Просмотр исходного кода

oref0 Master update 0.7.1
Two new variables/settings in FAX added in oref0.

Jon Mårtensson 3 лет назад
Родитель
Сommit
3dc4e59877

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


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

@@ -69,6 +69,8 @@ struct Preferences: JSON {
     var useWeightedAverage: Bool = false
     var weightPercentage: Decimal = 0.65
     var tddAdjBasal: Bool = false
+    var enableSMB_high_bg: Bool = false
+    var enableSMB_high_bg_target: Decimal = 110
 }
 
 extension Preferences {
@@ -140,6 +142,8 @@ extension Preferences {
         case useWeightedAverage
         case weightPercentage
         case tddAdjBasal
+        case enableSMB_high_bg
+        case enableSMB_high_bg_target
     }
 }
 

+ 18 - 2
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift

@@ -91,8 +91,6 @@ extension PreferencesEditor {
                 )
             ]
 
-            // MARK: - SMB fields
-
             let dynamicISF = [
                 Field(
                     displayName: "Enable Dynamic ISF",
@@ -206,6 +204,24 @@ extension PreferencesEditor {
                     settable: self
                 ),
                 Field(
+                    displayName: "Enable SMB With High BG",
+                    type: .boolean(keypath: \.enableSMB_high_bg),
+                    infoText: NSLocalizedString(
+                        "Enable SMBs when a high BG is detected, based on the high BG target (adjusted or profile)",
+                        comment: "Enable SMB With High BG"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "Enable SMB over this BG",
+                    type: .decimal(keypath: \.enableSMB_high_bg_target),
+                    infoText: NSLocalizedString(
+                        "Set the value enableSMB_high_bg will compare against to enable SMB. If BG > than this value, SMBs should enable.",
+                        comment: "Over This BG (mg/dl):"
+                    ),
+                    settable: self
+                ),
+                Field(
                     displayName: "Enable UAM",
                     type: .boolean(keypath: \.enableUAM),
                     infoText: NSLocalizedString(