idea: value with unit as sealed class
This commit is contained in:
parent
906fc35da5
commit
2da872bbfe
|
@ -2,6 +2,22 @@
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
<option name="AUTODETECT_INDENTS" value="false" />
|
<option name="AUTODETECT_INDENTS" value="false" />
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
|
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||||
|
<value>
|
||||||
|
<package name="java.util" alias="false" withSubpackages="false" />
|
||||||
|
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||||
|
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||||
|
<value>
|
||||||
|
<package name="" alias="false" withSubpackages="true" />
|
||||||
|
<package name="java" alias="false" withSubpackages="true" />
|
||||||
|
<package name="javax" alias="false" withSubpackages="true" />
|
||||||
|
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||||
|
<package name="" alias="true" withSubpackages="true" />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
|
<option name="ALIGN_IN_COLUMNS_CASE_BRANCH" value="true" />
|
||||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" />
|
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="6" />
|
||||||
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" />
|
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="6" />
|
||||||
|
|
|
@ -9,6 +9,7 @@ import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.Constants
|
import info.nightscout.androidaps.Constants
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogCalibrationBinding
|
import info.nightscout.androidaps.databinding.DialogCalibrationBinding
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -79,7 +80,7 @@ class CalibrationDialog : DialogFragmentWithDate() {
|
||||||
if (bg > 0) {
|
if (bg > 0) {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.overview_calibration), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.overview_calibration), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
uel.log(Action.CALIBRATION, ValueWithUnit(bg, units))
|
uel.log(Action.CALIBRATION, XXXValueWithUnit.fromGlucoseUnit(bg, units))
|
||||||
xdripCalibrations.sendIntent(bg)
|
xdripCalibrations.sendIntent(bg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import info.nightscout.androidaps.MainApp
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
|
@ -222,7 +223,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.carbs), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
when {
|
when {
|
||||||
activitySelected -> {
|
activitySelected -> {
|
||||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.ACTIVITY.text, Units.TherapyEvent), ValueWithUnit(activityTT, units) , ValueWithUnit(activityTTDuration, Units.M))
|
uel.log(Action.TT, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.ACTIVITY.text), XXXValueWithUnit.fromGlucoseUnit(activityTT, units) , XXXValueWithUnit.Minute(activityTTDuration))
|
||||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
duration = TimeUnit.MINUTES.toMillis(activityTTDuration.toLong()),
|
duration = TimeUnit.MINUTES.toMillis(activityTTDuration.toLong()),
|
||||||
|
@ -238,7 +239,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
eatingSoonSelected -> {
|
eatingSoonSelected -> {
|
||||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TherapyEvent), ValueWithUnit(eatingSoonTT, units) , ValueWithUnit(eatingSoonTTDuration, Units.M))
|
uel.log(Action.TT, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.EATING_SOON.text), XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units) , XXXValueWithUnit.Minute(eatingSoonTTDuration))
|
||||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
||||||
|
@ -254,7 +255,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
hypoSelected -> {
|
hypoSelected -> {
|
||||||
uel.log(Action.TT, ValueWithUnit(TemporaryTarget.Reason.HYPOGLYCEMIA.text, Units.TherapyEvent), ValueWithUnit(hypoTT, units) , ValueWithUnit(hypoTTDuration, Units.M))
|
uel.log(Action.TT, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.HYPOGLYCEMIA.text), XXXValueWithUnit.fromGlucoseUnit(hypoTT, units) , XXXValueWithUnit.Minute(hypoTTDuration))
|
||||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
duration = TimeUnit.MINUTES.toMillis(hypoTTDuration.toLong()),
|
duration = TimeUnit.MINUTES.toMillis(hypoTTDuration.toLong()),
|
||||||
|
@ -276,7 +277,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
carbsGenerator.generateCarbs(carbsAfterConstraints, time, duration, notes)
|
carbsGenerator.generateCarbs(carbsAfterConstraints, time, duration, notes)
|
||||||
nsUpload.uploadEvent(TherapyEvent.Type.NOTE.text, DateUtil.now() - 2000, resourceHelper.gs(R.string.generated_ecarbs_note, carbsAfterConstraints, duration, timeOffset))
|
nsUpload.uploadEvent(TherapyEvent.Type.NOTE.text, DateUtil.now() - 2000, resourceHelper.gs(R.string.generated_ecarbs_note, carbsAfterConstraints, duration, timeOffset))
|
||||||
}
|
}
|
||||||
uel.log(Action.CARBS, notes, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(carbsAfterConstraints, Units.G), ValueWithUnit(timeOffset, Units.M, timeOffset != 0), ValueWithUnit(duration, Units.H, duration != 0))
|
uel.log(Action.CARBS, notes, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.Gram(carbsAfterConstraints), XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset != 0 }, XXXValueWithUnit.Hour(duration).takeIf { duration != 0 })
|
||||||
}
|
}
|
||||||
if (useAlarm && carbs > 0 && timeOffset > 0) {
|
if (useAlarm && carbs > 0 && timeOffset > 0) {
|
||||||
carbTimer.scheduleReminder(dateUtil._now() + T.mins(timeOffset.toLong()).msecs())
|
carbTimer.scheduleReminder(dateUtil._now() + T.mins(timeOffset.toLong()).msecs())
|
||||||
|
|
|
@ -14,6 +14,7 @@ import info.nightscout.androidaps.MainApp
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.transactions.InsertTherapyEventIfNewTransaction
|
import info.nightscout.androidaps.database.transactions.InsertTherapyEventIfNewTransaction
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
|
@ -60,7 +61,7 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private var options: EventType = EventType.BGCHECK
|
private var options: EventType = EventType.BGCHECK
|
||||||
private var valuesWithUnit = mutableListOf<ValueWithUnit>()
|
private var valuesWithUnit = mutableListOf<XXXValueWithUnit?>()
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
private var event: Int = R.string.none
|
private var event: Int = R.string.none
|
||||||
|
@ -198,17 +199,17 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
binding.sensor.isChecked -> TherapyEvent.MeterType.SENSOR
|
binding.sensor.isChecked -> TherapyEvent.MeterType.SENSOR
|
||||||
else -> TherapyEvent.MeterType.MANUAL
|
else -> TherapyEvent.MeterType.MANUAL
|
||||||
}
|
}
|
||||||
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_glucosetype) + ": " + translator.translate(meterType.text))
|
actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_glucosetype) + ": " + translator.translate(meterType))
|
||||||
actions.add(resourceHelper.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(profileFunction, binding.bg.value) + " " + resourceHelper.gs(unitResId))
|
actions.add(resourceHelper.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(profileFunction, binding.bg.value) + " " + resourceHelper.gs(unitResId))
|
||||||
therapyEvent.glucoseType = meterType
|
therapyEvent.glucoseType = meterType
|
||||||
therapyEvent.glucose = binding.bg.value
|
therapyEvent.glucose = binding.bg.value
|
||||||
valuesWithUnit.add(ValueWithUnit(binding.bg.value.toDouble(), profileFunction.getUnits()))
|
valuesWithUnit.add(XXXValueWithUnit.fromGlucoseUnit(binding.bg.value.toDouble(), profileFunction.getUnits()))
|
||||||
valuesWithUnit.add(ValueWithUnit(meterType.text, Units.TherapyEvent))
|
valuesWithUnit.add(XXXValueWithUnit.TherapyEvent(meterType.text))
|
||||||
}
|
}
|
||||||
if (options == EventType.NOTE || options == EventType.EXERCISE) {
|
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()))
|
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()
|
therapyEvent.duration = T.mins(binding.duration.value.toLong()).msecs()
|
||||||
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()
|
val notes = binding.notesLayout.notes.text.toString()
|
||||||
if (notes.isNotEmpty()) {
|
if (notes.isNotEmpty()) {
|
||||||
|
@ -227,8 +228,8 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
}, {
|
}, {
|
||||||
aapsLogger.error(LTag.BGSOURCE, "Error while saving therapy event", it)
|
aapsLogger.error(LTag.BGSOURCE, "Error while saving therapy event", it)
|
||||||
})
|
})
|
||||||
valuesWithUnit.add(0, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged))
|
valuesWithUnit.add(0, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
|
||||||
valuesWithUnit.add(1, ValueWithUnit(therapyEvent.type.text, Units.TherapyEvent))
|
valuesWithUnit.add(1, XXXValueWithUnit.TherapyEvent(therapyEvent.type.text))
|
||||||
uel.log(Action.CAREPORTAL, notes, valuesWithUnit)
|
uel.log(Action.CAREPORTAL, notes, valuesWithUnit)
|
||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding
|
import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
@ -88,7 +89,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
|
||||||
|
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.extended_bolus), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.extended_bolus), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
uel.log(Action.EXTENDED_BOLUS, ValueWithUnit(insulinAfterConstraint, Units.U), ValueWithUnit(durationInMinutes, Units.M))
|
uel.log(Action.EXTENDED_BOLUS, XXXValueWithUnit.Insulin(insulinAfterConstraint), XXXValueWithUnit.Minute(durationInMinutes))
|
||||||
commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() {
|
commandQueue.extendedBolus(insulinAfterConstraint, durationInMinutes, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.transactions.InsertTherapyEventIfNewTransaction
|
import info.nightscout.androidaps.database.transactions.InsertTherapyEventIfNewTransaction
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
|
@ -124,7 +125,7 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
val insulinChange = binding.fillCartridgeChange.isChecked
|
val insulinChange = binding.fillCartridgeChange.isChecked
|
||||||
if (insulinChange)
|
if (insulinChange)
|
||||||
actions.add(resourceHelper.gs(R.string.record_insulin_cartridge_change).formatColor(resourceHelper, R.color.actionsConfirm))
|
actions.add(resourceHelper.gs(R.string.record_insulin_cartridge_change).formatColor(resourceHelper, R.color.actionsConfirm))
|
||||||
val notes = binding.notesLayout.notes.text.toString()
|
val notes: String = binding.notesLayout.notes.text.toString()
|
||||||
if (notes.isNotEmpty())
|
if (notes.isNotEmpty())
|
||||||
actions.add(resourceHelper.gs(R.string.notes_label) + ": " + notes)
|
actions.add(resourceHelper.gs(R.string.notes_label) + ": " + notes)
|
||||||
eventTime -= eventTime % 1000
|
eventTime -= eventTime % 1000
|
||||||
|
@ -136,11 +137,11 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.primefill), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.primefill), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
if (insulinAfterConstraints > 0) {
|
if (insulinAfterConstraints > 0) {
|
||||||
uel.log(Action.PRIME_BOLUS, notes, ValueWithUnit(insulinAfterConstraints, Units.U, insulinAfterConstraints != 0.0))
|
uel.log(Action.PRIME_BOLUS, notes, XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 })
|
||||||
requestPrimeBolus(insulinAfterConstraints, notes)
|
requestPrimeBolus(insulinAfterConstraints, notes)
|
||||||
}
|
}
|
||||||
if (siteChange) {
|
if (siteChange) {
|
||||||
uel.log(Action.CAREPORTAL, notes, ValueWithUnit(TherapyEvent.Type.CANNULA_CHANGE.text, Units.TherapyEvent))
|
uel.log(Action.CAREPORTAL, notes, XXXValueWithUnit.TherapyEvent(TherapyEvent.Type.CANNULA_CHANGE.text))
|
||||||
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
||||||
timestamp = eventTime,
|
timestamp = eventTime,
|
||||||
type = TherapyEvent.Type.CANNULA_CHANGE,
|
type = TherapyEvent.Type.CANNULA_CHANGE,
|
||||||
|
@ -154,7 +155,7 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
if (insulinChange) {
|
if (insulinChange) {
|
||||||
// add a second for case of both checked
|
// add a second for case of both checked
|
||||||
uel.log(Action.CAREPORTAL, notes, ValueWithUnit(TherapyEvent.Type.INSULIN_CHANGE.text, Units.TherapyEvent))
|
uel.log(Action.CAREPORTAL, notes, XXXValueWithUnit.TherapyEvent(TherapyEvent.Type.INSULIN_CHANGE.text))
|
||||||
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
disposable += repository.runTransactionForResult(InsertTherapyEventIfNewTransaction(
|
||||||
timestamp = eventTime + 1000,
|
timestamp = eventTime + 1000,
|
||||||
type = TherapyEvent.Type.INSULIN_CHANGE,
|
type = TherapyEvent.Type.INSULIN_CHANGE,
|
||||||
|
|
|
@ -15,6 +15,7 @@ import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
|
@ -189,7 +190,7 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.bolus), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.bolus), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
if (eatingSoonChecked) {
|
if (eatingSoonChecked) {
|
||||||
uel.log(Action.TT, notes, ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TherapyEvent), ValueWithUnit(eatingSoonTT, units), ValueWithUnit(eatingSoonTTDuration, Units.M))
|
uel.log(Action.TT, notes, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.EATING_SOON.text), XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units), XXXValueWithUnit.Minute(eatingSoonTTDuration))
|
||||||
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
disposable += repository.runTransactionForResult(InsertTemporaryTargetAndCancelCurrentTransaction(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
duration = TimeUnit.MINUTES.toMillis(eatingSoonTTDuration.toLong()),
|
||||||
|
@ -211,11 +212,11 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
detailedBolusInfo.source = Source.USER
|
detailedBolusInfo.source = Source.USER
|
||||||
detailedBolusInfo.notes = notes
|
detailedBolusInfo.notes = notes
|
||||||
if (recordOnlyChecked) {
|
if (recordOnlyChecked) {
|
||||||
uel.log(Action.BOLUS_RECORD, notes, ValueWithUnit(insulinAfterConstraints, Units.U), ValueWithUnit(timeOffset, Units.M, timeOffset!= 0))
|
uel.log(Action.BOLUS_RECORD, notes, XXXValueWithUnit.Insulin(insulinAfterConstraints), XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset!= 0 })
|
||||||
detailedBolusInfo.date = time
|
detailedBolusInfo.date = time
|
||||||
activePlugin.activeTreatments.addToHistoryTreatment(detailedBolusInfo, false)
|
activePlugin.activeTreatments.addToHistoryTreatment(detailedBolusInfo, false)
|
||||||
} else {
|
} else {
|
||||||
uel.log(Action.BOLUS, notes, ValueWithUnit(insulinAfterConstraints, Units.U))
|
uel.log(Action.BOLUS, notes, XXXValueWithUnit.Insulin(insulinAfterConstraints))
|
||||||
detailedBolusInfo.date = DateUtil.now()
|
detailedBolusInfo.date = DateUtil.now()
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import androidx.fragment.app.FragmentManager
|
||||||
import dagger.android.support.DaggerDialogFragment
|
import dagger.android.support.DaggerDialogFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogLoopBinding
|
import info.nightscout.androidaps.databinding.DialogLoopBinding
|
||||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||||
|
@ -287,7 +288,7 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_resume, R.id.overview_reconnect -> {
|
R.id.overview_resume, R.id.overview_reconnect -> {
|
||||||
uel.log(if (v.id==R.id.overview_resume) Action.RESUME else Action.RECONNECT )
|
uel.log(if (v.id == R.id.overview_resume) Action.RESUME else Action.RECONNECT )
|
||||||
loopPlugin.suspendTo(0L)
|
loopPlugin.suspendTo(0L)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
commandQueue.cancelTempBasal(true, object : Callback() {
|
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||||
|
@ -303,49 +304,49 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_suspend_1h -> {
|
R.id.overview_suspend_1h -> {
|
||||||
uel.log(Action.SUSPEND, ValueWithUnit(1, Units.H))
|
uel.log(Action.SUSPEND, XXXValueWithUnit.Hour(1))
|
||||||
loopPlugin.suspendLoop(60)
|
loopPlugin.suspendLoop(60)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_suspend_2h -> {
|
R.id.overview_suspend_2h -> {
|
||||||
uel.log(Action.SUSPEND, ValueWithUnit(2, Units.H))
|
uel.log(Action.SUSPEND, XXXValueWithUnit.Hour(2))
|
||||||
loopPlugin.suspendLoop(120)
|
loopPlugin.suspendLoop(120)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_suspend_3h -> {
|
R.id.overview_suspend_3h -> {
|
||||||
uel.log(Action.SUSPEND, ValueWithUnit(3, Units.H))
|
uel.log(Action.SUSPEND, XXXValueWithUnit.Hour(3))
|
||||||
loopPlugin.suspendLoop(180)
|
loopPlugin.suspendLoop(180)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_suspend_10h -> {
|
R.id.overview_suspend_10h -> {
|
||||||
uel.log(Action.SUSPEND, ValueWithUnit(10, Units.H))
|
uel.log(Action.SUSPEND, XXXValueWithUnit.Hour(10))
|
||||||
loopPlugin.suspendLoop(600)
|
loopPlugin.suspendLoop(600)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_15m -> {
|
R.id.overview_disconnect_15m -> {
|
||||||
uel.log(Action.DISCONNECT, ValueWithUnit(15, Units.M))
|
uel.log(Action.DISCONNECT, XXXValueWithUnit.Minute(15))
|
||||||
loopPlugin.disconnectPump(15, profile)
|
loopPlugin.disconnectPump(15, profile)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_30m -> {
|
R.id.overview_disconnect_30m -> {
|
||||||
uel.log(Action.DISCONNECT, ValueWithUnit(30, Units.M))
|
uel.log(Action.DISCONNECT, XXXValueWithUnit.Minute(30))
|
||||||
loopPlugin.disconnectPump(30, profile)
|
loopPlugin.disconnectPump(30, profile)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_1h -> {
|
R.id.overview_disconnect_1h -> {
|
||||||
uel.log(Action.DISCONNECT, ValueWithUnit(1, Units.H))
|
uel.log(Action.DISCONNECT, XXXValueWithUnit.Hour(1))
|
||||||
loopPlugin.disconnectPump(60, profile)
|
loopPlugin.disconnectPump(60, profile)
|
||||||
sp.putBoolean(R.string.key_objectiveusedisconnect, true)
|
sp.putBoolean(R.string.key_objectiveusedisconnect, true)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
|
@ -353,14 +354,14 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_2h -> {
|
R.id.overview_disconnect_2h -> {
|
||||||
uel.log(Action.DISCONNECT, ValueWithUnit(2, Units.H))
|
uel.log(Action.DISCONNECT, XXXValueWithUnit.Hour(2))
|
||||||
loopPlugin.disconnectPump(120, profile)
|
loopPlugin.disconnectPump(120, profile)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_3h -> {
|
R.id.overview_disconnect_3h -> {
|
||||||
uel.log(Action.DISCONNECT, ValueWithUnit(3, Units.H))
|
uel.log(Action.DISCONNECT, XXXValueWithUnit.Hour(3))
|
||||||
loopPlugin.disconnectPump(180, profile)
|
loopPlugin.disconnectPump(180, profile)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.widget.ArrayAdapter
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import info.nightscout.androidaps.Constants
|
import info.nightscout.androidaps.Constants
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogProfileswitchBinding
|
import info.nightscout.androidaps.databinding.DialogProfileswitchBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
@ -125,7 +126,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
|
||||||
|
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_profileswitch), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_profileswitch), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
uel.log(Action.PROFILE_SWITCH, notes, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(profile, Units.None), ValueWithUnit(percent, Units.Percent), ValueWithUnit(timeShift, Units.H, timeShift != 0), ValueWithUnit(duration, Units.M, duration != 0))
|
uel.log(Action.PROFILE_SWITCH, notes, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged } , XXXValueWithUnit.SimpleString(profile), XXXValueWithUnit.Percent(percent), XXXValueWithUnit.Hour(timeShift).takeIf { timeShift != 0 }, XXXValueWithUnit.Minute(duration).takeIf { duration != 0 })
|
||||||
treatmentsPlugin.doProfileSwitch(profileStore, profile, duration, percent, timeShift, eventTime)
|
treatmentsPlugin.doProfileSwitch(profileStore, profile, duration, percent, timeShift, eventTime)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.view.ViewGroup
|
||||||
import com.google.common.base.Joiner
|
import com.google.common.base.Joiner
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogTempbasalBinding
|
import info.nightscout.androidaps.databinding.DialogTempbasalBinding
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
@ -126,10 +127,10 @@ class TempBasalDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isPercentPump) {
|
if (isPercentPump) {
|
||||||
uel.log(Action.TEMP_BASAL, ValueWithUnit(percent, Units.Percent), ValueWithUnit(durationInMinutes, Units.M))
|
uel.log(Action.TEMP_BASAL, XXXValueWithUnit.Percent(percent), XXXValueWithUnit.Minute(durationInMinutes))
|
||||||
commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback)
|
commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback)
|
||||||
} else {
|
} else {
|
||||||
uel.log(Action.TEMP_BASAL, ValueWithUnit(absolute, Units.U), ValueWithUnit(durationInMinutes, Units.M))
|
uel.log(Action.TEMP_BASAL, XXXValueWithUnit.Insulin(absolute), XXXValueWithUnit.Minute(durationInMinutes))
|
||||||
commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback)
|
commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,6 +12,7 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
import info.nightscout.androidaps.database.ValueWrapper
|
import info.nightscout.androidaps.database.ValueWrapper
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
||||||
|
@ -181,11 +182,11 @@ class TempTargetDialog : DialogFragmentWithDate() {
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
val units = profileFunction.getUnits()
|
val units = profileFunction.getUnits()
|
||||||
when(reason) {
|
when(reason) {
|
||||||
resourceHelper.gs(R.string.eatingsoon) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.EATING_SOON.text, Units.TherapyEvent), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
resourceHelper.gs(R.string.eatingsoon) -> uel.log(Action.TT, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.EATING_SOON.text), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.ACTIVITY.text, Units.TherapyEvent), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.ACTIVITY.text), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.HYPOGLYCEMIA.text, Units.TherapyEvent), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.HYPOGLYCEMIA.text), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.manual) -> uel.log(Action.TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged), ValueWithUnit(TemporaryTarget.Reason.CUSTOM.text, Units.TherapyEvent), ValueWithUnit(target, units), ValueWithUnit(duration, Units.M))
|
resourceHelper.gs(R.string.manual) -> uel.log(Action.TT, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEvent(TemporaryTarget.Reason.CUSTOM.text), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, ValueWithUnit(eventTime, Units.Timestamp, eventTimeChanged))
|
resourceHelper.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
|
||||||
}
|
}
|
||||||
if (target == 0.0 || duration == 0) {
|
if (target == 0.0 || duration == 0) {
|
||||||
disposable += repository.runTransactionForResult(CancelCurrentTemporaryTargetIfAnyTransaction(eventTime))
|
disposable += repository.runTransactionForResult(CancelCurrentTemporaryTargetIfAnyTransaction(eventTime))
|
||||||
|
|
|
@ -12,6 +12,7 @@ import info.nightscout.androidaps.Config
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.DialogTreatmentBinding
|
import info.nightscout.androidaps.databinding.DialogTreatmentBinding
|
||||||
|
@ -130,7 +131,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
||||||
if (insulinAfterConstraints > 0 || carbsAfterConstraints > 0) {
|
if (insulinAfterConstraints > 0 || carbsAfterConstraints > 0) {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.overview_treatment_label), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.overview_treatment_label), HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions)), {
|
||||||
uel.log(Action.TREATMENT, ValueWithUnit(insulin, Units.U, insulin != 0.0), ValueWithUnit(carbs, Units.G, carbs != 0))
|
uel.log(Action.TREATMENT, XXXValueWithUnit.Insulin(insulin ).takeIf { insulin != 0.0 }, XXXValueWithUnit.Gram(carbs).takeIf { carbs != 0 })
|
||||||
val detailedBolusInfo = DetailedBolusInfo()
|
val detailedBolusInfo = DetailedBolusInfo()
|
||||||
if (insulinAfterConstraints == 0.0) detailedBolusInfo.eventType = TherapyEvent.Type.CARBS_CORRECTION.text
|
if (insulinAfterConstraints == 0.0) detailedBolusInfo.eventType = TherapyEvent.Type.CARBS_CORRECTION.text
|
||||||
if (carbsAfterConstraints == 0) detailedBolusInfo.eventType = TherapyEvent.Type.CORRECTION_BOLUS.text
|
if (carbsAfterConstraints == 0) detailedBolusInfo.eventType = TherapyEvent.Type.CORRECTION_BOLUS.text
|
||||||
|
|
|
@ -17,7 +17,8 @@ import androidx.recyclerview.widget.LinearSmoothScroller
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding
|
import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding
|
||||||
import info.nightscout.androidaps.databinding.ObjectivesItemBinding
|
import info.nightscout.androidaps.databinding.ObjectivesItemBinding
|
||||||
import info.nightscout.androidaps.dialogs.NtpProgressDialog
|
import info.nightscout.androidaps.dialogs.NtpProgressDialog
|
||||||
|
@ -35,11 +36,11 @@ import info.nightscout.androidaps.utils.FabricPrivacy
|
||||||
import info.nightscout.androidaps.utils.HtmlHelper
|
import info.nightscout.androidaps.utils.HtmlHelper
|
||||||
import info.nightscout.androidaps.utils.SntpClient
|
import info.nightscout.androidaps.utils.SntpClient
|
||||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||||
import io.reactivex.rxkotlin.plusAssign
|
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
|
import io.reactivex.rxkotlin.plusAssign
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class ObjectivesFragment : DaggerFragment() {
|
class ObjectivesFragment : DaggerFragment() {
|
||||||
|
@ -308,7 +309,7 @@ class ObjectivesFragment : DaggerFragment() {
|
||||||
holder.binding.unstart.setOnClickListener {
|
holder.binding.unstart.setOnClickListener {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.objectives), resourceHelper.gs(R.string.doyouwantresetstart), Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.objectives), resourceHelper.gs(R.string.doyouwantresetstart), Runnable {
|
||||||
uel.log(Action.OBJECTIVE_UNSTARTED, ValueWithUnit(position + 1, Units.None))
|
uel.log(Action.OBJECTIVE_UNSTARTED, XXXValueWithUnit.SimpleInt(position + 1))
|
||||||
objective.startedOn = 0
|
objective.startedOn = 0
|
||||||
scrollToCurrentObjective()
|
scrollToCurrentObjective()
|
||||||
rxBus.send(EventObjectivesUpdateGui())
|
rxBus.send(EventObjectivesUpdateGui())
|
||||||
|
|
|
@ -6,9 +6,9 @@ import androidx.work.WorkerParameters
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit
|
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction
|
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction
|
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction
|
||||||
import info.nightscout.androidaps.events.EventNsTreatment
|
import info.nightscout.androidaps.events.EventNsTreatment
|
||||||
|
@ -85,28 +85,28 @@ class NSClientAddUpdateWorker(
|
||||||
}
|
}
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach {
|
result.inserted.forEach { tt ->
|
||||||
uel.log(UserEntry.Action.TT_FROM_NS,
|
uel.log(UserEntry.Action.TT_FROM_NS,
|
||||||
ValueWithUnit(it.reason.text, UserEntry.Units.TherapyEvent),
|
XXXValueWithUnit.TherapyEvent(tt.reason.text),
|
||||||
ValueWithUnit(it.lowTarget, UserEntry.Units.Mg_Dl, true),
|
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit(it.highTarget, UserEntry.Units.Mg_Dl, it.lowTarget != it.highTarget),
|
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
ValueWithUnit(it.duration.toInt() / 60000, UserEntry.Units.M, true)
|
XXXValueWithUnit.Minute(tt.duration.toInt() / 60000)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach { tt ->
|
||||||
uel.log(UserEntry.Action.TT_DELETED_FROM_NS,
|
uel.log(UserEntry.Action.TT_DELETED_FROM_NS,
|
||||||
ValueWithUnit(it.reason.text, UserEntry.Units.TherapyEvent),
|
XXXValueWithUnit.TherapyEvent(tt.reason.text),
|
||||||
ValueWithUnit(it.lowTarget, UserEntry.Units.Mg_Dl, true),
|
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit(it.highTarget, UserEntry.Units.Mg_Dl, it.lowTarget != it.highTarget),
|
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
ValueWithUnit(it.duration.toInt() / 60000, UserEntry.Units.M, true)
|
XXXValueWithUnit.Minute(tt.duration.toInt() / 60000)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.ended.forEach {
|
result.ended.forEach { tt ->
|
||||||
uel.log(UserEntry.Action.TT_CANCELED_FROM_NS,
|
uel.log(UserEntry.Action.TT_CANCELED_FROM_NS,
|
||||||
ValueWithUnit(it.reason.text, UserEntry.Units.TherapyEvent),
|
XXXValueWithUnit.TherapyEvent(tt.reason.text),
|
||||||
ValueWithUnit(it.lowTarget, UserEntry.Units.Mg_Dl, true),
|
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit(it.highTarget, UserEntry.Units.Mg_Dl, it.lowTarget != it.highTarget),
|
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
ValueWithUnit(it.duration.toInt() / 60000, UserEntry.Units.M, true)
|
XXXValueWithUnit.Minute(tt.duration.toInt() / 60000)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,15 +133,15 @@ class NSClientAddUpdateWorker(
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
uel.log(UserEntry.Action.CAREPORTAL_FROM_NS,
|
uel.log(UserEntry.Action.CAREPORTAL_FROM_NS,
|
||||||
it.note ?: "",
|
it.note ?: "",
|
||||||
ValueWithUnit(it.timestamp, UserEntry.Units.Timestamp, true),
|
XXXValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit(it.type.text, UserEntry.Units.TherapyEvent)
|
XXXValueWithUnit.TherapyEvent(it.type.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(UserEntry.Action.CAREPORTAL_DELETED_FROM_NS,
|
uel.log(UserEntry.Action.CAREPORTAL_DELETED_FROM_NS,
|
||||||
it.note ?: "",
|
it.note ?: "",
|
||||||
ValueWithUnit(it.timestamp, UserEntry.Units.Timestamp, true),
|
XXXValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit(it.type.text, UserEntry.Units.TherapyEvent)
|
XXXValueWithUnit.TherapyEvent(it.type.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,6 @@ import info.nightscout.androidaps.database.entities.TemporaryTarget;
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent;
|
import info.nightscout.androidaps.database.entities.TherapyEvent;
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action;
|
import info.nightscout.androidaps.database.entities.UserEntry.Action;
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Units;
|
import info.nightscout.androidaps.database.entities.UserEntry.Units;
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit;
|
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction;
|
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction;
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction;
|
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction;
|
||||||
import info.nightscout.androidaps.events.EventAppExit;
|
import info.nightscout.androidaps.events.EventAppExit;
|
||||||
|
|
|
@ -6,8 +6,8 @@ import androidx.work.WorkerParameters
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.ValueWithUnit
|
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction
|
import info.nightscout.androidaps.database.transactions.SyncTemporaryTargetTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction
|
import info.nightscout.androidaps.database.transactions.SyncTherapyEventTransaction
|
||||||
import info.nightscout.androidaps.events.EventNsTreatment
|
import info.nightscout.androidaps.events.EventNsTreatment
|
||||||
|
@ -66,13 +66,13 @@ class NSClientRemoveWorker(
|
||||||
}
|
}
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach { tt ->
|
||||||
uel.log(
|
uel.log(
|
||||||
UserEntry.Action.TT_DELETED_FROM_NS,
|
UserEntry.Action.TT_DELETED_FROM_NS,
|
||||||
ValueWithUnit(it.reason.text, UserEntry.Units.TherapyEvent),
|
XXXValueWithUnit.TherapyEvent(tt.reason.text),
|
||||||
ValueWithUnit(it.lowTarget, UserEntry.Units.Mg_Dl, true),
|
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
ValueWithUnit(it.highTarget, UserEntry.Units.Mg_Dl, it.lowTarget != it.highTarget),
|
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
ValueWithUnit(it.duration.toInt() / 60000, UserEntry.Units.M, it.duration != 0L)
|
XXXValueWithUnit.Minute(tt.duration.toInt() / 60000).takeIf { tt.duration != 0L }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ class NSClientRemoveWorker(
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(
|
uel.log(
|
||||||
UserEntry.Action.CAREPORTAL_DELETED_FROM_NS, (it.note ?: ""),
|
UserEntry.Action.CAREPORTAL_DELETED_FROM_NS, (it.note ?: ""),
|
||||||
ValueWithUnit(it.timestamp, UserEntry.Units.Timestamp, true),
|
XXXValueWithUnit.Timestamp(it.timestamp),
|
||||||
ValueWithUnit(it.type.text, UserEntry.Units.TherapyEvent))
|
XXXValueWithUnit.TherapyEvent(it.type.text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
||||||
|
@ -40,7 +41,6 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||||
import info.nightscout.androidaps.queue.Callback
|
import info.nightscout.androidaps.queue.Callback
|
||||||
import info.nightscout.androidaps.receivers.DataWorker
|
import info.nightscout.androidaps.receivers.DataWorker
|
||||||
import info.nightscout.androidaps.receivers.DataReceiver
|
|
||||||
import info.nightscout.androidaps.utils.*
|
import info.nightscout.androidaps.utils.*
|
||||||
import info.nightscout.androidaps.utils.extensions.valueToUnitsString
|
import info.nightscout.androidaps.utils.extensions.valueToUnitsString
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
|
@ -602,7 +602,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
activePlugin.activeTreatments.doProfileSwitch(store, list[pIndex - 1] as String, 0, finalPercentage, 0, DateUtil.now())
|
activePlugin.activeTreatments.doProfileSwitch(store, list[pIndex - 1] as String, 0, finalPercentage, 0, DateUtil.now())
|
||||||
val replyText = resourceHelper.gs(R.string.profileswitchcreated)
|
val replyText = resourceHelper.gs(R.string.profileswitchcreated)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_PROFILE, ValueWithUnit(R.string.profileswitchcreated, Units.R_String))
|
uel.log(Action.SMS_PROFILE, XXXValueWithUnit.StringResource(R.string.profileswitchcreated))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -624,12 +624,12 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalcanceled)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalcanceled)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalcanceled, Units.R_String))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalcanceled))
|
||||||
} else {
|
} else {
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalcancelfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalcancelfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalcancelfailed, Units.R_String))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalcancelfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -658,14 +658,14 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (result.isPercent)
|
if (result.isPercent)
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalset_percent, 2), ValueWithUnit(result.percent, Units.Percent), ValueWithUnit(result.duration, Units.M))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(XXXValueWithUnit.Percent(result.percent), XXXValueWithUnit.Minute(result.duration))) )
|
||||||
else
|
else
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalset, 2), ValueWithUnit(result.absolute, Units.U_H), ValueWithUnit(result.duration, Units.M))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf( XXXValueWithUnit.UnitPerHour(result.absolute), XXXValueWithUnit.Minute(result.duration))))
|
||||||
} else {
|
} else {
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalfailed, Units.R_String))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -696,14 +696,14 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (result.isPercent)
|
if (result.isPercent)
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalset_percent, 2), ValueWithUnit(result.percent, Units.Percent), ValueWithUnit(result.duration, Units.M))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(XXXValueWithUnit.Percent(result.percent), XXXValueWithUnit.Minute(result.duration))))
|
||||||
else
|
else
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalset, 2), ValueWithUnit(result.absolute, Units.U_H), ValueWithUnit(result.duration, Units.M))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf(XXXValueWithUnit.UnitPerHour(result.absolute), XXXValueWithUnit.Minute(result.duration))))
|
||||||
} else {
|
} else {
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_tempbasalfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_tempbasalfailed, Units.R_String))
|
uel.log(Action.SMS_BASAL, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -730,7 +730,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_extendedcancelfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_extendedcancelfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_extendedcanceled, Units.R_String))
|
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedcanceled))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -757,16 +757,16 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (config.APS)
|
if (config.APS)
|
||||||
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_extendedset, 2), ValueWithUnit(aDouble
|
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf(XXXValueWithUnit.Insulin(aDouble
|
||||||
?: 0.0, Units.U), ValueWithUnit(duration, Units.M), ValueWithUnit(R.string.loopsuspended, Units.R_String))
|
?: 0.0), XXXValueWithUnit.Minute(duration))), XXXValueWithUnit.StringResource(R.string.loopsuspended))
|
||||||
else
|
else
|
||||||
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_extendedset, 2), ValueWithUnit(aDouble
|
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf( XXXValueWithUnit.Insulin(aDouble
|
||||||
?: 0.0, Units.U), ValueWithUnit(duration, Units.M))
|
?: 0.0), XXXValueWithUnit.Minute(duration))))
|
||||||
} else {
|
} else {
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_extendedfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_extendedfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_extendedfailed, Units.R_String))
|
uel.log(Action.SMS_EXTENDED_BOLUS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -844,7 +844,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_bolusfailed)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_bolusfailed)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_BOLUS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_bolusfailed, Units.R_String))
|
uel.log(Action.SMS_BOLUS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_bolusfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -884,14 +884,13 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger)
|
var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_carbsset, 1), ValueWithUnit(anInteger
|
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_carbsset, listOf(XXXValueWithUnit.Gram(anInteger ?: 0))))
|
||||||
?: 0, Units.G))
|
|
||||||
} else {
|
} else {
|
||||||
var replyText = resourceHelper.gs(R.string.smscommunicator_carbsfailed, anInteger)
|
var replyText = resourceHelper.gs(R.string.smscommunicator_carbsfailed, anInteger)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
sendSMS(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_carbsfailed, 1), ValueWithUnit(anInteger
|
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_carbsfailed, listOf(XXXValueWithUnit.Gram(anInteger
|
||||||
?: 0, Units.G))
|
?: 0))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -900,8 +899,8 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger)
|
var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger)
|
||||||
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
replyText += "\n" + activePlugin.activePump.shortStatus(true)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), ValueWithUnit(R.string.smscommunicator_carbsset, 1), ValueWithUnit(anInteger
|
uel.log(Action.SMS_CARBS, activePlugin.activePump.shortStatus(true), XXXValueWithUnit.StringResource(R.string.smscommunicator_carbsset, listOf(XXXValueWithUnit.Gram(anInteger
|
||||||
?: 0, Units.G))
|
?: 0))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -971,7 +970,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_tt_set), ttString, ttDuration)
|
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_tt_set), ttString, ttDuration)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
//uel.log(Action.SMS_TT, ValueWithUnit(R.string.smscommunicator_tt_set, 2), ValueWithUnit(tt, units), ValueWithUnit(ttDuration, Units.M))
|
//uel.log(Action.SMS_TT, ValueWithUnit(R.string.smscommunicator_tt_set, 2), ValueWithUnit(tt, units), ValueWithUnit(ttDuration, Units.M))
|
||||||
uel.log(Action.SMS_TT, ValueWithUnit(tt, units), ValueWithUnit(ttDuration, Units.M))
|
uel.log(Action.SMS_TT, XXXValueWithUnit.fromGlucoseUnit(tt, units), XXXValueWithUnit.Minute(ttDuration))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (isStop) {
|
} else if (isStop) {
|
||||||
|
@ -988,7 +987,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
})
|
})
|
||||||
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_tt_canceled))
|
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_tt_canceled))
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_TT, ValueWithUnit(R.string.smscommunicator_tt_canceled, Units.R_String))
|
uel.log(Action.SMS_TT, XXXValueWithUnit.StringResource(R.string.smscommunicator_tt_canceled))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else
|
} else
|
||||||
|
@ -1007,7 +1006,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
sp.putBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)
|
sp.putBoolean(R.string.key_smscommunicator_remotecommandsallowed, false)
|
||||||
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_stoppedsms))
|
val replyText = String.format(resourceHelper.gs(R.string.smscommunicator_stoppedsms))
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
uel.log(Action.SMS_SMS, ValueWithUnit(R.string.smscommunicator_stoppedsms, Units.R_String))
|
uel.log(Action.SMS_SMS, XXXValueWithUnit.StringResource(R.string.smscommunicator_stoppedsms))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
|
} else sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
|
||||||
|
@ -1026,9 +1025,9 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
if (result) resourceHelper.gs(R.string.smscommunicator_calibrationsent) else resourceHelper.gs(R.string.smscommunicator_calibrationfailed)
|
if (result) resourceHelper.gs(R.string.smscommunicator_calibrationsent) else resourceHelper.gs(R.string.smscommunicator_calibrationfailed)
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (result)
|
if (result)
|
||||||
uel.log(Action.SMS_CAL, ValueWithUnit(R.string.smscommunicator_calibrationsent, Units.R_String))
|
uel.log(Action.SMS_CAL, XXXValueWithUnit.StringResource(R.string.smscommunicator_calibrationsent))
|
||||||
else
|
else
|
||||||
uel.log(Action.SMS_CAL, ValueWithUnit(R.string.smscommunicator_calibrationfailed, Units.R_String))
|
uel.log(Action.SMS_CAL, XXXValueWithUnit.StringResource(R.string.smscommunicator_calibrationfailed))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
|
} else sendSMS(Sms(receivedSms.phoneNumber, resourceHelper.gs(R.string.wrongformat)))
|
||||||
|
|
|
@ -8,6 +8,7 @@ import android.widget.AdapterView
|
||||||
import android.widget.ArrayAdapter
|
import android.widget.ArrayAdapter
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.NsprofileFragmentBinding
|
import info.nightscout.androidaps.databinding.NsprofileFragmentBinding
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -62,7 +63,7 @@ class NSProfileFragment : DaggerFragment() {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.nsprofile),
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.nsprofile),
|
||||||
resourceHelper.gs(R.string.activate_profile) + ": " + name + " ?", Runnable {
|
resourceHelper.gs(R.string.activate_profile) + ": " + name + " ?", Runnable {
|
||||||
uel.log(Action.PROFILE_SWITCH, ValueWithUnit(name, Units.None), ValueWithUnit(100.toInt(), Units.Percent))
|
uel.log(Action.PROFILE_SWITCH, XXXValueWithUnit.SimpleString(name), XXXValueWithUnit.Percent(100))
|
||||||
treatmentsPlugin.doProfileSwitch(store, name, 0, 100, 0, DateUtil.now())
|
treatmentsPlugin.doProfileSwitch(store, name, 0, 100, 0, DateUtil.now())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction
|
||||||
|
@ -129,7 +130,7 @@ class BGSourceFragment : DaggerFragment() {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
val text = dateUtil.dateAndTimeString(glucoseValue.timestamp) + "\n" + glucoseValue.valueToUnitsString(profileFunction.getUnits())
|
val text = dateUtil.dateAndTimeString(glucoseValue.timestamp) + "\n" + glucoseValue.valueToUnitsString(profileFunction.getUnits())
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||||
uel.log(Action.BG_REMOVED, ValueWithUnit(glucoseValue.timestamp, Units.Timestamp))
|
uel.log(Action.BG_REMOVED, XXXValueWithUnit.Timestamp(glucoseValue.timestamp))
|
||||||
disposable += repository.runTransaction(InvalidateGlucoseValueTransaction(glucoseValue.id)).subscribe()
|
disposable += repository.runTransaction(InvalidateGlucoseValueTransaction(glucoseValue.id)).subscribe()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsBolusFragmentBinding
|
import info.nightscout.androidaps.databinding.TreatmentsBolusFragmentBinding
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsBolusItemBinding
|
import info.nightscout.androidaps.databinding.TreatmentsBolusItemBinding
|
||||||
|
@ -175,7 +176,7 @@ class TreatmentsBolusFragment : DaggerFragment() {
|
||||||
resourceHelper.gs(R.string.carbs) + ": " + resourceHelper.gs(R.string.format_carbs, treatment.carbs.toInt()) + "\n" +
|
resourceHelper.gs(R.string.carbs) + ": " + resourceHelper.gs(R.string.format_carbs, treatment.carbs.toInt()) + "\n" +
|
||||||
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(treatment.date)
|
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(treatment.date)
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||||
uel.log(Action.TREATMENT_REMOVED, ValueWithUnit(treatment.date, Units.Timestamp), ValueWithUnit(treatment.insulin, Units.U, treatment.insulin != 0.0), ValueWithUnit(treatment.carbs.toInt(), Units.G, treatment.carbs != 0.0))
|
uel.log(Action.TREATMENT_REMOVED, XXXValueWithUnit.Timestamp(treatment.date), XXXValueWithUnit.Insulin(treatment.insulin).takeIf { treatment.insulin != 0.0 }, XXXValueWithUnit.Gram(treatment.carbs.toInt()).takeIf { treatment.carbs != 0.0 })
|
||||||
if (treatment.source == Source.PUMP) {
|
if (treatment.source == Source.PUMP) {
|
||||||
treatment.isValid = false
|
treatment.isValid = false
|
||||||
treatmentsPlugin.service.update(treatment)
|
treatmentsPlugin.service.update(treatment)
|
||||||
|
|
|
@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateAAPSStartedTherapyEventTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateAAPSStartedTherapyEventTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction
|
||||||
|
@ -176,7 +177,7 @@ class TreatmentsCareportalFragment : DaggerFragment() {
|
||||||
holder.binding.date.text = dateUtil.dateAndTimeString(therapyEvent.timestamp)
|
holder.binding.date.text = dateUtil.dateAndTimeString(therapyEvent.timestamp)
|
||||||
holder.binding.duration.text = if (therapyEvent.duration == 0L) "" else DateUtil.niceTimeScalar(therapyEvent.duration, resourceHelper)
|
holder.binding.duration.text = if (therapyEvent.duration == 0L) "" else DateUtil.niceTimeScalar(therapyEvent.duration, resourceHelper)
|
||||||
holder.binding.note.text = therapyEvent.note
|
holder.binding.note.text = therapyEvent.note
|
||||||
holder.binding.type.text = translator.translate(therapyEvent.type.text)
|
holder.binding.type.text = translator.translate(therapyEvent.type)
|
||||||
holder.binding.remove.tag = therapyEvent
|
holder.binding.remove.tag = therapyEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,11 +193,11 @@ class TreatmentsCareportalFragment : DaggerFragment() {
|
||||||
binding.remove.setOnClickListener { v: View ->
|
binding.remove.setOnClickListener { v: View ->
|
||||||
val therapyEvent = v.tag as TherapyEvent
|
val therapyEvent = v.tag as TherapyEvent
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
val text = resourceHelper.gs(R.string.eventtype) + ": " + translator.translate(therapyEvent.type.text) + "\n" +
|
val text = resourceHelper.gs(R.string.eventtype) + ": " + translator.translate(therapyEvent.type) + "\n" +
|
||||||
resourceHelper.gs(R.string.notes_label) + ": " + (therapyEvent.note ?: "") + "\n" +
|
resourceHelper.gs(R.string.notes_label) + ": " + (therapyEvent.note ?: "") + "\n" +
|
||||||
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(therapyEvent.timestamp)
|
resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(therapyEvent.timestamp)
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, therapyEvent.note , ValueWithUnit(therapyEvent.timestamp, Units.Timestamp), ValueWithUnit(therapyEvent.type.text, Units.TherapyEvent))
|
uel.log(Action.CAREPORTAL_REMOVED, therapyEvent.note , XXXValueWithUnit.Timestamp(therapyEvent.timestamp), XXXValueWithUnit.TherapyEvent(therapyEvent.type.text))
|
||||||
disposable += repository.runTransactionForResult(InvalidateTherapyEventTransaction(therapyEvent.id))
|
disposable += repository.runTransactionForResult(InvalidateTherapyEventTransaction(therapyEvent.id))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
val id = therapyEvent.interfaceIDs.nightscoutId
|
val id = therapyEvent.interfaceIDs.nightscoutId
|
||||||
|
|
|
@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import dagger.android.support.DaggerFragment
|
import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchFragmentBinding
|
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchFragmentBinding
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchItemBinding
|
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchItemBinding
|
||||||
|
@ -148,7 +149,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord),
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord),
|
||||||
resourceHelper.gs(R.string.careportal_profileswitch) + ": " + profileSwitch.profileName +
|
resourceHelper.gs(R.string.careportal_profileswitch) + ": " + profileSwitch.profileName +
|
||||||
"\n" + resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(profileSwitch.date), Runnable {
|
"\n" + resourceHelper.gs(R.string.date) + ": " + dateUtil.dateAndTimeString(profileSwitch.date), Runnable {
|
||||||
uel.log(Action.PROFILE_SWITCH_REMOVED, profileSwitch.profileName, ValueWithUnit(profileSwitch.date, Units.Timestamp))
|
uel.log(Action.PROFILE_SWITCH_REMOVED, profileSwitch.profileName, XXXValueWithUnit.Timestamp(profileSwitch.date))
|
||||||
val id = profileSwitch._id
|
val id = profileSwitch._id
|
||||||
if (NSUpload.isIdValid(id)) nsUpload.removeCareportalEntryFromNS(id)
|
if (NSUpload.isIdValid(id)) nsUpload.removeCareportalEntryFromNS(id)
|
||||||
else uploadQueue.removeByMongoId("dbAdd", id)
|
else uploadQueue.removeByMongoId("dbAdd", id)
|
||||||
|
@ -161,7 +162,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
|
||||||
val profileSwitch = it.tag as ProfileSwitch
|
val profileSwitch = it.tag as ProfileSwitch
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_profileswitch), resourceHelper.gs(R.string.copytolocalprofile) + "\n" + profileSwitch.customizedName + "\n" + dateUtil.dateAndTimeString(profileSwitch.date), Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_profileswitch), resourceHelper.gs(R.string.copytolocalprofile) + "\n" + profileSwitch.customizedName + "\n" + dateUtil.dateAndTimeString(profileSwitch.date), Runnable {
|
||||||
profileSwitch.profileObject?.let {
|
profileSwitch.profileObject?.let {
|
||||||
uel.log(Action.PROFILE_SWITCH_CLONED, ValueWithUnit(profileSwitch.date, Units.Timestamp), ValueWithUnit(profileSwitch.profileName, Units.None))
|
uel.log(Action.PROFILE_SWITCH_CLONED, XXXValueWithUnit.Timestamp(profileSwitch.date), XXXValueWithUnit.SimpleString(profileSwitch.profileName))
|
||||||
val nonCustomized = it.convertToNonCustomizedProfile()
|
val nonCustomized = it.convertToNonCustomizedProfile()
|
||||||
if (nonCustomized.isValid(resourceHelper.gs(R.string.careportal_profileswitch, false))) {
|
if (nonCustomized.isValid(resourceHelper.gs(R.string.careportal_profileswitch, false))) {
|
||||||
localProfilePlugin.addProfile(localProfilePlugin.copyFrom(nonCustomized, profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_")))
|
localProfilePlugin.addProfile(localProfilePlugin.copyFrom(nonCustomized, profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_")))
|
||||||
|
|
|
@ -13,6 +13,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
import info.nightscout.androidaps.database.ValueWrapper
|
import info.nightscout.androidaps.database.ValueWrapper
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.database.interfaces.end
|
import info.nightscout.androidaps.database.interfaces.end
|
||||||
|
@ -170,7 +171,7 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
|
||||||
holder.binding.duration.text = resourceHelper.gs(R.string.format_mins, T.msecs(tempTarget.duration).mins())
|
holder.binding.duration.text = resourceHelper.gs(R.string.format_mins, T.msecs(tempTarget.duration).mins())
|
||||||
holder.binding.low.text = tempTarget.lowValueToUnitsToString(units)
|
holder.binding.low.text = tempTarget.lowValueToUnitsToString(units)
|
||||||
holder.binding.high.text = tempTarget.highValueToUnitsToString(units)
|
holder.binding.high.text = tempTarget.highValueToUnitsToString(units)
|
||||||
holder.binding.reason.text = translator.translate(tempTarget.reason.text)
|
holder.binding.reason.text = translator.translate(tempTarget.reason)
|
||||||
holder.binding.date.setTextColor(
|
holder.binding.date.setTextColor(
|
||||||
when {
|
when {
|
||||||
tempTarget.id == currentlyActiveTarget?.id -> resourceHelper.gc(R.color.colorActive)
|
tempTarget.id == currentlyActiveTarget?.id -> resourceHelper.gc(R.color.colorActive)
|
||||||
|
@ -196,7 +197,7 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
|
||||||
${dateUtil.dateAndTimeString(tempTarget.timestamp)}
|
${dateUtil.dateAndTimeString(tempTarget.timestamp)}
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
{ _: DialogInterface?, _: Int ->
|
{ _: DialogInterface?, _: Int ->
|
||||||
uel.log(Action.TT_REMOVED, ValueWithUnit(tempTarget.timestamp, Units.Timestamp), ValueWithUnit(tempTarget.reason.text, Units.TherapyEvent), ValueWithUnit(tempTarget.lowTarget, Units.Mg_Dl), ValueWithUnit(tempTarget.highTarget, Units.Mg_Dl, tempTarget.lowTarget != tempTarget.highTarget), ValueWithUnit(tempTarget.duration.toInt(), Units.M))
|
uel.log(Action.TT_REMOVED, XXXValueWithUnit.Timestamp(tempTarget.timestamp), XXXValueWithUnit.TherapyEvent(tempTarget.reason.text), XXXValueWithUnit.Mgdl(tempTarget.lowTarget), XXXValueWithUnit.Mgdl(tempTarget.highTarget).takeIf { tempTarget.lowTarget != tempTarget.highTarget }, XXXValueWithUnit.Minute(tempTarget.duration.toInt()))
|
||||||
disposable += repository.runTransactionForResult(InvalidateTemporaryTargetTransaction(tempTarget.id))
|
disposable += repository.runTransactionForResult(InvalidateTemporaryTargetTransaction(tempTarget.id))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
val id = tempTarget.interfaceIDs.nightscoutId
|
val id = tempTarget.interfaceIDs.nightscoutId
|
||||||
|
|
|
@ -12,6 +12,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Intervals
|
import info.nightscout.androidaps.data.Intervals
|
||||||
import info.nightscout.androidaps.data.IobTotal
|
import info.nightscout.androidaps.data.IobTotal
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsFragmentBinding
|
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsFragmentBinding
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsItemBinding
|
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsItemBinding
|
||||||
|
@ -164,7 +165,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
|
||||||
${resourceHelper.gs(R.string.date)}: ${dateUtil.dateAndTimeString(tempBasal.date)}
|
${resourceHelper.gs(R.string.date)}: ${dateUtil.dateAndTimeString(tempBasal.date)}
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
{ _: DialogInterface?, _: Int ->
|
{ _: DialogInterface?, _: Int ->
|
||||||
uel.log(Action.TT_REMOVED, ValueWithUnit(tempBasal.date, Units.Timestamp))
|
uel.log(Action.TT_REMOVED, XXXValueWithUnit.Timestamp(tempBasal.date))
|
||||||
activePlugin.activeTreatments.removeTempBasal(tempBasal)
|
activePlugin.activeTreatments.removeTempBasal(tempBasal)
|
||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
|
||||||
override fun onBindViewHolder(holder: UserEntryViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: UserEntryViewHolder, position: Int) {
|
||||||
val current = entries[position]
|
val current = entries[position]
|
||||||
holder.binding.date.text = dateUtil.dateAndTimeAndSecondsString(current.timestamp)
|
holder.binding.date.text = dateUtil.dateAndTimeAndSecondsString(current.timestamp)
|
||||||
holder.binding.action.text = translator.translate(current.action.name)
|
holder.binding.action.text = translator.translate(current.action)
|
||||||
holder.binding.action.setTextColor(resourceHelper.gc(current.action.colorGroup.colorId()))
|
holder.binding.action.setTextColor(resourceHelper.gc(current.action.colorGroup.colorId()))
|
||||||
if (current.s != "") {
|
if (current.s != "") {
|
||||||
holder.binding.s.text = current.s
|
holder.binding.s.text = current.s
|
||||||
|
@ -138,12 +138,12 @@ class TreatmentsUserEntryFragment : DaggerFragment() {
|
||||||
4 -> rStringParam = 0
|
4 -> rStringParam = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Units.Mg_Dl -> valuesWithUnitString += if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue) + translator.translate(Units.Mg_Dl.name) + separator else DecimalFormatter.to1Decimal(v.dValue/Constants.MMOLL_TO_MGDL) + translator.translate(Units.Mmol_L.name) + separator
|
Units.Mg_Dl -> valuesWithUnitString += if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue) + translator.translate(Units.Mg_Dl) + separator else DecimalFormatter.to1Decimal(v.dValue/Constants.MMOLL_TO_MGDL) + translator.translate(Units.Mmol_L) + separator
|
||||||
Units.Mmol_L -> valuesWithUnitString += if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue*Constants.MMOLL_TO_MGDL) + translator.translate(Units.Mg_Dl.name) + separator else DecimalFormatter.to1Decimal(v.dValue) + translator.translate(Units.Mmol_L.name) + separator
|
Units.Mmol_L -> valuesWithUnitString += if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue*Constants.MMOLL_TO_MGDL) + translator.translate(Units.Mg_Dl) + separator else DecimalFormatter.to1Decimal(v.dValue) + translator.translate(Units.Mmol_L) + separator
|
||||||
Units.U_H, Units.U
|
Units.U_H, Units.U
|
||||||
-> valuesWithUnitString += DecimalFormatter.to2Decimal(v.dValue) + translator.translate(v.unit.name) + separator
|
-> valuesWithUnitString += DecimalFormatter.to2Decimal(v.dValue) + translator.translate(v.unit) + separator
|
||||||
Units.G, Units.M, Units.H, Units.Percent
|
Units.G, Units.M, Units.H, Units.Percent
|
||||||
-> valuesWithUnitString += v.iValue.toString() + translator.translate(v.unit.name) + separator
|
-> valuesWithUnitString += v.iValue.toString() + translator.translate(v.unit) + separator
|
||||||
else -> valuesWithUnitString += if (v.iValue != 0 || v.sValue != "") { v.value().toString() + separator } else ""
|
else -> valuesWithUnitString += if (v.iValue != 0 || v.sValue != "") { v.value().toString() + separator } else ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.TherapyEvent
|
import info.nightscout.androidaps.database.entities.TherapyEvent
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
|
@ -349,7 +350,7 @@ class BolusWizard @Inject constructor(
|
||||||
boluscalc = nsJSON()
|
boluscalc = nsJSON()
|
||||||
source = Source.USER
|
source = Source.USER
|
||||||
notes = this@BolusWizard.notes
|
notes = this@BolusWizard.notes
|
||||||
uel.log(Action.BOLUS_ADVISOR, notes, ValueWithUnit(eventType, Units.TherapyEvent), ValueWithUnit(insulinAfterConstraints, Units.U))
|
uel.log(Action.BOLUS_ADVISOR, notes, XXXValueWithUnit.TherapyEvent(eventType), XXXValueWithUnit.Insulin(insulinAfterConstraints))
|
||||||
if (insulin > 0) {
|
if (insulin > 0) {
|
||||||
commandQueue.bolus(this, object : Callback() {
|
commandQueue.bolus(this, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
@ -413,7 +414,7 @@ class BolusWizard @Inject constructor(
|
||||||
boluscalc = nsJSON()
|
boluscalc = nsJSON()
|
||||||
source = Source.USER
|
source = Source.USER
|
||||||
notes = this@BolusWizard.notes
|
notes = this@BolusWizard.notes
|
||||||
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))
|
uel.log(Action.BOLUS, notes, XXXValueWithUnit.TherapyEvent(eventType), XXXValueWithUnit.Insulin(insulinAfterConstraints), XXXValueWithUnit.Gram(this@BolusWizard.carbs).takeIf { this@BolusWizard.carbs != 0 }, XXXValueWithUnit.Minute(carbTime).takeIf { carbTime != 0 })
|
||||||
if (insulin > 0 || pump.pumpDescription.storesCarbInfo) {
|
if (insulin > 0 || pump.pumpDescription.storesCarbInfo) {
|
||||||
commandQueue.bolus(this, object : Callback() {
|
commandQueue.bolus(this, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
|
|
@ -59,7 +59,7 @@ class TherapyEventDataPoint @Inject constructor(
|
||||||
|
|
||||||
override fun getLabel(): String? =
|
override fun getLabel(): String? =
|
||||||
if (data.note != null) data.note
|
if (data.note != null) data.note
|
||||||
else translator.translate(data.type.text)
|
else translator.translate(data.type)
|
||||||
|
|
||||||
override fun getDuration(): Long = end() - start()
|
override fun getDuration(): Long = end() - start()
|
||||||
override fun getShape(): PointsWithLabelGraphSeries.Shape =
|
override fun getShape(): PointsWithLabelGraphSeries.Shape =
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.logging
|
package info.nightscout.androidaps.logging
|
||||||
|
|
||||||
import info.nightscout.androidaps.Constants
|
|
||||||
import info.nightscout.androidaps.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
|
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.*
|
import info.nightscout.androidaps.database.entities.UserEntry.*
|
||||||
import info.nightscout.androidaps.database.transactions.UserEntryTransaction
|
import info.nightscout.androidaps.database.transactions.UserEntryTransaction
|
||||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||||
|
@ -38,6 +38,12 @@ class UserEntryLogger @Inject constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun log(action: Action, vararg listvalues: XXXValueWithUnit?) = Unit // TODO
|
||||||
|
|
||||||
|
fun log(action: Action, s: String? = "", values: List<XXXValueWithUnit?>) = Unit
|
||||||
|
|
||||||
|
fun log(action: Action, s: String? , vararg listvalues: XXXValueWithUnit?) = Unit
|
||||||
|
|
||||||
fun log(action: Action, vararg listvalues: ValueWithUnit) {
|
fun log(action: Action, vararg listvalues: ValueWithUnit) {
|
||||||
val values = mutableListOf<ValueWithUnit>()
|
val values = mutableListOf<ValueWithUnit>()
|
||||||
for (v in listvalues){
|
for (v in listvalues){
|
||||||
|
@ -69,17 +75,17 @@ class UserEntryLogger @Inject constructor(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun log(action: Action, s: String? = "", values: MutableList<ValueWithUnit>) {
|
// fun log(action: Action, s: String? = "", values: List<ValueWithUnit>) { // TODO re-enable with new signature
|
||||||
compositeDisposable += repository.runTransaction(UserEntryTransaction(
|
// compositeDisposable += repository.runTransaction(UserEntryTransaction(
|
||||||
action = action,
|
// action = action,
|
||||||
s = s ?:"",
|
// s = s ?:"",
|
||||||
values = values
|
// values = values
|
||||||
))
|
// ))
|
||||||
.subscribeOn(aapsSchedulers.io)
|
// .subscribeOn(aapsSchedulers.io)
|
||||||
.observeOn(aapsSchedulers.io)
|
// .observeOn(aapsSchedulers.io)
|
||||||
.subscribeBy(
|
// .subscribeBy(
|
||||||
onError = { aapsLogger.debug("ERRORED USER ENTRY: $action $s $values") },
|
// onError = { aapsLogger.debug("ERRORED USER ENTRY: $action $s $values") },
|
||||||
onComplete = { aapsLogger.debug("USER ENTRY: $action $s $values") }
|
// onComplete = { aapsLogger.debug("USER ENTRY: $action $s $values") }
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
}
|
}
|
|
@ -125,8 +125,8 @@ class ClassicPrefsFormat @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun csvString(action: Action): String = "\"" + translator.translate(action.name).replace("\"", "\"\"") + "\""
|
private fun csvString(action: Action): String = "\"" + translator.translate(action).replace("\"", "\"\"") + "\""
|
||||||
private fun csvString(unit: Units): String = "\"" + translator.translate(unit.name).replace("\"", "\"\"") + "\""
|
private fun csvString(unit: Units): String = "\"" + translator.translate(unit).replace("\"", "\"\"") + "\""
|
||||||
private fun csvString(id: Int): String = if (id != 0) "\"" + resourceHelper.gs(id).replace("\"", "\"\"") + "\"" else ""
|
private fun csvString(id: Int): String = if (id != 0) "\"" + resourceHelper.gs(id).replace("\"", "\"\"") + "\"" else ""
|
||||||
private fun csvString(s: String): String = if (s != "") "\"" + s.replace("\"", "\"\"") + "\"" else ""
|
private fun csvString(s: String): String = if (s != "") "\"" + s.replace("\"", "\"\"") + "\"" else ""
|
||||||
}
|
}
|
|
@ -13,6 +13,7 @@ class Translator @Inject internal constructor(
|
||||||
private val resourceHelper: ResourceHelper
|
private val resourceHelper: ResourceHelper
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@Deprecated("use type instead of string")
|
||||||
fun translate(text: String): String =
|
fun translate(text: String): String =
|
||||||
when (text) {
|
when (text) {
|
||||||
TherapyEvent.Type.FINGER_STICK_BG_VALUE.text -> resourceHelper.gs(R.string.careportal_bgcheck)
|
TherapyEvent.Type.FINGER_STICK_BG_VALUE.text -> resourceHelper.gs(R.string.careportal_bgcheck)
|
||||||
|
@ -44,111 +45,162 @@ class Translator @Inject internal constructor(
|
||||||
TherapyEvent.MeterType.SENSOR.text -> resourceHelper.gs(R.string.glucosetype_sensor)
|
TherapyEvent.MeterType.SENSOR.text -> resourceHelper.gs(R.string.glucosetype_sensor)
|
||||||
TherapyEvent.MeterType.MANUAL.text -> resourceHelper.gs(R.string.manual)
|
TherapyEvent.MeterType.MANUAL.text -> resourceHelper.gs(R.string.manual)
|
||||||
|
|
||||||
TemporaryTarget.Reason.CUSTOM.text -> resourceHelper.gs(R.string.custom)
|
|
||||||
TemporaryTarget.Reason.HYPOGLYCEMIA.text -> resourceHelper.gs(R.string.hypo)
|
|
||||||
TemporaryTarget.Reason.EATING_SOON.text -> resourceHelper.gs(R.string.eatingsoon)
|
|
||||||
TemporaryTarget.Reason.ACTIVITY.text -> resourceHelper.gs(R.string.activity)
|
|
||||||
TemporaryTarget.Reason.AUTOMATION.text -> resourceHelper.gs(R.string.automation)
|
|
||||||
TemporaryTarget.Reason.WEAR.text -> resourceHelper.gs(R.string.wear)
|
|
||||||
|
|
||||||
Action.BOLUS.name -> resourceHelper.gs(R.string.uel_bolus)
|
|
||||||
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)
|
|
||||||
Action.SUPERBOLUS_TBR.name -> resourceHelper.gs(R.string.uel_superbolus_tbr)
|
|
||||||
Action.CARBS.name -> resourceHelper.gs(R.string.uel_carbs)
|
|
||||||
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.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)
|
|
||||||
Action.PROFILE_SWITCH.name -> resourceHelper.gs(R.string.uel_profile_switch)
|
|
||||||
Action.PROFILE_SWITCH_CLONED.name -> resourceHelper.gs(R.string.uel_profile_switch_cloned)
|
|
||||||
Action.CLOSED_LOOP_MODE.name -> resourceHelper.gs(R.string.uel_closed_loop_mode)
|
|
||||||
Action.LGS_LOOP_MODE.name -> resourceHelper.gs(R.string.uel_lgs_loop_mode)
|
|
||||||
Action.OPEN_LOOP_MODE.name -> resourceHelper.gs(R.string.uel_open_loop_mode)
|
|
||||||
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.name -> resourceHelper.gs(R.string.uel_disconnect)
|
|
||||||
Action.RESUME.name -> resourceHelper.gs(R.string.uel_resume)
|
|
||||||
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)
|
|
||||||
Action.CANCEL_TEMP_BASAL.name -> resourceHelper.gs(R.string.uel_cancel_temp_basal)
|
|
||||||
Action.CANCEL_EXTENDED_BOLUS.name -> resourceHelper.gs(R.string.uel_cancel_extended_bolus)
|
|
||||||
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.PRIME_BOLUS.name -> resourceHelper.gs(R.string.uel_prime_bolus)
|
|
||||||
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)
|
|
||||||
Action.TREATMENTS_NS_REFRESH.name -> resourceHelper.gs(R.string.uel_treatments_ns_refresh)
|
|
||||||
Action.TT_NS_REFRESH.name -> resourceHelper.gs(R.string.uel_tt_ns_refresh)
|
|
||||||
Action.AUTOMATION_REMOVED.name -> resourceHelper.gs(R.string.uel_automation_removed)
|
|
||||||
Action.BG_REMOVED.name -> resourceHelper.gs(R.string.uel_bg_removed)
|
|
||||||
Action.CAREPORTAL_REMOVED.name -> resourceHelper.gs(R.string.uel_careportal_removed)
|
|
||||||
Action.EXTENDED_BOLUS_REMOVED.name -> resourceHelper.gs(R.string.uel_extended_bolus_removed)
|
|
||||||
Action.FOOD_REMOVED.name -> resourceHelper.gs(R.string.uel_food_removed)
|
|
||||||
Action.PROFILE_REMOVED.name -> resourceHelper.gs(R.string.uel_profile_removed)
|
|
||||||
Action.PROFILE_SWITCH_REMOVED.name -> resourceHelper.gs(R.string.uel_profile_switch_removed)
|
|
||||||
Action.RESTART_EVENTS_REMOVED.name -> resourceHelper.gs(R.string.uel_restart_events_removed)
|
|
||||||
Action.TREATMENT_REMOVED.name -> resourceHelper.gs(R.string.uel_treatment_removed)
|
|
||||||
Action.TT_REMOVED.name -> resourceHelper.gs(R.string.uel_tt_removed)
|
|
||||||
Action.NS_PAUSED.name -> resourceHelper.gs(R.string.uel_ns_paused)
|
|
||||||
Action.NS_RESUME.name -> resourceHelper.gs(R.string.uel_ns_resume)
|
|
||||||
Action.NS_QUEUE_CLEARED.name -> resourceHelper.gs(R.string.uel_ns_queue_cleared)
|
|
||||||
Action.NS_SETTINGS_COPIED.name -> resourceHelper.gs(R.string.uel_ns_settings_copied)
|
|
||||||
Action.ERROR_DIALOG_OK.name -> resourceHelper.gs(R.string.uel_error_dialog_ok)
|
|
||||||
Action.ERROR_DIALOG_MUTE.name -> resourceHelper.gs(R.string.uel_error_dialog_mute)
|
|
||||||
Action.ERROR_DIALOG_MUTE_5MIN.name -> resourceHelper.gs(R.string.uel_error_dialog_mute_5min)
|
|
||||||
Action.OBJECTIVE_STARTED.name -> resourceHelper.gs(R.string.uel_objective_started)
|
|
||||||
Action.OBJECTIVE_UNSTARTED.name -> resourceHelper.gs(R.string.uel_objective_unstarted)
|
|
||||||
Action.OBJECTIVES_SKIPPED.name -> resourceHelper.gs(R.string.uel_objectives_skipped)
|
|
||||||
Action.STAT_RESET.name -> resourceHelper.gs(R.string.uel_stat_reset)
|
|
||||||
Action.DELETE_LOGS.name -> resourceHelper.gs(R.string.uel_delete_logs)
|
|
||||||
Action.DELETE_FUTURE_TREATMENTS.name -> resourceHelper.gs(R.string.uel_delete_future_treatments)
|
|
||||||
Action.EXPORT_SETTINGS.name -> resourceHelper.gs(R.string.uel_export_settings)
|
|
||||||
Action.IMPORT_SETTINGS.name -> resourceHelper.gs(R.string.uel_import_settings)
|
|
||||||
Action.RESET_DATABASES.name -> resourceHelper.gs(R.string.uel_reset_databases)
|
|
||||||
Action.EXPORT_DATABASES.name -> resourceHelper.gs(R.string.uel_export_databases)
|
|
||||||
Action.IMPORT_DATABASES.name -> resourceHelper.gs(R.string.uel_import_databases)
|
|
||||||
Action.OTP_EXPORT.name -> resourceHelper.gs(R.string.uel_otp_export)
|
|
||||||
Action.OTP_RESET.name -> resourceHelper.gs(R.string.uel_otp_reset)
|
|
||||||
Action.SMS_BASAL.name -> resourceHelper.gs(R.string.uel_sms_basal)
|
|
||||||
Action.SMS_BOLUS.name -> resourceHelper.gs(R.string.uel_sms_bolus)
|
|
||||||
Action.SMS_CAL.name -> resourceHelper.gs(R.string.uel_sms_cal)
|
|
||||||
Action.SMS_CARBS.name -> resourceHelper.gs(R.string.uel_sms_carbs)
|
|
||||||
Action.SMS_EXTENDED_BOLUS.name -> resourceHelper.gs(R.string.uel_sms_extended_bolus)
|
|
||||||
Action.SMS_LOOP_DISABLED.name -> resourceHelper.gs(R.string.uel_sms_loop_disabled)
|
|
||||||
Action.SMS_LOOP_ENABLED.name -> resourceHelper.gs(R.string.uel_sms_loop_enabled)
|
|
||||||
Action.SMS_LOOP_RESUME.name -> resourceHelper.gs(R.string.uel_sms_loop_resume)
|
|
||||||
Action.SMS_LOOP_SUSPEND.name -> resourceHelper.gs(R.string.uel_sms_loop_suspend)
|
|
||||||
Action.SMS_PROFILE.name -> resourceHelper.gs(R.string.uel_sms_profile)
|
|
||||||
Action.SMS_PUMP_CONNECT.name -> resourceHelper.gs(R.string.uel_sms_pump_connect)
|
|
||||||
Action.SMS_PUMP_DISCONNECT.name -> resourceHelper.gs(R.string.uel_sms_pump_disconnect)
|
|
||||||
Action.SMS_SMS.name -> resourceHelper.gs(R.string.uel_sms_sms)
|
|
||||||
Action.SMS_TT.name -> resourceHelper.gs(R.string.uel_sms_tt)
|
|
||||||
Action.TT_DELETED_FROM_NS.name -> resourceHelper.gs(R.string.uel_tt_deleted_from_ns)
|
|
||||||
Action.TT_FROM_NS.name -> resourceHelper.gs(R.string.uel_tt_from_ns)
|
|
||||||
Action.TT_CANCELED_FROM_NS.name -> resourceHelper.gs(R.string.uel_tt_canceleted_from_ns)
|
|
||||||
Action.CAREPORTAL_DELETED_FROM_NS.name -> resourceHelper.gs(R.string.uel_careportal_deleted_from_ns)
|
|
||||||
Action.CAREPORTAL_FROM_NS.name -> resourceHelper.gs(R.string.uel_careportal_from_ns)
|
|
||||||
Action.EXPORT_CSV.name -> resourceHelper.gs(R.string.uel_export_csv)
|
|
||||||
|
|
||||||
Units.Mg_Dl.name -> resourceHelper.gs(R.string.mgdl)
|
|
||||||
Units.Mmol_L.name -> resourceHelper.gs(R.string.mmol)
|
|
||||||
Units.U.name -> resourceHelper.gs(R.string.insulin_unit_shortname)
|
|
||||||
Units.U_H.name -> resourceHelper.gs(R.string.profile_ins_units_per_hour)
|
|
||||||
Units.G.name -> resourceHelper.gs(R.string.shortgram)
|
|
||||||
Units.M.name -> resourceHelper.gs(R.string.shortminute)
|
|
||||||
Units.H.name -> resourceHelper.gs(R.string.shorthour)
|
|
||||||
Units.Percent.name -> resourceHelper.gs(R.string.shortpercent)
|
|
||||||
Units.None.name -> ""
|
|
||||||
|
|
||||||
else -> resourceHelper.gs(R.string.unknown)
|
else -> resourceHelper.gs(R.string.unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun translate(action: Action): String = when(action) {
|
||||||
|
Action.BOLUS -> resourceHelper.gs(R.string.uel_bolus)
|
||||||
|
Action.BOLUS_ADVISOR -> resourceHelper.gs(R.string.uel_bolus_advisor)
|
||||||
|
Action.BOLUS_RECORD -> resourceHelper.gs(R.string.uel_bolus_record)
|
||||||
|
Action.EXTENDED_BOLUS -> resourceHelper.gs(R.string.uel_extended_bolus)
|
||||||
|
Action.SUPERBOLUS_TBR -> resourceHelper.gs(R.string.uel_superbolus_tbr)
|
||||||
|
Action.CARBS -> resourceHelper.gs(R.string.uel_carbs)
|
||||||
|
Action.EXTENDED_CARBS -> resourceHelper.gs(R.string.uel_extended_carbs)
|
||||||
|
Action.TEMP_BASAL -> resourceHelper.gs(R.string.uel_temp_basal)
|
||||||
|
Action.TT -> resourceHelper.gs(R.string.uel_tt)
|
||||||
|
Action.NEW_PROFILE -> resourceHelper.gs(R.string.uel_new_profile)
|
||||||
|
Action.CLONE_PROFILE -> resourceHelper.gs(R.string.uel_clone_profile)
|
||||||
|
Action.STORE_PROFILE -> resourceHelper.gs(R.string.uel_store_profile)
|
||||||
|
Action.PROFILE_SWITCH -> resourceHelper.gs(R.string.uel_profile_switch)
|
||||||
|
Action.PROFILE_SWITCH_CLONED -> resourceHelper.gs(R.string.uel_profile_switch_cloned)
|
||||||
|
Action.CLOSED_LOOP_MODE -> resourceHelper.gs(R.string.uel_closed_loop_mode)
|
||||||
|
Action.LGS_LOOP_MODE -> resourceHelper.gs(R.string.uel_lgs_loop_mode)
|
||||||
|
Action.OPEN_LOOP_MODE -> resourceHelper.gs(R.string.uel_open_loop_mode)
|
||||||
|
Action.LOOP_DISABLED -> resourceHelper.gs(R.string.uel_loop_disabled)
|
||||||
|
Action.LOOP_ENABLED -> resourceHelper.gs(R.string.uel_loop_enabled)
|
||||||
|
Action.RECONNECT -> resourceHelper.gs(R.string.uel_reconnect)
|
||||||
|
Action.DISCONNECT -> resourceHelper.gs(R.string.uel_disconnect)
|
||||||
|
Action.RESUME -> resourceHelper.gs(R.string.uel_resume)
|
||||||
|
Action.SUSPEND -> resourceHelper.gs(R.string.uel_suspend)
|
||||||
|
Action.HW_PUMP_ALLOWED -> resourceHelper.gs(R.string.uel_hw_pump_allowed)
|
||||||
|
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_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)
|
||||||
|
Action.CALIBRATION -> resourceHelper.gs(R.string.uel_calibration)
|
||||||
|
Action.PRIME_BOLUS -> resourceHelper.gs(R.string.uel_prime_bolus)
|
||||||
|
Action.TREATMENT -> resourceHelper.gs(R.string.uel_treatment)
|
||||||
|
Action.CAREPORTAL_NS_REFRESH -> resourceHelper.gs(R.string.uel_careportal_ns_refresh)
|
||||||
|
Action.PROFILE_SWITCH_NS_REFRESH -> resourceHelper.gs(R.string.uel_profile_switch_ns_refresh)
|
||||||
|
Action.TREATMENTS_NS_REFRESH -> resourceHelper.gs(R.string.uel_treatments_ns_refresh)
|
||||||
|
Action.TT_NS_REFRESH -> resourceHelper.gs(R.string.uel_tt_ns_refresh)
|
||||||
|
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.EXTENDED_BOLUS_REMOVED -> resourceHelper.gs(R.string.uel_extended_bolus_removed)
|
||||||
|
Action.FOOD_REMOVED -> resourceHelper.gs(R.string.uel_food_removed)
|
||||||
|
Action.PROFILE_REMOVED -> resourceHelper.gs(R.string.uel_profile_removed)
|
||||||
|
Action.PROFILE_SWITCH_REMOVED -> resourceHelper.gs(R.string.uel_profile_switch_removed)
|
||||||
|
Action.RESTART_EVENTS_REMOVED -> resourceHelper.gs(R.string.uel_restart_events_removed)
|
||||||
|
Action.TREATMENT_REMOVED -> resourceHelper.gs(R.string.uel_treatment_removed)
|
||||||
|
Action.TT_REMOVED -> resourceHelper.gs(R.string.uel_tt_removed)
|
||||||
|
Action.NS_PAUSED -> resourceHelper.gs(R.string.uel_ns_paused)
|
||||||
|
Action.NS_RESUME -> resourceHelper.gs(R.string.uel_ns_resume)
|
||||||
|
Action.NS_QUEUE_CLEARED -> resourceHelper.gs(R.string.uel_ns_queue_cleared)
|
||||||
|
Action.NS_SETTINGS_COPIED -> resourceHelper.gs(R.string.uel_ns_settings_copied)
|
||||||
|
Action.ERROR_DIALOG_OK -> resourceHelper.gs(R.string.uel_error_dialog_ok)
|
||||||
|
Action.ERROR_DIALOG_MUTE -> resourceHelper.gs(R.string.uel_error_dialog_mute)
|
||||||
|
Action.ERROR_DIALOG_MUTE_5MIN -> resourceHelper.gs(R.string.uel_error_dialog_mute_5min)
|
||||||
|
Action.OBJECTIVE_STARTED -> resourceHelper.gs(R.string.uel_objective_started)
|
||||||
|
Action.OBJECTIVE_UNSTARTED -> resourceHelper.gs(R.string.uel_objective_unstarted)
|
||||||
|
Action.OBJECTIVES_SKIPPED -> resourceHelper.gs(R.string.uel_objectives_skipped)
|
||||||
|
Action.STAT_RESET -> resourceHelper.gs(R.string.uel_stat_reset)
|
||||||
|
Action.DELETE_LOGS -> resourceHelper.gs(R.string.uel_delete_logs)
|
||||||
|
Action.DELETE_FUTURE_TREATMENTS -> resourceHelper.gs(R.string.uel_delete_future_treatments)
|
||||||
|
Action.EXPORT_SETTINGS -> resourceHelper.gs(R.string.uel_export_settings)
|
||||||
|
Action.IMPORT_SETTINGS -> resourceHelper.gs(R.string.uel_import_settings)
|
||||||
|
Action.RESET_DATABASES -> resourceHelper.gs(R.string.uel_reset_databases)
|
||||||
|
Action.EXPORT_DATABASES -> resourceHelper.gs(R.string.uel_export_databases)
|
||||||
|
Action.IMPORT_DATABASES -> resourceHelper.gs(R.string.uel_import_databases)
|
||||||
|
Action.OTP_EXPORT -> resourceHelper.gs(R.string.uel_otp_export)
|
||||||
|
Action.OTP_RESET -> resourceHelper.gs(R.string.uel_otp_reset)
|
||||||
|
Action.SMS_BASAL -> resourceHelper.gs(R.string.uel_sms_basal)
|
||||||
|
Action.SMS_BOLUS -> resourceHelper.gs(R.string.uel_sms_bolus)
|
||||||
|
Action.SMS_CAL -> resourceHelper.gs(R.string.uel_sms_cal)
|
||||||
|
Action.SMS_CARBS -> resourceHelper.gs(R.string.uel_sms_carbs)
|
||||||
|
Action.SMS_EXTENDED_BOLUS -> resourceHelper.gs(R.string.uel_sms_extended_bolus)
|
||||||
|
Action.SMS_LOOP_DISABLED -> resourceHelper.gs(R.string.uel_sms_loop_disabled)
|
||||||
|
Action.SMS_LOOP_ENABLED -> resourceHelper.gs(R.string.uel_sms_loop_enabled)
|
||||||
|
Action.SMS_LOOP_RESUME -> resourceHelper.gs(R.string.uel_sms_loop_resume)
|
||||||
|
Action.SMS_LOOP_SUSPEND -> resourceHelper.gs(R.string.uel_sms_loop_suspend)
|
||||||
|
Action.SMS_PROFILE -> resourceHelper.gs(R.string.uel_sms_profile)
|
||||||
|
Action.SMS_PUMP_CONNECT -> resourceHelper.gs(R.string.uel_sms_pump_connect)
|
||||||
|
Action.SMS_PUMP_DISCONNECT -> resourceHelper.gs(R.string.uel_sms_pump_disconnect)
|
||||||
|
Action.SMS_SMS -> resourceHelper.gs(R.string.uel_sms_sms)
|
||||||
|
Action.SMS_TT -> resourceHelper.gs(R.string.uel_sms_tt)
|
||||||
|
Action.TT_DELETED_FROM_NS -> resourceHelper.gs(R.string.uel_tt_deleted_from_ns)
|
||||||
|
Action.TT_FROM_NS -> resourceHelper.gs(R.string.uel_tt_from_ns)
|
||||||
|
Action.TT_CANCELED_FROM_NS -> resourceHelper.gs(R.string.uel_tt_canceleted_from_ns)
|
||||||
|
Action.CAREPORTAL_DELETED_FROM_NS -> resourceHelper.gs(R.string.uel_careportal_deleted_from_ns)
|
||||||
|
Action.CAREPORTAL_FROM_NS -> resourceHelper.gs(R.string.uel_careportal_from_ns)
|
||||||
|
Action.EXPORT_CSV -> resourceHelper.gs(R.string.uel_export_csv)
|
||||||
|
Action.FOOD_FROM_NS -> resourceHelper.gs(R.string.unknown) // TODO?
|
||||||
|
Action.UNKNOWN -> resourceHelper.gs(R.string.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun translate(units: Units): String = when(units) {
|
||||||
|
Units.Mg_Dl -> resourceHelper.gs(R.string.mgdl)
|
||||||
|
Units.Mmol_L -> resourceHelper.gs(R.string.mmol)
|
||||||
|
Units.U -> resourceHelper.gs(R.string.insulin_unit_shortname)
|
||||||
|
Units.U_H -> resourceHelper.gs(R.string.profile_ins_units_per_hour)
|
||||||
|
Units.G -> resourceHelper.gs(R.string.shortgram)
|
||||||
|
Units.M -> resourceHelper.gs(R.string.shortminute)
|
||||||
|
Units.H -> resourceHelper.gs(R.string.shorthour)
|
||||||
|
Units.Percent -> resourceHelper.gs(R.string.shortpercent)
|
||||||
|
Units.None -> ""
|
||||||
|
|
||||||
|
else -> resourceHelper.gs(R.string.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun translate(meterType: TherapyEvent.MeterType): String = when(meterType) {
|
||||||
|
TherapyEvent.MeterType.FINGER -> resourceHelper.gs(R.string.glucosetype_finger)
|
||||||
|
TherapyEvent.MeterType.SENSOR -> resourceHelper.gs(R.string.glucosetype_sensor)
|
||||||
|
TherapyEvent.MeterType.MANUAL -> resourceHelper.gs(R.string.manual)
|
||||||
|
|
||||||
|
else -> resourceHelper.gs(R.string.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun translate(type: TherapyEvent.Type): String = when(type) {
|
||||||
|
TherapyEvent.Type.FINGER_STICK_BG_VALUE -> resourceHelper.gs(R.string.careportal_bgcheck)
|
||||||
|
TherapyEvent.Type.SNACK_BOLUS -> resourceHelper.gs(R.string.careportal_snackbolus)
|
||||||
|
TherapyEvent.Type.MEAL_BOLUS -> resourceHelper.gs(R.string.careportal_mealbolus)
|
||||||
|
TherapyEvent.Type.CORRECTION_BOLUS -> resourceHelper.gs(R.string.careportal_correctionbolus)
|
||||||
|
TherapyEvent.Type.CARBS_CORRECTION -> resourceHelper.gs(R.string.careportal_carbscorrection)
|
||||||
|
TherapyEvent.Type.BOLUS_WIZARD -> resourceHelper.gs(R.string.boluswizard)
|
||||||
|
TherapyEvent.Type.COMBO_BOLUS -> resourceHelper.gs(R.string.careportal_combobolus)
|
||||||
|
TherapyEvent.Type.ANNOUNCEMENT -> resourceHelper.gs(R.string.careportal_announcement)
|
||||||
|
TherapyEvent.Type.NOTE -> resourceHelper.gs(R.string.careportal_note)
|
||||||
|
TherapyEvent.Type.QUESTION -> resourceHelper.gs(R.string.careportal_question)
|
||||||
|
TherapyEvent.Type.EXERCISE -> resourceHelper.gs(R.string.careportal_exercise)
|
||||||
|
TherapyEvent.Type.CANNULA_CHANGE -> resourceHelper.gs(R.string.careportal_pumpsitechange)
|
||||||
|
TherapyEvent.Type.PUMP_BATTERY_CHANGE -> resourceHelper.gs(R.string.careportal_pumpbatterychange)
|
||||||
|
TherapyEvent.Type.SENSOR_STARTED -> resourceHelper.gs(R.string.careportal_cgmsensorstart)
|
||||||
|
TherapyEvent.Type.SENSOR_STOPPED -> resourceHelper.gs(R.string.careportal_cgm_sensor_stop)
|
||||||
|
TherapyEvent.Type.SENSOR_CHANGE -> resourceHelper.gs(R.string.careportal_cgmsensorinsert)
|
||||||
|
TherapyEvent.Type.INSULIN_CHANGE -> resourceHelper.gs(R.string.careportal_insulincartridgechange)
|
||||||
|
TherapyEvent.Type.DAD_ALERT -> resourceHelper.gs(R.string.careportal_dad_alert)
|
||||||
|
TherapyEvent.Type.TEMPORARY_BASAL_START -> resourceHelper.gs(R.string.careportal_tempbasalstart)
|
||||||
|
TherapyEvent.Type.TEMPORARY_BASAL_END -> resourceHelper.gs(R.string.careportal_tempbasalend)
|
||||||
|
TherapyEvent.Type.PROFILE_SWITCH -> resourceHelper.gs(R.string.careportal_profileswitch)
|
||||||
|
TherapyEvent.Type.TEMPORARY_TARGET -> resourceHelper.gs(R.string.careportal_temporarytarget)
|
||||||
|
TherapyEvent.Type.TEMPORARY_TARGET_CANCEL -> resourceHelper.gs(R.string.careportal_temporarytargetcancel)
|
||||||
|
TherapyEvent.Type.APS_OFFLINE -> resourceHelper.gs(R.string.careportal_openapsoffline)
|
||||||
|
TherapyEvent.Type.NS_MBG -> resourceHelper.gs(R.string.careportal_mbg)
|
||||||
|
|
||||||
|
else -> resourceHelper.gs(R.string.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun translate(reason: TemporaryTarget.Reason): String = when(reason) {
|
||||||
|
TemporaryTarget.Reason.CUSTOM -> resourceHelper.gs(R.string.custom)
|
||||||
|
TemporaryTarget.Reason.HYPOGLYCEMIA -> resourceHelper.gs(R.string.hypo)
|
||||||
|
TemporaryTarget.Reason.EATING_SOON -> resourceHelper.gs(R.string.eatingsoon)
|
||||||
|
TemporaryTarget.Reason.ACTIVITY -> resourceHelper.gs(R.string.activity)
|
||||||
|
TemporaryTarget.Reason.AUTOMATION -> resourceHelper.gs(R.string.automation)
|
||||||
|
TemporaryTarget.Reason.WEAR -> resourceHelper.gs(R.string.wear)
|
||||||
|
|
||||||
|
else -> resourceHelper.gs(R.string.unknown)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -115,17 +115,10 @@ data class UserEntry(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data class ValueWithUnit (val dValue: Double=0.0, val iValue: Int=0, val lValue: Long=0, val sValue: String="", val unit: Units=Units.None, val condition:Boolean=true){
|
data class ValueWithUnit (val dValue: Double=0.0, val iValue: Int=0, val lValue: Long=0, val sValue: String="", val unit: Units=Units.None, val condition:Boolean=true){
|
||||||
constructor(dvalue: Double, unit: Units, condition:Boolean = true) : this(dvalue, 0, 0, "", unit, condition)
|
|
||||||
constructor(ivalue: Int, unit: Units, condition:Boolean = true) : this(0.0, ivalue, 0, "", unit, condition)
|
|
||||||
constructor(lvalue: Long, unit: Units, condition:Boolean = true) : this(0.0,0, lvalue, "", unit, condition)
|
|
||||||
constructor(svalue: String, unit:Units) : this(0.0,0, 0, svalue, unit, svalue != "")
|
|
||||||
constructor(dvalue: Double, unit:String) : this(dvalue,0, 0, "", Units.fromText(unit))
|
|
||||||
constructor(rStringRef: Int, nbParam: Long) : this(0.0, rStringRef, nbParam, "", Units.R_String, !rStringRef.equals(0)) // additionnal constructors for formated strings with additional values as parameters (define number of parameters as long
|
|
||||||
|
|
||||||
fun value() : Any {
|
fun value() : Any {
|
||||||
if (sValue != "") return sValue
|
if (sValue != "") return sValue
|
||||||
if (!dValue.equals(0.0)) return dValue
|
if (!dValue.equals(0.0)) return dValue
|
||||||
if (!iValue.equals(0)) return iValue
|
if (iValue != 0) return iValue
|
||||||
return lValue
|
return lValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package info.nightscout.androidaps.database.entities
|
||||||
|
|
||||||
|
import androidx.annotation.StringRes
|
||||||
|
|
||||||
|
sealed class XXXValueWithUnit {
|
||||||
|
|
||||||
|
object UNKNOWN : XXXValueWithUnit() // formerly None used as fallback
|
||||||
|
|
||||||
|
data class SimpleString(val value: String) : XXXValueWithUnit() // formerly one usage of None
|
||||||
|
|
||||||
|
data class SimpleInt(val value: Int) : XXXValueWithUnit() // formerly one usage of None
|
||||||
|
|
||||||
|
class Mgdl(val value: Double) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Mmoll(val value: Double) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Timestamp(val value: Long) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Insulin(val value: Double) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class UnitPerHour(val value: Double) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Gram(val value: Int) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Minute(val value: Int) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Hour(val value: Int) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class Percent(val value: Int) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class TherapyEvent(val value: String) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class TherapyEventType(val value: info.nightscout.androidaps.database.entities.TherapyEvent.Type) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class TherapyEventMeterType(val value: info.nightscout.androidaps.database.entities.TherapyEvent.MeterType) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
class TherapyEventTTReason(val value: TemporaryTarget.Reason) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class StringResource(@StringRes val value: Int, val params : List<XXXValueWithUnit> = listOf()) : XXXValueWithUnit()
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
fun fromGlucoseUnit(value: Double, string: String): XXXValueWithUnit? = when (string) {
|
||||||
|
"mg/dl", "mgdl" -> Mgdl(value)
|
||||||
|
"mmol", "mmol/l" -> Mmoll(value)
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Idea: Leverage sealed classes for units
|
||||||
|
* Advantage: it is clear what type of data a Unit contains. Still we are exhaustive on when
|
||||||
|
*
|
||||||
|
* The condition "condition" that is used to check if an item should be logged can be replaced by .takeIf { condition }.
|
||||||
|
* The value then would not have to be handled but the logging could simply discard null value.
|
||||||
|
*/
|
|
@ -0,0 +1,144 @@
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||||
|
|
||||||
|
enum class SourceSensorDomain(val text : String) {
|
||||||
|
@SerializedName("AndroidAPS-Dexcom")
|
||||||
|
DEXCOM_NATIVE_UNKNOWN("AndroidAPS-Dexcom"),
|
||||||
|
@SerializedName("AndroidAPS-DexcomG6")
|
||||||
|
DEXCOM_G6_NATIVE("AndroidAPS-DexcomG6"),
|
||||||
|
@SerializedName("AndroidAPS-DexcomG5")
|
||||||
|
DEXCOM_G5_NATIVE("AndroidAPS-DexcomG5"),
|
||||||
|
@SerializedName("Bluetooth Wixel")
|
||||||
|
DEXCOM_G4_WIXEL("Bluetooth Wixel"),
|
||||||
|
@SerializedName("xBridge Wixel")
|
||||||
|
DEXCOM_G4_XBRIDGE("xBridge Wixel"),
|
||||||
|
@SerializedName("G4 Share Receiver")
|
||||||
|
DEXCOM_G4_NATIVE("G4 Share Receiver"),
|
||||||
|
@SerializedName("Medtrum A6")
|
||||||
|
MEDTRUM_A6("Medtrum A6"),
|
||||||
|
@SerializedName("Network G4")
|
||||||
|
DEXCOM_G4_NET("Network G4"),
|
||||||
|
@SerializedName("Network G4 and xBridge")
|
||||||
|
DEXCOM_G4_NET_XBRIDGE("Network G4 and xBridge"),
|
||||||
|
@SerializedName("Network G4 and Classic xDrip")
|
||||||
|
DEXCOM_G4_NET_CLASSIC("Network G4 and Classic xDrip"),
|
||||||
|
@SerializedName("DexcomG5")
|
||||||
|
DEXCOM_G5_XDRIP("DexcomG5"),
|
||||||
|
@SerializedName("G6 Native")
|
||||||
|
DEXCOM_G6_NATIVE_XDRIP("G6 Native"),
|
||||||
|
@SerializedName("G5 Native")
|
||||||
|
DEXCOM_G5_NATIVE_XDRIP("G5 Native"),
|
||||||
|
@SerializedName("G6 Native / G5 Native")
|
||||||
|
DEXCOM_G6_G5_NATIVE_XDRIP("G6 Native / G5 Native"),
|
||||||
|
@SerializedName("Network libre")
|
||||||
|
LIBRE_1_NET("Network libre"),
|
||||||
|
@SerializedName("BlueReader")
|
||||||
|
LIBRE_1_BLUE("BlueReader"),
|
||||||
|
@SerializedName("Transmiter PL")
|
||||||
|
LIBRE_1_PL("Transmiter PL"),
|
||||||
|
@SerializedName("Blucon")
|
||||||
|
LIBRE_1_BLUCON("Blucon"),
|
||||||
|
@SerializedName("Tomato")
|
||||||
|
LIBRE_1_TOMATO("Tomato"),
|
||||||
|
@SerializedName("Rfduino")
|
||||||
|
LIBRE_1_RF("Rfduino"),
|
||||||
|
@SerializedName("LimiTTer")
|
||||||
|
LIBRE_1_LIMITTER("LimiTTer"),
|
||||||
|
@SerializedName("Glimp")
|
||||||
|
GLIMP("Glimp"),
|
||||||
|
@SerializedName("Libre2")
|
||||||
|
LIBRE_2_NATIVE("Libre2"),
|
||||||
|
@SerializedName("Poctech")
|
||||||
|
POCTECH_NATIVE("Poctech"),
|
||||||
|
@SerializedName("MM600Series")
|
||||||
|
MM_600_SERIES("MM600Series"),
|
||||||
|
@SerializedName("Eversense")
|
||||||
|
EVERSENSE("Eversense"),
|
||||||
|
@SerializedName("Random")
|
||||||
|
RANDOM("Random"),
|
||||||
|
@SerializedName("Unknown")
|
||||||
|
UNKNOWN("Unknown"),
|
||||||
|
|
||||||
|
@SerializedName("IOBPrediction")
|
||||||
|
IOB_PREDICTION("IOBPrediction"),
|
||||||
|
@SerializedName("aCOBPrediction")
|
||||||
|
aCOB_PREDICTION("aCOBPrediction"),
|
||||||
|
@SerializedName("COBPrediction")
|
||||||
|
COB_PREDICTION("COBPrediction"),
|
||||||
|
@SerializedName("UAMPrediction")
|
||||||
|
UAM_PREDICTION("UAMPrediction"),
|
||||||
|
@SerializedName("ZTPrediction")
|
||||||
|
ZT_PREDICTION("ZTPrediction")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun GlucoseValue.SourceSensor.toDomain(): SourceSensorDomain = when(this) {
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_NATIVE_UNKNOWN -> SourceSensorDomain.DEXCOM_NATIVE_UNKNOWN
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G6_NATIVE -> SourceSensorDomain.DEXCOM_G6_NATIVE
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G5_NATIVE -> SourceSensorDomain.DEXCOM_G5_NATIVE
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_WIXEL -> SourceSensorDomain.DEXCOM_G4_WIXEL
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_XBRIDGE -> SourceSensorDomain.DEXCOM_G4_XBRIDGE
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_NATIVE -> SourceSensorDomain.DEXCOM_G4_NATIVE
|
||||||
|
GlucoseValue.SourceSensor.MEDTRUM_A6 -> SourceSensorDomain.MEDTRUM_A6
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_NET -> SourceSensorDomain.DEXCOM_G4_NET
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_NET_XBRIDGE -> SourceSensorDomain.DEXCOM_G4_NET_XBRIDGE
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G4_NET_CLASSIC -> SourceSensorDomain.DEXCOM_G4_NET_CLASSIC
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G5_XDRIP -> SourceSensorDomain.DEXCOM_G5_XDRIP
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G6_NATIVE_XDRIP -> SourceSensorDomain.DEXCOM_G6_NATIVE_XDRIP
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G5_NATIVE_XDRIP -> SourceSensorDomain.DEXCOM_G5_NATIVE_XDRIP
|
||||||
|
GlucoseValue.SourceSensor.DEXCOM_G6_G5_NATIVE_XDRIP -> SourceSensorDomain.DEXCOM_G6_G5_NATIVE_XDRIP
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_NET -> SourceSensorDomain.LIBRE_1_NET
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_BLUE -> SourceSensorDomain.LIBRE_1_BLUE
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_PL -> SourceSensorDomain.LIBRE_1_PL
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_BLUCON -> SourceSensorDomain.LIBRE_1_BLUCON
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_TOMATO -> SourceSensorDomain.LIBRE_1_TOMATO
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_RF -> SourceSensorDomain.LIBRE_1_LIMITTER
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_1_LIMITTER -> SourceSensorDomain.LIBRE_1_LIMITTER
|
||||||
|
GlucoseValue.SourceSensor.GLIMP -> SourceSensorDomain.GLIMP
|
||||||
|
GlucoseValue.SourceSensor.LIBRE_2_NATIVE -> SourceSensorDomain.LIBRE_2_NATIVE
|
||||||
|
GlucoseValue.SourceSensor.POCTECH_NATIVE -> SourceSensorDomain.POCTECH_NATIVE
|
||||||
|
GlucoseValue.SourceSensor.MM_600_SERIES -> SourceSensorDomain.MM_600_SERIES
|
||||||
|
GlucoseValue.SourceSensor.EVERSENSE -> SourceSensorDomain.EVERSENSE
|
||||||
|
GlucoseValue.SourceSensor.RANDOM -> SourceSensorDomain.RANDOM
|
||||||
|
GlucoseValue.SourceSensor.UNKNOWN -> SourceSensorDomain.UNKNOWN
|
||||||
|
GlucoseValue.SourceSensor.IOB_PREDICTION -> SourceSensorDomain.IOB_PREDICTION
|
||||||
|
GlucoseValue.SourceSensor.aCOB_PREDICTION -> SourceSensorDomain.aCOB_PREDICTION
|
||||||
|
GlucoseValue.SourceSensor.COB_PREDICTION -> SourceSensorDomain.COB_PREDICTION
|
||||||
|
GlucoseValue.SourceSensor.UAM_PREDICTION -> SourceSensorDomain.UAM_PREDICTION
|
||||||
|
GlucoseValue.SourceSensor.ZT_PREDICTION -> SourceSensorDomain.ZT_PREDICTION
|
||||||
|
}
|
||||||
|
|
||||||
|
fun SourceSensorDomain.toPersistence(): GlucoseValue.SourceSensor = when(this) {
|
||||||
|
SourceSensorDomain.DEXCOM_NATIVE_UNKNOWN -> GlucoseValue.SourceSensor.DEXCOM_NATIVE_UNKNOWN
|
||||||
|
SourceSensorDomain.DEXCOM_G6_NATIVE -> GlucoseValue.SourceSensor.DEXCOM_G6_NATIVE
|
||||||
|
SourceSensorDomain.DEXCOM_G5_NATIVE -> GlucoseValue.SourceSensor.DEXCOM_G5_NATIVE
|
||||||
|
SourceSensorDomain.DEXCOM_G4_WIXEL -> GlucoseValue.SourceSensor.DEXCOM_G4_WIXEL
|
||||||
|
SourceSensorDomain.DEXCOM_G4_XBRIDGE -> GlucoseValue.SourceSensor.DEXCOM_G4_XBRIDGE
|
||||||
|
SourceSensorDomain.DEXCOM_G4_NATIVE -> GlucoseValue.SourceSensor.DEXCOM_G4_NATIVE
|
||||||
|
SourceSensorDomain.MEDTRUM_A6 -> GlucoseValue.SourceSensor.MEDTRUM_A6
|
||||||
|
SourceSensorDomain.DEXCOM_G4_NET -> GlucoseValue.SourceSensor.DEXCOM_G4_NET
|
||||||
|
SourceSensorDomain.DEXCOM_G4_NET_XBRIDGE -> GlucoseValue.SourceSensor.DEXCOM_G4_NET_XBRIDGE
|
||||||
|
SourceSensorDomain.DEXCOM_G4_NET_CLASSIC -> GlucoseValue.SourceSensor.DEXCOM_G4_NET_CLASSIC
|
||||||
|
SourceSensorDomain.DEXCOM_G5_XDRIP -> GlucoseValue.SourceSensor.DEXCOM_G5_XDRIP
|
||||||
|
SourceSensorDomain.DEXCOM_G6_NATIVE_XDRIP -> GlucoseValue.SourceSensor.DEXCOM_G6_NATIVE_XDRIP
|
||||||
|
SourceSensorDomain.DEXCOM_G5_NATIVE_XDRIP -> GlucoseValue.SourceSensor.DEXCOM_G5_NATIVE_XDRIP
|
||||||
|
SourceSensorDomain.DEXCOM_G6_G5_NATIVE_XDRIP -> GlucoseValue.SourceSensor.DEXCOM_G6_G5_NATIVE_XDRIP
|
||||||
|
SourceSensorDomain.LIBRE_1_NET -> GlucoseValue.SourceSensor.LIBRE_1_NET
|
||||||
|
SourceSensorDomain.LIBRE_1_BLUE -> GlucoseValue.SourceSensor.LIBRE_1_BLUE
|
||||||
|
SourceSensorDomain.LIBRE_1_PL -> GlucoseValue.SourceSensor.LIBRE_1_PL
|
||||||
|
SourceSensorDomain.LIBRE_1_BLUCON -> GlucoseValue.SourceSensor.LIBRE_1_BLUCON
|
||||||
|
SourceSensorDomain.LIBRE_1_TOMATO -> GlucoseValue.SourceSensor.LIBRE_1_TOMATO
|
||||||
|
SourceSensorDomain.LIBRE_1_RF -> GlucoseValue.SourceSensor.LIBRE_1_LIMITTER
|
||||||
|
SourceSensorDomain.LIBRE_1_LIMITTER -> GlucoseValue.SourceSensor.LIBRE_1_LIMITTER
|
||||||
|
SourceSensorDomain.GLIMP -> GlucoseValue.SourceSensor.GLIMP
|
||||||
|
SourceSensorDomain.LIBRE_2_NATIVE -> GlucoseValue.SourceSensor.LIBRE_2_NATIVE
|
||||||
|
SourceSensorDomain.POCTECH_NATIVE -> GlucoseValue.SourceSensor.POCTECH_NATIVE
|
||||||
|
SourceSensorDomain.MM_600_SERIES -> GlucoseValue.SourceSensor.MM_600_SERIES
|
||||||
|
SourceSensorDomain.EVERSENSE -> GlucoseValue.SourceSensor.EVERSENSE
|
||||||
|
SourceSensorDomain.RANDOM -> GlucoseValue.SourceSensor.RANDOM
|
||||||
|
SourceSensorDomain.UNKNOWN -> GlucoseValue.SourceSensor.UNKNOWN
|
||||||
|
SourceSensorDomain.IOB_PREDICTION -> GlucoseValue.SourceSensor.IOB_PREDICTION
|
||||||
|
SourceSensorDomain.aCOB_PREDICTION -> GlucoseValue.SourceSensor.aCOB_PREDICTION
|
||||||
|
SourceSensorDomain.COB_PREDICTION -> GlucoseValue.SourceSensor.COB_PREDICTION
|
||||||
|
SourceSensorDomain.UAM_PREDICTION -> GlucoseValue.SourceSensor.UAM_PREDICTION
|
||||||
|
SourceSensorDomain.ZT_PREDICTION -> GlucoseValue.SourceSensor.ZT_PREDICTION
|
||||||
|
}
|
Loading…
Reference in a new issue