Skip to content

Commit

Permalink
CPPlot: Power zone shading for watts/kg
Browse files Browse the repository at this point in the history
  • Loading branch information
grauser committed Sep 9, 2014
1 parent df81fdc commit 092c840
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CPPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,9 @@ CPPlot::plotBests()
// when we have power and the user wants it to
// be a rainbow curve. Otherwise its gonna be plain
int shadingCP = 0;
if (rideSeries == RideFile::watts && shadeMode) shadingCP = dateCP;
double shadingRatio = 1.0;
if ((rideSeries == RideFile::wattsKg || rideSeries == RideFile::watts) && shadeMode) shadingCP = dateCP;
if (rideSeries == RideFile::wattsKg && shadeMode) shadingRatio = appsettings->cvalue(context->athlete->cyclist, GC_WEIGHT).toDouble();

//For veloclinic plot we need to start by using a 2 parameters model
if (criticalSeries == CriticalPowerWindow::veloclinicplot) {
Expand Down Expand Up @@ -900,7 +902,7 @@ CPPlot::plotBests()
if (nextZone >= power_zone.size())
low = 0;
else {
while ((low > 0) && (values[low] < power_zone[nextZone]))
while ((low > 0) && (values[low] < power_zone[nextZone]/shadingRatio))
--low;
}

Expand Down

0 comments on commit 092c840

Please sign in to comment.