Add and wire some Omnipod Dash UI
This commit is contained in:
parent
16f35870eb
commit
12ff37123d
|
@ -15,6 +15,7 @@ import info.nightscout.androidaps.danars.di.InsightModule
|
|||
import info.nightscout.androidaps.database.DatabaseModule
|
||||
import info.nightscout.androidaps.plugins.pump.common.di.RileyLinkModule
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.dagger.OmnipodDashModule
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodErosModule
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -36,6 +37,7 @@ import javax.inject.Singleton
|
|||
WizardModule::class,
|
||||
RileyLinkModule::class,
|
||||
MedtronicModule::class,
|
||||
OmnipodDashModule::class,
|
||||
OmnipodErosModule::class,
|
||||
APSModule::class,
|
||||
PreferencesModule::class,
|
||||
|
|
|
@ -42,6 +42,7 @@ import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
|||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.mdi.MDIPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin
|
||||
|
@ -162,6 +163,12 @@ abstract class PluginsModule {
|
|||
@IntKey(155)
|
||||
abstract fun bindOmnipodErosPumpPlugin(plugin: OmnipodErosPumpPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@PumpDriver
|
||||
@IntoMap
|
||||
@IntKey(156)
|
||||
abstract fun bindOmnipodDashPumpPlugin(plugin: OmnipodDashPumpPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@NotNSClient
|
||||
@IntoMap
|
||||
|
|
|
@ -6,4 +6,10 @@
|
|||
<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" />
|
||||
|
||||
<application>
|
||||
<activity android:name=".ui.wizard.activation.DashPodActivationWizardActivity" />
|
||||
<activity android:name=".ui.wizard.deactivation.DashPodDeactivationWizardActivity" />
|
||||
<activity android:name=".ui.DashPodManagementActivity" />
|
||||
</application>
|
||||
</manifest>
|
|
@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash;
|
|||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
@ -56,7 +58,7 @@ public class OmnipodDashPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
}
|
||||
|
||||
@Override public boolean isInitialized() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public boolean isSuspended() {
|
||||
|
@ -64,7 +66,8 @@ public class OmnipodDashPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
}
|
||||
|
||||
@Override public boolean isBusy() {
|
||||
return false;
|
||||
// prevents the queue from executing
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public boolean isConnected() {
|
||||
|
@ -100,15 +103,18 @@ public class OmnipodDashPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
}
|
||||
|
||||
@NotNull @Override public PumpEnactResult setNewBasalProfile(@NotNull Profile profile) {
|
||||
return null;
|
||||
// TODO
|
||||
return new PumpEnactResult(getInjector()).success(true).enacted(true);
|
||||
}
|
||||
|
||||
@Override public boolean isThisProfileSet(@NotNull Profile profile) {
|
||||
return false;
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public long lastDataTime() {
|
||||
return 0;
|
||||
// TODO
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override public double getBaseBasalRate() {
|
||||
|
@ -152,7 +158,7 @@ public class OmnipodDashPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
}
|
||||
|
||||
@NotNull @Override public JSONObject getJSONStatus(@NotNull Profile profile, @NotNull String profileName, @NotNull String version) {
|
||||
return null;
|
||||
return new JSONObject();
|
||||
}
|
||||
|
||||
@NotNull @Override public ManufacturerType manufacturer() {
|
||||
|
|
|
@ -1,8 +1,33 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.dagger
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.ActivityScope
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodWizardModule
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.DashPodManagementActivity
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.OmnipodDashOverviewFragment
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.DashPodActivationWizardActivity
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.DashPodDeactivationWizardActivity
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class OmnipodDashModule {
|
||||
// ACTIVITIES
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract fun contributesDashPodManagementActivity(): DashPodManagementActivity
|
||||
|
||||
@ActivityScope
|
||||
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodDashWizardViewModelsModule::class])
|
||||
abstract fun contributesDashActivationWizardActivity(): DashPodActivationWizardActivity
|
||||
|
||||
@ActivityScope
|
||||
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodDashWizardViewModelsModule::class])
|
||||
abstract fun contributesDashDeactivationWizardActivity(): DashPodDeactivationWizardActivity
|
||||
|
||||
// FRAGMENTS
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract fun contributesOmnipodDashOverviewFragment(): OmnipodDashOverviewFragment
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.dagger
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.multibindings.IntoMap
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodPluginQualifier
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.ViewModelKey
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.AttachPodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.PodActivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.StartPodActivationViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDeactivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDiscardedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.StartPodDeactivationViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action.DashInitializePodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action.DashInsertCannulaViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info.DashAttachPodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info.DashPodActivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info.DashStartPodActivationViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.action.DashDeactivatePodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info.DashPodDeactivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info.DashPodDiscardedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info.DashStartPodDeactivationViewModel
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class OmnipodDashWizardViewModelsModule {
|
||||
// #### VIEW MODELS ############################################################################
|
||||
|
||||
// POD ACTIVATION
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(StartPodActivationViewModel::class)
|
||||
internal abstract fun startPodActivationViewModel(viewModel: DashStartPodActivationViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(InitializePodViewModel::class)
|
||||
internal abstract fun initializePodViewModel(viewModel: DashInitializePodViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(AttachPodViewModel::class)
|
||||
internal abstract fun attachPodViewModel(viewModel: DashAttachPodViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(InsertCannulaViewModel::class)
|
||||
internal abstract fun insertCannulaViewModel(viewModel: DashInsertCannulaViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(PodActivatedViewModel::class)
|
||||
internal abstract fun podActivatedViewModel(viewModel: DashPodActivatedViewModel): ViewModel
|
||||
|
||||
// POD DEACTIVATION
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(StartPodDeactivationViewModel::class)
|
||||
internal abstract fun startPodDeactivationViewModel(viewModel: DashStartPodDeactivationViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(DeactivatePodViewModel::class)
|
||||
internal abstract fun deactivatePodViewModel(viewModel: DashDeactivatePodViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(PodDeactivatedViewModel::class)
|
||||
internal abstract fun podDeactivatedViewModel(viewModel: DashPodDeactivatedViewModel): ViewModel
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
@OmnipodPluginQualifier
|
||||
@ViewModelKey(PodDiscardedViewModel::class)
|
||||
internal abstract fun podDiscardedViewModel(viewModel: DashPodDiscardedViewModel): ViewModel
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
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.dash.R
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.databinding.OmnipodDashPodManagementBinding
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.DashPodActivationWizardActivity
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.DashPodDeactivationWizardActivity
|
||||
import info.nightscout.androidaps.queue.Callback
|
||||
import info.nightscout.androidaps.queue.events.EventQueueChanged
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* Created by andy on 30/08/2019
|
||||
*/
|
||||
class DashPodManagementActivity : NoSplashAppCompatActivity() {
|
||||
|
||||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var fabricPrivacy: FabricPrivacy
|
||||
@Inject lateinit var commandQueue: CommandQueueProvider
|
||||
@Inject lateinit var injector: HasAndroidInjector
|
||||
@Inject lateinit var context: Context
|
||||
@Inject lateinit var aapsSchedulers: AapsSchedulers
|
||||
|
||||
private var disposables: CompositeDisposable = CompositeDisposable()
|
||||
|
||||
private lateinit var binding: OmnipodDashPodManagementBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
binding = OmnipodDashPodManagementBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.buttonActivatePod.setOnClickListener {
|
||||
/* TODO determine type
|
||||
val type: PodActivationWizardActivity.Type = if (podStateManager.isPodInitialized
|
||||
and podStateManager.activationProgress.isAtLeast(ActivationProgress.PRIMING_COMPLETED)) {
|
||||
PodActivationWizardActivity.Type.SHORT
|
||||
} else {
|
||||
PodActivationWizardActivity.Type.LONG
|
||||
}
|
||||
*/
|
||||
|
||||
val intent = Intent(this, DashPodActivationWizardActivity::class.java)
|
||||
intent.putExtra(PodActivationWizardActivity.KEY_TYPE, PodActivationWizardActivity.Type.LONG)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.buttonDeactivatePod.setOnClickListener {
|
||||
startActivity(Intent(this, DashPodDeactivationWizardActivity::class.java))
|
||||
}
|
||||
|
||||
binding.buttonDiscardPod.setOnClickListener {
|
||||
OKDialog.showConfirmation(this,
|
||||
resourceHelper.gs(R.string.omnipod_common_pod_management_discard_pod_confirmation), Thread {
|
||||
// TODO discard Pod
|
||||
})
|
||||
}
|
||||
|
||||
binding.buttonPlayTestBeep.setOnClickListener {
|
||||
// TODO
|
||||
binding.buttonPlayTestBeep.isEnabled = false
|
||||
binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_playing_test_beep)
|
||||
|
||||
commandQueue.customCommand(CommandPlayTestBeep(), object : Callback() {
|
||||
override fun run() {
|
||||
if (!result.success) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
disposables += rxBus
|
||||
.toObservable(EventQueueChanged::class.java)
|
||||
.observeOn(aapsSchedulers.main)
|
||||
.subscribe({ refreshButtons() }, fabricPrivacy::logException)
|
||||
|
||||
refreshButtons()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
disposables.clear()
|
||||
}
|
||||
|
||||
private fun refreshButtons() {
|
||||
// TODO update button state from Pod state
|
||||
}
|
||||
|
||||
private fun displayErrorDialog(title: String, message: String, @Suppress("SameParameterValue") withSound: Boolean) {
|
||||
context.let {
|
||||
ErrorHelperActivity.runAlarm(it, message, title, if (withSound) R.raw.boluserror else 0)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -31,4 +32,12 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
|||
_bluetoothStatusBinding = OmnipodDashOverviewBluetoothStatusBinding.bind(it.root)
|
||||
_binding = it
|
||||
}.root
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
buttonBinding.buttonPodManagement.setOnClickListener {
|
||||
startActivity(Intent(context, DashPodManagementActivity::class.java))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity
|
||||
|
||||
class DashPodActivationWizardActivity : PodActivationWizardActivity()
|
|
@ -0,0 +1,31 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.data.PumpEnactResult
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashInitializePodViewModel @Inject constructor(private val aapsLogger: AAPSLogger, private val injector: HasAndroidInjector) : InitializePodViewModel() {
|
||||
|
||||
override fun isPodInAlarm(): Boolean = false // TODO
|
||||
|
||||
override fun isPodActivationTimeExceeded(): Boolean = false // TODO
|
||||
|
||||
override fun isPodDeactivatable(): Boolean = true // TODO
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult {
|
||||
// TODO FIRST STEP OF ACTIVATION
|
||||
aapsLogger.debug(LTag.PUMP, "started activation part 1")
|
||||
return PumpEnactResult(injector).success(false).comment("not implemented")
|
||||
}
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_initialize_pod_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_dash_pod_activation_wizard_initialize_pod_text
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.data.PumpEnactResult
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashInsertCannulaViewModel @Inject constructor(private val injector: HasAndroidInjector, private val profileFunction: ProfileFunction) : InsertCannulaViewModel() {
|
||||
|
||||
override fun isPodInAlarm(): Boolean = false // TODO
|
||||
|
||||
override fun isPodActivationTimeExceeded(): Boolean = false // TODO
|
||||
|
||||
override fun isPodDeactivatable(): Boolean = true // TODO
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult = PumpEnactResult(injector) // TODO
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_insert_cannula_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_activation_wizard_insert_cannula_text
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.AttachPodViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashAttachPodViewModel @Inject constructor() : AttachPodViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_activation_wizard_attach_pod_text
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.PodActivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashPodActivatedViewModel @Inject constructor() : PodActivatedViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_activation_wizard_pod_activated_text
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.StartPodActivationViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashStartPodActivationViewModel @Inject constructor() : StartPodActivationViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_start_pod_activation_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId(): Int = R.string.omnipod_dash_pod_activation_wizard_start_pod_activation_text
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
|
||||
|
||||
class DashPodDeactivationWizardActivity : PodDeactivationWizardActivity()
|
|
@ -0,0 +1,23 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.action
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.data.PumpEnactResult
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.R
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashDeactivatePodViewModel @Inject constructor(private val injector: HasAndroidInjector) : DeactivatePodViewModel() {
|
||||
|
||||
override fun doExecuteAction(): PumpEnactResult = PumpEnactResult(injector) // TODO
|
||||
|
||||
override fun discardPod() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_text
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDeactivatedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashPodDeactivatedViewModel @Inject constructor() : PodDeactivatedViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_text
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDiscardedViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashPodDiscardedViewModel @Inject constructor() : PodDiscardedViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_text
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.info
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.StartPodDeactivationViewModel
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.R
|
||||
import javax.inject.Inject
|
||||
|
||||
class DashStartPodDeactivationViewModel @Inject constructor() : StartPodDeactivationViewModel() {
|
||||
|
||||
@StringRes
|
||||
override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_start_pod_deactivation_title
|
||||
|
||||
@StringRes
|
||||
override fun getTextId() = R.string.omnipod_common_pod_deactivation_wizard_start_pod_deactivation_text
|
||||
}
|
|
@ -37,6 +37,7 @@
|
|||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -77,9 +78,6 @@
|
|||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="2dip"
|
||||
|
|
139
omnipod-dash/src/main/res/layout/omnipod_dash_pod_management.xml
Normal file
139
omnipod-dash/src/main/res/layout/omnipod_dash_pod_management.xml
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/omnipod_dash_pod_management"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.DashPodManagementActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/omnipod_eros_pod_management_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="10dp"
|
||||
|
||||
android:gravity="center"
|
||||
android:text="@string/omnipod_common_pod_management_title"
|
||||
android:textAlignment="center"
|
||||
android:textSize="12pt"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:text="@string/omnipod_common_pod_management_heading_actions" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
android:id="@+id/Actions_Row_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/Actions_Row_1_horizontal_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0" />
|
||||
|
||||
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||
android:id="@+id/button_activate_pod"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_pod_management_activate_pod"
|
||||
android:text="@string/omnipod_common_pod_management_button_activate_pod"
|
||||
android:textAllCaps="false"
|
||||
android:visibility="visible"
|
||||
app:layout_constrainedHeight="@+id/Actions_Row_1_horizontal_guideline"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/Actions_Col_1_Row_1_vertical_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/Actions_Col_1_Row_1_vertical_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||
android:id="@+id/button_deactivate_pod"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_pod_management_deactivate_pod"
|
||||
android:text="@string/omnipod_common_pod_management_button_deactivate_pod"
|
||||
android:textAllCaps="false"
|
||||
android:visibility="visible"
|
||||
app:layout_constrainedHeight="@+id/Actions_Row_1_horizontal_guideline"
|
||||
app:layout_constraintLeft_toRightOf="@+id/Actions_Col_1_Row_1_vertical_guideline"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
android:id="@+id/Actions_Row_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/Actions_Row_2_horizontal_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0" />
|
||||
|
||||
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||
android:id="@+id/button_play_test_beep"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_pod_management_play_test_beep"
|
||||
android:text="@string/omnipod_common_pod_management_button_play_test_beep"
|
||||
android:textAllCaps="false"
|
||||
android:visibility="visible"
|
||||
app:layout_constrainedHeight="@+id/Actions_Row_2_horizontal_guideline"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/Actions_Col_1_Row_2_vertical_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/Actions_Col_1_Row_2_vertical_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||
android:id="@+id/button_discard_pod"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_pod_management_discard_pod"
|
||||
android:text="@string/omnipod_common_pod_management_button_discard_pod"
|
||||
android:textAllCaps="false"
|
||||
android:visibility="gone"
|
||||
app:layout_constrainedHeight="@+id/Actions_Row_2_horizontal_guideline"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintLeft_toRightOf="@+id/Actions_Col_1_Row_2_vertical_guideline"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -11,4 +11,8 @@
|
|||
<!-- Omnipod Dash - Overview -->
|
||||
<string name="omnipod_dash_bluetooth_status">Bluetooth Status</string>
|
||||
<string name="omnipod_dash_bluetooth_address">Bluetooth Address</string>
|
||||
|
||||
<!-- Omnipod Dash - Pod Activation Wizard -->
|
||||
<string name="omnipod_dash_pod_activation_wizard_start_pod_activation_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.</string>
|
||||
<string name="omnipod_dash_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>.</string>
|
||||
</resources>
|
|
@ -82,7 +82,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Al
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosActiveAlertsChanged;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosFaultEventChanged;
|
||||
|
@ -122,7 +122,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
public static final int STARTUP_STATUS_REQUEST_TRIES = 2;
|
||||
public static final double RESERVOIR_OVER_50_UNITS_DEFAULT = 75.0;
|
||||
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final RileyLinkServiceData rileyLinkServiceData;
|
||||
private final AapsOmnipodErosManager aapsOmnipodErosManager;
|
||||
private final AapsOmnipodUtil aapsOmnipodUtil;
|
||||
|
@ -167,7 +167,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
|
|||
ResourceHelper resourceHelper,
|
||||
ActivePluginProvider activePlugin,
|
||||
SP sp,
|
||||
PodStateManager podStateManager,
|
||||
ErosPodStateManager podStateManager,
|
||||
AapsOmnipodErosManager aapsOmnipodErosManager,
|
||||
CommandQueueProvider commandQueue,
|
||||
FabricPrivacy fabricPrivacy,
|
||||
|
|
|
@ -6,7 +6,7 @@ import dagger.android.ContributesAndroidInjector
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.ActivityScope
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodWizardModule
|
||||
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.ErosPodStateManager
|
||||
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.service.RileyLinkOmnipodService
|
||||
|
@ -23,36 +23,36 @@ abstract class OmnipodErosModule {
|
|||
// ACTIVITIES
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract fun contributesPodManagementActivity(): ErosPodManagementActivity
|
||||
@ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): ErosPodHistoryActivity
|
||||
abstract fun contributesErosPodManagementActivity(): ErosPodManagementActivity
|
||||
@ContributesAndroidInjector abstract fun contributesErosPodHistoryActivity(): ErosPodHistoryActivity
|
||||
|
||||
@ActivityScope
|
||||
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodErosWizardViewModelsModule::class])
|
||||
abstract fun contributesActivationWizardActivity(): ErosPodActivationWizardActivity
|
||||
abstract fun contributesErosActivationWizardActivity(): ErosPodActivationWizardActivity
|
||||
|
||||
@ActivityScope
|
||||
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodErosWizardViewModelsModule::class])
|
||||
abstract fun contributesDeactivationWizardActivity(): ErosPodDeactivationWizardActivity
|
||||
abstract fun contributesErosDeactivationWizardActivity(): ErosPodDeactivationWizardActivity
|
||||
|
||||
// FRAGMENTS
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract fun contributesOmnipodFragment(): OmnipodErosOverviewFragment
|
||||
abstract fun contributesOmnipodErosOverviewFragment(): OmnipodErosOverviewFragment
|
||||
|
||||
// SERVICES
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract fun omnipodCommunicationManagerProvider(): OmnipodRileyLinkCommunicationManager
|
||||
abstract fun contributesOmnipodRileyLinkCommunicationManagerProvider(): OmnipodRileyLinkCommunicationManager
|
||||
@ContributesAndroidInjector
|
||||
abstract fun contributesRileyLinkOmnipodService(): RileyLinkOmnipodService
|
||||
|
||||
// DATA
|
||||
|
||||
@ContributesAndroidInjector abstract fun rlHistoryItemOmnipod(): RLHistoryItemOmnipod
|
||||
@ContributesAndroidInjector abstract fun contributesRlHistoryItemOmnipod(): RLHistoryItemOmnipod
|
||||
|
||||
companion object {
|
||||
|
||||
@Provides
|
||||
fun podStateManagerProvider(aapsErosPodStateManager: AapsErosPodStateManager): PodStateManager = aapsErosPodStateManager
|
||||
fun erosPodStateManagerProvider(aapsErosPodStateManager: AapsErosPodStateManager): ErosPodStateManager = aapsErosPodStateManager
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class AcknowledgeAlertsAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final AlertSet alerts;
|
||||
|
||||
public AcknowledgeAlertsAction(PodStateManager podStateManager, AlertSet alerts) {
|
||||
public AcknowledgeAlertsAction(ErosPodStateManager podStateManager, AlertSet alerts) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class AcknowledgeAlertsAction implements OmnipodAction<StatusResponse> {
|
|||
this.alerts = alerts;
|
||||
}
|
||||
|
||||
public AcknowledgeAlertsAction(PodStateManager podStateManager, AlertSlot alertSlot) {
|
||||
public AcknowledgeAlertsAction(ErosPodStateManager podStateManager, AlertSlot alertSlot) {
|
||||
this(podStateManager, new AlertSet(Collections.singletonList(alertSlot)));
|
||||
}
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Pa
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalMessageAddressException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalPacketTypeException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalVersionResponseTypeException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class AssignAddressAction implements OmnipodAction<Void> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final AAPSLogger aapsLogger;
|
||||
|
||||
public AssignAddressAction(PodStateManager podStateManager, AAPSLogger aapsLogger) {
|
||||
public AssignAddressAction(ErosPodStateManager podStateManager, AAPSLogger aapsLogger) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("podStateManager can not be null");
|
||||
}
|
||||
|
|
|
@ -9,17 +9,17 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BolusDeliverySchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class BolusAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final double units;
|
||||
private final Duration timeBetweenPulses;
|
||||
private final boolean acknowledgementBeep;
|
||||
private final boolean completionBeep;
|
||||
|
||||
public BolusAction(PodStateManager podStateManager, double units, Duration timeBetweenPulses,
|
||||
public BolusAction(ErosPodStateManager podStateManager, double units, Duration timeBetweenPulses,
|
||||
boolean acknowledgementBeep, boolean completionBeep) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
|
@ -34,7 +34,7 @@ public class BolusAction implements OmnipodAction<StatusResponse> {
|
|||
this.completionBeep = completionBeep;
|
||||
}
|
||||
|
||||
public BolusAction(PodStateManager podStateManager, double units, boolean acknowledgementBeep, boolean completionBeep) {
|
||||
public BolusAction(ErosPodStateManager podStateManager, double units, boolean acknowledgementBeep, boolean completionBeep) {
|
||||
this(podStateManager, units, Duration.standardSeconds(2), acknowledgementBeep, completionBeep);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final EnumSet<DeliveryType> deliveryTypes;
|
||||
private final boolean acknowledgementBeep;
|
||||
|
||||
public CancelDeliveryAction(PodStateManager podStateManager, EnumSet<DeliveryType> deliveryTypes,
|
||||
public CancelDeliveryAction(ErosPodStateManager podStateManager, EnumSet<DeliveryType> deliveryTypes,
|
||||
boolean acknowledgementBeep) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
|
|
|
@ -5,14 +5,14 @@ import java.util.List;
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.ConfigureAlertsCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class ConfigureAlertsAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final List<AlertConfiguration> alertConfigurations;
|
||||
|
||||
public ConfigureAlertsAction(PodStateManager podStateManager, List<AlertConfiguration> alertConfigurations) {
|
||||
public ConfigureAlertsAction(ErosPodStateManager podStateManager, List<AlertConfiguration> alertConfigurations) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class ConfigureAlertsAction implements OmnipodAction<StatusResponse> {
|
|||
return statusResponse;
|
||||
}
|
||||
|
||||
public static void updateConfiguredAlerts(PodStateManager podStateManager, List<AlertConfiguration> alertConfigurations) {
|
||||
public static void updateConfiguredAlerts(ErosPodStateManager podStateManager, List<AlertConfiguration> alertConfigurations) {
|
||||
for (AlertConfiguration alertConfiguration : alertConfigurations) {
|
||||
if (alertConfiguration.isActive()) {
|
||||
podStateManager.putConfiguredAlert(alertConfiguration.getAlertSlot(), alertConfiguration.getAlertType());
|
||||
|
|
|
@ -5,11 +5,11 @@ import org.joda.time.Duration;
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.BeepConfigCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
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.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class ConfigureBeepAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final BeepConfigType beepType;
|
||||
private final boolean basalCompletionBeep;
|
||||
private final Duration basalIntervalBeep;
|
||||
|
@ -18,7 +18,7 @@ public class ConfigureBeepAction implements OmnipodAction<StatusResponse> {
|
|||
private final boolean bolusCompletionBeep;
|
||||
private final Duration bolusIntervalBeep;
|
||||
|
||||
public ConfigureBeepAction(PodStateManager podState, BeepConfigType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, boolean tempBasalCompletionBeep, Duration tempBasalIntervalBeep, boolean bolusCompletionBeep, Duration bolusIntervalBeep) {
|
||||
public ConfigureBeepAction(ErosPodStateManager podState, BeepConfigType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, boolean tempBasalCompletionBeep, Duration tempBasalIntervalBeep, boolean bolusCompletionBeep, Duration bolusIntervalBeep) {
|
||||
if (podState == null || beepType == null) {
|
||||
throw new IllegalArgumentException("Required parameter(s) missing");
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class ConfigureBeepAction implements OmnipodAction<StatusResponse> {
|
|||
this.podStateManager = podState;
|
||||
}
|
||||
|
||||
public ConfigureBeepAction(PodStateManager podState, BeepConfigType beepType) {
|
||||
public ConfigureBeepAction(ErosPodStateManager podState, BeepConfigType beepType) {
|
||||
this(podState, beepType, false, Duration.ZERO, false, Duration.ZERO, false, Duration.ZERO);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.PodFaultException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final boolean acknowledgementBeep;
|
||||
|
||||
public DeactivatePodAction(PodStateManager podStateManager, boolean acknowledgementBeep) {
|
||||
public DeactivatePodAction(ErosPodStateManager podStateManager, boolean acknowledgementBeep) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
}
|
||||
|
|
|
@ -3,14 +3,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.GetStatusCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class GetPodInfoAction implements OmnipodAction<PodInfoResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final PodInfoType podInfoType;
|
||||
|
||||
public GetPodInfoAction(PodStateManager podStateManager, PodInfoType podInfoType) {
|
||||
public GetPodInfoAction(ErosPodStateManager podStateManager, PodInfoType podInfoType) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.GetStatusCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class GetStatusAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
|
||||
public GetStatusAction(PodStateManager podState) {
|
||||
public GetStatusAction(ErosPodStateManager podState) {
|
||||
if (podState == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
}
|
||||
|
|
|
@ -11,17 +11,17 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Al
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalActivationProgressException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class InsertCannulaAction implements OmnipodAction<Void> {
|
||||
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final BasalSchedule initialBasalSchedule;
|
||||
private final Duration expirationReminderTimeBeforeShutdown;
|
||||
private final Integer lowReservoirAlertUnits;
|
||||
|
||||
public InsertCannulaAction(PodStateManager podStateManager, BasalSchedule initialBasalSchedule,
|
||||
public InsertCannulaAction(ErosPodStateManager podStateManager, BasalSchedule initialBasalSchedule,
|
||||
Duration expirationReminderTimeBeforeShutdown, Integer lowReservoirAlertUnits) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
|
|
|
@ -3,15 +3,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.service.PrimeService;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalActivationProgressException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class PrimeAction implements OmnipodAction<Void> {
|
||||
|
||||
private final PrimeService service;
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
|
||||
public PrimeAction(PrimeService primeService, PodStateManager podStateManager) {
|
||||
public PrimeAction(PrimeService primeService, ErosPodStateManager podStateManager) {
|
||||
if (primeService == null) {
|
||||
throw new IllegalArgumentException("Prime service cannot be null");
|
||||
}
|
||||
|
|
|
@ -9,17 +9,17 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class SetBasalScheduleAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final BasalSchedule basalSchedule;
|
||||
private final boolean confidenceReminder;
|
||||
private final Duration scheduleOffset;
|
||||
private final boolean acknowledgementBeep;
|
||||
|
||||
public SetBasalScheduleAction(PodStateManager podStateManager, BasalSchedule basalSchedule,
|
||||
public SetBasalScheduleAction(ErosPodStateManager podStateManager, BasalSchedule basalSchedule,
|
||||
boolean confidenceReminder, Duration scheduleOffset, boolean acknowledgementBeep) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
|
|
|
@ -10,17 +10,17 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.SetInsulinScheduleCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.TempBasalExtraCommand;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class SetTempBasalAction implements OmnipodAction<StatusResponse> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final double rate;
|
||||
private final Duration duration;
|
||||
private final boolean acknowledgementBeep;
|
||||
private final boolean completionBeep;
|
||||
|
||||
public SetTempBasalAction(PodStateManager podStateManager, double rate, Duration duration,
|
||||
public SetTempBasalAction(ErosPodStateManager podStateManager, double rate, Duration duration,
|
||||
boolean acknowledgementBeep, boolean completionBeep) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager cannot be null");
|
||||
|
|
|
@ -16,14 +16,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ill
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalPacketTypeException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalPodProgressException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalVersionResponseTypeException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class SetupPodAction implements OmnipodAction<Void> {
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final AAPSLogger aapsLogger;
|
||||
|
||||
public SetupPodAction(PodStateManager podStateManager, AAPSLogger aapsLogger) {
|
||||
public SetupPodAction(ErosPodStateManager podStateManager, AAPSLogger aapsLogger) {
|
||||
if (podStateManager == null) {
|
||||
throw new IllegalArgumentException("Pod state manager can not be null");
|
||||
}
|
||||
|
|
|
@ -11,14 +11,14 @@ import java.util.Map;
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.AlertConfigurationUtil;
|
||||
|
||||
public final class ExpirationReminderBuilder {
|
||||
private final Map<AlertSlot, AlertConfiguration> alerts = new HashMap<>();
|
||||
private final DateTime endOfServiceTime;
|
||||
|
||||
public ExpirationReminderBuilder(PodStateManager podStateManager) {
|
||||
public ExpirationReminderBuilder(ErosPodStateManager podStateManager) {
|
||||
this.endOfServiceTime = podStateManager.getActivatedAt().plus(OmnipodConstants.SERVICE_DURATION);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,26 +11,26 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.AlertConfigurationUtil;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
|
||||
public class PrimeService {
|
||||
|
||||
public StatusResponse executeDisableTab5Sub16And17FaultConfigCommand(OmnipodRileyLinkCommunicationManager communicationService, PodStateManager podStateManager) {
|
||||
public StatusResponse executeDisableTab5Sub16And17FaultConfigCommand(OmnipodRileyLinkCommunicationManager communicationService, ErosPodStateManager podStateManager) {
|
||||
FaultConfigCommand faultConfigCommand = new FaultConfigCommand(podStateManager.getCurrentNonce(), (byte) 0x00, (byte) 0x00);
|
||||
OmnipodMessage faultConfigMessage = new OmnipodMessage(podStateManager.getAddress(),
|
||||
Collections.singletonList(faultConfigCommand), podStateManager.getMessageNumber());
|
||||
return communicationService.exchangeMessages(StatusResponse.class, podStateManager, faultConfigMessage);
|
||||
}
|
||||
|
||||
public StatusResponse executeFinishSetupReminderAlertCommand(OmnipodRileyLinkCommunicationManager communicationService, PodStateManager podStateManager) {
|
||||
public StatusResponse executeFinishSetupReminderAlertCommand(OmnipodRileyLinkCommunicationManager communicationService, ErosPodStateManager podStateManager) {
|
||||
AlertConfiguration finishSetupReminderAlertConfiguration = AlertConfigurationUtil.createFinishSetupReminderAlertConfiguration();
|
||||
return communicationService.executeAction(new ConfigureAlertsAction(podStateManager,
|
||||
Collections.singletonList(finishSetupReminderAlertConfiguration)));
|
||||
}
|
||||
|
||||
public StatusResponse executePrimeBolusCommand(OmnipodRileyLinkCommunicationManager communicationService, PodStateManager podStateManager) {
|
||||
public StatusResponse executePrimeBolusCommand(OmnipodRileyLinkCommunicationManager communicationService, ErosPodStateManager podStateManager) {
|
||||
return communicationService.executeAction(new BolusAction(podStateManager, OmnipodConstants.POD_PRIME_BOLUS_UNITS,
|
||||
Duration.standardSeconds(1), false, true));
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.sc
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil;
|
||||
|
||||
// TODO add nullchecks on some setters
|
||||
public abstract class PodStateManager {
|
||||
public abstract class ErosPodStateManager {
|
||||
|
||||
private final AAPSLogger aapsLogger;
|
||||
private final Gson gsonInstance;
|
||||
private PodState podState;
|
||||
|
||||
protected PodStateManager(AAPSLogger aapsLogger) {
|
||||
protected ErosPodStateManager(AAPSLogger aapsLogger) {
|
||||
this.aapsLogger = aapsLogger;
|
||||
this.gsonInstance = createGson();
|
||||
}
|
|
@ -63,7 +63,7 @@ public class OmnipodManager {
|
|||
private static final int ACTION_VERIFICATION_TRIES = 1;
|
||||
|
||||
private final OmnipodRileyLinkCommunicationManager communicationService;
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
|
||||
private ActiveBolusData activeBolusData;
|
||||
private SingleSubject<Boolean> bolusCommandExecutionSubject;
|
||||
|
@ -76,7 +76,7 @@ public class OmnipodManager {
|
|||
public OmnipodManager(AAPSLogger aapsLogger,
|
||||
AapsSchedulers aapsSchedulers,
|
||||
OmnipodRileyLinkCommunicationManager communicationService,
|
||||
PodStateManager podStateManager) {
|
||||
ErosPodStateManager podStateManager) {
|
||||
if (communicationService == null) {
|
||||
throw new IllegalArgumentException("Communication service cannot be null");
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
|||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosActiveAlertsChanged;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosFaultEventChanged;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosTbrChanged;
|
||||
|
@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodEr
|
|||
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
||||
|
||||
@Singleton
|
||||
public class AapsErosPodStateManager extends PodStateManager {
|
||||
public class AapsErosPodStateManager extends ErosPodStateManager {
|
||||
private final SP sp;
|
||||
private final RxBusWrapper rxBus;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ril
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnexpectedException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnreachableException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.OmnipodManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
|
||||
|
@ -94,7 +94,7 @@ import io.reactivex.subjects.SingleSubject;
|
|||
@Singleton
|
||||
public class AapsOmnipodErosManager {
|
||||
|
||||
private final PodStateManager podStateManager;
|
||||
private final ErosPodStateManager podStateManager;
|
||||
private final AapsOmnipodUtil aapsOmnipodUtil;
|
||||
private final AAPSLogger aapsLogger;
|
||||
private final AapsSchedulers aapsSchedulers;
|
||||
|
@ -127,7 +127,7 @@ public class AapsOmnipodErosManager {
|
|||
|
||||
@Inject
|
||||
public AapsOmnipodErosManager(OmnipodRileyLinkCommunicationManager communicationService,
|
||||
PodStateManager podStateManager,
|
||||
ErosPodStateManager podStateManager,
|
||||
AapsOmnipodUtil aapsOmnipodUtil,
|
||||
AAPSLogger aapsLogger,
|
||||
AapsSchedulers aapsSchedulers,
|
||||
|
|
|
@ -43,7 +43,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Pod
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkTimeoutException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnexpectedException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnreachableException;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
|
||||
/**
|
||||
* Created by andy on 6/29/18.
|
||||
|
@ -86,11 +86,11 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
return super.sendAndListen(msg, timeout_ms, repeatCount, retryCount, extendPreamble_ms);
|
||||
}
|
||||
|
||||
public <T extends MessageBlock> T sendCommand(Class<T> responseClass, PodStateManager podStateManager, MessageBlock command) {
|
||||
public <T extends MessageBlock> T sendCommand(Class<T> responseClass, ErosPodStateManager podStateManager, MessageBlock command) {
|
||||
return sendCommand(responseClass, podStateManager, command, true);
|
||||
}
|
||||
|
||||
public <T extends MessageBlock> T sendCommand(Class<T> responseClass, PodStateManager podStateManager, MessageBlock command, boolean automaticallyResyncNone) {
|
||||
public <T extends MessageBlock> T sendCommand(Class<T> responseClass, ErosPodStateManager podStateManager, MessageBlock command, boolean automaticallyResyncNone) {
|
||||
OmnipodMessage message = new OmnipodMessage(podStateManager.getAddress(), Collections.singletonList(command), podStateManager.getMessageNumber());
|
||||
return exchangeMessages(responseClass, podStateManager, message, automaticallyResyncNone);
|
||||
}
|
||||
|
@ -100,19 +100,19 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
return action.execute(this);
|
||||
}
|
||||
|
||||
public <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, PodStateManager podStateManager, OmnipodMessage message) {
|
||||
public <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, ErosPodStateManager podStateManager, OmnipodMessage message) {
|
||||
return exchangeMessages(responseClass, podStateManager, message, true);
|
||||
}
|
||||
|
||||
public <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, PodStateManager podStateManager, OmnipodMessage message, boolean automaticallyResyncNonce) {
|
||||
public <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, ErosPodStateManager podStateManager, OmnipodMessage message, boolean automaticallyResyncNonce) {
|
||||
return exchangeMessages(responseClass, podStateManager, message, null, null, automaticallyResyncNonce);
|
||||
}
|
||||
|
||||
public synchronized <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, PodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride) {
|
||||
public synchronized <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, ErosPodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride) {
|
||||
return exchangeMessages(responseClass, podStateManager, message, addressOverride, ackAddressOverride, true);
|
||||
}
|
||||
|
||||
public synchronized <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, PodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride, boolean automaticallyResyncNonce) {
|
||||
public synchronized <T extends MessageBlock> T exchangeMessages(Class<T> responseClass, ErosPodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride, boolean automaticallyResyncNonce) {
|
||||
aapsLogger.debug(LTag.PUMPBTCOMM, "Exchanging OmnipodMessage: responseClass={}, podStateManager={}, message={}, addressOverride={}, ackAddressOverride={}, automaticallyResyncNonce={}", //
|
||||
responseClass.getSimpleName(), podStateManager, message, addressOverride, ackAddressOverride, automaticallyResyncNonce);
|
||||
|
||||
|
@ -192,7 +192,7 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
|
||||
}
|
||||
|
||||
private MessageBlock transportMessages(PodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride) {
|
||||
private MessageBlock transportMessages(ErosPodStateManager podStateManager, OmnipodMessage message, Integer addressOverride, Integer ackAddressOverride) {
|
||||
int packetAddress = podStateManager.getAddress();
|
||||
if (addressOverride != null) {
|
||||
packetAddress = addressOverride;
|
||||
|
@ -298,7 +298,7 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
return messageBlock;
|
||||
}
|
||||
|
||||
private OmnipodPacket createAckPacket(PodStateManager podStateManager, Integer packetAddress, Integer messageAddress) {
|
||||
private OmnipodPacket createAckPacket(ErosPodStateManager podStateManager, Integer packetAddress, Integer messageAddress) {
|
||||
if (packetAddress == null) {
|
||||
packetAddress = podStateManager.getAddress();
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
return new OmnipodPacket(packetAddress, PacketType.ACK, podStateManager.getPacketNumber(), ByteUtil.getBytesFromInt(messageAddress));
|
||||
}
|
||||
|
||||
private void ackUntilQuiet(PodStateManager podStateManager, Integer packetAddress, Integer messageAddress) {
|
||||
private void ackUntilQuiet(ErosPodStateManager podStateManager, Integer packetAddress, Integer messageAddress) {
|
||||
OmnipodPacket ack = createAckPacket(podStateManager, packetAddress, messageAddress);
|
||||
boolean quiet = false;
|
||||
while (!quiet) try {
|
||||
|
@ -326,15 +326,15 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
|
|||
podStateManager.increasePacketNumber();
|
||||
}
|
||||
|
||||
private OmnipodPacket exchangePackets(PodStateManager podStateManager, OmnipodPacket packet) {
|
||||
private OmnipodPacket exchangePackets(ErosPodStateManager podStateManager, OmnipodPacket packet) {
|
||||
return exchangePackets(podStateManager, packet, 0, 333, 9000, 127);
|
||||
}
|
||||
|
||||
private OmnipodPacket exchangePackets(PodStateManager podStateManager, OmnipodPacket packet, int repeatCount, int preambleExtensionMilliseconds) {
|
||||
private OmnipodPacket exchangePackets(ErosPodStateManager podStateManager, OmnipodPacket packet, int repeatCount, int preambleExtensionMilliseconds) {
|
||||
return exchangePackets(podStateManager, packet, repeatCount, 333, 9000, preambleExtensionMilliseconds);
|
||||
}
|
||||
|
||||
private OmnipodPacket exchangePackets(PodStateManager podStateManager, OmnipodPacket packet, int repeatCount, int responseTimeoutMilliseconds, int exchangeTimeoutMilliseconds, int preambleExtensionMilliseconds) {
|
||||
private OmnipodPacket exchangePackets(ErosPodStateManager podStateManager, OmnipodPacket packet, int repeatCount, int responseTimeoutMilliseconds, int exchangeTimeoutMilliseconds, int preambleExtensionMilliseconds) {
|
||||
long timeoutTime = System.currentTimeMillis() + exchangeTimeoutMilliseconds;
|
||||
|
||||
podStateManager.increasePacketNumber();
|
||||
|
|
|
@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin
|
|||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
|
||||
|
@ -36,7 +36,7 @@ public class RileyLinkOmnipodService extends RileyLinkService {
|
|||
|
||||
@Inject OmnipodErosPumpPlugin omnipodErosPumpPlugin;
|
||||
@Inject AapsOmnipodUtil aapsOmnipodUtil;
|
||||
@Inject PodStateManager podStateManager;
|
||||
@Inject ErosPodStateManager podStateManager;
|
||||
@Inject DatabaseHelperInterface databaseHelper;
|
||||
@Inject AapsOmnipodErosManager aapsOmnipodErosManager;
|
||||
@Inject OmnipodRileyLinkCommunicationManager omnipodRileyLinkCommunicationManager;
|
||||
|
|
|
@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugi
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodErosPodManagementBinding
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog
|
||||
|
@ -44,7 +44,7 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() {
|
|||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var fabricPrivacy: FabricPrivacy
|
||||
@Inject lateinit var commandQueue: CommandQueueProvider
|
||||
@Inject lateinit var podStateManager: PodStateManager
|
||||
@Inject lateinit var podStateManager: ErosPodStateManager
|
||||
@Inject lateinit var injector: HasAndroidInjector
|
||||
@Inject lateinit var rileyLinkServiceData: RileyLinkServiceData
|
||||
@Inject lateinit var aapsOmnipodManager: AapsOmnipodErosManager
|
||||
|
|
|
@ -35,7 +35,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodE
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
|
||||
|
@ -74,7 +74,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
|
|||
@Inject lateinit var commandQueue: CommandQueueProvider
|
||||
@Inject lateinit var activePlugin: ActivePluginProvider
|
||||
@Inject lateinit var omnipodErosPumpPlugin: OmnipodErosPumpPlugin
|
||||
@Inject lateinit var podStateManager: PodStateManager
|
||||
@Inject lateinit var podStateManager: ErosPodStateManager
|
||||
@Inject lateinit var sp: SP
|
||||
@Inject lateinit var omnipodUtil: AapsOmnipodUtil
|
||||
@Inject lateinit var omnipodAlertUtil: OmnipodAlertUtil
|
||||
|
|
|
@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
|
|||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertType;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager;
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper;
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ public class AapsOmnipodUtil {
|
|||
return this.gsonInstance;
|
||||
}
|
||||
|
||||
public List<String> getTranslatedActiveAlerts(PodStateManager podStateManager) {
|
||||
public List<String> getTranslatedActiveAlerts(ErosPodStateManager podStateManager) {
|
||||
List<String> translatedAlerts = new ArrayList<>();
|
||||
AlertSet activeAlerts = podStateManager.getActiveAlerts();
|
||||
|
||||
|
|
Loading…
Reference in a new issue