Multiply time passed instead of divide dia.
This commit is contained in:
parent
6b8dd5868d
commit
d49eea854c
2 changed files with 6 additions and 4 deletions
|
@ -183,10 +183,8 @@ public class Treatment implements DataPointWithLabelInterface {
|
||||||
public Iob iobCalc(long time, double dia) {
|
public Iob iobCalc(long time, double dia) {
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
return new Iob();
|
return new Iob();
|
||||||
InsulinInterface insulinInterface = MainApp.getInsulinIterfaceById(insulinInterfaceID);
|
|
||||||
if (insulinInterface == null)
|
|
||||||
insulinInterface = ConfigBuilderPlugin.getActiveInsulin();
|
|
||||||
|
|
||||||
|
InsulinInterface insulinInterface = ConfigBuilderPlugin.getActiveInsulin();
|
||||||
return insulinInterface.iobCalcForTreatment(this, time, dia);
|
return insulinInterface.iobCalcForTreatment(this, time, dia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,7 +185,11 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
|
||||||
total.iob += tIOB.iobContrib;
|
total.iob += tIOB.iobContrib;
|
||||||
total.activity += tIOB.activityContrib;
|
total.activity += tIOB.activityContrib;
|
||||||
if (!t.isSMB) {
|
if (!t.isSMB) {
|
||||||
Iob bIOB = t.iobCalc(time, dia / SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0));
|
// instead of dividing the DIA that only worked on the bilinear curves,
|
||||||
|
// multiply the time the treatment is seen active.
|
||||||
|
long timeSinceTreatent = t.date - time;
|
||||||
|
long snoozeTime = t.date - (long)(timeSinceTreatent * SP.getDouble("openapsama_bolussnooze_dia_divisor", 2.0));
|
||||||
|
Iob bIOB = t.iobCalc(snoozeTime, dia);
|
||||||
total.bolussnooze += bIOB.iobContrib;
|
total.bolussnooze += bIOB.iobContrib;
|
||||||
} else {
|
} else {
|
||||||
total.basaliob += t.insulin;
|
total.basaliob += t.insulin;
|
||||||
|
|
Loading…
Reference in a new issue