mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
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.
95 lines
2.5 KiB
C++
95 lines
2.5 KiB
C++
/*
|
|
* Copyright (c) 2009 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
|
|
*/
|
|
|
|
|
|
#ifndef _GC_RealtimeData_h
|
|
#define _GC_RealtimeData_h 1
|
|
#include "GoldenCheetah.h"
|
|
|
|
#include <QString>
|
|
|
|
class RealtimeData
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
// abstract to dataseries
|
|
enum dataseries { None=0, Time, LapTime, Distance, Lap,
|
|
Watts, Speed, Cadence, HeartRate, Load,
|
|
XPower, BikeScore, Joules };
|
|
|
|
typedef enum dataseries DataSeries;
|
|
double value(DataSeries) const;
|
|
static QString seriesName(DataSeries);
|
|
static const QList<DataSeries> &listDataSeries();
|
|
|
|
RealtimeData();
|
|
void reset(); // set all values to zero
|
|
|
|
void setName(char *name);
|
|
void setWatts(double watts);
|
|
void setHr(double hr);
|
|
void setTime(long time);
|
|
void setSpeed(double speed);
|
|
void setWheelRpm(double wheelRpm);
|
|
void setCadence(double aCadence);
|
|
void setLoad(double load);
|
|
void setMsecs(long);
|
|
void setLapMsecs(long);
|
|
void setDistance(double);
|
|
void setBikeScore(long);
|
|
void setJoules(long);
|
|
void setXPower(long);
|
|
void setLap(long);
|
|
|
|
const char *getName() const;
|
|
double getWatts() const;
|
|
double getHr() const;
|
|
long getTime() const;
|
|
double getSpeed() const;
|
|
double getWheelRpm() const;
|
|
double getCadence() const;
|
|
double getLoad() const;
|
|
long getMsecs() const;
|
|
long getLapMsecs() const;
|
|
double getDistance() const;
|
|
long getBikeScore() const;
|
|
long getJoules() const;
|
|
long getXPower() const;
|
|
long getLap() const;
|
|
|
|
|
|
private:
|
|
char name[64];
|
|
|
|
// realtime telemetry
|
|
double hr, watts, speed, wheelRpm, load;
|
|
double cadence; // in rpm
|
|
|
|
// derived data
|
|
double distance;
|
|
long lap;
|
|
long msecs;
|
|
long lapMsecs;
|
|
long bikeScore, joules, xPower;
|
|
};
|
|
|
|
|
|
#endif
|