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

rename to tempTargetHalfBasalTarget

Robert 5 месяцев назад
Родитель
Сommit
ef6967be32

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

@@ -541,7 +541,7 @@ final class OpenAPS {
             {
                 // Compute effective HBT - handles both custom HBT and standard TT (where HBT might need adjustment)
                 let effectiveHBT = TempTargetCalculations.computeEffectiveHBT(
-                    storedHBT: activeTempTarget.halfBasalTarget?.decimalValue,
+                    tempTargetHalfBasalTarget: activeTempTarget.halfBasalTarget?.decimalValue,
                     settingHalfBasalTarget: defaultHalfBasalTarget,
                     target: targetValue,
                     autosensMax: preferences.autosensMax

+ 4 - 4
Trio/Sources/Helpers/TempTargetCalculations.swift

@@ -104,20 +104,20 @@ enum TempTargetCalculations {
     /// If the stored HBT is nil (standard TT) and using settings HBT would result in < 15%,
     /// calculates an adjusted HBT. Otherwise returns the stored HBT or nil.
     /// - Parameters:
-    ///   - storedHBT: The HBT stored with the TempTarget (nil for standard TT)
+    ///   - tempTargetHalfBasalTarget: The HBT stored with the TempTarget (nil for standard TT)
     ///   - settingHalfBasalTarget: The HBT from user settings
     ///   - target: The target glucose value
     ///   - autosensMax: The maximum autosens multiplier from settings
     /// - Returns: The effective HBT to use, or nil if settings HBT should be used as-is
     static func computeEffectiveHBT(
-        storedHBT: Decimal?,
+        tempTargetHalfBasalTarget: Decimal?,
         settingHalfBasalTarget: Decimal,
         target: Decimal,
         autosensMax: Decimal
     ) -> Decimal? {
         // If TempTarget has a stored HBT, use it directly
-        if let storedHBT {
-            return storedHBT
+        if let tempTargetHalfBasalTarget {
+            return tempTargetHalfBasalTarget
         }
 
         // For standard TT (no stored HBT), check if we need to adjust

+ 1 - 1
Trio/Sources/Modules/Home/View/HomeRootView.swift

@@ -286,7 +286,7 @@ extension Home {
             var target = (latestTempTarget.target ?? 100) as Decimal
             // Use TempTargetCalculations to get effective HBT (handles both custom and auto-adjusted standard TT)
             let effectiveHBT = TempTargetCalculations.computeEffectiveHBT(
-                storedHBT: latestTempTarget.halfBasalTarget?.decimalValue,
+                tempTargetHalfBasalTarget: latestTempTarget.halfBasalTarget?.decimalValue,
                 settingHalfBasalTarget: state.settingHalfBasalTarget,
                 target: target,
                 autosensMax: state.autosensMax