From b824cc28c9d6e614a32ca97a164a401d18a9d69f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 9 Dec 2016 20:37:56 +0100 Subject: [PATCH] korean danar description --- .../androidaps/plugins/DanaR/DanaRPlugin.java | 2 +- .../DanaRKorean/DanaRKoreanPlugin.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) 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 d9e5b90445..643560df9e 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 @@ -79,7 +79,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE); MainApp.bus().register(this); - pumpDescription.isBolusCapable = true; + pumpDescription.isBolusCapable = true; // TODO: use description in setTempBasalAbsolute pumpDescription.bolusStep = 0.05d; pumpDescription.isExtendedBolusCapable = true; 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 740cdc791c..7d15344cbf 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 @@ -77,6 +77,27 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints Intent intent = new Intent(context, ExecutionService.class); context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE); MainApp.bus().register(this); + + pumpDescription.isBolusCapable = true; // TODO: use description in setTempBasalAbsolute + pumpDescription.bolusStep = 0.1d; + + pumpDescription.isExtendedBolusCapable = true; + pumpDescription.extendedBolusStep = 0.1d; + + 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.isSetBasalProfileCapable = true; + pumpDescription.basalStep = 0.01d; + pumpDescription.basalMinimumRate = 0.1d; + + pumpDescription.isRefillingCapable = true; } ServiceConnection mConnection = new ServiceConnection() { @@ -105,6 +126,12 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints boolean previousValue = useExtendedBoluses; SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); 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(); }