Move several parts of Omnipod Eros driver to omnipod-common, did some renaming and added some preliminary Dash stuff

This commit is contained in:
Bart Sopers 2021-02-19 09:40:59 +01:00
parent ad1f450820
commit ecfabccffb
87 changed files with 1456 additions and 1163 deletions

View file

@ -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.insight.LocalInsightFragment
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic 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.pump.virtual.VirtualPumpFragment
import info.nightscout.androidaps.plugins.source.BGSourceFragment import info.nightscout.androidaps.plugins.source.BGSourceFragment
import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment
@ -68,7 +68,7 @@ abstract class FragmentsModule {
@ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment
@ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment
@ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment @ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment
@ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodOverviewFragment @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodErosOverviewFragment
@ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment @ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment
@ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment
@ContributesAndroidInjector @ContributesAndroidInjector

View file

@ -633,7 +633,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
} }
pump.isSuspended -> { 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. // For Omnipod, indicate the pump as disconnected when it's suspended.
// The only way to 'reconnect' it, is through the Omnipod tab // The only way to 'reconnect' it, is through the Omnipod tab
R.drawable.ic_loop_disconnected R.drawable.ic_loop_disconnected

View file

@ -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) 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 (!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") handleOmnipodReservoirLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U")
} else { } else {
handleLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U") 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 (!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) 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) { } 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(), "%") handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%")

View file

@ -98,12 +98,19 @@ public enum PumpType {
// Insulet // 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), // new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
PumpTempBasalType.Absolute, // PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, //
0.05d, null, 0.05d, null, PumpCapability.OmnipodCapabilities, true), 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
Medtronic_512_712("Medtronic 512/712", ManufacturerType.Medtronic, "512/712", 0.1d, null, // Medtronic_512_712("Medtronic 512/712", ManufacturerType.Medtronic, "512/712", 0.1d, null, //
new DoseSettings(0.05d, 30, 8 * 60, 0.05d), // new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //

View file

@ -45,6 +45,7 @@ dependencies {
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "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" kapt "com.google.dagger:dagger-compiler:$dagger_version"
testImplementation "junit:junit:$junit_version" testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.test.ext:junit:$androidx_junit" androidTestImplementation "androidx.test.ext:junit:$androidx_junit"
} }

View file

@ -2,4 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.androidaps.plugins.pump.omnipod.common"> package="info.nightscout.androidaps.plugins.pump.omnipod.common">
<application>
<activity android:name=".ui.wizard.activation.PodActivationWizardActivity" />
<activity android:name=".ui.wizard.deactivation.PodDeactivationWizardActivity" />
</application>
</manifest> </manifest>

View file

