Set the Bolus Increment to the min amount supported by the pump

This commit is contained in:
Tim Gunn 2019-12-06 18:16:46 +13:00
parent 280e075ada
commit 9e93de4c7b

View file

@ -228,7 +228,6 @@ public class DetermineBasalAdapterSMBJS {
) throws JSONException { ) throws JSONException {
String units = profile.getUnits(); String units = profile.getUnits();
Double bolusincrement = SP.getDouble("key_bolus_increment", SMBDefaults.bolus_increment);
Double pumpbolusstep = ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().bolusStep; Double pumpbolusstep = ConfigBuilderPlugin.getPlugin().getActivePump().getPumpDescription().bolusStep;
mProfile = new JSONObject(); mProfile = new JSONObject();
@ -276,11 +275,8 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("enableSMB_after_carbs", smbEnabled && SP.getBoolean(R.string.key_enableSMB_after_carbs, false) && advancedFiltering); mProfile.put("enableSMB_after_carbs", smbEnabled && SP.getBoolean(R.string.key_enableSMB_after_carbs, false) && advancedFiltering);
mProfile.put("maxSMBBasalMinutes", SP.getInt(R.string.key_smbmaxminutes, SMBDefaults.maxSMBBasalMinutes)); mProfile.put("maxSMBBasalMinutes", SP.getInt(R.string.key_smbmaxminutes, SMBDefaults.maxSMBBasalMinutes));
mProfile.put("maxUAMSMBBasalMinutes", SP.getInt(R.string.key_uamsmbmaxminutes, SMBDefaults.maxUAMSMBBasalMinutes)); mProfile.put("maxUAMSMBBasalMinutes", SP.getInt(R.string.key_uamsmbmaxminutes, SMBDefaults.maxUAMSMBBasalMinutes));
if (bolusincrement < pumpbolusstep){ //set the min SMB amount to be the amount set by the pump.
//the bolus incrument is less than what the pump can support (by pump settings or pump restriction), set to value supported by the pump mProfile.put("bolus_increment", pumpbolusstep);
bolusincrement = pumpbolusstep;
}
mProfile.put("bolus_increment", bolusincrement);
mProfile.put("carbsReqThreshold", SP.getInt(R.string.key_carbsReqThreshold, SMBDefaults.carbsReqThreshold)); mProfile.put("carbsReqThreshold", SP.getInt(R.string.key_carbsReqThreshold, SMBDefaults.carbsReqThreshold));
mProfile.put("current_basal", basalrate); mProfile.put("current_basal", basalrate);