FastRiseAlarmEditor.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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: "Alerts when glucose readings rise rapidly. For example, "
  10. + "three straight readings each climbing by at least the amount "
  11. + "you set. Optionally limit alerts to only fire above a certain BG.",
  12. alarmType: alarm.type
  13. )
  14. AlarmGeneralSection(alarm: $alarm)
  15. AlarmBGSection(
  16. header: String(localized: "Rate of Rise"),
  17. footer: String(localized: "This is how much the glucose must rise to be considered a fast rise."),
  18. title: String(localized: "Rises by"),
  19. range: 3 ... 54,
  20. value: $alarm.delta
  21. )
  22. AlarmStepperSection(
  23. header: String(localized: "Consecutive Rises"),
  24. footer: String(localized: "Number of rises—each meeting the rate above—required before an alert fires."),
  25. title: String(localized: "Rises in a row"),
  26. range: 1 ... 3,
  27. step: 1,
  28. value: $alarm.monitoringWindow
  29. )
  30. AlarmBGLimitSection(
  31. header: String(localized: "BG Limit"),
  32. footer: String(localized: "When enabled, this alert only fires if the glucose is above the limit you set."),
  33. toggleText: String(localized: "Use BG Limit"),
  34. pickerTitle: String(localized: "Rising above"),
  35. range: 40 ... 300,
  36. defaultOnValue: 200,
  37. value: $alarm.aboveBG
  38. )
  39. AlarmActiveSection(alarm: $alarm)
  40. AlarmAudioSection(alarm: $alarm)
  41. AlarmSnoozeSection(alarm: $alarm)
  42. }
  43. }
  44. }