Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rT.reason extended with missing values #1415

Merged
merged 1 commit into from
Dec 18, 2021
Merged
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
12 changes: 6 additions & 6 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ function enable_smb(
console.error("SMB enabled for COB of",meal_data.mealCOB);
}
return true;
}
}

// enable SMB/UAM (if enabled in preferences) for a full 6 hours after any carb entry
// (6 hours is defined in carbWindow in lib/meal/total.js)
if (profile.enableSMB_after_carbs === true && meal_data.carbs ) {
Expand All @@ -98,7 +98,7 @@ function enable_smb(
}
return true;
}

// enable SMB/UAM (if enabled in preferences) if a low temptarget is set
if (profile.enableSMB_with_temptarget === true && (profile.temptargetSet && target_bg < 100)) {
if (meal_data.bwFound) {
Expand All @@ -120,7 +120,7 @@ function enable_smb(
}
return true;
}

console.error("SMB disabled (no enableSMB preferences active or no condition satisfied)");
return false;
}
Expand Down Expand Up @@ -803,12 +803,12 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_

rT.COB=meal_data.mealCOB;
rT.IOB=iob_data.iob;
rT.BGI=bgi;
rT.BGI=convert_bg(bgi,profile);
rT.deviation=convert_bg(deviation, profile);
rT.ISF=convert_bg(sens, profile);
rT.CR=round(profile.carb_ratio, 2);
rT.target_bg=convert_bg(target_bg, profile);
rT.reason="minPredBG " + convert_bg(minPredBG, profile) + ", minGuardBG " + convert_bg(minGuardBG, profile) + ", IOBpredBG " + convert_bg(lastIOBpredBG, profile);
rT.reason="COB: " + rT.COB + ", Dev: " + rT.deviation + ", BGI: " + rT.BGI+ ", ISF: " + rT.ISF + ", CR: " + rT.CR + ", minPredBG " + convert_bg(minPredBG, profile) + ", minGuardBG " + convert_bg(minGuardBG, profile) + ", IOBpredBG " + convert_bg(lastIOBpredBG, profile);
if (lastCOBpredBG > 0) {
rT.reason += ", COBpredBG " + convert_bg(lastCOBpredBG, profile);
}
Expand Down