From d9279eed2abd8689427a28af8dcf911876a55e7d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 8 Apr 2018 20:17:15 +0200 Subject: [PATCH] split MaxIOB for SMB --- .../plugins/ConstraintsSafety/SafetyPlugin.java | 6 +++++- app/src/main/res/values/strings.xml | 5 ++++- app/src/main/res/xml/pref_openapssmb.xml | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java index 219236263c..6a9613e92a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java @@ -169,7 +169,11 @@ public class SafetyPlugin extends PluginBase implements ConstraintsInterface { @Override public Constraint applyMaxIOBConstraints(Constraint maxIob) { - double maxIobPref = SP.getDouble(R.string.key_openapsma_max_iob, 1.5d); + double maxIobPref; + if (OpenAPSSMBPlugin.getPlugin().isEnabled(PluginType.APS)) + maxIobPref = SP.getDouble(R.string.key_openapssmb_max_iob, 3d); + else + maxIobPref = SP.getDouble(R.string.key_openapsma_max_iob, 1.5d); maxIob.setIfSmaller(maxIobPref, String.format(MainApp.gs(R.string.limitingiob), maxIobPref, MainApp.gs(R.string.maxvalueinpreferences)), this); if (OpenAPSMAPlugin.getPlugin().isEnabled(PluginType.APS)) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f65ca4af5..27d352570d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -203,7 +203,7 @@ Max U/hr a Temp Basal can be set to This value is called max basal in OpenAPS context Maximum basal IOB OpenAPS can deliver [U] - This value is called Max IOB in OpenAPS context\nThis will default to zero. After several days or weeks, depending on your comfort level, you may choose to adjust this number. + This value is called Max IOB in OpenAPS context\nThis is maximal insulin in [U] APS can deliver at once. Bulgarian DISMISS Language @@ -989,4 +989,7 @@ IobCobCalculator Waiting for time synchronization (%d sec) Disconnected (%d m) + openapsmb_max_iob + Maximum total IOB OpenAPS can\'t go over [U] + This value is called Max IOB in OpenAPS context\nOpenAPS will not add more insulin if current IOB is greater than this value diff --git a/app/src/main/res/xml/pref_openapssmb.xml b/app/src/main/res/xml/pref_openapssmb.xml index 098d874eaa..1bdad6392c 100644 --- a/app/src/main/res/xml/pref_openapssmb.xml +++ b/app/src/main/res/xml/pref_openapssmb.xml @@ -11,11 +11,11 @@ android:dialogMessage="@string/openapsma_maxbasal_summary" android:title="@string/openapsma_maxbasal_title" /> + android:dialogMessage="@string/openapssmb_maxiob_summary" + android:title="@string/openapssmb_maxiob_title" />