Final merge

This commit is contained in:
Tim Gunn 2020-03-26 12:18:02 +13:00
parent d8ccaadc03
commit ced46f6e1d
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -34,6 +34,8 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction; import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.SafeParse; import info.nightscout.androidaps.utils.SafeParse;
import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.resources.ResourceHelper;
@ -48,6 +50,8 @@ public class DetermineBasalAdapterSMBJS {
@Inject ResourceHelper resourceHelper; @Inject ResourceHelper resourceHelper;
@Inject ProfileFunction profileFunction; @Inject ProfileFunction profileFunction;
@Inject TreatmentsPlugin treatmentsPlugin; @Inject TreatmentsPlugin treatmentsPlugin;
@Inject ActivePluginProvider activePluginProvider;
private ScriptReader mScriptReader; private ScriptReader mScriptReader;
private JSONObject mProfile; private JSONObject mProfile;
@ -233,7 +237,7 @@ public class DetermineBasalAdapterSMBJS {
) throws JSONException { ) throws JSONException {
String units = profile.getUnits(); String units = profile.getUnits();
Double pumpbolusstep = ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().bolusStep; Double pumpbolusstep = activePluginProvider.getActivePump().getPumpDescription().bolusStep;
mProfile = new JSONObject(); mProfile = new JSONObject();
mProfile.put("max_iob", maxIob); mProfile.put("max_iob", maxIob);
@ -272,7 +276,7 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("enableUAM", uamAllowed); mProfile.put("enableUAM", uamAllowed);
mProfile.put("A52_risk_enable", SMBDefaults.A52_risk_enable); mProfile.put("A52_risk_enable", SMBDefaults.A52_risk_enable);
boolean smbEnabled = sp.getBoolean(MainApp.gs(R.string.key_use_smb), false); boolean smbEnabled = sp.getBoolean(resourceHelper.gs(R.string.key_use_smb), false);
mProfile.put("SMBInterval", sp.getInt("key_smbinterval", SMBDefaults.SMBInterval)); mProfile.put("SMBInterval", sp.getInt("key_smbinterval", SMBDefaults.SMBInterval));
mProfile.put("enableSMB_with_COB", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_COB, false)); mProfile.put("enableSMB_with_COB", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_COB, false));
mProfile.put("enableSMB_with_temptarget", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_temptarget, false)); mProfile.put("enableSMB_with_temptarget", smbEnabled && sp.getBoolean(R.string.key_enableSMB_with_temptarget, false));