FastDropAlarmEditor.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // LoopFollow
  2. // FastDropAlarmEditor.swift
  3. import SwiftUI
  4. struct FastDropAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. @State private var useLimit: Bool = false
  7. var body: some View {
  8. Group {
  9. InfoBanner(
  10. text: String(localized: "Alerts when glucose readings drop rapidly. For example, three straight readings each falling by at least the amount you set. Optionally limit alerts to only fire below a certain BG level.")
  11. )
  12. AlarmGeneralSection(alarm: $alarm)
  13. AlarmBGSection(
  14. header: String(localized: "Rate of Fall"),
  15. footer: String(localized: "This is how much the glucose must drop to be considered a fast drop."),
  16. title: String(localized: "Falls by"),
  17. range: 3 ... 54,
  18. value: $alarm.delta
  19. )
  20. AlarmStepperSection(
  21. header: String(localized: "Consecutive Drops"),
  22. footer: String(localized: "Number of drops—each meeting the rate above—required before an alert fires."),
  23. title: String(localized: "Number of Drops"),
  24. range: 1 ... 3,
  25. step: 1,
  26. value: $alarm.monitoringWindow
  27. )
  28. AlarmBGLimitSection(
  29. header: String(localized: "BG Limit"),
  30. footer: String(localized: "When enabled, this alert only fires if the glucose is below the limit you set."),
  31. toggleText: String(localized: "Use BG Limit"),
  32. pickerTitle: String(localized: "Dropping below"),
  33. range: 40 ... 300,
  34. defaultOnValue: 120,
  35. value: $alarm.belowBG
  36. )
  37. AlarmActiveSection(alarm: $alarm)
  38. AlarmAudioSection(alarm: $alarm)
  39. AlarmSnoozeSection(alarm: $alarm)
  40. }
  41. }
  42. }