block if no profile switch is set
This commit is contained in:
parent
d155616c0b
commit
59a1e007ad
|
@ -287,6 +287,17 @@ public class CommandQueue {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check that there is a valid profileSwitch NOW
|
||||||
|
if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) {
|
||||||
|
Notification noProfileSwitchNotif = new Notification(Notification.PROFILE_SWITCH_MISSING, MainApp.sResources.getString(R.string.profileswitch_missing), Notification.NORMAL);
|
||||||
|
MainApp.bus().post(new EventNewNotification(noProfileSwitchNotif));
|
||||||
|
if (callback != null) {
|
||||||
|
PumpEnactResult result = new PumpEnactResult().success(false).enacted(false).comment("Refuse to send profile to pump! No ProfileSwitch!");
|
||||||
|
callback.result(result).run();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Compare with pump limits
|
// Compare with pump limits
|
||||||
Profile.BasalValue[] basalValues = profile.getBasalValues();
|
Profile.BasalValue[] basalValues = profile.getBasalValues();
|
||||||
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||||
|
|
Loading…
Reference in a new issue