From d2e7cc90419621153f5986fb3a3ce382545b407d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 8 Jun 2019 22:39:26 +0200 Subject: [PATCH] Provide manufacter, model, SN for pump --- .../plugins/pump/combo/ComboPlugin.java | 12 +++++++++++- .../plugins/pump/danaR/AbstractDanaRPlugin.java | 7 ++++++- .../plugins/pump/danaR/DanaRPlugin.java | 5 +++++ .../pump/danaRKorean/DanaRKoreanPlugin.java | 5 +++++ .../plugins/pump/danaRS/DanaRSPlugin.java | 12 +++++++++++- .../plugins/pump/danaRv2/DanaRv2Plugin.java | 5 +++++ .../plugins/pump/insight/LocalInsightPlugin.java | 16 +++++++++++++--- .../androidaps/plugins/pump/mdi/MDIPlugin.java | 14 ++++++++++++-- .../plugins/pump/virtual/VirtualPumpPlugin.java | 12 +++++++++++- 9 files changed, 79 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 557ba42168..a70f0c1f72 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -1312,10 +1312,20 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint } @Override - public String deviceID() { + public String manufacter() { + return "Roche"; + } + + @Override + public String model() { return "Combo"; } + @Override + public String serialNumber() { + return "Unknown"; + } + @Override public PumpDescription getPumpDescription() { return pumpDescription; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java index 749307e1a7..24dc27fb18 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/AbstractDanaRPlugin.java @@ -376,7 +376,12 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte } @Override - public String deviceID() { + public String manufacter() { + return "SOOIL"; + }; + + @Override + public String serialNumber() { return DanaRPump.getInstance().serialNumber; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java index 2f7484cd6f..923247c39a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPlugin.java @@ -360,6 +360,11 @@ public class DanaRPlugin extends AbstractDanaRPlugin { return result; } + @Override + public String model() { + return "DanaR"; + } + private PumpEnactResult cancelRealTempBasal() { PumpEnactResult result = new PumpEnactResult(); TemporaryBasal runningTB = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(System.currentTimeMillis()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java index 3b4aa0ee4c..ef3301fc28 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPlugin.java @@ -364,6 +364,11 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin { return result; } + @Override + public String model() { + return "DanaRKorean"; + } + private PumpEnactResult cancelRealTempBasal() { PumpEnactResult result = new PumpEnactResult(); TemporaryBasal runningTB = TreatmentsPlugin.getPlugin().getTempBasalFromHistory(System.currentTimeMillis()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.java index ddbb8547ae..f653d764d4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRS/DanaRSPlugin.java @@ -769,7 +769,17 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte } @Override - public String deviceID() { + public String manufacter() { + return "SOOIL"; + } + + @Override + public String model() { + return "DanaRS"; + } + + @Override + public String serialNumber() { return DanaRPump.getInstance().serialNumber; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java index 9e3ca499d0..2087d3facf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2Plugin.java @@ -402,6 +402,11 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { } } + @Override + public String model() { + return "DanaRv2"; + } + @Override public PumpEnactResult loadEvents() { return sExecutionService.loadEvents(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 35f5deb616..9114b38b40 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -945,9 +945,19 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con } @Override - public String deviceID() { - if (connectionService == null || alertService == null) return null; - return connectionService.getPumpSystemIdentification().getSerialNumber(); + public String manufacter() { + return "Roche"; + } + + @Override + public String model() { + return "Insight"; + } + + @Override + public String serialNumber() { + if (connectionService == null || alertService == null) return "Unknown"; + return connectionService.getPumpSystemIdentification().getSerialNumber(); } public PumpEnactResult stopPump() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/mdi/MDIPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/mdi/MDIPlugin.java index 89d1184581..d607dad4cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/mdi/MDIPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/mdi/MDIPlugin.java @@ -236,10 +236,20 @@ public class MDIPlugin extends PluginBase implements PumpInterface { } @Override - public String deviceID() { + public String manufacter() { + return "AndroidAPS"; + } + + @Override + public String model() { return "MDI"; } + @Override + public String serialNumber() { + return "Unknown"; + } + @Override public PumpDescription getPumpDescription() { return pumpDescription; @@ -247,7 +257,7 @@ public class MDIPlugin extends PluginBase implements PumpInterface { @Override public String shortStatus(boolean veryShort) { - return deviceID(); + return model(); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.java index 461f71c31d..5317120b58 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.java @@ -437,10 +437,20 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface { } @Override - public String deviceID() { + public String manufacter() { + return "AndroidAPS"; + } + + @Override + public String model() { return "VirtualPump"; } + @Override + public String serialNumber() { + return "Unknown"; + } + @Override public PumpDescription getPumpDescription() { return pumpDescription;