Minor improvements.

This commit is contained in:
Johannes Mockenhaupt 2017-11-18 14:33:02 +01:00
parent b85b6f85f4
commit f03b9669d5
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
5 changed files with 16 additions and 8 deletions

View file

@ -1,4 +1,6 @@
- [x] Bugs
- [x] ruffy: Accessing the quick info menu yields noMenu when cartridge is low
- [x] ruffy: Multi-digit error codes in error history aren't supported
- [-] No connection can be established anymore; ruffy issue i can't solve
- Removing the BT device's bonding (!=pairing) fixes it; nope it doesn't
- Ruffy logs in BTConnection:163 handler.fail("no connection possible: " + e.getMessage());

View file

@ -23,6 +23,7 @@ public class ComboErrorHistoryDialog extends DialogFragment {
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
List<PumpError> errors = ComboPlugin.getPlugin().getPump().history.pumpErrorHistory;
StringBuilder sb = new StringBuilder();
// TODO i18n
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM. HH:mm");
if (errors.isEmpty()) {
text.setText("To retrieve the error history from the pump, long press the Refresh button.");

View file

@ -23,6 +23,7 @@ public class ComboTddHistoryDialog extends DialogFragment {
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().history.tddHistory;
StringBuilder sb = new StringBuilder();
// TODO i18n
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.");
if (tdds.isEmpty()) {
text.setText("To retrieve the TDD history from the pump, long press the Refresh button.");

View file

@ -117,7 +117,7 @@ public class RuffyScripter implements RuffyCommands {
@Override
public void rtDisplayHandleNoMenu() throws RemoteException {
log.debug("rtDisplayHandleNoMenu callback invoked");
log.warn("rtDisplayHandleNoMenu callback invoked");
}
};
@ -635,12 +635,12 @@ public class RuffyScripter implements RuffyCommands {
* Wait till a menu changed has completed, "away" from the menu provided as argument.
*/
public void waitForMenuToBeLeft(MenuType menuType) {
long timeout = System.currentTimeMillis() + 60 * 1000;
long timeout = System.currentTimeMillis() + 10 * 1000;
while (getCurrentMenu().getType() == menuType) {
if (System.currentTimeMillis() > timeout) {
throw new CommandException("Timeout waiting for menu " + menuType + " to be left");
}
SystemClock.sleep(10);
waitForScreenUpdate();
}
}
@ -649,11 +649,11 @@ public class RuffyScripter implements RuffyCommands {
}
public void verifyMenuIsDisplayed(MenuType expectedMenu, String failureMessage) {
int retries = 600;
int attempts = 5;
while (getCurrentMenu().getType() != expectedMenu) {
if (retries > 0) {
SystemClock.sleep(100);
retries = retries - 1;
attempts -= 1;
if (attempts > 0) {
waitForScreenUpdate();
} else {
if (failureMessage == null) {
failureMessage = "Invalid pump state, expected to be in menu " + expectedMenu + ", but current menu is " + getCurrentMenuName();

View file

@ -10,7 +10,11 @@ public abstract class BaseCommand implements Command {
// RS will inject itself here
protected RuffyScripter scripter;
protected CommandResult result = new CommandResult();
protected CommandResult result;
public BaseCommand() {
result = new CommandResult();
}
@Override
public void setScripter(RuffyScripter scripter) {