wearwizard trend
This commit is contained in:
parent
24dd4e1710
commit
ec106726a7
1 changed files with 4 additions and 1 deletions
|
@ -193,6 +193,7 @@ public class ActionStringHandler {
|
|||
boolean useBolusIOB = Boolean.parseBoolean(act[3]);
|
||||
boolean useBasalIOB = Boolean.parseBoolean(act[4]);
|
||||
boolean useCOB = true;
|
||||
boolean useTrend = true;
|
||||
int percentage = Integer.parseInt(act[5]);
|
||||
|
||||
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||
|
@ -212,7 +213,7 @@ public class ActionStringHandler {
|
|||
DecimalFormat format = new DecimalFormat("0.00");
|
||||
DecimalFormat formatInt = new DecimalFormat("0");
|
||||
BolusWizard bolusWizard = new BolusWizard();
|
||||
bolusWizard.doCalc(profile, null, carbsAfterConstraints, useCOB?cob:0d, useBG ? bgReading.valueToUnits(profile.getUnits()) : 0d, 0d, percentage, useBolusIOB, useBasalIOB, false, false);
|
||||
bolusWizard.doCalc(profile, null, carbsAfterConstraints, useCOB?cob:0d, useBG ? bgReading.valueToUnits(profile.getUnits()) : 0d, 0d, percentage, useBolusIOB, useBasalIOB, false, useTrend);
|
||||
|
||||
Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(bolusWizard.calculatedTotalInsulin)).value();
|
||||
if (insulinAfterConstraints - bolusWizard.calculatedTotalInsulin != 0) {
|
||||
|
@ -244,6 +245,8 @@ public class ActionStringHandler {
|
|||
rMessage += "\nBolus IOB: " + format.format(bolusWizard.insulingFromBolusIOB) + "U";
|
||||
if (useBasalIOB)
|
||||
rMessage += "\nBasal IOB: " + format.format(bolusWizard.insulingFromBasalsIOB) + "U";
|
||||
if (useTrend)
|
||||
rMessage += "\nFrom 15' trend: " + format.format(bolusWizard.insulinFromTrend) + "U";
|
||||
if (percentage != 100) {
|
||||
rMessage += "\nPercentage: " + format.format(bolusWizard.totalBeforePercentageAdjustment) + "U * " + percentage + "% -> ~" + format.format(bolusWizard.calculatedTotalInsulin) + "U";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue