1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Added missing changes :-)

This commit is contained in:
Martin Tůma 2016-06-16 20:47:32 +02:00
parent f0c3f9b8c8
commit 1289762365
11 changed files with 231 additions and 126 deletions

View File

@ -43,7 +43,8 @@ HEADERS += src/config.h \
src/trackinfo.h \
src/exportdialog.h \
src/fileselectwidget.h \
src/margins.h
src/margins.h \
src/temperaturegraph.h
SOURCES += src/main.cpp \
src/gui.cpp \
src/gpx.cpp \
@ -73,7 +74,9 @@ SOURCES += src/main.cpp \
src/app.cpp \
src/trackinfo.cpp \
src/exportdialog.cpp \
src/fileselectwidget.cpp
src/fileselectwidget.cpp \
src/temperaturegraph.cpp \
src/trackpoint.cpp
RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts
macx {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs_CZ">
<TS version="2.0" language="cs_CZ">
<context>
<name>ElevationGraph</name>
<message>
@ -59,7 +59,7 @@
<context>
<name>ExportDialog</name>
<message>
<location filename="../src/exportdialog.cpp" line="122"/>
<location filename="../src/exportdialog.cpp" line="121"/>
<source>Export to PDF</source>
<translation>Exportovat do PDF</translation>
</message>
@ -124,24 +124,24 @@
<translation>Exportovat</translation>
</message>
<message>
<location filename="../src/exportdialog.cpp" line="129"/>
<location filename="../src/exportdialog.cpp" line="139"/>
<location filename="../src/exportdialog.cpp" line="144"/>
<location filename="../src/exportdialog.cpp" line="128"/>
<location filename="../src/exportdialog.cpp" line="138"/>
<location filename="../src/exportdialog.cpp" line="143"/>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message>
<location filename="../src/exportdialog.cpp" line="129"/>
<location filename="../src/exportdialog.cpp" line="128"/>
<source>No output file selected.</source>
<translation>Nebyl zvolen žádný výstupní soubor.</translation>
</message>
<message>
<location filename="../src/exportdialog.cpp" line="139"/>
<location filename="../src/exportdialog.cpp" line="138"/>
<source>%1 is a directory.</source>
<translation>%1 je adresář.</translation>
</message>
<message>
<location filename="../src/exportdialog.cpp" line="144"/>
<location filename="../src/exportdialog.cpp" line="143"/>
<source>%1 is not writable.</source>
<translation>%1 nelze zapsat.</translation>
</message>
@ -149,12 +149,12 @@
<context>
<name>FileSelectWidget</name>
<message>
<location filename="../src/fileselectwidget.cpp" line="10"/>
<location filename="../src/fileselectwidget.cpp" line="15"/>
<source>Browse...</source>
<translation>Procházet...</translation>
</message>
<message>
<location filename="../src/fileselectwidget.cpp" line="22"/>
<location filename="../src/fileselectwidget.cpp" line="28"/>
<source>Select file</source>
<translation>Vybrat soubor</translation>
</message>
@ -162,353 +162,358 @@
<context>
<name>GUI</name>
<message>
<location filename="../src/gui.cpp" line="458"/>
<location filename="../src/gui.cpp" line="464"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="522"/>
<location filename="../src/gui.cpp" line="528"/>
<source>Open file</source>
<translation>Otevřít soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="599"/>
<location filename="../src/gui.cpp" line="606"/>
<source>Open POI file</source>
<translation>Otevřít POI soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="203"/>
<location filename="../src/gui.cpp" line="204"/>
<source>Open</source>
<translation>Otevřít</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="187"/>
<location filename="../src/gui.cpp" line="188"/>
<source>Quit</source>
<translation>Ukončit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="195"/>
<location filename="../src/gui.cpp" line="474"/>
<location filename="../src/gui.cpp" line="475"/>
<location filename="../src/gui.cpp" line="196"/>
<location filename="../src/gui.cpp" line="480"/>
<location filename="../src/gui.cpp" line="481"/>
<source>Keyboard controls</source>
<translation>Ovládací klávesy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="219"/>
<location filename="../src/gui.cpp" line="220"/>
<source>Close</source>
<translation>Zavřít</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="225"/>
<location filename="../src/gui.cpp" line="226"/>
<source>Reload</source>
<translation>Znovu načíst</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="381"/>
<location filename="../src/gui.cpp" line="382"/>
<source>Show</source>
<translation>Zobrazit</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="322"/>
<location filename="../src/gui.cpp" line="375"/>
<location filename="../src/gui.cpp" line="323"/>
<location filename="../src/gui.cpp" line="376"/>
<source>File</source>
<translation>Soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="193"/>
<location filename="../src/gui.cpp" line="497"/>
<location filename="../src/gui.cpp" line="498"/>
<location filename="../src/gui.cpp" line="194"/>
<location filename="../src/gui.cpp" line="503"/>
<location filename="../src/gui.cpp" line="504"/>
<source>Data sources</source>
<translation>Zdroje dat</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="233"/>
<location filename="../src/gui.cpp" line="234"/>
<source>Load POI file</source>
<translation>Nahrát POI soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="236"/>
<location filename="../src/gui.cpp" line="237"/>
<source>Close POI files</source>
<translation>Zavřit POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="239"/>
<location filename="../src/gui.cpp" line="240"/>
<source>Show POIs</source>
<translation>Zobrazit POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="247"/>
<location filename="../src/gui.cpp" line="248"/>
<source>Show map</source>
<translation>Zobrazit mapu</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="253"/>
<location filename="../src/gui.cpp" line="254"/>
<source>Clear tile cache</source>
<translation>Vymazat mezipaměť dlaždic</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="262"/>
<location filename="../src/gui.cpp" line="266"/>
<location filename="../src/gui.cpp" line="484"/>
<location filename="../src/gui.cpp" line="263"/>
<location filename="../src/gui.cpp" line="267"/>
<location filename="../src/gui.cpp" line="490"/>
<source>Next map</source>
<translation>Následující mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="273"/>
<location filename="../src/gui.cpp" line="274"/>
<source>Show graphs</source>
<translation>Zobrazovat grafy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="279"/>
<location filename="../src/gui.cpp" line="280"/>
<source>Show toolbars</source>
<translation>Zobrazovat nástrojové lišty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="285"/>
<location filename="../src/gui.cpp" line="286"/>
<source>Metric</source>
<translation>Metrické</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="290"/>
<location filename="../src/gui.cpp" line="291"/>
<source>Imperial</source>
<translation>Imperiální</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="296"/>
<location filename="../src/gui.cpp" line="297"/>
<source>Fullscreen mode</source>
<translation>Celoobrazovkový režim</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="304"/>
<location filename="../src/gui.cpp" line="305"/>
<source>Next</source>
<translation>Následující</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="307"/>
<location filename="../src/gui.cpp" line="308"/>
<source>Previous</source>
<translation>Předchozí</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="311"/>
<location filename="../src/gui.cpp" line="312"/>
<source>Last</source>
<translation>Poslední</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="314"/>
<location filename="../src/gui.cpp" line="315"/>
<source>First</source>
<translation>První</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="336"/>
<location filename="../src/gui.cpp" line="337"/>
<source>Map</source>
<translation>Mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="343"/>
<location filename="../src/gui.cpp" line="344"/>
<source>POI</source>
<translation>POI</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="344"/>
<location filename="../src/gui.cpp" line="345"/>
<source>POI files</source>
<translation>POI soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="352"/>
<location filename="../src/gui.cpp" line="353"/>
<source>Settings</source>
<translation>Nastavení</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="353"/>
<location filename="../src/gui.cpp" line="354"/>
<source>Units</source>
<translation>Jednotky</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="362"/>
<location filename="../src/gui.cpp" line="363"/>
<source>Help</source>
<translation>Nápověda</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="486"/>
<location filename="../src/gui.cpp" line="426"/>
<source>Temperature</source>
<translation>Teplota</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="492"/>
<source>Previous map</source>
<translation>Předchozí mapa</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="684"/>
<location filename="../src/gui.cpp" line="687"/>
<location filename="../src/gui.cpp" line="691"/>
<location filename="../src/gui.cpp" line="694"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="860"/>
<location filename="../src/gui.cpp" line="871"/>
<source>No GPX files loaded</source>
<translation>Nejsou načteny žádné GPX soubory</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="420"/>
<location filename="../src/gui.cpp" line="423"/>
<source>Elevation</source>
<translation>Výška</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="421"/>
<location filename="../src/gui.cpp" line="424"/>
<source>Speed</source>
<translation>Rychlost</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="422"/>
<location filename="../src/gui.cpp" line="425"/>
<source>Heart rate</source>
<translation>Tep</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="477"/>
<location filename="../src/gui.cpp" line="483"/>
<source>Next file</source>
<translation>Následující soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="454"/>
<location filename="../src/gui.cpp" line="460"/>
<source>Version </source>
<translation>Verze </translation>
</message>
<message>
<location filename="../src/gui.cpp" line="208"/>
<location filename="../src/gui.cpp" line="209"/>
<source>Print...</source>
<translation>Tisknout...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="213"/>
<location filename="../src/gui.cpp" line="214"/>
<source>Export to PDF...</source>
<translation>Exportovat do PDF...</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="478"/>
<location filename="../src/gui.cpp" line="484"/>
<source>Previous file</source>
<translation>Předchozí soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="480"/>
<location filename="../src/gui.cpp" line="486"/>
<source>First file</source>
<translation>První soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="481"/>
<location filename="../src/gui.cpp" line="487"/>
<source>Last file</source>
<translation>Poslední soubor</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="482"/>
<location filename="../src/gui.cpp" line="488"/>
<source>Append modifier</source>
<translation>Modifikátor nahradit/přidat</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="501"/>
<location filename="../src/gui.cpp" line="507"/>
<source>Map (tiles) source URLs are read on program startup from the following file:</source>
<translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="504"/>
<location filename="../src/gui.cpp" line="510"/>
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="512"/>
<location filename="../src/gui.cpp" line="518"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="523"/>
<location filename="../src/gui.cpp" line="529"/>
<source>GPX files (*.gpx);;All files (*)</source>
<translation>Soubory GPX (*.gpx);;Všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="590"/>
<location filename="../src/gui.cpp" line="616"/>
<location filename="../src/gui.cpp" line="597"/>
<location filename="../src/gui.cpp" line="623"/>
<source>Line: %1</source>
<translation>Řádka: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="600"/>
<location filename="../src/gui.cpp" line="607"/>
<source>GPX files (*.gpx);;CSV files (*.csv);;All files (*)</source>
<translation>Soubory GPX (*.gpx);;Soubory CSV (*.csv);;Všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="690"/>
<location filename="../src/gui.cpp" line="697"/>
<source>Tracks</source>
<translation>Počet tras</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="696"/>
<location filename="../src/gui.cpp" line="875"/>
<location filename="../src/gui.cpp" line="703"/>
<location filename="../src/gui.cpp" line="886"/>
<source>mi</source>
<translation>mi</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="872"/>
<location filename="../src/gui.cpp" line="883"/>
<source>ft</source>
<translation>ft</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="198"/>
<location filename="../src/gui.cpp" line="452"/>
<location filename="../src/gui.cpp" line="199"/>
<location filename="../src/gui.cpp" line="458"/>
<source>About GPXSee</source>
<translation>O aplikaci GPXSee</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="385"/>
<location filename="../src/gui.cpp" line="386"/>
<source>Navigation</source>
<translation>Navigace</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="500"/>
<location filename="../src/gui.cpp" line="506"/>
<source>Map sources</source>
<translation>Mapové zdroje</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="511"/>
<location filename="../src/gui.cpp" line="517"/>
<source>POIs</source>
<translation>POI body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="695"/>
<location filename="../src/gui.cpp" line="698"/>
<location filename="../src/gui.cpp" line="702"/>
<location filename="../src/gui.cpp" line="705"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="703"/>
<location filename="../src/gui.cpp" line="710"/>
<source>Time</source>
<translation>Čas</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="879"/>
<location filename="../src/gui.cpp" line="890"/>
<source>m</source>
<translation>m</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="867"/>
<location filename="../src/gui.cpp" line="878"/>
<source>%1 tracks</source>
<translation>Počet tras: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="699"/>
<location filename="../src/gui.cpp" line="882"/>
<location filename="../src/gui.cpp" line="706"/>
<location filename="../src/gui.cpp" line="893"/>
<source>km</source>
<translation>km</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="592"/>
<location filename="../src/gui.cpp" line="617"/>
<location filename="../src/gui.cpp" line="599"/>
<location filename="../src/gui.cpp" line="624"/>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="587"/>
<location filename="../src/gui.cpp" line="594"/>
<source>Error loading GPX file:
%1</source>
<translation>Soubor GPX nelze otevřít:
%1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="613"/>
<location filename="../src/gui.cpp" line="620"/>
<source>Error loading POI file:
%1</source>
<translation>Soubor POI nelze otevřít:
@ -639,4 +644,62 @@
<translation>mi/h</translation>
</message>
</context>
<context>
<name>TemperatureGraph</name>
<message>
<location filename="../src/temperaturegraph.cpp" line="10"/>
<source>Distance</source>
<translation>Vzdálenost</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="11"/>
<source>Temperature</source>
<translation>Teplota</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="18"/>
<source>Average</source>
<translation>Průměr</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="20"/>
<source>Minimum</source>
<translation>Minimum</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="22"/>
<source>Maximum</source>
<translation>Maximum</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="77"/>
<source>m</source>
<translation>m</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="80"/>
<source>km</source>
<translation>km</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="85"/>
<source>ft</source>
<translation>ft</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="88"/>
<source>mi</source>
<translation>mi</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="97"/>
<source>C</source>
<translation>C</translation>
</message>
<message>
<location filename="../src/temperaturegraph.cpp" line="100"/>
<source>F</source>
<translation>F</translation>
</message>
</context>
</TS>

View File

@ -49,6 +49,7 @@ GraphView::GraphView(QWidget *parent)
_xScale = 1;
_yScale = 1;
_yOffset = 0;
_precision = 0;
_minYRange = 0.01;
@ -116,16 +117,6 @@ void GraphView::setYUnits(const QString &units)
createYLabel();
}
void GraphView::setXScale(qreal scale)
{
_xScale = scale;
}
void GraphView::setYScale(qreal scale)
{
_yScale = scale;
}
void GraphView::loadData(const QVector<QPointF> &data)
{
QPainterPath path;
@ -182,7 +173,8 @@ void GraphView::redraw(const QSizeF &size)
_graphs.at(i)->resetTransform();
rx = RangeF(_bounds.left() * _xScale, _bounds.right() * _xScale);
ry = RangeF(_bounds.top() * _yScale, _bounds.bottom() * _yScale);
ry = RangeF(_bounds.top() * _yScale + _yOffset, _bounds.bottom() * _yScale
+ _yOffset);
if (ry.size() < _minYRange)
ry.resize(_minYRange);
@ -217,6 +209,8 @@ void GraphView::redraw(const QSizeF &size)
_scene->addItem(_yAxis);
_slider->setArea(r);
if (_sliderPos > _bounds.right() || _sliderPos < _bounds.left())
_slider->setVisible(false);
_slider->setPos((_sliderPos / _bounds.width()) * _slider->area().width(),
r.bottom());
_scene->addItem(_slider);
@ -311,7 +305,7 @@ void GraphView::updateSliderInfo()
{
_sliderInfo->setVisible(_graphs.size() == 1);
if (_graphs.size() != 1)
if (!_slider->isVisible())
return;
const QPainterPath &path = _graphs.at(0)->path();
@ -329,7 +323,8 @@ void GraphView::updateSliderInfo()
_sliderInfo->setSide(s);
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
_sliderInfo->setText(QString::number(-y * _yScale, 'f', _precision));
_sliderInfo->setText(QString::number(-y * _yScale + _yOffset, 'f',
_precision));
}
void GraphView::emitSliderPositionChanged(const QPointF &pos)

View File

@ -47,13 +47,15 @@ public:
const QString &yUnits() const {return _yUnits;}
qreal xScale() const {return _xScale;}
qreal yScale() const {return _yScale;}
qreal yOffset() const {return _yOffset;}
void setXLabel(const QString &label);
void setYLabel(const QString &label);
void setXUnits(const QString &units);
void setYUnits(const QString &units);
void setXScale(qreal scale);
void setYScale(qreal scale);
void setXScale(qreal scale) {_xScale = scale;}
void setYScale(qreal scale) {_yScale = scale;}
void setYOffset(qreal offset) {_yOffset = offset;}
void setSliderPrecision(int precision) {_precision = precision;}
void setMinYRange(qreal range) {_minYRange = range;}
@ -85,6 +87,7 @@ private:
void updateSliderInfo();
qreal _xScale, _yScale;
qreal _yOffset;
QString _xUnits, _yUnits;
QString _xLabel, _yLabel;
int _precision;

View File

@ -28,6 +28,7 @@
#include "elevationgraph.h"
#include "speedgraph.h"
#include "heartrategraph.h"
#include "temperaturegraph.h"
#include "trackview.h"
#include "trackinfo.h"
#include "filebrowser.h"
@ -405,6 +406,8 @@ void GUI::createTrackGraphs()
_speedGraph->setFrameShape(QFrame::NoFrame);
_heartRateGraph = new HeartRateGraph;
_heartRateGraph->setFrameShape(QFrame::NoFrame);
_temperatureGraph = new TemperatureGraph;
_temperatureGraph->setFrameShape(QFrame::NoFrame);
_trackGraphs = new QTabWidget;
connect(_trackGraphs, SIGNAL(currentChanged(int)), this,
@ -420,6 +423,7 @@ void GUI::createTrackGraphs()
_tabs.append(GraphTab(_elevationGraph, tr("Elevation")));
_tabs.append(GraphTab(_speedGraph, tr("Speed")));
_tabs.append(GraphTab(_heartRateGraph, tr("Heart rate")));
_tabs.append(GraphTab(_temperatureGraph, tr("Temperature")));
connect(_elevationGraph, SIGNAL(sliderPositionChanged(qreal)), this,
SLOT(sliderPositionChanged(qreal)));
@ -427,6 +431,8 @@ void GUI::createTrackGraphs()
SLOT(sliderPositionChanged(qreal)));
connect(_heartRateGraph, SIGNAL(sliderPositionChanged(qreal)), this,
SLOT(sliderPositionChanged(qreal)));
connect(_temperatureGraph, SIGNAL(sliderPositionChanged(qreal)), this,
SLOT(sliderPositionChanged(qreal)));
}
void GUI::createStatusBar()
@ -562,6 +568,7 @@ bool GUI::loadFile(const QString &fileName)
_elevationGraph->loadGPX(gpx);
_speedGraph->loadGPX(gpx);
_heartRateGraph->loadGPX(gpx);
_temperatureGraph->loadGPX(gpx);
updateGraphTabs();
_track->setHidden(false);
_track->loadGPX(gpx);
@ -736,6 +743,7 @@ void GUI::reloadFile()
_elevationGraph->clear();
_speedGraph->clear();
_heartRateGraph->clear();
_temperatureGraph->clear();
_track->clear();
_sliderPos = 0;
@ -769,6 +777,7 @@ void GUI::closeFiles()
_elevationGraph->clear();
_speedGraph->clear();
_heartRateGraph->clear();
_temperatureGraph->clear();
_track->clear();
_files.clear();
@ -1003,6 +1012,7 @@ void GUI::setMetricUnits()
_elevationGraph->setUnits(Metric);
_speedGraph->setUnits(Metric);
_heartRateGraph->setUnits(Metric);
_temperatureGraph->setUnits(Metric);
updateStatusBarInfo();
}
@ -1012,6 +1022,7 @@ void GUI::setImperialUnits()
_elevationGraph->setUnits(Imperial);
_speedGraph->setUnits(Imperial);
_heartRateGraph->setUnits(Imperial);
_temperatureGraph->setUnits(Imperial);
updateStatusBarInfo();
}

