1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 11:39:16 +02:00

Add only valid graph segments to the graphs

Fixes #489
This commit is contained in:
2023-04-10 13:06:19 +02:00
parent 52ea52ff4e
commit 1bbc57173e
11 changed files with 59 additions and 66 deletions

View File

@ -47,7 +47,7 @@ QList<GraphItem*> CadenceGraph::loadData(const Data &data)
const Track &track = data.tracks().at(i);
const Graph &graph = track.cadence();
if (!graph.isValid()) {
if (graph.isEmpty()) {
_palette.nextColor();
graphs.append(0);
} else {

View File

@ -85,7 +85,7 @@ void ElevationGraph::setInfo()
GraphItem *ElevationGraph::loadGraph(const Graph &graph, PathType type,
const QColor &color, bool primary)
{
if (!graph.isValid())
if (graph.isEmpty())
return 0;
ElevationGraphItem *gi = new ElevationGraphItem(graph, _graphType, _width,

View File

@ -50,7 +50,7 @@ QList<GraphItem*> GearRatioGraph::loadData(const Data &data)
for (int i = 0; i < data.tracks().count(); i++) {
const Graph &graph = data.tracks().at(i).ratio();
if (!graph.isValid()) {
if (graph.isEmpty()) {
_palette.nextColor();
graphs.append(0);
} else {

View File

@ -8,8 +8,6 @@ GraphItem::GraphItem(const Graph &graph, GraphType type, int width,
const QColor &color, Qt::PenStyle style, QGraphicsItem *parent)
: GraphicsItem(parent), _graph(graph), _type(type), _secondaryGraph(0)
{
Q_ASSERT(_graph.isValid());
_units = Metric;
_sx = 0; _sy = 0;
_color = color;

View File

@ -47,7 +47,7 @@ QList<GraphItem*> HeartRateGraph::loadData(const Data &data)
const Track &track = data.tracks().at(i);
const Graph &graph = track.heartRate();
if (!graph.isValid()) {
if (graph.isEmpty()) {
_palette.nextColor();
graphs.append(0);
} else {

View File

@ -47,7 +47,7 @@ QList<GraphItem*> PowerGraph::loadData(const Data &data)
const Track &track = data.tracks().at(i);
const Graph &graph = track.power();
if (!graph.isValid()) {
if (graph.isEmpty()) {
_palette.nextColor();
graphs.append(0);
} else {

View File

@ -50,7 +50,7 @@ void SpeedGraph::setInfo()
GraphItem *SpeedGraph::loadGraph(const Graph &graph, const Track &track,
const QColor &color, bool primary)
{
if (!graph.isValid())
if (graph.isEmpty())
return 0;
SpeedGraphItem *gi = new SpeedGraphItem(graph, _graphType, _width,

View File

@ -51,7 +51,7 @@ QList<GraphItem*> TemperatureGraph::loadData(const Data &data)
const Track &track = data.tracks().at(i);
const Graph &graph = track.temperature();
if (!graph.isValid()) {
if (graph.isEmpty()) {
_palette.nextColor();
graphs.append(0);
} else {