Просмотр исходного кода

Lessen the rounding to get same TDD with backwards TDD calc

Jon Mårtensson 4 лет назад
Родитель
Сommit
aa9f58b124
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      FreeAPS/Resources/javascript/middleware/determine_basal.js

+ 2 - 2
FreeAPS/Resources/javascript/middleware/determine_basal.js

@@ -1,6 +1,6 @@
 function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock, pumphistory, preferences, basalProfile) {
 function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock, pumphistory, preferences, basalProfile) {
      
      
-    // This middleware works with my "bdb" branch.
+    // Dynamic ratios and TDD calculation
     const BG = glucose[0].glucose;
     const BG = glucose[0].glucose;
     var chrisFormula = preferences.enableChris;
     var chrisFormula = preferences.enableChris;
     var useDynamicCR = preferences.enableDynamicCR;
     var useDynamicCR = preferences.enableDynamicCR;
@@ -403,7 +403,7 @@ function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoi
         }
         }
         
         
         // Set the new ratio
         // Set the new ratio
-        autosens.ratio = round(newRatio, 2);
+        autosens.ratio = round(newRatio, 4);
         
         
         logOutPut = startLog + dataLog + bgLog + afLog + formula + log + logTDD + logBolus + logTempBasal + logBasal;
         logOutPut = startLog + dataLog + bgLog + afLog + formula + log + logTDD + logBolus + logTempBasal + logBasal;
     } else if (chrisFormula == false && useDynamicCR == true) {
     } else if (chrisFormula == false && useDynamicCR == true) {