View File

@ -22,6 +22,7 @@ class GraphView;
class ElevationGraph;
class SpeedGraph;
class HeartRateGraph;
class TemperatureGraph;
class TrackView;
class Map;
@ -158,6 +159,7 @@ private:
ElevationGraph *_elevationGraph;
SpeedGraph *_speedGraph;
HeartRateGraph *_heartRateGraph;
TemperatureGraph *_temperatureGraph;
QList<GraphTab> _tabs;
POI _poi;

View File

@ -7,6 +7,8 @@ void Parser::handleExtensionData(QStringRef element, const QString &value)
_track->last().speed = value.toDouble();
else if (element == "hr" || element == "heartrate")
_track->last().heartRate = value.toDouble();
else if (element == "atemp" || element == "temp")
_track->last().temperature = value.toDouble();
}
void Parser::handleTrekPointData(QStringRef element, const QString &value)
@ -42,7 +44,7 @@ void Parser::handleWayPointAttributes(const QXmlStreamAttributes &attr)
void Parser::tpExtension()
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "hr")
if (_reader.name() == "hr" || _reader.name() == "atemp")
handleExtensionData(_reader.name(), _reader.readElementText());
else
_reader.skipCurrentElement();
@ -53,7 +55,7 @@ void Parser::extensions()
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "speed" || _reader.name() == "hr"
|| _reader.name() == "heartrate")
|| _reader.name() == "heartrate" || _reader.name() == "temp")
handleExtensionData(_reader.name(), _reader.readElementText());
else if (_reader.name() == "TrackPointExtension")
tpExtension();

