From ec106726a7473a15e207b551875d1283279b7d9c Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 3 May 2018 16:05:04 +0200 Subject: [PATCH] wearwizard trend --- .../androidaps/plugins/Wear/ActionStringHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 715dc1163c..f95027a87c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -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"; }