Check active menu again when retrying inputs.

This commit is contained in:
Johannes Mockenhaupt 2017-07-18 10:24:45 +02:00
parent abf9566476
commit 3b287df77d
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 4 additions and 0 deletions

View file

@ -100,6 +100,7 @@ public class BolusCommand implements Command {
}
private void inputBolusAmount(RuffyScripter scripter) {
scripter.verifyMenuIsDisplayed(MenuType.BOLUS_ENTER);
// press 'up' once for each 0.1 U increment
long steps = Math.round(bolus * 10);
for (int i = 0; i < steps; i++) {
@ -110,6 +111,7 @@ public class BolusCommand implements Command {
}
private void verifyDisplayedBolusAmount(RuffyScripter scripter) {
scripter.verifyMenuIsDisplayed(MenuType.BOLUS_ENTER);
double displayedBolus = readDisplayedBolusAmount(scripter);
log.debug("Final bolus: " + displayedBolus);
if (Math.abs(displayedBolus - bolus) > 0.05) {

View file

@ -157,6 +157,7 @@ public class SetTbrCommand implements Command {
}
private void verifyDisplayedTbrPercentage(RuffyScripter scripter) {
scripter.verifyMenuIsDisplayed(MenuType.TBR_SET);
long displayedPercentage = readDisplayedTbrPercentage(scripter);
if (displayedPercentage != this.percentage) {
log.debug("Final displayed TBR percentage: " + displayedPercentage);
@ -176,6 +177,7 @@ public class SetTbrCommand implements Command {
}
private void inputTbrDuration(RuffyScripter scripter) {
scripter.verifyMenuIsDisplayed(MenuType.TBR_DURATION);
long currentDuration = readDisplayedTbrDuration(scripter);
if (currentDuration % 15 != 0) {
// The duration displayed is how long an active TBR will still run,