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 5ec2723fa4..7cebe4a72d 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 @@ -196,6 +196,7 @@ public class ActionStringHandler { } boolean useBG = SP.getBoolean(R.string.key_wearwizard_bg, true); + boolean useTT = SP.getBoolean(R.string.key_wearwizard_tt, false); boolean useBolusIOB = SP.getBoolean(R.string.key_wearwizard_bolusiob, true); boolean useBasalIOB = SP.getBoolean(R.string.key_wearwizard_basaliob, true); boolean useCOB = SP.getBoolean(R.string.key_wearwizard_cob, true); @@ -223,7 +224,9 @@ public class ActionStringHandler { DecimalFormat format = new DecimalFormat("0.00"); DecimalFormat formatInt = new DecimalFormat("0"); BolusWizard bolusWizard = new BolusWizard(); - bolusWizard.doCalc(profile, null, carbsAfterConstraints, useCOB?cobInfo.displayCob:0d, useBG ? bgReading.valueToUnits(profile.getUnits()) : 0d, 0d, percentage, useBolusIOB, useBasalIOB, false, useTrend); + bolusWizard.doCalc(profile, useTT ? TreatmentsPlugin.getPlugin().getTempTargetFromHistory() : null, + carbsAfterConstraints, useCOB?cobInfo.displayCob: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) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e0ce1ebbf0..0931f67e2d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1037,6 +1037,7 @@ Autobackfill BG Wizard Settings wearwizard_bg + wearwizard_tt wearwizard_trend wearwizard_cob wearwizard_bolusiob diff --git a/app/src/main/res/xml/pref_wear.xml b/app/src/main/res/xml/pref_wear.xml index 2c3c9f3435..fad213bef6 100644 --- a/app/src/main/res/xml/pref_wear.xml +++ b/app/src/main/res/xml/pref_wear.xml @@ -25,6 +25,12 @@ android:defaultValue="true" android:dependency="wearcontrol"/> + +