mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-06 07:32:51 +02:00
Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
83189a4e65 | |||
797fd7f02b | |||
a45125be9a | |||
a7154988ab | |||
afe9a14d5b | |||
b3f1596918 | |||
cd90407f56 | |||
73f06e61f0 | |||
c708fa35fd | |||
dcedfe1e9f | |||
daa9d296bd | |||
b8a9a4481c | |||
e792bf3b23 | |||
359a9f0a5a | |||
4b0b6513d1 | |||
c7762e26fb | |||
5b8d41afb7 | |||
81e1664a9b | |||
fad3f116f5 | |||
a6e522d758 | |||
ab65deadb6 | |||
7f80e8f7b7 | |||
9a5c5eaf61 | |||
9bc5016141 | |||
a4a46232e4 | |||
d85fbe5b48 | |||
141e0cb404 | |||
2b7d0cd631 | |||
d106f47771 | |||
e48729fc84 | |||
dca53bc622 | |||
65045dfee4 | |||
002b9c35e1 | |||
945528d6b1 | |||
4697ba4ef0 | |||
9bf1447a7e | |||
1a8114af8e | |||
ad154dfd7d | |||
c2004ded31 | |||
3ced367fab | |||
506d1998f8 | |||
afc5e9ca4b | |||
425d0e3013 | |||
3a8b1107fe | |||
ad7a413d50 | |||
8d5f72de64 |
@ -15,7 +15,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>@EXECUTABLE@</string>
|
<string>@EXECUTABLE@</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>cz.wz.tumic.GPXSee</string>
|
<string>org.gpxsee.GPXSee</string>
|
||||||
|
|
||||||
<key>CFBundleDocumentTypes</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<array>
|
<array>
|
||||||
|
@ -30,4 +30,4 @@ make
|
|||||||
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
||||||
|
|
||||||
## Homepage
|
## Homepage
|
||||||
GPXSee homepage: http://tumic.wz.cz/gpxsee
|
http://www.gpxsee.org
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
VERSION = 4.8
|
VERSION = 4.11
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
network
|
network
|
||||||
@ -94,7 +94,9 @@ HEADERS += src/config.h \
|
|||||||
src/datum.h \
|
src/datum.h \
|
||||||
src/maplist.h \
|
src/maplist.h \
|
||||||
src/albersequal.h \
|
src/albersequal.h \
|
||||||
src/oddspinbox.h
|
src/oddspinbox.h \
|
||||||
|
src/rectc.h \
|
||||||
|
src/searchpointer.h
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/gui.cpp \
|
src/gui.cpp \
|
||||||
src/poi.cpp \
|
src/poi.cpp \
|
||||||
@ -162,7 +164,8 @@ SOURCES += src/main.cpp \
|
|||||||
src/datum.cpp \
|
src/datum.cpp \
|
||||||
src/maplist.cpp \
|
src/maplist.cpp \
|
||||||
src/albersequal.cpp \
|
src/albersequal.cpp \
|
||||||
src/oddspinbox.cpp
|
src/oddspinbox.cpp \
|
||||||
|
src/rectc.cpp
|
||||||
RESOURCES += gpxsee.qrc
|
RESOURCES += gpxsee.qrc
|
||||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||||
lang/gpxsee_sv.ts \
|
lang/gpxsee_sv.ts \
|
||||||
|
@ -25,6 +25,54 @@
|
|||||||
<translation>Maximum</translation>
|
<translation>Maximum</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Data</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="93"/>
|
||||||
|
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
||||||
|
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>CSV files (*.csv)</source>
|
||||||
|
<translation>Soubory CSV (*.csv)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>FIT files (*.fit)</source>
|
||||||
|
<translation>Soubory FIT (*.fit)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>GPX files (*.gpx)</source>
|
||||||
|
<translation>Soubory GPX (*.gpx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>IGC files (*.igc)</source>
|
||||||
|
<translation>Soubory IGC (*.igc)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>KML files (*.kml)</source>
|
||||||
|
<translation>Soubory KML (*.kml)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>NMEA files (*.nmea)</source>
|
||||||
|
<translation>Soubory NMEA (*.nmea)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>TCX files (*.tcx)</source>
|
||||||
|
<translation>Soubory TCX (*.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>All files (*)</source>
|
||||||
|
<translation>Všechny soubory (*)</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ElevationGraph</name>
|
<name>ElevationGraph</name>
|
||||||
<message>
|
<message>
|
||||||
@ -190,366 +238,321 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GUI</name>
|
<name>GUI</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="655"/>
|
<location filename="../src/gui.cpp" line="645"/>
|
||||||
<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="733"/>
|
<location filename="../src/gui.cpp" line="724"/>
|
||||||
<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="823"/>
|
<location filename="../src/gui.cpp" line="814"/>
|
||||||
<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="296"/>
|
<location filename="../src/gui.cpp" line="282"/>
|
||||||
<source>Quit</source>
|
<source>Quit</source>
|
||||||
<translation>Ukončit</translation>
|
<translation>Ukončit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="304"/>
|
<location filename="../src/gui.cpp" line="291"/>
|
||||||
<location filename="../src/gui.cpp" line="671"/>
|
<location filename="../src/gui.cpp" line="662"/>
|
||||||
<location filename="../src/gui.cpp" line="672"/>
|
<location filename="../src/gui.cpp" line="663"/>
|
||||||
<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="328"/>
|
<location filename="../src/gui.cpp" line="316"/>
|
||||||
<source>Close</source>
|
<source>Close</source>
|
||||||
<translation>Zavřít</translation>
|
<translation>Zavřít</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="334"/>
|
<location filename="../src/gui.cpp" line="322"/>
|
||||||
<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="585"/>
|
<location filename="../src/gui.cpp" line="574"/>
|
||||||
<source>Show</source>
|
<source>Show</source>
|
||||||
<translation>Zobrazit</translation>
|
<translation>Zobrazit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="502"/>
|
<location filename="../src/gui.cpp" line="491"/>
|
||||||
<location filename="../src/gui.cpp" line="579"/>
|
<location filename="../src/gui.cpp" line="568"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Soubor</translation>
|
<translation>Soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
<location filename="../src/gui.cpp" line="289"/>
|
||||||
<source>FIT files (*.fit)</source>
|
<location filename="../src/gui.cpp" line="691"/>
|
||||||
<translation>Soubory FIT (*.fit)</translation>
|
<location filename="../src/gui.cpp" line="692"/>
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
|
||||||
<source>IGC files (*.igc)</source>
|
|
||||||
<translation>Soubory IGC (*.igc)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>NMEA files (*.nmea)</source>
|
|
||||||
<translation>Soubory NMEA (*.nmea)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="302"/>
|
|
||||||
<location filename="../src/gui.cpp" line="700"/>
|
|
||||||
<location filename="../src/gui.cpp" line="701"/>
|
|
||||||
<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="345"/>
|
<location filename="../src/gui.cpp" line="333"/>
|
||||||
<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="347"/>
|
<location filename="../src/gui.cpp" line="335"/>
|
||||||
<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="351"/>
|
<location filename="../src/gui.cpp" line="339"/>
|
||||||
<source>Show POI labels</source>
|
<source>Show POI labels</source>
|
||||||
<translation>Zobrazit názvy POI</translation>
|
<translation>Zobrazit názvy POI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="356"/>
|
<location filename="../src/gui.cpp" line="344"/>
|
||||||
<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="365"/>
|
<location filename="../src/gui.cpp" line="353"/>
|
||||||
<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="375"/>
|
<location filename="../src/gui.cpp" line="363"/>
|
||||||
<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="312"/>
|
<location filename="../src/gui.cpp" line="300"/>
|
||||||
<source>Open...</source>
|
<source>Open...</source>
|
||||||
<translation>Otevřít...</translation>
|
<translation>Otevřít...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="342"/>
|
<location filename="../src/gui.cpp" line="330"/>
|
||||||
<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="373"/>
|
<location filename="../src/gui.cpp" line="361"/>
|
||||||
<source>Load map...</source>
|
<source>Load map...</source>
|
||||||
<translation>Nahrát mapu...</translation>
|
<translation>Nahrát mapu...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="379"/>
|
<location filename="../src/gui.cpp" line="367"/>
|
||||||
<location filename="../src/gui.cpp" line="383"/>
|
<location filename="../src/gui.cpp" line="371"/>
|
||||||
<location filename="../src/gui.cpp" line="683"/>
|
<location filename="../src/gui.cpp" line="674"/>
|
||||||
<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="393"/>
|
<location filename="../src/gui.cpp" line="381"/>
|
||||||
<source>Show tracks</source>
|
<source>Show tracks</source>
|
||||||
<translation>Zobrazit cesty</translation>
|
<translation>Zobrazit cesty</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="397"/>
|
<location filename="../src/gui.cpp" line="385"/>
|
||||||
<source>Show routes</source>
|
<source>Show routes</source>
|
||||||
<translation>Zobrazit trasy</translation>
|
<translation>Zobrazit trasy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="401"/>
|
<location filename="../src/gui.cpp" line="389"/>
|
||||||
<source>Show waypoints</source>
|
<source>Show waypoints</source>
|
||||||
<translation>Zobrazit navigační body</translation>
|
<translation>Zobrazit navigační body</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="405"/>
|
<location filename="../src/gui.cpp" line="393"/>
|
||||||
<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="416"/>
|
<location filename="../src/gui.cpp" line="404"/>
|
||||||
<source>Show graphs</source>
|
<source>Show graphs</source>
|
||||||
<translation>Zobrazit grafy</translation>
|
<translation>Zobrazit grafy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="438"/>
|
<location filename="../src/gui.cpp" line="426"/>
|
||||||
<source>Show grid</source>
|
<source>Show grid</source>
|
||||||
<translation>Zobrazit mřížku</translation>
|
<translation>Zobrazit mřížku</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="444"/>
|
<location filename="../src/gui.cpp" line="432"/>
|
||||||
<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="450"/>
|
<location filename="../src/gui.cpp" line="438"/>
|
||||||
<source>Total time</source>
|
<source>Total time</source>
|
||||||
<translation>Celkový čas</translation>
|
<translation>Celkový čas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="455"/>
|
<location filename="../src/gui.cpp" line="443"/>
|
||||||
<location filename="../src/gui.cpp" line="1015"/>
|
<location filename="../src/gui.cpp" line="1006"/>
|
||||||
<source>Moving time</source>
|
<source>Moving time</source>
|
||||||
<translation>Čistý čas</translation>
|
<translation>Čistý čas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="462"/>
|
<location filename="../src/gui.cpp" line="450"/>
|
||||||
<source>Metric</source>
|
<source>Metric</source>
|
||||||
<translation>Metrické</translation>
|
<translation>Metrické</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="467"/>
|
<location filename="../src/gui.cpp" line="455"/>
|
||||||
<source>Imperial</source>
|
<source>Imperial</source>
|
||||||
<translation>Imperiální</translation>
|
<translation>Imperiální</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="473"/>
|
<location filename="../src/gui.cpp" line="461"/>
|
||||||
<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="479"/>
|
<location filename="../src/gui.cpp" line="467"/>
|
||||||
<source>Options...</source>
|
<source>Options...</source>
|
||||||
<translation>Nastavení...</translation>
|
<translation>Nastavení...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="484"/>
|
<location filename="../src/gui.cpp" line="473"/>
|
||||||
<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="487"/>
|
<location filename="../src/gui.cpp" line="476"/>
|
||||||
<source>Previous</source>
|
<source>Previous</source>
|
||||||
<translation>Předchozí</translation>
|
<translation>Předchozí</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="491"/>
|
<location filename="../src/gui.cpp" line="480"/>
|
||||||
<source>Last</source>
|
<source>Last</source>
|
||||||
<translation>Poslední</translation>
|
<translation>Poslední</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="494"/>
|
<location filename="../src/gui.cpp" line="483"/>
|
||||||
<source>First</source>
|
<source>First</source>
|
||||||
<translation>První</translation>
|
<translation>První</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="516"/>
|
<location filename="../src/gui.cpp" line="505"/>
|
||||||
<source>Map</source>
|
<source>Map</source>
|
||||||
<translation>Mapa</translation>
|
<translation>Mapa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="524"/>
|
<location filename="../src/gui.cpp" line="513"/>
|
||||||
<source>Graph</source>
|
<source>Graph</source>
|
||||||
<translation>Graf</translation>
|
<translation>Graf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="532"/>
|
<location filename="../src/gui.cpp" line="521"/>
|
||||||
<source>POI</source>
|
<source>POI</source>
|
||||||
<translation>POI</translation>
|
<translation>POI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="533"/>
|
<location filename="../src/gui.cpp" line="522"/>
|
||||||
<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="544"/>
|
<location filename="../src/gui.cpp" line="533"/>
|
||||||
<source>Data</source>
|
<source>Data</source>
|
||||||
<translation>Data</translation>
|
<translation>Data</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="545"/>
|
<location filename="../src/gui.cpp" line="534"/>
|
||||||
<source>Display</source>
|
<source>Display</source>
|
||||||
<translation>Zobrazit</translation>
|
<translation>Zobrazit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="553"/>
|
<location filename="../src/gui.cpp" line="542"/>
|
||||||
<source>Settings</source>
|
<source>Settings</source>
|
||||||
<translation>Nastavení</translation>
|
<translation>Nastavení</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="557"/>
|
<location filename="../src/gui.cpp" line="546"/>
|
||||||
<source>Units</source>
|
<source>Units</source>
|
||||||
<translation>Jednotky</translation>
|
<translation>Jednotky</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="566"/>
|
<location filename="../src/gui.cpp" line="555"/>
|
||||||
<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="681"/>
|
<location filename="../src/gui.cpp" line="672"/>
|
||||||
<source>Append file</source>
|
<source>Append file</source>
|
||||||
<translation>Přidat soubor</translation>
|
<translation>Přidat soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="682"/>
|
<location filename="../src/gui.cpp" line="673"/>
|
||||||
<source>Next/Previous</source>
|
<source>Next/Previous</source>
|
||||||
<translation>Následující/Předchozí</translation>
|
<translation>Následující/Předchozí</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="685"/>
|
<location filename="../src/gui.cpp" line="676"/>
|
||||||
<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="686"/>
|
<location filename="../src/gui.cpp" line="677"/>
|
||||||
<source>Zoom in</source>
|
<source>Zoom in</source>
|
||||||
<translation>Přiblížit</translation>
|
<translation>Přiblížit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="688"/>
|
<location filename="../src/gui.cpp" line="679"/>
|
||||||
<source>Zoom out</source>
|
<source>Zoom out</source>
|
||||||
<translation>Oddálit</translation>
|
<translation>Oddálit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="690"/>
|
<location filename="../src/gui.cpp" line="681"/>
|
||||||
<source>Digital zoom</source>
|
<source>Digital zoom</source>
|
||||||
<translation>Digitální zoom</translation>
|
<translation>Digitální zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="691"/>
|
<location filename="../src/gui.cpp" line="682"/>
|
||||||
<source>Zoom</source>
|
<source>Zoom</source>
|
||||||
<translation>Zoom</translation>
|
<translation>Zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="703"/>
|
<location filename="../src/gui.cpp" line="694"/>
|
||||||
<source>Online maps</source>
|
<source>Online maps</source>
|
||||||
<translation>Online mapy</translation>
|
<translation>Online mapy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="704"/>
|
<location filename="../src/gui.cpp" line="695"/>
|
||||||
<source>Online map URLs are read on program startup from the following file:</source>
|
<source>Online map URLs are read on program startup from the following file:</source>
|
||||||
<translation>URL online map jsou načteny při startu programu z následujícího souboru:</translation>
|
<translation>URL online map jsou načteny při startu programu z následujícího souboru:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="715"/>
|
<location filename="../src/gui.cpp" line="706"/>
|
||||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||||
<translation>Offline mapy jsou načítány při startu aplikace z následujícího adresáře:</translation>
|
<translation>Offline mapy jsou načítány při startu aplikace z následujícího adresáře:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1206"/>
|
<location filename="../src/gui.cpp" line="1197"/>
|
||||||
<source>Open map file</source>
|
<source>Open map file</source>
|
||||||
<translation>Otevřít mapový soubor</translation>
|
<translation>Otevřít mapový soubor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1239"/>
|
<location filename="../src/gui.cpp" line="1233"/>
|
||||||
<source>No files loaded</source>
|
<source>No files loaded</source>
|
||||||
<translation>Nejsou načteny žádné soubory</translation>
|
<translation>Nejsou načteny žádné soubory</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
<location filename="../src/gui.cpp" line="992"/>
|
||||||
<source>GPX files (*.gpx)</source>
|
<location filename="../src/gui.cpp" line="995"/>
|
||||||
<translation>Soubory GPX (*.gpx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>TCX files (*.tcx)</source>
|
|
||||||
<translation>Soubory TCX (*.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>KML files (*.kml)</source>
|
|
||||||
<translation>Soubory KML (*.kml)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
|
||||||
<source>CSV files (*.csv)</source>
|
|
||||||
<translation>Soubory CSV (*.csv)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>All files (*)</source>
|
|
||||||
<translation>Všechny soubory (*)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1001"/>
|
|
||||||
<location filename="../src/gui.cpp" line="1004"/>
|
|
||||||
<source>Date</source>
|
<source>Date</source>
|
||||||
<translation>Datum</translation>
|
<translation>Datum</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="993"/>
|
<location filename="../src/gui.cpp" line="984"/>
|
||||||
<source>Routes</source>
|
<source>Routes</source>
|
||||||
<translation>Trasy</translation>
|
<translation>Trasy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1207"/>
|
<location filename="../src/gui.cpp" line="1218"/>
|
||||||
<source>Map files (*.map *.tba *.tar)</source>
|
|
||||||
<translation>Mapové soubory (*.map *.tba *.tar)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1224"/>
|
|
||||||
<source>Error loading map:</source>
|
<source>Error loading map:</source>
|
||||||
<translation>Mapu nelze načíst:</translation>
|
<translation>Mapu nelze načíst:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../src/gui.cpp" line="1243"/>
|
<location filename="../src/gui.cpp" line="1237"/>
|
||||||
<source>%n files</source>
|
<source>%n files</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n soubor</numerusform>
|
<numerusform>%n soubor</numerusform>
|
||||||
@ -558,127 +561,122 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="675"/>
|
<location filename="../src/gui.cpp" line="666"/>
|
||||||
<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="652"/>
|
<location filename="../src/gui.cpp" line="642"/>
|
||||||
<source>Version </source>
|
<source>Version </source>
|
||||||
<translation>Verze </translation>
|
<translation>Verze </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="317"/>
|
<location filename="../src/gui.cpp" line="305"/>
|
||||||
<source>Print...</source>
|
<source>Print...</source>
|
||||||
<translation>Tisknout...</translation>
|
<translation>Tisknout...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="322"/>
|
<location filename="../src/gui.cpp" line="310"/>
|
||||||
<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="995"/>
|
<location filename="../src/gui.cpp" line="986"/>
|
||||||
<source>Waypoints</source>
|
<source>Waypoints</source>
|
||||||
<translation>Navigační body</translation>
|
<translation>Navigační body</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="676"/>
|
<location filename="../src/gui.cpp" line="667"/>
|
||||||
<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="107"/>
|
<location filename="../src/gui.cpp" line="397"/>
|
||||||
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
|
||||||
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="409"/>
|
|
||||||
<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="678"/>
|
<location filename="../src/gui.cpp" line="669"/>
|
||||||
<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="680"/>
|
<location filename="../src/gui.cpp" line="671"/>
|
||||||
<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="707"/>
|
<location filename="../src/gui.cpp" line="698"/>
|
||||||
<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="714"/>
|
<location filename="../src/gui.cpp" line="705"/>
|
||||||
<source>Offline maps</source>
|
<source>Offline maps</source>
|
||||||
<translation>Offline mapy</translation>
|
<translation>Offline mapy</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="718"/>
|
<location filename="../src/gui.cpp" line="709"/>
|
||||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||||
<translation>Očekávaná struktura je jedna mapa/atlas v samostatném podadresáři. Podporované mapové formáty jsou OziExplorer mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
|
<translation>Očekávaná struktura je jedna mapa/atlas v samostatném podadresáři. Podporované mapové formáty jsou OziExplorer mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="723"/>
|
<location filename="../src/gui.cpp" line="714"/>
|
||||||
<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="812"/>
|
<location filename="../src/gui.cpp" line="803"/>
|
||||||
<source>Error loading data file:</source>
|
<source>Error loading data file:</source>
|
||||||
<translation>Datový soubor nelze načíst:</translation>
|
<translation>Datový soubor nelze načíst:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="815"/>
|
<location filename="../src/gui.cpp" line="806"/>
|
||||||
<location filename="../src/gui.cpp" line="840"/>
|
<location filename="../src/gui.cpp" line="831"/>
|
||||||
<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="837"/>
|
<location filename="../src/gui.cpp" line="828"/>
|
||||||
<source>Error loading POI file:</source>
|
<source>Error loading POI file:</source>
|
||||||
<translation>Soubor POI nelze načíst:</translation>
|
<translation>Soubor POI nelze načíst:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="987"/>
|
<location filename="../src/gui.cpp" line="978"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation>Název</translation>
|
<translation>Název</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="991"/>
|
<location filename="../src/gui.cpp" line="982"/>
|
||||||
<source>Tracks</source>
|
<source>Tracks</source>
|
||||||
<translation>Cesty</translation>
|
<translation>Cesty</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="307"/>
|
<location filename="../src/gui.cpp" line="294"/>
|
||||||
<location filename="../src/gui.cpp" line="651"/>
|
<location filename="../src/gui.cpp" line="641"/>
|
||||||
<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="590"/>
|
<location filename="../src/gui.cpp" line="579"/>
|
||||||
<source>Navigation</source>
|
<source>Navigation</source>
|
||||||
<translation>Navigace</translation>
|
<translation>Navigace</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="722"/>
|
<location filename="../src/gui.cpp" line="713"/>
|
||||||
<source>POIs</source>
|
<source>POIs</source>
|
||||||
<translation>POI body</translation>
|
<translation>POI body</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="424"/>
|
<location filename="../src/gui.cpp" line="412"/>
|
||||||
<location filename="../src/gui.cpp" line="1011"/>
|
<location filename="../src/gui.cpp" line="1002"/>
|
||||||
<source>Distance</source>
|
<source>Distance</source>
|
||||||
<translation>Vzdálenost</translation>
|
<translation>Vzdálenost</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="431"/>
|
<location filename="../src/gui.cpp" line="419"/>
|
||||||
<location filename="../src/gui.cpp" line="554"/>
|
<location filename="../src/gui.cpp" line="543"/>
|
||||||
<location filename="../src/gui.cpp" line="1013"/>
|
<location filename="../src/gui.cpp" line="1004"/>
|
||||||
<source>Time</source>
|
<source>Time</source>
|
||||||
<translation>Čas</translation>
|
<translation>Čas</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -756,6 +754,19 @@
|
|||||||
<translation>Maximum</translation>
|
<translation>Maximum</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>MapList</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="127"/>
|
||||||
|
<source>Map files (*.map *.tba *.tar)</source>
|
||||||
|
<translation>Mapové soubory (*.map *.tba *.tar)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="128"/>
|
||||||
|
<source>URL list files (*.txt)</source>
|
||||||
|
<translation>Seznamy URL (*.txt)</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>OptionsDialog</name>
|
<name>OptionsDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -25,6 +25,54 @@
|
|||||||
<translation>Maximum</translation>
|
<translation>Maximum</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Data</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="93"/>
|
||||||
|
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
||||||
|
<translation>Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>CSV files (*.csv)</source>
|
||||||
|
<translation>CSV-Dateien (*.csv)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>FIT files (*.fit)</source>
|
||||||
|
<translation>FIT-Dateien (*.fit)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>GPX files (*.gpx)</source>
|
||||||
|
<translation>GPX-Dateien (*.gpx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>IGC files (*.igc)</source>
|
||||||
|
<translation>IGC-Dateien (*.igc)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>KML files (*.kml)</source>
|
||||||
|
<translation>KML-Dateien (*.kml)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>NMEA files (*.nmea)</source>
|
||||||
|
<translation>NMEA-Dateien (*.nmea)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>TCX files (*.tcx)</source>
|
||||||
|
<translation>TCX-Dateien (*.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>All files (*)</source>
|
||||||
|
<translation>Alle Dateien (*)</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ElevationGraph</name>
|
<name>ElevationGraph</name>
|
||||||
<message>
|
<message>
|
||||||
@ -190,335 +238,315 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GUI</name>
|
<name>GUI</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="655"/>
|
<location filename="../src/gui.cpp" line="645"/>
|
||||||
<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>GPXSee wird unter der GNU General Public License version 3 vertrieben. Mehr Informationen zu GPXSee auf der Homepage </translation>
|
<translation>GPXSee wird unter der GNU General Public License version 3 vertrieben. Mehr Informationen zu GPXSee auf der Homepage </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="733"/>
|
<location filename="../src/gui.cpp" line="724"/>
|
||||||
<source>Open file</source>
|
<source>Open file</source>
|
||||||
<translation>Datei öffnen</translation>
|
<translation>Datei öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="823"/>
|
<location filename="../src/gui.cpp" line="814"/>
|
||||||
<source>Open POI file</source>
|
<source>Open POI file</source>
|
||||||
<translation>POI Datei öffnen</translation>
|
<translation>POI Datei öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="296"/>
|
<location filename="../src/gui.cpp" line="282"/>
|
||||||
<source>Quit</source>
|
<source>Quit</source>
|
||||||
<translation>Beenden</translation>
|
<translation>Beenden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="304"/>
|
<location filename="../src/gui.cpp" line="291"/>
|
||||||
<location filename="../src/gui.cpp" line="671"/>
|
<location filename="../src/gui.cpp" line="662"/>
|
||||||
<location filename="../src/gui.cpp" line="672"/>
|
<location filename="../src/gui.cpp" line="663"/>
|
||||||
<source>Keyboard controls</source>
|
<source>Keyboard controls</source>
|
||||||
<translation>Tastaturkürzel</translation>
|
<translation>Tastaturkürzel</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="328"/>
|
<location filename="../src/gui.cpp" line="316"/>
|
||||||
<source>Close</source>
|
<source>Close</source>
|
||||||
<translation>Schließen</translation>
|
<translation>Schließen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="334"/>
|
<location filename="../src/gui.cpp" line="322"/>
|
||||||
<source>Reload</source>
|
<source>Reload</source>
|
||||||
<translation>Neu Laden</translation>
|
<translation>Neu Laden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="585"/>
|
<location filename="../src/gui.cpp" line="574"/>
|
||||||
<source>Show</source>
|
<source>Show</source>
|
||||||
<translation>Ansicht</translation>
|
<translation>Ansicht</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="502"/>
|
<location filename="../src/gui.cpp" line="491"/>
|
||||||
<location filename="../src/gui.cpp" line="579"/>
|
<location filename="../src/gui.cpp" line="568"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Datei</translation>
|
<translation>Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
<location filename="../src/gui.cpp" line="289"/>
|
||||||
<source>FIT files (*.fit)</source>
|
<location filename="../src/gui.cpp" line="691"/>
|
||||||
<translation>FIT-Dateien (*.fit)</translation>
|
<location filename="../src/gui.cpp" line="692"/>
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
|
||||||
<source>IGC files (*.igc)</source>
|
|
||||||
<translation>IGC-Dateien (*.igc)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>NMEA files (*.nmea)</source>
|
|
||||||
<translation>NMEA-Dateien (*.nmea)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="302"/>
|
|
||||||
<location filename="../src/gui.cpp" line="700"/>
|
|
||||||
<location filename="../src/gui.cpp" line="701"/>
|
|
||||||
<source>Data sources</source>
|
<source>Data sources</source>
|
||||||
<translation>Datenquellen</translation>
|
<translation>Datenquellen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="345"/>
|
<location filename="../src/gui.cpp" line="333"/>
|
||||||
<source>Close POI files</source>
|
<source>Close POI files</source>
|
||||||
<translation>POI-Datei schließen</translation>
|
<translation>POI-Datei schließen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="347"/>
|
<location filename="../src/gui.cpp" line="335"/>
|
||||||
<source>Overlap POIs</source>
|
<source>Overlap POIs</source>
|
||||||
<translation>POI überlappen</translation>
|
<translation>POI überlappen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="351"/>
|
<location filename="../src/gui.cpp" line="339"/>
|
||||||
<source>Show POI labels</source>
|
<source>Show POI labels</source>
|
||||||
<translation>POI-Labels anzeigen</translation>
|
<translation>POI-Labels anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="356"/>
|
<location filename="../src/gui.cpp" line="344"/>
|
||||||
<source>Show POIs</source>
|
<source>Show POIs</source>
|
||||||
<translation>POIs anzeigen</translation>
|
<translation>POIs anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="365"/>
|
<location filename="../src/gui.cpp" line="353"/>
|
||||||
<source>Show map</source>
|
<source>Show map</source>
|
||||||
<translation>Karte anzeigen</translation>
|
<translation>Karte anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="375"/>
|
<location filename="../src/gui.cpp" line="363"/>
|
||||||
<source>Clear tile cache</source>
|
<source>Clear tile cache</source>
|
||||||
<translation>Tile-Cache bereinigen</translation>
|
<translation>Tile-Cache bereinigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="312"/>
|
<location filename="../src/gui.cpp" line="300"/>
|
||||||
<source>Open...</source>
|
<source>Open...</source>
|
||||||
<translation>Öffnen...</translation>
|
<translation>Öffnen...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="342"/>
|
<location filename="../src/gui.cpp" line="330"/>
|
||||||
<source>Load POI file...</source>
|
<source>Load POI file...</source>
|
||||||
<translation>POI-Datei laden...</translation>
|
<translation>POI-Datei laden...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="373"/>
|
<location filename="../src/gui.cpp" line="361"/>
|
||||||
<source>Load map...</source>
|
<source>Load map...</source>
|
||||||
<translation>Karte laden...</translation>
|
<translation>Karte laden...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="379"/>
|
<location filename="../src/gui.cpp" line="367"/>
|
||||||
<location filename="../src/gui.cpp" line="383"/>
|
<location filename="../src/gui.cpp" line="371"/>
|
||||||
<location filename="../src/gui.cpp" line="683"/>
|
<location filename="../src/gui.cpp" line="674"/>
|
||||||
<source>Next map</source>
|
<source>Next map</source>
|
||||||
<translation>Nächste Karte</translation>
|
<translation>Nächste Karte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="393"/>
|
<location filename="../src/gui.cpp" line="381"/>
|
||||||
<source>Show tracks</source>
|
<source>Show tracks</source>
|
||||||
<translation>Strecken anzeigen</translation>
|
<translation>Strecken anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="397"/>
|
<location filename="../src/gui.cpp" line="385"/>
|
||||||
<source>Show routes</source>
|
<source>Show routes</source>
|
||||||
<translation>Routen anzeigen</translation>
|
<translation>Routen anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="401"/>
|
<location filename="../src/gui.cpp" line="389"/>
|
||||||
<source>Show waypoints</source>
|
<source>Show waypoints</source>
|
||||||
<translation>Wegpunkte anzeigen</translation>
|
<translation>Wegpunkte anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="405"/>
|
<location filename="../src/gui.cpp" line="393"/>
|
||||||
<source>Waypoint labels</source>
|
<source>Waypoint labels</source>
|
||||||
<translation>Wegpunkt Labels</translation>
|
<translation>Wegpunkt Labels</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="416"/>
|
<location filename="../src/gui.cpp" line="404"/>
|
||||||
<source>Show graphs</source>
|
<source>Show graphs</source>
|
||||||
<translation>Graphen anzeigen</translation>
|
<translation>Graphen anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="438"/>
|
<location filename="../src/gui.cpp" line="426"/>
|
||||||
<source>Show grid</source>
|
<source>Show grid</source>
|
||||||
<translation>Gitter anzeigen</translation>
|
<translation>Gitter anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="444"/>
|
<location filename="../src/gui.cpp" line="432"/>
|
||||||
<source>Show toolbars</source>
|
<source>Show toolbars</source>
|
||||||
<translation>Toolbars anzeigen</translation>
|
<translation>Toolbars anzeigen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="450"/>
|
<location filename="../src/gui.cpp" line="438"/>
|
||||||
<source>Total time</source>
|
<source>Total time</source>
|
||||||
<translation>Gesamtzeit</translation>
|
<translation>Gesamtzeit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="455"/>
|
<location filename="../src/gui.cpp" line="443"/>
|
||||||
<location filename="../src/gui.cpp" line="1015"/>
|
<location filename="../src/gui.cpp" line="1006"/>
|
||||||
<source>Moving time</source>
|
<source>Moving time</source>
|
||||||
<translation>Bewegungszeit</translation>
|
<translation>Bewegungszeit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="462"/>
|
<location filename="../src/gui.cpp" line="450"/>
|
||||||
<source>Metric</source>
|
<source>Metric</source>
|
||||||
<translation>Metrisch</translation>
|
<translation>Metrisch</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="467"/>
|
<location filename="../src/gui.cpp" line="455"/>
|
||||||
<source>Imperial</source>
|
<source>Imperial</source>
|
||||||
<translation>Imperial</translation>
|
<translation>Imperial</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="473"/>
|
<location filename="../src/gui.cpp" line="461"/>
|
||||||
<source>Fullscreen mode</source>
|
<source>Fullscreen mode</source>
|
||||||
<translation>Vollbildmodus</translation>
|
<translation>Vollbildmodus</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="479"/>
|
<location filename="../src/gui.cpp" line="467"/>
|
||||||
<source>Options...</source>
|
<source>Options...</source>
|
||||||
<translation>Einstellungen...</translation>
|
<translation>Einstellungen...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="484"/>
|
<location filename="../src/gui.cpp" line="473"/>
|
||||||
<source>Next</source>
|
<source>Next</source>
|
||||||
<translation>Nächste</translation>
|
<translation>Nächste</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="487"/>
|
<location filename="../src/gui.cpp" line="476"/>
|
||||||
<source>Previous</source>
|
<source>Previous</source>
|
||||||
<translation>Vorherige</translation>
|
<translation>Vorherige</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="491"/>
|
<location filename="../src/gui.cpp" line="480"/>
|
||||||
<source>Last</source>
|
<source>Last</source>
|
||||||
<translation>Letzte</translation>
|
<translation>Letzte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="494"/>
|
<location filename="../src/gui.cpp" line="483"/>
|
||||||
<source>First</source>
|
<source>First</source>
|
||||||
<translation>Erste</translation>
|
<translation>Erste</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="516"/>
|
<location filename="../src/gui.cpp" line="505"/>
|
||||||
<source>Map</source>
|
<source>Map</source>
|
||||||
<translation>Karte</translation>
|
<translation>Karte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="524"/>
|
<location filename="../src/gui.cpp" line="513"/>
|
||||||
<source>Graph</source>
|
<source>Graph</source>
|
||||||
<translation>Graph</translation>
|
<translation>Graph</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="532"/>
|
<location filename="../src/gui.cpp" line="521"/>
|
||||||
<source>POI</source>
|
<source>POI</source>
|
||||||
<translation>POI</translation>
|
<translation>POI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="533"/>
|
<location filename="../src/gui.cpp" line="522"/>
|
||||||
<source>POI files</source>
|
<source>POI files</source>
|
||||||
<translation>POI-Dateien</translation>
|
<translation>POI-Dateien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="544"/>
|
<location filename="../src/gui.cpp" line="533"/>
|
||||||
<source>Data</source>
|
<source>Data</source>
|
||||||
<translation>Daten</translation>
|
<translation>Daten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="545"/>
|
<location filename="../src/gui.cpp" line="534"/>
|
||||||
<source>Display</source>
|
<source>Display</source>
|
||||||
<translation>Anzeige</translation>
|
<translation>Anzeige</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="553"/>
|
<location filename="../src/gui.cpp" line="542"/>
|
||||||
<source>Settings</source>
|
<source>Settings</source>
|
||||||
<translation>Einstellungen</translation>
|
<translation>Einstellungen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="557"/>
|
<location filename="../src/gui.cpp" line="546"/>
|
||||||
<source>Units</source>
|
<source>Units</source>
|
||||||
<translation>Einheiten</translation>
|
<translation>Einheiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="566"/>
|
<location filename="../src/gui.cpp" line="555"/>
|
||||||
<source>Help</source>
|
<source>Help</source>
|
||||||
<translation>Hilfe</translation>
|
<translation>Hilfe</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="681"/>
|
<location filename="../src/gui.cpp" line="672"/>
|
||||||
<source>Append file</source>
|
<source>Append file</source>
|
||||||
<translation>An Datei anhängen</translation>
|
<translation>An Datei anhängen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="682"/>
|
<location filename="../src/gui.cpp" line="673"/>
|
||||||
<source>Next/Previous</source>
|
<source>Next/Previous</source>
|
||||||
<translation>Nächste/Vorherige</translation>
|
<translation>Nächste/Vorherige</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="685"/>
|
<location filename="../src/gui.cpp" line="676"/>
|
||||||
<source>Previous map</source>
|
<source>Previous map</source>
|
||||||
<translation>Vorherige Karte</translation>
|
<translation>Vorherige Karte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="686"/>
|
<location filename="../src/gui.cpp" line="677"/>
|
||||||
<source>Zoom in</source>
|
<source>Zoom in</source>
|
||||||
<translation>Hineinzoomen</translation>
|
<translation>Hineinzoomen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="688"/>
|
<location filename="../src/gui.cpp" line="679"/>
|
||||||
<source>Zoom out</source>
|
<source>Zoom out</source>
|
||||||
<translation>Herauszoomen</translation>
|
<translation>Herauszoomen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="690"/>
|
<location filename="../src/gui.cpp" line="681"/>
|
||||||
<source>Digital zoom</source>
|
<source>Digital zoom</source>
|
||||||
<translation>Digitaler Zoom</translation>
|
<translation>Digitaler Zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="691"/>
|
<location filename="../src/gui.cpp" line="682"/>
|
||||||
<source>Zoom</source>
|
<source>Zoom</source>
|
||||||
<translation>Zoom</translation>
|
<translation>Zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="703"/>
|
<location filename="../src/gui.cpp" line="694"/>
|
||||||
<source>Online maps</source>
|
<source>Online maps</source>
|
||||||
<translation>Onlinekarten</translation>
|
<translation>Onlinekarten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="704"/>
|
<location filename="../src/gui.cpp" line="695"/>
|
||||||
<source>Online map URLs are read on program startup from the following file:</source>
|
<source>Online map URLs are read on program startup from the following file:</source>
|
||||||
<translation>Onlinekarten URLs werden zu Programmstart aus der folgenden Datei gelesen:</translation>
|
<translation>Onlinekarten URLs werden zu Programmstart aus der folgenden Datei gelesen:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="714"/>
|
<location filename="../src/gui.cpp" line="705"/>
|
||||||
<source>Offline maps</source>
|
<source>Offline maps</source>
|
||||||
<translation>Offlinekarten</translation>
|
<translation>Offlinekarten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="715"/>
|
<location filename="../src/gui.cpp" line="706"/>
|
||||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||||
<translation>Offlinekarten werden zu Programmstart aus dem folgenden Verzeichnis geladen:</translation>
|
<translation>Offlinekarten werden zu Programmstart aus dem folgenden Verzeichnis geladen:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1206"/>
|
<location filename="../src/gui.cpp" line="1197"/>
|
||||||
<source>Open map file</source>
|
<source>Open map file</source>
|
||||||
<translation>Karte Datei öffnen</translation>
|
<translation>Karte Datei öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1207"/>
|
<location filename="../src/gui.cpp" line="1218"/>
|
||||||
<source>Map files (*.map *.tba *.tar)</source>
|
|
||||||
<translation>Karten-Dateien (*.map *.tba *.tar)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1224"/>
|
|
||||||
<source>Error loading map:</source>
|
<source>Error loading map:</source>
|
||||||
<translation>Fehler beim Laden der Karte-Datei:</translation>
|
<translation>Fehler beim Laden der Karte-Datei:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1239"/>
|
<location filename="../src/gui.cpp" line="1233"/>
|
||||||
<source>No files loaded</source>
|
<source>No files loaded</source>
|
||||||
<translation>Keine Dateien geladen</translation>
|
<translation>Keine Dateien geladen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../src/gui.cpp" line="1243"/>
|
<location filename="../src/gui.cpp" line="1237"/>
|
||||||
<source>%n files</source>
|
<source>%n files</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n Datei</numerusform>
|
<numerusform>%n Datei</numerusform>
|
||||||
@ -526,158 +554,128 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
<location filename="../src/gui.cpp" line="992"/>
|
||||||
<source>GPX files (*.gpx)</source>
|
<location filename="../src/gui.cpp" line="995"/>
|
||||||
<translation>GPX-Dateien (*.gpx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>TCX files (*.tcx)</source>
|
|
||||||
<translation>TCX-Dateien (*.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>KML files (*.kml)</source>
|
|
||||||
<translation>KML-Dateien (*.kml)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
|
||||||
<source>CSV files (*.csv)</source>
|
|
||||||
<translation>CSV-Dateien (*.csv)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>All files (*)</source>
|
|
||||||
<translation>Alle Dateien (*)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1001"/>
|
|
||||||
<location filename="../src/gui.cpp" line="1004"/>
|
|
||||||
<source>Date</source>
|
<source>Date</source>
|
||||||
<translation>Datum</translation>
|
<translation>Datum</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="993"/>
|
<location filename="../src/gui.cpp" line="984"/>
|
||||||
<source>Routes</source>
|
<source>Routes</source>
|
||||||
<translation>Routen</translation>
|
<translation>Routen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="675"/>
|
<location filename="../src/gui.cpp" line="666"/>
|
||||||
<source>Next file</source>
|
<source>Next file</source>
|
||||||
<translation>Nächste Datei</translation>
|
<translation>Nächste Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="652"/>
|
<location filename="../src/gui.cpp" line="642"/>
|
||||||
<source>Version </source>
|
<source>Version </source>
|
||||||
<translation>Version </translation>
|
<translation>Version </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="317"/>
|
<location filename="../src/gui.cpp" line="305"/>
|
||||||
<source>Print...</source>
|
<source>Print...</source>
|
||||||
<translation>Drucken...</translation>
|
<translation>Drucken...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="322"/>
|
<location filename="../src/gui.cpp" line="310"/>
|
||||||
<source>Export to PDF...</source>
|
<source>Export to PDF...</source>
|
||||||
<translation>Als PDF exportieren...</translation>
|
<translation>Als PDF exportieren...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="995"/>
|
<location filename="../src/gui.cpp" line="986"/>
|
||||||
<source>Waypoints</source>
|
<source>Waypoints</source>
|
||||||
<translation>Wegpunkte</translation>
|
<translation>Wegpunkte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="676"/>
|
<location filename="../src/gui.cpp" line="667"/>
|
||||||
<source>Previous file</source>
|
<source>Previous file</source>
|
||||||
<translation>Vorherige Datei</translation>
|
<translation>Vorherige Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="107"/>
|
<location filename="../src/gui.cpp" line="397"/>
|
||||||
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
|
||||||
<translation>Unterstütze Dateien (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="409"/>
|
|
||||||
<source>Route waypoints</source>
|
<source>Route waypoints</source>
|
||||||
<translation>Routen Wegpunkte</translation>
|
<translation>Routen Wegpunkte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="678"/>
|
<location filename="../src/gui.cpp" line="669"/>
|
||||||
<source>First file</source>
|
<source>First file</source>
|
||||||
<translation>Erste Datei</translation>
|
<translation>Erste Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="680"/>
|
<location filename="../src/gui.cpp" line="671"/>
|
||||||
<source>Last file</source>
|
<source>Last file</source>
|
||||||
<translation>Letzte Datei</translation>
|
<translation>Letzte Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="707"/>
|
<location filename="../src/gui.cpp" line="698"/>
|
||||||
<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>Das Dateiformat ist eine Karte pro Linie. Jede Linie besteht aus dem Kartenname und die durch ein TAB Zeichen getrennte Tiles URL. X und Y Koordinate einer Tile werden in der URL durch $x und $y ersetzt und das Zoomlevel durch $z. Ein Beispiel einer Kartendatei könnte so aussehen:</translation>
|
<translation>Das Dateiformat ist eine Karte pro Linie. Jede Linie besteht aus dem Kartenname und die durch ein TAB Zeichen getrennte Tiles URL. X und Y Koordinate einer Tile werden in der URL durch $x und $y ersetzt und das Zoomlevel durch $z. Ein Beispiel einer Kartendatei könnte so aussehen:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="718"/>
|
<location filename="../src/gui.cpp" line="709"/>
|
||||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||||
<translation>Die erwartete Struktur ist eine Karte/ein Atlas pro Unterverzeichnis. Unterstützte Kartenformate sind OziExplorer Karten und TrekBuddy Karten/Atlanten (mit oder ohne tar Kompression).</translation>
|
<translation>Die erwartete Struktur ist eine Karte/ein Atlas pro Unterverzeichnis. Unterstützte Kartenformate sind OziExplorer Karten und TrekBuddy Karten/Atlanten (mit oder ohne tar Kompression).</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="723"/>
|
<location filename="../src/gui.cpp" line="714"/>
|
||||||
<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>Damit GPXSee zu Programmstart automatisch eine POI-Datei lädt, fügen Sie diese zu folgendem Verzeichnis hinzu:</translation>
|
<translation>Damit GPXSee zu Programmstart automatisch eine POI-Datei lädt, fügen Sie diese zu folgendem Verzeichnis hinzu:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="812"/>
|
<location filename="../src/gui.cpp" line="803"/>
|
||||||
<source>Error loading data file:</source>
|
<source>Error loading data file:</source>
|
||||||
<translation>Fehler beim Laden der Datei:</translation>
|
<translation>Fehler beim Laden der Datei:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="815"/>
|
<location filename="../src/gui.cpp" line="806"/>
|
||||||
<location filename="../src/gui.cpp" line="840"/>
|
<location filename="../src/gui.cpp" line="831"/>
|
||||||
<source>Line: %1</source>
|
<source>Line: %1</source>
|
||||||
<translation>Linie: %1</translation>
|
<translation>Linie: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="837"/>
|
<location filename="../src/gui.cpp" line="828"/>
|
||||||
<source>Error loading POI file:</source>
|
<source>Error loading POI file:</source>
|
||||||
<translation>Fehler beim Laden der POI-Datei:</translation>
|
<translation>Fehler beim Laden der POI-Datei:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="987"/>
|
<location filename="../src/gui.cpp" line="978"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation>Name</translation>
|
<translation>Name</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="991"/>
|
<location filename="../src/gui.cpp" line="982"/>
|
||||||
<source>Tracks</source>
|
<source>Tracks</source>
|
||||||
<translation>Strecken</translation>
|
<translation>Strecken</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="307"/>
|
<location filename="../src/gui.cpp" line="294"/>
|
||||||
<location filename="../src/gui.cpp" line="651"/>
|
<location filename="../src/gui.cpp" line="641"/>
|
||||||
<source>About GPXSee</source>
|
<source>About GPXSee</source>
|
||||||
<translation>Über GPXSee</translation>
|
<translation>Über GPXSee</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="590"/>
|
<location filename="../src/gui.cpp" line="579"/>
|
||||||
<source>Navigation</source>
|
<source>Navigation</source>
|
||||||
<translation>Navigation</translation>
|
<translation>Navigation</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="722"/>
|
<location filename="../src/gui.cpp" line="713"/>
|
||||||
<source>POIs</source>
|
<source>POIs</source>
|
||||||
<translation>POIs</translation>
|
<translation>POIs</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="424"/>
|
<location filename="../src/gui.cpp" line="412"/>
|
||||||
<location filename="../src/gui.cpp" line="1011"/>
|
<location filename="../src/gui.cpp" line="1002"/>
|
||||||
<source>Distance</source>
|
<source>Distance</source>
|
||||||
<translation>Distanz</translation>
|
<translation>Distanz</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="431"/>
|
<location filename="../src/gui.cpp" line="419"/>
|
||||||
<location filename="../src/gui.cpp" line="554"/>
|
<location filename="../src/gui.cpp" line="543"/>
|
||||||
<location filename="../src/gui.cpp" line="1013"/>
|
<location filename="../src/gui.cpp" line="1004"/>
|
||||||
<source>Time</source>
|
<source>Time</source>
|
||||||
<translation>Zeit</translation>
|
<translation>Zeit</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -755,6 +753,19 @@
|
|||||||
<translation>Maximum</translation>
|
<translation>Maximum</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>MapList</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="127"/>
|
||||||
|
<source>Map files (*.map *.tba *.tar)</source>
|
||||||
|
<translation>Karten-Dateien (*.map *.tba *.tar)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="128"/>
|
||||||
|
<source>URL list files (*.txt)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>OptionsDialog</name>
|
<name>OptionsDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS>
|
<!DOCTYPE TS>
|
||||||
<TS version="2.0" language="sv">
|
<TS version="2.1" language="sv">
|
||||||
<context>
|
<context>
|
||||||
<name>CadenceGraph</name>
|
<name>CadenceGraph</name>
|
||||||
<message>
|
<message>
|
||||||
@ -25,6 +25,54 @@
|
|||||||
<translation>Maximal</translation>
|
<translation>Maximal</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>Data</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="93"/>
|
||||||
|
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
||||||
|
<translation>Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>CSV files (*.csv)</source>
|
||||||
|
<translation>CSV-filer (*.csv)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="94"/>
|
||||||
|
<source>FIT files (*.fit)</source>
|
||||||
|
<translation>FIT-filer (*.fit)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>GPX files (*.gpx)</source>
|
||||||
|
<translation>GPX-filer (*.gpx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="95"/>
|
||||||
|
<source>IGC files (*.igc)</source>
|
||||||
|
<translation>IGC-filer (*.igc)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>KML files (*.kml)</source>
|
||||||
|
<translation>KML-filer (*.kml)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="96"/>
|
||||||
|
<source>NMEA files (*.nmea)</source>
|
||||||
|
<translation>NMEA-filer (*.nmea)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>TCX files (*.tcx)</source>
|
||||||
|
<translation>TCX-filer (*.tcx)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/data.cpp" line="97"/>
|
||||||
|
<source>All files (*)</source>
|
||||||
|
<translation>Alla filer (*)</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ElevationGraph</name>
|
<name>ElevationGraph</name>
|
||||||
<message>
|
<message>
|
||||||
@ -190,335 +238,315 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GUI</name>
|
<name>GUI</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="655"/>
|
<location filename="../src/gui.cpp" line="645"/>
|
||||||
<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>GPXSee distribueras under vilkoren för GNU General Public License version 3. För mer info om GPXSee, besök hemsidan på </translation>
|
<translation>GPXSee distribueras under vilkoren för GNU General Public License version 3. För mer info om GPXSee, besök hemsidan på </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="733"/>
|
<location filename="../src/gui.cpp" line="724"/>
|
||||||
<source>Open file</source>
|
<source>Open file</source>
|
||||||
<translation>Öppna fil</translation>
|
<translation>Öppna fil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="823"/>
|
<location filename="../src/gui.cpp" line="814"/>
|
||||||
<source>Open POI file</source>
|
<source>Open POI file</source>
|
||||||
<translation>Öppna POI-fil</translation>
|
<translation>Öppna POI-fil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="296"/>
|
<location filename="../src/gui.cpp" line="282"/>
|
||||||
<source>Quit</source>
|
<source>Quit</source>
|
||||||
<translation>Avsluta</translation>
|
<translation>Avsluta</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="304"/>
|
<location filename="../src/gui.cpp" line="291"/>
|
||||||
<location filename="../src/gui.cpp" line="671"/>
|
<location filename="../src/gui.cpp" line="662"/>
|
||||||
<location filename="../src/gui.cpp" line="672"/>
|
<location filename="../src/gui.cpp" line="663"/>
|
||||||
<source>Keyboard controls</source>
|
<source>Keyboard controls</source>
|
||||||
<translation>Snabbtangenter</translation>
|
<translation>Snabbtangenter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="328"/>
|
<location filename="../src/gui.cpp" line="316"/>
|
||||||
<source>Close</source>
|
<source>Close</source>
|
||||||
<translation>Stäng</translation>
|
<translation>Stäng</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="334"/>
|
<location filename="../src/gui.cpp" line="322"/>
|
||||||
<source>Reload</source>
|
<source>Reload</source>
|
||||||
<translation>Uppdatera</translation>
|
<translation>Uppdatera</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="585"/>
|
<location filename="../src/gui.cpp" line="574"/>
|
||||||
<source>Show</source>
|
<source>Show</source>
|
||||||
<translation>Visa</translation>
|
<translation>Visa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="502"/>
|
<location filename="../src/gui.cpp" line="491"/>
|
||||||
<location filename="../src/gui.cpp" line="579"/>
|
<location filename="../src/gui.cpp" line="568"/>
|
||||||
<source>File</source>
|
<source>File</source>
|
||||||
<translation>Arkiv</translation>
|
<translation>Arkiv</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
<location filename="../src/gui.cpp" line="289"/>
|
||||||
<source>FIT files (*.fit)</source>
|
<location filename="../src/gui.cpp" line="691"/>
|
||||||
<translation>FIT-filer (*.fit)</translation>
|
<location filename="../src/gui.cpp" line="692"/>
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
|
||||||
<source>IGC files (*.igc)</source>
|
|
||||||
<translation>IGC-filer (*.igc)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>NMEA files (*.nmea)</source>
|
|
||||||
<translation>NMEA-filer (*.nmea)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="302"/>
|
|
||||||
<location filename="../src/gui.cpp" line="700"/>
|
|
||||||
<location filename="../src/gui.cpp" line="701"/>
|
|
||||||
<source>Data sources</source>
|
<source>Data sources</source>
|
||||||
<translation>Datakällor</translation>
|
<translation>Datakällor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="345"/>
|
<location filename="../src/gui.cpp" line="333"/>
|
||||||
<source>Close POI files</source>
|
<source>Close POI files</source>
|
||||||
<translation>Stäng POI-filer</translation>
|
<translation>Stäng POI-filer</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="347"/>
|
<location filename="../src/gui.cpp" line="335"/>
|
||||||
<source>Overlap POIs</source>
|
<source>Overlap POIs</source>
|
||||||
<translation>Överlappa POI:er</translation>
|
<translation>Överlappa POI:er</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="351"/>
|
<location filename="../src/gui.cpp" line="339"/>
|
||||||
<source>Show POI labels</source>
|
<source>Show POI labels</source>
|
||||||
<translation>Visa POI-namn</translation>
|
<translation>Visa POI-namn</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="356"/>
|
<location filename="../src/gui.cpp" line="344"/>
|
||||||
<source>Show POIs</source>
|
<source>Show POIs</source>
|
||||||
<translation>Visa POI:er</translation>
|
<translation>Visa POI:er</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="365"/>
|
<location filename="../src/gui.cpp" line="353"/>
|
||||||
<source>Show map</source>
|
<source>Show map</source>
|
||||||
<translation>Visa karta</translation>
|
<translation>Visa karta</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="375"/>
|
<location filename="../src/gui.cpp" line="363"/>
|
||||||
<source>Clear tile cache</source>
|
<source>Clear tile cache</source>
|
||||||
<translation>Rensa kart-cache</translation>
|
<translation>Rensa kart-cache</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="312"/>
|
<location filename="../src/gui.cpp" line="300"/>
|
||||||
<source>Open...</source>
|
<source>Open...</source>
|
||||||
<translation>Öppna...</translation>
|
<translation>Öppna...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="342"/>
|
<location filename="../src/gui.cpp" line="330"/>
|
||||||
<source>Load POI file...</source>
|
<source>Load POI file...</source>
|
||||||
<translation>Läs in POI-fil...</translation>
|
<translation>Läs in POI-fil...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="373"/>
|
<location filename="../src/gui.cpp" line="361"/>
|
||||||
<source>Load map...</source>
|
<source>Load map...</source>
|
||||||
<translation>Läs in karta...</translation>
|
<translation>Läs in karta...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="379"/>
|
<location filename="../src/gui.cpp" line="367"/>
|
||||||
<location filename="../src/gui.cpp" line="383"/>
|
<location filename="../src/gui.cpp" line="371"/>
|
||||||
<location filename="../src/gui.cpp" line="683"/>
|
<location filename="../src/gui.cpp" line="674"/>
|
||||||
<source>Next map</source>
|
<source>Next map</source>
|
||||||
<translation>Nästa karta</translation>
|
<translation>Nästa karta</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="393"/>
|
<location filename="../src/gui.cpp" line="381"/>
|
||||||
<source>Show tracks</source>
|
<source>Show tracks</source>
|
||||||
<translation>Visa spår</translation>
|
<translation>Visa spår</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="397"/>
|
<location filename="../src/gui.cpp" line="385"/>
|
||||||
<source>Show routes</source>
|
<source>Show routes</source>
|
||||||
<translation>Visa rutter</translation>
|
<translation>Visa rutter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="401"/>
|
<location filename="../src/gui.cpp" line="389"/>
|
||||||
<source>Show waypoints</source>
|
<source>Show waypoints</source>
|
||||||
<translation>Visa vägpunkter</translation>
|
<translation>Visa vägpunkter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="405"/>
|
<location filename="../src/gui.cpp" line="393"/>
|
||||||
<source>Waypoint labels</source>
|
<source>Waypoint labels</source>
|
||||||
<translation>Vägpunktsnamn</translation>
|
<translation>Vägpunktsnamn</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="416"/>
|
<location filename="../src/gui.cpp" line="404"/>
|
||||||
<source>Show graphs</source>
|
<source>Show graphs</source>
|
||||||
<translation>Visa diagram</translation>
|
<translation>Visa diagram</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="438"/>
|
<location filename="../src/gui.cpp" line="426"/>
|
||||||
<source>Show grid</source>
|
<source>Show grid</source>
|
||||||
<translation>Visa stödlinjer</translation>
|
<translation>Visa stödlinjer</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="444"/>
|
<location filename="../src/gui.cpp" line="432"/>
|
||||||
<source>Show toolbars</source>
|
<source>Show toolbars</source>
|
||||||
<translation>Visa verktygsfält</translation>
|
<translation>Visa verktygsfält</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="450"/>
|
<location filename="../src/gui.cpp" line="438"/>
|
||||||
<source>Total time</source>
|
<source>Total time</source>
|
||||||
<translation>Total tid</translation>
|
<translation>Total tid</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="455"/>
|
<location filename="../src/gui.cpp" line="443"/>
|
||||||
<location filename="../src/gui.cpp" line="1015"/>
|
<location filename="../src/gui.cpp" line="1006"/>
|
||||||
<source>Moving time</source>
|
<source>Moving time</source>
|
||||||
<translation>Förflyttningstid</translation>
|
<translation>Förflyttningstid</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="462"/>
|
<location filename="../src/gui.cpp" line="450"/>
|
||||||
<source>Metric</source>
|
<source>Metric</source>
|
||||||
<translation>Meter</translation>
|
<translation>Meter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="467"/>
|
<location filename="../src/gui.cpp" line="455"/>
|
||||||
<source>Imperial</source>
|
<source>Imperial</source>
|
||||||
<translation>Imperial</translation>
|
<translation>Imperial</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="473"/>
|
<location filename="../src/gui.cpp" line="461"/>
|
||||||
<source>Fullscreen mode</source>
|
<source>Fullscreen mode</source>
|
||||||
<translation>Helskärmsläge</translation>
|
<translation>Helskärmsläge</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="479"/>
|
<location filename="../src/gui.cpp" line="467"/>
|
||||||
<source>Options...</source>
|
<source>Options...</source>
|
||||||
<translation>Alternativ...</translation>
|
<translation>Alternativ...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="484"/>
|
<location filename="../src/gui.cpp" line="473"/>
|
||||||
<source>Next</source>
|
<source>Next</source>
|
||||||
<translation>Nästa</translation>
|
<translation>Nästa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="487"/>
|
<location filename="../src/gui.cpp" line="476"/>
|
||||||
<source>Previous</source>
|
<source>Previous</source>
|
||||||
<translation>Föregående</translation>
|
<translation>Föregående</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="491"/>
|
<location filename="../src/gui.cpp" line="480"/>
|
||||||
<source>Last</source>
|
<source>Last</source>
|
||||||
<translation>Sista</translation>
|
<translation>Sista</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="494"/>
|
<location filename="../src/gui.cpp" line="483"/>
|
||||||
<source>First</source>
|
<source>First</source>
|
||||||
<translation>Första</translation>
|
<translation>Första</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="516"/>
|
<location filename="../src/gui.cpp" line="505"/>
|
||||||
<source>Map</source>
|
<source>Map</source>
|
||||||
<translation>Karta</translation>
|
<translation>Karta</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="524"/>
|
<location filename="../src/gui.cpp" line="513"/>
|
||||||
<source>Graph</source>
|
<source>Graph</source>
|
||||||
<translation>Diagram</translation>
|
<translation>Diagram</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="532"/>
|
<location filename="../src/gui.cpp" line="521"/>
|
||||||
<source>POI</source>
|
<source>POI</source>
|
||||||
<translation>POI</translation>
|
<translation>POI</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="533"/>
|
<location filename="../src/gui.cpp" line="522"/>
|
||||||
<source>POI files</source>
|
<source>POI files</source>
|
||||||
<translation>POI-filer</translation>
|
<translation>POI-filer</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="544"/>
|
<location filename="../src/gui.cpp" line="533"/>
|
||||||
<source>Data</source>
|
<source>Data</source>
|
||||||
<translation>Data</translation>
|
<translation>Data</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="545"/>
|
<location filename="../src/gui.cpp" line="534"/>
|
||||||
<source>Display</source>
|
<source>Display</source>
|
||||||
<translation>Visa</translation>
|
<translation>Visa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="553"/>
|
<location filename="../src/gui.cpp" line="542"/>
|
||||||
<source>Settings</source>
|
<source>Settings</source>
|
||||||
<translation>Inställningar</translation>
|
<translation>Inställningar</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="557"/>
|
<location filename="../src/gui.cpp" line="546"/>
|
||||||
<source>Units</source>
|
<source>Units</source>
|
||||||
<translation>Enhet</translation>
|
<translation>Enhet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="566"/>
|
<location filename="../src/gui.cpp" line="555"/>
|
||||||
<source>Help</source>
|
<source>Help</source>
|
||||||
<translation>Hjälp</translation>
|
<translation>Hjälp</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="681"/>
|
<location filename="../src/gui.cpp" line="672"/>
|
||||||
<source>Append file</source>
|
<source>Append file</source>
|
||||||
<translation>Lägg till fil</translation>
|
<translation>Lägg till fil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="682"/>
|
<location filename="../src/gui.cpp" line="673"/>
|
||||||
<source>Next/Previous</source>
|
<source>Next/Previous</source>
|
||||||
<translation>Nästa/Föregående</translation>
|
<translation>Nästa/Föregående</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="685"/>
|
<location filename="../src/gui.cpp" line="676"/>
|
||||||
<source>Previous map</source>
|
<source>Previous map</source>
|
||||||
<translation>Föregående karta</translation>
|
<translation>Föregående karta</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="686"/>
|
<location filename="../src/gui.cpp" line="677"/>
|
||||||
<source>Zoom in</source>
|
<source>Zoom in</source>
|
||||||
<translation>Zooma in</translation>
|
<translation>Zooma in</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="688"/>
|
<location filename="../src/gui.cpp" line="679"/>
|
||||||
<source>Zoom out</source>
|
<source>Zoom out</source>
|
||||||
<translation>Zooma ut</translation>
|
<translation>Zooma ut</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="690"/>
|
<location filename="../src/gui.cpp" line="681"/>
|
||||||
<source>Digital zoom</source>
|
<source>Digital zoom</source>
|
||||||
<translation>Digital zoom</translation>
|
<translation>Digital zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="691"/>
|
<location filename="../src/gui.cpp" line="682"/>
|
||||||
<source>Zoom</source>
|
<source>Zoom</source>
|
||||||
<translation>Zoom</translation>
|
<translation>Zoom</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="703"/>
|
<location filename="../src/gui.cpp" line="694"/>
|
||||||
<source>Online maps</source>
|
<source>Online maps</source>
|
||||||
<translation>Online-kartor</translation>
|
<translation>Online-kartor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="704"/>
|
<location filename="../src/gui.cpp" line="695"/>
|
||||||
<source>Online map URLs are read on program startup from the following file:</source>
|
<source>Online map URLs are read on program startup from the following file:</source>
|
||||||
<translation>Online-kartors URL:er, läses från följande fil vid programstart:</translation>
|
<translation>Online-kartors URL:er, läses från följande fil vid programstart:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="714"/>
|
<location filename="../src/gui.cpp" line="705"/>
|
||||||
<source>Offline maps</source>
|
<source>Offline maps</source>
|
||||||
<translation>Offline-kartor</translation>
|
<translation>Offline-kartor</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="715"/>
|
<location filename="../src/gui.cpp" line="706"/>
|
||||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||||
<translation>Offline-kartor läses in från följande mapp vid programstart:</translation>
|
<translation>Offline-kartor läses in från följande mapp vid programstart:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1206"/>
|
<location filename="../src/gui.cpp" line="1197"/>
|
||||||
<source>Open map file</source>
|
<source>Open map file</source>
|
||||||
<translation>Öppna kartfil</translation>
|
<translation>Öppna kartfil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1207"/>
|
<location filename="../src/gui.cpp" line="1218"/>
|
||||||
<source>Map files (*.map *.tba *.tar)</source>
|
|
||||||
<translation>Kartfiler (*.map *.tba *.tar)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1224"/>
|
|
||||||
<source>Error loading map:</source>
|
<source>Error loading map:</source>
|
||||||
<translation>Fel vid inläsning av karta:</translation>
|
<translation>Fel vid inläsning av karta:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="1239"/>
|
<location filename="../src/gui.cpp" line="1233"/>
|
||||||
<source>No files loaded</source>
|
<source>No files loaded</source>
|
||||||
<translation>Inga filer inlästa</translation>
|
<translation>Inga filer inlästa</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../src/gui.cpp" line="1243"/>
|
<location filename="../src/gui.cpp" line="1237"/>
|
||||||
<source>%n files</source>
|
<source>%n files</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n filer</numerusform>
|
<numerusform>%n filer</numerusform>
|
||||||
@ -526,158 +554,128 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="109"/>
|
<location filename="../src/gui.cpp" line="992"/>
|
||||||
<source>GPX files (*.gpx)</source>
|
<location filename="../src/gui.cpp" line="995"/>
|
||||||
<translation>GPX-filer (*.gpx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>TCX files (*.tcx)</source>
|
|
||||||
<translation>TCX-filer (*.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="110"/>
|
|
||||||
<source>KML files (*.kml)</source>
|
|
||||||
<translation>KML-filer (*.kml)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="108"/>
|
|
||||||
<source>CSV files (*.csv)</source>
|
|
||||||
<translation>CSV-filer (*.csv)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="111"/>
|
|
||||||
<source>All files (*)</source>
|
|
||||||
<translation>Alla filer (*)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="1001"/>
|
|
||||||
<location filename="../src/gui.cpp" line="1004"/>
|
|
||||||
<source>Date</source>
|
<source>Date</source>
|
||||||
<translation>Datum</translation>
|
<translation>Datum</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="993"/>
|
<location filename="../src/gui.cpp" line="984"/>
|
||||||
<source>Routes</source>
|
<source>Routes</source>
|
||||||
<translation>Rutter</translation>
|
<translation>Rutter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="675"/>
|
<location filename="../src/gui.cpp" line="666"/>
|
||||||
<source>Next file</source>
|
<source>Next file</source>
|
||||||
<translation>Nästa fil</translation>
|
<translation>Nästa fil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="652"/>
|
<location filename="../src/gui.cpp" line="642"/>
|
||||||
<source>Version </source>
|
<source>Version </source>
|
||||||
<translation>Version </translation>
|
<translation>Version </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="317"/>
|
<location filename="../src/gui.cpp" line="305"/>
|
||||||
<source>Print...</source>
|
<source>Print...</source>
|
||||||
<translation>Skriv ut...</translation>
|
<translation>Skriv ut...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="322"/>
|
<location filename="../src/gui.cpp" line="310"/>
|
||||||
<source>Export to PDF...</source>
|
<source>Export to PDF...</source>
|
||||||
<translation>Exportera till PDF...</translation>
|
<translation>Exportera till PDF...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="995"/>
|
<location filename="../src/gui.cpp" line="986"/>
|
||||||
<source>Waypoints</source>
|
<source>Waypoints</source>
|
||||||
<translation>Vägpunkter</translation>
|
<translation>Vägpunkter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="676"/>
|
<location filename="../src/gui.cpp" line="667"/>
|
||||||
<source>Previous file</source>
|
<source>Previous file</source>
|
||||||
<translation>Föregående fil</translation>
|
<translation>Föregående fil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="107"/>
|
<location filename="../src/gui.cpp" line="397"/>
|
||||||
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
|
||||||
<translation>Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../src/gui.cpp" line="409"/>
|
|
||||||
<source>Route waypoints</source>
|
<source>Route waypoints</source>
|
||||||
<translation>Ruttvägpunkter</translation>
|
<translation>Ruttvägpunkter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="678"/>
|
<location filename="../src/gui.cpp" line="669"/>
|
||||||
<source>First file</source>
|
<source>First file</source>
|
||||||
<translation>Första filen</translation>
|
<translation>Första filen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="680"/>
|
<location filename="../src/gui.cpp" line="671"/>
|
||||||
<source>Last file</source>
|
<source>Last file</source>
|
||||||
<translation>Sista filen</translation>
|
<translation>Sista filen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="707"/>
|
<location filename="../src/gui.cpp" line="698"/>
|
||||||
<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>Filformatet är en kartpost per rad, bestående av kartnamn och kartrutans URL, avgränsade med ett TAB-tecken. Kartrutans X- och Y-koordinater ersätts med $x och $y i URL:en och zoomnivån ersätts med $z. Exempel på en kartfil kan se ut så här:</translation>
|
<translation>Filformatet är en kartpost per rad, bestående av kartnamn och kartrutans URL, avgränsade med ett TAB-tecken. Kartrutans X- och Y-koordinater ersätts med $x och $y i URL:en och zoomnivån ersätts med $z. Exempel på en kartfil kan se ut så här:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="718"/>
|
<location filename="../src/gui.cpp" line="709"/>
|
||||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer maps and TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||||
<translation>Den förväntade strukturen är en karta/atlas i en separat undermapp. Kartformat som stöds är OziExplorer kartor och TrekBuddy-kartor/-kartsamlingar (tarerade och icke tarerade).</translation>
|
<translation>Den förväntade strukturen är en karta/atlas i en separat undermapp. Kartformat som stöds är OziExplorer kartor och TrekBuddy-kartor/-kartsamlingar (tarerade och icke tarerade).</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="723"/>
|
<location filename="../src/gui.cpp" line="714"/>
|
||||||
<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>För att GPXSee skall läsa in en POI-fil automatiskt vid programstart, läggs filen i följande mapp:</translation>
|
<translation>För att GPXSee skall läsa in en POI-fil automatiskt vid programstart, läggs filen i följande mapp:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="812"/>
|
<location filename="../src/gui.cpp" line="803"/>
|
||||||
<source>Error loading data file:</source>
|
<source>Error loading data file:</source>
|
||||||
<translation>Fel vid inläsning av datafil:</translation>
|
<translation>Fel vid inläsning av datafil:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="815"/>
|
<location filename="../src/gui.cpp" line="806"/>
|
||||||
<location filename="../src/gui.cpp" line="840"/>
|
<location filename="../src/gui.cpp" line="831"/>
|
||||||
<source>Line: %1</source>
|
<source>Line: %1</source>
|
||||||
<translation>Rad: %1</translation>
|
<translation>Rad: %1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="837"/>
|
<location filename="../src/gui.cpp" line="828"/>
|
||||||
<source>Error loading POI file:</source>
|
<source>Error loading POI file:</source>
|
||||||
<translation>Fel vid inläsning av POI-fil:</translation>
|
<translation>Fel vid inläsning av POI-fil:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="987"/>
|
<location filename="../src/gui.cpp" line="978"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation>Namn</translation>
|
<translation>Namn</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="991"/>
|
<location filename="../src/gui.cpp" line="982"/>
|
||||||
<source>Tracks</source>
|
<source>Tracks</source>
|
||||||
<translation>Spår</translation>
|
<translation>Spår</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="307"/>
|
<location filename="../src/gui.cpp" line="294"/>
|
||||||
<location filename="../src/gui.cpp" line="651"/>
|
<location filename="../src/gui.cpp" line="641"/>
|
||||||
<source>About GPXSee</source>
|
<source>About GPXSee</source>
|
||||||
<translation>Om GPXSee</translation>
|
<translation>Om GPXSee</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="590"/>
|
<location filename="../src/gui.cpp" line="579"/>
|
||||||
<source>Navigation</source>
|
<source>Navigation</source>
|
||||||
<translation>Navigation</translation>
|
<translation>Navigation</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="722"/>
|
<location filename="../src/gui.cpp" line="713"/>
|
||||||
<source>POIs</source>
|
<source>POIs</source>
|
||||||
<translation>POI:er</translation>
|
<translation>POI:er</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="424"/>
|
<location filename="../src/gui.cpp" line="412"/>
|
||||||
<location filename="../src/gui.cpp" line="1011"/>
|
<location filename="../src/gui.cpp" line="1002"/>
|
||||||
<source>Distance</source>
|
<source>Distance</source>
|
||||||
<translation>Avstånd</translation>
|
<translation>Avstånd</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/gui.cpp" line="431"/>
|
<location filename="../src/gui.cpp" line="419"/>
|
||||||
<location filename="../src/gui.cpp" line="554"/>
|
<location filename="../src/gui.cpp" line="543"/>
|
||||||
<location filename="../src/gui.cpp" line="1013"/>
|
<location filename="../src/gui.cpp" line="1004"/>
|
||||||
<source>Time</source>
|
<source>Time</source>
|
||||||
<translation>Tid</translation>
|
<translation>Tid</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -755,6 +753,19 @@
|
|||||||
<translation>Max</translation>
|
<translation>Max</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>MapList</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="127"/>
|
||||||
|
<source>Map files (*.map *.tba *.tar)</source>
|
||||||
|
<translation>Kartfiler (*.map *.tba *.tar)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/maplist.cpp" line="128"/>
|
||||||
|
<source>URL list files (*.txt)</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>OptionsDialog</name>
|
<name>OptionsDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -5,10 +5,12 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "4.8"
|
!define VERSION "4.11"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
|
; Compression method
|
||||||
|
SetCompressor /SOLID lzma
|
||||||
|
|
||||||
; Required execution level
|
; Required execution level
|
||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
@ -171,8 +173,8 @@ Section "MSVC runtime" SEC_MSVC
|
|||||||
|
|
||||||
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
||||||
SetOutPath $TEMP
|
SetOutPath $TEMP
|
||||||
File "VC_redist.x86.exe"
|
File "vcredist_x86.exe"
|
||||||
ExecWait '"$TEMP/VC_redist.x86.exe" /install /quiet /norestart'
|
ExecWait '"$TEMP\vcredist_x86.exe" /install /quiet /norestart'
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -5,10 +5,12 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "4.8"
|
!define VERSION "4.11"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
; Compression method
|
||||||
|
SetCompressor /SOLID lzma
|
||||||
|
|
||||||
; Required execution level
|
; Required execution level
|
||||||
RequestExecutionLevel admin
|
RequestExecutionLevel admin
|
||||||
@ -173,8 +175,8 @@ Section "MSVC runtime" SEC_MSVC
|
|||||||
|
|
||||||
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
DetailPrint "Installing Visual C++ 2015 Redistributable..."
|
||||||
SetOutPath $TEMP
|
SetOutPath $TEMP
|
||||||
File "VC_redist.x64.exe"
|
File "vcredist_x64.exe"
|
||||||
ExecWait '"$TEMP/VC_redist.x64.exe" /install /quiet /norestart'
|
ExecWait '"$TEMP\vcredist_x64.exe" /install /quiet /norestart'
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
14
src/app.cpp
14
src/app.cpp
@ -3,6 +3,7 @@
|
|||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
#include <QNetworkProxyFactory>
|
#include <QNetworkProxyFactory>
|
||||||
|
#include <QLibraryInfo>
|
||||||
#include "opengl.h"
|
#include "opengl.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "onlinemap.h"
|
#include "onlinemap.h"
|
||||||
@ -13,11 +14,16 @@
|
|||||||
App::App(int &argc, char **argv) : QApplication(argc, argv),
|
App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||||
_argc(argc), _argv(argv)
|
_argc(argc), _argv(argv)
|
||||||
{
|
{
|
||||||
QTranslator *translator = new QTranslator(this);
|
QTranslator *gpxsee = new QTranslator(this);
|
||||||
|
|
||||||
QString locale = QLocale::system().name();
|
QString locale = QLocale::system().name();
|
||||||
translator->load(QString(":/lang/gpxsee_") + locale);
|
gpxsee->load(QString(":/lang/gpxsee_") + locale);
|
||||||
installTranslator(translator);
|
installTranslator(gpxsee);
|
||||||
|
|
||||||
|
QTranslator *qt = new QTranslator(this);
|
||||||
|
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
|
||||||
|
QLibraryInfo::TranslationsPath));
|
||||||
|
installTranslator(qt);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
setAttribute(Qt::AA_DontShowIconsInMenus);
|
setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QtAlgorithms>
|
#include <QtAlgorithms>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include "rectc.h"
|
||||||
#include "tar.h"
|
#include "tar.h"
|
||||||
#include "atlas.h"
|
#include "atlas.h"
|
||||||
|
|
||||||
@ -84,23 +85,21 @@ void Atlas::computeBounds()
|
|||||||
offsets.append(QPointF());
|
offsets.append(QPointF());
|
||||||
|
|
||||||
for (int z = 0; z < _zooms.count(); z++) {
|
for (int z = 0; z < _zooms.count(); z++) {
|
||||||
qreal w = 0, h = 0;
|
|
||||||
|
|
||||||
QList<OfflineMap*> m;
|
QList<OfflineMap*> m;
|
||||||
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++)
|
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++)
|
||||||
m.append(_maps.at(i));
|
m.append(_maps.at(i));
|
||||||
|
|
||||||
qSort(m.begin(), m.end(), xCmp);
|
qSort(m.begin(), m.end(), xCmp);
|
||||||
offsets[_maps.indexOf(m.first())].setX(w);
|
offsets[_maps.indexOf(m.first())].setX(0);
|
||||||
for (int i = 1; i < m.size(); i++) {
|
for (int i = 1; i < m.size(); i++) {
|
||||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
qreal w = round(m.first()->pp2xy(TL(m.at(i))).x());
|
||||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
qSort(m.begin(), m.end(), yCmp);
|
qSort(m.begin(), m.end(), yCmp);
|
||||||
offsets[_maps.indexOf(m.first())].setY(h);
|
offsets[_maps.indexOf(m.first())].setY(0);
|
||||||
for (int i = 1; i < m.size(); i++) {
|
for (int i = 1; i < m.size(); i++) {
|
||||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
qreal h = round(m.first()->pp2xy(TL(m.at(i))).y());
|
||||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,11 +197,11 @@ qreal Atlas::zoom() const
|
|||||||
return _zoom;
|
return _zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal Atlas::zoomFit(const QSize &size, const QRectF &br)
|
qreal Atlas::zoomFit(const QSize &size, const RectC &br)
|
||||||
{
|
{
|
||||||
_zoom = 0;
|
_zoom = 0;
|
||||||
|
|
||||||
if (br.isNull()) {
|
if (!br.isValid()) {
|
||||||
_zoom = _zooms.size() - 1;
|
_zoom = _zooms.size() - 1;
|
||||||
return _zoom;
|
return _zoom;
|
||||||
}
|
}
|
||||||
@ -227,6 +226,26 @@ qreal Atlas::zoomFit(const QSize &size, const QRectF &br)
|
|||||||
return _zoom;
|
return _zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qreal Atlas::zoomFit(qreal resolution, const Coordinates &c)
|
||||||
|
{
|
||||||
|
_zoom = 0;
|
||||||
|
|
||||||
|
for (int z = 0; z < _zooms.count(); z++) {
|
||||||
|
for (int i = _zooms.at(z).first; i <= _zooms.at(z).second; i++) {
|
||||||
|
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(c)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (_maps.at(i)->resolution(_maps.at(i)->ll2xy(c)) < resolution)
|
||||||
|
return _zoom;
|
||||||
|
|
||||||
|
_zoom = z;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
qreal Atlas::zoomIn()
|
qreal Atlas::zoomIn()
|
||||||
{
|
{
|
||||||
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
||||||
|
@ -20,7 +20,8 @@ public:
|
|||||||
qreal resolution(const QPointF &p) const;
|
qreal resolution(const QPointF &p) const;
|
||||||
|
|
||||||
qreal zoom() const;
|
qreal zoom() const;
|
||||||
qreal zoomFit(const QSize &size, const QRectF &br);
|
qreal zoomFit(const QSize &size, const RectC &br);
|
||||||
|
qreal zoomFit(qreal resolution, const Coordinates &c);
|
||||||
qreal zoomIn();
|
qreal zoomIn();
|
||||||
qreal zoomOut();
|
qreal zoomOut();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#define APP_NAME "GPXSee"
|
#define APP_NAME "GPXSee"
|
||||||
#define APP_HOMEPAGE "http://tumic.wz.cz/gpxsee"
|
#define APP_HOMEPAGE "http://www.gpxsee.org"
|
||||||
|
|
||||||
#define FONT_FAMILY "Arial"
|
#define FONT_FAMILY "Arial"
|
||||||
#define FONT_SIZE 12
|
#define FONT_SIZE 12
|
||||||
|
@ -21,7 +21,6 @@ QDebug operator<<(QDebug dbg, const Coordinates &coordinates)
|
|||||||
{
|
{
|
||||||
dbg.nospace() << "Coordinates(" << coordinates.lon() << ", "
|
dbg.nospace() << "Coordinates(" << coordinates.lon() << ", "
|
||||||
<< coordinates.lat() << ")";
|
<< coordinates.lat() << ")";
|
||||||
|
|
||||||
return dbg.space();
|
return dbg.space();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define COORDINATES_H
|
#define COORDINATES_H
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QPointF>
|
#include <QPair>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
class Coordinates
|
class Coordinates
|
||||||
@ -12,9 +12,6 @@ public:
|
|||||||
Coordinates(const Coordinates &c) {_lon = c._lon; _lat = c._lat;}
|
Coordinates(const Coordinates &c) {_lon = c._lon; _lat = c._lat;}
|
||||||
Coordinates(qreal lon, qreal lat) {_lon = lon; _lat = lat;}
|
Coordinates(qreal lon, qreal lat) {_lon = lon; _lat = lat;}
|
||||||
|
|
||||||
Coordinates(const QPointF &p) {_lon = p.x(), _lat = p.y();}
|
|
||||||
QPointF toPointF() const {return QPointF(_lon, _lat);}
|
|
||||||
|
|
||||||
qreal &rlon() {return _lon;}
|
qreal &rlon() {return _lon;}
|
||||||
qreal &rlat() {return _lat;}
|
qreal &rlat() {return _lat;}
|
||||||
void setLon(qreal lon) {_lon = lon;}
|
void setLon(qreal lon) {_lon = lon;}
|
||||||
@ -23,10 +20,10 @@ public:
|
|||||||
qreal lat() const {return _lat;}
|
qreal lat() const {return _lat;}
|
||||||
|
|
||||||
bool isNull() const
|
bool isNull() const
|
||||||
{return (std::isnan(_lon) || std::isnan(_lat)) ? true : false;}
|
{return std::isnan(_lon) && std::isnan(_lat);}
|
||||||
bool isValid() const
|
bool isValid() const
|
||||||
{return (_lon >= -180.0 && _lon <= 180.0 && _lat >= -90.0
|
{return (_lon >= -180.0 && _lon <= 180.0
|
||||||
&& _lat <= 90.0) ? true : false;}
|
&& _lat >= -90.0 && _lat <= 90.0);}
|
||||||
|
|
||||||
qreal distanceTo(const Coordinates &c) const;
|
qreal distanceTo(const Coordinates &c) const;
|
||||||
QPair<Coordinates, Coordinates> boundingRect(qreal distance) const;
|
QPair<Coordinates, Coordinates> boundingRect(qreal distance) const;
|
||||||
@ -39,6 +36,7 @@ inline bool operator==(const Coordinates &c1, const Coordinates &c2)
|
|||||||
{return (c1.lat() == c2.lat() && c1.lon() == c2.lon());}
|
{return (c1.lat() == c2.lat() && c1.lon() == c2.lon());}
|
||||||
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)
|
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)
|
||||||
{return !(c1 == c2);}
|
{return !(c1 == c2);}
|
||||||
|
|
||||||
QDebug operator<<(QDebug dbg, const Coordinates &trackpoint);
|
QDebug operator<<(QDebug dbg, const Coordinates &trackpoint);
|
||||||
|
|
||||||
#endif // COORDINATES_H
|
#endif // COORDINATES_H
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#include "csvparser.h"
|
#include "csvparser.h"
|
||||||
|
|
||||||
bool CSVParser::loadFile(QFile *file)
|
bool CSVParser::parse(QFile *file, QList<TrackData> &track,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(track);
|
||||||
|
Q_UNUSED(routes);
|
||||||
bool res;
|
bool res;
|
||||||
|
|
||||||
_errorLine = 1;
|
_errorLine = 1;
|
||||||
@ -36,7 +39,7 @@ bool CSVParser::loadFile(QFile *file)
|
|||||||
wp.setDescription(QString::fromUtf8(ba.data(), ba.size()));
|
wp.setDescription(QString::fromUtf8(ba.data(), ba.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
_waypoints.append(wp);
|
waypoints.append(wp);
|
||||||
_errorLine++;
|
_errorLine++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,12 +6,11 @@
|
|||||||
class CSVParser : public Parser
|
class CSVParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSVParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
CSVParser() : _errorLine(0) {}
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
|
|
||||||
{_errorLine = 0;}
|
|
||||||
~CSVParser() {}
|
~CSVParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &track, QList<RouteData> &routes,
|
||||||
|
QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _errorString;}
|
QString errorString() const {return _errorString;}
|
||||||
int errorLine() const {return _errorLine;}
|
int errorLine() const {return _errorLine;}
|
||||||
|
|
||||||
|
64
src/data.cpp
64
src/data.cpp
@ -11,38 +11,32 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
|
|
||||||
|
|
||||||
Data::Data() : _errorLine(0)
|
static QHash<QString, Parser*> parsers()
|
||||||
{
|
{
|
||||||
_parsers.insert("gpx", new GPXParser(_trackData, _routeData,
|
QHash<QString, Parser*> hash;
|
||||||
_waypointData));
|
|
||||||
_parsers.insert("tcx", new TCXParser(_trackData, _routeData,
|
hash.insert("gpx", new GPXParser());
|
||||||
_waypointData));
|
hash.insert("tcx", new TCXParser());
|
||||||
_parsers.insert("kml", new KMLParser(_trackData, _routeData,
|
hash.insert("kml", new KMLParser());
|
||||||
_waypointData));
|
hash.insert("fit", new FITParser());
|
||||||
_parsers.insert("fit", new FITParser(_trackData, _routeData,
|
hash.insert("csv", new CSVParser());
|
||||||
_waypointData));
|
hash.insert("igc", new IGCParser());
|
||||||
_parsers.insert("csv", new CSVParser(_trackData, _routeData,
|
hash.insert("nmea", new NMEAParser());
|
||||||
_waypointData));
|
|
||||||
_parsers.insert("igc", new IGCParser(_trackData, _routeData,
|
return hash;
|
||||||
_waypointData));
|
|
||||||
_parsers.insert("nmea", new NMEAParser(_trackData, _routeData,
|
|
||||||
_waypointData));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QHash<QString, Parser*> Data::_parsers = parsers();
|
||||||
|
|
||||||
Data::~Data()
|
Data::~Data()
|
||||||
{
|
{
|
||||||
QHash<QString, Parser*>::iterator it;
|
|
||||||
|
|
||||||
for (it = _parsers.begin(); it != _parsers.end(); it++)
|
|
||||||
delete it.value();
|
|
||||||
|
|
||||||
for (int i = 0; i < _tracks.count(); i++)
|
for (int i = 0; i < _tracks.count(); i++)
|
||||||
delete _tracks.at(i);
|
delete _tracks.at(i);
|
||||||
for (int i = 0; i < _routes.count(); i++)
|
for (int i = 0; i < _routes.count(); i++)
|
||||||
delete _routes.at(i);
|
delete _routes.at(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Data::createData()
|
void Data::processData()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _trackData.count(); i++)
|
for (int i = 0; i < _trackData.count(); i++)
|
||||||
_tracks.append(new Track(_trackData.at(i)));
|
_tracks.append(new Track(_trackData.at(i)));
|
||||||
@ -66,8 +60,8 @@ bool Data::loadFile(const QString &fileName)
|
|||||||
|
|
||||||
QHash<QString, Parser*>::iterator it;
|
QHash<QString, Parser*>::iterator it;
|
||||||
if ((it = _parsers.find(fi.suffix().toLower())) != _parsers.end()) {
|
if ((it = _parsers.find(fi.suffix().toLower())) != _parsers.end()) {
|
||||||
if (it.value()->loadFile(&file)) {
|
if (it.value()->parse(&file, _trackData, _routeData, _waypoints)) {
|
||||||
createData();
|
processData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +69,8 @@ bool Data::loadFile(const QString &fileName)
|
|||||||
_errorString = it.value()->errorString();
|
_errorString = it.value()->errorString();
|
||||||
} else {
|
} else {
|
||||||
for (it = _parsers.begin(); it != _parsers.end(); it++) {
|
for (it = _parsers.begin(); it != _parsers.end(); it++) {
|
||||||
if (it.value()->loadFile(&file)) {
|
if (it.value()->parse(&file, _trackData, _routeData, _waypoints)) {
|
||||||
createData();
|
processData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
file.reset();
|
file.reset();
|
||||||
@ -93,3 +87,23 @@ bool Data::loadFile(const QString &fileName)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Data::formats()
|
||||||
|
{
|
||||||
|
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)")
|
||||||
|
+ ";;" + tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
|
||||||
|
+ tr("GPX files (*.gpx)") + ";;" + tr("IGC files (*.igc)") + ";;"
|
||||||
|
+ tr("KML files (*.kml)") + ";;" + tr("NMEA files (*.nmea)") + ";;"
|
||||||
|
+ tr("TCX files (*.tcx)") + ";;" + tr("All files (*)");
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList Data::filter()
|
||||||
|
{
|
||||||
|
QStringList filter;
|
||||||
|
QHash<QString, Parser*>::iterator it;
|
||||||
|
|
||||||
|
for (it = _parsers.begin(); it != _parsers.end(); it++)
|
||||||
|
filter << QString("*.%1").arg(it.key());
|
||||||
|
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
19
src/data.h
19
src/data.h
@ -6,16 +6,19 @@
|
|||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
#include "track.h"
|
#include "track.h"
|
||||||
#include "route.h"
|
#include "route.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
|
|
||||||
class Data
|
class Data : public QObject
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Data();
|
Data(QObject *parent = 0) : QObject(parent), _errorLine(0) {}
|
||||||
~Data();
|
~Data();
|
||||||
|
|
||||||
bool loadFile(const QString &fileName);
|
bool loadFile(const QString &fileName);
|
||||||
@ -24,21 +27,25 @@ public:
|
|||||||
|
|
||||||
const QList<Track*> &tracks() const {return _tracks;}
|
const QList<Track*> &tracks() const {return _tracks;}
|
||||||
const QList<Route*> &routes() const {return _routes;}
|
const QList<Route*> &routes() const {return _routes;}
|
||||||
const QList<Waypoint> &waypoints() const {return _waypointData;}
|
const QList<Waypoint> &waypoints() const {return _waypoints;}
|
||||||
|
|
||||||
|
static QString formats();
|
||||||
|
static QStringList filter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createData();
|
void processData();
|
||||||
|
|
||||||
QString _errorString;
|
QString _errorString;
|
||||||
int _errorLine;
|
int _errorLine;
|
||||||
QHash<QString, Parser*> _parsers;
|
|
||||||
|
|
||||||
QList<Track*> _tracks;
|
QList<Track*> _tracks;
|
||||||
QList<Route*> _routes;
|
QList<Route*> _routes;
|
||||||
|
QList<Waypoint> _waypoints;
|
||||||
|
|
||||||
QList<TrackData> _trackData;
|
QList<TrackData> _trackData;
|
||||||
QList<RouteData> _routeData;
|
QList<RouteData> _routeData;
|
||||||
QList<Waypoint> _waypointData;
|
|
||||||
|
static QHash<QString, Parser*> _parsers;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATA_H
|
#endif // DATA_H
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
#include <cmath>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include "wgs84.h"
|
#include "wgs84.h"
|
||||||
|
#include "rd.h"
|
||||||
#include "datum.h"
|
#include "datum.h"
|
||||||
|
|
||||||
|
|
||||||
@ -7,7 +9,7 @@ static QMap<QString, Datum> WGS84()
|
|||||||
{
|
{
|
||||||
QMap<QString, Datum> map;
|
QMap<QString, Datum> map;
|
||||||
map.insert("WGS 84", Datum(Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING),
|
map.insert("WGS 84", Datum(Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING),
|
||||||
0, 0, 0));
|
0.0, 0.0, 0.0));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,3 +83,39 @@ bool Datum::loadList(const QString &path)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Abridged Molodensky transformation
|
||||||
|
Coordinates Datum::toWGS84(const Coordinates &c) const
|
||||||
|
{
|
||||||
|
if (_ellipsoid.radius() == WGS84_RADIUS
|
||||||
|
&& _ellipsoid.flattening() == WGS84_FLATTENING
|
||||||
|
&& _dx == 0.0 && _dy == 0.0 && _dz == 0.0)
|
||||||
|
return c;
|
||||||
|
|
||||||
|
double rlat = deg2rad(c.lat());
|
||||||
|
double rlon = deg2rad(c.lon());
|
||||||
|
|
||||||
|
double slat = sin(rlat);
|
||||||
|
double clat = cos(rlat);
|
||||||
|
double slon = sin(rlon);
|
||||||
|
double clon = cos(rlon);
|
||||||
|
double ssqlat = slat * slat;
|
||||||
|
|
||||||
|
double from_f = ellipsoid().flattening();
|
||||||
|
double df = WGS84_FLATTENING - from_f;
|
||||||
|
double from_a = ellipsoid().radius();
|
||||||
|
double da = WGS84_RADIUS - from_a;
|
||||||
|
double from_esq = ellipsoid().flattening()
|
||||||
|
* (2.0 - ellipsoid().flattening());
|
||||||
|
double adb = 1.0 / (1.0 - from_f);
|
||||||
|
double rn = from_a / sqrt(1 - from_esq * ssqlat);
|
||||||
|
double rm = from_a * (1 - from_esq) / pow((1 - from_esq * ssqlat), 1.5);
|
||||||
|
double from_h = 0.0;
|
||||||
|
|
||||||
|
double dlat = (-dx() * slat * clon - dy() * slat * slon + dz() * clat + da
|
||||||
|
* rn * from_esq * slat * clat / from_a + df * (rm * adb + rn / adb) * slat
|
||||||
|
* clat) / (rm + from_h);
|
||||||
|
double dlon = (-dx() * slon + dy() * clon) / ((rn + from_h) * clat);
|
||||||
|
|
||||||
|
return Coordinates(c.lon() + rad2deg(dlon), c.lat() + rad2deg(dlat));
|
||||||
|
}
|
||||||
|
10
src/datum.h
10
src/datum.h
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include "ellipsoid.h"
|
#include "ellipsoid.h"
|
||||||
|
#include "coordinates.h"
|
||||||
|
|
||||||
class Datum
|
class Datum
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Datum() : _ellipsoid(Ellipsoid()), _dx(0), _dy(0), _dz(0) {}
|
Datum() : _ellipsoid(Ellipsoid()), _dx(0.0), _dy(0.0), _dz(0.0) {}
|
||||||
Datum(const Ellipsoid &ellipsoid, double dx, double dy, double dz)
|
Datum(const Ellipsoid &ellipsoid, double dx, double dy, double dz)
|
||||||
: _ellipsoid(ellipsoid), _dx(dx), _dy(dy), _dz(dz) {}
|
: _ellipsoid(ellipsoid), _dx(dx), _dy(dy), _dz(dz) {}
|
||||||
|
|
||||||
@ -16,9 +17,10 @@ public:
|
|||||||
double dy() const {return _dy;}
|
double dy() const {return _dy;}
|
||||||
double dz() const {return _dz;}
|
double dz() const {return _dz;}
|
||||||
|
|
||||||
bool isNull() const {return _ellipsoid.isNull();}
|
bool isNull() const
|
||||||
bool isWGS84() const
|
{return (_ellipsoid.isNull() && _dx == 0.0 && _dy == 0.0 && _dz == 0.0);}
|
||||||
{return _ellipsoid.isWGS84() && _dx == 0 && _dy == 0 && _dz == 0;}
|
|
||||||
|
Coordinates toWGS84(const Coordinates &c) const;
|
||||||
|
|
||||||
static bool loadList(const QString &path);
|
static bool loadList(const QString &path);
|
||||||
static const QString &errorString() {return _errorString;}
|
static const QString &errorString() {return _errorString;}
|
||||||
|
@ -3,21 +3,18 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include "wgs84.h"
|
|
||||||
|
|
||||||
class Ellipsoid
|
class Ellipsoid
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Ellipsoid() : _radius(-1.0), _flattening(-1.0) {}
|
Ellipsoid() : _radius(0.0), _flattening(0.0) {}
|
||||||
Ellipsoid(double radius, double flattening)
|
Ellipsoid(double radius, double flattening)
|
||||||
: _radius(radius), _flattening(flattening) {}
|
: _radius(radius), _flattening(flattening) {}
|
||||||
|
|
||||||
double radius() const {return _radius;}
|
double radius() const {return _radius;}
|
||||||
double flattening() const {return _flattening;}
|
double flattening() const {return _flattening;}
|
||||||
|
|
||||||
bool isNull() const {return _radius < 0 || _flattening < 0;}
|
bool isNull() const {return (_radius == 0.0 && _flattening == 0.0);}
|
||||||
bool isWGS84() const
|
|
||||||
{return _radius == WGS84_RADIUS && _flattening == WGS84_FLATTENING;}
|
|
||||||
|
|
||||||
static bool loadList(const QString &path);
|
static bool loadList(const QString &path);
|
||||||
static const QString &errorString() {return _errorString;}
|
static const QString &errorString() {return _errorString;}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include "rectc.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "rd.h"
|
#include "rd.h"
|
||||||
#include "wgs84.h"
|
#include "wgs84.h"
|
||||||
@ -21,17 +22,14 @@ QRectF EmptyMap::bounds() const
|
|||||||
return scaled(QRectF(QPointF(-180, -180), QSizeF(360, 360)), 1.0/_scale);
|
return scaled(QRectF(QPointF(-180, -180), QSizeF(360, 360)), 1.0/_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal EmptyMap::zoomFit(const QSize &size, const QRectF &br)
|
qreal EmptyMap::zoomFit(const QSize &size, const RectC &br)
|
||||||
{
|
{
|
||||||
if (br.isNull())
|
if (!br.isValid())
|
||||||
_scale = SCALE_MAX;
|
_scale = SCALE_MAX;
|
||||||
else {
|
else {
|
||||||
Coordinates topLeft(br.topLeft());
|
QRectF tbr(Mercator().ll2xy(br.topLeft()),
|
||||||
Coordinates bottomRight(br.bottomRight());
|
Mercator().ll2xy(br.bottomRight()));
|
||||||
QRectF tbr(Mercator().ll2xy(topLeft), Mercator().ll2xy(bottomRight));
|
|
||||||
|
|
||||||
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
|
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
|
||||||
|
|
||||||
_scale = qMax(sc.x(), sc.y());
|
_scale = qMax(sc.x(), sc.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +39,17 @@ qreal EmptyMap::zoomFit(const QSize &size, const QRectF &br)
|
|||||||
return _scale;
|
return _scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qreal EmptyMap::zoomFit(qreal resolution, const Coordinates &c)
|
||||||
|
{
|
||||||
|
_scale = (360.0 * resolution) / (WGS84_RADIUS * 2 * M_PI
|
||||||
|
* cos(deg2rad(c.lat())));
|
||||||
|
|
||||||
|
_scale = qMax(_scale, SCALE_MAX);
|
||||||
|
_scale = qMin(_scale, SCALE_MIN);
|
||||||
|
|
||||||
|
return _scale;
|
||||||
|
}
|
||||||
|
|
||||||
qreal EmptyMap::resolution(const QPointF &p) const
|
qreal EmptyMap::resolution(const QPointF &p) const
|
||||||
{
|
{
|
||||||
return (WGS84_RADIUS * 2 * M_PI * _scale / 360.0
|
return (WGS84_RADIUS * 2 * M_PI * _scale / 360.0
|
||||||
|
@ -16,7 +16,8 @@ public:
|
|||||||
qreal resolution(const QPointF &p) const;
|
qreal resolution(const QPointF &p) const;
|
||||||
|
|
||||||
qreal zoom() const {return _scale;}
|
qreal zoom() const {return _scale;}
|
||||||
qreal zoomFit(const QSize &size, const QRectF &br);
|
qreal zoomFit(const QSize &size, const RectC &br);
|
||||||
|
qreal zoomFit(qreal resolution, const Coordinates &c);
|
||||||
qreal zoomIn();
|
qreal zoomIn();
|
||||||
qreal zoomOut();
|
qreal zoomOut();
|
||||||
|
|
||||||
|
@ -10,8 +10,7 @@ const quint32 FIT_MAGIC = 0x5449462E; // .FIT
|
|||||||
#define TIMESTAMP_FIELD 253
|
#define TIMESTAMP_FIELD 253
|
||||||
|
|
||||||
|
|
||||||
FITParser::FITParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
FITParser::FITParser()
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
|
|
||||||
{
|
{
|
||||||
memset(_defs, 0, sizeof(_defs));
|
memset(_defs, 0, sizeof(_defs));
|
||||||
|
|
||||||
@ -191,7 +190,8 @@ bool FITParser::readField(Field *f, quint32 &val)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::parseData(MessageDefinition *def, quint8 offset)
|
bool FITParser::parseData(TrackData &track, MessageDefinition *def,
|
||||||
|
quint8 offset)
|
||||||
{
|
{
|
||||||
Field *field;
|
Field *field;
|
||||||
quint32 timestamp = _timestamp + offset;
|
quint32 timestamp = _timestamp + offset;
|
||||||
@ -268,7 +268,7 @@ bool FITParser::parseData(MessageDefinition *def, quint8 offset)
|
|||||||
if (trackpoint.coordinates().isValid()) {
|
if (trackpoint.coordinates().isValid()) {
|
||||||
trackpoint.setTimestamp(QDateTime::fromTime_t(timestamp
|
trackpoint.setTimestamp(QDateTime::fromTime_t(timestamp
|
||||||
+ 631065600));
|
+ 631065600));
|
||||||
_tracks.last().append(trackpoint);
|
track.append(trackpoint);
|
||||||
} else {
|
} else {
|
||||||
if (trackpoint.coordinates().isNull())
|
if (trackpoint.coordinates().isNull())
|
||||||
warning("Missing coordinates");
|
warning("Missing coordinates");
|
||||||
@ -282,21 +282,21 @@ bool FITParser::parseData(MessageDefinition *def, quint8 offset)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::parseDataMessage(quint8 header)
|
bool FITParser::parseDataMessage(TrackData &track, quint8 header)
|
||||||
{
|
{
|
||||||
int local_id = header & 0xf;
|
int local_id = header & 0xf;
|
||||||
MessageDefinition* def = &_defs[local_id];
|
MessageDefinition* def = &_defs[local_id];
|
||||||
return parseData(def, 0);
|
return parseData(track, def, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::parseCompressedMessage(quint8 header)
|
bool FITParser::parseCompressedMessage(TrackData &track, quint8 header)
|
||||||
{
|
{
|
||||||
int local_id = (header >> 5) & 3;
|
int local_id = (header >> 5) & 3;
|
||||||
MessageDefinition* def = &_defs[local_id];
|
MessageDefinition* def = &_defs[local_id];
|
||||||
return parseData(def, header & 0x1f);
|
return parseData(track, def, header & 0x1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::parseRecord()
|
bool FITParser::parseRecord(TrackData &track)
|
||||||
{
|
{
|
||||||
quint8 header;
|
quint8 header;
|
||||||
|
|
||||||
@ -304,11 +304,11 @@ bool FITParser::parseRecord()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (header & 0x80)
|
if (header & 0x80)
|
||||||
return parseCompressedMessage(header);
|
return parseCompressedMessage(track, header);
|
||||||
else if (header & 0x40)
|
else if (header & 0x40)
|
||||||
return parseDefinitionMessage(header);
|
return parseDefinitionMessage(header);
|
||||||
else
|
else
|
||||||
return parseDataMessage(header);
|
return parseDataMessage(track, header);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::parseHeader()
|
bool FITParser::parseHeader()
|
||||||
@ -337,8 +337,11 @@ bool FITParser::parseHeader()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FITParser::loadFile(QFile *file)
|
bool FITParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(routes);
|
||||||
|
Q_UNUSED(waypoints);
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
_device = file;
|
_device = file;
|
||||||
@ -348,10 +351,11 @@ bool FITParser::loadFile(QFile *file)
|
|||||||
if (!parseHeader())
|
if (!parseHeader())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
|
TrackData &track = tracks.last();
|
||||||
|
|
||||||
while (_len)
|
while (_len)
|
||||||
if ((ret = parseRecord()) == false)
|
if ((ret = parseRecord(track)) == false)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
clearDefinitions();
|
clearDefinitions();
|
||||||
|
@ -6,37 +6,37 @@
|
|||||||
class FITParser : public Parser
|
class FITParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FITParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
FITParser();
|
||||||
QList<Waypoint> &waypoints);
|
|
||||||
~FITParser() {}
|
~FITParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||||
|
QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _errorString;}
|
QString errorString() const {return _errorString;}
|
||||||
int errorLine() const {return 0;}
|
int errorLine() const {return 0;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef struct {
|
struct FileHeader {
|
||||||
quint8 headerSize;
|
quint8 headerSize;
|
||||||
quint8 protocolVersion;
|
quint8 protocolVersion;
|
||||||
quint16 profileVersion;
|
quint16 profileVersion;
|
||||||
quint32 dataSize;
|
quint32 dataSize;
|
||||||
quint32 magic;
|
quint32 magic;
|
||||||
} FileHeader;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct Field {
|
||||||
quint8 id;
|
quint8 id;
|
||||||
quint8 size;
|
quint8 size;
|
||||||
quint8 type;
|
quint8 type;
|
||||||
} Field;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct MessageDefinition {
|
||||||
quint8 endian;
|
quint8 endian;
|
||||||
quint16 globalId;
|
quint16 globalId;
|
||||||
quint8 numFields;
|
quint8 numFields;
|
||||||
Field *fields;
|
Field *fields;
|
||||||
quint8 numDevFields;
|
quint8 numDevFields;
|
||||||
Field *devFields;
|
Field *devFields;
|
||||||
} MessageDefinition;
|
};
|
||||||
|
|
||||||
|
|
||||||
void warning(const char *text) const;
|
void warning(const char *text) const;
|
||||||
@ -47,11 +47,11 @@ private:
|
|||||||
bool skipValue(size_t size);
|
bool skipValue(size_t size);
|
||||||
|
|
||||||
bool parseHeader();
|
bool parseHeader();
|
||||||
bool parseRecord();
|
bool parseRecord(TrackData &track);
|
||||||
bool parseDefinitionMessage(quint8 header);
|
bool parseDefinitionMessage(quint8 header);
|
||||||
bool parseCompressedMessage(quint8 header);
|
bool parseCompressedMessage(TrackData &track, quint8 header);
|
||||||
bool parseDataMessage(quint8 header);
|
bool parseDataMessage(TrackData &track, quint8 header);
|
||||||
bool parseData(MessageDefinition *def, quint8 offset);
|
bool parseData(TrackData &track, MessageDefinition *def, quint8 offset);
|
||||||
bool readField(Field *f, quint32 &val);
|
bool readField(Field *f, quint32 &val);
|
||||||
|
|
||||||
QIODevice *_device;
|
QIODevice *_device;
|
||||||
|
@ -167,39 +167,36 @@ void GPXParser::track(TrackData &track)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPXParser::gpx()
|
void GPXParser::gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||||
|
QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "trk") {
|
if (_reader.name() == "trk") {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
track(_tracks.back());
|
track(tracks.back());
|
||||||
} else if (_reader.name() == "rte") {
|
} else if (_reader.name() == "rte") {
|
||||||
_routes.append(RouteData());
|
routes.append(RouteData());
|
||||||
routepoints(_routes.back());
|
routepoints(routes.back());
|
||||||
} else if (_reader.name() == "wpt") {
|
} else if (_reader.name() == "wpt") {
|
||||||
_waypoints.append(Waypoint(coordinates()));
|
waypoints.append(Waypoint(coordinates()));
|
||||||
waypointData(_waypoints.last());
|
waypointData(waypoints.last());
|
||||||
} else
|
} else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GPXParser::parse()
|
bool GPXParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
_reader.clear();
|
||||||
|
_reader.setDevice(file);
|
||||||
|
|
||||||
if (_reader.readNextStartElement()) {
|
if (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "gpx")
|
if (_reader.name() == "gpx")
|
||||||
gpx();
|
gpx(tracks, routes, waypoints);
|
||||||
else
|
else
|
||||||
_reader.raiseError("Not a GPX file");
|
_reader.raiseError("Not a GPX file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return !_reader.error();
|
return !_reader.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GPXParser::loadFile(QFile *file)
|
|
||||||
{
|
|
||||||
_reader.clear();
|
|
||||||
_reader.setDevice(file);
|
|
||||||
|
|
||||||
return parse();
|
|
||||||
}
|
|
||||||
|
@ -8,17 +8,16 @@
|
|||||||
class GPXParser : public Parser
|
class GPXParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GPXParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
|
|
||||||
~GPXParser() {}
|
~GPXParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _reader.errorString();}
|
QString errorString() const {return _reader.errorString();}
|
||||||
int errorLine() const {return _reader.lineNumber();}
|
int errorLine() const {return _reader.lineNumber();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool parse();
|
void gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||||
void gpx();
|
QList<Waypoint> &waypoints);
|
||||||
void track(TrackData &track);
|
void track(TrackData &track);
|
||||||
void trackpoints(TrackData &track);
|
void trackpoints(TrackData &track);
|
||||||
void routepoints(RouteData &route);
|
void routepoints(RouteData &route);
|
||||||
|
@ -4,6 +4,5 @@ QDebug operator<<(QDebug dbg, const GraphPoint &point)
|
|||||||
{
|
{
|
||||||
dbg.nospace() << "GraphPoint(" << point.s() << ", " << point.t() << ", "
|
dbg.nospace() << "GraphPoint(" << point.s() << ", " << point.t() << ", "
|
||||||
<< point.y() << ")";
|
<< point.y() << ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
||||||
|
66
src/gui.cpp
66
src/gui.cpp
@ -102,24 +102,6 @@ GUI::~GUI()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString GUI::fileFormats() const
|
|
||||||
{
|
|
||||||
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)")
|
|
||||||
+ ";;" + tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
|
|
||||||
+ tr("GPX files (*.gpx)") + ";;" + tr("IGC files (*.igc)") + ";;"
|
|
||||||
+ tr("KML files (*.kml)") + ";;" + tr("NMEA files (*.nmea)") + ";;"
|
|
||||||
+ tr("TCX files (*.tcx)") + ";;" + tr("All files (*)");
|
|
||||||
}
|
|
||||||
|
|
||||||
void GUI::createBrowser()
|
|
||||||
{
|
|
||||||
QStringList filter;
|
|
||||||
filter << "*.gpx" << "*.tcx" << "*.kml" << "*.fit" << "*.csv" << "*.igc"
|
|
||||||
<< "*.nmea";
|
|
||||||
_browser = new FileBrowser(this);
|
|
||||||
_browser->setFilter(filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GUI::loadDatums()
|
void GUI::loadDatums()
|
||||||
{
|
{
|
||||||
QString ef, df;
|
QString ef, df;
|
||||||
@ -175,7 +157,7 @@ void GUI::loadMaps()
|
|||||||
else if (QFile::exists(GLOBAL_MAP_FILE))
|
else if (QFile::exists(GLOBAL_MAP_FILE))
|
||||||
online = GLOBAL_MAP_FILE;
|
online = GLOBAL_MAP_FILE;
|
||||||
|
|
||||||
if (!online.isNull() && !_ml->loadList(online))
|
if (!online.isNull() && !_ml->loadFile(online))
|
||||||
qWarning("%s: %s", qPrintable(online), qPrintable(_ml->errorString()));
|
qWarning("%s: %s", qPrintable(online), qPrintable(_ml->errorString()));
|
||||||
|
|
||||||
|
|
||||||
@ -187,12 +169,10 @@ void GUI::loadMaps()
|
|||||||
if (!offline.isNull()) {
|
if (!offline.isNull()) {
|
||||||
QDir md(offline);
|
QDir md(offline);
|
||||||
QFileInfoList ml = md.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
QFileInfoList ml = md.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
QStringList filters;
|
|
||||||
filters << "*.map" << "*.tba" << "*.tar";
|
|
||||||
|
|
||||||
for (int i = 0; i < ml.size(); i++) {
|
for (int i = 0; i < ml.size(); i++) {
|
||||||
QDir dir(ml.at(i).absoluteFilePath());
|
QDir dir(ml.at(i).absoluteFilePath());
|
||||||
QFileInfoList fl = dir.entryInfoList(filters, QDir::Files);
|
QFileInfoList fl = dir.entryInfoList(MapList::filter(), QDir::Files);
|
||||||
|
|
||||||
if (fl.isEmpty())
|
if (fl.isEmpty())
|
||||||
qWarning("%s: no map/atlas file found",
|
qWarning("%s: no map/atlas file found",
|
||||||
@ -201,7 +181,7 @@ void GUI::loadMaps()
|
|||||||
qWarning("%s: ambiguous directory content",
|
qWarning("%s: ambiguous directory content",
|
||||||
qPrintable(ml.at(i).absoluteFilePath()));
|
qPrintable(ml.at(i).absoluteFilePath()));
|
||||||
else
|
else
|
||||||
if (!_ml->loadMap(fl.first().absoluteFilePath()))
|
if (!_ml->loadFile(fl.first().absoluteFilePath()))
|
||||||
qWarning("%s: %s", qPrintable(fl.first().absoluteFilePath()),
|
qWarning("%s: %s", qPrintable(fl.first().absoluteFilePath()),
|
||||||
qPrintable(_ml->errorString()));
|
qPrintable(_ml->errorString()));
|
||||||
}
|
}
|
||||||
@ -234,6 +214,12 @@ void GUI::loadPOIs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::createBrowser()
|
||||||
|
{
|
||||||
|
_browser = new FileBrowser(this);
|
||||||
|
_browser->setFilter(Data::filter());
|
||||||
|
}
|
||||||
|
|
||||||
void GUI::createMapActions()
|
void GUI::createMapActions()
|
||||||
{
|
{
|
||||||
_mapsSignalMapper = new QSignalMapper(this);
|
_mapsSignalMapper = new QSignalMapper(this);
|
||||||
@ -295,6 +281,7 @@ void GUI::createActions()
|
|||||||
// General actions
|
// General actions
|
||||||
_exitAction = new QAction(QIcon(QPixmap(QUIT_ICON)), tr("Quit"), this);
|
_exitAction = new QAction(QIcon(QPixmap(QUIT_ICON)), tr("Quit"), this);
|
||||||
_exitAction->setShortcut(QUIT_SHORTCUT);
|
_exitAction->setShortcut(QUIT_SHORTCUT);
|
||||||
|
_exitAction->setMenuRole(QAction::QuitRole);
|
||||||
connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
|
connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
|
||||||
addAction(_exitAction);
|
addAction(_exitAction);
|
||||||
|
|
||||||
@ -305,6 +292,7 @@ void GUI::createActions()
|
|||||||
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
|
connect(_keysAction, SIGNAL(triggered()), this, SLOT(keys()));
|
||||||
_aboutAction = new QAction(QIcon(QPixmap(APP_ICON)),
|
_aboutAction = new QAction(QIcon(QPixmap(APP_ICON)),
|
||||||
tr("About GPXSee"), this);
|
tr("About GPXSee"), this);
|
||||||
|
_aboutAction->setMenuRole(QAction::AboutRole);
|
||||||
connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
|
connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
|
||||||
|
|
||||||
// File actions
|
// File actions
|
||||||
@ -477,6 +465,7 @@ void GUI::createActions()
|
|||||||
SLOT(showFullscreen(bool)));
|
SLOT(showFullscreen(bool)));
|
||||||
addAction(_fullscreenAction);
|
addAction(_fullscreenAction);
|
||||||
_openOptionsAction = new QAction(tr("Options..."), this);
|
_openOptionsAction = new QAction(tr("Options..."), this);
|
||||||
|
_openOptionsAction->setMenuRole(QAction::PreferencesRole);
|
||||||
connect(_openOptionsAction, SIGNAL(triggered()), this,
|
connect(_openOptionsAction, SIGNAL(triggered()), this,
|
||||||
SLOT(openOptions()));
|
SLOT(openOptions()));
|
||||||
|
|
||||||
@ -647,6 +636,7 @@ void GUI::createStatusBar()
|
|||||||
void GUI::about()
|
void GUI::about()
|
||||||
{
|
{
|
||||||
QMessageBox msgBox(this);
|
QMessageBox msgBox(this);
|
||||||
|
QUrl homepage(APP_HOMEPAGE);
|
||||||
|
|
||||||
msgBox.setWindowTitle(tr("About GPXSee"));
|
msgBox.setWindowTitle(tr("About GPXSee"));
|
||||||
msgBox.setText("<h2>" + QString(APP_NAME) + "</h2><p><p>" + tr("Version ")
|
msgBox.setText("<h2>" + QString(APP_NAME) + "</h2><p><p>" + tr("Version ")
|
||||||
@ -654,7 +644,8 @@ void GUI::about()
|
|||||||
msgBox.setInformativeText("<table width=\"300\"><tr><td>"
|
msgBox.setInformativeText("<table width=\"300\"><tr><td>"
|
||||||
+ tr("GPXSee is distributed under the terms of the GNU General Public "
|
+ tr("GPXSee is distributed under the terms of the GNU General Public "
|
||||||
"License version 3. For more info about GPXSee visit the project "
|
"License version 3. For more info about GPXSee visit the project "
|
||||||
"homepage at ") + "<a href=\"" + APP_HOMEPAGE + "\">" + APP_HOMEPAGE
|
"homepage at ") + "<a href=\"" + homepage.toString() + "\">"
|
||||||
|
+ homepage.toString(QUrl::RemoveScheme).mid(2)
|
||||||
+ "</a>.</td></tr></table>");
|
+ "</a>.</td></tr></table>");
|
||||||
|
|
||||||
QIcon icon = msgBox.windowIcon();
|
QIcon icon = msgBox.windowIcon();
|
||||||
@ -731,7 +722,7 @@ void GUI::dataSources()
|
|||||||
void GUI::openFile()
|
void GUI::openFile()
|
||||||
{
|
{
|
||||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"),
|
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open file"),
|
||||||
QString(), fileFormats());
|
QString(), Data::formats());
|
||||||
QStringList list = files;
|
QStringList list = files;
|
||||||
|
|
||||||
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
||||||
@ -821,7 +812,7 @@ bool GUI::loadFile(const QString &fileName)
|
|||||||
void GUI::openPOIFile()
|
void GUI::openPOIFile()
|
||||||
{
|
{
|
||||||
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open POI file"),
|
QStringList files = QFileDialog::getOpenFileNames(this, tr("Open POI file"),
|
||||||
QString(), fileFormats());
|
QString(), Data::formats());
|
||||||
QStringList list = files;
|
QStringList list = files;
|
||||||
|
|
||||||
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
for (QStringList::Iterator it = list.begin(); it != list.end(); it++)
|
||||||
@ -1204,22 +1195,25 @@ void GUI::showGraphGrids(bool show)
|
|||||||
void GUI::loadMap()
|
void GUI::loadMap()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open map file"),
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Open map file"),
|
||||||
QString(), tr("Map files (*.map *.tba *.tar)"));
|
QString(), MapList::formats());
|
||||||
|
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_ml->loadMap(fileName)) {
|
int count = _ml->maps().count();
|
||||||
QAction *a = new QAction(_ml->maps().last()->name(), this);
|
if (_ml->loadFile(fileName)) {
|
||||||
a->setCheckable(true);
|
for (int i = count; i < _ml->maps().count(); i++) {
|
||||||
a->setActionGroup(_mapsActionGroup);
|
QAction *a = new QAction(_ml->maps().at(i)->name(), this);
|
||||||
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
|
a->setCheckable(true);
|
||||||
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
|
a->setActionGroup(_mapsActionGroup);
|
||||||
_mapActions.append(a);
|
_mapsSignalMapper->setMapping(a, i);
|
||||||
_mapMenu->insertAction(_mapsEnd, a);
|
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
|
||||||
|
_mapActions.append(a);
|
||||||
|
_mapMenu->insertAction(_mapsEnd, a);
|
||||||
|
}
|
||||||
_showMapAction->setEnabled(true);
|
_showMapAction->setEnabled(true);
|
||||||
_clearMapCacheAction->setEnabled(true);
|
_clearMapCacheAction->setEnabled(true);
|
||||||
a->activate(QAction::Trigger);
|
_mapActions.last()->activate(QAction::Trigger);
|
||||||
} else {
|
} else {
|
||||||
QString error = tr("Error loading map:") + "\n\n"
|
QString error = tr("Error loading map:") + "\n\n"
|
||||||
+ fileName + "\n\n" + _ml->errorString();
|
+ fileName + "\n\n" + _ml->errorString();
|
||||||
|
@ -121,8 +121,6 @@ private:
|
|||||||
void readSettings();
|
void readSettings();
|
||||||
void writeSettings();
|
void writeSettings();
|
||||||
|
|
||||||
const QString fileFormats() const;
|
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
|
@ -120,7 +120,7 @@ bool IGCParser::readHRecord(const char *line, int len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IGCParser::readBRecord(const char *line, int len)
|
bool IGCParser::readBRecord(TrackData &track, const char *line, int len)
|
||||||
{
|
{
|
||||||
qreal lat, lon, ele;
|
qreal lat, lon, ele;
|
||||||
QTime time;
|
QTime time;
|
||||||
@ -156,12 +156,12 @@ bool IGCParser::readBRecord(const char *line, int len)
|
|||||||
Trackpoint t(Coordinates(lon, lat));
|
Trackpoint t(Coordinates(lon, lat));
|
||||||
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
|
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
|
||||||
t.setElevation(ele);
|
t.setElevation(ele);
|
||||||
_tracks.last().append(t);
|
track.append(t);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IGCParser::readCRecord(const char *line, int len)
|
bool IGCParser::readCRecord(RouteData &route, const char *line, int len)
|
||||||
{
|
{
|
||||||
qreal lat, lon;
|
qreal lat, lon;
|
||||||
|
|
||||||
@ -183,14 +183,16 @@ bool IGCParser::readCRecord(const char *line, int len)
|
|||||||
|
|
||||||
Waypoint w(Coordinates(lon, lat));
|
Waypoint w(Coordinates(lon, lat));
|
||||||
w.setName(QString(ba.trimmed()));
|
w.setName(QString(ba.trimmed()));
|
||||||
_routes.last().append(w);
|
route.append(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IGCParser::loadFile(QFile *file)
|
bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(waypoints);
|
||||||
qint64 len;
|
qint64 len;
|
||||||
char line[76 + 2 + 1 + 1];
|
char line[76 + 2 + 1 + 1];
|
||||||
bool route = false, track = false;
|
bool route = false, track = false;
|
||||||
@ -221,11 +223,11 @@ bool IGCParser::loadFile(QFile *file)
|
|||||||
return false;
|
return false;
|
||||||
} else if (line[0] == 'C') {
|
} else if (line[0] == 'C') {
|
||||||
if (route) {
|
if (route) {
|
||||||
if (!readCRecord(line, len))
|
if (!readCRecord(routes.last() ,line, len))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
route = true;
|
route = true;
|
||||||
_routes.append(RouteData());
|
routes.append(RouteData());
|
||||||
}
|
}
|
||||||
} else if (line[0] == 'B') {
|
} else if (line[0] == 'B') {
|
||||||
if (_date.isNull()) {
|
if (_date.isNull()) {
|
||||||
@ -233,11 +235,11 @@ bool IGCParser::loadFile(QFile *file)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!track) {
|
if (!track) {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
_time = QTime(0, 0);
|
_time = QTime(0, 0);
|
||||||
track = true;
|
track = true;
|
||||||
}
|
}
|
||||||
if (!readBRecord(line, len))
|
if (!readBRecord(tracks.last(), line, len))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,19 +9,18 @@
|
|||||||
class IGCParser : public Parser
|
class IGCParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IGCParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
IGCParser() : _errorLine(0) {}
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
|
|
||||||
{_errorLine = 0;}
|
|
||||||
~IGCParser() {}
|
~IGCParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _errorString;}
|
QString errorString() const {return _errorString;}
|
||||||
int errorLine() const {return _errorLine;}
|
int errorLine() const {return _errorLine;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool readHRecord(const char *line, int len);
|
bool readHRecord(const char *line, int len);
|
||||||
bool readBRecord(const char *line, int len);
|
bool readBRecord(TrackData &track, const char *line, int len);
|
||||||
bool readCRecord(const char *line, int len);
|
bool readCRecord(RouteData &route, const char *line, int len);
|
||||||
|
|
||||||
int _errorLine;
|
int _errorLine;
|
||||||
QString _errorString;
|
QString _errorString;
|
||||||
|
@ -251,20 +251,21 @@ void KMLParser::track(TrackData &track)
|
|||||||
_reader.raiseError(mismatchError);
|
_reader.raiseError(mismatchError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMLParser::multiGeometry(const QString &name, const QString &desc,
|
void KMLParser::multiGeometry(QList<TrackData> &tracks,
|
||||||
|
QList<Waypoint> &waypoints, const QString &name, const QString &desc,
|
||||||
const QDateTime timestamp)
|
const QDateTime timestamp)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Point") {
|
if (_reader.name() == "Point") {
|
||||||
_waypoints.append(Waypoint());
|
waypoints.append(Waypoint());
|
||||||
Waypoint &w = _waypoints.last();
|
Waypoint &w = waypoints.last();
|
||||||
w.setName(name);
|
w.setName(name);
|
||||||
w.setDescription(desc);
|
w.setDescription(desc);
|
||||||
w.setTimestamp(timestamp);
|
w.setTimestamp(timestamp);
|
||||||
point(w);
|
point(w);
|
||||||
} else if (_reader.name() == "LineString") {
|
} else if (_reader.name() == "LineString") {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
TrackData &t = _tracks.last();
|
TrackData &t = tracks.last();
|
||||||
t.setName(name);
|
t.setName(name);
|
||||||
t.setDescription(desc);
|
t.setDescription(desc);
|
||||||
lineString(t);
|
lineString(t);
|
||||||
@ -273,7 +274,7 @@ void KMLParser::multiGeometry(const QString &name, const QString &desc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMLParser::placemark()
|
void KMLParser::placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
QString name, desc;
|
QString name, desc;
|
||||||
QDateTime timestamp;
|
QDateTime timestamp;
|
||||||
@ -286,23 +287,24 @@ void KMLParser::placemark()
|
|||||||
else if (_reader.name() == "TimeStamp")
|
else if (_reader.name() == "TimeStamp")
|
||||||
timestamp = timeStamp();
|
timestamp = timeStamp();
|
||||||
else if (_reader.name() == "MultiGeometry")
|
else if (_reader.name() == "MultiGeometry")
|
||||||
multiGeometry(name, desc, timestamp);
|
multiGeometry(tracks, waypoints, name, desc, timestamp);
|
||||||
else if (_reader.name() == "Point") {
|
else if (_reader.name() == "Point") {
|
||||||
_waypoints.append(Waypoint());
|
waypoints.append(Waypoint());
|
||||||
Waypoint &w = _waypoints.last();
|
Waypoint &w = waypoints.last();
|
||||||
w.setName(name);
|
w.setName(name);
|
||||||
w.setDescription(desc);
|
w.setDescription(desc);
|
||||||
w.setTimestamp(timestamp);
|
w.setTimestamp(timestamp);
|
||||||
point(w);
|
point(w);
|
||||||
} else if (_reader.name() == "LineString") {
|
} else if (_reader.name() == "LineString"
|
||||||
_tracks.append(TrackData());
|
|| _reader.name() == "LinearRing") {
|
||||||
TrackData &t = _tracks.last();
|
tracks.append(TrackData());
|
||||||
|
TrackData &t = tracks.last();
|
||||||
t.setName(name);
|
t.setName(name);
|
||||||
t.setDescription(desc);
|
t.setDescription(desc);
|
||||||
lineString(t);
|
lineString(t);
|
||||||
} else if (_reader.name() == "Track") {
|
} else if (_reader.name() == "Track") {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
TrackData &t = _tracks.last();
|
TrackData &t = tracks.last();
|
||||||
t.setName(name);
|
t.setName(name);
|
||||||
t.setDescription(desc);
|
t.setDescription(desc);
|
||||||
track(t);
|
track(t);
|
||||||
@ -311,58 +313,56 @@ void KMLParser::placemark()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMLParser::folder()
|
void KMLParser::folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Placemark")
|
if (_reader.name() == "Placemark")
|
||||||
placemark();
|
placemark(tracks, waypoints);
|
||||||
else if (_reader.name() == "Folder")
|
else if (_reader.name() == "Folder")
|
||||||
folder();
|
folder(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMLParser::document()
|
void KMLParser::document(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Placemark")
|
if (_reader.name() == "Placemark")
|
||||||
placemark();
|
placemark(tracks, waypoints);
|
||||||
else if (_reader.name() == "Folder")
|
else if (_reader.name() == "Folder")
|
||||||
folder();
|
folder(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMLParser::kml()
|
void KMLParser::kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Document")
|
if (_reader.name() == "Document")
|
||||||
document();
|
document(tracks, waypoints);
|
||||||
else if (_reader.name() == "Placemark")
|
else if (_reader.name() == "Placemark")
|
||||||
placemark();
|
placemark(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KMLParser::parse()
|
bool KMLParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(routes);
|
||||||
|
|
||||||
|
_reader.clear();
|
||||||
|
_reader.setDevice(file);
|
||||||
|
|
||||||
if (_reader.readNextStartElement()) {
|
if (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "kml")
|
if (_reader.name() == "kml")
|
||||||
kml();
|
kml(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.raiseError("Not a KML file");
|
_reader.raiseError("Not a KML file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return !_reader.error();
|
return !_reader.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KMLParser::loadFile(QFile *file)
|
|
||||||
{
|
|
||||||
_reader.clear();
|
|
||||||
_reader.setDevice(file);
|
|
||||||
|
|
||||||
return parse();
|
|
||||||
}
|
|
||||||
|
@ -8,22 +8,20 @@
|
|||||||
class KMLParser : public Parser
|
class KMLParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KMLParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
|
|
||||||
~KMLParser() {}
|
~KMLParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _reader.errorString();}
|
QString errorString() const {return _reader.errorString();}
|
||||||
int errorLine() const {return _reader.lineNumber();}
|
int errorLine() const {return _reader.lineNumber();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool parse();
|
void kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void kml();
|
void document(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void document();
|
void folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void folder();
|
void placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void placemark();
|
void multiGeometry(QList<TrackData> &tracks, QList<Waypoint> &waypoints,
|
||||||
void multiGeometry(const QString &name, const QString &desc,
|
const QString &name, const QString &desc, const QDateTime timestamp);
|
||||||
const QDateTime timestamp);
|
|
||||||
void track(TrackData &track);
|
void track(TrackData &track);
|
||||||
void lineString(TrackData &track);
|
void lineString(TrackData &track);
|
||||||
void point(Waypoint &waypoint);
|
void point(Waypoint &waypoint);
|
||||||
|
@ -7,9 +7,9 @@ class LatLon : public Projection
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual QPointF ll2xy(const Coordinates &c) const
|
virtual QPointF ll2xy(const Coordinates &c) const
|
||||||
{return c.toPointF();}
|
{return QPointF(c.lon(), c.lat());}
|
||||||
virtual Coordinates xy2ll(const QPointF &p) const
|
virtual Coordinates xy2ll(const QPointF &p) const
|
||||||
{return Coordinates(p);}
|
{return Coordinates(p.x(), p.y());}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LATLON_H
|
#endif // LATLON_H
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
class QPainter;
|
class QPainter;
|
||||||
class Coordinates;
|
class Coordinates;
|
||||||
|
class RectC;
|
||||||
|
|
||||||
class Map : public QObject
|
class Map : public QObject
|
||||||
{
|
{
|
||||||
@ -21,7 +22,8 @@ public:
|
|||||||
virtual qreal resolution(const QPointF &p) const = 0;
|
virtual qreal resolution(const QPointF &p) const = 0;
|
||||||
|
|
||||||
virtual qreal zoom() const = 0;
|
virtual qreal zoom() const = 0;
|
||||||
virtual qreal zoomFit(const QSize &size, const QRectF &br) = 0;
|
virtual qreal zoomFit(const QSize &size, const RectC &br) = 0;
|
||||||
|
virtual qreal zoomFit(qreal resolution, const Coordinates &c) = 0;
|
||||||
virtual qreal zoomIn() = 0;
|
virtual qreal zoomIn() = 0;
|
||||||
virtual qreal zoomOut() = 0;
|
virtual qreal zoomOut() = 0;
|
||||||
|
|
||||||
|
136
src/maplist.cpp
136
src/maplist.cpp
@ -6,26 +6,25 @@
|
|||||||
#include "maplist.h"
|
#include "maplist.h"
|
||||||
|
|
||||||
|
|
||||||
bool MapList::loadListEntry(const QByteArray &line)
|
Map *MapList::loadListEntry(const QByteArray &line)
|
||||||
{
|
{
|
||||||
QList<QByteArray> list = line.split('\t');
|
QList<QByteArray> list = line.split('\t');
|
||||||
if (list.size() != 2)
|
if (list.size() != 2)
|
||||||
return false;
|
return 0;
|
||||||
|
|
||||||
QByteArray ba1 = list[0].trimmed();
|
QByteArray ba1 = list[0].trimmed();
|
||||||
QByteArray ba2 = list[1].trimmed();
|
QByteArray ba2 = list[1].trimmed();
|
||||||
if (ba1.isEmpty() || ba2.isEmpty())
|
if (ba1.isEmpty() || ba2.isEmpty())
|
||||||
return false;
|
return 0;
|
||||||
|
|
||||||
_maps.append(new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
|
return new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
|
||||||
QString::fromLatin1(ba2.data(), ba2.size()), this));
|
QString::fromLatin1(ba2.data(), ba2.size()), this);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MapList::loadList(const QString &path)
|
bool MapList::loadList(const QString &path)
|
||||||
{
|
{
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
|
QList<Map*> maps;
|
||||||
|
|
||||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
_errorString = file.errorString();
|
_errorString = file.errorString();
|
||||||
@ -36,65 +35,102 @@ bool MapList::loadList(const QString &path)
|
|||||||
while (!file.atEnd()) {
|
while (!file.atEnd()) {
|
||||||
ln++;
|
ln++;
|
||||||
QByteArray line = file.readLine();
|
QByteArray line = file.readLine();
|
||||||
|
Map *map = loadListEntry(line);
|
||||||
|
|
||||||
if (!loadListEntry(line)) {
|
if (map)
|
||||||
|
maps.append(map);
|
||||||
|
else {
|
||||||
|
for (int i = 0; i < maps.count(); i++)
|
||||||
|
delete maps.at(i);
|
||||||
_errorString = QString("Invalid map list entry on line %1.")
|
_errorString = QString("Invalid map list entry on line %1.")
|
||||||
.arg(QString::number(ln));
|
.arg(QString::number(ln));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_maps += maps;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MapList::loadMap(const QString &path)
|
bool MapList::loadMap(const QString &path)
|
||||||
|
{
|
||||||
|
OfflineMap *map = new OfflineMap(path, this);
|
||||||
|
if (map->isValid()) {
|
||||||
|
_maps.append(map);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
_errorString = map->errorString();
|
||||||
|
delete map;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MapList::loadTba(const QString &path)
|
||||||
|
{
|
||||||
|
Atlas *atlas = new Atlas(path, this);
|
||||||
|
if (atlas->isValid()) {
|
||||||
|
_maps.append(atlas);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
_errorString = atlas->errorString();
|
||||||
|
delete atlas;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MapList::loadTar(const QString &path)
|
||||||
|
{
|
||||||
|
Atlas *atlas = new Atlas(path, this);
|
||||||
|
if (atlas->isValid()) {
|
||||||
|
_maps.append(atlas);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
_errorString = atlas->errorString();
|
||||||
|
delete atlas;
|
||||||
|
OfflineMap *map = new OfflineMap(path, this);
|
||||||
|
if (map->isValid()) {
|
||||||
|
_maps.append(map);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
qWarning("%s: %s", qPrintable(path), qPrintable(_errorString));
|
||||||
|
qWarning("%s: %s", qPrintable(path),
|
||||||
|
qPrintable(map->errorString()));
|
||||||
|
_errorString = "Not a map/atlas file";
|
||||||
|
delete map;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MapList::loadFile(const QString &path)
|
||||||
{
|
{
|
||||||
QFileInfo fi(path);
|
QFileInfo fi(path);
|
||||||
QString suffix = fi.suffix().toLower();
|
QString suffix = fi.suffix().toLower();
|
||||||
|
|
||||||
if (suffix == "map") {
|
if (suffix == "txt")
|
||||||
OfflineMap *om = new OfflineMap(path, this);
|
return loadList(path);
|
||||||
if (om->isValid()) {
|
else if (suffix == "map")
|
||||||
_maps.append(om);
|
return loadMap(path);
|
||||||
return true;
|
else if (suffix == "tba")
|
||||||
} else {
|
return loadTba(path);
|
||||||
_errorString = om->errorString();
|
else if (suffix == "tar")
|
||||||
delete om;
|
return loadTar(path);
|
||||||
return false;
|
else {
|
||||||
}
|
|
||||||
} else if (suffix == "tba") {
|
|
||||||
Atlas *atlas = new Atlas(path, this);
|
|
||||||
if (atlas->isValid()) {
|
|
||||||
_maps.append(atlas);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
_errorString = atlas->errorString();
|
|
||||||
delete atlas;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (suffix == "tar") {
|
|
||||||
Atlas *atlas = new Atlas(path, this);
|
|
||||||
if (atlas->isValid()) {
|
|
||||||
_maps.append(atlas);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
_errorString = atlas->errorString();
|
|
||||||
delete atlas;
|
|
||||||
OfflineMap *om = new OfflineMap(path, this);
|
|
||||||
if (om->isValid()) {
|
|
||||||
_maps.append(om);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
qWarning("%s: %s", qPrintable(path), qPrintable(_errorString));
|
|
||||||
qWarning("%s: %s", qPrintable(path),
|
|
||||||
qPrintable(om->errorString()));
|
|
||||||
_errorString = "Not a map/atlas file";
|
|
||||||
delete om;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
_errorString = "Not a map/atlas file";
|
_errorString = "Not a map/atlas file";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MapList::formats()
|
||||||
|
{
|
||||||
|
return tr("Map files (*.map *.tba *.tar)") + ";;"
|
||||||
|
+ tr("URL list files (*.txt)");
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList MapList::filter()
|
||||||
|
{
|
||||||
|
QStringList filter;
|
||||||
|
filter << "*.map" << "*.tba" << "*.tar" << "*.txt";
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
@ -12,14 +12,21 @@ class MapList : public QObject
|
|||||||
public:
|
public:
|
||||||
MapList(QObject *parent = 0) : QObject(parent) {}
|
MapList(QObject *parent = 0) : QObject(parent) {}
|
||||||
|
|
||||||
bool loadMap(const QString &path);
|
bool loadFile(const QString &path);
|
||||||
bool loadList(const QString &path);
|
|
||||||
|
|
||||||
QList<Map*> &maps() {return _maps;}
|
const QList<Map*> &maps() const {return _maps;}
|
||||||
const QString &errorString() const {return _errorString;}
|
const QString &errorString() const {return _errorString;}
|
||||||
|
|
||||||
|
static QString formats();
|
||||||
|
static QStringList filter();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool loadListEntry(const QByteArray &line);
|
Map *loadListEntry(const QByteArray &line);
|
||||||
|
|
||||||
|
bool loadList(const QString &path);
|
||||||
|
bool loadMap(const QString &path);
|
||||||
|
bool loadTba(const QString &path);
|
||||||
|
bool loadTar(const QString &path);
|
||||||
|
|
||||||
QList<Map*> _maps;
|
QList<Map*> _maps;
|
||||||
QString _errorString;
|
QString _errorString;
|
||||||
|
@ -115,3 +115,16 @@ void Matrix::zeroize()
|
|||||||
for (size_t i = 0; i < _h * _w; i++)
|
for (size_t i = 0; i < _h * _w; i++)
|
||||||
_m[i] = 0;
|
_m[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug dbg, const Matrix &matrix)
|
||||||
|
{
|
||||||
|
dbg.nospace() << "Matrix(" << endl;
|
||||||
|
for (size_t i = 0; i < matrix.h(); i++) {
|
||||||
|
for (size_t j = 0; j < matrix.w(); j++)
|
||||||
|
dbg << "\t" << matrix.m(i, j);
|
||||||
|
dbg << endl;
|
||||||
|
}
|
||||||
|
dbg << ")";
|
||||||
|
|
||||||
|
return dbg.space();
|
||||||
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
class Matrix {
|
class Matrix {
|
||||||
public:
|
public:
|
||||||
@ -30,4 +31,6 @@ private:
|
|||||||
size_t _w;
|
size_t _w;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug dbg, const Matrix &matrix);
|
||||||
|
|
||||||
#endif // MATRIX_H
|
#endif // MATRIX_H
|
||||||
|
@ -227,7 +227,7 @@ bool NMEAParser::readEW(const char *data, int len, qreal &lon)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NMEAParser::readRMC(const char *line, int len)
|
bool NMEAParser::readRMC(TrackData &track, const char *line, int len)
|
||||||
{
|
{
|
||||||
int col = 1;
|
int col = 1;
|
||||||
const char *vp = line;
|
const char *vp = line;
|
||||||
@ -280,22 +280,23 @@ bool NMEAParser::readRMC(const char *line, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!date.isNull()) {
|
if (!date.isNull()) {
|
||||||
if (_date.isNull() && !_time.isNull() && !_tracks.last().isEmpty())
|
if (_date.isNull() && !_time.isNull() && !track.isEmpty())
|
||||||
_tracks.last().last().setTimestamp(QDateTime(date, _time, Qt::UTC));
|
track.last().setTimestamp(QDateTime(date, _time, Qt::UTC));
|
||||||
_date = date;
|
_date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valid && !_GGA && !std::isnan(lat) && !std::isnan(lon)) {
|
Coordinates c(lon, lat);
|
||||||
Trackpoint t(Coordinates(lon, lat));
|
if (valid && !_GGA && c.isValid()) {
|
||||||
|
Trackpoint t(c);
|
||||||
if (!_date.isNull() && !time.isNull())
|
if (!_date.isNull() && !time.isNull())
|
||||||
t.setTimestamp(QDateTime(_date, time, Qt::UTC));
|
t.setTimestamp(QDateTime(_date, time, Qt::UTC));
|
||||||
_tracks.last().append(t);
|
track.append(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NMEAParser::readGGA(const char *line, int len)
|
bool NMEAParser::readGGA(TrackData &track, const char *line, int len)
|
||||||
{
|
{
|
||||||
int col = 1;
|
int col = 1;
|
||||||
const char *vp = line;
|
const char *vp = line;
|
||||||
@ -356,13 +357,14 @@ bool NMEAParser::readGGA(const char *line, int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::isnan(lat) && !std::isnan(lon)) {
|
Coordinates c(lon, lat);
|
||||||
Trackpoint t(Coordinates(lon, lat));
|
if (c.isValid()) {
|
||||||
|
Trackpoint t(c);
|
||||||
if (!(_time.isNull() || _date.isNull()))
|
if (!(_time.isNull() || _date.isNull()))
|
||||||
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
|
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
|
||||||
if (!std::isnan(ele))
|
if (!std::isnan(ele))
|
||||||
t.setElevation(ele - gh);
|
t.setElevation(ele - gh);
|
||||||
_tracks.last().append(t);
|
track.append(t);
|
||||||
|
|
||||||
_GGA = true;
|
_GGA = true;
|
||||||
}
|
}
|
||||||
@ -370,7 +372,7 @@ bool NMEAParser::readGGA(const char *line, int len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NMEAParser::readWPL(const char *line, int len)
|
bool NMEAParser::readWPL(QList<Waypoint> &waypoints, const char *line, int len)
|
||||||
{
|
{
|
||||||
int col = 1;
|
int col = 1;
|
||||||
const char *vp = line;
|
const char *vp = line;
|
||||||
@ -411,10 +413,11 @@ bool NMEAParser::readWPL(const char *line, int len)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!std::isnan(lat) && !std::isnan(lon)) {
|
Coordinates c(lon, lat);
|
||||||
Waypoint w(Coordinates(lon, lat));
|
if (c.isValid()) {
|
||||||
|
Waypoint w(c);
|
||||||
w.setName(name);
|
w.setName(name);
|
||||||
_waypoints.append(w);
|
waypoints.append(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -474,8 +477,10 @@ bool NMEAParser::readZDA(const char *line, int len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NMEAParser::loadFile(QFile *file)
|
bool NMEAParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(routes);
|
||||||
qint64 len;
|
qint64 len;
|
||||||
char line[80 + 2 + 1 + 1];
|
char line[80 + 2 + 1 + 1];
|
||||||
|
|
||||||
@ -486,7 +491,8 @@ bool NMEAParser::loadFile(QFile *file)
|
|||||||
_time = QTime();
|
_time = QTime();
|
||||||
_GGA = false;
|
_GGA = false;
|
||||||
|
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
|
TrackData &track = tracks.last();
|
||||||
|
|
||||||
while (!file->atEnd()) {
|
while (!file->atEnd()) {
|
||||||
len = file->readLine(line, sizeof(line));
|
len = file->readLine(line, sizeof(line));
|
||||||
@ -501,13 +507,13 @@ bool NMEAParser::loadFile(QFile *file)
|
|||||||
|
|
||||||
if (validSentence(line, len)) {
|
if (validSentence(line, len)) {
|
||||||
if (!memcmp(line + 3, "RMC,", 4)) {
|
if (!memcmp(line + 3, "RMC,", 4)) {
|
||||||
if (!readRMC(line + 7, len))
|
if (!readRMC(track, line + 7, len))
|
||||||
return false;
|
return false;
|
||||||
} else if (!memcmp(line + 3, "GGA,", 4)) {
|
} else if (!memcmp(line + 3, "GGA,", 4)) {
|
||||||
if (!readGGA(line + 7, len))
|
if (!readGGA(track, line + 7, len))
|
||||||
return false;
|
return false;
|
||||||
} else if (!memcmp(line + 3, "WPL,", 4)) {
|
} else if (!memcmp(line + 3, "WPL,", 4)) {
|
||||||
if (!readWPL(line + 7, len))
|
if (!readWPL(waypoints, line + 7, len))
|
||||||
return false;
|
return false;
|
||||||
} else if (!memcmp(line + 3, "ZDA,", 4)) {
|
} else if (!memcmp(line + 3, "ZDA,", 4)) {
|
||||||
if (!readZDA(line + 7, len))
|
if (!readZDA(line + 7, len))
|
||||||
@ -518,7 +524,7 @@ bool NMEAParser::loadFile(QFile *file)
|
|||||||
_errorLine++;
|
_errorLine++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_tracks.last().size() && !_waypoints.size()) {
|
if (!tracks.last().size() && !waypoints.size()) {
|
||||||
_errorString = "No usable NMEA sentence found";
|
_errorString = "No usable NMEA sentence found";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,11 @@
|
|||||||
class NMEAParser : public Parser
|
class NMEAParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NMEAParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
NMEAParser() : _errorLine(0), _GGA(false) {}
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
|
|
||||||
{_errorLine = 0; _GGA = false;}
|
|
||||||
~NMEAParser() {}
|
~NMEAParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _errorString;}
|
QString errorString() const {return _errorString;}
|
||||||
int errorLine() const {return _errorLine;}
|
int errorLine() const {return _errorLine;}
|
||||||
|
|
||||||
@ -27,9 +26,9 @@ private:
|
|||||||
bool readAltitude(const char *data, int len, qreal &ele);
|
bool readAltitude(const char *data, int len, qreal &ele);
|
||||||
bool readGeoidHeight(const char *data, int len, qreal &gh);
|
bool readGeoidHeight(const char *data, int len, qreal &gh);
|
||||||
|
|
||||||
bool readRMC(const char *line, int len);
|
bool readRMC(TrackData &track, const char *line, int len);
|
||||||
bool readGGA(const char *line, int len);
|
bool readGGA(TrackData &track, const char *line, int len);
|
||||||
bool readWPL(const char *line, int len);
|
bool readWPL(QList<Waypoint> &waypoints, const char *line, int len);
|
||||||
bool readZDA(const char *line, int len);
|
bool readZDA(const char *line, int len);
|
||||||
|
|
||||||
int _errorLine;
|
int _errorLine;
|
||||||
|
@ -20,42 +20,10 @@
|
|||||||
#include "lambertconic.h"
|
#include "lambertconic.h"
|
||||||
#include "albersequal.h"
|
#include "albersequal.h"
|
||||||
#include "ozf.h"
|
#include "ozf.h"
|
||||||
|
#include "rectc.h"
|
||||||
#include "offlinemap.h"
|
#include "offlinemap.h"
|
||||||
|
|
||||||
|
|
||||||
// Abridged Molodensky transformation
|
|
||||||
static Coordinates toWGS84(Coordinates c, const Datum &datum)
|
|
||||||
{
|
|
||||||
double rlat = deg2rad(c.lat());
|
|
||||||
double rlon = deg2rad(c.lon());
|
|
||||||
|
|
||||||
double slat = sin(rlat);
|
|
||||||
double clat = cos(rlat);
|
|
||||||
double slon = sin(rlon);
|
|
||||||
double clon = cos(rlon);
|
|
||||||
double ssqlat = slat * slat;
|
|
||||||
|
|
||||||
double from_f = datum.ellipsoid().flattening();
|
|
||||||
double df = WGS84_FLATTENING - from_f;
|
|
||||||
double from_a = datum.ellipsoid().radius();
|
|
||||||
double da = WGS84_RADIUS - from_a;
|
|
||||||
double from_esq = datum.ellipsoid().flattening()
|
|
||||||
* (2.0 - datum.ellipsoid().flattening());
|
|
||||||
double adb = 1.0 / (1.0 - from_f);
|
|
||||||
double rn = from_a / sqrt(1 - from_esq * ssqlat);
|
|
||||||
double rm = from_a * (1 - from_esq) / pow((1 - from_esq * ssqlat), 1.5);
|
|
||||||
double from_h = 0.0;
|
|
||||||
|
|
||||||
double dlat = (-datum.dx() * slat * clon - datum.dy() * slat * slon
|
|
||||||
+ datum.dz() * clat + da * rn * from_esq * slat * clat / from_a + df
|
|
||||||
* (rm * adb + rn / adb) * slat * clat) / (rm + from_h);
|
|
||||||
double dlon = (-datum.dx() * slon + datum.dy() * clon) / ((rn + from_h)
|
|
||||||
* clat);
|
|
||||||
|
|
||||||
return Coordinates(c.lon() + rad2deg(dlon), c.lat() + rad2deg(dlat));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
||||||
QString &projection, ProjectionSetup &setup, QString &datum)
|
QString &projection, ProjectionSetup &setup, QString &datum)
|
||||||
{
|
{
|
||||||
@ -135,6 +103,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
|||||||
} else
|
} else
|
||||||
return ln;
|
return ln;
|
||||||
} else if (key == "IWH") {
|
} else if (key == "IWH") {
|
||||||
|
if (list.count() < 4)
|
||||||
|
return ln;
|
||||||
int w = list.at(2).trimmed().toInt(&res);
|
int w = list.at(2).trimmed().toInt(&res);
|
||||||
if (!res)
|
if (!res)
|
||||||
return ln;
|
return ln;
|
||||||
@ -143,6 +113,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
|||||||
return ln;
|
return ln;
|
||||||
_size = QSize(w, h);
|
_size = QSize(w, h);
|
||||||
} else if (key == "Map Projection") {
|
} else if (key == "Map Projection") {
|
||||||
|
if (list.count() < 2)
|
||||||
|
return ln;
|
||||||
projection = list.at(1);
|
projection = list.at(1);
|
||||||
} else if (key == "Projection Setup") {
|
} else if (key == "Projection Setup") {
|
||||||
if (list.count() < 8)
|
if (list.count() < 8)
|
||||||
@ -213,8 +185,8 @@ bool OfflineMap::createProjection(const QString &datum,
|
|||||||
|
|
||||||
if (setup.latitudeOrigin < -90.0 || setup.latitudeOrigin > 90.0
|
if (setup.latitudeOrigin < -90.0 || setup.latitudeOrigin > 90.0
|
||||||
|| setup.longitudeOrigin < -180.0 || setup.longitudeOrigin > 180.0
|
|| setup.longitudeOrigin < -180.0 || setup.longitudeOrigin > 180.0
|
||||||
|| setup.standardParallel1 < -90 || setup.standardParallel1 > 90
|
|| setup.standardParallel1 < -90.0 || setup.standardParallel1 > 90.0
|
||||||
|| setup.standardParallel2 < -90 || setup.standardParallel2 > 90) {
|
|| setup.standardParallel2 < -90.0 || setup.standardParallel2 > 90.0) {
|
||||||
_errorString = "Invalid projection setup";
|
_errorString = "Invalid projection setup";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -263,38 +235,54 @@ bool OfflineMap::createProjection(const QString &datum,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < points.size(); i++) {
|
for (int i = 0; i < points.size(); i++) {
|
||||||
if (points.at(i).ll.isNull()) {
|
if (points.at(i).ll.isNull())
|
||||||
if (d.isWGS84())
|
points[i].ll = d.toWGS84(_projection->xy2ll(points.at(i).pp));
|
||||||
points[i].ll = _projection->xy2ll(points.at(i).pp);
|
else
|
||||||
else
|
points[i].ll = d.toWGS84(points[i].ll);
|
||||||
points[i].ll = toWGS84(_projection->xy2ll(points.at(i).pp), d);
|
|
||||||
} else {
|
|
||||||
if (!d.isWGS84())
|
|
||||||
points[i].ll = toWGS84(points[i].ll, d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
bool OfflineMap::simpleTransformation(const QList<ReferencePoint> &points)
|
||||||
{
|
{
|
||||||
Q_ASSERT(points.size() >= 2);
|
if (points.at(0).xy.x() == points.at(1).xy.x()
|
||||||
|
|| points.at(0).xy.y() == points.at(1).xy.y()) {
|
||||||
|
_errorString = "Invalid reference points tuple";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPointF p0(_projection->ll2xy(points.at(0).ll));
|
||||||
|
QPointF p1(_projection->ll2xy(points.at(1).ll));
|
||||||
|
|
||||||
|
qreal dX, dY, lat0, lon0;
|
||||||
|
dX = (p0.x() - p1.x()) / (points.at(0).xy.x() - points.at(1).xy.x());
|
||||||
|
dY = (p1.y() - p0.y()) / (points.at(1).xy.y() - points.at(0).xy.y());
|
||||||
|
lat0 = p0.y() - points.at(0).xy.y() * dY;
|
||||||
|
lon0 = p1.x() - points.at(1).xy.x() * dX;
|
||||||
|
|
||||||
|
_transform = QTransform(1.0/dX, 0, 0, 1.0/dY, -lon0/dX, -lat0/dY);
|
||||||
|
_inverted = _transform.inverted();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OfflineMap::affineTransformation(const QList<ReferencePoint> &points)
|
||||||
|
{
|
||||||
Matrix c(3, 2);
|
Matrix c(3, 2);
|
||||||
c.zeroize();
|
c.zeroize();
|
||||||
for (size_t j = 0; j < c.w(); j++) {
|
for (size_t i = 0; i < c.h(); i++) {
|
||||||
for (size_t k = 0; k < c.h(); k++) {
|
for (size_t j = 0; j < c.w(); j++) {
|
||||||
for (int i = 0; i < points.size(); i++) {
|
for (int k = 0; k < points.size(); k++) {
|
||||||
double f[3], t[2];
|
double f[3], t[2];
|
||||||
QPointF p = _projection->ll2xy(points.at(i).ll);
|
QPointF p = _projection->ll2xy(points.at(k).ll);
|
||||||
|
|
||||||
f[0] = p.x();
|
f[0] = p.x();
|
||||||
f[1] = p.y();
|
f[1] = p.y();
|
||||||
f[2] = 1.0;
|
f[2] = 1.0;
|
||||||
t[0] = points.at(i).xy.x();
|
t[0] = points.at(k).xy.x();
|
||||||
t[1] = points.at(i).xy.y();
|
t[1] = points.at(k).xy.y();
|
||||||
c.m(k,j) += f[k] * t[j];
|
c.m(i,j) += f[i] * t[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,6 +314,16 @@ bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
||||||
|
{
|
||||||
|
Q_ASSERT(points.size() >= 2);
|
||||||
|
|
||||||
|
if (points.size() == 2)
|
||||||
|
return simpleTransformation(points);
|
||||||
|
else
|
||||||
|
return affineTransformation(points);
|
||||||
|
}
|
||||||
|
|
||||||
bool OfflineMap::computeResolution(QList<ReferencePoint> &points)
|
bool OfflineMap::computeResolution(QList<ReferencePoint> &points)
|
||||||
{
|
{
|
||||||
Q_ASSERT(points.count() >= 2);
|
Q_ASSERT(points.count() >= 2);
|
||||||
@ -376,23 +374,20 @@ bool OfflineMap::getImageInfo(const QString &path)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString suffix = ii.suffix().toLower();
|
if (OZF::isOZF(_imgPath)) {
|
||||||
if (suffix == "ozf4" || suffix == "ozfx4") {
|
if (!_ozf.load(_imgPath)) {
|
||||||
_errorString = QString("%1: OZF4 image files not supported")
|
_errorString = QString("%1: Error loading OZF file")
|
||||||
.arg(QFileInfo(_imgPath).fileName());
|
.arg(QFileInfo(_imgPath).fileName());
|
||||||
return false;
|
return false;
|
||||||
} else if (suffix == "ozf2" || suffix == "ozfx2" || suffix == "ozf3"
|
}
|
||||||
|| suffix == "ozfx3") {
|
|
||||||
_ozf.load(_imgPath);
|
|
||||||
_size = _ozf.size();
|
|
||||||
} else {
|
} else {
|
||||||
QImageReader img(_imgPath);
|
QImageReader img(_imgPath);
|
||||||
_size = img.size();
|
_size = img.size();
|
||||||
}
|
if (!_size.isValid()) {
|
||||||
if (!_size.isValid()) {
|
_errorString = QString("%1: Error reading map image")
|
||||||
_errorString = QString("%1: Error reading map image")
|
.arg(QFileInfo(_imgPath).fileName());
|
||||||
.arg(QFileInfo(_imgPath).fileName());
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -449,7 +444,9 @@ OfflineMap::OfflineMap(const QString &fileName, QObject *parent)
|
|||||||
_valid = false;
|
_valid = false;
|
||||||
_img = 0;
|
_img = 0;
|
||||||
_projection = 0;
|
_projection = 0;
|
||||||
_resolution = 0;
|
_resolution = 0.0;
|
||||||
|
_zoom = 0;
|
||||||
|
_scale = QPointF(1.0, 1.0);
|
||||||
|
|
||||||
if (suffix == "tar") {
|
if (suffix == "tar") {
|
||||||
if (!_tar.load(fileName)) {
|
if (!_tar.load(fileName)) {
|
||||||
@ -515,6 +512,9 @@ OfflineMap::OfflineMap(const QString &fileName, Tar &tar, QObject *parent)
|
|||||||
_valid = false;
|
_valid = false;
|
||||||
_img = 0;
|
_img = 0;
|
||||||
_projection = 0;
|
_projection = 0;
|
||||||
|
_resolution = 0.0;
|
||||||
|
_zoom = 0;
|
||||||
|
_scale = QPointF(1.0, 1.0);
|
||||||
|
|
||||||
QFileInfo map(fi.absolutePath());
|
QFileInfo map(fi.absolutePath());
|
||||||
QFileInfo layer(map.absolutePath());
|
QFileInfo layer(map.absolutePath());
|
||||||
@ -590,7 +590,7 @@ void OfflineMap::drawTiled(QPainter *painter, const QRectF &rect)
|
|||||||
int x = tl.x() + i * _tileSize.width();
|
int x = tl.x() + i * _tileSize.width();
|
||||||
int y = tl.y() + j * _tileSize.height();
|
int y = tl.y() + j * _tileSize.height();
|
||||||
|
|
||||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
if (!QRectF(QPointF(x, y), _tileSize).intersects(bounds())) {
|
||||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -633,22 +633,24 @@ void OfflineMap::drawOZF(QPainter *painter, const QRectF &rect)
|
|||||||
int y = tl.y() + j * _ozf.tileSize().height();
|
int y = tl.y() + j * _ozf.tileSize().height();
|
||||||
|
|
||||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
||||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
painter->fillRect(QRectF(QPoint(x, y), _ozf.tileSize()),
|
||||||
|
Qt::white);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
QString key = _ozf.fileName() + "/" + QString::number(x)
|
QString key = _ozf.fileName() + "/" + QString::number(_zoom) + "_"
|
||||||
+ "_" + QString::number(y);
|
+ QString::number(x) + "_" + QString::number(y);
|
||||||
if (!QPixmapCache::find(key, &pixmap)) {
|
if (!QPixmapCache::find(key, &pixmap)) {
|
||||||
pixmap = _ozf.tile(x, y);
|
pixmap = _ozf.tile(_zoom, x, y);
|
||||||
if (!pixmap.isNull())
|
if (!pixmap.isNull())
|
||||||
QPixmapCache::insert(key, pixmap);
|
QPixmapCache::insert(key, pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pixmap.isNull()) {
|
if (pixmap.isNull()) {
|
||||||
qWarning("%s: error loading tile image", qPrintable(key));
|
qWarning("%s: error loading tile image", qPrintable(key));
|
||||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
painter->fillRect(QRectF(QPoint(x, y), _ozf.tileSize()),
|
||||||
|
Qt::white);
|
||||||
} else
|
} else
|
||||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||||
}
|
}
|
||||||
@ -660,9 +662,9 @@ void OfflineMap::drawImage(QPainter *painter, const QRectF &rect)
|
|||||||
if (!_img || _img->isNull())
|
if (!_img || _img->isNull())
|
||||||
painter->fillRect(rect, Qt::white);
|
painter->fillRect(rect, Qt::white);
|
||||||
else {
|
else {
|
||||||
QPoint p = rect.topLeft().toPoint();
|
QRect r(rect.toRect());
|
||||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
painter->drawImage(r.left(), r.top(), *_img, r.left(), r.top(),
|
||||||
painter->drawImage(rect.topLeft(), crop);
|
r.width(), r.height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,3 +677,101 @@ void OfflineMap::draw(QPainter *painter, const QRectF &rect)
|
|||||||
else
|
else
|
||||||
drawImage(painter, rect);
|
drawImage(painter, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPointF OfflineMap::ll2xy(const Coordinates &c)
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen()) {
|
||||||
|
QPointF p(_transform.map(_projection->ll2xy(c)));
|
||||||
|
return QPointF(p.x() * _scale.x(), p.y() * _scale.y());
|
||||||
|
} else
|
||||||
|
return _transform.map(_projection->ll2xy(c));
|
||||||
|
}
|
||||||
|
|
||||||
|
Coordinates OfflineMap::xy2ll(const QPointF &p)
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen()) {
|
||||||
|
return _projection->xy2ll(_inverted.map(QPointF(p.x() / _scale.x(),
|
||||||
|
p.y() / _scale.y())));
|
||||||
|
} else
|
||||||
|
return _projection->xy2ll(_inverted.map(p));
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF OfflineMap::bounds() const
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen())
|
||||||
|
return QRectF(QPointF(0, 0), _ozf.size(_zoom));
|
||||||
|
else
|
||||||
|
return QRectF(QPointF(0, 0), _size);
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OfflineMap::resolution(const QPointF &p) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(p);
|
||||||
|
|
||||||
|
if (_ozf.isOpen())
|
||||||
|
return _resolution / ((_scale.x() + _scale.y()) / 2.0);
|
||||||
|
else
|
||||||
|
return _resolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OfflineMap::zoomFit(const QSize &size, const RectC &br)
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen()) {
|
||||||
|
if (!br.isValid())
|
||||||
|
rescale(0);
|
||||||
|
else {
|
||||||
|
QRect sbr(QRectF(_transform.map(_projection->ll2xy(br.topLeft())),
|
||||||
|
_transform.map(_projection->ll2xy(br.bottomRight())))
|
||||||
|
.toRect().normalized());
|
||||||
|
|
||||||
|
for (int i = 0; i < _ozf.zooms(); i++) {
|
||||||
|
rescale(i);
|
||||||
|
if (sbr.size().width() * _scale.x() <= size.width()
|
||||||
|
&& sbr.size().height() * _scale.y() <= size.height())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OfflineMap::zoomFit(qreal resolution, const Coordinates &c)
|
||||||
|
{
|
||||||
|
Q_UNUSED(c);
|
||||||
|
|
||||||
|
if (_ozf.isOpen()) {
|
||||||
|
for (int i = 0; i < _ozf.zooms(); i++) {
|
||||||
|
rescale(i);
|
||||||
|
qreal sr = _resolution / ((_scale.x() + _scale.y()) / 2.0);
|
||||||
|
if (sr >= resolution)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OfflineMap::zoomIn()
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen())
|
||||||
|
rescale(qMax(_zoom - 1, 0));
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OfflineMap::zoomOut()
|
||||||
|
{
|
||||||
|
if (_ozf.isOpen())
|
||||||
|
rescale(qMin(_zoom + 1, _ozf.zooms() - 1));
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OfflineMap::rescale(int zoom)
|
||||||
|
{
|
||||||
|
_zoom = zoom;
|
||||||
|
_scale = QPointF(
|
||||||
|
(qreal)_ozf.size(_zoom).width() / (qreal)_ozf.size(0).width(),
|
||||||
|
(qreal)_ozf.size(_zoom).height() / (qreal)_ozf.size(0).height());
|
||||||
|
}
|
||||||
|
@ -23,18 +23,17 @@ public:
|
|||||||
|
|
||||||
const QString &name() const {return _name;}
|
const QString &name() const {return _name;}
|
||||||
|
|
||||||
QRectF bounds() const {return QRectF(QPointF(0, 0), _size);}
|
QRectF bounds() const;
|
||||||
qreal resolution(const QPointF &) const {return _resolution;}
|
qreal resolution(const QPointF &p) const;
|
||||||
|
|
||||||
qreal zoom() const {return 1.0;}
|
qreal zoom() const {return _zoom;}
|
||||||
qreal zoomFit(const QSize &, const QRectF &) {return 1.0;}
|
qreal zoomFit(const QSize &size, const RectC &br);
|
||||||
qreal zoomIn() {return 1.0;}
|
qreal zoomFit(qreal resolution, const Coordinates &c);
|
||||||
qreal zoomOut() {return 1.0;}
|
qreal zoomIn();
|
||||||
|
qreal zoomOut();
|
||||||
|
|
||||||
QPointF ll2xy(const Coordinates &c)
|
QPointF ll2xy(const Coordinates &c);
|
||||||
{return _transform.map(_projection->ll2xy(c));}
|
Coordinates xy2ll(const QPointF &p);
|
||||||
Coordinates xy2ll(const QPointF &p)
|
|
||||||
{return _projection->xy2ll(_inverted.map(p));}
|
|
||||||
|
|
||||||
void draw(QPainter *painter, const QRectF &rect);
|
void draw(QPainter *painter, const QRectF &rect);
|
||||||
|
|
||||||
@ -52,13 +51,13 @@ public:
|
|||||||
{return _transform.map(p);}
|
{return _transform.map(p);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef struct {
|
struct ReferencePoint {
|
||||||
QPoint xy;
|
QPoint xy;
|
||||||
Coordinates ll;
|
Coordinates ll;
|
||||||
QPointF pp;
|
QPointF pp;
|
||||||
} ReferencePoint;
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct ProjectionSetup {
|
||||||
double latitudeOrigin;
|
double latitudeOrigin;
|
||||||
double longitudeOrigin;
|
double longitudeOrigin;
|
||||||
double scale;
|
double scale;
|
||||||
@ -67,7 +66,7 @@ private:
|
|||||||
double standardParallel1;
|
double standardParallel1;
|
||||||
double standardParallel2;
|
double standardParallel2;
|
||||||
int zone;
|
int zone;
|
||||||
} ProjectionSetup;
|
};
|
||||||
|
|
||||||
int parse(QIODevice &device, QList<ReferencePoint> &points,
|
int parse(QIODevice &device, QList<ReferencePoint> &points,
|
||||||
QString &projection, ProjectionSetup &setup, QString &datum);
|
QString &projection, ProjectionSetup &setup, QString &datum);
|
||||||
@ -76,6 +75,8 @@ private:
|
|||||||
bool totalSizeSet();
|
bool totalSizeSet();
|
||||||
bool createProjection(const QString &datum, const QString &projection,
|
bool createProjection(const QString &datum, const QString &projection,
|
||||||
const ProjectionSetup &setup, QList<ReferencePoint> &points);
|
const ProjectionSetup &setup, QList<ReferencePoint> &points);
|
||||||
|
bool simpleTransformation(const QList<ReferencePoint> &points);
|
||||||
|
bool affineTransformation(const QList<ReferencePoint> &points);
|
||||||
bool computeTransformation(const QList<ReferencePoint> &points);
|
bool computeTransformation(const QList<ReferencePoint> &points);
|
||||||
bool computeResolution(QList<ReferencePoint> &points);
|
bool computeResolution(QList<ReferencePoint> &points);
|
||||||
bool getTileInfo(const QStringList &tiles, const QString &path = QString());
|
bool getTileInfo(const QStringList &tiles, const QString &path = QString());
|
||||||
@ -85,6 +86,8 @@ private:
|
|||||||
void drawOZF(QPainter *painter, const QRectF &rect);
|
void drawOZF(QPainter *painter, const QRectF &rect);
|
||||||
void drawImage(QPainter *painter, const QRectF &rect);
|
void drawImage(QPainter *painter, const QRectF &rect);
|
||||||
|
|
||||||
|
void rescale(int zoom);
|
||||||
|
|
||||||
QString _name;
|
QString _name;
|
||||||
bool _valid;
|
bool _valid;
|
||||||
QString _errorString;
|
QString _errorString;
|
||||||
@ -101,6 +104,9 @@ private:
|
|||||||
QString _imgPath;
|
QString _imgPath;
|
||||||
QSize _tileSize;
|
QSize _tileSize;
|
||||||
QString _tileName;
|
QString _tileName;
|
||||||
|
|
||||||
|
int _zoom;
|
||||||
|
QPointF _scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OFFLINEMAP_H
|
#endif // OFFLINEMAP_H
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include "rectc.h"
|
||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "rd.h"
|
#include "rd.h"
|
||||||
@ -25,16 +26,14 @@ static QPoint mercator2tile(const QPointF &m, int z)
|
|||||||
return tile;
|
return tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static qreal zoom2scale(int zoom)
|
||||||
|
{
|
||||||
|
return (360.0/(qreal)((1<<zoom) * TILE_SIZE));
|
||||||
|
}
|
||||||
|
|
||||||
static int scale2zoom(qreal scale)
|
static int scale2zoom(qreal scale)
|
||||||
{
|
{
|
||||||
int zoom = (int)log2(360.0/(scale * (qreal)TILE_SIZE));
|
return (int)log2(360.0/(scale * (qreal)TILE_SIZE));
|
||||||
|
|
||||||
if (zoom < ZOOM_MIN)
|
|
||||||
return ZOOM_MIN;
|
|
||||||
if (zoom > ZOOM_MAX)
|
|
||||||
return ZOOM_MAX;
|
|
||||||
|
|
||||||
return zoom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ OnlineMap::OnlineMap(const QString &name, const QString &url, QObject *parent)
|
|||||||
_name = name;
|
_name = name;
|
||||||
_url = url;
|
_url = url;
|
||||||
_block = false;
|
_block = false;
|
||||||
_scale = ((360.0/(qreal)(1<<ZOOM_MAX))/(qreal)TILE_SIZE);
|
_zoom = ZOOM_MAX;
|
||||||
|
|
||||||
connect(downloader, SIGNAL(finished()), this, SLOT(emitLoaded()));
|
connect(downloader, SIGNAL(finished()), this, SLOT(emitLoaded()));
|
||||||
|
|
||||||
@ -163,53 +162,68 @@ void OnlineMap::clearCache()
|
|||||||
|
|
||||||
QRectF OnlineMap::bounds() const
|
QRectF OnlineMap::bounds() const
|
||||||
{
|
{
|
||||||
return scaled(QRectF(QPointF(-180, -180), QSizeF(360, 360)), 1.0/_scale);
|
return scaled(QRectF(QPointF(-180, -180), QSizeF(360, 360)),
|
||||||
|
1.0/zoom2scale(_zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal OnlineMap::zoomFit(const QSize &size, const QRectF &br)
|
qreal OnlineMap::zoomFit(const QSize &size, const RectC &br)
|
||||||
{
|
{
|
||||||
if (br.isNull())
|
if (!br.isValid())
|
||||||
_scale = ((360.0/(qreal)(1<<ZOOM_MAX))/(qreal)TILE_SIZE);
|
_zoom = ZOOM_MAX;
|
||||||
else {
|
else {
|
||||||
Coordinates topLeft(br.topLeft());
|
QRectF tbr(Mercator().ll2xy(br.topLeft()),
|
||||||
Coordinates bottomRight(br.bottomRight());
|
Mercator().ll2xy(br.bottomRight()));
|
||||||
QRectF tbr(Mercator().ll2xy(topLeft), Mercator().ll2xy(bottomRight));
|
|
||||||
|
|
||||||
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
|
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
|
||||||
|
|
||||||
_scale = ((360.0/(qreal)(1<<scale2zoom(qMax(sc.x(), sc.y()))))
|
_zoom = scale2zoom(qMax(sc.x(), sc.y()));
|
||||||
/ (qreal)TILE_SIZE);
|
if (_zoom < ZOOM_MIN)
|
||||||
|
_zoom = ZOOM_MIN;
|
||||||
|
if (_zoom > ZOOM_MAX)
|
||||||
|
_zoom = ZOOM_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _scale;
|
return _zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal OnlineMap::zoomFit(qreal resolution, const Coordinates &c)
|
||||||
|
{
|
||||||
|
_zoom = (int)(log2((WGS84_RADIUS * 2 * M_PI * cos(deg2rad(c.lat())))
|
||||||
|
/ resolution) - log2(TILE_SIZE));
|
||||||
|
|
||||||
|
if (_zoom < ZOOM_MIN)
|
||||||
|
_zoom = ZOOM_MIN;
|
||||||
|
if (_zoom > ZOOM_MAX)
|
||||||
|
_zoom = ZOOM_MAX;
|
||||||
|
|
||||||
|
return _zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal OnlineMap::resolution(const QPointF &p) const
|
qreal OnlineMap::resolution(const QPointF &p) const
|
||||||
{
|
{
|
||||||
return (WGS84_RADIUS * 2 * M_PI * _scale / 360.0
|
qreal scale = zoom2scale(_zoom);
|
||||||
* cos(2.0 * atan(exp(deg2rad(-p.y() * _scale))) - M_PI/2));
|
|
||||||
|
return (WGS84_RADIUS * 2 * M_PI * scale / 360.0
|
||||||
|
* cos(2.0 * atan(exp(deg2rad(-p.y() * scale))) - M_PI/2));
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal OnlineMap::zoomIn()
|
qreal OnlineMap::zoomIn()
|
||||||
{
|
{
|
||||||
int zoom = qMin(scale2zoom(_scale) + 1, ZOOM_MAX);
|
_zoom = qMin(_zoom + 1, ZOOM_MAX);
|
||||||
_scale = ((360.0/(qreal)(1<<zoom))/(qreal)TILE_SIZE);
|
return _zoom;
|
||||||
return _scale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal OnlineMap::zoomOut()
|
qreal OnlineMap::zoomOut()
|
||||||
{
|
{
|
||||||
int zoom = qMax(scale2zoom(_scale) - 1, ZOOM_MIN);
|
_zoom = qMax(_zoom - 1, ZOOM_MIN);
|
||||||
_scale = ((360.0/(qreal)(1<<zoom))/(qreal)TILE_SIZE);
|
return _zoom;
|
||||||
return _scale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnlineMap::draw(QPainter *painter, const QRectF &rect)
|
void OnlineMap::draw(QPainter *painter, const QRectF &rect)
|
||||||
{
|
{
|
||||||
int zoom = scale2zoom(_scale);
|
qreal scale = zoom2scale(_zoom);
|
||||||
|
|
||||||
QPoint tile = mercator2tile(QPointF(rect.topLeft().x() * _scale,
|
QPoint tile = mercator2tile(QPointF(rect.topLeft().x() * scale,
|
||||||
-rect.topLeft().y() * _scale), zoom);
|
-rect.topLeft().y() * scale), _zoom);
|
||||||
QPoint tl = QPoint((int)floor(rect.left() / (qreal)TILE_SIZE)
|
QPoint tl = QPoint((int)floor(rect.left() / (qreal)TILE_SIZE)
|
||||||
* TILE_SIZE, (int)floor(rect.top() / TILE_SIZE) * TILE_SIZE);
|
* TILE_SIZE, (int)floor(rect.top() / TILE_SIZE) * TILE_SIZE);
|
||||||
|
|
||||||
@ -217,7 +231,7 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect)
|
|||||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||||
for (int i = 0; i < ceil(s.width() / TILE_SIZE); i++)
|
for (int i = 0; i < ceil(s.width() / TILE_SIZE); i++)
|
||||||
for (int j = 0; j < ceil(s.height() / TILE_SIZE); j++)
|
for (int j = 0; j < ceil(s.height() / TILE_SIZE); j++)
|
||||||
tiles.append(Tile(QPoint(tile.x() + i, tile.y() + j), zoom));
|
tiles.append(Tile(QPoint(tile.x() + i, tile.y() + j), _zoom));
|
||||||
|
|
||||||
if (_block)
|
if (_block)
|
||||||
loadTilesSync(tiles);
|
loadTilesSync(tiles);
|
||||||
@ -234,12 +248,14 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect)
|
|||||||
|
|
||||||
QPointF OnlineMap::ll2xy(const Coordinates &c)
|
QPointF OnlineMap::ll2xy(const Coordinates &c)
|
||||||
{
|
{
|
||||||
|
qreal scale = zoom2scale(_zoom);
|
||||||
QPointF m = Mercator().ll2xy(c);
|
QPointF m = Mercator().ll2xy(c);
|
||||||
return QPointF(m.x() / _scale, m.y() / -_scale);
|
return QPointF(m.x() / scale, m.y() / -scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
Coordinates OnlineMap::xy2ll(const QPointF &p)
|
Coordinates OnlineMap::xy2ll(const QPointF &p)
|
||||||
{
|
{
|
||||||
QPointF m(p.x() * _scale, -p.y() * _scale);
|
qreal scale = zoom2scale(_zoom);
|
||||||
|
QPointF m(p.x() * scale, -p.y() * scale);
|
||||||
return Mercator().xy2ll(m);
|
return Mercator().xy2ll(m);
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,9 @@ public:
|
|||||||
QRectF bounds() const;
|
QRectF bounds() const;
|
||||||
qreal resolution(const QPointF &p) const;
|
qreal resolution(const QPointF &p) const;
|
||||||
|
|
||||||
qreal zoom() const {return _scale;}
|
qreal zoom() const {return _zoom;}
|
||||||
qreal zoomFit(const QSize &size, const QRectF &br);
|
qreal zoomFit(const QSize &size, const RectC &br);
|
||||||
|
qreal zoomFit(qreal resolution, const Coordinates &c);
|
||||||
qreal zoomIn();
|
qreal zoomIn();
|
||||||
qreal zoomOut();
|
qreal zoomOut();
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ private:
|
|||||||
void loadTilesAsync(QList<Tile> &list);
|
void loadTilesAsync(QList<Tile> &list);
|
||||||
void loadTilesSync(QList<Tile> &list);
|
void loadTilesSync(QList<Tile> &list);
|
||||||
|
|
||||||
qreal _scale;
|
int _zoom;
|
||||||
QString _name;
|
QString _name;
|
||||||
QString _url;
|
QString _url;
|
||||||
bool _block;
|
bool _block;
|
||||||
|
172
src/ozf.cpp
172
src/ozf.cpp
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#define OZF2_MAGIC 0x7778
|
#define OZF2_MAGIC 0x7778
|
||||||
#define OZF3_MAGIC 0x7780
|
#define OZF3_MAGIC 0x7780
|
||||||
#define SEPARATOR 0x77777777
|
|
||||||
|
|
||||||
static const quint8 XKEY[] =
|
static const quint8 XKEY[] =
|
||||||
{
|
{
|
||||||
@ -39,21 +38,22 @@ template<class T> bool OZF::readValue(T &val)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OZF::read(void *data, size_t size)
|
bool OZF::read(void *data, size_t size, size_t decryptSize)
|
||||||
{
|
{
|
||||||
if (_file.read((char*)data, size) < (qint64)size)
|
if (_file.read((char*)data, size) < (qint64)size)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_decrypt)
|
if (_decrypt)
|
||||||
decrypt(data, size, _key);
|
decrypt(data, decryptSize ? qMin(decryptSize, size) : size, _key);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OZF::readKey()
|
bool OZF::initOZF3()
|
||||||
{
|
{
|
||||||
quint8 randomNumber, initial;
|
quint8 randomNumber, initial;
|
||||||
quint32 keyblock;
|
quint32 keyblock;
|
||||||
|
quint8 h1[8];
|
||||||
|
|
||||||
|
|
||||||
if (!_file.seek(14))
|
if (!_file.seek(14))
|
||||||
@ -66,7 +66,15 @@ bool OZF::readKey()
|
|||||||
if (!readValue(initial))
|
if (!readValue(initial))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_decrypt = true; _key = initial;
|
_decrypt = true;
|
||||||
|
_key = initial;
|
||||||
|
|
||||||
|
if (!_file.seek(0))
|
||||||
|
return false;
|
||||||
|
if (!read(h1, sizeof(h1)))
|
||||||
|
return false;
|
||||||
|
_tileSize = *(h1 + 6);
|
||||||
|
|
||||||
if (!_file.seek(15 + randomNumber))
|
if (!_file.seek(15 + randomNumber))
|
||||||
return false;
|
return false;
|
||||||
if (!readValue(keyblock))
|
if (!readValue(keyblock))
|
||||||
@ -104,21 +112,28 @@ bool OZF::readKey()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OZF::initOZF2()
|
||||||
|
{
|
||||||
|
if (!_file.seek(6))
|
||||||
|
return false;
|
||||||
|
if (!readValue(_tileSize))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool OZF::readHeaders()
|
bool OZF::readHeaders()
|
||||||
{
|
{
|
||||||
quint16 magic;
|
quint16 magic;
|
||||||
quint32 separator;
|
|
||||||
|
|
||||||
if (!readValue(magic))
|
if (!readValue(magic))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (magic == OZF2_MAGIC) {
|
if (magic == OZF2_MAGIC) {
|
||||||
if (!_file.seek(_file.pos() + 52))
|
if (!initOZF2())
|
||||||
return false;
|
|
||||||
if (!readValue(separator) || separator != SEPARATOR)
|
|
||||||
return false;
|
return false;
|
||||||
} else if (magic == OZF3_MAGIC) {
|
} else if (magic == OZF3_MAGIC) {
|
||||||
if (!readKey())
|
if (!initOZF3())
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
@ -128,52 +143,58 @@ bool OZF::readHeaders()
|
|||||||
|
|
||||||
bool OZF::readTileTable()
|
bool OZF::readTileTable()
|
||||||
{
|
{
|
||||||
quint32 offset, bgr0, w, h;
|
quint32 tableOffset, headerOffset, bgr0, w, h;
|
||||||
quint16 x, y;
|
quint16 x, y;
|
||||||
|
int zooms;
|
||||||
|
|
||||||
|
|
||||||
if (!_file.seek(_file.size() - 4))
|
if (!_file.seek(_file.size() - sizeof(tableOffset)))
|
||||||
return false;
|
return false;
|
||||||
// table offset
|
if (!readValue(tableOffset))
|
||||||
if (!readValue(offset))
|
|
||||||
return false;
|
|
||||||
if (!_file.seek(offset))
|
|
||||||
return false;
|
|
||||||
// tiles offset (zoom level 0)
|
|
||||||
if (!readValue(offset))
|
|
||||||
return false;
|
|
||||||
if (!_file.seek(offset))
|
|
||||||
return false;
|
return false;
|
||||||
|
zooms = (_file.size() - tableOffset - sizeof(quint32)) / sizeof(quint32);
|
||||||
|
|
||||||
if (!readValue(w))
|
for (int i = 0; i < zooms - 2; i++) {
|
||||||
return false;
|
if (!_file.seek(tableOffset + i * sizeof(quint32)))
|
||||||
if (!readValue(h))
|
|
||||||
return false;
|
|
||||||
if (!readValue(x))
|
|
||||||
return false;
|
|
||||||
if (!readValue(y))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
_size = QSize(w, h);
|
|
||||||
_dim = QSize(x, y);
|
|
||||||
|
|
||||||
_palette = QVector<quint32>(256);
|
|
||||||
if (!read(&(_palette[0]), sizeof(quint32) * 256))
|
|
||||||
return false;
|
|
||||||
for (int i = 0; i < _palette.size(); i++) {
|
|
||||||
bgr0 = qFromLittleEndian(_palette.at(i));
|
|
||||||
|
|
||||||
quint32 b = (bgr0 & 0x000000FF);
|
|
||||||
quint32 g = (bgr0 & 0x0000FF00) >> 8;
|
|
||||||
quint32 r = (bgr0 & 0x00FF0000) >> 16;
|
|
||||||
|
|
||||||
_palette[i] = 0xFF000000 | r << 16 | g << 8 | b;
|
|
||||||
}
|
|
||||||
|
|
||||||
_tiles = QVector<quint32>(_dim.width() * _dim.height() + 1);
|
|
||||||
for (int i = 0; i < _tiles.size(); i++)
|
|
||||||
if (!readValue(_tiles[i]))
|
|
||||||
return false;
|
return false;
|
||||||
|
if (!readValue(headerOffset))
|
||||||
|
return false;
|
||||||
|
if (!_file.seek(headerOffset))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!readValue(w))
|
||||||
|
return false;
|
||||||
|
if (!readValue(h))
|
||||||
|
return false;
|
||||||
|
if (!readValue(x))
|
||||||
|
return false;
|
||||||
|
if (!readValue(y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Zoom zoom;
|
||||||
|
zoom.size = QSize(w, h);
|
||||||
|
zoom.dim = QSize(x, y);
|
||||||
|
|
||||||
|
zoom.palette = QVector<quint32>(256);
|
||||||
|
if (!read(&(zoom.palette[0]), sizeof(quint32) * 256))
|
||||||
|
return false;
|
||||||
|
for (int i = 0; i < zoom.palette.size(); i++) {
|
||||||
|
bgr0 = qFromLittleEndian(zoom.palette.at(i));
|
||||||
|
|
||||||
|
quint32 b = (bgr0 & 0x000000FF);
|
||||||
|
quint32 g = (bgr0 & 0x0000FF00) >> 8;
|
||||||
|
quint32 r = (bgr0 & 0x00FF0000) >> 16;
|
||||||
|
|
||||||
|
zoom.palette[i] = 0xFF000000 | r << 16 | g << 8 | b;
|
||||||
|
}
|
||||||
|
|
||||||
|
zoom.tiles = QVector<quint32>(zoom.dim.width() * zoom.dim.height() + 1);
|
||||||
|
for (int i = 0; i < zoom.tiles.size(); i++)
|
||||||
|
if (!readValue(zoom.tiles[i]))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
_zooms.append(zoom);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -196,39 +217,66 @@ bool OZF::load(const QString &path)
|
|||||||
if (!readTileTable()) {
|
if (!readTileTable()) {
|
||||||
qWarning("%s: file format error", qPrintable(_file.fileName()));
|
qWarning("%s: file format error", qPrintable(_file.fileName()));
|
||||||
_file.close();
|
_file.close();
|
||||||
_size = QSize();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap OZF::tile(int x, int y)
|
QPixmap OZF::tile(int zoom, int x, int y)
|
||||||
{
|
{
|
||||||
Q_ASSERT(_file.isOpen());
|
Q_ASSERT(_file.isOpen());
|
||||||
|
Q_ASSERT(0 <= zoom && zoom < _zooms.count());
|
||||||
|
|
||||||
int i = (y/tileSize().height()) * _dim.width() + (x/tileSize().width());
|
const Zoom &z = _zooms.at(zoom);
|
||||||
if (i >= _tiles.size() - 1 || i < 0)
|
|
||||||
|
int i = (y/tileSize().height()) * z.dim.width() + (x/tileSize().width());
|
||||||
|
if (i >= z.tiles.size() - 1 || i < 0)
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
int size = _tiles.at(i+1) - _tiles.at(i);
|
int size = z.tiles.at(i+1) - z.tiles.at(i);
|
||||||
if (!_file.seek(_tiles.at(i)))
|
if (!_file.seek(z.tiles.at(i)))
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
QByteArray ba = _file.read(size);
|
|
||||||
if (ba.size() != size)
|
|
||||||
return QPixmap();
|
|
||||||
if (_decrypt)
|
|
||||||
decrypt(ba.data(), qMin(16, ba.size()), _key);
|
|
||||||
quint32 bes = qToBigEndian(tileSize().width() * tileSize().height());
|
quint32 bes = qToBigEndian(tileSize().width() * tileSize().height());
|
||||||
ba.prepend(QByteArray((char*)&bes, sizeof(bes)));
|
QByteArray ba;
|
||||||
|
ba.resize(sizeof(bes) + size);
|
||||||
|
*(ba.data()) = bes;
|
||||||
|
|
||||||
|
if (!read(ba.data() + sizeof(bes), size, 16))
|
||||||
|
return QPixmap();
|
||||||
QByteArray uba = qUncompress(ba);
|
QByteArray uba = qUncompress(ba);
|
||||||
if (uba.size() != tileSize().width() * tileSize().height())
|
if (uba.size() != tileSize().width() * tileSize().height())
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
QImage img((const uchar*)uba.constData(), tileSize().width(),
|
QImage img((const uchar*)uba.constData(), tileSize().width(),
|
||||||
tileSize().height(), QImage::Format_Indexed8);
|
tileSize().height(), QImage::Format_Indexed8);
|
||||||
img.setColorTable(_palette);
|
img.setColorTable(z.palette);
|
||||||
|
|
||||||
return QPixmap::fromImage(img.mirrored());
|
return QPixmap::fromImage(img.mirrored());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize OZF::size(int zoom) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(_file.isOpen());
|
||||||
|
Q_ASSERT(0 <= zoom && zoom < _zooms.count());
|
||||||
|
|
||||||
|
return _zooms.at(zoom).size;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OZF::isOZF(const QString &path)
|
||||||
|
{
|
||||||
|
QFile file(path);
|
||||||
|
quint16 magic;
|
||||||
|
|
||||||
|
if (!file.open(QIODevice::ReadOnly))
|
||||||
|
return false;
|
||||||
|
if (file.read((char*)&magic, sizeof(magic)) < (qint64)sizeof(magic))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
magic = qFromLittleEndian(magic);
|
||||||
|
if (magic == OZF2_MAGIC || magic == OZF3_MAGIC)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
32
src/ozf.h
32
src/ozf.h
@ -4,6 +4,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
#include <QList>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@ -11,32 +12,39 @@
|
|||||||
class OZF
|
class OZF
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OZF() : _decrypt(false), _key(0) {}
|
OZF() : _tileSize(0), _decrypt(false), _key(0) {}
|
||||||
|
|
||||||
bool load(const QString &path);
|
bool load(const QString &path);
|
||||||
|
|
||||||
QString fileName() const {return _file.fileName();}
|
QString fileName() const {return _file.fileName();}
|
||||||
bool isOpen() const {return _file.isOpen();}
|
bool isOpen() const {return _file.isOpen();}
|
||||||
|
|
||||||
QSize size() const {return _size;}
|
int zooms() const {return _zooms.size();}
|
||||||
QSize tileSize() const {return QSize(64, 64);}
|
QSize size(int zoom) const;
|
||||||
QPixmap tile(int x, int y);
|
QSize tileSize() const {return QSize(_tileSize, _tileSize);}
|
||||||
|
QPixmap tile(int zoom, int x, int y);
|
||||||
|
|
||||||
|
static bool isOZF(const QString &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct Zoom {
|
||||||
|
QSize size;
|
||||||
|
QSize dim;
|
||||||
|
QVector<QRgb> palette;
|
||||||
|
QVector<quint32> tiles;
|
||||||
|
};
|
||||||
|
|
||||||
template<class T> bool readValue(T &val);
|
template<class T> bool readValue(T &val);
|
||||||
bool read(void *data, size_t size);
|
bool read(void *data, size_t size, size_t decryptSize = 0);
|
||||||
bool readKey();
|
bool initOZF3();
|
||||||
|
bool initOZF2();
|
||||||
bool readHeaders();
|
bool readHeaders();
|
||||||
bool readTileTable();
|
bool readTileTable();
|
||||||
|
|
||||||
|
quint16 _tileSize;
|
||||||
bool _decrypt;
|
bool _decrypt;
|
||||||
quint8 _key;
|
quint8 _key;
|
||||||
|
QList<Zoom> _zooms;
|
||||||
QSize _size;
|
|
||||||
QSize _dim;
|
|
||||||
QVector<QRgb> _palette;
|
|
||||||
QVector<quint32> _tiles;
|
|
||||||
|
|
||||||
QFile _file;
|
QFile _file;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,6 +41,5 @@ QDebug operator<<(QDebug dbg, const Palette &palette)
|
|||||||
{
|
{
|
||||||
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
|
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
|
||||||
<< ")";
|
<< ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
||||||
|
11
src/parser.h
11
src/parser.h
@ -12,19 +12,12 @@
|
|||||||
class Parser
|
class Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Parser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
|
||||||
QList<Waypoint> &waypoints) : _tracks(tracks), _routes(routes),
|
|
||||||
_waypoints(waypoints) {}
|
|
||||||
virtual ~Parser() {}
|
virtual ~Parser() {}
|
||||||
|
|
||||||
virtual bool loadFile(QFile *file) = 0;
|
virtual bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints) = 0;
|
||||||
virtual QString errorString() const = 0;
|
virtual QString errorString() const = 0;
|
||||||
virtual int errorLine() const = 0;
|
virtual int errorLine() const = 0;
|
||||||
|
|
||||||
protected:
|
|
||||||
QList<TrackData> &_tracks;
|
|
||||||
QList<RouteData> &_routes;
|
|
||||||
QList<Waypoint> &_waypoints;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PARSER_H
|
#endif // PARSER_H
|
||||||
|
27
src/path.cpp
27
src/path.cpp
@ -1,33 +1,20 @@
|
|||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
|
||||||
QRectF Path::boundingRect() const
|
RectC Path::boundingRect() const
|
||||||
{
|
{
|
||||||
if (size() < 2)
|
if (size() < 2)
|
||||||
return QRectF();
|
return RectC();
|
||||||
|
|
||||||
QPointF topLeft(at(0).coordinates().lon(), at(0).coordinates().lat());
|
RectC ret(first().coordinates(), first().coordinates());
|
||||||
QPointF bottomRight(topLeft);
|
for (int i = 1; i < size(); i++)
|
||||||
|
ret.unite(at(i).coordinates());
|
||||||
|
|
||||||
for (int i = 1; i < size(); i++) {
|
return ret;
|
||||||
qreal x = at(i).coordinates().lon();
|
|
||||||
qreal y = at(i).coordinates().lat();
|
|
||||||
|
|
||||||
if (x < topLeft.x())
|
|
||||||
topLeft.setX(x);
|
|
||||||
if (y < topLeft.y())
|
|
||||||
topLeft.setY(y);
|
|
||||||
if (x > bottomRight.x())
|
|
||||||
bottomRight.setX(x);
|
|
||||||
if (y > bottomRight.y())
|
|
||||||
bottomRight.setY(y);
|
|
||||||
}
|
|
||||||
return QRectF(topLeft, bottomRight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug operator<<(QDebug dbg, const PathPoint &point)
|
QDebug operator<<(QDebug dbg, const PathPoint &point)
|
||||||
{
|
{
|
||||||
dbg.nospace() << "PathPoint(" << point.distance() << ", "
|
dbg.nospace() << "PathPoint(" << point.distance() << ", "
|
||||||
<< point.coordinates() << ")";
|
<< point.coordinates() << ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include "coordinates.h"
|
#include "coordinates.h"
|
||||||
|
#include "rectc.h"
|
||||||
|
|
||||||
class PathPoint
|
class PathPoint
|
||||||
{
|
{
|
||||||
@ -28,7 +29,7 @@ QDebug operator<<(QDebug dbg, const PathPoint &point);
|
|||||||
class Path : public QVector<PathPoint>
|
class Path : public QVector<PathPoint>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QRectF boundingRect() const;
|
RectC boundingRect() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PATH_H
|
#endif // PATH_H
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "poi.h"
|
#include "poi.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "emptymap.h"
|
|
||||||
#include "trackitem.h"
|
#include "trackitem.h"
|
||||||
#include "routeitem.h"
|
#include "routeitem.h"
|
||||||
#include "waypointitem.h"
|
#include "waypointitem.h"
|
||||||
@ -16,25 +15,14 @@
|
|||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "pathview.h"
|
#include "pathview.h"
|
||||||
|
|
||||||
#define MAX_ZOOM 1
|
|
||||||
#define MIN_ZOOM -3
|
|
||||||
#define MARGIN 10.0
|
|
||||||
#define SCALE_OFFSET 7
|
|
||||||
|
|
||||||
static void unite(QRectF &rect, const QPointF &p)
|
#define MAX_DIGITAL_ZOOM 1
|
||||||
{
|
#define MIN_DIGITAL_ZOOM -3
|
||||||
if (p.x() < rect.left())
|
#define MARGIN 10.0
|
||||||
rect.setLeft(p.x());
|
#define SCALE_OFFSET 7
|
||||||
if (p.x() > rect.right())
|
|
||||||
rect.setRight(p.x());
|
|
||||||
if (p.y() > rect.bottom())
|
|
||||||
rect.setBottom(p.y());
|
|
||||||
if (p.y() < rect.top())
|
|
||||||
rect.setTop(p.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
PathView::PathView(Map *map, POI *poi, QWidget *parent)
|
PathView::PathView(Map *map, POI *poi, QWidget *parent)
|
||||||
: QGraphicsView(parent)
|
: QGraphicsView(parent)
|
||||||
{
|
{
|
||||||
Q_ASSERT(map != 0);
|
Q_ASSERT(map != 0);
|
||||||
Q_ASSERT(poi != 0);
|
Q_ASSERT(poi != 0);
|
||||||
@ -141,8 +129,7 @@ void PathView::addWaypoints(const QList<Waypoint> &waypoints)
|
|||||||
|
|
||||||
WaypointItem *wi = new WaypointItem(w, _map);
|
WaypointItem *wi = new WaypointItem(w, _map);
|
||||||
_waypoints.append(wi);
|
_waypoints.append(wi);
|
||||||
Coordinates c = wi->waypoint().coordinates();
|
updateWaypointsBoundingRect(wi->waypoint().coordinates());
|
||||||
updateWaypointsBoundingRect(QPointF(c.lon(), c.lat()));
|
|
||||||
wi->setZValue(1);
|
wi->setZValue(1);
|
||||||
wi->showLabel(_showWaypointLabels);
|
wi->showLabel(_showWaypointLabels);
|
||||||
wi->setUnits(_units);
|
wi->setUnits(_units);
|
||||||
@ -184,43 +171,31 @@ QList<PathItem *> PathView::loadData(const Data &data)
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathView::updateWaypointsBoundingRect(const QPointF &wp)
|
void PathView::updateWaypointsBoundingRect(const Coordinates &wp)
|
||||||
{
|
{
|
||||||
if (_wr.isNull()) {
|
if (_wr.isNull())
|
||||||
if (_wp.isNull())
|
_wr = RectC(wp, wp);
|
||||||
_wp = wp;
|
else
|
||||||
else {
|
_wr.unite(wp);
|
||||||
_wr = QRectF(_wp, wp).normalized();
|
|
||||||
_wp = QPointF();
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
unite(_wr, wp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal PathView::mapScale() const
|
qreal PathView::mapScale() const
|
||||||
{
|
{
|
||||||
QRectF br = _tr | _rr | _wr;
|
RectC br = _tr | _rr | _wr;
|
||||||
if (!br.isNull() && !_wp.isNull())
|
|
||||||
unite(br, _wp);
|
|
||||||
|
|
||||||
return _map->zoomFit(viewport()->size() - QSize(MARGIN/2, MARGIN/2), br);
|
return _map->zoomFit(viewport()->size() - QSize(MARGIN/2, MARGIN/2), br);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF PathView::contentCenter() const
|
QPointF PathView::contentCenter() const
|
||||||
{
|
{
|
||||||
QRectF br = _tr | _rr | _wr;
|
RectC br = _tr | _rr | _wr;
|
||||||
if (!br.isNull() && !_wp.isNull())
|
|
||||||
unite(br, _wp);
|
|
||||||
|
|
||||||
if (br.isNull())
|
return _map->ll2xy(br.center());
|
||||||
return _map->ll2xy(_wp);
|
|
||||||
else
|
|
||||||
return _map->ll2xy(br.center());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathView::updatePOIVisibility()
|
void PathView::updatePOIVisibility()
|
||||||
{
|
{
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it, jt;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it, jt;
|
||||||
|
|
||||||
if (!_showPOI)
|
if (!_showPOI)
|
||||||
return;
|
return;
|
||||||
@ -251,7 +226,7 @@ void PathView::rescale()
|
|||||||
for (int i = 0; i < _waypoints.size(); i++)
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
_waypoints.at(i)->setMap(_map);
|
_waypoints.at(i)->setMap(_map);
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
it.value()->setMap(_map);
|
it.value()->setMap(_map);
|
||||||
|
|
||||||
@ -271,6 +246,10 @@ void PathView::setPalette(const Palette &palette)
|
|||||||
|
|
||||||
void PathView::setMap(Map *map)
|
void PathView::setMap(Map *map)
|
||||||
{
|
{
|
||||||
|
QPointF pos = mapToScene(viewport()->rect().center());
|
||||||
|
Coordinates center = _map->xy2ll(pos);
|
||||||
|
qreal resolution = _map->resolution(pos);
|
||||||
|
|
||||||
_map->unload();
|
_map->unload();
|
||||||
disconnect(_map, SIGNAL(loaded()), this, SLOT(redraw()));
|
disconnect(_map, SIGNAL(loaded()), this, SLOT(redraw()));
|
||||||
|
|
||||||
@ -280,7 +259,7 @@ void PathView::setMap(Map *map)
|
|||||||
|
|
||||||
resetDigitalZoom();
|
resetDigitalZoom();
|
||||||
|
|
||||||
mapScale();
|
_map->zoomFit(resolution, center);
|
||||||
_scene->setSceneRect(_map->bounds());
|
_scene->setSceneRect(_map->bounds());
|
||||||
|
|
||||||
for (int i = 0; i < _tracks.size(); i++)
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
@ -290,15 +269,15 @@ void PathView::setMap(Map *map)
|
|||||||
for (int i = 0; i < _waypoints.size(); i++)
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
_waypoints.at(i)->setMap(map);
|
_waypoints.at(i)->setMap(map);
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
it.value()->setMap(_map);
|
it.value()->setMap(_map);
|
||||||
updatePOIVisibility();
|
updatePOIVisibility();
|
||||||
|
|
||||||
QPointF center = contentCenter();
|
pos = _map->ll2xy(center);
|
||||||
centerOn(center);
|
centerOn(pos);
|
||||||
|
|
||||||
_res = _map->resolution(center);
|
_res = _map->resolution(pos);
|
||||||
_mapScale->setResolution(_res);
|
_mapScale->setResolution(_res);
|
||||||
|
|
||||||
resetCachedContent();
|
resetCachedContent();
|
||||||
@ -317,7 +296,7 @@ void PathView::setPOI(POI *poi)
|
|||||||
|
|
||||||
void PathView::updatePOI()
|
void PathView::updatePOI()
|
||||||
{
|
{
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||||
_scene->removeItem(it.value());
|
_scene->removeItem(it.value());
|
||||||
@ -339,7 +318,7 @@ void PathView::addPOI(const QVector<Waypoint> &waypoints)
|
|||||||
for (int i = 0; i < waypoints.size(); i++) {
|
for (int i = 0; i < waypoints.size(); i++) {
|
||||||
const Waypoint &w = waypoints.at(i);
|
const Waypoint &w = waypoints.at(i);
|
||||||
|
|
||||||
if (_pois.contains(w))
|
if (_pois.contains(SearchPointer<Waypoint>(&w)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
WaypointItem *pi = new WaypointItem(w, _map);
|
WaypointItem *pi = new WaypointItem(w, _map);
|
||||||
@ -349,7 +328,7 @@ void PathView::addPOI(const QVector<Waypoint> &waypoints)
|
|||||||
pi->setDigitalZoom(_digitalZoom);
|
pi->setDigitalZoom(_digitalZoom);
|
||||||
_scene->addItem(pi);
|
_scene->addItem(pi);
|
||||||
|
|
||||||
_pois.insert(w, pi);
|
_pois.insert(SearchPointer<Waypoint>(&(pi->waypoint())), pi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +345,7 @@ void PathView::setUnits(enum Units units)
|
|||||||
for (int i = 0; i < _waypoints.size(); i++)
|
for (int i = 0; i < _waypoints.size(); i++)
|
||||||
_waypoints.at(i)->setUnits(units);
|
_waypoints.at(i)->setUnits(units);
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
it.value()->setUnits(units);
|
it.value()->setUnits(units);
|
||||||
}
|
}
|
||||||
@ -378,7 +357,7 @@ void PathView::redraw()
|
|||||||
|
|
||||||
void PathView::resetDigitalZoom()
|
void PathView::resetDigitalZoom()
|
||||||
{
|
{
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
_digitalZoom = 0;
|
_digitalZoom = 0;
|
||||||
resetTransform();
|
resetTransform();
|
||||||
@ -397,7 +376,7 @@ void PathView::resetDigitalZoom()
|
|||||||
|
|
||||||
void PathView::digitalZoom(int zoom)
|
void PathView::digitalZoom(int zoom)
|
||||||
{
|
{
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
|
|
||||||
_digitalZoom += zoom;
|
_digitalZoom += zoom;
|
||||||
scale(pow(2, zoom), pow(2, zoom));
|
scale(pow(2, zoom), pow(2, zoom));
|
||||||
@ -420,8 +399,8 @@ void PathView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
|
|||||||
|
|
||||||
if (_digitalZoom) {
|
if (_digitalZoom) {
|
||||||
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
||||||
>= MAX_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
>= MAX_DIGITAL_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
||||||
|| _digitalZoom <= MIN_ZOOM)))
|
|| _digitalZoom <= MIN_DIGITAL_ZOOM)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
digitalZoom(zoom);
|
digitalZoom(zoom);
|
||||||
@ -473,7 +452,7 @@ void PathView::keyPressEvent(QKeyEvent *event)
|
|||||||
{
|
{
|
||||||
int z;
|
int z;
|
||||||
|
|
||||||
QPoint pos = QRect(QPoint(), viewport()->size()).center();
|
QPoint pos = viewport()->rect().center();
|
||||||
Coordinates c = _map->xy2ll(mapToScene(pos));
|
Coordinates c = _map->xy2ll(mapToScene(pos));
|
||||||
|
|
||||||
if (event->matches(ZOOM_IN))
|
if (event->matches(ZOOM_IN))
|
||||||
@ -539,8 +518,9 @@ void PathView::clear()
|
|||||||
_scene->clear();
|
_scene->clear();
|
||||||
_palette.reset();
|
_palette.reset();
|
||||||
|
|
||||||
_tr = QRectF(); _rr = QRectF(); _wr = QRectF();
|
_tr = RectC();
|
||||||
_wp = QPointF();
|
_rr = RectC();
|
||||||
|
_wr = RectC();
|
||||||
|
|
||||||
resetDigitalZoom();
|
resetDigitalZoom();
|
||||||
resetCachedContent();
|
resetCachedContent();
|
||||||
@ -600,7 +580,7 @@ void PathView::showPOI(bool show)
|
|||||||
{
|
{
|
||||||
_showPOI = show;
|
_showPOI = show;
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
it.value()->setVisible(show);
|
it.value()->setVisible(show);
|
||||||
|
|
||||||
@ -611,7 +591,7 @@ void PathView::showPOILabels(bool show)
|
|||||||
{
|
{
|
||||||
_showPOILabels = show;
|
_showPOILabels = show;
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
QHash<SearchPointer<Waypoint>, WaypointItem*>::const_iterator it;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||||
it.value()->showLabel(show);
|
it.value()->showLabel(show);
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
#include "rectc.h"
|
||||||
|
#include "searchpointer.h"
|
||||||
|
|
||||||
class Data;
|
class Data;
|
||||||
class POI;
|
class POI;
|
||||||
@ -80,7 +82,7 @@ private:
|
|||||||
void digitalZoom(int zoom);
|
void digitalZoom(int zoom);
|
||||||
void resetDigitalZoom();
|
void resetDigitalZoom();
|
||||||
void updatePOIVisibility();
|
void updatePOIVisibility();
|
||||||
void updateWaypointsBoundingRect(const QPointF &wp);
|
void updateWaypointsBoundingRect(const Coordinates &wp);
|
||||||
|
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event);
|
||||||
@ -95,10 +97,9 @@ private:
|
|||||||
QList<TrackItem*> _tracks;
|
QList<TrackItem*> _tracks;
|
||||||
QList<RouteItem*> _routes;
|
QList<RouteItem*> _routes;
|
||||||
QList<WaypointItem*> _waypoints;
|
QList<WaypointItem*> _waypoints;
|
||||||
QHash<Waypoint, WaypointItem*> _pois;
|
QHash<SearchPointer<Waypoint>, WaypointItem*> _pois;
|
||||||
|
|
||||||
QRectF _tr, _rr, _wr;
|
RectC _tr, _rr, _wr;
|
||||||
QPointF _wp;
|
|
||||||
qreal _res;
|
qreal _res;
|
||||||
|
|
||||||
Map *_map;
|
Map *_map;
|
||||||
|
@ -38,11 +38,11 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
typedef RTree<size_t, qreal, 2> POITree;
|
typedef RTree<size_t, qreal, 2> POITree;
|
||||||
typedef struct {
|
struct FileIndex {
|
||||||
int start;
|
int start;
|
||||||
int end;
|
int end;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
} FileIndex;
|
};
|
||||||
|
|
||||||
POITree _tree;
|
POITree _tree;
|
||||||
QVector<Waypoint> _data;
|
QVector<Waypoint> _data;
|
||||||
|
@ -11,5 +11,5 @@ void RangeF::resize(qreal size)
|
|||||||
QDebug operator<<(QDebug dbg, const RangeF &range)
|
QDebug operator<<(QDebug dbg, const RangeF &range)
|
||||||
{
|
{
|
||||||
dbg.nospace() << "RangeF(" << range.min() << ", " << range.max() << ")";
|
dbg.nospace() << "RangeF(" << range.min() << ", " << range.max() << ")";
|
||||||
return dbg.maybeSpace();
|
return dbg.space();
|
||||||
}
|
}
|
||||||
|
63
src/rectc.cpp
Normal file
63
src/rectc.cpp
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#include "rectc.h"
|
||||||
|
|
||||||
|
RectC RectC::operator|(const RectC &r) const
|
||||||
|
{
|
||||||
|
if (isNull())
|
||||||
|
return r;
|
||||||
|
if (r.isNull())
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
qreal l1 = _tl.lon();
|
||||||
|
qreal r1 = _tl.lon();
|
||||||
|
if (_br.lon() - _tl.lon() < 0)
|
||||||
|
l1 = _br.lon();
|
||||||
|
else
|
||||||
|
r1 = _br.lon();
|
||||||
|
|
||||||
|
qreal l2 = r._tl.lon();
|
||||||
|
qreal r2 = r._tl.lon();
|
||||||
|
if (r._br.lon() - r._tl.lon() < 0)
|
||||||
|
l2 = r._br.lon();
|
||||||
|
else
|
||||||
|
r2 = r._br.lon();
|
||||||
|
|
||||||
|
qreal t1 = _tl.lat();
|
||||||
|
qreal b1 = _tl.lat();
|
||||||
|
if (_br.lat() - _tl.lat() < 0)
|
||||||
|
t1 = _br.lat();
|
||||||
|
else
|
||||||
|
b1 = _br.lat();
|
||||||
|
|
||||||
|
qreal t2 = r._tl.lat();
|
||||||
|
qreal b2 = r._tl.lat();
|
||||||
|
if (r._br.lat() - r._tl.lat() < 0)
|
||||||
|
t2 = r._br.lat();
|
||||||
|
else
|
||||||
|
b2 = r._br.lat();
|
||||||
|
|
||||||
|
RectC tmp;
|
||||||
|
tmp._tl.setLon(qMin(l1, l2));
|
||||||
|
tmp._br.setLon(qMax(r1, r2));
|
||||||
|
tmp._tl.setLat(qMin(t1, t2));
|
||||||
|
tmp._br.setLat(qMax(b1, b2));
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RectC::unite(const Coordinates &c)
|
||||||
|
{
|
||||||
|
if (c.lon() < _tl.lon())
|
||||||
|
_tl.setLon(c.lon());
|
||||||
|
if (c.lon() > _br.lon())
|
||||||
|
_br.setLon(c.lon());
|
||||||
|
if (c.lat() > _br.lat())
|
||||||
|
_br.setLat(c.lat());
|
||||||
|
if (c.lat() < _tl.lat())
|
||||||
|
_tl.setLat(c.lat());
|
||||||
|
}
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug dbg, const RectC &rect)
|
||||||
|
{
|
||||||
|
dbg.nospace() << "RectC(" << rect.topLeft() << ", " << rect.size() << ")";
|
||||||
|
return dbg.space();
|
||||||
|
}
|
42
src/rectc.h
Normal file
42
src/rectc.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#ifndef RECTC_H
|
||||||
|
#define RECTC_H
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QSizeF>
|
||||||
|
#include "coordinates.h"
|
||||||
|
|
||||||
|
class RectC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RectC() {}
|
||||||
|
RectC(const Coordinates &topLeft, const Coordinates &bottomRight)
|
||||||
|
: _tl(topLeft), _br(bottomRight) {}
|
||||||
|
|
||||||
|
bool isNull() const
|
||||||
|
{return _tl.isNull() && _br.isNull();}
|
||||||
|
bool isValid() const
|
||||||
|
{return (_tl.isValid() && _br.isValid() && _tl != _br);}
|
||||||
|
|
||||||
|
Coordinates topLeft() const {return _tl;}
|
||||||
|
Coordinates bottomRight() const {return _br;}
|
||||||
|
|
||||||
|
Coordinates center() const
|
||||||
|
{return Coordinates((_tl.lon() + _br.lon()) / 2.0,
|
||||||
|
(_tl.lat() + _br.lat()) / 2.0);}
|
||||||
|
qreal width() const {return _br.lon() - _tl.lon();}
|
||||||
|
qreal height() const {return _br.lat() - _tl.lat();}
|
||||||
|
|
||||||
|
QSizeF size() const {return QSizeF(width(), height());}
|
||||||
|
|
||||||
|
RectC operator|(const RectC &r) const;
|
||||||
|
RectC &operator|=(const RectC &r) {*this = *this | r; return *this;}
|
||||||
|
|
||||||
|
void unite(const Coordinates &c);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Coordinates _tl, _br;
|
||||||
|
};
|
||||||
|
|
||||||
|
QDebug operator<<(QDebug dbg, const RectC &rect);
|
||||||
|
|
||||||
|
#endif // RECTC_H
|
24
src/searchpointer.h
Normal file
24
src/searchpointer.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#ifndef SEARCHPOINTER_H
|
||||||
|
#define SEARCHPOINTER_H
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class SearchPointer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SearchPointer(const T *ptr) : _ptr(ptr) {}
|
||||||
|
|
||||||
|
const T *data() const {return _ptr;}
|
||||||
|
bool operator==(const SearchPointer<T> &other) const
|
||||||
|
{return *data() == *(other.data());}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const T *_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline uint qHash(const SearchPointer<T> &t)
|
||||||
|
{
|
||||||
|
return ::qHash(*(t.data()));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // SEARCHPOINTER_H
|
73
src/tar.cpp
73
src/tar.cpp
@ -1,5 +1,6 @@
|
|||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
#include "tar.h"
|
#include "tar.h"
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ struct Header
|
|||||||
/* 500 */
|
/* 500 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static quint64 number(const char* data, size_t size)
|
static quint64 number(const char* data, size_t size, int base = 8)
|
||||||
{
|
{
|
||||||
const char *sp;
|
const char *sp;
|
||||||
quint64 val = 0;
|
quint64 val = 0;
|
||||||
@ -38,18 +39,13 @@ static quint64 number(const char* data, size_t size)
|
|||||||
if (isdigit(*sp))
|
if (isdigit(*sp))
|
||||||
break;
|
break;
|
||||||
for (; sp < data + size && isdigit(*sp); sp++)
|
for (; sp < data + size && isdigit(*sp); sp++)
|
||||||
val = val * 8 + *sp - '0';
|
val = val * base + *sp - '0';
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Tar::load(const QString &path)
|
bool Tar::load(const QString &path)
|
||||||
{
|
{
|
||||||
char buffer[BLOCKSIZE];
|
|
||||||
struct Header *hdr = (struct Header*)&buffer;
|
|
||||||
quint64 size;
|
|
||||||
qint64 ret;
|
|
||||||
|
|
||||||
if (_file.isOpen())
|
if (_file.isOpen())
|
||||||
_file.close();
|
_file.close();
|
||||||
_index.clear();
|
_index.clear();
|
||||||
@ -58,16 +54,33 @@ bool Tar::load(const QString &path)
|
|||||||
if (!_file.open(QIODevice::ReadOnly))
|
if (!_file.open(QIODevice::ReadOnly))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
QFileInfo fi(path);
|
||||||
|
QString tmiPath = fi.path() + "/" + fi.completeBaseName() + ".tmi";
|
||||||
|
|
||||||
|
if (loadTmi(tmiPath))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return loadTar();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Tar::loadTar()
|
||||||
|
{
|
||||||
|
char buffer[BLOCKSIZE];
|
||||||
|
struct Header *hdr = (struct Header*)&buffer;
|
||||||
|
quint64 size;
|
||||||
|
qint64 ret;
|
||||||
|
|
||||||
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
||||||
if (ret < BLOCKSIZE) {
|
if (ret < BLOCKSIZE) {
|
||||||
_file.close();
|
_file.close();
|
||||||
|
_index.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
size = number(hdr->size, sizeof(hdr->size));
|
size = number(hdr->size, sizeof(hdr->size));
|
||||||
if (size)
|
_index.insert(hdr->name, _file.pos() / BLOCKSIZE - 1);
|
||||||
_index.insert(hdr->name, Info(size, _file.pos()));
|
|
||||||
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
|
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
|
||||||
_file.close();
|
_file.close();
|
||||||
|
_index.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,15 +88,49 @@ bool Tar::load(const QString &path)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Tar::loadTmi(const QString &path)
|
||||||
|
{
|
||||||
|
quint64 block;
|
||||||
|
int ln = 1;
|
||||||
|
|
||||||
|
QFile file(path);
|
||||||
|
if (!file.open(QIODevice::ReadOnly))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
while (!file.atEnd()) {
|
||||||
|
QByteArray line = file.readLine();
|
||||||
|
int pos = line.indexOf(':');
|
||||||
|
if (line.size() < 10 || pos < 7 || !line.startsWith("block")) {
|
||||||
|
qWarning("%s:%d: syntax error\n", qPrintable(path), ln);
|
||||||
|
_index.clear();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
block = number(line.constData() + 6, line.size() - 6, 10);
|
||||||
|
QString file(line.mid(pos + 1).trimmed());
|
||||||
|
|
||||||
|
_index.insert(file, block);
|
||||||
|
ln++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray Tar::file(const QString &name)
|
QByteArray Tar::file(const QString &name)
|
||||||
{
|
{
|
||||||
QMap<QString, Tar::Info>::const_iterator it = _index.find(name);
|
char buffer[BLOCKSIZE];
|
||||||
|
struct Header *hdr = (struct Header*)&buffer;
|
||||||
|
quint64 size;
|
||||||
|
|
||||||
|
QMap<QString, quint64>::const_iterator it = _index.find(name);
|
||||||
if (it == _index.end())
|
if (it == _index.end())
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
|
||||||
Q_ASSERT(_file.isOpen());
|
Q_ASSERT(_file.isOpen());
|
||||||
if (_file.seek(it.value().offset()))
|
if (_file.seek(it.value() * BLOCKSIZE)) {
|
||||||
return _file.read(it.value().size());
|
if (_file.read(buffer, BLOCKSIZE) < BLOCKSIZE)
|
||||||
else
|
return QByteArray();
|
||||||
|
size = number(hdr->size, sizeof(hdr->size));
|
||||||
|
return _file.read(size);
|
||||||
|
} else
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
15
src/tar.h
15
src/tar.h
@ -17,20 +17,11 @@ public:
|
|||||||
bool isOpen() const {return _file.isOpen();}
|
bool isOpen() const {return _file.isOpen();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Info
|
bool loadTar();
|
||||||
{
|
bool loadTmi(const QString &path);
|
||||||
public:
|
|
||||||
Info(quint64 size, quint64 offset) : _size(size), _offset(offset) {}
|
|
||||||
quint64 size() const {return _size;}
|
|
||||||
quint64 offset() const {return _offset;}
|
|
||||||
|
|
||||||
private:
|
|
||||||
quint64 _size;
|
|
||||||
quint64 _offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
QFile _file;
|
QFile _file;
|
||||||
QMap<QString, Info> _index;
|
QMap<QString, quint64> _index;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TAR_H
|
#endif // TAR_H
|
||||||
|
@ -112,7 +112,7 @@ void TCXParser::trackpoints(TrackData &track)
|
|||||||
if (_reader.name() == "Trackpoint") {
|
if (_reader.name() == "Trackpoint") {
|
||||||
Trackpoint t;
|
Trackpoint t;
|
||||||
trackpointData(t);
|
trackpointData(t);
|
||||||
if (!t.coordinates().isNull())
|
if (t.coordinates().isValid())
|
||||||
track.append(t);
|
track.append(t);
|
||||||
else
|
else
|
||||||
warning("Missing Trackpoint coordinates");
|
warning("Missing Trackpoint coordinates");
|
||||||
@ -131,7 +131,7 @@ void TCXParser::lap(TrackData &track)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::course(TrackData &track)
|
void TCXParser::course(QList<Waypoint> &waypoints, TrackData &track)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Track")
|
if (_reader.name() == "Track")
|
||||||
@ -143,8 +143,8 @@ void TCXParser::course(TrackData &track)
|
|||||||
else if (_reader.name() == "CoursePoint") {
|
else if (_reader.name() == "CoursePoint") {
|
||||||
Waypoint w;
|
Waypoint w;
|
||||||
waypointData(w);
|
waypointData(w);
|
||||||
if (!w.coordinates().isNull())
|
if (w.coordinates().isValid())
|
||||||
_waypoints.append(w);
|
waypoints.append(w);
|
||||||
else
|
else
|
||||||
warning("Missing Trackpoint coordinates");
|
warning("Missing Trackpoint coordinates");
|
||||||
} else
|
} else
|
||||||
@ -162,56 +162,54 @@ void TCXParser::activity(TrackData &track)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::courses()
|
void TCXParser::courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Course") {
|
if (_reader.name() == "Course") {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
course(_tracks.back());
|
course(waypoints, tracks.back());
|
||||||
} else
|
} else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::activities()
|
void TCXParser::activities(QList<TrackData> &tracks)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Activity") {
|
if (_reader.name() == "Activity") {
|
||||||
_tracks.append(TrackData());
|
tracks.append(TrackData());
|
||||||
activity(_tracks.back());
|
activity(tracks.back());
|
||||||
} else
|
} else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCXParser::tcx()
|
void TCXParser::tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
while (_reader.readNextStartElement()) {
|
while (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "Courses")
|
if (_reader.name() == "Courses")
|
||||||
courses();
|
courses(tracks, waypoints);
|
||||||
else if (_reader.name() == "Activities")
|
else if (_reader.name() == "Activities")
|
||||||
activities();
|
activities(tracks);
|
||||||
else
|
else
|
||||||
_reader.skipCurrentElement();
|
_reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TCXParser::parse()
|
bool TCXParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(routes);
|
||||||
|
|
||||||
|
_reader.clear();
|
||||||
|
_reader.setDevice(file);
|
||||||
|
|
||||||
if (_reader.readNextStartElement()) {
|
if (_reader.readNextStartElement()) {
|
||||||
if (_reader.name() == "TrainingCenterDatabase")
|
if (_reader.name() == "TrainingCenterDatabase")
|
||||||
tcx();
|
tcx(tracks, waypoints);
|
||||||
else
|
else
|
||||||
_reader.raiseError("Not a TCX file");
|
_reader.raiseError("Not a TCX file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return !_reader.error();
|
return !_reader.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TCXParser::loadFile(QFile *file)
|
|
||||||
{
|
|
||||||
_reader.clear();
|
|
||||||
_reader.setDevice(file);
|
|
||||||
|
|
||||||
return parse();
|
|
||||||
}
|
|
||||||
|
@ -8,20 +8,18 @@
|
|||||||
class TCXParser : public Parser
|
class TCXParser : public Parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TCXParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
|
||||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints) {}
|
|
||||||
~TCXParser() {}
|
~TCXParser() {}
|
||||||
|
|
||||||
bool loadFile(QFile *file);
|
bool parse(QFile *file, QList<TrackData> &tracks,
|
||||||
|
QList<RouteData> &routes, QList<Waypoint> &waypoints);
|
||||||
QString errorString() const {return _reader.errorString();}
|
QString errorString() const {return _reader.errorString();}
|
||||||
int errorLine() const {return _reader.lineNumber();}
|
int errorLine() const {return _reader.lineNumber();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool parse();
|
void tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void tcx();
|
void courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints);
|
||||||
void courses();
|
void activities(QList<TrackData> &tracks);
|
||||||
void activities();
|
void course(QList<Waypoint> &waypoints, TrackData &track);
|
||||||
void course(TrackData &track);
|
|
||||||
void activity(TrackData &track);
|
void activity(TrackData &track);
|
||||||
void lap(TrackData &track);
|
void lap(TrackData &track);
|
||||||
void trackpoints(TrackData &track);
|
void trackpoints(TrackData &track);
|
||||||
|
@ -6,6 +6,5 @@ QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint)
|
|||||||
<< trackpoint.timestamp() << ", " << trackpoint.elevation() << ", "
|
<< trackpoint.timestamp() << ", " << trackpoint.elevation() << ", "
|
||||||
<< trackpoint.speed() << ", " << trackpoint.heartRate() << ", "
|
<< trackpoint.speed() << ", " << trackpoint.heartRate() << ", "
|
||||||
<< trackpoint.temperature() << ")";
|
<< trackpoint.temperature() << ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
||||||
|
@ -197,16 +197,16 @@ Coordinates TransverseMercator::xy2ll(const QPointF &p) const
|
|||||||
sr = SPHSR(ftphi);
|
sr = SPHSR(ftphi);
|
||||||
sn = SPHSN(ftphi);
|
sn = SPHSN(ftphi);
|
||||||
|
|
||||||
cl = cos(ftphi);
|
cl = cos(ftphi);
|
||||||
|
|
||||||
t = tan(ftphi);
|
t = tan(ftphi);
|
||||||
tan2 = t * t;
|
tan2 = t * t;
|
||||||
tan4 = tan2 * tan2;
|
tan4 = tan2 * tan2;
|
||||||
eta = _ebs * pow(cl, 2);
|
eta = _ebs * pow(cl, 2);
|
||||||
eta2 = eta * eta;
|
eta2 = eta * eta;
|
||||||
eta3 = eta2 * eta;
|
eta3 = eta2 * eta;
|
||||||
eta4 = eta3 * eta;
|
eta4 = eta3 * eta;
|
||||||
de = p.x() - _falseEasting;
|
de = p.x() - _falseEasting;
|
||||||
if (fabs(de) < 0.0001)
|
if (fabs(de) < 0.0001)
|
||||||
de = 0.0;
|
de = 0.0;
|
||||||
|
|
||||||
|
@ -4,6 +4,5 @@ QDebug operator<<(QDebug dbg, const Waypoint &waypoint)
|
|||||||
{
|
{
|
||||||
dbg.nospace() << "Waypoint(" << waypoint.coordinates() << ", "
|
dbg.nospace() << "Waypoint(" << waypoint.coordinates() << ", "
|
||||||
<< waypoint.name() << ", " << waypoint.description() << ")";
|
<< waypoint.name() << ", " << waypoint.description() << ")";
|
||||||
|
return dbg.space();
|
||||||
return dbg.maybeSpace();
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user