Przeglądaj źródła

Fixing rounding and using the correct value for eventualGlucose

This commit fixes a rounding issue with eventualGlucose (rounds before
converting to an Int) and makes sure that we're using the right
`eventualGlucose` value for our enableSmb function.
Sam King 8 miesięcy temu
rodzic
commit
2a68c5d968

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

@@ -291,7 +291,7 @@ enum DeterminationGenerator {
             adjustedTargetGlucose: adjustedGlucoseTargets.targetGlucose,
             adjustedSensitivity: adjustedSensitivity,
             minGuardGlucose: forecastResult.minGuardGlucose,
-            eventualGlucose: eventualGlucose,
+            eventualGlucose: forecastResult.eventualGlucose,
             threshold: threshold,
             glucoseStatus: glucoseStatus,
             trioCustomOrefVariables: trioCustomOrefVariables,
@@ -305,7 +305,7 @@ enum DeterminationGenerator {
             reason: dosingInputs.reason,
             units: nil,
             insulinReq: nil,
-            eventualBG: Int(forecastResult.eventualGlucose),
+            eventualBG: Int(forecastResult.eventualGlucose.jsRounded()),
             sensitivityRatio: sensitivityRatio, // this would only the AS-adjusted one for now
             rate: nil,
             duration: nil,