diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js index a254cf8fc..0e6126380 100644 --- a/lib/determine-basal/determine-basal.js +++ b/lib/determine-basal/determine-basal.js @@ -417,11 +417,11 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ } UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; //console.error(predBGI, predCI, predUCI); - // truncate all BG predictions at 3.5 hours - if ( IOBpredBGs.length < 42) { IOBpredBGs.push(IOBpredBG); } - if ( COBpredBGs.length < 42) { COBpredBGs.push(COBpredBG); } - if ( aCOBpredBGs.length < 42) { aCOBpredBGs.push(aCOBpredBG); } - if ( UAMpredBGs.length < 42) { UAMpredBGs.push(UAMpredBG); } + // truncate all BG predictions at 4 hours + if ( IOBpredBGs.length < 48) { IOBpredBGs.push(IOBpredBG); } + if ( COBpredBGs.length < 48) { COBpredBGs.push(COBpredBG); } + if ( aCOBpredBGs.length < 48) { aCOBpredBGs.push(aCOBpredBG); } + if ( UAMpredBGs.length < 48) { UAMpredBGs.push(UAMpredBG); } // calculate minGuardBG without a wait from COB if available, or UAM, or IOB predBGs if ( (cid || remainingCIpeak > 0) && fractionCOBAbsorbed < 0.75 ) { if ( COBpredBG < minGuardBG ) { minGuardBG = round(COBpredBG); }