diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java index 7d23862cef..ea0ce7d4cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/AutosensData.java @@ -46,7 +46,7 @@ public class AutosensData implements DataPointWithLabelInterface { min5minCarbImpact = t.carbs / (maxAbsorptionHours * 60 / 5) * sens / ic; log.debug("Min 5m carbs impact for " + carbs + "g @" + new Date(t.date).toLocaleString() + " for " + maxAbsorptionHours + "h calculated to " + min5minCarbImpact + " ISF: " + sens + " IC: " + ic); } else { - min5minCarbImpact = SP.getDouble("openapsama_min_5m_carbimpact", SMBDefaults.min_5m_carbimpact); + min5minCarbImpact = SP.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact); } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index f51c7f7a94..2241c256ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -74,7 +74,7 @@ public class IobCobCalculatorPlugin extends PluginBase { .neverVisible(true) .alwaysEnabled(true) ); - } + } @Override protected void onStart() { @@ -548,7 +548,9 @@ public class IobCobCalculatorPlugin extends PluginBase { } if (ev.isChanged(R.string.key_openapsama_autosens_period) || ev.isChanged(R.string.key_age) || - ev.isChanged(R.string.key_absorption_maxtime) + ev.isChanged(R.string.key_absorption_maxtime) || + ev.isChanged(R.string.key_openapsama_min_5m_carbimpact) || + ev.isChanged(R.string.key_absorption_cutoff) ) { stopCalculation("onEventPreferenceChange"); synchronized (dataLock) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java index e1616112ab..a41f12764d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobThread.java @@ -17,6 +17,7 @@ import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.db.BgReading; @@ -212,7 +213,7 @@ public class IobCobThread extends Thread { } } else { //Oref sensitivity - totalMinCarbsImpact = SP.getDouble("openapsama_min_5m_carbimpact", SMBDefaults.min_5m_carbimpact); + totalMinCarbsImpact = SP.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact); } // figure out how many carbs that represents diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java index 89739ef626..ed0fa1f0bb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java @@ -217,7 +217,7 @@ public class DetermineBasalAdapterAMAJS { if(mealData.usedMinCarbsImpact > 0){ mProfile.put("min_5m_carbimpact", mealData.usedMinCarbsImpact); } else { - mProfile.put("min_5m_carbimpact", SP.getDouble("openapsama_min_5m_carbimpact", SMBDefaults.min_5m_carbimpact)); + mProfile.put("min_5m_carbimpact", SP.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)); } if (units.equals(Constants.MMOL)) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalAdapterSMBJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalAdapterSMBJS.java index fe14147853..0c665c7f9f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalAdapterSMBJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/DetermineBasalAdapterSMBJS.java @@ -247,7 +247,7 @@ public class DetermineBasalAdapterSMBJS { if(mealData.usedMinCarbsImpact > 0){ mProfile.put("min_5m_carbimpact", mealData.usedMinCarbsImpact); } else { - mProfile.put("min_5m_carbimpact", SP.getDouble("openapsama_min_5m_carbimpact", SMBDefaults.min_5m_carbimpact)); + mProfile.put("min_5m_carbimpact", SP.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)); } mProfile.put("remainingCarbsCap", SMBDefaults.remainingCarbsCap); mProfile.put("enableUAM", SP.getBoolean(R.string.key_use_uam, false)); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a0c4363c01..1e8d21ac37 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1004,4 +1004,5 @@ Time show_notes_entry_dialogs Show notes field in treatment dialogs + openapsama_min_5m_carbimpact diff --git a/app/src/main/res/xml/pref_absorption_oref0.xml b/app/src/main/res/xml/pref_absorption_oref0.xml index a194b754a9..4c3b11d283 100644 --- a/app/src/main/res/xml/pref_absorption_oref0.xml +++ b/app/src/main/res/xml/pref_absorption_oref0.xml @@ -15,7 +15,7 @@ android:maxLines="20" android:title="@string/openapsama_min_5m_carbimpact" android:dialogMessage="@string/openapsama_min_5m_carbimpact_summary" - android:key="openapsama_min_5m_carbimpact" /> + android:key="@string/key_openapsama_min_5m_carbimpact" />