|
|
@@ -5,7 +5,7 @@ extension PreferencesEditor {
|
|
|
final class StateModel: BaseStateModel<Provider>, PreferencesSettable { private(set) var preferences = Preferences()
|
|
|
@Published var unitsIndex = 1
|
|
|
@Published var allowAnnouncements = false
|
|
|
- @Published var insulinReqFraction: Decimal = 0.7
|
|
|
+ @Published var insulinReqFraction: Decimal = 2.0
|
|
|
@Published var skipBolusScreenAfterCarbs = false
|
|
|
|
|
|
@Published var sections: [FieldSection] = []
|
|
|
@@ -129,10 +129,10 @@ extension PreferencesEditor {
|
|
|
settable: self
|
|
|
),
|
|
|
Field(
|
|
|
- displayName: "Weighted Average of TDD. Weight of past 24 hours of TDD",
|
|
|
+ displayName: "Weighted Average of TDD. Weight of past 24 hours:",
|
|
|
type: .decimal(keypath: \.weightPercentage),
|
|
|
infoText: NSLocalizedString(
|
|
|
- "Default is 0.65 (65 %) * past 24 hours. The rest will be from 7 days TDD average (0.35). To only use past 24 hours, set this to 1.",
|
|
|
+ "Has to be > 0 and <= 1. Default is 0.65 (65 %) * past 24 hours. The rest will be from 7 days TDD average (0.35). To only use past 24 hours, set this to 1.",
|
|
|
comment: "Weight of past 24 hours of TDD"
|
|
|
),
|
|
|
settable: self
|
|
|
@@ -436,16 +436,7 @@ extension PreferencesEditor {
|
|
|
)
|
|
|
]
|
|
|
|
|
|
- let xpmToogles = [
|
|
|
- Field(
|
|
|
- displayName: "Enable Floating Carbs",
|
|
|
- type: .boolean(keypath: \.floatingcarbs),
|
|
|
- infoText: NSLocalizedString(
|
|
|
- "Defaults to false. If true, then dose slightly more aggressively by using all entered carbs for calculating COBpredBGs. This avoids backing off too quickly as COB decays. Even with this option, oref0 still switches gradually from using COBpredBGs to UAMpredBGs proportionally to how many carbs are left as COB. Summary: use all entered carbs in the future for predBGs & don't decay them as COB, only once they are actual.",
|
|
|
- comment: "Floating Carbs"
|
|
|
- ),
|
|
|
- settable: self
|
|
|
- ),
|
|
|
+ let autoISF = [
|
|
|
Field(
|
|
|
displayName: "Enable AutoISF",
|
|
|
type: .boolean(keypath: \.autoisf),
|
|
|
@@ -454,6 +445,18 @@ extension PreferencesEditor {
|
|
|
comment: "Enable AutoISF"
|
|
|
),
|
|
|
settable: self
|
|
|
+ )
|
|
|
+ ]
|
|
|
+
|
|
|
+ let autoISFsettings = [
|
|
|
+ Field(
|
|
|
+ displayName: "Enable Floating Carbs",
|
|
|
+ type: .boolean(keypath: \.floatingcarbs),
|
|
|
+ infoText: NSLocalizedString(
|
|
|
+ "Defaults to false. If true, then dose slightly more aggressively by using all entered carbs for calculating COBpredBGs. This avoids backing off too quickly as COB decays. Even with this option, oref0 still switches gradually from using COBpredBGs to UAMpredBGs proportionally to how many carbs are left as COB. Summary: use all entered carbs in the future for predBGs & don't decay them as COB, only once they are actual.",
|
|
|
+ comment: "Floating Carbs"
|
|
|
+ ),
|
|
|
+ settable: self
|
|
|
),
|
|
|
Field(
|
|
|
displayName: "Enable AutoISF with COB",
|
|
|
@@ -472,9 +475,7 @@ extension PreferencesEditor {
|
|
|
comment: "Enable BG accel in autoISF"
|
|
|
),
|
|
|
settable: self
|
|
|
- )
|
|
|
- ]
|
|
|
- let xpmSettings = [
|
|
|
+ ),
|
|
|
Field(
|
|
|
displayName: "AutoISF HourlyMaxChange",
|
|
|
type: .decimal(keypath: \.autoISFhourlyChange),
|
|
|
@@ -492,9 +493,7 @@ extension PreferencesEditor {
|
|
|
comment: "AutoISF Max"
|
|
|
),
|
|
|
settable: self
|
|
|
- )
|
|
|
- ]
|
|
|
- let xpmSMB = [
|
|
|
+ ),
|
|
|
Field(
|
|
|
displayName: "SMB Max RangeExtension",
|
|
|
type: .decimal(keypath: \.smbMaxRangeExtension),
|
|
|
@@ -539,9 +538,7 @@ extension PreferencesEditor {
|
|
|
comment: "SMB DeliveryRatio Minimum"
|
|
|
),
|
|
|
settable: self
|
|
|
- )
|
|
|
- ]
|
|
|
- let xpmParabolicFit = [
|
|
|
+ ),
|
|
|
Field(
|
|
|
displayName: "ISF weight while BG accelerates",
|
|
|
type: .decimal(keypath: \.bgAccelISFweight),
|
|
|
@@ -568,9 +565,7 @@ extension PreferencesEditor {
|
|
|
comment: "AutoISF Min"
|
|
|
),
|
|
|
settable: self
|
|
|
- )
|
|
|
- ]
|
|
|
- let xpmAutoISF = [
|
|
|
+ ),
|
|
|
Field(
|
|
|
displayName: "ISF weight for higher BG's",
|
|
|
type: .decimal(keypath: \.higherISFrangeWeight),
|
|
|
@@ -597,9 +592,7 @@ extension PreferencesEditor {
|
|
|
comment: "ISF higher delta BG weight"
|
|
|
),
|
|
|
settable: self
|
|
|
- )
|
|
|
- ]
|
|
|
- let xpmPostPrandial = [
|
|
|
+ ),
|
|
|
Field(
|
|
|
displayName: "Enable always postprandial ISF adaption",
|
|
|
type: .boolean(keypath: \.postMealISFalways),
|
|
|
@@ -649,34 +642,15 @@ extension PreferencesEditor {
|
|
|
fields: otherSettings
|
|
|
),
|
|
|
FieldSection(
|
|
|
- displayName: NSLocalizedString("XPM toggles", comment: "Switch on/off experimental stuff"),
|
|
|
- fields: xpmToogles
|
|
|
- ),
|
|
|
- FieldSection(
|
|
|
- displayName: NSLocalizedString("autoISF general settings", comment: "Experimental stuff settings"),
|
|
|
- fields: xpmSettings
|
|
|
- ),
|
|
|
- FieldSection(
|
|
|
- displayName: NSLocalizedString("SMB Delivery Ratio settings", comment: "Experimental settings for SMBs"),
|
|
|
- fields: xpmSMB
|
|
|
- ),
|
|
|
- FieldSection(
|
|
|
- displayName: NSLocalizedString("autoISF 2.1 settings", comment: "Experimental settings for autoISF 2.1"),
|
|
|
- fields: xpmAutoISF
|
|
|
- ),
|
|
|
- FieldSection(
|
|
|
- displayName: NSLocalizedString(
|
|
|
- "autoISF 2.2 Parabolic Fit settings",
|
|
|
- comment: "Experimental settings for autoISF 2.2"
|
|
|
- ),
|
|
|
- fields: xpmParabolicFit
|
|
|
+ displayName: NSLocalizedString("Use Auto ISF", comment: "Switch on/off experimental stuff"),
|
|
|
+ fields: autoISF
|
|
|
),
|
|
|
FieldSection(
|
|
|
displayName: NSLocalizedString(
|
|
|
- "autoISF 2.1 Post-prandial settings",
|
|
|
- comment: "Experimental settings for autoISF 2.1"
|
|
|
+ "Auto ISF Settings. Forget about these if Auto ISF is toggled off",
|
|
|
+ comment: "AutoISF Settings"
|
|
|
),
|
|
|
- fields: xpmPostPrandial
|
|
|
+ fields: autoISFsettings
|
|
|
)
|
|
|
]
|
|
|
}
|