From c6d94284d76f98032d2f3a75ad18a0894a3dee72 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Fri, 30 Aug 2019 16:20:18 +0100 Subject: [PATCH] - merge from bart - added new dialogs (Omnipod Mgmt and InitPodWizard), extended OmnipodFragment code - changes to OmnipodCommunicationManagerInterface --- .../plugins/pump/omnipod/OmnipodFragment.kt | 65 +++++++++++-------- .../plugins/pump/omnipod/OmnipodManager.java | 24 ++++++- .../pump/omnipod/OmnipodPumpPlugin.java | 53 ++++++++++++--- .../pump/omnipod/comm/ui/OmnipodUITask.java | 10 ++- .../pump/omnipod/defs/OmnipodCommandType.java | 2 +- .../OmnipodCommunicationManagerInterface.java | 4 +- .../defs/OmnipodPumpPluginInterface.java | 9 +++ .../omnipod/defs/OmnipodStatusRequest.java | 9 +++ .../pump/omnipod/defs/PodInitActionType.java | 49 ++++++++++++-- .../pump/omnipod/util/OmnipodUtil.java | 10 +-- .../omnipod_dash/OmnipodDashPumpPlugin.java | 6 +- app/src/main/res/layout/omnipod_pod_mgmt.xml | 16 ++--- 12 files changed, 190 insertions(+), 67 deletions(-) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodPumpPluginInterface.java create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodStatusRequest.java 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 ea6226c18b..aec006dd7a 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 @@ -22,9 +22,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity -import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpDeviceState +import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodStatusRequest import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodDeviceState - +import info.nightscout.androidaps.plugins.pump.omnipod.dialogs.PodManagementActivity import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodRefreshButtonState @@ -77,11 +77,11 @@ class OmnipodFragment : Fragment() { omnipod_pod_status.text = "{fa-bed}" omnipod_pod_mgmt.setOnClickListener { -// if (OmnipodUtil.getPumpStatus().verifyConfiguration()) { -// startActivity(Intent(context, MedtronicHistoryActivity::class.java)) -// } else { -// OmnipodUtil.displayNotConfiguredDialog(context) -// } + if (OmnipodUtil.getPumpStatus().verifyConfiguration()) { + startActivity(Intent(context, PodManagementActivity::class.java)) + } else { + OmnipodUtil.displayNotConfiguredDialog(context) + } } omnipod_refresh.setOnClickListener { @@ -89,8 +89,8 @@ class OmnipodFragment : Fragment() { OmnipodUtil.displayNotConfiguredDialog(context) } else { omnipod_refresh.isEnabled = false - OmnipodUtil.getPlugin().resetStatusState() - ConfigBuilderPlugin.getPlugin().commandQueue.readStatus("Clicked refresh", object : Callback() { + OmnipodUtil.getPlugin().addPodStatusRequest(OmnipodStatusRequest.ResetState); + ConfigBuilderPlugin.getPlugin().commandQueue.readStatus("Clicked Refresh", object : Callback() { override fun run() { activity?.runOnUiThread { omnipod_refresh.isEnabled = true } } @@ -106,6 +106,16 @@ class OmnipodFragment : Fragment() { } } + omnipod_pod_active_alerts_ack.setOnClickListener { + if (!OmnipodUtil.getPumpStatus().verifyConfiguration()) { + OmnipodUtil.displayNotConfiguredDialog(context) + } else { + omnipod_pod_active_alerts_ack.isEnabled = false + OmnipodUtil.getPlugin().addPodStatusRequest(OmnipodStatusRequest.AcknowledgeAlerts); + ConfigBuilderPlugin.getPlugin().commandQueue.readStatus("Clicked Alert Ack", null) + } + } + updateGUI() } @@ -130,7 +140,7 @@ class OmnipodFragment : Fragment() { .observeOn(AndroidSchedulers.mainThread()) .subscribe({ updateGUI() }, { FabricPrivacy.logException(it) }) } - + override fun onPause() { super.onPause() @@ -184,12 +194,12 @@ class OmnipodFragment : Fragment() { MainApp.gs(it.getResourceId(RileyLinkTargetDevice.Omnipod)) } ?: "-" - if (pumpStatus.podNumber==null) { + if (pumpStatus.podNumber == null) { } - if (pumpStatus.podSessionState==null) { + if (pumpStatus.podSessionState == null) { omnipod_pod_address.text = MainApp.gs(R.string.omnipod_pod_name_no_info) omnipod_pod_expiry.text = "-" omnipod_pod_status.text = "{fa-bed} " @@ -198,23 +208,23 @@ class OmnipodFragment : Fragment() { omnipod_pod_address.text = pumpStatus.podSessionState.address.toString() omnipod_pod_expiry.text = pumpStatus.podSessionState.expiryDateAsString - pumpStatus.podDeviceState = checkStatusSet(pumpStatus.podDeviceState, - OmnipodUtil.getPodDeviceState()) as PodDeviceState? + pumpStatus.podDeviceState = checkStatusSet(pumpStatus.podDeviceState, + OmnipodUtil.getPodDeviceState()) as PodDeviceState? var podDeviceState = pumpStatus.podDeviceState - when (podDeviceState) { - null, - PumpDeviceState.Sleeping -> omnipod_pod_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name()); - PumpDeviceState.NeverContacted, - PumpDeviceState.WakingUp, - PumpDeviceState.PumpUnreachable, - PumpDeviceState.ErrorWhenCommunicating, - PumpDeviceState.TimeoutWhenCommunicating, - PumpDeviceState.InvalidConfiguration -> omnipod_pod_status.text = " " + MainApp.gs(podDeviceState.resourceId) - PumpDeviceState.Active -> { + when (podDeviceState) { + null, + PodDeviceState.Sleeping -> omnipod_pod_status.text = "{fa-bed} " // + pumpStatus.pumpDeviceState.name()); + PodDeviceState.NeverContacted, + PodDeviceState.WakingUp, + PodDeviceState.PumpUnreachable, + PodDeviceState.ErrorWhenCommunicating, + PodDeviceState.TimeoutWhenCommunicating, + PodDeviceState.InvalidConfiguration -> omnipod_pod_status.text = " " + MainApp.gs(podDeviceState.resourceId) + PodDeviceState.Active -> { - omnipod_pod_status.text = "Active"; + omnipod_pod_status.text = "Active"; // val cmd = OmnipodUtil.getCurrentCommand() // if (cmd == null) // omnipod_pod_status.text = " " + MainApp.gs(pumpStatus.pumpDeviceState.resourceId) @@ -231,10 +241,9 @@ class OmnipodFragment : Fragment() { // ?: cmd.getCommandDescription()) // } // } + } + else -> log.warn("Unknown pump state: " + pumpStatus.podDeviceState) } - else -> log.warn("Unknown pump state: " + pumpStatus.podDeviceState) - } - } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java index bd8097cfa2..b95a35b07b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodManager.java @@ -34,6 +34,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.pod import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryType; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInfoType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress; import info.nightscout.androidaps.plugins.pump.omnipod.defs.schedule.BasalScheduleMapper; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; @@ -59,7 +61,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { instance = this; } - @Override + public PumpEnactResult insertCannula(Profile profile) { if (podState == null || podState.getSetupProgress().isBefore(SetupProgress.PRIMING_FINISHED)) { // TODO use string resource @@ -86,7 +88,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override + public PumpEnactResult pairAndPrime() { try { if (podState == null) { @@ -129,6 +131,11 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } + @Override + public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podIniReceiver) { + return null; + } + @Override public PumpEnactResult getPodStatus() { if (podState == null) { @@ -187,6 +194,17 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { } @Override + public PumpEnactResult resetPodStatus() { + return null; + } + + @Override + public PumpEnactResult setBolus(Double amount) { + return null; + } + + + // TODO rename back public PumpEnactResult resetPodState() { podState = null; SP.remove(OmnipodConst.Prefs.PodState); @@ -194,7 +212,7 @@ public class OmnipodManager implements OmnipodCommunicationManagerInterface { return new PumpEnactResult().success(true).enacted(true); } - @Override + // TODO rename back public PumpEnactResult bolus(Double units) { if (!isInitialized()) { return createNotInitializedResult(); 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 bbe9bb60e0..d813717015 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 @@ -31,9 +31,9 @@ import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.events.EventRefreshOverview; import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginType; -import info.nightscout.androidaps.interfaces.PumpInterface; 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.general.actions.defs.CustomAction; import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType; import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract; @@ -49,6 +49,8 @@ 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; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodRefreshButtonState; @@ -64,7 +66,7 @@ import info.nightscout.androidaps.utils.SP; * * @author Andy Rozman (andy.rozman@gmail.com) */ -public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterface { +public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPumpPluginInterface { private static final Logger LOG = LoggerFactory.getLogger(L.PUMP); @@ -202,6 +204,13 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa clearBusyQueue(); } + if (!this.omnipodStatusRequestList.isEmpty()) { + if (!ConfigBuilderPlugin.getPlugin().getCommandQueue().statusInQueue()) { + ConfigBuilderPlugin.getPlugin().getCommandQueue() + .readStatus("Status Refresh Requested", null); + } + } + } while (serviceRunning); }).start(); @@ -249,9 +258,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa clearBusyQueue(); - if (busyTimestamps.size() > 0) { - return true; - } + return (busyTimestamps.size() > 0); } } @@ -307,13 +314,29 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa if (firstRun) { initializePump(!isRefresh); - } else { - getPodPumpStatus(); + triggerUIChange(); + } else if (!omnipodStatusRequestList.isEmpty()) { + + List removeList = new ArrayList<>(); + + for (OmnipodStatusRequest omnipodStatusRequest : omnipodStatusRequestList) { + // TODO when we get more commands this needs to be extended + omnipodUIComm.executeCommand(OmnipodCommandType.AcknowledgeAlerts); + removeList.add(omnipodStatusRequest); + } + + + //getPodPumpStatus(); } - triggerUIChange(); } + + public void setIsBusy(boolean isBusy) { + this.isBusy = isBusy; + } + + private void getPodPumpStatus() { // TODO read pod status LOG.error("getPodPumpStatus() NOT IMPLEMENTED"); @@ -321,8 +344,20 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements PumpInterfa // we would probably need to read Basal Profile here too } + //OmnipodStatusRequest pumpStatusRequest = null; - void resetStatusState() { + List omnipodStatusRequestList = new ArrayList<>(); + + public void addPodStatusRequest(OmnipodStatusRequest pumpStatusRequest) { + if (pumpStatusRequest == OmnipodStatusRequest.ResetState) { + resetStatusState(); + } else { + omnipodStatusRequestList.add(pumpStatusRequest); + } + } + + + public void resetStatusState() { firstRun = true; isRefresh = true; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/ui/OmnipodUITask.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/ui/OmnipodUITask.java index a14b22e627..3aa2b3d4c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/ui/OmnipodUITask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/comm/ui/OmnipodUITask.java @@ -8,10 +8,11 @@ import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.data.PodCommResponse; 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.PodDeviceState; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitActionType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodInitReceiver; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodResponseType; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged; @@ -56,7 +57,7 @@ public class OmnipodUITask { // break; case InitPod: - returnData = communicationManager.initPod(); + returnData = communicationManager.initPod((PodInitActionType) parameters[0], (PodInitReceiver) parameters[1]); // TODO returnData = communicationManager.pairAndPrime(); break; @@ -98,6 +99,9 @@ public class OmnipodUITask { returnData = communicationManager.cancelTemporaryBasal(); break; + case AcknowledgeAlerts: + returnData = communicationManager.acknowledgeAlerts(); + break; default: { LOG.warn("This commandType is not supported (yet) - {}.", commandType); @@ -133,7 +137,7 @@ public class OmnipodUITask { public T getResult() { - return (T)returnData; + return (T) returnData; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommandType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommandType.java index ea0c74feb9..75963932d8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommandType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommandType.java @@ -12,7 +12,7 @@ public enum OmnipodCommandType { CancelBolus, // SetTemporaryBasal, CancelTemporaryBasal, - ResetPodStatus; + ResetPodStatus, AcknowledgeAlerts; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java index e63f4903c4..937bc53623 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodCommunicationManagerInterface.java @@ -14,10 +14,10 @@ public interface OmnipodCommunicationManagerInterface { PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podIniReceiver); // TODO remove - PumpEnactResult pairAndPrime(); + //PumpEnactResult pairAndPrime(); // TODO remove - PumpEnactResult insertCannula(Profile basalProfile); + //PumpEnactResult insertCannula(Profile basalProfile); /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodPumpPluginInterface.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodPumpPluginInterface.java new file mode 100644 index 0000000000..50cfec2d88 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodPumpPluginInterface.java @@ -0,0 +1,9 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.defs; + +import info.nightscout.androidaps.interfaces.PumpInterface; + +public interface OmnipodPumpPluginInterface extends PumpInterface { + + void addPodStatusRequest(OmnipodStatusRequest pumpStatusRequest); + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodStatusRequest.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodStatusRequest.java new file mode 100644 index 0000000000..92d94f3041 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/OmnipodStatusRequest.java @@ -0,0 +1,9 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.defs; + +public enum OmnipodStatusRequest { + ResetState, // + AcknowledgeAlerts, // + ; + + +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInitActionType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInitActionType.java index 063eceaab0..8b7b21148c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInitActionType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/PodInitActionType.java @@ -1,13 +1,29 @@ package info.nightscout.androidaps.plugins.pump.omnipod.defs; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + public enum PodInitActionType { - PairAndPrime, // - PairPod(PairAndPrime), // - PrimePod(PairAndPrime), // + PairAndPrimeWizardStep, // + PairPod(PairAndPrimeWizardStep), // + PrimePod(PairAndPrimeWizardStep), // + + FillCannulaWizardStep, + FillCannula(FillCannulaWizardStep), + SetBasalProfile(FillCannulaWizardStep); - ; + private PodInitActionType[] parent; + + private static Map> stepsForWizardStep; + + + static { + // TODO + + } PodInitActionType() { @@ -15,8 +31,31 @@ public enum PodInitActionType { } - private PodInitActionType(PodInitActionType parent) { + private PodInitActionType(PodInitActionType... parent) { + this.parent = parent; + } + + public static List getAvailableWizardSteps(OmnipodPodType podType) { + List outList = new ArrayList<>(); + + if (podType == OmnipodPodType.Eros) { + outList.add(PodInitActionType.PairAndPrimeWizardStep); + outList.add(PodInitActionType.FillCannulaWizardStep); + } else { + // TODO we might have different wizard steps, with different handling for Dash + } + + return outList; + } + + + public static List getAvailableActionsForWizardSteps(PodInitActionType wizardStep) { + if (stepsForWizardStep.containsKey(wizardStep)) { + return stepsForWizardStep.get(wizardStep); + } else { + return new ArrayList<>(); + } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java index ce6f76b0ff..9d32748437 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/util/OmnipodUtil.java @@ -24,10 +24,10 @@ import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; -import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; -import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationManager; 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.OmnipodPodType; +import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodPumpPluginInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodDeviceState; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodDeviceStatusChange; @@ -50,7 +50,7 @@ public class OmnipodUtil extends RileyLinkUtil { private static Gson gsonInstance = createGson(); private static PodSessionState podSessionState; private static PodDeviceState podDeviceState; - private static OmnipodPumpPlugin omnipodPumpPlugin; + private static OmnipodPumpPluginInterface omnipodPumpPlugin; private static OmnipodPodType omnipodPodType; public static Gson getGsonInstance() { @@ -182,13 +182,13 @@ public class OmnipodUtil extends RileyLinkUtil { @NotNull - public static OmnipodPumpPlugin getPlugin() { + public static OmnipodPumpPluginInterface getPlugin() { return OmnipodUtil.omnipodPumpPlugin; } @NotNull - public static void setPlugin(OmnipodPumpPlugin pumpPlugin) { + public static void setPlugin(OmnipodPumpPluginInterface pumpPlugin) { OmnipodUtil.omnipodPumpPlugin = pumpPlugin; } 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 029e97b639..ad4a6ddd54 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 @@ -15,7 +15,6 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginType; -import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction; @@ -25,6 +24,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodFragment; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.comm.ui.OmnipodUIComm; 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.events.EventOmnipodPumpValuesChanged; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodRefreshButtonState; import info.nightscout.androidaps.plugins.pump.omnipod.service.OmnipodPumpStatus; @@ -37,7 +37,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod_dash.comm.OmnipodDashComm * * @author Andy Rozman (andy.rozman@gmail.com) */ -public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements PumpInterface { +public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodPumpPluginInterface { private static final Logger LOG = LoggerFactory.getLogger(L.PUMP); @@ -192,7 +192,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements PumpInte } - void resetStatusState() { + public void resetStatusState() { firstRun = true; isRefresh = true; } diff --git a/app/src/main/res/layout/omnipod_pod_mgmt.xml b/app/src/main/res/layout/omnipod_pod_mgmt.xml index 4a93f96425..07b7f49402 100644 --- a/app/src/main/res/layout/omnipod_pod_mgmt.xml +++ b/app/src/main/res/layout/omnipod_pod_mgmt.xml @@ -2,7 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".plugins.pump.omnipod.dialogs.PodManagementActivity"> + tools:context="info.nightscout.androidaps.plugins.pump.omnipod.dialogs.PodManagementActivity"> + android:text="" /> + android:text="" /> + android:text="" />