diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.java b/app/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.java index 69fbbdef79..b350db88ea 100644 --- a/app/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.java +++ b/app/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.java @@ -5,9 +5,9 @@ package info.nightscout.androidaps.interfaces; */ public class PumpDescription { - public static final int PERCENT = 0; - public static final int ABSOLUTE = 1; - public static final int EXTENDED = 2; + public static final int PERCENT = 1; + public static final int ABSOLUTE = 2; + public static final int EXTENDED = 4; public boolean isBolusCapable = true; public double bolusStep = 0.1d; @@ -18,11 +18,16 @@ public class PumpDescription { public boolean isTempBasalCapable = true; public int lowTempBasalStyle = PERCENT; public int highTempBasalStyle = PERCENT; - public double maxHighTemp = 200; - public double lowTempStep = 10; - public int lowTempDuration = 60; - public double highTempStep = 10; - public int highTempDuration = 60; + public double maxHighTempPercent = 200; + public double maxHighTempAbsolute = 0; // zero = no limit + public double lowTempPercentStep = 10; + public double lowTempAbsoluteStep = 0.05d; + public int lowTempPercentDuration = 30; + public int lowTempAbsoluteDuration = 30; + public double highTempPercentStep = 10; + public double highTempAbsoluteStep = 0.05d; + public int highTempPercentDuration = 30; + public int highTempAbsoluteDuration = 30; public boolean isSetBasalProfileCapable = true; public double basalStep = 0.01d; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 643560df9e..b039a84f94 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -16,7 +16,6 @@ import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.text.DateFormat; import java.util.Date; import java.util.Objects; @@ -88,11 +87,16 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf pumpDescription.isTempBasalCapable = true; pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT; pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT; - pumpDescription.maxHighTemp = useExtendedBoluses ? 0: 200; - pumpDescription.lowTempStep = 10; - pumpDescription.lowTempDuration = 60; - pumpDescription.highTempStep = useExtendedBoluses ? 0.05d : 10; - pumpDescription.highTempDuration = useExtendedBoluses ? 30 : 60; + pumpDescription.maxHighTempPercent = 200; + pumpDescription.maxHighTempAbsolute = 0; + pumpDescription.lowTempPercentStep = 10; + pumpDescription.lowTempAbsoluteStep = 0; + pumpDescription.lowTempPercentDuration = 60; + pumpDescription.lowTempAbsoluteDuration = 60; + pumpDescription.highTempPercentStep = 10; + pumpDescription.highTempAbsoluteStep = 0.05d; + pumpDescription.highTempPercentDuration = 60; + pumpDescription.highTempAbsoluteDuration = 30; pumpDescription.isSetBasalProfileCapable = true; pumpDescription.basalStep = 0.01d; @@ -129,9 +133,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT; - pumpDescription.maxHighTemp = useExtendedBoluses ? 0: 200; - pumpDescription.highTempStep = useExtendedBoluses ? 0.05d : 10; - pumpDescription.highTempDuration = useExtendedBoluses ? 30 : 60; if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { sExecutionService.extendedBolusStop(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index 7d15344cbf..67ee8d3ad2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -87,11 +87,16 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints pumpDescription.isTempBasalCapable = true; pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT; pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT; - pumpDescription.maxHighTemp = useExtendedBoluses ? 0: 200; - pumpDescription.lowTempStep = 10; - pumpDescription.lowTempDuration = 60; - pumpDescription.highTempStep = useExtendedBoluses ? 0.05d : 10; - pumpDescription.highTempDuration = useExtendedBoluses ? 30 : 60; + pumpDescription.maxHighTempPercent = 200; + pumpDescription.maxHighTempAbsolute = 0; + pumpDescription.lowTempPercentStep = 10; + pumpDescription.lowTempAbsoluteStep = 0; + pumpDescription.lowTempPercentDuration = 60; + pumpDescription.lowTempAbsoluteDuration = 60; + pumpDescription.highTempPercentStep = 10; + pumpDescription.highTempAbsoluteStep = 0.05d; + pumpDescription.highTempPercentDuration = 60; + pumpDescription.highTempAbsoluteDuration = 30; pumpDescription.isSetBasalProfileCapable = true; pumpDescription.basalStep = 0.01d; @@ -128,9 +133,6 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints useExtendedBoluses = sharedPreferences.getBoolean("danar_useextended", false); pumpDescription.highTempBasalStyle = useExtendedBoluses ? PumpDescription.EXTENDED : PumpDescription.PERCENT; - pumpDescription.maxHighTemp = useExtendedBoluses ? 0: 200; - pumpDescription.highTempStep = useExtendedBoluses ? 0.05d : 10; - pumpDescription.highTempDuration = useExtendedBoluses ? 30 : 60; if (useExtendedBoluses != previousValue && isExtendedBoluslInProgress()) { sExecutionService.extendedBolusStop(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java index b68706fbe3..c150748920 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/VirtualPump/VirtualPumpPlugin.java @@ -40,6 +40,34 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface { PumpDescription pumpDescription = new PumpDescription(); + public VirtualPumpPlugin() { + pumpDescription.isBolusCapable = true; + pumpDescription.bolusStep = 1d; + + pumpDescription.isExtendedBolusCapable = true; + pumpDescription.extendedBolusStep = 0.2d; + + pumpDescription.isTempBasalCapable = true; + pumpDescription.lowTempBasalStyle = PumpDescription.ABSOLUTE | PumpDescription.PERCENT; + pumpDescription.highTempBasalStyle = PumpDescription.ABSOLUTE | PumpDescription.PERCENT; + pumpDescription.maxHighTempPercent = 600; + pumpDescription.maxHighTempAbsolute = 10; + pumpDescription.lowTempPercentStep = 5; + pumpDescription.lowTempAbsoluteStep = 0.1; + pumpDescription.lowTempPercentDuration = 30; + pumpDescription.lowTempAbsoluteDuration = 30; + pumpDescription.highTempPercentStep = 10; + pumpDescription.highTempAbsoluteStep = 0.05d; + pumpDescription.highTempPercentDuration = 30; + pumpDescription.highTempAbsoluteDuration = 30; + + pumpDescription.isSetBasalProfileCapable = true; + pumpDescription.basalStep = 0.01d; + pumpDescription.basalMinimumRate = 0.04d; + + pumpDescription.isRefillingCapable = false; + } + @Override public String getFragmentClass() { return VirtualPumpFragment.class.getName();