From 0b928c314039a999ef683ebc6209358b8e8d1fc5 Mon Sep 17 00:00:00 2001 From: Philoul Date: Mon, 19 Apr 2021 18:34:18 +0200 Subject: [PATCH 1/3] Add uel.log for Cancel Bolus Button --- .../nightscout/androidaps/dialogs/BolusProgressDialog.kt | 5 +++++ .../main/java/info/nightscout/androidaps/utils/Translator.kt | 1 + .../nightscout/androidaps/utils/userEntry/UserEntryMapper.kt | 1 + core/src/main/res/values/strings.xml | 1 + .../nightscout/androidaps/database/entities/UserEntry.kt | 1 + 5 files changed, 9 insertions(+) diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index 6273d544f5..5ab17221c5 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -11,10 +11,13 @@ import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.BolusProgressHelperActivity import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding +import info.nightscout.androidaps.database.entities.UserEntry.Action +import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag +import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress @@ -32,6 +35,7 @@ class BolusProgressDialog : DaggerDialogFragment() { @Inject lateinit var commandQueue: CommandQueueProvider @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var aapsSchedulers: AapsSchedulers + @Inject lateinit var uel: UserEntryLogger private val disposable = CompositeDisposable() @@ -87,6 +91,7 @@ class BolusProgressDialog : DaggerDialogFragment() { stopPressed = true binding.stoppressed.visibility = View.VISIBLE binding.stop.visibility = View.INVISIBLE + uel.log(Action.CANCEL_BOLUS, Sources.Overview, state) commandQueue.cancelAllBoluses() } val defaultState = resourceHelper.gs(R.string.waitingforpump) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt index b95247ddf6..9ee3dbee13 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt @@ -46,6 +46,7 @@ class Translator @Inject internal constructor( Action.CLEAR_PAIRING_KEYS -> resourceHelper.gs(R.string.uel_clear_pairing_keys) Action.ACCEPTS_TEMP_BASAL -> resourceHelper.gs(R.string.uel_accepts_temp_basal) Action.CANCEL_TEMP_BASAL -> resourceHelper.gs(R.string.uel_cancel_temp_basal) + Action.CANCEL_BOLUS -> resourceHelper.gs(R.string.uel_cancel_bolus) Action.CANCEL_EXTENDED_BOLUS -> resourceHelper.gs(R.string.uel_cancel_extended_bolus) Action.CANCEL_TT -> resourceHelper.gs(R.string.uel_cancel_tt) Action.CAREPORTAL -> resourceHelper.gs(R.string.uel_careportal) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt index 9bcd0ab632..2863d007d2 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt @@ -31,6 +31,7 @@ class UserEntryMapper { CLEAR_PAIRING_KEYS (UserEntry.Action.CLEAR_PAIRING_KEYS), ACCEPTS_TEMP_BASAL (UserEntry.Action.ACCEPTS_TEMP_BASAL), CANCEL_TEMP_BASAL (UserEntry.Action.CANCEL_TEMP_BASAL), + CANCEL_BOLUS (UserEntry.Action.CANCEL_BOLUS), CANCEL_EXTENDED_BOLUS (UserEntry.Action.CANCEL_EXTENDED_BOLUS), CANCEL_TT (UserEntry.Action.CANCEL_TT), CAREPORTAL (UserEntry.Action.CAREPORTAL), diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 225303c081..2a52cf9050 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -433,6 +433,7 @@ CLEAR PAIRING KEYS ACCEPTS TEMP BASAL CANCEL TEMP BASAL + CANCEL BOLUS CANCEL EXTENDED BOLUS CANCEL TT CAREPORTAL diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt b/database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt index d4347542c2..4e98e31686 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt @@ -46,6 +46,7 @@ data class UserEntry( CLEAR_PAIRING_KEYS (ColorGroup.Pump), ACCEPTS_TEMP_BASAL (ColorGroup.BasalTreatment), CANCEL_TEMP_BASAL (ColorGroup.BasalTreatment), + CANCEL_BOLUS (ColorGroup.InsulinTreatment), CANCEL_EXTENDED_BOLUS (ColorGroup.InsulinTreatment), CANCEL_TT (ColorGroup.TT), CAREPORTAL (ColorGroup.Careportal), From 0f18d43da803e8ddcc79f773f8c5cd22a0941b26 Mon Sep 17 00:00:00 2001 From: Philoul Date: Tue, 20 Apr 2021 22:28:58 +0200 Subject: [PATCH 2/3] Icon overview of userEntry updated --- .../androidaps/utils/userEntry/UserEntryPresentationHelper.kt | 2 +- {app => core}/src/main/res/drawable/ic_home.xml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {app => core}/src/main/res/drawable/ic_home.xml (100%) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index b3a5049f9b..ca68f22e85 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -95,7 +95,7 @@ class UserEntryPresentationHelper @Inject constructor( Sources.Food -> R.drawable.ic_food Sources.Stats -> R.drawable.ic_cp_stats Sources.ConfigBuilder -> R.drawable.ic_cogs - Sources.Overview -> R.drawable.ic_notif_aaps + Sources.Overview -> R.drawable.ic_home Sources.Aaps -> R.drawable.ic_notif_aaps Sources.Unknown -> R.drawable.ic_generic_icon } diff --git a/app/src/main/res/drawable/ic_home.xml b/core/src/main/res/drawable/ic_home.xml similarity index 100% rename from app/src/main/res/drawable/ic_home.xml rename to core/src/main/res/drawable/ic_home.xml From 2ba10469b8a94e058778067aa285bc808bbdf3e2 Mon Sep 17 00:00:00 2001 From: Philoul Date: Wed, 21 Apr 2021 21:54:04 +0200 Subject: [PATCH 3/3] Fix UTC Offset in csv --- .../androidaps/utils/userEntry/UserEntryPresentationHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index ca68f22e85..da3d09d93f 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -166,7 +166,7 @@ class UserEntryPresentationHelper @Inject constructor( val fullvalueWithUnitList = ArrayList(entry.values) var timestampRec = "" + entry.timestamp var dateTimestampRev = dateUtil.dateAndTimeAndSecondsString(entry.timestamp) - var utcOffset = dateUtil.timeString(entry.utcOffset) + var utcOffset = dateUtil.timeStringFromSeconds((entry.utcOffset/1000).toInt()) var action = csvString(entry.action) var therapyEvent = "" var source = translator.translate(entry.source)