Prechádzať zdrojové kódy

New oref0 variable, Threshold setting. Needs a change in index.js also.

(cherry picked from commit c03068802cc1175c0f249c36c723d80c4fe4f507)
Jon Mårtensson 3 rokov pred
rodič
commit
bd8cf3641b

+ 2 - 0
FreeAPS/Sources/Models/Preferences.swift

@@ -71,6 +71,7 @@ struct Preferences: JSON {
     var tddAdjBasal: Bool = false
     var tddAdjBasal: Bool = false
     var enableSMB_high_bg: Bool = false
     var enableSMB_high_bg: Bool = false
     var enableSMB_high_bg_target: Decimal = 110
     var enableSMB_high_bg_target: Decimal = 110
+    var threshold_setting: Decimal = 65
 }
 }
 
 
 extension Preferences {
 extension Preferences {
@@ -144,6 +145,7 @@ extension Preferences {
         case tddAdjBasal
         case tddAdjBasal
         case enableSMB_high_bg
         case enableSMB_high_bg
         case enableSMB_high_bg_target
         case enableSMB_high_bg_target
+        case threshold_setting
     }
     }
 }
 }
 
 

+ 9 - 0
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift

@@ -145,6 +145,15 @@ extension PreferencesEditor {
                         comment: "Enable adjustment of basal based on the ratio of 24 h : 7 day average TDD"
                         comment: "Enable adjustment of basal based on the ratio of 24 h : 7 day average TDD"
                     ),
                     ),
                     settable: self
                     settable: self
+                ),
+                Field(
+                    displayName: "Threshold Setting",
+                    type: .decimal(keypath: \.threshold_setting),
+                    infoText: NSLocalizedString(
+                        "The default threshold in FAX depends on your current minimum BG target. If your minimum BG target = 90 mg/dl -> threshold of 65 mg/dl, if min_bg = 100 -> threshold of 70, if min_bg = 110 -> threshold of 75, and if min_bg = 130 -> threshold of 85. This settings allows you to change the default  to a higher threshold for a possibly safer looping with dynISF. Valid values are 65 <= Threshold Setting <= 120 for this setting. ",
+                        comment: "Threshold Setting"
+                    ),
+                    settable: self
                 )
                 )
             ]
             ]