a little safer<
This commit is contained in:
parent
398e950f8e
commit
02369b952b
1 changed files with 10 additions and 8 deletions
|
@ -733,17 +733,19 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
|
||||||
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
|
profileSwitch.isCPP = percentage != 100 || timeshift != 0;
|
||||||
profileSwitch.timeshift = timeshift;
|
profileSwitch.timeshift = timeshift;
|
||||||
profileSwitch.percentage = percentage;
|
profileSwitch.percentage = percentage;
|
||||||
}
|
MainApp.getConfigBuilder().addToHistoryProfileSwitch(profileSwitch);
|
||||||
MainApp.getConfigBuilder().addToHistoryProfileSwitch(profileSwitch);
|
|
||||||
|
|
||||||
PumpInterface pump = MainApp.getConfigBuilder();
|
PumpInterface pump = MainApp.getConfigBuilder();
|
||||||
if (pump != null) {
|
if (pump != null) {
|
||||||
pump.setNewBasalProfile(profileSwitch.getProfileObject());
|
pump.setNewBasalProfile(profileSwitch.getProfileObject());
|
||||||
MainApp.bus().post(new EventNewBasalProfile());
|
MainApp.bus().post(new EventNewBasalProfile());
|
||||||
|
} else {
|
||||||
|
log.error("No active pump selected");
|
||||||
|
}
|
||||||
|
Answers.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
|
||||||
} else {
|
} else {
|
||||||
log.error("No active pump selected");
|
log.error("No profile switch existing");
|
||||||
}
|
}
|
||||||
Answers.getInstance().logCustom(new CustomEvent("ProfileSwitch"));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue