- changed bolus step to 0.05 for 523 and 554

This commit is contained in:
Andy Rozman 2019-08-28 19:29:18 +01:00
parent e1b24eb900
commit b48fec4624
2 changed files with 19 additions and 36 deletions

View file

@ -4,8 +4,7 @@ package info.nightscout.androidaps.plugins.pump.common.defs;
* Created by andy on 02/05/2018.
*/
public enum DoseStepSize
{
public enum DoseStepSize {
ComboBasal( //
new DoseStepSizeEntry(0f, 1f, 0.01f), //
@ -26,24 +25,18 @@ public enum DoseStepSize
new DoseStepSizeEntry(0f, 1f, 0.025f), //
new DoseStepSizeEntry(1f, 10f, 0.05f), //
new DoseStepSizeEntry(10f, Double.MAX_VALUE, 0.1f)), //
MedtronicVeoBolus( //
new DoseStepSizeEntry(0f, 1f, 0.025f), //
new DoseStepSizeEntry(1f, Double.MAX_VALUE, 0.05f)) //
;
DoseStepSizeEntry[] entries;
DoseStepSize(DoseStepSizeEntry...entries)
{
DoseStepSize(DoseStepSizeEntry... entries) {
this.entries = entries;
}
public double getStepSizeForAmount(double amount)
{
public double getStepSizeForAmount(double amount) {
for (DoseStepSizeEntry entry : entries) {
if (entry.from <= amount && entry.to > amount)
return entry.value;
@ -64,12 +57,9 @@ public enum DoseStepSize
sb.append(entry.from);
sb.append("-");
if (entry.to == Double.MAX_VALUE)
{
if (entry.to == Double.MAX_VALUE) {
sb.append("~}");
}
else
{
} else {
sb.append(entry.to);
sb.append("}, ");
}
@ -79,15 +69,13 @@ public enum DoseStepSize
}
static class DoseStepSizeEntry
{
static class DoseStepSizeEntry {
double from;
double to;
double value;
// to = this value is not included, but would actually mean <, so for rates between 0.025-0.975 u/h, we would have [from=0, to=10]
DoseStepSizeEntry(double from, double to, double value)
{
DoseStepSizeEntry(double from, double to, double value) {
this.from = from;
this.to = to;
this.value = value;

View file

@ -13,7 +13,7 @@ import info.nightscout.androidaps.utils.Round;
/**
* Created by andy on 02/05/2018.
*
* <p>
* Most of this defintions is intended for VirtualPump only, but they can be used by other plugins.
*/
@ -107,7 +107,7 @@ public enum PumpType {
Medtronic_515_715("Medtronic 515/715", "515/715", Medtronic_512_712),
Medtronic_522_722("Medtronic 522/722", "522/722", Medtronic_512_712),
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", ManufacturerType.Medtronic, "523/723 (Revel)", 0.025d, DoseStepSize.MedtronicVeoBolus, //
Medtronic_523_723_Revel("Medtronic 523/723 (Revel)", ManufacturerType.Medtronic, "523/723 (Revel)", 0.05d, null, //
new DoseSettings(0.05d, 30, 8 * 60, 0.05d), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05d, 30, 24 * 60, 0d, 35d), PumpCapability.BasalRate_Duration30minAllowed, //
@ -133,8 +133,7 @@ public enum PumpType {
TandemTSlimX2("Tandem t:slim X2", "t:slim X2", TandemTSlim), //
// MDI
MDI("MDI", ManufacturerType.AndroidAPS, "MDI")
;
MDI("MDI", ManufacturerType.AndroidAPS, "MDI");
private String description;
@ -164,24 +163,21 @@ public enum PumpType {
}
PumpType(String description, String model, PumpType parent)
{
PumpType(String description, String model, PumpType parent) {
this.description = description;
this.parent = parent;
this.model = model;
}
PumpType(String description, ManufacturerType manufacturer, String model)
{
PumpType(String description, ManufacturerType manufacturer, String model) {
this.description = description;
this.manufacturer = manufacturer;
this.model = model;
}
PumpType(String description, String model, PumpType parent, PumpCapability pumpCapability)
{
PumpType(String description, String model, PumpType parent, PumpCapability pumpCapability) {
this.description = description;
this.parent = parent;
this.pumpCapability = pumpCapability;
@ -191,8 +187,7 @@ public enum PumpType {
PumpType(String description, ManufacturerType manufacturer, String model, double bolusSize, DoseStepSize specialBolusSize, //
DoseSettings extendedBolusSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
double baseBasalMinValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
{
double baseBasalMinValue, double baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability) {
this(description, manufacturer, model, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
}