microbolus calculation
This commit is contained in:
parent
57f5e5a92d
commit
f703c82ca7
|
@ -16,6 +16,10 @@ public class IobTotal {
|
|||
public double netbasalinsulin;
|
||||
public double hightempinsulin;
|
||||
|
||||
// oref1
|
||||
public double microBolusInsulin;
|
||||
public double microBolusIOB;
|
||||
|
||||
public double netInsulin = 0d; // for calculations from temp basals only
|
||||
public double netRatio = 0d; // net ratio at start of temp basal
|
||||
|
||||
|
@ -30,6 +34,8 @@ public class IobTotal {
|
|||
this.basaliob = 0d;
|
||||
this.netbasalinsulin = 0d;
|
||||
this.hightempinsulin = 0d;
|
||||
this.microBolusInsulin = 0d;
|
||||
this.microBolusIOB = 0d;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
|
@ -42,6 +48,8 @@ public class IobTotal {
|
|||
hightempinsulin += other.hightempinsulin;
|
||||
netInsulin += other.netInsulin;
|
||||
extendedBolusInsulin += other.extendedBolusInsulin;
|
||||
microBolusInsulin += other.microBolusInsulin;
|
||||
microBolusIOB += other.microBolusIOB;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -53,6 +61,8 @@ public class IobTotal {
|
|||
result.basaliob = basalIob.basaliob;
|
||||
result.netbasalinsulin = basalIob.netbasalinsulin;
|
||||
result.hightempinsulin = basalIob.hightempinsulin;
|
||||
result.microBolusInsulin = bolusIOB.microBolusInsulin + basalIob.microBolusInsulin;
|
||||
result.microBolusIOB = bolusIOB.microBolusIOB + basalIob.microBolusIOB;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -63,6 +73,8 @@ public class IobTotal {
|
|||
this.basaliob = Round.roundTo(this.basaliob, 0.001);
|
||||
this.netbasalinsulin = Round.roundTo(this.netbasalinsulin, 0.001);
|
||||
this.hightempinsulin = Round.roundTo(this.hightempinsulin, 0.001);
|
||||
this.microBolusInsulin = Round.roundTo(this.microBolusInsulin, 0.001);
|
||||
this.microBolusIOB = Round.roundTo(this.microBolusIOB, 0.001);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -183,8 +183,13 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
|
|||
Iob tIOB = t.iobCalc(time, dia);
|
||||
total.iob += tIOB.iobContrib;
|
||||
total.activity += tIOB.activityContrib;
|
||||
if (!t.isSMB) {
|
||||
Iob bIOB = t.iobCalc(time, dia / SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0));
|
||||
total.bolussnooze += bIOB.iobContrib;
|
||||
} else {
|
||||
total.basaliob += t.insulin;
|
||||
total.microBolusIOB += tIOB.iobContrib;
|
||||
}
|
||||
}
|
||||
|
||||
if (!MainApp.getConfigBuilder().isFakingTempsByExtendedBoluses())
|
||||
|
|
Loading…
Reference in a new issue