Use of calculation step reverted back to value / 60 * 5, as calculation step method was producing incorrect, very large numbers.
This commit is contained in:
parent
58d9ce78d7
commit
035e9742af
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue