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

Added missing routes related stuff

Refactoring/optimization/cleanup
This commit is contained in:
Martin Tůma 2016-08-09 23:08:49 +02:00
parent aacc04520f
commit 20b107581e
17 changed files with 277 additions and 239 deletions

View File

@ -15,13 +15,13 @@
<translation>Výška</translation> <translation>Výška</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="92"/> <location filename="../src/elevationgraph.cpp" line="85"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="89"/> <location filename="../src/elevationgraph.cpp" line="82"/>
<location filename="../src/elevationgraph.cpp" line="109"/> <location filename="../src/elevationgraph.cpp" line="102"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
@ -41,13 +41,13 @@
<translation>Minimum</translation> <translation>Minimum</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="100"/> <location filename="../src/elevationgraph.cpp" line="93"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/elevationgraph.cpp" line="97"/> <location filename="../src/elevationgraph.cpp" line="90"/>
<location filename="../src/elevationgraph.cpp" line="112"/> <location filename="../src/elevationgraph.cpp" line="105"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
@ -163,371 +163,358 @@
<context> <context>
<name>GUI</name> <name>GUI</name>
<message> <message>
<location filename="../src/gui.cpp" line="482"/> <location filename="../src/gui.cpp" line="486"/>
<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> <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> <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>
<message> <message>
<location filename="../src/gui.cpp" line="546"/> <location filename="../src/gui.cpp" line="550"/>
<source>Open file</source> <source>Open file</source>
<translation>Otevřít soubor</translation> <translation>Otevřít soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="622"/> <location filename="../src/gui.cpp" line="631"/>
<source>Open POI file</source> <source>Open POI file</source>
<translation>Otevřít POI soubor</translation> <translation>Otevřít POI soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="194"/> <location filename="../src/gui.cpp" line="198"/>
<source>Open</source> <source>Open</source>
<translation>Otevřít</translation> <translation>Otevřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="178"/> <location filename="../src/gui.cpp" line="182"/>
<source>Quit</source> <source>Quit</source>
<translation>Ukončit</translation> <translation>Ukončit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="186"/> <location filename="../src/gui.cpp" line="190"/>
<location filename="../src/gui.cpp" line="498"/> <location filename="../src/gui.cpp" line="502"/>
<location filename="../src/gui.cpp" line="499"/> <location filename="../src/gui.cpp" line="503"/>
<source>Keyboard controls</source> <source>Keyboard controls</source>
<translation>Ovládací klávesy</translation> <translation>Ovládací klávesy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="210"/> <location filename="../src/gui.cpp" line="214"/>
<source>Close</source> <source>Close</source>
<translation>Zavřít</translation> <translation>Zavřít</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="216"/> <location filename="../src/gui.cpp" line="220"/>
<source>Reload</source> <source>Reload</source>
<translation>Znovu načíst</translation> <translation>Znovu načíst</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="414"/> <location filename="../src/gui.cpp" line="418"/>
<source>Show</source> <source>Show</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="343"/> <location filename="../src/gui.cpp" line="347"/>
<location filename="../src/gui.cpp" line="408"/> <location filename="../src/gui.cpp" line="412"/>
<source>File</source> <source>File</source>
<translation>Soubor</translation> <translation>Soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="184"/> <location filename="../src/gui.cpp" line="188"/>
<location filename="../src/gui.cpp" line="521"/> <location filename="../src/gui.cpp" line="525"/>
<location filename="../src/gui.cpp" line="522"/> <location filename="../src/gui.cpp" line="526"/>
<source>Data sources</source> <source>Data sources</source>
<translation>Zdroje dat</translation> <translation>Zdroje dat</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="224"/> <location filename="../src/gui.cpp" line="228"/>
<source>Load POI file</source> <source>Load POI file</source>
<translation>Nahrát POI soubor</translation> <translation>Nahrát POI soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="227"/> <location filename="../src/gui.cpp" line="231"/>
<source>Close POI files</source> <source>Close POI files</source>
<translation>Zavřit POI soubory</translation> <translation>Zavřit POI soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="229"/> <location filename="../src/gui.cpp" line="233"/>
<source>Overlap POIs</source> <source>Overlap POIs</source>
<translation>Překrývat POI</translation> <translation>Překrývat POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="233"/> <location filename="../src/gui.cpp" line="237"/>
<source>Show POI labels</source> <source>Show POI labels</source>
<translation>Zobrazovat názvy POI</translation> <translation>Zobrazovat názvy POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="238"/> <location filename="../src/gui.cpp" line="242"/>
<source>Show POIs</source> <source>Show POIs</source>
<translation>Zobrazit POI</translation> <translation>Zobrazit POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="246"/> <location filename="../src/gui.cpp" line="250"/>
<source>Show map</source> <source>Show map</source>
<translation>Zobrazit mapu</translation> <translation>Zobrazit mapu</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="252"/> <location filename="../src/gui.cpp" line="256"/>
<source>Clear tile cache</source> <source>Clear tile cache</source>
<translation>Vymazat mezipaměť dlaždic</translation> <translation>Vymazat mezipaměť dlaždic</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="261"/>
<location filename="../src/gui.cpp" line="265"/> <location filename="../src/gui.cpp" line="265"/>
<location filename="../src/gui.cpp" line="508"/> <location filename="../src/gui.cpp" line="269"/>
<location filename="../src/gui.cpp" line="512"/>
<source>Next map</source> <source>Next map</source>
<translation>Následující mapa</translation> <translation>Následující mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="272"/> <location filename="../src/gui.cpp" line="288"/>
<source>Show tracks</source>
<translation>Zobrazit cesty</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="276"/>
<source>Show routes</source>
<translation>Zobrazit trasy</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="280"/>
<source>Show waypoints</source>
<translation>Zobrazit navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="284"/>
<source>Waypoint labels</source> <source>Waypoint labels</source>
<translation>Názvy navigačních bodů</translation> <translation>Názvy navigačních bodů</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="288"/> <location filename="../src/gui.cpp" line="292"/>
<source>Route Waypoints</source> <source>Route Waypoints</source>
<translation>Body tras</translation> <translation>Body tras</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="294"/> <location filename="../src/gui.cpp" line="298"/>
<source>Show graphs</source> <source>Show graphs</source>
<translation>Zobrazovat grafy</translation> <translation>Zobrazovat grafy</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="300"/> <location filename="../src/gui.cpp" line="304"/>
<source>Show toolbars</source> <source>Show toolbars</source>
<translation>Zobrazovat nástrojové lišty</translation> <translation>Zobrazovat nástrojové lišty</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="306"/> <location filename="../src/gui.cpp" line="310"/>
<source>Metric</source> <source>Metric</source>
<translation>Metrické</translation> <translation>Metrické</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="311"/> <location filename="../src/gui.cpp" line="315"/>
<source>Imperial</source> <source>Imperial</source>
<translation>Imperiální</translation> <translation>Imperiální</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="317"/> <location filename="../src/gui.cpp" line="321"/>
<source>Fullscreen mode</source> <source>Fullscreen mode</source>
<translation>Celoobrazovkový režim</translation> <translation>Celoobrazovkový režim</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="325"/> <location filename="../src/gui.cpp" line="329"/>
<source>Next</source> <source>Next</source>
<translation>Následující</translation> <translation>Následující</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="328"/> <location filename="../src/gui.cpp" line="332"/>
<source>Previous</source> <source>Previous</source>
<translation>Předchozí</translation> <translation>Předchozí</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="332"/> <location filename="../src/gui.cpp" line="336"/>
<source>Last</source> <source>Last</source>
<translation>Poslední</translation> <translation>Poslední</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="335"/> <location filename="../src/gui.cpp" line="339"/>
<source>First</source> <source>First</source>
<translation>První</translation> <translation>První</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="357"/> <location filename="../src/gui.cpp" line="361"/>
<source>Map</source> <source>Map</source>
<translation>Mapa</translation> <translation>Mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="364"/> <location filename="../src/gui.cpp" line="368"/>
<source>POI</source> <source>POI</source>
<translation>POI</translation> <translation>POI</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="365"/> <location filename="../src/gui.cpp" line="369"/>
<source>POI files</source> <source>POI files</source>
<translation>POI soubory</translation> <translation>POI soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="376"/> <location filename="../src/gui.cpp" line="380"/>
<source>Data</source> <source>Data</source>
<translation>Data</translation> <translation>Data</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="377"/> <location filename="../src/gui.cpp" line="381"/>
<source>Display</source> <source>Display</source>
<translation>Zobrazit</translation> <translation>Zobrazit</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="385"/> <location filename="../src/gui.cpp" line="389"/>
<source>Settings</source> <source>Settings</source>
<translation>Nastavení</translation> <translation>Nastavení</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="386"/> <location filename="../src/gui.cpp" line="390"/>
<source>Units</source> <source>Units</source>
<translation>Jednotky</translation> <translation>Jednotky</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="395"/> <location filename="../src/gui.cpp" line="399"/>
<source>Help</source> <source>Help</source>
<translation>Nápověda</translation> <translation>Nápověda</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="510"/> <location filename="../src/gui.cpp" line="514"/>
<source>Previous map</source> <source>Previous map</source>
<translation>Předchozí mapa</translation> <translation>Předchozí mapa</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="708"/> <location filename="../src/gui.cpp" line="718"/>
<location filename="../src/gui.cpp" line="711"/> <location filename="../src/gui.cpp" line="721"/>
<source>Date</source> <source>Date</source>
<translation>Datum</translation> <translation>Datum</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="889"/> <location filename="../src/gui.cpp" line="280"/>
<location filename="../src/gui.cpp" line="730"/>
<source>Routes</source>
<translation>Počet tras</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="903"/>
<source>No GPX files loaded</source> <source>No GPX files loaded</source>
<translation>Nejsou načteny žádné GPX soubory</translation> <translation>Nejsou načteny žádné GPX soubory</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="501"/> <location filename="../src/gui.cpp" line="910"/>
<source>%1 files</source>
<translation>%1 souborů</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="505"/>
<source>Next file</source> <source>Next file</source>
<translation>Následující soubor</translation> <translation>Následující soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="478"/> <location filename="../src/gui.cpp" line="482"/>
<source>Version </source> <source>Version </source>
<translation>Verze </translation> <translation>Verze </translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="199"/> <location filename="../src/gui.cpp" line="203"/>
<source>Print...</source> <source>Print...</source>
<translation>Tisknout...</translation> <translation>Tisknout...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="204"/> <location filename="../src/gui.cpp" line="208"/>
<source>Export to PDF...</source> <source>Export to PDF...</source>
<translation>Exportovat do PDF...</translation> <translation>Exportovat do PDF...</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="502"/> <location filename="../src/gui.cpp" line="284"/>
<location filename="../src/gui.cpp" line="732"/>
<source>Waypoints</source>
<translation>Navigační body</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="506"/>
<source>Previous file</source> <source>Previous file</source>
<translation>Předchozí soubor</translation> <translation>Předchozí soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="504"/> <location filename="../src/gui.cpp" line="508"/>
<source>First file</source> <source>First file</source>
<translation>První soubor</translation> <translation>První soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="505"/> <location filename="../src/gui.cpp" line="509"/>
<source>Last file</source> <source>Last file</source>
<translation>Poslední soubor</translation> <translation>Poslední soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="506"/> <location filename="../src/gui.cpp" line="510"/>
<source>Append modifier</source> <source>Append modifier</source>
<translation>Modifikátor nahradit/přidat</translation> <translation>Modifikátor nahradit/přidat</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="525"/> <location filename="../src/gui.cpp" line="529"/>
<source>Map (tiles) source URLs are read on program startup from the following file:</source> <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> <translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="528"/> <location filename="../src/gui.cpp" line="532"/>
<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> <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> <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>
<message> <message>
<location filename="../src/gui.cpp" line="536"/> <location filename="../src/gui.cpp" line="540"/>
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source> <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> <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>
<message> <message>
<location filename="../src/gui.cpp" line="547"/> <location filename="../src/gui.cpp" line="551"/>
<source>GPX files (*.gpx);;All files (*)</source> <source>GPX files (*.gpx);;All files (*)</source>
<translation>Soubory GPX (*.gpx);;Všechny soubory (*)</translation> <translation>Soubory GPX (*.gpx);;Všechny soubory (*)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="613"/> <location filename="../src/gui.cpp" line="622"/>
<location filename="../src/gui.cpp" line="639"/> <location filename="../src/gui.cpp" line="648"/>
<source>Line: %1</source> <source>Line: %1</source>
<translation>Řádka: %1</translation> <translation>Řádka: %1</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="623"/> <location filename="../src/gui.cpp" line="632"/>
<source>GPX files (*.gpx);;CSV files (*.csv);;All files (*)</source> <source>GPX files (*.gpx);;CSV files (*.csv);;All files (*)</source>
<translation>Soubory GPX (*.gpx);;Soubory CSV (*.csv);;Všechny soubory (*)</translation> <translation>Soubory GPX (*.gpx);;Soubory CSV (*.csv);;Všechny soubory (*)</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="714"/> <location filename="../src/gui.cpp" line="276"/>
<location filename="../src/gui.cpp" line="728"/>
<source>Tracks</source> <source>Tracks</source>
<translation>Počet tras</translation> <translation>Počet cest</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="720"/> <location filename="../src/gui.cpp" line="193"/>
<source>mi</source> <location filename="../src/gui.cpp" line="480"/>
<translation>mi</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="189"/>
<location filename="../src/gui.cpp" line="476"/>
<source>About GPXSee</source> <source>About GPXSee</source>
<translation>O aplikaci GPXSee</translation> <translation>O aplikaci GPXSee</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="418"/> <location filename="../src/gui.cpp" line="422"/>
<source>Navigation</source> <source>Navigation</source>
<translation>Navigace</translation> <translation>Navigace</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="524"/> <location filename="../src/gui.cpp" line="528"/>
<source>Map sources</source> <source>Map sources</source>
<translation>Mapové zdroje</translation> <translation>Mapové zdroje</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="535"/> <location filename="../src/gui.cpp" line="539"/>
<source>POIs</source> <source>POIs</source>
<translation>POI body</translation> <translation>POI body</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="719"/> <location filename="../src/gui.cpp" line="735"/>
<location filename="../src/gui.cpp" line="722"/>
<source>Distance</source> <source>Distance</source>
<translation>Vzdálenost</translation> <translation>Vzdálenost</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="727"/> <location filename="../src/gui.cpp" line="737"/>
<source>Time</source> <source>Time</source>
<translation>Čas</translation> <translation>Čas</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="896"/> <location filename="../src/gui.cpp" line="624"/>
<source>%1 tracks</source> <location filename="../src/gui.cpp" line="649"/>
<translation>Počet tras: %1</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="723"/>
<source>km</source>
<translation>km</translation>
</message>
<message>
<location filename="../src/gui.cpp" line="615"/>
<location filename="../src/gui.cpp" line="640"/>
<source>Error</source> <source>Error</source>
<translation>Chyba</translation> <translation>Chyba</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="610"/> <location filename="../src/gui.cpp" line="619"/>
<source>Error loading GPX file: <source>Error loading GPX file:
%1</source> %1</source>
<translation>Soubor GPX nelze otevřít: <translation>Soubor GPX nelze otevřít:
%1</translation> %1</translation>
</message> </message>
<message> <message>
<location filename="../src/gui.cpp" line="636"/> <location filename="../src/gui.cpp" line="645"/>
<source>Error loading POI file: <source>Error loading POI file:
%1</source> %1</source>
<translation>Soubor POI nelze otevřít: <translation>Soubor POI nelze otevřít:
@ -548,7 +535,7 @@
<translation>Tep</translation> <translation>Tep</translation>
</message> </message>
<message> <message>
<location filename="../src/heartrategraph.cpp" line="81"/> <location filename="../src/heartrategraph.cpp" line="80"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
@ -568,17 +555,17 @@
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/heartrategraph.cpp" line="78"/> <location filename="../src/heartrategraph.cpp" line="77"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/heartrategraph.cpp" line="86"/> <location filename="../src/heartrategraph.cpp" line="85"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/heartrategraph.cpp" line="89"/> <location filename="../src/heartrategraph.cpp" line="88"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
@ -645,22 +632,22 @@
<translation>Rychlost</translation> <translation>Rychlost</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="75"/> <location filename="../src/speedgraph.cpp" line="73"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="78"/> <location filename="../src/speedgraph.cpp" line="76"/>
<source>km</source> <source>km</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="83"/> <location filename="../src/speedgraph.cpp" line="81"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="95"/> <location filename="../src/speedgraph.cpp" line="93"/>
<source>km/h</source> <source>km/h</source>
<translation>km/h</translation> <translation>km/h</translation>
</message> </message>
@ -675,12 +662,12 @@
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="86"/> <location filename="../src/speedgraph.cpp" line="84"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/speedgraph.cpp" line="98"/> <location filename="../src/speedgraph.cpp" line="96"/>
<source>mi/h</source> <source>mi/h</source>
<translation>mi/h</translation> <translation>mi/h</translation>
</message> </message>
@ -714,32 +701,32 @@
<translation>Maximum</translation> <translation>Maximum</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="80"/> <location filename="../src/temperaturegraph.cpp" line="79"/>
<source>m</source> <source>m</source>
<translation>m</translation> <translation>m</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="83"/> <location filename="../src/temperaturegraph.cpp" line="82"/>
<source>km</source> <source>km</source>
<translation>km</translation> <translation>km</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="88"/> <location filename="../src/temperaturegraph.cpp" line="87"/>
<source>ft</source> <source>ft</source>
<translation>ft</translation> <translation>ft</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="91"/> <location filename="../src/temperaturegraph.cpp" line="90"/>
<source>mi</source> <source>mi</source>
<translation>mi</translation> <translation>mi</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="100"/> <location filename="../src/temperaturegraph.cpp" line="99"/>
<source>C</source> <source>C</source>
<translation>C</translation> <translation>C</translation>
</message> </message>
<message> <message>
<location filename="../src/temperaturegraph.cpp" line="104"/> <location filename="../src/temperaturegraph.cpp" line="103"/>
<source>F</source> <source>F</source>
<translation>F</translation> <translation>F</translation>
</message> </message>

