Files
GoldenCheetah/src/RealtimePlotWindow.cpp
Mark Liversedge fc826ecc97 Improvements for Train View
The training view has a number of improvements, most
notable of which is the workout plot now plots the
telemetry as you ride. This enables you to view
your performance against the workout as you ride.

In developing and testing this I found and fixed a
number of other minor issues;

* The workout plot didn't have any axes
* The workout plot title didn't reflect the workout selected
* The workout plot markers didn't honour preferences
* Values didn't reset on stop/start of workout
* The rolling 30 second power plot in realtime was broken
* Lap numbers were not available for display

In addition, some minor changes were made;
* Save workout is no longer optional - it always saves
* The control buttons/margins did not resize nicely
* The workout plot uses colour to distinguish between
  workouts that are time or distance based.
* A new default train layout for new users to avoid
  having to muck about with layouts
* Removed the race servers since they are not used
  and steal screen estate. Will re-introduce when
  multi-rider or internet racing is implemented.

I have also added a few workout files into the
test/workouts directory, we should think about how
we can distribute these and allow users to share and
contribute them in the future.

Fixes #493.
2011-10-24 18:09:59 +01:00

68 lines
1.9 KiB
C++

/*
* Copyright (c) 2010 Mark Liversedge (liversedge@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "RealtimePlotWindow.h"
RealtimePlotWindow::RealtimePlotWindow(MainWindow *mainWindow) :
GcWindow(mainWindow), mainWindow(mainWindow)
{
setContentsMargins(0,0,0,0);
setInstanceName("RT Plot");
setControls(NULL);
setProperty("color", GColor(CRIDEPLOTBACKGROUND));
QVBoxLayout *layout = new QVBoxLayout(this);
rtPlot = new RealtimePlot();
layout->addWidget(rtPlot);
// get updates..
connect(mainWindow, SIGNAL(telemetryUpdate(RealtimeData)), this, SLOT(telemetryUpdate(RealtimeData)));
// set to zero
telemetryUpdate(RealtimeData());
}
void
RealtimePlotWindow::start()
{
//resetValues();
}
void
RealtimePlotWindow::stop()
{
//resetValues();
}
void
RealtimePlotWindow::pause()
{
}
void
RealtimePlotWindow::telemetryUpdate(RealtimeData rtData)
{
rtPlot->pwrData.addData(rtData.value(RealtimeData::Watts));
rtPlot->pwr30Data.addData(rtData.value(RealtimeData::Watts));
rtPlot->cadData.addData(rtData.value(RealtimeData::Cadence));
rtPlot->spdData.addData(rtData.value(RealtimeData::Speed));
rtPlot->hrData.addData(rtData.value(RealtimeData::HeartRate));
rtPlot->replot(); // redraw
}