瀏覽代碼

Fixes after tester feedback
* Do not plot line mark when glucose value is 0 or manual glucose
* Do not reset direction when processing smoothing

Deniz Cengiz 2 月之前
父節點
當前提交
14426f1e87

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

@@ -437,6 +437,7 @@ extension BaseFetchGlucoseManager {
                     break
                 }
 
+                // possible FIXME: we probably do not need this; ported none the less from AAPS
                 if Int(data[i].glucose) == xDripErrorGlucose {
                     validWindowCount = i // exclude this 38 value
                     break
@@ -449,7 +450,6 @@ extension BaseFetchGlucoseManager {
             for obj in data {
                 let raw = Decimal(Int(obj.glucose))
                 obj.smoothedGlucose = max(raw, minimumSmoothedGlucose) as NSDecimalNumber
-                obj.direction = .none
             }
             return
         }
@@ -512,7 +512,6 @@ extension BaseFetchGlucoseManager {
             let clamped = max(rounded, minimumSmoothedGlucose)
 
             data[i].smoothedGlucose = clamped as NSDecimalNumber
-            data[i].direction = .none
         }
     }
 }

+ 1 - 1
Trio/Sources/Modules/Home/View/Chart/ChartElements/GlucoseChartView.swift

@@ -53,7 +53,7 @@ struct GlucoseChartView: ChartContent {
                 }
             }
 
-            if isSmoothingEnabled, let smoothedGlucose = item.smoothedGlucose {
+            if isSmoothingEnabled, let smoothedGlucose = item.smoothedGlucose, smoothedGlucose != 0 {
                 LineMark(
                     x: .value("Time", item.date ?? Date(), unit: .second),
                     y: .value("Value", smoothedGlucose as Decimal),