Sfoglia il codice sorgente

Merge branch 'dev' into unit_tests_ci

Deniz Cengiz 11 mesi fa
parent
commit
01c10a0487
27 ha cambiato i file con 139 aggiunte e 53 eliminazioni
  1. 1 1
      Config.xcconfig
  2. 20 0
      Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/Contents.json
  3. BIN
      Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/trioCircledNoBackground watch.png
  4. BIN
      Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/trioCircledNoBackground.png
  5. BIN
      Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.imageset/ComplicationIcon.png
  6. 0 12
      Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.imageset/Contents.json
  7. 1 1
      Trio/Resources/javascript/bundle/autosens.js
  8. 1 1
      Trio/Resources/javascript/bundle/autotune-core.js
  9. 1 1
      Trio/Resources/javascript/bundle/autotune-prep.js
  10. 1 1
      Trio/Resources/javascript/bundle/basal-set-temp.js
  11. 1 1
      Trio/Resources/javascript/bundle/determine-basal.js
  12. 1 1
      Trio/Resources/javascript/bundle/glucose-get-last.js
  13. 1 1
      Trio/Resources/javascript/bundle/iob.js
  14. 1 1
      Trio/Resources/javascript/bundle/meal.js
  15. 1 1
      Trio/Resources/javascript/bundle/profile.js
  16. 2 2
      Trio/Resources/javascript/prepare/autosens.js
  17. 1 1
      Trio/Resources/javascript/prepare/autotune-core.js
  18. 1 1
      Trio/Resources/javascript/prepare/autotune-prep.js
  19. 2 2
      Trio/Resources/javascript/prepare/determine-basal.js
  20. 1 1
      Trio/Resources/javascript/prepare/iob.js
  21. 1 1
      Trio/Resources/javascript/prepare/meal.js
  22. 6 6
      Trio/Resources/javascript/prepare/profile.js
  23. 42 0
      Trio/Sources/Localizations/Main/Localizable.xcstrings
  24. 25 7
      Trio/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift
  25. 25 8
      Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift
  26. 0 1
      Trio/Sources/Modules/Settings/SettingItems.swift
  27. 3 1
      oref0_source_version.txt

+ 1 - 1
Config.xcconfig

@@ -19,7 +19,7 @@ TRIO_APP_GROUP_ID = group.org.nightscout.$(DEVELOPMENT_TEAM).trio.trio-app-group
 
 // The developers set the version numbers, please leave them alone
 APP_VERSION = 0.5.0
-APP_DEV_VERSION = 0.5.0.38
+APP_DEV_VERSION = 0.5.0.41
 APP_BUILD_NUMBER = 1
 COPYRIGHT_NOTICE =
 

+ 20 - 0
Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/Contents.json

@@ -0,0 +1,20 @@
+{
+  "images" : [
+    {
+      "filename" : "trioCircledNoBackground.png",
+      "idiom" : "universal",
+      "platform" : "ios",
+      "size" : "1024x1024"
+    },
+    {
+      "filename" : "trioCircledNoBackground watch.png",
+      "idiom" : "universal",
+      "platform" : "watchos",
+      "size" : "1024x1024"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/trioCircledNoBackground watch.png


BIN
Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.appiconset/trioCircledNoBackground.png


BIN
Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.imageset/ComplicationIcon.png


+ 0 - 12
Trio/Resources/Assets.xcassets/app_icons/trioCircledNoBackground.imageset/Contents.json

@@ -1,12 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "ComplicationIcon.png",
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/autosens.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/autotune-core.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/autotune-prep.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/basal-set-temp.js


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


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/glucose-get-last.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/iob.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/meal.js


File diff suppressed because it is too large
+ 1 - 1
Trio/Resources/javascript/bundle/profile.js


+ 2 - 2
Trio/Resources/javascript/prepare/autosens.js

@@ -18,9 +18,9 @@ function generate(glucose_data, pumphistory_data, basalprofile, profile_data, ca
         temptargets: temptarget_data
     };
     detection_inputs.deviations = 96;
-    var ratio8h = freeaps_autosens(detection_inputs);
+    var ratio8h = trio_autosens(detection_inputs);
     detection_inputs.deviations = 288;
-    var ratio24h = freeaps_autosens(detection_inputs);
+    var ratio24h = trio_autosens(detection_inputs);
     var lowestRatio = ratio8h.ratio < ratio24h.ratio ? ratio8h : ratio24h;
     return lowestRatio;
 }

+ 1 - 1
Trio/Resources/javascript/prepare/autotune-core.js

@@ -13,5 +13,5 @@ function generate(prepped_glucose_data,previous_autotune_data,pumpprofile_data)
       , pumpProfile: pumpprofile_data
     };
 
-    return freeaps_autotuneCore(inputs);
+    return trio_autotuneCore(inputs);
 }

+ 1 - 1
Trio/Resources/javascript/prepare/autotune-prep.js

@@ -43,5 +43,5 @@ function generate(pumphistory_data, profile_data, glucose_data, pumpprofile_data
     , tune_insulin_curve: tune_insulin_curve
     };
 
-    return freeaps_autotunePrep(inputs);
+    return trio_autotunePrep(inputs);
 }

+ 2 - 2
Trio/Resources/javascript/prepare/determine-basal.js

@@ -13,7 +13,7 @@ function generate(iob, currenttemp, glucose, profile, autosens = null, meal = nu
         console.log("Invalid middleware: " + error);
     };
 
-    var glucose_status = freeaps_glucoseGetLast(glucose);
+    var glucose_status = trio_glucoseGetLast(glucose);
     var autosens_data = null;
 
     if (autosens) {
@@ -45,5 +45,5 @@ function generate(iob, currenttemp, glucose, profile, autosens = null, meal = nu
         trio_custom_oref_variables_temp = trio_custom_oref_variables;
     }
     
-    return freeaps_determineBasal(glucose_status, currenttemp, iob, profile, autosens_data, meal_data, freeaps_basalSetTemp, microbolusAllowed, reservoir_data, clock, pumphistory, preferences, basalprofile, trio_custom_oref_variables_temp, middleware_was_used);
+    return trio_determineBasal(glucose_status, currenttemp, iob, profile, autosens_data, meal_data, trio_basalSetTemp, microbolusAllowed, reservoir_data, clock, pumphistory, preferences, basalprofile, trio_custom_oref_variables_temp, middleware_was_used);
 }

+ 1 - 1
Trio/Resources/javascript/prepare/iob.js

@@ -11,5 +11,5 @@ function generate(pumphistory_data, profile_data, clock_data, autosens_data = nu
       if (autosens_data) {
         inputs.autosens = autosens_data;
       }
-      return freeaps_iob(inputs);
+      return trio_iob(inputs);
 }

+ 1 - 1
Trio/Resources/javascript/prepare/meal.js

@@ -23,7 +23,7 @@ function generate(pumphistory_data, profile_data, clock_data, glucose_data, basa
     , glucose: glucose_data
     };
 
-    var recentCarbs = freeaps_meal(inputs);
+    var recentCarbs = trio_meal(inputs);
 
     if (glucose_data.length < 4) {
         console.error("Not enough glucose data to calculate carb absorption; found:", glucose_data.length);

+ 6 - 6
Trio/Resources/javascript/prepare/profile.js

@@ -1,7 +1,7 @@
 //для pumpprofile.json параметры: settings/settings.json settings/bg_targets.json settings/insulin_sensitivities.json settings/basal_profile.json preferences.json settings/carb_ratios.json settings/temptargets.json settings/model.json
 //для profile.json параметры: settings/settings.json settings/bg_targets.json settings/insulin_sensitivities.json settings/basal_profile.json preferences.json settings/carb_ratios.json settings/temptargets.json settings/model.json settings/autotune.json
 
-function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data, preferences_input = false, carbratio_input = false, temptargets_input = false, model_input = false, autotune_input = false, freeaps_data) {
+function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data, preferences_input = false, carbratio_input = false, temptargets_input = false, model_input = false, autotune_input = false, trio_data) {
     if (bgtargets_data.units !== 'mg/dL') {
         if (bgtargets_data.units === 'mmol/L') {
             for (var i = 0, len = bgtargets_data.targets.length; i < len; i++) {
@@ -35,9 +35,9 @@ function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data
         temptargets_data = temptargets_input;
     }
     
-    var freeaps = { };
-    if (freeaps_data) {
-        freeaps = freeaps_data;
+    var trioData = { };
+    if (trio_data) {
+        trioData = trio_data;
     }
 
     var model_data = { };
@@ -98,10 +98,10 @@ function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data
 
     if (autotune_data) {
         if (autotune_data.basalprofile) { inputs.basals = autotune_data.basalprofile; }
-        if (!freeaps.onlyAutotuneBasals) {
+        if (!trioData.onlyAutotuneBasals) {
             if (autotune_data.isfProfile) { inputs.isf = autotune_data.isfProfile; }
             if (autotune_data.carb_ratio) { inputs.carbratio.schedule[0].ratio = autotune_data.carb_ratio; }
         }
     }
-    return freeaps_profile(inputs);
+    return trio_profile(inputs);
 }

+ 42 - 0
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -897,6 +897,12 @@
         }
       }
     },
+    "  ◦ A TBR higher than your scheduled rate will increase IOB" : {
+
+    },
+    "  ◦ A TBR lower than your scheduled rate will decrease IOB" : {
+
+    },
     " -  Manual Basal ⚠️" : {
       "comment" : "Current Manual Temp basal",
       "extractionState" : "manual",
@@ -10104,6 +10110,9 @@
         }
       }
     },
+    "• Boluses (including SMBs)" : {
+
+    },
     "• Carb Ratio" : {
       "localizations" : {
         "bg" : {
@@ -13708,6 +13717,12 @@
         }
       }
     },
+    "• Manual boluses you enter yoursef" : {
+
+    },
+    "• Manual temporary basal rates you set yourself" : {
+
+    },
     "• Maximum Duration" : {
       "localizations" : {
         "bg" : {
@@ -15192,6 +15207,9 @@
         }
       }
     },
+    "• Temporary Basal Rates (TBRs)" : {
+
+    },
     "• xDrip4iOS" : {
       "localizations" : {
         "bg" : {
@@ -58215,6 +58233,9 @@
         }
       }
     },
+    "Choose a value that covers your highest insulin needs — think about a correction for a very high glucose reading plus your biggest meal bolus. This gives Trio room to work while keeping you safe." : {
+
+    },
     "Choose Calendar" : {
       "localizations" : {
         "bg" : {
@@ -113912,6 +113933,7 @@
       }
     },
     "If a calculated amount exceeds this limit, the suggested and / or delivered amount will be reduced so that active insulin on board (IOB) will not exceed this safety limit." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -114229,6 +114251,9 @@
         }
       }
     },
+    "If delivering more insulin would push your IOB above this limit, Trio will reduce or skip the dose to stay within the safety boundary. This applies to SMBs, TBRs, and the recommendation from the bolus calculator." : {
+
+    },
     "If Half Basal Exercise Target is %@ %@, a Temp Target of %@ %@ uses an Autosens Ratio of 1.09. A Temp Target of %@ %@ uses an Autosens Ratio of 1.33." : {
       "localizations" : {
         "bg" : {
@@ -136582,6 +136607,9 @@
         }
       }
     },
+    "Max IOB sets a safety limit on how much insulin Trio can automatically deliver above your scheduled basal rates. This prevents the system from giving too much insulin at once." : {
+
+    },
     "Max Meal Absorption Time" : {
       "localizations" : {
         "bg" : {
@@ -152131,7 +152159,11 @@
         }
       }
     },
