Skip to content

Commit 4eea0b2

Browse files
author
Pete Schwamb
committed
Restore predicted carb-effect line on ICE and food-insight charts
The carb-effect chart on the Carb Absorption screen and the Favorite Foods insights screen lost their predicted carb-effect line in the Tidepool stateless-algorithm refactor. `dynamicGlucoseEffects(from: end, ...)` generated effects only from now+1h forward, but the chart's visible window ends at roughly now+1h — so the two ranges only touched at a single point and nothing rendered. Widen the output sampling window to `from: start` at both call sites (carb-absorption review and historical-charts data). The carb-absorption model itself is unchanged; only the sample window grows to span the chart. No dosing-path impact: the main Loop algorithm runs through LoopAlgorithm (SPM), not these UI-only helpers. Reported by @marionbarker in LoopKit/LoopWorkspace#213.
1 parent ce1935b commit 4eea0b2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Loop/Managers/LoopDataManager+CarbAbsorption.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extension LoopDataManager {
8686
)
8787

8888
let carbEffects = carbStatus.dynamicGlucoseEffects(
89-
from: end,
89+
from: start,
9090
to: end.addingTimeInterval(InsulinMath.defaultInsulinActivityDuration),
9191
carbRatios: carbRatioWithOverrides,
9292
insulinSensitivities: sensitivityWithOverrides,

Loop/Managers/LoopDataManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ extension LoopDataManager: FavoriteFoodInsightsViewModelDelegate {
15071507
)
15081508

15091509
let carbEffects = carbStatus.dynamicGlucoseEffects(
1510-
from: end,
1510+
from: start,
15111511
to: end.addingTimeInterval(InsulinMath.defaultInsulinActivityDuration),
15121512
carbRatios: carbRatioWithOverrides,
15131513
insulinSensitivities: sensitivityWithOverrides,

0 commit comments

Comments
 (0)