From 035e9742afea1452d402ab1f17774af12bbd1cb3 Mon Sep 17 00:00:00 2001 From: t_j_s Date: Sun, 20 Feb 2022 15:58:06 +0000 Subject: [PATCH] Use of calculation step reverted back to value / 60 * 5, as calculation step method was producing incorrect, very large numbers. --- .../nightscout/androidaps/utils/stats/TddCalculator.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 fc7cfe2bb0..34663d0800 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 @@ -103,13 +103,13 @@ class TddCalculator @Inject constructor( val tbr = iobCobCalculator.getTempBasalIncludingConvertedExtended(t) val profile = profileFunction.getProfile(t) ?: continue val absoluteRate = tbr?.convertedToAbsolute(t, profile) ?: profile.getBasal(t) - tdd.basalAmount += absoluteRate / T.mins(5).msecs().toDouble() * calculationStep.toDouble() + tdd.basalAmount += absoluteRate / 60.0 * 5.0 if (!activePlugin.activePump.isFakingTempsByExtendedBoluses) { // they are not included in TBRs val eb = iobCobCalculator.getExtendedBolus(t) val absoluteEbRate = eb?.rate ?: 0.0 - tdd.bolusAmount += absoluteEbRate / T.mins(5).msecs().toDouble() * calculationStep.toDouble() + tdd.bolusAmount += absoluteEbRate / 60.0 * 5.0 } //result.put(midnight, tdd) } @@ -150,13 +150,13 @@ class TddCalculator @Inject constructor( val tbr = iobCobCalculator.getTempBasalIncludingConvertedExtended(t) val profile = profileFunction.getProfile(t) ?: continue val absoluteRate = tbr?.convertedToAbsolute(t, profile) ?: profile.getBasal(t) - tdd.basalAmount += absoluteRate / T.mins(5).msecs().toDouble() * calculationStep.toDouble() + tdd.basalAmount += absoluteRate / 60.0 * 5.0 if (!activePlugin.activePump.isFakingTempsByExtendedBoluses) { // they are not included in TBRs val eb = iobCobCalculator.getExtendedBolus(t) val absoluteEbRate = eb?.rate ?: 0.0 - tdd.bolusAmount += absoluteEbRate / T.mins(5).msecs().toDouble() * calculationStep.toDouble() + tdd.bolusAmount += absoluteEbRate / 60.0 * 5.0 } //result.put(midnight, tdd) }