From a7daa83955aa62f64d15766db1974214cc7a77c6 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Wed, 20 Jan 2021 23:49:10 +0000 Subject: [PATCH] - little fix displaying values for special Bolus/Basal steps - added YpsoPump to Virtual Pumps --- app/src/main/res/values/arrays.xml | 1 + .../plugins/common/ManufacturerType.java | 5 +++- .../pump/common/defs/DoseStepSize.java | 25 +++++++++++++++---- .../pump/common/defs/PumpCapability.java | 1 + .../plugins/pump/common/defs/PumpType.java | 8 ++++++ 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index b8fb302f4d..3328d5a3fe 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -134,6 +134,7 @@ Tandem t:flex Tandem t:slim G4 Tandem t:slim X2 + YpsoPump diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/common/ManufacturerType.java b/core/src/main/java/info/nightscout/androidaps/plugins/common/ManufacturerType.java index 124e96cbc5..e21d981c85 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/common/ManufacturerType.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/common/ManufacturerType.java @@ -8,7 +8,10 @@ public enum ManufacturerType { Tandem("Tandem"), Insulet("Insulet"), - Animas("Animas"), Cellnovo("Cellnovo"), Roche("Roche"); + Animas("Animas"), + Cellnovo("Cellnovo"), + Roche("Roche"), + Ypsomed("Ypsomed"); diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/DoseStepSize.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/DoseStepSize.java index 86a67ffc3d..095c11de65 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/DoseStepSize.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/DoseStepSize.java @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.defs; +import java.util.Locale; + /** * Created by andy on 02/05/2018. */ @@ -25,6 +27,13 @@ public enum DoseStepSize { new DoseStepSizeEntry(0f, 1f, 0.025f), // new DoseStepSizeEntry(1f, 10f, 0.05f), // new DoseStepSizeEntry(10f, Double.MAX_VALUE, 0.1f)), // + + YpsopumpBasal( // + new DoseStepSizeEntry(0.0f, 1f, 0.01f), // + new DoseStepSizeEntry(1f, 2f, 0.02f), // + new DoseStepSizeEntry(2f, 15f, 0.1f), // + new DoseStepSizeEntry(15f, 40f, 0.5f) + ) ; @@ -49,19 +58,25 @@ public enum DoseStepSize { public String getDescription() { StringBuilder sb = new StringBuilder(); - + boolean first = true; for (DoseStepSizeEntry entry : entries) { - sb.append(entry.value); + if (first) { + first = false; + } else { + sb.append(", "); + } + + sb.append(String.format(Locale.ENGLISH, "%.3f", entry.value)); sb.append(" {"); - sb.append(entry.from); + sb.append(String.format(Locale.ENGLISH,"%.3f", entry.from)); sb.append("-"); if (entry.to == Double.MAX_VALUE) { sb.append("~}"); } else { - sb.append(entry.to); - sb.append("}, "); + sb.append(String.format(Locale.ENGLISH, "%.3f", entry.to)); + sb.append("}"); } } diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpCapability.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpCapability.java index 0f8baa6392..183cfbe8d9 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpCapability.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpCapability.java @@ -25,6 +25,7 @@ public enum PumpCapability { InsightCapabilities(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, BasalRate30min), // MedtronicCapabilities(Bolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD), // OmnipodCapabilities(Bolus, TempBasal, BasalProfileSet, BasalRate30min), // + YpsomedCapabilities(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad), // BasalRates (separately grouped) BasalRate_Duration15minAllowed, // diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java index cd0bb9d44c..90c6aadd70 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java @@ -139,6 +139,14 @@ public enum PumpType { TandemTSlimG4("Tandem t:slim G4", "t:slim G4", TandemTSlim), // TandemTSlimX2("Tandem t:slim X2", "t:slim X2", TandemTSlim), // + // Ypsomed/myLife + YpsoPump("YpsoPump", ManufacturerType.Ypsomed, "Ypsopump", 0.1d, null, // + new DoseSettings(0.1d, 15, 12 * 60, 0.1d), // + PumpTempBasalType.Percent, + new DoseSettings(1, 15, 24 * 60, 0d, 500d), PumpCapability.BasalRate_Duration15and30minAllowed, // + 0.02d, 40.0d, 0.01d, DoseStepSize.YpsopumpBasal, PumpCapability.YpsomedCapabilities), + + // MDI MDI("MDI", ManufacturerType.AndroidAPS, "MDI");