Small robustness improvements.

This commit is contained in:
Johannes Mockenhaupt 2017-11-24 23:03:34 +01:00
parent a95a00377b
commit 5e79900411
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 4 additions and 3 deletions

View file

@ -219,7 +219,6 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
@Override
public synchronized int setNewBasalProfile(Profile profile) {
if (!isInitialized()) {
log.error("setNewBasalProfile not initialized");
Notification notification = new Notification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, MainApp.sResources.getString(R.string.pumpNotInitializedProfileNotSet), Notification.URGENT);
@ -234,6 +233,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
return PumpInterface.NOT_NEEDED;
}
CommandResult setResult = runCommand(MainApp.sResources.getString(R.string.combo_activity_setting_basal_profile), 2,
() -> ruffyScripter.setBasalProfile(requestedBasalProfile));
if (!setResult.success) {

View file

@ -16,6 +16,7 @@ public class ReadBasalProfileCommand extends BaseCommand {
@Override
public void execute() {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.BASAL_1_MENU);
scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU);
scripter.pressCheckKey();

View file

@ -37,6 +37,7 @@ public class ReadHistoryCommand extends BaseCommand {
if (request.bolusHistory != PumpHistoryRequest.SKIP
|| request.tbrHistory != PumpHistoryRequest.SKIP
|| request.pumpErrorHistory != PumpHistoryRequest.SKIP) {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.MY_DATA_MENU);
scripter.verifyMenuIsDisplayed(MenuType.MY_DATA_MENU);
scripter.pressCheckKey();

View file

@ -25,6 +25,7 @@ public class SetBasalProfileCommand extends BaseCommand {
@Override
public void execute() {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.BASAL_1_MENU);
scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU);
scripter.pressCheckKey();
@ -66,8 +67,6 @@ public class SetBasalProfileCommand extends BaseCommand {
// confirm entered basal rate
scripter.pressCheckKey();
scripter.returnToRootMenu();
scripter.verifyRootMenuIsDisplayed();
result.success(true).basalProfile(basalProfile);