- added check before bolus is attempted, if we have enough in reservoir (from local info, we don't query the pump,

while this might not always be 100% correct, it is updated every hour (if under 50 U and every 4h if over
50U and every 15 minutes if under 20U, so it should be accurate, information is not accurate only if you cancel bolus midway...
This commit is contained in:
Andy Rozman 2019-08-12 17:20:38 +01:00
parent 5b4a88ed1b
commit a1bbf29230
2 changed files with 12 additions and 0 deletions

View file

@ -791,6 +791,17 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
setRefreshButtonEnabled(false);
MedtronicPumpStatus mdtPumpStatus = getMDTPumpStatus();
if (detailedBolusInfo.insulin > mdtPumpStatus.reservoirRemainingUnits) {
return new PumpEnactResult() //
.success(false) //
.enacted(false) //
.comment(MainApp.gs(R.string.medtronic_cmd_bolus_could_not_be_delivered_no_insulin,
mdtPumpStatus.reservoirRemainingUnits,
detailedBolusInfo.insulin));
}
bolusDeliveryType = BolusDeliveryType.DeliveryPrepared;
if (isPumpNotReachable()) {

View file

@ -1637,6 +1637,7 @@
<string name="medtronic_cmd_cant_cancel_tbr_stop_op">Could not cancel current TBR. Stopping operation.</string>
<string name="medtronic_cmd_set_profile_pattern_overflow">Profile set failed, because following patterns, have too big basal rate: %1$s</string>
<string name="medtronic_cmd_bolus_could_not_be_delivered">Bolus could not be delivered.</string>
<string name="medtronic_cmd_bolus_could_not_be_delivered_no_insulin">Bolus could not be delivered, because available amount (%1$d) is less than Bolus required (%2$d).</string>
<string name="medtronic_cmd_tbr_could_not_be_delivered">TBR could not be set.</string>
<string name="medtronic_cmd_cant_cancel_tbr">Could not cancel current TBR.</string>
<string name="medtronic_cmd_basal_profile_could_not_be_set">Basal profile could not be set.</string>