소스 검색

feat(oref): Import webpack bundle with removed 400 / shouldProtectDueToHIGH #hackdiabetes2025

Deniz Cengiz 6 달 전
부모
커밋
814c85a0ad

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
Trio/Resources/javascript/bundle/determine-basal.js


+ 1 - 2
Trio/Sources/APS/OpenAPS/OpenAPS.swift

@@ -452,8 +452,7 @@ final class OpenAPS {
                 start: (activeOverrides.first?.start ?? 0) as Decimal,
                 end: (activeOverrides.first?.end ?? 0) as Decimal,
                 smbMinutes: activeOverrides.first?.smbMinutes?.decimalValue ?? maxSMBBasalMinutes,
-                uamMinutes: activeOverrides.first?.uamMinutes?.decimalValue ?? maxUAMBasalMinutes,
-                shouldProtectDueToHIGH: GlucoseStored.glucoseIsHIGH(glucose)
+                uamMinutes: activeOverrides.first?.uamMinutes?.decimalValue ?? maxUAMBasalMinutes
             )
 
             // Save and return contents of Trio's custom oref variables

+ 0 - 4
Trio/Sources/Models/TrioCustomOrefVariables.swift

@@ -21,7 +21,6 @@ struct TrioCustomOrefVariables: JSON, Equatable {
     var end: Decimal
     var smbMinutes: Decimal
     var uamMinutes: Decimal
-    var shouldProtectDueToHIGH: Bool
 
     init(
         average_total_data: Decimal,
@@ -44,7 +43,6 @@ struct TrioCustomOrefVariables: JSON, Equatable {
         end: Decimal,
         smbMinutes: Decimal,
         uamMinutes: Decimal,
-        shouldProtectDueToHIGH: Bool
     ) {
         self.average_total_data = average_total_data
         self.weightedAverage = weightedAverage
@@ -66,7 +64,6 @@ struct TrioCustomOrefVariables: JSON, Equatable {
         self.end = end
         self.smbMinutes = smbMinutes
         self.uamMinutes = uamMinutes
-        self.shouldProtectDueToHIGH = shouldProtectDueToHIGH
     }
 }
 
@@ -92,6 +89,5 @@ extension TrioCustomOrefVariables {
         case end
         case smbMinutes
         case uamMinutes
-        case shouldProtectDueToHIGH
     }
 }

+ 2 - 1
oref0_source_version.txt

@@ -1,6 +1,7 @@
-oref0 branch: dev - git version: 37896e5
+oref0 branch: remove-400-guard-trio-oref - git version: 3aeba68
 
 Last commits:
+3aeba68 feat(algo): Remove 400 / shouldProtectDueToHIGH guard #hackdiabetes2025
 37896e5 Merge pull request #48 from nightscout/fix-bundle-naming
 f21a187 Rename output library to trio_[name]
 c0b46d3 Merge pull request #47 from nightscout/fix-400-guard

+ 0 - 9
trio-oref/lib/determine-basal/determine-basal.js

@@ -78,10 +78,6 @@ function enable_smb(profile, microBolusAllowed, meal_data, bg, target_bg, high_b
     } else if (meal_data.bwFound === true && profile.A52_risk_enable === false) {
         console.error("SMB disabled due to Bolus Wizard activity in the last 6 hours.");
         return false;
-    // Disable if invalid CGM reading (HIGH)
-    } else if (!!trio_custom_variables.shouldProtectDueToHIGH) {
-        console.error("Invalid CGM (HIGH). SMBs disabled.");
-        return false;
     }
 
     // enable SMB/UAM if always-on (unless previously disabled for high temptarget)
@@ -1616,11 +1612,6 @@ var maxDelta_bg_threshold;
 
         var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
 
-        // set neutral TBR at current basal rate because glucose is considered as requiring dosing Protect due to HIGH (400 mg/dL)
-        if (!!trio_custom_variables.shouldProtectDueToHIGH) {
-            return tempBasalFunctions.setTempBasal(profile.current_basal, 30, profile, rT, currenttemp);
-        }
-
         if (rate > maxSafeBasal) {
             rT.reason += "adj. req. rate: " + rate + " to maxSafeBasal: " + round(maxSafeBasal,2) + ", ";
             rate = round_basal(maxSafeBasal, profile);