@ -1,4 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.common;
public class PlaceHolder {
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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 android.os.Bundle
import androidx.annotation.IdRes import androidx.annotation.IdRes
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
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 javax.inject.Inject import javax.inject.Inject
class PodActivationWizardActivity : OmnipodWizardActivityBase() { class PodActivationWizardActivity : OmnipodWizardActivityBase() {

View file

@ -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.os.Bundle
import android.view.View import android.view.View
@ -7,16 +7,16 @@ import androidx.annotation.IdRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
class AttachPodInfoFragment : InfoFragmentBase() { class AttachPodInfoFragment : InfoFragmentBase() {
@StringRes @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 @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 @IdRes
override fun getNextPageActionId(): Int = R.id.action_attachPodInfoFragment_to_insertCannulaActionFragment override fun getNextPageActionId(): Int = R.id.action_attachPodInfoFragment_to_insertCannulaActionFragment
@ -31,9 +31,9 @@ class AttachPodInfoFragment : InfoFragmentBase() {
AlertDialog.Builder(it) AlertDialog.Builder(it)
.setIcon(android.R.drawable.ic_dialog_alert) .setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(getTitleId())) .setTitle(getString(getTitleId()))
.setMessage(getString(R.string.omnipod_pod_activation_wizard_attach_pod_confirm_insert_cannula_text)) .setMessage(getString(R.string.omnipod_common_pod_activation_wizard_attach_pod_confirm_insert_cannula_text))
.setPositiveButton(getString(R.string.omnipod_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) } .setPositiveButton(getString(R.string.omnipod_common_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) }
.setNegativeButton(getString(R.string.omnipod_cancel), null) .setNegativeButton(getString(R.string.omnipod_common_cancel), null)
.show() .show()
} }
} }

View file

@ -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.IdRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase
class FillPodInfoFragment : InfoFragmentBase() { class FillPodInfoFragment : InfoFragmentBase() {
@StringRes @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 @StringRes
override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_text override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_text

View file

@ -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 android.os.Bundle
import androidx.annotation.IdRes import androidx.annotation.IdRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InitializePodActionViewModel
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InitializePodActionViewModel
import javax.inject.Inject import javax.inject.Inject
class InitializePodActionFragment : PodActivationActionFragmentBase() { class InitializePodActionFragment : PodActivationActionFragmentBase() {
@ -24,7 +23,7 @@ class InitializePodActionFragment : PodActivationActionFragmentBase() {
} }
@StringRes @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 @StringRes
override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_text override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_text

View file

@ -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 android.os.Bundle
import androidx.annotation.IdRes import androidx.annotation.IdRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
import javax.inject.Inject import javax.inject.Inject
class InsertCannulaActionFragment : PodActivationActionFragmentBase() { class InsertCannulaActionFragment : PodActivationActionFragmentBase() {
@ -24,10 +23,10 @@ class InsertCannulaActionFragment : PodActivationActionFragmentBase() {
} }
@StringRes @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 @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 @IdRes
override fun getNextPageActionId(): Int = R.id.action_insertCannulaActionFragment_to_PodActivatedInfoFragment override fun getNextPageActionId(): Int = R.id.action_insertCannulaActionFragment_to_PodActivatedInfoFragment

View file

@ -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
}

View file

@ -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.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.widget.Button import android.widget.Button
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
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 javax.inject.Inject import javax.inject.Inject
abstract class PodActivationActionFragmentBase : ActionFragmentBase() { abstract class PodActivationActionFragmentBase : ActionFragmentBase() {

View file

@ -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.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.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
import javax.inject.Inject import javax.inject.Inject
class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() { class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() {

View file

@ -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.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.ProfileFunction 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.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase
import javax.inject.Inject import javax.inject.Inject
class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() { class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() {

View file

@ -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.appcompat.app.AlertDialog
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment import androidx.navigation.fragment.NavHostFragment
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity 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() { abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() {
@ -20,8 +20,8 @@ abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() {
.setIcon(android.R.drawable.ic_dialog_alert) .setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(R.string.omnipod_common_wizard_exit_confirmation_title)) .setTitle(getString(R.string.omnipod_common_wizard_exit_confirmation_title))
.setMessage(getString(R.string.omnipod_common_wizard_exit_confirmation_text)) .setMessage(getString(R.string.omnipod_common_wizard_exit_confirmation_text))
.setPositiveButton(getString(R.string.omnipod_yes)) { _, _ -> finish() } .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ -> finish() }
.setNegativeButton(getString(R.string.omnipod_no), null) .setNegativeButton(getString(R.string.omnipod_common_no), null)
.show() .show()
} }
} }

View file

@ -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.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
@ -6,8 +6,8 @@ import android.view.View
import android.widget.Button import android.widget.Button
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase
import info.nightscout.androidaps.utils.extensions.toVisibility import info.nightscout.androidaps.utils.extensions.toVisibility
abstract class ActionFragmentBase : WizardFragmentBase() { abstract class ActionFragmentBase : WizardFragmentBase() {

View file

@ -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.os.Bundle
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.annotation.StringRes 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() { abstract class InfoFragmentBase : WizardFragmentBase() {

View file

@ -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.content.res.ColorStateList
import android.os.Bundle import android.os.Bundle
@ -10,9 +10,8 @@ import androidx.annotation.LayoutRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodWizardBaseFragmentBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase
import kotlin.math.roundToInt import kotlin.math.roundToInt
abstract class WizardFragmentBase : DaggerFragment() { abstract class WizardFragmentBase : DaggerFragment() {

View file

@ -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.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
@ -17,7 +17,7 @@ abstract class ActionViewModelBase : ViewModel() {
fun executeAction() { fun executeAction() {
_isActionExecutingLiveData.postValue(true) _isActionExecutingLiveData.postValue(true)
SingleSubject.fromCallable<PumpEnactResult>(this::doExecuteAction) SingleSubject.fromCallable(this::doExecuteAction)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.doOnSuccess { result -> .doOnSuccess { result ->
_isActionExecutingLiveData.postValue(false) _isActionExecutingLiveData.postValue(false)

View file

@ -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 android.os.Bundle
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase
class PodDeactivationWizardActivity : OmnipodWizardActivityBase() { class PodDeactivationWizardActivity : OmnipodWizardActivityBase() {

View file

@ -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.os.Bundle
import android.view.View import android.view.View
@ -9,11 +9,9 @@ import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.findNavController import androidx.navigation.fragment.findNavController
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
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.utils.extensions.toVisibility import info.nightscout.androidaps.utils.extensions.toVisibility
import javax.inject.Inject import javax.inject.Inject
@ -37,18 +35,18 @@ class DeactivatePodActionFragment : ActionFragmentBase() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
buttonDiscardPod = view.findViewById(R.id.button_discard_pod) buttonDiscardPod = view.findViewById(R.id.omnipod_wizard_button_discard_pod)
buttonDiscardPod.setOnClickListener { buttonDiscardPod.setOnClickListener {
context?.let { context?.let {
AlertDialog.Builder(it) AlertDialog.Builder(it)
.setIcon(android.R.drawable.ic_dialog_alert) .setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod)) .setTitle(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod))
.setMessage(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod_confirmation)) .setMessage(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod_confirmation))
.setPositiveButton(getString(R.string.omnipod_yes)) { _, _ -> .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ ->
aapsOmnipodManager.discardPodState() aapsOmnipodManager.discardPodState()
findNavController().navigate(R.id.action_deactivatePodActionFragment_to_podDiscardedInfoFragment) findNavController().navigate(R.id.action_deactivatePodActionFragment_to_podDiscardedInfoFragment)
} }
.setNegativeButton(getString(R.string.omnipod_no), null) .setNegativeButton(getString(R.string.omnipod_common_no), null)
.show() .show()
} }
} }
@ -59,10 +57,10 @@ class DeactivatePodActionFragment : ActionFragmentBase() {
} }
@StringRes @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 @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 @IdRes
override fun getNextPageActionId(): Int = R.id.action_deactivatePodActionFragment_to_podDeactivatedInfoFragment override fun getNextPageActionId(): Int = R.id.action_deactivatePodActionFragment_to_podDeactivatedInfoFragment

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}

View file

@ -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.data.PumpEnactResult
import info.nightscout.androidaps.interfaces.CommandQueueProvider 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.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandDeactivatePod 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 info.nightscout.androidaps.queue.Callback
import io.reactivex.subjects.SingleSubject import io.reactivex.subjects.SingleSubject
import javax.inject.Inject import javax.inject.Inject

View file

@ -106,7 +106,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_pod_address" android:text="@string/omnipod_common_overview_pod_unique_id"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -145,7 +145,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_lot" android:text="@string/omnipod_common_overview_lot_number"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -184,7 +184,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_tid" android:text="@string/omnipod_common_overview_pod_sequence_number"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -223,7 +223,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_firmware_version" android:text="@string/omnipod_common_overview_firmware_version"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -262,7 +262,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_time_on_pod" android:text="@string/omnipod_common_overview_time_on_pod"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -302,7 +302,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_pod_expiry_date" android:text="@string/omnipod_common_overview_pod_expiry_date"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -342,7 +342,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_pod_status" android:text="@string/omnipod_common_overview_pod_status"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -398,7 +398,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_last_connection" android:text="@string/omnipod_common_overview_last_connection"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -446,7 +446,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_last_bolus" android:text="@string/omnipod_common_overview_last_bolus"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -494,7 +494,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_base_basal_rate" android:text="@string/omnipod_common_overview_base_basal_rate"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -542,7 +542,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_temp_basal_rate" android:text="@string/omnipod_common_overview_temp_basal_rate"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -590,7 +590,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_reservoir" android:text="@string/omnipod_common_overview_reservoir"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -638,7 +638,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_total_delivered" android:text="@string/omnipod_common_overview_total_delivered"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -686,7 +686,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_errors" android:text="@string/omnipod_common_overview_errors"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -734,7 +734,7 @@
android:gravity="end" android:gravity="end"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/omnipod_overview_pod_active_alerts" android:text="@string/omnipod_common_overview_pod_active_alerts"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
@ -808,7 +808,7 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_pod_management" android:drawableTop="@drawable/ic_omnipod_overview_pod_management"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding" android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_overview_button_pod_management" /> android:text="@string/omnipod_common_overview_button_pod_management" />
<Button <Button
android:id="@+id/button_acknowledge_active_alerts" android:id="@+id/button_acknowledge_active_alerts"
@ -818,7 +818,7 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_acknowledge_alerts" android:drawableTop="@drawable/ic_omnipod_overview_acknowledge_alerts"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding" android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_overview_button_acknowledge_active_alerts" /> android:text="@string/omnipod_common_overview_button_acknowledge_active_alerts" />
<Button <Button
android:id="@+id/button_set_time" android:id="@+id/button_set_time"
@ -828,7 +828,7 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_set_time" android:drawableTop="@drawable/ic_omnipod_overview_set_time"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding" android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_overview_button_set_time" android:text="@string/omnipod_common_overview_button_set_time"
android:visibility="gone" /> android:visibility="gone" />
<Button <Button
@ -839,7 +839,7 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_resume_delivery" android:drawableTop="@drawable/ic_omnipod_overview_resume_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding" android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_overview_button_resume_delivery" android:text="@string/omnipod_common_overview_button_resume_delivery"
android:visibility="gone" /> android:visibility="gone" />
<Button <Button
@ -850,7 +850,7 @@
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_suspend_delivery" android:drawableTop="@drawable/ic_omnipod_overview_suspend_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding" android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_overview_button_suspend_delivery" android:text="@string/omnipod_common_overview_button_suspend_delivery"
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>

View file

@ -4,7 +4,7 @@
app:startDestination="@id/fillPodInfoFragment"> app:startDestination="@id/fillPodInfoFragment">
<fragment <fragment
android:id="@+id/fillPodInfoFragment" android:id="@+id/fillPodInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.FillPodInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.FillPodInfoFragment"
android:label="FillPodInfoFragment"> android:label="FillPodInfoFragment">
<action <action
android:id="@+id/action_fillPodInfoFragment_to_initializePodActionFragment" android:id="@+id/action_fillPodInfoFragment_to_initializePodActionFragment"
@ -12,7 +12,7 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/initializePodActionFragment" android:id="@+id/initializePodActionFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.InitializePodActionFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.InitializePodActionFragment"
android:label="initializePodActionFragment"> android:label="initializePodActionFragment">
<action <action
android:id="@+id/action_initializePodActionFragment_to_attachPodInfoFragment" android:id="@+id/action_initializePodActionFragment_to_attachPodInfoFragment"
@ -20,7 +20,7 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/attachPodInfoFragment" android:id="@+id/attachPodInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.AttachPodInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.AttachPodInfoFragment"
android:label="AttachPodInfoFragment"> android:label="AttachPodInfoFragment">
<action <action
android:id="@+id/action_attachPodInfoFragment_to_insertCannulaActionFragment" android:id="@+id/action_attachPodInfoFragment_to_insertCannulaActionFragment"
@ -28,7 +28,7 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/insertCannulaActionFragment" android:id="@+id/insertCannulaActionFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.InsertCannulaActionFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.InsertCannulaActionFragment"
android:label="InsertCannulaActionFragment"> android:label="InsertCannulaActionFragment">
<action <action
android:id="@+id/action_insertCannulaActionFragment_to_PodActivatedInfoFragment" android:id="@+id/action_insertCannulaActionFragment_to_PodActivatedInfoFragment"
@ -36,6 +36,6 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/PodActivatedInfoFragment" android:id="@+id/PodActivatedInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.PodActivatedInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment.PodActivatedInfoFragment"
android:label="PodActivatedInfoFragment" /> android:label="PodActivatedInfoFragment" />
</navigation> </navigation>

View file

@ -4,7 +4,7 @@
app:startDestination="@id/deactivatePodInfoFragment"> app:startDestination="@id/deactivatePodInfoFragment">
<fragment <fragment
android:id="@+id/deactivatePodInfoFragment" android:id="@+id/deactivatePodInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.DeactivatePodInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.DeactivatePodInfoFragment"
android:label="DeactivatePodInfoFragment"> android:label="DeactivatePodInfoFragment">
<action <action
android:id="@+id/action_deactivatePodInfoFragment_to_deactivatePodActionFragment" android:id="@+id/action_deactivatePodInfoFragment_to_deactivatePodActionFragment"
@ -12,7 +12,7 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/deactivatePodActionFragment" android:id="@+id/deactivatePodActionFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.DeactivatePodActionFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.DeactivatePodActionFragment"
android:label="DeactivatePodActionFragment"> android:label="DeactivatePodActionFragment">
<action <action
android:id="@+id/action_deactivatePodActionFragment_to_podDeactivatedInfoFragment" android:id="@+id/action_deactivatePodActionFragment_to_podDeactivatedInfoFragment"
@ -23,10 +23,10 @@
</fragment> </fragment>
<fragment <fragment
android:id="@+id/podDeactivatedInfoFragment" android:id="@+id/podDeactivatedInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.PodDeactivatedInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.PodDeactivatedInfoFragment"
android:label="PodDeactivatedInfoFragment" /> android:label="PodDeactivatedInfoFragment" />
<fragment <fragment
android:id="@+id/podDiscardedInfoFragment" android:id="@+id/podDiscardedInfoFragment"
android:name="info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment.PodDiscardedInfoFragment" android:name="info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment.PodDiscardedInfoFragment"
android:label="PodDiscardedInfoFragment" /> android:label="PodDiscardedInfoFragment" />
</navigation> </navigation>

View file

@ -1,6 +1,89 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Omnipod - Wizard common --> <!-- Omnipod - Keys -->
<string name="key_omnipod_common_bolus_beeps_enabled" translatable="false">AAPS.Omnipod.bolus_beeps_enabled</string>
<string name="key_omnipod_common_basal_beeps_enabled" translatable="false">AAPS.Omnipod.basal_beeps_enabled</string>
<string name="key_omnipod_common_smb_beeps_enabled" translatable="false">AAPS.Omnipod.smb_beeps_enabled</string>
<string name="key_omnipod_common_tbr_beeps_enabled" translatable="false">AAPS.Omnipod.tbr_beeps_enabled</string>
<string name="key_omnipod_common_suspend_delivery_button_enabled" translatable="false">AAPS.Omnipod.suspend_delivery_button_enabled</string>
<string name="key_omnipod_common_time_change_event_enabled" translatable="false">AAPS.Omnipod.time_change_enabled</string>
<string name="key_omnipod_common_expiration_reminder_enabled" translatable="false">AAPS.Omnipod.expiration_reminder_enabled</string>
<string name="key_omnipod_common_expiration_reminder_hours_before_shutdown" translatable="false">AAPS.Omnipod.expiration_reminder_hours_before_shutdown</string>
<string name="key_omnipod_common_low_reservoir_alert_enabled" translatable="false">AAPS.Omnipod.low_reservoir_alert_enabled</string>
<string name="key_omnipod_common_low_reservoir_alert_units" translatable="false">AAPS.Omnipod.low_reservoir_alert_units</string>
<string name="key_omnipod_common_automatically_acknowledge_alerts_enabled" translatable="false">AAPS.Omnipod.automatically_acknowledge_alerts_enabled</string>
<!-- Omnipod - Pod Management -->
<string name="omnipod_common_pod_management_title">Pod Management</string>
<string name="omnipod_common_pod_management_heading_actions">Actions</string>
<string name="omnipod_common_pod_management_heading_tools">Tools</string>
<string name="omnipod_common_pod_management_button_activate_pod">Activate Pod</string>
<string name="omnipod_common_pod_management_button_deactivate_pod">Deactivate Pod</string>
<string name="omnipod_common_pod_management_button_discard_pod">Discard Pod</string>
<string name="omnipod_common_pod_management_discard_pod_confirmation">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 <b>Deactivate Pod</b> option.\n\nIf you wish to proceed, please make sure to remove the Pod from your body!</string>
<string name="omnipod_common_pod_management_button_play_test_beep">Play Test Beep</string>
<string name="omnipod_common_pod_management_button_playing_test_beep">Playing Test Beep…</string>
<string name="omnipod_common_pod_management_button_pod_history">Pod History</string>
<!-- Omnipod - Error -->
<string name="omnipod_common_error_pod_not_attached">No active Pod</string>
<string name="omnipod_common_error_set_basal_failed">Setting basal profile failed.</string>
<string name="omnipod_common_error_bolus_did_not_succeed">Bolus did not succeed.</string>
<string name="omnipod_common_error_failed_to_set_profile_empty_profile">Failed to set basal profile: received an empty profile. Make sure to activate your basal profile.</string>
<string name="omnipod_common_error_set_initial_basal_schedule_no_profile">No basal profile is active. Make sure to activate your basal profile.</string>
<string name="omnipod_common_error_unsupported_custom_command">Unsupported custom command: %1$s</string>
<string name="omnipod_common_error_failed_to_refresh_status">Failed to refresh status</string>
<string name="omnipod_common_error_failed_to_refresh_status_on_startup">Failed to refresh status on startup</string>
<string name="omnipod_common_error_failed_to_acknowledge_alerts">Failed to acknowledge alerts</string>
<string name="omnipod_common_error_failed_to_suspend_delivery">Failed to suspend delivery</string>
<string name="omnipod_common_error_failed_to_set_time">Failed to set time</string>
<string name="omnipod_common_error_failed_to_resume_delivery">Failed to resume delivery</string>
<string name="omnipod_common_error_failed_to_initialize_pod">Failed to initialize the Pod</string>
<string name="omnipod_common_error_failed_to_insert_cannula">Failed to insert cannula</string>
<string name="omnipod_common_error_pod_fault_activation_time_exceeded">The Pod\'s activation time has been exceeded. This Pod can no longer be activated.</string>
<string name="omnipod_common_error_failed_to_verify_activation_progress">Failed to verify activation progress. Please retry.</string>
<string name="omnipod_common_error_pod_suspended">Pod suspended</string>
<string name="omnipod_common_error_failed_to_play_test_beep">Failed to play test beep</string>
<string name="omnipod_common_error_time_out_of_sync">The time on the Pod is out of sync. Please update the time in the Omnipod tab.</string>
<string name="omnipod_common_error_unexpected_exception">An unexpected error occurred. Please report! (%1$s: %2$s).</string>
<!-- Omnipod - Confirmation -->
<string name="omnipod_common_confirmation">Confirmation</string>
<string name="omnipod_common_confirmation_time_or_timezone_change">Time and/or time zone changed on the Pod.</string>
<string name="omnipod_common_confirmation_expiration_alerts_updated">Alert configuration has been updated in the Pod.</string>
<string name="omnipod_common_confirmation_time_on_pod_updated">The time on the Pod has been updated.</string>
<string name="omnipod_common_confirmation_suspended_delivery">All insulin delivery has been suspended.</string>
<string name="omnipod_common_confirmation_acknowledged_alerts">Active alerts have been acknowledged.</string>
<string name="omnipod_common_confirmation_delivery_resumed">Insulin delivery has been resumed.</string>
<!-- Omnipod - Overview -->
<string name="omnipod_common_overview_button_set_time">Set time</string>
<string name="omnipod_common_overview_button_suspend_delivery">Suspend</string>
<string name="omnipod_common_overview_button_resume_delivery">Resume Delivery</string>
<string name="omnipod_common_overview_button_pod_management">Pod Mgmt</string>
<string name="omnipod_common_overview_button_acknowledge_active_alerts">Ack Alerts</string>
<string name="omnipod_common_overview_pod_status">Pod Status</string>
<string name="omnipod_common_overview_total_delivered">Total Delivered</string>
<string name="omnipod_common_overview_total_delivered_value">%1$.2f U</string>
<string name="omnipod_common_overview_pod_unique_id">Unique ID</string>
<string name="omnipod_common_overview_lot_number">LOT Number</string>
<string name="omnipod_common_overview_pod_sequence_number">Sequence Number</string>
<string name="omnipod_common_overview_pod_expiry_date">Pod Expires</string>
<string name="omnipod_common_overview_last_connection">Last Connection</string>
<string name="omnipod_common_overview_last_bolus">Last Bolus</string>
<string name="omnipod_common_overview_temp_basal_rate">Temp Basal Rate</string>
<string name="omnipod_common_overview_base_basal_rate">Base Basal Rate</string>
<string name="omnipod_common_overview_reservoir">Reservoir</string>
<string name="omnipod_common_overview_pod_active_alerts">Active Pod Alerts</string>
<string name="omnipod_common_overview_firmware_version">Firmware Version</string>
<string name="omnipod_common_overview_time_on_pod">Time on Pod</string>
<string name="omnipod_common_overview_temp_basal_value">%1$.2fU/h @%2$s (%3$d/%4$d minutes)</string>
<string name="omnipod_common_overview_reservoir_value">%1$.2f U left</string>
<string name="omnipod_common_overview_reservoir_value_over50">Over 50 U left</string>
<string name="omnipod_common_overview_errors">Errors</string>
<string name="omnipod_common_overview_last_bolus_value" translatable="false">%1$.2f %2$s (%3$s)</string>
<!-- Omnipod - Wizard Base -->
<string name="omnipod_common_wizard_button_cancel">Cancel</string> <string name="omnipod_common_wizard_button_cancel">Cancel</string>
<string name="omnipod_common_wizard_button_finish">Finish</string> <string name="omnipod_common_wizard_button_finish">Finish</string>
<string name="omnipod_common_wizard_button_next">Next</string> <string name="omnipod_common_wizard_button_next">Next</string>
@ -9,4 +92,128 @@
<string name="omnipod_common_wizard_button_discard_pod">Discard Pod</string> <string name="omnipod_common_wizard_button_discard_pod">Discard Pod</string>
<string name="omnipod_common_wizard_exit_confirmation_text">You haven\'t completed all steps yet. Are you sure you want to exit?</string> <string name="omnipod_common_wizard_exit_confirmation_text">You haven\'t completed all steps yet. Are you sure you want to exit?</string>
<string name="omnipod_common_wizard_exit_confirmation_title">Exit</string> <string name="omnipod_common_wizard_exit_confirmation_title">Exit</string>
<!-- Omnipod - Pod Activation Wizard -->
<string name="omnipod_common_pod_activation_wizard_fill_pod_title">Fill Pod</string>
<string name="omnipod_common_pod_activation_wizard_initialize_pod_title">Initialize Pod</string>
<string name="omnipod_common_pod_activation_wizard_attach_pod_title">Attach Pod</string>
<string name="omnipod_common_pod_activation_wizard_attach_pod_text">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 <b>Cancel</b> and discard your Pod.\n\nPress <b>Next</b> to insert the cannula and begin basal delivery.</string>
<string name="omnipod_common_pod_activation_wizard_attach_pod_confirm_insert_cannula_text">When you press <b>OK</b>, the cannula will be inserted. Make sure that you have attached the Pod to the infusion site.</string>
<string name="omnipod_common_pod_activation_wizard_insert_cannula_title">Insert Cannula</string>
<string name="omnipod_common_pod_activation_wizard_insert_cannula_text">Trying to set initial basal schedule and insert the cannula.\n\nWhen the cannula has successfully been inserted, you can press <b>Next</b>.</string>
<string name="omnipod_common_pod_activation_wizard_pod_activated_title">Pod Activated</string>
<string name="omnipod_common_pod_activation_wizard_pod_activated_text">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.</string>
<!-- Omnipod - Pod Deactivation Wizard -->
<string name="omnipod_common_pod_deactivation_wizard_deactivate_pod_title">Deactivate Pod</string>
<string name="omnipod_common_pod_deactivation_wizard_deactivate_pod_text">Press <b>Next</b> to deactivate the Pod.\n\n<b>Note:</b> This will suspend all insulin delivery and deactivate the Pod.</string>
<string name="omnipod_common_pod_deactivation_wizard_deactivating_pod_title">Deactivating Pod</string>
<string name="omnipod_common_pod_deactivation_wizard_deactivating_pod_text">Deactivating the Pod.\n\nWhen deactivation has completed successfully, you can press <b>Next</b>.</string>
<string name="omnipod_common_pod_deactivation_wizard_pod_deactivated_title">Pod Deactivated</string>
<string name="omnipod_common_pod_deactivation_wizard_pod_deactivated_text">Your Pod has been deactivated.\n\nPlease remove the Pod from your body and recycle it.</string>
<string name="omnipod_common_pod_deactivation_wizard_pod_discarded_title">Pod Discarded</string>
<string name="omnipod_common_pod_deactivation_wizard_pod_discarded_text">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.</string>
<string name="omnipod_common_pod_deactivation_wizard_discard_pod_confirmation">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?</string>
<string name="omnipod_common_pod_deactivation_wizard_discard_pod">Discard Pod</string>
<!-- Omnipod - Preferences -->
<string name="omnipod_common_preferences_bolus_beeps_enabled">Bolus beeps enabled</string>
<string name="omnipod_common_preferences_basal_beeps_enabled">Basal beeps enabled</string>
<string name="omnipod_common_preferences_smb_beeps_enabled">SMB beeps enabled</string>
<string name="omnipod_common_preferences_tbr_beeps_enabled">TBR beeps enabled</string>
<string name="omnipod_common_preferences_suspend_delivery_button_enabled">Show Suspend Delivery button in Omnipod tab</string>
<string name="omnipod_common_preferences_time_change_enabled">DST/Time zone detection enabled</string>
<string name="omnipod_common_preferences_expiration_reminder_enabled">Expiration reminder enabled</string>
<string name="omnipod_common_preferences_expiration_reminder_hours_before_shutdown">Hours before shutdown</string>
<string name="omnipod_common_preferences_low_reservoir_alert_enabled">Low reservoir alert enabled</string>
<string name="omnipod_common_preferences_low_reservoir_alert_units">Number of units</string>
<string name="omnipod_common_preferences_automatically_acknowledge_alerts">Automatically acknowledge Pod alerts</string>
<string name="omnipod_common_preferences_category_other">Other</string>
<string name="omnipod_common_preferences_category_alerts">Alerts</string>
<string name="omnipod_common_preferences_category_confirmation_beeps">Confirmation Beeps</string>
<!-- Omnipod - Pod Status -->
<string name="omnipod_common_pod_status_no_active_pod">No Active Pod</string>
<string name="omnipod_common_pod_status_waiting_for_activation">Setup in progress (waiting for Pod activation)</string>
<string name="omnipod_common_pod_status_waiting_for_cannula_insertion">Setup in progress (waiting for cannula insertion)</string>
<string name="omnipod_common_pod_status_running">Running</string>
<string name="omnipod_common_pod_status_suspended">Suspended</string>
<string name="omnipod_common_pod_status_pod_fault">Pod Fault</string>
<string name="omnipod_common_pod_status_activation_time_exceeded">Activation time exceeded</string>
<string name="omnipod_common_pod_status_inactive">Inactive</string>
<string name="omnipod_common_pod_status_pod_fault_description">Pod Fault: %1$03d %2$s</string>
<!-- Omnipod - Commands -->
<string name="omnipod_common_cmd_deactivate_pod">Deactivate Pod</string>
<string name="omnipod_common_cmd_discard_pod">Discard Pod</string>
<string name="omnipod_common_cmd_set_bolus">Set Bolus</string>
<string name="omnipod_common_cmd_cancel_bolus">Cancel Bolus</string>
<string name="omnipod_common_cmd_set_tbr">Set Temporary Basal</string>
<string name="omnipod_common_cmd_cancel_tbr_by_driver">Cancel Temporary Basal (internally by driver)</string>
<string name="omnipod_common_cmd_cancel_tbr">Cancel Temporary Basal</string>
<string name="omnipod_common_cmd_set_basal_schedule">Set Basal Schedule</string>
<string name="omnipod_common_cmd_get_pod_status">Get Pod Status</string>
<string name="omnipod_common_cmd_get_pod_info">Get Pod Info</string>
<string name="omnipod_common_cmd_set_time">Set Time</string>
<string name="omnipod_common_cmd_configure_alerts">Configure Alerts</string>
<string name="omnipod_common_cmd_acknowledge_alerts">Acknowledge Alerts</string>
<string name="omnipod_common_cmd_suspend_delivery">Suspend Delivery</string>
<string name="omnipod_common_cmd_resume_delivery">Resume Delivery</string>
<string name="omnipod_common_cmd_unknown_entry">Unknown Entry</string>
<string name="omnipod_common_cmd_initialize_pod">Initialize Pod</string>
<string name="omnipod_common_cmd_insert_cannula">Insert Cannula</string>
<string name="omnipod_common_cmd_read_pulse_log">Read Pulse Log</string>
<string name="omnipod_common_cmd_set_fake_suspended_tbr">Set fake temporary basal because the Pod is suspended</string>
<string name="omnipod_common_cmd_cancel_fake_suspended_tbr">Cancel fake temporary basal that was created because the Pod was suspended</string>
<string name="omnipod_common_cmd_split_tbr">Split temporary basal because of uncertain failure in cancellation</string>
<string name="omnipod_common_cmd_beep_config">Beep Config</string>
<string name="omnipod_common_cmd_play_test_beep">Play Test Beep</string>
<!-- Omnipod - Alerts -->
<string name="omnipod_common_alert_finish_pairing_reminder">Finish pairing reminder</string>
<string name="omnipod_common_alert_finish_setup_reminder_reminder">Finish setup reminder</string>
<string name="omnipod_common_alert_expiration">Pod will expire soon</string>
<string name="omnipod_common_alert_expiration_advisory">Pod will expire soon</string>
<string name="omnipod_common_alert_shutdown_imminent">Shutdown is imminent</string>
<string name="omnipod_common_alert_low_reservoir">Low Reservoir</string>
<string name="omnipod_common_alert_unknown_alert">Unknown Alert</string>
<!-- Omnipod - Short status -->
<string name="omnipod_common_short_status_no_active_pod">No Active Pod</string>
<string name="omnipod_common_short_status_last_connection">LastConn: %1$d min ago</string>
<string name="omnipod_common_short_status_last_bolus">LastBolus: %1$s @ %2$s</string>
<string name="omnipod_common_short_status_temp_basal">Temp: %1$s</string>
<string name="omnipod_common_short_status_extended_bolus">Extended: %1$s</string>
<string name="omnipod_common_short_status_reservoir">Reserv: %1$sU</string>
<!-- Omnipod - Other -->
<string name="omnipod_common_yes">Yes</string>
<string name="omnipod_common_no">No</string>
<string name="omnipod_common_ok">OK</string>
<string name="omnipod_common_cancel">Cancel</string>
<string name="omnipod_common_warning">Warning</string>
<string name="omnipod_common_two_strings_concatenated_by_colon" translatable="false">%1$s: %2$s</string>
<!-- Omnipod - Times -->
<string name="omnipod_common_time_with_timezone" translatable="false">%1$s (%2$s)</string>
<string name="omnipod_common_moments_ago">Moments ago</string>
<string name="omnipod_common_less_than_a_minute_ago">Less than a minute ago</string>
<string name="omnipod_common_composite_time">%1$s and %2$s</string>
<string name="omnipod_common_time_ago">%1$s ago</string>
<plurals name="omnipod_common_minutes">
<item quantity="one">%1$d minute</item>
<item quantity="other">%1$d minutes</item>
</plurals>
<plurals name="omnipod_common_hours">
<item quantity="one">%1$d hour</item>
<item quantity="other">%1$d hours</item>
</plurals>
<plurals name="omnipod_common_days">
<item quantity="one">%1$d day</item>
<item quantity="other">%1$d days</item>
</plurals>
<plurals name="omnipod_common_pod_alerts">
<item quantity="one">Pod Alert: %1$s</item>
<item quantity="other">Pod Alerts: %1$s</item>
</plurals>
</resources> </resources>

View file

@ -1,4 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="info.nightscout.androidaps.plugins.pump.omnipod.dash"> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.androidaps.plugins.pump.omnipod.dash">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest> </manifest>

View file

@ -1,5 +1,170 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash; package info.nightscout.androidaps.plugins.pump.omnipod.dash;
public class OmnipodDashPumpPlugin { import androidx.annotation.Nullable;
// TODO
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<CustomAction> getCustomActions() {
return null;
}
@Override public void executeCustomAction(CustomActionType customActionType) {
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
@Override public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
}
} }

View file

@ -0,0 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver;
public interface OmnipodDashManager {
}

View file

@ -0,0 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm;
public interface OmnipodDashCommunicationManager {
}

View file

@ -0,0 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state;
public interface OmnipodDashPodStateManager {
}

View file

@ -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
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Omnipod Dash - Description -->
<string name="omnipod_dash_name" translatable="false">Dash</string>
<string name="omnipod_dash_name_short" translatable="false">Dash</string>
<string name="omnipod_dash_pump_description">Pump integration for Omnipod Dash (the new, Bluetooth-enabled model with a blue needle cap).</string>
<!-- Omnipod Dash - Keys -->
<string name="key_omnipod_dash_pod_state" translatable="false">AAPS.OmnipodDash.pod_state</string>
</resources>

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_confirmation_beeps">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_bolus_beeps_enabled"
android:title="@string/omnipod_common_preferences_bolus_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_basal_beeps_enabled"
android:title="@string/omnipod_common_preferences_basal_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_smb_beeps_enabled"
android:title="@string/omnipod_common_preferences_smb_beeps_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_tbr_beeps_enabled"
android:title="@string/omnipod_common_preferences_tbr_beeps_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_alerts">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_expiration_reminder_enabled"
android:title="@string/omnipod_common_preferences_expiration_reminder_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="9"
android:dependency="@string/key_omnipod_common_expiration_reminder_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_common_expiration_reminder_hours_before_shutdown"
android:title="@string/omnipod_common_preferences_expiration_reminder_hours_before_shutdown"
validate:maxNumber="24"
validate:minNumber="2"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_low_reservoir_alert_enabled"
android:title="@string/omnipod_common_preferences_low_reservoir_alert_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="20"
android:dependency="@string/key_omnipod_common_low_reservoir_alert_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_common_low_reservoir_alert_units"
android:title="@string/omnipod_common_preferences_low_reservoir_alert_units"
validate:maxNumber="50"
validate:minNumber="5"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_automatically_acknowledge_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_acknowledge_alerts" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_other">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_suspend_delivery_button_enabled"
android:title="@string/omnipod_common_preferences_suspend_delivery_button_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_time_change_event_enabled"
android:title="@string/omnipod_common_preferences_time_change_enabled" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -7,9 +7,7 @@
android:enabled="true" android:enabled="true"
android:exported="true" /> android:exported="true" />
<activity android:name=".ui.PodManagementActivity" /> <activity android:name=".ui.ErosPodManagementActivity" />
<activity android:name=".ui.PodHistoryActivity" /> <activity android:name=".ui.ErosPodHistoryActivity" />
<activity android:name=".ui.wizard.activation.PodActivationWizardActivity" />
<activity android:name=".ui.wizard.deactivation.PodDeactivationWizardActivity" />
</application> </application>
</manifest> </manifest>

View file

@ -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.defs.RileyLinkPumpInfo;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; 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.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.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod; 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.OmnipodErosCommandType;
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.communication.action.service.ExpirationReminderBuilder; 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.communication.message.response.podinfo.PodInfoRecentPulseLog;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress; 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.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodTbrChanged; 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.event.EventOmnipodUncertainTbrRecovered;
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.queue.command.CommandAcknowledgeAlerts; 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.CommandReadPulseLog;
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.rileylink.manager.OmnipodRileyLinkCommunicationManager; 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.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.AapsOmnipodUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil;
import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.Callback;
@ -123,7 +126,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private final PodStateManager podStateManager; private final PodStateManager podStateManager;
private final RileyLinkServiceData rileyLinkServiceData; private final RileyLinkServiceData rileyLinkServiceData;
private final AapsOmnipodManager aapsOmnipodManager; private final AapsOmnipodErosManager aapsOmnipodErosManager;
private final AapsOmnipodUtil aapsOmnipodUtil; private final AapsOmnipodUtil aapsOmnipodUtil;
private final RileyLinkUtil rileyLinkUtil; private final RileyLinkUtil rileyLinkUtil;
private final OmnipodAlertUtil omnipodAlertUtil; private final OmnipodAlertUtil omnipodAlertUtil;
@ -140,7 +143,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private final PumpDescription pumpDescription; private final PumpDescription pumpDescription;
private final ServiceConnection serviceConnection; private final ServiceConnection serviceConnection;
private final OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager; 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 CompositeDisposable disposables = new CompositeDisposable();
private final NSUpload nsUpload; private final NSUpload nsUpload;
@ -168,7 +171,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
ActivePluginProvider activePlugin, ActivePluginProvider activePlugin,
SP sp, SP sp,
PodStateManager podStateManager, PodStateManager podStateManager,
AapsOmnipodManager aapsOmnipodManager, AapsOmnipodErosManager aapsOmnipodErosManager,
CommandQueueProvider commandQueue, CommandQueueProvider commandQueue,
FabricPrivacy fabricPrivacy, FabricPrivacy fabricPrivacy,
RileyLinkServiceData rileyLinkServiceData, RileyLinkServiceData rileyLinkServiceData,
@ -182,12 +185,12 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
) { ) {
super(new PluginDescription() // super(new PluginDescription() //
.mainType(PluginType.PUMP) // .mainType(PluginType.PUMP) //
.fragmentClass(OmnipodOverviewFragment.class.getName()) // .fragmentClass(OmnipodErosOverviewFragment.class.getName()) //
.pluginIcon(R.drawable.ic_pod_128) .pluginIcon(R.drawable.ic_pod_128)
.pluginName(R.string.omnipod_name) // .pluginName(R.string.omnipod_eros_name) //
.shortName(R.string.omnipod_name_short) // .shortName(R.string.omnipod_eros_name_short) //
.preferencesId(R.xml.pref_omnipod) // .preferencesId(R.xml.omnipod_eros_preferences) //
.description(R.string.omnipod_pump_description), // .description(R.string.omnipod_eros_pump_description), //
injector, aapsLogger, resourceHelper, commandQueue); injector, aapsLogger, resourceHelper, commandQueue);
this.aapsLogger = aapsLogger; this.aapsLogger = aapsLogger;
this.aapsSchedulers = aapsSchedulers; this.aapsSchedulers = aapsSchedulers;
@ -200,7 +203,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
this.dateUtil = dateUtil; this.dateUtil = dateUtil;
this.podStateManager = podStateManager; this.podStateManager = podStateManager;
this.rileyLinkServiceData = rileyLinkServiceData; this.rileyLinkServiceData = rileyLinkServiceData;
this.aapsOmnipodManager = aapsOmnipodManager; this.aapsOmnipodErosManager = aapsOmnipodErosManager;
this.aapsOmnipodUtil = aapsOmnipodUtil; this.aapsOmnipodUtil = aapsOmnipodUtil;
this.rileyLinkUtil = rileyLinkUtil; this.rileyLinkUtil = rileyLinkUtil;
this.omnipodAlertUtil = omnipodAlertUtil; this.omnipodAlertUtil = omnipodAlertUtil;
@ -242,9 +245,9 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override public void run() { @Override public void run() {
if (commandQueue.size() == 0) { if (commandQueue.size() == 0) {
if (podStateManager.isPodRunning() && !podStateManager.isSuspended()) { if (podStateManager.isPodRunning() && !podStateManager.isSuspended()) {
aapsOmnipodManager.cancelSuspendedFakeTbrIfExists(); aapsOmnipodErosManager.cancelSuspendedFakeTbrIfExists();
} else { } else {
aapsOmnipodManager.createSuspendedFakeTbrIfNotExists(); aapsOmnipodErosManager.createSuspendedFakeTbrIfNotExists();
} }
if (OmnipodErosPumpPlugin.this.hasTimeDateOrTimeZoneChanged) { if (OmnipodErosPumpPlugin.this.hasTimeDateOrTimeZoneChanged) {
@ -254,7 +257,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null); 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)) { podStateManager.getActiveAlerts().size() > 0 && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
queueAcknowledgeAlertsCommand(); queueAcknowledgeAlertsCommand();
} }
@ -314,25 +317,25 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.toObservable(EventPreferenceChange.class) .toObservable(EventPreferenceChange.class)
.observeOn(aapsSchedulers.getIo()) .observeOn(aapsSchedulers.getIo())
.subscribe(event -> { .subscribe(event -> {
if (event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BASAL_BEEPS_ENABLED) || if (event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BASAL_BEEPS_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BOLUS_BEEPS_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BOLUS_BEEPS_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.TBR_BEEPS_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SMB_BEEPS_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SMB_BEEPS_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED)) { event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED)) {
aapsOmnipodManager.reloadSettings(); aapsOmnipodErosManager.reloadSettings();
} else if (event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED) || } else if (event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED) || event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED) ||
event.isChanged(getResourceHelper(), OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS)) { event.isChanged(getResourceHelper(), OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS)) {
if (!verifyPodAlertConfiguration()) { if (!verifyPodAlertConfiguration()) {
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null); getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null);
} }
@ -347,16 +350,16 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
// If so, add it to history // If so, add it to history
// Needs to be done after EventAppInitialized because otherwise, TreatmentsPlugin.onStart() hasn't been called yet // 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 // so it didn't initialize a TreatmentService yet, resulting in a NullPointerException
if (sp.contains(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS)) { if (sp.contains(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS)) {
String activeBolusString = sp.getString(OmnipodStorageKeys.Preferences.ACTIVE_BOLUS, ""); String activeBolusString = sp.getString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, "");
aapsLogger.warn(LTag.PUMP, "Found active bolus in SP: {}. Adding Treatment.", activeBolusString); aapsLogger.warn(LTag.PUMP, "Found active bolus in SP: {}. Adding Treatment.", activeBolusString);
try { try {
ActiveBolus activeBolus = aapsOmnipodUtil.getGsonInstance().fromJson(activeBolusString, ActiveBolus.class); ActiveBolus activeBolus = aapsOmnipodUtil.getGsonInstance().fromJson(activeBolusString, ActiveBolus.class);
aapsOmnipodManager.addBolusToHistory(activeBolus.toDetailedBolusInfo(aapsLogger)); aapsOmnipodErosManager.addBolusToHistory(activeBolus.toDetailedBolusInfo(aapsLogger));
} catch (Exception ex) { } catch (Exception ex) {
aapsLogger.error(LTag.PUMP, "Failed to add active bolus to history", 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) }, fabricPrivacy::logException)
); );
@ -367,8 +370,8 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
} }
private void handleCancelledTbr() { private void handleCancelledTbr() {
if (!podStateManager.isTempBasalRunning() && activePlugin.getActiveTreatments().isTempBasalInProgress() && !aapsOmnipodManager.hasSuspendedFakeTbr()) { if (!podStateManager.isTempBasalRunning() && activePlugin.getActiveTreatments().isTempBasalInProgress() && !aapsOmnipodErosManager.hasSuspendedFakeTbr()) {
aapsOmnipodManager.reportCancelledTbr(); aapsOmnipodErosManager.reportCancelledTbr();
} }
} }
@ -378,7 +381,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
if (podStateManager.isTempBasalRunning() && tempBasal == null) { if (podStateManager.isTempBasalRunning() && tempBasal == null) {
if (podStateManager.hasTempBasal()) { if (podStateManager.hasTempBasal()) {
aapsLogger.warn(LTag.PUMP, "Registering TBR that AAPS was unaware of"); 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())); new TempBasalPair(podStateManager.getTempBasalAmount(), false, (int) podStateManager.getTempBasalDuration().getStandardMinutes()));
TemporaryBasal temporaryBasal = new TemporaryBasal(getInjector()) // TemporaryBasal temporaryBasal = new TemporaryBasal(getInjector()) //
@ -392,7 +395,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
} else { } else {
// Not sure what's going on. Notify the user // Not sure what's going on. Notify the user
aapsLogger.error(LTag.PUMP, "Unknown TBR in both Pod state and AAPS"); 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) { } else if (!podStateManager.isTempBasalRunning() && tempBasal != null) {
aapsLogger.warn(LTag.PUMP, "Removing AAPS TBR that actually hadn't succeeded"); 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(); AlertSet activeAlerts = podStateManager.getActiveAlerts();
if (activeAlerts.size() > 0) { if (activeAlerts.size() > 0) {
String alerts = TextUtils.join(", ", aapsOmnipodUtil.getTranslatedActiveAlerts(podStateManager)); 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); Notification notification = new Notification(Notification.OMNIPOD_POD_ALERTS, notificationText, Notification.URGENT);
rxBus.send(new EventNewNotification(notification)); rxBus.send(new EventNewNotification(notification));
nsUpload.uploadError(notificationText); nsUpload.uploadError(notificationText);
if (aapsOmnipodManager.isAutomaticallyAcknowledgeAlertsEnabled() && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) { if (aapsOmnipodErosManager.isAutomaticallyAcknowledgeAlertsEnabled() && !getCommandQueue().isCustomCommandInQueue(CommandAcknowledgeAlerts.class)) {
queueAcknowledgeAlertsCommand(); queueAcknowledgeAlertsCommand();
} }
} }
@ -421,7 +424,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private void handlePodFaultEvent() { private void handlePodFaultEvent() {
if (podStateManager.isPodFaulted()) { 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); nsUpload.uploadError(notificationText);
} }
} }
@ -451,19 +454,19 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private void updatePodWarningNotifications() { private void updatePodWarningNotifications() {
if (System.currentTimeMillis() > this.nextPodWarningCheck) { if (System.currentTimeMillis() > this.nextPodWarningCheck) {
if (!podStateManager.isPodRunning()) { 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)); rxBus.send(new EventNewNotification(notification));
} else { } else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED)); rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED));
if (podStateManager.isSuspended()) { 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)); rxBus.send(new EventNewNotification(notification));
} else { } else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED)); rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) { 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)); rxBus.send(new EventNewNotification(notification));
} else { } else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_TIME_OUT_OF_SYNC)); 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() { @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 connectedModel = "Eros";
String serialNumber = podStateManager.isPodInitialized() ? String.valueOf(podStateManager.getAddress()) : "-"; String serialNumber = podStateManager.isPodInitialized() ? String.valueOf(podStateManager.getAddress()) : "-";
return new RileyLinkPumpInfo(frequency, connectedModel, serialNumber); return new RileyLinkPumpInfo(frequency, connectedModel, serialNumber);
@ -578,13 +581,13 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
} }
private PumpEnactResult getPodStatus() { private PumpEnactResult getPodStatus() {
return executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus); return executeCommand(OmnipodErosCommandType.GET_POD_STATUS, aapsOmnipodErosManager::getPodStatus);
} }
@NonNull @NonNull
@Override @Override
public PumpEnactResult setNewBasalProfile(Profile profile) { 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); 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 // When we activate a new Pod, we just use ProfileFunction to set the currently active profile
return true; return true;
} }
return Objects.equals(podStateManager.getBasalSchedule(), AapsOmnipodManager.mapProfileToBasalSchedule(profile)); return Objects.equals(podStateManager.getBasalSchedule(), AapsOmnipodErosManager.mapProfileToBasalSchedule(profile));
} }
@Override @Override
@ -628,7 +631,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override @Override
public int getBatteryLevel() { public int getBatteryLevel() {
if (aapsOmnipodManager.isShowRileyLinkBatteryLevel()) { if (aapsOmnipodErosManager.isShowRileyLinkBatteryLevel()) {
return Optional.ofNullable(rileyLinkServiceData.batteryLevel).orElse(0); return Optional.ofNullable(rileyLinkServiceData.batteryLevel).orElse(0);
} }
@ -656,7 +659,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override @Override
public void stopBolusDelivering() { 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), // 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); aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute: rate: {}, duration={}", absoluteRate, durationInMinutes);
if (durationInMinutes <= 0 || durationInMinutes % BASAL_STEP_DURATION.getStandardMinutes() != 0) { 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 // 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); aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute - setTBR. Response: " + result.success);
if (result.success) { if (result.success) {
incrementStatistics(OmnipodStorageKeys.Statistics.TBRS_SET); incrementStatistics(OmnipodErosStorageKeys.Statistics.TBRS_SET);
} }
return result; return result;
@ -707,7 +710,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return new PumpEnactResult(getInjector()).success(true).enacted(false); 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) // TODO improve (i8n and more)
@ -795,30 +798,30 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@NonNull @Override @NonNull @Override
public String shortStatus(boolean veryShort) { public String shortStatus(boolean veryShort) {
if (!podStateManager.isPodActivationCompleted()) { 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 = ""; String ret = "";
if (lastConnectionTimeMillis != 0) { if (lastConnectionTimeMillis != 0) {
long agoMsec = System.currentTimeMillis() - lastConnectionTimeMillis; long agoMsec = System.currentTimeMillis() - lastConnectionTimeMillis;
int agoMin = (int) (agoMsec / 60d / 1000d); 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) { 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"; android.text.format.DateFormat.format("HH:mm", podStateManager.getLastBolusStartTime().toDate())) + "\n";
} }
TemporaryBasal activeTemp = activePlugin.getActiveTreatments().getRealTempBasalFromHistory(System.currentTimeMillis()); TemporaryBasal activeTemp = activePlugin.getActiveTreatments().getRealTempBasalFromHistory(System.currentTimeMillis());
if (activeTemp != null) { 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( ExtendedBolus activeExtendedBolus = activePlugin.getActiveTreatments().getExtendedBolusFromHistory(
System.currentTimeMillis()); System.currentTimeMillis());
if (activeExtendedBolus != null) { 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()) { 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(); return ret.trim();
} }
@ -835,52 +838,50 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override @Override
public PumpEnactResult executeCustomCommand(CustomCommand command) { public PumpEnactResult executeCustomCommand(CustomCommand command) {
if (!(command instanceof OmnipodCustomCommand)) { if (command instanceof CommandAcknowledgeAlerts) {
aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + command.getClass().getName()); return executeCommand(OmnipodErosCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodErosManager::acknowledgeAlerts);
return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, command.getClass().getName()));
} }
if (command instanceof CommandGetPodStatus) {
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(); 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));
} }
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()));
}
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() { private PumpEnactResult retrievePulseLog() {
PodInfoRecentPulseLog result; PodInfoRecentPulseLog result;
try { try {
result = executeCommand(OmnipodCommandType.READ_POD_PULSE_LOG, aapsOmnipodManager::readPulseLog); result = executeCommand(OmnipodErosCommandType.READ_POD_PULSE_LOG, aapsOmnipodErosManager::readPulseLog);
} catch (Exception ex) { } 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); Intent i = new Intent(context, ErrorHelperActivity.class);
i.putExtra("soundid", 0); i.putExtra("soundid", 0);
i.putExtra("status", resourceHelper.gs(R.string.omnipod_pulse_log_value) + ":\n" + result.toString()); 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_pulse_log)); i.putExtra("title", resourceHelper.gs(R.string.omnipod_eros_pod_management_pulse_log));
i.putExtra("clipboardContent", result.toString()); i.putExtra("clipboardContent", result.toString());
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i); context.startActivity(i);
@ -897,7 +898,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) // .lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) //
.build(); .build();
PumpEnactResult result = executeCommand(OmnipodCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodManager.configureAlerts(alertConfigurations)); PumpEnactResult result = executeCommand(OmnipodErosCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodErosManager.configureAlerts(alertConfigurations));
if (result.success) { if (result.success) {
aapsLogger.info(LTag.PUMP, "Successfully configured alerts in Pod"); 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 notification = new Notification(
Notification.OMNIPOD_POD_ALERTS_UPDATED, 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); Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification)); rxBus.send(new EventNewNotification(notification));
} else { } else {
@ -921,8 +922,8 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
aapsLogger.debug(LTag.PUMP, "Setting time, requestedByUser={}", requestedByUser); aapsLogger.debug(LTag.PUMP, "Setting time, requestedByUser={}", requestedByUser);
PumpEnactResult result; PumpEnactResult result;
if (requestedByUser || aapsOmnipodManager.isTimeChangeEventEnabled()) { if (requestedByUser || aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
result = executeCommand(OmnipodCommandType.SET_TIME, () -> aapsOmnipodManager.setTime(!requestedByUser)); result = executeCommand(OmnipodErosCommandType.SET_TIME, () -> aapsOmnipodErosManager.setTime(!requestedByUser));
} else { } else {
// Even if automatically changing the time is disabled, we still want to at least do a GetStatus request, // 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 // 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; this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0; timeChangeRetries = 0;
if (!requestedByUser && aapsOmnipodManager.isTimeChangeEventEnabled()) { if (!requestedByUser && aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification( Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE, 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); Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification)); rxBus.send(new EventNewNotification(notification));
} }
@ -946,10 +947,10 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
timeChangeRetries++; timeChangeRetries++;
if (timeChangeRetries > 3) { if (timeChangeRetries > 3) {
if (aapsOmnipodManager.isTimeChangeEventEnabled()) { if (aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification( Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE, 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); Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification)); rxBus.send(new EventNewNotification(notification));
} }
@ -964,7 +965,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override @Override
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) { 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) { if (timeChangeType == TimeChangeType.TimeChanged) {
aapsLogger.info(LTag.PUMP, "Ignoring time change because it is not a DST or TZ change"); 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() { public boolean isUseRileyLinkBatteryLevel() {
return aapsOmnipodManager.isShowRileyLinkBatteryLevel(); return aapsOmnipodErosManager.isShowRileyLinkBatteryLevel();
} }
public boolean isBatteryChangeLoggingEnabled() { public boolean isBatteryChangeLoggingEnabled() {
return aapsOmnipodManager.isBatteryChangeLoggingEnabled(); return aapsOmnipodErosManager.isBatteryChangeLoggingEnabled();
} }
private void initializeAfterRileyLinkConnection() { private void initializeAfterRileyLinkConnection() {
@ -1082,7 +1083,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
} }
if (!success) { if (!success) {
aapsLogger.warn(LTag.PUMP, "Failed to retrieve Pod status on startup"); 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 { } else {
aapsLogger.debug(LTag.PUMP, "Not retrieving Pod status on startup: no Pod running"); 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) { @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) { if (result.success) {
incrementStatistics(detailedBolusInfo.isSMB ? OmnipodStorageKeys.Statistics.SMB_BOLUSES_DELIVERED incrementStatistics(detailedBolusInfo.isSMB ? OmnipodErosStorageKeys.Statistics.SMB_BOLUSES_DELIVERED
: OmnipodStorageKeys.Statistics.STANDARD_BOLUSES_DELIVERED); : OmnipodErosStorageKeys.Statistics.STANDARD_BOLUSES_DELIVERED);
result.carbsDelivered(detailedBolusInfo.carbs); result.carbsDelivered(detailedBolusInfo.carbs);
} }
@ -1104,7 +1105,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return result; return result;
} }
private <T> T executeCommand(OmnipodCommandType commandType, Supplier<T> supplier) { private <T> T executeCommand(OmnipodErosCommandType commandType, Supplier<T> supplier) {
try { try {
aapsLogger.debug(LTag.PUMP, "Executing command: {}", commandType); aapsLogger.debug(LTag.PUMP, "Executing command: {}", commandType);

View file

@ -3,14 +3,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger
import dagger.Module import dagger.Module
import dagger.Provides import dagger.Provides
import dagger.android.ContributesAndroidInjector 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.data.RLHistoryItemOmnipod
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager 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.rileylink.manager.OmnipodRileyLinkCommunicationManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.PodHistoryActivity import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.ErosPodHistoryActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.PodManagementActivity import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.ErosPodManagementActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.PodActivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.PodDeactivationWizardActivity
@Module @Module
@Suppress("unused") @Suppress("unused")
@ -18,8 +18,8 @@ abstract class OmnipodErosModule {
// Activities // Activities
@ContributesAndroidInjector @ContributesAndroidInjector
abstract fun contributesPodManagementActivity(): PodManagementActivity abstract fun contributesPodManagementActivity(): ErosPodManagementActivity
@ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): PodHistoryActivity @ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): ErosPodHistoryActivity
@ActivityScope @ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class]) @ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
@ -39,6 +39,6 @@ abstract class OmnipodErosModule {
companion object { companion object {
@Provides @Provides
fun podStateManagerProvider(aapsPodStateManager: AapsPodStateManager): PodStateManager = aapsPodStateManager fun podStateManagerProvider(aapsErosPodStateManager: AapsErosPodStateManager): PodStateManager = aapsErosPodStateManager
} }
} }

View file

@ -7,18 +7,18 @@ import dagger.Module
import dagger.Provides import dagger.Provides
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
import dagger.multibindings.IntoMap import dagger.multibindings.IntoMap
import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment.AttachPodInfoFragment import info.nightscout.androidaps.plugins.pump.omnipod.common.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.common.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.common.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.common.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.common.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.common.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.common.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.common.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.common.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.common.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.common.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.deactivation.viewmodel.DeactivatePodActionViewModel
import javax.inject.Provider import javax.inject.Provider
@Module @Module

View file

@ -7,15 +7,15 @@ import javax.inject.Inject;
import dagger.android.HasAndroidInjector; import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; 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.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; import info.nightscout.androidaps.utils.resources.ResourceHelper;
public class RLHistoryItemOmnipod extends RLHistoryItem { public class RLHistoryItemOmnipod extends RLHistoryItem {
@Inject ResourceHelper resourceHelper; @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); super(new LocalDateTime(), RLHistoryItemSource.OmnipodCommand, RileyLinkTargetDevice.Omnipod);
injector.androidInjector().inject(this); injector.androidInjector().inject(this);
this.omnipodCommandType = omnipodCommandType; this.omnipodCommandType = omnipodCommandType;

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -2,33 +2,33 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.definition;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
public class OmnipodStorageKeys { public class OmnipodErosStorageKeys {
public static class Preferences { public static class Preferences {
public static final int POD_STATE = R.string.key_omnipod_pod_state; public static final int POD_STATE = R.string.key_omnipod_eros_pod_state;
public static final int ACTIVE_BOLUS = R.string.key_omnipod_current_bolus; public static final int ACTIVE_BOLUS = R.string.key_omnipod_eros_current_bolus;
public static final int BASAL_BEEPS_ENABLED = R.string.key_omnipod_basal_beeps_enabled; 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_bolus_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_smb_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_tbr_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_suspend_delivery_button_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_pulse_log_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_time_change_event_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_expiration_reminder_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_expiration_reminder_hours_before_shutdown; 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_low_reservoir_alert_enabled; 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_low_reservoir_alert_units; 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_notification_uncertain_tbr_sound_enabled; 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_notification_uncertain_smb_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_notification_uncertain_bolus_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_automatically_acknowledge_alerts_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_riley_link_stats_button_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 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 class Statistics {
public static final int TBRS_SET = R.string.key_omnipod_tbrs_set; public static final int TBRS_SET = R.string.key_omnipod_eros_tbrs_set;
public static final int STANDARD_BOLUSES_DELIVERED = R.string.key_omnipod_std_boluses_delivered; 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_smb_boluses_delivered; public static final int SMB_BOLUSES_DELIVERED = R.string.key_omnipod_eros_smb_boluses_delivered;
} }
} }

View file

@ -13,35 +13,35 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
*/ */
public enum PodHistoryEntryType { public enum PodHistoryEntryType {
INITIALIZE_POD(1, R.string.omnipod_cmd_initialize_pod, PumpHistoryEntryGroup.Prime), INITIALIZE_POD(1, R.string.omnipod_common_cmd_initialize_pod, PumpHistoryEntryGroup.Prime),
INSERT_CANNULA(2, R.string.omnipod_cmd_insert_cannula, PumpHistoryEntryGroup.Prime), INSERT_CANNULA(2, R.string.omnipod_common_cmd_insert_cannula, PumpHistoryEntryGroup.Prime),
DEACTIVATE_POD(3, R.string.omnipod_cmd_deactivate_pod, PumpHistoryEntryGroup.Prime), DEACTIVATE_POD(3, R.string.omnipod_common_cmd_deactivate_pod, PumpHistoryEntryGroup.Prime),
DISCARD_POD(4, R.string.omnipod_cmd_discard_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), SET_TEMPORARY_BASAL(10, R.string.omnipod_common_cmd_set_tbr, PumpHistoryEntryGroup.Basal),
CANCEL_TEMPORARY_BASAL_BY_DRIVER(11, R.string.omnipod_cmd_cancel_tbr_by_driver, 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_cmd_cancel_tbr, PumpHistoryEntryGroup.Basal), CANCEL_TEMPORARY_BASAL(12, R.string.omnipod_common_cmd_cancel_tbr, PumpHistoryEntryGroup.Basal),
SET_FAKE_SUSPENDED_TEMPORARY_BASAL(13, R.string.omnipod_cmd_set_fake_suspended_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_cmd_cancel_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_cmd_split_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_STATUS(30, R.string.omnipod_common_cmd_get_pod_status, PumpHistoryEntryGroup.Configuration),
GET_POD_INFO(31, R.string.omnipod_cmd_get_pod_info, PumpHistoryEntryGroup.Configuration), GET_POD_INFO(31, R.string.omnipod_common_cmd_get_pod_info, PumpHistoryEntryGroup.Configuration),
SET_TIME(32, R.string.omnipod_cmd_set_time, 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), SET_BOLUS(40, R.string.omnipod_common_cmd_set_bolus, PumpHistoryEntryGroup.Bolus),
CANCEL_BOLUS(41, R.string.omnipod_cmd_cancel_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), CONFIGURE_ALERTS(50, R.string.omnipod_common_cmd_configure_alerts, PumpHistoryEntryGroup.Alarm),
ACKNOWLEDGE_ALERTS(51, R.string.omnipod_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm), ACKNOWLEDGE_ALERTS(51, R.string.omnipod_common_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm),
PLAY_TEST_BEEP(52, R.string.omnipod_cmd_play_test_beep, 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), SUSPEND_DELIVERY(60, R.string.omnipod_common_cmd_suspend_delivery, PumpHistoryEntryGroup.Basal),
RESUME_DELIVERY(61, R.string.omnipod_cmd_resume_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 final int code;
private static final Map<Integer, PodHistoryEntryType> instanceMap; private static final Map<Integer, PodHistoryEntryType> instanceMap;

View file

@ -7,7 +7,7 @@ import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; 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.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodActiveAlertsChanged; import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodFaultEventChanged; 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; import info.nightscout.androidaps.utils.sharedPreferences.SP;
@Singleton @Singleton
public class AapsPodStateManager extends PodStateManager { public class AapsErosPodStateManager extends PodStateManager {
private final SP sp; private final SP sp;
private final RxBusWrapper rxBus; private final RxBusWrapper rxBus;
@Inject @Inject
public AapsPodStateManager(AAPSLogger aapsLogger, SP sp, RxBusWrapper rxBus) { public AapsErosPodStateManager(AAPSLogger aapsLogger, SP sp, RxBusWrapper rxBus) {
super(aapsLogger); super(aapsLogger);
this.sp = sp; this.sp = sp;
this.rxBus = rxBus; this.rxBus = rxBus;
@ -29,12 +29,12 @@ public class AapsPodStateManager extends PodStateManager {
@Override @Override
protected String readPodState() { protected String readPodState() {
return sp.getString(OmnipodStorageKeys.Preferences.POD_STATE, ""); return sp.getString(OmnipodErosStorageKeys.Preferences.POD_STATE, "");
} }
@Override @Override
protected void storePodState(String podState) { protected void storePodState(String podState) {
sp.putString(OmnipodStorageKeys.Preferences.POD_STATE, podState); sp.putString(OmnipodErosStorageKeys.Preferences.POD_STATE, podState);
} }
@Override protected void onUncertainTbrRecovered() { @Override protected void onUncertainTbrRecovered() {

View file

@ -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.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; 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.data.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
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.definition.PodHistoryEntryType; 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.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoRecentPulseLog; 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; import io.reactivex.subjects.SingleSubject;
@Singleton @Singleton
public class AapsOmnipodManager { public class AapsOmnipodErosManager {
private final PodStateManager podStateManager; private final PodStateManager podStateManager;
private final AapsOmnipodUtil aapsOmnipodUtil; private final AapsOmnipodUtil aapsOmnipodUtil;
@ -127,7 +127,7 @@ public class AapsOmnipodManager {
private boolean batteryChangeLoggingEnabled; private boolean batteryChangeLoggingEnabled;
@Inject @Inject
public AapsOmnipodManager(OmnipodRileyLinkCommunicationManager communicationService, public AapsOmnipodErosManager(OmnipodRileyLinkCommunicationManager communicationService,
PodStateManager podStateManager, PodStateManager podStateManager,
AapsOmnipodUtil aapsOmnipodUtil, AapsOmnipodUtil aapsOmnipodUtil,
AAPSLogger aapsLogger, AAPSLogger aapsLogger,
@ -164,20 +164,20 @@ public class AapsOmnipodManager {
} }
public void reloadSettings() { public void reloadSettings() {
basalBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BASAL_BEEPS_ENABLED, true); basalBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BASAL_BEEPS_ENABLED, true);
bolusBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BOLUS_BEEPS_ENABLED, true); bolusBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BOLUS_BEEPS_ENABLED, true);
smbBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SMB_BEEPS_ENABLED, true); smbBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SMB_BEEPS_ENABLED, true);
tbrBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED, false); tbrBeepsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.TBR_BEEPS_ENABLED, false);
suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false); suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false);
pulseLogButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false); pulseLogButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false);
rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED, false); rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.RILEY_LINK_STATS_BUTTON_ENABLED, false);
showRileyLinkBatteryLevel = sp.getBoolean(OmnipodStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL, false); showRileyLinkBatteryLevel = sp.getBoolean(OmnipodErosStorageKeys.Preferences.SHOW_RILEY_LINK_BATTERY_LEVEL, false);
batteryChangeLoggingEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED, false); batteryChangeLoggingEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.BATTERY_CHANGE_LOGGING_ENABLED, false);
timeChangeEventEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true); timeChangeEventEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true);
notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, false); notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, false);
notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true); notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true);
notificationUncertainBolusSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED, true); notificationUncertainBolusSoundEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED, true);
automaticallyAcknowledgeAlertsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED, false); automaticallyAcknowledgeAlertsEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED, false);
} }
public PumpEnactResult initializePod() { public PumpEnactResult initializePod() {
@ -189,7 +189,7 @@ public class AapsOmnipodManager {
result.success(res).enacted(res); result.success(res).enacted(res);
if (!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) { } catch (Exception ex) {
result.success(false).enacted(false).comment(translateException(ex)); result.success(false).enacted(false).comment(translateException(ex));
@ -202,7 +202,7 @@ public class AapsOmnipodManager {
public PumpEnactResult insertCannula(Profile profile) { public PumpEnactResult insertCannula(Profile profile) {
if (profile == null) { 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); return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
} }
@ -216,7 +216,7 @@ public class AapsOmnipodManager {
result.success(res).enacted(res); result.success(res).enacted(res);
if (!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) { } catch (Exception ex) {
result.success(false).enacted(false).comment(translateException(ex)); result.success(false).enacted(false).comment(translateException(ex));
@ -298,7 +298,7 @@ public class AapsOmnipodManager {
public PumpEnactResult setBasalProfile(Profile profile, boolean showNotifications) { public PumpEnactResult setBasalProfile(Profile profile, boolean showNotifications) {
if (profile == null) { 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) { if (showNotifications) {
showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror); showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
} }
@ -313,14 +313,14 @@ public class AapsOmnipodManager {
} catch (CommandFailedAfterChangingDeliveryStatusException ex) { } catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists(); createSuspendedFakeTbrIfNotExists();
if (showNotifications) { 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()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage); addFailureToHistory(historyEntryType, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage); return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (PrecedingCommandFailedUncertainlyException ex) { } catch (PrecedingCommandFailedUncertainlyException ex) {
if (showNotifications) { 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()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage); addFailureToHistory(historyEntryType, errorMessage);
@ -329,9 +329,9 @@ public class AapsOmnipodManager {
if (showNotifications) { if (showNotifications) {
String note; String note;
if (OmnipodManager.isCertainFailure(ex)) { if (OmnipodManager.isCertainFailure(ex)) {
note = getStringResource(R.string.omnipod_error_set_basal_failed); note = getStringResource(R.string.omnipod_common_error_set_basal_failed);
} else { } 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); showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
} }
@ -367,7 +367,7 @@ public class AapsOmnipodManager {
dismissNotification(Notification.OMNIPOD_POD_FAULT); dismissNotification(Notification.OMNIPOD_POD_FAULT);
sendEvent(new EventOmnipodPumpValuesChanged()); 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); return new PumpEnactResult(injector).success(true).enacted(true);
} }
@ -379,7 +379,7 @@ public class AapsOmnipodManager {
Date bolusStarted; Date bolusStarted;
try { 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) -> { (estimatedUnitsDelivered, percentage) -> {
EventOverviewBolusProgress progressUpdateEvent = EventOverviewBolusProgress.INSTANCE; EventOverviewBolusProgress progressUpdateEvent = EventOverviewBolusProgress.INSTANCE;
progressUpdateEvent.setStatus(getStringResource(R.string.bolusdelivering, detailedBolusInfo.insulin)); progressUpdateEvent.setStatus(getStringResource(R.string.bolusdelivering, detailedBolusInfo.insulin));
@ -397,9 +397,9 @@ public class AapsOmnipodManager {
if (OmnipodManager.CommandDeliveryStatus.UNCERTAIN_FAILURE.equals(bolusCommandResult.getCommandDeliveryStatus())) { 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 // For safety reasons, we treat this as a bolus that has successfully been delivered, in order to prevent insulin overdose
if (detailedBolusInfo.isSMB) { 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 { } 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 // I discussed this with the AAPS team but nobody seems to care so we're stuck with this ugly workaround for now
try { try {
ActiveBolus activeBolus = ActiveBolus.fromDetailedBolusInfo(detailedBolusInfo); 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"); aapsLogger.debug(LTag.PUMP, "Stored active bolus to SP for recovery");
} catch (Exception ex) { } catch (Exception ex) {
aapsLogger.error(LTag.PUMP, "Failed to store active bolus to SP", ex); aapsLogger.error(LTag.PUMP, "Failed to store active bolus to SP", ex);
@ -444,7 +444,7 @@ public class AapsOmnipodManager {
addBolusToHistory(detailedBolusInfo); 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); 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"); aapsLogger.debug(LTag.PUMP, "Bolus command successfully executed. Proceeding bolus cancellation");
} else { } else {
aapsLogger.debug(LTag.PUMP, "Not cancelling bolus: bolus command failed"); 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); addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.CANCEL_BOLUS, comment);
return new PumpEnactResult(injector).success(true).enacted(false).comment(comment); return new PumpEnactResult(injector).success(true).enacted(false).comment(comment);
} }
@ -491,7 +491,7 @@ public class AapsOmnipodManager {
public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) { public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) {
boolean beepsEnabled = isTbrBeepsEnabled(); boolean beepsEnabled = isTbrBeepsEnabled();
try { 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) { } catch (CommandFailedAfterChangingDeliveryStatusException ex) {
String errorMessage = translateException(ex.getCause()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage); addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
@ -500,7 +500,7 @@ public class AapsOmnipodManager {
String errorMessage = translateException(ex.getCause()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage); 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 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); long pumpId = addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
if (!OmnipodManager.isCertainFailure(ex)) { 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, // 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 // 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) return new PumpEnactResult(injector)
.duration(tempBasalPair.getDurationMinutes()) .duration(tempBasalPair.getDurationMinutes())
.absolute(PumpType.Insulet_Omnipod.determineCorrectBasalSize(tempBasalPair.getInsulinRate())) .absolute(PumpType.Omnipod_Eros.determineCorrectBasalSize(tempBasalPair.getInsulinRate()))
.success(true).enacted(true); .success(true).enacted(true);
} }
@ -542,7 +542,7 @@ public class AapsOmnipodManager {
executeCommand(() -> delegate.cancelTemporaryBasal(isTbrBeepsEnabled())); executeCommand(() -> delegate.cancelTemporaryBasal(isTbrBeepsEnabled()));
} catch (Exception ex) { } catch (Exception ex) {
if (OmnipodManager.isCertainFailure(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 { } else {
splitActiveTbr(); // Split any active TBR so when we recover from the uncertain TBR status,we only cancel the part after the cancellation 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) { } catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists(); createSuspendedFakeTbrIfNotExists();
if (showNotifications) { 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()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage); addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage); return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (PrecedingCommandFailedUncertainlyException ex) { } catch (PrecedingCommandFailedUncertainlyException ex) {
if (showNotifications) { 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()); String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage); addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage); return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (Exception ex) { } catch (Exception ex) {
if (showNotifications) { 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); String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage); addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
@ -899,56 +899,56 @@ public class AapsOmnipodManager {
String comment; String comment;
if (ex instanceof CrcMismatchException) { 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) { } 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 || } else if (ex instanceof IllegalPodProgressException || ex instanceof IllegalActivationProgressException ||
ex instanceof IllegalDeliveryStatusException) { 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } else if (ex instanceof PodFaultException) {
FaultEventCode faultEventCode = ((PodFaultException) ex).getDetailedStatus().getFaultEventCode(); FaultEventCode faultEventCode = ((PodFaultException) ex).getDetailedStatus().getFaultEventCode();
comment = createPodFaultErrorMessage(faultEventCode); comment = createPodFaultErrorMessage(faultEventCode);
} else if (ex instanceof ActivationTimeExceededException) { } 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) { } 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) { } 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) { } 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) { } 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) { } else if (ex instanceof RileyLinkUnexpectedException) {
Throwable cause = ex.getCause(); 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 { } else {
// Shouldn't be reachable // 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; return comment;
} }
private String createPodFaultErrorMessage(FaultEventCode faultEventCode) { 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()); ByteUtil.convertUnsignedByteToInt(faultEventCode.getValue()), faultEventCode.name());
} }
@ -1002,7 +1002,7 @@ public class AapsOmnipodManager {
} }
List<BasalScheduleEntry> entries = new ArrayList<>(); List<BasalScheduleEntry> entries = new ArrayList<>();
for (Profile.ProfileValue basalValue : basalValues) { 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))); Duration.standardSeconds(basalValue.timeAsSeconds)));
} }

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -1,7 +1,11 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
public final class CommandGetPodStatus extends OmnipodCustomCommand { import org.jetbrains.annotations.NotNull;
public CommandGetPodStatus() {
super(OmnipodCustomCommandType.GET_POD_STATUS); import info.nightscout.androidaps.queue.commands.CustomCommand;
public final class CommandGetPodStatus implements CustomCommand {
@NotNull @Override public String getStatusDescription() {
return "GET POD STATUS";
} }
} }

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -1,7 +1,11 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command; package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command;
public final class CommandReadPulseLog extends OmnipodCustomCommand { import org.jetbrains.annotations.NotNull;
public CommandReadPulseLog() {
super(OmnipodCustomCommandType.READ_PULSE_LOG); import info.nightscout.androidaps.queue.commands.CustomCommand;
public final class CommandReadPulseLog implements CustomCommand {
@NotNull @Override public String getStatusDescription() {
return "READ PULSE LOG";
} }
} }

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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();
}
}

