diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardInfoDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardInfoDialog.kt index 6a6aaf32fa..da6094487e 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardInfoDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardInfoDialog.kt @@ -69,13 +69,15 @@ class WizardInfoDialog : DaggerDialogFragment() { binding.close.setOnClickListener { dismiss() } val units = profileFunction.getUnits() val bgString = Profile.toUnitsString(data.glucoseValue, data.glucoseValue * Constants.MGDL_TO_MMOLL, units) + val isf = Profile.toUnits(data.isf, data.isf * Constants.MGDL_TO_MMOLL, units) + val trend = Profile.toUnitsString(data.glucoseTrend * 3, data.glucoseTrend * 3 * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()) // BG - binding.bg.text = rh.gs(R.string.format_bg_isf, bgString, data.isf) + binding.bg.text = rh.gs(R.string.format_bg_isf, bgString, isf) binding.bgInsulin.text = rh.gs(R.string.formatinsulinunits, data.glucoseInsulin) binding.bgCheckbox.isChecked = data.wasGlucoseUsed binding.ttCheckbox.isChecked = data.wasTempTargetUsed // Trend - binding.bgTrend.text = DecimalFormatter.to1Decimal(data.glucoseTrend) + binding.bgTrend.text = trend binding.bgTrendInsulin.text = rh.gs(R.string.formatinsulinunits, data.trendInsulin) binding.bgTrendCheckbox.isChecked = data.wasTrendUsed // COB 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 c9a361dca5..5a66cd2510 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 @@ -261,22 +261,23 @@ class BolusWizard @Inject constructor( return this } - private fun createBolusCalculatorResult(): BolusCalculatorResult = - BolusCalculatorResult( + private fun createBolusCalculatorResult(): BolusCalculatorResult { + val unit = profileFunction.getUnits() + return BolusCalculatorResult( timestamp = dateUtil.now(), - targetBGLow = targetBGLow, - targetBGHigh = targetBGHigh, - isf = sens, + targetBGLow = Profile.toMgdl(targetBGLow, unit), + targetBGHigh = Profile.toMgdl(targetBGHigh, unit), + isf = Profile.toMgdl(sens, unit), ic = ic, bolusIOB = insulinFromBolusIOB, wasBolusIOBUsed = includeBolusIOB, basalIOB = insulinFromBasalIOB, wasBasalIOBUsed = includeBasalIOB, - glucoseValue = bg, + glucoseValue = Profile.toMgdl(bg, unit), wasGlucoseUsed = useBg && bg > 0, glucoseDifference = bgDiff, glucoseInsulin = insulinFromBG, - glucoseTrend = trend, + glucoseTrend = Profile.fromMgdlToUnits(trend, unit), wasTrendUsed = useTrend, trendInsulin = insulinFromTrend, cob = cob, @@ -294,6 +295,7 @@ class BolusWizard @Inject constructor( profileName = profileName, note = notes ) + } private fun confirmMessageAfterConstraints(advisor: Boolean): Spanned {