diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/RuffyScripter.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/RuffyScripter.java index b8b818e758..2066244d3a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/RuffyScripter.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/RuffyScripter.java @@ -488,7 +488,7 @@ public class RuffyScripter { if (System.currentTimeMillis() > timeout) { throw new CommandException().message("Unable to read current menu"); } - log.error("currentMenu == null, waiting"); + log.debug("currentMenu == null, waiting"); waitForMenuUpdate(); } return currentMenu; @@ -634,10 +634,10 @@ public class RuffyScripter { } public void navigateToMenu(MenuType desiredMenu) { - MenuType startedFrom = currentMenu.getType(); + MenuType startedFrom = getCurrentMenu().getType(); boolean movedOnce = false; - while (currentMenu.getType() != desiredMenu) { - MenuType currentMenuType = currentMenu.getType(); + while (getCurrentMenu().getType() != desiredMenu) { + MenuType currentMenuType = getCurrentMenu().getType(); log.debug("Navigating to menu " + desiredMenu + ", currenty menu: " + currentMenuType); if (movedOnce && currentMenuType == startedFrom) { throw new CommandException().message("Menu not found searching for " + desiredMenu @@ -652,7 +652,7 @@ public class RuffyScripter { /** 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; - while (currentMenu.getType() == menuType) { + while (getCurrentMenu().getType() == menuType) { if (System.currentTimeMillis() > timeout) { throw new CommandException().message("Timeout waiting for menu " + menuType + " to be left"); } @@ -666,7 +666,7 @@ public class RuffyScripter { public void verifyMenuIsDisplayed(MenuType expectedMenu, String failureMessage) { int retries = 600; - while (currentMenu.getType() != expectedMenu) { + while (getCurrentMenu().getType() != expectedMenu) { if (retries > 0) { SystemClock.sleep(100); retries = retries - 1; @@ -682,9 +682,9 @@ public class RuffyScripter { @SuppressWarnings("unchecked") public T readBlinkingValue(Class expectedType, MenuAttribute attribute) { int retries = 5; - Object value = currentMenu.getAttribute(attribute); + Object value = getCurrentMenu().getAttribute(attribute); while (!expectedType.isInstance(value)) { - value = currentMenu.getAttribute(attribute); + value = getCurrentMenu().getAttribute(attribute); waitForScreenUpdate(1000); retries--; if (retries == 0) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/BaseCommand.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/BaseCommand.java index 1a145c3efc..d47f654660 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/BaseCommand.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/BaseCommand.java @@ -1,10 +1,5 @@ package info.nightscout.androidaps.plugins.PumpCombo.scripter.commands; -import android.os.SystemClock; - -import org.monkey.d.ruffy.ruffy.driver.display.MenuAttribute; -import org.monkey.d.ruffy.ruffy.driver.display.MenuType; - import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter; public abstract class BaseCommand implements Command { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/ExperimentalBolusCommand.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/ExperimentalBolusCommand.java index d493d95433..edd5827286 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/ExperimentalBolusCommand.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/scripter/commands/ExperimentalBolusCommand.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import info.nightscout.androidaps.plugins.PumpCombo.scripter.PumpState; import info.nightscout.androidaps.plugins.PumpCombo.scripter.RuffyScripter; import static info.nightscout.androidaps.plugins.PumpCombo.scripter.commands.ExperimentalBolusCommand.ProgressReportCallback.State.DELIVERED;