Set Source.PUMP when setting/cancelling TBR.
While technically, the history isn't read, we can be reasonably sure a TBR was set/cancelled by reading the main menu (and for TBR starts that's the only way to do so). Reading the history might cause (more) problems with the pump's minute-precision and not yield much safety. Besides, command mode is expected to take over yesterday. (cherry picked from commit 04fb1c8)
This commit is contained in:
parent
383750d5e8
commit
dc6c91fd87
|
@ -627,7 +627,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
tempStart.durationInMinutes = durationInMinutes;
|
tempStart.durationInMinutes = durationInMinutes;
|
||||||
tempStart.percentRate = adjustedPercent;
|
tempStart.percentRate = adjustedPercent;
|
||||||
tempStart.isAbsolute = false;
|
tempStart.isAbsolute = false;
|
||||||
tempStart.source = Source.USER;
|
tempStart.source = Source.PUMP;
|
||||||
tempStart.pumpId = tempStart.date;
|
tempStart.pumpId = tempStart.date;
|
||||||
ConfigBuilderPlugin treatmentsInterface = MainApp.getConfigBuilder();
|
ConfigBuilderPlugin treatmentsInterface = MainApp.getConfigBuilder();
|
||||||
treatmentsInterface.addToHistoryTempBasal(tempStart);
|
treatmentsInterface.addToHistoryTempBasal(tempStart);
|
||||||
|
@ -658,7 +658,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
TemporaryBasal tempBasal = new TemporaryBasal();
|
TemporaryBasal tempBasal = new TemporaryBasal();
|
||||||
tempBasal.date = commandResult.state.timestamp;
|
tempBasal.date = commandResult.state.timestamp;
|
||||||
tempBasal.durationInMinutes = 0;
|
tempBasal.durationInMinutes = 0;
|
||||||
tempBasal.source = Source.USER;
|
tempBasal.source = Source.PUMP;
|
||||||
tempBasal.pumpId = activeTemp.pumpId;
|
tempBasal.pumpId = activeTemp.pumpId;
|
||||||
MainApp.getConfigBuilder().addToHistoryTempBasal(tempBasal);
|
MainApp.getConfigBuilder().addToHistoryTempBasal(tempBasal);
|
||||||
return new PumpEnactResult().isTempCancel(true).success(true).enacted(true);
|
return new PumpEnactResult().isTempCancel(true).success(true).enacted(true);
|
||||||
|
@ -684,7 +684,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
TemporaryBasal tempBasal = new TemporaryBasal();
|
TemporaryBasal tempBasal = new TemporaryBasal();
|
||||||
tempBasal.date = System.currentTimeMillis() / (60 * 1000) * (60 * 1000);
|
tempBasal.date = System.currentTimeMillis() / (60 * 1000) * (60 * 1000);
|
||||||
tempBasal.durationInMinutes = 15;
|
tempBasal.durationInMinutes = 15;
|
||||||
tempBasal.source = Source.USER;
|
tempBasal.source = Source.PUMP;
|
||||||
tempBasal.pumpId = tempBasal.date;
|
tempBasal.pumpId = tempBasal.date;
|
||||||
tempBasal.percentRate = percentage;
|
tempBasal.percentRate = percentage;
|
||||||
tempBasal.isAbsolute = false;
|
tempBasal.isAbsolute = false;
|
||||||
|
|
Loading…
Reference in a new issue