IOBAlarmEditor.swift 2.2 KB

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