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

incorporate orefs Floating Carbs and establish toggle in Prefs

output in debugging & Suggestion
filter messages
Jon B.M 4 лет назад
Родитель
Сommit
93e9d04d60

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


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


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

@@ -46,6 +46,7 @@ struct Preferences: JSON {
     var noisyCGMTargetMultiplier: Decimal = 1.3
     var suspendZerosIOB: Bool = true
     var timestamp: Date?
+    var floatingcarbs: Bool = false
 }
 
 extension Preferences {
@@ -94,6 +95,7 @@ extension Preferences {
         case carbsReqThreshold
         case noisyCGMTargetMultiplier
         case suspendZerosIOB = "suspend_zeros_iob"
+        case floatingcarbs = "floating_carbs"
     }
 }
 

+ 13 - 13
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift

@@ -376,7 +376,16 @@ extension PreferencesEditor {
                 )
             ]
 
-            let autoisfSettings = [
+            let xpmSettings = [
+                Field(
+                    displayName: "Enable Floating Carbs",
+                    type: .boolean(keypath: \.floatingcarbs),
+                    infoText: NSLocalizedString(
+                        "Defaults to false. If true, then dose slightly more aggressively by using all entered carbs for calculating COBpredBGs. This avoids backing off too quickly as COB decays. Even with this option, oref0 still switches gradually from using COBpredBGs to UAMpredBGs proportionally to how many carbs are left as COB. Summary: use all entered carbs in the future for predBGs & don't decay them as COB, only once they are actual.",
+                        comment: "Floating Carbs"
+                    ),
+                    settable: self
+                ),
                 Field(
                     displayName: "Enable AutoISF",
                     type: .boolean(keypath: \.autoisf),
@@ -408,19 +417,10 @@ extension PreferencesEditor {
                     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.",
+                        "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(
-                        "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
                 )
             ]
 
@@ -440,8 +440,8 @@ extension PreferencesEditor {
                     fields: otherSettings
                 ),
                 FieldSection(
-                    displayName: NSLocalizedString("Auto-ISF settings", comment: "Auto-ISF settings"),
-                    fields: autoisfSettings
+                    displayName: NSLocalizedString("XPM settings", comment: "Experimental stuff settings"),
+                    fields: xpmSettings
                 )
             ]
         }