View File

@ -99,15 +99,13 @@ void Track::elevationGraph(QVector<QPointF> &graph) const
if (!_data.size())
return;
if (!_data.at(0).hasElevation())
return;
raw.append(QPointF(0, _data.at(0).elevation - _data.at(0).geoidheight));
if (_data.at(0).hasElevation())
raw.append(QPointF(0, _data.at(0).elevation - _data.at(0).geoidheight));
for (int i = 1; i < _data.size(); i++) {
dist += _dd.at(i-1);
if (!_data.at(i).hasElevation())
return;
raw.append(QPointF(dist, _data.at(i).elevation
- _data.at(i).geoidheight));
if (_data.at(i).hasElevation())
raw.append(QPointF(dist, _data.at(i).elevation
- _data.at(i).geoidheight));
}
graph = filter(raw, WINDOW_EF);
@ -124,15 +122,18 @@ void Track::speedGraph(QVector<QPointF> &graph) const
raw.append(QPointF(0, 0));
for (int i = 1; i < _data.size(); i++) {
ds = _dd.at(i-1);
dt = _data.at(i-1).timestamp.msecsTo(_data.at(i).timestamp) / 1000.0;
dist += ds;
if (!_data.at(i).hasSpeed()) {
if (_data.at(i).hasSpeed())
v = _data.at(i).speed;
else if (_data.at(i).hasTimestamp()) {
dt = _data.at(i-1).timestamp.msecsTo(_data.at(i).timestamp)
/ 1000.0;
if (dt == 0)
continue;
v = ds / dt;
} else
v = _data.at(i).speed;
continue;
raw.append(QPointF(dist, v));
}
@ -148,19 +149,33 @@ void Track::heartRateGraph(QVector<QPointF> &graph) const
if (!_data.size())
return;
if (!_data.at(0).hasHeartRate())
return;
raw.append(QPointF(0, _data.at(0).heartRate));
if (_data.at(0).hasHeartRate())
raw.append(QPointF(0, _data.at(0).heartRate));
for (int i = 1; i < _data.count(); i++) {
if (!_data.at(i).hasHeartRate())
return;
dist += _dd.at(i-1);
raw.append(QPointF(dist, _data.at(i).heartRate));
if (_data.at(i).hasHeartRate())
raw.append(QPointF(dist, _data.at(i).heartRate));
}
graph = filter(eliminate(raw, WINDOW_HE), WINDOW_HF);
}
void Track::temperatureGraph(QVector<QPointF> &graph) const
{
qreal dist = 0;
if (!_data.size())
return;
if (_data.at(0).hasTemperature())
graph.append(QPointF(0, _data.at(0).temperature));
for (int i = 1; i < _data.size(); i++) {
dist += _dd.at(i-1);
if (_data.at(i).hasTemperature())
graph.append(QPointF(dist, _data.at(i).temperature));
}
}
void Track::track(QVector<QPointF> &track) const
{
for (int i = 0; i < _data.size(); i++)

View File

@ -13,6 +13,7 @@ public:
void elevationGraph(QVector<QPointF> &graph) const;
void speedGraph(QVector<QPointF> &graph) const;
void heartRateGraph(QVector<QPointF> &graph) const;
void temperatureGraph(QVector<QPointF> &graph) const;
void track(QVector<QPointF> &track) const;
qreal distance() const {return _distance;}
qreal time() const;

View File

@ -3,6 +3,7 @@
#include <QPointF>
#include <QDateTime>
#include <QDebug>
#include <cmath>
class Trackpoint
@ -13,11 +14,14 @@ public:
geoidheight = 0;
speed = NAN;
heartRate = NAN;
temperature = NAN;
}
bool hasTimestamp() const {return !timestamp.isNull();}
bool hasElevation() const {return !std::isnan(elevation);}
bool hasSpeed() const {return !std::isnan(speed);}
bool hasHeartRate() const {return !std::isnan(heartRate);}
bool hasTemperature() const {return !std::isnan(temperature);}
QPointF coordinates;
QDateTime timestamp;
@ -25,6 +29,9 @@ public:
qreal geoidheight;
qreal speed;
qreal heartRate;
qreal temperature;
};
QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint);
#endif // TRACKPOINT_H

View File

@ -18,6 +18,9 @@ enum Units {
#define MIINFT 5280 // 1 mi in ft
#define MIINM 1609.344 // 1mi in m
#define C2FS 1.8 // Celsius to Farenheit - scale
#define C2FO 32 // Celsius to Farenheit - offset
#ifdef Q_OS_WIN32
#define UNIT_SPACE QString(" ")
#else // Q_OS_WIN32