From ba4f599242d7bcb145ba9f01bb4ecf8ec7c2d5d0 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 28 Jul 2020 13:51:03 +0200 Subject: [PATCH] include EB in statistics --- .../nightscout/androidaps/utils/stats/TddCalculator.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/stats/TddCalculator.kt b/app/src/main/java/info/nightscout/androidaps/utils/stats/TddCalculator.kt index 1f8338f7d8..6cecfa4f73 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/stats/TddCalculator.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/stats/TddCalculator.kt @@ -65,6 +65,13 @@ class TddCalculator @Inject constructor( val profile = profileFunction.getProfile(t) ?: continue val absoluteRate = tbr?.tempBasalConvertedToAbsolute(t, profile) ?: profile.getBasal(t) tdd.basal += absoluteRate / 60.0 * 5.0 + + if (!activePlugin.getActivePump().isFakingTempsByExtendedBoluses()) { + // they are not included in TBRs + val eb = getExtendedBolusFromHistory(t) + val absoluteEbRate = eb?.absoluteRate() ?: 0.0 + tdd.bolus += absoluteEbRate / 60.0 * 5.0 + } result.put(midnight, tdd) } for (i in 0 until result.size()) {