mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-03-17 20:17:45 +01:00
Fixed maximal speed info
Display the maximum of all primary graphs, not the maximum of all graphs.
This commit is contained in:
parent
f34d6b0540
commit
8de6bbe4fb
@ -64,6 +64,7 @@ GraphItem *SpeedGraph::loadGraph(const Graph &graph, const Track &track,
|
||||
if (primary) {
|
||||
_avg.append(QPointF(track.distance(), gi->avg()));
|
||||
_mavg.append(QPointF(track.distance(), gi->mavg()));
|
||||
_max.append(QPointF(track.distance(), gi->max()));
|
||||
}
|
||||
|
||||
return gi;
|
||||
@ -117,6 +118,16 @@ qreal SpeedGraph::avg() const
|
||||
return (sum / w);
|
||||
}
|
||||
|
||||
qreal SpeedGraph::max() const
|
||||
{
|
||||
qreal mv = 0;
|
||||
|
||||
for (int i = 0; i < _max.size(); i++)
|
||||
mv = qMax(mv, _max.at(i).y());
|
||||
|
||||
return mv;
|
||||
}
|
||||
|
||||
void SpeedGraph::clear()
|
||||
{
|
||||
qDeleteAll(_tracks);
|
||||
@ -124,6 +135,7 @@ void SpeedGraph::clear()
|
||||
|
||||
_avg.clear();
|
||||
_mavg.clear();
|
||||
_max.clear();
|
||||
|
||||
GraphTab::clear();
|
||||
}
|
||||
|
@ -26,12 +26,13 @@ private:
|
||||
GraphItem *loadGraph(const Graph &graph, const Track &track,
|
||||
const QColor &color, bool primary);
|
||||
qreal avg() const;
|
||||
qreal max() const {return bounds().bottom();}
|
||||
qreal max() const;
|
||||
void setYUnits();
|
||||
void setInfo();
|
||||
|
||||
QVector<QPointF> _avg;
|
||||
QVector<QPointF> _mavg;
|
||||
QVector<QPointF> _max;
|
||||
|
||||
Units _units;
|
||||
TimeType _timeType;
|
||||
|
Loading…
x
Reference in New Issue
Block a user