Explorar o código

autoISF 2.2

based on gazelles oref adaption for AAPS
Jon B.M %!s(int64=4) %!d(string=hai) anos
pai
achega
e8edc31b6f

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/glucose-get-last.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/profile.js


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

@@ -8,8 +8,9 @@ struct Preferences: JSON {
     var autosensMin: Decimal = 0.7
     var autoisf: Bool = false
     var autoISFhourlyChange: Decimal = 0.25
-    var autoISFmax: Decimal = 1.5
-    var smbDeliveryRatio: Decimal = 0.65
+    var autoISFmax: Decimal = 1.3
+    var autoISFmin: Decimal = 1
+    var smbDeliveryRatio: Decimal = 0.5
     var smbMaxRangeExtension: Decimal = 1
     var rewindResetsAutosens: Bool = true
     var highTemptargetRaisesSensitivity: Bool = false
@@ -57,6 +58,8 @@ struct Preferences: JSON {
     var postMealISFweight: Decimal = 0
     var postMealISFduration: Decimal = 3
     var postMealISFalways: Bool = false
+    var bgAccelISFweight: Decimal = 0
+    var bgBrakeISFweight: Decimal = 0
 }
 
 extension Preferences {
@@ -69,6 +72,7 @@ extension Preferences {
         case autoisf = "use_autoisf"
         case autoISFhourlyChange = "autoisf_hourlychange"
         case autoISFmax = "autoisf_max"
+        case autoISFmin = "autoisf_min"
         case smbDeliveryRatio = "smb_delivery_ratio"
         case smbMaxRangeExtension = "smb_max_range_extension"
         case rewindResetsAutosens = "rewind_resets_autosens"
@@ -116,6 +120,8 @@ extension Preferences {
         case postMealISFweight = "postmeal_ISF_weight"
         case postMealISFduration = "postmeal_ISF_duration"
         case postMealISFalways = "enableppisf_always"
+        case bgAccelISFweight = "bgAccel_ISF_weight"
+        case bgBrakeISFweight = "bgBrake_ISF_weight"
     }
 }
 

+ 40 - 4
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift

@@ -396,6 +396,15 @@ extension PreferencesEditor {
                     settable: self
                 ),
                 Field(
+                    displayName: "Enable AutoISF with COB",
+                    type: .boolean(keypath: \.enableautoISFwithCOB),
+                    infoText: NSLocalizedString(
+                        "Enables autoISF not just for UAM, but also with COB\n\nRead up on:\nhttps://github.com/ga-zelle/autoISF/tree/2.8.2_dev_parabola",
+                        comment: "Enable autoISF with COB"
+                    ),
+                    settable: self
+                ),
+                Field(
                     displayName: "AutoISF HourlyMaxChange",
                     type: .decimal(keypath: \.autoISFhourlyChange),
                     infoText: NSLocalizedString(
@@ -414,6 +423,24 @@ extension PreferencesEditor {
                     settable: self
                 ),
                 Field(
+                    displayName: "AutoISF Min",
+                    type: .decimal(keypath: \.autoISFmin),
+                    infoText: NSLocalizedString(
+                        "This is a multiplier cap for autoISF to set a limit on how low the autoISF ratio can be, which in turn determines how high it can adjust ISF.",
+                        comment: "AutoISF Min"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "SMB Max RangeExtension",
+                    type: .decimal(keypath: \.smbMaxRangeExtension),
+                    infoText: NSLocalizedString(
+                        "Default value: 1. This is another key OpenAPS safety cap, and specifies by what factor you can exceed the regular 120 maxSMB/maxUAM minutes. Increase this experimental value slowly and with caution. Available only when autoISF is enabled.",
+                        comment: "SMB Max RangeExtension"
+                    ),
+                    settable: self
+                ),
+                Field(
                     displayName: "SMB DeliveryRatio",
                     type: .decimal(keypath: \.smbDeliveryRatio),
                     infoText: NSLocalizedString(
@@ -450,11 +477,20 @@ extension PreferencesEditor {
                     settable: self
                 ),
                 Field(
-                    displayName: "Enable AutoISF with COB",
-                    type: .boolean(keypath: \.enableautoISFwithCOB),
+                    displayName: "ISF weight while BG accelerates",
+                    type: .decimal(keypath: \.bgAccelISFweight),
                     infoText: NSLocalizedString(
-                        "Enables autoISF not just for UAM, but also with COB\n\nRead up on:\nhttps://github.com/ga-zelle/autoISF/tree/2.8.2_dev_parabola",
-                        comment: "Enable autoISF with COB"
+                        "Default value: 0. This is the weight applied while glucose accelerates and which strengthens ISF. With 0 this contribution is effectively disabled.",
+                        comment: "ISF postprandial change duration"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "ISF weight while BG decelerates",
+                    type: .decimal(keypath: \.bgBrakeISFweight),
+                    infoText: NSLocalizedString(
+                        "Default value: 0. This is the weight applied while glucose decelerates and which weakens ISF. With 0 this contribution is effectively disabled.",
+                        comment: "ISF postprandial change duration"
                     ),
                     settable: self
                 ),