diff --git a/app/src/main/assets/OpenAPSSMB/determine-basal.js b/app/src/main/assets/OpenAPSSMB/determine-basal.js index a18120af22..d33dc5988d 100644 --- a/app/src/main/assets/OpenAPSSMB/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMB/determine-basal.js @@ -284,7 +284,12 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ else { console.error("Time now is "+now+"; "); } + if (meal_data.TDDAIMI7){ var tdd7 = meal_data.TDDAIMI7; + } + else{ + var tdd7 = ((basal * 12)*100)/21; + } var tdd_pump_now = meal_data.TDDPUMP; var tdd_pump = ( tdd_pump_now / (now / 24)); var TDD = (tdd7 * 0.4) + (tdd_pump * 0.6); @@ -307,6 +312,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ rT.reason += "TDD: " +TDD+ " based on standard pump 60/tdd7 40 split; "; } + var variable_sens = (277700 / (TDD * bg)); variable_sens = round(variable_sens,1); console.log("Current sensitivity for predictions is " +variable_sens+" based on current bg");