diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java index aeaf9ed56d..126b017b5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java @@ -44,7 +44,6 @@ import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.resources.ResourceHelper; - import info.nightscout.androidaps.utils.sharedPreferences.SP; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.schedulers.Schedulers; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java index d1f10d27a5..34a3418902 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.java @@ -3,14 +3,9 @@ package info.nightscout.androidaps.plugins.pump.common.data; import java.util.Date; import info.nightscout.androidaps.data.ProfileStore; -import info.nightscout.androidaps.interfaces.PumpDescription; -import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpStatusType; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.resources.ResourceHelper; -import info.nightscout.androidaps.utils.sharedPreferences.SP; /** * Created by andy on 4/28/18. @@ -18,8 +13,6 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP; public abstract class PumpStatus { - - // connection public long lastDataTime; public long lastConnection = 0L; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java index fa3ae64723..ccb47a7d4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEScanActivity.java @@ -54,9 +54,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.utils.LocationHelper; import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin; import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged; -import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged; -import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.sharedPreferences.SP; @@ -68,8 +66,6 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { @Inject RxBusWrapper rxBus; @Inject ResourceHelper resourceHelper; @Inject RileyLinkUtil rileyLinkUtil; - // TODO change this. Currently verifyConfiguration uses MDT data not only RL - // @Inject MedtronicPumpPlugin medtronicPumpPlugin; @Inject ActivePluginProvider activePlugin; private static final int PERMISSION_REQUEST_COARSE_LOCATION = 30241; // arbitrary. @@ -119,10 +115,6 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity { sp.putString(RileyLinkConst.Prefs.RileyLinkAddress, bleAddress); - //RileyLinkUtil.getRileyLinkSelectPreference().setSummary(bleAddress); - - // TODO refactor this - PumpInterface activePump = activePlugin.getActivePump(); if (activePump.manufacturer()== ManufacturerType.Medtronic) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index d0ac45ce6a..f3f6399570 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -362,8 +362,6 @@ public class RFSpy { break; } - - //this.selectedTargetFrequency = frequency; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java index c27de0a7e6..4a1ff7bdb0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkCommunicationException.java @@ -7,9 +7,11 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile */ public class RileyLinkCommunicationException extends Exception { + String extendedErrorText; private RileyLinkBLEError errorCode; + public RileyLinkCommunicationException(RileyLinkBLEError errorCode, String extendedErrorText) { super(errorCode.getDescription()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java index de2c3a33df..623ecae9ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.java @@ -44,13 +44,6 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re @Inject ResourceHelper resourceHelper; @Inject MedtronicUtil medtronicUtil; @Inject AAPSLogger aapsLogger; - - // TODO fix this is not correct - //@Inject RileyLinkUtil rileyLinkUtil; - //@Inject MedtronicUtil medtronicUtil; - //@Inject MedtronicPumpStatus medtronicPumpStatus; - - //@Inject MedtronicPumpPlugin medtronicPumpPlugin; @Inject RileyLinkServiceData rileyLinkServiceData; TextView connectionStatus; @@ -65,10 +58,6 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re TextView lastDeviceContact; TextView firmwareVersion; - //RileyLinkServiceData rileyLinkServiceData; - - //MedtronicPumpStatus medtronicPumpStatus; - //OmnipodPumpStatus omnipodPumpStatus; boolean first = false; @@ -139,14 +128,8 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re } - // TODO add handling for Omnipod pump status -// TODO refactor this Omnipod - PumpPluginAbstract pumpPlugin = (PumpPluginAbstract)activePlugin.getActivePump(); - //if (activePlugin) - - if (pumpPlugin.manufacturer()== ManufacturerType.Medtronic) { MedtronicPumpStatus medtronicPumpStatus = (MedtronicPumpStatus)pumpPlugin.getPumpStatusData(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java index b33e95d0d1..370015ab95 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.java @@ -19,7 +19,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtro */ public class ResetRileyLinkConfigurationTask extends PumpTask { - private static final String TAG = "ResetRileyLinkTask"; @Inject ActivePluginProvider activePlugin; @Inject RxBusWrapper rxBus; @@ -35,7 +34,6 @@ public class ResetRileyLinkConfigurationTask extends PumpTask { @Override public void run() { - // this is intended only for RL supported pump, so we can cast to PumpPluginAbstract RileyLinkPumpDevice pumpAbstract = (RileyLinkPumpDevice)activePlugin.getActivePump(); rxBus.send(new EventRefreshButtonState(false)); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java index 2268fb9302..219da8bf3f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.java @@ -34,12 +34,11 @@ public class WakeAndTuneTask extends PumpTask { @Override public void run() { - PumpPluginAbstract pump = (PumpPluginAbstract) activePlugin.getActivePump(); - RileyLinkPumpDevice pumpDevice = (RileyLinkPumpDevice)pump; + RileyLinkPumpDevice pumpDevice = (RileyLinkPumpDevice)activePlugin.getActivePump(); rxBus.send(new EventRefreshButtonState(false)); - MedtronicPumpPlugin.isBusy = true; + pumpDevice.setIsBusy(true); pumpDevice.doTuneUpDevice(); - MedtronicPumpPlugin.isBusy = false; + pumpDevice.setIsBusy(false); rxBus.send(new EventRefreshButtonState(true)); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java index d9bde273a5..f7686fa824 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.java @@ -121,6 +121,7 @@ public class MedtronicPumpStatus extends PumpStatus { medtronicPumpMap.put("723", PumpType.Medtronic_523_723_Revel); medtronicPumpMap.put("554", PumpType.Medtronic_554_754_Veo); medtronicPumpMap.put("754", PumpType.Medtronic_554_754_Veo); + } public Map getMedtronicPumpMap() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java index cc8cfb3f11..7c6a55d092 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.java @@ -240,7 +240,6 @@ public class RileyLinkMedtronicService extends RileyLinkService { } else { PumpType pumpType = medtronicPumpStatus.getMedtronicPumpMap().get(pumpTypePart); medtronicPumpStatus.medtronicDeviceType = medtronicPumpStatus.getMedtronicDeviceTypeMap().get(pumpTypePart); - //medtronicPumpPlugin.getPumpDescription().setPumpDescription(pumpType); medtronicPumpPlugin.setPumpType(pumpType); if (pumpTypePart.startsWith("7")) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java index afd814d81c..a4e7a51ec2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.java @@ -68,7 +68,6 @@ public class MedtronicUtil { this.medtronicPumpStatus = medtronicPumpStatus; } - public LocalTime getTimeFrom30MinInterval(int interval) { if (interval % 2 == 0) { return new LocalTime(interval / 2, 0);