From 63b8bdf2127eea31be14258c4b683431c0c8c2d4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 15 Mar 2020 19:23:11 +0100 Subject: [PATCH] DetermineBasalAdapter --- .../plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.java | 5 +++-- .../plugins/aps/openAPSMA/DetermineBasalAdapterMAJS.java | 6 ++++-- .../plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.java | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.java index 62741c9b68..f6bb79fda3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.java @@ -32,7 +32,7 @@ import info.nightscout.androidaps.plugins.aps.loop.ScriptReader; import info.nightscout.androidaps.plugins.aps.openAPSMA.LoggerCallback; import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults; import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker; -import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions; +import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; @@ -43,6 +43,7 @@ public class DetermineBasalAdapterAMAJS { @Inject AAPSLogger aapsLogger; @Inject ConstraintChecker constraintChecker; @Inject SP sp; + @Inject ProfileFunction profileFunction; private ScriptReader mScriptReader; @@ -222,7 +223,7 @@ public class DetermineBasalAdapterAMAJS { mProfile.put("min_5m_carbimpact", sp.getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact)); } - if (ProfileFunctions.getSystemUnits().equals(Constants.MMOL)) { + if (profileFunction.getUnits().equals(Constants.MMOL)) { mProfile.put("out_units", "mmol/L"); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSMA/DetermineBasalAdapterMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSMA/DetermineBasalAdapterMAJS.java index 183daa4c2a..91ce302639 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSMA/DetermineBasalAdapterMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSMA/DetermineBasalAdapterMAJS.java @@ -28,7 +28,7 @@ import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.aps.loop.ScriptReader; -import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions; +import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.utils.SP; @@ -37,6 +37,8 @@ public class DetermineBasalAdapterMAJS { private HasAndroidInjector injector; @Inject AAPSLogger aapsLogger; + @Inject ProfileFunction profileFunction; + private ScriptReader mScriptReader; private JSONObject mProfile; private JSONObject mGlucoseStatus; @@ -180,7 +182,7 @@ public class DetermineBasalAdapterMAJS { mProfile.put("current_basal", basalRate); - if (ProfileFunctions.getSystemUnits().equals(Constants.MMOL)) { + if (profileFunction.getUnits().equals(Constants.MMOL)) { mProfile.put("out_units", "mmol/L"); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.java index f47cb88777..61956a7dd1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.java @@ -32,7 +32,7 @@ import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.plugins.aps.loop.ScriptReader; import info.nightscout.androidaps.plugins.aps.openAPSMA.LoggerCallback; import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker; -import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions; +import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; @@ -44,6 +44,7 @@ public class DetermineBasalAdapterSMBJS { @Inject AAPSLogger aapsLogger; @Inject ConstraintChecker constraintChecker; @Inject SP sp; + @Inject ProfileFunction profileFunction; private ScriptReader mScriptReader; private JSONObject mProfile; @@ -276,7 +277,7 @@ public class DetermineBasalAdapterSMBJS { mProfile.put("temptargetSet", tempTargetSet); mProfile.put("autosens_max", SafeParse.stringToDouble(sp.getString(R.string.key_openapsama_autosens_max, "1.2"))); - if (ProfileFunctions.getSystemUnits().equals(Constants.MMOL)) { + if (profileFunction.getUnits().equals(Constants.MMOL)) { mProfile.put("out_units", "mmol/L"); }