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.variables in mg/dL #30

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
24 changes: 12 additions & 12 deletions lib/determine-basal/determine-basal.js
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
//

var sigmoidLog = ""

if (dynISFenabled) {
// Logarithmic
if (!enable_sigmoid) {
Expand Down Expand Up @@ -1551,20 +1551,20 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_

rT.COB=meal_data.mealCOB;
rT.IOB=iob_data.iob;
rT.BGI=convert_bg(bgi,profile);
rT.deviation=convert_bg(deviation, profile);
rT.ISF=convert_bg(sens, profile);
rT.CR=round(carbRatio, 1);
rT.target_bg=convert_bg(target_bg, profile);
rT.TDD=round(tdd_before, 2);
rT.current_target=round(target_bg, 0);
rT.BGI = round(bgi, 0);
rT.deviation = round(deviation, 0);
rT.ISF = round(sens, 0);
rT.CR = round(carbRatio, 1);
rT.target_bg = convert_bg(target_bg, profile);
rT.TDD = round(tdd_before, 2);
rT.current_target = round(target_bg, 0);

var cr_log = rT.CR;
if (cr_before != rT.CR) {
cr_log = cr_before + "\u2192" + rT.CR;
}

rT.reason = isfreason + ", COB: " + rT.COB + ", Dev: " + rT.deviation + ", BGI: " + rT.BGI + ", CR: " + cr_log + ", Target: " + targetLog + ", minPredBG " + convert_bg(minPredBG, profile) + ", minGuardBG " + convert_bg(minGuardBG, profile) + ", IOBpredBG " + convert_bg(lastIOBpredBG, profile);
rT.reason = isfreason + ", COB: " + rT.COB + ", Dev: " + convert_bg(deviation, profile) + ", BGI: " + convert_bg(bgi, profile) + ", CR: " + cr_log + ", Target: " + targetLog + ", 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 Expand Up @@ -1620,7 +1620,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
console.error("minGuardBG " + convert_bg(minGuardBG, profile) + " projected below " + convert_bg(threshold, profile) + " - disabling SMB");
rT.manualBolusErrorString = 1;
rT.minGuardBG = minGuardBG;
rT.insulinForManualBolus = round((rT.eventualBG - rT.target_bg) / sens, 2);
rT.insulinForManualBolus = round((eventualBG - target_bg) / sens, 2);

//rT.reason += "minGuardBG "+minGuardBG+"<"+threshold+": SMB disabled; ";
enableSMB = false;
Expand Down Expand Up @@ -1803,7 +1803,7 @@ var maxDelta_bg_threshold;
}
}

rT.insulinForManualBolus = round((rT.eventualBG - rT.target_bg) / sens, 2);
rT.insulinForManualBolus = round((eventualBG - target_bg) / sens, 2);

// if in SMB mode, don't cancel SMB zero temp
if (! (microBolusAllowed && enableSMB)) {
Expand All @@ -1825,7 +1825,7 @@ var maxDelta_bg_threshold;
if (Math.min(eventualBG,minPredBG) < max_bg) {
if (minPredBG < min_bg && eventualBG > min_bg) {
rT.manualBolusErrorString = 6;
rT.insulinForManualBolus = round((rT.eventualBG - rT.target_bg) / sens, 2);
rT.insulinForManualBolus = round((eventualBG - target_bg) / sens, 2);
rT.minPredBG = minPredBG;
}
// if in SMB mode, don't cancel SMB zero temp
Expand Down