IOBAlarmEditor.swift 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // LoopFollow
  2. // IOBAlarmEditor.swift
  3. import SwiftUI
  4. struct IOBAlarmEditor: View {
  5. @Binding var alarm: Alarm
  6. var body: some View {
  7. Group {
  8. InfoBanner(
  9. text: "Alerts when insulin-on-board is high, or when several "
  10. + "boluses in quick succession exceed the limits you set.",
  11. alarmType: alarm.type
  12. )
  13. AlarmGeneralSection(alarm: $alarm)
  14. AlarmStepperSection(
  15. header: String(localized: "Boluses Size Limit"),
  16. footer: String(localized: "This counts only boluses larger than this size."),
  17. title: String(localized: "Above"),
  18. range: 0.1 ... 20,
  19. step: 0.1,
  20. unitLabel: String(localized: "Units"),
  21. value: $alarm.delta
  22. )
  23. AlarmStepperSection(
  24. header: String(localized: "Bolus Count"),
  25. footer: String(localized: "Number of qualifying boluses needed to trigger."),
  26. title: String(localized: "Count"),
  27. range: 1 ... 10,
  28. step: 1,
  29. unitLabel: String(localized: "Boluses"),
  30. value: $alarm.monitoringWindow
  31. )
  32. AlarmStepperSection(
  33. header: String(localized: "Time Window"),
  34. footer: String(localized: "How far back to look for those boluses."),
  35. title: String(localized: "Time"),
  36. range: 5 ... 120,
  37. step: 5,
  38. unitLabel: String(localized: "min"),
  39. value: $alarm.predictiveMinutes
  40. )
  41. AlarmStepperSection(
  42. header: String(localized: "Insulin On Board"),
  43. footer: String(localized: "Alert if current IOB or total boluses reach this."),
  44. title: String(localized: "IOB Above"),
  45. range: 1 ... 20,
  46. step: 0.5,
  47. unitLabel: String(localized: "Units"),
  48. value: $alarm.threshold
  49. )
  50. AlarmActiveSection(alarm: $alarm)
  51. AlarmAudioSection(alarm: $alarm)
  52. AlarmSnoozeSection(alarm: $alarm)
  53. }
  54. }
  55. }