+    "Note: This setting must be greater than 0 for any automatic insulin dosing by Trio (unless you currently have negative IOB)." : {
+
+    },
     "Note: This setting must be greater than 0 for any automatic insulin dosing by Trio." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -152344,6 +152376,7 @@
       }
     },
     "Note: You can still manually bolus above this limit, but the suggested bolus amount will never exceed this in the bolus calculator." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -209549,6 +209582,7 @@
       }
     },
     "This is the maximum amount of Insulin On Board (IOB) above profile basal rates from all sources - positive temporary basal rates, manual or meal boluses, and SMBs - that Trio is allowed to accumulate to address an above target glucose." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -211897,6 +211931,7 @@
       }
     },
     "This setting helps prevent delivering too much insulin at once. It’s typically a value close to the amount you might need for a very high blood sugar and the biggest meal of your life combined." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -218772,6 +218807,9 @@
         }
       }
     },
+    "Trio calculates your current Insulin On Board (IOB) from:" : {
+
+    },
     "Trio can automatically adapt insulin delivery based on inputs and glucose forecasts. Your algorithm settings play a major part in accurate and effective dosing." : {
       "localizations" : {
         "bg" : {
@@ -232079,6 +232117,7 @@
       }
     },
     "Warning: This must be greater than 0 for any automatic temporary basal rates or SMBs to be given." : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -233804,6 +233843,9 @@
         }
       }
     },