View File

@ -56,17 +56,10 @@ void ElevationGraph::loadPath(const QVector<QPointF> &data)
void ElevationGraph::loadGPX(const GPX &gpx) void ElevationGraph::loadGPX(const GPX &gpx)
{ {
for (int i = 0; i < gpx.trackCount(); i++) { for (int i = 0; i < gpx.tracks().count(); i++)
QVector<QPointF> data; loadPath(gpx.tracks().at(i)->elevation());
gpx.track(i).elevationGraph(data); for (int i = 0; i < gpx.routes().count(); i++)
loadPath(data); loadPath(gpx.routes().at(i)->elevation());
}
for (int i = 0; i < gpx.routeCount(); i++) {
QVector<QPointF> data;
gpx.route(i).elevationGraph(data);
loadPath(data);
}
setXUnits(); setXUnits();
setInfo(); setInfo();

View File

@ -4,12 +4,24 @@
#include "gpx.h" #include "gpx.h"
GPX::GPX() : _parser(_track_data, _route_data, _waypoint_data), _errorLine(0)
{
}
GPX::~GPX()
{
for (int i = 0; i < _tracks.count(); i++)
delete _tracks.at(i);
for (int i = 0; i < _routes.count(); i++)
delete _routes.at(i);
}
bool GPX::loadFile(const QString &fileName) bool GPX::loadFile(const QString &fileName)
{ {
QFile file(fileName);
bool ret; bool ret;
QFile file(fileName);
_tracks.clear();
_error.clear(); _error.clear();
_errorLine = 0; _errorLine = 0;
@ -18,11 +30,18 @@ bool GPX::loadFile(const QString &fileName)
return false; return false;
} }
if (!(ret = _parser.loadFile(&file))) { ret = _parser.loadFile(&file);
file.close();
if (ret == false) {
_error = _parser.errorString(); _error = _parser.errorString();
_errorLine = _parser.errorLine(); _errorLine = _parser.errorLine();
return false;
} }
file.close();
return ret; for (int i = 0; i < _track_data.count(); i++)
_tracks.append(new Track(_track_data.at(i)));
for (int i = 0; i < _route_data.count(); i++)
_routes.append(new Route(_route_data.at(i)));
return true;
} }

