ソースを参照

update predicition to eventualbg

Arif Kobel 2 年 前
コミット
06fd91cda1

+ 3 - 4
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView2.swift

@@ -39,6 +39,7 @@ struct MainChartView2: View {
     }
     }
 
 
     @Binding var glucose: [BloodGlucose]
     @Binding var glucose: [BloodGlucose]
+    @Binding var eventualBG: Int?
     @Binding var suggestion: Suggestion?
     @Binding var suggestion: Suggestion?
     @Binding var tempBasals: [PumpHistoryEvent]
     @Binding var tempBasals: [PumpHistoryEvent]
     @Binding var boluses: [PumpHistoryEvent]
     @Binding var boluses: [PumpHistoryEvent]
@@ -341,10 +342,8 @@ extension MainChartView2 {
                 .foregroundColor(.orange)
                 .foregroundColor(.orange)
             Text("UAM")
             Text("UAM")
                 .foregroundColor(.secondary)
                 .foregroundColor(.secondary)
-            if suggestion?.predictions?.cob?.last != nil {
-                Text("⇢ " + String(suggestion?.predictions?.cob?.last ?? 0))
-            } else if suggestion?.predictions?.uam?.last != nil {
-                Text("⇢ " + String(suggestion?.predictions?.uam?.last ?? 0))
+            if eventualBG != nil {
+                Text("⇢ " + String(eventualBG ?? 0))
             }
             }
         }
         }
         .font(.caption2)
         .font(.caption2)

+ 1 - 0
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -452,6 +452,7 @@ extension Home {
 
 
                 MainChartView2(
                 MainChartView2(
                     glucose: $state.glucose,
                     glucose: $state.glucose,
+                    eventualBG: $state.eventualBG,
                     suggestion: $state.suggestion,
                     suggestion: $state.suggestion,
                     tempBasals: $state.tempBasals,
                     tempBasals: $state.tempBasals,
                     boluses: $state.boluses,
                     boluses: $state.boluses,