From ff3409d65014e23ae34538176af8e66ffa7efa22 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Sun, 8 Mar 2020 18:10:48 +0000 Subject: [PATCH] - problem with display, pumpType was not set. --- .../androidaps/plugins/pump/omnipod/OmnipodFragment.kt | 8 +++++++- .../plugins/pump/omnipod/OmnipodPumpPlugin.java | 8 ++++++-- .../plugins/pump/omnipod_dash/OmnipodDashPumpPlugin.java | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt index 1794e3f536..e64eb9f787 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt @@ -14,6 +14,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.logging.L import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin +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.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState @@ -339,7 +340,12 @@ class OmnipodFragment : Fragment() { fun updateGUI() { val plugin = OmnipodPumpPlugin.getPlugin() val pumpStatus = OmnipodUtil.getPumpStatus() - val pumpType = OmnipodUtil.getPumpType() + var pumpType = OmnipodUtil.getPumpType() + + if (pumpType==null) { + LOG.warn("PumpType was not set, reseting to Omnipod.") + pumpType = PumpType.Insulet_Omnipod; + } setDeviceStatus() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 91ed803613..973b5105f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -54,6 +54,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.pod import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCustomActionType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodPodType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodPumpPluginInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodStatusRequest; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; @@ -134,8 +135,8 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump // } // // TODO ccc -// OmnipodUtil.setOmnipodPodType(OmnipodPodType.Eros); -// OmnipodUtil.setPlugin(this); + + serviceConnection = new ServiceConnection() { @@ -169,6 +170,9 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump omnipodCommunicationManager.setPumpStatus(pumpStatusLocal); } + OmnipodUtil.setOmnipodPodType(OmnipodPodType.Eros); + OmnipodUtil.setPlugin(OmnipodPumpPlugin.this); + omnipodUIComm = new OmnipodUIComm(omnipodCommunicationManager, plugin, pumpStatusLocal); break; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/OmnipodDashPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/OmnipodDashPumpPlugin.java index db3b30534a..afecf93b9f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/OmnipodDashPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/OmnipodDashPumpPlugin.java @@ -72,7 +72,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP displayConnectionMessages = false; - OmnipodUtil.setOmnipodPodType(OmnipodPodType.Dash); + //OmnipodUtil.setOmnipodPodType(OmnipodPodType.Dash); if (omnipodCommunicationManager == null) { omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance();