|
|
@@ -7,7 +7,7 @@ extension AlgorithmAdvancedSettings {
|
|
|
@StateObject var state = StateModel()
|
|
|
@State private var shouldDisplayHint: Bool = false
|
|
|
@State var hintDetent = PresentationDetent.large
|
|
|
- @State var selectedVerboseHint: String?
|
|
|
+ @State var selectedVerboseHint: AnyView?
|
|
|
@State var hintLabel: String?
|
|
|
@State private var decimalPlaceholder: Decimal = 0.0
|
|
|
@State private var booleanPlaceholder: Bool = false
|
|
|
@@ -23,7 +23,7 @@ extension AlgorithmAdvancedSettings {
|
|
|
content: {
|
|
|
VStack(alignment: .leading) {
|
|
|
Text(
|
|
|
- "The settings in this section are designed for advanced expert users and typically do not require ANY modifications."
|
|
|
+ "The settings in this section typically do not require ANY modifications. Do not alter them without a solid understanding of what you are changing and the full impact it will have on the algorithm."
|
|
|
).bold()
|
|
|
}
|
|
|
}
|
|
|
@@ -37,18 +37,23 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("maxDailySafetyMultiplier"),
|
|
|
label: NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "This is an important OpenAPS safety limit. The default setting (which is unlikely to need adjusting) is 3. This means that OpenAPS will never be allowed to set a temporary basal rate that is more than 3x the highest hourly basal rate programmed in a user’s pump, or, if enabled, determined by autotune.",
|
|
|
- comment: "Max Daily Safety Multiplier"
|
|
|
- )
|
|
|
+ miniHint: "Limits temporary basal rates to this percentage of your largest basal rate.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 300%").bold()
|
|
|
+ Text(
|
|
|
+ "This setting restricts the maximum temporary basal rate Trio can set. At the default of 300%, it caps it at 3 times your highest programmed basal rate."
|
|
|
+ )
|
|
|
+ Text("It serves as a safety limit, ensuring no temporary basal rates exceed safe levels.")
|
|
|
+ Text("Warning: Increasing this setting is not advised.").bold()
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -58,7 +63,7 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString(
|
|
|
"Current Basal Safety Multiplier",
|
|
|
comment: "Current Basal Safety Multiplier"
|
|
|
@@ -68,11 +73,18 @@ extension AlgorithmAdvancedSettings {
|
|
|
units: state.units,
|
|
|
type: .decimal("currentBasalSafetyMultiplier"),
|
|
|
label: NSLocalizedString("Current Basal Safety Multiplier", comment: "Current Basal Safety Multiplier"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "This is another important OpenAPS safety limit. The default setting (which is also unlikely to need adjusting) is 4. This means that OpenAPS will never be allowed to set a temporary basal rate that is more than 4x the current hourly basal rate programmed in a user’s pump, or, if enabled, determined by autotune.",
|
|
|
- comment: "Current Basal Safety Multiplier"
|
|
|
- )
|
|
|
+ miniHint: "Limits temporary basal rates to this percentage of the current basal rate.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 400%").bold()
|
|
|
+ Text(
|
|
|
+ "This limits the automatic adjustment of the temporary basal rate to this percentage of the current hourly profile basal rate at the time of the loop cycle."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This prevents excessive dosing, especially during times of variable insulin sensitivity, enhancing safety."
|
|
|
+ )
|
|
|
+ Text("Warning: Increasing this setting is not advised.").bold()
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -82,15 +94,27 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = "Duration of Insulin Action"
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("dia"),
|
|
|
label: "Duration of Insulin Action",
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: "Duration of Insulin Action… bla bla bla"
|
|
|
+ miniHint: "Number of hours insulin is active in your body.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 10 hours").bold()
|
|
|
+ Text(
|
|
|
+ "The Duration of Insulin Action (DIA) defines how long your insulin continues to lower glucose readings after a dose."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This helps the system accurately track Insulin on Board (IOB), avoiding over- or under-corrections by considering the tail end of insulin's effect."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "Tip: It is better to use Custom Peak Time rather than adjust your Duration of Insulin Action (DIA)."
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -100,7 +124,7 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time")
|
|
|
}
|
|
|
),
|
|
|
@@ -108,13 +132,20 @@ extension AlgorithmAdvancedSettings {
|
|
|
type: .conditionalDecimal("insulinPeakTime"),
|
|
|
label: NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time"),
|
|
|
conditionalLabel: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "Defaults to false. Setting to true allows changing insulinPeakTime", comment: "Use Custom Peak Time"
|
|
|
- ) + NSLocalizedString(
|
|
|
- "Time of maximum blood glucose lowering effect of insulin, in minutes. Beware: Oref assumes for ultra-rapid (Lyumjev) & rapid-acting (Fiasp) curves minimal (35 & 50 min) and maximal (100 & 120 min) applicable insulinPeakTimes. Using a custom insulinPeakTime outside these bounds will result in issues with Trio, longer loop calculations and possible red loops.",
|
|
|
- comment: "Insulin Peak Time"
|
|
|
- )
|
|
|
+ miniHint: "Set a custom time for peak insulin effect.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: Set by Insulin Type").bold()
|
|
|
+ Text(
|
|
|
+ "Insulin Peak Time defines when insulin is most effective in lowering glucose, set in minutes after dosing."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This peak informs the system when to expect the most potent glucose-lowering effect, helping it predict glucose trends more accurately."
|
|
|
+ )
|
|
|
+ Text("System-Determined Defaults:").bold()
|
|
|
+ Text("Ultra-Rapid: 55 minutes (permitted range 35-100 minutes)")
|
|
|
+ Text("Rapid-Acting: 75 minutes (permitted range 50-120 minutes)")
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -124,18 +155,24 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Skip Neutral Temps", comment: "Skip Neutral Temps")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .boolean,
|
|
|
label: NSLocalizedString("Skip Neutral Temps", comment: "Skip Neutral Temps"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "Defaults to false, so that Trio will set temps whenever it can, so it will be easier to see if the system is working, even when you are offline. This means Trio will set a “neutral” temp (same as your default basal) if no adjustments are needed. This is an old setting for OpenAPS to have the options to minimise sounds and notifications from the 'rig', that may wake you up during the night.",
|
|
|
- comment: "Skip Neutral Temps"
|
|
|
- )
|
|
|
+ miniHint: "Skip neutral temporary basal rates to reduce MDT pump alerts.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: OFF").bold()
|
|
|
+ Text(
|
|
|
+ "When Skip Neutral Temps is enabled, Trio will not set neutral basal rates shortly before the hour, minimizing hourly pump alerts on MDT pumps. This can help light sleepers avoid alerts but will delay basal adjustments. This will also only come into effect if SMB's are disabled for whatever reason."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "For most users, leaving this OFF is recommended to ensure consistent basal delivery and loop calculation. If this option is effective, loops will be skipped during the last 5 minutes of the hour."
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -145,18 +182,22 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Unsuspend If No Temp", comment: "Unsuspend If No Temp")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .boolean,
|
|
|
label: NSLocalizedString("Unsuspend If No Temp", comment: "Unsuspend If No Temp"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "Many people occasionally forget to resume / unsuspend their pump after reconnecting it. If you’re one of them, and you are willing to reliably set a zero temp basal whenever suspending and disconnecting your pump, this feature has your back. If enabled, it will automatically resume / unsuspend the pump if you forget to do so before your zero temp expires. As long as the zero temp is still running, it will leave the pump suspended.",
|
|
|
- comment: "Unsuspend If No Temp"
|
|
|
- )
|
|
|
+ miniHint: "Resume pump automatically after suspension.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: OFF").bold()
|
|
|
+ Text(
|
|
|
+ "Enabling Unsuspend If No Temp allows Trio to resume your pump if you forget, as long as a zero temp basal was set first. This feature ensures insulin delivery restarts if you forget to manually unsuspend, adding a safeguard for pump reconnections."
|
|
|
+ )
|
|
|
+ Text("Note: Applies only to pumps with on-pump suspend options")
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -166,43 +207,53 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Suspend Zeros IOB", comment: "Suspend Zeros IOB")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .boolean,
|
|
|
label: NSLocalizedString("Suspend Zeros IOB", comment: "Suspend Zeros IOB"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "Default is false. Any existing temp basals during times the pump was suspended will be deleted and 0 temp basals to negate the profile basal rates during times pump is suspended will be added.",
|
|
|
- comment: "Suspend Zeros IOB"
|
|
|
- )
|
|
|
+ miniHint: "Clear temporary basal rates and reset IOB when suspended.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: OFF").bold()
|
|
|
+ Text(
|
|
|
+ "When Suspend Zeros IOB is enabled, any active temporary basal rates during a pump suspension are reset, with new 0 U/hr temporary basal rates added to counteract those done during suspension."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This prevents lingering insulin effects when your pump is suspended, ensuring safer management of insulin on board."
|
|
|
+ )
|
|
|
+ Text("Note: Applies only to pumps with on-pump suspend options.")
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
- SettingInputSection(
|
|
|
- decimalValue: $state.autotuneISFAdjustmentFraction,
|
|
|
- booleanValue: $booleanPlaceholder,
|
|
|
- shouldDisplayHint: $shouldDisplayHint,
|
|
|
- selectedVerboseHint: Binding(
|
|
|
- get: { selectedVerboseHint },
|
|
|
- set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
- hintLabel = NSLocalizedString(
|
|
|
- "Autotune ISF Adjustment Fraction",
|
|
|
- comment: "Autotune ISF Adjustment Fraction"
|
|
|
- )
|
|
|
- }
|
|
|
- ),
|
|
|
- units: state.units,
|
|
|
- type: .decimal("autotuneISFAdjustmentFraction"),
|
|
|
- label: NSLocalizedString("Autotune ISF Adjustment Fraction", comment: "Autotune ISF Adjustment Fraction"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "The default of 0.5 for this value keeps autotune ISF closer to pump ISF via a weighted average of fullNewISF and pumpISF. 1.0 allows full adjustment, 0 is no adjustment from pump ISF.",
|
|
|
- comment: "Autotune ISF Adjustment Fraction"
|
|
|
- )
|
|
|
- )
|
|
|
+ // Commenting out Autotune from Settings Menu until full removal is complete
|
|
|
+ // SettingInputSection(
|
|
|
+ // decimalValue: $state.autotuneISFAdjustmentFraction,
|
|
|
+ // booleanValue: $booleanPlaceholder,
|
|
|
+ // shouldDisplayHint: $shouldDisplayHint,
|
|
|
+ // selectedVerboseHint: Binding(
|
|
|
+ // get: { selectedVerboseHint },
|
|
|
+ // set: {
|
|
|
+ // selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
+ // hintLabel = NSLocalizedString(
|
|
|
+ // "Autotune ISF Adjustment Percent",
|
|
|
+ // comment: "Autotune ISF Adjustment Percent"
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // ),
|
|
|
+ // units: state.units,
|
|
|
+ // type: .decimal("autotuneISFAdjustmentFraction"),
|
|
|
+ // label: NSLocalizedString("Autotune ISF Adjustment Percent", comment: "Autotune ISF Adjustment Percent"),
|
|
|
+ // miniHint: "Using Autotune is not advised",
|
|
|
+ // verboseHint: Text(
|
|
|
+ // NSLocalizedString(
|
|
|
+ // "The default of 50% for this value keeps autotune ISF closer to pump ISF via a weighted average of fullNewISF and pumpISF. 100% allows full adjustment, 0% is no adjustment from pump ISF.",
|
|
|
+ // comment: "Autotune ISF Adjustment Percent"
|
|
|
+ // )
|
|
|
+ // )
|
|
|
+ // )
|
|
|
|
|
|
SettingInputSection(
|
|
|
decimalValue: $state.min5mCarbimpact,
|
|
|
@@ -211,18 +262,26 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
- hintLabel = NSLocalizedString("Min 5m Carbimpact", comment: "Min 5m Carbimpact")
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
+ hintLabel = NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("min5mCarbimpact"),
|
|
|
- label: NSLocalizedString("Min 5m Carbimpact", comment: "Min 5m Carbimpact"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "This is a setting for default carb absorption impact per 5 minutes. The default is an expected 8 mg/dL/5min. This affects how fast COB is decayed in situations when carb absorption is not visible in BG deviations. The default of 8 mg/dL/5min corresponds to a minimum carb absorption rate of 24g/hr at a CSF of 4 mg/dL/g.",
|
|
|
- comment: "Min 5m Carbimpact"
|
|
|
- )
|
|
|
+ label: NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact"),
|
|
|
+ miniHint: "Default impact of carb absorption over a 5 minute interval.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text(
|
|
|
+ "Min 5m Carb Impact sets the expected glucose rise from carbs over 5 minutes when absorption isn't obvious from glucose data."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "The default value of 8 mg/dL per 5 minutes corresponds to an absorption rate of 24 g of carbs per hour."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This setting helps the system estimate how much glucose your body is absorbing, even when it's not immediately visible in your glucose data, ensuring more accurate insulin dosing during carb absorption."
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -232,18 +291,24 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
- hintLabel = NSLocalizedString("Remaining Carbs Fraction", comment: "Remaining Carbs Fraction")
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
+ hintLabel = NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("remainingCarbsFraction"),
|
|
|
- label: NSLocalizedString("Remaining Carbs Fraction", comment: "Remaining Carbs Fraction"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "This is the fraction of carbs we’ll assume will absorb over 4h if we don’t yet see carb absorption.",
|
|
|
- comment: "Remaining Carbs Fraction"
|
|
|
- )
|
|
|
+ label: NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage"),
|
|
|
+ miniHint: "Percentage of carbs still available if no absorption is detected.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 100%").bold()
|
|
|
+ Text(
|
|
|
+ "Remaining Carbs Percentage estimates carbs still absorbing over 4 hours if glucose data doesn't show clear absorption."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This fallback setting prevents under-dosing by spreading a portion of the entered carbs over time, balancing insulin needs with undetected carb impact."
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -253,18 +318,24 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("remainingCarbsCap"),
|
|
|
label: NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "This is the amount of the maximum number of carbs we’ll assume will absorb over 4h if we don’t yet see carb absorption.",
|
|
|
- comment: "Remaining Carbs Cap"
|
|
|
- )
|
|
|
+ miniHint: "Maximum amount of carbs still available if no absorption is detected.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 90 g").bold()
|
|
|
+ Text(
|
|
|
+ "The Remaining Carbs Cap defines the upper limit for how many carbs the system will assume are absorbing over 4 hours, even when there's no clear sign of absorption from your glucose readings."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This cap prevents the system from overestimating how much insulin is needed when carb absorption isn't visible, offering a safeguard for accurate dosing."
|
|
|
+ )
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
SettingInputSection(
|
|
|
@@ -274,26 +345,34 @@ extension AlgorithmAdvancedSettings {
|
|
|
selectedVerboseHint: Binding(
|
|
|
get: { selectedVerboseHint },
|
|
|
set: {
|
|
|
- selectedVerboseHint = $0
|
|
|
+ selectedVerboseHint = $0.map { AnyView($0) }
|
|
|
hintLabel = NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier")
|
|
|
}
|
|
|
),
|
|
|
units: state.units,
|
|
|
type: .decimal("noisyCGMTargetMultiplier"),
|
|
|
- label: NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier"),
|
|
|
- miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
|
|
|
- verboseHint: NSLocalizedString(
|
|
|
- "Defaults to 1.3. Increase target by this amount when looping off raw/noisy CGM data",
|
|
|
- comment: "Noisy CGM Target Multiplier"
|
|
|
- )
|
|
|
+ label: NSLocalizedString("Noisy CGM Target Increase", comment: "Noisy CGM Target Increase"),
|
|
|
+ miniHint: "Percentage increase of glucose target when CGM is inconsistent.",
|
|
|
+ verboseHint:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Default: 130%").bold()
|
|
|
+ Text(
|
|
|
+ "The Noisy CGM Target Increase raises your glucose target when the system detects noisy or raw CGM data. By default, the target is increased to 130% of your set target glucose to account for the less reliable glucose readings."
|
|
|
+ )
|
|
|
+ Text(
|
|
|
+ "This helps reduce the risk of incorrect insulin dosing based on inaccurate sensor data, ensuring safer insulin adjustments during periods of poor CGM accuracy."
|
|
|
+ )
|
|
|
+ Text("Note: A CGM is considered noisy when it provides inconsistent readings.")
|
|
|
+ }
|
|
|
)
|
|
|
}
|
|
|
+ .listSectionSpacing(sectionSpacing)
|
|
|
.sheet(isPresented: $shouldDisplayHint) {
|
|
|
SettingInputHintView(
|
|
|
hintDetent: $hintDetent,
|
|
|
shouldDisplayHint: $shouldDisplayHint,
|
|
|
hintLabel: hintLabel ?? "",
|
|
|
- hintText: selectedVerboseHint ?? "",
|
|
|
+ hintText: selectedVerboseHint ?? AnyView(EmptyView()),
|
|
|
sheetTitle: "Help"
|
|
|
)
|
|
|
}
|