+    "What's NOT limited:" : {
+
+    },
     "When \"Reduced Bolus\" is selected in the bolus calculator, the recommended bolus will be multiplied by the \"Reduced Bolus Percentage\" as well as the \"Recommended Bolus Percentage\"." : {
       "localizations" : {
         "bg" : {

+ 25 - 7
Trio/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift

@@ -46,22 +46,40 @@ extension UnitsLimitsSettings {
                     verboseHint:
                     VStack(alignment: .leading, spacing: 10) {
                         Text("Default: 0 units").bold()
+
                         Text(
-                            "Warning: This must be greater than 0 for any automatic temporary basal rates or SMBs to be given."
-                        ).bold()
-                        Text(
-                            "This setting helps prevent delivering too much insulin at once. It’s typically a value close to the amount you might need for a very high blood sugar and the biggest meal of your life combined."
+                            "Note: This setting must be greater than 0 for any automatic insulin dosing by Trio (unless you currently have negative IOB)."
                         )
+                        .bold()
+                        .foregroundStyle(Color.orange)
+
                         Text(
-                            "This is the maximum amount of Insulin On Board (IOB) above profile basal rates from all sources - positive temporary basal rates, manual or meal boluses, and SMBs - that Trio is allowed to accumulate to address an above target glucose."
+                            "Choose a value that covers your highest insulin needs — think about a correction for a very high glucose reading plus your biggest meal bolus. This gives Trio room to work while keeping you safe."
                         )
+
                         Text(
-                            "If a calculated amount exceeds this limit, the suggested and / or delivered amount will be reduced so that active insulin on board (IOB) will not exceed this safety limit."
+                            "Max IOB sets a safety limit on how much insulin Trio can automatically deliver above your scheduled basal rates. This prevents the system from giving too much insulin at once."
                         )
+
+                        VStack(alignment: .leading, spacing: 0) {
+                            Text("Trio calculates your current Insulin On Board (IOB) from:")
+                            Text("• Boluses (including SMBs)")
+                            Text("• Temporary Basal Rates (TBRs)")
+                            Text("  ◦ A TBR higher than your scheduled rate will increase IOB")
+                            Text("  ◦ A TBR lower than your scheduled rate will decrease IOB")
+                        }
+
                         Text(
-                            "Note: You can still manually bolus above this limit, but the suggested bolus amount will never exceed this in the bolus calculator."
+                            "If delivering more insulin would push your IOB above this limit, Trio will reduce or skip the dose to stay within the safety boundary. This applies to SMBs, TBRs, and the recommendation from the bolus calculator."
                         )
+
+                        VStack(alignment: .leading, spacing: 0) {
+                            Text("What's NOT limited:")
+                            Text("• Manual boluses you enter yoursef")
+                            Text("• Manual temporary basal rates you set yourself")
+                        }
                     }
+                    .fixedSize(horizontal: false, vertical: true)
                 )
 
                 SettingInputSection(

+ 25 - 8
Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift

@@ -386,25 +386,42 @@ enum DeliveryLimitSubstep: Int, CaseIterable, Identifiable {
     func description(units: GlucoseUnits) -> any View {
         switch self {
         case .maxIOB:
-            return VStack(alignment: .leading, spacing: 8) {
-                Text(
-                    "Note: This setting must be greater than 0 for any automatic insulin dosing by Trio."
-                ).bold().foregroundStyle(Color.orange)
+            return VStack(alignment: .leading, spacing: 10) {
+                Text("Default: 0 units").bold()
 
                 Text(
-                    "This setting helps prevent delivering too much insulin at once. It’s typically a value close to the amount you might need for a very high blood sugar and the biggest meal of your life combined."
+                    "Note: This setting must be greater than 0 for any automatic insulin dosing by Trio (unless you currently have negative IOB)."
                 )
+                .bold()
+                .foregroundStyle(Color.orange)
 
                 Text(
-                    "This is the maximum amount of Insulin On Board (IOB) above profile basal rates from all sources - positive temporary basal rates, manual or meal boluses, and SMBs - that Trio is allowed to accumulate to address an above target glucose."
+                    "Choose a value that covers your highest insulin needs — think about a correction for a very high glucose reading plus your biggest meal bolus. This gives Trio room to work while keeping you safe."
                 )
+
                 Text(
-                    "If a calculated amount exceeds this limit, the suggested and / or delivered amount will be reduced so that active insulin on board (IOB) will not exceed this safety limit."
+                    "Max IOB sets a safety limit on how much insulin Trio can automatically deliver above your scheduled basal rates. This prevents the system from giving too much insulin at once."
                 )
+
+                VStack(alignment: .leading, spacing: 0) {
+                    Text("Trio calculates your current Insulin On Board (IOB) from:")
+                    Text("• Boluses (including SMBs)")
+                    Text("• Temporary Basal Rates (TBRs)")
+                    Text("  ◦ A TBR higher than your scheduled rate will increase IOB")
+                    Text("  ◦ A TBR lower than your scheduled rate will decrease IOB")
+                }
+
                 Text(
-                    "Note: You can still manually bolus above this limit, but the suggested bolus amount will never exceed this in the bolus calculator."
+                    "If delivering more insulin would push your IOB above this limit, Trio will reduce or skip the dose to stay within the safety boundary. This applies to SMBs, TBRs, and the recommendation from the bolus calculator."
                 )
+
+                VStack(alignment: .leading, spacing: 0) {
+                    Text("What's NOT limited:")
+                    Text("• Manual boluses you enter yoursef")
+                    Text("• Manual temporary basal rates you set yourself")
+                }
             }
+            .fixedSize(horizontal: false, vertical: true)
         case .maxBolus:
             return VStack(alignment: .leading, spacing: 8) {
                 Text(

+ 0 - 1
Trio/Sources/Modules/Settings/SettingItems.swift

@@ -161,7 +161,6 @@ enum SettingItems {
                 "Insulin Peak Time",
                 "Skip Neutral Temps",
                 "Unsuspend If No Temp",
-                "Suspend Zeros IOB",
                 "SMB Delivery Ratio",
                 "SMB Interval",
                 "Min 5m Carbimpact",

+ 3 - 1
oref0_source_version.txt

@@ -1,6 +1,8 @@
-oref0 branch: dev - git version: c0b46d3
+oref0 branch: dev - git version: 37896e5
 
 Last commits:
+37896e5 Merge pull request #48 from nightscout/fix-bundle-naming
+f21a187 Rename output library to trio_[name]
 c0b46d3 Merge pull request #47 from nightscout/fix-400-guard
 1591b14 Remove leftover != 400 condition
 4204b12 Remove autoISF adjustments from glucose-get-last