From 413553a9c248d29067ac17b52f921fb1d156a017 Mon Sep 17 00:00:00 2001 From: Stephen Brown II Date: Tue, 18 Feb 2020 12:29:20 -0700 Subject: [PATCH] Add NiMH battery option for Medtronic pumps --- .../plugins/pump/medtronic/data/dto/BatteryStatusDTO.java | 5 +++-- .../androidaps/plugins/pump/medtronic/defs/BatteryType.java | 3 ++- app/src/main/res/values/arrays.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java index 93b5eb10cb..ed0ff2bad1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java @@ -40,11 +40,12 @@ public class BatteryStatusDTO { public String toString() { - return String.format(Locale.ENGLISH, "BatteryStatusDTO [voltage=%.2f, alkaline=%d, lithium=%d, niZn={}]", + return String.format(Locale.ENGLISH, "BatteryStatusDTO [voltage=%.2f, alkaline=%d, lithium=%d, niZn=%d, nimh=%d]", voltage == null ? 0.0f : voltage, getCalculatedPercent(BatteryType.Alkaline), getCalculatedPercent(BatteryType.Lithium), - getCalculatedPercent(BatteryType.NiZn)); + getCalculatedPercent(BatteryType.NiZn), + getCalculatedPercent(BatteryType.NiMH)); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java index 5c7bf245a2..9ae1b8921a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/BatteryType.java @@ -15,7 +15,8 @@ public enum BatteryType { None(R.string.key_medtronic_pump_battery_no, 0, 0), Alkaline(R.string.key_medtronic_pump_battery_alkaline, 1.20d, 1.47d), // Lithium(R.string.key_medtronic_pump_battery_lithium, 1.22d, 1.64d), // - NiZn(R.string.key_medtronic_pump_battery_nizn, 1.40d, 1.70d) // + NiZn(R.string.key_medtronic_pump_battery_nizn, 1.40d, 1.70d), // + NiMH(R.string.key_medtronic_pump_battery_nimh, 1.10d, 1.40d) // ; private final String description; diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index eca0961ca5..28b0418196 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -191,6 +191,7 @@ @string/medtronic_pump_battery_alkaline @string/medtronic_pump_battery_lithium @string/medtronic_pump_battery_nizn + @string/medtronic_pump_battery_nimh @@ -198,6 +199,7 @@ @string/key_medtronic_pump_battery_alkaline @string/key_medtronic_pump_battery_lithium @string/key_medtronic_pump_battery_nizn + @string/key_medtronic_pump_battery_nimh diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e06c2a027..e3b2276cd0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1449,6 +1449,7 @@ medtronic_pump_battery_alkaline medtronic_pump_battery_lithium medtronic_pump_battery_nizn + medtronic_pump_battery_nimh Pump Serial Number Pump Type @@ -1469,6 +1470,7 @@ Alkaline (Extended view) Lithium (Extended view) NiZn (Extended view) + NiMH (Extended view) Bolus/Treatments Debugging