- little fix displaying values for special Bolus/Basal steps

- added YpsoPump to Virtual Pumps
This commit is contained in:
Andy Rozman 2021-01-20 23:49:10 +00:00
parent 6239f8e289
commit a7daa83955
5 changed files with 34 additions and 6 deletions

View file

@ -134,6 +134,7 @@
<item>Tandem t:flex</item>
<item>Tandem t:slim G4</item>
<item>Tandem t:slim X2</item>
<item>YpsoPump</item>
</string-array>
<string-array name="medtronicPumpTypeArray">

View file

@ -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");

View file

@ -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("}");
}
}

View file

@ -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, //

View file

@ -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");