Add experimental option to avoid one vibration after bolusing.

(cherry picked from commit 104777c)
This commit is contained in:
Johannes Mockenhaupt 2017-08-30 15:11:24 +02:00
parent 9649682ae3
commit 21a37c9247
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 21 additions and 5 deletions

View file

@ -11,6 +11,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import info.nightscout.androidaps.Config;
public class BolusCommand extends BaseCommand { public class BolusCommand extends BaseCommand {
private static final Logger log = LoggerFactory.getLogger(BolusCommand.class); private static final Logger log = LoggerFactory.getLogger(BolusCommand.class);
@ -96,9 +98,20 @@ public class BolusCommand extends BaseCommand {
} }
log.debug("Bolus record in history confirms delivered bolus"); log.debug("Bolus record in history confirms delivered bolus");
// leave menu to go back to main menu if (Config.comboExperimentalFeatures) {
scripter.pressCheckKey(); // returning to main menu using the 'back' key should not cause a vibration
scripter.waitForMenuToBeLeft(MenuType.BOLUS_DATA); // TODO this is too brute-force; at least check for WARNING_OR_ERROR menu type
do {
log.debug("Going back to main menu, currently at " + scripter.getCurrentMenu().getType());
scripter.pressBackKey();
scripter.waitForMenuUpdate();
} while (scripter.getCurrentMenu().getType() != MenuType.MAIN_MENU);
} else {
// leave menu to go back to main menu
scripter.pressCheckKey();
scripter.waitForMenuToBeLeft(MenuType.BOLUS_DATA);
}
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU, scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU,
"Bolus was correctly delivered and checked against history, but we " "Bolus was correctly delivered and checked against history, but we "
+ "did not return the main menu successfully."); + "did not return the main menu successfully.");

View file

@ -49,11 +49,14 @@ public class Config {
public static final boolean logDanaSerialEngine = true; public static final boolean logDanaSerialEngine = true;
// Combo specific // Combo specific
// TODO try turning this into preferences
public static final boolean comboExperimentalFeatures = true;
/** enable the UNFINISHED and currently BROKEN bolus cammand that reports progress and can be cancelled */ /** enable the UNFINISHED and currently BROKEN bolus cammand that reports progress and can be cancelled */
public static final boolean comboExperimentalBolus = false; public static final boolean comboExperimentalBolus = false && comboExperimentalFeatures;
/** Very quick hack to split up bolus into 2 U parts, spaced roughly 45s apart. /** Very quick hack to split up bolus into 2 U parts, spaced roughly 45s apart.
* If there's an error during bolusing, no record is created in AAPS. * If there's an error during bolusing, no record is created in AAPS.
* Don't combine with experimental bolus! */ * Don't combine with experimental bolus! */
public static final boolean comboExperimentalSplitBoluses = false && !comboExperimentalBolus; public static final boolean comboExperimentalSplitBoluses = false && comboExperimentalFeatures && !comboExperimentalBolus;
} }