From 99ae6b4b84ee81556aebcdaa7fc2772ffb30a5bb Mon Sep 17 00:00:00 2001 From: Theo van Elsberg Date: Wed, 6 Oct 2021 11:33:47 +0200 Subject: [PATCH] PodConstants: - Fixed type - PRIMING/CANULLA/PULSE are the same, move to one single const --- .../pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt | 8 ++++---- .../omnipod/dash/driver/pod/definition/PodConstants.kt | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt index 0828b50c74..7187dd520d 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.G import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.* import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants.Companion.MAX_POD_LIFETIME import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants.Companion.POD_EXPIRATION_ALERT_MINUTES_DURATION -import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants.Companion.POD_EXPIRATION_EMINENT_ALERT_MINUTES +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants.Companion.POD_EXPIRATION_IMMINENT_ALERT_MINUTES import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants.Companion.POD_EXPIRATION_ALERT_MINUTES import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.* import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager @@ -281,7 +281,7 @@ class OmnipodDashManagerImpl @Inject constructor( .setUniqueId(podStateManager.uniqueId!!.toInt()) .setSequenceNumber(podStateManager.messageSequenceNumber) .setNonce(NONCE) - .setNumberOfUnits(podStateManager.firstPrimeBolusVolume!! * PodConstants.POD_PRIMING_BOLUS_UNITS) + .setNumberOfUnits(podStateManager.firstPrimeBolusVolume!! * PodConstants.POD_PULSE_BOLUS_UNITS) .setDelayBetweenPulsesInEighthSeconds(podStateManager.primePulseRate!!.toByte()) .setProgramReminder(ProgramReminder(atStart = false, atEnd = false, atInterval = 0)) .build(), @@ -383,7 +383,7 @@ class OmnipodDashManagerImpl @Inject constructor( ) observables.add( observeSendProgramBolusCommand( - podStateManager.secondPrimeBolusVolume!! * PodConstants.POD_CANNULA_INSERTION_BOLUS_UNITS, + podStateManager.secondPrimeBolusVolume!! * PodConstants.POD_PULSE_BOLUS_UNITS, podStateManager.primePulseRate!!.toByte(), confirmationBeeps = false, completionBeeps = false @@ -408,7 +408,7 @@ class OmnipodDashManagerImpl @Inject constructor( enabled = true, durationInMinutes = 0, autoOff = false, - AlertTrigger.TimerTrigger(POD_EXPIRATION_EMINENT_ALERT_MINUTES.toShort()), // FIXME use activation time + AlertTrigger.TimerTrigger(POD_EXPIRATION_IMMINENT_ALERT_MINUTES.toShort()), // FIXME use activation time BeepType.FOUR_TIMES_BIP_BEEP, BeepRepetitionType.XXX4 ) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt index 04de6d4c50..f2c5939557 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt @@ -12,15 +12,11 @@ class PodConstants { // Expiration alert time in minutes since activation const val POD_EXPIRATION_ALERT_MINUTES = 60 * 72 // Expiration eminent alert time in minutes since activation - const val POD_EXPIRATION_EMINENT_ALERT_MINUTES = 60 * 79 + const val POD_EXPIRATION_IMMINENT_ALERT_MINUTES = 60 * 79 - // Bolus units + // Bolus & Priming units const val POD_PULSE_BOLUS_UNITS = 0.05 - // Priming units - const val POD_PRIMING_BOLUS_UNITS = 0.05 - const val POD_CANNULA_INSERTION_BOLUS_UNITS = 0.05 - // Reservoir units alert threshold const val DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD : Short = 20 }