pair programming session
This commit is contained in:
parent
8d8abd65a7
commit
c2b3e617df
41 changed files with 353 additions and 347 deletions
|
@ -9,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogCalibrationBinding
|
import info.nightscout.androidaps.databinding.DialogCalibrationBinding
|
||||||
|
@ -81,7 +81,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, Sources.CalibrationDialog, XXXValueWithUnit.fromGlucoseUnit(bg, units))
|
uel.log(Action.CALIBRATION, Sources.CalibrationDialog, ValueWithUnit.fromGlucoseUnit(bg, units))
|
||||||
xdripCalibrations.sendIntent(bg)
|
xdripCalibrations.sendIntent(bg)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -225,9 +225,9 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
when {
|
when {
|
||||||
activitySelected -> {
|
activitySelected -> {
|
||||||
uel.log(Action.TT, Sources.CarbDialog,
|
uel.log(Action.TT, Sources.CarbDialog,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.ACTIVITY),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.ACTIVITY),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(activityTT, units) ,
|
ValueWithUnit.fromGlucoseUnit(activityTT, units) ,
|
||||||
XXXValueWithUnit.Minute(activityTTDuration))
|
ValueWithUnit.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()),
|
||||||
|
@ -244,9 +244,9 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
|
|
||||||
eatingSoonSelected -> {
|
eatingSoonSelected -> {
|
||||||
uel.log(Action.TT, Sources.CarbDialog,
|
uel.log(Action.TT, Sources.CarbDialog,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units) ,
|
ValueWithUnit.fromGlucoseUnit(eatingSoonTT, units) ,
|
||||||
XXXValueWithUnit.Minute(eatingSoonTTDuration))
|
ValueWithUnit.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()),
|
||||||
|
@ -263,9 +263,9 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
|
|
||||||
hypoSelected -> {
|
hypoSelected -> {
|
||||||
uel.log(Action.TT, Sources.CarbDialog,
|
uel.log(Action.TT, Sources.CarbDialog,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.HYPOGLYCEMIA),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.HYPOGLYCEMIA),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(hypoTT, units) ,
|
ValueWithUnit.fromGlucoseUnit(hypoTT, units) ,
|
||||||
XXXValueWithUnit.Minute(hypoTTDuration))
|
ValueWithUnit.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()),
|
||||||
|
@ -290,10 +290,10 @@ class CarbsDialog : DialogFragmentWithDate() {
|
||||||
detailedBolusInfo.carbsTimestamp = time
|
detailedBolusInfo.carbsTimestamp = time
|
||||||
uel.log(if (duration == 0) Action.CARBS else Action.EXTENDED_CARBS, Sources.CarbDialog,
|
uel.log(if (duration == 0) Action.CARBS else Action.EXTENDED_CARBS, Sources.CarbDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged },
|
ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged },
|
||||||
XXXValueWithUnit.Gram(carbsAfterConstraints),
|
ValueWithUnit.Gram(carbsAfterConstraints),
|
||||||
XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset != 0 },
|
ValueWithUnit.Minute(timeOffset).takeIf { timeOffset != 0 },
|
||||||
XXXValueWithUnit.Hour(duration).takeIf { duration != 0 })
|
ValueWithUnit.Hour(duration).takeIf { duration != 0 })
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ 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.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -61,7 +61,7 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
|
|
||||||
private var options: EventType = EventType.BGCHECK
|
private var options: EventType = EventType.BGCHECK
|
||||||
//private var valuesWithUnit = mutableListOf<XXXValueWithUnit?>()
|
//private var valuesWithUnit = mutableListOf<XXXValueWithUnit?>()
|
||||||
private var valuesWithUnit = mutableListOf<XXXValueWithUnit?>()
|
private var valuesWithUnit = mutableListOf<ValueWithUnit?>()
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
private var event: Int = R.string.none
|
private var event: Int = R.string.none
|
||||||
|
@ -203,13 +203,13 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
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(XXXValueWithUnit.fromGlucoseUnit(binding.bg.value.toDouble(), profileFunction.getUnits()))
|
valuesWithUnit.add(ValueWithUnit.fromGlucoseUnit(binding.bg.value.toDouble(), profileFunction.getUnits()))
|
||||||
valuesWithUnit.add(XXXValueWithUnit.TherapyEventMeterType(meterType))
|
valuesWithUnit.add(ValueWithUnit.TherapyEventMeterType(meterType))
|
||||||
}
|
}
|
||||||
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(XXXValueWithUnit.Minute(binding.duration.value.toInt()).takeIf { !binding.duration.value.equals(0.0) } )
|
valuesWithUnit.add(ValueWithUnit.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()) {
|
||||||
|
@ -238,8 +238,8 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted therapy event $it") } },
|
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted therapy event $it") } },
|
||||||
{ aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", it) }
|
{ aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", it) }
|
||||||
)
|
)
|
||||||
valuesWithUnit.add(0, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
|
valuesWithUnit.add(0, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
|
||||||
valuesWithUnit.add(1, XXXValueWithUnit.TherapyEventType(therapyEvent.type))
|
valuesWithUnit.add(1, ValueWithUnit.TherapyEventType(therapyEvent.type))
|
||||||
uel.log(Action.CAREPORTAL, source, notes, valuesWithUnit)
|
uel.log(Action.CAREPORTAL, source, notes, valuesWithUnit)
|
||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding
|
import info.nightscout.androidaps.databinding.DialogExtendedbolusBinding
|
||||||
|
@ -91,8 +91,8 @@ 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, Sources.ExtendedBolusDialog,
|
uel.log(Action.EXTENDED_BOLUS, Sources.ExtendedBolusDialog,
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraint),
|
ValueWithUnit.Insulin(insulinAfterConstraint),
|
||||||
XXXValueWithUnit.Minute(durationInMinutes))
|
ValueWithUnit.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,7 +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.ValueWithUnit
|
||||||
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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -137,13 +137,13 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
if (insulinAfterConstraints > 0) {
|
if (insulinAfterConstraints > 0) {
|
||||||
uel.log(Action.PRIME_BOLUS, Sources.FillDialog,
|
uel.log(Action.PRIME_BOLUS, Sources.FillDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 })
|
ValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 })
|
||||||
requestPrimeBolus(insulinAfterConstraints, notes)
|
requestPrimeBolus(insulinAfterConstraints, notes)
|
||||||
}
|
}
|
||||||
if (siteChange) {
|
if (siteChange) {
|
||||||
uel.log(Action.CAREPORTAL, Sources.FillDialog,
|
uel.log(Action.CAREPORTAL, Sources.FillDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.CANNULA_CHANGE))
|
ValueWithUnit.TherapyEventType(TherapyEvent.Type.CANNULA_CHANGE))
|
||||||
disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction(
|
disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction(
|
||||||
timestamp = eventTime,
|
timestamp = eventTime,
|
||||||
type = TherapyEvent.Type.CANNULA_CHANGE,
|
type = TherapyEvent.Type.CANNULA_CHANGE,
|
||||||
|
@ -158,7 +158,7 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
// add a second for case of both checked
|
// add a second for case of both checked
|
||||||
uel.log(Action.CAREPORTAL, Sources.FillDialog,
|
uel.log(Action.CAREPORTAL, Sources.FillDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.TherapyEventType(TherapyEvent.Type.INSULIN_CHANGE))
|
ValueWithUnit.TherapyEventType(TherapyEvent.Type.INSULIN_CHANGE))
|
||||||
disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction(
|
disposable += repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction(
|
||||||
timestamp = eventTime + 1000,
|
timestamp = eventTime + 1000,
|
||||||
type = TherapyEvent.Type.INSULIN_CHANGE,
|
type = TherapyEvent.Type.INSULIN_CHANGE,
|
||||||
|
|
|
@ -15,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -191,9 +191,9 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
if (eatingSoonChecked) {
|
if (eatingSoonChecked) {
|
||||||
uel.log(Action.TT, Sources.InsulinDialog,
|
uel.log(Action.TT, Sources.InsulinDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(eatingSoonTT, units),
|
ValueWithUnit.fromGlucoseUnit(eatingSoonTT, units),
|
||||||
XXXValueWithUnit.Minute(eatingSoonTTDuration))
|
ValueWithUnit.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()),
|
||||||
|
@ -217,9 +217,9 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
if (recordOnlyChecked) {
|
if (recordOnlyChecked) {
|
||||||
uel.log(Action.BOLUS, Sources.InsulinDialog,
|
uel.log(Action.BOLUS, Sources.InsulinDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.StringResource(R.string.record),
|
ValueWithUnit.StringResource(R.string.record),
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints),
|
ValueWithUnit.Insulin(insulinAfterConstraints),
|
||||||
XXXValueWithUnit.Minute(timeOffset).takeIf { timeOffset!= 0 })
|
ValueWithUnit.Minute(timeOffset).takeIf { timeOffset!= 0 })
|
||||||
disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction())
|
disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") } },
|
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") } },
|
||||||
|
@ -233,7 +233,7 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
} else
|
} else
|
||||||
uel.log(Action.BOLUS, Sources.InsulinDialog,
|
uel.log(Action.BOLUS, Sources.InsulinDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints))
|
ValueWithUnit.Insulin(insulinAfterConstraints))
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogLoopBinding
|
import info.nightscout.androidaps.databinding.DialogLoopBinding
|
||||||
|
@ -305,49 +305,49 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_suspend_1h -> {
|
R.id.overview_suspend_1h -> {
|
||||||
uel.log(Action.SUSPEND, Sources.LoopDialog, XXXValueWithUnit.Hour(1))
|
uel.log(Action.SUSPEND, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Hour(2))
|
uel.log(Action.SUSPEND, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Hour(3))
|
uel.log(Action.SUSPEND, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Hour(10))
|
uel.log(Action.SUSPEND, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Minute(15))
|
uel.log(Action.DISCONNECT, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Minute(30))
|
uel.log(Action.DISCONNECT, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Hour(1))
|
uel.log(Action.DISCONNECT, Sources.LoopDialog, ValueWithUnit.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"))
|
||||||
|
@ -355,14 +355,14 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.overview_disconnect_2h -> {
|
R.id.overview_disconnect_2h -> {
|
||||||
uel.log(Action.DISCONNECT, Sources.LoopDialog, XXXValueWithUnit.Hour(2))
|
uel.log(Action.DISCONNECT, Sources.LoopDialog, ValueWithUnit.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, Sources.LoopDialog, XXXValueWithUnit.Hour(3))
|
uel.log(Action.DISCONNECT, Sources.LoopDialog, ValueWithUnit.Hour(3))
|
||||||
loopPlugin.disconnectPump(180, profile)
|
loopPlugin.disconnectPump(180, profile)
|
||||||
rxBus.send(EventRefreshOverview("suspendmenu"))
|
rxBus.send(EventRefreshOverview("suspendmenu"))
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -8,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogProfileswitchBinding
|
import info.nightscout.androidaps.databinding.DialogProfileswitchBinding
|
||||||
|
@ -130,11 +130,11 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
|
||||||
uel.log(Action.PROFILE_SWITCH,
|
uel.log(Action.PROFILE_SWITCH,
|
||||||
Sources.ProfileSwitchDialog,
|
Sources.ProfileSwitchDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged },
|
ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged },
|
||||||
XXXValueWithUnit.SimpleString(profile),
|
ValueWithUnit.SimpleString(profile),
|
||||||
XXXValueWithUnit.Percent(percent),
|
ValueWithUnit.Percent(percent),
|
||||||
XXXValueWithUnit.Hour(timeShift).takeIf { timeShift != 0 },
|
ValueWithUnit.Hour(timeShift).takeIf { timeShift != 0 },
|
||||||
XXXValueWithUnit.Minute(duration).takeIf { duration != 0 })
|
ValueWithUnit.Minute(duration).takeIf { duration != 0 })
|
||||||
treatmentsPlugin.doProfileSwitch(profileStore, profile, duration, percent, timeShift, eventTime)
|
treatmentsPlugin.doProfileSwitch(profileStore, profile, duration, percent, timeShift, eventTime)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogTempbasalBinding
|
import info.nightscout.androidaps.databinding.DialogTempbasalBinding
|
||||||
|
@ -129,13 +129,13 @@ class TempBasalDialog : DialogFragmentWithDate() {
|
||||||
}
|
}
|
||||||
if (isPercentPump) {
|
if (isPercentPump) {
|
||||||
uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog,
|
uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog,
|
||||||
XXXValueWithUnit.Percent(percent),
|
ValueWithUnit.Percent(percent),
|
||||||
XXXValueWithUnit.Minute(durationInMinutes))
|
ValueWithUnit.Minute(durationInMinutes))
|
||||||
commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback)
|
commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, callback)
|
||||||
} else {
|
} else {
|
||||||
uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog,
|
uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog,
|
||||||
XXXValueWithUnit.Insulin(absolute),
|
ValueWithUnit.Insulin(absolute),
|
||||||
XXXValueWithUnit.Minute(durationInMinutes))
|
ValueWithUnit.Minute(durationInMinutes))
|
||||||
commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback)
|
commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, callback)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -181,11 +181,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, Sources.TTDialog, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
resourceHelper.gs(R.string.eatingsoon) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON), ValueWithUnit.fromGlucoseUnit(target, units), ValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT, Sources.TTDialog, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.ACTIVITY), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
resourceHelper.gs(R.string.activity) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.ACTIVITY), ValueWithUnit.fromGlucoseUnit(target, units), ValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT, Sources.TTDialog, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.HYPOGLYCEMIA), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
resourceHelper.gs(R.string.hypo) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.HYPOGLYCEMIA), ValueWithUnit.fromGlucoseUnit(target, units), ValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.manual) -> uel.log(Action.TT, Sources.TTDialog, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.CUSTOM), XXXValueWithUnit.fromGlucoseUnit(target, units), XXXValueWithUnit.Minute(duration))
|
resourceHelper.gs(R.string.manual) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.CUSTOM), ValueWithUnit.fromGlucoseUnit(target, units), ValueWithUnit.Minute(duration))
|
||||||
resourceHelper.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, Sources.TTDialog, XXXValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged })
|
resourceHelper.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, Sources.TTDialog, ValueWithUnit.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))
|
||||||
|
|
|
@ -13,7 +13,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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.DialogTreatmentBinding
|
import info.nightscout.androidaps.databinding.DialogTreatmentBinding
|
||||||
|
@ -152,10 +152,10 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
||||||
detailedBolusInfo.context = context
|
detailedBolusInfo.context = context
|
||||||
if (recordOnlyChecked) {
|
if (recordOnlyChecked) {
|
||||||
uel.log(action, Sources.TreatmentDialog,
|
uel.log(action, Sources.TreatmentDialog,
|
||||||
XXXValueWithUnit.Timestamp(detailedBolusInfo.timestamp).takeIf { eventTimeChanged },
|
ValueWithUnit.Timestamp(detailedBolusInfo.timestamp).takeIf { eventTimeChanged },
|
||||||
XXXValueWithUnit.StringResource(R.string.record).takeIf { insulinAfterConstraints != 0.0 },
|
ValueWithUnit.StringResource(R.string.record).takeIf { insulinAfterConstraints != 0.0 },
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 },
|
ValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 },
|
||||||
XXXValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
||||||
if (detailedBolusInfo.insulin > 0)
|
if (detailedBolusInfo.insulin > 0)
|
||||||
disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction())
|
disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
@ -176,13 +176,13 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
||||||
} else
|
} else
|
||||||
uel.log(action, Sources.TreatmentDialog,
|
uel.log(action, Sources.TreatmentDialog,
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints),
|
ValueWithUnit.Insulin(insulinAfterConstraints),
|
||||||
XXXValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
uel.log(action, Sources.TreatmentDialog,
|
uel.log(action, Sources.TreatmentDialog,
|
||||||
XXXValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbs != 0 })
|
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbs != 0 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import info.nightscout.androidaps.database.AppRepository
|
||||||
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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction
|
import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction
|
import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction
|
||||||
import info.nightscout.androidaps.events.EventAcceptOpenLoopChange
|
import info.nightscout.androidaps.events.EventAcceptOpenLoopChange
|
||||||
|
@ -564,8 +564,8 @@ open class LoopPlugin @Inject constructor(
|
||||||
} else {
|
} else {
|
||||||
aapsLogger.debug(LTag.APS, "applyAPSRequest: tempBasalPercent()")
|
aapsLogger.debug(LTag.APS, "applyAPSRequest: tempBasalPercent()")
|
||||||
uel.log(Action.TEMP_BASAL, Sources.Loop,
|
uel.log(Action.TEMP_BASAL, Sources.Loop,
|
||||||
XXXValueWithUnit.Percent(request.percent),
|
ValueWithUnit.Percent(request.percent),
|
||||||
XXXValueWithUnit.Minute(request.duration))
|
ValueWithUnit.Minute(request.duration))
|
||||||
commandQueue.tempBasalPercent(request.percent, request.duration, false, profile!!, callback)
|
commandQueue.tempBasalPercent(request.percent, request.duration, false, profile!!, callback)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -587,8 +587,8 @@ open class LoopPlugin @Inject constructor(
|
||||||
} else {
|
} else {
|
||||||
aapsLogger.debug(LTag.APS, "applyAPSRequest: setTempBasalAbsolute()")
|
aapsLogger.debug(LTag.APS, "applyAPSRequest: setTempBasalAbsolute()")
|
||||||
uel.log(Action.TEMP_BASAL, Sources.Loop,
|
uel.log(Action.TEMP_BASAL, Sources.Loop,
|
||||||
XXXValueWithUnit.UnitPerHour(request.rate),
|
ValueWithUnit.UnitPerHour(request.rate),
|
||||||
XXXValueWithUnit.Minute(request.duration))
|
ValueWithUnit.Minute(request.duration))
|
||||||
commandQueue.tempBasalAbsolute(request.rate, request.duration, false, profile!!, callback)
|
commandQueue.tempBasalAbsolute(request.rate, request.duration, false, profile!!, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -628,7 +628,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
detailedBolusInfo.deliverAtTheLatest = request.deliverAt
|
detailedBolusInfo.deliverAtTheLatest = request.deliverAt
|
||||||
aapsLogger.debug(LTag.APS, "applyAPSRequest: bolus()")
|
aapsLogger.debug(LTag.APS, "applyAPSRequest: bolus()")
|
||||||
if (request.smb > 0.0)
|
if (request.smb > 0.0)
|
||||||
uel.log(Action.SMB, Sources.Loop, XXXValueWithUnit.Insulin(detailedBolusInfo.insulin))
|
uel.log(Action.SMB, Sources.Loop, ValueWithUnit.Insulin(detailedBolusInfo.insulin))
|
||||||
commandQueue.bolus(detailedBolusInfo, callback)
|
commandQueue.bolus(detailedBolusInfo, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import dagger.android.support.DaggerFragment
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
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
|
||||||
|
@ -311,7 +311,7 @@ class ObjectivesFragment : DaggerFragment() {
|
||||||
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, Sources.Objectives,
|
uel.log(Action.OBJECTIVE_UNSTARTED, Sources.Objectives,
|
||||||
XXXValueWithUnit.SimpleInt(position + 1))
|
ValueWithUnit.SimpleInt(position + 1))
|
||||||
objective.startedOn = 0
|
objective.startedOn = 0
|
||||||
scrollToCurrentObjective()
|
scrollToCurrentObjective()
|
||||||
rxBus.send(EventObjectivesUpdateGui())
|
rxBus.send(EventObjectivesUpdateGui())
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package info.nightscout.androidaps.plugins.general.nsclient
|
package info.nightscout.androidaps.plugins.general.nsclient
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.work.Data
|
|
||||||
import androidx.work.Worker
|
import androidx.work.Worker
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.workDataOf
|
import androidx.work.workDataOf
|
||||||
|
@ -9,7 +8,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.database.AppRepository
|
import info.nightscout.androidaps.database.AppRepository
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -92,14 +91,14 @@ class NSClientAddUpdateWorker(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Insulin(it.amount)
|
ValueWithUnit.Insulin(it.amount)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Insulin(it.amount)
|
ValueWithUnit.Insulin(it.amount)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,14 +115,14 @@ class NSClientAddUpdateWorker(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Gram(it.amount.toInt())
|
ValueWithUnit.Gram(it.amount.toInt())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Gram(it.amount.toInt())
|
ValueWithUnit.Gram(it.amount.toInt())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,26 +141,26 @@ class NSClientAddUpdateWorker(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.inserted.forEach { tt ->
|
result.inserted.forEach { tt ->
|
||||||
uel.log(Action.TT, Sources.NSClient,
|
uel.log(Action.TT, Sources.NSClient,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL),
|
ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach { tt ->
|
result.invalidated.forEach { tt ->
|
||||||
uel.log(Action.TT_REMOVED, Sources.NSClient,
|
uel.log(Action.TT_REMOVED, Sources.NSClient,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
ValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.ended.forEach { tt ->
|
result.ended.forEach { tt ->
|
||||||
uel.log(Action.CANCEL_TT, Sources.NSClient,
|
uel.log(Action.CANCEL_TT, Sources.NSClient,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
ValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,15 +186,15 @@ class NSClientAddUpdateWorker(
|
||||||
result.inserted.forEach {
|
result.inserted.forEach {
|
||||||
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
uel.log(Action.CAREPORTAL, Sources.NSClient,
|
||||||
it.note ?: "",
|
it.note ?: "",
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.TherapyEventType(it.type)
|
ValueWithUnit.TherapyEventType(it.type)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
||||||
it.note ?: "",
|
it.note ?: "",
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.TherapyEventType(it.type)
|
ValueWithUnit.TherapyEventType(it.type)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import androidx.work.workDataOf
|
||||||
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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.transactions.SyncNsBolusTransaction
|
import info.nightscout.androidaps.database.transactions.SyncNsBolusTransaction
|
||||||
|
@ -74,10 +74,10 @@ class NSClientRemoveWorker(
|
||||||
result.invalidated.forEach { tt ->
|
result.invalidated.forEach { tt ->
|
||||||
uel.log(
|
uel.log(
|
||||||
Action.TT_REMOVED, Sources.NSClient,
|
Action.TT_REMOVED, Sources.NSClient,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(tt.reason),
|
ValueWithUnit.TherapyEventTTReason(tt.reason),
|
||||||
XXXValueWithUnit.Mgdl(tt.lowTarget),
|
ValueWithUnit.Mgdl(tt.lowTarget),
|
||||||
XXXValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()).takeIf { tt.duration != 0L }
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()).takeIf { tt.duration != 0L }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,8 @@ class NSClientRemoveWorker(
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
||||||
(it.note ?: ""),
|
(it.note ?: ""),
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.TherapyEventType(it.type))
|
ValueWithUnit.TherapyEventType(it.type))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ class NSClientRemoveWorker(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Insulin(it.amount))
|
ValueWithUnit.Insulin(it.amount))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ class NSClientRemoveWorker(
|
||||||
.also { result ->
|
.also { result ->
|
||||||
result.invalidated.forEach {
|
result.invalidated.forEach {
|
||||||
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient,
|
||||||
XXXValueWithUnit.Timestamp(it.timestamp),
|
ValueWithUnit.Timestamp(it.timestamp),
|
||||||
XXXValueWithUnit.Gram(it.amount.toInt()))
|
ValueWithUnit.Gram(it.amount.toInt()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -585,7 +585,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
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.PROFILE_SWITCH, Sources.SMS,
|
uel.log(Action.PROFILE_SWITCH, Sources.SMS,
|
||||||
XXXValueWithUnit.StringResource(R.string.profileswitchcreated))
|
ValueWithUnit.StringResource(R.string.profileswitchcreated))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -608,13 +608,13 @@ 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))
|
||||||
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalcanceled))
|
ValueWithUnit.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.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalcancelfailed))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalcancelfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -645,17 +645,17 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
if (result.isPercent)
|
if (result.isPercent)
|
||||||
uel.log(Action.TEMP_BASAL, Sources.SMS,
|
uel.log(Action.TEMP_BASAL, Sources.SMS,
|
||||||
activePlugin.activePump.shortStatus(true),
|
activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(XXXValueWithUnit.Percent(result.percent), XXXValueWithUnit.Minute(result.duration))) )
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(ValueWithUnit.Percent(result.percent), ValueWithUnit.Minute(result.duration))) )
|
||||||
else
|
else
|
||||||
uel.log(Action.TEMP_BASAL, Sources.SMS,
|
uel.log(Action.TEMP_BASAL, Sources.SMS,
|
||||||
activePlugin.activePump.shortStatus(true),
|
activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf( XXXValueWithUnit.UnitPerHour(result.absolute), XXXValueWithUnit.Minute(result.duration))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf( ValueWithUnit.UnitPerHour(result.absolute), ValueWithUnit.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.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -687,16 +687,16 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (result.isPercent)
|
if (result.isPercent)
|
||||||
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(XXXValueWithUnit.Percent(result.percent), XXXValueWithUnit.Minute(result.duration))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset_percent, listOf(ValueWithUnit.Percent(result.percent), ValueWithUnit.Minute(result.duration))))
|
||||||
else
|
else
|
||||||
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf(XXXValueWithUnit.UnitPerHour(result.absolute), XXXValueWithUnit.Minute(result.duration))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalset, listOf(ValueWithUnit.UnitPerHour(result.absolute), ValueWithUnit.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.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tempbasalfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -724,7 +724,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
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.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedcanceled))
|
ValueWithUnit.StringResource(R.string.smscommunicator_extendedcanceled))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -752,17 +752,17 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (config.APS)
|
if (config.APS)
|
||||||
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf(XXXValueWithUnit.Insulin(aDouble ?: 0.0), XXXValueWithUnit.Minute(duration))),
|
ValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf(ValueWithUnit.Insulin(aDouble ?: 0.0), ValueWithUnit.Minute(duration))),
|
||||||
XXXValueWithUnit.StringResource(R.string.loopsuspended))
|
ValueWithUnit.StringResource(R.string.loopsuspended))
|
||||||
else
|
else
|
||||||
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf( XXXValueWithUnit.Insulin(aDouble ?: 0.0), XXXValueWithUnit.Minute(duration))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_extendedset, listOf( ValueWithUnit.Insulin(aDouble ?: 0.0), ValueWithUnit.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.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_extendedfailed))
|
ValueWithUnit.StringResource(R.string.smscommunicator_extendedfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -840,7 +840,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
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.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_bolusfailed))
|
ValueWithUnit.StringResource(R.string.smscommunicator_bolusfailed))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -879,13 +879,13 @@ 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))
|
||||||
uel.log(Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_carbsset, listOf(XXXValueWithUnit.Gram(anInteger ?: 0))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_carbsset, listOf(ValueWithUnit.Gram(anInteger ?: 0))))
|
||||||
} 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.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
uel.log(Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true),
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_carbsfailed, listOf(XXXValueWithUnit.Gram(anInteger ?: 0))))
|
ValueWithUnit.StringResource(R.string.smscommunicator_carbsfailed, listOf(ValueWithUnit.Gram(anInteger ?: 0))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -957,8 +957,8 @@ 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.TT, Sources.SMS,
|
uel.log(Action.TT, Sources.SMS,
|
||||||
XXXValueWithUnit.fromGlucoseUnit(tt, units),
|
ValueWithUnit.fromGlucoseUnit(tt, units),
|
||||||
XXXValueWithUnit.Minute(ttDuration))
|
ValueWithUnit.Minute(ttDuration))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (isStop) {
|
} else if (isStop) {
|
||||||
|
@ -976,7 +976,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.CANCEL_TT, Sources.SMS,
|
uel.log(Action.CANCEL_TT, Sources.SMS,
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_tt_canceled))
|
ValueWithUnit.StringResource(R.string.smscommunicator_tt_canceled))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else
|
} else
|
||||||
|
@ -996,7 +996,7 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
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.STOP_SMS, Sources.SMS,
|
uel.log(Action.STOP_SMS, Sources.SMS,
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_stoppedsms))
|
ValueWithUnit.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)))
|
||||||
|
@ -1016,10 +1016,10 @@ class SmsCommunicatorPlugin @Inject constructor(
|
||||||
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText))
|
||||||
if (result)
|
if (result)
|
||||||
uel.log(Action.CALIBRATION, Sources.SMS,
|
uel.log(Action.CALIBRATION, Sources.SMS,
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_calibrationsent))
|
ValueWithUnit.StringResource(R.string.smscommunicator_calibrationsent))
|
||||||
else
|
else
|
||||||
uel.log(Action.CALIBRATION, Sources.SMS,
|
uel.log(Action.CALIBRATION, Sources.SMS,
|
||||||
XXXValueWithUnit.StringResource(R.string.smscommunicator_calibrationfailed))
|
ValueWithUnit.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)))
|
||||||
|
|
|
@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.ValueWrapper
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.interfaces.end
|
import info.nightscout.androidaps.database.interfaces.end
|
||||||
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction
|
import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction
|
||||||
|
@ -570,8 +570,8 @@ class ActionStringHandler @Inject constructor(
|
||||||
}
|
}
|
||||||
//send profile to pump
|
//send profile to pump
|
||||||
uel.log(Action.PROFILE_SWITCH, Sources.Wear,
|
uel.log(Action.PROFILE_SWITCH, Sources.Wear,
|
||||||
XXXValueWithUnit.Percent(percentage),
|
ValueWithUnit.Percent(percentage),
|
||||||
XXXValueWithUnit.Hour(timeshift).takeIf { timeshift != 0 })
|
ValueWithUnit.Hour(timeshift).takeIf { timeshift != 0 })
|
||||||
activePlugin.activeTreatments.doProfileSwitch(0, percentage, timeshift)
|
activePlugin.activeTreatments.doProfileSwitch(0, percentage, timeshift)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,10 +590,10 @@ class ActionStringHandler @Inject constructor(
|
||||||
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
||||||
})
|
})
|
||||||
uel.log(Action.TT, Sources.Wear,
|
uel.log(Action.TT, Sources.Wear,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.WEAR),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.WEAR),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(low, profileFunction.getUnits()),
|
ValueWithUnit.fromGlucoseUnit(low, profileFunction.getUnits()),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(high, profileFunction.getUnits()).takeIf { low != high },
|
ValueWithUnit.fromGlucoseUnit(high, profileFunction.getUnits()).takeIf { low != high },
|
||||||
XXXValueWithUnit.Minute(duration))
|
ValueWithUnit.Minute(duration))
|
||||||
} else {
|
} else {
|
||||||
disposable += repository.runTransactionForResult(CancelCurrentTemporaryTargetIfAnyTransaction(System.currentTimeMillis()))
|
disposable += repository.runTransactionForResult(CancelCurrentTemporaryTargetIfAnyTransaction(System.currentTimeMillis()))
|
||||||
.subscribe({ result ->
|
.subscribe({ result ->
|
||||||
|
@ -602,7 +602,7 @@ class ActionStringHandler @Inject constructor(
|
||||||
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
||||||
})
|
})
|
||||||
uel.log(Action.CANCEL_TT, Sources.Wear,
|
uel.log(Action.CANCEL_TT, Sources.Wear,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.WEAR))
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.WEAR))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ class ActionStringHandler @Inject constructor(
|
||||||
detailedBolusInfo.insulin = amount
|
detailedBolusInfo.insulin = amount
|
||||||
detailedBolusInfo.bolusType = DetailedBolusInfo.BolusType.PRIMING
|
detailedBolusInfo.bolusType = DetailedBolusInfo.BolusType.PRIMING
|
||||||
uel.log(Action.PRIME_BOLUS, Sources.Wear,
|
uel.log(Action.PRIME_BOLUS, Sources.Wear,
|
||||||
XXXValueWithUnit.Insulin(amount).takeIf { amount != 0.0 })
|
ValueWithUnit.Insulin(amount).takeIf { amount != 0.0 })
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
@ -625,9 +625,9 @@ class ActionStringHandler @Inject constructor(
|
||||||
|
|
||||||
private fun doECarbs(carbs: Int, time: Long, duration: Int) {
|
private fun doECarbs(carbs: Int, time: Long, duration: Int) {
|
||||||
uel.log(if (duration==0) Action.CARBS else Action.EXTENDED_CARBS, Sources.Wear,
|
uel.log(if (duration==0) Action.CARBS else Action.EXTENDED_CARBS, Sources.Wear,
|
||||||
XXXValueWithUnit.Timestamp(time),
|
ValueWithUnit.Timestamp(time),
|
||||||
XXXValueWithUnit.Gram(carbs),
|
ValueWithUnit.Gram(carbs),
|
||||||
XXXValueWithUnit.Hour(duration).takeIf { duration !=0 })
|
ValueWithUnit.Hour(duration).takeIf { duration !=0 })
|
||||||
doBolus(0.0, carbs, time, duration)
|
doBolus(0.0, carbs, time, duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,9 +646,9 @@ class ActionStringHandler @Inject constructor(
|
||||||
else -> Action.TREATMENT
|
else -> Action.TREATMENT
|
||||||
}
|
}
|
||||||
uel.log(action, Sources.Wear,
|
uel.log(action, Sources.Wear,
|
||||||
XXXValueWithUnit.Insulin(amount).takeIf { amount != 0.0 },
|
ValueWithUnit.Insulin(amount).takeIf { amount != 0.0 },
|
||||||
XXXValueWithUnit.Gram(carbs).takeIf { carbs != 0 },
|
ValueWithUnit.Gram(carbs).takeIf { carbs != 0 },
|
||||||
XXXValueWithUnit.Hour(carbsDuration).takeIf { carbsDuration != 0 })
|
ValueWithUnit.Hour(carbsDuration).takeIf { carbsDuration != 0 })
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import info.nightscout.androidaps.R
|
||||||
import info.nightscout.androidaps.data.Profile
|
import info.nightscout.androidaps.data.Profile
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.databinding.LocalprofileFragmentBinding
|
import info.nightscout.androidaps.databinding.LocalprofileFragmentBinding
|
||||||
import info.nightscout.androidaps.dialogs.ProfileSwitchDialog
|
import info.nightscout.androidaps.dialogs.ProfileSwitchDialog
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
|
@ -175,7 +175,7 @@ class LocalProfileFragment : DaggerFragment() {
|
||||||
if (localProfilePlugin.isEdited) {
|
if (localProfilePlugin.isEdited) {
|
||||||
activity?.let { OKDialog.show(it, "", resourceHelper.gs(R.string.saveorresetchangesfirst)) }
|
activity?.let { OKDialog.show(it, "", resourceHelper.gs(R.string.saveorresetchangesfirst)) }
|
||||||
} else {
|
} else {
|
||||||
uel.log(Action.CLONE_PROFILE, Sources.LocalProfile, XXXValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
uel.log(Action.CLONE_PROFILE, Sources.LocalProfile, ValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
||||||
localProfilePlugin.cloneProfile()
|
localProfilePlugin.cloneProfile()
|
||||||
build()
|
build()
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ class LocalProfileFragment : DaggerFragment() {
|
||||||
binding.profileRemove.setOnClickListener {
|
binding.profileRemove.setOnClickListener {
|
||||||
activity?.let { activity ->
|
activity?.let { activity ->
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.deletecurrentprofile), {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.deletecurrentprofile), {
|
||||||
uel.log(Action.PROFILE_REMOVED, Sources.LocalProfile, XXXValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
uel.log(Action.PROFILE_REMOVED, Sources.LocalProfile, ValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
||||||
localProfilePlugin.removeCurrentProfile()
|
localProfilePlugin.removeCurrentProfile()
|
||||||
build()
|
build()
|
||||||
}, null)
|
}, null)
|
||||||
|
@ -212,7 +212,7 @@ class LocalProfileFragment : DaggerFragment() {
|
||||||
if (!localProfilePlugin.isValidEditState()) {
|
if (!localProfilePlugin.isValidEditState()) {
|
||||||
return@setOnClickListener //Should not happen as saveButton should not be visible if not valid
|
return@setOnClickListener //Should not happen as saveButton should not be visible if not valid
|
||||||
}
|
}
|
||||||
uel.log(Action.STORE_PROFILE, Sources.LocalProfile, XXXValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
uel.log(Action.STORE_PROFILE, Sources.LocalProfile, ValueWithUnit.SimpleString(localProfilePlugin.currentProfile()?.name ?: ""))
|
||||||
localProfilePlugin.storeSettings(activity)
|
localProfilePlugin.storeSettings(activity)
|
||||||
build()
|
build()
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.NsprofileFragmentBinding
|
import info.nightscout.androidaps.databinding.NsprofileFragmentBinding
|
||||||
|
@ -65,8 +65,8 @@ class NSProfileFragment : DaggerFragment() {
|
||||||
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, Sources.NSProfile,
|
uel.log(Action.PROFILE_SWITCH, Sources.NSProfile,
|
||||||
XXXValueWithUnit.SimpleString(name),
|
ValueWithUnit.SimpleString(name),
|
||||||
XXXValueWithUnit.Percent(100))
|
ValueWithUnit.Percent(100))
|
||||||
treatmentsPlugin.doProfileSwitch(store, name, 0, 100, 0, DateUtil.now())
|
treatmentsPlugin.doProfileSwitch(store, name, 0, 100, 0, DateUtil.now())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.GlucoseValue
|
import info.nightscout.androidaps.database.entities.GlucoseValue
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -133,7 +133,7 @@ class BGSourceFragment : DaggerFragment() {
|
||||||
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, XXXValueWithUnit.Timestamp(glucoseValue.timestamp))
|
//uel.log(Action.BG_REMOVED, XXXValueWithUnit.Timestamp(glucoseValue.timestamp))
|
||||||
uel.log(Action.BG_REMOVED, Sources.BG,
|
uel.log(Action.BG_REMOVED, Sources.BG,
|
||||||
XXXValueWithUnit.Timestamp(glucoseValue.timestamp))
|
ValueWithUnit.Timestamp(glucoseValue.timestamp))
|
||||||
disposable += repository.runTransaction(InvalidateGlucoseValueTransaction(glucoseValue.id)).subscribe()
|
disposable += repository.runTransaction(InvalidateGlucoseValueTransaction(glucoseValue.id)).subscribe()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.entities.BolusCalculatorResult
|
||||||
import info.nightscout.androidaps.database.entities.Carbs
|
import info.nightscout.androidaps.database.entities.Carbs
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateBolusCalculatorResultTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateBolusCalculatorResultTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateBolusTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateBolusTransaction
|
||||||
import info.nightscout.androidaps.database.transactions.InvalidateCarbsTransaction
|
import info.nightscout.androidaps.database.transactions.InvalidateCarbsTransaction
|
||||||
|
@ -336,8 +336,8 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||||
uel.log(
|
uel.log(
|
||||||
Action.TREATMENT_REMOVED, Sources.Treatments,
|
Action.TREATMENT_REMOVED, Sources.Treatments,
|
||||||
XXXValueWithUnit.Timestamp(bolus.timestamp),
|
ValueWithUnit.Timestamp(bolus.timestamp),
|
||||||
XXXValueWithUnit.Insulin(bolus.amount)
|
ValueWithUnit.Insulin(bolus.amount)
|
||||||
//XXXValueWithUnit.Gram(mealLinkLoaded.carbs.toInt())
|
//XXXValueWithUnit.Gram(mealLinkLoaded.carbs.toInt())
|
||||||
)
|
)
|
||||||
disposable += repository.runTransactionForResult(InvalidateBolusTransaction(bolus.id))
|
disposable += repository.runTransactionForResult(InvalidateBolusTransaction(bolus.id))
|
||||||
|
@ -358,8 +358,8 @@ class TreatmentsBolusCarbsFragment : DaggerFragment() {
|
||||||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||||
uel.log(
|
uel.log(
|
||||||
Action.TREATMENT_REMOVED, Sources.Treatments,
|
Action.TREATMENT_REMOVED, Sources.Treatments,
|
||||||
XXXValueWithUnit.Timestamp(carb.timestamp),
|
ValueWithUnit.Timestamp(carb.timestamp),
|
||||||
XXXValueWithUnit.Gram(carb.amount.toInt()))
|
ValueWithUnit.Gram(carb.amount.toInt()))
|
||||||
disposable += repository.runTransactionForResult(InvalidateCarbsTransaction(carb.id))
|
disposable += repository.runTransactionForResult(InvalidateCarbsTransaction(carb.id))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
{ result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it") } },
|
{ result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it") } },
|
||||||
|
|
|
@ -10,7 +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.ValueWithUnit
|
||||||
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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -189,8 +189,8 @@ class TreatmentsCareportalFragment : DaggerFragment() {
|
||||||
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, Sources.Treatments, therapyEvent.note ,
|
uel.log(Action.CAREPORTAL_REMOVED, Sources.Treatments, therapyEvent.note ,
|
||||||
XXXValueWithUnit.Timestamp(therapyEvent.timestamp),
|
ValueWithUnit.Timestamp(therapyEvent.timestamp),
|
||||||
XXXValueWithUnit.TherapyEventType(therapyEvent.type))
|
ValueWithUnit.TherapyEventType(therapyEvent.type))
|
||||||
disposable += repository.runTransactionForResult(InvalidateTherapyEventTransaction(therapyEvent.id))
|
disposable += repository.runTransactionForResult(InvalidateTherapyEventTransaction(therapyEvent.id))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
{ result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated therapy event $it") } },
|
{ result -> result.invalidated.forEach { aapsLogger.debug(LTag.DATABASE, "Invalidated therapy event $it") } },
|
||||||
|
|
|
@ -9,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchFragmentBinding
|
import info.nightscout.androidaps.databinding.TreatmentsProfileswitchFragmentBinding
|
||||||
|
@ -151,7 +151,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
|
||||||
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, Sources.Treatments, profileSwitch.profileName,
|
uel.log(Action.PROFILE_SWITCH_REMOVED, Sources.Treatments, profileSwitch.profileName,
|
||||||
XXXValueWithUnit.Timestamp(profileSwitch.date))
|
ValueWithUnit.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)
|
||||||
|
@ -166,8 +166,8 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
|
||||||
profileSwitch.profileObject?.let {
|
profileSwitch.profileObject?.let {
|
||||||
uel.log(Action.PROFILE_SWITCH_CLONED, Sources.Treatments,
|
uel.log(Action.PROFILE_SWITCH_CLONED, Sources.Treatments,
|
||||||
profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_"),
|
profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_"),
|
||||||
XXXValueWithUnit.Timestamp(profileSwitch.date),
|
ValueWithUnit.Timestamp(profileSwitch.date),
|
||||||
XXXValueWithUnit.SimpleString(profileSwitch.profileName))
|
ValueWithUnit.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,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -197,11 +197,11 @@ class TreatmentsTempTargetFragment : DaggerFragment() {
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
{ _: DialogInterface?, _: Int ->
|
{ _: DialogInterface?, _: Int ->
|
||||||
uel.log(Action.TT_REMOVED, Sources.Treatments,
|
uel.log(Action.TT_REMOVED, Sources.Treatments,
|
||||||
XXXValueWithUnit.Timestamp(tempTarget.timestamp),
|
ValueWithUnit.Timestamp(tempTarget.timestamp),
|
||||||
XXXValueWithUnit.TherapyEventTTReason(tempTarget.reason),
|
ValueWithUnit.TherapyEventTTReason(tempTarget.reason),
|
||||||
XXXValueWithUnit.Mgdl(tempTarget.lowTarget),
|
ValueWithUnit.Mgdl(tempTarget.lowTarget),
|
||||||
XXXValueWithUnit.Mgdl(tempTarget.highTarget).takeIf { tempTarget.lowTarget != tempTarget.highTarget },
|
ValueWithUnit.Mgdl(tempTarget.highTarget).takeIf { tempTarget.lowTarget != tempTarget.highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tempTarget.duration).toInt()))
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tempTarget.duration).toInt()))
|
||||||
disposable += repository.runTransactionForResult(InvalidateTemporaryTargetTransaction(tempTarget.id))
|
disposable += repository.runTransactionForResult(InvalidateTemporaryTargetTransaction(tempTarget.id))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
{ aapsLogger.debug(LTag.DATABASE, "Removed temp target $tempTarget") },
|
{ aapsLogger.debug(LTag.DATABASE, "Removed temp target $tempTarget") },
|
||||||
|
|
|
@ -12,7 +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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsFragmentBinding
|
import info.nightscout.androidaps.databinding.TreatmentsTempbasalsFragmentBinding
|
||||||
|
@ -167,7 +167,7 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
{ _: DialogInterface?, _: Int ->
|
{ _: DialogInterface?, _: Int ->
|
||||||
uel.log(Action.TT_REMOVED, Sources.Treatments,
|
uel.log(Action.TT_REMOVED, Sources.Treatments,
|
||||||
XXXValueWithUnit.Timestamp(tempBasal.date))
|
ValueWithUnit.Timestamp(tempBasal.date))
|
||||||
activePlugin.activeTreatments.removeTempBasal(tempBasal)
|
activePlugin.activeTreatments.removeTempBasal(tempBasal)
|
||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ 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.BolusCalculatorResult
|
import info.nightscout.androidaps.database.entities.BolusCalculatorResult
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
import info.nightscout.androidaps.database.entities.TemporaryTarget
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
@ -350,8 +350,8 @@ class BolusWizard @Inject constructor(
|
||||||
notes = this@BolusWizard.notes
|
notes = this@BolusWizard.notes
|
||||||
uel.log(Action.BOLUS_ADVISOR, if (quickWizard) Sources.QuickWizard else Sources.WizardDialog,
|
uel.log(Action.BOLUS_ADVISOR, if (quickWizard) Sources.QuickWizard else Sources.WizardDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.TherapyEventType(eventType.toDBbEventType()),
|
ValueWithUnit.TherapyEventType(eventType.toDBbEventType()),
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints))
|
ValueWithUnit.Insulin(insulinAfterConstraints))
|
||||||
if (insulin > 0) {
|
if (insulin > 0) {
|
||||||
commandQueue.bolus(this, object : Callback() {
|
commandQueue.bolus(this, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
@ -421,10 +421,10 @@ class BolusWizard @Inject constructor(
|
||||||
}
|
}
|
||||||
uel.log(action, if (quickWizard) Sources.QuickWizard else Sources.WizardDialog,
|
uel.log(action, if (quickWizard) Sources.QuickWizard else Sources.WizardDialog,
|
||||||
notes,
|
notes,
|
||||||
XXXValueWithUnit.TherapyEventType(eventType.toDBbEventType()),
|
ValueWithUnit.TherapyEventType(eventType.toDBbEventType()),
|
||||||
XXXValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 },
|
ValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 },
|
||||||
XXXValueWithUnit.Gram(this@BolusWizard.carbs).takeIf { this@BolusWizard.carbs != 0 },
|
ValueWithUnit.Gram(this@BolusWizard.carbs).takeIf { this@BolusWizard.carbs != 0 },
|
||||||
XXXValueWithUnit.Minute(carbTime).takeIf { carbTime != 0 })
|
ValueWithUnit.Minute(carbTime).takeIf { carbTime != 0 })
|
||||||
commandQueue.bolus(this, object : Callback() {
|
commandQueue.bolus(this, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import info.nightscout.androidaps.automation.R
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult
|
import info.nightscout.androidaps.data.PumpEnactResult
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.events.EventRefreshOverview
|
import info.nightscout.androidaps.events.EventRefreshOverview
|
||||||
import info.nightscout.androidaps.interfaces.LoopInterface
|
import info.nightscout.androidaps.interfaces.LoopInterface
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
|
@ -38,7 +38,7 @@ class ActionLoopSuspend(injector: HasAndroidInjector) : Action(injector) {
|
||||||
loopPlugin.suspendLoop(minutes.getMinutes())
|
loopPlugin.suspendLoop(minutes.getMinutes())
|
||||||
rxBus.send(EventRefreshOverview("ActionLoopSuspend"))
|
rxBus.send(EventRefreshOverview("ActionLoopSuspend"))
|
||||||
uel.log(UserEntry.Action.SUSPEND, Sources.Automation, title,
|
uel.log(UserEntry.Action.SUSPEND, Sources.Automation, title,
|
||||||
XXXValueWithUnit.StringResource(R.string.suspendloopforXmin, listOf(XXXValueWithUnit.Minute(minutes.getMinutes()))))
|
ValueWithUnit.StringResource(R.string.suspendloopforXmin, listOf(ValueWithUnit.Minute(minutes.getMinutes()))))
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
||||||
} else {
|
} else {
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.alreadysuspended))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.alreadysuspended))?.run()
|
||||||
|
|
|
@ -7,7 +7,7 @@ import info.nightscout.androidaps.automation.R
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult
|
import info.nightscout.androidaps.data.PumpEnactResult
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -59,8 +59,8 @@ class ActionProfileSwitch(injector: HasAndroidInjector) : Action(injector) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uel.log(UserEntry.Action.PROFILE_SWITCH, Sources.Automation, title,
|
uel.log(UserEntry.Action.PROFILE_SWITCH, Sources.Automation, title,
|
||||||
XXXValueWithUnit.SimpleString(inputProfileName.value),
|
ValueWithUnit.SimpleString(inputProfileName.value),
|
||||||
XXXValueWithUnit.Percent(100))
|
ValueWithUnit.Percent(100))
|
||||||
activePlugin.activeTreatments.doProfileSwitch(profileStore, inputProfileName.value, 0, 100, 0, DateUtil.now())
|
activePlugin.activeTreatments.doProfileSwitch(profileStore, inputProfileName.value, 0, 100, 0, DateUtil.now())
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import info.nightscout.androidaps.automation.R
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult
|
import info.nightscout.androidaps.data.PumpEnactResult
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||||
import info.nightscout.androidaps.plugins.general.automation.elements.Comparator
|
import info.nightscout.androidaps.plugins.general.automation.elements.Comparator
|
||||||
|
@ -43,7 +43,7 @@ class ActionProfileSwitchPercent(injector: HasAndroidInjector) : Action(injector
|
||||||
|
|
||||||
override fun doAction(callback: Callback) {
|
override fun doAction(callback: Callback) {
|
||||||
uel.log(UserEntry.Action.PROFILE_SWITCH, Sources.Automation, title,
|
uel.log(UserEntry.Action.PROFILE_SWITCH, Sources.Automation, title,
|
||||||
XXXValueWithUnit.StringResource( R.string.startprofile, listOf(XXXValueWithUnit.Percent(pct.value.toInt()), XXXValueWithUnit.Minute(duration.value))))
|
ValueWithUnit.StringResource( R.string.startprofile, listOf(ValueWithUnit.Percent(pct.value.toInt()), ValueWithUnit.Minute(duration.value))))
|
||||||
activePlugin.activeTreatments.doProfileSwitch(duration.value, pct.value.toInt(), 0)
|
activePlugin.activeTreatments.doProfileSwitch(duration.value, pct.value.toInt(), 0)
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import info.nightscout.androidaps.database.AppRepository
|
||||||
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.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction
|
import info.nightscout.androidaps.database.transactions.InsertTemporaryTargetAndCancelCurrentTransaction
|
||||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
|
@ -62,10 +62,10 @@ class ActionStartTempTarget(injector: HasAndroidInjector) : Action(injector) {
|
||||||
result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted temp target $it") }
|
result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted temp target $it") }
|
||||||
result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated temp target $it") }
|
result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated temp target $it") }
|
||||||
uel.log(UserEntry.Action.TT, Sources.Automation, title,
|
uel.log(UserEntry.Action.TT, Sources.Automation, title,
|
||||||
XXXValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.AUTOMATION),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.AUTOMATION),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(tt().lowTarget, Constants.MGDL),
|
ValueWithUnit.fromGlucoseUnit(tt().lowTarget, Constants.MGDL),
|
||||||
XXXValueWithUnit.fromGlucoseUnit(tt().highTarget, Constants.MGDL).takeIf { tt().lowTarget != tt().highTarget },
|
ValueWithUnit.fromGlucoseUnit(tt().highTarget, Constants.MGDL).takeIf { tt().lowTarget != tt().highTarget },
|
||||||
XXXValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt().duration).toInt()))
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt().duration).toInt()))
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
||||||
}, {
|
}, {
|
||||||
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package info.nightscout.androidaps.logging
|
package info.nightscout.androidaps.logging
|
||||||
|
|
||||||
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.ValueWithUnit
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.transactions.UserEntryTransaction
|
import info.nightscout.androidaps.database.transactions.UserEntryTransaction
|
||||||
|
@ -21,11 +21,11 @@ class UserEntryLogger @Inject constructor(
|
||||||
|
|
||||||
private val compositeDisposable = CompositeDisposable()
|
private val compositeDisposable = CompositeDisposable()
|
||||||
|
|
||||||
fun log(action: Action, source: Sources, note: String? ="", vararg listvalues: XXXValueWithUnit?) = log(action, source, note, listvalues.toList())
|
fun log(action: Action, source: Sources, note: String? ="", vararg listvalues: ValueWithUnit?) = log(action, source, note, listvalues.toList())
|
||||||
|
|
||||||
fun log(action: Action, source: Sources, vararg listvalues: XXXValueWithUnit?) = log(action, source,"", listvalues.toList())
|
fun log(action: Action, source: Sources, vararg listvalues: ValueWithUnit?) = log(action, source,"", listvalues.toList())
|
||||||
|
|
||||||
fun log(action: Action, source: Sources, note: String? ="", listvalues: List<XXXValueWithUnit?> = listOf()) {
|
fun log(action: Action, source: Sources, note: String? ="", listvalues: List<ValueWithUnit?> = listOf()) {
|
||||||
val filteredValues = listvalues.toList().filter { it != null}
|
val filteredValues = listvalues.toList().filter { it != null}
|
||||||
compositeDisposable += repository.runTransaction(UserEntryTransaction(
|
compositeDisposable += repository.runTransaction(UserEntryTransaction(
|
||||||
action = action,
|
action = action,
|
||||||
|
|
|
@ -78,7 +78,7 @@ class ClassicPrefsFormat @Inject constructor(
|
||||||
|
|
||||||
fun saveCsv(file: File, userEntries: List<UserEntry>) {
|
fun saveCsv(file: File, userEntries: List<UserEntry>) {
|
||||||
try {
|
try {
|
||||||
val contents = userEntryPresentationHelper.UserEntriesToCsv(userEntries)
|
val contents = userEntryPresentationHelper.userEntriesToCsv(userEntries)
|
||||||
storage.putFileContents(file, contents)
|
storage.putFileContents(file, contents)
|
||||||
} catch (e: FileNotFoundException) {
|
} catch (e: FileNotFoundException) {
|
||||||
throw PrefFileNotFoundError(file.absolutePath)
|
throw PrefFileNotFoundError(file.absolutePath)
|
||||||
|
|
|
@ -5,7 +5,7 @@ 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.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
@ -92,15 +92,15 @@ class Translator @Inject internal constructor(
|
||||||
Action.UNKNOWN -> resourceHelper.gs(R.string.unknown)
|
Action.UNKNOWN -> resourceHelper.gs(R.string.unknown)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun translate(units: XXXValueWithUnit?): String = when(units) {
|
fun translate(units: ValueWithUnit?): String = when(units) {
|
||||||
is XXXValueWithUnit.Gram -> resourceHelper.gs(R.string.shortgram)
|
is ValueWithUnit.Gram -> resourceHelper.gs(R.string.shortgram)
|
||||||
is XXXValueWithUnit.Hour -> resourceHelper.gs(R.string.shorthour)
|
is ValueWithUnit.Hour -> resourceHelper.gs(R.string.shorthour)
|
||||||
is XXXValueWithUnit.Insulin -> resourceHelper.gs(R.string.insulin_unit_shortname)
|
is ValueWithUnit.Insulin -> resourceHelper.gs(R.string.insulin_unit_shortname)
|
||||||
is XXXValueWithUnit.Mgdl -> resourceHelper.gs(R.string.mgdl)
|
is ValueWithUnit.Mgdl -> resourceHelper.gs(R.string.mgdl)
|
||||||
is XXXValueWithUnit.Minute -> resourceHelper.gs(R.string.shortminute)
|
is ValueWithUnit.Minute -> resourceHelper.gs(R.string.shortminute)
|
||||||
is XXXValueWithUnit.Mmoll -> resourceHelper.gs(R.string.mmol)
|
is ValueWithUnit.Mmoll -> resourceHelper.gs(R.string.mmol)
|
||||||
is XXXValueWithUnit.Percent -> resourceHelper.gs(R.string.shortpercent)
|
is ValueWithUnit.Percent -> resourceHelper.gs(R.string.shortpercent)
|
||||||
is XXXValueWithUnit.UnitPerHour -> resourceHelper.gs(R.string.profile_ins_units_per_hour)
|
is ValueWithUnit.UnitPerHour -> resourceHelper.gs(R.string.profile_ins_units_per_hour)
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ import info.nightscout.androidaps.Constants
|
||||||
import info.nightscout.androidaps.core.R
|
import info.nightscout.androidaps.core.R
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.ColorGroup
|
import info.nightscout.androidaps.database.entities.UserEntry.ColorGroup
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -80,40 +80,40 @@ class UserEntryPresentationHelper @Inject constructor(
|
||||||
|
|
||||||
private fun coloredAction(action: Action): String = "<font color='${resourceHelper.gc(colorId(action.colorGroup))}'>${translator.translate(action)}</font>"
|
private fun coloredAction(action: Action): String = "<font color='${resourceHelper.gc(colorId(action.colorGroup))}'>${translator.translate(action)}</font>"
|
||||||
|
|
||||||
fun listToPresentationString(list: List<XXXValueWithUnit?>) =
|
fun listToPresentationString(list: List<ValueWithUnit?>) =
|
||||||
list.joinToString(separator = " ", transform = this::toPresentationString)
|
list.joinToString(separator = " ", transform = this::toPresentationString)
|
||||||
|
|
||||||
private fun toPresentationString(valueWithUnit: XXXValueWithUnit?): String = when (valueWithUnit) {
|
private fun toPresentationString(valueWithUnit: ValueWithUnit?): String = when (valueWithUnit) {
|
||||||
is XXXValueWithUnit.Gram -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
is ValueWithUnit.Gram -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
||||||
is XXXValueWithUnit.Hour -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
is ValueWithUnit.Hour -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
||||||
is XXXValueWithUnit.Minute -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
is ValueWithUnit.Minute -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
||||||
is XXXValueWithUnit.Percent -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
is ValueWithUnit.Percent -> "${valueWithUnit.value}${translator.translate(valueWithUnit)}"
|
||||||
is XXXValueWithUnit.Insulin -> DecimalFormatter.to2Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
is ValueWithUnit.Insulin -> DecimalFormatter.to2Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||||
is XXXValueWithUnit.UnitPerHour -> DecimalFormatter.to2Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
is ValueWithUnit.UnitPerHour -> DecimalFormatter.to2Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||||
is XXXValueWithUnit.SimpleInt -> valueWithUnit.value.toString()
|
is ValueWithUnit.SimpleInt -> valueWithUnit.value.toString()
|
||||||
is XXXValueWithUnit.SimpleString -> valueWithUnit.value
|
is ValueWithUnit.SimpleString -> valueWithUnit.value
|
||||||
// is XXXValueWithUnit.StringResource -> resourceHelper.gs(valueWithUnit.value, valueWithUnit.params.map{ it.value() }.toTypedArray()) //Todo Fix StringResource with Param
|
is ValueWithUnit.StringResource -> resourceHelper.gs(valueWithUnit.value, *(valueWithUnit.params.map { it.value() }.toTypedArray())) //Todo Fix StringResource with Param
|
||||||
is XXXValueWithUnit.StringResource -> if (valueWithUnit.params.size > 0 ) valueWithUnit.params.joinToString(separator = " ") { value -> toPresentationString(value) } else resourceHelper.gs(valueWithUnit.value) //To help debugging
|
// is XXXValueWithUnit.StringResource -> if (valueWithUnit.params.size > 0 ) valueWithUnit.params.joinToString(separator = " ") { value -> toPresentationString(value) } else resourceHelper.gs(valueWithUnit.value) //To help debugging
|
||||||
is XXXValueWithUnit.TherapyEventMeterType -> translator.translate(valueWithUnit.value)
|
is ValueWithUnit.TherapyEventMeterType -> translator.translate(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.TherapyEventTTReason -> translator.translate(valueWithUnit.value)
|
is ValueWithUnit.TherapyEventTTReason -> translator.translate(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.TherapyEventType -> translator.translate(valueWithUnit.value)
|
is ValueWithUnit.TherapyEventType -> translator.translate(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.Timestamp -> dateUtil.dateAndTimeAndSecondsString(valueWithUnit.value)
|
is ValueWithUnit.Timestamp -> dateUtil.dateAndTimeAndSecondsString(valueWithUnit.value)
|
||||||
|
|
||||||
is XXXValueWithUnit.Mgdl -> {
|
is ValueWithUnit.Mgdl -> {
|
||||||
if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||||
else DecimalFormatter.to1Decimal(valueWithUnit.value / Constants.MMOLL_TO_MGDL) + translator.translate(valueWithUnit)
|
else DecimalFormatter.to1Decimal(valueWithUnit.value / Constants.MMOLL_TO_MGDL) + translator.translate(valueWithUnit)
|
||||||
}
|
}
|
||||||
|
|
||||||
is XXXValueWithUnit.Mmoll -> {
|
is ValueWithUnit.Mmoll -> {
|
||||||
if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value) + translator.translate(valueWithUnit)
|
||||||
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL) + translator.translate(valueWithUnit)
|
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL) + translator.translate(valueWithUnit)
|
||||||
}
|
}
|
||||||
|
|
||||||
XXXValueWithUnit.UNKNOWN -> ""
|
ValueWithUnit.UNKNOWN -> ""
|
||||||
null -> ""
|
null -> ""
|
||||||
}
|
}
|
||||||
|
|
||||||
fun UserEntriesToCsv(userEntries: List<UserEntry>): String {
|
fun userEntriesToCsv(userEntries: List<UserEntry>): String {
|
||||||
return getCsvHeader() + userEntries.joinToString("\n") { entry -> getCsvEntry(entry) }
|
return getCsvHeader() + userEntries.joinToString("\n") { entry -> getCsvEntry(entry) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class UserEntryPresentationHelper @Inject constructor(
|
||||||
csvString(R.string.careportal_note),
|
csvString(R.string.careportal_note),
|
||||||
csvString(R.string.ue_formated_string),
|
csvString(R.string.ue_formated_string),
|
||||||
csvString(R.string.event_time_label),
|
csvString(R.string.event_time_label),
|
||||||
csvString(if (profileFunction.getUnits() == Constants.MGDL) R.string.mgdl else R.string.mmol ),
|
csvString(if (profileFunction.getUnits() == Constants.MGDL) R.string.mgdl else R.string.mmol),
|
||||||
csvString(R.string.shortgram),
|
csvString(R.string.shortgram),
|
||||||
csvString(R.string.insulin_unit_shortname),
|
csvString(R.string.insulin_unit_shortname),
|
||||||
csvString(R.string.profile_ins_units_per_hour),
|
csvString(R.string.profile_ins_units_per_hour),
|
||||||
|
@ -138,7 +138,7 @@ class UserEntryPresentationHelper @Inject constructor(
|
||||||
) + "\n"
|
) + "\n"
|
||||||
|
|
||||||
private fun getCsvEntry(entry: UserEntry): String {
|
private fun getCsvEntry(entry: UserEntry): String {
|
||||||
val fullvalueWithUnitList = ArrayList<XXXValueWithUnit?>(entry.values)
|
val fullvalueWithUnitList = ArrayList<ValueWithUnit?>(entry.values)
|
||||||
var timestampRec = "" + entry.timestamp
|
var timestampRec = "" + entry.timestamp
|
||||||
var dateTimestampRev = dateUtil.dateAndTimeAndSecondsString(entry.timestamp)
|
var dateTimestampRev = dateUtil.dateAndTimeAndSecondsString(entry.timestamp)
|
||||||
var utcOffset = dateUtil.timeString(entry.utcOffset)
|
var utcOffset = dateUtil.timeString(entry.utcOffset)
|
||||||
|
@ -157,46 +157,53 @@ class UserEntryPresentationHelper @Inject constructor(
|
||||||
var minute = ""
|
var minute = ""
|
||||||
var other = ""
|
var other = ""
|
||||||
for (valueWithUnit in entry.values) {
|
for (valueWithUnit in entry.values) {
|
||||||
if (valueWithUnit is XXXValueWithUnit.StringResource) fullvalueWithUnitList.addAll(valueWithUnit.params)
|
if (valueWithUnit is ValueWithUnit.StringResource) fullvalueWithUnitList.addAll(valueWithUnit.params)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (valueWithUnit in fullvalueWithUnitList.filter { it != null }) {
|
for (valueWithUnit in fullvalueWithUnitList.filterNotNull()) {
|
||||||
when (valueWithUnit) {
|
when (valueWithUnit) {
|
||||||
is XXXValueWithUnit.Gram -> gram = valueWithUnit.value.toString()
|
is ValueWithUnit.Gram -> gram = valueWithUnit.value.toString()
|
||||||
is XXXValueWithUnit.Hour -> hour = valueWithUnit.value.toString()
|
is ValueWithUnit.Hour -> hour = valueWithUnit.value.toString()
|
||||||
is XXXValueWithUnit.Minute -> minute = valueWithUnit.value.toString()
|
is ValueWithUnit.Minute -> minute = valueWithUnit.value.toString()
|
||||||
is XXXValueWithUnit.Percent -> percent = valueWithUnit.value.toString()
|
is ValueWithUnit.Percent -> percent = valueWithUnit.value.toString()
|
||||||
is XXXValueWithUnit.Insulin -> insulin = DecimalFormatter.to2Decimal(valueWithUnit.value)
|
is ValueWithUnit.Insulin -> insulin = DecimalFormatter.to2Decimal(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.UnitPerHour -> unitPerHour = DecimalFormatter.to2Decimal(valueWithUnit.value)
|
is ValueWithUnit.UnitPerHour -> unitPerHour = DecimalFormatter.to2Decimal(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.SimpleInt -> other = if (other == "") valueWithUnit.value.toString() else other + " / " + valueWithUnit.value.toString()
|
is ValueWithUnit.SimpleInt -> other = other.addWithSeparator(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.SimpleString -> other = if (other == "") valueWithUnit.value else other + " / " + valueWithUnit.value
|
is ValueWithUnit.SimpleString -> other = other.addWithSeparator(valueWithUnit.value)
|
||||||
// is XXXValueWithUnit.StringResource -> stringResource = if (stringResource == "") resourceHelper.gs(valueWithUnit.value, valueWithUnit.params.map { it.value() }.toTypedArray()) else stringResource + " / " + resourceHelper.gs(valueWithUnit.value, valueWithUnit.params.map { it.value() }.toTypedArray())
|
// is XXXValueWithUnit.StringResource -> stringResource = if (stringResource == "") resourceHelper.gs(valueWithUnit.value, valueWithUnit.params.map { it.value() }.toTypedArray()) else stringResource + " / " + resourceHelper.gs(valueWithUnit.value, valueWithUnit.params.map { it.value() }.toTypedArray())
|
||||||
is XXXValueWithUnit.StringResource -> if (valueWithUnit.params.size == 0) { stringResource = if (stringResource == "") resourceHelper.gs(valueWithUnit.value) else stringResource + " / " + resourceHelper.gs(valueWithUnit.value)}
|
is ValueWithUnit.StringResource -> if (valueWithUnit.params.isEmpty()) {
|
||||||
is XXXValueWithUnit.TherapyEventMeterType -> therapyEvent = if (therapyEvent == "") translator.translate(valueWithUnit.value) else therapyEvent + " / " + translator.translate(valueWithUnit.value)
|
stringResource = if (stringResource == "") resourceHelper.gs(valueWithUnit.value) else stringResource + " / " + resourceHelper.gs(valueWithUnit.value)
|
||||||
is XXXValueWithUnit.TherapyEventTTReason -> therapyEvent = if (therapyEvent == "") translator.translate(valueWithUnit.value) else therapyEvent + " / " + translator.translate(valueWithUnit.value)
|
}
|
||||||
is XXXValueWithUnit.TherapyEventType -> therapyEvent = if (therapyEvent == "") translator.translate(valueWithUnit.value) else therapyEvent + " / " + translator.translate(valueWithUnit.value)
|
is ValueWithUnit.TherapyEventMeterType -> therapyEvent = therapyEvent.addWithSeparator(translator.translate(valueWithUnit.value))
|
||||||
is XXXValueWithUnit.Timestamp -> timestamp = dateUtil.dateAndTimeAndSecondsString(valueWithUnit.value)
|
is ValueWithUnit.TherapyEventTTReason -> therapyEvent = therapyEvent.addWithSeparator(translator.translate(valueWithUnit.value))
|
||||||
|
is ValueWithUnit.TherapyEventType -> therapyEvent = therapyEvent.addWithSeparator(translator.translate(valueWithUnit.value))
|
||||||
|
is ValueWithUnit.Timestamp -> timestamp = dateUtil.dateAndTimeAndSecondsString(valueWithUnit.value)
|
||||||
|
|
||||||
is XXXValueWithUnit.Mgdl -> {
|
is ValueWithUnit.Mgdl -> {
|
||||||
bg = if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value)
|
bg = if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value)
|
||||||
else DecimalFormatter.to1Decimal(valueWithUnit.value / Constants.MMOLL_TO_MGDL)
|
else DecimalFormatter.to1Decimal(valueWithUnit.value / Constants.MMOLL_TO_MGDL)
|
||||||
}
|
}
|
||||||
is XXXValueWithUnit.Mmoll -> {
|
|
||||||
|
is ValueWithUnit.Mmoll -> {
|
||||||
bg = if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value)
|
bg = if (profileFunction.getUnits() == Constants.MGDL) DecimalFormatter.to0Decimal(valueWithUnit.value)
|
||||||
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL)
|
else DecimalFormatter.to1Decimal(valueWithUnit.value * Constants.MMOLL_TO_MGDL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ValueWithUnit.UNKNOWN -> Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
therapyEvent = csvString(therapyEvent)
|
therapyEvent = csvString(therapyEvent)
|
||||||
stringResource = csvString(stringResource)
|
stringResource = csvString(stringResource)
|
||||||
other = csvString(other)
|
other = csvString(other)
|
||||||
return timestampRec + ";" + dateTimestampRev + ";" + utcOffset + ";" + action + ";" + therapyEvent + ";" + source + ";" + note + ";" + stringResource + ";" + timestamp + ";" + bg + ";" + gram + ";" + insulin + ";" + unitPerHour + ";" + percent + ";" + hour + ";" + minute + ";" + other
|
return "$timestampRec;$dateTimestampRev;$utcOffset;$action;$therapyEvent;$source;$note;$stringResource;$timestamp;$bg;$gram;$insulin;$unitPerHour;$percent;$hour;$minute;$other"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun saveString(id: Int): String = if (id != 0) resourceHelper.gs(id) else ""
|
private fun saveString(id: Int): String = if (id != 0) resourceHelper.gs(id) else ""
|
||||||
private fun csvString(action: Action): String = "\"" + translator.translate(action).replace("\"", "\"\"") + "\""
|
private fun csvString(action: Action): String = "\"" + translator.translate(action).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 ""
|
||||||
|
|
||||||
|
private fun String.addWithSeparator(add: Any) =
|
||||||
|
this + (if (this.isBlank()) "" else " / ") + add.toString()
|
||||||
}
|
}
|
|
@ -1,14 +1,14 @@
|
||||||
package info.nightscout.androidaps.utils.serialisation
|
package info.nightscout.androidaps.utils.serialisation
|
||||||
|
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
|
|
||||||
object ValueWithUnitSerialiser {
|
object ValueWithUnitSerialiser {
|
||||||
|
|
||||||
fun toSealedClassJson(list: List<XXXValueWithUnit>): String = list.map(::ValueWithUnitWrapper)
|
fun toSealedClassJson(list: List<ValueWithUnit>): String = list.map(::ValueWithUnitWrapper)
|
||||||
.let(SealedClassHelper.gson::toJson)
|
.let(SealedClassHelper.gson::toJson)
|
||||||
|
|
||||||
fun fromJson(string: String): List<XXXValueWithUnit> = SealedClassHelper.gson
|
fun fromJson(string: String): List<ValueWithUnit> = SealedClassHelper.gson
|
||||||
.fromJson<List<ValueWithUnitWrapper>>(string).map { it.wrapped }
|
.fromJson<List<ValueWithUnitWrapper>>(string).map { it.wrapped }
|
||||||
|
|
||||||
private class ValueWithUnitWrapper(val wrapped: XXXValueWithUnit)
|
private class ValueWithUnitWrapper(val wrapped: ValueWithUnit)
|
||||||
}
|
}
|
|
@ -481,7 +481,7 @@
|
||||||
<string name="ue_timestamp">Timestamp</string>
|
<string name="ue_timestamp">Timestamp</string>
|
||||||
<string name="ue_none">No Unit</string>
|
<string name="ue_none">No Unit</string>
|
||||||
<string name="ue_export_to_csv">Export User Entries to Excel (csv)</string>
|
<string name="ue_export_to_csv">Export User Entries to Excel (csv)</string>
|
||||||
<string name="ue_csv_header">"%1$s;%2$s;%3$s;%4$s;%5$s;%6$s;%7$s;%8$s;%9$s;%10$s;%11$s;%12$s;%13$s;%14$s;%15$s;%16$s;%17$s"</string>
|
<string name="ue_csv_header" translatable="false">"%1$s;%2$s;%3$s;%4$s;%5$s;%6$s;%7$s;%8$s;%9$s;%10$s;%11$s;%12$s;%13$s;%14$s;%15$s;%16$s;%17$s"</string>
|
||||||
|
|
||||||
<plurals name="days">
|
<plurals name="days">
|
||||||
<item quantity="one">%1$d day</item>
|
<item quantity="one">%1$d day</item>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package info.nightscout.androidaps.utils.serialisation
|
package info.nightscout.androidaps.utils.serialisation
|
||||||
|
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ internal class ValueWithUnitSerialiserTest {
|
||||||
@Test
|
@Test
|
||||||
fun testSerialisationDeserization() {
|
fun testSerialisationDeserization() {
|
||||||
|
|
||||||
val list = listOf<XXXValueWithUnit>(
|
val list = listOf<ValueWithUnit>(
|
||||||
XXXValueWithUnit.SimpleString("hello"),
|
ValueWithUnit.SimpleString("hello"),
|
||||||
XXXValueWithUnit.SimpleInt(5),
|
ValueWithUnit.SimpleInt(5),
|
||||||
XXXValueWithUnit.UNKNOWN
|
ValueWithUnit.UNKNOWN
|
||||||
)
|
)
|
||||||
|
|
||||||
val serialized = ValueWithUnitSerialiser.toSealedClassJson(list)
|
val serialized = ValueWithUnitSerialiser.toSealedClassJson(list)
|
||||||
|
@ -25,7 +25,7 @@ internal class ValueWithUnitSerialiserTest {
|
||||||
@Test
|
@Test
|
||||||
fun testEmptyList() {
|
fun testEmptyList() {
|
||||||
|
|
||||||
val list = listOf<XXXValueWithUnit>()
|
val list = listOf<ValueWithUnit>()
|
||||||
|
|
||||||
val serialized = ValueWithUnitSerialiser.toSealedClassJson(list)
|
val serialized = ValueWithUnitSerialiser.toSealedClassJson(list)
|
||||||
val deserialized = ValueWithUnitSerialiser.fromJson(serialized)
|
val deserialized = ValueWithUnitSerialiser.fromJson(serialized)
|
||||||
|
|
|
@ -27,14 +27,14 @@ class Converters {
|
||||||
fun toSource(source: String?) = source?.let { Sources.fromString(it) }
|
fun toSource(source: String?) = source?.let { Sources.fromString(it) }
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun fromListOfXXXValueWithUnit(values: List<XXXValueWithUnit>): String = values.map(::ValueWithUnitWrapper)
|
fun fromListOfXXXValueWithUnit(values: List<ValueWithUnit>): String = values.map(::ValueWithUnitWrapper)
|
||||||
.let(SealedClassHelper.gson::toJson)
|
.let(SealedClassHelper.gson::toJson)
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun toMutableListOfXXXValueWithUnit(string: String): List<XXXValueWithUnit> = SealedClassHelper.gson
|
fun toMutableListOfXXXValueWithUnit(string: String): List<ValueWithUnit> = SealedClassHelper.gson
|
||||||
.fromJson<List<ValueWithUnitWrapper>>(string).map { it.wrapped }
|
.fromJson<List<ValueWithUnitWrapper>>(string).map { it.wrapped }
|
||||||
|
|
||||||
private class ValueWithUnitWrapper(val wrapped: XXXValueWithUnit)
|
private class ValueWithUnitWrapper(val wrapped: ValueWithUnit)
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun fromBolusType(bolusType: Bolus.Type?) = bolusType?.name
|
fun fromBolusType(bolusType: Bolus.Type?) = bolusType?.name
|
||||||
|
|
|
@ -16,7 +16,7 @@ data class UserEntry(
|
||||||
var action: Action,
|
var action: Action,
|
||||||
var source: Sources,
|
var source: Sources,
|
||||||
var note: String,
|
var note: String,
|
||||||
var values: List<XXXValueWithUnit?>
|
var values: List<ValueWithUnit?>
|
||||||
) : DBEntry, DBEntryWithTime {
|
) : DBEntry, DBEntryWithTime {
|
||||||
enum class Action (val colorGroup: ColorGroup) {
|
enum class Action (val colorGroup: ColorGroup) {
|
||||||
BOLUS (ColorGroup.InsulinTreatment),
|
BOLUS (ColorGroup.InsulinTreatment),
|
||||||
|
|
|
@ -2,39 +2,39 @@ package info.nightscout.androidaps.database.entities
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
|
|
||||||
sealed class XXXValueWithUnit {
|
sealed class ValueWithUnit {
|
||||||
|
|
||||||
object UNKNOWN : XXXValueWithUnit() // formerly None used as fallback
|
object UNKNOWN : ValueWithUnit() // formerly None used as fallback
|
||||||
|
|
||||||
data class SimpleString(val value: String) : XXXValueWithUnit() // formerly one usage of None
|
data class SimpleString(val value: String) : ValueWithUnit() // formerly one usage of None
|
||||||
|
|
||||||
data class SimpleInt(val value: Int) : XXXValueWithUnit() // formerly one usage of None
|
data class SimpleInt(val value: Int) : ValueWithUnit() // formerly one usage of None
|
||||||
|
|
||||||
data class Mgdl(val value: Double) : XXXValueWithUnit()
|
data class Mgdl(val value: Double) : ValueWithUnit()
|
||||||
|
|
||||||
data class Mmoll(val value: Double) : XXXValueWithUnit()
|
data class Mmoll(val value: Double) : ValueWithUnit()
|
||||||
|
|
||||||
data class Timestamp(val value: Long) : XXXValueWithUnit()
|
data class Timestamp(val value: Long) : ValueWithUnit()
|
||||||
|
|
||||||
data class Insulin(val value: Double) : XXXValueWithUnit()
|
data class Insulin(val value: Double) : ValueWithUnit()
|
||||||
|
|
||||||
data class UnitPerHour(val value: Double) : XXXValueWithUnit()
|
data class UnitPerHour(val value: Double) : ValueWithUnit()
|
||||||
|
|
||||||
data class Gram(val value: Int) : XXXValueWithUnit()
|
data class Gram(val value: Int) : ValueWithUnit()
|
||||||
|
|
||||||
data class Minute(val value: Int) : XXXValueWithUnit()
|
data class Minute(val value: Int) : ValueWithUnit()
|
||||||
|
|
||||||
data class Hour(val value: Int) : XXXValueWithUnit()
|
data class Hour(val value: Int) : ValueWithUnit()
|
||||||
|
|
||||||
data class Percent(val value: Int) : XXXValueWithUnit()
|
data class Percent(val value: Int) : ValueWithUnit()
|
||||||
|
|
||||||
data class TherapyEventType(val value: TherapyEvent.Type) : XXXValueWithUnit()
|
data class TherapyEventType(val value: TherapyEvent.Type) : ValueWithUnit()
|
||||||
|
|
||||||
data class TherapyEventMeterType(val value: TherapyEvent.MeterType) : XXXValueWithUnit()
|
data class TherapyEventMeterType(val value: TherapyEvent.MeterType) : ValueWithUnit()
|
||||||
|
|
||||||
data class TherapyEventTTReason(val value: TemporaryTarget.Reason) : XXXValueWithUnit()
|
data class TherapyEventTTReason(val value: TemporaryTarget.Reason) : ValueWithUnit()
|
||||||
|
|
||||||
data class StringResource(@StringRes val value: Int, val params: List<XXXValueWithUnit> = listOf()) : XXXValueWithUnit()
|
data class StringResource(@StringRes val value: Int, val params: List<ValueWithUnit> = listOf()) : ValueWithUnit()
|
||||||
|
|
||||||
fun value(): Any? {
|
fun value(): Any? {
|
||||||
return when(this) {
|
return when(this) {
|
||||||
|
@ -58,7 +58,7 @@ sealed class XXXValueWithUnit {
|
||||||
}
|
}
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
fun fromGlucoseUnit(value: Double, string: String): XXXValueWithUnit? = when (string) {
|
fun fromGlucoseUnit(value: Double, string: String): ValueWithUnit? = when (string) {
|
||||||
"mg/dl", "mgdl" -> Mgdl(value)
|
"mg/dl", "mgdl" -> Mgdl(value)
|
||||||
"mmol", "mmol/l" -> Mmoll(value)
|
"mmol", "mmol/l" -> Mmoll(value)
|
||||||
else -> null
|
else -> null
|
|
@ -3,13 +3,13 @@ package info.nightscout.androidaps.database.transactions
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry
|
import info.nightscout.androidaps.database.entities.UserEntry
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
import info.nightscout.androidaps.database.entities.UserEntry.Action
|
||||||
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
import info.nightscout.androidaps.database.entities.UserEntry.Sources
|
||||||
import info.nightscout.androidaps.database.entities.XXXValueWithUnit
|
import info.nightscout.androidaps.database.entities.ValueWithUnit
|
||||||
|
|
||||||
class UserEntryTransaction(
|
class UserEntryTransaction(
|
||||||
val action: Action,
|
val action: Action,
|
||||||
val source: Sources,
|
val source: Sources,
|
||||||
val note: String,
|
val note: String,
|
||||||
val values: List<XXXValueWithUnit?> = listOf()
|
val values: List<ValueWithUnit?> = listOf()
|
||||||
) : Transaction<Unit>() {
|
) : Transaction<Unit>() {
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
|
Loading…
Reference in a new issue