View File

@ -13,25 +13,28 @@
class GPX class GPX
{ {
public: public:
GPX() : _parser(_tracks, _routes, _waypoints), _errorLine(0) {} GPX();
~GPX();
bool loadFile(const QString &fileName); bool loadFile(const QString &fileName);
const QString &errorString() const {return _error;} const QString &errorString() const {return _error;}
int errorLine() const {return _errorLine;} int errorLine() const {return _errorLine;}
int trackCount() const {return _tracks.count();} const QList<Track*> &tracks() const {return _tracks;}
Track track(int i) const {return Track(_tracks.at(i));} const QList<Route*> &routes() const {return _routes;}
int routeCount() const {return _routes.count();} const QList<Waypoint> &waypoints() const {return _waypoint_data;}
Route route(int i) const {return Route(_routes.at(i));}
const QList<Waypoint> &waypoints() const {return _waypoints;}
private: private:
Parser _parser; Parser _parser;
QString _error; QString _error;
int _errorLine; int _errorLine;
QList<QVector<Trackpoint> > _tracks; QList<Track*> _tracks;
QList<QVector<Waypoint> > _routes; QList<Route*> _routes;
QList<Waypoint> _waypoints;
QList<QVector<Trackpoint> > _track_data;
QList<QVector<Waypoint> > _route_data;
QList<Waypoint> _waypoint_data;
}; };
#endif // GPX_H #endif // GPX_H

View File

@ -39,6 +39,8 @@
#include "gui.h" #include "gui.h"
#include <QElapsedTimer>
GUI::GUI(QWidget *parent) : QMainWindow(parent) GUI::GUI(QWidget *parent) : QMainWindow(parent)
{ {
loadMaps(); loadMaps();
@ -73,6 +75,8 @@ GUI::GUI(QWidget *parent) : QMainWindow(parent)
_distance = 0; _distance = 0;
_time = 0; _time = 0;
_trackCount = 0; _trackCount = 0;
_routeCount = 0;
_waypointCount = 0;
_sliderPos = 0; _sliderPos = 0;
@ -269,15 +273,15 @@ void GUI::createActions()
} }
// Data actions // Data actions
_showTracksAction = new QAction(tr("Show tracks"), this); _showTracksAction = new QAction(tr("Tracks"), this);
_showTracksAction->setCheckable(true); _showTracksAction->setCheckable(true);
connect(_showTracksAction, SIGNAL(triggered(bool)), _track, connect(_showTracksAction, SIGNAL(triggered(bool)), _track,
SLOT(showTracks(bool))); SLOT(showTracks(bool)));
_showRoutesAction = new QAction(tr("Show routes"), this); _showRoutesAction = new QAction(tr("Routes"), this);
_showRoutesAction->setCheckable(true); _showRoutesAction->setCheckable(true);
connect(_showRoutesAction, SIGNAL(triggered(bool)), _track, connect(_showRoutesAction, SIGNAL(triggered(bool)), _track,
SLOT(showRoutes(bool))); SLOT(showRoutes(bool)));
_showWaypointsAction = new QAction(tr("Show waypoints"), this); _showWaypointsAction = new QAction(tr("Waypoints"), this);
_showWaypointsAction->setCheckable(true); _showWaypointsAction->setCheckable(true);
connect(_showWaypointsAction, SIGNAL(triggered(bool)), _track, connect(_showWaypointsAction, SIGNAL(triggered(bool)), _track,
SLOT(showWaypoints(bool))); SLOT(showWaypoints(bool)));
@ -592,17 +596,22 @@ bool GUI::loadFile(const QString &fileName)
_track->loadPOI(_poi); _track->loadPOI(_poi);
_track->movePositionMarker(_sliderPos); _track->movePositionMarker(_sliderPos);
for (int i = 0; i < gpx.trackCount(); i++) { for (int i = 0; i < gpx.tracks().count(); i++) {
_distance += gpx.track(i).distance(); _distance += gpx.tracks().at(i)->distance();
_time += gpx.track(i).time(); _time += gpx.tracks().at(i)->time();
const QDate &date = gpx.track(i).date().date(); const QDate &date = gpx.tracks().at(i)->date().date();
if (_dateRange.first.isNull() || _dateRange.first > date) if (_dateRange.first.isNull() || _dateRange.first > date)
_dateRange.first = date; _dateRange.first = date;
if (_dateRange.second.isNull() || _dateRange.second < date) if (_dateRange.second.isNull() || _dateRange.second < date)
_dateRange.second = date; _dateRange.second = date;
} }
_trackCount += gpx.tracks().count();
_trackCount += gpx.trackCount(); for (int i = 0; i < gpx.routes().count(); i++)
_distance += gpx.routes().at(i)->distance();
_routeCount += gpx.routes().count();
_waypointCount += gpx.waypoints().count();
return true; return true;
} else { } else {
@ -700,6 +709,7 @@ void GUI::plot(QPrinter *printer)
QPainter p(printer); QPainter p(printer);
TrackInfo info; TrackInfo info;
qreal ih, gh, mh, ratio; qreal ih, gh, mh, ratio;
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric;
if (_dateRange.first.isValid()) { if (_dateRange.first.isValid()) {
@ -711,18 +721,18 @@ void GUI::plot(QPrinter *printer)
info.insert(tr("Date"), QString("%1 - %2") info.insert(tr("Date"), QString("%1 - %2")
.arg(_dateRange.first.toString(format), .arg(_dateRange.first.toString(format),
_dateRange.second.toString(format))); _dateRange.second.toString(format)));
info.insert(tr("Tracks"), QString::number(_trackCount));
}
}
if (_distance > 0) {
if (_imperialUnitsAction->isChecked()) {
info.insert(tr("Distance"), QString::number(_distance * M2MI, 'f',
1) + UNIT_SPACE + tr("mi"));
} else {
info.insert(tr("Distance"), QString::number(_distance * M2KM, 'f',
1) + UNIT_SPACE + tr("km"));
} }
} }
if (_trackCount)
info.insert(tr("Tracks"), QString::number(_trackCount));
if (_routeCount)
info.insert(tr("Routes"), QString::number(_routeCount));
if (_waypointCount)
info.insert(tr("Waypoints"), QString::number(_waypointCount));
if (_distance > 0)
info.insert(tr("Distance"), ::distance(_distance, units));
if (_time > 0) if (_time > 0)
info.insert(tr("Time"), timeSpan(_time)); info.insert(tr("Time"), timeSpan(_time));
@ -756,6 +766,8 @@ void GUI::reloadFile()
_time = 0; _time = 0;
_dateRange = DateRange(QDate(), QDate()); _dateRange = DateRange(QDate(), QDate());
_trackCount = 0; _trackCount = 0;
_routeCount = 0;
_waypointCount = 0;
for (int i = 0; i < _tabs.count(); i++) for (int i = 0; i < _tabs.count(); i++)
_tabs.at(i)->clear(); _tabs.at(i)->clear();
@ -786,6 +798,8 @@ void GUI::closeFiles()
_time = 0; _time = 0;
_dateRange = DateRange(QDate(), QDate()); _dateRange = DateRange(QDate(), QDate());
_trackCount = 0; _trackCount = 0;
_routeCount = 0;
_waypointCount = 0;
_sliderPos = 0; _sliderPos = 0;
@ -893,7 +907,7 @@ void GUI::updateStatusBarInfo()
} else if (_files.count() == 1) } else if (_files.count() == 1)
_fileNameLabel->setText(_files.at(0)); _fileNameLabel->setText(_files.at(0));
else else
_fileNameLabel->setText(tr("%1 tracks").arg(_trackCount)); _fileNameLabel->setText(tr("%1 files").arg(_files.count()));
Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric; Units units = _imperialUnitsAction->isChecked() ? Imperial : Metric;
_distanceLabel->setText(distance(_distance, units)); _distanceLabel->setText(distance(_distance, units));

View File

@ -162,6 +162,8 @@ private:
Map *_currentMap; Map *_currentMap;
int _trackCount; int _trackCount;
int _routeCount;
int _waypointCount;
qreal _distance; qreal _distance;
qreal _time; qreal _time;
DateRange _dateRange; DateRange _dateRange;

View File

@ -23,11 +23,10 @@ void HeartRateGraph::setInfo()
void HeartRateGraph::loadGPX(const GPX &gpx) void HeartRateGraph::loadGPX(const GPX &gpx)
{ {
for (int i = 0; i < gpx.trackCount(); i++) { for (int i = 0; i < gpx.tracks().count(); i++) {
QVector<QPointF> data; QVector<QPointF> data = gpx.tracks().at(i)->heartRate();
qreal sum = 0, w = 0; qreal sum = 0, w = 0;
gpx.track(i).heartRateGraph(data);
if (data.count() < 2) { if (data.count() < 2) {
skipColor(); skipColor();
continue; continue;
@ -37,12 +36,12 @@ void HeartRateGraph::loadGPX(const GPX &gpx)
sum += data.at(j).y() * (data.at(j).x() - data.at(j-1).x()); sum += data.at(j).y() * (data.at(j).x() - data.at(j-1).x());
w += data.at(j).x() - data.at(j-1).x(); w += data.at(j).x() - data.at(j-1).x();
} }
_avg.append(QPointF(gpx.track(i).distance(), sum/w)); _avg.append(QPointF(gpx.tracks().at(i)->distance(), sum/w));
loadData(data); loadData(data);
} }
for (int i = 0; i < gpx.routeCount(); i++) for (int i = 0; i < gpx.routes().count(); i++)
skipColor(); skipColor();
setXUnits(); setXUnits();

View File

@ -6,20 +6,25 @@ Route::Route(const QVector<Waypoint> &data) : _data(data)
qreal dist = 0; qreal dist = 0;
_dd.append(dist); _dd.append(dist);
for (int i = 1; i < _data.count(); i++) { for (int i = 1; i < data.count(); i++) {
dist += llDistance(_data.at(i).coordinates(), dist += llDistance(data.at(i).coordinates(), data.at(i-1).coordinates());
_data.at(i-1).coordinates());
_dd.append(dist); _dd.append(dist);
} }
} }
void Route::elevationGraph(QVector<QPointF> &graph) const QVector<QPointF> Route::elevation() const
{ {
if (!_data.size()) QVector<QPointF> graph;
return;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
if (_data.at(i).hasElevation()) if (_data.at(i).hasElevation())
graph.append(QPointF(_dd.at(i), _data.at(i).elevation() graph.append(QPointF(_dd.at(i), _data.at(i).elevation()
- _data.at(i).geoidHeight())); - _data.at(i).geoidHeight()));
return graph;
}
qreal Route::distance() const
{
return (_dd.isEmpty()) ? 0 : _dd.last();
} }

