Optimize Actions
This commit is contained in:
parent
2b6f060eae
commit
accfc24332
16 changed files with 54 additions and 92 deletions
|
@ -13,7 +13,6 @@ import info.nightscout.androidaps.database.entities.UserEntry.*
|
|||
import info.nightscout.androidaps.databinding.DialogCalibrationBinding
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.utils.HtmlHelper
|
||||
import info.nightscout.androidaps.utils.XdripCalibrations
|
||||
|
|
|
@ -222,7 +222,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||
when {
|
||||
activitySelected -> {
|
||||
uel.log(Action.TT_ACTIVITY, ValueWithUnit(activityTT, units) , ValueWithUnit(activityTTDuration, Units.M))
|
||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.ACTIVITY.text, Units.TT_Reason), ValueWithUnit(activityTT, units) , ValueWithUnit(activityTTDuration, Units.M))
|
||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||
timestamp = System.currentTimeMillis(),
|
||||
duration = TimeUnit.MINUTES.toMillis(activityTTDuration.toLong()),
|
||||
|
@ -238,7 +238,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
|
||||
eatingSoonSelected -> {
|
||||
uel.log(Action.TT_EATING_SOON, ValueWithUnit(eatingSoonTT, units) , ValueWithUnit(eatingSoonTTDuration, Units.M))
|
||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TT_Reason), ValueWithUnit(eatingSoonTT, units) , ValueWithUnit(eatingSoonTTDuration, Units.M))
|
||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||
timestamp = System.currentTimeMillis(),
|
||||
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
||||
|
@ -254,7 +254,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
|
||||
hypoSelected -> {
|
||||
uel.log(Action.TT_HYPO, ValueWithUnit(hypoTT, units) , ValueWithUnit(hypoTTDuration, Units.M))
|
||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.HYPOGLYCEMIA.text, Units.TT_Reason), ValueWithUnit(hypoTT, units) , ValueWithUnit(hypoTTDuration, Units.M))
|
||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||
timestamp = System.currentTimeMillis(),
|
||||
duration = TimeUnit.MINUTES.toMillis(hypoTTDuration.toLong()),
|
||||
|
|
|
@ -203,7 +203,7 @@ class CareDialog : DialogFragmentWithDate() {
|
|||
therapyEvent.glucoseType = meterType
|
||||
therapyEvent.glucose = binding.bg.value
|
||||
valuesWithUnit.add(ValueWithUnit(binding.bg.value.toDouble(), profileFunction.getUnits()))
|
||||
valuesWithUnit.add(ValueWithUnit(meterType.text, Units.CPEvent))
|
||||
valuesWithUnit.add(ValueWithUnit(meterType.text, Units.TherapyEvent))
|
||||
}
|
||||
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()))
|
||||
|
@ -228,7 +228,7 @@ class CareDialog : DialogFragmentWithDate() {
|
|||
aapsLogger.error(LTag.BGSOURCE, "Error while saving therapy event", it)
|
||||
})
|
||||
valuesWithUnit.add(0, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged))
|
||||
valuesWithUnit.add(1, ValueWithUnit(therapyEvent.type.text, Units.CPEvent))
|
||||
valuesWithUnit.add(1, ValueWithUnit(therapyEvent.type.text, Units.TherapyEvent))
|
||||
uel.log(Action.CAREPORTAL, notes, valuesWithUnit)
|
||||
}, null)
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class FillDialog : DialogFragmentWithDate() {
|
|||
requestPrimeBolus(insulinAfterConstraints, notes)
|
||||
}
|
||||
if (siteChange) {
|
||||
uel.log(Action.SITE_CHANGE, notes)
|
||||
uel.log(Action.CAREPORTAL, notes, ValueWithUnit(TherapyEvent.Type.CANNULA_CHANGE.text, Units.TherapyEvent))
|
||||
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
||||
timestamp = eventTime,
|
||||
type = TherapyEvent.Type.CANNULA_CHANGE,
|
||||
|
@ -154,7 +154,7 @@ class FillDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
if (insulinChange) {
|
||||
// add a second for case of both checked
|
||||
uel.log(Action.INSULIN_CHANGE, notes)
|
||||
uel.log(Action.CAREPORTAL, notes, ValueWithUnit(TherapyEvent.Type.INSULIN_CHANGE.text, Units.TherapyEvent))
|
||||
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
||||
timestamp = eventTime + 1000,
|
||||
type = TherapyEvent.Type.INSULIN_CHANGE,
|
||||
|
|
|
@ -189,7 +189,7 @@ class InsulinDialog : DialogFragmentWithDate() {
|
|||
activity?.let { activity ->
|
||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.bolus), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||
if (eatingSoonChecked) {
|
||||
uel.log(Action.TT_EATING_SOON, notes, ValueWithUnit(eatingSoonTT, units), ValueWithUnit(eatingSoonTTDuration, Units.M))
|
||||
uel.log(Action.TT, notes, ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TT_Reason), ValueWithUnit(eatingSoonTT, units), ValueWithUnit(eatingSoonTTDuration, Units.M))
|
||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||
timestamp = System.currentTimeMillis(),
|
||||
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
||||
|
|
|
@ -303,49 +303,49 @@ class LoopDialog : DaggerDialogFragment() {
|
|||
}
|
||||
|
||||
R.id.overview_suspend_1h -> {
|
||||
uel.log(Action.SUSPEND_1H)
|
||||
uel.log(Action.SUSPEND, ValueWithUnit(1, Units.H))
|
||||
loopPlugin.suspendLoop(60)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_suspend_2h -> {
|
||||
uel.log(Action.SUSPEND_2H)
|
||||
uel.log(Action.SUSPEND, ValueWithUnit(2, Units.H))
|
||||
loopPlugin.suspendLoop(120)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_suspend_3h -> {
|
||||
uel.log(Action.SUSPEND_3H)
|
||||
uel.log(Action.SUSPEND, ValueWithUnit(3, Units.H))
|
||||
loopPlugin.suspendLoop(180)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_suspend_10h -> {
|
||||
uel.log(Action.SUSPEND_10H)
|
||||
uel.log(Action.SUSPEND, ValueWithUnit(10, Units.H))
|
||||
loopPlugin.suspendLoop(600)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_disconnect_15m -> {
|
||||
uel.log(Action.DISCONNECT_15M)
|
||||
uel.log(Action.DISCONNECT, ValueWithUnit(15, Units.M))
|
||||
loopPlugin.disconnectPump(15, profile)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_disconnect_30m -> {
|
||||
uel.log(Action.DISCONNECT_30M)
|
||||
uel.log(Action.DISCONNECT, ValueWithUnit(30, Units.M))
|
||||
loopPlugin.disconnectPump(30, profile)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_disconnect_1h -> {
|
||||
uel.log(Action.DISCONNECT_1H)
|
||||
uel.log(Action.DISCONNECT, ValueWithUnit(1, Units.H))
|
||||
loopPlugin.disconnectPump(60, profile)
|
||||
sp.putBoolean(R.string.key_objectiveusedisconnect, true)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
|
@ -353,14 +353,14 @@ class LoopDialog : DaggerDialogFragment() {
|
|||
}
|
||||
|
||||
R.id.overview_disconnect_2h -> {
|
||||
uel.log(Action.DISCONNECT_2H)
|
||||
uel.log(Action.DISCONNECT, ValueWithUnit(2, Units.H))
|
||||
loopPlugin.disconnectPump(120, profile)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
}
|
||||
|
||||
R.id.overview_disconnect_3h -> {
|
||||
uel.log(Action.DISCONNECT_3H)
|
||||
uel.log(Action.DISCONNECT, ValueWithUnit(3, Units.H))
|
||||
loopPlugin.disconnectPump(180, profile)
|
||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||
return true
|
||||
|
|
|
@ -181,9 +181,9 @@ class TempTargetDialog : DialogFragmentWithDate() {
|
|||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||
val units = profileFunction.getUnits()
|
||||
when(reason) {
|
||||
resourceHelper.gs(R.string.eatingsoon) -> uel.log(Action.TT_EATING_SOON, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT_ACTIVITY, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT_HYPO, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.eatingsoon) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TT_Reason), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.ACTIVITY.text, Units.TT_Reason), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.HYPOGLYCEMIA.text, Units.TT_Reason), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.manual) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
||||
resourceHelper.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged))
|
||||
}
|
||||
|
@ -213,6 +213,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
|
|||
aapsLogger.error(LTag.BGSOURCE, "Error while saving temporary target", it)
|
||||
})
|
||||
}
|
||||
|
||||
if (duration == 10) sp.putBoolean(R.string.key_objectiveusetemptarget, true)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -433,7 +433,7 @@ public class NSClientPlugin extends PluginBase {
|
|||
// room Therapy Event
|
||||
TherapyEvent therapyEvent = therapyEventFromNsIdForInvalidating(_id);
|
||||
disposable.add(repository.runTransactionForResult(new SyncTherapyEventTransaction(therapyEvent)).subscribe(
|
||||
result -> result.getInvalidated().forEach(record -> uel.log(Action.CAREPORTAL_DELETED_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.CPEvent))),
|
||||
result -> result.getInvalidated().forEach(record -> uel.log(Action.CAREPORTAL_DELETED_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.TherapyEvent))),
|
||||
error -> aapsLogger.error(LTag.DATABASE, "Error while removing therapy event", error)));
|
||||
// new DB model
|
||||
EventNsTreatment evtTreatment = new EventNsTreatment(EventNsTreatment.Companion.getREMOVE(), json);
|
||||
|
@ -493,8 +493,8 @@ public class NSClientPlugin extends PluginBase {
|
|||
disposable.add(repository.runTransactionForResult(new SyncTherapyEventTransaction(therapyEvent))
|
||||
.subscribe(
|
||||
result -> {
|
||||
result.getInserted().forEach(record -> uel.log(Action.CAREPORTAL_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.CPEvent)));
|
||||
result.getInvalidated().forEach(record -> uel.log(Action.CAREPORTAL_DELETED_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.CPEvent)));
|
||||
result.getInserted().forEach(record -> uel.log(Action.CAREPORTAL_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.TherapyEvent)));
|
||||
result.getInvalidated().forEach(record -> uel.log(Action.CAREPORTAL_DELETED_FROM_NS, record.getNote() , new ValueWithUnit(record.getTimestamp(), Units.Timestamp, true), new ValueWithUnit(record.getType().getText(), Units.TherapyEvent)));
|
||||
},
|
||||
error -> aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", error)));
|
||||
} else {
|
||||
|
|
|
@ -196,7 +196,7 @@ class TreatmentsCareportalFragment : DaggerFragment() {
|
|||
resourceHelper.gs(R.string.notes_label) + ": " + (therapyEvent.note ?: "") + "\n" +
|
||||
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(therapyEvent.timestamp)
|
||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||
uel.log(Action.CAREPORTAL_REMOVED, therapyEvent.note ?: "", ValueWithUnit(therapyEvent.type.text, Units.CPEvent), ValueWithUnit(therapyEvent.timestamp, Units.Timestamp))
|
||||
uel.log(Action.CAREPORTAL_REMOVED, therapyEvent.note ?: "", ValueWithUnit(therapyEvent.type.text, Units.TherapyEvent), ValueWithUnit(therapyEvent.timestamp, Units.Timestamp))
|
||||
disposable += repository.runTransactionForResult(InvalidateTherapyEventTransaction(therapyEvent.id))
|
||||
.subscribe({
|
||||
val id = therapyEvent.interfaceIDs.nightscoutId
|
||||
|
|
|
@ -126,9 +126,9 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
|
|||
rStringParam--
|
||||
else
|
||||
when (v.unit) {
|
||||
Units.Timestamp -> valuesWithUnitString += dateUtil.dateAndTimeAndSecondsString(v.lValue) + separator
|
||||
Units.CPEvent -> valuesWithUnitString += translator.translate(v.sValue) + separator
|
||||
Units.TT_Reason -> valuesWithUnitString += translator.translate(v.sValue) + separator
|
||||
Units.Timestamp -> valuesWithUnitString += dateUtil.dateAndTimeAndSecondsString(v.lValue) + separator
|
||||
Units.TherapyEvent -> valuesWithUnitString += translator.translate(v.sValue) + separator
|
||||
Units.TT_Reason -> valuesWithUnitString += translator.translate(v.sValue) + separator
|
||||
Units.R_String -> {
|
||||
rStringParam = v.lValue.toInt()
|
||||
when (rStringParam) { //
|
||||
|
|
|
@ -349,7 +349,7 @@ class BolusWizard @Inject constructor(
|
|||
boluscalc = nsJSON()
|
||||
source = Source.USER
|
||||
notes = this@BolusWizard.notes
|
||||
uel.log(Action.BOLUS_ADVISOR, ValueWithUnit(insulinAfterConstraints, Units.U))
|
||||
uel.log(Action.BOLUS_ADVISOR, notes, ValueWithUnit(eventType, Units.TherapyEvent), ValueWithUnit(insulinAfterConstraints, Units.U))
|
||||
if (insulin > 0) {
|
||||
commandQueue.bolus(this, object : Callback() {
|
||||
override fun run() {
|
||||
|
@ -413,7 +413,7 @@ class BolusWizard @Inject constructor(
|
|||
boluscalc = nsJSON()
|
||||
source = Source.USER
|
||||
notes = this@BolusWizard.notes
|
||||
uel.log(Action.BOLUS_WIZARD, notes, ValueWithUnit(insulinAfterConstraints, Units.U), ValueWithUnit(this@BolusWizard.carbs, Units.G, this@BolusWizard.carbs != 0), ValueWithUnit(carbTime, Units.M, carbTime != 0))
|
||||
uel.log(Action.BOLUS, notes, ValueWithUnit(eventType,Units.TherapyEvent), ValueWithUnit(insulinAfterConstraints, Units.U), ValueWithUnit(this@BolusWizard.carbs, Units.G, this@BolusWizard.carbs != 0), ValueWithUnit(carbTime, Units.M, carbTime != 0))
|
||||
if (insulin > 0 || pump.pumpDescription.storesCarbInfo) {
|
||||
commandQueue.bolus(this, object : Callback() {
|
||||
override fun run() {
|
||||
|
|
|
@ -933,7 +933,6 @@
|
|||
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
|
||||
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
|
||||
<string name="format_percent">%1$d%%</string>
|
||||
<string name="boluswizard">Bolus wizard</string>
|
||||
<string name="unit_minute_short">min</string>
|
||||
<string name="profile_name">Profile name:</string>
|
||||
<string name="selected_profile">Selected:</string>
|
||||
|
|
|
@ -111,9 +111,9 @@ class ClassicPrefsFormat @Inject constructor(
|
|||
|
||||
fun valueWithUnitToCsv(v: ValueWithUnit): String {
|
||||
return when (v.unit) {
|
||||
Units.Timestamp -> dateUtil.dateAndTimeAndSecondsString(v.lValue) + ";" + csvString(R.string.date)
|
||||
Units.CPEvent -> csvString(translator.translate(v.sValue)) + ";"
|
||||
Units.TT_Reason -> csvString(translator.translate(v.sValue)) + ";"
|
||||
Units.Timestamp -> dateUtil.dateAndTimeAndSecondsString(v.lValue) + ";" + csvString(R.string.date)
|
||||
Units.TherapyEvent -> csvString(translator.translate(v.sValue)) + ";"
|
||||
Units.TT_Reason -> csvString(translator.translate(v.sValue)) + ";"
|
||||
Units.R_String -> if (v.lValue.toInt() == 0) csvString(v.iValue) + ";" else ";" //If lValue > 0 it's a formated string, so hidden for
|
||||
Units.Mg_Dl -> if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue) + ";" + csvString(Units.Mg_Dl) else DecimalFormatter.to1Decimal(v.dValue/Constants.MMOLL_TO_MGDL) + ";" + csvString(Units.Mmol_L)
|
||||
Units.Mmol_L -> if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue*Constants.MMOLL_TO_MGDL) + ";" + csvString(Units.Mg_Dl) else DecimalFormatter.to1Decimal(v.dValue) + ";" + csvString(Units.Mmol_L)
|
||||
|
|
|
@ -20,6 +20,7 @@ class Translator @Inject internal constructor(
|
|||
TherapyEvent.Type.MEAL_BOLUS.text -> resourceHelper.gs(R.string.careportal_mealbolus)
|
||||
TherapyEvent.Type.CORRECTION_BOLUS.text -> resourceHelper.gs(R.string.careportal_correctionbolus)
|
||||
TherapyEvent.Type.CARBS_CORRECTION.text -> resourceHelper.gs(R.string.careportal_carbscorrection)
|
||||
TherapyEvent.Type.BOLUS_WIZARD.text -> resourceHelper.gs(R.string.boluswizard)
|
||||
TherapyEvent.Type.COMBO_BOLUS.text -> resourceHelper.gs(R.string.careportal_combobolus)
|
||||
TherapyEvent.Type.ANNOUNCEMENT.text -> resourceHelper.gs(R.string.careportal_announcement)
|
||||
TherapyEvent.Type.NOTE.text -> resourceHelper.gs(R.string.careportal_note)
|
||||
|
@ -51,7 +52,6 @@ class Translator @Inject internal constructor(
|
|||
TemporaryTarget.Reason.WEAR.text -> resourceHelper.gs(R.string.wear)
|
||||
|
||||
Action.BOLUS.name -> resourceHelper.gs(R.string.uel_bolus)
|
||||
Action.BOLUS_WIZARD.name -> resourceHelper.gs(R.string.uel_bolus_wizard)
|
||||
Action.BOLUS_ADVISOR.name -> resourceHelper.gs(R.string.uel_bolus_advisor)
|
||||
Action.BOLUS_RECORD.name -> resourceHelper.gs(R.string.uel_bolus_record)
|
||||
Action.EXTENDED_BOLUS.name -> resourceHelper.gs(R.string.uel_extended_bolus)
|
||||
|
@ -60,9 +60,6 @@ class Translator @Inject internal constructor(
|
|||
Action.EXTENDED_CARBS.name -> resourceHelper.gs(R.string.uel_extended_carbs)
|
||||
Action.TEMP_BASAL.name -> resourceHelper.gs(R.string.uel_temp_basal)
|
||||
Action.TT.name -> resourceHelper.gs(R.string.uel_tt)
|
||||
Action.TT_ACTIVITY.name -> resourceHelper.gs(R.string.uel_tt_activity)
|
||||
Action.TT_EATING_SOON.name -> resourceHelper.gs(R.string.uel_tt_eating_soon)
|
||||
Action.TT_HYPO.name -> resourceHelper.gs(R.string.uel_tt_hypo)
|
||||
Action.NEW_PROFILE.name -> resourceHelper.gs(R.string.uel_new_profile)
|
||||
Action.CLONE_PROFILE.name -> resourceHelper.gs(R.string.uel_clone_profile)
|
||||
Action.STORE_PROFILE.name -> resourceHelper.gs(R.string.uel_store_profile)
|
||||
|
@ -74,16 +71,9 @@ class Translator @Inject internal constructor(
|
|||
Action.LOOP_DISABLED.name -> resourceHelper.gs(R.string.uel_loop_disabled)
|
||||
Action.LOOP_ENABLED.name -> resourceHelper.gs(R.string.uel_loop_enabled)
|
||||
Action.RECONNECT.name -> resourceHelper.gs(R.string.uel_reconnect)
|
||||
Action.DISCONNECT_15M.name -> resourceHelper.gs(R.string.uel_disconnect_15m)
|
||||
Action.DISCONNECT_30M.name -> resourceHelper.gs(R.string.uel_disconnect_30m)
|
||||
Action.DISCONNECT_1H.name -> resourceHelper.gs(R.string.uel_disconnect_1h)
|
||||
Action.DISCONNECT_2H.name -> resourceHelper.gs(R.string.uel_disconnect_2h)
|
||||
Action.DISCONNECT_3H.name -> resourceHelper.gs(R.string.uel_disconnect_3h)
|
||||
Action.DISCONNECT.name -> resourceHelper.gs(R.string.uel_disconnect)
|
||||
Action.RESUME.name -> resourceHelper.gs(R.string.uel_resume)
|
||||
Action.SUSPEND_1H.name -> resourceHelper.gs(R.string.uel_suspend_1h)
|
||||
Action.SUSPEND_2H.name -> resourceHelper.gs(R.string.uel_suspend_2h)
|
||||
Action.SUSPEND_3H.name -> resourceHelper.gs(R.string.uel_suspend_3h)
|
||||
Action.SUSPEND_10H.name -> resourceHelper.gs(R.string.uel_suspend_10h)
|
||||
Action.SUSPEND.name -> resourceHelper.gs(R.string.uel_suspend)
|
||||
Action.HW_PUMP_ALLOWED.name -> resourceHelper.gs(R.string.uel_hw_pump_allowed)
|
||||
Action.CLEAR_PAIRING_KEYS.name -> resourceHelper.gs(R.string.uel_clear_pairing_keys)
|
||||
Action.ACCEPTS_TEMP_BASAL.name -> resourceHelper.gs(R.string.uel_accepts_temp_basal)
|
||||
|
@ -92,9 +82,7 @@ class Translator @Inject internal constructor(
|
|||
Action.CANCEL_TT.name -> resourceHelper.gs(R.string.uel_cancel_tt)
|
||||
Action.CAREPORTAL.name -> resourceHelper.gs(R.string.uel_careportal)
|
||||
Action.CALIBRATION.name -> resourceHelper.gs(R.string.uel_calibration)
|
||||
Action.INSULIN_CHANGE.name -> resourceHelper.gs(R.string.uel_insulin_change)
|
||||
Action.PRIME_BOLUS.name -> resourceHelper.gs(R.string.uel_prime_bolus)
|
||||
Action.SITE_CHANGE.name -> resourceHelper.gs(R.string.uel_site_change)
|
||||
Action.TREATMENT.name -> resourceHelper.gs(R.string.uel_treatment)
|
||||
Action.CAREPORTAL_NS_REFRESH.name -> resourceHelper.gs(R.string.uel_careportal_ns_refresh)
|
||||
Action.PROFILE_SWITCH_NS_REFRESH.name -> resourceHelper.gs(R.string.uel_profile_switch_ns_refresh)
|
||||
|
|
|
@ -265,6 +265,7 @@
|
|||
<string name="careportal_pumpbatterychange">Pump Battery Change</string>
|
||||
<string name="careportal_temporarytarget">Temporary target</string>
|
||||
<string name="careportal_temporarytargetcancel">Temporary target cancel</string>
|
||||
<string name="boluswizard">Bolus wizard</string>
|
||||
<string name="glucosetype_finger">Finger</string>
|
||||
<string name="glucosetype_sensor">Sensor</string>
|
||||
<string name="manual">Manual</string>
|
||||
|
@ -399,7 +400,6 @@
|
|||
|
||||
<!-- User Entry -->
|
||||
<string name="uel_bolus">BOLUS</string>
|
||||
<string name="uel_bolus_wizard">BOLUS WIZARD</string>
|
||||
<string name="uel_bolus_advisor">BOLUS ADVISOR</string>
|
||||
<string name="uel_bolus_record">BOLUS RECORD</string>
|
||||
<string name="uel_extended_bolus">EXTENDED BOLUS</string>
|
||||
|
@ -408,9 +408,6 @@
|
|||
<string name="uel_extended_carbs">EXTENDED CARBS</string>
|
||||
<string name="uel_temp_basal">TEMP BASAL</string>
|
||||
<string name="uel_tt">TT</string>
|
||||
<string name="uel_tt_activity">TT ACTIVITY</string>
|
||||
<string name="uel_tt_eating_soon">TT EATING SOON</string>
|
||||
<string name="uel_tt_hypo">TT HYPO</string>
|
||||
<string name="uel_new_profile">NEW PROFILE</string>
|
||||
<string name="uel_clone_profile">CLONE PROFILE</string>
|
||||
<string name="uel_store_profile">STORE PROFILE</string>
|
||||
|
@ -422,16 +419,9 @@
|
|||
<string name="uel_loop_disabled">LOOP DISABLED</string>
|
||||
<string name="uel_loop_enabled">LOOP ENABLED</string>
|
||||
<string name="uel_reconnect">RECONNECT</string>
|
||||
<string name="uel_disconnect_15m">DISCONNECT 15M</string>
|
||||
<string name="uel_disconnect_30m">DISCONNECT 30M</string>
|
||||
<string name="uel_disconnect_1h">DISCONNECT 1H</string>
|
||||
<string name="uel_disconnect_2h">DISCONNECT 2H</string>
|
||||
<string name="uel_disconnect_3h">DISCONNECT 3H</string>
|
||||
<string name="uel_disconnect">DISCONNECT</string>
|
||||
<string name="uel_resume">RESUME</string>
|
||||
<string name="uel_suspend_1h">SUSPEND 1H</string>
|
||||
<string name="uel_suspend_2h">SUSPEND 2H</string>
|
||||
<string name="uel_suspend_3h">SUSPEND 3H</string>
|
||||
<string name="uel_suspend_10h">SUSPEND 10H</string>
|
||||
<string name="uel_suspend">SUSPEND</string>
|
||||
<string name="uel_hw_pump_allowed">HW PUMP ALLOWED</string>
|
||||
<string name="uel_clear_pairing_keys">CLEAR PAIRING KEYS</string>
|
||||
<string name="uel_accepts_temp_basal">ACCEPTS TEMP BASAL</string>
|
||||
|
@ -440,9 +430,7 @@
|
|||
<string name="uel_cancel_tt">CANCEL TT</string>
|
||||
<string name="uel_careportal">CAREPORTAL</string>
|
||||
<string name="uel_calibration">CALIBRATION</string>
|
||||
<string name="uel_insulin_change">INSULIN CHANGE</string>
|
||||
<string name="uel_prime_bolus">PRIME BOLUS</string>
|
||||
<string name="uel_site_change">SITE CHANGE</string>
|
||||
<string name="uel_treatment">TREATMENT</string>
|
||||
<string name="uel_careportal_ns_refresh">CAREPORTAL NS REFRESH</string>
|
||||
<string name="uel_profile_switch_ns_refresh">PROFILE SWITCH NS REFRESH</string>
|
||||
|
|
|
@ -20,7 +20,6 @@ data class UserEntry(
|
|||
) : DBEntry, DBEntryWithTime {
|
||||
enum class Action (val colorGroup: ColorGroup) {
|
||||
@SerializedName("BOLUS") BOLUS (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("BOLUS_WIZARD") BOLUS_WIZARD (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("BOLUS_ADVISOR") BOLUS_ADVISOR (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("BOLUS_RECORD") BOLUS_RECORD (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("EXTENDED_BOLUS") EXTENDED_BOLUS (ColorGroup.InsulinTreatment),
|
||||
|
@ -29,9 +28,6 @@ data class UserEntry(
|
|||
@SerializedName("EXTENDED_CARBS") EXTENDED_CARBS (ColorGroup.CarbTreatment),
|
||||
@SerializedName("TEMP_BASAL") TEMP_BASAL (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("TT") TT (ColorGroup.TT),
|
||||
@SerializedName("TT_ACTIVITY") TT_ACTIVITY (ColorGroup.TT),
|
||||
@SerializedName("TT_EATING_SOON") TT_EATING_SOON (ColorGroup.TT),
|
||||
@SerializedName("TT_HYPO") TT_HYPO (ColorGroup.TT),
|
||||
@SerializedName("NEW_PROFILE") NEW_PROFILE (ColorGroup.Profile),
|
||||
@SerializedName("CLONE_PROFILE") CLONE_PROFILE (ColorGroup.Profile),
|
||||
@SerializedName("STORE_PROFILE") STORE_PROFILE (ColorGroup.Profile),
|
||||
|
@ -43,16 +39,9 @@ data class UserEntry(
|
|||
@SerializedName("LOOP_DISABLED") LOOP_DISABLED (ColorGroup.Loop),
|
||||
@SerializedName("LOOP_ENABLED") LOOP_ENABLED (ColorGroup.Loop),
|
||||
@SerializedName("RECONNECT") RECONNECT (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT_15M") DISCONNECT_15M (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT_30M") DISCONNECT_30M (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT_1H") DISCONNECT_1H (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT_2H") DISCONNECT_2H (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT_3H") DISCONNECT_3H (ColorGroup.Pump),
|
||||
@SerializedName("DISCONNECT") DISCONNECT (ColorGroup.Pump),
|
||||
@SerializedName("RESUME") RESUME (ColorGroup.Loop),
|
||||
@SerializedName("SUSPEND_1H") SUSPEND_1H (ColorGroup.Loop),
|
||||
@SerializedName("SUSPEND_2H") SUSPEND_2H (ColorGroup.Loop),
|
||||
@SerializedName("SUSPEND_3H") SUSPEND_3H (ColorGroup.Loop),
|
||||
@SerializedName("SUSPEND_10H") SUSPEND_10H (ColorGroup.Loop),
|
||||
@SerializedName("SUSPEND") SUSPEND (ColorGroup.Loop),
|
||||
@SerializedName("HW_PUMP_ALLOWED") HW_PUMP_ALLOWED (ColorGroup.Pump),
|
||||
@SerializedName("CLEAR_PAIRING_KEYS") CLEAR_PAIRING_KEYS (ColorGroup.Pump),
|
||||
@SerializedName("ACCEPTS_TEMP_BASAL") ACCEPTS_TEMP_BASAL (ColorGroup.InsulinTreatment),
|
||||
|
@ -61,9 +50,7 @@ data class UserEntry(
|
|||
@SerializedName("CANCEL_TT") CANCEL_TT (ColorGroup.TT),
|
||||
@SerializedName("CAREPORTAL") CAREPORTAL (ColorGroup.Careportal),
|
||||
@SerializedName("CALIBRATION") CALIBRATION (ColorGroup.Careportal),
|
||||
@SerializedName("INSULIN_CHANGE") INSULIN_CHANGE (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("PRIME_BOLUS") PRIME_BOLUS (ColorGroup.Careportal),
|
||||
@SerializedName("SITE_CHANGE") SITE_CHANGE (ColorGroup.Careportal),
|
||||
@SerializedName("TREATMENT") TREATMENT (ColorGroup.InsulinTreatment),
|
||||
@SerializedName("CAREPORTAL_NS_REFRESH") CAREPORTAL_NS_REFRESH (ColorGroup.Aaps),
|
||||
@SerializedName("PROFILE_SWITCH_NS_REFRESH") PROFILE_SWITCH_NS_REFRESH (ColorGroup.Aaps),
|
||||
|
@ -142,19 +129,19 @@ data class UserEntry(
|
|||
}
|
||||
}
|
||||
enum class Units(val text: String) {
|
||||
@SerializedName("None") None (""), //Int or String
|
||||
@SerializedName("Mg_Dl") Mg_Dl ("mg/dl"), //Double
|
||||
@SerializedName("Mmol_L") Mmol_L ("mmol"), //Double
|
||||
@SerializedName("Timestamp") Timestamp("Timestamp"), //long
|
||||
@SerializedName("U") U ("U"), //Double
|
||||
@SerializedName("U_H") U_H ("U/h"), //Double
|
||||
@SerializedName("G") G ("g"), //Int
|
||||
@SerializedName("M") M ("m"), //Int
|
||||
@SerializedName("H") H ("h"), //Int
|
||||
@SerializedName("Percent") Percent ("%"), //Int
|
||||
@SerializedName("CPEvent") CPEvent ("CPEvent"), //String (CareportalEvent.Event => Translated by Translator function)
|
||||
@SerializedName("TT_Reason") TT_Reason ("TTReason"), //TemporaryTarget.Reason => String (to Improve for translation)
|
||||
@SerializedName("R_String") R_String ("R.string") //Int
|
||||
@SerializedName("None") None (""), //Int or String
|
||||
@SerializedName("Mg_Dl") Mg_Dl ("mg/dl"), //Double
|
||||
@SerializedName("Mmol_L") Mmol_L ("mmol"), //Double
|
||||
@SerializedName("Timestamp") Timestamp("Timestamp"), //long
|
||||
@SerializedName("U") U ("U"), //Double
|
||||
@SerializedName("U_H") U_H ("U/h"), //Double
|
||||
@SerializedName("G") G ("g"), //Int
|
||||
@SerializedName("M") M ("m"), //Int
|
||||
@SerializedName("H") H ("h"), //Int
|
||||
@SerializedName("Percent") Percent ("%"), //Int
|
||||
@SerializedName("TherapyEvent") TherapyEvent ("TherapyEvent"), //String (CareportalEvent.Event => Translated by Translator function)
|
||||
@SerializedName("TT_Reason") TT_Reason ("TTReason"), //TemporaryTarget.Reason => String (to Improve for translation)
|
||||
@SerializedName("R_String") R_String ("R.string") //Int
|
||||
;
|
||||
|
||||
companion object {
|
||||
|
|
Loading…
Reference in a new issue