diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt
index 4db48e9649..6a611fc4b4 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt
@@ -85,14 +85,14 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount)
)
aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it")
}
result.invalidated.forEach {
- uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
+ uel.log(Action.BOLUS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Insulin(it.amount)
)
@@ -114,14 +114,14 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.CARBS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it")
}
result.invalidated.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.CARBS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.Gram(it.amount.toInt())
)
@@ -194,8 +194,13 @@ class NSClientAddUpdateWorker(
}
.blockingGet()
.also { result ->
+ val action = when (eventType) {
+ TherapyEvent.Type.CANNULA_CHANGE.text -> Action.SITE_CHANGE
+ TherapyEvent.Type.INSULIN_CHANGE.text -> Action.RESERVOIR_CHANGE
+ else -> Action.CAREPORTAL
+ }
result.inserted.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(action, Sources.NSClient,
it.note ?: "",
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.TherapyEventType(it.type)
@@ -225,7 +230,7 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.TEMP_BASAL, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@@ -233,7 +238,7 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it")
}
result.invalidated.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.TEMP_BASAL_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@@ -241,7 +246,7 @@ class NSClientAddUpdateWorker(
aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryBasal $it")
}
result.ended.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.CANCEL_TEMP_BASAL, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
@@ -263,24 +268,27 @@ class NSClientAddUpdateWorker(
.blockingGet()
.also { result ->
result.inserted.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.EXTENDED_BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
+ ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
)
aapsLogger.debug(LTag.DATABASE, "Inserted ExtendedBolus $it")
}
result.invalidated.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.EXTENDED_BOLUS_REMOVED, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
+ ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
)
aapsLogger.debug(LTag.DATABASE, "Invalidated ExtendedBolus $it")
}
result.ended.forEach {
- uel.log(Action.CAREPORTAL, Sources.NSClient,
+ uel.log(Action.CANCEL_EXTENDED_BOLUS, Sources.NSClient,
ValueWithUnit.Timestamp(it.timestamp),
+ ValueWithUnit.Insulin(it.amount),
ValueWithUnit.UnitPerHour(it.rate),
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt())
)
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusCarbsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusCarbsFragment.kt
index 0f1a7f3693..e530d9dc6e 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusCarbsFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsBolusCarbsFragment.kt
@@ -334,10 +334,10 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(bolus.timestamp)
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
uel.log(
- Action.TREATMENT_REMOVED, Sources.Treatments,
+ Action.BOLUS_REMOVED, Sources.Treatments,
ValueWithUnit.Timestamp(bolus.timestamp),
ValueWithUnit.Insulin(bolus.amount)
- //XXXValueWithUnit.Gram(mealLinkLoaded.carbs.toInt())
+ //ValueWithUnit.Gram(mealLinkLoaded.carbs.toInt())
)
disposable += repository.runTransactionForResult(InvalidateBolusTransaction(bolus.id))
.subscribe(
@@ -356,7 +356,7 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(carb.timestamp)
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
uel.log(
- Action.TREATMENT_REMOVED, Sources.Treatments,
+ Action.CARBS_REMOVED, Sources.Treatments,
ValueWithUnit.Timestamp(carb.timestamp),
ValueWithUnit.Gram(carb.amount.toInt()))
disposable += repository.runTransactionForResult(InvalidateCarbsTransaction(carb.id))
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
index 67da8886ff..ecd4b5d288 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTemporaryBasalsFragment.kt
@@ -170,7 +170,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
${resourceHelper.gs(R.string.date)}: ${dateUtil.dateAndTimeString(tempBasal.timestamp)}
""".trimIndent(),
{ _: DialogInterface?, _: Int ->
- uel.log(Action.TT_REMOVED, Sources.Treatments,
+ uel.log(Action.TEMP_BASAL_REMOVED, Sources.Treatments,
ValueWithUnit.Timestamp(tempBasal.timestamp))
disposable += repository.runTransactionForResult(InvalidateTemporaryBasalTransaction(tempBasal.id))
.subscribe(
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 85e2632cc1..28fe5150f0 100644
--- a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt
+++ b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt
@@ -61,6 +61,9 @@ class Translator @Inject internal constructor(
Action.AUTOMATION_REMOVED -> resourceHelper.gs(R.string.uel_automation_removed)
Action.BG_REMOVED -> resourceHelper.gs(R.string.uel_bg_removed)
Action.CAREPORTAL_REMOVED -> resourceHelper.gs(R.string.uel_careportal_removed)
+ Action.BOLUS_REMOVED -> resourceHelper.gs(R.string.uel_bolus_removed)
+ Action.CARBS_REMOVED -> resourceHelper.gs(R.string.uel_carbs_removed)
+ Action.TEMP_BASAL_REMOVED -> resourceHelper.gs(R.string.uel_temp_basal_removed)
Action.EXTENDED_BOLUS_REMOVED -> resourceHelper.gs(R.string.uel_extended_bolus_removed)
Action.FOOD -> resourceHelper.gs(R.string.uel_food)
Action.FOOD_REMOVED -> resourceHelper.gs(R.string.uel_food_removed)
diff --git a/core/src/main/java/info/nightscout/androidaps/utils/UserEntryPresentationHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/UserEntryPresentationHelper.kt
index 569f49c4af..8371ba96ab 100644
--- a/core/src/main/java/info/nightscout/androidaps/utils/UserEntryPresentationHelper.kt
+++ b/core/src/main/java/info/nightscout/androidaps/utils/UserEntryPresentationHelper.kt
@@ -106,8 +106,7 @@ class UserEntryPresentationHelper @Inject constructor(
is ValueWithUnit.UnitPerHour -> DecimalFormatter.to2Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
is ValueWithUnit.SimpleInt -> valueWithUnit.value.toString()
is ValueWithUnit.SimpleString -> valueWithUnit.value
- is ValueWithUnit.StringResource -> resourceHelper.gs(valueWithUnit.value, *(valueWithUnit.params.map { it.value() }.toTypedArray())) //Todo Fix StringResource with Param
- // is XXXValueWithUnit.StringResource -> if (valueWithUnit.params.size > 0 ) valueWithUnit.params.joinToString(separator = " ") { value -> toPresentationString(value) } else resourceHelper.gs(valueWithUnit.value) //To help debugging
+ is ValueWithUnit.StringResource -> resourceHelper.gs(valueWithUnit.value, *(valueWithUnit.params.map { it.value() }.toTypedArray()))
is ValueWithUnit.TherapyEventMeterType -> translator.translate(valueWithUnit.value)
is ValueWithUnit.TherapyEventTTReason -> translator.translate(valueWithUnit.value)
is ValueWithUnit.TherapyEventType -> translator.translate(valueWithUnit.value)
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index 077096197b..c627510416 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -444,6 +444,9 @@
AUTOMATION REMOVED
BG REMOVED
CAREPORTAL REMOVED
+ BOLUS REMOVED
+ CARBS REMOVED
+ TEMP BASAL REMOVED
EXTENDED BOLUS REMOVED
FOOD
FOOD REMOVED
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 4da5d0659c..390c92aca5 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
@@ -67,6 +67,9 @@ data class UserEntry(
PROFILE_SWITCH_REMOVED (ColorGroup.Aaps),
RESTART_EVENTS_REMOVED (ColorGroup.Aaps),
TREATMENT_REMOVED (ColorGroup.Aaps),
+ BOLUS_REMOVED (ColorGroup.Aaps),
+ CARBS_REMOVED (ColorGroup.Aaps),
+ TEMP_BASAL_REMOVED (ColorGroup.Aaps),
TT_REMOVED (ColorGroup.Aaps),
NS_PAUSED (ColorGroup.Aaps),
NS_RESUME (ColorGroup.Aaps),