ソースを参照

Add JS rounding for COB output

Deniz Cengiz 1 ヶ月 前
コミット
f8a32fbad8

+ 1 - 1
Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DetermineBasalGenerator.swift

@@ -365,7 +365,7 @@ enum DeterminationGenerator {
             rate: nil,
             rate: nil,
             duration: nil,
             duration: nil,
             iob: iobData.first?.iob,
             iob: iobData.first?.iob,
-            cob: mealData.mealCOB,
+            cob: mealData.mealCOB.jsRounded(),
             predictions: Predictions(
             predictions: Predictions(
                 iob: forecastResult.iob.map { Int($0.jsRounded()) },
                 iob: forecastResult.iob.map { Int($0.jsRounded()) },
                 zt: forecastResult.zt.map { Int($0.jsRounded()) },
                 zt: forecastResult.zt.map { Int($0.jsRounded()) },

+ 1 - 1
Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DosingEngine.swift

@@ -166,7 +166,7 @@ enum DosingEngine {
         let lastUAMpredBG = forecast.uam?.last?.jsRounded()
         let lastUAMpredBG = forecast.uam?.last?.jsRounded()
 
 
         var reason =
         var reason =
-            "\(isfReason), COB: \(mealData.mealCOB), Dev: \(deviation.jsRounded()), BGI: \(glucoseImpact.jsRounded()), CR: \(forecast.adjustedCarbRatio.jsRounded(scale: 1)), Target: \(targetLog), minPredBG \(forecast.minForecastedGlucose.jsRounded()), minGuardBG \(forecast.minGuardGlucose.jsRounded()), IOBpredBG \(lastIOBpredBG)"
+        "\(isfReason), COB: \(mealData.mealCOB.jsRounded()), Dev: \(deviation.jsRounded()), BGI: \(glucoseImpact.jsRounded()), CR: \(forecast.adjustedCarbRatio.jsRounded(scale: 1)), Target: \(targetLog), minPredBG \(forecast.minForecastedGlucose.jsRounded()), minGuardBG \(forecast.minGuardGlucose.jsRounded()), IOBpredBG \(lastIOBpredBG)"
 
 
         if let lastCOB = lastCOBpredBG {
         if let lastCOB = lastCOBpredBG {
             reason += ", COBpredBG \(lastCOB)"
             reason += ", COBpredBG \(lastCOB)"