IobCobCalculatorPlugin fix

This commit is contained in:
Milos Kozak 2021-02-16 17:43:45 +01:00
parent 41b66d40e0
commit 67184c96d9

View file

@ -643,7 +643,7 @@ open class IobCobCalculatorPlugin @Inject constructor(
var time = System.currentTimeMillis() var time = System.currentTimeMillis()
time = roundUpTime(time) time = roundUpTime(time)
val len = ((profile.dia * 60 + 30) / 5).toInt() val len = ((profile.dia * 60 + 30) / 5).toInt()
val array = arrayOf<IobTotal>() val array = Array(len) { IobTotal(0) }
for ((pos, i) in (0 until len).withIndex()) { for ((pos, i) in (0 until len).withIndex()) {
val t = time + i * 5 * 60000 val t = time + i * 5 * 60000
val iob = calculateFromTreatmentsAndTempsSynchronized(t, profile) val iob = calculateFromTreatmentsAndTempsSynchronized(t, profile)