Add experimental option to avoid one vibration after bolusing.
(cherry picked from commit 104777c)
This commit is contained in:
parent
9649682ae3
commit
21a37c9247
|
@ -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");
|
||||||
|
|
||||||
|
if (Config.comboExperimentalFeatures) {
|
||||||
|
// returning to main menu using the 'back' key should not cause a vibration
|
||||||
|
// 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
|
// leave menu to go back to main menu
|
||||||
scripter.pressCheckKey();
|
scripter.pressCheckKey();
|
||||||
scripter.waitForMenuToBeLeft(MenuType.BOLUS_DATA);
|
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.");
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue