فهرست منبع

Add transmitter and sensor information to bloodglucose type

(cherry picked from commit b1c7890f624b2a3756fa7832f511aac2ac2ca3d4)
Jan Dittmer 4 سال پیش
والد
کامیت
65d7203e14
2فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 4 1
      FreeAPS/Sources/APS/CGM/DexcomSource.swift
  2. 5 2
      FreeAPS/Sources/APS/CGM/GlucoseSimulatorSource.swift

+ 4 - 1
FreeAPS/Sources/APS/CGM/DexcomSource.swift

@@ -57,7 +57,10 @@ extension DexcomSource: TransmitterManagerDelegate {
                 filtered: nil,
                 filtered: nil,
                 noise: nil,
                 noise: nil,
                 glucose: value,
                 glucose: value,
-                type: "sgv"
+                type: "sgv",
+                activationDate: glucose.activationDate,
+                sessionStartDate: glucose.sessionStartDate,
+                transmitterID: glucose.transmitterID
             )
             )
         }
         }
         promise?(.success(bloodGlucose))
         promise?(.success(bloodGlucose))

+ 5 - 2
FreeAPS/Sources/APS/CGM/GlucoseSimulatorSource.swift

@@ -103,7 +103,7 @@ class IntelligentGenerator: BloodGlucoseGenerator {
     // direction of last step
     // direction of last step
     @Persisted(key: "GlucoseSimulatorDirection") private var trandsStepDirection = BloodGlucose.Direction.flat.rawValue
     @Persisted(key: "GlucoseSimulatorDirection") private var trandsStepDirection = BloodGlucose.Direction.flat.rawValue
     var currentGlucose: Int
     var currentGlucose: Int
-
+    let startup = Date()
     init(currentGlucose: Int) {
     init(currentGlucose: Int) {
         self.currentGlucose = currentGlucose
         self.currentGlucose = currentGlucose
     }
     }
@@ -135,7 +135,10 @@ class IntelligentGenerator: BloodGlucoseGenerator {
             filtered: nil,
             filtered: nil,
             noise: nil,
             noise: nil,
             glucose: currentGlucose,
             glucose: currentGlucose,
-            type: nil
+            type: nil,
+            activationDate: startup,
+            sessionStartDate: startup,
+            transmitterID: "SIMULATOR"
         )
         )
         return glucose
         return glucose
     }
     }