diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
index 3424fc9872..965e57496b 100644
--- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
+++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt
@@ -36,7 +36,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyL
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodOverviewFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodErosOverviewFragment
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment
import info.nightscout.androidaps.plugins.source.BGSourceFragment
import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment
@@ -68,7 +68,7 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
@ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment
- @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodOverviewFragment
+ @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodErosOverviewFragment
@ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
@ContributesAndroidInjector
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
index 1c6a8e088a..ac9ce8438c 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt
@@ -633,7 +633,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
pump.isSuspended -> {
- binding.infoLayout.apsMode.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) {
+ binding.infoLayout.apsMode.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Omnipod_Eros) {
// For Omnipod, indicate the pump as disconnected when it's suspended.
// The only way to 'reconnect' it, is through the Omnipod tab
R.drawable.ic_loop_disconnected
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt
index 82362908b7..f2cbd11ebb 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt
@@ -40,7 +40,7 @@ class StatusLightHandler @Inject constructor(
handleAge(careportal_pb_age, CareportalEvent.PUMPBATTERYCHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0)
}
if (!config.NSCLIENT) {
- if (pump.model() == PumpType.Insulet_Omnipod) {
+ if (pump.model() == PumpType.Omnipod_Eros) {
handleOmnipodReservoirLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U")
} else {
handleLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U")
@@ -52,7 +52,7 @@ class StatusLightHandler @Inject constructor(
}
if (!config.NSCLIENT) {
- if (pump.model() == PumpType.Insulet_Omnipod && pump is OmnipodErosPumpPlugin) { // instance of check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below
+ if (pump.model() == PumpType.Omnipod_Eros && pump is OmnipodErosPumpPlugin) { // instance of check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below
handleOmnipodBatteryLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%", pump.isUseRileyLinkBatteryLevel)
} else if (pump.model() != PumpType.AccuChekCombo) {
handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%")
diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java
index 90c6aadd70..670ec3fae1 100644
--- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java
+++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java
@@ -98,12 +98,19 @@ public enum PumpType {
// Insulet
- Insulet_Omnipod("Insulet Omnipod", ManufacturerType.Insulet, "Omnipod (Eros)", 0.05d, null, //
+ Omnipod_Eros("Omnipod", ManufacturerType.Insulet, "Eros", 0.05d, null, //
new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, //
0.05d, null, 0.05d, null, PumpCapability.OmnipodCapabilities, true),
+ Omnipod_Dash("Omnipod", ManufacturerType.Insulet, "Dash", 0.05d, null, //
+ new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
+ PumpTempBasalType.Absolute, //
+ new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, //
+ 0.05d, null, 0.05d, null, PumpCapability.OmnipodCapabilities, false),
+
+
// Medtronic
Medtronic_512_712("Medtronic 512/712", ManufacturerType.Medtronic, "512/712", 0.1d, null, //
new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
diff --git a/omnipod-common/build.gradle b/omnipod-common/build.gradle
index 85797f8d35..78e07d2236 100644
--- a/omnipod-common/build.gradle
+++ b/omnipod-common/build.gradle
@@ -45,6 +45,7 @@ dependencies {
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
+
testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.test.ext:junit:$androidx_junit"
}
\ No newline at end of file
diff --git a/omnipod-common/src/main/AndroidManifest.xml b/omnipod-common/src/main/AndroidManifest.xml
index 2ad7b616f1..24a9e72c49 100644
--- a/omnipod-common/src/main/AndroidManifest.xml
+++ b/omnipod-common/src/main/AndroidManifest.xml
@@ -2,4 +2,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java
deleted file mode 100644
index 4053d8f105..0000000000
--- a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.common;
-
-public class PlaceHolder {
-}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java
new file mode 100644
index 0000000000..ea8aa4fba3
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandAcknowledgeAlerts implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "ACKNOWLEDGE ALERTS";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java
new file mode 100644
index 0000000000..b3300b15ef
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandDeactivatePod implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "DEACTIVATE POD";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java
new file mode 100644
index 0000000000..5dfdcdcab6
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java
@@ -0,0 +1,21 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandHandleTimeChange implements CustomCommand {
+ private final boolean requestedByUser;
+
+ public CommandHandleTimeChange(boolean requestedByUser) {
+ this.requestedByUser = requestedByUser;
+ }
+
+ public boolean isRequestedByUser() {
+ return requestedByUser;
+ }
+
+ @NotNull @Override public String getStatusDescription() {
+ return "HANDLE TIME CHANGE";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java
new file mode 100644
index 0000000000..d62d59d726
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public class CommandPlayTestBeep implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "PLAY TEST BEEP";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java
new file mode 100644
index 0000000000..2d8af85bdd
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandResumeDelivery implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "RESUME DELIVERY";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java
new file mode 100644
index 0000000000..f3478e7d50
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandSuspendDelivery implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "SUSPEND DELIVERY";
+ }
+}
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java
new file mode 100644
index 0000000000..be1f7549ae
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java
@@ -0,0 +1,11 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command;
+
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandUpdateAlertConfiguration implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "UPDATE ALERT CONFIGURATION";
+ }
+}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt
similarity index 79%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt
index 723f990c60..c941e94147 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt
@@ -1,11 +1,9 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation
import android.os.Bundle
import androidx.annotation.IdRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
import javax.inject.Inject
class PodActivationWizardActivity : OmnipodWizardActivityBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt
similarity index 60%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt
index 13c091f04f..42ea98a971 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
import android.os.Bundle
import android.view.View
@@ -7,16 +7,16 @@ import androidx.annotation.IdRes
import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog
import androidx.navigation.fragment.findNavController
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
class AttachPodInfoFragment : InfoFragmentBase() {
@StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_title
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_title
@StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_text
+ override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_text
@IdRes
override fun getNextPageActionId(): Int = R.id.action_attachPodInfoFragment_to_insertCannulaActionFragment
@@ -31,9 +31,9 @@ class AttachPodInfoFragment : InfoFragmentBase() {
AlertDialog.Builder(it)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(getTitleId()))
- .setMessage(getString(R.string.omnipod_pod_activation_wizard_attach_pod_confirm_insert_cannula_text))
- .setPositiveButton(getString(R.string.omnipod_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) }
- .setNegativeButton(getString(R.string.omnipod_cancel), null)
+ .setMessage(getString(R.string.omnipod_common_pod_activation_wizard_attach_pod_confirm_insert_cannula_text))
+ .setPositiveButton(getString(R.string.omnipod_common_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) }
+ .setNegativeButton(getString(R.string.omnipod_common_cancel), null)
.show()
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt
similarity index 52%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt
index d6f3316deb..26dd0b2e54 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt
@@ -1,14 +1,14 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
import androidx.annotation.IdRes
import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
class FillPodInfoFragment : InfoFragmentBase() {
@StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_title
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_fill_pod_title
@StringRes
override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_text
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt
similarity index 65%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt
index 23914c1e96..848d7f5064 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt
@@ -1,13 +1,12 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
import android.os.Bundle
import androidx.annotation.IdRes
import androidx.annotation.StringRes
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InitializePodActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InitializePodActionViewModel
import javax.inject.Inject
class InitializePodActionFragment : PodActivationActionFragmentBase() {
@@ -24,7 +23,7 @@ class InitializePodActionFragment : PodActivationActionFragmentBase() {
}
@StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_title
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_initialize_pod_title
@StringRes
override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_text
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt
similarity index 58%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt
index ec56cedab2..fffaa1d930 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt
@@ -1,13 +1,12 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
import android.os.Bundle
import androidx.annotation.IdRes
import androidx.annotation.StringRes
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
import javax.inject.Inject
class InsertCannulaActionFragment : PodActivationActionFragmentBase() {
@@ -24,10 +23,10 @@ class InsertCannulaActionFragment : PodActivationActionFragmentBase() {
}
@StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_insert_cannula_title
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_insert_cannula_title
@StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_insert_cannula_text
+ override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_insert_cannula_text
@IdRes
override fun getNextPageActionId(): Int = R.id.action_insertCannulaActionFragment_to_PodActivatedInfoFragment
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt
new file mode 100644
index 0000000000..387646d015
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt
@@ -0,0 +1,20 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
+
+import androidx.annotation.IdRes
+import androidx.annotation.StringRes
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
+
+class PodActivatedInfoFragment : InfoFragmentBase() {
+
+ @StringRes
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_title
+
+ @StringRes
+ override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_text
+
+ @IdRes
+ override fun getNextPageActionId(): Int? = null
+
+ override fun getIndex(): Int = 5
+}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt
similarity index 68%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt
index f94ffd38a2..99e1a6da4e 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt
@@ -1,14 +1,12 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Button
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.ActionFragmentBase
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.PodDeactivationWizardActivity
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
import javax.inject.Inject
abstract class PodActivationActionFragmentBase : ActionFragmentBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt
similarity index 66%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt
index a1316b51d6..0eb2c9436e 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt
@@ -1,8 +1,8 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel
import info.nightscout.androidaps.data.PumpEnactResult
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
import javax.inject.Inject
class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt
similarity index 72%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt
index 87e34c28f7..ad5f366fc7 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt
@@ -1,9 +1,9 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.ProfileFunction
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
import javax.inject.Inject
class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt
similarity index 76%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt
index ec00555995..039e047bfa 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt
@@ -1,10 +1,10 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity
import androidx.appcompat.app.AlertDialog
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() {
@@ -20,8 +20,8 @@ abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() {
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(R.string.omnipod_common_wizard_exit_confirmation_title))
.setMessage(getString(R.string.omnipod_common_wizard_exit_confirmation_text))
- .setPositiveButton(getString(R.string.omnipod_yes)) { _, _ -> finish() }
- .setNegativeButton(getString(R.string.omnipod_no), null)
+ .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ -> finish() }
+ .setNegativeButton(getString(R.string.omnipod_common_no), null)
.show()
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt
similarity index 92%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt
index d1bd2f9f0b..9abbd9e8cf 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment
import android.annotation.SuppressLint
import android.os.Bundle
@@ -6,8 +6,8 @@ import android.view.View
import android.widget.Button
import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.utils.extensions.toVisibility
abstract class ActionFragmentBase : WizardFragmentBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt
similarity index 80%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt
index 664e373539..6193e64d86 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt
@@ -1,11 +1,11 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment
import android.os.Bundle
import android.view.View
import android.widget.TextView
import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
abstract class InfoFragmentBase : WizardFragmentBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt
similarity index 88%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt
index f687bb9b04..6cbb24aeed 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment
import android.content.res.ColorStateList
import android.os.Bundle
@@ -10,9 +10,8 @@ import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
import androidx.navigation.fragment.findNavController
import dagger.android.support.DaggerFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodWizardBaseFragmentBinding
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
import kotlin.math.roundToInt
abstract class WizardFragmentBase : DaggerFragment() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt
similarity index 86%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt
index 65f29dd3f5..d41b0725d1 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
@@ -17,7 +17,7 @@ abstract class ActionViewModelBase : ViewModel() {
fun executeAction() {
_isActionExecutingLiveData.postValue(true)
- SingleSubject.fromCallable(this::doExecuteAction)
+ SingleSubject.fromCallable(this::doExecuteAction)
.subscribeOn(Schedulers.io())
.doOnSuccess { result ->
_isActionExecutingLiveData.postValue(false)
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt
similarity index 59%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt
index 895a7c4c8e..4107469ce4 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt
@@ -1,8 +1,8 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation
import android.os.Bundle
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
class PodDeactivationWizardActivity : OmnipodWizardActivityBase() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt
similarity index 64%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt
index dab6389965..d2bcb71c99 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt
@@ -1,4 +1,4 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment
import android.os.Bundle
import android.view.View
@@ -9,11 +9,9 @@ import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.findNavController
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.ActionFragmentBase
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
import info.nightscout.androidaps.utils.extensions.toVisibility
import javax.inject.Inject
@@ -37,18 +35,18 @@ class DeactivatePodActionFragment : ActionFragmentBase() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- buttonDiscardPod = view.findViewById(R.id.button_discard_pod)
+ buttonDiscardPod = view.findViewById(R.id.omnipod_wizard_button_discard_pod)
buttonDiscardPod.setOnClickListener {
context?.let {
AlertDialog.Builder(it)
.setIcon(android.R.drawable.ic_dialog_alert)
- .setTitle(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod))
- .setMessage(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod_confirmation))
- .setPositiveButton(getString(R.string.omnipod_yes)) { _, _ ->
+ .setTitle(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod))
+ .setMessage(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod_confirmation))
+ .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ ->
aapsOmnipodManager.discardPodState()
findNavController().navigate(R.id.action_deactivatePodActionFragment_to_podDiscardedInfoFragment)
}
- .setNegativeButton(getString(R.string.omnipod_no), null)
+ .setNegativeButton(getString(R.string.omnipod_common_no), null)
.show()
}
}
@@ -59,10 +57,10 @@ class DeactivatePodActionFragment : ActionFragmentBase() {
}
@StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivating_pod_title
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_title
@StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivating_pod_text
+ override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_text
@IdRes
override fun getNextPageActionId(): Int = R.id.action_deactivatePodActionFragment_to_podDeactivatedInfoFragment
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt
new file mode 100644
index 0000000000..185eaf2f61
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt
@@ -0,0 +1,20 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment
+
+import androidx.annotation.IdRes
+import androidx.annotation.StringRes
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
+
+class DeactivatePodInfoFragment : InfoFragmentBase() {
+
+ @StringRes
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivate_pod_title
+
+ @StringRes
+ override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivate_pod_text
+
+ @IdRes
+ override fun getNextPageActionId(): Int = R.id.action_deactivatePodInfoFragment_to_deactivatePodActionFragment
+
+ override fun getIndex(): Int = 1
+}
\ No newline at end of file
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt
new file mode 100644
index 0000000000..50d6ec5173
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt
@@ -0,0 +1,20 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment
+
+import androidx.annotation.IdRes
+import androidx.annotation.StringRes
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
+
+class PodDeactivatedInfoFragment : InfoFragmentBase() {
+
+ @StringRes
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_title
+
+ @StringRes
+ override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_text
+
+ @IdRes
+ override fun getNextPageActionId(): Int? = null
+
+ override fun getIndex(): Int = 3
+}
\ No newline at end of file
diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt
new file mode 100644
index 0000000000..4bc0cc1214
--- /dev/null
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt
@@ -0,0 +1,20 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment
+
+import androidx.annotation.IdRes
+import androidx.annotation.StringRes
+import info.nightscout.androidaps.plugins.pump.omnipod.common.R
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
+
+class PodDiscardedInfoFragment : InfoFragmentBase() {
+
+ @StringRes
+ override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_title
+
+ @StringRes
+ override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_text
+
+ @IdRes
+ override fun getNextPageActionId(): Int? = null
+
+ override fun getIndex(): Int = 3
+}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt
similarity index 82%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt
rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt
index 24530b6c70..2108a08a5b 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt
+++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt
@@ -1,10 +1,10 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel
+package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel
import info.nightscout.androidaps.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.CommandQueueProvider
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandDeactivatePod
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.queue.Callback
import io.reactivex.subjects.SingleSubject
import javax.inject.Inject
diff --git a/omnipod-eros/src/main/res/layout/omnipod_overview.xml b/omnipod-common/src/main/res/layout/omnipod_overview.xml
similarity index 95%
rename from omnipod-eros/src/main/res/layout/omnipod_overview.xml
rename to omnipod-common/src/main/res/layout/omnipod_overview.xml
index f627579beb..034f2d3065 100644
--- a/omnipod-eros/src/main/res/layout/omnipod_overview.xml
+++ b/omnipod-common/src/main/res/layout/omnipod_overview.xml
@@ -106,7 +106,7 @@
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
- android:text="@string/omnipod_overview_pod_address"
+ android:text="@string/omnipod_common_overview_pod_unique_id"
android:textSize="14sp" />
+ android:text="@string/omnipod_common_overview_button_pod_management" />
+ android:text="@string/omnipod_common_overview_button_acknowledge_active_alerts" />
diff --git a/omnipod-common/src/main/res/navigation/omnipod_pod_activation_wizard_navigation_graph.xml b/omnipod-common/src/main/res/navigation/omnipod_pod_activation_wizard_navigation_graph.xml
index fcc84bac39..b5683e39c8 100644
--- a/omnipod-common/src/main/res/navigation/omnipod_pod_activation_wizard_navigation_graph.xml
+++ b/omnipod-common/src/main/res/navigation/omnipod_pod_activation_wizard_navigation_graph.xml
@@ -4,7 +4,7 @@
app:startDestination="@id/fillPodInfoFragment">
\ No newline at end of file
diff --git a/omnipod-common/src/main/res/navigation/omnipod_pod_deactivation_wizard_navigation_graph.xml b/omnipod-common/src/main/res/navigation/omnipod_pod_deactivation_wizard_navigation_graph.xml
index 3257353f2b..91cb66d462 100644
--- a/omnipod-common/src/main/res/navigation/omnipod_pod_deactivation_wizard_navigation_graph.xml
+++ b/omnipod-common/src/main/res/navigation/omnipod_pod_deactivation_wizard_navigation_graph.xml
@@ -4,7 +4,7 @@
app:startDestination="@id/deactivatePodInfoFragment">
\ No newline at end of file
diff --git a/omnipod-common/src/main/res/values/strings.xml b/omnipod-common/src/main/res/values/strings.xml
index 3d779856b0..a8cb6ab200 100644
--- a/omnipod-common/src/main/res/values/strings.xml
+++ b/omnipod-common/src/main/res/values/strings.xml
@@ -1,6 +1,89 @@
-
+
+ AAPS.Omnipod.bolus_beeps_enabled
+ AAPS.Omnipod.basal_beeps_enabled
+ AAPS.Omnipod.smb_beeps_enabled
+ AAPS.Omnipod.tbr_beeps_enabled
+ AAPS.Omnipod.suspend_delivery_button_enabled
+ AAPS.Omnipod.time_change_enabled
+ AAPS.Omnipod.expiration_reminder_enabled
+ AAPS.Omnipod.expiration_reminder_hours_before_shutdown
+ AAPS.Omnipod.low_reservoir_alert_enabled
+ AAPS.Omnipod.low_reservoir_alert_units
+ AAPS.Omnipod.automatically_acknowledge_alerts_enabled
+
+
+ Pod Management
+ Actions
+ Tools
+ Activate Pod
+ Deactivate Pod
+ Discard Pod
+ If you discard the Pod, you will not be able to communicate with it anymore. You should only do this when all communication with the Pod persistently fails. If you can still communicate with the Pod, please use the Deactivate Pod option.\n\nIf you wish to proceed, please make sure to remove the Pod from your body!
+ Play Test Beep
+ Playing Test Beep…
+ Pod History
+
+
+ No active Pod
+ Setting basal profile failed.
+ Bolus did not succeed.
+ Failed to set basal profile: received an empty profile. Make sure to activate your basal profile.
+ No basal profile is active. Make sure to activate your basal profile.
+ Unsupported custom command: %1$s
+ Failed to refresh status
+ Failed to refresh status on startup
+ Failed to acknowledge alerts
+ Failed to suspend delivery
+ Failed to set time
+ Failed to resume delivery
+ Failed to initialize the Pod
+ Failed to insert cannula
+ The Pod\'s activation time has been exceeded. This Pod can no longer be activated.
+ Failed to verify activation progress. Please retry.
+ Pod suspended
+ Failed to play test beep
+ The time on the Pod is out of sync. Please update the time in the Omnipod tab.
+ An unexpected error occurred. Please report! (%1$s: %2$s).
+
+
+ Confirmation
+ Time and/or time zone changed on the Pod.
+ Alert configuration has been updated in the Pod.
+ The time on the Pod has been updated.
+ All insulin delivery has been suspended.
+ Active alerts have been acknowledged.
+ Insulin delivery has been resumed.
+
+
+ Set time
+ Suspend
+ Resume Delivery
+ Pod Mgmt
+ Ack Alerts
+ Pod Status
+ Total Delivered
+ %1$.2f U
+ Unique ID
+ LOT Number
+ Sequence Number
+ Pod Expires
+ Last Connection
+ Last Bolus
+ Temp Basal Rate
+ Base Basal Rate
+ Reservoir
+ Active Pod Alerts
+ Firmware Version
+ Time on Pod
+ %1$.2fU/h @%2$s (%3$d/%4$d minutes)
+ %1$.2f U left
+ Over 50 U left
+ Errors
+ %1$.2f %2$s (%3$s)
+
+
Cancel
Finish
Next
@@ -9,4 +92,128 @@
Discard Pod
You haven\'t completed all steps yet. Are you sure you want to exit?
Exit
+
+
+ Fill Pod
+ Initialize Pod
+ Attach Pod
+ Prepare the infusion site. Remove the Pod\'s needle cap and adhesive backing and attach the Pod to the infusion site.\n\nIf the cannula sticks out, please press Cancel and discard your Pod.\n\nPress Next to insert the cannula and begin basal delivery.
+ When you press OK, the cannula will be inserted. Make sure that you have attached the Pod to the infusion site.
+ Insert Cannula
+ Trying to set initial basal schedule and insert the cannula.\n\nWhen the cannula has successfully been inserted, you can press Next.
+ Pod Activated
+ The new Pod is now active.\n\nYour basal schedule has been programmed and the cannula has been inserted.\n\nPlease verify that the cannula has been inserted correctly and change your Pod if you think it has not.
+
+
+ Deactivate Pod
+ Press Next to deactivate the Pod.\n\nNote: This will suspend all insulin delivery and deactivate the Pod.
+ Deactivating Pod
+ Deactivating the Pod.\n\nWhen deactivation has completed successfully, you can press Next.
+ Pod Deactivated
+ Your Pod has been deactivated.\n\nPlease remove the Pod from your body and recycle it.
+ Pod Discarded
+ The Pod state has been discarded. Insulin delivery has not been suspended because the Pod has not been properly deactivated!\n\nPlease remove the Pod from your body and recycle it.
+ If you discard the Pod, you will not be able to communicate with it anymore. You should only do this when all communication with the Pod persistently fails. Are you sure you want to discard the Pod?
+ Discard Pod
+
+
+ Bolus beeps enabled
+ Basal beeps enabled
+ SMB beeps enabled
+ TBR beeps enabled
+ Show Suspend Delivery button in Omnipod tab
+ DST/Time zone detection enabled
+ Expiration reminder enabled
+ Hours before shutdown
+ Low reservoir alert enabled
+ Number of units
+ Automatically acknowledge Pod alerts
+ Other
+ Alerts
+ Confirmation Beeps
+
+
+ No Active Pod
+ Setup in progress (waiting for Pod activation)
+ Setup in progress (waiting for cannula insertion)
+ Running
+ Suspended
+ Pod Fault
+ Activation time exceeded
+ Inactive
+ Pod Fault: %1$03d %2$s
+
+
+ Deactivate Pod
+ Discard Pod
+ Set Bolus
+ Cancel Bolus
+ Set Temporary Basal
+ Cancel Temporary Basal (internally by driver)
+ Cancel Temporary Basal
+ Set Basal Schedule
+ Get Pod Status
+ Get Pod Info
+ Set Time
+ Configure Alerts
+ Acknowledge Alerts
+ Suspend Delivery
+ Resume Delivery
+ Unknown Entry
+ Initialize Pod
+ Insert Cannula
+ Read Pulse Log
+ Set fake temporary basal because the Pod is suspended
+ Cancel fake temporary basal that was created because the Pod was suspended
+ Split temporary basal because of uncertain failure in cancellation
+ Beep Config
+ Play Test Beep
+
+
+ Finish pairing reminder
+ Finish setup reminder
+ Pod will expire soon
+ Pod will expire soon
+ Shutdown is imminent
+ Low Reservoir
+ Unknown Alert
+
+
+ No Active Pod
+ LastConn: %1$d min ago
+ LastBolus: %1$s @ %2$s
+ Temp: %1$s
+ Extended: %1$s
+ Reserv: %1$sU
+
+
+ Yes
+ No
+ OK
+ Cancel
+ Warning
+ %1$s: %2$s
+
+
+ %1$s (%2$s)
+ Moments ago
+ Less than a minute ago
+ %1$s and %2$s
+ %1$s ago
+
+ - %1$d minute
+ - %1$d minutes
+
+
+ - %1$d hour
+ - %1$d hours
+
+
+ - %1$d day
+ - %1$d days
+
+
+ - Pod Alert: %1$s
+ - Pod Alerts: %1$s
+
\ No newline at end of file
diff --git a/omnipod-dash/src/main/AndroidManifest.xml b/omnipod-dash/src/main/AndroidManifest.xml
index e93d85a757..25a6e46f21 100644
--- a/omnipod-dash/src/main/AndroidManifest.xml
+++ b/omnipod-dash/src/main/AndroidManifest.xml
@@ -1,4 +1,9 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.java b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.java
index e18c717b74..471a477e89 100644
--- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.java
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.java
@@ -1,5 +1,170 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash;
-public class OmnipodDashPumpPlugin {
- // TODO
+import androidx.annotation.Nullable;
+
+import org.jetbrains.annotations.NotNull;
+import org.json.JSONObject;
+
+import java.util.List;
+
+import info.nightscout.androidaps.data.DetailedBolusInfo;
+import info.nightscout.androidaps.data.Profile;
+import info.nightscout.androidaps.data.PumpEnactResult;
+import info.nightscout.androidaps.interfaces.PumpDescription;
+import info.nightscout.androidaps.interfaces.PumpInterface;
+import info.nightscout.androidaps.plugins.common.ManufacturerType;
+import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
+import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
+import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+import info.nightscout.androidaps.utils.TimeChangeType;
+
+public class OmnipodDashPumpPlugin implements PumpInterface {
+ @Override public boolean isInitialized() {
+ return false;
+ }
+
+ @Override public boolean isSuspended() {
+ return false;
+ }
+
+ @Override public boolean isBusy() {
+ return false;
+ }
+
+ @Override public boolean isConnected() {
+ return false;
+ }
+
+ @Override public boolean isConnecting() {
+ return false;
+ }
+
+ @Override public boolean isHandshakeInProgress() {
+ return false;
+ }
+
+ @Override public void finishHandshaking() {
+
+ }
+
+ @Override public void connect(String reason) {
+
+ }
+
+ @Override public void disconnect(String reason) {
+
+ }
+
+ @Override public void stopConnecting() {
+
+ }
+
+ @Override public void getPumpStatus(String reason) {
+
+ }
+
+ @NotNull @Override public PumpEnactResult setNewBasalProfile(Profile profile) {
+ return null;
+ }
+
+ @Override public boolean isThisProfileSet(Profile profile) {
+ return false;
+ }
+
+ @Override public long lastDataTime() {
+ return 0;
+ }
+
+ @Override public double getBaseBasalRate() {
+ return 0;
+ }
+
+ @Override public double getReservoirLevel() {
+ return 0;
+ }
+
+ @Override public int getBatteryLevel() {
+ return 0;
+ }
+
+ @NotNull @Override public PumpEnactResult deliverTreatment(DetailedBolusInfo detailedBolusInfo) {
+ return null;
+ }
+
+ @Override public void stopBolusDelivering() {
+
+ }
+
+ @NotNull @Override public PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes, Profile profile, boolean enforceNew) {
+ return null;
+ }
+
+ @NotNull @Override public PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes, Profile profile, boolean enforceNew) {
+ return null;
+ }
+
+ @NotNull @Override public PumpEnactResult setExtendedBolus(Double insulin, Integer durationInMinutes) {
+ return null;
+ }
+
+ @NotNull @Override public PumpEnactResult cancelTempBasal(boolean enforceNew) {
+ return null;
+ }
+
+ @NotNull @Override public PumpEnactResult cancelExtendedBolus() {
+ return null;
+ }
+
+ @NotNull @Override public JSONObject getJSONStatus(Profile profile, String profileName, String version) {
+ return null;
+ }
+
+ @NotNull @Override public ManufacturerType manufacturer() {
+ return null;
+ }
+
+ @NotNull @Override public PumpType model() {
+ return null;
+ }
+
+ @NotNull @Override public String serialNumber() {
+ return null;
+ }
+
+ @NotNull @Override public PumpDescription getPumpDescription() {
+ return null;
+ }
+
+ @NotNull @Override public String shortStatus(boolean veryShort) {
+ return null;
+ }
+
+ @Override public boolean isFakingTempsByExtendedBoluses() {
+ return false;
+ }
+
+ @NotNull @Override public PumpEnactResult loadTDDs() {
+ return null;
+ }
+
+ @Override public boolean canHandleDST() {
+ return false;
+ }
+
+ @Nullable @Override public List getCustomActions() {
+ return null;
+ }
+
+ @Override public void executeCustomAction(CustomActionType customActionType) {
+
+ }
+
+ @Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
+ return null;
+ }
+
+ @Override public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
+
+ }
}
diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.java b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.java
new file mode 100644
index 0000000000..a23de9bcf0
--- /dev/null
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.java
@@ -0,0 +1,4 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver;
+
+public interface OmnipodDashManager {
+}
diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashCommunicationManager.java b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashCommunicationManager.java
new file mode 100644
index 0000000000..a53f3e2b34
--- /dev/null
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashCommunicationManager.java
@@ -0,0 +1,4 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm;
+
+public interface OmnipodDashCommunicationManager {
+}
diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.java b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.java
new file mode 100644
index 0000000000..275bb1d6ec
--- /dev/null
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.java
@@ -0,0 +1,4 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state;
+
+public interface OmnipodDashPodStateManager {
+}
diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt
new file mode 100644
index 0000000000..9a8eaa0d1f
--- /dev/null
+++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt
@@ -0,0 +1,19 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import dagger.android.support.DaggerFragment
+
+class OmnipodDashOverviewFragment : DaggerFragment() {
+
+ private var _binding: OmnipodOverviewBinding? = null
+
+ // This property is only valid between onCreateView and
+ // onDestroyView.
+ private val binding get() = _binding!!
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
+ OmnipodOverviewBinding.inflate(inflater, container, false).also { _binding = it }.root
+}
\ No newline at end of file
diff --git a/omnipod-dash/src/main/res/values/strings.xml b/omnipod-dash/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..45233d9e6e
--- /dev/null
+++ b/omnipod-dash/src/main/res/values/strings.xml
@@ -0,0 +1,10 @@
+
+
+
+ Dash
+ Dash
+ Pump integration for Omnipod Dash (the new, Bluetooth-enabled model with a blue needle cap).
+
+
+ AAPS.OmnipodDash.pod_state
+
\ No newline at end of file
diff --git a/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml b/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml
new file mode 100644
index 0000000000..54210c36b7
--- /dev/null
+++ b/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/omnipod-eros/src/main/AndroidManifest.xml b/omnipod-eros/src/main/AndroidManifest.xml
index 22e068b8cc..1c269e921d 100644
--- a/omnipod-eros/src/main/AndroidManifest.xml
+++ b/omnipod-eros/src/main/AndroidManifest.xml
@@ -7,9 +7,7 @@
android:enabled="true"
android:exported="true" />
-
-
-
-
+
+
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java
index 6a5364dbca..c9bbd95cd8 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java
@@ -66,10 +66,17 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpInfo;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData;
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandAcknowledgeAlerts;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandHandleTimeChange;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandResumeDelivery;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandSuspendDelivery;
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandUpdateAlertConfiguration;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodCommandType;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodStorageKeys;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.service.ExpirationReminderBuilder;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress;
@@ -83,16 +90,12 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodFa
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodUncertainTbrRecovered;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandAcknowledgeAlerts;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandHandleTimeChange;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandPlayTestBeep;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandUpdateAlertConfiguration;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.OmnipodCustomCommand;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.OmnipodCustomCommandType;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.service.RileyLinkOmnipodService;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodOverviewFragment;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodErosOverviewFragment;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil;
import info.nightscout.androidaps.queue.Callback;
@@ -123,7 +126,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private final PodStateManager podStateManager;
private final RileyLinkServiceData rileyLinkServiceData;
- private final AapsOmnipodManager aapsOmnipodManager;
+ private final AapsOmnipodErosManager aapsOmnipodErosManager;
private final AapsOmnipodUtil aapsOmnipodUtil;
private final RileyLinkUtil rileyLinkUtil;
private final OmnipodAlertUtil omnipodAlertUtil;
@@ -140,7 +143,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private final PumpDescription pumpDescription;
private final ServiceConnection serviceConnection;
private final OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager;
- private final PumpType pumpType = PumpType.Insulet_Omnipod;
+ private final PumpType pumpType = PumpType.Omnipod_Eros;
private final CompositeDisposable disposables = new CompositeDisposable();
private final NSUpload nsUpload;
@@ -168,7 +171,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
ActivePluginProvider activePlugin,
SP sp,
PodStateManager podStateManager,
- AapsOmnipodManager aapsOmnipodManager,
+ AapsOmnipodErosManager aapsOmnipodErosManager,
CommandQueueProvider commandQueue,
FabricPrivacy fabricPrivacy,
RileyLinkServiceData rileyLinkServiceData,
@@ -182,12 +185,12 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
) {
super(new PluginDescription() //
.mainType(PluginType.PUMP) //
- .fragmentClass(OmnipodOverviewFragment.class.getName()) //
+ .fragmentClass(OmnipodErosOverviewFragment.class.getName()) //
.pluginIcon(R.drawable.ic_pod_128)
- .pluginName(R.string.omnipod_name) //
- .shortName(R.string.omnipod_name_short) //
- .preferencesId(R.xml.pref_omnipod) //
- .description(R.string.omnipod_pump_description), //
+ .pluginName(R.string.omnipod_eros_name) //
+ .shortName(R.string.omnipod_eros_name_short) //
+ .preferencesId(R.xml.omnipod_eros_preferences) //
+ .description(R.string.omnipod_eros_pump_description), //
injector, aapsLogger, resourceHelper, commandQueue);
this.aapsLogger = aapsLogger;
this.aapsSchedulers = aapsSchedulers;
@@ -200,7 +203,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
this.dateUtil = dateUtil;
this.podStateManager = podStateManager;
this.rileyLinkServiceData = rileyLinkServiceData;
- this.aapsOmnipodManager = aapsOmnipodManager;
+ this.aapsOmnipodErosManager = aapsOmnipodErosManager;
this.aapsOmnipodUtil = aapsOmnipodUtil;
this.rileyLinkUtil = rileyLinkUtil;
this.omnipodAlertUtil = omnipodAlertUtil;
@@ -242,9 +245,9 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override public void run() {
if (commandQueue.size() == 0) {
if (podStateManager.isPodRunning() && !podStateManager.isSuspended()) {
- aapsOmnipodManager.cancelSuspendedFakeTbrIfExists();
+ aapsOmnipodErosManager.cancelSuspendedFakeTbrIfExists();
} else {
- aapsOmnipodManager.createSuspendedFakeTbrIfNotExists();
+ aapsOmnipodErosManager.createSuspendedFakeTbrIfNotExists();
}
if (OmnipodErosPumpPlugin.this.hasTimeDateOrTimeZoneChanged) {
@@ -254,7 +257,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null);
}
- if (aapsOmnipodManager.isAutomaticallyAcknowledgeAlertsEnabled() && podStateManager.isPodActivationCompleted() && !podStateManager.isPodDead() &&
+ if (aapsOmnipodErosManager.isAutomaticallyAcknowledgeAlertsEnabled() && podStateManager.isPodActivationCompleted() && !podStateManager.isPodDead() &&
podStateManager.getActiveAlerts().size() > 0 && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
queueAcknowledgeAlertsCommand();
}
@@ -314,25 +317,25 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.toObservable(EventPreferenceChange.class)
.observeOn(aapsSchedulers.getIo())
.subscribe(event -> {
- if (event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BASAL_BEEPS_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BOLUS_BEEPS_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SMB_BEEPS_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED)) {
- aapsOmnipodManager.reloadSettings();
- } else if (event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED) ||
- event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS)) {
+ if (event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BASAL_BEEPS_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BOLUS_BEEPS_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.TBR_BEEPS_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SMB_BEEPS_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED)) {
+ aapsOmnipodErosManager.reloadSettings();
+ } else if (event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED) ||
+ event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS)) {
if (!verifyPodAlertConfiguration()) {
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null);
}
@@ -347,16 +350,16 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
// If so, add it to history
// Needs to be done after EventAppInitialized because otherwise, TreatmentsPlugin.onStart() hasn't been called yet
// so it didn't initialize a TreatmentService yet, resulting in a NullPointerException
- if (sp.contains(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS)) {
- String activeBolusString = sp.getString(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS, "");
+ if (sp.contains(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS)) {
+ String activeBolusString = sp.getString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, "");
aapsLogger.warn(LTag.PUMP, "Found active bolus in SP: {}. Adding Treatment.", activeBolusString);
try {
ActiveBolus activeBolus = aapsOmnipodUtil.getGsonInstance().fromJson(activeBolusString, ActiveBolus.class);
- aapsOmnipodManager.addBolusToHistory(activeBolus.toDetailedBolusInfo(aapsLogger));
+ aapsOmnipodErosManager.addBolusToHistory(activeBolus.toDetailedBolusInfo(aapsLogger));
} catch (Exception ex) {
aapsLogger.error(LTag.PUMP, "Failed to add active bolus to history", ex);
}
- sp.remove(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS);
+ sp.remove(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS);
}
}, fabricPrivacy::logException)
);
@@ -367,8 +370,8 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
private void handleCancelledTbr() {
- if (!podStateManager.isTempBasalRunning() && activePlugin.getActiveTreatments().isTempBasalInProgress() && !aapsOmnipodManager.hasSuspendedFakeTbr()) {
- aapsOmnipodManager.reportCancelledTbr();
+ if (!podStateManager.isTempBasalRunning() && activePlugin.getActiveTreatments().isTempBasalInProgress() && !aapsOmnipodErosManager.hasSuspendedFakeTbr()) {
+ aapsOmnipodErosManager.reportCancelledTbr();
}
}
@@ -378,7 +381,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
if (podStateManager.isTempBasalRunning() && tempBasal == null) {
if (podStateManager.hasTempBasal()) {
aapsLogger.warn(LTag.PUMP, "Registering TBR that AAPS was unaware of");
- long pumpId = aapsOmnipodManager.addTbrSuccessToHistory(podStateManager.getTempBasalStartTime().getMillis(),
+ long pumpId = aapsOmnipodErosManager.addTbrSuccessToHistory(podStateManager.getTempBasalStartTime().getMillis(),
new TempBasalPair(podStateManager.getTempBasalAmount(), false, (int) podStateManager.getTempBasalDuration().getStandardMinutes()));
TemporaryBasal temporaryBasal = new TemporaryBasal(getInjector()) //
@@ -392,7 +395,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
} else {
// Not sure what's going on. Notify the user
aapsLogger.error(LTag.PUMP, "Unknown TBR in both Pod state and AAPS");
- rxBus.send(new EventNewNotification(new Notification(Notification.OMNIPOD_UNKNOWN_TBR, resourceHelper.gs(R.string.omnipod_error_tbr_running_but_aaps_not_aware), Notification.NORMAL).sound(R.raw.boluserror)));
+ rxBus.send(new EventNewNotification(new Notification(Notification.OMNIPOD_UNKNOWN_TBR, resourceHelper.gs(R.string.omnipod_eros_error_tbr_running_but_aaps_not_aware), Notification.NORMAL).sound(R.raw.boluserror)));
}
} else if (!podStateManager.isTempBasalRunning() && tempBasal != null) {
aapsLogger.warn(LTag.PUMP, "Removing AAPS TBR that actually hadn't succeeded");
@@ -407,12 +410,12 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
AlertSet activeAlerts = podStateManager.getActiveAlerts();
if (activeAlerts.size() > 0) {
String alerts = TextUtils.join(", ", aapsOmnipodUtil.getTranslatedActiveAlerts(podStateManager));
- String notificationText = resourceHelper.gq(R.plurals.omnipod_pod_alerts, activeAlerts.size(), alerts);
+ String notificationText = resourceHelper.gq(R.plurals.omnipod_common_pod_alerts, activeAlerts.size(), alerts);
Notification notification = new Notification(Notification.OMNIPOD_POD_ALERTS, notificationText, Notification.URGENT);
rxBus.send(new EventNewNotification(notification));
nsUpload.uploadError(notificationText);
- if (aapsOmnipodManager.isAutomaticallyAcknowledgeAlertsEnabled() && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
+ if (aapsOmnipodErosManager.isAutomaticallyAcknowledgeAlertsEnabled() && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
queueAcknowledgeAlertsCommand();
}
}
@@ -421,7 +424,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private void handlePodFaultEvent() {
if (podStateManager.isPodFaulted()) {
- String notificationText = resourceHelper.gs(R.string.omnipod_pod_status_pod_fault_description, podStateManager.getFaultEventCode().getValue(), podStateManager.getFaultEventCode().name());
+ String notificationText = resourceHelper.gs(R.string.omnipod_common_pod_status_pod_fault_description, podStateManager.getFaultEventCode().getValue(), podStateManager.getFaultEventCode().name());
nsUpload.uploadError(notificationText);
}
}
@@ -451,19 +454,19 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private void updatePodWarningNotifications() {
if (System.currentTimeMillis() > this.nextPodWarningCheck) {
if (!podStateManager.isPodRunning()) {
- Notification notification = new Notification(Notification.OMNIPOD_POD_NOT_ATTACHED, resourceHelper.gs(R.string.omnipod_error_pod_not_attached), Notification.NORMAL);
+ Notification notification = new Notification(Notification.OMNIPOD_POD_NOT_ATTACHED, resourceHelper.gs(R.string.omnipod_common_error_pod_not_attached), Notification.NORMAL);
rxBus.send(new EventNewNotification(notification));
} else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED));
if (podStateManager.isSuspended()) {
- Notification notification = new Notification(Notification.OMNIPOD_POD_SUSPENDED, resourceHelper.gs(R.string.omnipod_error_pod_suspended), Notification.NORMAL);
+ Notification notification = new Notification(Notification.OMNIPOD_POD_SUSPENDED, resourceHelper.gs(R.string.omnipod_common_error_pod_suspended), Notification.NORMAL);
rxBus.send(new EventNewNotification(notification));
} else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) {
- Notification notification = new Notification(Notification.OMNIPOD_TIME_OUT_OF_SYNC, resourceHelper.gs(R.string.omnipod_error_time_out_of_sync), Notification.NORMAL);
+ Notification notification = new Notification(Notification.OMNIPOD_TIME_OUT_OF_SYNC, resourceHelper.gs(R.string.omnipod_common_error_time_out_of_sync), Notification.NORMAL);
rxBus.send(new EventNewNotification(notification));
} else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_TIME_OUT_OF_SYNC));
@@ -524,7 +527,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
@Override public RileyLinkPumpInfo getPumpInfo() {
- String frequency = resourceHelper.gs(R.string.omnipod_frequency);
+ String frequency = resourceHelper.gs(R.string.omnipod_eros_frequency);
String connectedModel = "Eros";
String serialNumber = podStateManager.isPodInitialized() ? String.valueOf(podStateManager.getAddress()) : "-";
return new RileyLinkPumpInfo(frequency, connectedModel, serialNumber);
@@ -578,13 +581,13 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
private PumpEnactResult getPodStatus() {
- return executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
+ return executeCommand(OmnipodErosCommandType.GET_POD_STATUS, aapsOmnipodErosManager::getPodStatus);
}
@NonNull
@Override
public PumpEnactResult setNewBasalProfile(Profile profile) {
- PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodManager.setBasalProfile(profile, true));
+ PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodErosManager.setBasalProfile(profile, true));
aapsLogger.info(LTag.PUMP, "Basal Profile was set: " + result.success);
@@ -598,7 +601,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
// When we activate a new Pod, we just use ProfileFunction to set the currently active profile
return true;
}
- return Objects.equals(podStateManager.getBasalSchedule(), AapsOmnipodManager.mapProfileToBasalSchedule(profile));
+ return Objects.equals(podStateManager.getBasalSchedule(), AapsOmnipodErosManager.mapProfileToBasalSchedule(profile));
}
@Override
@@ -628,7 +631,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public int getBatteryLevel() {
- if (aapsOmnipodManager.isShowRileyLinkBatteryLevel()) {
+ if (aapsOmnipodErosManager.isShowRileyLinkBatteryLevel()) {
return Optional.ofNullable(rileyLinkServiceData.batteryLevel).orElse(0);
}
@@ -656,7 +659,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public void stopBolusDelivering() {
- executeCommand(OmnipodCommandType.CANCEL_BOLUS, aapsOmnipodManager::cancelBolus);
+ executeCommand(OmnipodErosCommandType.CANCEL_BOLUS, aapsOmnipodErosManager::cancelBolus);
}
// if enforceNew is true, current temp basal is cancelled and new TBR set (duration is prolonged),
@@ -668,7 +671,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute: rate: {}, duration={}", absoluteRate, durationInMinutes);
if (durationInMinutes <= 0 || durationInMinutes % BASAL_STEP_DURATION.getStandardMinutes() != 0) {
- return new PumpEnactResult(getInjector()).success(false).comment(resourceHelper.gs(R.string.omnipod_error_set_temp_basal_failed_validation, BASAL_STEP_DURATION.getStandardMinutes()));
+ return new PumpEnactResult(getInjector()).success(false).comment(resourceHelper.gs(R.string.omnipod_eros_error_set_temp_basal_failed_validation, BASAL_STEP_DURATION.getStandardMinutes()));
}
// read current TBR
@@ -686,12 +689,12 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
}
- PumpEnactResult result = executeCommand(OmnipodCommandType.SET_TEMPORARY_BASAL, () -> aapsOmnipodManager.setTemporaryBasal(new TempBasalPair(absoluteRate, false, durationInMinutes)));
+ PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_TEMPORARY_BASAL, () -> aapsOmnipodErosManager.setTemporaryBasal(new TempBasalPair(absoluteRate, false, durationInMinutes)));
aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute - setTBR. Response: " + result.success);
if (result.success) {
- incrementStatistics(OmnipodStorageKeys.Statistics.TBRS_SET);
+ incrementStatistics(OmnipodErosStorageKeys.Statistics.TBRS_SET);
}
return result;
@@ -707,7 +710,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return new PumpEnactResult(getInjector()).success(true).enacted(false);
}
- return executeCommand(OmnipodCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodManager::cancelTemporaryBasal);
+ return executeCommand(OmnipodErosCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodErosManager::cancelTemporaryBasal);
}
// TODO improve (i8n and more)
@@ -795,30 +798,30 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@NonNull @Override
public String shortStatus(boolean veryShort) {
if (!podStateManager.isPodActivationCompleted()) {
- return resourceHelper.gs(R.string.omnipod_short_status_no_active_pod);
+ return resourceHelper.gs(R.string.omnipod_common_short_status_no_active_pod);
}
String ret = "";
if (lastConnectionTimeMillis != 0) {
long agoMsec = System.currentTimeMillis() - lastConnectionTimeMillis;
int agoMin = (int) (agoMsec / 60d / 1000d);
- ret += resourceHelper.gs(R.string.omnipod_short_status_last_connection, agoMin) + "\n";
+ ret += resourceHelper.gs(R.string.omnipod_common_short_status_last_connection, agoMin) + "\n";
}
if (podStateManager.getLastBolusStartTime() != null) {
- ret += resourceHelper.gs(R.string.omnipod_short_status_last_bolus, DecimalFormatter.to2Decimal(podStateManager.getLastBolusAmount()),
+ ret += resourceHelper.gs(R.string.omnipod_common_short_status_last_bolus, DecimalFormatter.to2Decimal(podStateManager.getLastBolusAmount()),
android.text.format.DateFormat.format("HH:mm", podStateManager.getLastBolusStartTime().toDate())) + "\n";
}
TemporaryBasal activeTemp = activePlugin.getActiveTreatments().getRealTempBasalFromHistory(System.currentTimeMillis());
if (activeTemp != null) {
- ret += resourceHelper.gs(R.string.omnipod_short_status_temp_basal, activeTemp.toStringFull()) + "\n";
+ ret += resourceHelper.gs(R.string.omnipod_common_short_status_temp_basal, activeTemp.toStringFull()) + "\n";
}
ExtendedBolus activeExtendedBolus = activePlugin.getActiveTreatments().getExtendedBolusFromHistory(
System.currentTimeMillis());
if (activeExtendedBolus != null) {
- ret += resourceHelper.gs(R.string.omnipod_short_status_extended_bolus, activeExtendedBolus.toString()) + "\n";
+ ret += resourceHelper.gs(R.string.omnipod_common_short_status_extended_bolus, activeExtendedBolus.toString()) + "\n";
}
- ret += resourceHelper.gs(R.string.omnipod_short_status_reservoir, (getReservoirLevel() > OmnipodConstants.MAX_RESERVOIR_READING ? "50+" : DecimalFormatter.to0Decimal(getReservoirLevel()))) + "\n";
+ ret += resourceHelper.gs(R.string.omnipod_common_short_status_reservoir, (getReservoirLevel() > OmnipodConstants.MAX_RESERVOIR_READING ? "50+" : DecimalFormatter.to0Decimal(getReservoirLevel()))) + "\n";
if (isUseRileyLinkBatteryLevel()) {
- ret += resourceHelper.gs(R.string.omnipod_short_status_rl_battery, getBatteryLevel()) + "\n";
+ ret += resourceHelper.gs(R.string.omnipod_eros_short_status_riley_link_battery, getBatteryLevel()) + "\n";
}
return ret.trim();
}
@@ -835,52 +838,50 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public PumpEnactResult executeCustomCommand(CustomCommand command) {
- if (!(command instanceof OmnipodCustomCommand)) {
- aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + command.getClass().getName());
- return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, command.getClass().getName()));
+ if (command instanceof CommandAcknowledgeAlerts) {
+ return executeCommand(OmnipodErosCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodErosManager::acknowledgeAlerts);
+ }
+ if (command instanceof CommandGetPodStatus) {
+ return getPodStatus();
+ }
+ if (command instanceof CommandReadPulseLog) {
+ return retrievePulseLog();
+ }
+ if (command instanceof CommandSuspendDelivery) {
+ return executeCommand(OmnipodErosCommandType.SUSPEND_DELIVERY, aapsOmnipodErosManager::suspendDelivery);
+ }
+ if (command instanceof CommandResumeDelivery) {
+ return executeCommand(OmnipodErosCommandType.RESUME_DELIVERY, () -> aapsOmnipodErosManager.setBasalProfile(profileFunction.getProfile(), false));
+ }
+ if (command instanceof CommandDeactivatePod) {
+ return executeCommand(OmnipodErosCommandType.DEACTIVATE_POD, aapsOmnipodErosManager::deactivatePod);
+ }
+ if (command instanceof CommandHandleTimeChange) {
+ return handleTimeChange(((CommandHandleTimeChange) command).isRequestedByUser());
+ }
+ if (command instanceof CommandUpdateAlertConfiguration) {
+ return updateAlertConfiguration();
+ }
+ if (command instanceof CommandPlayTestBeep) {
+ return executeCommand(OmnipodErosCommandType.PLAY_TEST_BEEP, () -> aapsOmnipodErosManager.playTestBeep(((CommandPlayTestBeep) command).getBeepType()));
}
- OmnipodCustomCommandType commandType = ((OmnipodCustomCommand) command).getType();
-
- aapsLogger.debug(LTag.PUMP, "Executing custom command: " + commandType);
-
- switch (commandType) {
- case ACKNOWLEDGE_ALERTS:
- return executeCommand(OmnipodCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodManager::acknowledgeAlerts);
- case GET_POD_STATUS:
- return getPodStatus();
- case READ_PULSE_LOG:
- return retrievePulseLog();
- case SUSPEND_DELIVERY:
- return executeCommand(OmnipodCommandType.SUSPEND_DELIVERY, aapsOmnipodManager::suspendDelivery);
- case RESUME_DELIVERY:
- return executeCommand(OmnipodCommandType.RESUME_DELIVERY, () -> aapsOmnipodManager.setBasalProfile(profileFunction.getProfile(), false));
- case DEACTIVATE_POD:
- return executeCommand(OmnipodCommandType.DEACTIVATE_POD, aapsOmnipodManager::deactivatePod);
- case HANDLE_TIME_CHANGE:
- return handleTimeChange(((CommandHandleTimeChange) command).isRequestedByUser());
- case UPDATE_ALERT_CONFIGURATION:
- return updateAlertConfiguration();
- case PLAY_TEST_BEEP:
- return executeCommand(OmnipodCommandType.PLAY_TEST_BEEP, () -> aapsOmnipodManager.playTestBeep(((CommandPlayTestBeep) command).getBeepType()));
- default:
- aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + commandType);
- return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, commandType));
- }
+ aapsLogger.warn(LTag.PUMP, "Unsupported custom command: " + command.getClass().getName());
+ return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_common_error_unsupported_custom_command, command.getClass().getName()));
}
private PumpEnactResult retrievePulseLog() {
PodInfoRecentPulseLog result;
try {
- result = executeCommand(OmnipodCommandType.READ_POD_PULSE_LOG, aapsOmnipodManager::readPulseLog);
+ result = executeCommand(OmnipodErosCommandType.READ_POD_PULSE_LOG, aapsOmnipodErosManager::readPulseLog);
} catch (Exception ex) {
- return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(aapsOmnipodManager.translateException(ex));
+ return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(aapsOmnipodErosManager.translateException(ex));
}
Intent i = new Intent(context, ErrorHelperActivity.class);
i.putExtra("soundid", 0);
- i.putExtra("status", resourceHelper.gs(R.string.omnipod_pulse_log_value) + ":\n" + result.toString());
- i.putExtra("title", resourceHelper.gs(R.string.omnipod_pulse_log));
+ i.putExtra("status", resourceHelper.gs(R.string.omnipod_eros_pod_management_pulse_log_value) + ":\n" + result.toString());
+ i.putExtra("title", resourceHelper.gs(R.string.omnipod_eros_pod_management_pulse_log));
i.putExtra("clipboardContent", result.toString());
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
@@ -897,7 +898,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) //
.build();
- PumpEnactResult result = executeCommand(OmnipodCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodManager.configureAlerts(alertConfigurations));
+ PumpEnactResult result = executeCommand(OmnipodErosCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodErosManager.configureAlerts(alertConfigurations));
if (result.success) {
aapsLogger.info(LTag.PUMP, "Successfully configured alerts in Pod");
@@ -907,7 +908,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
Notification notification = new Notification(
Notification.OMNIPOD_POD_ALERTS_UPDATED,
- resourceHelper.gs(R.string.omnipod_confirmation_expiration_alerts_updated),
+ resourceHelper.gs(R.string.omnipod_common_confirmation_expiration_alerts_updated),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
} else {
@@ -921,8 +922,8 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
aapsLogger.debug(LTag.PUMP, "Setting time, requestedByUser={}", requestedByUser);
PumpEnactResult result;
- if (requestedByUser || aapsOmnipodManager.isTimeChangeEventEnabled()) {
- result = executeCommand(OmnipodCommandType.SET_TIME, () -> aapsOmnipodManager.setTime(!requestedByUser));
+ if (requestedByUser || aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
+ result = executeCommand(OmnipodErosCommandType.SET_TIME, () -> aapsOmnipodErosManager.setTime(!requestedByUser));
} else {
// Even if automatically changing the time is disabled, we still want to at least do a GetStatus request,
// in order to update the Pod's activation time, which we need for calculating the time on the Pod
@@ -933,10 +934,10 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0;
- if (!requestedByUser && aapsOmnipodManager.isTimeChangeEventEnabled()) {
+ if (!requestedByUser && aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
- resourceHelper.gs(R.string.omnipod_confirmation_time_on_pod_updated),
+ resourceHelper.gs(R.string.omnipod_common_confirmation_time_on_pod_updated),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
@@ -946,10 +947,10 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
timeChangeRetries++;
if (timeChangeRetries > 3) {
- if (aapsOmnipodManager.isTimeChangeEventEnabled()) {
+ if (aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
- resourceHelper.gs(R.string.omnipod_error_automatic_time_or_timezone_change_failed),
+ resourceHelper.gs(R.string.omnipod_eros_error_automatic_time_or_timezone_change_failed),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
@@ -964,7 +965,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
- aapsLogger.info(LTag.PUMP, "Time, Date and/or TimeZone changed. [changeType=" + timeChangeType.name() + ", eventHandlingEnabled=" + aapsOmnipodManager.isTimeChangeEventEnabled() + "]");
+ aapsLogger.info(LTag.PUMP, "Time, Date and/or TimeZone changed. [changeType=" + timeChangeType.name() + ", eventHandlingEnabled=" + aapsOmnipodErosManager.isTimeChangeEventEnabled() + "]");
if (timeChangeType == TimeChangeType.TimeChanged) {
aapsLogger.info(LTag.PUMP, "Ignoring time change because it is not a DST or TZ change");
@@ -1062,11 +1063,11 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
public boolean isUseRileyLinkBatteryLevel() {
- return aapsOmnipodManager.isShowRileyLinkBatteryLevel();
+ return aapsOmnipodErosManager.isShowRileyLinkBatteryLevel();
}
public boolean isBatteryChangeLoggingEnabled() {
- return aapsOmnipodManager.isBatteryChangeLoggingEnabled();
+ return aapsOmnipodErosManager.isBatteryChangeLoggingEnabled();
}
private void initializeAfterRileyLinkConnection() {
@@ -1082,7 +1083,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
if (!success) {
aapsLogger.warn(LTag.PUMP, "Failed to retrieve Pod status on startup");
- rxBus.send(new EventNewNotification(new Notification(Notification.OMNIPOD_STARTUP_STATUS_REFRESH_FAILED, resourceHelper.gs(R.string.omnipod_error_failed_to_refresh_status_on_startup), Notification.NORMAL)));
+ rxBus.send(new EventNewNotification(new Notification(Notification.OMNIPOD_STARTUP_STATUS_REFRESH_FAILED, resourceHelper.gs(R.string.omnipod_common_error_failed_to_refresh_status_on_startup), Notification.NORMAL)));
}
} else {
aapsLogger.debug(LTag.PUMP, "Not retrieving Pod status on startup: no Pod running");
@@ -1092,11 +1093,11 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
@NonNull private PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
- PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BOLUS, () -> aapsOmnipodManager.bolus(detailedBolusInfo));
+ PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_BOLUS, () -> aapsOmnipodErosManager.bolus(detailedBolusInfo));
if (result.success) {
- incrementStatistics(detailedBolusInfo.isSMB ? OmnipodStorageKeys.Statistics.SMB_BOLUSES_DELIVERED
- : OmnipodStorageKeys.Statistics.STANDARD_BOLUSES_DELIVERED);
+ incrementStatistics(detailedBolusInfo.isSMB ? OmnipodErosStorageKeys.Statistics.SMB_BOLUSES_DELIVERED
+ : OmnipodErosStorageKeys.Statistics.STANDARD_BOLUSES_DELIVERED);
result.carbsDelivered(detailedBolusInfo.carbs);
}
@@ -1104,7 +1105,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return result;
}
- private T executeCommand(OmnipodCommandType commandType, Supplier supplier) {
+ private T executeCommand(OmnipodErosCommandType commandType, Supplier supplier) {
try {
aapsLogger.debug(LTag.PUMP, "Executing command: {}", commandType);
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt
index bea8298395..c4862ac968 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt
@@ -3,14 +3,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger
import dagger.Module
import dagger.Provides
import dagger.android.ContributesAndroidInjector
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsPodStateManager
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.PodHistoryActivity
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.PodManagementActivity
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.PodActivationWizardActivity
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.PodDeactivationWizardActivity
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.ErosPodHistoryActivity
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.ErosPodManagementActivity
@Module
@Suppress("unused")
@@ -18,8 +18,8 @@ abstract class OmnipodErosModule {
// Activities
@ContributesAndroidInjector
- abstract fun contributesPodManagementActivity(): PodManagementActivity
- @ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): PodHistoryActivity
+ abstract fun contributesPodManagementActivity(): ErosPodManagementActivity
+ @ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): ErosPodHistoryActivity
@ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
@@ -39,6 +39,6 @@ abstract class OmnipodErosModule {
companion object {
@Provides
- fun podStateManagerProvider(aapsPodStateManager: AapsPodStateManager): PodStateManager = aapsPodStateManager
+ fun podStateManagerProvider(aapsErosPodStateManager: AapsErosPodStateManager): PodStateManager = aapsErosPodStateManager
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodWizardModule.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodWizardModule.kt
index c69c769a7a..1525102ef2 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodWizardModule.kt
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodWizardModule.kt
@@ -7,18 +7,18 @@ import dagger.Module
import dagger.Provides
import dagger.android.ContributesAndroidInjector
import dagger.multibindings.IntoMap
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.AttachPodInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.FillPodInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.InitializePodActionFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.InsertCannulaActionFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.PodActivatedInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InitializePodActionViewModel
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.DeactivatePodActionFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.DeactivatePodInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.PodDeactivatedInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.PodDiscardedInfoFragment
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.AttachPodInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.FillPodInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.InitializePodActionFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.InsertCannulaActionFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.PodActivatedInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InitializePodActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.DeactivatePodActionFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.DeactivatePodInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.PodDeactivatedInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.PodDiscardedInfoFragment
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
import javax.inject.Provider
@Module
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java
index cf1df3e683..e6930775d2 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java
@@ -7,15 +7,15 @@ import javax.inject.Inject;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodCommandType;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
public class RLHistoryItemOmnipod extends RLHistoryItem {
@Inject ResourceHelper resourceHelper;
- private final OmnipodCommandType omnipodCommandType;
+ private final OmnipodErosCommandType omnipodCommandType;
- public RLHistoryItemOmnipod(HasAndroidInjector injector, OmnipodCommandType omnipodCommandType) {
+ public RLHistoryItemOmnipod(HasAndroidInjector injector, OmnipodErosCommandType omnipodCommandType) {
super(new LocalDateTime(), RLHistoryItemSource.OmnipodCommand, RileyLinkTargetDevice.Omnipod);
injector.androidInjector().inject(this);
this.omnipodCommandType = omnipodCommandType;
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodCommandType.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodCommandType.java
deleted file mode 100644
index c47306d057..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodCommandType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.definition;
-
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
-
-/**
- * Created by andy on 4.8.2019
- */
-public enum OmnipodCommandType {
- INITIALIZE_POD(R.string.omnipod_cmd_initialize_pod), // First step of Pod activation
- INSERT_CANNULA(R.string.omnipod_cmd_insert_cannula), // Second step of Pod activation
- DEACTIVATE_POD(R.string.omnipod_cmd_deactivate_pod), //
- SET_BASAL_PROFILE(R.string.omnipod_cmd_set_basal_schedule), //
- SET_BOLUS(R.string.omnipod_cmd_set_bolus), //
- CANCEL_BOLUS(R.string.omnipod_cmd_cancel_bolus), //
- SET_TEMPORARY_BASAL(R.string.omnipod_cmd_set_tbr), //
- CANCEL_TEMPORARY_BASAL(R.string.omnipod_cmd_cancel_tbr_by_driver), //
- DISCARD_POD(R.string.omnipod_cmd_discard_pod), //
- GET_POD_STATUS(R.string.omnipod_cmd_get_pod_status), //
- SET_TIME(R.string.omnipod_cmd_set_time), //
- CONFIGURE_ALERTS(R.string.omnipod_cmd_configure_alerts), //
- ACKNOWLEDGE_ALERTS(R.string.omnipod_cmd_acknowledge_alerts), //
- READ_POD_PULSE_LOG(R.string.omnipod_cmd_read_pulse_log), //
- SUSPEND_DELIVERY(R.string.omnipod_cmd_suspend_delivery),
- RESUME_DELIVERY(R.string.omnipod_cmd_resume_delivery),
- PLAY_TEST_BEEP(R.string.omnipod_cmd_play_test_beep);
-
- private final int resourceId;
-
- OmnipodCommandType(int resourceId) {
- this.resourceId = resourceId;
- }
-
- public int getResourceId() {
- return resourceId;
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosCommandType.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosCommandType.java
new file mode 100644
index 0000000000..c219fcbe6d
--- /dev/null
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosCommandType.java
@@ -0,0 +1,36 @@
+package info.nightscout.androidaps.plugins.pump.omnipod.eros.definition;
+
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
+
+/**
+ * Created by andy on 4.8.2019
+ */
+public enum OmnipodErosCommandType {
+ INITIALIZE_POD(R.string.omnipod_common_cmd_initialize_pod), // First step of Pod activation
+ INSERT_CANNULA(R.string.omnipod_common_cmd_insert_cannula), // Second step of Pod activation
+ DEACTIVATE_POD(R.string.omnipod_common_cmd_deactivate_pod), //
+ SET_BASAL_PROFILE(R.string.omnipod_common_cmd_set_basal_schedule), //
+ SET_BOLUS(R.string.omnipod_common_cmd_set_bolus), //
+ CANCEL_BOLUS(R.string.omnipod_common_cmd_cancel_bolus), //
+ SET_TEMPORARY_BASAL(R.string.omnipod_common_cmd_set_tbr), //
+ CANCEL_TEMPORARY_BASAL(R.string.omnipod_common_cmd_cancel_tbr_by_driver), //
+ DISCARD_POD(R.string.omnipod_common_cmd_discard_pod), //
+ GET_POD_STATUS(R.string.omnipod_common_cmd_get_pod_status), //
+ SET_TIME(R.string.omnipod_common_cmd_set_time), //
+ CONFIGURE_ALERTS(R.string.omnipod_common_cmd_configure_alerts), //
+ ACKNOWLEDGE_ALERTS(R.string.omnipod_common_cmd_acknowledge_alerts), //
+ READ_POD_PULSE_LOG(R.string.omnipod_common_cmd_read_pulse_log), //
+ SUSPEND_DELIVERY(R.string.omnipod_common_cmd_suspend_delivery),
+ RESUME_DELIVERY(R.string.omnipod_common_cmd_resume_delivery),
+ PLAY_TEST_BEEP(R.string.omnipod_common_cmd_play_test_beep);
+
+ private final int resourceId;
+
+ OmnipodErosCommandType(int resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public int getResourceId() {
+ return resourceId;
+ }
+}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodStorageKeys.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosStorageKeys.java
similarity index 59%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodStorageKeys.java
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosStorageKeys.java
index 861acff0ff..f889045406 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodStorageKeys.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/OmnipodErosStorageKeys.java
@@ -2,33 +2,33 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.definition;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
-public class OmnipodStorageKeys {
+public class OmnipodErosStorageKeys {
public static class Preferences {
- public static final int POD_STATE = R.string.key_omnipod_pod_state;
- public static final int ACTIVE_BOLUS = R.string.key_omnipod_current_bolus;
- public static final int BASAL_BEEPS_ENABLED = R.string.key_omnipod_basal_beeps_enabled;
- public static final int BOLUS_BEEPS_ENABLED = R.string.key_omnipod_bolus_beeps_enabled;
- public static final int SMB_BEEPS_ENABLED = R.string.key_omnipod_smb_beeps_enabled;
- public static final int TBR_BEEPS_ENABLED = R.string.key_omnipod_tbr_beeps_enabled;
- public static final int SUSPEND_DELIVERY_BUTTON_ENABLED = R.string.key_omnipod_suspend_delivery_button_enabled;
- public static final int PULSE_LOG_BUTTON_ENABLED = R.string.key_omnipod_pulse_log_button_enabled;
- public static final int TIME_CHANGE_EVENT_ENABLED = R.string.key_omnipod_time_change_event_enabled;
- public static final int EXPIRATION_REMINDER_ENABLED = R.string.key_omnipod_expiration_reminder_enabled;
- public static final int EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN = R.string.key_omnipod_expiration_reminder_hours_before_shutdown;
- public static final int LOW_RESERVOIR_ALERT_ENABLED = R.string.key_omnipod_low_reservoir_alert_enabled;
- public static final int LOW_RESERVOIR_ALERT_UNITS = R.string.key_omnipod_low_reservoir_alert_units;
- public static final int NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_tbr_sound_enabled;
- public static final int NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_smb_sound_enabled;
- public static final int NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_bolus_sound_enabled;
- public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_automatically_acknowledge_alerts_enabled;
- public static final int RILEY_LINK_STATS_BUTTON_ENABLED = R.string.key_omnipod_riley_link_stats_button_enabled;
+ public static final int POD_STATE = R.string.key_omnipod_eros_pod_state;
+ public static final int ACTIVE_BOLUS = R.string.key_omnipod_eros_current_bolus;
+ public static final int BASAL_BEEPS_ENABLED = R.string.key_omnipod_common_basal_beeps_enabled;
+ public static final int BOLUS_BEEPS_ENABLED = R.string.key_omnipod_common_bolus_beeps_enabled;
+ public static final int SMB_BEEPS_ENABLED = R.string.key_omnipod_common_smb_beeps_enabled;
+ public static final int TBR_BEEPS_ENABLED = R.string.key_omnipod_common_tbr_beeps_enabled;
+ public static final int SUSPEND_DELIVERY_BUTTON_ENABLED = R.string.key_omnipod_common_suspend_delivery_button_enabled;
+ public static final int PULSE_LOG_BUTTON_ENABLED = R.string.key_omnipod_eros_pulse_log_button_enabled;
+ public static final int TIME_CHANGE_EVENT_ENABLED = R.string.key_omnipod_common_time_change_event_enabled;
+ public static final int EXPIRATION_REMINDER_ENABLED = R.string.key_omnipod_common_expiration_reminder_enabled;
+ public static final int EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN = R.string.key_omnipod_common_expiration_reminder_hours_before_shutdown;
+ public static final int LOW_RESERVOIR_ALERT_ENABLED = R.string.key_omnipod_common_low_reservoir_alert_enabled;
+ public static final int LOW_RESERVOIR_ALERT_UNITS = R.string.key_omnipod_common_low_reservoir_alert_units;
+ public static final int NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_tbr_sound_enabled;
+ public static final int NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_smb_sound_enabled;
+ public static final int NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_bolus_sound_enabled;
+ public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_common_automatically_acknowledge_alerts_enabled;
+ public static final int RILEY_LINK_STATS_BUTTON_ENABLED = R.string.key_omnipod_eros_riley_link_stats_button_enabled;
public static final int SHOW_RILEY_LINK_BATTERY_LEVEL = R.string.key_riley_link_show_battery_level;
- public static final int BATTERY_CHANGE_LOGGING_ENABLED = R.string.key_omnipod_battery_change_logging_enabled;
+ public static final int BATTERY_CHANGE_LOGGING_ENABLED = R.string.key_omnipod_eros_battery_change_logging_enabled;
}
public static class Statistics {
- public static final int TBRS_SET = R.string.key_omnipod_tbrs_set;
- public static final int STANDARD_BOLUSES_DELIVERED = R.string.key_omnipod_std_boluses_delivered;
- public static final int SMB_BOLUSES_DELIVERED = R.string.key_omnipod_smb_boluses_delivered;
+ public static final int TBRS_SET = R.string.key_omnipod_eros_tbrs_set;
+ public static final int STANDARD_BOLUSES_DELIVERED = R.string.key_omnipod_eros_std_boluses_delivered;
+ public static final int SMB_BOLUSES_DELIVERED = R.string.key_omnipod_eros_smb_boluses_delivered;
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/PodHistoryEntryType.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/PodHistoryEntryType.java
index e4a61ec8c1..88869f249b 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/PodHistoryEntryType.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/definition/PodHistoryEntryType.java
@@ -13,35 +13,35 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
*/
public enum PodHistoryEntryType {
- INITIALIZE_POD(1, R.string.omnipod_cmd_initialize_pod, PumpHistoryEntryGroup.Prime),
- INSERT_CANNULA(2, R.string.omnipod_cmd_insert_cannula, PumpHistoryEntryGroup.Prime),
- DEACTIVATE_POD(3, R.string.omnipod_cmd_deactivate_pod, PumpHistoryEntryGroup.Prime),
- DISCARD_POD(4, R.string.omnipod_cmd_discard_pod, PumpHistoryEntryGroup.Prime),
+ INITIALIZE_POD(1, R.string.omnipod_common_cmd_initialize_pod, PumpHistoryEntryGroup.Prime),
+ INSERT_CANNULA(2, R.string.omnipod_common_cmd_insert_cannula, PumpHistoryEntryGroup.Prime),
+ DEACTIVATE_POD(3, R.string.omnipod_common_cmd_deactivate_pod, PumpHistoryEntryGroup.Prime),
+ DISCARD_POD(4, R.string.omnipod_common_cmd_discard_pod, PumpHistoryEntryGroup.Prime),
- SET_TEMPORARY_BASAL(10, R.string.omnipod_cmd_set_tbr, PumpHistoryEntryGroup.Basal),
- CANCEL_TEMPORARY_BASAL_BY_DRIVER(11, R.string.omnipod_cmd_cancel_tbr_by_driver, PumpHistoryEntryGroup.Basal),
- CANCEL_TEMPORARY_BASAL(12, R.string.omnipod_cmd_cancel_tbr, PumpHistoryEntryGroup.Basal),
- SET_FAKE_SUSPENDED_TEMPORARY_BASAL(13, R.string.omnipod_cmd_set_fake_suspended_tbr, PumpHistoryEntryGroup.Basal),
- CANCEL_FAKE_SUSPENDED_TEMPORARY_BASAL(14, R.string.omnipod_cmd_cancel_fake_suspended_tbr, PumpHistoryEntryGroup.Basal),
- SPLIT_TEMPORARY_BASAL(15, R.string.omnipod_cmd_split_tbr, PumpHistoryEntryGroup.Basal),
+ SET_TEMPORARY_BASAL(10, R.string.omnipod_common_cmd_set_tbr, PumpHistoryEntryGroup.Basal),
+ CANCEL_TEMPORARY_BASAL_BY_DRIVER(11, R.string.omnipod_common_cmd_cancel_tbr_by_driver, PumpHistoryEntryGroup.Basal),
+ CANCEL_TEMPORARY_BASAL(12, R.string.omnipod_common_cmd_cancel_tbr, PumpHistoryEntryGroup.Basal),
+ SET_FAKE_SUSPENDED_TEMPORARY_BASAL(13, R.string.omnipod_common_cmd_set_fake_suspended_tbr, PumpHistoryEntryGroup.Basal),
+ CANCEL_FAKE_SUSPENDED_TEMPORARY_BASAL(14, R.string.omnipod_common_cmd_cancel_fake_suspended_tbr, PumpHistoryEntryGroup.Basal),
+ SPLIT_TEMPORARY_BASAL(15, R.string.omnipod_common_cmd_split_tbr, PumpHistoryEntryGroup.Basal),
- SET_BASAL_SCHEDULE(20, R.string.omnipod_cmd_set_basal_schedule, PumpHistoryEntryGroup.Basal),
+ SET_BASAL_SCHEDULE(20, R.string.omnipod_common_cmd_set_basal_schedule, PumpHistoryEntryGroup.Basal),
- GET_POD_STATUS(30, R.string.omnipod_cmd_get_pod_status, PumpHistoryEntryGroup.Configuration),
- GET_POD_INFO(31, R.string.omnipod_cmd_get_pod_info, PumpHistoryEntryGroup.Configuration),
- SET_TIME(32, R.string.omnipod_cmd_set_time, PumpHistoryEntryGroup.Configuration),
+ GET_POD_STATUS(30, R.string.omnipod_common_cmd_get_pod_status, PumpHistoryEntryGroup.Configuration),
+ GET_POD_INFO(31, R.string.omnipod_common_cmd_get_pod_info, PumpHistoryEntryGroup.Configuration),
+ SET_TIME(32, R.string.omnipod_common_cmd_set_time, PumpHistoryEntryGroup.Configuration),
- SET_BOLUS(40, R.string.omnipod_cmd_set_bolus, PumpHistoryEntryGroup.Bolus),
- CANCEL_BOLUS(41, R.string.omnipod_cmd_cancel_bolus, PumpHistoryEntryGroup.Bolus),
+ SET_BOLUS(40, R.string.omnipod_common_cmd_set_bolus, PumpHistoryEntryGroup.Bolus),
+ CANCEL_BOLUS(41, R.string.omnipod_common_cmd_cancel_bolus, PumpHistoryEntryGroup.Bolus),
- CONFIGURE_ALERTS(50, R.string.omnipod_cmd_configure_alerts, PumpHistoryEntryGroup.Alarm),
- ACKNOWLEDGE_ALERTS(51, R.string.omnipod_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm),
- PLAY_TEST_BEEP(52, R.string.omnipod_cmd_play_test_beep, PumpHistoryEntryGroup.Alarm),
+ CONFIGURE_ALERTS(50, R.string.omnipod_common_cmd_configure_alerts, PumpHistoryEntryGroup.Alarm),
+ ACKNOWLEDGE_ALERTS(51, R.string.omnipod_common_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm),
+ PLAY_TEST_BEEP(52, R.string.omnipod_common_cmd_play_test_beep, PumpHistoryEntryGroup.Alarm),
- SUSPEND_DELIVERY(60, R.string.omnipod_cmd_suspend_delivery, PumpHistoryEntryGroup.Basal),
- RESUME_DELIVERY(61, R.string.omnipod_cmd_resume_delivery, PumpHistoryEntryGroup.Basal),
+ SUSPEND_DELIVERY(60, R.string.omnipod_common_cmd_suspend_delivery, PumpHistoryEntryGroup.Basal),
+ RESUME_DELIVERY(61, R.string.omnipod_common_cmd_resume_delivery, PumpHistoryEntryGroup.Basal),
- UNKNOWN_ENTRY_TYPE(99, R.string.omnipod_cmd_unknown_entry);
+ UNKNOWN_ENTRY_TYPE(99, R.string.omnipod_common_cmd_unknown_entry);
private final int code;
private static final Map instanceMap;
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManager.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java
similarity index 85%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManager.java
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java
index ecbf9a8d42..3959c08194 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManager.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java
@@ -7,7 +7,7 @@ import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodStorageKeys;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodFaultEventChanged;
@@ -16,12 +16,12 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodUn
import info.nightscout.androidaps.utils.sharedPreferences.SP;
@Singleton
-public class AapsPodStateManager extends PodStateManager {
+public class AapsErosPodStateManager extends PodStateManager {
private final SP sp;
private final RxBusWrapper rxBus;
@Inject
- public AapsPodStateManager(AAPSLogger aapsLogger, SP sp, RxBusWrapper rxBus) {
+ public AapsErosPodStateManager(AAPSLogger aapsLogger, SP sp, RxBusWrapper rxBus) {
super(aapsLogger);
this.sp = sp;
this.rxBus = rxBus;
@@ -29,12 +29,12 @@ public class AapsPodStateManager extends PodStateManager {
@Override
protected String readPodState() {
- return sp.getString(OmnipodStorageKeys.Preferences.POD_STATE, "");
+ return sp.getString(OmnipodErosStorageKeys.Preferences.POD_STATE, "");
}
@Override
protected void storePodState(String podState) {
- sp.putString(OmnipodStorageKeys.Preferences.POD_STATE, podState);
+ sp.putString(OmnipodErosStorageKeys.Preferences.POD_STATE, podState);
}
@Override protected void onUncertainTbrRecovered() {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodManager.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java
similarity index 86%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodManager.java
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java
index d4a76b8bae..bbaf51ec95 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodManager.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java
@@ -43,8 +43,8 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.ActiveBolus;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodCommandType;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodStorageKeys;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistoryEntryType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
@@ -93,7 +93,7 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
import io.reactivex.subjects.SingleSubject;
@Singleton
-public class AapsOmnipodManager {
+public class AapsOmnipodErosManager {
private final PodStateManager podStateManager;
private final AapsOmnipodUtil aapsOmnipodUtil;
@@ -127,21 +127,21 @@ public class AapsOmnipodManager {
private boolean batteryChangeLoggingEnabled;
@Inject
- public AapsOmnipodManager(OmnipodRileyLinkCommunicationManager communicationService,
- PodStateManager podStateManager,
- AapsOmnipodUtil aapsOmnipodUtil,
- AAPSLogger aapsLogger,
- AapsSchedulers aapsSchedulers,
- RxBusWrapper rxBus,
- SP sp,
- ResourceHelper resourceHelper,
- HasAndroidInjector injector,
- ActivePluginProvider activePlugin,
- DatabaseHelperInterface databaseHelper,
- OmnipodAlertUtil omnipodAlertUtil,
- NSUpload nsUpload,
- ProfileFunction profileFunction,
- Context context) {
+ public AapsOmnipodErosManager(OmnipodRileyLinkCommunicationManager communicationService,
+ PodStateManager podStateManager,
+ AapsOmnipodUtil aapsOmnipodUtil,
+ AAPSLogger aapsLogger,
+ AapsSchedulers aapsSchedulers,
+ RxBusWrapper rxBus,
+ SP sp,
+ ResourceHelper resourceHelper,
+ HasAndroidInjector injector,
+ ActivePluginProvider activePlugin,
+ DatabaseHelperInterface databaseHelper,
+ OmnipodAlertUtil omnipodAlertUtil,
+ NSUpload nsUpload,
+ ProfileFunction profileFunction,
+ Context context) {
this.podStateManager = podStateManager;
this.aapsOmnipodUtil = aapsOmnipodUtil;
@@ -164,20 +164,20 @@ public class AapsOmnipodManager {
}
public void reloadSettings() {
- basalBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BASAL_BEEPS_ENABLED, true);
- bolusBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BOLUS_BEEPS_ENABLED, true);
- smbBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SMB_BEEPS_ENABLED, true);
- tbrBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED, false);
- suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false);
- pulseLogButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false);
- rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED, false);
- showRileyLinkBatteryLevel = sp.getBoolean(OmnipodStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL, false);
- batteryChangeLoggingEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED, false);
- timeChangeEventEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true);
- notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, false);
- notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true);
- notificationUncertainBolusSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED, true);
- automaticallyAcknowledgeAlertsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED, false);
+ basalBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BASAL_BEEPS_ENABLED, true);
+ bolusBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BOLUS_BEEPS_ENABLED, true);
+ smbBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SMB_BEEPS_ENABLED, true);
+ tbrBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.TBR_BEEPS_ENABLED, false);
+ suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false);
+ pulseLogButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false);
+ rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED, false);
+ showRileyLinkBatteryLevel = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL, false);
+ batteryChangeLoggingEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED, false);
+ timeChangeEventEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true);
+ notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, false);
+ notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true);
+ notificationUncertainBolusSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED, true);
+ automaticallyAcknowledgeAlertsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED, false);
}
public PumpEnactResult initializePod() {
@@ -189,7 +189,7 @@ public class AapsOmnipodManager {
result.success(res).enacted(res);
if (!res) {
- result.comment(R.string.omnipod_error_failed_to_initialize_pod);
+ result.comment(R.string.omnipod_common_error_failed_to_initialize_pod);
}
} catch (Exception ex) {
result.success(false).enacted(false).comment(translateException(ex));
@@ -202,7 +202,7 @@ public class AapsOmnipodManager {
public PumpEnactResult insertCannula(Profile profile) {
if (profile == null) {
- String comment = getStringResource(R.string.omnipod_error_set_initial_basal_schedule_no_profile);
+ String comment = getStringResource(R.string.omnipod_common_error_set_initial_basal_schedule_no_profile);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
}
@@ -216,7 +216,7 @@ public class AapsOmnipodManager {
result.success(res).enacted(res);
if (!res) {
- result.comment(R.string.omnipod_error_failed_to_insert_cannula);
+ result.comment(R.string.omnipod_common_error_failed_to_insert_cannula);
}
} catch (Exception ex) {
result.success(false).enacted(false).comment(translateException(ex));
@@ -298,7 +298,7 @@ public class AapsOmnipodManager {
public PumpEnactResult setBasalProfile(Profile profile, boolean showNotifications) {
if (profile == null) {
- String note = getStringResource(R.string.omnipod_error_failed_to_set_profile_empty_profile);
+ String note = getStringResource(R.string.omnipod_common_error_failed_to_set_profile_empty_profile);
if (showNotifications) {
showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
}
@@ -313,14 +313,14 @@ public class AapsOmnipodManager {
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists();
if (showNotifications) {
- showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_basal_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
+ showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_eros_error_set_basal_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (PrecedingCommandFailedUncertainlyException ex) {
if (showNotifications) {
- showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_basal_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
+ showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_eros_error_set_basal_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage);
@@ -329,9 +329,9 @@ public class AapsOmnipodManager {
if (showNotifications) {
String note;
if (OmnipodManager.isCertainFailure(ex)) {
- note = getStringResource(R.string.omnipod_error_set_basal_failed);
+ note = getStringResource(R.string.omnipod_common_error_set_basal_failed);
} else {
- note = getStringResource(R.string.omnipod_error_set_basal_might_have_failed_delivery_might_be_suspended);
+ note = getStringResource(R.string.omnipod_eros_error_set_basal_might_have_failed_delivery_might_be_suspended);
}
showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
}
@@ -367,7 +367,7 @@ public class AapsOmnipodManager {
dismissNotification(Notification.OMNIPOD_POD_FAULT);
sendEvent(new EventOmnipodPumpValuesChanged());
- sendEvent(new EventRefreshOverview("Omnipod command: " + OmnipodCommandType.DISCARD_POD, false));
+ sendEvent(new EventRefreshOverview("Omnipod command: " + OmnipodErosCommandType.DISCARD_POD, false));
return new PumpEnactResult(injector).success(true).enacted(true);
}
@@ -379,7 +379,7 @@ public class AapsOmnipodManager {
Date bolusStarted;
try {
- bolusCommandResult = executeCommand(() -> delegate.bolus(PumpType.Insulet_Omnipod.determineCorrectBolusSize(detailedBolusInfo.insulin), beepsEnabled, beepsEnabled, detailedBolusInfo.isSMB ? null :
+ bolusCommandResult = executeCommand(() -> delegate.bolus(PumpType.Omnipod_Eros.determineCorrectBolusSize(detailedBolusInfo.insulin), beepsEnabled, beepsEnabled, detailedBolusInfo.isSMB ? null :
(estimatedUnitsDelivered, percentage) -> {
EventOverviewBolusProgress progressUpdateEvent = EventOverviewBolusProgress.INSTANCE;
progressUpdateEvent.setStatus(getStringResource(R.string.bolusdelivering, detailedBolusInfo.insulin));
@@ -397,9 +397,9 @@ public class AapsOmnipodManager {
if (OmnipodManager.CommandDeliveryStatus.UNCERTAIN_FAILURE.equals(bolusCommandResult.getCommandDeliveryStatus())) {
// For safety reasons, we treat this as a bolus that has successfully been delivered, in order to prevent insulin overdose
if (detailedBolusInfo.isSMB) {
- showNotification(Notification.OMNIPOD_UNCERTAIN_SMB, getStringResource(R.string.omnipod_error_bolus_failed_uncertain_smb, detailedBolusInfo.insulin), Notification.URGENT, isNotificationUncertainSmbSoundEnabled() ? R.raw.boluserror : null);
+ showNotification(Notification.OMNIPOD_UNCERTAIN_SMB, getStringResource(R.string.omnipod_eros_error_bolus_failed_uncertain_smb, detailedBolusInfo.insulin), Notification.URGENT, isNotificationUncertainSmbSoundEnabled() ? R.raw.boluserror : null);
} else {
- showErrorDialog(getStringResource(R.string.omnipod_error_bolus_failed_uncertain), isNotificationUncertainBolusSoundEnabled() ? R.raw.boluserror : null);
+ showErrorDialog(getStringResource(R.string.omnipod_eros_error_bolus_failed_uncertain), isNotificationUncertainBolusSoundEnabled() ? R.raw.boluserror : null);
}
}
@@ -425,7 +425,7 @@ public class AapsOmnipodManager {
// I discussed this with the AAPS team but nobody seems to care so we're stuck with this ugly workaround for now
try {
ActiveBolus activeBolus = ActiveBolus.fromDetailedBolusInfo(detailedBolusInfo);
- sp.putString(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS, aapsOmnipodUtil.getGsonInstance().toJson(activeBolus));
+ sp.putString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, aapsOmnipodUtil.getGsonInstance().toJson(activeBolus));
aapsLogger.debug(LTag.PUMP, "Stored active bolus to SP for recovery");
} catch (Exception ex) {
aapsLogger.error(LTag.PUMP, "Failed to store active bolus to SP", ex);
@@ -444,7 +444,7 @@ public class AapsOmnipodManager {
addBolusToHistory(detailedBolusInfo);
- sp.remove(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS);
+ sp.remove(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS);
return new PumpEnactResult(injector).success(true).enacted(true).carbsDelivered(detailedBolusInfo.carbs).bolusDelivered(detailedBolusInfo.insulin);
}
@@ -459,7 +459,7 @@ public class AapsOmnipodManager {
aapsLogger.debug(LTag.PUMP, "Bolus command successfully executed. Proceeding bolus cancellation");
} else {
aapsLogger.debug(LTag.PUMP, "Not cancelling bolus: bolus command failed");
- String comment = getStringResource(R.string.omnipod_error_bolus_did_not_succeed);
+ String comment = getStringResource(R.string.omnipod_common_error_bolus_did_not_succeed);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.CANCEL_BOLUS, comment);
return new PumpEnactResult(injector).success(true).enacted(false).comment(comment);
}
@@ -491,7 +491,7 @@ public class AapsOmnipodManager {
public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) {
boolean beepsEnabled = isTbrBeepsEnabled();
try {
- executeCommand(() -> delegate.setTemporaryBasal(PumpType.Insulet_Omnipod.determineCorrectBasalSize(tempBasalPair.getInsulinRate()), Duration.standardMinutes(tempBasalPair.getDurationMinutes()), beepsEnabled, beepsEnabled));
+ executeCommand(() -> delegate.setTemporaryBasal(PumpType.Omnipod_Eros.determineCorrectBasalSize(tempBasalPair.getInsulinRate()), Duration.standardMinutes(tempBasalPair.getDurationMinutes()), beepsEnabled, beepsEnabled));
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
@@ -500,7 +500,7 @@ public class AapsOmnipodManager {
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
- showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_might_be_cancelled), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
+ showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_eros_error_set_temp_basal_failed_old_tbr_might_be_cancelled), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
splitActiveTbr(); // Split any active TBR so when we recover from the uncertain TBR status,we only cancel the part after the cancellation
@@ -510,7 +510,7 @@ public class AapsOmnipodManager {
long pumpId = addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
if (!OmnipodManager.isCertainFailure(ex)) {
- showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
+ showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_eros_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
// Assume that setting the temp basal succeeded here, because in case it didn't succeed,
// The next StatusResponse that we receive will allow us to recover from the wrong state
@@ -533,7 +533,7 @@ public class AapsOmnipodManager {
return new PumpEnactResult(injector)
.duration(tempBasalPair.getDurationMinutes())
- .absolute(PumpType.Insulet_Omnipod.determineCorrectBasalSize(tempBasalPair.getInsulinRate()))
+ .absolute(PumpType.Omnipod_Eros.determineCorrectBasalSize(tempBasalPair.getInsulinRate()))
.success(true).enacted(true);
}
@@ -542,7 +542,7 @@ public class AapsOmnipodManager {
executeCommand(() -> delegate.cancelTemporaryBasal(isTbrBeepsEnabled()));
} catch (Exception ex) {
if (OmnipodManager.isCertainFailure(ex)) {
- showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_error_cancel_temp_basal_failed_uncertain), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
+ showNotification(Notification.OMNIPOD_TBR_ALERTS, getStringResource(R.string.omnipod_eros_error_cancel_temp_basal_failed_uncertain), Notification.URGENT, isNotificationUncertainTbrSoundEnabled() ? R.raw.boluserror : null);
} else {
splitActiveTbr(); // Split any active TBR so when we recover from the uncertain TBR status,we only cancel the part after the cancellation
}
@@ -604,21 +604,21 @@ public class AapsOmnipodManager {
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists();
if (showNotifications) {
- showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_time_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
+ showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_eros_error_set_time_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (PrecedingCommandFailedUncertainlyException ex) {
if (showNotifications) {
- showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_time_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
+ showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_eros_error_set_time_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (Exception ex) {
if (showNotifications) {
- showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_time_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
+ showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_eros_error_set_time_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
@@ -899,56 +899,56 @@ public class AapsOmnipodManager {
String comment;
if (ex instanceof CrcMismatchException) {
- comment = getStringResource(R.string.omnipod_error_crc_mismatch);
+ comment = getStringResource(R.string.omnipod_eros_error_crc_mismatch);
} else if (ex instanceof IllegalPacketTypeException) {
- comment = getStringResource(R.string.omnipod_error_invalid_packet_type);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_packet_type);
} else if (ex instanceof IllegalPodProgressException || ex instanceof IllegalActivationProgressException ||
ex instanceof IllegalDeliveryStatusException) {
- comment = getStringResource(R.string.omnipod_error_invalid_progress_state);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_progress_state);
} else if (ex instanceof PodProgressStatusVerificationFailedException) {
- comment = getStringResource(R.string.omnipod_error_failed_to_verify_activation_progress);
+ comment = getStringResource(R.string.omnipod_common_error_failed_to_verify_activation_progress);
} else if (ex instanceof IllegalVersionResponseTypeException) {
- comment = getStringResource(R.string.omnipod_error_invalid_response);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_response);
} else if (ex instanceof IllegalResponseException) {
- comment = getStringResource(R.string.omnipod_error_invalid_response);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_response);
} else if (ex instanceof IllegalMessageSequenceNumberException) {
- comment = getStringResource(R.string.omnipod_error_invalid_message_sequence_number);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_message_sequence_number);
} else if (ex instanceof IllegalMessageAddressException) {
- comment = getStringResource(R.string.omnipod_error_invalid_message_address);
+ comment = getStringResource(R.string.omnipod_eros_error_invalid_message_address);
} else if (ex instanceof MessageDecodingException) {
- comment = getStringResource(R.string.omnipod_error_message_decoding_failed);
+ comment = getStringResource(R.string.omnipod_eros_error_message_decoding_failed);
} else if (ex instanceof NonceOutOfSyncException) {
- comment = getStringResource(R.string.omnipod_error_nonce_out_of_sync);
+ comment = getStringResource(R.string.omnipod_eros_error_nonce_out_of_sync);
} else if (ex instanceof NonceResyncException) {
- comment = getStringResource(R.string.omnipod_error_nonce_resync_failed);
+ comment = getStringResource(R.string.omnipod_eros_error_nonce_resync_failed);
} else if (ex instanceof NotEnoughDataException) {
- comment = getStringResource(R.string.omnipod_error_not_enough_data);
+ comment = getStringResource(R.string.omnipod_eros_error_not_enough_data);
} else if (ex instanceof PodFaultException) {
FaultEventCode faultEventCode = ((PodFaultException) ex).getDetailedStatus().getFaultEventCode();
comment = createPodFaultErrorMessage(faultEventCode);
} else if (ex instanceof ActivationTimeExceededException) {
- comment = getStringResource(R.string.omnipod_error_pod_fault_activation_time_exceeded);
+ comment = getStringResource(R.string.omnipod_common_error_pod_fault_activation_time_exceeded);
} else if (ex instanceof PodReturnedErrorResponseException) {
- comment = getStringResource(R.string.omnipod_error_pod_returned_error_response);
+ comment = getStringResource(R.string.omnipod_eros_error_pod_returned_error_response);
} else if (ex instanceof RileyLinkUnreachableException) {
- comment = getStringResource(R.string.omnipod_error_communication_failed_no_response_from_riley_link);
+ comment = getStringResource(R.string.omnipod_eros_error_communication_failed_no_response_from_riley_link);
} else if (ex instanceof RileyLinkInterruptedException) {
- comment = getStringResource(R.string.omnipod_error_communication_failed_riley_link_interrupted);
+ comment = getStringResource(R.string.omnipod_eros_error_communication_failed_riley_link_interrupted);
} else if (ex instanceof RileyLinkTimeoutException) {
- comment = getStringResource(R.string.omnipod_error_communication_failed_no_response_from_pod);
+ comment = getStringResource(R.string.omnipod_eros_error_communication_failed_no_response_from_pod);
} else if (ex instanceof RileyLinkUnexpectedException) {
Throwable cause = ex.getCause();
- comment = getStringResource(R.string.omnipod_error_unexpected_exception, cause.getClass().getName(), cause.getMessage());
+ comment = getStringResource(R.string.omnipod_common_error_unexpected_exception, cause.getClass().getName(), cause.getMessage());
} else {
// Shouldn't be reachable
- comment = getStringResource(R.string.omnipod_error_unexpected_exception, ex.getClass().getName(), ex.getMessage());
+ comment = getStringResource(R.string.omnipod_common_error_unexpected_exception, ex.getClass().getName(), ex.getMessage());
}
return comment;
}
private String createPodFaultErrorMessage(FaultEventCode faultEventCode) {
- return getStringResource(R.string.omnipod_error_pod_fault,
+ return getStringResource(R.string.omnipod_eros_error_pod_fault,
ByteUtil.convertUnsignedByteToInt(faultEventCode.getValue()), faultEventCode.name());
}
@@ -1002,7 +1002,7 @@ public class AapsOmnipodManager {
}
List entries = new ArrayList<>();
for (Profile.ProfileValue basalValue : basalValues) {
- entries.add(new BasalScheduleEntry(PumpType.Insulet_Omnipod.determineCorrectBasalSize(basalValue.value),
+ entries.add(new BasalScheduleEntry(PumpType.Omnipod_Eros.determineCorrectBasalSize(basalValue.value),
Duration.standardSeconds(basalValue.timeAsSeconds)));
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandAcknowledgeAlerts.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandAcknowledgeAlerts.java
deleted file mode 100644
index ce181a7912..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandAcknowledgeAlerts.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandAcknowledgeAlerts extends OmnipodCustomCommand {
- public CommandAcknowledgeAlerts() {
- super(OmnipodCustomCommandType.ACKNOWLEDGE_ALERTS);
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandDeactivatePod.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandDeactivatePod.java
deleted file mode 100644
index 0d099c4481..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandDeactivatePod.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandDeactivatePod extends OmnipodCustomCommand {
- public CommandDeactivatePod() {
- super(OmnipodCustomCommandType.DEACTIVATE_POD);
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java
index 85ee7b6fd4..3df5898ff9 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java
@@ -1,7 +1,11 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-public final class CommandGetPodStatus extends OmnipodCustomCommand {
- public CommandGetPodStatus() {
- super(OmnipodCustomCommandType.GET_POD_STATUS);
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandGetPodStatus implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "GET POD STATUS";
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandHandleTimeChange.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandHandleTimeChange.java
deleted file mode 100644
index d55cb11249..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandHandleTimeChange.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandHandleTimeChange extends OmnipodCustomCommand {
- private final boolean requestedByUser;
-
- public CommandHandleTimeChange(boolean requestedByUser) {
- super(OmnipodCustomCommandType.HANDLE_TIME_CHANGE);
- this.requestedByUser = requestedByUser;
- }
-
- public boolean isRequestedByUser() {
- return requestedByUser;
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandPlayTestBeep.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandPlayTestBeep.java
deleted file mode 100644
index f06dc0cda1..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandPlayTestBeep.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
-
-public class CommandPlayTestBeep extends OmnipodCustomCommand {
- private final BeepConfigType beepType;
-
- public CommandPlayTestBeep(BeepConfigType beepType) {
- super(OmnipodCustomCommandType.PLAY_TEST_BEEP);
- this.beepType = beepType;
- }
-
- public BeepConfigType getBeepType() {
- return beepType;
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java
index d3317651ca..507abd12ca 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java
@@ -1,7 +1,11 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-public final class CommandReadPulseLog extends OmnipodCustomCommand {
- public CommandReadPulseLog() {
- super(OmnipodCustomCommandType.READ_PULSE_LOG);
+import org.jetbrains.annotations.NotNull;
+
+import info.nightscout.androidaps.queue.commands.CustomCommand;
+
+public final class CommandReadPulseLog implements CustomCommand {
+ @NotNull @Override public String getStatusDescription() {
+ return "READ PULSE LOG";
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandResumeDelivery.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandResumeDelivery.java
deleted file mode 100644
index 9398330ab2..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandResumeDelivery.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandResumeDelivery extends OmnipodCustomCommand {
- public CommandResumeDelivery() {
- super(OmnipodCustomCommandType.RESUME_DELIVERY);
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandSuspendDelivery.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandSuspendDelivery.java
deleted file mode 100644
index e3883b9105..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandSuspendDelivery.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandSuspendDelivery extends OmnipodCustomCommand {
- public CommandSuspendDelivery() {
- super(OmnipodCustomCommandType.SUSPEND_DELIVERY);
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandUpdateAlertConfiguration.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandUpdateAlertConfiguration.java
deleted file mode 100644
index 5dc5d00f7f..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandUpdateAlertConfiguration.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public final class CommandUpdateAlertConfiguration extends OmnipodCustomCommand {
- public CommandUpdateAlertConfiguration() {
- super(OmnipodCustomCommandType.UPDATE_ALERT_CONFIGURATION);
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommand.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommand.java
deleted file mode 100644
index 9ddc4c1bd0..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommand.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-import androidx.annotation.NonNull;
-
-import info.nightscout.androidaps.queue.commands.CustomCommand;
-
-public abstract class OmnipodCustomCommand implements CustomCommand {
- private final OmnipodCustomCommandType type;
-
- OmnipodCustomCommand(@NonNull OmnipodCustomCommandType type) {
- this.type = type;
- }
-
- public final OmnipodCustomCommandType getType() {
- return type;
- }
-
- @Override public final String getStatusDescription() {
- return type.getDescription();
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommandType.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommandType.java
deleted file mode 100644
index 6a20ea2580..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/OmnipodCustomCommandType.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
-
-public enum OmnipodCustomCommandType {
- ACKNOWLEDGE_ALERTS("ACKNOWLEDGE ALERTS"),
- GET_POD_STATUS("GET POD STATUS"),
- READ_PULSE_LOG("READ PULSE LOG"),
- SUSPEND_DELIVERY("SUSPEND DELIVERY"),
- RESUME_DELIVERY("RESUME DELIVERY"),
- DEACTIVATE_POD("DEACTIVATE POD"),
- HANDLE_TIME_CHANGE("HANDLE TIME CHANGE"),
- UPDATE_ALERT_CONFIGURATION("UPDATE ALERT CONFIGURATION"),
- PLAY_TEST_BEEP("PLAY TEST BEEP");
-
- private final String description;
-
- OmnipodCustomCommandType(String description) {
- this.description = description;
- }
-
- String getDescription() {
- return description;
- }
-}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java
index 9f6417ffdd..89524f0129 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java
@@ -21,7 +21,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
@@ -38,7 +38,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
@Inject AapsOmnipodUtil aapsOmnipodUtil;
@Inject PodStateManager podStateManager;
@Inject DatabaseHelperInterface databaseHelper;
- @Inject AapsOmnipodManager aapsOmnipodManager;
+ @Inject AapsOmnipodErosManager aapsOmnipodErosManager;
@Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager;
private final IBinder mBinder = new LocalBinder();
@@ -118,11 +118,11 @@ public class RileyLinkOmnipodService extends RileyLinkService {
if (StringUtils.isEmpty(rileyLinkAddress)) {
aapsLogger.debug(LTag.PUMPBTCOMM, "RileyLink address invalid: no address");
- errorDescription = resourceHelper.gs(R.string.omnipod_error_rileylink_address_invalid);
+ errorDescription = resourceHelper.gs(R.string.omnipod_eros_error_riley_link_address_invalid);
return false;
} else {
if (!rileyLinkAddress.matches(REGEX_MAC)) {
- errorDescription = resourceHelper.gs(R.string.omnipod_error_rileylink_address_invalid);
+ errorDescription = resourceHelper.gs(R.string.omnipod_eros_error_riley_link_address_invalid);
aapsLogger.debug(LTag.PUMPBTCOMM, "RileyLink address invalid: {}", rileyLinkAddress);
} else {
if (!rileyLinkAddress.equals(this.rileyLinkAddress)) {
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodHistoryActivity.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java
similarity index 96%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodHistoryActivity.java
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java
index 0cd1cb817b..a9019b0689 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodHistoryActivity.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java
@@ -38,7 +38,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistor
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
-public class PodHistoryActivity extends NoSplashAppCompatActivity {
+public class ErosPodHistoryActivity extends NoSplashAppCompatActivity {
@Inject AAPSLogger aapsLogger;
@Inject AapsOmnipodUtil aapsOmnipodUtil;
@@ -60,7 +60,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
private List typeListFull;
- public PodHistoryActivity() {
+ public ErosPodHistoryActivity() {
super();
}
@@ -251,7 +251,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_TEMPORARY_BASAL:
case SPLIT_TEMPORARY_BASAL: {
TempBasalPair tempBasalPair = aapsOmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), TempBasalPair.class);
- valueView.setText(resourceHelper.gs(R.string.omnipod_history_tbr_value, tempBasalPair.getInsulinRate(), tempBasalPair.getDurationMinutes()));
+ valueView.setText(resourceHelper.gs(R.string.omnipod_eros_history_tbr_value, tempBasalPair.getInsulinRate(), tempBasalPair.getDurationMinutes()));
}
break;
@@ -266,9 +266,9 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_BOLUS: {
if (historyEntry.getData().contains(";")) {
String[] splitVal = historyEntry.getData().split(";");
- valueView.setText(resourceHelper.gs(R.string.omnipod_history_bolus_value_with_carbs, Double.valueOf(splitVal[0]), Double.valueOf(splitVal[1])));
+ valueView.setText(resourceHelper.gs(R.string.omnipod_eros_history_bolus_value_with_carbs, Double.valueOf(splitVal[0]), Double.valueOf(splitVal[1])));
} else {
- valueView.setText(resourceHelper.gs(R.string.omnipod_history_bolus_value, Double.valueOf(historyEntry.getData())));
+ valueView.setText(resourceHelper.gs(R.string.omnipod_eros_history_bolus_value, Double.valueOf(historyEntry.getData())));
}
}
break;
@@ -309,7 +309,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
try {
Profile.ProfileValue[] profileValuesArray = aapsOmnipodUtil.getGsonInstance().fromJson(data, Profile.ProfileValue[].class);
- valueView.setText(ProfileUtil.getBasalProfilesDisplayable(profileValuesArray, PumpType.Insulet_Omnipod));
+ valueView.setText(ProfileUtil.getBasalProfilesDisplayable(profileValuesArray, PumpType.Omnipod_Eros));
} catch (Exception e) {
aapsLogger.error(LTag.PUMP, "Problem parsing Profile json. Ex: {}, Data:\n{}", e.getMessage(), data);
valueView.setText("");
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodManagementActivity.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt
similarity index 84%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodManagementActivity.kt
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt
index d7b05ebac7..0fc0b1acbb 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/PodManagementActivity.kt
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt
@@ -13,6 +13,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyL
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity
+import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodPodManagementBinding
@@ -20,11 +23,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Ac
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandPlayTestBeep
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.PodActivationWizardActivity
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.PodDeactivationWizardActivity
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.queue.events.EventQueueChanged
import info.nightscout.androidaps.utils.FabricPrivacy
@@ -39,7 +39,7 @@ import javax.inject.Inject
/**
* Created by andy on 30/08/2019
*/
-class PodManagementActivity : NoSplashAppCompatActivity() {
+class ErosPodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var fabricPrivacy: FabricPrivacy
@@ -47,7 +47,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var podStateManager: PodStateManager
@Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
- @Inject lateinit var aapsOmnipodManager: AapsOmnipodManager
+ @Inject lateinit var aapsOmnipodManager: AapsOmnipodErosManager
@Inject lateinit var context: Context
@Inject lateinit var omnipodErosPumpPlugin: OmnipodErosPumpPlugin
@Inject lateinit var serviceTaskExecutor: ServiceTaskExecutor
@@ -72,7 +72,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonDiscardPod.setOnClickListener {
OKDialog.showConfirmation(this,
- resourceHelper.gs(R.string.omnipod_pod_management_discard_pod_confirmation), Thread {
+ resourceHelper.gs(R.string.omnipod_common_pod_management_discard_pod_confirmation), Thread {
aapsOmnipodManager.discardPodState()
})
}
@@ -92,12 +92,12 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonPlayTestBeep.setOnClickListener {
binding.buttonPlayTestBeep.isEnabled = false
- binding.buttonPlayTestBeep.setText(R.string.omnipod_pod_management_button_playing_test_beep)
+ binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_playing_test_beep)
commandQueue.customCommand(CommandPlayTestBeep(BeepConfigType.BEEEP), object : Callback() {
override fun run() {
if (!result.success) {
- displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_error_failed_to_play_test_beep), result.comment), false)
+ displayErrorDialog(resourceHelper.gs(R.string.omnipod_common_warning), resourceHelper.gs(R.string.omnipod_common_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_common_error_failed_to_play_test_beep), result.comment), false)
}
}
})
@@ -105,19 +105,19 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonPulseLog.setOnClickListener {
binding.buttonPulseLog.isEnabled = false
- binding.buttonPulseLog.setText(R.string.omnipod_pod_management_button_reading_pulse_log)
+ binding.buttonPulseLog.setText(R.string.omnipod_eros_pod_management_button_reading_pulse_log)
commandQueue.customCommand(CommandReadPulseLog(), object : Callback() {
override fun run() {
if (!result.success) {
- displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_error_failed_to_read_pulse_log), result.comment), false)
+ displayErrorDialog(resourceHelper.gs(R.string.omnipod_common_warning), resourceHelper.gs(R.string.omnipod_common_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_eros_error_failed_to_read_pulse_log), result.comment), false)
}
}
})
}
binding.buttonPodHistory.setOnClickListener {
- startActivity(Intent(this, PodHistoryActivity::class.java))
+ startActivity(Intent(this, ErosPodHistoryActivity::class.java))
}
}
@@ -164,14 +164,14 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
if (podStateManager.isPodInitialized && podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED)) {
if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) {
binding.buttonPlayTestBeep.isEnabled = false
- binding.buttonPlayTestBeep.setText(R.string.omnipod_pod_management_button_playing_test_beep)
+ binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_playing_test_beep)
} else {
binding.buttonPlayTestBeep.isEnabled = true
- binding.buttonPlayTestBeep.setText(R.string.omnipod_pod_management_button_play_test_beep)
+ binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_play_test_beep)
}
} else {
binding.buttonPlayTestBeep.isEnabled = false
- binding.buttonPlayTestBeep.setText(R.string.omnipod_pod_management_button_play_test_beep)
+ binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_play_test_beep)
}
if (discardButtonEnabled) {
@@ -181,18 +181,18 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
if (podStateManager.isPodActivationCompleted) {
if (commandQueue.isCustomCommandInQueue(CommandReadPulseLog::class.java)) {
binding.buttonPulseLog.isEnabled = false
- binding.buttonPulseLog.setText(R.string.omnipod_pod_management_button_reading_pulse_log)
+ binding.buttonPulseLog.setText(R.string.omnipod_eros_pod_management_button_reading_pulse_log)
} else {
binding.buttonPulseLog.isEnabled = true
- binding.buttonPulseLog.setText(R.string.omnipod_pod_management_button_read_pulse_log)
+ binding.buttonPulseLog.setText(R.string.omnipod_eros_pod_management_button_read_pulse_log)
}
} else {
binding.buttonPulseLog.isEnabled = false
- binding.buttonPulseLog.setText(R.string.omnipod_pod_management_button_read_pulse_log)
+ binding.buttonPulseLog.setText(R.string.omnipod_eros_pod_management_button_read_pulse_log)
}
}
} else {
- binding.buttonPlayTestBeep.setText(R.string.omnipod_pod_management_button_play_test_beep)
+ binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_play_test_beep)
binding.buttonActivatePod.isEnabled = false
binding.buttonDeactivatePod.isEnabled = false
binding.buttonPlayTestBeep.isEnabled = false
@@ -202,7 +202,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
}
if (pulseLogButtonEnabled) {
binding.buttonPulseLog.isEnabled = false
- binding.buttonPulseLog.setText(R.string.omnipod_pod_management_button_read_pulse_log)
+ binding.buttonPulseLog.setText(R.string.omnipod_eros_pod_management_button_read_pulse_log)
}
}
}
@@ -221,8 +221,8 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
private fun displayNotConfiguredDialog() {
context.let {
UIRunnable {
- OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
- resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
+ OKDialog.show(it, resourceHelper.gs(R.string.omnipod_common_warning),
+ resourceHelper.gs(R.string.omnipod_eros_error_operation_not_possible_no_configuration), null)
}.run()
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodOverviewFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt
similarity index 84%
rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodOverviewFragment.kt
rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt
index cc627f1a7a..c9c4e58566 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodOverviewFragment.kt
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt
@@ -22,6 +22,10 @@ import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDevic
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandAcknowledgeAlerts
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandHandleTimeChange
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandResumeDelivery
+import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandSuspendDelivery
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodOverviewBinding
@@ -31,12 +35,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Po
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandAcknowledgeAlerts
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandHandleTimeChange
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandResumeDelivery
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandSuspendDelivery
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil
import info.nightscout.androidaps.queue.Callback
@@ -58,7 +58,7 @@ import java.util.*
import javax.inject.Inject
import kotlin.collections.ArrayList
-class OmnipodOverviewFragment : DaggerFragment() {
+class OmnipodErosOverviewFragment : DaggerFragment() {
companion object {
private const val REFRESH_INTERVAL_MILLIS = 15 * 1000L // 15 seconds
@@ -77,7 +77,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
@Inject lateinit var omnipodAlertUtil: OmnipodAlertUtil
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
@Inject lateinit var dateUtil: DateUtil
- @Inject lateinit var omnipodManager: AapsOmnipodManager
+ @Inject lateinit var omnipodManager: AapsOmnipodErosManager
@Inject lateinit var protectionCheck: ProtectionCheck
@Inject lateinit var aapsSchedulers: AapsSchedulers
@@ -111,7 +111,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
context?.let { context ->
protectionCheck.queryProtection(
activity, ProtectionCheck.Protection.PREFERENCES,
- UIRunnable { startActivity(Intent(context, PodManagementActivity::class.java)) }
+ UIRunnable { startActivity(Intent(context, ErosPodManagementActivity::class.java)) }
)
}
}
@@ -123,35 +123,35 @@ class OmnipodOverviewFragment : DaggerFragment() {
binding.buttonResumeDelivery.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandResumeDelivery(),
- DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_resume_delivery), true).messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_delivery_resumed)))
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_resume_delivery), true).messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_delivery_resumed)))
}
binding.buttonRefreshStatus.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandGetPodStatus(),
- DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_refresh_status), false))
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_refresh_status), false))
}
binding.buttonAcknowledgeActiveAlerts.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandAcknowledgeAlerts(),
- DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_acknowledge_alerts), false)
- .messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_acknowledged_alerts))
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_acknowledge_alerts), false)
+ .messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_acknowledged_alerts))
.actionOnSuccess { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_ALERTS)) })
}
binding.buttonSuspendDelivery.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandSuspendDelivery(),
- DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_suspend_delivery), true)
- .messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_suspended_delivery)))
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_suspend_delivery), true)
+ .messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_suspended_delivery)))
}
binding.buttonSetTime.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandHandleTimeChange(true),
- DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_set_time), true)
- .messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_time_on_pod_updated)))
+ DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_set_time), true)
+ .messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_time_on_pod_updated)))
}
}
@@ -260,7 +260,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
binding.podAddress.text = podStateManager.address.toString()
binding.podLot.text = podStateManager.lot.toString()
binding.podTid.text = podStateManager.tid.toString()
- binding.firmwareVersion.text = resourceHelper.gs(R.string.omnipod_firmware_version_value, podStateManager.pmVersion.toString(), podStateManager.piVersion.toString())
+ binding.firmwareVersion.text = resourceHelper.gs(R.string.omnipod_eros_overview_firmware_version_value, podStateManager.pmVersion.toString(), podStateManager.piVersion.toString())
binding.timeOnPod.text = readableZonedTime(podStateManager.time)
binding.timeOnPod.setTextColor(if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) {
@@ -283,7 +283,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
if (podStateManager.isPodFaulted) {
val faultEventCode = podStateManager.faultEventCode
- errors.add(resourceHelper.gs(R.string.omnipod_pod_status_pod_fault_description, faultEventCode.value, faultEventCode.name))
+ errors.add(resourceHelper.gs(R.string.omnipod_common_pod_status_pod_fault_description, faultEventCode.value, faultEventCode.name))
}
// base basal rate
@@ -295,20 +295,20 @@ class OmnipodOverviewFragment : DaggerFragment() {
// total delivered
binding.totalDelivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) {
- resourceHelper.gs(R.string.omnipod_overview_total_delivered_value, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS)
+ resourceHelper.gs(R.string.omnipod_common_overview_total_delivered_value, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS)
} else {
PLACEHOLDER
}
// reservoir
if (podStateManager.reservoirLevel == null) {
- binding.reservoir.text = resourceHelper.gs(R.string.omnipod_overview_reservoir_value_over50)
+ binding.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value_over50)
binding.reservoir.setTextColor(Color.WHITE)
} else {
val lowReservoirThreshold = (omnipodAlertUtil.lowReservoirAlertUnits
?: OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD).toDouble()
- binding.reservoir.text = resourceHelper.gs(R.string.omnipod_overview_reservoir_value, podStateManager.reservoirLevel)
+ binding.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value, podStateManager.reservoirLevel)
binding.reservoir.setTextColor(if (podStateManager.reservoirLevel < lowReservoirThreshold) {
Color.RED
} else {
@@ -354,34 +354,34 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun updatePodStatus() {
binding.podStatus.text = if (!podStateManager.hasPodState()) {
- resourceHelper.gs(R.string.omnipod_pod_status_no_active_pod)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_no_active_pod)
} else if (!podStateManager.isPodActivationCompleted) {
if (!podStateManager.isPodInitialized) {
- resourceHelper.gs(R.string.omnipod_pod_status_waiting_for_activation)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_waiting_for_activation)
} else {
if (podStateManager.activationProgress.isBefore(ActivationProgress.PRIMING_COMPLETED)) {
- resourceHelper.gs(R.string.omnipod_pod_status_waiting_for_activation)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_waiting_for_activation)
} else {
- resourceHelper.gs(R.string.omnipod_pod_status_waiting_for_cannula_insertion)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_waiting_for_cannula_insertion)
}
}
} else {
if (podStateManager.podProgressStatus.isRunning) {
var status = if (podStateManager.isSuspended) {
- resourceHelper.gs(R.string.omnipod_pod_status_suspended)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_suspended)
} else {
- resourceHelper.gs(R.string.omnipod_pod_status_running)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_running)
}
if (!podStateManager.isBasalCertain) {
- status += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
+ status += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
status
} else if (podStateManager.podProgressStatus == PodProgressStatus.FAULT_EVENT_OCCURRED) {
- resourceHelper.gs(R.string.omnipod_pod_status_pod_fault)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_pod_fault)
} else if (podStateManager.podProgressStatus == PodProgressStatus.INACTIVE) {
- resourceHelper.gs(R.string.omnipod_pod_status_inactive)
+ resourceHelper.gs(R.string.omnipod_common_pod_status_inactive)
} else {
podStateManager.podProgressStatus.toString()
}
@@ -397,14 +397,14 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun updateLastBolus() {
if (podStateManager.isPodActivationCompleted && podStateManager.hasLastBolus()) {
- var text = resourceHelper.gs(R.string.omnipod_overview_last_bolus_value, omnipodErosPumpPlugin.model().determineCorrectBolusSize(podStateManager.lastBolusAmount), resourceHelper.gs(R.string.insulin_unit_shortname), readableDuration(podStateManager.lastBolusStartTime))
+ var text = resourceHelper.gs(R.string.omnipod_common_overview_last_bolus_value, omnipodErosPumpPlugin.model().determineCorrectBolusSize(podStateManager.lastBolusAmount), resourceHelper.gs(R.string.insulin_unit_shortname), readableDuration(podStateManager.lastBolusStartTime))
val textColor: Int
if (podStateManager.isLastBolusCertain) {
textColor = Color.WHITE
} else {
textColor = Color.RED
- text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
+ text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.lastBolus.text = text
@@ -432,12 +432,12 @@ class OmnipodOverviewFragment : DaggerFragment() {
var text: String
val textColor: Int
- text = resourceHelper.gs(R.string.omnipod_overview_temp_basal_value, amount, dateUtil.timeString(startTime.millis), minutesRunning, duration.standardMinutes)
+ text = resourceHelper.gs(R.string.omnipod_common_overview_temp_basal_value, amount, dateUtil.timeString(startTime.millis), minutesRunning, duration.standardMinutes)
if (podStateManager.isTempBasalCertain) {
textColor = Color.WHITE
} else {
textColor = Color.RED
- text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
+ text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.tempBasal.text = text
@@ -451,7 +451,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
textColor = Color.WHITE
} else {
textColor = Color.RED
- text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
+ text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.tempBasal.text = text
@@ -529,8 +529,8 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun displayNotConfiguredDialog() {
context?.let {
UIRunnable {
- OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
- resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
+ OKDialog.show(it, resourceHelper.gs(R.string.omnipod_common_warning),
+ resourceHelper.gs(R.string.omnipod_eros_error_operation_not_possible_no_configuration), null)
}.run()
}
}
@@ -564,7 +564,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
val isDaylightTime = timeZone.inDaylightTime(timeAsJavaData)
val locale = resources.configuration.locales.get(0)
val timeZoneDisplayName = timeZone.getDisplayName(isDaylightTime, TimeZone.SHORT, locale) + " " + timeZone.getDisplayName(isDaylightTime, TimeZone.LONG, locale)
- return resourceHelper.gs(R.string.omnipod_time_with_timezone, dateUtil.dateAndTimeString(timeAsJavaData), timeZoneDisplayName)
+ return resourceHelper.gs(R.string.omnipod_common_time_with_timezone, dateUtil.dateAndTimeString(timeAsJavaData), timeZoneDisplayName)
}
private fun readableDuration(dateTime: DateTime): String {
@@ -574,32 +574,32 @@ class OmnipodOverviewFragment : DaggerFragment() {
val seconds = duration.standardSeconds.toInt()
when {
seconds < 10 -> {
- return resourceHelper.gs(R.string.omnipod_moments_ago)
+ return resourceHelper.gs(R.string.omnipod_common_moments_ago)
}
seconds < 60 -> {
- return resourceHelper.gs(R.string.omnipod_less_than_a_minute_ago)
+ return resourceHelper.gs(R.string.omnipod_common_less_than_a_minute_ago)
}
seconds < 60 * 60 -> { // < 1 hour
- return resourceHelper.gs(R.string.omnipod_time_ago, resourceHelper.gq(R.plurals.omnipod_minutes, minutes, minutes))
+ return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_minutes, minutes, minutes))
}
seconds < 24 * 60 * 60 -> { // < 1 day
val minutesLeft = minutes % 60
if (minutesLeft > 0)
- return resourceHelper.gs(R.string.omnipod_time_ago,
- resourceHelper.gs(R.string.omnipod_composite_time, resourceHelper.gq(R.plurals.omnipod_hours, hours, hours), resourceHelper.gq(R.plurals.omnipod_minutes, minutesLeft, minutesLeft)))
- return resourceHelper.gs(R.string.omnipod_time_ago, resourceHelper.gq(R.plurals.omnipod_hours, hours, hours))
+ return resourceHelper.gs(R.string.omnipod_common_time_ago,
+ resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours), resourceHelper.gq(R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft)))
+ return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours))
}
else -> {
val days = hours / 24
val hoursLeft = hours % 24
if (hoursLeft > 0)
- return resourceHelper.gs(R.string.omnipod_time_ago,
- resourceHelper.gs(R.string.omnipod_composite_time, resourceHelper.gq(R.plurals.omnipod_days, days, days), resourceHelper.gq(R.plurals.omnipod_hours, hoursLeft, hoursLeft)))
- return resourceHelper.gs(R.string.omnipod_time_ago, resourceHelper.gq(R.plurals.omnipod_days, days, days))
+ return resourceHelper.gs(R.string.omnipod_common_time_ago,
+ resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_days, days, days), resourceHelper.gq(R.plurals.omnipod_common_hours, hoursLeft, hoursLeft)))
+ return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_days, days, days))
}
}
}
@@ -622,11 +622,11 @@ class OmnipodOverviewFragment : DaggerFragment() {
if (result.success) {
val messageOnSuccess = this.messageOnSuccess
if (messageOnSuccess != null) {
- displayOkDialog(resourceHelper.gs(R.string.omnipod_confirmation), messageOnSuccess)
+ displayOkDialog(resourceHelper.gs(R.string.omnipod_common_confirmation), messageOnSuccess)
}
actionOnSuccess?.run()
} else {
- displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, errorMessagePrefix, result.comment), withSoundOnError)
+ displayErrorDialog(resourceHelper.gs(R.string.omnipod_common_warning), resourceHelper.gs(R.string.omnipod_common_two_strings_concatenated_by_colon, errorMessagePrefix, result.comment), withSoundOnError)
}
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt
deleted file mode 100644
index 4b1227ffce..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment
-
-import androidx.annotation.IdRes
-import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
-
-class PodActivatedInfoFragment : InfoFragmentBase() {
-
- @StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_pod_activated_title
-
- @StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_pod_activated_text
-
- @IdRes
- override fun getNextPageActionId(): Int? = null
-
- override fun getIndex(): Int = 5
-}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt
deleted file mode 100644
index f90e682e25..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment
-
-import androidx.annotation.IdRes
-import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
-
-class DeactivatePodInfoFragment : InfoFragmentBase() {
-
- @StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivate_pod_title
-
- @StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivate_pod_text
-
- @IdRes
- override fun getNextPageActionId(): Int = R.id.action_deactivatePodInfoFragment_to_deactivatePodActionFragment
-
- override fun getIndex(): Int = 1
-}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt
deleted file mode 100644
index ebc8a16a8e..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment
-
-import androidx.annotation.IdRes
-import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
-
-class PodDeactivatedInfoFragment : InfoFragmentBase() {
-
- @StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_deactivated_title
-
- @StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_deactivated_text
-
- @IdRes
- override fun getNextPageActionId(): Int? = null
-
- override fun getIndex(): Int = 3
-}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt
deleted file mode 100644
index e74bf8a528..0000000000
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment
-
-import androidx.annotation.IdRes
-import androidx.annotation.StringRes
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase
-
-class PodDiscardedInfoFragment : InfoFragmentBase() {
-
- @StringRes
- override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_discarded_title
-
- @StringRes
- override fun getTextId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_discarded_text
-
- @IdRes
- override fun getNextPageActionId(): Int? = null
-
- override fun getIndex(): Int = 3
-}
\ No newline at end of file
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java
index 51b9acb54c..ad99d1746b 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java
@@ -68,21 +68,21 @@ public class AapsOmnipodUtil {
private String translateAlertType(AlertType alertType) {
if (alertType == null) {
- return resourceHelper.gs(R.string.omnipod_alert_unknown_alert);
+ return resourceHelper.gs(R.string.omnipod_common_alert_unknown_alert);
}
switch (alertType) {
case FINISH_PAIRING_REMINDER:
- return resourceHelper.gs(R.string.omnipod_alert_finish_pairing_reminder);
+ return resourceHelper.gs(R.string.omnipod_common_alert_finish_pairing_reminder);
case FINISH_SETUP_REMINDER:
- return resourceHelper.gs(R.string.omnipod_alert_finish_setup_reminder_reminder);
+ return resourceHelper.gs(R.string.omnipod_common_alert_finish_setup_reminder_reminder);
case EXPIRATION_ALERT:
- return resourceHelper.gs(R.string.omnipod_alert_expiration);
+ return resourceHelper.gs(R.string.omnipod_common_alert_expiration);
case EXPIRATION_ADVISORY_ALERT:
- return resourceHelper.gs(R.string.omnipod_alert_expiration_advisory);
+ return resourceHelper.gs(R.string.omnipod_common_alert_expiration_advisory);
case SHUTDOWN_IMMINENT_ALARM:
- return resourceHelper.gs(R.string.omnipod_alert_shutdown_imminent);
+ return resourceHelper.gs(R.string.omnipod_common_alert_shutdown_imminent);
case LOW_RESERVOIR_ALERT:
- return resourceHelper.gs(R.string.omnipod_alert_low_reservoir);
+ return resourceHelper.gs(R.string.omnipod_common_alert_low_reservoir);
default:
return alertType.name();
}
diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java
index 0ad2b49c18..9b7554efd0 100644
--- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java
+++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java
@@ -5,7 +5,7 @@ import org.joda.time.Duration;
import javax.inject.Inject;
import javax.inject.Singleton;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodStorageKeys;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
@@ -19,12 +19,12 @@ public class OmnipodAlertUtil {
}
public Duration getExpirationReminderTimeBeforeShutdown() {
- boolean expirationAlertEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED, true);
- return expirationAlertEnabled ? Duration.standardHours(sp.getInt(OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN, 9)) : null;
+ boolean expirationAlertEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED, true);
+ return expirationAlertEnabled ? Duration.standardHours(sp.getInt(OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN, 9)) : null;
}
public Integer getLowReservoirAlertUnits() {
- boolean lowReservoirAlertEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED, true);
- return lowReservoirAlertEnabled ? sp.getInt(OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS, OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD) : null;
+ boolean lowReservoirAlertEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED, true);
+ return lowReservoirAlertEnabled ? sp.getInt(OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS, OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD) : null;
}
}
diff --git a/omnipod-eros/src/main/res/layout/omnipod_pod_history_activity.xml b/omnipod-eros/src/main/res/layout/omnipod_pod_history_activity.xml
index d2a91efbc7..c34ff11276 100644
--- a/omnipod-eros/src/main/res/layout/omnipod_pod_history_activity.xml
+++ b/omnipod-eros/src/main/res/layout/omnipod_pod_history_activity.xml
@@ -17,7 +17,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="20dp"
- android:text="@string/omnipod_history_type"
+ android:text="@string/omnipod_eros_history_type"
android:textAppearance="?android:attr/textAppearanceSmall" />
+ android:text="@string/omnipod_eros_history_title" />
diff --git a/omnipod-eros/src/main/res/layout/omnipod_pod_history_item.xml b/omnipod-eros/src/main/res/layout/omnipod_pod_history_item.xml
index 0534481536..cea5ceedf3 100644
--- a/omnipod-eros/src/main/res/layout/omnipod_pod_history_item.xml
+++ b/omnipod-eros/src/main/res/layout/omnipod_pod_history_item.xml
@@ -11,21 +11,21 @@
android:id="@+id/omnipod_history_time"
android:layout_width="88dp"
android:layout_height="match_parent"
- android:text="@string/omnipod_history_item_date"
+ android:text="@string/omnipod_eros_history_item_date"
android:textSize="12sp" />
\ No newline at end of file
diff --git a/omnipod-eros/src/main/res/layout/omnipod_pod_management.xml b/omnipod-eros/src/main/res/layout/omnipod_pod_management.xml
index 51010b34a2..1cfaf47ef9 100644
--- a/omnipod-eros/src/main/res/layout/omnipod_pod_management.xml
+++ b/omnipod-eros/src/main/res/layout/omnipod_pod_management.xml
@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- tools:context=".ui.PodManagementActivity">
+ tools:context=".ui.ErosPodManagementActivity">
@@ -42,7 +42,7 @@
android:layout_marginRight="10dp"
android:layout_weight="0.5"
android:gravity="center"
- android:text="@string/omnipod_pod_management_waiting_for_rileylink_connection"
+ android:text="@string/omnipod_eros_pod_management_waiting_for_riley_link_connection"
android:textAlignment="center"
android:textSize="8pt" />
@@ -53,7 +53,7 @@
android:layout_marginTop="15dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
- android:text="@string/omnipod_pod_management_heading_actions" />
+ android:text="@string/omnipod_common_pod_management_heading_actions" />
@@ -82,7 +82,7 @@
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_deactivate_pod"
- android:text="@string/omnipod_pod_management_button_deactivate_pod"
+ android:text="@string/omnipod_common_pod_management_button_deactivate_pod"
android:textAllCaps="false" />
@@ -102,7 +102,7 @@
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_play_test_beep"
- android:text="@string/omnipod_pod_management_button_play_test_beep"
+ android:text="@string/omnipod_common_pod_management_button_play_test_beep"
android:textAllCaps="false" />
@@ -114,7 +114,7 @@
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_discard_pod"
- android:text="@string/omnipod_pod_management_button_discard_pod"
+ android:text="@string/omnipod_common_pod_management_button_discard_pod"
android:textAllCaps="false"
android:visibility="gone" />
@@ -126,7 +126,7 @@
android:layout_marginTop="15dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
- android:text="@string/omnipod_pod_management_heading_tools" />
+ android:text="@string/omnipod_common_pod_management_heading_tools" />
@@ -175,7 +175,7 @@
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_pulse_log"
- android:text="@string/omnipod_pod_management_button_read_pulse_log"
+ android:text="@string/omnipod_eros_pod_management_button_read_pulse_log"
android:textAllCaps="false"
android:visibility="gone" />
@@ -187,7 +187,7 @@
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_activity_reset_rileylink_config"
- android:text="@string/omnipod_pod_management_button_reset_riley_link_config"
+ android:text="@string/omnipod_eros_pod_management_button_reset_riley_link_config"
android:textAllCaps="false" />
diff --git a/omnipod-eros/src/main/res/values/strings.xml b/omnipod-eros/src/main/res/values/strings.xml
index bac4ee85e6..477e110f15 100644
--- a/omnipod-eros/src/main/res/values/strings.xml
+++ b/omnipod-eros/src/main/res/values/strings.xml
@@ -1,290 +1,98 @@
+
+ Omnipod
+ Pod
+ Pump integration for Omnipod Eros (the older model with a transparent needle cap). Requires a RileyLink device with at least firmware version 2.0.
+ Omnipod (433.91 MHz)
-
- AAPS.Omnipod.pod_state
- AAPS.Omnipod.current_bolus
- AAPS.Omnipod.bolus_beeps_enabled
- AAPS.Omnipod.basal_beeps_enabled
- AAPS.Omnipod.smb_beeps_enabled
- AAPS.Omnipod.tbr_beeps_enabled
- AAPS.Omnipod.suspend_delivery_button_enabled
- AAPS.Omnipod.pulse_log_button_enabled
- AAPS.Omnipod.rileylink_stats_button_enabled
- AAPS.Omnipod.enable_battery_change_logging
- AAPS.Omnipod.time_change_enabled
- AAPS.Omnipod.expiration_reminder_enabled
- AAPS.Omnipod.expiration_reminder_hours_before_shutdown
- AAPS.Omnipod.low_reservoir_alert_enabled
- AAPS.Omnipod.low_reservoir_alert_units
- AAPS.Omnipod.automatically_acknowledge_alerts_enabled
- AAPS.Omnipod.notification_uncertain_tbr_sound_enabled
- AAPS.Omnipod.notification_uncertain_smb_sound_enabled
- AAPS.Omnipod.notification_uncertain_bolus_sound_enabled
- AAPS.Omnipod.tbrs_set
- AAPS.Omnipod.std_boluses_delivered
- AAPS.Omnipod.smb_boluses_delivered
+
+ AAPS.Omnipod.pod_state
+ AAPS.Omnipod.current_bolus
+ AAPS.Omnipod.pulse_log_button_enabled
+ AAPS.Omnipod.rileylink_stats_button_enabled
+ AAPS.Omnipod.enable_battery_change_logging
+ AAPS.Omnipod.notification_uncertain_tbr_sound_enabled
+ AAPS.Omnipod.notification_uncertain_smb_sound_enabled
+ AAPS.Omnipod.notification_uncertain_bolus_sound_enabled
+ AAPS.Omnipod.tbrs_set
+ AAPS.Omnipod.std_boluses_delivered
+ AAPS.Omnipod.smb_boluses_delivered
-
- Omnipod
- Pod
- Omnipod (433.91 MHz)
- LOT
- TID
- PM %1$s / PI %2$s
- %1$s (%2$s)
- %1$s: %2$s
- %1$.2f %2$s (%3$s)
+
+ PM %1$s / PI %2$s
-
- RileyLink Configuration
- Bolus beeps enabled
- Basal beeps enabled
- SMB beeps enabled
- TBR beeps enabled
- Show Suspend Delivery button in Omnipod tab
- Show Pulse Log button in Pod Management menu
- Show RileyLink Stats button in Pod Management menu
- Enable battery change logging in Actions
- DST/Time zone detection enabled
- Expiration reminder enabled
- Hours before shutdown
- Low reservoir alert enabled
- Number of units
- Sound for uncertain TBR notifications enabled
- Sound for uncertain SMB notifications enabled
- Sound for uncertain bolus notifications enabled
- Automatically acknowledge Pod alerts
- RileyLink
- Other
- Alerts
- Confirmation Beeps
- Notifications
+
+ RileyLink Configuration
+ Notifications
+ Show Pulse Log button in Pod Management menu
+ Show RileyLink Stats button in Pod Management menu
+ Enable battery change logging in Actions
+ RileyLink
+ Sound for uncertain TBR notifications enabled
+ Sound for uncertain SMB notifications enabled
+ Sound for uncertain bolus notifications enabled
-
- No Active Pod
- Setup in progress (waiting for Pod activation)
- Setup in progress (waiting for cannula insertion)
- Running
- Suspended
- Pod Fault
- Activation time exceeded
- Inactive
- Pod Fault: %1$03d %2$s
+
+ Pod History
+ Description
+ Source
+ Date
+ Type:
+ %1$.2f U
+ %1$.2f U, CH=%2$.1f g
+ Rate: %1$.2f U, duration: %2$d minutes
-
- Finish pairing reminder
- Finish setup reminder
- Pod will expire soon
- Pod will expire soon
- Shutdown is imminent
- Low Reservoir
- Unknown Alert
+
+ RLBatt: %1$d
-
- Pod History
- Description
- Source
- Date
- Type:
- %1$.2f U
- %1$.2f U, CH=%2$.1f g
- Rate: %1$.2f U, duration: %2$d minutes
+
+ RileyLink address invalid.
+ Communication failed: message integrity verification failed
+ Communication failed: received an invalid packet from the Pod
+ Communication failed: the Pod is in a wrong state
+ Communication failed: received an invalid response from the Pod
+ Communication failed: received a message with an invalid sequence number from the Pod
+ Communication failed: received a message with an invalid address from the Pod
+ Communication failed: failed to decode message from the Pod
+ Communication failed: nonce resync failed
+ Communication failed: nonce out of sync
+ Communication failed: not enough data received from the Pod
+ A Pod fault (%1$03d %2$s) has been detected. Please deactivate your Pod and activate a new one
+ Communication failed: the Pod returned an error response
+ No response from RileyLink
+ RileyLink interrupted
+ No response from Pod
+ Setting basal profile failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
+ Setting basal profile might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
+ Setting basal profile failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.
+ Cancelling temp basal might have failed. Please manually refresh the Pod status from the Omnipod tab.
+ Setting temp basal failed. If a temp basal was previously running, it might have been cancelled. Please manually refresh the Pod status from the Omnipod tab.
+ Setting temp basal might have basal failed. If a temp basal was previously running, it has been cancelled. Please manually refresh the Pod status from the Omnipod tab.
+ TBR duration must be greater than zero and a multiple of %1$s minutes.
+ Setting time might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
+ Setting time failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.
+ Failed to read Pulse Log
+ Failed to automatically change time on the Pod. You should manually synchronize the time on the Omnipod tab.
+ Operation is not possible.\n\nYou need to configure Omnipod first, before you can use this operation.
+ Unable to verify whether the bolus succeeded. Please manually verify that your Pod is bolusing by listening to clicks. If you are sure that the bolus didn\'t succeed, you should manually delete the bolus entry from Treatments, even if you click \'Cancel bolus\' now!
+ Unable to verify whether SMB bolus (%1$.2f U) succeeded. If you are sure that the Bolus didn\'t succeed, you should manually delete the SMB entry from Treatments.
+ A temporary basal is running on the Pod, but AAPS is unaware of this temporary basal. Please cancel your temporary basal manually.
-
- No Active Pod
- LastConn: %1$d min ago
- LastBolus: %1$s @ %2$s
- Temp: %1$s
- Extended: %1$s
- Reserv: %1$sU
- RLBatt: %1$d
+
+ RileyLink Stats
+ Waiting for RileyLink connection…
+ Reset RileyLink Config
+ Read Pulse Log
+ Reading Pulse Log…
+ Pulse Log
+ Pulse Log (copied to clipboard)
-
- Warning
- RileyLink address invalid.
- Operation is not possible.\n\nYou need to configure Omnipod first, before you can use this operation.
- No active Pod
- The time on the Pod is out of sync. Please update the time in the Omnipod tab.
- An unexpected error occurred. Please report! (%1$s: %2$s).
- Communication failed: message integrity verification failed
- Communication failed: received an invalid packet from the Pod
- Communication failed: the Pod is in a wrong state
- Communication failed: received an invalid response from the Pod
- Communication failed: received a message with an invalid sequence number from the Pod
- Communication failed: received a message with an invalid address from the Pod
- Communication failed: failed to decode message from the Pod
- Communication failed: nonce resync failed
- Communication failed: nonce out of sync
- Communication failed: not enough data received from the Pod
- A Pod fault (%1$03d %2$s) has been detected. Please deactivate your Pod and activate a new one
- Communication failed: the Pod returned an error response
- No response from RileyLink
- RileyLink interrupted
- No response from Pod
- Setting basal profile failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
- Setting basal profile might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
- Setting basal profile failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.
- Setting basal profile failed.
- Cancelling temp basal might have failed. Please manually refresh the Pod status from the Omnipod tab.
- Setting temp basal failed. If a temp basal was previously running, it might have been cancelled. Please manually refresh the Pod status from the Omnipod tab.
- Setting temp basal might have basal failed. If a temp basal was previously running, it has been cancelled. Please manually refresh the Pod status from the Omnipod tab.
- TBR duration must be greater than zero and a multiple of %1$s minutes.
- Setting time might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.
- Setting time failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.
- Failed to set basal profile: received an empty profile. Make sure to activate your basal profile.
- No basal profile is active. Make sure to activate your basal profile.
- Unknown custom command: %1$s
- Failed to read Pulse Log
- Failed to refresh status
- Failed to refresh status on startup
- Failed to acknowledge alerts
- Failed to suspend delivery
- Failed to set time
- Failed to resume delivery
- Failed to automatically change time on the Pod. You should manually synchronize the time on the Omnipod tab.
- Unable to verify whether the bolus succeeded. Please manually verify that your Pod is bolusing by listening to clicks. If you are sure that the bolus didn\'t succeed, you should manually delete the bolus entry from Treatments, even if you click \'Cancel bolus\' now!
- Unable to verify whether SMB bolus (%1$.2f U) succeeded. If you are sure that the Bolus didn\'t succeed, you should manually delete the SMB entry from Treatments.
- Bolus did not succeed.
- Failed to initialize the Pod
- Failed to insert cannula
- The Pod\'s activation time has been exceeded. This Pod can no longer be activated.
- Failed to verify activation progress. Please retry.
- Pod suspended
- Failed to play test beep
- A temporary basal is running on the Pod, but AAPS is unaware of this temporary basal. Please cancel your temporary basal manually.
+
+ Fill a new Pod with enough insulin for 3 days.\n\nListen for two beeps from the Pod during the filling process. These indicate that the minimum amount of 85U has been inserted. Be sure to completely empty the fill syringe, even after hearing the two beeps.\n\nAfter filling the Pod, please press Next.\n\nNote: do not remove the Pod\'s needle cap at this time.\nNote: please place the RileyLink in an upright position and place the Pod a few inches away from it.
+ Trying to pair with the new Pod and prime it.\n\nWhen the initialization process has successfully been completed, you can press Next.\n\nNote: please place the RileyLink in an upright position and place the Pod a few inches away from it.
-
- Confirmation
- Time and/or time zone changed on the Pod.
- Alert configuration has been updated in the Pod.
- The time on the Pod has been updated.
- All insulin delivery has been suspended.
- Active alerts have been acknowledged.
- Insulin delivery has been resumed.
-
-
- Deactivate Pod
- Discard Pod
- Set Bolus
- Cancel Bolus
- Set Temporary Basal
- Cancel Temporary Basal (internally by driver)
- Cancel Temporary Basal
- Set Basal Schedule
- Get Pod Status
- Get Pod Info
- Set Time
- Configure Alerts
- Acknowledge Alerts
- Suspend Delivery
- Resume Delivery
- Unknown Entry
- Initialize Pod
- Insert Cannula
- Read Pulse Log
- Set fake temporary basal because the Pod is suspended
- Cancel fake temporary basal that was created because the Pod was suspended
- Split temporary basal because of uncertain failure in cancellation
- Beep Config
- Play Test Beep
-
-
- Pod Management
- Actions
- Tools
- Waiting for RileyLink connection…
- Activate Pod
- Deactivate Pod
- Discard Pod
- Pod History
- RileyLink Stats
- Reset RileyLink Config
- Read Pulse Log
- Reading Pulse Log…
- If you discard the Pod, you will not be able to communicate with it anymore. You should only do this when all communication with the Pod persistently fails. If you can still communicate with the Pod, please use the Deactivate Pod option.\n\nIf you wish to proceed, please make sure to remove the Pod from your body!
- Play Test Beep
- Playing Test Beep…
-
-
- Fill Pod
- Fill a new Pod with enough insulin for 3 days.\n\nListen for two beeps from the Pod during the filling process. These indicate that the minimum amount of 85U has been inserted. Be sure to completely empty the fill syringe, even after hearing the two beeps.\n\nAfter filling the Pod, please press Next.\n\nNote: do not remove the Pod\'s needle cap at this time.\nNote: please place the RileyLink in an upright position and place the Pod a few inches away from it.
- Initialize Pod
- Trying to pair with the new Pod and prime it.\n\nWhen the initialization process has successfully been completed, you can press Next.\n\nNote: please place the RileyLink in an upright position and place the Pod a few inches away from it.
- Attach Pod
- Prepare the infusion site. Remove the Pod\'s needle cap and adhesive backing and attach the Pod to the infusion site.\n\nIf the cannula sticks out, please press Cancel and discard your Pod.\n\nPress Next to insert the cannula and begin basal delivery.
- When you press OK, the cannula will be inserted. Make sure that you have attached the Pod to the infusion site.
- Insert Cannula
- Trying to set initial basal schedule and insert the cannula.\n\nWhen the cannula has successfully been inserted, you can press Next.
- Pod Activated
- The new Pod is now active.\n\nYour basal schedule has been programmed and the cannula has been inserted.\n\nPlease verify that the cannula has been inserted correctly and change your Pod if you think it has not.
-
-
- Deactivate Pod
- Press Next to deactivate the Pod.\n\nNote: This will suspend all insulin delivery and deactivate the Pod.
- Deactivating Pod
- Deactivating the Pod.\n\nWhen deactivation has completed successfully, you can press Next.
- Pod Deactivated
- Your Pod has been deactivated.\n\nPlease remove the Pod from your body and recycle it.
- Pod Discarded
- The Pod state has been discarded. Insulin delivery has not been suspended because the Pod has not been properly deactivated!\n\nPlease remove the Pod from your body and recycle it.
- If you discard the Pod, you will not be able to communicate with it anymore. You should only do this when all communication with the Pod persistently fails. Are you sure you want to discard the Pod?
- Discard Pod
-
-
- Set time
- Suspend
- Resume Delivery
- Pod Mgmt
- Ack Alerts
- Pod Status
- Total Delivered
- %1$.2f U
- Pod Address
- Pod Expires
- Last Connection
- Last Bolus
- Temp Basal Rate
- Base Basal Rate
- Reservoir
- Active Pod Alerts
- Firmware Version
- Time on Pod
- %1$.2fU/h @%2$s (%3$d/%4$d minutes)
- %1$.2f U left
- Over 50 U left
- Errors
-
-
- Pump integration for Omnipod, requires RileyLink (with at least 2.0 firmware) device.
- uncertain
- Pulse log
- Pulse Log (copied to clipboard)
- Yes
- No
- OK
- Cancel
-
-
- Moments ago
- Less than a minute ago
- %1$s and %2$s
- %1$s ago
-
- - %1$d minute
- - %1$d minutes
-
-
- - %1$d hour
- - %1$d hours
-
-
- - %1$d day
- - %1$d days
-
-
- - Pod Alert: %1$s
- - Pod Alerts: %1$s
-
+
+ uncertain
\ No newline at end of file
diff --git a/omnipod-eros/src/main/res/xml/omnipod_eros_preferences.xml b/omnipod-eros/src/main/res/xml/omnipod_eros_preferences.xml
new file mode 100644
index 0000000000..3666817d2c
--- /dev/null
+++ b/omnipod-eros/src/main/res/xml/omnipod_eros_preferences.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/omnipod-eros/src/main/res/xml/pref_omnipod.xml b/omnipod-eros/src/main/res/xml/pref_omnipod.xml
deleted file mode 100644
index a56ea0ce0b..0000000000
--- a/omnipod-eros/src/main/res/xml/pref_omnipod.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.java b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.java
index 795f36fc25..b47c74d122 100644
--- a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.java
+++ b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.java
@@ -26,7 +26,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.rx.TestAapsSchedulers;
@@ -45,7 +45,7 @@ public class OmnipodErosPumpPluginTest {
RxBusWrapper rxBusWrapper = new RxBusWrapper(new TestAapsSchedulers());
@Mock ResourceHelper resourceHelper;
@Mock(answer = Answers.RETURNS_DEEP_STUBS) ActivePluginProvider activePluginProvider;
- @Mock AapsOmnipodManager aapsOmnipodManager;
+ @Mock AapsOmnipodErosManager aapsOmnipodErosManager;
@Mock CommandQueueProvider commandQueueProvider;
@Mock RileyLinkUtil rileyLinkUtil;
@@ -59,7 +59,7 @@ public class OmnipodErosPumpPluginTest {
// mock all the things
PowerMockito.mockStatic(Looper.class);
OmnipodErosPumpPlugin plugin = new OmnipodErosPumpPlugin(injector, aapsLogger, new TestAapsSchedulers(), rxBusWrapper, null,
- resourceHelper, activePluginProvider, null, null, aapsOmnipodManager, commandQueueProvider,
+ resourceHelper, activePluginProvider, null, null, aapsOmnipodErosManager, commandQueueProvider,
null, null, null, null,
rileyLinkUtil, null, null, null, null
);
@@ -73,7 +73,7 @@ public class OmnipodErosPumpPluginTest {
// always return a PumpEnactResult containing same rate and duration as input
- when(aapsOmnipodManager.setTemporaryBasal(any(TempBasalPair.class))).thenAnswer(
+ when(aapsOmnipodErosManager.setTemporaryBasal(any(TempBasalPair.class))).thenAnswer(
invocation -> {
TempBasalPair pair = invocation.getArgument(0);
PumpEnactResult result = new PumpEnactResult(injector);
@@ -120,7 +120,7 @@ public class OmnipodErosPumpPluginTest {
// When treatment
result1 = plugin.setTempBasalPercent(80, 30, profile, false);
// Then return sane values
- assertEquals(result1.absolute, PumpType.Insulet_Omnipod.determineCorrectBasalSize(500d * 0.8), 0.01d);
+ assertEquals(result1.absolute, PumpType.Omnipod_Eros.determineCorrectBasalSize(500d * 0.8), 0.01d);
assertEquals(result1.duration, 30);
// Given weird basal
diff --git a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodManagerTest.java b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java
similarity index 88%
rename from omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodManagerTest.java
rename to omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java
index e376fd6d68..58163504a6 100644
--- a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodManagerTest.java
+++ b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java
@@ -11,12 +11,12 @@ import java.util.List;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry;
-import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager;
+import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
-public class AapsOmnipodManagerTest {
+public class AapsOmnipodErosManagerTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -42,7 +42,7 @@ public class AapsOmnipodManagerTest {
value3
});
- BasalSchedule basalSchedule = AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ BasalSchedule basalSchedule = AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
List entries = basalSchedule.getEntries();
assertEquals(3, entries.size());
@@ -64,14 +64,14 @@ public class AapsOmnipodManagerTest {
public void invalidProfileNullProfile() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Profile can not be null");
- AapsOmnipodManager.mapProfileToBasalSchedule(null);
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(null);
}
@Test
public void invalidProfileNullEntries() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Basal values can not be null");
- AapsOmnipodManager.mapProfileToBasalSchedule(mock(Profile.class));
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(mock(Profile.class));
}
@Test
@@ -82,7 +82,7 @@ public class AapsOmnipodManagerTest {
PowerMockito.when(profile.getBasalValues()).thenReturn(new Profile.ProfileValue[0]);
- AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
}
@Test
@@ -100,7 +100,7 @@ public class AapsOmnipodManagerTest {
value,
});
- AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
}
@Test
@@ -123,7 +123,7 @@ public class AapsOmnipodManagerTest {
value2
});
- AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
}
@Test
@@ -141,7 +141,7 @@ public class AapsOmnipodManagerTest {
value,
});
- AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
}
@Test
@@ -156,7 +156,7 @@ public class AapsOmnipodManagerTest {
value,
});
- BasalSchedule basalSchedule = AapsOmnipodManager.mapProfileToBasalSchedule(profile);
+ BasalSchedule basalSchedule = AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
BasalScheduleEntry basalScheduleEntry = basalSchedule.getEntries().get(0);
assertEquals(0.05D, basalScheduleEntry.getRate(), 0.000001);
diff --git a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManagerTest.java b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.java
similarity index 91%
rename from omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManagerTest.java
rename to omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.java
index c8f5ca44cd..595cad0672 100644
--- a/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsPodStateManagerTest.java
+++ b/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.java
@@ -20,7 +20,7 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
import static org.junit.Assert.assertEquals;
@RunWith(PowerMockRunner.class)
-public class AapsPodStateManagerTest {
+public class AapsErosPodStateManagerTest {
@Mock AAPSLogger aapsLogger;
@Mock SP sp;
@@ -35,7 +35,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis());
- AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus);
+ AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);
@@ -53,7 +53,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis());
- AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus);
+ AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);
@@ -76,7 +76,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis());
- AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus);
+ AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);