mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Bests offset error
.. when plotting 1s best aka Max Power, the code was using the wrong offset (out by one) and returning 0w.
This commit is contained in:
@@ -1280,7 +1280,7 @@ RideFileCache::best(Context *context, QString filename, RideFile::SeriesType ser
|
||||
}
|
||||
|
||||
// jump to correct offset
|
||||
long offset = offsetForMeanMax(head, series) + (sizeof(float) * (duration-1));
|
||||
long offset = offsetForMeanMax(head, series) + (sizeof(float) * (duration));
|
||||
inFile.skipRawData(offset);
|
||||
|
||||
float readhere = 0;
|
||||
@@ -1412,7 +1412,7 @@ RideFileCache::getAllBestsFor(Context *context, QList<MetricDetail> metrics, QDa
|
||||
// get the values and place into the summarymetric map
|
||||
long offset = offsetForMeanMax(head, workitem.series) +
|
||||
(sizeof(head)) +
|
||||
(sizeof(float) * ((workitem.duration*workitem.duration_units)-1));
|
||||
(sizeof(float) * ((workitem.duration*workitem.duration_units)));
|
||||
|
||||
cacheFile.seek(qint64(offset));
|
||||
inFile.readRawData((char*)&value, sizeof(float));
|
||||
|
||||
Reference in New Issue
Block a user