From be252c937417939f1661bc5db9e1fc5bc315dde7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 15 Apr 2019 16:47:42 +0200 Subject: [PATCH] Clear basalDataTable on significant change --- .../plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.java index 39982010ae..4897ff55ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.java @@ -630,6 +630,7 @@ public class IobCobCalculatorPlugin extends PluginBase { log.debug("Invalidating cached data because of new profile. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records"); iobTable = new LongSparseArray<>(); autosensDataTable = new LongSparseArray<>(); + basalDataTable = new LongSparseArray<>(); } runCalculation("onNewProfile", System.currentTimeMillis(), false, true, ev); } @@ -652,9 +653,10 @@ public class IobCobCalculatorPlugin extends PluginBase { stopCalculation("onEventPreferenceChange"); synchronized (dataLock) { if (L.isEnabled(L.AUTOSENS)) - log.debug("Invalidating cached data because of preference change. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records"); + log.debug("Invalidating cached data because of preference change. IOB: " + iobTable.size() + " Autosens: " + autosensDataTable.size() + " records" + " BasalData: " + basalDataTable.size() + " records"); iobTable = new LongSparseArray<>(); autosensDataTable = new LongSparseArray<>(); + basalDataTable = new LongSparseArray<>(); } runCalculation("onEventPreferenceChange", System.currentTimeMillis(), false, true, ev); } @@ -730,6 +732,7 @@ public class IobCobCalculatorPlugin extends PluginBase { log.debug("Clearing cached data."); iobTable = new LongSparseArray<>(); autosensDataTable = new LongSparseArray<>(); + basalDataTable = new LongSparseArray<>(); } }