MissedBolusAlarmEditor.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // LoopFollow
  2. // MissedBolusAlarmEditor.swift
  3. import SwiftUI
  4. struct MissedBolusAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Group {
  8. InfoBanner(
  9. text: "Alerts when carbs are logged but no bolus is delivered " +
  10. "within the delay below. Allows small-carb / treatment " +
  11. "exclusions and pre-bolus detection.",
  12. alarmType: alarm.type
  13. )
  14. AlarmGeneralSection(alarm: $alarm)
  15. AlarmStepperSection(
  16. header: "Delay",
  17. footer: "Minutes to wait after the carb entry before checking " +
  18. "for a bolus.",
  19. title: "Delay",
  20. range: 5 ... 60,
  21. step: 5,
  22. unitLabel: "min",
  23. value: $alarm.monitoringWindow
  24. )
  25. AlarmStepperSection(
  26. header: "Pre-bolus",
  27. footer: "Count boluses given up to this many minutes before " +
  28. "the carb entry as valid.",
  29. title: "Pre-Bolus Time",
  30. range: 0 ... 45,
  31. step: 5,
  32. unitLabel: "min",
  33. value: $alarm.predictiveMinutes
  34. )
  35. AlarmStepperSection(
  36. header: "Ignore small boluses",
  37. footer: "Boluses at or below this size are ignored.",
  38. title: "At or Below",
  39. range: 0.05 ... 2,
  40. step: 0.05,
  41. unitLabel: "Units",
  42. value: $alarm.delta
  43. )
  44. AlarmStepperSection(
  45. header: "Ignore small carbs",
  46. footer: "Carb entries at or below this amount will not trigger the alarm.",
  47. title: "At or Below",
  48. range: 0 ... 15,
  49. step: 1,
  50. unitLabel: "Grams",
  51. value: $alarm.threshold
  52. )
  53. AlarmBGLimitSection(
  54. header: "Ignore low BG",
  55. footer: "Only alert if the current BG is above this value.",
  56. toggleText: "Use BG Limit",
  57. pickerTitle: "Above",
  58. range: 40 ... 140,
  59. defaultOnValue: 70,
  60. value: $alarm.aboveBG
  61. )
  62. AlarmActiveSection(alarm: $alarm)
  63. AlarmAudioSection(alarm: $alarm)
  64. AlarmSnoozeSection(alarm: $alarm)
  65. }
  66. }
  67. }