Simplify reading alerts (message doesn't blink)

This commit is contained in:
Johannes Mockenhaupt 2017-07-15 16:14:38 +02:00
parent e01e85c54f
commit 4ff81e885c
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -347,16 +347,11 @@ public class RuffyScripter {
public PumpAlert readDisplayPumpAlert() {
Object errorObj = currentMenu.getAttribute(MenuAttribute.ERROR);
Object errorMsgObj = currentMenu.getAttribute(MenuAttribute.MESSAGE);
while (errorObj == null) {
SystemClock.sleep(10);
errorObj = currentMenu.getAttribute(MenuAttribute.ERROR);
errorMsgObj = currentMenu.getAttribute(MenuAttribute.MESSAGE);
}
while (errorMsgObj == null) {
SystemClock.sleep(10);
errorMsgObj = currentMenu.getAttribute(MenuAttribute.MESSAGE);
}
return new PumpAlert((int) errorObj, (String) errorMsgObj);
String errorMsg = (String) currentMenu.getAttribute(MenuAttribute.MESSAGE);
return new PumpAlert((int) errorObj, errorMsg);
}
}