diff --git a/TODO-Combo.md b/TODO-Combo.md index 37c286e3d2..3c37507d89 100644 --- a/TODO-Combo.md +++ b/TODO-Combo.md @@ -92,4 +92,3 @@ - Application shut down is broken with PersistentNotification (never shut down) and WearPlugin - Android logs it as crashed and restarts it, thereby restarting the app (or just keeping it alive, also causes errors with the DB as there were attemtps to open a closed DB instance/ref. - - [ ] Button on Combo tab to confirm any warning (if active)? diff --git a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java index c1ead296db..3d1e876e8c 100644 --- a/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java +++ b/ruffy-spi/src/main/java/de/jotomo/ruffy/spi/BasalProfile.java @@ -35,8 +35,12 @@ public class BasalProfile { @Override public String toString() { + double total = 0d; + for(int i = 0; i < 23; i++) { + total += hourlyRates[i]; + } return "BasalProfile{" + - "hourlyRates=" + Arrays.toString(hourlyRates) + + "hourlyRates=" + Arrays.toString(hourlyRates) + ", total " + total + " U" + '}'; } } diff --git a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java index 5c44fbf2c5..f9a291527a 100644 --- a/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java +++ b/ruffyscripter/src/main/java/de/jotomo/ruffyscripter/commands/SetBasalProfileCommand.java @@ -50,6 +50,7 @@ public class SetBasalProfileCommand extends BaseCommand { log.debug("Set basal profile, hour " + i + ": " + requestedRate); } + // move from hourly values to basal total scripter.pressCheckKey(); scripter.verifyMenuIsDisplayed(MenuType.BASAL_TOTAL); @@ -63,6 +64,9 @@ public class SetBasalProfileCommand extends BaseCommand { throw new CommandException("Basal total of " + pumpTotal + " differs from requested total of " + requestedTotal); } + // confirm entered basal rate + scripter.pressCheckKey(); + scripter.returnToRootMenu(); scripter.verifyRootMenuIsDisplayed(); @@ -76,7 +80,7 @@ public class SetBasalProfileCommand extends BaseCommand { if (Math.abs(currentRate - requestedRate) < 0.01) { return null; } - log.debug("Current rate: " + currentRate + " = requested => " + requestedRate); + log.debug("Current rate: " + currentRate + ", requested: " + requestedRate); double change = requestedRate - currentRate; long steps = Math.round(change * 100); boolean increasing = steps > 0;