View file

@ -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;
}
}

View file

@ -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.OmnipodErosPumpPlugin;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; 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.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.rileylink.manager.OmnipodRileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
@ -38,7 +38,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
@Inject AapsOmnipodUtil aapsOmnipodUtil; @Inject AapsOmnipodUtil aapsOmnipodUtil;
@Inject PodStateManager podStateManager; @Inject PodStateManager podStateManager;
@Inject DatabaseHelperInterface databaseHelper; @Inject DatabaseHelperInterface databaseHelper;
@Inject AapsOmnipodManager aapsOmnipodManager; @Inject AapsOmnipodErosManager aapsOmnipodErosManager;
@Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager; @Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager;
private final IBinder mBinder = new LocalBinder(); private final IBinder mBinder = new LocalBinder();
@ -118,11 +118,11 @@ public class RileyLinkOmnipodService extends RileyLinkService {
if (StringUtils.isEmpty(rileyLinkAddress)) { if (StringUtils.isEmpty(rileyLinkAddress)) {
aapsLogger.debug(LTag.PUMPBTCOMM, "RileyLink address invalid: no address"); 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; return false;
} else { } else {
if (!rileyLinkAddress.matches(REGEX_MAC)) { 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); aapsLogger.debug(LTag.PUMPBTCOMM, "RileyLink address invalid: {}", rileyLinkAddress);
} else { } else {
if (!rileyLinkAddress.equals(this.rileyLinkAddress)) { if (!rileyLinkAddress.equals(this.rileyLinkAddress)) {

View file

@ -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.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.resources.ResourceHelper;
public class PodHistoryActivity extends NoSplashAppCompatActivity { public class ErosPodHistoryActivity extends NoSplashAppCompatActivity {
@Inject AAPSLogger aapsLogger; @Inject AAPSLogger aapsLogger;
@Inject AapsOmnipodUtil aapsOmnipodUtil; @Inject AapsOmnipodUtil aapsOmnipodUtil;
@ -60,7 +60,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
private List<TypeList> typeListFull; private List<TypeList> typeListFull;
public PodHistoryActivity() { public ErosPodHistoryActivity() {
super(); super();
} }
@ -251,7 +251,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_TEMPORARY_BASAL: case SET_TEMPORARY_BASAL:
case SPLIT_TEMPORARY_BASAL: { case SPLIT_TEMPORARY_BASAL: {
TempBasalPair tempBasalPair = aapsOmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), TempBasalPair.class); 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; break;
@ -266,9 +266,9 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_BOLUS: { case SET_BOLUS: {
if (historyEntry.getData().contains(";")) { if (historyEntry.getData().contains(";")) {
String[] splitVal = historyEntry.getData().split(";"); 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 { } 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; break;
@ -309,7 +309,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
try { try {
Profile.ProfileValue[] profileValuesArray = aapsOmnipodUtil.getGsonInstance().fromJson(data, Profile.ProfileValue[].class); 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) { } catch (Exception e) {
aapsLogger.error(LTag.PUMP, "Problem parsing Profile json. Ex: {}, Data:\n{}", e.getMessage(), data); aapsLogger.error(LTag.PUMP, "Problem parsing Profile json. Ex: {}, Data:\n{}", e.getMessage(), data);
valueView.setText(""); valueView.setText("");

View file

@ -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.RileyLinkServiceData
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask 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.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.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodPodManagementBinding 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.definition.BeepConfigType
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager 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.event.EventOmnipodPumpValuesChanged
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.queue.command.CommandPlayTestBeep
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog 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.Callback
import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.queue.events.EventQueueChanged
import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.FabricPrivacy
@ -39,7 +39,7 @@ import javax.inject.Inject
/** /**
* Created by andy on 30/08/2019 * Created by andy on 30/08/2019
*/ */
class PodManagementActivity : NoSplashAppCompatActivity() { class ErosPodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var rxBus: RxBusWrapper @Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var fabricPrivacy: FabricPrivacy
@ -47,7 +47,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
@Inject lateinit var podStateManager: PodStateManager @Inject lateinit var podStateManager: PodStateManager
@Inject lateinit var injector: HasAndroidInjector @Inject lateinit var injector: HasAndroidInjector
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData @Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
@Inject lateinit var aapsOmnipodManager: AapsOmnipodManager @Inject lateinit var aapsOmnipodManager: AapsOmnipodErosManager
@Inject lateinit var context: Context @Inject lateinit var context: Context
@Inject lateinit var omnipodErosPumpPlugin: OmnipodErosPumpPlugin @Inject lateinit var omnipodErosPumpPlugin: OmnipodErosPumpPlugin
@Inject lateinit var serviceTaskExecutor: ServiceTaskExecutor @Inject lateinit var serviceTaskExecutor: ServiceTaskExecutor
@ -72,7 +72,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonDiscardPod.setOnClickListener { binding.buttonDiscardPod.setOnClickListener {
OKDialog.showConfirmation(this, 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() aapsOmnipodManager.discardPodState()
}) })
} }
@ -92,12 +92,12 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonPlayTestBeep.setOnClickListener { binding.buttonPlayTestBeep.setOnClickListener {
binding.buttonPlayTestBeep.isEnabled = false 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() { commandQueue.customCommand(CommandPlayTestBeep(BeepConfigType.BEEEP), object : Callback() {
override fun run() { override fun run() {
if (!result.success) { 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.setOnClickListener {
binding.buttonPulseLog.isEnabled = false 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() { commandQueue.customCommand(CommandReadPulseLog(), object : Callback() {
override fun run() { override fun run() {
if (!result.success) { 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 { 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 (podStateManager.isPodInitialized && podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED)) {
if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) { if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) {
binding.buttonPlayTestBeep.isEnabled = false 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 { } else {
binding.buttonPlayTestBeep.isEnabled = true 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 { } else {
binding.buttonPlayTestBeep.isEnabled = false 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) { if (discardButtonEnabled) {
@ -181,18 +181,18 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
if (podStateManager.isPodActivationCompleted) { if (podStateManager.isPodActivationCompleted) {
if (commandQueue.isCustomCommandInQueue(CommandReadPulseLog::class.java)) { if (commandQueue.isCustomCommandInQueue(CommandReadPulseLog::class.java)) {
binding.buttonPulseLog.isEnabled = false 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 { } else {
binding.buttonPulseLog.isEnabled = true 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 { } else {
binding.buttonPulseLog.isEnabled = false 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 { } 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.buttonActivatePod.isEnabled = false
binding.buttonDeactivatePod.isEnabled = false binding.buttonDeactivatePod.isEnabled = false
binding.buttonPlayTestBeep.isEnabled = false binding.buttonPlayTestBeep.isEnabled = false
@ -202,7 +202,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
} }
if (pulseLogButtonEnabled) { if (pulseLogButtonEnabled) {
binding.buttonPulseLog.isEnabled = false 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() { private fun displayNotConfiguredDialog() {
context.let { context.let {
UIRunnable { UIRunnable {
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning), OKDialog.show(it, resourceHelper.gs(R.string.omnipod_common_warning),
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null) resourceHelper.gs(R.string.omnipod_eros_error_operation_not_possible_no_configuration), null)
}.run() }.run()
} }
} }

View file

@ -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.RileyLinkServiceState
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice 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.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.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodOverviewBinding 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.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil 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.event.EventOmnipodPumpValuesChanged
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.queue.command.CommandAcknowledgeAlerts
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus 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.AapsOmnipodUtil
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil
import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.Callback
@ -58,7 +58,7 @@ import java.util.*
import javax.inject.Inject import javax.inject.Inject
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
class OmnipodOverviewFragment : DaggerFragment() { class OmnipodErosOverviewFragment : DaggerFragment() {
companion object { companion object {
private const val REFRESH_INTERVAL_MILLIS = 15 * 1000L // 15 seconds 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 omnipodAlertUtil: OmnipodAlertUtil
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData @Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
@Inject lateinit var dateUtil: DateUtil @Inject lateinit var dateUtil: DateUtil
@Inject lateinit var omnipodManager: AapsOmnipodManager @Inject lateinit var omnipodManager: AapsOmnipodErosManager
@Inject lateinit var protectionCheck: ProtectionCheck @Inject lateinit var protectionCheck: ProtectionCheck
@Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var aapsSchedulers: AapsSchedulers
@ -111,7 +111,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
context?.let { context -> context?.let { context ->
protectionCheck.queryProtection( protectionCheck.queryProtection(
activity, ProtectionCheck.Protection.PREFERENCES, 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 { binding.buttonResumeDelivery.setOnClickListener {
disablePodActionButtons() disablePodActionButtons()
commandQueue.customCommand(CommandResumeDelivery(), 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 { binding.buttonRefreshStatus.setOnClickListener {
disablePodActionButtons() disablePodActionButtons()
commandQueue.customCommand(CommandGetPodStatus(), 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 { binding.buttonAcknowledgeActiveAlerts.setOnClickListener {
disablePodActionButtons() disablePodActionButtons()
commandQueue.customCommand(CommandAcknowledgeAlerts(), commandQueue.customCommand(CommandAcknowledgeAlerts(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_acknowledge_alerts), false) DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_acknowledge_alerts), false)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_acknowledged_alerts)) .messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_acknowledged_alerts))
.actionOnSuccess { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_ALERTS)) }) .actionOnSuccess { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_ALERTS)) })
} }
binding.buttonSuspendDelivery.setOnClickListener { binding.buttonSuspendDelivery.setOnClickListener {
disablePodActionButtons() disablePodActionButtons()
commandQueue.customCommand(CommandSuspendDelivery(), commandQueue.customCommand(CommandSuspendDelivery(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_suspend_delivery), true) DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_suspend_delivery), true)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_suspended_delivery))) .messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_suspended_delivery)))
} }
binding.buttonSetTime.setOnClickListener { binding.buttonSetTime.setOnClickListener {
disablePodActionButtons() disablePodActionButtons()
commandQueue.customCommand(CommandHandleTimeChange(true), commandQueue.customCommand(CommandHandleTimeChange(true),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_set_time), true) DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_set_time), true)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_time_on_pod_updated))) .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.podAddress.text = podStateManager.address.toString()
binding.podLot.text = podStateManager.lot.toString() binding.podLot.text = podStateManager.lot.toString()
binding.podTid.text = podStateManager.tid.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.text = readableZonedTime(podStateManager.time)
binding.timeOnPod.setTextColor(if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) { binding.timeOnPod.setTextColor(if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) {
@ -283,7 +283,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
if (podStateManager.isPodFaulted) { if (podStateManager.isPodFaulted) {
val faultEventCode = podStateManager.faultEventCode 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 // base basal rate
@ -295,20 +295,20 @@ class OmnipodOverviewFragment : DaggerFragment() {
// total delivered // total delivered
binding.totalDelivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) { 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 { } else {
PLACEHOLDER PLACEHOLDER
} }
// reservoir // reservoir
if (podStateManager.reservoirLevel == null) { 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) binding.reservoir.setTextColor(Color.WHITE)
} else { } else {
val lowReservoirThreshold = (omnipodAlertUtil.lowReservoirAlertUnits val lowReservoirThreshold = (omnipodAlertUtil.lowReservoirAlertUnits
?: OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD).toDouble() ?: 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) { binding.reservoir.setTextColor(if (podStateManager.reservoirLevel < lowReservoirThreshold) {
Color.RED Color.RED
} else { } else {
@ -354,34 +354,34 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun updatePodStatus() { private fun updatePodStatus() {
binding.podStatus.text = if (!podStateManager.hasPodState()) { 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) { } else if (!podStateManager.isPodActivationCompleted) {
if (!podStateManager.isPodInitialized) { 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 { } else {
if (podStateManager.activationProgress.isBefore(ActivationProgress.PRIMING_COMPLETED)) { 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 { } 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 { } else {
if (podStateManager.podProgressStatus.isRunning) { if (podStateManager.podProgressStatus.isRunning) {
var status = if (podStateManager.isSuspended) { var status = if (podStateManager.isSuspended) {
resourceHelper.gs(R.string.omnipod_pod_status_suspended) resourceHelper.gs(R.string.omnipod_common_pod_status_suspended)
} else { } else {
resourceHelper.gs(R.string.omnipod_pod_status_running) resourceHelper.gs(R.string.omnipod_common_pod_status_running)
} }
if (!podStateManager.isBasalCertain) { if (!podStateManager.isBasalCertain) {
status += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")" status += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
} }
status status
} else if (podStateManager.podProgressStatus == PodProgressStatus.FAULT_EVENT_OCCURRED) { } 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) { } else if (podStateManager.podProgressStatus == PodProgressStatus.INACTIVE) {
resourceHelper.gs(R.string.omnipod_pod_status_inactive) resourceHelper.gs(R.string.omnipod_common_pod_status_inactive)
} else { } else {
podStateManager.podProgressStatus.toString() podStateManager.podProgressStatus.toString()
} }
@ -397,14 +397,14 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun updateLastBolus() { private fun updateLastBolus() {
if (podStateManager.isPodActivationCompleted && podStateManager.hasLastBolus()) { 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 val textColor: Int
if (podStateManager.isLastBolusCertain) { if (podStateManager.isLastBolusCertain) {
textColor = Color.WHITE textColor = Color.WHITE
} else { } else {
textColor = Color.RED textColor = Color.RED
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")" text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
} }
binding.lastBolus.text = text binding.lastBolus.text = text
@ -432,12 +432,12 @@ class OmnipodOverviewFragment : DaggerFragment() {
var text: String var text: String
val textColor: Int 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) { if (podStateManager.isTempBasalCertain) {
textColor = Color.WHITE textColor = Color.WHITE
} else { } else {
textColor = Color.RED textColor = Color.RED
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")" text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
} }
binding.tempBasal.text = text binding.tempBasal.text = text
@ -451,7 +451,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
textColor = Color.WHITE textColor = Color.WHITE
} else { } else {
textColor = Color.RED textColor = Color.RED
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")" text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
} }
binding.tempBasal.text = text binding.tempBasal.text = text
@ -529,8 +529,8 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun displayNotConfiguredDialog() { private fun displayNotConfiguredDialog() {
context?.let { context?.let {
UIRunnable { UIRunnable {
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning), OKDialog.show(it, resourceHelper.gs(R.string.omnipod_common_warning),
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null) resourceHelper.gs(R.string.omnipod_eros_error_operation_not_possible_no_configuration), null)
}.run() }.run()
} }
} }
@ -564,7 +564,7 @@ class OmnipodOverviewFragment : DaggerFragment() {
val isDaylightTime = timeZone.inDaylightTime(timeAsJavaData) val isDaylightTime = timeZone.inDaylightTime(timeAsJavaData)
val locale = resources.configuration.locales.get(0) val locale = resources.configuration.locales.get(0)
val timeZoneDisplayName = timeZone.getDisplayName(isDaylightTime, TimeZone.SHORT, locale) + " " + timeZone.getDisplayName(isDaylightTime, TimeZone.LONG, locale) 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 { private fun readableDuration(dateTime: DateTime): String {
@ -574,32 +574,32 @@ class OmnipodOverviewFragment : DaggerFragment() {
val seconds = duration.standardSeconds.toInt() val seconds = duration.standardSeconds.toInt()
when { when {
seconds < 10 -> { seconds < 10 -> {
return resourceHelper.gs(R.string.omnipod_moments_ago) return resourceHelper.gs(R.string.omnipod_common_moments_ago)
} }
seconds < 60 -> { 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 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 seconds < 24 * 60 * 60 -> { // < 1 day
val minutesLeft = minutes % 60 val minutesLeft = minutes % 60
if (minutesLeft > 0) if (minutesLeft > 0)
return resourceHelper.gs(R.string.omnipod_time_ago, return resourceHelper.gs(R.string.omnipod_common_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))) 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_time_ago, resourceHelper.gq(R.plurals.omnipod_hours, hours, hours)) return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours))
} }
else -> { else -> {
val days = hours / 24 val days = hours / 24
val hoursLeft = hours % 24 val hoursLeft = hours % 24
if (hoursLeft > 0) if (hoursLeft > 0)
return resourceHelper.gs(R.string.omnipod_time_ago, return resourceHelper.gs(R.string.omnipod_common_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))) 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_time_ago, resourceHelper.gq(R.plurals.omnipod_days, days, days)) 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) { if (result.success) {
val messageOnSuccess = this.messageOnSuccess val messageOnSuccess = this.messageOnSuccess
if (messageOnSuccess != null) { if (messageOnSuccess != null) {
displayOkDialog(resourceHelper.gs(R.string.omnipod_confirmation), messageOnSuccess) displayOkDialog(resourceHelper.gs(R.string.omnipod_common_confirmation), messageOnSuccess)
} }
actionOnSuccess?.run() actionOnSuccess?.run()
} else { } 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)
} }
} }

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}

View file

@ -68,21 +68,21 @@ public class AapsOmnipodUtil {
private String translateAlertType(AlertType alertType) { private String translateAlertType(AlertType alertType) {
if (alertType == null) { if (alertType == null) {
return resourceHelper.gs(R.string.omnipod_alert_unknown_alert); return resourceHelper.gs(R.string.omnipod_common_alert_unknown_alert);
} }
switch (alertType) { switch (alertType) {
case FINISH_PAIRING_REMINDER: 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: 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: case EXPIRATION_ALERT:
return resourceHelper.gs(R.string.omnipod_alert_expiration); return resourceHelper.gs(R.string.omnipod_common_alert_expiration);
case EXPIRATION_ADVISORY_ALERT: 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: 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: case LOW_RESERVOIR_ALERT:
return resourceHelper.gs(R.string.omnipod_alert_low_reservoir); return resourceHelper.gs(R.string.omnipod_common_alert_low_reservoir);
default: default:
return alertType.name(); return alertType.name();
} }

View file

@ -5,7 +5,7 @@ import org.joda.time.Duration;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; 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.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.utils.sharedPreferences.SP; import info.nightscout.androidaps.utils.sharedPreferences.SP;
@ -19,12 +19,12 @@ public class OmnipodAlertUtil {
} }
public Duration getExpirationReminderTimeBeforeShutdown() { public Duration getExpirationReminderTimeBeforeShutdown() {
boolean expirationAlertEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED, true); boolean expirationAlertEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_ENABLED, true);
return expirationAlertEnabled ? Duration.standardHours(sp.getInt(OmnipodStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN, 9)) : null; return expirationAlertEnabled ? Duration.standardHours(sp.getInt(OmnipodErosStorageKeys.Preferences.EXPIRATION_REMINDER_HOURS_BEFORE_SHUTDOWN, 9)) : null;
} }
public Integer getLowReservoirAlertUnits() { public Integer getLowReservoirAlertUnits() {
boolean lowReservoirAlertEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED, true); boolean lowReservoirAlertEnabled = sp.getBoolean(OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_ENABLED, true);
return lowReservoirAlertEnabled ? sp.getInt(OmnipodStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS, OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD) : null; return lowReservoirAlertEnabled ? sp.getInt(OmnipodErosStorageKeys.Preferences.LOW_RESERVOIR_ALERT_UNITS, OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD) : null;
} }
} }

View file

@ -17,7 +17,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:text="@string/omnipod_history_type" android:text="@string/omnipod_eros_history_type"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<Spinner <Spinner
@ -34,7 +34,7 @@
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/pillborder" android:background="@drawable/pillborder"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:text="@string/omnipod_history_title" /> android:text="@string/omnipod_eros_history_title" />
</LinearLayout> </LinearLayout>

View file

@ -11,21 +11,21 @@
android:id="@+id/omnipod_history_time" android:id="@+id/omnipod_history_time"
android:layout_width="88dp" android:layout_width="88dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/omnipod_history_item_date" android:text="@string/omnipod_eros_history_item_date"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
android:id="@+id/omnipod_history_source" android:id="@+id/omnipod_history_source"
android:layout_width="132dp" android:layout_width="132dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/omnipod_history_item_source" android:text="@string/omnipod_eros_history_item_source"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
android:id="@+id/omnipod_history_description" android:id="@+id/omnipod_history_description"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:text="@string/omnipod_history_item_description" android:text="@string/omnipod_eros_history_item_description"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>

View file

@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
tools:context=".ui.PodManagementActivity"> tools:context=".ui.ErosPodManagementActivity">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -15,7 +15,7 @@
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:gravity="center" android:gravity="center"
android:text="@string/omnipod_pod_management_title" android:text="@string/omnipod_common_pod_management_title"
android:textAlignment="center" android:textAlignment="center"
android:textSize="12pt" android:textSize="12pt"
android:textStyle="bold" /> android:textStyle="bold" />
@ -42,7 +42,7 @@
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:gravity="center" 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:textAlignment="center"
android:textSize="8pt" /> android:textSize="8pt" />
</LinearLayout> </LinearLayout>
@ -53,7 +53,7 @@
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:paddingStart="15dp" android:paddingStart="15dp"
android:paddingEnd="15dp" android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_actions" /> android:text="@string/omnipod_common_pod_management_heading_actions" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -70,7 +70,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_activate_pod" android:drawableTop="@drawable/ic_pod_management_activate_pod"
android:text="@string/omnipod_pod_management_button_activate_pod" android:text="@string/omnipod_common_pod_management_button_activate_pod"
android:textAllCaps="false" /> android:textAllCaps="false" />
@ -82,7 +82,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_deactivate_pod" 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" /> android:textAllCaps="false" />
</LinearLayout> </LinearLayout>
@ -102,7 +102,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_play_test_beep" 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" /> android:textAllCaps="false" />
@ -114,7 +114,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_discard_pod" 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:textAllCaps="false"
android:visibility="gone" /> android:visibility="gone" />
@ -126,7 +126,7 @@
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:paddingStart="15dp" android:paddingStart="15dp"
android:paddingEnd="15dp" android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_tools" /> android:text="@string/omnipod_common_pod_management_heading_tools" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -143,7 +143,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_pod_history" android:drawableTop="@drawable/ic_pod_management_pod_history"
android:text="@string/omnipod_pod_management_button_pod_history" android:text="@string/omnipod_common_pod_management_button_pod_history"
android:textAllCaps="false" /> android:textAllCaps="false" />
<info.nightscout.androidaps.utils.ui.SingleClickButton <info.nightscout.androidaps.utils.ui.SingleClickButton
@ -154,7 +154,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_rl_stats" android:drawableTop="@drawable/ic_pod_management_rl_stats"
android:text="@string/omnipod_pod_management_button_riley_link_stats" android:text="@string/omnipod_eros_pod_management_button_riley_link_stats"
android:textAllCaps="false" android:textAllCaps="false"
android:visibility="gone" /> android:visibility="gone" />
@ -175,7 +175,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_pulse_log" 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:textAllCaps="false"
android:visibility="gone" /> android:visibility="gone" />
@ -187,7 +187,7 @@
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_weight="0.5" android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_activity_reset_rileylink_config" 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" /> android:textAllCaps="false" />
</LinearLayout> </LinearLayout>

View file

@ -1,290 +1,98 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Omnipod Eros - Description -->
<string name="omnipod_eros_name" translatable="false">Omnipod</string>
<string name="omnipod_eros_name_short" translatable="false">Pod</string>
<string name="omnipod_eros_pump_description">Pump integration for Omnipod Eros (the older model with a transparent needle cap). Requires a RileyLink device with at least firmware version 2.0.</string>
<string name="omnipod_eros_frequency" translatable="false">Omnipod (433.91 MHz)</string>
<!-- Omnipod - Keys --> <!-- Omnipod Eros - Keys -->
<string name="key_omnipod_pod_state" translatable="false">AAPS.Omnipod.pod_state</string> <string name="key_omnipod_eros_pod_state" translatable="false">AAPS.Omnipod.pod_state</string>
<string name="key_omnipod_current_bolus" translatable="false">AAPS.Omnipod.current_bolus</string> <string name="key_omnipod_eros_current_bolus" translatable="false">AAPS.Omnipod.current_bolus</string>
<string name="key_omnipod_bolus_beeps_enabled" translatable="false">AAPS.Omnipod.bolus_beeps_enabled</string> <string name="key_omnipod_eros_pulse_log_button_enabled" translatable="false">AAPS.Omnipod.pulse_log_button_enabled</string>
<string name="key_omnipod_basal_beeps_enabled" translatable="false">AAPS.Omnipod.basal_beeps_enabled</string> <string name="key_omnipod_eros_riley_link_stats_button_enabled" translatable="false">AAPS.Omnipod.rileylink_stats_button_enabled</string>
<string name="key_omnipod_smb_beeps_enabled" translatable="false">AAPS.Omnipod.smb_beeps_enabled</string> <string name="key_omnipod_eros_battery_change_logging_enabled" translatable="false">AAPS.Omnipod.enable_battery_change_logging</string>
<string name="key_omnipod_tbr_beeps_enabled" translatable="false">AAPS.Omnipod.tbr_beeps_enabled</string> <string name="key_omnipod_eros_notification_uncertain_tbr_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_tbr_sound_enabled</string>
<string name="key_omnipod_suspend_delivery_button_enabled" translatable="false">AAPS.Omnipod.suspend_delivery_button_enabled</string> <string name="key_omnipod_eros_notification_uncertain_smb_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_smb_sound_enabled</string>
<string name="key_omnipod_pulse_log_button_enabled" translatable="false">AAPS.Omnipod.pulse_log_button_enabled</string> <string name="key_omnipod_eros_notification_uncertain_bolus_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_bolus_sound_enabled</string>
<string name="key_omnipod_riley_link_stats_button_enabled" translatable="false">AAPS.Omnipod.rileylink_stats_button_enabled</string> <string name="key_omnipod_eros_tbrs_set" translatable="false">AAPS.Omnipod.tbrs_set</string>
<string name="key_omnipod_battery_change_logging_enabled" translatable="false">AAPS.Omnipod.enable_battery_change_logging</string> <string name="key_omnipod_eros_std_boluses_delivered" translatable="false">AAPS.Omnipod.std_boluses_delivered</string>
<string name="key_omnipod_time_change_event_enabled" translatable="false">AAPS.Omnipod.time_change_enabled</string> <string name="key_omnipod_eros_smb_boluses_delivered" translatable="false">AAPS.Omnipod.smb_boluses_delivered</string>
<string name="key_omnipod_expiration_reminder_enabled" translatable="false">AAPS.Omnipod.expiration_reminder_enabled</string>
<string name="key_omnipod_expiration_reminder_hours_before_shutdown" translatable="false">AAPS.Omnipod.expiration_reminder_hours_before_shutdown</string>
<string name="key_omnipod_low_reservoir_alert_enabled" translatable="false">AAPS.Omnipod.low_reservoir_alert_enabled</string>
<string name="key_omnipod_low_reservoir_alert_units" translatable="false">AAPS.Omnipod.low_reservoir_alert_units</string>
<string name="key_omnipod_automatically_acknowledge_alerts_enabled" translatable="false">AAPS.Omnipod.automatically_acknowledge_alerts_enabled</string>
<string name="key_omnipod_notification_uncertain_tbr_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_tbr_sound_enabled</string>
<string name="key_omnipod_notification_uncertain_smb_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_smb_sound_enabled</string>
<string name="key_omnipod_notification_uncertain_bolus_sound_enabled" translatable="false">AAPS.Omnipod.notification_uncertain_bolus_sound_enabled</string>
<string name="key_omnipod_tbrs_set" translatable="false">AAPS.Omnipod.tbrs_set</string>
<string name="key_omnipod_std_boluses_delivered" translatable="false">AAPS.Omnipod.std_boluses_delivered</string>
<string name="key_omnipod_smb_boluses_delivered" translatable="false">AAPS.Omnipod.smb_boluses_delivered</string>
<!-- Omnipod - Non translatable --> <!-- Omnipod Eros - Overview -->
<string name="omnipod_name" translatable="false">Omnipod</string> <string name="omnipod_eros_overview_firmware_version_value" translatable="false">PM %1$s / PI %2$s</string>
<string name="omnipod_name_short" translatable="false">Pod</string>
<string name="omnipod_frequency" translatable="false">Omnipod (433.91 MHz)</string>
<string name="omnipod_lot" translatable="false">LOT</string>
<string name="omnipod_tid" translatable="false">TID</string>
<string name="omnipod_firmware_version_value" translatable="false">PM %1$s / PI %2$s</string>
<string name="omnipod_time_with_timezone" translatable="false">%1$s (%2$s)</string>
<string name="omnipod_two_strings_concatenated_by_colon" translatable="false">%1$s: %2$s</string>
<string name="omnipod_overview_last_bolus_value" translatable="false">%1$.2f %2$s (%3$s)</string>
<!-- Omnipod - Preferences --> <!-- Omnipod Eros - Preferences -->
<string name="omnipod_config_riley_link_configuration">RileyLink Configuration</string> <string name="omnipod_eros_preferences_riley_link_configuration">RileyLink Configuration</string>
<string name="omnipod_config_bolus_beeps_enabled">Bolus beeps enabled</string> <string name="omnipod_eros_preferences_category_notifications">Notifications</string>
<string name="omnipod_config_basal_beeps_enabled">Basal beeps enabled</string> <string name="omnipod_eros_preferences_pulse_log_button_enabled">Show Pulse Log button in Pod Management menu</string>
<string name="omnipod_config_smb_beeps_enabled">SMB beeps enabled</string> <string name="omnipod_eros_preferences_riley_link_stats_button_enabled">Show RileyLink Stats button in Pod Management menu</string>
<string name="omnipod_config_tbr_beeps_enabled">TBR beeps enabled</string> <string name="omnipod_eros_preferences_battery_change_logging_enabled">Enable battery change logging in Actions</string>
<string name="omnipod_config_suspend_delivery_button_enabled">Show Suspend Delivery button in Omnipod tab</string> <string name="omnipod_eros_preferences_category_riley_link">RileyLink</string>
<string name="omnipod_config_pulse_log_button_enabled">Show Pulse Log button in Pod Management menu</string> <string name="omnipod_eros_preferences_notification_uncertain_tbr_sound_enabled">Sound for uncertain TBR notifications enabled</string>
<string name="omnipod_config_rileylink_stats_button_enabled">Show RileyLink Stats button in Pod Management menu</string> <string name="omnipod_eros_preferences_notification_uncertain_smb_sound_enabled">Sound for uncertain SMB notifications enabled</string>
<string name="omnipod_config_battery_change_logging_enabled">Enable battery change logging in Actions</string> <string name="omnipod_eros_preferences_notification_uncertain_bolus_sound_enabled">Sound for uncertain bolus notifications enabled</string>
<string name="omnipod_config_time_change_enabled">DST/Time zone detection enabled</string>
<string name="omnipod_config_expiration_reminder_enabled">Expiration reminder enabled</string>
<string name="omnipod_config_expiration_reminder_hours_before_shutdown">Hours before shutdown</string>
<string name="omnipod_config_low_reservoir_alert_enabled">Low reservoir alert enabled</string>
<string name="omnipod_config_low_reservoir_alert_units">Number of units</string>
<string name="omnipod_config_notification_uncertain_tbr_sound_enabled">Sound for uncertain TBR notifications enabled</string>
<string name="omnipod_config_notification_uncertain_smb_sound_enabled">Sound for uncertain SMB notifications enabled</string>
<string name="omnipod_config_notification_uncertain_bolus_sound_enabled">Sound for uncertain bolus notifications enabled</string>
<string name="omnipod_config_automatically_acknowledge_alerts">Automatically acknowledge Pod alerts</string>
<string name="omnipod_preference_category_rileylink">RileyLink</string>
<string name="omnipod_preference_category_other">Other</string>
<string name="omnipod_preference_category_alerts">Alerts</string>
<string name="omnipod_preference_category_confirmation_beeps">Confirmation Beeps</string>
<string name="omnipod_preference_category_notifications">Notifications</string>
<!-- Omnipod - Pod Status --> <!-- Omnipod Eros - History -->
<string name="omnipod_pod_status_no_active_pod">No Active Pod</string> <string name="omnipod_eros_history_title">Pod History</string>
<string name="omnipod_pod_status_waiting_for_activation">Setup in progress (waiting for Pod activation)</string> <string name="omnipod_eros_history_item_description">Description</string>
<string name="omnipod_pod_status_waiting_for_cannula_insertion">Setup in progress (waiting for cannula insertion)</string> <string name="omnipod_eros_history_item_source">Source</string>
<string name="omnipod_pod_status_running">Running</string> <string name="omnipod_eros_history_item_date">Date</string>
<string name="omnipod_pod_status_suspended">Suspended</string> <string name="omnipod_eros_history_type">Type:</string>
<string name="omnipod_pod_status_pod_fault">Pod Fault</string> <string name="omnipod_eros_history_bolus_value">%1$.2f U</string>
<string name="omnipod_pod_status_activation_time_exceeded">Activation time exceeded</string> <string name="omnipod_eros_history_bolus_value_with_carbs">%1$.2f U, CH=%2$.1f g</string>
<string name="omnipod_pod_status_inactive">Inactive</string> <string name="omnipod_eros_history_tbr_value">Rate: %1$.2f U, duration: %2$d minutes</string>
<string name="omnipod_pod_status_pod_fault_description">Pod Fault: %1$03d %2$s</string>
<!-- Omnipod - Alerts --> <!-- Omnipod Eros - Short Status -->
<string name="omnipod_alert_finish_pairing_reminder">Finish pairing reminder</string> <string name="omnipod_eros_short_status_riley_link_battery">RLBatt: %1$d</string>
<string name="omnipod_alert_finish_setup_reminder_reminder">Finish setup reminder</string>
<string name="omnipod_alert_expiration">Pod will expire soon</string>
<string name="omnipod_alert_expiration_advisory">Pod will expire soon</string>
<string name="omnipod_alert_shutdown_imminent">Shutdown is imminent</string>
<string name="omnipod_alert_low_reservoir">Low Reservoir</string>
<string name="omnipod_alert_unknown_alert">Unknown Alert</string>
<!-- Omnipod - History --> <!-- Omnipod Eros - Error -->
<string name="omnipod_history_title">Pod History</string> <string name="omnipod_eros_error_riley_link_address_invalid">RileyLink address invalid.</string>
<string name="omnipod_history_item_description">Description</string> <string name="omnipod_eros_error_crc_mismatch">Communication failed: message integrity verification failed</string>
<string name="omnipod_history_item_source">Source</string> <string name="omnipod_eros_error_invalid_packet_type">Communication failed: received an invalid packet from the Pod</string>
<string name="omnipod_history_item_date">Date</string> <string name="omnipod_eros_error_invalid_progress_state">Communication failed: the Pod is in a wrong state</string>
<string name="omnipod_history_type">Type:</string> <string name="omnipod_eros_error_invalid_response">Communication failed: received an invalid response from the Pod</string>
<string name="omnipod_history_bolus_value">%1$.2f U</string> <string name="omnipod_eros_error_invalid_message_sequence_number">Communication failed: received a message with an invalid sequence number from the Pod</string>
<string name="omnipod_history_bolus_value_with_carbs">%1$.2f U, CH=%2$.1f g</string> <string name="omnipod_eros_error_invalid_message_address">Communication failed: received a message with an invalid address from the Pod</string>
<string name="omnipod_history_tbr_value">Rate: %1$.2f U, duration: %2$d minutes</string> <string name="omnipod_eros_error_message_decoding_failed">Communication failed: failed to decode message from the Pod</string>
<string name="omnipod_eros_error_nonce_resync_failed">Communication failed: nonce resync failed</string>
<string name="omnipod_eros_error_nonce_out_of_sync">Communication failed: nonce out of sync</string>
<string name="omnipod_eros_error_not_enough_data">Communication failed: not enough data received from the Pod</string>
<string name="omnipod_eros_error_pod_fault">A Pod fault (%1$03d %2$s) has been detected. Please deactivate your Pod and activate a new one</string>
<string name="omnipod_eros_error_pod_returned_error_response">Communication failed: the Pod returned an error response</string>
<string name="omnipod_eros_error_communication_failed_no_response_from_riley_link">No response from RileyLink</string>
<string name="omnipod_eros_error_communication_failed_riley_link_interrupted">RileyLink interrupted</string>
<string name="omnipod_eros_error_communication_failed_no_response_from_pod">No response from Pod</string>
<string name="omnipod_eros_error_set_basal_failed_delivery_might_be_suspended">Setting basal profile failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.</string>
<string name="omnipod_eros_error_set_basal_might_have_failed_delivery_might_be_suspended">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.</string>
<string name="omnipod_eros_error_set_basal_failed_delivery_suspended">Setting basal profile failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.</string>
<string name="omnipod_eros_error_cancel_temp_basal_failed_uncertain">Cancelling temp basal might have failed. Please manually refresh the Pod status from the Omnipod tab.</string>
<string name="omnipod_eros_error_set_temp_basal_failed_old_tbr_might_be_cancelled">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.</string>
<string name="omnipod_eros_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed">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.</string>
<string name="omnipod_eros_error_set_temp_basal_failed_validation">TBR duration must be greater than zero and a multiple of %1$s minutes.</string>
<string name="omnipod_eros_error_set_time_failed_delivery_might_be_suspended">Setting time might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.</string>
<string name="omnipod_eros_error_set_time_failed_delivery_suspended">Setting time failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.</string>
<string name="omnipod_eros_error_failed_to_read_pulse_log">Failed to read Pulse Log</string>
<string name="omnipod_eros_error_automatic_time_or_timezone_change_failed">Failed to automatically change time on the Pod. You should manually synchronize the time on the Omnipod tab.</string>
<string name="omnipod_eros_error_operation_not_possible_no_configuration">Operation is not possible.\n\nYou need to configure Omnipod first, before you can use this operation.</string>
<string name="omnipod_eros_error_bolus_failed_uncertain">Unable to verify whether the bolus succeeded. Please manually verify that your Pod is bolusing by listening to clicks. <b>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!</b></string>
<string name="omnipod_eros_error_bolus_failed_uncertain_smb">Unable to verify whether SMB bolus (%1$.2f U) succeeded. <b>If you are sure that the Bolus didn\'t succeed, you should manually delete the SMB entry from Treatments.</b></string>
<string name="omnipod_eros_error_tbr_running_but_aaps_not_aware">A temporary basal is running on the Pod, but AAPS is unaware of this temporary basal. Please cancel your temporary basal manually.</string>
<!-- Omnipod - Short status --> <!-- Omnipod Eros - Pod Management -->
<string name="omnipod_short_status_no_active_pod">No Active Pod</string> <string name="omnipod_eros_pod_management_button_riley_link_stats">RileyLink Stats</string>
<string name="omnipod_short_status_last_connection">LastConn: %1$d min ago</string> <string name="omnipod_eros_pod_management_waiting_for_riley_link_connection">Waiting for RileyLink connection…</string>
<string name="omnipod_short_status_last_bolus">LastBolus: %1$s @ %2$s</string> <string name="omnipod_eros_pod_management_button_reset_riley_link_config">Reset RileyLink Config</string>
<string name="omnipod_short_status_temp_basal">Temp: %1$s</string> <string name="omnipod_eros_pod_management_button_read_pulse_log">Read Pulse Log</string>
<string name="omnipod_short_status_extended_bolus">Extended: %1$s</string> <string name="omnipod_eros_pod_management_button_reading_pulse_log">Reading Pulse Log…</string>
<string name="omnipod_short_status_reservoir">Reserv: %1$sU</string> <string name="omnipod_eros_pod_management_pulse_log">Pulse Log</string>
<string name="omnipod_short_status_rl_battery">RLBatt: %1$d</string> <string name="omnipod_eros_pod_management_pulse_log_value">Pulse Log (copied to clipboard)</string>
<!-- Omnipod - Error --> <!-- Omnipod Eros - Pod Activation Wizard -->
<string name="omnipod_warning">Warning</string> <string name="omnipod_eros_pod_activation_wizard_fill_pod_text">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 <b>Next</b>.\n\n<b>Note:</b> do not remove the Pod\'s needle cap at this time.\n<b>Note:</b> please place the RileyLink in an upright position and place the Pod a few inches away from it.</string>
<string name="omnipod_error_rileylink_address_invalid">RileyLink address invalid.</string> <string name="omnipod_eros_pod_activation_wizard_initialize_pod_text">Trying to pair with the new Pod and prime it.\n\nWhen the initialization process has successfully been completed, you can press <b>Next</b>.\n\n<b>Note:</b> please place the RileyLink in an upright position and place the Pod a few inches away from it.</string>
<string name="omnipod_error_operation_not_possible_no_configuration">Operation is not possible.\n\nYou need to configure Omnipod first, before you can use this operation.</string>
<string name="omnipod_error_pod_not_attached">No active Pod</string>
<string name="omnipod_error_time_out_of_sync">The time on the Pod is out of sync. Please update the time in the Omnipod tab.</string>
<string name="omnipod_error_unexpected_exception">An unexpected error occurred. Please report! (%1$s: %2$s).</string>
<string name="omnipod_error_crc_mismatch">Communication failed: message integrity verification failed</string>
<string name="omnipod_error_invalid_packet_type">Communication failed: received an invalid packet from the Pod</string>
<string name="omnipod_error_invalid_progress_state">Communication failed: the Pod is in a wrong state</string>
<string name="omnipod_error_invalid_response">Communication failed: received an invalid response from the Pod</string>
<string name="omnipod_error_invalid_message_sequence_number">Communication failed: received a message with an invalid sequence number from the Pod</string>
<string name="omnipod_error_invalid_message_address">Communication failed: received a message with an invalid address from the Pod</string>
<string name="omnipod_error_message_decoding_failed">Communication failed: failed to decode message from the Pod</string>
<string name="omnipod_error_nonce_resync_failed">Communication failed: nonce resync failed</string>
<string name="omnipod_error_nonce_out_of_sync">Communication failed: nonce out of sync</string>
<string name="omnipod_error_not_enough_data">Communication failed: not enough data received from the Pod</string>
<string name="omnipod_error_pod_fault">A Pod fault (%1$03d %2$s) has been detected. Please deactivate your Pod and activate a new one</string>
<string name="omnipod_error_pod_returned_error_response">Communication failed: the Pod returned an error response</string>
<string name="omnipod_error_communication_failed_no_response_from_riley_link">No response from RileyLink</string>
<string name="omnipod_error_communication_failed_riley_link_interrupted">RileyLink interrupted</string>
<string name="omnipod_error_communication_failed_no_response_from_pod">No response from Pod</string>
<string name="omnipod_error_set_basal_failed_delivery_might_be_suspended">Setting basal profile failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.</string>
<string name="omnipod_error_set_basal_might_have_failed_delivery_might_be_suspended">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.</string>
<string name="omnipod_error_set_basal_failed_delivery_suspended">Setting basal profile failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.</string>
<string name="omnipod_error_set_basal_failed">Setting basal profile failed.</string>
<string name="omnipod_error_cancel_temp_basal_failed_uncertain">Cancelling temp basal might have failed. Please manually refresh the Pod status from the Omnipod tab.</string>
<string name="omnipod_error_set_temp_basal_failed_old_tbr_might_be_cancelled">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.</string>
<string name="omnipod_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed">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.</string>
<string name="omnipod_error_set_temp_basal_failed_validation">TBR duration must be greater than zero and a multiple of %1$s minutes.</string>
<string name="omnipod_error_set_time_failed_delivery_might_be_suspended">Setting time might have failed. Delivery might be suspended! Please manually refresh the Pod status from the Omnipod tab and resume delivery if needed.</string>
<string name="omnipod_error_set_time_failed_delivery_suspended">Setting time failed. Delivery is suspended! Please manually resume delivery from the Omnipod tab.</string>
<string name="omnipod_error_failed_to_set_profile_empty_profile">Failed to set basal profile: received an empty profile. Make sure to activate your basal profile.</string>
<string name="omnipod_error_set_initial_basal_schedule_no_profile">No basal profile is active. Make sure to activate your basal profile.</string>
<string name="omnipod_error_unknown_custom_command">Unknown custom command: %1$s</string>
<string name="omnipod_error_failed_to_read_pulse_log">Failed to read Pulse Log</string>
<string name="omnipod_error_failed_to_refresh_status">Failed to refresh status</string>
<string name="omnipod_error_failed_to_refresh_status_on_startup">Failed to refresh status on startup</string>
<string name="omnipod_error_failed_to_acknowledge_alerts">Failed to acknowledge alerts</string>
<string name="omnipod_error_failed_to_suspend_delivery">Failed to suspend delivery</string>
<string name="omnipod_error_failed_to_set_time">Failed to set time</string>
<string name="omnipod_error_failed_to_resume_delivery">Failed to resume delivery</string>
<string name="omnipod_error_automatic_time_or_timezone_change_failed">Failed to automatically change time on the Pod. You should manually synchronize the time on the Omnipod tab.</string>
<string name="omnipod_error_bolus_failed_uncertain">Unable to verify whether the bolus succeeded. Please manually verify that your Pod is bolusing by listening to clicks. <b>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!</b></string>
<string name="omnipod_error_bolus_failed_uncertain_smb">Unable to verify whether SMB bolus (%1$.2f U) succeeded. <b>If you are sure that the Bolus didn\'t succeed, you should manually delete the SMB entry from Treatments.</b></string>
<string name="omnipod_error_bolus_did_not_succeed">Bolus did not succeed.</string>
<string name="omnipod_error_failed_to_initialize_pod">Failed to initialize the Pod</string>
<string name="omnipod_error_failed_to_insert_cannula">Failed to insert cannula</string>
<string name="omnipod_error_pod_fault_activation_time_exceeded">The Pod\'s activation time has been exceeded. This Pod can no longer be activated.</string>
<string name="omnipod_error_failed_to_verify_activation_progress">Failed to verify activation progress. Please retry.</string>
<string name="omnipod_error_pod_suspended">Pod suspended</string>
<string name="omnipod_error_failed_to_play_test_beep">Failed to play test beep</string>
<string name="omnipod_error_tbr_running_but_aaps_not_aware">A temporary basal is running on the Pod, but AAPS is unaware of this temporary basal. Please cancel your temporary basal manually.</string>
<!-- Omnipod - Confirmation --> <!-- Omnipod Eros - Other -->
<string name="omnipod_confirmation">Confirmation</string> <string name="omnipod_eros_uncertain">uncertain</string>
<string name="omnipod_confirmation_time_or_timezone_change">Time and/or time zone changed on the Pod.</string>
<string name="omnipod_confirmation_expiration_alerts_updated">Alert configuration has been updated in the Pod.</string>
<string name="omnipod_confirmation_time_on_pod_updated">The time on the Pod has been updated.</string>
<string name="omnipod_confirmation_suspended_delivery">All insulin delivery has been suspended.</string>
<string name="omnipod_confirmation_acknowledged_alerts">Active alerts have been acknowledged.</string>
<string name="omnipod_confirmation_delivery_resumed">Insulin delivery has been resumed.</string>
<!-- Omnipod - Commands -->
<string name="omnipod_cmd_deactivate_pod">Deactivate Pod</string>
<string name="omnipod_cmd_discard_pod">Discard Pod</string>
<string name="omnipod_cmd_set_bolus">Set Bolus</string>
<string name="omnipod_cmd_cancel_bolus">Cancel Bolus</string>
<string name="omnipod_cmd_set_tbr">Set Temporary Basal</string>
<string name="omnipod_cmd_cancel_tbr_by_driver">Cancel Temporary Basal (internally by driver)</string>
<string name="omnipod_cmd_cancel_tbr">Cancel Temporary Basal</string>
<string name="omnipod_cmd_set_basal_schedule">Set Basal Schedule</string>
<string name="omnipod_cmd_get_pod_status">Get Pod Status</string>
<string name="omnipod_cmd_get_pod_info">Get Pod Info</string>
<string name="omnipod_cmd_set_time">Set Time</string>
<string name="omnipod_cmd_configure_alerts">Configure Alerts</string>
<string name="omnipod_cmd_acknowledge_alerts">Acknowledge Alerts</string>
<string name="omnipod_cmd_suspend_delivery">Suspend Delivery</string>
<string name="omnipod_cmd_resume_delivery">Resume Delivery</string>
<string name="omnipod_cmd_unknown_entry">Unknown Entry</string>
<string name="omnipod_cmd_initialize_pod">Initialize Pod</string>
<string name="omnipod_cmd_insert_cannula">Insert Cannula</string>
<string name="omnipod_cmd_read_pulse_log">Read Pulse Log</string>
<string name="omnipod_cmd_set_fake_suspended_tbr">Set fake temporary basal because the Pod is suspended</string>
<string name="omnipod_cmd_cancel_fake_suspended_tbr">Cancel fake temporary basal that was created because the Pod was suspended</string>
<string name="omnipod_cmd_split_tbr">Split temporary basal because of uncertain failure in cancellation</string>
<string name="omnipod_cmd_beep_config">Beep Config</string>
<string name="omnipod_cmd_play_test_beep">Play Test Beep</string>
<!-- Omnipod - Pod Management -->
<string name="omnipod_pod_management_title">Pod Management</string>
<string name="omnipod_pod_management_heading_actions">Actions</string>
<string name="omnipod_pod_management_heading_tools">Tools</string>
<string name="omnipod_pod_management_waiting_for_rileylink_connection">Waiting for RileyLink connection…</string>
<string name="omnipod_pod_management_button_activate_pod">Activate Pod</string>
<string name="omnipod_pod_management_button_deactivate_pod">Deactivate Pod</string>
<string name="omnipod_pod_management_button_discard_pod">Discard Pod</string>
<string name="omnipod_pod_management_button_pod_history">Pod History</string>
<string name="omnipod_pod_management_button_riley_link_stats">RileyLink Stats</string>
<string name="omnipod_pod_management_button_reset_riley_link_config">Reset RileyLink Config</string>
<string name="omnipod_pod_management_button_read_pulse_log">Read Pulse Log</string>
<string name="omnipod_pod_management_button_reading_pulse_log">Reading Pulse Log…</string>
<string name="omnipod_pod_management_discard_pod_confirmation">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 <b>Deactivate Pod</b> option.\n\nIf you wish to proceed, please make sure to remove the Pod from your body!</string>
<string name="omnipod_pod_management_button_play_test_beep">Play Test Beep</string>
<string name="omnipod_pod_management_button_playing_test_beep">Playing Test Beep…</string>
<!-- Omnipod - Pod activation Wizard -->
<string name="omnipod_pod_activation_wizard_fill_pod_title">Fill Pod</string>
<string name="omnipod_pod_activation_wizard_fill_pod_text">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 <b>Next</b>.\n\n<b>Note:</b> do not remove the Pod\'s needle cap at this time.\n<b>Note:</b> please place the RileyLink in an upright position and place the Pod a few inches away from it.</string>
<string name="omnipod_pod_activation_wizard_initialize_pod_title">Initialize Pod</string>
<string name="omnipod_pod_activation_wizard_initialize_pod_text">Trying to pair with the new Pod and prime it.\n\nWhen the initialization process has successfully been completed, you can press <b>Next</b>.\n\n<b>Note:</b> please place the RileyLink in an upright position and place the Pod a few inches away from it.</string>
<string name="omnipod_pod_activation_wizard_attach_pod_title">Attach Pod</string>
<string name="omnipod_pod_activation_wizard_attach_pod_text">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 <b>Cancel</b> and discard your Pod.\n\nPress <b>Next</b> to insert the cannula and begin basal delivery.</string>
<string name="omnipod_pod_activation_wizard_attach_pod_confirm_insert_cannula_text">When you press <b>OK</b>, the cannula will be inserted. Make sure that you have attached the Pod to the infusion site.</string>
<string name="omnipod_pod_activation_wizard_insert_cannula_title">Insert Cannula</string>
<string name="omnipod_pod_activation_wizard_insert_cannula_text">Trying to set initial basal schedule and insert the cannula.\n\nWhen the cannula has successfully been inserted, you can press <b>Next</b>.</string>
<string name="omnipod_pod_activation_wizard_pod_activated_title">Pod Activated</string>
<string name="omnipod_pod_activation_wizard_pod_activated_text">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.</string>
<!-- Omnipod - Pod deactivation Wizard -->
<string name="omnipod_pod_deactivation_wizard_deactivate_pod_title">Deactivate Pod</string>
<string name="omnipod_pod_deactivation_wizard_deactivate_pod_text">Press <b>Next</b> to deactivate the Pod.\n\n<b>Note:</b> This will suspend all insulin delivery and deactivate the Pod.</string>
<string name="omnipod_pod_deactivation_wizard_deactivating_pod_title">Deactivating Pod</string>
<string name="omnipod_pod_deactivation_wizard_deactivating_pod_text">Deactivating the Pod.\n\nWhen deactivation has completed successfully, you can press <b>Next</b>.</string>
<string name="omnipod_pod_deactivation_wizard_pod_deactivated_title">Pod Deactivated</string>
<string name="omnipod_pod_deactivation_wizard_pod_deactivated_text">Your Pod has been deactivated.\n\nPlease remove the Pod from your body and recycle it.</string>
<string name="omnipod_pod_deactivation_wizard_pod_discarded_title">Pod Discarded</string>
<string name="omnipod_pod_deactivation_wizard_pod_discarded_text">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.</string>
<string name="omnipod_pod_deactivation_wizard_discard_pod_confirmation">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?</string>
<string name="omnipod_pod_deactivation_wizard_discard_pod">Discard Pod</string>
<!-- Omnipod - Overview -->
<string name="omnipod_overview_button_set_time">Set time</string>
<string name="omnipod_overview_button_suspend_delivery">Suspend</string>
<string name="omnipod_overview_button_resume_delivery">Resume Delivery</string>
<string name="omnipod_overview_button_pod_management">Pod Mgmt</string>
<string name="omnipod_overview_button_acknowledge_active_alerts">Ack Alerts</string>
<string name="omnipod_overview_pod_status">Pod Status</string>
<string name="omnipod_overview_total_delivered">Total Delivered</string>
<string name="omnipod_overview_total_delivered_value">%1$.2f U</string>
<string name="omnipod_overview_pod_address">Pod Address</string>
<string name="omnipod_overview_pod_expiry_date">Pod Expires</string>
<string name="omnipod_overview_last_connection">Last Connection</string>
<string name="omnipod_overview_last_bolus">Last Bolus</string>
<string name="omnipod_overview_temp_basal_rate">Temp Basal Rate</string>
<string name="omnipod_overview_base_basal_rate">Base Basal Rate</string>
<string name="omnipod_overview_reservoir">Reservoir</string>
<string name="omnipod_overview_pod_active_alerts">Active Pod Alerts</string>
<string name="omnipod_overview_firmware_version">Firmware Version</string>
<string name="omnipod_overview_time_on_pod">Time on Pod</string>
<string name="omnipod_overview_temp_basal_value">%1$.2fU/h @%2$s (%3$d/%4$d minutes)</string>
<string name="omnipod_overview_reservoir_value">%1$.2f U left</string>
<string name="omnipod_overview_reservoir_value_over50">Over 50 U left</string>
<string name="omnipod_overview_errors">Errors</string>
<!-- Omnipod - Other -->
<string name="omnipod_pump_description">Pump integration for Omnipod, requires RileyLink (with at least 2.0 firmware) device.</string>
<string name="omnipod_uncertain">uncertain</string>
<string name="omnipod_pulse_log">Pulse log</string>
<string name="omnipod_pulse_log_value">Pulse Log (copied to clipboard)</string>
<string name="omnipod_yes">Yes</string>
<string name="omnipod_no">No</string>
<string name="omnipod_ok">OK</string>
<string name="omnipod_cancel">Cancel</string>
<!-- Omnipod - Times -->
<string name="omnipod_moments_ago">Moments ago</string>
<string name="omnipod_less_than_a_minute_ago">Less than a minute ago</string>
<string name="omnipod_composite_time">%1$s and %2$s</string>
<string name="omnipod_time_ago">%1$s ago</string>
<plurals name="omnipod_minutes">
<item quantity="one">%1$d minute</item>
<item quantity="other">%1$d minutes</item>
</plurals>
<plurals name="omnipod_hours">
<item quantity="one">%1$d hour</item>
<item quantity="other">%1$d hours</item>
</plurals>
<plurals name="omnipod_days">
<item quantity="one">%1$d day</item>
<item quantity="other">%1$d days</item>
</plurals>
<plurals name="omnipod_pod_alerts">
<item quantity="one">Pod Alert: %1$s</item>
<item quantity="other">Pod Alerts: %1$s</item>
</plurals>
</resources> </resources>

View file

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/omnipod_eros_preferences_category_riley_link">
<Preference
android:enabled="true"
android:key="@string/key_rileylink_mac_address"
android:title="@string/omnipod_eros_preferences_riley_link_configuration">
<intent android:action="info.nightscout.androidaps.plugins.PumpCommon.dialog.RileyLinkBLEConfigActivity" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_riley_link_show_battery_level"
android:summary="@string/riley_link_show_battery_level_summary"
android:title="@string/riley_link_show_battery_level" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_riley_link_show_battery_level"
android:key="@string/key_omnipod_eros_battery_change_logging_enabled"
android:title="@string/omnipod_eros_preferences_battery_change_logging_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_confirmation_beeps">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_bolus_beeps_enabled"
android:title="@string/omnipod_common_preferences_bolus_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_basal_beeps_enabled"
android:title="@string/omnipod_common_preferences_basal_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_smb_beeps_enabled"
android:title="@string/omnipod_common_preferences_smb_beeps_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_tbr_beeps_enabled"
android:title="@string/omnipod_common_preferences_tbr_beeps_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_alerts">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_expiration_reminder_enabled"
android:title="@string/omnipod_common_preferences_expiration_reminder_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="9"
android:dependency="@string/key_omnipod_common_expiration_reminder_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_common_expiration_reminder_hours_before_shutdown"
android:title="@string/omnipod_common_preferences_expiration_reminder_hours_before_shutdown"
validate:maxNumber="24"
validate:minNumber="2"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_low_reservoir_alert_enabled"
android:title="@string/omnipod_common_preferences_low_reservoir_alert_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="20"
android:dependency="@string/key_omnipod_common_low_reservoir_alert_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_common_low_reservoir_alert_units"
android:title="@string/omnipod_common_preferences_low_reservoir_alert_units"
validate:maxNumber="50"
validate:minNumber="5"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_automatically_acknowledge_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_acknowledge_alerts" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_eros_preferences_category_notifications">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_eros_notification_uncertain_tbr_sound_enabled"
android:title="@string/omnipod_eros_preferences_notification_uncertain_tbr_sound_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_eros_notification_uncertain_smb_sound_enabled"
android:title="@string/omnipod_eros_preferences_notification_uncertain_smb_sound_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_eros_notification_uncertain_bolus_sound_enabled"
android:title="@string/omnipod_eros_preferences_notification_uncertain_bolus_sound_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_common_preferences_category_other">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_suspend_delivery_button_enabled"
android:title="@string/omnipod_common_preferences_suspend_delivery_button_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_eros_pulse_log_button_enabled"
android:title="@string/omnipod_eros_preferences_pulse_log_button_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_eros_riley_link_stats_button_enabled"
android:title="@string/omnipod_eros_preferences_riley_link_stats_button_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_common_time_change_event_enabled"
android:title="@string/omnipod_common_preferences_time_change_enabled" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -1,136 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/omnipod_preference_category_rileylink">
<Preference
android:enabled="true"
android:key="@string/key_rileylink_mac_address"
android:title="@string/omnipod_config_riley_link_configuration">
<intent android:action="info.nightscout.androidaps.plugins.PumpCommon.dialog.RileyLinkBLEConfigActivity" />
</Preference>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_riley_link_show_battery_level"
android:summary="@string/riley_link_show_battery_level_summary"
android:title="@string/riley_link_show_battery_level" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_riley_link_show_battery_level"
android:key="@string/key_omnipod_battery_change_logging_enabled"
android:title="@string/omnipod_config_battery_change_logging_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_preference_category_confirmation_beeps">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_bolus_beeps_enabled"
android:title="@string/omnipod_config_bolus_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_basal_beeps_enabled"
android:title="@string/omnipod_config_basal_beeps_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_smb_beeps_enabled"
android:title="@string/omnipod_config_smb_beeps_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_tbr_beeps_enabled"
android:title="@string/omnipod_config_tbr_beeps_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_preference_category_alerts">
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_expiration_reminder_enabled"
android:title="@string/omnipod_config_expiration_reminder_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="9"
android:dependency="@string/key_omnipod_expiration_reminder_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_expiration_reminder_hours_before_shutdown"
android:title="@string/omnipod_config_expiration_reminder_hours_before_shutdown"
validate:maxNumber="24"
validate:minNumber="2"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_low_reservoir_alert_enabled"
android:title="@string/omnipod_config_low_reservoir_alert_enabled" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="20"
android:dependency="@string/key_omnipod_low_reservoir_alert_enabled"
android:digits="0123456789"
android:inputType="number"
android:key="@string/key_omnipod_low_reservoir_alert_units"
android:title="@string/omnipod_config_low_reservoir_alert_units"
validate:maxNumber="50"
validate:minNumber="5"
validate:testType="numericRange" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_automatically_acknowledge_alerts_enabled"
android:title="@string/omnipod_config_automatically_acknowledge_alerts" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_preference_category_notifications">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_notification_uncertain_tbr_sound_enabled"
android:title="@string/omnipod_config_notification_uncertain_tbr_sound_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_notification_uncertain_smb_sound_enabled"
android:title="@string/omnipod_config_notification_uncertain_smb_sound_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_notification_uncertain_bolus_sound_enabled"
android:title="@string/omnipod_config_notification_uncertain_bolus_sound_enabled" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/omnipod_preference_category_other">
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_suspend_delivery_button_enabled"
android:title="@string/omnipod_config_suspend_delivery_button_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_pulse_log_button_enabled"
android:title="@string/omnipod_config_pulse_log_button_enabled" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_riley_link_stats_button_enabled"
android:title="@string/omnipod_config_rileylink_stats_button_enabled" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_omnipod_time_change_event_enabled"
android:title="@string/omnipod_config_time_change_enabled" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>

View file

@ -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.data.TempBasalPair;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; 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.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.resources.ResourceHelper;
import info.nightscout.androidaps.utils.rx.TestAapsSchedulers; import info.nightscout.androidaps.utils.rx.TestAapsSchedulers;
@ -45,7 +45,7 @@ public class OmnipodErosPumpPluginTest {
RxBusWrapper rxBusWrapper = new RxBusWrapper(new TestAapsSchedulers()); RxBusWrapper rxBusWrapper = new RxBusWrapper(new TestAapsSchedulers());
@Mock ResourceHelper resourceHelper; @Mock ResourceHelper resourceHelper;
@Mock(answer = Answers.RETURNS_DEEP_STUBS) ActivePluginProvider activePluginProvider; @Mock(answer = Answers.RETURNS_DEEP_STUBS) ActivePluginProvider activePluginProvider;
@Mock AapsOmnipodManager aapsOmnipodManager; @Mock AapsOmnipodErosManager aapsOmnipodErosManager;
@Mock CommandQueueProvider commandQueueProvider; @Mock CommandQueueProvider commandQueueProvider;
@Mock RileyLinkUtil rileyLinkUtil; @Mock RileyLinkUtil rileyLinkUtil;
@ -59,7 +59,7 @@ public class OmnipodErosPumpPluginTest {
// mock all the things // mock all the things
PowerMockito.mockStatic(Looper.class); PowerMockito.mockStatic(Looper.class);
OmnipodErosPumpPlugin plugin = new OmnipodErosPumpPlugin(injector, aapsLogger, new TestAapsSchedulers(), rxBusWrapper, null, 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, null, null, null, null,
rileyLinkUtil, 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 // 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 -> { invocation -> {
TempBasalPair pair = invocation.getArgument(0); TempBasalPair pair = invocation.getArgument(0);
PumpEnactResult result = new PumpEnactResult(injector); PumpEnactResult result = new PumpEnactResult(injector);
@ -120,7 +120,7 @@ public class OmnipodErosPumpPluginTest {
// When treatment // When treatment
result1 = plugin.setTempBasalPercent(80, 30, profile, false); result1 = plugin.setTempBasalPercent(80, 30, profile, false);
// Then return sane values // 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); assertEquals(result1.duration, 30);
// Given weird basal // Given weird basal

View file

@ -11,12 +11,12 @@ import java.util.List;
import info.nightscout.androidaps.data.Profile; 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.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry; 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.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
public class AapsOmnipodManagerTest { public class AapsOmnipodErosManagerTest {
@Rule @Rule
public ExpectedException thrown = ExpectedException.none(); public ExpectedException thrown = ExpectedException.none();
@ -42,7 +42,7 @@ public class AapsOmnipodManagerTest {
value3 value3
}); });
BasalSchedule basalSchedule = AapsOmnipodManager.mapProfileToBasalSchedule(profile); BasalSchedule basalSchedule = AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
List<BasalScheduleEntry> entries = basalSchedule.getEntries(); List<BasalScheduleEntry> entries = basalSchedule.getEntries();
assertEquals(3, entries.size()); assertEquals(3, entries.size());
@ -64,14 +64,14 @@ public class AapsOmnipodManagerTest {
public void invalidProfileNullProfile() { public void invalidProfileNullProfile() {
thrown.expect(IllegalArgumentException.class); thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Profile can not be null"); thrown.expectMessage("Profile can not be null");
AapsOmnipodManager.mapProfileToBasalSchedule(null); AapsOmnipodErosManager.mapProfileToBasalSchedule(null);
} }
@Test @Test
public void invalidProfileNullEntries() { public void invalidProfileNullEntries() {
thrown.expect(IllegalArgumentException.class); thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Basal values can not be null"); thrown.expectMessage("Basal values can not be null");
AapsOmnipodManager.mapProfileToBasalSchedule(mock(Profile.class)); AapsOmnipodErosManager.mapProfileToBasalSchedule(mock(Profile.class));
} }
@Test @Test
@ -82,7 +82,7 @@ public class AapsOmnipodManagerTest {
PowerMockito.when(profile.getBasalValues()).thenReturn(new Profile.ProfileValue[0]); PowerMockito.when(profile.getBasalValues()).thenReturn(new Profile.ProfileValue[0]);
AapsOmnipodManager.mapProfileToBasalSchedule(profile); AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
} }
@Test @Test
@ -100,7 +100,7 @@ public class AapsOmnipodManagerTest {
value, value,
}); });
AapsOmnipodManager.mapProfileToBasalSchedule(profile); AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
} }
@Test @Test
@ -123,7 +123,7 @@ public class AapsOmnipodManagerTest {
value2 value2
}); });
AapsOmnipodManager.mapProfileToBasalSchedule(profile); AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
} }
@Test @Test
@ -141,7 +141,7 @@ public class AapsOmnipodManagerTest {
value, value,
}); });
AapsOmnipodManager.mapProfileToBasalSchedule(profile); AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
} }
@Test @Test
@ -156,7 +156,7 @@ public class AapsOmnipodManagerTest {
value, value,
}); });
BasalSchedule basalSchedule = AapsOmnipodManager.mapProfileToBasalSchedule(profile); BasalSchedule basalSchedule = AapsOmnipodErosManager.mapProfileToBasalSchedule(profile);
BasalScheduleEntry basalScheduleEntry = basalSchedule.getEntries().get(0); BasalScheduleEntry basalScheduleEntry = basalSchedule.getEntries().get(0);
assertEquals(0.05D, basalScheduleEntry.getRate(), 0.000001); assertEquals(0.05D, basalScheduleEntry.getRate(), 0.000001);

View file

@ -20,7 +20,7 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
@RunWith(PowerMockRunner.class) @RunWith(PowerMockRunner.class)
public class AapsPodStateManagerTest { public class AapsErosPodStateManagerTest {
@Mock AAPSLogger aapsLogger; @Mock AAPSLogger aapsLogger;
@Mock SP sp; @Mock SP sp;
@ -35,7 +35,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis()); DateTimeUtils.setCurrentMillisFixed(now.getMillis());
AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus); AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0); podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1), podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS); new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);
@ -53,7 +53,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis()); DateTimeUtils.setCurrentMillisFixed(now.getMillis());
AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus); AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0); podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1), podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS); new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);
@ -76,7 +76,7 @@ public class AapsPodStateManagerTest {
DateTimeUtils.setCurrentMillisFixed(now.getMillis()); DateTimeUtils.setCurrentMillisFixed(now.getMillis());
AapsPodStateManager podStateManager = new AapsPodStateManager(aapsLogger, sp, rxBus); AapsErosPodStateManager podStateManager = new AapsErosPodStateManager(aapsLogger, sp, rxBus);
podStateManager.initState(0x0); podStateManager.initState(0x0);
podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1), podStateManager.setInitializationParameters(0, 0, new FirmwareVersion(1, 1, 1),
new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS); new FirmwareVersion(2, 2, 2), timeZone, PodProgressStatus.ABOVE_FIFTY_UNITS);