| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- // LoopFollow
- // FastRiseAlarmEditor.swift
- // Created by Jonas Björkert on 2025-05-15.
- import SwiftUI
- struct FastRiseAlarmEditor: View {
- @Binding var alarm: Alarm
- var body: some View {
- Form {
- InfoBanner(
- text: "Alerts when glucose readings rise rapidly. For example, "
- + "three straight readings each climbing by at least the amount "
- + "you set. Optionally limit alerts to only fire above a certain BG.",
- alarmType: alarm.type
- )
- AlarmGeneralSection(alarm: $alarm)
- AlarmBGSection(
- header: "Rate of Rise",
- footer: "This is how much the glucose must rise to be considered a fast rise.",
- title: "Rises by",
- range: 3 ... 54,
- value: Binding(
- get: { alarm.delta ?? 10 }, // This value has not effect since it is set as default on the alarm
- set: { alarm.delta = $0 }
- )
- )
- AlarmStepperSection(
- header: "Consecutive Rises",
- footer: "Number of rises—each meeting the rate above—"
- + "required before an alert fires.",
- title: "Rises in a row",
- range: 1 ... 3,
- step: 1,
- value: $alarm.monitoringWindow
- )
- AlarmBGLimitSection(
- header: "BG Limit",
- footer: "When enabled, this alert only fires if the glucose is "
- + "above the limit you set.",
- toggleText: "Use BG Limit",
- pickerTitle: "Rising above",
- range: 40 ... 300,
- defaultOnValue: 200,
- value: $alarm.aboveBG
- )
- AlarmActiveSection(alarm: $alarm)
- AlarmAudioSection(alarm: $alarm)
- AlarmSnoozeSection(alarm: $alarm)
- }
- .navigationTitle(alarm.type.rawValue)
- }
- }
|