Quellcode durchsuchen

initial autoISF2.1 v14

Robert vor 4 Jahren
Ursprung
Commit
5759c4017f

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
FreeAPS/Resources/javascript/bundle/profile.js


+ 21 - 1
FreeAPS/Sources/Models/Preferences.swift

@@ -47,6 +47,16 @@ struct Preferences: JSON {
     var suspendZerosIOB: Bool = true
     var timestamp: Date?
     var floatingcarbs: Bool = false
+    var smbDeliveryRatioBGrange: Decimal = 0
+    var smbDeliveryRatioMin: Decimal = 0.5
+    var smbDeliveryRatioMax: Decimal = 0.75
+    var enableautoISFwithCOB: Bool = false
+    var higherISFrangeWeight: Decimal = 0
+    var lowerISFrangeWeight: Decimal = 0
+    var deltaISFrangeWeight: Decimal = 0
+    var postMealISFweight: Decimal = 0
+    var postMealISFduration: Decimal = 3
+    var postMealISFalways: Bool = false
 }
 
 extension Preferences {
@@ -56,7 +66,7 @@ extension Preferences {
         case currentBasalSafetyMultiplier = "current_basal_safety_multiplier"
         case autosensMax = "autosens_max"
         case autosensMin = "autosens_min"
-        case autoisf = "auto_isf"
+        case autoisf = "use_autoisf"
         case autoISFhourlyChange = "autoisf_hourlychange"
         case autoISFmax = "autoisf_max"
         case smbDeliveryRatio = "smb_delivery_ratio"
@@ -96,6 +106,16 @@ extension Preferences {
         case noisyCGMTargetMultiplier
         case suspendZerosIOB = "suspend_zeros_iob"
         case floatingcarbs = "floating_carbs"
+        case smbDeliveryRatioBGrange = "smb_delivery_ratio_bg_range"
+        case smbDeliveryRatioMin = "smb_delivery_ratio_min"
+        case smbDeliveryRatioMax = "smb_delivery_ratio_max"
+        case enableautoISFwithCOB = "enableautoisf_with_COB"
+        case higherISFrangeWeight = "higher_ISFrange_weight"
+        case lowerISFrangeWeight = "lower_ISFrange_weight"
+        case deltaISFrangeWeight = "delta_ISFrange_weight"
+        case postMealISFweight = "postmeal_ISF_weight"
+        case postMealISFduration = "postmeal_ISF_duration"
+        case postMealISFalways = "enableppisf_always"
     }
 }
 

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

@@ -421,6 +421,96 @@ extension PreferencesEditor {
                         comment: "SMB DeliveryRatio"
                     ),
                     settable: self
+                ),
+                Field(
+                    displayName: "SMB DeliveryRatio BG Range",
+                    type: .decimal(keypath: \.smbDeliveryRatioBGrange),
+                    infoText: NSLocalizedString(
+                        "Default value: 0, Sensible is bteween 40 and 120. The linearly increasing SMB delivery ratio is mapped to the glucose range [target_bg, target_bg+bg_range]. At target_bg the SMB ratio is smb_delivery_ratio_min, at target_bg+bg_range it is smb_delivery_ratio_max. With 0 the linearly increasing SMB ratio is disabled and the fix smb_delivery_ratio is used.",
+                        comment: "SMB DeliveryRatio BG Range"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "SMB DeliveryRatio BG Minimum",
+                    type: .decimal(keypath: \.smbDeliveryRatioMin),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.5 This is the lower end of a linearly increasing SMB Delivery Ratio rather than the fix value above in SMB DeliveryRatio.",
+                        comment: "SMB DeliveryRatio Minimum"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "SMB DeliveryRatio BG Maximum",
+                    type: .decimal(keypath: \.smbDeliveryRatioMax),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.5 This is the higher end of a linearly increasing SMB Delivery Ratio rather than the fix value above in SMB DeliveryRatio.",
+                        comment: "SMB DeliveryRatio Minimum"
+                    ),
+                    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: "ISF weight for higher BG's",
+                    type: .decimal(keypath: \.higherISFrangeWeight),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.0 This is the weight applied to the polygon which adapts ISF if glucose is above target. With 0.0 the effect is effectively disabled.",
+                        comment: "ISF high BG weight"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "ISF weight for lower BG's",
+                    type: .decimal(keypath: \.lowerISFrangeWeight),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.0 This is the weight applied to the polygon which adapts ISF if glucose is below target. With 0.0 the effect is effectively disabled.",
+                        comment: "ISF low BG weight"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "ISF weight for higher BG deltas",
+                    type: .decimal(keypath: \.deltaISFrangeWeight),
+                    infoText: NSLocalizedString(
+                        "Default value: 0.0 This is the weight applied to the polygon which adapts ISF higher deltas. With 0.0 the effect is effectively disabled.",
+                        comment: "ISF higher delta BG weight"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "Enable always postprandial ISF adaption",
+                    type: .boolean(keypath: \.postMealISFalways),
+                    infoText: NSLocalizedString(
+                        "Enable the postprandial ISF adaptation all the time regardless of when the last meal was taken.",
+                        comment: "Enable postprandial ISF always"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "ISF weight for postprandial BG rise",
+                    type: .decimal(keypath: \.postMealISFweight),
+                    infoText: NSLocalizedString(
+                        "Default value: 0 This is the weight applied to the linear slope while glucose rises and  which adapts ISF. With 0 this contribution is effectively disabled.",
+                        comment: "ISF postprandial weight"
+                    ),
+                    settable: self
+                ),
+                Field(
+                    displayName: "Duration ISF postprandial adaption",
+                    type: .decimal(keypath: \.postMealISFduration),
+                    infoText: NSLocalizedString(
+                        "Default value: 3 This is the duration in hours how long after a meal the effect will be active. Oref will delete carb timing after 10 hours latest no matter what you enter.",
+                        comment: "ISF postprandial change duration"
+                    ),
+                    settable: self
                 )
             ]