FastRiseAlarmEditor.swift 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // LoopFollow
  2. // FastRiseAlarmEditor.swift
  3. import SwiftUI
  4. struct FastRiseAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Group {
  8. InfoBanner(
  9. text: String(localized: "Alerts when glucose readings rise rapidly. For example, three straight readings each climbing by at least the amount you set. Optionally limit alerts to only fire above a certain BG."),
  10. alarmType: alarm.type
  11. )
  12. AlarmGeneralSection(alarm: $alarm)
  13. AlarmBGSection(
  14. header: String(localized: "Rate of Rise"),
  15. footer: String(localized: "This is how much the glucose must rise to be considered a fast rise."),
  16. title: String(localized: "Rises by"),
  17. range: 3 ... 54,
  18. value: $alarm.delta
  19. )
  20. AlarmStepperSection(
  21. header: String(localized: "Consecutive Rises"),
  22. footer: String(localized: "Number of rises—each meeting the rate above—required before an alert fires."),
  23. title: String(localized: "Rises in a row"),
  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 above the limit you set."),
  31. toggleText: String(localized: "Use BG Limit"),
  32. pickerTitle: String(localized: "Rising above"),
  33. range: 40 ... 300,
  34. defaultOnValue: 200,
  35. value: $alarm.aboveBG
  36. )
  37. AlarmActiveSection(alarm: $alarm)
  38. AlarmAudioSection(alarm: $alarm)
  39. AlarmSnoozeSection(alarm: $alarm)
  40. }
  41. }
  42. }