diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 413f4f8401..b472b11c22 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -6,9 +6,7 @@ import android.os.SystemClock; import org.monkey.d.ruffy.ruffy.driver.IRTHandler; import org.monkey.d.ruffy.ruffy.driver.IRuffyService; import org.monkey.d.ruffy.ruffy.driver.display.Menu; -import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute; import org.monkey.d.ruffy.ruffy.driver.display.MenuType; -import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -124,7 +122,9 @@ public class RuffyScripter { // TODO hackish, to say the least ... // wait till pump is ready for input waitForMenuUpdate(); - logPumpStatus(); + // TODO check pump state; currently most command check their in the MAIN_MENU; + // run ReadStateCommand, which handles possible states ... and then do wait? + // Return an unsuccessful CommandResult and make the caller do something loud with it log.debug("Cmd execution: connection ready, executing cmd " + cmd); cmdThread = new Thread(new Runnable() { @Override @@ -167,28 +167,6 @@ public class RuffyScripter { } } - private void logPumpStatus() { - log.debug("Pump status:"); - MenuType currentMenuType = currentMenu.getType(); - if (currentMenuType == MenuType.MAIN_MENU) { - Double tbrPercentage = (Double) currentMenu.getAttribute(MenuAttribute.TBR); - if (tbrPercentage != 100) { - MenuTime durationMenuTime = ((MenuTime) currentMenu.getAttribute(MenuAttribute.RUNTIME)); - long durationRemainging = durationMenuTime.getHour() * 60 + durationMenuTime.getMinute(); - log.debug(" TBR active: " + tbrPercentage + "%/" + durationRemainging + "m remaining"); - } else { - log.debug(" TBR active: no"); - } - } else { - log.warn(" !!! Pump is on unexpected screen " + currentMenuType + " !!!"); - log.warn(" Dumping all displayed attributes:"); - for (MenuAttribute menuAttribute : currentMenu.attributes()) { - log.warn(" " + menuAttribute + ": " + currentMenu.getAttribute(menuAttribute)); - } - - } - } - public void ensureConnected() { // did we get a menu update from the pump in the last 5s? Then we're connected if (currentMenu != null && menuLastUpdated + 5000 > System.currentTimeMillis()) {