mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
SrmRide: set Tags
Ride notes, slope, zero offset... were ignored during import of SRM files. This patch sets the meta tags accordingly.
This commit is contained in:
@@ -99,6 +99,7 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
|
||||
|
||||
RideFile *result = new RideFile;
|
||||
result->setDeviceType("SRM");
|
||||
result->setTag("Sport", "Bike" );
|
||||
|
||||
char magic[4];
|
||||
in.readRawData(magic, sizeof(magic));
|
||||
@@ -133,10 +134,13 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
|
||||
char comment[71];
|
||||
in.readRawData(comment, sizeof(comment) - 1);
|
||||
comment[commentlen - 1] = '\0';
|
||||
result->setTag("Notes", QString(comment) );
|
||||
|
||||
result->setRecIntSecs(((double) recint1) / recint2);
|
||||
unsigned recintms = (unsigned) round(result->recIntSecs() * 1000.0);
|
||||
|
||||
result->setTag("Wheel Circumference", QString("%1").arg(wheelcirc) );
|
||||
|
||||
QDate date(1880, 1, 1);
|
||||
date = date.addDays(dayssince1880);
|
||||
|
||||
@@ -173,6 +177,10 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
|
||||
|
||||
markers[i].note = QString( mcomment);
|
||||
|
||||
if( i == 0 ){
|
||||
result->setTag("Athlete Name", QString(mcomment) );
|
||||
}
|
||||
|
||||
(void) active;
|
||||
(void) avgwatts;
|
||||
(void) avghr;
|
||||
@@ -200,8 +208,9 @@ RideFile *SrmFileReader::openRideFile(QFile &file, QStringList &errorStrings, QL
|
||||
quint16 datacnt = readShort(in);
|
||||
readByte(in); // padding
|
||||
|
||||
(void) zero;
|
||||
(void) slope;
|
||||
result->setTag("Slope", QString("%1")
|
||||
.arg( 140.0 / 42781 * slope, 0, 'f', 2) );
|
||||
result->setTag("Zero Offset", QString("%1").arg(zero) );
|
||||
|
||||
// SRM5 files have no blocks - synthesize one
|
||||
if( blockcnt < 1 ){
|
||||
|
||||
Reference in New Issue
Block a user