Fix taking over low* alerts on connect.

This commit is contained in:
Johannes Mockenhaupt 2017-11-22 20:23:59 +01:00
parent f3bbf861f3
commit 1897051782
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -226,7 +226,7 @@ public class RuffyScripter implements RuffyCommands {
while (menuType != MenuType.MAIN_MENU && menuType != MenuType.STOP && menuType != MenuType.WARNING_OR_ERROR) { while (menuType != MenuType.MAIN_MENU && menuType != MenuType.STOP && menuType != MenuType.WARNING_OR_ERROR) {
log.debug("Going back to main menu, currently at " + menuType); log.debug("Going back to main menu, currently at " + menuType);
pressBackKey(); pressBackKey();
while(getCurrentMenu().getType() == menuType) { while (getCurrentMenu().getType() == menuType) {
waitForScreenUpdate(); waitForScreenUpdate();
} }
menuType = getCurrentMenu().getType(); menuType = getCurrentMenu().getType();
@ -263,10 +263,12 @@ public class RuffyScripter implements RuffyCommands {
activeCmd.getResult().success = false; activeCmd.getResult().success = false;
return; return;
} }
} else if (getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR && !(cmd instanceof ConfirmAlertCommand)) { } else if (getCurrentMenu().getType() == MenuType.WARNING_OR_ERROR) {
log.warn("Warning/alert active on pump, but requested command is not ConfirmAlertCommand"); if (!(cmd instanceof ConfirmAlertCommand)) {
activeCmd.getResult().success = false; log.warn("Warning/alert active on pump, but requested command is not ConfirmAlertCommand");
return; // active alert is returned as part of PumpState activeCmd.getResult().success = false;
return; // active alert is returned as part of PumpState
}
} else if (getCurrentMenu().getType() != MenuType.MAIN_MENU) { } else if (getCurrentMenu().getType() != MenuType.MAIN_MENU) {
log.debug("Pump is unexpectedly not on main menu but " + getCurrentMenuName()); log.debug("Pump is unexpectedly not on main menu but " + getCurrentMenuName());
activeCmd.getResult().success = false; activeCmd.getResult().success = false;