Merge branch 'dev' of https://github.com/MilosKozak/AndroidAPS into dev
This commit is contained in:
commit
05281b7e8b
|
@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.TemporaryBasal;
|
||||||
import info.nightscout.androidaps.logging.L;
|
import info.nightscout.androidaps.logging.L;
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage;
|
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.DateTimeUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder;
|
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder;
|
||||||
|
@ -613,6 +614,8 @@ public class MedtronicHistoryData {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterOutNonInsulinEntries(entriesFromHistory);
|
||||||
|
|
||||||
if (doubleBolusDebug)
|
if (doubleBolusDebug)
|
||||||
LOG.debug("DoubleBolusDebug: List (after filter): {}, FromDb={}", gson.toJson(entryList),
|
LOG.debug("DoubleBolusDebug: List (after filter): {}, FromDb={}", gson.toJson(entryList),
|
||||||
gsonCore.toJson(entriesFromHistory));
|
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) {
|
private void processTBREntries(List<PumpHistoryEntry> entryList) {
|
||||||
|
|
||||||
Collections.reverse(entryList);
|
Collections.reverse(entryList);
|
||||||
|
|
|
@ -1542,7 +1542,7 @@
|
||||||
<string name="medtronic_error_rileylink_address_invalid">RileyLink Address invalid.</string>
|
<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_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_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_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>
|
<string name="medtronic_error_pump_wrong_max_bolus_set">Wrong Max Bolus set on Pump (must be %1$.2f).</string>
|
||||||
|
|
Loading…
Reference in a new issue