Skip to content

Commit

Permalink
fix oref1 prefs - missing settings
Browse files Browse the repository at this point in the history
also duplicate Exercise Control into autoISF settings
  • Loading branch information
mountrcg committed Nov 29, 2023
1 parent ea3cd5e commit efcfca9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 20 deletions.
21 changes: 20 additions & 1 deletion FreeAPS/Sources/Modules/AutoISF/AutoISFConfStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ extension AutoISFConf {
comment: "Switch off autoISF with exercise"
),
settable: self
),
Field(
displayName: "Exercise Mode",
type: .boolean(keypath: \.exerciseMode),
infoText: NSLocalizedString(
"Defaults to false. When true, > 100 mg/dL high temp target adjusts sensitivityRatio for exercise mode. Synonym for high_temptarget_raises_sensitivity",
comment: "Exercise Mode"
),
settable: self
),
Field(
displayName: NSLocalizedString("Half Basal Exercise Target", comment: "Half Basal Exercise Target") +
" (mg/dL)",
type: .decimal(keypath: \.halfBasalExerciseTarget),
infoText: NSLocalizedString(
"Set to a number in mg/dl, e.g. 160, which means when TempTarget (TT) is 160 mg/dL and exercise mode = true, it will run 50% basal at this TT level (if high TT at 120 = 75%; 140 = 60%). This can be adjusted, to give you more control over your exercise modes.",
comment: "Half Basal Exercise Target"
),
settable: self
)
]

Expand Down Expand Up @@ -314,7 +333,7 @@ extension AutoISFConf {

sections = [
FieldSection(
displayName: NSLocalizedString("Target Control", comment: "AutoISF control via Targets"),
displayName: NSLocalizedString("Target & Exercise Control", comment: "AutoISF control via Targets"),
fields: autoisfConfig
),
FieldSection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ extension PreferencesEditor {
infoText: "Insulin curve info",
settable: self
),
Field(
displayName: NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time"),
type: .boolean(keypath: \.useCustomPeakTime),
infoText: NSLocalizedString(
"Defaults to false. Setting to true allows changing insulinPeakTime", comment: "Use Custom Peak Time"
),
settable: self
),
Field(
displayName: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
type: .decimal(keypath: \.insulinPeakTime),
infoText: 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 iAPS, longer loop calculations and possible red loops.",
comment: "Insulin Peak Time"
),
settable: self
),
Field(
displayName: NSLocalizedString("Max IOB", comment: "Max IOB"),
type: .decimal(keypath: \.maxIOB),
Expand Down Expand Up @@ -210,6 +227,15 @@ extension PreferencesEditor {
),
settable: self
),
Field(
displayName: NSLocalizedString("SMB Interval", comment: "SMB Interval"),
type: .decimal(keypath: \.smbInterval),
infoText: NSLocalizedString(
"Minimum duration in minutes for new SMB since last SMB or manual bolus",
comment: "SMB Interval"
),
settable: self
),
Field(
displayName: NSLocalizedString("Bolus Increment", comment: "Bolus Increment"),
type: .decimal(keypath: \.bolusIncrement),
Expand Down Expand Up @@ -280,23 +306,6 @@ extension PreferencesEditor {
),
settable: self
),
Field(
displayName: NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time"),
type: .boolean(keypath: \.useCustomPeakTime),
infoText: NSLocalizedString(
"Defaults to false. Setting to true allows changing insulinPeakTime", comment: "Use Custom Peak Time"
),
settable: self
),
Field(
displayName: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
type: .decimal(keypath: \.insulinPeakTime),
infoText: 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 iAPS, longer loop calculations and possible red loops.",
comment: "Insulin Peak Time"
),
settable: self
),
Field(
displayName: NSLocalizedString("Skip Neutral Temps", comment: "Skip Neutral Temps"),
type: .boolean(keypath: \.skipNeutralTemps),
Expand Down Expand Up @@ -376,16 +385,22 @@ extension PreferencesEditor {

sections = [
FieldSection(
displayName: NSLocalizedString("Temp Target Settings", comment: "Target Control Sports"),
displayName: NSLocalizedString("Target Control Sports", comment: "Target Control Sports"),
fields: quickPrefs
),
FieldSection(
displayName: NSLocalizedString("OpenAPS main settings", comment: "OpenAPS main settings"), fields: mainFields
displayName: NSLocalizedString("OpenAPS main settings", comment: "OpenAPS main settings"),
fields: mainFields
),
FieldSection(
displayName: NSLocalizedString("OpenAPS SMB settings", comment: "OpenAPS main settings"),
fields: smbFields
),
FieldSection(
displayName: NSLocalizedString("OpenAPS targets settings", comment: "OpenAPS targets settings"),
fields: targetSettings
),

FieldSection(
displayName: NSLocalizedString("OpenAPS other settings", comment: "OpenAPS other settings"),
fields: otherSettings
Expand Down

0 comments on commit efcfca9

Please sign in to comment.