diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js index 96204d80..5032b649 100644 --- a/lib/determine-basal/determine-basal.js +++ b/lib/determine-basal/determine-basal.js @@ -656,7 +656,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ // var sigmoidLog = "" - + if (dynISFenabled) { // Logarithmic if (!enable_sigmoid) { @@ -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); } @@ -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; @@ -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)) { @@ -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