This commit is contained in:
Milos Kozak 2017-08-10 22:39:25 +02:00
commit 26fbd450b0
3 changed files with 22 additions and 5 deletions

View file

@ -16,6 +16,10 @@ public class IobTotal {
public double netbasalinsulin; public double netbasalinsulin;
public double hightempinsulin; public double hightempinsulin;
// oref1
public double microBolusInsulin;
public double microBolusIOB;
public double netInsulin = 0d; // for calculations from temp basals only public double netInsulin = 0d; // for calculations from temp basals only
public double netRatio = 0d; // net ratio at start of temp basal public double netRatio = 0d; // net ratio at start of temp basal
@ -30,6 +34,8 @@ public class IobTotal {
this.basaliob = 0d; this.basaliob = 0d;
this.netbasalinsulin = 0d; this.netbasalinsulin = 0d;
this.hightempinsulin = 0d; this.hightempinsulin = 0d;
this.microBolusInsulin = 0d;
this.microBolusIOB = 0d;
this.time = time; this.time = time;
} }
@ -42,6 +48,8 @@ public class IobTotal {
hightempinsulin += other.hightempinsulin; hightempinsulin += other.hightempinsulin;
netInsulin += other.netInsulin; netInsulin += other.netInsulin;
extendedBolusInsulin += other.extendedBolusInsulin; extendedBolusInsulin += other.extendedBolusInsulin;
microBolusInsulin += other.microBolusInsulin;
microBolusIOB += other.microBolusIOB;
return this; return this;
} }
@ -53,6 +61,8 @@ public class IobTotal {
result.basaliob = basalIob.basaliob; result.basaliob = basalIob.basaliob;
result.netbasalinsulin = basalIob.netbasalinsulin; result.netbasalinsulin = basalIob.netbasalinsulin;
result.hightempinsulin = basalIob.hightempinsulin; result.hightempinsulin = basalIob.hightempinsulin;
result.microBolusInsulin = bolusIOB.microBolusInsulin + basalIob.microBolusInsulin;
result.microBolusIOB = bolusIOB.microBolusIOB + basalIob.microBolusIOB;
return result; return result;
} }
@ -63,6 +73,8 @@ public class IobTotal {
this.basaliob = Round.roundTo(this.basaliob, 0.001); this.basaliob = Round.roundTo(this.basaliob, 0.001);
this.netbasalinsulin = Round.roundTo(this.netbasalinsulin, 0.001); this.netbasalinsulin = Round.roundTo(this.netbasalinsulin, 0.001);
this.hightempinsulin = Round.roundTo(this.hightempinsulin, 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; return this;
} }

View file

@ -183,8 +183,13 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
Iob tIOB = t.iobCalc(time, dia); Iob tIOB = t.iobCalc(time, dia);
total.iob += tIOB.iobContrib; total.iob += tIOB.iobContrib;
total.activity += tIOB.activityContrib; total.activity += tIOB.activityContrib;
if (!t.isSMB) {
Iob bIOB = t.iobCalc(time, dia / SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0)); Iob bIOB = t.iobCalc(time, dia / SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0));
total.bolussnooze += bIOB.iobContrib; total.bolussnooze += bIOB.iobContrib;
} else {
total.basaliob += t.insulin;
total.microBolusIOB += tIOB.iobContrib;
}
} }
if (!MainApp.getConfigBuilder().isFakingTempsByExtendedBoluses()) if (!MainApp.getConfigBuilder().isFakingTempsByExtendedBoluses())

View file

@ -12,7 +12,7 @@
<string name="careportal_newnstreatment_sensor">Sensor</string> <string name="careportal_newnstreatment_sensor">Sensor</string>
<string name="configbuilder_profile">Profil</string> <string name="configbuilder_profile">Profil</string>
<string name="configbuilder_pump">Pumpe</string> <string name="configbuilder_pump">Pumpe</string>
<string name="confirmation">Konfiguration</string> <string name="confirmation">Bestätigung</string>
<string name="days">Tage</string> <string name="days">Tage</string>
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="openapsma_profile_label">Profil</string> <string name="openapsma_profile_label">Profil</string>
@ -109,8 +109,8 @@
<string name="treatments_newtreatment_carbsamount_label">Kohlehydrat Menge</string> <string name="treatments_newtreatment_carbsamount_label">Kohlehydrat Menge</string>
<string name="treatments_newtreatment_insulinamount_label">Insulin Menge</string> <string name="treatments_newtreatment_insulinamount_label">Insulin Menge</string>
<string name="treatments">Treatments</string> <string name="treatments">Treatments</string>
<string name="treatmentssafety_maxbolus_title">Max erlaubter Bolus</string> <string name="treatmentssafety_maxbolus_title">Max erlaubter Bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max erlaubte Kohlehydrate</string> <string name="treatmentssafety_maxcarbs_title">Max erlaubte Kohlehydrate [g]</string>
<string name="treatmentssafety_title">Tratments Sicherheit</string> <string name="treatmentssafety_title">Tratments Sicherheit</string>
<string name="simpleprofile">Einfaches Profil</string> <string name="simpleprofile">Einfaches Profil</string>
<string name="setextendedbolusquestion">Setze neuen extended Bolus:</string> <string name="setextendedbolusquestion">Setze neuen extended Bolus:</string>