FastDropAlarmEditor.swift 1.6 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: "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: "Rate of Fall",
  15. footer: "This is how much the glucose must drop to be considered a fast drop.",
  16. title: "Falls by",
  17. range: 3 ... 54,
  18. value: $alarm.delta
  19. )
  20. AlarmStepperSection(
  21. header: "Consecutive Drops",
  22. footer: "Number of drops—each meeting the rate above—required before an alert fires.",
  23. title: "Number of Drops",
  24. range: 1 ... 3,
  25. step: 1,
  26. value: $alarm.monitoringWindow
  27. )
  28. AlarmBGLimitSection(
  29. header: "BG Limit",
  30. footer: "When enabled, this alert only fires if the glucose is below the limit you set.",
  31. toggleText: "Use BG Limit",
  32. pickerTitle: "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. }