From 348c260d3d4da3b6a169141f5f4a54925a8c76fe Mon Sep 17 00:00:00 2001 From: Philoul Date: Tue, 30 Mar 2021 23:13:20 +0200 Subject: [PATCH] QuickWizard --- .../nightscout/androidaps/utils/wizard/BolusWizard.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index 0108940eae..4595d30331 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -131,6 +131,7 @@ class BolusWizard @Inject constructor( private var useAlarm = false var notes: String = "" private var carbTime: Int = 0 + private var quickWizard: Boolean = true @JvmOverloads fun doCalc(profile: Profile, @@ -150,7 +151,8 @@ class BolusWizard @Inject constructor( useTrend: Boolean, useAlarm: Boolean, notes: String = "", - carbTime: Int = 0 + carbTime: Int = 0, + quickWizard: Boolean = false ): BolusWizard { this.profile = profile @@ -171,6 +173,7 @@ class BolusWizard @Inject constructor( this.useAlarm = useAlarm this.notes = notes this.carbTime = carbTime + this.quickWizard = quickWizard // Insulin from BG sens = Profile.fromMgdlToUnits(profile.isfMgdl, profileFunction.getUnits()) @@ -418,8 +421,8 @@ class BolusWizard @Inject constructor( carbs.equals(0.0) -> Action.BOLUS else -> Action.TREATMENT } - uel.log(action, if (notes == resourceHelper.gs(R.string.ue_quickwizard_ID)) quickWizard.getActive()?.buttonText() else notes, // ue_quickwizard_ID is complicated string impossible to write as note in WizardDialog - ValueWithUnit(if (notes == resourceHelper.gs(R.string.ue_quickwizard_ID)) Sources.QuickWizard else Sources.WizardDialog), + uel.log(action, notes, + ValueWithUnit(if (quickWizard) Sources.QuickWizard else Sources.WizardDialog), ValueWithUnit(eventType.toDBbEventType().text, Units.TherapyEvent), ValueWithUnit(insulinAfterConstraints, Units.U, insulinAfterConstraints != 0.0), ValueWithUnit(this@BolusWizard.carbs, Units.G, this@BolusWizard.carbs != 0),