Feature Request/Bug #863

- merged with dev
- extended PumpType with new setting in PumpDescription
- added Insight pump settings for VirtualPump
This commit is contained in:
Andy Rozman 2018-05-04 15:48:46 +01:00
parent f2df13dbfb
commit 4fb8e899c2
8 changed files with 94 additions and 57 deletions

View file

@ -58,24 +58,25 @@ public class PumpDescription {
isTempBasalCapable = true;
tempBasalStyle = PERCENT;
maxTempPercent = 200;
tempPercentStep = 10;
maxTempAbsolute = 10;
tempAbsoluteStep = 0.05d;
tempDurationStep = 60;
tempMaxDuration = 12 * 60;
tempDurationStep15mAllowed = false;
tempDurationStep30mAllowed = false;
isSetBasalProfileCapable = true;
basalStep = 0.01d;
basalMinimumRate = 0.04d;
is30minBasalRatesCapable = false;
isRefillingCapable = false;
storesCarbInfo = true;
supportsTDDs = false;
needsManualTDDLoad = true;
}
}

View file

@ -12,6 +12,12 @@ public enum DoseStepSize
new DoseStepSizeEntry(1f, 10f, 0.05f), //
new DoseStepSizeEntry(10f, Float.MAX_VALUE, 0.1f)), //
InsightBolus(
new DoseStepSizeEntry(0f, 2f, 0.05f), //
new DoseStepSizeEntry(2f, 5f, 0.1f), //
new DoseStepSizeEntry(5f, 10f, 0.2f), //
new DoseStepSizeEntry(10f, Float.MAX_VALUE, 0.5f)),
MedtronicVeoBasal( //
new DoseStepSizeEntry(0f, 1f, 0.025f), //
new DoseStepSizeEntry(1f, 10f, 0.05f), //

View file

@ -6,19 +6,30 @@ package info.nightscout.androidaps.plugins.PumpCommon.defs;
public enum PumpCapability {
Bolus, //
ExtendedBolus, //
TBR, //
BasalProfileSet, //
Refill, //
StoreCarbInfo, //
Bolus, // isBolusCapable
ExtendedBolus, // isExtendedBolusCapable
TempBasal, // isTempBasalCapable
BasalProfileSet, // isSetBasalProfileCapable
Refill, // isRefillingCapable
StoreCarbInfo, // storesCarbInfo
TDD, // supportsTDDs
ManualTDDLoad, // needsManualTDDLoad
BasalRate30min, // is30minBasalRatesCapable
// grouped by pump
VirtualPumpCapabilities(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill), //
ComboCapabilities(Bolus, TempBasal, BasalProfileSet, Refill, StoreCarbInfo, TDD, ManualTDDLoad), //
DanaCapabilities(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, StoreCarbInfo, TDD, ManualTDDLoad), //
InsightCapabilities(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill,TDD,BasalRate30min), //
// BasalRates (separately grouped)
BasalRate_Duration15minAllowed, //
BasalRate_Duration30minAllowed, //
BasalRate_Duration15and30minAllowed(BasalRate_Duration15minAllowed, BasalRate_Duration30minAllowed), //
BasalRate_Duration15and30minNotAllowed, //
// grouped
VirtualPump(Bolus, ExtendedBolus, TBR, BasalProfileSet, StoreCarbInfo), //
Bolus_TBR_Basal_Refill_Carb(Bolus, TBR, BasalProfileSet, Refill, StoreCarbInfo), //
Bolus_Extended_TBR_Basal_Carb(Bolus, ExtendedBolus, TBR, BasalProfileSet, StoreCarbInfo), //
Bolus_Extended_TBR_Basal_Refill_Carb(Bolus, ExtendedBolus, TBR, BasalProfileSet, Refill, StoreCarbInfo), //
;

View file

@ -4,7 +4,6 @@ package info.nightscout.androidaps.plugins.PumpCommon.defs;
import java.util.HashMap;
import java.util.Map;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.plugins.PumpCommon.data.DoseSettings;
@ -20,38 +19,43 @@ public enum PumpType {
GenericAAPS("Generic AAPS", 0.1f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Percent, //
new DoseSettings(10,30, 24*60, 0f, 500f), //
0.01f, 0.01f, null, PumpCapability.VirtualPump), //
new DoseSettings(10,30, 24*60, 0f, 500f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.01f, 0.01f, null, PumpCapability.VirtualPumpCapabilities), //
// Cellnovo
Cellnovo1("Cellnovo", 0.05f, null, //
new DoseSettings(0.05f, 30, 24*60, 1f, null),
PumpTempBasalType.Percent,
new DoseSettings(5,30, 24*60, 0f, 200f), //
0.05f, 0.05f, null, PumpCapability.VirtualPump), //
new DoseSettings(5,30, 24*60, 0f, 200f), PumpCapability.BasalRate_Duration30minAllowed, //
0.05f, 0.05f, null, PumpCapability.VirtualPumpCapabilities), //
// Accu-Chek
AccuChekCombo("Accu-Chek Combo", 0.1f, null, //
new DoseSettings(0.1f, 15, 12*60, 0.1f), //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 12*60,0f, 500f), //
0.01f, 0.1f, DoseStepSize.ComboBasal, PumpCapability.Bolus_TBR_Basal_Refill_Carb), //
new DoseSettings(10, 15, 12*60,0f, 500f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.01f, 0.1f, DoseStepSize.ComboBasal, PumpCapability.ComboCapabilities), //
AccuChekSpirit("Accu-Chek Spirit", 0.1f, null, //
new DoseSettings(0.1f, 15, 12*60, 0.1f), //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 12*60,0f, 500f), //
0.01f, 0.1f, null, PumpCapability.VirtualPump), //
new DoseSettings(10, 15, 12*60,0f, 500f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.01f, 0.1f, null, PumpCapability.VirtualPumpCapabilities), //
AccuChekInsight("Accu-Chek Insight", 0.05f, DoseStepSize.InsightBolus, //
new DoseSettings(0.05f, 15, 24*60, 0.05f), //
PumpTempBasalType.Percent,
new DoseSettings(10, 15, 12*60,0f, 250f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.02f, 0.1f, null, PumpCapability.InsightCapabilities), //
// Animas
AnimasVibe("Animas Vibe", 0.05f, null, // AnimasBolus?
new DoseSettings(0.05f, 30, 12*60, 0.05f), //
PumpTempBasalType.Percent, //
new DoseSettings(10, 30, 24*60, 0f, 200f), //
0.025f, 5f, 0f, null, PumpCapability.VirtualPump), //
new DoseSettings(10, 30, 24*60, 0f, 200f), PumpCapability.BasalRate_Duration30minAllowed, //
0.025f, 5f, 0f, null, PumpCapability.VirtualPumpCapabilities), //
AnimasPing("Animas Ping", AnimasVibe),
@ -59,32 +63,37 @@ public enum PumpType {
DanaR("DanaR", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Percent, //
new DoseSettings(10f, 60, 24*60, 0f, 200f), //
0.04f, 0.01f, null, PumpCapability.Bolus_Extended_TBR_Basal_Refill_Carb),
new DoseSettings(10f, 60, 24*60, 0f, 200f), PumpCapability.BasalRate_Duration15and30minNotAllowed, //
0.04f, 0.01f, null, PumpCapability.DanaCapabilities),
DanaRKorean("DanaR Korean", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Percent, //
new DoseSettings(10f, 60, 24*60, 0f, 200f), //
0.1f, 0.01f, null, PumpCapability.Bolus_Extended_TBR_Basal_Refill_Carb),
new DoseSettings(10f, 60, 24*60, 0f, 200f), PumpCapability.BasalRate_Duration15and30minNotAllowed, //
0.1f, 0.01f, null, PumpCapability.DanaCapabilities),
DanaRS("DanaRS", DanaR),
DanaRv2("DanaRv2", DanaR),
DanaRS("DanaRS", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Percent, //
new DoseSettings(10f, 60, 24*60, 0f, 200f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.04f, 0.01f, null, PumpCapability.DanaCapabilities),
DanaRv2("DanaRv2", DanaRS),
// Insulet
Insulet_Omnipod("Insulet Omnipod", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05f, 30, 12*60, 0f, 5.0f), // cannot exceed max basal rate 30u/hr
0.05f, 0.05f, null, PumpCapability.VirtualPump),
new DoseSettings(0.05f, 30, 12*60, 0f, 5.0f), PumpCapability.BasalRate_Duration30minAllowed, // cannot exceed max basal rate 30u/hr
0.05f, 0.05f, null, PumpCapability.VirtualPumpCapabilities),
// Medtronic
Minimed_512_712("Medtronic 512/712", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), //
0.05f, 0.05f, null, PumpCapability.VirtualPump), // TODO
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), PumpCapability.BasalRate_Duration30minAllowed, //
0.05f, 0.05f, null, PumpCapability.VirtualPumpCapabilities), // TODO
Minimed_515_715("Medtronic 515/715", Minimed_512_712),
Minimed_522_722("Medtronic 522/722", Minimed_512_712),
@ -93,23 +102,23 @@ public enum PumpType {
Minimed_553_753_Revel("Medtronic 553/753 (Revel)", 0.05f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), //
0.025f, 0.025f, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPump), //
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), PumpCapability.BasalRate_Duration30minAllowed, //
0.025f, 0.025f, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPumpCapabilities), //
Minimed_554_754_Veo("Medtronic 554/754 (Veo)", Minimed_553_753_Revel), // TODO
Minimed_640G("Medtronic 640G", 0.025f, null, //
new DoseSettings(0.05f, 30, 8*60, 0.05f), //
PumpTempBasalType.Absolute, //
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), //
0.025f, 0.025f, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPump), //
new DoseSettings(0.05f, 30, 24*60, 0f, 35f), PumpCapability.BasalRate_Duration30minAllowed, //
0.025f, 0.025f, DoseStepSize.MedtronicVeoBasal, PumpCapability.VirtualPumpCapabilities), //
// Tandem
TandemTSlim("Tandem t:slim", 0.01f, null, //
new DoseSettings(0.01f,15, 8*60, 0.4f) ,
new DoseSettings(0.01f,15, 8*60, 0.4f),
PumpTempBasalType.Percent,
new DoseSettings(1,15, 8*60, 0f, 250f), //
0.1f, 0.001f, null, PumpCapability.VirtualPump),
new DoseSettings(1,15, 8*60, 0f, 250f), PumpCapability.BasalRate_Duration15and30minAllowed, //
0.1f, 0.001f, null, PumpCapability.VirtualPumpCapabilities),
TandemTFlex("Tandem t:flex", TandemTSlim), //
TandemTSlimG4("Tandem t:slim G4", TandemTSlim), //
@ -122,6 +131,7 @@ public enum PumpType {
private DoseSettings extendedBolusSettings;
private PumpTempBasalType pumpTempBasalType;
private DoseSettings tbrSettings;
private PumpCapability specialBasalDurations;
private float baseBasalMinValue; //
private Float baseBasalMaxValue;
private float baseBasalStep; //
@ -156,15 +166,15 @@ public enum PumpType {
PumpType(String description, float bolusSize, DoseStepSize specialBolusSize, //
DoseSettings extendedBolusSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
float baseBasalMinValue, float baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
{
this(description, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
this(description, bolusSize, specialBolusSize, extendedBolusSettings, pumpTempBasalType, tbrSettings, specialBasalDurations, baseBasalMinValue, null, baseBasalStep, baseBasalSpecialSteps, pumpCapability);
}
PumpType(String description, float bolusSize, DoseStepSize specialBolusSize, //
DoseSettings extendedBolusSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, //
PumpTempBasalType pumpTempBasalType, DoseSettings tbrSettings, PumpCapability specialBasalDurations, //
float baseBasalMinValue, Float baseBasalMaxValue, float baseBasalStep, DoseStepSize baseBasalSpecialSteps, PumpCapability pumpCapability)
{
this.description = description;
@ -173,6 +183,7 @@ public enum PumpType {
this.extendedBolusSettings = extendedBolusSettings;
this.pumpTempBasalType = pumpTempBasalType;
this.tbrSettings = tbrSettings;
this.specialBasalDurations = specialBasalDurations;
this.baseBasalMinValue = baseBasalMinValue;
this.baseBasalMaxValue = baseBasalMaxValue;
this.baseBasalStep = baseBasalStep;
@ -299,5 +310,7 @@ public enum PumpType {
}
public PumpCapability getSpecialBasalDurations() {
return specialBasalDurations;
}
}

View file

@ -11,14 +11,10 @@ import info.nightscout.androidaps.plugins.PumpCommon.defs.PumpType;
public class PumpUtil {
public static void setPumpDescription(PumpDescription pumpDescription, PumpType pumpType)
{
setPumpDescription(pumpDescription, pumpType, false);
}
public static void setPumpDescription(PumpDescription pumpDescription, PumpType pumpType, boolean isVirtualPump)
{
PumpCapability pumpCapability = isVirtualPump ? PumpCapability.VirtualPump : pumpType.getPumpCapability();
PumpCapability pumpCapability = pumpType.getPumpCapability();
pumpDescription.isBolusCapable = pumpCapability.hasCapability(PumpCapability.Bolus);
pumpDescription.bolusStep = pumpType.getBolusSize();
@ -28,7 +24,7 @@ public class PumpUtil {
pumpDescription.extendedBolusDurationStep = pumpType.getExtendedBolusSettings().getDurationStep();
pumpDescription.extendedBolusMaxDuration = pumpType.getExtendedBolusSettings().getMaxDuration();
pumpDescription.isTempBasalCapable = pumpCapability.hasCapability(PumpCapability.TBR);
pumpDescription.isTempBasalCapable = pumpCapability.hasCapability(PumpCapability.TempBasal);
if (pumpType.getPumpTempBasalType()==PumpTempBasalType.Percent)
{
@ -46,6 +42,8 @@ public class PumpUtil {
pumpDescription.tempDurationStep = pumpType.getTbrSettings().getDurationStep();
pumpDescription.tempMaxDuration = pumpType.getTbrSettings().getMaxDuration();
pumpDescription.tempDurationStep15mAllowed = pumpType.getSpecialBasalDurations().hasCapability(PumpCapability.BasalRate_Duration15minAllowed);
pumpDescription.tempDurationStep30mAllowed = pumpType.getSpecialBasalDurations().hasCapability(PumpCapability.BasalRate_Duration30minAllowed);
pumpDescription.isSetBasalProfileCapable = pumpCapability.hasCapability(PumpCapability.BasalProfileSet);
pumpDescription.basalStep = pumpType.getBaseBasalStep();
@ -53,6 +51,12 @@ public class PumpUtil {
pumpDescription.isRefillingCapable = pumpCapability.hasCapability(PumpCapability.Refill);
pumpDescription.storesCarbInfo = pumpCapability.hasCapability(PumpCapability.StoreCarbInfo);
pumpDescription.supportsTDDs = pumpCapability.hasCapability(PumpCapability.TDD);
pumpDescription.needsManualTDDLoad = pumpCapability.hasCapability(PumpCapability.ManualTDDLoad);
pumpDescription.is30minBasalRatesCapable = pumpCapability.hasCapability(PumpCapability.BasalRate30min);
}

View file

@ -15,6 +15,7 @@ import com.squareup.otto.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.TemporaryBasal;

View file

@ -426,7 +426,7 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
// reset
pumpDescription.resetSettings();
PumpUtil.setPumpDescription(pumpDescription, pumpTypeNew, true);
PumpUtil.setPumpDescription(pumpDescription, pumpTypeNew);
this.pumpType = pumpTypeNew;

View file

@ -108,11 +108,12 @@
<string-array name="virtualPumpTypes">
<item>Generic AAPS</item>
<item>Cellnovo</item>
<item>Accu-Chek Spirit</item>
<item>Accu-Chek Combo</item>
<item>Accu-Chek Insight</item>
<item>Animas Ping</item>
<item>Animas Vibe</item>
<item>Cellnovo</item>
<item>DanaR</item>
<item>DanaR Korean</item>
<item>DanaRS</item>