From 97aac063ee962acd492cdb0af1c8b799a111505e Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Fri, 26 Feb 2021 02:45:44 +0100 Subject: [PATCH] Add OmnipodDashManagerImpl --- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 4 ++ .../omnipod/dash/dagger/OmnipodDashModule.kt | 5 ++ .../dash/driver/OmnipodDashManagerImpl.kt | 68 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index db977caef9..939c480276 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -11,6 +11,8 @@ 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.plugins.pump.omnipod.dash.driver.OmnipodDashManager +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.OmnipodDashOverviewFragment import info.nightscout.androidaps.queue.commands.CustomCommand import info.nightscout.androidaps.utils.TimeChangeType @@ -21,6 +23,8 @@ import javax.inject.Singleton @Singleton class OmnipodDashPumpPlugin @Inject constructor( + private val omnipodManager: OmnipodDashManager, + private val podStateManager: OmnipodDashPodStateManager, injector: HasAndroidInjector, aapsLogger: AAPSLogger, resourceHelper: ResourceHelper, diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/dagger/OmnipodDashModule.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/dagger/OmnipodDashModule.kt index ae22f4409a..38b571f922 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/dagger/OmnipodDashModule.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/dagger/OmnipodDashModule.kt @@ -5,6 +5,8 @@ import dagger.Provides 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.driver.OmnipodDashManager +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.OmnipodDashManagerImpl import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.BleManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.OmnipodDashBleManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager @@ -42,5 +44,8 @@ abstract class OmnipodDashModule { @Provides fun providesPodStateManager(podStateManager: OmnipodDashPodStateManagerImpl): OmnipodDashPodStateManager = podStateManager + + @Provides + fun providesOmnipodManager(omnipodManager: OmnipodDashManagerImpl): OmnipodDashManager = omnipodManager } } \ No newline at end of file diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt new file mode 100644 index 0000000000..af4e3c8700 --- /dev/null +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -0,0 +1,68 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver + +import info.nightscout.androidaps.logging.AAPSLogger +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.OmnipodDashBleManager +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.event.PodEvent +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager +import io.reactivex.Observable +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class OmnipodDashManagerImpl @Inject constructor( + private val aapsLogger: AAPSLogger, + private val podStateManager: OmnipodDashPodStateManager, + private val bleManager: OmnipodDashBleManager +) : OmnipodDashManager { + + override fun activatePodPart1(): Observable { + // TODO + return Observable.empty() + } + + override fun activatePodPart2(): Observable { + // TODO + return Observable.empty() + } + + override fun getStatus(): Observable { + // TODO + return Observable.empty() + } + + override fun setBasalProgram(program: BasalProgram): Observable { + // TODO + return Observable.empty() + } + + override fun suspendDelivery(): Observable { + // TODO + return Observable.empty() + } + + override fun setTime(): Observable { + // TODO + return Observable.empty() + } + + override fun setTempBasal(rate: Double, durationInMinutes: Short): Observable { + // TODO + return Observable.empty() + } + + override fun cancelTempBasal(): Observable { + // TODO + return Observable.empty() + } + + override fun bolus(amount: Double): Observable { + // TODO + return Observable.empty() + } + + override fun cancelBolus(): Observable { + // TODO + return Observable.empty() + } +} \ No newline at end of file