|
|
@@ -252,3 +252,84 @@ struct Alarm: Identifiable, Codable, Equatable {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+extension AlarmType {
|
|
|
+ enum Group: String, CaseIterable {
|
|
|
+ case glucose = "Glucose"
|
|
|
+ case insulin = "Insulin / Food"
|
|
|
+ case device = "Device / System"
|
|
|
+ case other = "Override / Target"
|
|
|
+ }
|
|
|
+
|
|
|
+ var group: Group {
|
|
|
+ switch self {
|
|
|
+ case .low, .high, .fastDrop, .fastRise, .missedReading:
|
|
|
+ return .glucose
|
|
|
+ case .iob, .bolus, .cob, .missedBolus, .recBolus:
|
|
|
+ return .insulin
|
|
|
+ case .battery, .batteryDrop, .pump, .pumpChange,
|
|
|
+ .sensorChange, .notLooping, .buildExpire:
|
|
|
+ return .device
|
|
|
+ default:
|
|
|
+ return .other
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var icon: String {
|
|
|
+ switch self {
|
|
|
+ case .low : return "arrow.down.to.line"
|
|
|
+ case .high : return "arrow.up.to.line"
|
|
|
+ case .fastDrop : return "chevron.down.2"
|
|
|
+ case .fastRise : return "chevron.up.2"
|
|
|
+ case .missedReading: return "wifi.slash"
|
|
|
+
|
|
|
+ case .iob, .bolus: return "syringe"
|
|
|
+ case .cob : return "fork.knife"
|
|
|
+ case .missedBolus: return "exclamationmark.arrow.triangle.2.circlepath"
|
|
|
+ case .recBolus : return "bolt.horizontal"
|
|
|
+
|
|
|
+ case .battery: return "battery.25"
|
|
|
+ case .batteryDrop: return "battery.100.bolt"
|
|
|
+ case .pump: return "drop"
|
|
|
+ case .pumpChange: return "arrow.triangle.2.circlepath"
|
|
|
+ case .sensorChange: return "sensor.tag.radiowaves.forward"
|
|
|
+
|
|
|
+ case .notLooping: return "circle.slash"
|
|
|
+ case .buildExpire: return "calendar.badge.exclamationmark"
|
|
|
+
|
|
|
+ case .overrideStart: return "play.circle"
|
|
|
+ case .overrideEnd: return "stop.circle"
|
|
|
+ case .tempTargetStart: return "flag"
|
|
|
+ case .tempTargetEnd: return "flag.slash"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var blurb: String {
|
|
|
+ switch self {
|
|
|
+ case .low: return "Alerts when BG goes below a limit."
|
|
|
+ case .high: return "Alerts when BG rises above a limit."
|
|
|
+ case .fastDrop: return "Rapid downward BG trend."
|
|
|
+ case .fastRise: return "Rapid upward BG trend."
|
|
|
+ case .missedReading: return "No CGM data for X minutes."
|
|
|
+
|
|
|
+ case .iob: return "High insulin-on-board."
|
|
|
+ case .bolus: return "Large individual bolus."
|
|
|
+ case .cob: return "High carbs-on-board."
|
|
|
+ case .missedBolus: return "Carbs without bolus."
|
|
|
+ case .recBolus: return "Recommended bolus issued."
|
|
|
+
|
|
|
+ case .battery: return "Phone battery low."
|
|
|
+ case .batteryDrop: return "Battery drops quickly."
|
|
|
+ case .pump: return "Reservoir level low."
|
|
|
+ case .pumpChange: return "Pump change due."
|
|
|
+ case .sensorChange: return "Sensor change due."
|
|
|
+ case .notLooping: return "Loop hasn’t completed."
|
|
|
+ case .buildExpire: return "Looping-app build expiring."
|
|
|
+
|
|
|
+ case .overrideStart: return "Override just started."
|
|
|
+ case .overrideEnd: return "Override ended."
|
|
|
+ case .tempTargetStart:return "Temp target started."
|
|
|
+ case .tempTargetEnd: return "Temp target ended."
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|