Explorar o código

same variable name maxMealAbsorptionTime in oref

Robert hai 1 ano
pai
achega
e166d1ab21

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/meal.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/profile.js


+ 1 - 1
FreeAPS/Sources/Models/Preferences.swift

@@ -73,7 +73,7 @@ extension Preferences {
         case exerciseMode = "exercise_mode"
         case halfBasalExerciseTarget = "half_basal_exercise_target"
         case maxCOB
-        case maxMealAbsorptionTime = "maxAbsorptionTime"
+        case maxMealAbsorptionTime
         case wideBGTargetRange = "wide_bg_target_range"
         case skipNeutralTemps = "skip_neutral_temps"
         case unsuspendIfNoTemp = "unsuspend_if_no_temp"

+ 4 - 3
oref0_source_version.txt

@@ -1,8 +1,9 @@
-oref0 branch: maxAbsorptionTime - git version: f306168
+oref0 branch: maxAbsorptionTime - git version: 1567c76
 
 Last commits:
-f306168 reduce dynISF logging
-fb5f9bc introduce maxAbsorptionTime to orefmaxAbsorptionTime
+1567c76 use variable name maxMealAbsorptionTime
+61b4f85 reduce dynISF logging
+0fe81c1 introduce maxAbsorptionTime to orefmaxAbsorptionTime
 ade267d Merge pull request #37 from mountrcg/tdd-pumpdataCheck
 46deecb remove dynisf check on pumpdata calc
 2f258b2 Merge pull request #36 from mountrcg/fixTDDcheck

+ 1 - 1
trio-oref/lib/determine-basal/cob.js

@@ -51,7 +51,7 @@ function detectCarbAbsorption(inputs) {
         }
         // only consider BGs for 6h after a meal for calculating COB
         var hoursAfterMeal = (bgTime-mealTime)/(60*60*1000);
-        if (hoursAfterMeal > profile.maxAbsorptionTime || foundPreMealBG) {
+        if (hoursAfterMeal > profile.maxMealAbsorptionTime || foundPreMealBG) {
             continue;
         } else if (hoursAfterMeal < 0) {
 //console.error("Found pre-meal BG:",glucose_data[i].glucose, bgTime, Math.round(hoursAfterMeal*100)/100);

+ 8 - 8
trio-oref/lib/meal/total.js

@@ -47,18 +47,18 @@ function recentCarbs(opts, time) {
     var nsCarbsToRemove = 0;
     var bwCarbsToRemove = 0;
     var journalCarbsToRemove = 0;
-    var maxAbsorptionTime = 6;
+    var maxMealAbsorptionTime = 6;
 
-    if (typeof(profile_data.maxAbsorptionTime) === 'number' && ! isNaN(profile_data.maxAbsorptionTime)) {
-        maxAbsorptionTime = profile_data.maxAbsorptionTime;
+    if (typeof(profile_data.maxMealAbsorptionTime) === 'number' && ! isNaN(profile_data.maxMealAbsorptionTime)) {
+        maxMealAbsorptionTime = profile_data.maxMealAbsorptionTime;
     } else {
-        console.error("Bad profile.maxAbsorptionTime:",profile_data.maxAbsorptionTime);
+        console.error("Bad profile.maxMealAbsorptionTime:",profile_data.maxMealAbsorptionTime);
     }
 
     treatments.forEach(function(treatment) {
         var now = time.getTime();
-        // consider carbs from up to the meal preference maxAbsorptionTime hours ago in calculating COB
-        var carbWindow = now - maxAbsorptionTime * 60*60*1000;
+        // consider carbs from up to the meal preference maxMealAbsorptionTime hours ago in calculating COB
+        var carbWindow = now - maxMealAbsorptionTime * 60*60*1000;
         var treatmentDate = new Date(tz(treatment.timestamp));
         var treatmentTime = treatmentDate.getTime();
         if (treatmentTime > carbWindow && treatmentTime <= now) {
@@ -112,14 +112,14 @@ function recentCarbs(opts, time) {
     // calculate the current deviation and steepest deviation downslope over the last hour
     COB_inputs.ciTime = time.getTime();
     // set mealTime to 6h ago for Deviation calculations
-    COB_inputs.mealTime = time.getTime() - profile_data.maxAbsorptionTime * 60 * 60 * 1000;
+    COB_inputs.mealTime = time.getTime() - profile_data.maxMealAbsorptionTime * 60 * 60 * 1000;
     var c = calcMealCOB(COB_inputs);
     //console.error(c.currentDeviation, c.slopeFromMaxDeviation);
 
     // set a hard upper limit on COB to mitigate impact of erroneous or malicious carb entry
     if (typeof(profile_data.maxCOB) === 'number' && ! isNaN(profile_data.maxCOB)) {
         mealCOB = Math.min( profile_data.maxCOB, mealCOB );
-        console.error("mealCOB: " + round(mealCOB,1) + " with maxCOB " + profile_data.maxCOB + " and maxAbsorptionTime " + maxAbsorptionTime);
+        console.error("mealCOB: " + round(mealCOB,1) + " with maxCOB " + profile_data.maxCOB + "g and maxMealAbsorptionTime " + maxMealAbsorptionTime + "hrs.");
     } else {
         console.error("Bad profile.maxCOB:",profile_data.maxCOB);
     }

+ 2 - 2
trio-oref/lib/profile/index.js

@@ -25,7 +25,7 @@ function defaults ( ) {
     // (If someone enters more carbs or stacks more; OpenAPS will just truncate dosing based on 120.
     // Essentially, this just limits AMA/SMB as a safety cap against excessive COB entry)
     , maxCOB: 120
-    , maxAbsorptionTime: 6 // Handling of long lasting effects of "heavy meals" containing large cqantities of fat and protein might be improved by letting the system consider meal effects for longer than the default six hours.
+    , maxMealAbsorptionTime: 6 // Handling of long lasting effects of "heavy meals" containing large cqantities of fat and protein might be improved by letting the system consider meal effects for longer than the default six hours.
     , skip_neutral_temps: false // if true, don't set neutral temps
     , unsuspend_if_no_temp: false // if true, pump will un-suspend after a zero temp finishes
     , min_5m_carbimpact: 8 // mg/dL per 5m (8 mg/dL/5m corresponds to 24g/hr at a CSF of 4 mg/dL/g (x/5*60/4))
@@ -113,7 +113,7 @@ function displayedDefaults () {
     profile.enableSMB_high_bg = allDefaults.enableSMB_high_bg;
     profile.enableSMB_high_bg_target = allDefaults.enableSMB_high_bg_target;
     profile.maxCOB = allDefaults.maxCOB;
-    profile.maxAbsorptionTime = allDefaults.maxAbsorptionTime;
+    profile.maxMealAbsorptionTime = allDefaults.maxMealAbsorptionTime;
 
     console.error(profile);
     return profile