This commit is contained in:
Milos Kozak 2019-12-28 21:45:17 +01:00
commit 05281b7e8b
2 changed files with 21 additions and 1 deletions

View file

@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder;
@ -613,6 +614,8 @@ public class MedtronicHistoryData {
return;
}
filterOutNonInsulinEntries(entriesFromHistory);
if (doubleBolusDebug)
LOG.debug("DoubleBolusDebug: List (after filter): {}, FromDb={}", gson.toJson(entryList),
gsonCore.toJson(entriesFromHistory));
@ -640,6 +643,23 @@ public class MedtronicHistoryData {
}
private void filterOutNonInsulinEntries(List<? extends DbObjectBase> entriesFromHistory) {
// when we try to pair PumpHistory with AAPS treatments, we need to ignore all non-insulin entries
List<DbObjectBase> removeList = new ArrayList<>();
for (DbObjectBase dbObjectBase : entriesFromHistory) {
Treatment treatment = (Treatment)dbObjectBase;
if (RileyLinkUtil.isSame(treatment.insulin, 0d)) {
removeList.add(dbObjectBase);
}
}
entriesFromHistory.removeAll(removeList);
}
private void processTBREntries(List<PumpHistoryEntry> entryList) {
Collections.reverse(entryList);

View file

@ -1542,7 +1542,7 @@
<string name="medtronic_error_rileylink_address_invalid">RileyLink Address invalid.</string>
<string name="medtronic_error_pump_type_set_differs_from_detected">Pump type detected is not the same as configured type.</string>
<string name="medtronic_error_pump_basal_profiles_not_enabled">Basal profiles are not enabled on pump.</string>
<string name="medtronic_error_pump_basal_profiles_not_enabled">Basal profiles/patterns setting is not enabled on pump. Enable it on the pump.</string>
<string name="medtronic_error_pump_incorrect_basal_profile_selected">Basal profile set on pump is incorrect (must be STD).</string>
<string name="medtronic_error_pump_wrong_tbr_type_set">Wrong TBR type set on pump (must be Absolute).</string>
<string name="medtronic_error_pump_wrong_max_bolus_set">Wrong Max Bolus set on Pump (must be %1$.2f).</string>