Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
// disable SMB when a high temptarget is set
if (profile.temptargetSet && target_bg > 100) {
enableSMB=false;
// enable SMB/UAM if always-on (unless previously disabled for high temptarget)
} else if (profile.enableSMB_always) {
enableSMB=true;
// enable SMB/UAM (if enabled in preferences) for DIA hours after bolus
} else if (profile.enableSMB_with_bolus && bolusiob > 0.1) {
enableSMB=true;
Expand Down Expand Up @@ -602,6 +605,12 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_

if (enableSMB && minGuardBG < threshold) {
console.error("minGuardBG",minGuardBG,"projected below",threshold,"- disabling SMB");
//rT.reason += "minGuardBG "+minGuardBG+"<"+threshold+": SMB disabled; ";
enableSMB = false;
}
if ( glucose_status.delta > 0.1 * bg ) {
console.error("Delta",glucose_status.delta,"> 10% of BG",bg,"- disabling SMB");
rT.reason += "Delta "+glucose_status.delta+" > 10% of BG "+bg+": SMB disabled; ";
enableSMB = false;
}

Expand Down
1 change: 1 addition & 0 deletions lib/profile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function defaults ( ) {
, remainingCarbsCap: 90 // max carbs we'll assume will absorb over 4h if we don't yet see carb absorption
// WARNING: the following are advanced oref1 features, and are not yet tested for general use
, enableUAM: false // enable detection of unannounced meal carb absorption
, enableSMB_always: false // always enable supermicrobolus (unless disabled by high temptarget)
, enableSMB_with_bolus: false // enable supermicrobolus for DIA hours after a manual bolus
, enableSMB_with_COB: false // enable supermicrobolus while COB is positive
, enableSMB_with_temptarget: false // enable supermicrobolus for eating soon temp targets
Expand Down