Sfoglia il codice sorgente

Fix pump-history/TDD bug. ADD SMB DeliveryRatio to SMB settings

Jon Mårtensson 4 anni fa
parent
commit
a77e73f1e8

File diff suppressed because it is too large
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


+ 1 - 2
FreeAPS/Sources/APS/APSManager.swift

@@ -626,8 +626,7 @@ final class BaseAPSManager: APSManager, Injectable {
                 storage.save(averages, as: OpenAPS.Monitor.tdd_averages)
                 storage.save(averages, as: OpenAPS.Monitor.tdd_averages)
                 storage.save(Array(uniqEvents), as: file)
                 storage.save(Array(uniqEvents), as: file)
             }
             }
-            
-            
+
             debug(.apsManager, "Suggestion enacted. Received: \(received)")
             debug(.apsManager, "Suggestion enacted. Received: \(received)")
             DispatchQueue.main.async {
             DispatchQueue.main.async {
                 self.broadcaster.notify(EnactedSuggestionObserver.self, on: .main) {
                 self.broadcaster.notify(EnactedSuggestionObserver.self, on: .main) {

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

@@ -222,6 +222,15 @@ extension PreferencesEditor {
                     settable: self
                     settable: self
                 ),
                 ),
                 Field(
                 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
+                ),
+                Field(
                     displayName: "SMB Interval",
                     displayName: "SMB Interval",
                     type: .decimal(keypath: \.smbInterval),
                     type: .decimal(keypath: \.smbInterval),
                     infoText: NSLocalizedString("Minimum duration in minutes between two enacted SMBs", comment: "SMB Interval"),
                     infoText: NSLocalizedString("Minimum duration in minutes between two enacted SMBs", comment: "SMB Interval"),
@@ -504,15 +513,6 @@ extension PreferencesEditor {
                     settable: self
                     settable: self
                 ),
                 ),
                 Field(
                 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
-                ),
-                Field(
                     displayName: "SMB DeliveryRatio BG Range",
                     displayName: "SMB DeliveryRatio BG Range",
                     type: .decimal(keypath: \.smbDeliveryRatioBGrange),
                     type: .decimal(keypath: \.smbDeliveryRatioBGrange),
                     infoText: NSLocalizedString(
                     infoText: NSLocalizedString(