From dd8d907f4f0a49f5bf3e26ab8e43a240e9949cba Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 18 Apr 2018 16:23:40 +0200 Subject: [PATCH] fix TT units --- .../plugins/Overview/Dialogs/NewInsulinDialog.java | 4 ++-- .../nightscout/androidaps/queue/CommandQueue.java | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java index 91a54895cc..d7cb428312 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java @@ -258,8 +258,8 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener .duration((int) ttDuration) .reason("Eating soon") .source(Source.USER) - .low((int) finalTT) - .high((int) finalTT); + .low(Profile.toMgdl(finalTT, currentProfile.getUnits())) + .high(Profile.toMgdl(finalTT, currentProfile.getUnits())); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java index b522926560..a514a85815 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueue.java @@ -189,12 +189,13 @@ public class CommandQueue { add(new CommandSMBBolus(detailedBolusInfo, callback)); } else { add(new CommandBolus(detailedBolusInfo, callback, type)); - if(type.equals(Command.CommandType.BOLUS)) - // Bring up bolus progress dialog (start here, so the dialog is shown when the bolus is requested, - // not when the Bolus command is starting. The command closes the dialog upon completion). - showBolusProgressDialog(detailedBolusInfo.insulin, detailedBolusInfo.context); - // Notify Wear about upcoming bolus - MainApp.bus().post(new EventBolusRequested(detailedBolusInfo.insulin)); + if(type.equals(Command.CommandType.BOLUS)) { + // Bring up bolus progress dialog (start here, so the dialog is shown when the bolus is requested, + // not when the Bolus command is starting. The command closes the dialog upon completion). + showBolusProgressDialog(detailedBolusInfo.insulin, detailedBolusInfo.context); + // Notify Wear about upcoming bolus + MainApp.bus().post(new EventBolusRequested(detailedBolusInfo.insulin)); + } } notifyAboutNewCommand();