View File

@ -10,10 +10,11 @@ public:
Route(const QVector<Waypoint> &data); Route(const QVector<Waypoint> &data);
const QVector<Waypoint> &route() const {return _data;} const QVector<Waypoint> &route() const {return _data;}
void elevationGraph(QVector<QPointF> &graph) const; QVector<QPointF> elevation() const;
qreal distance() const {return _dd.last();}
bool isNull() const {return (_data.count() < 2) ? true : false;} qreal distance() const;
bool isNull() const {return _dd.isEmpty();}
private: private:
const QVector<Waypoint> &_data; const QVector<Waypoint> &_data;

View File

@ -79,3 +79,14 @@ void RouteItem::showWaypoints(bool show)
if (childs.at(i) != _marker) if (childs.at(i) != _marker)
childs.at(i)->setVisible(show); childs.at(i)->setVisible(show);
} }
void RouteItem::showWaypointLabels(bool show)
{
QList<QGraphicsItem *> childs = childItems();
for (int i = 0; i < childs.count(); i++) {
if (childs.at(i) != _marker) {
WaypointItem *wi = static_cast<WaypointItem*>(childs.at(i));
wi->showLabel(show);
}
}
}

View File

@ -23,6 +23,7 @@ public:
void moveMarker(qreal t); void moveMarker(qreal t);
void showWaypoints(bool show); void showWaypoints(bool show);
void showWaypointLabels(bool show);
private: private:
QPainterPath _path; QPainterPath _path;

