From ec188f13293008f9529f6288c99f97dc6c8395ee Mon Sep 17 00:00:00 2001 From: Tim Gunn <2896311+Tornado-Tim@users.noreply.github.com> Date: Mon, 1 Jun 2020 12:14:45 +1200 Subject: [PATCH] revert change --- .../iob/iobCobCalculator/IobCobCalculatorPlugin.java | 8 +++++++- 1 file changed, 7 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 f991661f9c..7720ff4afb 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 @@ -722,6 +722,13 @@ public class IobCobCalculatorPlugin extends PluginBase implements IobCobCalculat result.boluses += treatment.insulin; } } + if (t > absorptionTime_ago && t <= now) { + if (treatment.carbs >= 1) { + result.carbs += treatment.carbs; + if (t > result.lastCarbTime) + result.lastCarbTime = t; + } + } } AutosensData autosensData = getLastAutosensDataSynchronized("getMealData()"); @@ -731,7 +738,6 @@ public class IobCobCalculatorPlugin extends PluginBase implements IobCobCalculat result.slopeFromMaxDeviation = autosensData.slopeFromMaxDeviation; result.usedMinCarbsImpact = autosensData.usedMinCarbsImpact; } - result.lastCarbTime = treatmentsPlugin.getLastCarbTime(); result.lastBolusTime = treatmentsPlugin.getLastBolusTime(); return result; }