29
29
RideFileFactory::instance().registerReader(
30
30
"hrm", "Polar Precision", new PolarFileReader());
32
RideFile *PolarFileReader::openRideFile(QFile &file, QStringList &errors) const
32
RideFile *PolarFileReader::openRideFile(QFile &file, QStringList &errors, QList<RideFile*>*) const
35
35
* Polar HRM file format documented at www.polar.fi/files/Polar_HRM_file%20format.pdf
107
107
QString versionString = QString(line);
108
108
versionString.remove(0,8).insert(1, ".");
109
109
version = versionString.toFloat();
110
rideFile->setDeviceType("Polar HRM (v"+versionString+")");
110
rideFile->setFileFormat("Polar HRM v"+versionString+" (hrm)");
111
} else if (line.contains("Monitor=")) {
112
QString monitorString = QString(line);
113
monitorString.remove(0,8);
114
monitor = monitorString.toInt();
116
case 1: rideFile->setDeviceType("Polar Sport Tester / Vantage XL"); break;
117
case 2: rideFile->setDeviceType("Polar Vantage NV (VNV)"); break;
118
case 3: rideFile->setDeviceType("Polar Accurex Plus"); break;
119
case 4: rideFile->setDeviceType("Polar XTrainer Plus"); break;
120
case 6: rideFile->setDeviceType("Polar S520"); break;
121
case 7: rideFile->setDeviceType("Polar Coach"); break;
122
case 8: rideFile->setDeviceType("Polar S210"); break;
123
case 9: rideFile->setDeviceType("Polar S410"); break;
124
case 10: rideFile->setDeviceType("Polar S510"); break;
125
case 11: rideFile->setDeviceType("Polar S610 / S610i"); break;
126
case 12: rideFile->setDeviceType("Polar S710 / S710i"); break;
127
case 13: rideFile->setDeviceType("Polar S810 / S810i"); break;
128
case 15: rideFile->setDeviceType("Polar E600"); break;
129
case 20: rideFile->setDeviceType("Polar AXN500"); break;
130
case 21: rideFile->setDeviceType("Polar AXN700"); break;
131
case 22: rideFile->setDeviceType("Polar S625X / S725X"); break;
132
case 23: rideFile->setDeviceType("Polar S725"); break;
133
case 33: rideFile->setDeviceType("Polar CS400"); break;
134
case 34: rideFile->setDeviceType("Polar CS600X"); break;
135
case 35: rideFile->setDeviceType("Polar CS600"); break;
136
case 36: rideFile->setDeviceType("Polar RS400"); break;
137
case 37: rideFile->setDeviceType("Polar RS800"); break;
138
case 38: rideFile->setDeviceType("Polar RS800X"); break;
140
default: rideFile->setDeviceType(QString("Unknown Polar Device %1").arg(monitor));
112
142
} else if (line.contains("SMode=")) {
113
143
line.remove(0,6);
114
144
QString smode = QString(line);
123
153
if (smode.length()>3 && smode.at(4)=='1')
125
if (smode.length()>4 && smode.at(5)=='1')
126
pedaling_index = true;
155
//if (smode.length()>4 && smode.at(5)=='1') pedaling_index = true;
129
It appears that the Polar CS600 exports its data alays in metric when downloaded from the
130
polar software even when English units are displayed on the unit.. It also never sets
131
this bit low in the .hrm file. This will have to get changed if other software downloads
158
It appears that the Polar CS600 exports its data alays in metric when downloaded from the
159
polar software even when English units are displayed on the unit.. It also never sets
160
this bit low in the .hrm file. This will have to get changed if other software downloads
177
206
else if (section == "[HRData]"){
178
207
double nm=0,kph=0,watts=0,km=0,cad=0,hr=0,alt=0;
180
210
seconds += recInterval;
199
229
watts = line.section('\t', i, i).toDouble();
233
// Power LRB + PI: The value contains :
234
// - Left Right Balance (LRB) and
235
// - Pedalling Index (PI)
237
// in the following formula:
238
// value = PI * 256 + LRB PI bits 15-8 LRB bits 7-0
239
// LRB is the value of left foot
240
// for example if LRB = 45, actual balance is L45 - 55R.
241
// PI values are percentages from 0 to 100.
242
// For example value 12857 (= 40 * 256 + 47)
243
// means: PI = 40 and LRB = 47 => L47 - 53R
245
lrbalance = line.section('\t', i, i).toInt() & 0xff;
202
249
distance = distance + kph/60/60*recInterval;
216
263
alt *= METERS_PER_FOOT;
219
rideFile->appendPoint(seconds, cad, hr, km, kph, nm, watts, alt, 0.0, 0.0, 0.0, interval);
266
rideFile->appendPoint(seconds, cad, hr, km, kph, nm, watts, alt, 0.0, 0.0, 0.0, 0.0, RideFile::noTemp, lrbalance, interval);
220
267
//fprintf(stderr, " %f, %f, %f, %f, %f, %f, %f, %d\n", seconds, cad, hr, km, kph, nm, watts, alt, interval);