Use different defaults if using Medtronic Pump

This commit is contained in:
Tim Gunn 2020-05-03 23:11:29 +12:00
parent 39d011a4cc
commit 1598d0c45e
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C
2 changed files with 11 additions and 2 deletions

View file

@ -26,10 +26,12 @@ import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.MealData; import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader; import info.nightscout.androidaps.plugins.aps.loop.ScriptReader;
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback; import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker; 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;
@ -237,7 +239,9 @@ public class DetermineBasalAdapterSMBJS {
) throws JSONException { ) throws JSONException {
String units = profile.getUnits(); String units = profile.getUnits();
Double pumpbolusstep = activePluginProvider.getActivePump().getPumpDescription().bolusStep; PumpInterface pump = activePluginProvider.getActivePump();
ManufacturerType manufacturer = pump.manufacturer();
Double pumpbolusstep = pump.getPumpDescription().bolusStep;
mProfile = new JSONObject(); mProfile = new JSONObject();
mProfile.put("max_iob", maxIob); mProfile.put("max_iob", maxIob);
@ -265,7 +269,11 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("exercise_mode", SMBDefaults.exercise_mode); mProfile.put("exercise_mode", SMBDefaults.exercise_mode);
mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target); mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target);
mProfile.put("maxCOB", SMBDefaults.maxCOB); mProfile.put("maxCOB", SMBDefaults.maxCOB);
mProfile.put("skip_neutral_temps", sp.getBoolean(R.string.key_skip_neutral_temps,SMBDefaults.skip_neutral_temps)); if (!manufacturer.name().equals("Medtronic")) {
mProfile.put("skip_neutral_temps",SMBDefaults.skip_neutral_temps);
} else {
mProfile.put("skip_neutral_temps", sp.getBoolean(R.string.key_skip_neutral_temps, SMBDefaults.skip_neutral_temps_medtronic));
}
// min_5m_carbimpact is not used within SMB determinebasal // min_5m_carbimpact is not used within SMB determinebasal
//if (mealData.usedMinCarbsImpact > 0) { //if (mealData.usedMinCarbsImpact > 0) {
// mProfile.put("min_5m_carbimpact", mealData.usedMinCarbsImpact); // mProfile.put("min_5m_carbimpact", mealData.usedMinCarbsImpact);

View file

@ -38,6 +38,7 @@ public class SMBDefaults {
// Essentially, this just limits AMA/SMB as a safety cap against excessive COB entry) // Essentially, this just limits AMA/SMB as a safety cap against excessive COB entry)
public final static int maxCOB = 120; public final static int maxCOB = 120;
public final static boolean skip_neutral_temps = true; // ***** default false in oref1 ***** if true, don't set neutral temps public final static boolean skip_neutral_temps = true; // ***** default false in oref1 ***** if true, don't set neutral temps
public final static boolean skip_neutral_temps_medtronic = false;//if using a medtronic pump default to false so the pump doesnt beep on the hour
// unsuspend_if_no_temp:false // if true, pump will un-suspend after a zero temp finishes // unsuspend_if_no_temp:false // if true, pump will un-suspend after a zero temp finishes
// bolussnooze_dia_divisor:2 // bolus snooze decays after 1/2 of DIA // bolussnooze_dia_divisor:2 // bolus snooze decays after 1/2 of DIA
public final static double min_5m_carbimpact = 8d; // mg/dL per 5m (8 mg/dL/5m corresponds to 24g/hr at a CSF of 4 mg/dL/g (x/5*60/4)) public final static double min_5m_carbimpact = 8d; // mg/dL per 5m (8 mg/dL/5m corresponds to 24g/hr at a CSF of 4 mg/dL/g (x/5*60/4))