Save Last Bolus

This commit is contained in:
Philoul 2022-01-30 18:19:51 +01:00
parent ecefcdf9c2
commit 72fc2f3a54
3 changed files with 7 additions and 1 deletions

View file

@ -289,7 +289,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick
if (cartridgeStatus == null) return;
String status;
if (cartridgeStatus.isInserted())
status = DecimalFormatter.INSTANCE.to2Decimal(localInsightPlugin.getCartridgeStatus().getRemainingAmount()) + "U";
status = DecimalFormatter.INSTANCE.to2Decimal(cartridgeStatus.getRemainingAmount()) + "U";
else status = rh.gs(R.string.not_inserted);
statusItems.add(getStatusItem(rh.gs(R.string.reservoir_label), status));
}

View file

@ -232,6 +232,8 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai
pumpDescription = new PumpDescription();
pumpDescription.fillFor(PumpType.ACCU_CHEK_INSIGHT);
lastBolusTimestamp = sp.getLong(R.string.key_insight_lastbolustimestamp,0L);
lastBolusAmount = sp.getDouble(R.string.key_insight_lastbolusamount, 0.0);
}
public TBROverNotificationBlock getTBROverNotificationBlock() {
@ -1442,7 +1444,9 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai
PumpType.ACCU_CHEK_INSIGHT,
serial);
lastBolusTimestamp = bolusID.getTimestamp();
sp.putLong(R.string.key_insight_lastbolustimestamp,lastBolusTimestamp);
lastBolusAmount = event.getImmediateAmount();
sp.putDouble(R.string.key_insight_lastbolusamount, lastBolusAmount);
}
if (event.getBolusType() == BolusType.EXTENDED || event.getBolusType() == BolusType.MULTIWAVE) {
if (event.getDuration() > 0 && profileFunction.getProfile(bolusID.getTimestamp()) != null)

View file

@ -47,6 +47,8 @@
<string name="key_insight_min_recovery_duration" translatable="false">insight_min_recovery_duration</string>
<string name="key_insight_max_recovery_duration" translatable="false">insight_max_recovery_duration</string>
<string name="key_insight_disconnect_delay" translatable="false">insight_disconnect_delay</string>
<string name="key_insight_lastbolusamount" translatable="false">insight_lastbolusamount</string>
<string name="key_insight_lastbolustimestamp" translatable="false">insight_lastbolustimestamp</string>
<string name="disable_vibration_auto">Disable vibrations on automated bolus delivery</string>
<string name="disable_vibration_auto_summary">For SMB and Temp Basal with TBR emulation (only available with Insight firmware 3.x)</string>
<string name="timeout_during_handshake">Timeout during handshake - reset bluetooth</string>