diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index 72fec2f8fb..b00b88d62c 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -18,8 +18,6 @@ import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.databinding.DialogCareBinding import info.nightscout.androidaps.interfaces.ProfileFunction @@ -63,7 +61,7 @@ class CareDialog : DialogFragmentWithDate() { private var options: EventType = EventType.BGCHECK //private var valuesWithUnit = mutableListOf() - private var valuesWithUnit = mutableListOf() + private var valuesWithUnit = mutableListOf() @StringRes private var event: Int = R.string.none @@ -205,16 +203,13 @@ class CareDialog : DialogFragmentWithDate() { actions.add(resourceHelper.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(profileFunction, binding.bg.value) + " " + resourceHelper.gs(unitResId)) therapyEvent.glucoseType = meterType therapyEvent.glucose = binding.bg.value - //valuesWithUnit.add(XXXValueWithUnit.fromGlucoseUnit(binding.bg.value.toDouble(), profileFunction.getUnits())) - //valuesWithUnit.add(XXXValueWithUnit.TherapyEventMeterType(meterType)) - valuesWithUnit.add(ValueWithUnit(binding.bg.value.toDouble(), profileFunction.getUnits())) - valuesWithUnit.add(ValueWithUnit(meterType.text, Units.TherapyEvent)) + valuesWithUnit.add(XXXValueWithUnit.fromGlucoseUnit(binding.bg.value.toDouble(), profileFunction.getUnits())) + valuesWithUnit.add(XXXValueWithUnit.TherapyEventMeterType(meterType)) } if (options == EventType.NOTE || options == EventType.EXERCISE) { actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_duration_label) + ": " + resourceHelper.gs(R.string.format_mins, binding.duration.value.toInt())) therapyEvent.duration = T.mins(binding.duration.value.toLong()).msecs() - //valuesWithUnit.add(XXXValueWithUnit.Minute(binding.duration.value.toInt()).takeIf { !binding.duration.value.equals(0.0) }) - valuesWithUnit.add(ValueWithUnit(binding.duration.value.toInt(), Units.M, !binding.duration.value.equals(0.0))) + valuesWithUnit.add(XXXValueWithUnit.Minute(binding.duration.value.toInt()).takeIf { !binding.duration.value.equals(0.0) } ) } val notes = binding.notesLayout.notes.text.toString() if (notes.isNotEmpty()) { @@ -235,7 +230,6 @@ class CareDialog : DialogFragmentWithDate() { EventType.QUESTION -> Sources.Question EventType.ANNOUNCEMENT -> Sources.Announcement } - valuesWithUnit.add(ValueWithUnit(source)) activity?.let { activity -> OKDialog.showConfirmation(activity, resourceHelper.gs(event), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), { @@ -244,11 +238,9 @@ class CareDialog : DialogFragmentWithDate() { { result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted therapy event $it") } }, { aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", it) } ) - //valuesWithUnit.add(0, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }) - //valuesWithUnit.add(1, XXXValueWithUnit.TherapyEventType(therapyEvent.type)) - valuesWithUnit.add(0, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged)) - valuesWithUnit.add(1, ValueWithUnit(therapyEvent.type.text, Units.TherapyEvent)) - uel.log(Action.CAREPORTAL, notes, valuesWithUnit) + valuesWithUnit.add(0, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }) + valuesWithUnit.add(1, XXXValueWithUnit.TherapyEventType(therapyEvent.type)) + uel.log(Action.CAREPORTAL, source, notes, valuesWithUnit) }, null) } return true diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 0392653790..a226cbd5a0 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -11,8 +11,6 @@ import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.CommandQueueProvider @@ -92,8 +90,9 @@ class ExtendedBolusDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.extended_bolus), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), { - //uel.log(Action.EXTENDED_BOLUS, XXXValueWithUnit.Insulin(insulinAfterConstraint), XXXValueWithUnit.Minute(durationInMinutes)) - uel.log(Action.EXTENDED_BOLUS, ValueWithUnit(Sources.ExtendedBolusDialog), ValueWithUnit(insulinAfterConstraint, Units.U), ValueWithUnit(durationInMinutes, Units.M)) + uel.log(Action.EXTENDED_BOLUS, Sources.ExtendedBolusDialog, + XXXValueWithUnit.Insulin(insulinAfterConstraint), + XXXValueWithUnit.Minute(durationInMinutes)) commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() { override fun run() { if (!result.success) { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 38c185a17a..dcff75f07a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -14,8 +14,6 @@ import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.databinding.DialogFillBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider @@ -137,13 +135,15 @@ class FillDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.primefill), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), { if (insulinAfterConstraints > 0) { - //uel.log(Action.PRIME_BOLUS, notes, XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 }) - uel.log(Action.PRIME_BOLUS, notes, ValueWithUnit(Sources.FillDialog), ValueWithUnit(insulinAfterConstraints, Units.U, insulinAfterConstraints != 0.0)) + uel.log(Action.PRIME_BOLUS, Sources.FillDialog, + notes, + XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 }) requestPrimeBolus(insulinAfterConstraints, notes) } if (siteChange) { - //uel.log(Action.CAREPORTAL, notes, XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.CANNULA_CHANGE)) - uel.log(Action.CAREPORTAL, notes, ValueWithUnit(Sources.FillDialog), ValueWithUnit(TherapyEvent.Type.CANNULA_CHANGE.text, Units.TherapyEvent)) + uel.log(Action.CAREPORTAL, Sources.FillDialog, + notes, + XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.CANNULA_CHANGE)) disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction( timestamp = eventTime, type = TherapyEvent.Type.CANNULA_CHANGE, @@ -156,8 +156,9 @@ class FillDialog : DialogFragmentWithDate() { } if (insulinChange) { // add a second for case of both checked - //uel.log(Action.CAREPORTAL, notes, XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.INSULIN_CHANGE)) - uel.log(Action.CAREPORTAL, notes, ValueWithUnit(Sources.FillDialog), ValueWithUnit(TherapyEvent.Type.INSULIN_CHANGE.text, Units.TherapyEvent)) + uel.log(Action.CAREPORTAL, Sources.FillDialog, + notes, + XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.INSULIN_CHANGE)) disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction( timestamp = eventTime + 1000, type = TherapyEvent.Type.INSULIN_CHANGE, diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index f5197b9699..efb7bd1759 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -19,8 +19,6 @@ import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction import info.nightscout.androidaps.databinding.DialogInsulinBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider @@ -191,8 +189,11 @@ class InsulinDialog : DialogFragmentWithDate() { activity?.let { activity -> OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.bolus), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), { if (eatingSoonChecked) { - //uel.log(Action.TT, notes, XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON), XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units), XXXValueWithUnit.Minute(eatingSoonTTDuration)) - uel.log(Action.TT, notes, ValueWithUnit(Sources.InsulinDialog), ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TherapyEvent), ValueWithUnit(eatingSoonTT, units), ValueWithUnit(eatingSoonTTDuration, Units.M)) + uel.log(Action.TT, Sources.InsulinDialog, + notes, + XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON), + XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units), + XXXValueWithUnit.Minute(eatingSoonTTDuration)) disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction( timestamp = System.currentTimeMillis(), duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()), @@ -214,13 +215,11 @@ class InsulinDialog : DialogFragmentWithDate() { detailedBolusInfo.notes = notes detailedBolusInfo.timestamp = time if (recordOnlyChecked) { - //uel.log(Action.BOLUS_RECORD, notes, XXXValueWithUnit.Insulin(insulinAfterConstraints), XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset!= 0 }) - uel.log(Action.BOLUS, notes, - ValueWithUnit(Sources.InsulinDialog), - ValueWithUnit(detailedBolusInfo.timestamp, Units.Timestamp, eventTimeChanged), - ValueWithUnit(R.string.record, Units.R_String), - ValueWithUnit(detailedBolusInfo.insulin, Units.U), - ValueWithUnit(timeOffset, Units.M, timeOffset != 0)) + uel.log(Action.BOLUS, Sources.InsulinDialog, + notes, + XXXValueWithUnit.StringResource(R.string.record), + XXXValueWithUnit.Insulin(insulinAfterConstraints), + XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset!= 0 }) disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction()) .subscribe( { result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") } }, @@ -232,9 +231,9 @@ class InsulinDialog : DialogFragmentWithDate() { if (!result.success) { ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror) } else - uel.log(Action.BOLUS, notes, - ValueWithUnit(Sources.InsulinDialog), - ValueWithUnit(insulinAfterConstraints, Units.U)) + uel.log(Action.BOLUS, Sources.InsulinDialog, + notes, + XXXValueWithUnit.Insulin(insulinAfterConstraints)) } }) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index c4db84672c..8fa17df7a4 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -15,8 +15,6 @@ import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.databinding.DialogLoopBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.events.EventRefreshOverview diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index 10e48414e9..939e373b76 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -11,8 +11,6 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.databinding.DialogProfileswitchBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index 354a9eb503..0411ba5418 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -11,8 +11,6 @@ import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.databinding.DialogTempbasalBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.CommandQueueProvider @@ -130,12 +128,14 @@ class TempBasalDialog : DialogFragmentWithDate() { } } if (isPercentPump) { - //uel.log(Action.TEMP_BASAL, XXXValueWithUnit.Percent(percent), XXXValueWithUnit.Minute(durationInMinutes)) - uel.log(Action.TEMP_BASAL, ValueWithUnit(Sources.TempBasalDialog), ValueWithUnit(percent, Units.Percent), ValueWithUnit(durationInMinutes, Units.M)) + uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog, + XXXValueWithUnit.Percent(percent), + XXXValueWithUnit.Minute(durationInMinutes)) commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback) } else { - //uel.log(Action.TEMP_BASAL, XXXValueWithUnit.Insulin(absolute), XXXValueWithUnit.Minute(durationInMinutes)) - uel.log(Action.TEMP_BASAL, ValueWithUnit(Sources.TempBasalDialog), ValueWithUnit(absolute, Units.U), ValueWithUnit(durationInMinutes, Units.M)) + uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog, + XXXValueWithUnit.Insulin(absolute), + XXXValueWithUnit.Minute(durationInMinutes)) commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback) } }) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index db824d8bf3..9d2325b061 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -16,8 +16,6 @@ import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction import info.nightscout.androidaps.databinding.DialogTemptargetBinding diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index e04a9a4d0f..7e94e0eced 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -16,8 +16,6 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.databinding.DialogTreatmentBinding import info.nightscout.androidaps.interfaces.ActivePluginProvider import info.nightscout.androidaps.interfaces.CommandQueueProvider diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt index 579d2cfe28..4c18d06f98 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt @@ -19,8 +19,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit +import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.events.EventAcceptOpenLoopChange @@ -550,7 +549,7 @@ open class LoopPlugin @Inject constructor( if (request.percent == 100 && request.duration == 0) { if (activeTemp != null) { aapsLogger.debug(LTag.APS, "applyAPSRequest: cancelTempBasal()") - uel.log(Action.CANCEL_TEMP_BASAL, ValueWithUnit(Sources.Loop)) + uel.log(Action.CANCEL_TEMP_BASAL, Sources.Loop) commandQueue.cancelTempBasal(false, callback) } else { aapsLogger.debug(LTag.APS, "applyAPSRequest: Basal set correctly") @@ -564,14 +563,16 @@ open class LoopPlugin @Inject constructor( .comment(R.string.let_temp_basal_run))?.run() } else { aapsLogger.debug(LTag.APS, "applyAPSRequest: tempBasalPercent()") - uel.log(Action.TEMP_BASAL, ValueWithUnit(Sources.Loop), ValueWithUnit(request.percent, Units.Percent), ValueWithUnit(request.duration, Units.M)) + uel.log(Action.TEMP_BASAL, Sources.Loop, + XXXValueWithUnit.Percent(request.percent), + XXXValueWithUnit.Minute(request.duration)) commandQueue.tempBasalPercent(request.percent, request.duration, false, profile!!, callback) } } else { if (request.rate == 0.0 && request.duration == 0 || abs(request.rate - pump.baseBasalRate) < pump.pumpDescription.basalStep) { if (activeTemp != null) { aapsLogger.debug(LTag.APS, "applyAPSRequest: cancelTempBasal()") - uel.log(Action.CANCEL_TEMP_BASAL, ValueWithUnit(Sources.Loop)) + uel.log(Action.CANCEL_TEMP_BASAL, Sources.Loop) commandQueue.cancelTempBasal(false, callback) } else { aapsLogger.debug(LTag.APS, "applyAPSRequest: Basal set correctly") @@ -585,7 +586,9 @@ open class LoopPlugin @Inject constructor( .comment(R.string.let_temp_basal_run))?.run() } else { aapsLogger.debug(LTag.APS, "applyAPSRequest: setTempBasalAbsolute()") - uel.log(Action.TEMP_BASAL, ValueWithUnit(Sources.Loop), ValueWithUnit(request.rate, Units.U_H), ValueWithUnit(request.duration, Units.M)) + uel.log(Action.TEMP_BASAL, Sources.Loop, + XXXValueWithUnit.UnitPerHour(request.rate), + XXXValueWithUnit.Minute(request.duration)) commandQueue.tempBasalAbsolute(request.rate, request.duration, false, profile!!, callback) } } @@ -625,7 +628,7 @@ open class LoopPlugin @Inject constructor( detailedBolusInfo.deliverAtTheLatest = request.deliverAt aapsLogger.debug(LTag.APS, "applyAPSRequest: bolus()") if (request.smb > 0.0) - uel.log(Action.SMB, ValueWithUnit(Sources.Loop), ValueWithUnit(detailedBolusInfo.insulin, Units.U)) + uel.log(Action.SMB, Sources.Loop, XXXValueWithUnit.Insulin(detailedBolusInfo.insulin)) commandQueue.bolus(detailedBolusInfo, callback) } 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 8376821ff3..01177f85ef 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 @@ -16,8 +16,6 @@ import info.nightscout.androidaps.database.entities.XXXValueWithUnit import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.UserEntry.Units -import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.androidaps.events.EventRefreshOverview import info.nightscout.androidaps.interfaces.*