View File

@ -24,22 +24,20 @@ void SpeedGraph::setInfo()
void SpeedGraph::loadGPX(const GPX &gpx) void SpeedGraph::loadGPX(const GPX &gpx)
{ {
for (int i = 0; i < gpx.trackCount(); i++) { for (int i = 0; i < gpx.tracks().count(); i++) {
QVector<QPointF> data; QVector<QPointF> data = gpx.tracks().at(i)->speed();
gpx.track(i).speedGraph(data);
if (data.count() < 2) { if (data.count() < 2) {
skipColor(); skipColor();
continue; continue;
} }
_avg.append(QPointF(gpx.track(i).distance(), gpx.track(i).distance() _avg.append(QPointF(gpx.tracks().at(i)->distance(),
/ gpx.track(i).time())); gpx.tracks().at(i)->distance() / gpx.tracks().at(i)->time()));
loadData(data); loadData(data);
} }
for (int i = 0; i < gpx.routeCount(); i++) for (int i = 0; i < gpx.routes().count(); i++)
skipColor(); skipColor();
setXUnits(); setXUnits();

View File

@ -25,11 +25,10 @@ void TemperatureGraph::setInfo()
void TemperatureGraph::loadGPX(const GPX &gpx) void TemperatureGraph::loadGPX(const GPX &gpx)
{ {
for (int i = 0; i < gpx.trackCount(); i++) { for (int i = 0; i < gpx.tracks().count(); i++) {
QVector<QPointF> data; QVector<QPointF> data = gpx.tracks().at(i)->temperature();
qreal sum = 0, w = 0; qreal sum = 0, w = 0;
gpx.track(i).temperatureGraph(data);
if (data.count() < 2) { if (data.count() < 2) {
skipColor(); skipColor();
continue; continue;
@ -39,12 +38,12 @@ void TemperatureGraph::loadGPX(const GPX &gpx)
sum += data.at(j).y() * (data.at(j).x() - data.at(j-1).x()); sum += data.at(j).y() * (data.at(j).x() - data.at(j-1).x());
w += data.at(j).x() - data.at(j-1).x(); w += data.at(j).x() - data.at(j-1).x();
} }
_avg.append(QPointF(gpx.track(i).distance(), sum/w)); _avg.append(QPointF(gpx.tracks().at(i)->distance(), sum/w));
loadData(data); loadData(data);
} }
for (int i = 0; i < gpx.routeCount(); i++) for (int i = 0; i < gpx.routes().count(); i++)
skipColor(); skipColor();
setXUnits(); setXUnits();

View File

@ -84,36 +84,35 @@ Track::Track(const QVector<Trackpoint> &data) : _data(data)
qreal dist = 0; qreal dist = 0;
_dd.append(dist); _dd.append(dist);
for (int i = 1; i < _data.count(); i++) { for (int i = 1; i < data.count(); i++) {
dist += llDistance(_data.at(i).coordinates(), dist += llDistance(data.at(i).coordinates(), data.at(i-1).coordinates());
_data.at(i-1).coordinates());
_dd.append(dist); _dd.append(dist);
} }
} }
void Track::elevationGraph(QVector<QPointF> &graph) const QVector<QPointF> Track::elevation() const
{ {
QVector<QPointF> raw; QVector<QPointF> raw;
if (!_data.size()) if (!_data.size())
return; return raw;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
if (_data.at(i).hasElevation()) if (_data.at(i).hasElevation())
raw.append(QPointF(_dd.at(i), _data.at(i).elevation() raw.append(QPointF(_dd.at(i), _data.at(i).elevation()
- _data.at(i).geoidHeight())); - _data.at(i).geoidHeight()));
graph = filter(raw, WINDOW_EF); return filter(raw, WINDOW_EF);
} }
void Track::speedGraph(QVector<QPointF> &graph) const QVector<QPointF> Track::speed() const
{ {
qreal v, ds; qreal v, ds;
qint64 dt; qint64 dt;
QVector<QPointF> raw; QVector<QPointF> raw;
if (!_data.size()) if (!_data.size())
return; return raw;
raw.append(QPointF(0, 0)); raw.append(QPointF(0, 0));
for (int i = 1; i < _data.size(); i++) { for (int i = 1; i < _data.size(); i++) {
@ -131,52 +130,56 @@ void Track::speedGraph(QVector<QPointF> &graph) const
raw.append(QPointF(_dd.at(i), v)); raw.append(QPointF(_dd.at(i), v));
} }
graph = filter(eliminate(raw, WINDOW_SE), WINDOW_SF); return filter(eliminate(raw, WINDOW_SE), WINDOW_SF);
} }
void Track::heartRateGraph(QVector<QPointF> &graph) const QVector<QPointF> Track::heartRate() const
{ {
QVector<QPointF> raw; QVector<QPointF> raw;
if (!_data.size()) if (!_data.size())
return; return raw;
for (int i = 0; i < _data.count(); i++) for (int i = 0; i < _data.count(); i++)
if (_data.at(i).hasHeartRate()) if (_data.at(i).hasHeartRate())
raw.append(QPointF(_dd.at(i), _data.at(i).heartRate())); raw.append(QPointF(_dd.at(i), _data.at(i).heartRate()));
graph = filter(eliminate(raw, WINDOW_HE), WINDOW_HF); return filter(eliminate(raw, WINDOW_HE), WINDOW_HF);
} }
void Track::temperatureGraph(QVector<QPointF> &graph) const QVector<QPointF> Track::temperature() const
{ {
if (!_data.size()) QVector<QPointF> graph;
return;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
if (_data.at(i).hasTemperature()) if (_data.at(i).hasTemperature())
graph.append(QPointF(_dd.at(i), _data.at(i).temperature())); graph.append(QPointF(_dd.at(i), _data.at(i).temperature()));
return graph;
} }
void Track::track(QVector<QPointF> &track) const QVector<QPointF> Track::track() const
{ {
QVector<QPointF> graph;
for (int i = 0; i < _data.size(); i++) for (int i = 0; i < _data.size(); i++)
track.append(_data.at(i).coordinates()); graph.append(_data.at(i).coordinates());
return graph;
}
qreal Track::distance() const
{
return (_dd.isEmpty()) ? 0 : _dd.last();
} }
qreal Track::time() const qreal Track::time() const
{ {
if (_data.size() < 2) return (_data.size() < 2) ? 0 :
return 0; (_data.first().timestamp().msecsTo(_data.last().timestamp()) / 1000.0);
return (_data.first().timestamp().msecsTo(_data.last().timestamp())
/ 1000.0);
} }
QDateTime Track::date() const QDateTime Track::date() const
{ {
if (_data.size()) return (_data.size()) ? _data.first().timestamp() : QDateTime();
return _data.first().timestamp();
else
return QDateTime();
} }

View File

@ -10,16 +10,17 @@ class Track
public: public:
Track(const QVector<Trackpoint> &data); Track(const QVector<Trackpoint> &data);
void elevationGraph(QVector<QPointF> &graph) const; QVector<QPointF> track() const;
void speedGraph(QVector<QPointF> &graph) const; QVector<QPointF> elevation() const;
void heartRateGraph(QVector<QPointF> &graph) const; QVector<QPointF> speed() const;
void temperatureGraph(QVector<QPointF> &graph) const; QVector<QPointF> heartRate() const;
void track(QVector<QPointF> &track) const; QVector<QPointF> temperature() const;
qreal distance() const {return _dd.last();}
qreal distance() const;
qreal time() const; qreal time() const;
QDateTime date() const; QDateTime date() const;
bool isNull() const {return (_data.count() < 2) ? true : false;} bool isNull() const {return _dd.isEmpty();}
private: private:
const QVector<Trackpoint> &_data; const QVector<Trackpoint> &_data;

View File

@ -34,9 +34,7 @@ void TrackItem::updateShape()
TrackItem::TrackItem(const Track &track, QGraphicsItem *parent) TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
: QGraphicsItem(parent) : QGraphicsItem(parent)
{ {
QVector<QPointF> t; const QVector<QPointF> &t = track.track();
track.track(t);
Q_ASSERT(t.count() >= 2); Q_ASSERT(t.count() >= 2);
const QPointF &p = t.at(0); const QPointF &p = t.at(0);

View File

@ -91,6 +91,7 @@ void TrackView::addRoute(const Route &route)
ri->setColor(_palette.color()); ri->setColor(_palette.color());
ri->setVisible(_showRoutes); ri->setVisible(_showRoutes);
ri->showWaypoints(_showRouteWaypoints); ri->showWaypoints(_showRouteWaypoints);
ri->showWaypointLabels(_showWaypointLabels);
_scene->addItem(ri); _scene->addItem(ri);
_maxPath = qMax(ri->path().length(), _maxPath); _maxPath = qMax(ri->path().length(), _maxPath);
@ -120,10 +121,10 @@ void TrackView::loadGPX(const GPX &gpx)
{ {
int zoom = _zoom; int zoom = _zoom;
for (int i = 0; i < gpx.trackCount(); i++) for (int i = 0; i < gpx.tracks().count(); i++)
addTrack(gpx.track(i)); addTrack(*(gpx.tracks().at(i)));
for (int i = 0; i < gpx.routeCount(); i++) for (int i = 0; i < gpx.routes().count(); i++)
addRoute(gpx.route(i)); addRoute(*(gpx.routes().at(i)));
addWaypoints(gpx.waypoints()); addWaypoints(gpx.waypoints());
if (_tracks.empty() && _routes.empty() && _waypoints.empty()) if (_tracks.empty() && _routes.empty() && _waypoints.empty())
@ -540,6 +541,9 @@ void TrackView::showWaypointLabels(bool show)
for (int i = 0; i < _waypoints.size(); i++) for (int i = 0; i < _waypoints.size(); i++)
_waypoints.at(i)->showLabel(show); _waypoints.at(i)->showLabel(show);
for (int i = 0; i < _routes.size(); i++)
_routes.at(i)->showWaypointLabels(show);
} }
void TrackView::showRouteWaypoints(bool show) void TrackView::showRouteWaypoints(bool show)