Combo: update timestampOfLastKnownPumpBolusRecord after bolusing.

This commit is contained in:
Johannes Mockenhaupt 2018-02-02 11:50:00 +01:00
parent 1f06d801a2
commit a07a4beaf8
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -565,7 +565,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
return new PumpEnactResult().success(false).enacted(true)
.comment(MainApp.gs(R.string.combo_error_updating_treatment_record));
// partial bolus was delivered
timestampOfLastKnownPumpBolusRecord = lastPumpBolus.timestamp;
// only a partial bolus was delivered
if (Math.abs(lastPumpBolus.amount - detailedBolusInfo.insulin) > 0.01) {
if (cancelBolus) {
return new PumpEnactResult().success(true).enacted(true);
@ -1119,8 +1121,6 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
return null;
}
// TODO still regularly continues even though no changes on pump exist ...
// OPTIMIZE this reads the entire history on start, so this could be optimized by persisting
// `timestampOfLastKnownPumpBolusRecord`, though this should be thought through, to make sure
// all scenarios are covered