From 9ee329b7dbdc862cbeafe149cc302f8775b3b453 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 13 Oct 2018 11:40:19 +0200 Subject: [PATCH] log bucketed_data(0) --- .../plugins/IobCobCalculator/IobCobCalculatorPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index eee0d95bc7..1c851396eb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -231,13 +231,15 @@ public class IobCobCalculatorPlugin extends PluginBase { bucketed_data = new ArrayList<>(); bucketed_data.add(bgReadings.get(0)); + if (L.isEnabled(L.AUTOSENS)) + log.debug("Adding. bgTime: " + DateUtil.toISOString(bgReadings.get(0).date) + " lastbgTime: " + "none-first-value" + " " + bgReadings.get(0).toString()); int j = 0; for (int i = 1; i < bgReadings.size(); ++i) { long bgTime = bgReadings.get(i).date; long lastbgTime = bgReadings.get(i - 1).date; //log.error("Processing " + i + ": " + new Date(bgTime).toString() + " " + bgReadings.get(i).value + " Previous: " + new Date(lastbgTime).toString() + " " + bgReadings.get(i - 1).value); if (bgReadings.get(i).value < 39 || bgReadings.get(i - 1).value < 39) { - continue; + throw new IllegalStateException("<39"); } long elapsed_minutes = (bgTime - lastbgTime) / (60 * 1000);