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

autoISF by Tim & gazelle via oref

autoISF SMB range extensions
autotune rounding basals to 0.05 increments
oref changes autoisf toggle
autoISF in Preferences by Jon & enhanced debugging
default values for FAX
Descriptions AutoISF
oref change SMB adjustment tied to autoISF toggle
Robert 4 лет назад
Родитель
Сommit
f5a89c67bc

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


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


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


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


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

@@ -6,6 +6,11 @@ struct Preferences: JSON {
     var currentBasalSafetyMultiplier: Decimal = 4
     var autosensMax: Decimal = 1.2
     var autosensMin: Decimal = 0.7
+    var autoisf: Bool = false
+    var autoISFhourlyChange: Decimal = 0.25
+    var autoISFmax: Decimal = 1.3
+    var smbDeliveryRatio: Decimal = 0.5
+    var smbMaxRangeExtension: Decimal = 1
     var rewindResetsAutosens: Bool = true
     var highTemptargetRaisesSensitivity: Bool = false
     var lowTemptargetLowersSensitivity: Bool = false
@@ -50,6 +55,11 @@ extension Preferences {
         case currentBasalSafetyMultiplier = "current_basal_safety_multiplier"
         case autosensMax = "autosens_max"
         case autosensMin = "autosens_min"
+        case autoisf = "auto_isf"
+        case autoISFhourlyChange = "autoisf_hourlychange"
+        case autoISFmax = "autoisf_max"
+        case smbDeliveryRatio = "smb_delivery_ratio"
+        case smbMaxRangeExtension = "smb_max_range_extension"
         case rewindResetsAutosens = "rewind_resets_autosens"
         case highTemptargetRaisesSensitivity = "high_temptarget_raises_sensitivity"
         case lowTemptargetLowersSensitivity = "low_temptarget_lowers_sensitivity"

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

@@ -376,6 +376,54 @@ extension PreferencesEditor {
                 )
             ]
 
+            let autoisfSettings = [
+                Field(
+                    displayName: "Enable AutoISF",
+                    type: .boolean(keypath: \.autoisf),
+                    infoText: NSLocalizedString(
+                        "Defaults to false. Adapt ISF when glucose is stuck at high levels, only works without COB.\n\nRead up on:\nhttps://github.com/ga-zelle/autoISF/tree/2.8.2",
+                        comment: "Enable AutoISF"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "AutoISF HourlyMaxChange",
+                    type: .decimal(keypath: \.autoISFhourlyChange),
+                    infoText: NSLocalizedString(
+                        "Defaults to false. Rate at which autoISF grows per hour assuming bg is twice target. When value = 1.0, ISF is reduced to 50% after 1 hour of BG at 2x target.",
+                        comment: "AutoISF HourlyMaxChange"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "AutoISF Max",
+                    type: .decimal(keypath: \.autoISFmax),
+                    infoText: NSLocalizedString(
+                        "Multiplier cap on how high the autoISF ratio can be and therefore how low it can adjust ISF.",
+                        comment: "AutoISF Max"
+                    ),
+                    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.",
+                        comment: "SMB Max RangeExtension"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "SMB DeliveryRatio",
+                    type: .decimal(keypath: \.smbDeliveryRatio),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.5 This is another key OpenAPS safety cap, and specifies what share of the total insulin required can be delivered as SMB. This is to prevent people from getting into dangerous territory by setting SMB requests from the caregivers phone at the same time. Increase this experimental value slowly and with caution.",
+                        comment: "SMB DeliveryRatio"
+                    ),
+                    settable: self
+                )
+            ]
+
             sections = [
                 FieldSection(
                     displayName: NSLocalizedString("OpenAPS main settings", comment: "OpenAPS main settings"), fields: mainFields
@@ -390,6 +438,10 @@ extension PreferencesEditor {
                 FieldSection(
                     displayName: NSLocalizedString("OpenAPS other settings", comment: "OpenAPS other settings"),
                     fields: otherSettings
+                ),
+                FieldSection(
+                    displayName: NSLocalizedString("Auto-ISF settings", comment: "Auto-ISF settings"),
+                    fields: autoisfSettings
                 )
             ]
         }