From b42ce70daa9d459e24626c2ff805e608b869f819 Mon Sep 17 00:00:00 2001 From: harisp Date: Wed, 11 Jul 2018 14:14:01 +0200 Subject: [PATCH 1/3] Fixed problem with corr numberpicker when using insight pump --- .../nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java index bf2c9ec09b..ad092bd1e6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java @@ -914,7 +914,6 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai public Constraint applyBolusConstraints(Constraint insulin) { if (statusResult != null) { insulin.setIfSmaller(statusResult.maximumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); - insulin.setIfGreater(statusResult.minimumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); } return insulin; } From 395f2313fd5615cd68ada257a6226d9065bf90fc Mon Sep 17 00:00:00 2001 From: harisp Date: Wed, 11 Jul 2018 18:17:09 +0200 Subject: [PATCH 2/3] Implemented feedback --- .../androidaps/plugins/PumpInsight/InsightPlugin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java index ad092bd1e6..bdfd547f51 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java @@ -914,6 +914,9 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai public Constraint applyBolusConstraints(Constraint insulin) { if (statusResult != null) { insulin.setIfSmaller(statusResult.maximumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); + + if(insulin.value() != 0) + insulin.setIfGreater(statusResult.minimumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); } return insulin; } From 8b200ba9de454157e430edd97e55a918cc528f86 Mon Sep 17 00:00:00 2001 From: harispoljo <34479922+harispoljo@users.noreply.github.com> Date: Wed, 11 Jul 2018 19:53:19 +0200 Subject: [PATCH 3/3] Fixed bug --- .../androidaps/plugins/PumpInsight/InsightPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java index bdfd547f51..42dad2eb56 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java @@ -915,7 +915,7 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai if (statusResult != null) { insulin.setIfSmaller(statusResult.maximumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); - if(insulin.value() != 0) + if(insulin.value() < 0 && insulin.value() > 0.04 ) insulin.setIfGreater(statusResult.minimumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this); } return insulin;