Further realtime improvements

A number of new features / enhancements;

* Display IF/TSS or Elevation/Grade in the controller
  when a workout is selected.

* Added buttons for forward/back which emulate the
  forward/back from a computrainer controller

* Added a slider to increase and decrease intensity/grade
  on-the-fly (during a workout), tied in with the
  computrainer controller's + and - keys.

* Unpicked the manualOverride code previously implemented

Mostly, or at least for this release, fixes #494.
This commit is contained in:
Mark Liversedge
2011-11-05 18:31:55 +00:00
parent 368aeba04d
commit da6a2dc6d4
6 changed files with 215 additions and 117 deletions

View File

@@ -19,7 +19,13 @@
#include "ErgFile.h"
ErgFile::ErgFile(QString filename, int &mode, double Cp, MainWindow *main) : main(main)
ErgFile::ErgFile(QString filename, int &mode, double Cp, MainWindow *main) :
Cp(Cp), filename(filename), main(main), mode(mode)
{
reload();
}
void ErgFile::reload()
{
QFile ergFile(filename);
int section = NOMANSLAND; // section 0=init, 1=header data, 2=course data
@@ -27,6 +33,7 @@ ErgFile::ErgFile(QString filename, int &mode, double Cp, MainWindow *main) : mai
MaxWatts = Ftp = 0;
int lapcounter = 0;
format = ERG; // either ERG or MRC
Points.clear();
// running totals for CRS file format
long rdist = 0; // running total for distance
@@ -381,7 +388,8 @@ ErgFile::calculateMetrics()
}
last = p;
}
GRADE = ELE/ELEDIST * 100;
if (ELE == 0 || ELEDIST == 0) GRADE = 0;
else GRADE = ELE/ELEDIST * 100;
} else {