Minor improvements.
This commit is contained in:
parent
b85b6f85f4
commit
f03b9669d5
5 changed files with 16 additions and 8 deletions
|
@ -1,4 +1,6 @@
|
||||||
- [x] Bugs
|
- [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
|
- [-] 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
|
- 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());
|
- Ruffy logs in BTConnection:163 handler.fail("no connection possible: " + e.getMessage());
|
||||||
|
|
|
@ -23,6 +23,7 @@ public class ComboErrorHistoryDialog extends DialogFragment {
|
||||||
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
|
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
|
||||||
List<PumpError> errors = ComboPlugin.getPlugin().getPump().history.pumpErrorHistory;
|
List<PumpError> errors = ComboPlugin.getPlugin().getPump().history.pumpErrorHistory;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
// TODO i18n
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM. HH:mm");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM. HH:mm");
|
||||||
if (errors.isEmpty()) {
|
if (errors.isEmpty()) {
|
||||||
text.setText("To retrieve the error history from the pump, long press the Refresh button.");
|
text.setText("To retrieve the error history from the pump, long press the Refresh button.");
|
||||||
|
|
|
@ -23,6 +23,7 @@ public class ComboTddHistoryDialog extends DialogFragment {
|
||||||
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
|
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
|
||||||
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().history.tddHistory;
|
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().history.tddHistory;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
// TODO i18n
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.");
|
||||||
if (tdds.isEmpty()) {
|
if (tdds.isEmpty()) {
|
||||||
text.setText("To retrieve the TDD history from the pump, long press the Refresh button.");
|
text.setText("To retrieve the TDD history from the pump, long press the Refresh button.");
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rtDisplayHandleNoMenu() throws RemoteException {
|
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.
|
* Wait till a menu changed has completed, "away" from the menu provided as argument.
|
||||||
*/
|
*/
|
||||||
public void waitForMenuToBeLeft(MenuType menuType) {
|
public void waitForMenuToBeLeft(MenuType menuType) {
|
||||||
long timeout = System.currentTimeMillis() + 60 * 1000;
|
long timeout = System.currentTimeMillis() + 10 * 1000;
|
||||||
while (getCurrentMenu().getType() == menuType) {
|
while (getCurrentMenu().getType() == menuType) {
|
||||||
if (System.currentTimeMillis() > timeout) {
|
if (System.currentTimeMillis() > timeout) {
|
||||||
throw new CommandException("Timeout waiting for menu " + menuType + " to be left");
|
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) {
|
public void verifyMenuIsDisplayed(MenuType expectedMenu, String failureMessage) {
|
||||||
int retries = 600;
|
int attempts = 5;
|
||||||
while (getCurrentMenu().getType() != expectedMenu) {
|
while (getCurrentMenu().getType() != expectedMenu) {
|
||||||
if (retries > 0) {
|
attempts -= 1;
|
||||||
SystemClock.sleep(100);
|
if (attempts > 0) {
|
||||||
retries = retries - 1;
|
waitForScreenUpdate();
|
||||||
} else {
|
} else {
|
||||||
if (failureMessage == null) {
|
if (failureMessage == null) {
|
||||||
failureMessage = "Invalid pump state, expected to be in menu " + expectedMenu + ", but current menu is " + getCurrentMenuName();
|
failureMessage = "Invalid pump state, expected to be in menu " + expectedMenu + ", but current menu is " + getCurrentMenuName();
|
||||||
|
|
|
@ -10,7 +10,11 @@ public abstract class BaseCommand implements Command {
|
||||||
// RS will inject itself here
|
// RS will inject itself here
|
||||||
protected RuffyScripter scripter;
|
protected RuffyScripter scripter;
|
||||||
|
|
||||||
protected CommandResult result = new CommandResult();
|
protected CommandResult result;
|
||||||
|
|
||||||
|
public BaseCommand() {
|
||||||
|
result = new CommandResult();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setScripter(RuffyScripter scripter) {
|
public void setScripter(RuffyScripter scripter) {
|
||||||
|
|
Loading…
Reference in a new issue