FastRiseAlarmEditor.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: "Rate of Rise",
  17. footer: "This is how much the glucose must rise to be considered a fast rise.",
  18. title: "Rises by",
  19. range: 3 ... 54,
  20. value: $alarm.delta
  21. )
  22. AlarmStepperSection(
  23. header: "Consecutive Rises",
  24. footer: "Number of rises—each meeting the rate above—"
  25. + "required before an alert fires.",
  26. title: "Rises in a row",
  27. range: 1 ... 3,
  28. step: 1,
  29. value: $alarm.monitoringWindow
  30. )
  31. AlarmBGLimitSection(
  32. header: "BG Limit",
  33. footer: "When enabled, this alert only fires if the glucose is "
  34. + "above the limit you set.",
  35. toggleText: "Use BG Limit",
  36. pickerTitle: "Rising above",
  37. range: 40 ... 300,
  38. defaultOnValue: 200,
  39. value: $alarm.aboveBG
  40. )
  41. AlarmActiveSection(alarm: $alarm)
  42. AlarmAudioSection(alarm: $alarm)
  43. AlarmSnoozeSection(alarm: $alarm)
  44. }
  45. }
  46. }