Parcourir la source

max Delta-BG Treshold for SMB introduced in prefs

previously hardcoded to 20% and no option to change
Jon B.M il y a 4 ans
Parent
commit
0ed1fce391

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
FreeAPS/Resources/javascript/bundle/profile.js


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

@@ -61,6 +61,7 @@ struct Preferences: JSON {
     var bgAccelISFweight: Decimal = 0
     var bgBrakeISFweight: Decimal = 0
     var enableBGacceleration: Bool = false
+    var maxDeltaBGthreshold: Decimal = 0.2
 }
 
 extension Preferences {
@@ -124,6 +125,7 @@ extension Preferences {
         case bgAccelISFweight = "bgAccel_ISF_weight"
         case bgBrakeISFweight = "bgBrake_ISF_weight"
         case enableBGacceleration = "enable_BG_acceleration"
+        case maxDeltaBGthreshold = "maxDelta_bg_threshold"
     }
 }
 

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

@@ -102,6 +102,15 @@ extension PreferencesEditor {
                     settable: self
                 ),
                 Field(
+                    displayName: "Max Delta-BG Threshold SMB",
+                    type: .decimal(keypath: \.maxDeltaBGthreshold),
+                    infoText: NSLocalizedString(
+                        "Defaults to 0.2 (20%). Maximum positiv %change of BG level to use SMB, above that will disable SMB. Hardcoded cap of 40%. For UAM fully-closed-loop 30% is advisable. Observe in log and popup (maxDelta 27 > 20% of BG 100 - disabling SMB!).",
+                        comment: "Max Delta-BG Threshold"
+                    ),
+                    settable: self
+                ),
+                Field(
                     displayName: "Enable SMB With COB",
                     type: .boolean(keypath: \.enableSMBWithCOB),
                     infoText: NSLocalizedString(