|
@@ -78,10 +78,6 @@ function enable_smb(profile, microBolusAllowed, meal_data, bg, target_bg, high_b
|
|
|
} else if (meal_data.bwFound === true && profile.A52_risk_enable === false) {
|
|
} else if (meal_data.bwFound === true && profile.A52_risk_enable === false) {
|
|
|
console.error("SMB disabled due to Bolus Wizard activity in the last 6 hours.");
|
|
console.error("SMB disabled due to Bolus Wizard activity in the last 6 hours.");
|
|
|
return false;
|
|
return false;
|
|
|
- // Disable if invalid CGM reading (HIGH)
|
|
|
|
|
- } else if (!!trio_custom_variables.shouldProtectDueToHIGH) {
|
|
|
|
|
- console.error("Invalid CGM (HIGH). SMBs disabled.");
|
|
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// enable SMB/UAM if always-on (unless previously disabled for high temptarget)
|
|
// enable SMB/UAM if always-on (unless previously disabled for high temptarget)
|
|
@@ -444,13 +440,13 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (bg <= 10 || bg === 38 || noise >= 3 || minAgo > 12 || minAgo < -5 || ( glucose_status.short_avgdelta === 0 && glucose_status.long_avgdelta === 0 ) ) {
|
|
|
|
|
|
|
+ if (bg <= 10 || bg === 38 || noise >= 3 || minAgo > 12 || minAgo < -5) {
|
|
|
if (currenttemp.rate >= basal) { // high temp is running
|
|
if (currenttemp.rate >= basal) { // high temp is running
|
|
|
- rT.reason += ". Canceling high temp basal of " + currenttemp.rate;
|
|
|
|
|
|
|
+ rT.reason += ". Replacing high temp basal of "+currenttemp.rate+" with neutral temp of "+basal;
|
|
|
rT.deliverAt = deliverAt;
|
|
rT.deliverAt = deliverAt;
|
|
|
rT.temp = 'absolute';
|
|
rT.temp = 'absolute';
|
|
|
- rT.duration = 0;
|
|
|
|
|
- rT.rate = 0;
|
|
|
|
|
|
|
+ rT.duration = 30;
|
|
|
|
|
+ rT.rate = basal;
|
|
|
return rT;
|
|
return rT;
|
|
|
// don't use setTempBasal(), as it has logic that allows <120% high temps to continue running
|
|
// don't use setTempBasal(), as it has logic that allows <120% high temps to continue running
|
|
|
//return tempBasalFunctions.setTempBasal(basal, 30, profile, rT, currenttemp);
|
|
//return tempBasalFunctions.setTempBasal(basal, 30, profile, rT, currenttemp);
|
|
@@ -1616,11 +1612,6 @@ var maxDelta_bg_threshold;
|
|
|
|
|
|
|
|
var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
|
|
var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
|
|
|
|
|
|
|
|
- // set neutral TBR at current basal rate because glucose is considered as requiring dosing Protect due to HIGH (400 mg/dL)
|
|
|
|
|
- if (!!trio_custom_variables.shouldProtectDueToHIGH) {
|
|
|
|
|
- return tempBasalFunctions.setTempBasal(profile.current_basal, 30, profile, rT, currenttemp);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (rate > maxSafeBasal) {
|
|
if (rate > maxSafeBasal) {
|
|
|
rT.reason += "adj. req. rate: " + rate + " to maxSafeBasal: " + round(maxSafeBasal,2) + ", ";
|
|
rT.reason += "adj. req. rate: " + rate + " to maxSafeBasal: " + round(maxSafeBasal,2) + ", ";
|
|
|
rate = round_basal(maxSafeBasal, profile);
|
|
rate = round_basal(maxSafeBasal, profile);
|