mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-01 13:29:16 +02:00
Compare commits
93 Commits
Author | SHA1 | Date | |
---|---|---|---|
9e798e626c | |||
cb70f0dded | |||
400003f684 | |||
69db510b10 | |||
cd9ea0f8a9 | |||
0f6c8eb896 | |||
6b3c0d05ca | |||
b0cc028c4c | |||
1513130435 | |||
ec798451e8 | |||
ffc61552d2 | |||
aff7b1c13f | |||
d54f22d3f0 | |||
dba6291f3e | |||
e96cee2ea8 | |||
1eaaea98a3 | |||
a90073c422 | |||
223a13583c | |||
4386e1f2e1 | |||
5bfe9c2527 | |||
efa2b1c366 | |||
e0ad64a902 | |||
f0a1acb96a | |||
5f3bdb87f8 | |||
90d062e097 | |||
58b4c87d46 | |||
02654ec862 | |||
ff015c8714 | |||
c339116cd1 | |||
d8d70bfd8b | |||
7d8149ace3 | |||
4460b454c4 | |||
211310f377 | |||
1e4bcd0ac1 | |||
1a66ed0a36 | |||
273a127069 | |||
1c0a0fd0b3 | |||
713e331b2a | |||
96f406aad7 | |||
0aedec66c4 | |||
b500031713 | |||
699e4f32d5 | |||
992c8aaaf9 | |||
68a72c5809 | |||
eace308774 | |||
e4e3f7d143 | |||
acc49d015e | |||
b48652cb78 | |||
0808f6679e | |||
610ac3d73f | |||
1d719fdcc8 | |||
1746e1cf08 | |||
5d5a5365cd | |||
7dfdeac1da | |||
1ff13ee9f8 | |||
34b1fb6b5d | |||
02bf85780a | |||
47199348d8 | |||
3b55bc0efc | |||
4de3ddf71b | |||
e26fa92ce6 | |||
dfb69b2755 | |||
c2a30738cb | |||
fd53e89ea5 | |||
ccf91bb29f | |||
75bd388be0 | |||
aef0357204 | |||
d073d606d0 | |||
8822bf7e5f | |||
051a3ed303 | |||
96437ae6ab | |||
89c25bbc3a | |||
322792ea04 | |||
ce1c76a315 | |||
804e9594ad | |||
651973c524 | |||
533af66080 | |||
bab5750cf7 | |||
0d6f3ea162 | |||
b915302e2f | |||
03ef7a9147 | |||
33cb944e36 | |||
8bc575aef2 | |||
f0b7abdb72 | |||
6ce14734cd | |||
925a0e2951 | |||
e46bba18f2 | |||
a56aa4e706 | |||
c4b3a81b0b | |||
957cc6f4f3 | |||
ebad0832ee | |||
186c135ad5 | |||
72b5b1ea97 |
15
README.md
15
README.md
@ -3,7 +3,8 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
|
||||
KML, FIT, IGC and NMEA files.
|
||||
|
||||
## Features
|
||||
* User-definable map sources.
|
||||
* User-definable online maps.
|
||||
* Offline maps (OziExplorer maps and TrekBuddy maps/atlases).
|
||||
* Elevation, speed, heart rate, cadence, power and temperature graphs.
|
||||
* Support for multiple tracks in one view.
|
||||
* Support for POI files.
|
||||
@ -15,22 +16,18 @@ KML, FIT, IGC and NMEA files.
|
||||

|
||||
|
||||
## Build
|
||||
### Linux/OS X
|
||||
```shell
|
||||
lrelease gpxsee.pro
|
||||
qmake gpxsee.pro
|
||||
make
|
||||
```
|
||||
### Windows
|
||||
```shell
|
||||
lrelease gpxsee.pro
|
||||
qmake gpxsee.pro
|
||||
nmake release
|
||||
```
|
||||
|
||||
## Binaries
|
||||
## Download
|
||||
* [Windows & OS X builds](http://sourceforge.net/projects/gpxsee)
|
||||
* [Linux packages](http://software.opensuse.org/download.html?project=home%3Atumic%3AGPXSee&package=gpxsee)
|
||||
|
||||
## Changelog
|
||||
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
||||
|
||||
## Homepage
|
||||
GPXSee homepage: http://tumic.wz.cz/gpxsee
|
||||
|
31
gpxsee.pro
31
gpxsee.pro
@ -1,5 +1,5 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 4.0
|
||||
VERSION = 4.8
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
@ -23,7 +23,6 @@ HEADERS += src/config.h \
|
||||
src/filebrowser.h \
|
||||
src/map.h \
|
||||
src/onlinemap.h \
|
||||
src/maplist.h \
|
||||
src/downloader.h \
|
||||
src/units.h \
|
||||
src/scaleitem.h \
|
||||
@ -81,7 +80,6 @@ HEADERS += src/config.h \
|
||||
src/timetype.h \
|
||||
src/emptymap.h \
|
||||
src/offlinemap.h \
|
||||
src/mapdir.h \
|
||||
src/matrix.h \
|
||||
src/tar.h \
|
||||
src/atlas.h \
|
||||
@ -89,7 +87,14 @@ HEADERS += src/config.h \
|
||||
src/mercator.h \
|
||||
src/transversemercator.h \
|
||||
src/latlon.h \
|
||||
src/utm.h
|
||||
src/utm.h \
|
||||
src/lambertconic.h \
|
||||
src/ellipsoid.h \
|
||||
src/ozf.h \
|
||||
src/datum.h \
|
||||
src/maplist.h \
|
||||
src/albersequal.h \
|
||||
src/oddspinbox.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/gui.cpp \
|
||||
src/poi.cpp \
|
||||
@ -102,7 +107,6 @@ SOURCES += src/main.cpp \
|
||||
src/sliderinfoitem.cpp \
|
||||
src/filebrowser.cpp \
|
||||
src/onlinemap.cpp \
|
||||
src/maplist.cpp \
|
||||
src/downloader.cpp \
|
||||
src/scaleitem.cpp \
|
||||
src/track.cpp \
|
||||
@ -146,16 +150,23 @@ SOURCES += src/main.cpp \
|
||||
src/stylecombobox.cpp \
|
||||
src/emptymap.cpp \
|
||||
src/offlinemap.cpp \
|
||||
src/mapdir.cpp \
|
||||
src/matrix.cpp \
|
||||
src/tar.cpp \
|
||||
src/atlas.cpp \
|
||||
src/mercator.cpp \
|
||||
src/transversemercator.cpp \
|
||||
src/utm.cpp
|
||||
src/utm.cpp \
|
||||
src/lambertconic.cpp \
|
||||
src/ellipsoid.cpp \
|
||||
src/ozf.cpp \
|
||||
src/datum.cpp \
|
||||
src/maplist.cpp \
|
||||
src/albersequal.cpp \
|
||||
src/oddspinbox.cpp
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||
lang/gpxsee_sv.ts
|
||||
lang/gpxsee_sv.ts \
|
||||
lang/gpxsee_de.ts
|
||||
macx {
|
||||
ICON = icons/gpxsee.icns
|
||||
QMAKE_INFO_PLIST = Info.plist
|
||||
@ -165,7 +176,9 @@ macx {
|
||||
icons/fit.icns \
|
||||
icons/igc.icns \
|
||||
icons/nmea.icns \
|
||||
pkg/maps.txt
|
||||
pkg/maps.txt \
|
||||
pkg/ellipsoids.csv \
|
||||
pkg/datums.csv
|
||||
APP_RESOURCES.path = Contents/Resources
|
||||
QMAKE_BUNDLE_DATA += APP_RESOURCES
|
||||
}
|
||||
|
@ -14,12 +14,14 @@
|
||||
<file>icons/arrow-left-double.png</file>
|
||||
<file>icons/arrow-right-double.png</file>
|
||||
<file>icons/view-fullscreen.png</file>
|
||||
<file>icons/office-chart-line-stacked.png</file>
|
||||
<file>icons/office-chart-line.png</file>
|
||||
<file>icons/preferences-desktop-display.png</file>
|
||||
<file>icons/flag_48.png</file>
|
||||
<file>icons/system-run.png</file>
|
||||
<file>icons/document-print-preview.png</file>
|
||||
<file>icons/view-filter.png</file>
|
||||
<file>lang/gpxsee_cs.qm</file>
|
||||
<file>lang/gpxsee_sv.qm</file>
|
||||
<file>lang/gpxsee_de.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 727 B |
BIN
icons/office-chart-line.png
Normal file
BIN
icons/office-chart-line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 728 B |
BIN
icons/view-filter.png
Normal file
BIN
icons/view-filter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -190,326 +190,366 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="655"/>
|
||||
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
|
||||
<translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<location filename="../src/gui.cpp" line="733"/>
|
||||
<source>Open file</source>
|
||||
<translation>Otevřít soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="740"/>
|
||||
<location filename="../src/gui.cpp" line="823"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Otevřít POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<source>Open</source>
|
||||
<translation>Otevřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="221"/>
|
||||
<location filename="../src/gui.cpp" line="296"/>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<location filename="../src/gui.cpp" line="304"/>
|
||||
<location filename="../src/gui.cpp" line="671"/>
|
||||
<location filename="../src/gui.cpp" line="672"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Ovládací klávesy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="253"/>
|
||||
<location filename="../src/gui.cpp" line="328"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="259"/>
|
||||
<location filename="../src/gui.cpp" line="334"/>
|
||||
<source>Reload</source>
|
||||
<translation>Znovu načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="508"/>
|
||||
<location filename="../src/gui.cpp" line="585"/>
|
||||
<source>Show</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<location filename="../src/gui.cpp" line="579"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>FIT files (*.fit)</source>
|
||||
<translation>Soubory FIT (*.fit)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<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="107"/>
|
||||
<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="227"/>
|
||||
<location filename="../src/gui.cpp" line="617"/>
|
||||
<location filename="../src/gui.cpp" line="618"/>
|
||||
<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>
|
||||
<translation>Zdroje dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="267"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Nahrát POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="270"/>
|
||||
<location filename="../src/gui.cpp" line="345"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Zavřit POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="272"/>
|
||||
<location filename="../src/gui.cpp" line="347"/>
|
||||
<source>Overlap POIs</source>
|
||||
<translation>Překrývat POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="351"/>
|
||||
<source>Show POI labels</source>
|
||||
<translation>Zobrazit názvy POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<location filename="../src/gui.cpp" line="356"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Zobrazit POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="290"/>
|
||||
<location filename="../src/gui.cpp" line="365"/>
|
||||
<source>Show map</source>
|
||||
<translation>Zobrazit mapu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="297"/>
|
||||
<location filename="../src/gui.cpp" line="375"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Vymazat mezipaměť dlaždic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<location filename="../src/gui.cpp" line="606"/>
|
||||
<location filename="../src/gui.cpp" line="312"/>
|
||||
<source>Open...</source>
|
||||
<translation>Otevřít...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="342"/>
|
||||
<source>Load POI file...</source>
|
||||
<translation>Nahrát POI soubor...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="373"/>
|
||||
<source>Load map...</source>
|
||||
<translation>Nahrát mapu...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="383"/>
|
||||
<location filename="../src/gui.cpp" line="683"/>
|
||||
<source>Next map</source>
|
||||
<translation>Následující mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<location filename="../src/gui.cpp" line="393"/>
|
||||
<source>Show tracks</source>
|
||||
<translation>Zobrazit cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="321"/>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<source>Show routes</source>
|
||||
<translation>Zobrazit trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="325"/>
|
||||
<location filename="../src/gui.cpp" line="401"/>
|
||||
<source>Show waypoints</source>
|
||||
<translation>Zobrazit navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="329"/>
|
||||
<location filename="../src/gui.cpp" line="405"/>
|
||||
<source>Waypoint labels</source>
|
||||
<translation>Názvy navigačních bodů</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="340"/>
|
||||
<location filename="../src/gui.cpp" line="416"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Zobrazit grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="362"/>
|
||||
<location filename="../src/gui.cpp" line="438"/>
|
||||
<source>Show grid</source>
|
||||
<translation>Zobrazit mřížku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<location filename="../src/gui.cpp" line="444"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Zobrazovat nástrojové lišty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<location filename="../src/gui.cpp" line="450"/>
|
||||
<source>Total time</source>
|
||||
<translation>Celkový čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="893"/>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="1015"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Čistý čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="386"/>
|
||||
<location filename="../src/gui.cpp" line="462"/>
|
||||
<source>Metric</source>
|
||||
<translation>Metrické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="391"/>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperiální</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<location filename="../src/gui.cpp" line="473"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Celoobrazovkový režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="403"/>
|
||||
<location filename="../src/gui.cpp" line="479"/>
|
||||
<source>Options...</source>
|
||||
<translation>Nastavení...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="408"/>
|
||||
<location filename="../src/gui.cpp" line="484"/>
|
||||
<source>Next</source>
|
||||
<translation>Následující</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="411"/>
|
||||
<location filename="../src/gui.cpp" line="487"/>
|
||||
<source>Previous</source>
|
||||
<translation>Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<location filename="../src/gui.cpp" line="491"/>
|
||||
<source>Last</source>
|
||||
<translation>Poslední</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<source>First</source>
|
||||
<translation>První</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="440"/>
|
||||
<location filename="../src/gui.cpp" line="516"/>
|
||||
<source>Map</source>
|
||||
<translation>Mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="447"/>
|
||||
<location filename="../src/gui.cpp" line="524"/>
|
||||
<source>Graph</source>
|
||||
<translation>Graf</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="532"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="456"/>
|
||||
<location filename="../src/gui.cpp" line="533"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<location filename="../src/gui.cpp" line="544"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="468"/>
|
||||
<location filename="../src/gui.cpp" line="545"/>
|
||||
<source>Display</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="553"/>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<location filename="../src/gui.cpp" line="557"/>
|
||||
<source>Units</source>
|
||||
<translation>Jednotky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="489"/>
|
||||
<location filename="../src/gui.cpp" line="566"/>
|
||||
<source>Help</source>
|
||||
<translation>Nápověda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="607"/>
|
||||
<location filename="../src/gui.cpp" line="681"/>
|
||||
<source>Append file</source>
|
||||
<translation>Přidat soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="682"/>
|
||||
<source>Next/Previous</source>
|
||||
<translation>Následující/Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="685"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Předchozí mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="620"/>
|
||||
<location filename="../src/gui.cpp" line="686"/>
|
||||
<source>Zoom in</source>
|
||||
<translation>Přiblížit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="688"/>
|
||||
<source>Zoom out</source>
|
||||
<translation>Oddálit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="690"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation>Digitální zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="691"/>
|
||||
<source>Zoom</source>
|
||||
<translation>Zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<source>Online maps</source>
|
||||
<translation>Online mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<location filename="../src/gui.cpp" line="704"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="631"/>
|
||||
<source>Ofline maps</source>
|
||||
<translation>Offline mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="632"/>
|
||||
<location filename="../src/gui.cpp" line="715"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="635"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziMap image-based maps and tiled 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 OziMap mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
|
||||
<location filename="../src/gui.cpp" line="1206"/>
|
||||
<source>Open map file</source>
|
||||
<translation>Otevřít mapový soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1091"/>
|
||||
<location filename="../src/gui.cpp" line="1239"/>
|
||||
<source>No files loaded</source>
|
||||
<translation>Nejsou načteny žádné soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>GPX files (*.gpx)</source>
|
||||
<translation>Soubory GPX (*.gpx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<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="107"/>
|
||||
<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="105"/>
|
||||
<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="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="879"/>
|
||||
<location filename="../src/gui.cpp" line="882"/>
|
||||
<location filename="../src/gui.cpp" line="1001"/>
|
||||
<location filename="../src/gui.cpp" line="1004"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="871"/>
|
||||
<location filename="../src/gui.cpp" line="993"/>
|
||||
<source>Routes</source>
|
||||
<translation>Trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1207"/>
|
||||
<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>
|
||||
<translation>Mapu nelze načíst:</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/gui.cpp" line="1095"/>
|
||||
<location filename="../src/gui.cpp" line="1243"/>
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n soubor</numerusform>
|
||||
@ -518,122 +558,127 @@
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="597"/>
|
||||
<location filename="../src/gui.cpp" line="675"/>
|
||||
<source>Next file</source>
|
||||
<translation>Následující soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="575"/>
|
||||
<location filename="../src/gui.cpp" line="652"/>
|
||||
<source>Version </source>
|
||||
<translation>Verze </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="242"/>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<source>Print...</source>
|
||||
<translation>Tisknout...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<location filename="../src/gui.cpp" line="322"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportovat do PDF...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="873"/>
|
||||
<location filename="../src/gui.cpp" line="995"/>
|
||||
<source>Waypoints</source>
|
||||
<translation>Navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="599"/>
|
||||
<location filename="../src/gui.cpp" line="676"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Předchozí soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="104"/>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<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="333"/>
|
||||
<location filename="../src/gui.cpp" line="409"/>
|
||||
<source>Route waypoints</source>
|
||||
<translation>Body tras</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="601"/>
|
||||
<location filename="../src/gui.cpp" line="678"/>
|
||||
<source>First file</source>
|
||||
<translation>První soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="603"/>
|
||||
<location filename="../src/gui.cpp" line="680"/>
|
||||
<source>Last file</source>
|
||||
<translation>Poslední soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="604"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Modifikátor nahradit/přidat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="624"/>
|
||||
<location filename="../src/gui.cpp" line="707"/>
|
||||
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
|
||||
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="640"/>
|
||||
<location filename="../src/gui.cpp" line="714"/>
|
||||
<source>Offline maps</source>
|
||||
<translation>Offline mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="718"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="723"/>
|
||||
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
|
||||
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="729"/>
|
||||
<location filename="../src/gui.cpp" line="812"/>
|
||||
<source>Error loading data file:</source>
|
||||
<translation>Datový soubor nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="732"/>
|
||||
<location filename="../src/gui.cpp" line="757"/>
|
||||
<location filename="../src/gui.cpp" line="815"/>
|
||||
<location filename="../src/gui.cpp" line="840"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Řádka: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="754"/>
|
||||
<location filename="../src/gui.cpp" line="837"/>
|
||||
<source>Error loading POI file:</source>
|
||||
<translation>Soubor POI nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="865"/>
|
||||
<location filename="../src/gui.cpp" line="987"/>
|
||||
<source>Name</source>
|
||||
<translation>Název</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="869"/>
|
||||
<location filename="../src/gui.cpp" line="991"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<location filename="../src/gui.cpp" line="307"/>
|
||||
<location filename="../src/gui.cpp" line="651"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>O aplikaci GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="513"/>
|
||||
<location filename="../src/gui.cpp" line="590"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigace</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="639"/>
|
||||
<location filename="../src/gui.cpp" line="722"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<location filename="../src/gui.cpp" line="889"/>
|
||||
<location filename="../src/gui.cpp" line="424"/>
|
||||
<location filename="../src/gui.cpp" line="1011"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="355"/>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<location filename="../src/gui.cpp" line="891"/>
|
||||
<location filename="../src/gui.cpp" line="431"/>
|
||||
<location filename="../src/gui.cpp" line="554"/>
|
||||
<location filename="../src/gui.cpp" line="1013"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
@ -714,156 +759,256 @@
|
||||
<context>
|
||||
<name>OptionsDialog</name>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="34"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="36"/>
|
||||
<source>Base color:</source>
|
||||
<translation>Základní barva:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="35"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="37"/>
|
||||
<source>Palette shift:</source>
|
||||
<translation>Posun palety:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="47"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="49"/>
|
||||
<source>Track width:</source>
|
||||
<translation>Šířka cest:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="48"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="50"/>
|
||||
<source>Track style:</source>
|
||||
<translation>Styl cest:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="50"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="52"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="60"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="62"/>
|
||||
<source>Route width:</source>
|
||||
<translation>Šířka tras:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="61"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="63"/>
|
||||
<source>Route style:</source>
|
||||
<translation>Styl tras:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="63"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="65"/>
|
||||
<source>Routes</source>
|
||||
<translation>Trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="67"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="99"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="69"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="102"/>
|
||||
<source>Use anti-aliasing</source>
|
||||
<translation>Vyhlazovat hrany</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="97"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="100"/>
|
||||
<source>Line width:</source>
|
||||
<translation>Šířka čar:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="113"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="116"/>
|
||||
<source>Colors</source>
|
||||
<translation>Barvy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="114"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="117"/>
|
||||
<source>Paths</source>
|
||||
<translation>Trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="115"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="183"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="118"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="278"/>
|
||||
<source>Graphs</source>
|
||||
<translation>Grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="127"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="125"/>
|
||||
<source>Moving average window size</source>
|
||||
<translation>Velikost okna klouzavého průměru</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="144"/>
|
||||
<source>Elevation:</source>
|
||||
<translation>Výška:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="145"/>
|
||||
<source>Speed:</source>
|
||||
<translation>Rychlost:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="146"/>
|
||||
<source>Heart rate:</source>
|
||||
<translation>Tep:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="147"/>
|
||||
<source>Cadence:</source>
|
||||
<translation>Kadence:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="148"/>
|
||||
<source>Power:</source>
|
||||
<translation>Výkon:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="150"/>
|
||||
<source>Smoothing</source>
|
||||
<translation>Vyhlazování</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="154"/>
|
||||
<source>Eliminate GPS outliers</source>
|
||||
<translation>Odstarnit odlehlé GPS záznamy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="160"/>
|
||||
<source>Outlier elimination</source>
|
||||
<translation>Odstranění odlehlých hodnot</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="167"/>
|
||||
<source>Smoothing:</source>
|
||||
<translation>Vyhlazování:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="190"/>
|
||||
<source>mi/h</source>
|
||||
<translation>mi/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="193"/>
|
||||
<source>km/h</source>
|
||||
<translation>km/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="197"/>
|
||||
<source>s</source>
|
||||
<translation>s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="201"/>
|
||||
<source>Minimal speed:</source>
|
||||
<translation>Minimální rychlost:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="202"/>
|
||||
<source>Minimal duration:</source>
|
||||
<translation>Minimální doba trvání:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="209"/>
|
||||
<source>Filtering</source>
|
||||
<translation>Filtrování</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="210"/>
|
||||
<source>Pause detection</source>
|
||||
<translation>Detekce přestávek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="222"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="130"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="225"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="134"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="229"/>
|
||||
<source>POI radius:</source>
|
||||
<translation>POI radius:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="140"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="224"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="235"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="334"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="147"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="242"/>
|
||||
<source>Name</source>
|
||||
<translation>Název</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="149"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="244"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="151"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="246"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="153"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="248"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="155"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="250"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Čistý čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="157"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="252"/>
|
||||
<source>Item count (>1)</source>
|
||||
<translation>Počet objektů (>1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="172"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="267"/>
|
||||
<source>Separate graph page</source>
|
||||
<translation>Samostatná stránka s grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="182"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="277"/>
|
||||
<source>Header</source>
|
||||
<translation>Záhlaví</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="190"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="285"/>
|
||||
<source>Use OpenGL</source>
|
||||
<translation>Používat OpenGL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="206"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="227"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="297"/>
|
||||
<source>MB</source>
|
||||
<translation>MB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="301"/>
|
||||
<source>Image cache size:</source>
|
||||
<translation>Mezipaměť obrázků:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="314"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="337"/>
|
||||
<source>System</source>
|
||||
<translation>Systém</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="222"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="331"/>
|
||||
<source>Appearance</source>
|
||||
<translation>Vzhled</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="225"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="333"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="335"/>
|
||||
<source>Print & Export</source>
|
||||
<translation>Tisk a export</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="254"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="364"/>
|
||||
<source>Options</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
@ -913,22 +1058,22 @@
|
||||
<context>
|
||||
<name>ScaleItem</name>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="81"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="82"/>
|
||||
<location filename="../src/scaleitem.cpp" line="84"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="84"/>
|
||||
<location filename="../src/scaleitem.cpp" line="86"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<location filename="../src/scaleitem.cpp" line="87"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
@ -1032,27 +1177,27 @@
|
||||
<context>
|
||||
<name>WaypointItem</name>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="18"/>
|
||||
<location filename="../src/waypointitem.cpp" line="17"/>
|
||||
<source>Name</source>
|
||||
<translation>Název</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="19"/>
|
||||
<location filename="../src/waypointitem.cpp" line="18"/>
|
||||
<source>Coordinates</source>
|
||||
<translation>Souřadnice</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="22"/>
|
||||
<location filename="../src/waypointitem.cpp" line="21"/>
|
||||
<source>Elevation</source>
|
||||
<translation>Výška</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="25"/>
|
||||
<location filename="../src/waypointitem.cpp" line="24"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="28"/>
|
||||
<location filename="../src/waypointitem.cpp" line="27"/>
|
||||
<source>Description</source>
|
||||
<translation>Popis</translation>
|
||||
</message>
|
||||
|
1204
lang/gpxsee_de.ts
Normal file
1204
lang/gpxsee_de.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="sv">
|
||||
<TS version="2.0" language="sv">
|
||||
<context>
|
||||
<name>CadenceGraph</name>
|
||||
<message>
|
||||
@ -190,290 +190,335 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="655"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<location filename="../src/gui.cpp" line="733"/>
|
||||
<source>Open file</source>
|
||||
<translation>Öppna fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="740"/>
|
||||
<location filename="../src/gui.cpp" line="823"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Öppna POI-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<source>Open</source>
|
||||
<translation>Öppna</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="221"/>
|
||||
<location filename="../src/gui.cpp" line="296"/>
|
||||
<source>Quit</source>
|
||||
<translation>Avsluta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<location filename="../src/gui.cpp" line="304"/>
|
||||
<location filename="../src/gui.cpp" line="671"/>
|
||||
<location filename="../src/gui.cpp" line="672"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Snabbtangenter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="253"/>
|
||||
<location filename="../src/gui.cpp" line="328"/>
|
||||
<source>Close</source>
|
||||
<translation>Stäng</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="259"/>
|
||||
<location filename="../src/gui.cpp" line="334"/>
|
||||
<source>Reload</source>
|
||||
<translation>Uppdatera</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="508"/>
|
||||
<location filename="../src/gui.cpp" line="585"/>
|
||||
<source>Show</source>
|
||||
<translation>Visa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<location filename="../src/gui.cpp" line="579"/>
|
||||
<source>File</source>
|
||||
<translation>Arkiv</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>FIT files (*.fit)</source>
|
||||
<translation>FIT-filer (*.fit)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<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="107"/>
|
||||
<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="227"/>
|
||||
<location filename="../src/gui.cpp" line="617"/>
|
||||
<location filename="../src/gui.cpp" line="618"/>
|
||||
<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>
|
||||
<translation>Datakällor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="267"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Läs in POI-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="270"/>
|
||||
<location filename="../src/gui.cpp" line="345"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Stäng POI-filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="272"/>
|
||||
<location filename="../src/gui.cpp" line="347"/>
|
||||
<source>Overlap POIs</source>
|
||||
<translation>Överlappa POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="351"/>
|
||||
<source>Show POI labels</source>
|
||||
<translation>Visa POI-namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<location filename="../src/gui.cpp" line="356"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Visa POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="290"/>
|
||||
<location filename="../src/gui.cpp" line="365"/>
|
||||
<source>Show map</source>
|
||||
<translation>Visa karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="297"/>
|
||||
<location filename="../src/gui.cpp" line="375"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Rensa kart-cache</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<location filename="../src/gui.cpp" line="606"/>
|
||||
<location filename="../src/gui.cpp" line="312"/>
|
||||
<source>Open...</source>
|
||||
<translation>Öppna...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="342"/>
|
||||
<source>Load POI file...</source>
|
||||
<translation>Läs in POI-fil...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="373"/>
|
||||
<source>Load map...</source>
|
||||
<translation>Läs in karta...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="383"/>
|
||||
<location filename="../src/gui.cpp" line="683"/>
|
||||
<source>Next map</source>
|
||||
<translation>Nästa karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<location filename="../src/gui.cpp" line="393"/>
|
||||
<source>Show tracks</source>
|
||||
<translation>Visa spår</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="321"/>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<source>Show routes</source>
|
||||
<translation>Visa rutter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="325"/>
|
||||
<location filename="../src/gui.cpp" line="401"/>
|
||||
<source>Show waypoints</source>
|
||||
<translation>Visa vägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="329"/>
|
||||
<location filename="../src/gui.cpp" line="405"/>
|
||||
<source>Waypoint labels</source>
|
||||
<translation>Vägpunktsnamn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="340"/>
|
||||
<location filename="../src/gui.cpp" line="416"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Visa diagram</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="362"/>
|
||||
<location filename="../src/gui.cpp" line="438"/>
|
||||
<source>Show grid</source>
|
||||
<translation>Visa stödlinjer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<location filename="../src/gui.cpp" line="444"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Visa verktygsfält</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<location filename="../src/gui.cpp" line="450"/>
|
||||
<source>Total time</source>
|
||||
<translation>Total tid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="893"/>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="1015"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Förflyttningstid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="386"/>
|
||||
<location filename="../src/gui.cpp" line="462"/>
|
||||
<source>Metric</source>
|
||||
<translation>Meter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="391"/>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperial</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<location filename="../src/gui.cpp" line="473"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Helskärmsläge</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="403"/>
|
||||
<location filename="../src/gui.cpp" line="479"/>
|
||||
<source>Options...</source>
|
||||
<translation>Alternativ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="408"/>
|
||||
<location filename="../src/gui.cpp" line="484"/>
|
||||
<source>Next</source>
|
||||
<translation>Nästa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="411"/>
|
||||
<location filename="../src/gui.cpp" line="487"/>
|
||||
<source>Previous</source>
|
||||
<translation>Föregående</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<location filename="../src/gui.cpp" line="491"/>
|
||||
<source>Last</source>
|
||||
<translation>Sista</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<source>First</source>
|
||||
<translation>Första</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="440"/>
|
||||
<location filename="../src/gui.cpp" line="516"/>
|
||||
<source>Map</source>
|
||||
<translation>Karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="447"/>
|
||||
<location filename="../src/gui.cpp" line="524"/>
|
||||
<source>Graph</source>
|
||||
<translation>Diagram</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="532"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="456"/>
|
||||
<location filename="../src/gui.cpp" line="533"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI-filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<location filename="../src/gui.cpp" line="544"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="468"/>
|
||||
<location filename="../src/gui.cpp" line="545"/>
|
||||
<source>Display</source>
|
||||
<translation>Visa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="553"/>
|
||||
<source>Settings</source>
|
||||
<translation>Inställningar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<location filename="../src/gui.cpp" line="557"/>
|
||||
<source>Units</source>
|
||||
<translation>Enhet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="489"/>
|
||||
<location filename="../src/gui.cpp" line="566"/>
|
||||
<source>Help</source>
|
||||
<translation>Hjälp</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="607"/>
|
||||
<location filename="../src/gui.cpp" line="681"/>
|
||||
<source>Append file</source>
|
||||
<translation>Lägg till fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="682"/>
|
||||
<source>Next/Previous</source>
|
||||
<translation>Nästa/Föregående</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="685"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Föregående karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="620"/>
|
||||
<location filename="../src/gui.cpp" line="686"/>
|
||||
<source>Zoom in</source>
|
||||
<translation>Zooma in</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="688"/>
|
||||
<source>Zoom out</source>
|
||||
<translation>Zooma ut</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="690"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation>Digital zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="691"/>
|
||||
<source>Zoom</source>
|
||||
<translation>Zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<source>Online maps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Online-kartor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<location filename="../src/gui.cpp" line="704"/>
|
||||
<source>Online map URLs are read on program startup from the following file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Online-kartors URL:er, läses från följande fil vid programstart:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="631"/>
|
||||
<source>Ofline maps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<location filename="../src/gui.cpp" line="714"/>
|
||||
<source>Offline maps</source>
|
||||
<translation>Offline-kartor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="632"/>
|
||||
<location filename="../src/gui.cpp" line="715"/>
|
||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Offline-kartor läses in från följande mapp vid programstart:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="635"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziMap image-based maps and tiled TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<location filename="../src/gui.cpp" line="1206"/>
|
||||
<source>Open map file</source>
|
||||
<translation>Öppna kartfil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1091"/>
|
||||
<location filename="../src/gui.cpp" line="1207"/>
|
||||
<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>
|
||||
<translation>Fel vid inläsning av karta:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1239"/>
|
||||
<source>No files loaded</source>
|
||||
<translation>Inga filer inlästa</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/gui.cpp" line="1095"/>
|
||||
<location filename="../src/gui.cpp" line="1243"/>
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n filer</numerusform>
|
||||
@ -481,158 +526,158 @@
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>GPX files (*.gpx)</source>
|
||||
<translation>GPX-filer (*.gpx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<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="107"/>
|
||||
<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="105"/>
|
||||
<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="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Alla filer (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="879"/>
|
||||
<location filename="../src/gui.cpp" line="882"/>
|
||||
<location filename="../src/gui.cpp" line="1001"/>
|
||||
<location filename="../src/gui.cpp" line="1004"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="871"/>
|
||||
<location filename="../src/gui.cpp" line="993"/>
|
||||
<source>Routes</source>
|
||||
<translation>Rutter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="597"/>
|
||||
<location filename="../src/gui.cpp" line="675"/>
|
||||
<source>Next file</source>
|
||||
<translation>Nästa fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="575"/>
|
||||
<location filename="../src/gui.cpp" line="652"/>
|
||||
<source>Version </source>
|
||||
<translation>Version </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="242"/>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<source>Print...</source>
|
||||
<translation>Skriv ut...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<location filename="../src/gui.cpp" line="322"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportera till PDF...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="873"/>
|
||||
<location filename="../src/gui.cpp" line="995"/>
|
||||
<source>Waypoints</source>
|
||||
<translation>Vägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="599"/>
|
||||
<location filename="../src/gui.cpp" line="676"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Föregående fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="104"/>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<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="333"/>
|
||||
<location filename="../src/gui.cpp" line="409"/>
|
||||
<source>Route waypoints</source>
|
||||
<translation>Ruttvägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="601"/>
|
||||
<location filename="../src/gui.cpp" line="678"/>
|
||||
<source>First file</source>
|
||||
<translation>Första filen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="603"/>
|
||||
<location filename="../src/gui.cpp" line="680"/>
|
||||
<source>Last file</source>
|
||||
<translation>Sista filen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="604"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Tillämpa modifierare</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="624"/>
|
||||
<location filename="../src/gui.cpp" line="707"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="640"/>
|
||||
<location filename="../src/gui.cpp" line="718"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="723"/>
|
||||
<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>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="729"/>
|
||||
<location filename="../src/gui.cpp" line="812"/>
|
||||
<source>Error loading data file:</source>
|
||||
<translation>Fel vid inläsning av datafil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="732"/>
|
||||
<location filename="../src/gui.cpp" line="757"/>
|
||||
<location filename="../src/gui.cpp" line="815"/>
|
||||
<location filename="../src/gui.cpp" line="840"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Rad: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="754"/>
|
||||
<location filename="../src/gui.cpp" line="837"/>
|
||||
<source>Error loading POI file:</source>
|
||||
<translation>Fel vid inläsning av POI-fil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="865"/>
|
||||
<location filename="../src/gui.cpp" line="987"/>
|
||||
<source>Name</source>
|
||||
<translation>Namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="869"/>
|
||||
<location filename="../src/gui.cpp" line="991"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Spår</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<location filename="../src/gui.cpp" line="307"/>
|
||||
<location filename="../src/gui.cpp" line="651"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>Om GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="513"/>
|
||||
<location filename="../src/gui.cpp" line="590"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="639"/>
|
||||
<location filename="../src/gui.cpp" line="722"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<location filename="../src/gui.cpp" line="889"/>
|
||||
<location filename="../src/gui.cpp" line="424"/>
|
||||
<location filename="../src/gui.cpp" line="1011"/>
|
||||
<source>Distance</source>
|
||||
<translation>Avstånd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="355"/>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<location filename="../src/gui.cpp" line="891"/>
|
||||
<location filename="../src/gui.cpp" line="431"/>
|
||||
<location filename="../src/gui.cpp" line="554"/>
|
||||
<location filename="../src/gui.cpp" line="1013"/>
|
||||
<source>Time</source>
|
||||
<translation>Tid</translation>
|
||||
</message>
|
||||
@ -713,156 +758,256 @@
|
||||
<context>
|
||||
<name>OptionsDialog</name>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="34"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="36"/>
|
||||
<source>Base color:</source>
|
||||
<translation>Basfärg:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="35"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="37"/>
|
||||
<source>Palette shift:</source>
|
||||
<translation>Palettskiftning:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="47"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="49"/>
|
||||
<source>Track width:</source>
|
||||
<translation>Spårtjocklek:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="48"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="50"/>
|
||||
<source>Track style:</source>
|
||||
<translation>Spårstil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="50"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="52"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Spår</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="60"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="62"/>
|
||||
<source>Route width:</source>
|
||||
<translation>Ruttjocklek:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="61"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="63"/>
|
||||
<source>Route style:</source>
|
||||
<translation>Ruttstil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="63"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="65"/>
|
||||
<source>Routes</source>
|
||||
<translation>Rutter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="67"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="99"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="69"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="102"/>
|
||||
<source>Use anti-aliasing</source>
|
||||
<translation>Använd kantutjämning</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="97"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="100"/>
|
||||
<source>Line width:</source>
|
||||
<translation>Linjetjocklek:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="113"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="116"/>
|
||||
<source>Colors</source>
|
||||
<translation>Färger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="114"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="117"/>
|
||||
<source>Paths</source>
|
||||
<translation>Sökvägar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="115"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="183"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="118"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="278"/>
|
||||
<source>Graphs</source>
|
||||
<translation>Diagram</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="127"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="125"/>
|
||||
<source>Moving average window size</source>
|
||||
<translation>Flyttar vanlig fönsterstorlek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="144"/>
|
||||
<source>Elevation:</source>
|
||||
<translation>Höjd:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="145"/>
|
||||
<source>Speed:</source>
|
||||
<translation>Hastighet:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="146"/>
|
||||
<source>Heart rate:</source>
|
||||
<translation>Hjärtfrekvens:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="147"/>
|
||||
<source>Cadence:</source>
|
||||
<translation>Stegfrekvens:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="148"/>
|
||||
<source>Power:</source>
|
||||
<translation>Kraft:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="150"/>
|
||||
<source>Smoothing</source>
|
||||
<translation>Utjämning</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="154"/>
|
||||
<source>Eliminate GPS outliers</source>
|
||||
<translation>Eliminera GPS-extremvärden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="160"/>
|
||||
<source>Outlier elimination</source>
|
||||
<translation>Extremvärdeseliminering</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="167"/>
|
||||
<source>Smoothing:</source>
|
||||
<translation>Utjämning:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="190"/>
|
||||
<source>mi/h</source>
|
||||
<translation>mi/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="193"/>
|
||||
<source>km/h</source>
|
||||
<translation>km/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="197"/>
|
||||
<source>s</source>
|
||||
<translation>sek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="201"/>
|
||||
<source>Minimal speed:</source>
|
||||
<translation>Minsta hastighet:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="202"/>
|
||||
<source>Minimal duration:</source>
|
||||
<translation>Kortast varaktighet:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="209"/>
|
||||
<source>Filtering</source>
|
||||
<translation>Filtrerar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="210"/>
|
||||
<source>Pause detection</source>
|
||||
<translation>Pausa identifiering</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="222"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="130"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="225"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="134"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="229"/>
|
||||
<source>POI radius:</source>
|
||||
<translation>POI-radie:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="140"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="224"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="235"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="334"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="147"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="242"/>
|
||||
<source>Name</source>
|
||||
<translation>Namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="149"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="244"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="151"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="246"/>
|
||||
<source>Distance</source>
|
||||
<translation>Avstånd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="153"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="248"/>
|
||||
<source>Time</source>
|
||||
<translation>Tid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="155"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="250"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Förflyttningstid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="157"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="252"/>
|
||||
<source>Item count (>1)</source>
|
||||
<translation>Objektantal (>1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="172"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="267"/>
|
||||
<source>Separate graph page</source>
|
||||
<translation>Separat diagramsida</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="182"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="277"/>
|
||||
<source>Header</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="190"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="285"/>
|
||||
<source>Use OpenGL</source>
|
||||
<translation>Använd OpenGL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="206"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="227"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="297"/>
|
||||
<source>MB</source>
|
||||
<translation>MB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="301"/>
|
||||
<source>Image cache size:</source>
|
||||
<translation>Cashe-storlek för bilder:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="314"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="337"/>
|
||||
<source>System</source>
|
||||
<translation>System</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="222"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="331"/>
|
||||
<source>Appearance</source>
|
||||
<translation>Utseende</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="225"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="333"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="335"/>
|
||||
<source>Print & Export</source>
|
||||
<translation>Utskrift & Export</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/optionsdialog.cpp" line="254"/>
|
||||
<location filename="../src/optionsdialog.cpp" line="364"/>
|
||||
<source>Options</source>
|
||||
<translation>Alternativ</translation>
|
||||
</message>
|
||||
@ -912,22 +1057,22 @@
|
||||
<context>
|
||||
<name>ScaleItem</name>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="81"/>
|
||||
<location filename="../src/scaleitem.cpp" line="83"/>
|
||||
<source>mi</source>
|
||||
<translation>mi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="82"/>
|
||||
<location filename="../src/scaleitem.cpp" line="84"/>
|
||||
<source>ft</source>
|
||||
<translation>ft</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="84"/>
|
||||
<location filename="../src/scaleitem.cpp" line="86"/>
|
||||
<source>km</source>
|
||||
<translation>km</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/scaleitem.cpp" line="85"/>
|
||||
<location filename="../src/scaleitem.cpp" line="87"/>
|
||||
<source>m</source>
|
||||
<translation>m</translation>
|
||||
</message>
|
||||
@ -1031,27 +1176,27 @@
|
||||
<context>
|
||||
<name>WaypointItem</name>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="18"/>
|
||||
<location filename="../src/waypointitem.cpp" line="17"/>
|
||||
<source>Name</source>
|
||||
<translation>Namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="19"/>
|
||||
<location filename="../src/waypointitem.cpp" line="18"/>
|
||||
<source>Coordinates</source>
|
||||
<translation>Koordinater</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="22"/>
|
||||
<location filename="../src/waypointitem.cpp" line="21"/>
|
||||
<source>Elevation</source>
|
||||
<translation>Höjd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="25"/>
|
||||
<location filename="../src/waypointitem.cpp" line="24"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/waypointitem.cpp" line="28"/>
|
||||
<location filename="../src/waypointitem.cpp" line="27"/>
|
||||
<source>Description</source>
|
||||
<translation>Beskrivning</translation>
|
||||
</message>
|
||||
|
123
pkg/datums.csv
Normal file
123
pkg/datums.csv
Normal file
@ -0,0 +1,123 @@
|
||||
Adindan,4201,5,-162,-12,206
|
||||
Afgooye,4205,15,-43,-163,45
|
||||
Ain el Abd 1970,4204,14,-150,-251,-2
|
||||
Anna 1 Astro 1965,4708,2,-491,-22,435
|
||||
Arc 1950,4209,5,-143,-90,-294
|
||||
Arc 1960,4210,5,-160,-8,-300
|
||||
Ascension Island 1958,4712,14,-207,107,52
|
||||
Astro B4 Sorol Atoll,4707,14,114,-116,-333
|
||||
Astro Beacon 1945,4709,14,145,75,-272
|
||||
Astro DOS 71/4,4710,14,-320,550,-494
|
||||
Astronomic Stn 1952,4711,14,124,-234,-25
|
||||
Australian Geodetic 1966,4202,2,-133,-48,148
|
||||
Australian Geodetic 1984,4203,2,-134,-48,149
|
||||
Australian Geocentric 1994 (GDA94),4283,11,0,0,0
|
||||
Austrian,4312,3,594,84,471
|
||||
Bellevue (IGN),4714,14,-127,-769,472
|
||||
Bermuda 1957,4216,4,-73,213,296
|
||||
Bogota Observatory,4218,14,307,304,-318
|
||||
Campo Inchauspe,4221,14,-148,136,90
|
||||
Canton Astro 1966,4716,14,298,-304,-375
|
||||
Cape,4222,5,-136,-108,-292
|
||||
Cape Canaveral,4717,4,-2,150,181
|
||||
Carthage,4223,5,-263,6,431
|
||||
CH-1903,4149,3,674,15,405
|
||||
Chatham 1971,4672,14,175,-38,113
|
||||
Chua Astro,4224,14,-134,229,-29
|
||||
Corrego Alegre,4225,14,-206,172,-6
|
||||
Djakarta (Batavia),4211,3,-377,681,-50
|
||||
DOS 1968,,14,230,-199,-752
|
||||
Easter Island 1967,4719,14,211,147,111
|
||||
Egypt,,14,-130,-117,-151
|
||||
European 1950,4230,14,-87,-98,-121
|
||||
European 1950 (Mean France),,14,-87,-96,-120
|
||||
European 1950 (Spain and Portugal),,14,-84,-107,-120
|
||||
European 1979,4668,14,-86,-98,-119
|
||||
Finland Hayford,4123,14,-78,-231,-97
|
||||
Gandajika Base,4233,14,-133,-321,50
|
||||
Geodetic Datum 1949,4272,14,84,-22,209
|
||||
GGRS 87,4121,11,-199.87,74.79,246.62
|
||||
Guam 1963,4675,4,-100,-248,259
|
||||
GUX 1 Astro,4718,14,252,-209,-751
|
||||
Hartebeeshoek94,4148,20,0,0,0
|
||||
Hermannskogel,3906,3,653,-212,449
|
||||
Hjorsey 1955,4658,14,-73,46,-86
|
||||
Hong Kong 1963,4739,14,-156,-271,-189
|
||||
Hu-Tzu-Shan,4236,14,-634,-549,-201
|
||||
Indian Bangladesh,4682,6,289,734,257
|
||||
Indian Thailand,4240,6,214,836,303
|
||||
Israeli,4281,23,-235,-85,264
|
||||
Ireland 1965,4299,1,506,-122,611
|
||||
ISTS 073 Astro 1969,4724,14,208,-435,-229
|
||||
Johnston Island,4725,14,191,-77,-204
|
||||
Kandawala,4244,6,-97,787,86
|
||||
Kerguelen Island,4698,14,145,-187,103
|
||||
Kertau 1948,4245,7,-11,851,5
|
||||
L.C. 5 Astro,4726,4,42,124,147
|
||||
Liberia 1964,4251,5,-90,40,88
|
||||
Luzon Mindanao,,4,-133,-79,-72
|
||||
Luzon Philippines,4253,4,-133,-77,-51
|
||||
Mahe 1971,4256,5,41,-220,-134
|
||||
Marco Astro,4616,14,-289,-124,60
|
||||
Massawa,4262,3,639,405,60
|
||||
Merchich,4261,5,31,146,47
|
||||
Midway Astro 1961,4727,14,912,-58,1227
|
||||
Minna,4263,5,-92,-93,122
|
||||
NAD27 Alaska,,4,-5,135,172
|
||||
NAD27 Bahamas,,4,-4,154,178
|
||||
NAD27 Canada,,4,-10,158,187
|
||||
NAD27 Canal Zone,,4,0,125,201
|
||||
NAD27 Caribbean,,4,-7,152,178
|
||||
NAD27 Central,,4,0,125,194
|
||||
NAD27 CONUS,,4,-8,160,176
|
||||
NAD27 Cuba,,4,-9,152,178
|
||||
NAD27 Greenland,,4,11,114,195
|
||||
NAD27 Mexico,,4,-12,130,190
|
||||
NAD27 San Salvador,,4,1,140,165
|
||||
NAD83,4269,11,0,0,0
|
||||
Nahrwn Masirah Ilnd,,5,-247,-148,369
|
||||
Nahrwn Saudi Arbia,,5,-231,-196,482
|
||||
Nahrwn United Arab,,5,-249,-156,381
|
||||
Naparima BWI,4271,14,-2,374,172
|
||||
NGO1948,4273,27,315,-217,528
|
||||
NTF France,4275,24,-168,-60,320
|
||||
Norsk,4817,27,278,93,474
|
||||
NZGD1949,4272,14,84,-22,209
|
||||
NZGD2000,4167,20,0,0,0
|
||||
Observatorio 1966,4182,14,-425,-169,81
|
||||
Old Egyptian,4229,12,-130,110,-13
|
||||
Old Hawaiian,4135,4,61,-285,-181
|
||||
Oman,4232,5,-346,-1,224
|
||||
Ord Srvy Grt Britn,4277,0,375,-111,431
|
||||
Pico De Las Nieves,4728,14,-307,-92,127
|
||||
Pitcairn Astro 1967,4729,14,185,165,42
|
||||
Potsdam Rauenberg DHDN,4314,3,606,23,413
|
||||
Prov So Amrican 1956,4248,14,-288,175,-376
|
||||
Prov So Chilean 1963,4254,14,16,196,93
|
||||
Puerto Rico,4139,4,11,72,-101
|
||||
Pulkovo 1942 (1),4284,15,28,-130,-95
|
||||
Pulkovo 1942 (2),4284,15,28,-130,-95
|
||||
Qatar National,4285,14,-128,-283,22
|
||||
Qornoq,4287,14,164,138,-189
|
||||
Reunion,4626,14,94,-948,-1262
|
||||
Rijksdriehoeksmeting,4289,3,593,26,478
|
||||
Rome 1940,4806,14,-225,-65,9
|
||||
RT 90,4124,3,498,-36,568
|
||||
S42,4179,15,28,-121,-77
|
||||
Santo (DOS),4730,14,170,42,84
|
||||
Sao Braz,4184,14,-203,141,53
|
||||
Sapper Hill 1943,4292,14,-355,16,74
|
||||
Schwarzeck,4293,21,616,97,-251
|
||||
South American 1969,4291,16,-57,1,-41
|
||||
South Asia,,8,7,-10,-26
|
||||
Southeast Base,4615,14,-499,-249,314
|
||||
Southwest Base,4183,14,-104,167,-38
|
||||
Timbalai 1948,4298,6,-689,691,-46
|
||||
Tokyo,4301,3,-128,481,664
|
||||
Tristan Astro 1968,4734,14,-632,438,-609
|
||||
Viti Levu 1916,4731,5,51,391,-36
|
||||
Wake-Eniwetok 1960,4732,13,101,52,-39
|
||||
WGS 72,4322,19,0,0,5
|
||||
WGS 84,4326,20,0,0,0
|
||||
Yacare,4309,14,-155,171,37
|
||||
Zanderij,4311,14,-265,120,-358
|
|
30
pkg/ellipsoids.csv
Normal file
30
pkg/ellipsoids.csv
Normal file
@ -0,0 +1,30 @@
|
||||
0,Airy 1830,6377563.396,299.3249646
|
||||
1,Modified Airy,6377340.189,299.3249646
|
||||
2,Australian National,6378160.0,298.25
|
||||
3,Bessel 1841,6377397.155,299.1528128
|
||||
4,Clarke 1866,6378206.4,294.9786982
|
||||
5,Clarke 1880,6378249.145,293.465
|
||||
6,Everest (India 1830),6377276.345,300.8017
|
||||
7,Everest (1948),6377304.063,300.8017
|
||||
8,Modified Fischer 1960,6378155.0,298.3
|
||||
9,Everest (Pakistan),6377309.613,300.8017
|
||||
10,Indonesian 1974,6378160.0,298.247
|
||||
11,GRS 80,6378137.0,298.257222101
|
||||
12,Helmert 1906,6378200.0,298.3
|
||||
13,Hough 1960,6378270.0,297.0
|
||||
14,International 1924,6378388.0,297.0
|
||||
15,Krassovsky 1940,6378245.0,298.3
|
||||
16,South American 1969,6378160.0,298.25
|
||||
17,Everest (Malaysia 1969),6377295.664,300.8017
|
||||
18,Everest (Sabah Sarawak),6377298.556,300.8017
|
||||
19,WGS 72,6378135.0,298.26
|
||||
20,WGS 84,6378137.0,298.257223563
|
||||
21,Bessel 1841 (Namibia),6377483.865,299.1528128
|
||||
22,Everest (India 1956),6377301.243,300.8017
|
||||
23,Clarke 1880 Palestine,6378300.789,293.466
|
||||
24,Clarke 1880 IGN,6378249.2,293.466021
|
||||
25,Hayford 1909,6378388.0,296.959263
|
||||
26,Clarke 1858,6378350.87,294.26
|
||||
27,Bessel 1841 (Norway),6377492.0176,299.1528
|
||||
28,Plessis 1817 (France),6376523.0,308.6409971
|
||||
29,Hayford 1924,6378388.0,297.0
|
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "4.0"
|
||||
!define VERSION "4.8"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
@ -82,6 +82,8 @@ Section "GPXSee" SEC_APP
|
||||
; Put the files there
|
||||
File "gpxsee.exe"
|
||||
File "maps.txt"
|
||||
File "ellipsoids.csv"
|
||||
File "datums.csv"
|
||||
|
||||
; Create start menu entry and add links
|
||||
SetShellVarContext all
|
||||
@ -250,4 +252,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "4.0"
|
||||
!define VERSION "4.8"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
@ -89,6 +89,8 @@ Section "GPXSee" SEC_APP
|
||||
; Put the files there
|
||||
File "gpxsee.exe"
|
||||
File "maps.txt"
|
||||
File "ellipsoids.csv"
|
||||
File "datums.csv"
|
||||
|
||||
; Create start menu entry and add links
|
||||
SetShellVarContext all
|
||||
@ -253,4 +255,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
@ -1,3 +1,4 @@
|
||||
Open Topo Map https://a.tile.opentopomap.org/$z/$x/$y.png
|
||||
Thunderforest http://tile.thunderforest.com/outdoors/$z/$x/$y.png
|
||||
Open Street Map http://tile.openstreetmap.org/$z/$x/$y.png
|
||||
USGS Topo https://navigator.er.usgs.gov/tiles/tcr.cgi/$z/$x/$y.png
|
||||
USGS Imagery https://navigator.er.usgs.gov/tiles/aerial_Imagery.cgi/$z/$x/$y
|
||||
|
229
src/albersequal.cpp
Normal file
229
src/albersequal.cpp
Normal file
@ -0,0 +1,229 @@
|
||||
/*
|
||||
* Based on libgeotrans with the following Source Code Disclaimer:
|
||||
|
||||
1. The GEOTRANS source code ("the software") is provided free of charge by
|
||||
the National Imagery and Mapping Agency (NIMA) of the United States
|
||||
Department of Defense. Although NIMA makes no copyright claim under Title 17
|
||||
U.S.C., NIMA claims copyrights in the source code under other legal regimes.
|
||||
NIMA hereby grants to each user of the software a license to use and
|
||||
distribute the software, and develop derivative works.
|
||||
|
||||
2. Warranty Disclaimer: The software was developed to meet only the internal
|
||||
requirements of the U.S. National Imagery and Mapping Agency. The software
|
||||
is provided "as is," and no warranty, express or implied, including but not
|
||||
limited to the implied warranties of merchantability and fitness for
|
||||
particular purpose or arising by statute or otherwise in law or from a
|
||||
course of dealing or usage in trade, is made by NIMA as to the accuracy and
|
||||
functioning of the software.
|
||||
|
||||
3. NIMA and its personnel are not required to provide technical support or
|
||||
general assistance with respect to the software.
|
||||
|
||||
4. Neither NIMA nor its personnel will be liable for any claims, losses, or
|
||||
damages arising from or connected with the use of the software. The user
|
||||
agrees to hold harmless the United States National Imagery and Mapping
|
||||
Agency. The user's sole and exclusive remedy is to stop using the software.
|
||||
|
||||
5. NIMA requests that products developed using the software credit the
|
||||
source of the software with the following statement, "The product was
|
||||
developed using GEOTRANS, a product of the National Imagery and Mapping
|
||||
Agency and U.S. Army Engineering Research and Development Center."
|
||||
|
||||
6. For any products developed using the software, NIMA requires a disclaimer
|
||||
that use of the software does not indicate endorsement or approval of the
|
||||
product by the Secretary of Defense or the National Imagery and Mapping
|
||||
Agency. Pursuant to the United States Code, 10 U.S.C. Sec. 2797, the name of
|
||||
the National Imagery and Mapping Agency, the initials "NIMA", the seal of
|
||||
the National Imagery and Mapping Agency, or any colorable imitation thereof
|
||||
shall not be used to imply approval, endorsement, or authorization of a
|
||||
product without prior written permission from United States Secretary of
|
||||
Defense.
|
||||
|
||||
*/
|
||||
|
||||
#include "ellipsoid.h"
|
||||
#include "rd.h"
|
||||
#include "albersequal.h"
|
||||
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#endif // M_PI_2
|
||||
|
||||
#define ONE_MINUS_SQR(x) (1.0 - (x) * (x))
|
||||
#define ALBERS_Q(slat, one_minus_sqr_es_sin, es_sin) \
|
||||
(_one_minus_es2 * ((slat) / (one_minus_sqr_es_sin) - \
|
||||
(1 / (_two_es)) * log((1 - (es_sin)) / (1 + (es_sin)))))
|
||||
#define ALBERS_M(clat, one_minus_sqr_es_sin) \
|
||||
((clat) / sqrt(one_minus_sqr_es_sin))
|
||||
|
||||
|
||||
AlbersEqual::AlbersEqual(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double falseEasting, double falseNorthing)
|
||||
{
|
||||
double sin_lat, sin_lat1, sin_lat2, cos_lat1, cos_lat2;
|
||||
double m1, m2, sqr_m1, sqr_m2;
|
||||
double q0, q1, q2;
|
||||
double es_sin, es_sin1, es_sin2;
|
||||
double one_minus_sqr_es_sin1, one_minus_sqr_es_sin2;
|
||||
double nq0;
|
||||
double sp1, sp2;
|
||||
|
||||
|
||||
_e = ellipsoid;
|
||||
_latitudeOrigin = deg2rad(latitudeOrigin);
|
||||
_longitudeOrigin = deg2rad(longitudeOrigin);
|
||||
_falseEasting = falseEasting;
|
||||
_falseNorthing = falseNorthing;
|
||||
|
||||
sp1 = deg2rad(standardParallel1);
|
||||
sp2 = deg2rad(standardParallel2);
|
||||
|
||||
_es2 = 2 * _e.flattening() - _e.flattening() * _e.flattening();
|
||||
_es = sqrt(_es2);
|
||||
_one_minus_es2 = 1 - _es2;
|
||||
_two_es = 2 * _es;
|
||||
|
||||
sin_lat = sin(_latitudeOrigin);
|
||||
es_sin = _es * sin_lat;
|
||||
q0 = ALBERS_Q(sin_lat, ONE_MINUS_SQR(es_sin), es_sin);
|
||||
|
||||
sin_lat1 = sin(sp1);
|
||||
cos_lat1 = cos(sp1);
|
||||
es_sin1 = _es * sin_lat1;
|
||||
one_minus_sqr_es_sin1 = ONE_MINUS_SQR(es_sin1);
|
||||
m1 = ALBERS_M(cos_lat1, one_minus_sqr_es_sin1);
|
||||
q1 = ALBERS_Q(sin_lat1, one_minus_sqr_es_sin1, es_sin1);
|
||||
|
||||
sqr_m1 = m1 * m1;
|
||||
if (fabs(sp1 - sp2) > 1.0e-10) {
|
||||
sin_lat2 = sin(sp2);
|
||||
cos_lat2 = cos(sp2);
|
||||
es_sin2 = _es * sin_lat2;
|
||||
one_minus_sqr_es_sin2 = ONE_MINUS_SQR(es_sin2);
|
||||
m2 = ALBERS_M(cos_lat2, one_minus_sqr_es_sin2);
|
||||
q2 = ALBERS_Q(sin_lat2, one_minus_sqr_es_sin2, es_sin2);
|
||||
sqr_m2 = m2 * m2;
|
||||
_n = (sqr_m1 - sqr_m2) / (q2 - q1);
|
||||
} else
|
||||
_n = sin_lat1;
|
||||
|
||||
_C = sqr_m1 + _n * q1;
|
||||
_a_over_n = _e.radius() / _n;
|
||||
nq0 = _n * q0;
|
||||
_rho0 = (_C < nq0) ? 0 : _a_over_n * sqrt(_C - nq0);
|
||||
}
|
||||
|
||||
QPointF AlbersEqual::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
double dlam;
|
||||
double sin_lat;
|
||||
double es_sin;
|
||||
double q;
|
||||
double rho;
|
||||
double theta;
|
||||
double nq;
|
||||
|
||||
|
||||
dlam = deg2rad(c.lon()) - _longitudeOrigin;
|
||||
if (dlam > M_PI)
|
||||
dlam -= 2.0 * M_PI;
|
||||
if (dlam < -M_PI)
|
||||
dlam += 2.0 * M_PI;
|
||||
|
||||
sin_lat = sin(deg2rad(c.lat()));
|
||||
es_sin = _es * sin_lat;
|
||||
q = ALBERS_Q(sin_lat, ONE_MINUS_SQR(es_sin), es_sin);
|
||||
nq = _n * q;
|
||||
rho = (_C < nq) ? 0 : _a_over_n * sqrt(_C - nq);
|
||||
theta = _n * dlam;
|
||||
|
||||
return QPointF(rho * sin(theta) + _falseEasting,
|
||||
_rho0 - rho * cos(theta) + _falseNorthing);
|
||||
}
|
||||
|
||||
Coordinates AlbersEqual::xy2ll(const QPointF &p) const
|
||||
{
|
||||
double dy, dx;
|
||||
double rho0_minus_dy;
|
||||
double q, qc, q_over_2;
|
||||
double rho, rho_n;
|
||||
double phi, delta_phi = 1.0;
|
||||
double sin_phi;
|
||||
double es_sin, one_minus_sqr_es_sin;
|
||||
double theta = 0.0;
|
||||
int count = 30;
|
||||
double tolerance = 4.85e-10;
|
||||
double lat, lon;
|
||||
|
||||
|
||||
dy = p.y() - _falseNorthing;
|
||||
dx = p.x() - _falseEasting;
|
||||
|
||||
rho0_minus_dy = _rho0 - dy;
|
||||
rho = sqrt(dx * dx + rho0_minus_dy * rho0_minus_dy);
|
||||
|
||||
if (_n < 0) {
|
||||
rho *= -1.0;
|
||||
dx *= -1.0;
|
||||
rho0_minus_dy *= -1.0;
|
||||
}
|
||||
|
||||
if (rho != 0.0)
|
||||
theta = atan2(dx, rho0_minus_dy);
|
||||
rho_n = rho * _n;
|
||||
q = (_C - (rho_n * rho_n) / (_e.radius() * _e.radius())) / _n;
|
||||
qc = 1 - ((_one_minus_es2) / (_two_es)) * log((1.0 - _es) / (1.0 + _es));
|
||||
if (fabs(fabs(qc) - fabs(q)) > 1.0e-6) {
|
||||
q_over_2 = q / 2.0;
|
||||
if (q_over_2 > 1.0)
|
||||
lat = M_PI_2;
|
||||
else if (q_over_2 < -1.0)
|
||||
lat = -M_PI_2;
|
||||
else {
|
||||
phi = asin(q_over_2);
|
||||
if (_es < 1.0e-10)
|
||||
lat = phi;
|
||||
else {
|
||||
while ((fabs(delta_phi) > tolerance) && count) {
|
||||
sin_phi = sin(phi);
|
||||
es_sin = _es * sin_phi;
|
||||
one_minus_sqr_es_sin = ONE_MINUS_SQR(es_sin);
|
||||
delta_phi = (one_minus_sqr_es_sin * one_minus_sqr_es_sin)
|
||||
/ (2.0 * cos(phi)) * (q / (_one_minus_es2) - sin_phi
|
||||
/ one_minus_sqr_es_sin + (log((1.0 - es_sin)
|
||||
/ (1.0 + es_sin)) / (_two_es)));
|
||||
phi += delta_phi;
|
||||
count --;
|
||||
}
|
||||
|
||||
lat = phi;
|
||||
}
|
||||
|
||||
if (lat > M_PI_2)
|
||||
lat = M_PI_2;
|
||||
else if (lat < -M_PI_2)
|
||||
lat = -M_PI_2;
|
||||
}
|
||||
} else {
|
||||
if (q >= 0.0)
|
||||
lat = M_PI_2;
|
||||
else
|
||||
lat = -M_PI_2;
|
||||
}
|
||||
|
||||
lon = _longitudeOrigin + theta / _n;
|
||||
|
||||
if (lon > M_PI)
|
||||
lon -= M_PI * 2;
|
||||
if (lon < -M_PI)
|
||||
lon += M_PI * 2;
|
||||
|
||||
if (lon > M_PI)
|
||||
lon = M_PI;
|
||||
else if (lon < -M_PI)
|
||||
lon = -M_PI;
|
||||
|
||||
return Coordinates(rad2deg(lon), rad2deg(lat));
|
||||
}
|
36
src/albersequal.h
Normal file
36
src/albersequal.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef ALBERSEQUAL_H
|
||||
#define ALBERSEQUAL_H
|
||||
|
||||
#include "projection.h"
|
||||
|
||||
class Ellipsoid;
|
||||
|
||||
class AlbersEqual : public Projection
|
||||
{
|
||||
public:
|
||||
AlbersEqual(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double falseEasting, double falseNorthing);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
|
||||
private:
|
||||
Ellipsoid _e;
|
||||
|
||||
double _latitudeOrigin;
|
||||
double _longitudeOrigin;
|
||||
double _falseEasting;
|
||||
double _falseNorthing;
|
||||
|
||||
double _rho0;
|
||||
double _C;
|
||||
double _n;
|
||||
double _es;
|
||||
double _es2;
|
||||
double _a_over_n;
|
||||
double _one_minus_es2;
|
||||
double _two_es;
|
||||
};
|
||||
|
||||
#endif // ALBERSEQUAL_H
|
@ -3,7 +3,6 @@
|
||||
#include <QLocale>
|
||||
#include <QFileOpenEvent>
|
||||
#include <QNetworkProxyFactory>
|
||||
#include <QPixmapCache>
|
||||
#include "opengl.h"
|
||||
#include "gui.h"
|
||||
#include "onlinemap.h"
|
||||
@ -24,7 +23,6 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
QPixmapCache::setCacheLimit(65536);
|
||||
OnlineMap::setDownloader(new Downloader(this));
|
||||
OPENGL_SET_SAMPLES(4);
|
||||
|
||||
|
130
src/atlas.cpp
130
src/atlas.cpp
@ -30,25 +30,35 @@ static bool yCmp(const OfflineMap *m1, const OfflineMap *m2)
|
||||
return TL(m1).y() > TL(m2).y();
|
||||
}
|
||||
|
||||
bool Atlas::isAtlas(const QFileInfoList &files)
|
||||
bool Atlas::isAtlas(Tar &tar, const QString &path)
|
||||
{
|
||||
for (int i = 0; i < files.count(); i++) {
|
||||
const QString &fileName = files.at(i).fileName();
|
||||
if (fileName.endsWith(".tar")) {
|
||||
if (!_tar.load(files.at(i).absoluteFilePath())) {
|
||||
qWarning("%s: %s: error loading tar file", qPrintable(_name),
|
||||
qPrintable(fileName));
|
||||
return false;
|
||||
}
|
||||
QStringList tarFiles = _tar.files();
|
||||
for (int j = 0; j < tarFiles.size(); j++)
|
||||
if (tarFiles.at(j).endsWith(".tba"))
|
||||
return true;
|
||||
} else if (fileName.endsWith(".tba"))
|
||||
return true;
|
||||
QFileInfo fi(path);
|
||||
QByteArray ba;
|
||||
QString suffix = fi.suffix().toLower();
|
||||
|
||||
if (suffix == "tar") {
|
||||
if (!tar.load(path)) {
|
||||
_errorString = "Error reading tar file";
|
||||
return false;
|
||||
}
|
||||
QString tbaFileName = fi.completeBaseName() + ".tba";
|
||||
ba = tar.file(tbaFileName);
|
||||
} else if (suffix == "tba") {
|
||||
QFile tbaFile(path);
|
||||
if (!tbaFile.open(QIODevice::ReadOnly)) {
|
||||
_errorString = QString("Error opening tba file: %1")
|
||||
.arg(tbaFile.errorString());
|
||||
return false;
|
||||
}
|
||||
ba = tbaFile.readAll();
|
||||
}
|
||||
|
||||
return false;
|
||||
if (ba.startsWith("Atlas 1.0"))
|
||||
return true;
|
||||
else {
|
||||
_errorString = "Missing or invalid tba file";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Atlas::computeZooms()
|
||||
@ -83,19 +93,15 @@ void Atlas::computeBounds()
|
||||
qSort(m.begin(), m.end(), xCmp);
|
||||
offsets[_maps.indexOf(m.first())].setX(w);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).x() > TL(m.at(i-1)).x()) {
|
||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||
}
|
||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||
}
|
||||
|
||||
qSort(m.begin(), m.end(), yCmp);
|
||||
offsets[_maps.indexOf(m.first())].setY(h);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).y() < TL(m.at(i-1)).y()) {
|
||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||
}
|
||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,42 +110,52 @@ void Atlas::computeBounds()
|
||||
BR(_maps.at(i))), QRectF(offsets.at(i), _maps.at(i)->bounds().size())));
|
||||
}
|
||||
|
||||
Atlas::Atlas(const QString &path, QObject *parent) : Map(parent)
|
||||
Atlas::Atlas(const QString &fileName, QObject *parent) : Map(parent)
|
||||
{
|
||||
Tar tar;
|
||||
QFileInfo fi(fileName);
|
||||
|
||||
_valid = false;
|
||||
_zoom = 0;
|
||||
_name = fi.dir().dirName();
|
||||
_ci = -1; _cz = -1;
|
||||
|
||||
QFileInfo fi(path);
|
||||
_name = fi.fileName();
|
||||
|
||||
QDir dir(path);
|
||||
QFileInfoList files = dir.entryInfoList(QDir::Files);
|
||||
if (!isAtlas(files))
|
||||
if (!isAtlas(tar, fileName))
|
||||
return;
|
||||
|
||||
QDir dir(fi.absolutePath());
|
||||
QFileInfoList layers = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (int n = 0; n < layers.count(); n++) {
|
||||
QDir zdir(layers.at(n).absoluteFilePath());
|
||||
QFileInfoList maps = zdir.entryInfoList(QDir::Dirs
|
||||
| QDir::NoDotAndDotDot);
|
||||
for (int i = 0; i < maps.count(); i++) {
|
||||
QString mapFile = maps.at(i).absoluteFilePath() + "/"
|
||||
+ maps.at(i).fileName() + ".map";
|
||||
|
||||
OfflineMap *map;
|
||||
if (_tar.isOpen())
|
||||
map = new OfflineMap(_tar, maps.at(i).absoluteFilePath(), this);
|
||||
if (tar.isOpen())
|
||||
map = new OfflineMap(mapFile, tar, this);
|
||||
else
|
||||
map = new OfflineMap(maps.at(i).absoluteFilePath(), this);
|
||||
map = new OfflineMap(mapFile, this);
|
||||
|
||||
if (map->isValid())
|
||||
_maps.append(map);
|
||||
else {
|
||||
_errorString = QString("Error loading map: %1: %2")
|
||||
.arg(mapFile, map->errorString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_maps.isEmpty()) {
|
||||
qWarning("%s: No usable maps available", qPrintable(_name));
|
||||
_errorString = "No maps found in atlas";
|
||||
return;
|
||||
}
|
||||
|
||||
computeZooms();
|
||||
computeBounds();
|
||||
|
||||
_zoom = 0;
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
@ -186,9 +202,14 @@ qreal Atlas::zoomFit(const QSize &size, const QRectF &br)
|
||||
{
|
||||
_zoom = 0;
|
||||
|
||||
if (br.isNull()) {
|
||||
_zoom = _zooms.size() - 1;
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
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(br.center())))
|
||||
if (!_bounds.at(i).first.contains(_maps.at(i)->ll2pp(br.center())))
|
||||
continue;
|
||||
|
||||
QRect sbr = QRectF(_maps.at(i)->ll2xy(br.topLeft()),
|
||||
@ -218,22 +239,33 @@ qreal Atlas::zoomOut()
|
||||
return _zoom;
|
||||
}
|
||||
|
||||
QPointF Atlas::ll2xy(const Coordinates &c) const
|
||||
QPointF Atlas::ll2xy(const Coordinates &c)
|
||||
{
|
||||
int idx = _zooms.at(_zoom).first;
|
||||
QPointF pp;
|
||||
|
||||
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
|
||||
if (_bounds.at(i).first.contains(_maps.at(i)->ll2pp(c))) {
|
||||
idx = i;
|
||||
break;
|
||||
if (_cz != _zoom) {
|
||||
_ci = -1;
|
||||
_cz = _zoom;
|
||||
}
|
||||
|
||||
if (_ci >= 0)
|
||||
pp = _maps.at(_ci)->ll2pp(c);
|
||||
if (_ci < 0 || !_bounds.at(_ci).first.contains(pp)) {
|
||||
_ci = _zooms.at(_zoom).first;
|
||||
for (int i = _zooms.at(_zoom).first; i <= _zooms.at(_zoom).second; i++) {
|
||||
pp = _maps.at(i)->ll2pp(c);
|
||||
if (_bounds.at(i).first.contains(pp)) {
|
||||
_ci = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPointF p = _maps.at(idx)->ll2xy(c);
|
||||
return p + _bounds.at(idx).second.topLeft();
|
||||
QPointF p = _maps.at(_ci)->pp2xy(pp);
|
||||
return p + _bounds.at(_ci).second.topLeft();
|
||||
}
|
||||
|
||||
Coordinates Atlas::xy2ll(const QPointF &p) const
|
||||
Coordinates Atlas::xy2ll(const QPointF &p)
|
||||
{
|
||||
int idx = _zooms.at(_zoom).first;
|
||||
|
||||
@ -280,3 +312,9 @@ void Atlas::draw(QPainter *painter, const QRectF &rect, int mapIndex)
|
||||
map->draw(painter, pr);
|
||||
painter->translate(-offset);
|
||||
}
|
||||
|
||||
void Atlas::unload()
|
||||
{
|
||||
for (int i = 0; i < _maps.count(); i++)
|
||||
_maps.at(i)->unload();
|
||||
}
|
||||
|
17
src/atlas.h
17
src/atlas.h
@ -11,7 +11,7 @@ class Atlas : public Map
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Atlas(const QString &path, QObject *parent = 0);
|
||||
Atlas(const QString &fileName, QObject *parent = 0);
|
||||
~Atlas();
|
||||
|
||||
const QString &name() const {return _name;}
|
||||
@ -24,27 +24,32 @@ public:
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
|
||||
QPointF ll2xy(const Coordinates &c) const;
|
||||
Coordinates xy2ll(const QPointF &p) const;
|
||||
QPointF ll2xy(const Coordinates &c);
|
||||
Coordinates xy2ll(const QPointF &p);
|
||||
|
||||
void draw(QPainter *painter, const QRectF &rect);
|
||||
|
||||
bool isValid() {return _valid;}
|
||||
void unload();
|
||||
|
||||
bool isValid() const {return _valid;}
|
||||
const QString &errorString() const {return _errorString;}
|
||||
|
||||
private:
|
||||
void draw(QPainter *painter, const QRectF &rect, int mapIndex);
|
||||
bool isAtlas(const QFileInfoList &files);
|
||||
bool isAtlas(Tar &tar, const QString &path);
|
||||
void computeZooms();
|
||||
void computeBounds();
|
||||
|
||||
QString _name;
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
|
||||
Tar _tar;
|
||||
QList<OfflineMap*> _maps;
|
||||
QVector<QPair<int, int> > _zooms;
|
||||
QVector<QPair<QRectF, QRectF> > _bounds;
|
||||
int _zoom;
|
||||
|
||||
int _ci, _cz;
|
||||
};
|
||||
|
||||
#endif // ATLAS_H
|
||||
|
20
src/config.h
20
src/config.h
@ -13,6 +13,8 @@
|
||||
#define FONT_SIZE 12
|
||||
#define SCREEN_DPI 96.0
|
||||
|
||||
#define ELLIPSOID_FILE QString("ellipsoids.csv")
|
||||
#define DATUM_FILE QString("datums.csv")
|
||||
#define MAP_FILE QString("maps.txt")
|
||||
#define MAP_DIR QString("maps")
|
||||
#define POI_DIR QString("POI")
|
||||
@ -29,12 +31,16 @@
|
||||
#define GLOBAL_DIR QString("/usr/share/gpxsee")
|
||||
#endif
|
||||
|
||||
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
|
||||
#define USER_MAP_FILE USER_DIR + QString("/") + MAP_FILE
|
||||
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
|
||||
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
|
||||
#define GLOBAL_MAP_FILE GLOBAL_DIR + QString("/") + MAP_FILE
|
||||
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
|
||||
#define TILES_DIR USER_DIR + QString("/tiles")
|
||||
#define USER_ELLIPSOID_FILE USER_DIR + QString("/") + ELLIPSOID_FILE
|
||||
#define USER_DATUM_FILE USER_DIR + QString("/") + DATUM_FILE
|
||||
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
|
||||
#define USER_MAP_FILE USER_DIR + QString("/") + MAP_FILE
|
||||
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
|
||||
#define GLOBAL_ELLIPSOID_FILE GLOBAL_DIR + QString("/") + ELLIPSOID_FILE
|
||||
#define GLOBAL_DATUM_FILE GLOBAL_DIR + QString("/") + DATUM_FILE
|
||||
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
|
||||
#define GLOBAL_MAP_FILE GLOBAL_DIR + QString("/") + MAP_FILE
|
||||
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
|
||||
#define TILES_DIR USER_DIR + QString("/tiles")
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
83
src/datum.cpp
Normal file
83
src/datum.cpp
Normal file
@ -0,0 +1,83 @@
|
||||
#include <QFile>
|
||||
#include "wgs84.h"
|
||||
#include "datum.h"
|
||||
|
||||
|
||||
static QMap<QString, Datum> WGS84()
|
||||
{
|
||||
QMap<QString, Datum> map;
|
||||
map.insert("WGS 84", Datum(Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING),
|
||||
0, 0, 0));
|
||||
return map;
|
||||
}
|
||||
|
||||
QMap<QString, Datum> Datum::_datums = WGS84();
|
||||
QString Datum::_errorString;
|
||||
int Datum::_errorLine = 0;
|
||||
|
||||
Datum Datum::datum(const QString &name)
|
||||
{
|
||||
QMap<QString, Datum>::const_iterator it = _datums.find(name);
|
||||
|
||||
if (it == _datums.end())
|
||||
return Datum();
|
||||
|
||||
return it.value();
|
||||
}
|
||||
|
||||
bool Datum::loadList(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
_errorString = qPrintable(file.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() != 6) {
|
||||
_errorString = "Format error";
|
||||
return false;
|
||||
}
|
||||
|
||||
int eid = list[2].trimmed().toInt(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid id";
|
||||
return false;
|
||||
}
|
||||
double dx = list[3].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dx";
|
||||
return false;
|
||||
}
|
||||
double dy = list[4].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dy";
|
||||
return false;
|
||||
}
|
||||
double dz = list[5].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dz";
|
||||
return false;
|
||||
}
|
||||
|
||||
Ellipsoid e = Ellipsoid::ellipsoid(eid);
|
||||
if (e.isNull()) {
|
||||
_errorString = "Unknown ellipsoid ID";
|
||||
return false;
|
||||
}
|
||||
|
||||
Datum d(e, dx, dy, dz);
|
||||
_datums.insert(list[0].trimmed(), d);
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
38
src/datum.h
Normal file
38
src/datum.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef DATUM_H
|
||||
#define DATUM_H
|
||||
|
||||
#include <QMap>
|
||||
#include "ellipsoid.h"
|
||||
|
||||
class Datum
|
||||
{
|
||||
public:
|
||||
Datum() : _ellipsoid(Ellipsoid()), _dx(0), _dy(0), _dz(0) {}
|
||||
Datum(const Ellipsoid &ellipsoid, double dx, double dy, double dz)
|
||||
: _ellipsoid(ellipsoid), _dx(dx), _dy(dy), _dz(dz) {}
|
||||
|
||||
const Ellipsoid &ellipsoid() const {return _ellipsoid;}
|
||||
double dx() const {return _dx;}
|
||||
double dy() const {return _dy;}
|
||||
double dz() const {return _dz;}
|
||||
|
||||
bool isNull() const {return _ellipsoid.isNull();}
|
||||
bool isWGS84() const
|
||||
{return _ellipsoid.isWGS84() && _dx == 0 && _dy == 0 && _dz == 0;}
|
||||
|
||||
static bool loadList(const QString &path);
|
||||
static const QString &errorString() {return _errorString;}
|
||||
static int errorLine() {return _errorLine;}
|
||||
|
||||
static Datum datum(const QString &name);
|
||||
|
||||
private:
|
||||
Ellipsoid _ellipsoid;
|
||||
double _dx, _dy, _dz;
|
||||
|
||||
static QMap<QString, Datum> _datums;
|
||||
static QString _errorString;
|
||||
static int _errorLine;
|
||||
};
|
||||
|
||||
#endif // DATUM_H
|
62
src/ellipsoid.cpp
Normal file
62
src/ellipsoid.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
#include <QFile>
|
||||
#include "ellipsoid.h"
|
||||
|
||||
QMap<int, Ellipsoid> Ellipsoid::_ellipsoids;
|
||||
QString Ellipsoid::_errorString;
|
||||
int Ellipsoid::_errorLine = 0;
|
||||
|
||||
Ellipsoid Ellipsoid::ellipsoid(int id)
|
||||
{
|
||||
QMap<int, Ellipsoid>::const_iterator it = _ellipsoids.find(id);
|
||||
|
||||
if (it == _ellipsoids.end())
|
||||
return Ellipsoid();
|
||||
|
||||
return it.value();
|
||||
}
|
||||
|
||||
bool Ellipsoid::loadList(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
_errorString = qPrintable(file.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() != 4) {
|
||||
_errorString = "Format error";
|
||||
return false;
|
||||
}
|
||||
|
||||
int id = list[0].trimmed().toInt(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid id";
|
||||
return false;
|
||||
}
|
||||
double radius = list[2].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid radius";
|
||||
return false;
|
||||
}
|
||||
double flattening = list[3].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid flattening";
|
||||
return false;
|
||||
}
|
||||
|
||||
Ellipsoid e(radius, 1.0/flattening);
|
||||
_ellipsoids.insert(id, e);
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
37
src/ellipsoid.h
Normal file
37
src/ellipsoid.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef ELLIPSOID_H
|
||||
#define ELLIPSOID_H
|
||||
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include "wgs84.h"
|
||||
|
||||
class Ellipsoid
|
||||
{
|
||||
public:
|
||||
Ellipsoid() : _radius(-1.0), _flattening(-1.0) {}
|
||||
Ellipsoid(double radius, double flattening)
|
||||
: _radius(radius), _flattening(flattening) {}
|
||||
|
||||
double radius() const {return _radius;}
|
||||
double flattening() const {return _flattening;}
|
||||
|
||||
bool isNull() const {return _radius < 0 || _flattening < 0;}
|
||||
bool isWGS84() const
|
||||
{return _radius == WGS84_RADIUS && _flattening == WGS84_FLATTENING;}
|
||||
|
||||
static bool loadList(const QString &path);
|
||||
static const QString &errorString() {return _errorString;}
|
||||
static int errorLine() {return _errorLine;}
|
||||
|
||||
static Ellipsoid ellipsoid(int id);
|
||||
|
||||
private:
|
||||
double _radius;
|
||||
double _flattening;
|
||||
|
||||
static QMap<int, Ellipsoid> _ellipsoids;
|
||||
static QString _errorString;
|
||||
static int _errorLine;
|
||||
};
|
||||
|
||||
#endif // ELLIPSOID_H
|
@ -64,13 +64,13 @@ void EmptyMap::draw(QPainter *painter, const QRectF &rect)
|
||||
painter->fillRect(rect, Qt::white);
|
||||
}
|
||||
|
||||
QPointF EmptyMap::ll2xy(const Coordinates &c) const
|
||||
QPointF EmptyMap::ll2xy(const Coordinates &c)
|
||||
{
|
||||
QPointF m = Mercator().ll2xy(c);
|
||||
return QPointF(m.x() / _scale, m.y() / -_scale);
|
||||
}
|
||||
|
||||
Coordinates EmptyMap::xy2ll(const QPointF &p) const
|
||||
Coordinates EmptyMap::xy2ll(const QPointF &p)
|
||||
{
|
||||
QPointF m(p.x() * _scale, -p.y() * _scale);
|
||||
return Mercator().xy2ll(m);
|
||||
|
@ -20,8 +20,8 @@ public:
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
|
||||
QPointF ll2xy(const Coordinates &c) const;
|
||||
Coordinates xy2ll(const QPointF &p) const;
|
||||
QPointF ll2xy(const Coordinates &c);
|
||||
Coordinates xy2ll(const QPointF &p);
|
||||
|
||||
void draw(QPainter *painter, const QRectF &rect);
|
||||
|
||||
|
18
src/graph.h
18
src/graph.h
@ -31,22 +31,6 @@ private:
|
||||
Q_DECLARE_TYPEINFO(GraphPoint, Q_PRIMITIVE_TYPE);
|
||||
QDebug operator<<(QDebug dbg, const GraphPoint &point);
|
||||
|
||||
|
||||
class Graph : public QVector<GraphPoint>
|
||||
{
|
||||
public:
|
||||
Graph() : QVector<GraphPoint>() {_time = true;}
|
||||
void append(const GraphPoint &p)
|
||||
{
|
||||
if (std::isnan(p.t()))
|
||||
_time = false;
|
||||
QVector<GraphPoint>::append(p);
|
||||
}
|
||||
|
||||
bool hasTime() const {return _time;}
|
||||
|
||||
private:
|
||||
bool _time;
|
||||
};
|
||||
typedef QVector<GraphPoint> Graph;
|
||||
|
||||
#endif // GRAPH_H
|
||||
|
@ -14,6 +14,14 @@ GraphItem::GraphItem(const Graph &graph, QGraphicsItem *parent)
|
||||
_graph = graph;
|
||||
_sx = 1.0; _sy = 1.0;
|
||||
|
||||
_time = true;
|
||||
for (int i = 0; i < _graph.size(); i++) {
|
||||
if (std::isnan(_graph.at(i).t())) {
|
||||
_time = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setZValue(1.0);
|
||||
|
||||
updatePath();
|
||||
@ -124,7 +132,7 @@ qreal GraphItem::distanceAtTime(qreal time)
|
||||
void GraphItem::emitSliderPositionChanged(qreal pos)
|
||||
{
|
||||
if (_type == Time) {
|
||||
if (_graph.hasTime()) {
|
||||
if (_time) {
|
||||
if (pos >= _graph.first().t() && pos <= _graph.last().t())
|
||||
emit sliderPositionChanged(distanceAtTime(pos));
|
||||
else
|
||||
@ -163,7 +171,7 @@ void GraphItem::updatePath()
|
||||
{
|
||||
_path = QPainterPath();
|
||||
|
||||
if (_type == Time && !_graph.hasTime())
|
||||
if (_type == Time && !_time)
|
||||
return;
|
||||
|
||||
_path.moveTo(_graph.first().x(_type) * _sx, -_graph.first().y() * _sy);
|
||||
@ -173,7 +181,7 @@ void GraphItem::updatePath()
|
||||
|
||||
void GraphItem::updateBounds()
|
||||
{
|
||||
if (_type == Time && !_graph.hasTime()) {
|
||||
if (_type == Time && !_time) {
|
||||
_bounds = QRectF();
|
||||
return;
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ private:
|
||||
QPainterPath _path;
|
||||
QRectF _bounds;
|
||||
qreal _sx, _sy;
|
||||
|
||||
bool _time;
|
||||
};
|
||||
|
||||
#endif // GRAPHITEM_H
|
||||
|
326
src/gui.cpp
326
src/gui.cpp
@ -21,14 +21,16 @@
|
||||
#include <QLocale>
|
||||
#include <QMimeData>
|
||||
#include <QUrl>
|
||||
#include <QPixmapCache>
|
||||
#include "config.h"
|
||||
#include "icons.h"
|
||||
#include "keys.h"
|
||||
#include "settings.h"
|
||||
#include "data.h"
|
||||
#include "ellipsoid.h"
|
||||
#include "datum.h"
|
||||
#include "map.h"
|
||||
#include "maplist.h"
|
||||
#include "mapdir.h"
|
||||
#include "emptymap.h"
|
||||
#include "elevationgraph.h"
|
||||
#include "speedgraph.h"
|
||||
@ -47,6 +49,7 @@
|
||||
|
||||
GUI::GUI()
|
||||
{
|
||||
loadDatums();
|
||||
loadMaps();
|
||||
loadPOIs();
|
||||
|
||||
@ -117,23 +120,94 @@ void GUI::createBrowser()
|
||||
_browser->setFilter(filter);
|
||||
}
|
||||
|
||||
void GUI::loadDatums()
|
||||
{
|
||||
QString ef, df;
|
||||
bool ok = false;
|
||||
|
||||
if (QFile::exists(USER_ELLIPSOID_FILE))
|
||||
ef = USER_ELLIPSOID_FILE;
|
||||
else if (QFile::exists(GLOBAL_ELLIPSOID_FILE))
|
||||
ef = GLOBAL_ELLIPSOID_FILE;
|
||||
else
|
||||
qWarning("No ellipsoids file found.");
|
||||
|
||||
if (QFile::exists(USER_DATUM_FILE))
|
||||
df = USER_DATUM_FILE;
|
||||
else if (QFile::exists(GLOBAL_DATUM_FILE))
|
||||
df = GLOBAL_DATUM_FILE;
|
||||
else
|
||||
qWarning("No datums file found.");
|
||||
|
||||
if (!ef.isNull() && !df.isNull()) {
|
||||
if (!Ellipsoid::loadList(ef)) {
|
||||
if (Ellipsoid::errorLine())
|
||||
qWarning("%s: parse error on line %d: %s", qPrintable(ef),
|
||||
Ellipsoid::errorLine(), qPrintable(Ellipsoid::errorString()));
|
||||
else
|
||||
qWarning("%s: %s", qPrintable(ef), qPrintable(
|
||||
Ellipsoid::errorString()));
|
||||
} else {
|
||||
if (!Datum::loadList(df)) {
|
||||
if (Datum::errorLine())
|
||||
qWarning("%s: parse error on line %d: %s", qPrintable(ef),
|
||||
Datum::errorLine(), qPrintable(Datum::errorString()));
|
||||
else
|
||||
qWarning("%s: %s", qPrintable(ef), qPrintable(
|
||||
Datum::errorString()));
|
||||
} else
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
qWarning("Maps based on a datum different from WGS84 won't work.");
|
||||
}
|
||||
|
||||
void GUI::loadMaps()
|
||||
{
|
||||
QList<Map*> online, offline;
|
||||
_ml = new MapList(this);
|
||||
|
||||
QString offline, online;
|
||||
|
||||
if (QFile::exists(USER_MAP_FILE))
|
||||
online = MapList::load(USER_MAP_FILE, this);
|
||||
else
|
||||
online = MapList::load(GLOBAL_MAP_FILE, this);
|
||||
online = USER_MAP_FILE;
|
||||
else if (QFile::exists(GLOBAL_MAP_FILE))
|
||||
online = GLOBAL_MAP_FILE;
|
||||
|
||||
if (!online.isNull() && !_ml->loadList(online))
|
||||
qWarning("%s: %s", qPrintable(online), qPrintable(_ml->errorString()));
|
||||
|
||||
|
||||
if (QFile::exists(USER_MAP_DIR))
|
||||
offline = MapDir::load(USER_MAP_DIR, this);
|
||||
else
|
||||
offline = MapDir::load(GLOBAL_MAP_DIR, this);
|
||||
offline = USER_MAP_DIR;
|
||||
else if (QFile::exists(GLOBAL_MAP_DIR))
|
||||
offline = GLOBAL_MAP_DIR;
|
||||
|
||||
_maps = online + offline;
|
||||
if (!offline.isNull()) {
|
||||
QDir md(offline);
|
||||
QFileInfoList ml = md.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
QStringList filters;
|
||||
filters << "*.map" << "*.tba" << "*.tar";
|
||||
|
||||
_map = _maps.isEmpty() ? new EmptyMap(this) : _maps.first();
|
||||
for (int i = 0; i < ml.size(); i++) {
|
||||
QDir dir(ml.at(i).absoluteFilePath());
|
||||
QFileInfoList fl = dir.entryInfoList(filters, QDir::Files);
|
||||
|
||||
if (fl.isEmpty())
|
||||
qWarning("%s: no map/atlas file found",
|
||||
qPrintable(ml.at(i).absoluteFilePath()));
|
||||
else if (fl.size() > 1)
|
||||
qWarning("%s: ambiguous directory content",
|
||||
qPrintable(ml.at(i).absoluteFilePath()));
|
||||
else
|
||||
if (!_ml->loadMap(fl.first().absoluteFilePath()))
|
||||
qWarning("%s: %s", qPrintable(fl.first().absoluteFilePath()),
|
||||
qPrintable(_ml->errorString()));
|
||||
}
|
||||
}
|
||||
|
||||
_map = _ml->maps().isEmpty() ? new EmptyMap(this) : _ml->maps().first();
|
||||
}
|
||||
|
||||
void GUI::loadPOIs()
|
||||
@ -162,33 +236,34 @@ void GUI::loadPOIs()
|
||||
|
||||
void GUI::createMapActions()
|
||||
{
|
||||
QActionGroup *ag = new QActionGroup(this);
|
||||
ag->setExclusive(true);
|
||||
_mapsSignalMapper = new QSignalMapper(this);
|
||||
_mapsActionGroup = new QActionGroup(this);
|
||||
_mapsActionGroup->setExclusive(true);
|
||||
|
||||
QSignalMapper *sm = new QSignalMapper(this);
|
||||
|
||||
for (int i = 0; i < _maps.count(); i++) {
|
||||
QAction *a = new QAction(_maps.at(i)->name(), this);
|
||||
for (int i = 0; i < _ml->maps().count(); i++) {
|
||||
QAction *a = new QAction(_ml->maps().at(i)->name(), this);
|
||||
a->setCheckable(true);
|
||||
a->setActionGroup(ag);
|
||||
a->setActionGroup(_mapsActionGroup);
|
||||
|
||||
sm->setMapping(a, i);
|
||||
connect(a, SIGNAL(triggered()), sm, SLOT(map()));
|
||||
_mapsSignalMapper->setMapping(a, i);
|
||||
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
|
||||
|
||||
_mapActions.append(a);
|
||||
}
|
||||
|
||||
connect(sm, SIGNAL(mapped(int)), this, SLOT(mapChanged(int)));
|
||||
connect(_mapsSignalMapper, SIGNAL(mapped(int)), this,
|
||||
SLOT(mapChanged(int)));
|
||||
}
|
||||
|
||||
void GUI::createPOIFilesActions()
|
||||
{
|
||||
_poiFilesSM = new QSignalMapper(this);
|
||||
_poiFilesSignalMapper = new QSignalMapper(this);
|
||||
|
||||
for (int i = 0; i < _poi->files().count(); i++)
|
||||
createPOIFileAction(i);
|
||||
|
||||
connect(_poiFilesSM, SIGNAL(mapped(int)), this, SLOT(poiFileChecked(int)));
|
||||
connect(_poiFilesSignalMapper, SIGNAL(mapped(int)), this,
|
||||
SLOT(poiFileChecked(int)));
|
||||
}
|
||||
|
||||
QAction *GUI::createPOIFileAction(int index)
|
||||
@ -197,8 +272,8 @@ QAction *GUI::createPOIFileAction(int index)
|
||||
this);
|
||||
a->setCheckable(true);
|
||||
|
||||
_poiFilesSM->setMapping(a, index);
|
||||
connect(a, SIGNAL(triggered()), _poiFilesSM, SLOT(map()));
|
||||
_poiFilesSignalMapper->setMapping(a, index);
|
||||
connect(a, SIGNAL(triggered()), _poiFilesSignalMapper, SLOT(map()));
|
||||
|
||||
_poiFilesActions.append(a);
|
||||
|
||||
@ -234,7 +309,7 @@ void GUI::createActions()
|
||||
|
||||
// File actions
|
||||
_openFileAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Open"), this);
|
||||
tr("Open..."), this);
|
||||
_openFileAction->setShortcut(OPEN_SHORTCUT);
|
||||
connect(_openFileAction, SIGNAL(triggered()), this, SLOT(openFile()));
|
||||
addAction(_openFileAction);
|
||||
@ -264,7 +339,7 @@ void GUI::createActions()
|
||||
|
||||
// POI actions
|
||||
_openPOIAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Load POI file"), this);
|
||||
tr("Load POI file..."), this);
|
||||
connect(_openPOIAction, SIGNAL(triggered()), this, SLOT(openPOIFile()));
|
||||
_closePOIAction = new QAction(QIcon(QPixmap(CLOSE_FILE_ICON)),
|
||||
tr("Close POI files"), this);
|
||||
@ -294,23 +369,24 @@ void GUI::createActions()
|
||||
connect(_showMapAction, SIGNAL(triggered(bool)), _pathView,
|
||||
SLOT(showMap(bool)));
|
||||
addAction(_showMapAction);
|
||||
_loadMapAction = new QAction(QIcon(QPixmap(OPEN_FILE_ICON)),
|
||||
tr("Load map..."), this);
|
||||
connect(_loadMapAction, SIGNAL(triggered()), this, SLOT(loadMap()));
|
||||
_clearMapCacheAction = new QAction(tr("Clear tile cache"), this);
|
||||
connect(_clearMapCacheAction, SIGNAL(triggered()), this,
|
||||
SLOT(clearMapCache()));
|
||||
if (_maps.empty()) {
|
||||
createMapActions();
|
||||
_nextMapAction = new QAction(tr("Next map"), this);
|
||||
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
|
||||
connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap()));
|
||||
addAction(_nextMapAction);
|
||||
_prevMapAction = new QAction(tr("Next map"), this);
|
||||
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
|
||||
connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap()));
|
||||
addAction(_prevMapAction);
|
||||
if (_ml->maps().isEmpty()) {
|
||||
_showMapAction->setEnabled(false);
|
||||
_clearMapCacheAction->setEnabled(false);
|
||||
} else {
|
||||
createMapActions();
|
||||
|
||||
_nextMapAction = new QAction(tr("Next map"), this);
|
||||
_nextMapAction->setShortcut(NEXT_MAP_SHORTCUT);
|
||||
connect(_nextMapAction, SIGNAL(triggered()), this, SLOT(nextMap()));
|
||||
addAction(_nextMapAction);
|
||||
_prevMapAction = new QAction(tr("Next map"), this);
|
||||
_prevMapAction->setShortcut(PREV_MAP_SHORTCUT);
|
||||
connect(_prevMapAction, SIGNAL(triggered()), this, SLOT(prevMap()));
|
||||
addAction(_prevMapAction);
|
||||
}
|
||||
|
||||
// Data actions
|
||||
@ -437,12 +513,13 @@ void GUI::createMenus()
|
||||
fileMenu->addAction(_exitAction);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
QMenu *mapMenu = menuBar()->addMenu(tr("Map"));
|
||||
mapMenu->addActions(_mapActions);
|
||||
mapMenu->addSeparator();
|
||||
mapMenu->addAction(_clearMapCacheAction);
|
||||
mapMenu->addSeparator();
|
||||
mapMenu->addAction(_showMapAction);
|
||||
_mapMenu = menuBar()->addMenu(tr("Map"));
|
||||
_mapMenu->addActions(_mapActions);
|
||||
_mapsEnd = _mapMenu->addSeparator();
|
||||
_mapMenu->addAction(_loadMapAction);
|
||||
_mapMenu->addAction(_clearMapCacheAction);
|
||||
_mapMenu->addSeparator();
|
||||
_mapMenu->addAction(_showMapAction);
|
||||
|
||||
QMenu *graphMenu = menuBar()->addMenu(tr("Graph"));
|
||||
graphMenu->addAction(_distanceGraphAction);
|
||||
@ -594,18 +671,24 @@ void GUI::keys()
|
||||
msgBox.setWindowTitle(tr("Keyboard controls"));
|
||||
msgBox.setText("<h3>" + tr("Keyboard controls") + "</h3>");
|
||||
msgBox.setInformativeText(
|
||||
"<div><table width=\"300\"><tr><td>" + tr("Next file")
|
||||
+ "</td><td><i>" + QKeySequence(NEXT_KEY).toString()
|
||||
"<style>td {padding-right: 1.5em;}</style><div><table><tr><td>"
|
||||
+ tr("Next file") + "</td><td><i>" + QKeySequence(NEXT_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Previous file")
|
||||
+ "</td><td><i>" + QKeySequence(PREV_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("First file") + "</td><td><i>"
|
||||
+ QKeySequence(FIRST_KEY).toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Last file") + "</td><td><i>" + QKeySequence(LAST_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Append modifier")
|
||||
+ "</td><td><i>SHIFT</i></td></tr><tr><td></td><td></td></tr><tr><td>"
|
||||
+ tr("Next map") + "</td><td><i>" + NEXT_MAP_SHORTCUT.toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Previous map") + "</td><td><i>"
|
||||
+ PREV_MAP_SHORTCUT.toString() + "</i></td></tr></table></div>");
|
||||
+ "</i></td></tr><tr><td>" + tr("Append file")
|
||||
+ "</td><td><i>" + QKeySequence(MODIFIER).toString() + tr("Next/Previous")
|
||||
+ "</i></td></tr><tr><td></td><td></td></tr><tr><td>" + tr("Next map")
|
||||
+ "</td><td><i>" + NEXT_MAP_SHORTCUT.toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Previous map") + "</td><td><i>" + PREV_MAP_SHORTCUT.toString()
|
||||
+ "</i></td></tr><tr><td></td><td></td></tr><tr><td>" + tr("Zoom in")
|
||||
+ "</td><td><i>" + QKeySequence(ZOOM_IN).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Zoom out") + "</td><td><i>"
|
||||
+ QKeySequence(ZOOM_OUT).toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Digital zoom") + "</td><td><i>" + QKeySequence(MODIFIER).toString()
|
||||
+ tr("Zoom") + "</i></td></tr></table></div>");
|
||||
|
||||
msgBox.exec();
|
||||
}
|
||||
@ -628,13 +711,13 @@ void GUI::dataSources()
|
||||
+ "</p><p><code>Map1 http://tile.server.com/map/$z/$x/$y.png"
|
||||
"<br/>Map2 http://mapserver.org/map/$z-$x-$y</code></p>"
|
||||
|
||||
+ "<h4>" + tr("Ofline maps") + "</h4><p>"
|
||||
+ "<h4>" + tr("Offline maps") + "</h4><p>"
|
||||
+ tr("Offline maps are loaded on program startup from the following "
|
||||
"directory:")
|
||||
+ "</p><p><code>" + USER_MAP_DIR + "</code></p><p>"
|
||||
+ tr("The expected structure is one map/atlas in a separate subdirectory."
|
||||
" Supported map formats are OziMap image-based maps and tiled TrekBuddy"
|
||||
" maps/atlases (tared and non-tared).") + "</p>"
|
||||
" Supported map formats are OziExplorer maps and TrekBuddy maps/atlases"
|
||||
" (tared and non-tared).") + "</p>"
|
||||
|
||||
+ "<h4>" + tr("POIs") + "</h4><p>"
|
||||
+ tr("To make GPXSee load a POI file automatically on startup, add "
|
||||
@ -792,6 +875,7 @@ void GUI::printFile()
|
||||
void GUI::openOptions()
|
||||
{
|
||||
Options options(_options);
|
||||
bool reload = false;
|
||||
|
||||
OptionsDialog dialog(&options, this);
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
@ -821,6 +905,39 @@ void GUI::openOptions()
|
||||
_tabs.at(i)->setRenderHint(QPainter::Antialiasing,
|
||||
options.graphAntiAliasing);
|
||||
|
||||
if (options.elevationFilter != _options.elevationFilter) {
|
||||
Track::setElevationFilter(options.elevationFilter);
|
||||
reload = true;
|
||||
}
|
||||
if (options.speedFilter != _options.speedFilter) {
|
||||
Track::setSpeedFilter(options.speedFilter);
|
||||
reload = true;
|
||||
}
|
||||
if (options.heartRateFilter != _options.heartRateFilter) {
|
||||
Track::setHeartRateFilter(options.heartRateFilter);
|
||||
reload = true;
|
||||
}
|
||||
if (options.cadenceFilter != _options.cadenceFilter) {
|
||||
Track::setCadenceFilter(options.cadenceFilter);
|
||||
reload = true;
|
||||
}
|
||||
if (options.powerFilter != _options.powerFilter) {
|
||||
Track::setPowerFilter(options.powerFilter);
|
||||
reload = true;
|
||||
}
|
||||
if (options.outlierEliminate != _options.outlierEliminate) {
|
||||
Track::setOutlierElimination(options.outlierEliminate);
|
||||
reload = true;
|
||||
}
|
||||
if (options.pauseSpeed != _options.pauseSpeed) {
|
||||
Track::setPauseSpeed(options.pauseSpeed);
|
||||
reload = true;
|
||||
}
|
||||
if (options.pauseInterval != _options.pauseInterval) {
|
||||
Track::setPauseInterval(options.pauseInterval);
|
||||
reload = true;
|
||||
}
|
||||
|
||||
if (options.poiRadius != _options.poiRadius)
|
||||
_poi->setRadius(options.poiRadius);
|
||||
|
||||
@ -829,6 +946,11 @@ void GUI::openOptions()
|
||||
for (int i = 0; i < _tabs.count(); i++)
|
||||
_tabs.at(i)->useOpenGL(options.useOpenGL);
|
||||
}
|
||||
if (options.pixmapCache != _options.pixmapCache)
|
||||
QPixmapCache::setCacheLimit(options.pixmapCache * 1024);
|
||||
|
||||
if (reload)
|
||||
reloadFile();
|
||||
|
||||
_options = options;
|
||||
}
|
||||
@ -1079,6 +1201,32 @@ void GUI::showGraphGrids(bool show)
|
||||
_tabs.at(i)->showGrid(show);
|
||||
}
|
||||
|
||||
void GUI::loadMap()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open map file"),
|
||||
QString(), tr("Map files (*.map *.tba *.tar)"));
|
||||
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
|
||||
if (_ml->loadMap(fileName)) {
|
||||
QAction *a = new QAction(_ml->maps().last()->name(), this);
|
||||
a->setCheckable(true);
|
||||
a->setActionGroup(_mapsActionGroup);
|
||||
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
|
||||
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
|
||||
_mapActions.append(a);
|
||||
_mapMenu->insertAction(_mapsEnd, a);
|
||||
_showMapAction->setEnabled(true);
|
||||
_clearMapCacheAction->setEnabled(true);
|
||||
a->activate(QAction::Trigger);
|
||||
} else {
|
||||
QString error = tr("Error loading map:") + "\n\n"
|
||||
+ fileName + "\n\n" + _ml->errorString();
|
||||
QMessageBox::critical(this, APP_NAME, error);
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::clearMapCache()
|
||||
{
|
||||
_map->clearCache();
|
||||
@ -1125,26 +1273,27 @@ void GUI::updateWindowTitle()
|
||||
|
||||
void GUI::mapChanged(int index)
|
||||
{
|
||||
_map = _maps.at(index);
|
||||
_map = _ml->maps().at(index);
|
||||
_pathView->setMap(_map);
|
||||
}
|
||||
|
||||
void GUI::nextMap()
|
||||
{
|
||||
if (_maps.count() < 2)
|
||||
if (_ml->maps().count() < 2)
|
||||
return;
|
||||
|
||||
int next = (_maps.indexOf(_map) + 1) % _maps.count();
|
||||
int next = (_ml->maps().indexOf(_map) + 1) % _ml->maps().count();
|
||||
_mapActions.at(next)->setChecked(true);
|
||||
mapChanged(next);
|
||||
}
|
||||
|
||||
void GUI::prevMap()
|
||||
{
|
||||
if (_maps.count() < 2)
|
||||
if (_ml->maps().count() < 2)
|
||||
return;
|
||||
|
||||
int prev = (_maps.indexOf(_map) + _maps.count() - 1) % _maps.count();
|
||||
int prev = (_ml->maps().indexOf(_map) + _ml->maps().count() - 1)
|
||||
% _ml->maps().count();
|
||||
_mapActions.at(prev)->setChecked(true);
|
||||
mapChanged(prev);
|
||||
}
|
||||
@ -1312,6 +1461,7 @@ void GUI::keyPressEvent(QKeyEvent *event)
|
||||
if (_fullscreenAction->isChecked()) {
|
||||
_fullscreenAction->setChecked(false);
|
||||
showFullscreen(false);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1320,7 +1470,10 @@ void GUI::keyPressEvent(QKeyEvent *event)
|
||||
if (!(event->modifiers() & MODIFIER))
|
||||
closeFiles();
|
||||
openFile(file);
|
||||
return;
|
||||
}
|
||||
|
||||
QMainWindow::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void GUI::closeEvent(QCloseEvent *event)
|
||||
@ -1465,10 +1618,28 @@ void GUI::writeSettings()
|
||||
settings.setValue(PATH_AA_SETTING, _options.pathAntiAliasing);
|
||||
if (_options.graphAntiAliasing != GRAPH_AA_DEFAULT)
|
||||
settings.setValue(GRAPH_AA_SETTING, _options.graphAntiAliasing);
|
||||
if (_options.elevationFilter != ELEVATION_FILTER_DEFAULT)
|
||||
settings.setValue(ELEVATION_FILTER_SETTING, _options.elevationFilter);
|
||||
if (_options.speedFilter != SPEED_FILTER_DEFAULT)
|
||||
settings.setValue(SPEED_FILTER_SETTING, _options.speedFilter);
|
||||
if (_options.heartRateFilter != HEARTRATE_FILTER_DEFAULT)
|
||||
settings.setValue(HEARTRATE_FILTER_SETTING, _options.heartRateFilter);
|
||||
if (_options.cadenceFilter != CADENCE_FILTER_DEFAULT)
|
||||
settings.setValue(CADENCE_FILTER_SETTING, _options.cadenceFilter);
|
||||
if (_options.powerFilter != POWER_FILTER_DEFAULT)
|
||||
settings.setValue(POWER_FILTER_SETTING, _options.powerFilter);
|
||||
if (_options.outlierEliminate != OUTLIER_ELIMINATE_DEFAULT)
|
||||
settings.setValue(OUTLIER_ELIMINATE_SETTING, _options.outlierEliminate);
|
||||
if (_options.pauseSpeed != PAUSE_SPEED_DEFAULT)
|
||||
settings.setValue(PAUSE_SPEED_SETTING, _options.pauseSpeed);
|
||||
if (_options.pauseInterval != PAUSE_INTERVAL_DEFAULT)
|
||||
settings.setValue(PAUSE_INTERVAL_SETTING, _options.pauseInterval);
|
||||
if (_options.poiRadius != POI_RADIUS_DEFAULT)
|
||||
settings.setValue(POI_RADIUS_SETTING, _options.poiRadius);
|
||||
if (_options.useOpenGL != USE_OPENGL_DEFAULT)
|
||||
settings.setValue(USE_OPENGL_SETTING, _options.useOpenGL);
|
||||
if (_options.pixmapCache != PIXMAP_CACHE_DEFAULT)
|
||||
settings.setValue(PIXMAP_CACHE_SETTING, _options.pixmapCache);
|
||||
if (_options.printName != PRINT_NAME_DEFAULT)
|
||||
settings.setValue(PRINT_NAME_SETTING, _options.printName);
|
||||
if (_options.printDate != PRINT_DATE_DEFAULT)
|
||||
@ -1521,10 +1692,10 @@ void GUI::readSettings()
|
||||
settings.beginGroup(MAP_SETTINGS_GROUP);
|
||||
if (settings.value(SHOW_MAP_SETTING, SHOW_MAP_DEFAULT).toBool())
|
||||
_showMapAction->setChecked(true);
|
||||
if (_maps.count()) {
|
||||
if (_ml->maps().count()) {
|
||||
int index = mapIndex(settings.value(CURRENT_MAP_SETTING).toString());
|
||||
_mapActions.at(index)->setChecked(true);
|
||||
_map = _maps.at(index);
|
||||
_map = _ml->maps().at(index);
|
||||
_pathView->setMap(_map);
|
||||
}
|
||||
settings.endGroup();
|
||||
@ -1642,10 +1813,28 @@ void GUI::readSettings()
|
||||
GRAPH_WIDTH_DEFAULT).toInt();
|
||||
_options.graphAntiAliasing = settings.value(GRAPH_AA_SETTING,
|
||||
GRAPH_AA_DEFAULT).toBool();
|
||||
_options.elevationFilter = settings.value(ELEVATION_FILTER_SETTING,
|
||||
ELEVATION_FILTER_DEFAULT).toInt();
|
||||
_options.speedFilter = settings.value(SPEED_FILTER_SETTING,
|
||||
SPEED_FILTER_DEFAULT).toInt();
|
||||
_options.heartRateFilter = settings.value(HEARTRATE_FILTER_SETTING,
|
||||
HEARTRATE_FILTER_DEFAULT).toInt();
|
||||
_options.cadenceFilter = settings.value(CADENCE_FILTER_SETTING,
|
||||
CADENCE_FILTER_DEFAULT).toInt();
|
||||
_options.powerFilter = settings.value(POWER_FILTER_SETTING,
|
||||
POWER_FILTER_DEFAULT).toInt();
|
||||
_options.outlierEliminate = settings.value(OUTLIER_ELIMINATE_SETTING,
|
||||
OUTLIER_ELIMINATE_DEFAULT).toBool();
|
||||
_options.pauseSpeed = settings.value(PAUSE_SPEED_SETTING,
|
||||
PAUSE_SPEED_DEFAULT).toFloat();
|
||||
_options.pauseInterval = settings.value(PAUSE_INTERVAL_SETTING,
|
||||
PAUSE_INTERVAL_DEFAULT).toInt();
|
||||
_options.poiRadius = settings.value(POI_RADIUS_SETTING, POI_RADIUS_DEFAULT)
|
||||
.toInt();
|
||||
_options.useOpenGL = settings.value(USE_OPENGL_SETTING, USE_OPENGL_DEFAULT)
|
||||
.toBool();
|
||||
_options.pixmapCache = settings.value(PIXMAP_CACHE_SETTING,
|
||||
PIXMAP_CACHE_DEFAULT).toInt();
|
||||
_options.printName = settings.value(PRINT_NAME_SETTING, PRINT_NAME_DEFAULT)
|
||||
.toBool();
|
||||
_options.printDate = settings.value(PRINT_DATE_SETTING, PRINT_DATE_DEFAULT)
|
||||
@ -1679,15 +1868,26 @@ void GUI::readSettings()
|
||||
_tabs.at(i)->useOpenGL(true);
|
||||
}
|
||||
|
||||
Track::setElevationFilter(_options.elevationFilter);
|
||||
Track::setSpeedFilter(_options.speedFilter);
|
||||
Track::setHeartRateFilter(_options.heartRateFilter);
|
||||
Track::setCadenceFilter(_options.cadenceFilter);
|
||||
Track::setPowerFilter(_options.powerFilter);
|
||||
Track::setOutlierElimination(_options.outlierEliminate);
|
||||
Track::setPauseSpeed(_options.pauseSpeed);
|
||||
Track::setPauseInterval(_options.pauseInterval);
|
||||
|
||||
_poi->setRadius(_options.poiRadius);
|
||||
|
||||
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
int GUI::mapIndex(const QString &name)
|
||||
{
|
||||
for (int i = 0; i < _maps.count(); i++)
|
||||
if (_maps.at(i)->name() == name)
|
||||
for (int i = 0; i < _ml->maps().count(); i++)
|
||||
if (_ml->maps().at(i)->name() == name)
|
||||
return i;
|
||||
|
||||
return 0;
|
||||
|
13
src/gui.h
13
src/gui.h
@ -13,6 +13,7 @@
|
||||
#include "exportdialog.h"
|
||||
#include "optionsdialog.h"
|
||||
|
||||
|
||||
class QMenu;
|
||||
class QToolBar;
|
||||
class QTabWidget;
|
||||
@ -25,6 +26,7 @@ class FileBrowser;
|
||||
class GraphTab;
|
||||
class PathView;
|
||||
class Map;
|
||||
class MapList;
|
||||
|
||||
class GUI : public QMainWindow
|
||||
{
|
||||
@ -53,6 +55,7 @@ private slots:
|
||||
void showFullscreen(bool show);
|
||||
void showTracks(bool show);
|
||||
void showRoutes(bool show);
|
||||
void loadMap();
|
||||
void clearMapCache();
|
||||
void nextMap();
|
||||
void prevMap();
|
||||
@ -79,6 +82,7 @@ private slots:
|
||||
private:
|
||||
typedef QPair<QDate, QDate> DateRange;
|
||||
|
||||
void loadDatums();
|
||||
void loadMaps();
|
||||
void loadPOIs();
|
||||
void closeFiles();
|
||||
@ -128,9 +132,11 @@ private:
|
||||
QToolBar *_showToolBar;
|
||||
QToolBar *_navigationToolBar;
|
||||
QMenu *_poiFilesMenu;
|
||||
QMenu *_mapMenu;
|
||||
|
||||
QActionGroup *_fileActionGroup;
|
||||
QActionGroup *_navigationActionGroup;
|
||||
QActionGroup *_mapsActionGroup;
|
||||
QAction *_exitAction;
|
||||
QAction *_keysAction;
|
||||
QAction *_dataSourcesAction;
|
||||
@ -148,6 +154,7 @@ private:
|
||||
QAction *_showPOILabelsAction;
|
||||
QAction *_showMapAction;
|
||||
QAction *_fullscreenAction;
|
||||
QAction *_loadMapAction;
|
||||
QAction *_clearMapCacheAction;
|
||||
QAction *_showGraphsAction;
|
||||
QAction *_showGraphGridAction;
|
||||
@ -170,10 +177,12 @@ private:
|
||||
QAction *_showWaypointLabelsAction;
|
||||
QAction *_showRouteWaypointsAction;
|
||||
QAction *_openOptionsAction;
|
||||
QAction *_mapsEnd;
|
||||
QList<QAction*> _mapActions;
|
||||
QList<QAction*> _poiFilesActions;
|
||||
|
||||
QSignalMapper *_poiFilesSM;
|
||||
QSignalMapper *_poiFilesSignalMapper;
|
||||
QSignalMapper *_mapsSignalMapper;
|
||||
|
||||
QLabel *_fileNameLabel;
|
||||
QLabel *_distanceLabel;
|
||||
@ -184,7 +193,7 @@ private:
|
||||
QList<GraphTab*> _tabs;
|
||||
|
||||
POI *_poi;
|
||||
QList<Map*> _maps;
|
||||
MapList *_ml;
|
||||
|
||||
FileBrowser *_browser;
|
||||
QList<QString> _files;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#define CLOSE_FILE_ICON ":/icons/dialog-close.png"
|
||||
#define SHOW_POI_ICON ":/icons/flag.png"
|
||||
#define SHOW_MAP_ICON ":/icons/applications-internet.png"
|
||||
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line-stacked.png"
|
||||
#define SHOW_GRAPHS_ICON ":/icons/office-chart-line.png"
|
||||
#define QUIT_ICON ":/icons/application-exit.png"
|
||||
#define RELOAD_FILE_ICON ":/icons/view-refresh.png"
|
||||
#define NEXT_FILE_ICON ":/icons/arrow-right.png"
|
||||
@ -24,5 +24,6 @@
|
||||
#define POI_ICON ":/icons/flag_48.png"
|
||||
#define SYSTEM_ICON ":/icons/system-run.png"
|
||||
#define PRINT_EXPORT_ICON ":/icons/document-print-preview.png"
|
||||
#define DATA_ICON ":/icons/view-filter.png"
|
||||
|
||||
#endif /* ICONS_H */
|
||||
|
@ -10,6 +10,9 @@
|
||||
#define LAST_KEY Qt::Key_End
|
||||
#define MODIFIER Qt::ShiftModifier
|
||||
|
||||
#define ZOOM_IN QKeySequence::ZoomIn
|
||||
#define ZOOM_OUT QKeySequence::ZoomOut
|
||||
|
||||
#define QUIT_SHORTCUT QKeySequence(QKeySequence::Quit)
|
||||
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
||||
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
||||
@ -22,6 +25,7 @@
|
||||
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
||||
#define DISTANCE_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D)
|
||||
#define TIME_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T)
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
||||
#else // Q_OS_MAC
|
||||
|
81
src/lambertconic.cpp
Normal file
81
src/lambertconic.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include <cmath>
|
||||
#include "rd.h"
|
||||
#include "lambertconic.h"
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#endif // M_PI_2
|
||||
#ifndef M_PI_4
|
||||
#define M_PI_4 0.78539816339744830962
|
||||
#endif // M_PI_4
|
||||
|
||||
static double q(const Ellipsoid &el, double b)
|
||||
{
|
||||
double e = sqrt(el.flattening() * (2. - el.flattening()));
|
||||
double esb = e * sin(b);
|
||||
return log(tan(M_PI_4 + b / 2.) * pow((1. - esb) / (1. + esb), e / 2.));
|
||||
}
|
||||
|
||||
static double iq(const Ellipsoid &el, double q)
|
||||
{
|
||||
double e = sqrt(el.flattening() * (2. - el.flattening()));
|
||||
double b0 = 0.;
|
||||
double b = 2. * atan(exp(q)) - M_PI_2;
|
||||
|
||||
do {
|
||||
b0 = b;
|
||||
double esb = e * sin(b);
|
||||
b = 2. * atan(exp(q) * pow((1. - esb) / (1. + esb), -e / 2.)) - M_PI_2;
|
||||
} while (fabs(b - b0) > 1e-10);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
static double nradius(const Ellipsoid &el, double phi)
|
||||
{
|
||||
double sin_phi = sin(phi);
|
||||
return (el.radius() / sqrt(1. - (el.flattening() * (2. - el.flattening()))
|
||||
* sin_phi * sin_phi));
|
||||
}
|
||||
|
||||
LambertConic::LambertConic(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double scale, double falseEasting, double falseNorthing) : _e(ellipsoid)
|
||||
{
|
||||
_cm = longitudeOrigin;
|
||||
_fe = falseEasting;
|
||||
_fn = falseNorthing;
|
||||
|
||||
double sp1 = deg2rad(standardParallel1);
|
||||
double sp2 = deg2rad(standardParallel2);
|
||||
|
||||
double N1 = nradius(_e, sp1);
|
||||
double N2 = nradius(_e, sp2);
|
||||
|
||||
_q0 = q(_e, deg2rad(latitudeOrigin));
|
||||
double q1 = q(_e, sp1);
|
||||
double q2 = q(_e, sp2);
|
||||
|
||||
_n = log((N1 * cos(sp1)) / (N2 * cos(sp2))) / (q2 - q1);
|
||||
double R1 = N1 * cos(sp1) / _n;
|
||||
_R0 = scale * R1 * exp(_n * (q1 - _q0));
|
||||
}
|
||||
|
||||
QPointF LambertConic::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
double dl = _n * (deg2rad(c.lon()) - deg2rad(_cm));
|
||||
double R = _R0 * exp(_n * (_q0 - q(_e, deg2rad(c.lat()))));
|
||||
|
||||
return QPointF(_fe + R * sin(dl), _fn + _R0 - R * cos(dl));
|
||||
}
|
||||
|
||||
Coordinates LambertConic::xy2ll(const QPointF &p) const
|
||||
{
|
||||
double dl = atan((p.x() - _fe) / (_fn + _R0 - p.y()));
|
||||
double dx = p.x() - _fe;
|
||||
double dy = p.y() - _fn - _R0;
|
||||
double R = sqrt(dx * dx + dy * dy);
|
||||
double q = _q0 - log(R / _R0) / _n;
|
||||
|
||||
return Coordinates(rad2deg(deg2rad(_cm) + dl / _n), rad2deg(iq(_e, q)));
|
||||
}
|
29
src/lambertconic.h
Normal file
29
src/lambertconic.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef LAMBERTCONIC_H
|
||||
#define LAMBERTCONIC_H
|
||||
|
||||
#include "ellipsoid.h"
|
||||
#include "projection.h"
|
||||
|
||||
class LambertConic : public Projection
|
||||
{
|
||||
public:
|
||||
LambertConic(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double scale, double falseEasting, double falseNorthing);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
|
||||
private:
|
||||
Ellipsoid _e;
|
||||
|
||||
double _cm;
|
||||
double _fe;
|
||||
double _fn;
|
||||
|
||||
double _q0;
|
||||
double _R0;
|
||||
double _n;
|
||||
};
|
||||
|
||||
#endif // LAMBERTCONIC_H
|
@ -25,8 +25,8 @@ public:
|
||||
virtual qreal zoomIn() = 0;
|
||||
virtual qreal zoomOut() = 0;
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const = 0;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const = 0;
|
||||
virtual QPointF ll2xy(const Coordinates &c) = 0;
|
||||
virtual Coordinates xy2ll(const QPointF &p) = 0;
|
||||
|
||||
virtual void draw(QPainter *painter, const QRectF &rect) = 0;
|
||||
|
||||
|
@ -1,40 +0,0 @@
|
||||
#include <QDir>
|
||||
#include "atlas.h"
|
||||
#include "offlinemap.h"
|
||||
#include "mapdir.h"
|
||||
|
||||
QList<Map*> MapDir::load(const QString &path, QObject *parent)
|
||||
{
|
||||
QList<Map*> maps;
|
||||
QDir dir(path);
|
||||
|
||||
|
||||
if (!dir.exists())
|
||||
return maps;
|
||||
|
||||
if (!dir.isReadable()) {
|
||||
qWarning("Map directory not readable: %s\n", qPrintable(path));
|
||||
return maps;
|
||||
}
|
||||
|
||||
QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
QFileInfo fileInfo = list.at(i);
|
||||
|
||||
Atlas *atlas = new Atlas(fileInfo.absoluteFilePath(), parent);
|
||||
if (atlas->isValid())
|
||||
maps.append(atlas);
|
||||
else {
|
||||
delete atlas;
|
||||
|
||||
OfflineMap *map = new OfflineMap(fileInfo.absoluteFilePath(),
|
||||
parent);
|
||||
if (map->isValid())
|
||||
maps.append(map);
|
||||
else
|
||||
delete map;
|
||||
}
|
||||
}
|
||||
|
||||
return maps;
|
||||
}
|
16
src/mapdir.h
16
src/mapdir.h
@ -1,16 +0,0 @@
|
||||
#ifndef MAPDIR_H
|
||||
#define MAPDIR_H
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
class QObject;
|
||||
class Map;
|
||||
|
||||
class MapDir
|
||||
{
|
||||
public:
|
||||
static QList<Map*> load(const QString &path, QObject *parent = 0);
|
||||
};
|
||||
|
||||
#endif // MAPDIR_H
|
101
src/maplist.cpp
101
src/maplist.cpp
@ -1,41 +1,100 @@
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include "atlas.h"
|
||||
#include "offlinemap.h"
|
||||
#include "onlinemap.h"
|
||||
#include "maplist.h"
|
||||
|
||||
|
||||
QList<Map*> MapList::load(const QString &fileName, QObject *parent)
|
||||
bool MapList::loadListEntry(const QByteArray &line)
|
||||
{
|
||||
QList<Map*> maps;
|
||||
QFileInfo fi(fileName);
|
||||
QList<QByteArray> list = line.split('\t');
|
||||
if (list.size() != 2)
|
||||
return false;
|
||||
|
||||
if (!fi.exists())
|
||||
return maps;
|
||||
QByteArray ba1 = list[0].trimmed();
|
||||
QByteArray ba2 = list[1].trimmed();
|
||||
if (ba1.isEmpty() || ba2.isEmpty())
|
||||
return false;
|
||||
|
||||
QFile file(fileName);
|
||||
_maps.append(new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
|
||||
QString::fromLatin1(ba2.data(), ba2.size()), this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapList::loadList(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
qWarning("Error opening map list file: %s: %s\n",
|
||||
qPrintable(fileName), qPrintable(file.errorString()));
|
||||
return maps;
|
||||
_errorString = file.errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
int ln = 0;
|
||||
while (!file.atEnd()) {
|
||||
ln++;
|
||||
QByteArray line = file.readLine();
|
||||
QList<QByteArray> list = line.split('\t');
|
||||
if (list.size() != 2) {
|
||||
qWarning("Invalid map list entry on line %d\n", ln);
|
||||
continue;
|
||||
|
||||
if (!loadListEntry(line)) {
|
||||
_errorString = QString("Invalid map list entry on line %1.")
|
||||
.arg(QString::number(ln));
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray ba1 = list[0].trimmed();
|
||||
QByteArray ba2 = list[1].trimmed();
|
||||
|
||||
maps.append(new OnlineMap(QString::fromUtf8(ba1.data(), ba1.size()),
|
||||
QString::fromLatin1(ba2.data(), ba2.size()), parent));
|
||||
}
|
||||
|
||||
return maps;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapList::loadMap(const QString &path)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
QString suffix = fi.suffix().toLower();
|
||||
|
||||
if (suffix == "map") {
|
||||
OfflineMap *om = new OfflineMap(path, this);
|
||||
if (om->isValid()) {
|
||||
_maps.append(om);
|
||||
return true;
|
||||
} else {
|
||||
_errorString = om->errorString();
|
||||
delete om;
|
||||
return false;
|
||||
}
|
||||
} 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";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,28 @@
|
||||
#ifndef MAPLIST_H
|
||||
#define MAPLIST_H
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include "map.h"
|
||||
|
||||
class QObject;
|
||||
class Map;
|
||||
|
||||
class MapList
|
||||
class MapList : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static QList<Map*> load(const QString &fileName, QObject *parent = 0);
|
||||
MapList(QObject *parent = 0) : QObject(parent) {}
|
||||
|
||||
bool loadMap(const QString &path);
|
||||
bool loadList(const QString &path);
|
||||
|
||||
QList<Map*> &maps() {return _maps;}
|
||||
const QString &errorString() const {return _errorString;}
|
||||
|
||||
private:
|
||||
bool loadListEntry(const QByteArray &line);
|
||||
|
||||
QList<Map*> _maps;
|
||||
QString _errorString;
|
||||
};
|
||||
|
||||
#endif // MAPLIST_H
|
||||
|
@ -3,6 +3,9 @@
|
||||
|
||||
#include <QRectF>
|
||||
|
||||
#define ARRAY_SIZE(array) \
|
||||
(sizeof(array) / sizeof((array)[0]))
|
||||
|
||||
double niceNum(double x, int round);
|
||||
int str2int(const char *str, int len);
|
||||
QRectF scaled(const QRectF &rect, qreal factor);
|
||||
|
20
src/oddspinbox.cpp
Normal file
20
src/oddspinbox.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "oddspinbox.h"
|
||||
|
||||
OddSpinBox::OddSpinBox(QWidget *parent) : QSpinBox(parent)
|
||||
{
|
||||
setSingleStep(2);
|
||||
setMinimum(1);
|
||||
}
|
||||
|
||||
QValidator::State OddSpinBox::validate(QString &text, int &pos) const
|
||||
{
|
||||
Q_UNUSED(pos);
|
||||
bool ok;
|
||||
int val;
|
||||
|
||||
val = text.toInt(&ok);
|
||||
if (!ok || val < 0 || val % 2 == 0)
|
||||
return QValidator::Invalid;
|
||||
|
||||
return QValidator::Acceptable;
|
||||
}
|
15
src/oddspinbox.h
Normal file
15
src/oddspinbox.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef ODDSPINBOX_H
|
||||
#define ODDSPINBOX_H
|
||||
|
||||
#include <QSpinBox>
|
||||
|
||||
class OddSpinBox : public QSpinBox
|
||||
{
|
||||
public:
|
||||
OddSpinBox(QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
QValidator::State validate(QString &text, int &pos) const;
|
||||
};
|
||||
|
||||
#endif // ODDSPINBOX_H
|
@ -12,31 +12,68 @@
|
||||
#include "wgs84.h"
|
||||
#include "coordinates.h"
|
||||
#include "matrix.h"
|
||||
#include "datum.h"
|
||||
#include "latlon.h"
|
||||
#include "mercator.h"
|
||||
#include "transversemercator.h"
|
||||
#include "utm.h"
|
||||
#include "lambertconic.h"
|
||||
#include "albersequal.h"
|
||||
#include "ozf.h"
|
||||
#include "offlinemap.h"
|
||||
|
||||
|
||||
int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup)
|
||||
// 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,
|
||||
QString &projection, ProjectionSetup &setup, QString &datum)
|
||||
{
|
||||
bool res;
|
||||
int ln = 1;
|
||||
|
||||
|
||||
if (!device.open(QIODevice::ReadOnly))
|
||||
return -1;
|
||||
|
||||
while (!device.atEnd()) {
|
||||
QByteArray line = device.readLine();
|
||||
|
||||
if (ln == 1) {
|
||||
if (!line.trimmed().startsWith("OziExplorer Map Data File"))
|
||||
return ln;
|
||||
} else if (ln == 3)
|
||||
} else if (ln == 2)
|
||||
_name = line.trimmed();
|
||||
else if (ln == 3)
|
||||
_imgPath = line.trimmed();
|
||||
else if (ln == 5)
|
||||
datum = line.split(',').at(0).trimmed();
|
||||
else {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
QString key(list.at(0).trimmed());
|
||||
@ -63,14 +100,18 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
qreal lonm = list.at(10).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
ll = false;
|
||||
if (ll && list.at(8).trimmed() == "S")
|
||||
if (ll && list.at(8).trimmed() == "S") {
|
||||
latd = -latd;
|
||||
if (ll && list.at(11).trimmed() == "W")
|
||||
latm = -latm;
|
||||
}
|
||||
if (ll && list.at(11).trimmed() == "W") {
|
||||
lond = -lond;
|
||||
lonm = -lonm;
|
||||
}
|
||||
|
||||
int zone = list.at(13).trimmed().toInt(&res);
|
||||
setup.zone = list.at(13).trimmed().toInt(&res);
|
||||
if (!res)
|
||||
zone = 0;
|
||||
setup.zone = 0;
|
||||
qreal ppx = list.at(14).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
pp = false;
|
||||
@ -78,16 +119,18 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
if (!res)
|
||||
pp = false;
|
||||
if (list.at(16).trimmed() == "S")
|
||||
zone = -zone;
|
||||
setup.zone = -setup.zone;
|
||||
|
||||
ReferencePoint p;
|
||||
p.xy = QPoint(x, y);
|
||||
if (ll) {
|
||||
p.ll = Coordinates(lond + lonm/60.0, latd + latm/60.0);
|
||||
points.append(p);
|
||||
if (p.ll.isValid())
|
||||
points.append(p);
|
||||
else
|
||||
return ln;
|
||||
} else if (pp) {
|
||||
p.pp = QPointF(ppx, ppy);
|
||||
setup.zone = zone;
|
||||
points.append(p);
|
||||
} else
|
||||
return ln;
|
||||
@ -104,18 +147,27 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
} else if (key == "Projection Setup") {
|
||||
if (list.count() < 8)
|
||||
return ln;
|
||||
setup.centralMeridian = list.at(2).trimmed().toFloat(&res);
|
||||
setup.latitudeOrigin = list.at(1).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.centralMeridian = 0;
|
||||
setup.latitudeOrigin = 0;
|
||||
setup.longitudeOrigin = list.at(2).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.longitudeOrigin = 0;
|
||||
setup.scale = list.at(3).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.scale = 0;
|
||||
setup.scale = 1.0;
|
||||
setup.falseEasting = list.at(4).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.falseEasting = 0;
|
||||
setup.falseNorthing = list.at(5).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.falseNorthing = 0;
|
||||
setup.standardParallel1 = list.at(6).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.standardParallel1 = 0;
|
||||
setup.standardParallel2 = list.at(7).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.standardParallel2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,47 +177,109 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool OfflineMap::createProjection(const QString &projection,
|
||||
const ProjectionSetup &setup, QList<ReferencePoint> &points)
|
||||
bool OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup, QString &datum)
|
||||
{
|
||||
int el;
|
||||
|
||||
if (!device.open(QIODevice::ReadOnly)) {
|
||||
_errorString = QString("Error opening map file: %1")
|
||||
.arg(device.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((el = parse(device, points, projection, setup, datum))) {
|
||||
_errorString = QString("Map file parse error on line %1").arg(el);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OfflineMap::createProjection(const QString &datum,
|
||||
const QString &projection, const ProjectionSetup &setup,
|
||||
QList<ReferencePoint> &points)
|
||||
{
|
||||
if (points.count() < 2) {
|
||||
qWarning("%s: insufficient number of reference points",
|
||||
qPrintable(_name));
|
||||
_errorString = "Insufficient number of reference points";
|
||||
return false;
|
||||
}
|
||||
|
||||
Datum d = Datum::datum(datum);
|
||||
if (d.isNull()) {
|
||||
_errorString = QString("%1: Unknown datum").arg(datum);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (setup.latitudeOrigin < -90.0 || setup.latitudeOrigin > 90.0
|
||||
|| setup.longitudeOrigin < -180.0 || setup.longitudeOrigin > 180.0
|
||||
|| setup.standardParallel1 < -90 || setup.standardParallel1 > 90
|
||||
|| setup.standardParallel2 < -90 || setup.standardParallel2 > 90) {
|
||||
_errorString = "Invalid projection setup";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (projection == "Mercator")
|
||||
_projection = new Mercator();
|
||||
else if (projection == "Transverse Mercator")
|
||||
_projection = new TransverseMercator(setup.centralMeridian, setup.scale,
|
||||
_projection = new TransverseMercator(d.ellipsoid(),
|
||||
setup.latitudeOrigin, setup.longitudeOrigin, setup.scale,
|
||||
setup.falseEasting, setup.falseNorthing);
|
||||
else if (projection == "Latitude/Longitude")
|
||||
_projection = new LatLon();
|
||||
else if (projection == "Lambert Conformal Conic")
|
||||
_projection = new LambertConic(d.ellipsoid(),
|
||||
setup.standardParallel1, setup.standardParallel2,
|
||||
setup.latitudeOrigin, setup.longitudeOrigin, setup.scale,
|
||||
setup.falseEasting, setup.falseNorthing);
|
||||
else if (projection == "Albers Equal Area")
|
||||
_projection = new AlbersEqual(d.ellipsoid(), setup.standardParallel1,
|
||||
setup.standardParallel2, setup.latitudeOrigin, setup.longitudeOrigin,
|
||||
setup.falseEasting, setup.falseNorthing);
|
||||
else if (projection == "(UTM) Universal Transverse Mercator") {
|
||||
if (setup.zone)
|
||||
_projection = new UTM(setup.zone);
|
||||
_projection = new UTM(d.ellipsoid(), setup.zone);
|
||||
else if (!points.first().ll.isNull())
|
||||
_projection = new UTM(points.first().ll);
|
||||
_projection = new UTM(d.ellipsoid(), points.first().ll);
|
||||
else {
|
||||
qWarning("%s: Can not determine UTM zone", qPrintable(_name));
|
||||
_errorString = "Can not determine UTM zone";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
qWarning("%s: %s: unsupported map projection", qPrintable(_name),
|
||||
qPrintable(projection));
|
||||
} else if (projection == "(NZTM2) New Zealand TM 2000")
|
||||
_projection = new TransverseMercator(d.ellipsoid(), 0, 173.0, 0.9996,
|
||||
1600000, 10000000);
|
||||
else if (projection == "(BNG) British National Grid")
|
||||
_projection = new TransverseMercator(d.ellipsoid(), 49, -2, 0.999601,
|
||||
400000, -100000);
|
||||
else if (projection == "(IG) Irish Grid")
|
||||
_projection = new TransverseMercator(d.ellipsoid(), 53.5, -8, 1.000035,
|
||||
200000, 250000);
|
||||
else if (projection == "(SG) Swedish Grid")
|
||||
_projection = new TransverseMercator(d.ellipsoid(), 0, 15.808278, 1,
|
||||
1500000, 0);
|
||||
else {
|
||||
_errorString = QString("%1: Unknown map projection").arg(projection);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < points.size(); i++)
|
||||
if (points.at(i).ll.isNull())
|
||||
points[i].ll = _projection->xy2ll(points.at(i).pp);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
if (points.at(i).ll.isNull()) {
|
||||
if (d.isWGS84())
|
||||
points[i].ll = _projection->xy2ll(points.at(i).pp);
|
||||
else
|
||||
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;
|
||||
}
|
||||
|
||||
bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
||||
{
|
||||
Q_ASSERT(points.count() >= 2);
|
||||
Q_ASSERT(points.size() >= 2);
|
||||
|
||||
Matrix c(3, 2);
|
||||
c.zeroize();
|
||||
@ -201,12 +315,13 @@ bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
||||
|
||||
Matrix M = Q.augemented(c);
|
||||
if (!M.eliminate()) {
|
||||
qWarning("%s: singular transformation matrix", qPrintable(_name));
|
||||
_errorString = "Singular transformation matrix";
|
||||
return false;
|
||||
}
|
||||
|
||||
_transform = QTransform(M.m(0,3), M.m(0,4), M.m(1,3), M.m(1,4), M.m(2,3),
|
||||
M.m(2,4));
|
||||
_inverted = _transform.inverted();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -242,14 +357,41 @@ bool OfflineMap::computeResolution(QList<ReferencePoint> &points)
|
||||
bool OfflineMap::getImageInfo(const QString &path)
|
||||
{
|
||||
QFileInfo ii(_imgPath);
|
||||
if (ii.isRelative())
|
||||
_imgPath = path + "/" + _imgPath;
|
||||
|
||||
QImageReader img(_imgPath);
|
||||
_size = img.size();
|
||||
if (ii.isRelative())
|
||||
ii.setFile(path + "/" + _imgPath);
|
||||
|
||||
if (!ii.exists()) {
|
||||
int last = _imgPath.lastIndexOf('\\');
|
||||
if (last >= 0 && last < _imgPath.length() - 1) {
|
||||
QStringRef fn(&_imgPath, last + 1, _imgPath.length() - last - 1);
|
||||
ii.setFile(path + "/" + fn.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (ii.exists())
|
||||
_imgPath = ii.absoluteFilePath();
|
||||
else {
|
||||
_errorString = QString("%1: No such image file").arg(_imgPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
QString suffix = ii.suffix().toLower();
|
||||
if (suffix == "ozf4" || suffix == "ozfx4") {
|
||||
_errorString = QString("%1: OZF4 image files not supported")
|
||||
.arg(QFileInfo(_imgPath).fileName());
|
||||
return false;
|
||||
} else if (suffix == "ozf2" || suffix == "ozfx2" || suffix == "ozf3"
|
||||
|| suffix == "ozfx3") {
|
||||
_ozf.load(_imgPath);
|
||||
_size = _ozf.size();
|
||||
} else {
|
||||
QImageReader img(_imgPath);
|
||||
_size = img.size();
|
||||
}
|
||||
if (!_size.isValid()) {
|
||||
qWarning("%s: %s: error reading map image", qPrintable(_name),
|
||||
qPrintable(ii.absoluteFilePath()));
|
||||
_errorString = QString("%1: Error reading map image")
|
||||
.arg(QFileInfo(_imgPath).fileName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -258,11 +400,6 @@ bool OfflineMap::getImageInfo(const QString &path)
|
||||
|
||||
bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path)
|
||||
{
|
||||
if (tiles.isEmpty()) {
|
||||
qWarning("%s: empty tile set", qPrintable(_name));
|
||||
return false;
|
||||
}
|
||||
|
||||
QRegExp rx("_[0-9]+_[0-9]+\\.");
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
if (tiles.at(i).contains(rx)) {
|
||||
@ -277,9 +414,8 @@ bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path)
|
||||
_tileSize = QImageReader(path + "/" + tiles.at(i)).size();
|
||||
}
|
||||
if (!_tileSize.isValid()) {
|
||||
qWarning("%s: error retrieving tile size: %s: invalid image",
|
||||
qPrintable(_name), qPrintable(QFileInfo(tiles.at(i))
|
||||
.fileName()));
|
||||
_errorString = QString("Error retrieving tile size: "
|
||||
"%1: Invalid image").arg(QFileInfo(tiles.at(i)).fileName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -287,82 +423,59 @@ bool OfflineMap::getTileInfo(const QStringList &tiles, const QString &path)
|
||||
}
|
||||
}
|
||||
|
||||
qWarning("%s: invalid tile names", qPrintable(_name));
|
||||
|
||||
_errorString = "Invalid/missing tile set";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OfflineMap::mapLoaded(int res)
|
||||
{
|
||||
if (res) {
|
||||
if (res == -2)
|
||||
qWarning("%s: no map file found", qPrintable(_name));
|
||||
else if (res == -1)
|
||||
qWarning("%s: error opening map file", qPrintable(_name));
|
||||
else
|
||||
qWarning("%s: map file parse error on line: %d", qPrintable(_name),
|
||||
res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OfflineMap::totalSizeSet()
|
||||
{
|
||||
if (!_size.isValid()) {
|
||||
qWarning("%s: missing total image size (IWH)", qPrintable(_name));
|
||||
_errorString = "Missing total image size (IWH)";
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
}
|
||||
|
||||
OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
OfflineMap::OfflineMap(const QString &fileName, QObject *parent)
|
||||
: Map(parent)
|
||||
{
|
||||
int errorLine = -2;
|
||||
QList<ReferencePoint> points;
|
||||
QString proj;
|
||||
QString proj, datum;
|
||||
ProjectionSetup setup;
|
||||
QFileInfo fi(fileName);
|
||||
QString suffix = fi.suffix().toLower();
|
||||
|
||||
|
||||
_valid = false;
|
||||
_img = 0;
|
||||
_projection = 0;
|
||||
_resolution = 0;
|
||||
|
||||
QFileInfo fi(path);
|
||||
_name = fi.fileName();
|
||||
|
||||
QDir dir(path);
|
||||
QFileInfoList mapFiles = dir.entryInfoList(QDir::Files);
|
||||
for (int i = 0; i < mapFiles.count(); i++) {
|
||||
const QString &fileName = mapFiles.at(i).fileName();
|
||||
if (fileName.endsWith(".tar")) {
|
||||
if (!_tar.load(mapFiles.at(i).absoluteFilePath())) {
|
||||
qWarning("%s: %s: error loading tar file", qPrintable(_name),
|
||||
qPrintable(fileName));
|
||||
return;
|
||||
}
|
||||
QStringList tarFiles = _tar.files();
|
||||
for (int j = 0; j < tarFiles.size(); j++) {
|
||||
if (tarFiles.at(j).endsWith(".map")) {
|
||||
QByteArray ba = _tar.file(tarFiles.at(j));
|
||||
QBuffer buffer(&ba);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup);
|
||||
_imgPath = QString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else if (fileName.endsWith(".map")) {
|
||||
QFile mapFile(mapFiles.at(i).absoluteFilePath());
|
||||
errorLine = parseMapFile(mapFile, points, proj, setup);
|
||||
break;
|
||||
if (suffix == "tar") {
|
||||
if (!_tar.load(fileName)) {
|
||||
_errorString = "Error reading tar file";
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!mapLoaded(errorLine))
|
||||
return;
|
||||
|
||||
if (!createProjection(proj, setup, points))
|
||||
QString mapFileName = fi.completeBaseName() + ".map";
|
||||
QByteArray ba = _tar.file(mapFileName);
|
||||
if (ba.isNull()) {
|
||||
_errorString = "Map file not found";
|
||||
return;
|
||||
}
|
||||
QBuffer mapFile(&ba);
|
||||
if (!parseMapFile(mapFile, points, proj, setup, datum))
|
||||
return;
|
||||
} else if (suffix =="map") {
|
||||
QFile mapFile(fileName);
|
||||
if (!parseMapFile(mapFile, points, proj, setup, datum))
|
||||
return;
|
||||
} else {
|
||||
_errorString = "Not a map file";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!createProjection(datum, proj, setup, points))
|
||||
return;
|
||||
if (!computeTransformation(points))
|
||||
return;
|
||||
@ -373,16 +486,17 @@ OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
return;
|
||||
if (!getTileInfo(_tar.files()))
|
||||
return;
|
||||
_imgPath = QString();
|
||||
} else {
|
||||
QDir set(fi.absoluteFilePath() + "/" + "set");
|
||||
QDir set(fi.absolutePath() + "/" + "set");
|
||||
if (set.exists()) {
|
||||
if (!totalSizeSet())
|
||||
return;
|
||||
if (!getTileInfo(set.entryList(), set.canonicalPath()))
|
||||
if (!getTileInfo(set.entryList(), set.absolutePath()))
|
||||
return;
|
||||
_imgPath = QString();
|
||||
} else {
|
||||
if (!getImageInfo(fi.absoluteFilePath()))
|
||||
if (!getImageInfo(fi.absolutePath()))
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -390,37 +504,32 @@ OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
OfflineMap::OfflineMap(Tar &tar, const QString &path, QObject *parent)
|
||||
OfflineMap::OfflineMap(const QString &fileName, Tar &tar, QObject *parent)
|
||||
: Map(parent)
|
||||
{
|
||||
int errorLine = -2;
|
||||
QList<ReferencePoint> points;
|
||||
QString proj;
|
||||
QString proj, datum;
|
||||
ProjectionSetup setup;
|
||||
|
||||
QFileInfo fi(fileName);
|
||||
|
||||
_valid = false;
|
||||
_img = 0;
|
||||
_projection = 0;
|
||||
|
||||
QFileInfo fi(path);
|
||||
_name = fi.fileName();
|
||||
|
||||
QFileInfo li(fi.absoluteDir().dirName());
|
||||
QString prefix = li.fileName() + "/" + fi.fileName() + "/";
|
||||
QStringList tarFiles = tar.files();
|
||||
for (int j = 0; j < tarFiles.size(); j++) {
|
||||
if (tarFiles.at(j).startsWith(prefix)) {
|
||||
QByteArray ba = tar.file(tarFiles.at(j));
|
||||
QBuffer buffer(&ba);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!mapLoaded(errorLine))
|
||||
QFileInfo map(fi.absolutePath());
|
||||
QFileInfo layer(map.absolutePath());
|
||||
QString mapFile = layer.fileName() + "/" + map.fileName() + "/"
|
||||
+ fi.fileName();
|
||||
QByteArray ba = tar.file(mapFile);
|
||||
if (ba.isNull()) {
|
||||
_errorString = "Map file not found";
|
||||
return;
|
||||
}
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
if (!createProjection(proj, setup, points))
|
||||
if (!parseMapFile(buffer, points, proj, setup, datum))
|
||||
return;
|
||||
if (!createProjection(datum, proj, setup, points))
|
||||
return;
|
||||
if (!totalSizeSet())
|
||||
return;
|
||||
@ -428,14 +537,8 @@ OfflineMap::OfflineMap(Tar &tar, const QString &path, QObject *parent)
|
||||
return;
|
||||
computeResolution(points);
|
||||
|
||||
QDir dir(path);
|
||||
QFileInfoList mapFiles = dir.entryInfoList(QDir::Files);
|
||||
for (int i = 0; i < mapFiles.count(); i++) {
|
||||
const QString &fileName = mapFiles.at(i).absoluteFilePath();
|
||||
if (fileName.endsWith(".tar"))
|
||||
_tarPath = fileName;
|
||||
}
|
||||
|
||||
_tarPath = fi.absolutePath() + "/" + fi.completeBaseName() + ".tar";
|
||||
_imgPath = QString();
|
||||
_valid = true;
|
||||
}
|
||||
@ -452,15 +555,15 @@ void OfflineMap::load()
|
||||
{
|
||||
if (!_tarPath.isNull() && !_tileSize.isValid()) {
|
||||
if (!_tar.load(_tarPath)) {
|
||||
qWarning("%s: %s: error loading tar file", qPrintable(_name),
|
||||
qPrintable(_tarPath));
|
||||
qWarning("%s: error loading tar file", qPrintable(_tarPath));
|
||||
return;
|
||||
}
|
||||
getTileInfo(_tar.files());
|
||||
if (!getTileInfo(_tar.files()))
|
||||
qWarning("%s: %s", qPrintable(_tarPath), qPrintable(_errorString));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_img && !_imgPath.isNull()) {
|
||||
if (!_img && !_imgPath.isNull() && !_ozf.isOpen()) {
|
||||
_img = new QImage(_imgPath);
|
||||
if (_img->isNull())
|
||||
qWarning("%s: error loading map image", qPrintable(_imgPath));
|
||||
@ -475,104 +578,100 @@ void OfflineMap::unload()
|
||||
}
|
||||
}
|
||||
|
||||
QRectF OfflineMap::bounds() const
|
||||
void OfflineMap::drawTiled(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return QRectF(QPointF(0, 0), _size);
|
||||
}
|
||||
QPoint tl = QPoint((int)floor(rect.left() / (qreal)_tileSize.width())
|
||||
* _tileSize.width(), (int)floor(rect.top() / _tileSize.height())
|
||||
* _tileSize.height());
|
||||
|
||||
qreal OfflineMap::zoomFit(const QSize &size, const QRectF &br)
|
||||
{
|
||||
Q_UNUSED(size);
|
||||
Q_UNUSED(br);
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _tileSize.width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _tileSize.height()); j++) {
|
||||
int x = tl.x() + i * _tileSize.width();
|
||||
int y = tl.y() + j * _tileSize.height();
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
qreal OfflineMap::resolution(const QPointF &p) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
|
||||
return _resolution;
|
||||
}
|
||||
|
||||
qreal OfflineMap::zoomIn()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
qreal OfflineMap::zoomOut()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
void OfflineMap::draw(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
if (_tileSize.isValid()) {
|
||||
QPoint tl = QPoint((int)floor(rect.left() / (qreal)_tileSize.width())
|
||||
* _tileSize.width(), (int)floor(rect.top() / _tileSize.height())
|
||||
* _tileSize.height());
|
||||
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _tileSize.width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _tileSize.height()); j++) {
|
||||
int x = tl.x() + i * _tileSize.width();
|
||||
int y = tl.y() + j * _tileSize.height();
|
||||
QString tileName(_tileName.arg(QString::number(x),
|
||||
QString::number(y)));
|
||||
QPixmap pixmap;
|
||||
|
||||
if (_tar.isOpen()) {
|
||||
QString key = _tar.fileName() + "/" + tileName;
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
QByteArray ba = _tar.file(tileName);
|
||||
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
} else
|
||||
pixmap = QPixmap(tileName);
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(
|
||||
_tileName.arg(QString::number(x), QString::number(y))));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize),
|
||||
Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!_img || _img->isNull())
|
||||
painter->fillRect(rect, Qt::white);
|
||||
else {
|
||||
QPoint p = rect.topLeft().toPoint();
|
||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
||||
painter->drawImage(rect.topLeft(), crop);
|
||||
|
||||
QString tileName(_tileName.arg(QString::number(x),
|
||||
QString::number(y)));
|
||||
QPixmap pixmap;
|
||||
|
||||
if (_tar.isOpen()) {
|
||||
QString key = _tar.fileName() + "/" + tileName;
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
QByteArray ba = _tar.file(tileName);
|
||||
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
} else
|
||||
pixmap = QPixmap(tileName);
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(
|
||||
_tileName.arg(QString::number(x), QString::number(y))));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPointF OfflineMap::ll2xy(const Coordinates &c) const
|
||||
void OfflineMap::drawOZF(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _transform.map(_projection->ll2xy(c));
|
||||
QPoint tl = QPoint((int)floor(rect.left() / _ozf.tileSize().width())
|
||||
* _ozf.tileSize().width(), (int)floor(rect.top()
|
||||
/ _ozf.tileSize().height()) * _ozf.tileSize().height());
|
||||
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _ozf.tileSize().width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _ozf.tileSize().height()); j++) {
|
||||
int x = tl.x() + i * _ozf.tileSize().width();
|
||||
int y = tl.y() + j * _ozf.tileSize().height();
|
||||
|
||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
continue;
|
||||
}
|
||||
|
||||
QPixmap pixmap;
|
||||
QString key = _ozf.fileName() + "/" + QString::number(x)
|
||||
+ "_" + QString::number(y);
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
pixmap = _ozf.tile(x, y);
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(key));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Coordinates OfflineMap::xy2ll(const QPointF &p) const
|
||||
void OfflineMap::drawImage(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _projection->xy2ll(_transform.inverted().map(p));
|
||||
if (!_img || _img->isNull())
|
||||
painter->fillRect(rect, Qt::white);
|
||||
else {
|
||||
QPoint p = rect.topLeft().toPoint();
|
||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
||||
painter->drawImage(rect.topLeft(), crop);
|
||||
}
|
||||
}
|
||||
|
||||
QPointF OfflineMap::ll2pp(const Coordinates &c) const
|
||||
void OfflineMap::draw(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _projection->ll2xy(c);
|
||||
}
|
||||
|
||||
QPointF OfflineMap::xy2pp(const QPointF &p) const
|
||||
{
|
||||
return _transform.inverted().map(p);
|
||||
}
|
||||
|
||||
QPointF OfflineMap::pp2xy(const QPointF &p) const
|
||||
{
|
||||
return _transform.map(p);
|
||||
if (_ozf.isOpen())
|
||||
drawOZF(painter, rect);
|
||||
else if (_tileSize.isValid())
|
||||
drawTiled(painter, rect);
|
||||
else
|
||||
drawImage(painter, rect);
|
||||
}
|
||||
|
@ -4,44 +4,52 @@
|
||||
#include <QTransform>
|
||||
#include "map.h"
|
||||
#include "tar.h"
|
||||
#include "ozf.h"
|
||||
#include "coordinates.h"
|
||||
#include "projection.h"
|
||||
|
||||
|
||||
class QIODevice;
|
||||
class QImage;
|
||||
class Projection;
|
||||
|
||||
class OfflineMap : public Map
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OfflineMap(const QString &path, QObject *parent = 0);
|
||||
OfflineMap(Tar &tar, const QString &path, QObject *parent = 0);
|
||||
OfflineMap(const QString &fileName, QObject *parent = 0);
|
||||
OfflineMap(const QString &fileName, Tar &tar, QObject *parent = 0);
|
||||
~OfflineMap();
|
||||
|
||||
const QString &name() const {return _name;}
|
||||
|
||||
QRectF bounds() const;
|
||||
qreal resolution(const QPointF &p) const;
|
||||
QRectF bounds() const {return QRectF(QPointF(0, 0), _size);}
|
||||
qreal resolution(const QPointF &) const {return _resolution;}
|
||||
|
||||
qreal zoom() const {return 1.0;}
|
||||
qreal zoomFit(const QSize &size, const QRectF &br);
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
qreal zoomFit(const QSize &, const QRectF &) {return 1.0;}
|
||||
qreal zoomIn() {return 1.0;}
|
||||
qreal zoomOut() {return 1.0;}
|
||||
|
||||
QPointF ll2xy(const Coordinates &c) const;
|
||||
Coordinates xy2ll(const QPointF &p) const;
|
||||
QPointF ll2xy(const Coordinates &c)
|
||||
{return _transform.map(_projection->ll2xy(c));}
|
||||
Coordinates xy2ll(const QPointF &p)
|
||||
{return _projection->xy2ll(_inverted.map(p));}
|
||||
|
||||
void draw(QPainter *painter, const QRectF &rect);
|
||||
|
||||
void load();
|
||||
void unload();
|
||||
|
||||
bool isValid() {return _valid;}
|
||||
bool isValid() const {return _valid;}
|
||||
const QString &errorString() const {return _errorString;}
|
||||
|
||||
QPointF ll2pp(const Coordinates &c) const;
|
||||
QPointF xy2pp(const QPointF &p) const;
|
||||
QPointF pp2xy(const QPointF &p) const;
|
||||
QPointF ll2pp(const Coordinates &c) const
|
||||
{return _projection->ll2xy(c);}
|
||||
QPointF xy2pp(const QPointF &p) const
|
||||
{return _inverted.map(p);}
|
||||
QPointF pp2xy(const QPointF &p) const
|
||||
{return _transform.map(p);}
|
||||
|
||||
private:
|
||||
typedef struct {
|
||||
@ -51,38 +59,48 @@ private:
|
||||
} ReferencePoint;
|
||||
|
||||
typedef struct {
|
||||
double centralMeridian;
|
||||
double latitudeOrigin;
|
||||
double longitudeOrigin;
|
||||
double scale;
|
||||
double falseEasting;
|
||||
double falseNorthing;
|
||||
double standardParallel1;
|
||||
double standardParallel2;
|
||||
int zone;
|
||||
} ProjectionSetup;
|
||||
|
||||
int parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup);
|
||||
bool mapLoaded(int res);
|
||||
int parse(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup, QString &datum);
|
||||
bool parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup, QString &datum);
|
||||
bool totalSizeSet();
|
||||
bool createProjection(const QString &projection,
|
||||
bool createProjection(const QString &datum, const QString &projection,
|
||||
const ProjectionSetup &setup, QList<ReferencePoint> &points);
|
||||
bool computeTransformation(const QList<ReferencePoint> &points);
|
||||
bool computeResolution(QList<ReferencePoint> &points);
|
||||
bool getTileInfo(const QStringList &tiles, const QString &path = QString());
|
||||
bool getImageInfo(const QString &path);
|
||||
|
||||
void drawTiled(QPainter *painter, const QRectF &rect);
|
||||
void drawOZF(QPainter *painter, const QRectF &rect);
|
||||
void drawImage(QPainter *painter, const QRectF &rect);
|
||||
|
||||
QString _name;
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
|
||||
QSize _size;
|
||||
Projection *_projection;
|
||||
QTransform _transform;
|
||||
QTransform _transform, _inverted;
|
||||
qreal _resolution;
|
||||
|
||||
OZF _ozf;
|
||||
Tar _tar;
|
||||
QString _tarPath;
|
||||
QImage *_img;
|
||||
QString _imgPath;
|
||||
QSize _tileSize;
|
||||
QString _tileName;
|
||||
|
||||
bool _valid;
|
||||
};
|
||||
|
||||
#endif // OFFLINEMAP_H
|
||||
|
@ -45,7 +45,6 @@ OnlineMap::OnlineMap(const QString &name, const QString &url, QObject *parent)
|
||||
{
|
||||
_name = name;
|
||||
_url = url;
|
||||
downloader = downloader;
|
||||
_block = false;
|
||||
_scale = ((360.0/(qreal)(1<<ZOOM_MAX))/(qreal)TILE_SIZE);
|
||||
|
||||
@ -233,13 +232,13 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect)
|
||||
}
|
||||
}
|
||||
|
||||
QPointF OnlineMap::ll2xy(const Coordinates &c) const
|
||||
QPointF OnlineMap::ll2xy(const Coordinates &c)
|
||||
{
|
||||
QPointF m = Mercator().ll2xy(c);
|
||||
return QPointF(m.x() / _scale, m.y() / -_scale);
|
||||
}
|
||||
|
||||
Coordinates OnlineMap::xy2ll(const QPointF &p) const
|
||||
Coordinates OnlineMap::xy2ll(const QPointF &p)
|
||||
{
|
||||
QPointF m(p.x() * _scale, -p.y() * _scale);
|
||||
return Mercator().xy2ll(m);
|
||||
|
@ -23,8 +23,8 @@ public:
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
|
||||
QPointF ll2xy(const Coordinates &c) const;
|
||||
Coordinates xy2ll(const QPointF &p) const;
|
||||
QPointF ll2xy(const Coordinates &c);
|
||||
Coordinates xy2ll(const QPointF &p);
|
||||
|
||||
void draw(QPainter *painter, const QRectF &rect);
|
||||
|
||||
|
@ -9,11 +9,13 @@
|
||||
#include <QGroupBox>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
#include <QSysInfo>
|
||||
#include "config.h"
|
||||
#include "icons.h"
|
||||
#include "colorbox.h"
|
||||
#include "stylecombobox.h"
|
||||
#include "oddspinbox.h"
|
||||
#include "optionsdialog.h"
|
||||
|
||||
#define MENU_MARGIN 20
|
||||
@ -83,11 +85,12 @@ QWidget *OptionsDialog::createAppearancePage()
|
||||
pathTabLayout->addWidget(l1);
|
||||
pathTabLayout->addLayout(routeLayout);
|
||||
pathTabLayout->addWidget(l2);
|
||||
#else
|
||||
#else // Q_OS_MAC
|
||||
pathTabLayout->addWidget(trackBox);
|
||||
pathTabLayout->addWidget(routeBox);
|
||||
#endif
|
||||
#endif // Q_OS_MAC
|
||||
pathTabLayout->addLayout(pathAALayout);
|
||||
pathTabLayout->addStretch();
|
||||
pathTab->setLayout(pathTabLayout);
|
||||
|
||||
_graphWidth = new QSpinBox();
|
||||
@ -117,6 +120,98 @@ QWidget *OptionsDialog::createAppearancePage()
|
||||
return appearancePage;
|
||||
}
|
||||
|
||||
QWidget *OptionsDialog::createDataPage()
|
||||
{
|
||||
QString filterToolTip = tr("Moving average window size");
|
||||
|
||||
_elevationFilter = new OddSpinBox();
|
||||
_elevationFilter->setValue(_options->elevationFilter);
|
||||
_elevationFilter->setToolTip(filterToolTip);
|
||||
_speedFilter = new OddSpinBox();
|
||||
_speedFilter->setValue(_options->speedFilter);
|
||||
_speedFilter->setToolTip(filterToolTip);
|
||||
_heartRateFilter = new OddSpinBox();
|
||||
_heartRateFilter->setValue(_options->heartRateFilter);
|
||||
_heartRateFilter->setToolTip(filterToolTip);
|
||||
_cadenceFilter = new OddSpinBox();
|
||||
_cadenceFilter->setValue(_options->cadenceFilter);
|
||||
_cadenceFilter->setToolTip(filterToolTip);
|
||||
_powerFilter = new OddSpinBox();
|
||||
_powerFilter->setValue(_options->powerFilter);
|
||||
_powerFilter->setToolTip(filterToolTip);
|
||||
|
||||
QFormLayout *smoothLayout = new QFormLayout();
|
||||
smoothLayout->addRow(tr("Elevation:"), _elevationFilter);
|
||||
smoothLayout->addRow(tr("Speed:"), _speedFilter);
|
||||
smoothLayout->addRow(tr("Heart rate:"), _heartRateFilter);
|
||||
smoothLayout->addRow(tr("Cadence:"), _cadenceFilter);
|
||||
smoothLayout->addRow(tr("Power:"), _powerFilter);
|
||||
#ifndef Q_OS_MAC
|
||||
QGroupBox *smoothBox = new QGroupBox(tr("Smoothing"));
|
||||
smoothBox->setLayout(smoothLayout);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
_outlierEliminate = new QCheckBox(tr("Eliminate GPS outliers"));
|
||||
_outlierEliminate->setChecked(_options->outlierEliminate);
|
||||
|
||||
QFormLayout *outlierLayout = new QFormLayout();
|
||||
outlierLayout->addWidget(_outlierEliminate);
|
||||
#ifndef Q_OS_MAC
|
||||
QGroupBox *outlierBox = new QGroupBox(tr("Outlier elimination"));
|
||||
outlierBox->setLayout(outlierLayout);
|
||||
#endif // Q_OS_MAC
|
||||
|
||||
QWidget *filterTab = new QWidget();
|
||||
QVBoxLayout *filterTabLayout = new QVBoxLayout();
|
||||
#ifdef Q_OS_MAC
|
||||
QLabel *label = new QLabel(tr("Smoothing:"));
|
||||
QFrame *line = new QFrame();
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
filterTabLayout->addWidget(label);
|
||||
filterTabLayout->addLayout(smoothLayout);
|
||||
filterTabLayout->addWidget(line);
|
||||
filterTabLayout->addLayout(outlierLayout);
|
||||
#else // Q_OS_MAC
|
||||
filterTabLayout->addWidget(smoothBox);
|
||||
filterTabLayout->addWidget(outlierBox);
|
||||
#endif // Q_OS_MAC
|
||||
filterTabLayout->addStretch();
|
||||
filterTab->setLayout(filterTabLayout);
|
||||
|
||||
|
||||
_pauseSpeed = new QDoubleSpinBox();
|
||||
_pauseSpeed->setDecimals(1);
|
||||
_pauseSpeed->setSingleStep(0.1);
|
||||
_pauseSpeed->setMinimum(0.1);
|
||||
if (_options->units == Imperial) {
|
||||
_pauseSpeed->setValue(_options->pauseSpeed * MS2MIH);
|
||||
_pauseSpeed->setSuffix(UNIT_SPACE + tr("mi/h"));
|
||||
} else {
|
||||
_pauseSpeed->setValue(_options->pauseSpeed * MS2KMH);
|
||||
_pauseSpeed->setSuffix(UNIT_SPACE + tr("km/h"));
|
||||
}
|
||||
_pauseInterval = new QSpinBox();
|
||||
_pauseInterval->setMinimum(1);
|
||||
_pauseInterval->setSuffix(UNIT_SPACE + tr("s"));
|
||||
_pauseInterval->setValue(_options->pauseInterval);
|
||||
|
||||
QFormLayout *pauseLayout = new QFormLayout();
|
||||
pauseLayout->addRow(tr("Minimal speed:"), _pauseSpeed);
|
||||
pauseLayout->addRow(tr("Minimal duration:"), _pauseInterval);
|
||||
|
||||
QWidget *pauseTab = new QWidget();
|
||||
pauseTab->setLayout(pauseLayout);
|
||||
|
||||
|
||||
QTabWidget *filterPage = new QTabWidget();
|
||||
filterPage->addTab(filterTab, tr("Filtering"));
|
||||
filterPage->addTab(pauseTab, tr("Pause detection"));
|
||||
|
||||
return filterPage;
|
||||
}
|
||||
|
||||
QWidget *OptionsDialog::createPOIPage()
|
||||
{
|
||||
_poiRadius = new QDoubleSpinBox();
|
||||
@ -196,11 +291,24 @@ QWidget *OptionsDialog::createSystemPage()
|
||||
#endif // Q_OS_WIN32
|
||||
_useOpenGL->setChecked(_options->useOpenGL);
|
||||
|
||||
QFormLayout *systemLayout = new QFormLayout();
|
||||
systemLayout->addWidget(_useOpenGL);
|
||||
_pixmapCache = new QSpinBox();
|
||||
_pixmapCache->setMinimum(16);
|
||||
_pixmapCache->setMaximum(1024);
|
||||
_pixmapCache->setSuffix(UNIT_SPACE + tr("MB"));
|
||||
_pixmapCache->setValue(_options->pixmapCache);
|
||||
|
||||
QFormLayout *cacheLayout = new QFormLayout();
|
||||
cacheLayout->addRow(tr("Image cache size:"), _pixmapCache);
|
||||
|
||||
QFormLayout *openGLLayout = new QFormLayout();
|
||||
openGLLayout->addWidget(_useOpenGL);
|
||||
|
||||
QWidget *systemTab = new QWidget();
|
||||
systemTab->setLayout(systemLayout);
|
||||
QVBoxLayout *systemTabLayout = new QVBoxLayout();
|
||||
systemTabLayout->addLayout(cacheLayout);
|
||||
systemTabLayout->addLayout(openGLLayout);
|
||||
systemTabLayout->addStretch();
|
||||
systemTab->setLayout(systemTabLayout);
|
||||
|
||||
QTabWidget *systemPage = new QTabWidget();
|
||||
systemPage->addTab(systemTab, tr("System"));
|
||||
@ -213,6 +321,7 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
|
||||
{
|
||||
QStackedWidget *pages = new QStackedWidget();
|
||||
pages->addWidget(createAppearancePage());
|
||||
pages->addWidget(createDataPage());
|
||||
pages->addWidget(createPOIPage());
|
||||
pages->addWidget(createExportPage());
|
||||
pages->addWidget(createSystemPage());
|
||||
@ -221,6 +330,7 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
|
||||
menu->setIconSize(QSize(MENU_ICON_SIZE, MENU_ICON_SIZE));
|
||||
new QListWidgetItem(QIcon(QPixmap(APPEARANCE_ICON)), tr("Appearance"),
|
||||
menu);
|
||||
new QListWidgetItem(QIcon(QPixmap(DATA_ICON)), tr("Data"), menu);
|
||||
new QListWidgetItem(QIcon(QPixmap(POI_ICON)), tr("POI"), menu);
|
||||
new QListWidgetItem(QIcon(QPixmap(PRINT_EXPORT_ICON)), tr("Print & Export"),
|
||||
menu);
|
||||
@ -269,12 +379,21 @@ void OptionsDialog::accept()
|
||||
_options->graphWidth = _graphWidth->value();
|
||||
_options->graphAntiAliasing = _graphAA->isChecked();
|
||||
|
||||
if (_options->units == Imperial)
|
||||
_options->poiRadius = _poiRadius->value() * MIINM;
|
||||
else
|
||||
_options->poiRadius = _poiRadius->value() * KMINM;
|
||||
_options->elevationFilter = _elevationFilter->value();
|
||||
_options->speedFilter = _speedFilter->value();
|
||||
_options->heartRateFilter = _heartRateFilter->value();
|
||||
_options->cadenceFilter = _cadenceFilter->value();
|
||||
_options->powerFilter = _powerFilter->value();
|
||||
_options->outlierEliminate = _outlierEliminate->isChecked();
|
||||
_options->pauseSpeed = (_options->units == Imperial)
|
||||
? _pauseSpeed->value() / MS2MIH : _pauseSpeed->value() / MS2KMH;
|
||||
_options->pauseInterval = _pauseInterval->value();
|
||||
|
||||
_options->poiRadius = (_options->units == Imperial)
|
||||
? _poiRadius->value() * MIINM : _poiRadius->value() * KMINM;
|
||||
|
||||
_options->useOpenGL = _useOpenGL->isChecked();
|
||||
_options->pixmapCache = _pixmapCache->value();
|
||||
|
||||
_options->printName = _name->isChecked();
|
||||
_options->printDate = _date->isChecked();
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
class ColorBox;
|
||||
class StyleComboBox;
|
||||
class OddSpinBox;
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
class QComboBox;
|
||||
@ -22,10 +23,20 @@ struct Options {
|
||||
int graphWidth;
|
||||
bool pathAntiAliasing;
|
||||
bool graphAntiAliasing;
|
||||
// Data
|
||||
int elevationFilter;
|
||||
int speedFilter;
|
||||
int heartRateFilter;
|
||||
int cadenceFilter;
|
||||
int powerFilter;
|
||||
bool outlierEliminate;
|
||||
qreal pauseSpeed;
|
||||
int pauseInterval;
|
||||
// POI
|
||||
int poiRadius;
|
||||
// System
|
||||
bool useOpenGL;
|
||||
int pixmapCache;
|
||||
// Print/Export
|
||||
bool printName;
|
||||
bool printDate;
|
||||
@ -50,12 +61,14 @@ public slots:
|
||||
|
||||
private:
|
||||
QWidget *createAppearancePage();
|
||||
QWidget *createDataPage();
|
||||
QWidget *createPOIPage();
|
||||
QWidget *createSystemPage();
|
||||
QWidget *createExportPage();
|
||||
|
||||
Options *_options;
|
||||
|
||||
// Appearance
|
||||
ColorBox *_baseColor;
|
||||
QDoubleSpinBox *_colorOffset;
|
||||
QSpinBox *_trackWidth;
|
||||
@ -65,8 +78,21 @@ private:
|
||||
QCheckBox *_pathAA;
|
||||
QSpinBox *_graphWidth;
|
||||
QCheckBox *_graphAA;
|
||||
// Data
|
||||
OddSpinBox *_elevationFilter;
|
||||
OddSpinBox *_speedFilter;
|
||||
OddSpinBox *_heartRateFilter;
|
||||
OddSpinBox *_cadenceFilter;
|
||||
OddSpinBox *_powerFilter;
|
||||
QCheckBox *_outlierEliminate;
|
||||
QDoubleSpinBox *_pauseSpeed;
|
||||
QSpinBox *_pauseInterval;
|
||||
// POI
|
||||
QDoubleSpinBox *_poiRadius;
|
||||
// System
|
||||
QSpinBox *_pixmapCache;
|
||||
QCheckBox *_useOpenGL;
|
||||
// Print/Export
|
||||
QCheckBox *_name;
|
||||
QCheckBox *_date;
|
||||
QCheckBox *_distance;
|
||||
|
234
src/ozf.cpp
Normal file
234
src/ozf.cpp
Normal file
@ -0,0 +1,234 @@
|
||||
#include <QtEndian>
|
||||
#include <QFile>
|
||||
#include "ozf.h"
|
||||
|
||||
|
||||
#define OZF2_MAGIC 0x7778
|
||||
#define OZF3_MAGIC 0x7780
|
||||
#define SEPARATOR 0x77777777
|
||||
|
||||
static const quint8 XKEY[] =
|
||||
{
|
||||
0x2D, 0x4A, 0x43, 0xF1, 0x27, 0x9B, 0x69, 0x4F,
|
||||
0x36, 0x52, 0x87, 0xEC, 0x5F, 0x42, 0x53, 0x22,
|
||||
0x9E, 0x8B, 0x2D, 0x83, 0x3D, 0xD2, 0x84, 0xBA,
|
||||
0xD8, 0x5B
|
||||
};
|
||||
|
||||
static void decrypt(void *data, size_t size, quint8 init)
|
||||
{
|
||||
for (size_t i = 0; i < size; i++)
|
||||
reinterpret_cast<quint8*>(data)[i] ^= XKEY[i % sizeof(XKEY)] + init;
|
||||
}
|
||||
|
||||
template<class T> bool OZF::readValue(T &val)
|
||||
{
|
||||
T data;
|
||||
|
||||
if (_file.read((char*)&data, sizeof(T)) < (qint64)sizeof(T))
|
||||
return false;
|
||||
|
||||
if (_decrypt)
|
||||
decrypt(&data, sizeof(T), _key);
|
||||
|
||||
if (sizeof(T) > 1)
|
||||
val = qFromLittleEndian(data);
|
||||
else
|
||||
val = data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::read(void *data, size_t size)
|
||||
{
|
||||
if (_file.read((char*)data, size) < (qint64)size)
|
||||
return false;
|
||||
|
||||
if (_decrypt)
|
||||
decrypt(data, size, _key);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::readKey()
|
||||
{
|
||||
quint8 randomNumber, initial;
|
||||
quint32 keyblock;
|
||||
|
||||
|
||||
if (!_file.seek(14))
|
||||
return false;
|
||||
if (!readValue(randomNumber))
|
||||
return false;
|
||||
|
||||
if (!_file.seek(162))
|
||||
return false;
|
||||
if (!readValue(initial))
|
||||
return false;
|
||||
|
||||
_decrypt = true; _key = initial;
|
||||
if (!_file.seek(15 + randomNumber))
|
||||
return false;
|
||||
if (!readValue(keyblock))
|
||||
return false;
|
||||
|
||||
switch (keyblock & 0xFF) {
|
||||
case 0xf1:
|
||||
initial += 0x8a;
|
||||
break;
|
||||
case 0x18:
|
||||
case 0x54:
|
||||
initial += 0xa0;
|
||||
break;
|
||||
case 0x56:
|
||||
initial += 0xb9;
|
||||
break;
|
||||
case 0x43:
|
||||
initial += 0x6a;
|
||||
break;
|
||||
case 0x83:
|
||||
initial += 0xa4;
|
||||
break;
|
||||
case 0xc5:
|
||||
initial += 0x7e;
|
||||
break;
|
||||
case 0x38:
|
||||
initial += 0xc1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_key = initial;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::readHeaders()
|
||||
{
|
||||
quint16 magic;
|
||||
quint32 separator;
|
||||
|
||||
if (!readValue(magic))
|
||||
return false;
|
||||
|
||||
if (magic == OZF2_MAGIC) {
|
||||
if (!_file.seek(_file.pos() + 52))
|
||||
return false;
|
||||
if (!readValue(separator) || separator != SEPARATOR)
|
||||
return false;
|
||||
} else if (magic == OZF3_MAGIC) {
|
||||
if (!readKey())
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::readTileTable()
|
||||
{
|
||||
quint32 offset, bgr0, w, h;
|
||||
quint16 x, y;
|
||||
|
||||
|
||||
if (!_file.seek(_file.size() - 4))
|
||||
return false;
|
||||
// table offset
|
||||
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;
|
||||
|
||||
if (!readValue(w))
|
||||
return false;
|
||||
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 true;
|
||||
}
|
||||
|
||||
bool OZF::load(const QString &path)
|
||||
{
|
||||
if (_file.isOpen())
|
||||
_file.close();
|
||||
|
||||
_file.setFileName(path);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
if (!readHeaders()) {
|
||||
qWarning("%s: not a OZF2/OZF3 file", qPrintable(_file.fileName()));
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!readTileTable()) {
|
||||
qWarning("%s: file format error", qPrintable(_file.fileName()));
|
||||
_file.close();
|
||||
_size = QSize();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QPixmap OZF::tile(int x, int y)
|
||||
{
|
||||
Q_ASSERT(_file.isOpen());
|
||||
|
||||
int i = (y/tileSize().height()) * _dim.width() + (x/tileSize().width());
|
||||
if (i >= _tiles.size() - 1 || i < 0)
|
||||
return QPixmap();
|
||||
|
||||
int size = _tiles.at(i+1) - _tiles.at(i);
|
||||
if (!_file.seek(_tiles.at(i)))
|
||||
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());
|
||||
ba.prepend(QByteArray((char*)&bes, sizeof(bes)));
|
||||
QByteArray uba = qUncompress(ba);
|
||||
if (uba.size() != tileSize().width() * tileSize().height())
|
||||
return QPixmap();
|
||||
|
||||
QImage img((const uchar*)uba.constData(), tileSize().width(),
|
||||
tileSize().height(), QImage::Format_Indexed8);
|
||||
img.setColorTable(_palette);
|
||||
|
||||
return QPixmap::fromImage(img.mirrored());
|
||||
}
|
43
src/ozf.h
Normal file
43
src/ozf.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef OZF_H
|
||||
#define OZF_H
|
||||
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
#include <QColor>
|
||||
#include <QVector>
|
||||
#include <QFile>
|
||||
#include <QPixmap>
|
||||
|
||||
class OZF
|
||||
{
|
||||
public:
|
||||
OZF() : _decrypt(false), _key(0) {}
|
||||
|
||||
bool load(const QString &path);
|
||||
|
||||
QString fileName() const {return _file.fileName();}
|
||||
bool isOpen() const {return _file.isOpen();}
|
||||
|
||||
QSize size() const {return _size;}
|
||||
QSize tileSize() const {return QSize(64, 64);}
|
||||
QPixmap tile(int x, int y);
|
||||
|
||||
private:
|
||||
template<class T> bool readValue(T &val);
|
||||
bool read(void *data, size_t size);
|
||||
bool readKey();
|
||||
bool readHeaders();
|
||||
bool readTileTable();
|
||||
|
||||
bool _decrypt;
|
||||
quint8 _key;
|
||||
|
||||
QSize _size;
|
||||
QSize _dim;
|
||||
QVector<QRgb> _palette;
|
||||
QVector<quint32> _tiles;
|
||||
|
||||
QFile _file;
|
||||
};
|
||||
|
||||
#endif // OZF_H
|
@ -12,19 +12,21 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
||||
: QGraphicsObject(parent)
|
||||
{
|
||||
Q_ASSERT(path.count() >= 2);
|
||||
|
||||
_path = path;
|
||||
_map = map;
|
||||
|
||||
updatePainterPath(map);
|
||||
updateShape();
|
||||
_digitalZoom = 0;
|
||||
|
||||
_width = 3;
|
||||
QBrush brush(Qt::SolidPattern);
|
||||
_pen = QPen(brush, _width);
|
||||
|
||||
updatePainterPath(map);
|
||||
updateShape();
|
||||
|
||||
_marker = new MarkerItem(this);
|
||||
_marker->setPos(position(_path.at(0).distance()));
|
||||
_md = _path.at(0).distance();
|
||||
_markerDistance = _path.at(0).distance();
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
setAcceptHoverEvents(true);
|
||||
@ -33,7 +35,7 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
||||
void PathItem::updateShape()
|
||||
{
|
||||
QPainterPathStroker s;
|
||||
s.setWidth((_width + 1) * 1.0/scale());
|
||||
s.setWidth((_width + 1) * pow(2, -_digitalZoom));
|
||||
_shape = s.createStroke(_painterPath);
|
||||
}
|
||||
|
||||
@ -70,7 +72,7 @@ void PathItem::setMap(Map *map)
|
||||
updatePainterPath(map);
|
||||
updateShape();
|
||||
|
||||
_marker->setPos(position(_md));
|
||||
_marker->setPos(position(_markerDistance));
|
||||
}
|
||||
|
||||
void PathItem::setColor(const QColor &color)
|
||||
@ -79,12 +81,12 @@ void PathItem::setColor(const QColor &color)
|
||||
update();
|
||||
}
|
||||
|
||||
void PathItem::setWidth(int width)
|
||||
void PathItem::setWidth(qreal width)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
|
||||
_width = width;
|
||||
_pen.setWidthF(_width * 1.0/scale());
|
||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||
|
||||
updateShape();
|
||||
}
|
||||
@ -95,6 +97,17 @@ void PathItem::setStyle(Qt::PenStyle style)
|
||||
update();
|
||||
}
|
||||
|
||||
void PathItem::setDigitalZoom(int zoom)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
|
||||
_digitalZoom = zoom;
|
||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||
_marker->setScale(pow(2, -_digitalZoom));
|
||||
|
||||
updateShape();
|
||||
}
|
||||
|
||||
QPointF PathItem::position(qreal x) const
|
||||
{
|
||||
int low = 0;
|
||||
@ -136,7 +149,7 @@ void PathItem::moveMarker(qreal distance)
|
||||
&& distance <= _path.last().distance()) {
|
||||
_marker->setVisible(true);
|
||||
_marker->setPos(position(distance));
|
||||
_md = distance;
|
||||
_markerDistance = distance;
|
||||
} else
|
||||
_marker->setVisible(false);
|
||||
}
|
||||
@ -145,7 +158,7 @@ void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
_pen.setWidthF((_width + 1) * 1.0/scale());
|
||||
_pen.setWidthF((_width + 1) * pow(2, -_digitalZoom));
|
||||
setZValue(zValue() + 1.0);
|
||||
update();
|
||||
|
||||
@ -156,7 +169,7 @@ void PathItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
_pen.setWidthF(_width * 1.0/scale());
|
||||
_pen.setWidthF(_width * pow(2, -_digitalZoom));
|
||||
setZValue(zValue() - 1.0);
|
||||
update();
|
||||
|
||||
|
@ -26,10 +26,9 @@ public:
|
||||
void setMap(Map *map);
|
||||
|
||||
void setColor(const QColor &color);
|
||||
void setWidth(int width);
|
||||
void setWidth(qreal width);
|
||||
void setStyle(Qt::PenStyle style);
|
||||
|
||||
void showMarker(bool show) {_marker->setVisible(show);}
|
||||
void setDigitalZoom(int zoom);
|
||||
|
||||
public slots:
|
||||
void moveMarker(qreal distance);
|
||||
@ -50,9 +49,10 @@ private:
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
|
||||
Map *_map;
|
||||
qreal _md;
|
||||
qreal _markerDistance;
|
||||
int _digitalZoom;
|
||||
|
||||
int _width;
|
||||
qreal _width;
|
||||
QPen _pen;
|
||||
QPainterPath _shape;
|
||||
QPainterPath _painterPath;
|
||||
|
135
src/pathview.cpp
135
src/pathview.cpp
@ -1,7 +1,8 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsScene>
|
||||
#include <QWheelEvent>
|
||||
#include <QSysInfo>
|
||||
#include <QApplication>
|
||||
#include <QPixmapCache>
|
||||
#include "opengl.h"
|
||||
#include "misc.h"
|
||||
#include "poi.h"
|
||||
@ -12,9 +13,11 @@
|
||||
#include "routeitem.h"
|
||||
#include "waypointitem.h"
|
||||
#include "scaleitem.h"
|
||||
#include "keys.h"
|
||||
#include "pathview.h"
|
||||
|
||||
|
||||
#define MAX_ZOOM 1
|
||||
#define MIN_ZOOM -3
|
||||
#define MARGIN 10.0
|
||||
#define SCALE_OFFSET 7
|
||||
|
||||
@ -71,6 +74,7 @@ PathView::PathView(Map *map, POI *poi, QWidget *parent)
|
||||
_routeStyle = Qt::DashLine;
|
||||
|
||||
_plot = false;
|
||||
_digitalZoom = 0;
|
||||
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
_res = _map->resolution(_scene->sceneRect().center());
|
||||
@ -95,7 +99,9 @@ PathItem *PathView::addTrack(const Track &track)
|
||||
ti->setColor(_palette.nextColor());
|
||||
ti->setWidth(_trackWidth);
|
||||
ti->setStyle(_trackStyle);
|
||||
ti->setUnits(_units);
|
||||
ti->setVisible(_showTracks);
|
||||
ti->setDigitalZoom(_digitalZoom);
|
||||
_scene->addItem(ti);
|
||||
|
||||
addPOI(_poi->points(ti->path()));
|
||||
@ -116,9 +122,11 @@ PathItem *PathView::addRoute(const Route &route)
|
||||
ri->setColor(_palette.nextColor());
|
||||
ri->setWidth(_routeWidth);
|
||||
ri->setStyle(_routeStyle);
|
||||
ri->setUnits(_units);
|
||||
ri->setVisible(_showRoutes);
|
||||
ri->showWaypoints(_showRouteWaypoints);
|
||||
ri->showWaypointLabels(_showWaypointLabels);
|
||||
ri->setDigitalZoom(_digitalZoom);
|
||||
_scene->addItem(ri);
|
||||
|
||||
addPOI(_poi->points(ri->path()));
|
||||
@ -137,7 +145,9 @@ void PathView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||
updateWaypointsBoundingRect(QPointF(c.lon(), c.lat()));
|
||||
wi->setZValue(1);
|
||||
wi->showLabel(_showWaypointLabels);
|
||||
wi->setUnits(_units);
|
||||
wi->setVisible(_showWaypoints);
|
||||
wi->setDigitalZoom(_digitalZoom);
|
||||
_scene->addItem(wi);
|
||||
}
|
||||
|
||||
@ -268,6 +278,8 @@ void PathView::setMap(Map *map)
|
||||
_map->load();
|
||||
connect(_map, SIGNAL(loaded()), this, SLOT(redraw()));
|
||||
|
||||
resetDigitalZoom();
|
||||
|
||||
mapScale();
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
|
||||
@ -278,6 +290,11 @@ void PathView::setMap(Map *map)
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setMap(map);
|
||||
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setMap(_map);
|
||||
updatePOIVisibility();
|
||||
|
||||
QPointF center = contentCenter();
|
||||
centerOn(center);
|
||||
|
||||
@ -285,6 +302,7 @@ void PathView::setMap(Map *map)
|
||||
_mapScale->setResolution(_res);
|
||||
|
||||
resetCachedContent();
|
||||
QPixmapCache::clear();
|
||||
}
|
||||
|
||||
void PathView::setPOI(POI *poi)
|
||||
@ -328,6 +346,7 @@ void PathView::addPOI(const QVector<Waypoint> &waypoints)
|
||||
pi->setZValue(1);
|
||||
pi->showLabel(_showPOILabels);
|
||||
pi->setVisible(_showPOI);
|
||||
pi->setDigitalZoom(_digitalZoom);
|
||||
_scene->addItem(pi);
|
||||
|
||||
_pois.insert(w, pi);
|
||||
@ -357,22 +376,79 @@ void PathView::redraw()
|
||||
resetCachedContent();
|
||||
}
|
||||
|
||||
void PathView::zoom(const QPoint &pos, const Coordinates &c)
|
||||
void PathView::resetDigitalZoom()
|
||||
{
|
||||
QPoint offset = pos - viewport()->rect().center();
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
||||
|
||||
rescale();
|
||||
_digitalZoom = 0;
|
||||
resetTransform();
|
||||
|
||||
QPointF center = _map->ll2xy(c) - offset;
|
||||
centerOn(center);
|
||||
for (int i = 0; i < _tracks.size(); i++)
|
||||
_tracks.at(i)->setDigitalZoom(0);
|
||||
for (int i = 0; i < _routes.size(); i++)
|
||||
_routes.at(i)->setDigitalZoom(0);
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setDigitalZoom(0);
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setDigitalZoom(0);
|
||||
|
||||
_res = _map->resolution(center);
|
||||
_mapScale->setResolution(_res);
|
||||
_mapScale->setDigitalZoom(0);
|
||||
}
|
||||
|
||||
void PathView::digitalZoom(int zoom)
|
||||
{
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
||||
|
||||
_digitalZoom += zoom;
|
||||
scale(pow(2, zoom), pow(2, zoom));
|
||||
|
||||
for (int i = 0; i < _tracks.size(); i++)
|
||||
_tracks.at(i)->setDigitalZoom(_digitalZoom);
|
||||
for (int i = 0; i < _routes.size(); i++)
|
||||
_routes.at(i)->setDigitalZoom(_digitalZoom);
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setDigitalZoom(_digitalZoom);
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setDigitalZoom(_digitalZoom);
|
||||
|
||||
_mapScale->setDigitalZoom(_digitalZoom);
|
||||
}
|
||||
|
||||
void PathView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
|
||||
{
|
||||
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
||||
|
||||
if (_digitalZoom) {
|
||||
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
||||
>= MAX_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
||||
|| _digitalZoom <= MIN_ZOOM)))
|
||||
return;
|
||||
|
||||
digitalZoom(zoom);
|
||||
} else {
|
||||
qreal os, ns;
|
||||
os = _map->zoom();
|
||||
ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
|
||||
|
||||
if (ns != os) {
|
||||
QPoint offset = pos - viewport()->rect().center();
|
||||
|
||||
rescale();
|
||||
|
||||
QPointF center = _map->ll2xy(c) - offset;
|
||||
centerOn(center);
|
||||
|
||||
_res = _map->resolution(center);
|
||||
_mapScale->setResolution(_res);
|
||||
} else {
|
||||
if (shift)
|
||||
digitalZoom(zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PathView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
static int deg = 0;
|
||||
|
||||
deg += event->delta() / 8;
|
||||
@ -380,48 +456,39 @@ void PathView::wheelEvent(QWheelEvent *event)
|
||||
return;
|
||||
deg = 0;
|
||||
|
||||
os = _map->zoom();
|
||||
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||
|
||||
ns = (event->delta() > 0) ? _map->zoomIn() : _map->zoomOut();
|
||||
if (ns != os)
|
||||
zoom(event->pos(), c);
|
||||
zoom((event->delta() > 0) ? 1 : -1, event->pos(), c);
|
||||
}
|
||||
|
||||
void PathView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
|
||||
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
|
||||
return;
|
||||
|
||||
os = _map->zoom();
|
||||
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||
|
||||
ns = (event->button() == Qt::LeftButton) ? _map->zoomIn() : _map->zoomOut();
|
||||
if (ns != os)
|
||||
zoom(event->pos(), c);
|
||||
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), c);
|
||||
}
|
||||
|
||||
void PathView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
int z;
|
||||
|
||||
os = _map->zoom();
|
||||
QPoint pos = QRect(QPoint(), viewport()->size()).center();
|
||||
Coordinates c = _map->xy2ll(mapToScene(pos));
|
||||
|
||||
if (event->matches(QKeySequence::ZoomIn))
|
||||
ns = _map->zoomIn();
|
||||
else if (event->matches(QKeySequence::ZoomOut))
|
||||
ns = _map->zoomOut();
|
||||
else {
|
||||
QWidget::keyPressEvent(event);
|
||||
if (event->matches(ZOOM_IN))
|
||||
z = 1;
|
||||
else if (event->matches(ZOOM_OUT))
|
||||
z = -1;
|
||||
else if (_digitalZoom && event->key() == Qt::Key_Escape) {
|
||||
resetDigitalZoom();
|
||||
return;
|
||||
} else {
|
||||
QGraphicsView::keyPressEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ns != os)
|
||||
zoom(pos, c);
|
||||
zoom(z, pos, c);
|
||||
}
|
||||
|
||||
void PathView::plot(QPainter *painter, const QRectF &target)
|
||||
@ -474,6 +541,10 @@ void PathView::clear()
|
||||
|
||||
_tr = QRectF(); _rr = QRectF(); _wr = QRectF();
|
||||
_wp = QPointF();
|
||||
|
||||
resetDigitalZoom();
|
||||
resetCachedContent();
|
||||
QPixmapCache::clear();
|
||||
}
|
||||
|
||||
void PathView::showTracks(bool show)
|
||||
|
@ -76,7 +76,9 @@ private:
|
||||
qreal mapScale() const;
|
||||
QPointF contentCenter() const;
|
||||
void rescale();
|
||||
void zoom(const QPoint &pos, const Coordinates &c);
|
||||
void zoom(int zoom, const QPoint &pos, const Coordinates &c);
|
||||
void digitalZoom(int zoom);
|
||||
void resetDigitalZoom();
|
||||
void updatePOIVisibility();
|
||||
void updateWaypointsBoundingRect(const QPointF &wp);
|
||||
|
||||
@ -118,6 +120,7 @@ private:
|
||||
Qt::PenStyle _trackStyle;
|
||||
Qt::PenStyle _routeStyle;
|
||||
|
||||
int _digitalZoom;
|
||||
bool _plot;
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include "config.h"
|
||||
#include "misc.h"
|
||||
@ -15,6 +16,7 @@ ScaleItem::ScaleItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||
{
|
||||
_units = Metric;
|
||||
_res = 1.0;
|
||||
_digitalZoom = 0;
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
@ -87,24 +89,26 @@ QString ScaleItem::units() const
|
||||
|
||||
void ScaleItem::computeScale()
|
||||
{
|
||||
qreal res = _res * pow(2, -_digitalZoom);
|
||||
|
||||
if (_units == Imperial) {
|
||||
_length = niceNum((_res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_length = niceNum((res * M2FT * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
if (_length >= MIINFT) {
|
||||
_length = niceNum((_res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_width = (_length / (_res * M2FT * FT2MI));
|
||||
_length = niceNum((res * M2FT * FT2MI * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_width = (_length / (res * M2FT * FT2MI));
|
||||
_scale = true;
|
||||
} else {
|
||||
_width = (_length / (_res * M2FT));
|
||||
_width = (_length / (res * M2FT));
|
||||
_scale = false;
|
||||
}
|
||||
} else {
|
||||
_length = niceNum((_res * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
_length = niceNum((res * SCALE_WIDTH) / SEGMENTS, 1);
|
||||
if (_length >= KMINM) {
|
||||
_length *= M2KM;
|
||||
_width = (_length / (_res * M2KM));
|
||||
_width = (_length / (res * M2KM));
|
||||
_scale = true;
|
||||
} else {
|
||||
_width = (_length / _res);
|
||||
_width = (_length / res);
|
||||
_scale = false;
|
||||
}
|
||||
}
|
||||
@ -127,3 +131,14 @@ void ScaleItem::setUnits(enum Units units)
|
||||
updateBoundingRect();
|
||||
update();
|
||||
}
|
||||
|
||||
void ScaleItem::setDigitalZoom(int zoom)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
_digitalZoom = zoom;
|
||||
computeScale();
|
||||
updateBoundingRect();
|
||||
update();
|
||||
|
||||
setScale(pow(2, -_digitalZoom));
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
|
||||
void setResolution(qreal res);
|
||||
void setUnits(enum Units units);
|
||||
void setDigitalZoom(int zoom);
|
||||
|
||||
private:
|
||||
void updateBoundingRect();
|
||||
@ -27,6 +28,8 @@ private:
|
||||
Units _units;
|
||||
bool _scale;
|
||||
|
||||
int _digitalZoom;
|
||||
|
||||
QRectF _boundingRect;
|
||||
};
|
||||
|
||||
|
@ -90,10 +90,28 @@
|
||||
#define PATH_AA_DEFAULT true
|
||||
#define GRAPH_AA_SETTING "graphAntiAliasing"
|
||||
#define GRAPH_AA_DEFAULT false
|
||||
#define ELEVATION_FILTER_SETTING "elevationFilter"
|
||||
#define ELEVATION_FILTER_DEFAULT 3
|
||||
#define SPEED_FILTER_SETTING "speedFilter"
|
||||
#define SPEED_FILTER_DEFAULT 5
|
||||
#define HEARTRATE_FILTER_SETTING "heartrateFilter"
|
||||
#define HEARTRATE_FILTER_DEFAULT 3
|
||||
#define CADENCE_FILTER_SETTING "cadenceFilter"
|
||||
#define CADENCE_FILTER_DEFAULT 3
|
||||
#define POWER_FILTER_SETTING "powerFilter"
|
||||
#define POWER_FILTER_DEFAULT 3
|
||||
#define OUTLIER_ELIMINATE_SETTING "outlierEliminate"
|
||||
#define OUTLIER_ELIMINATE_DEFAULT true
|
||||
#define PAUSE_SPEED_SETTING "pauseSpeed"
|
||||
#define PAUSE_SPEED_DEFAULT 0.5 /* m/s */
|
||||
#define PAUSE_INTERVAL_SETTING "pauseInterval"
|
||||
#define PAUSE_INTERVAL_DEFAULT 10 /* s */
|
||||
#define POI_RADIUS_SETTING "poiRadius"
|
||||
#define POI_RADIUS_DEFAULT (IMPERIAL_UNITS() ? MIINM : KMINM)
|
||||
#define POI_RADIUS_DEFAULT (int)(IMPERIAL_UNITS() ? MIINM : KMINM)
|
||||
#define USE_OPENGL_SETTING "useOpenGL"
|
||||
#define USE_OPENGL_DEFAULT false
|
||||
#define PIXMAP_CACHE_SETTING "pixmapCache"
|
||||
#define PIXMAP_CACHE_DEFAULT 64 /* MB */
|
||||
#define PRINT_NAME_SETTING "printName"
|
||||
#define PRINT_NAME_DEFAULT true
|
||||
#define PRINT_DATE_SETTING "printDate"
|
||||
|
13
src/tar.cpp
13
src/tar.cpp
@ -50,18 +50,26 @@ bool Tar::load(const QString &path)
|
||||
quint64 size;
|
||||
qint64 ret;
|
||||
|
||||
if (_file.isOpen())
|
||||
_file.close();
|
||||
_index.clear();
|
||||
|
||||
_file.setFileName(path);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
||||
if (ret < BLOCKSIZE)
|
||||
if (ret < BLOCKSIZE) {
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
size = number(hdr->size, sizeof(hdr->size));
|
||||
if (size)
|
||||
_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();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -73,6 +81,7 @@ QByteArray Tar::file(const QString &name)
|
||||
if (it == _index.end())
|
||||
return QByteArray();
|
||||
|
||||
Q_ASSERT(_file.isOpen());
|
||||
if (_file.seek(it.value().offset()))
|
||||
return _file.read(it.value().size());
|
||||
else
|
||||
|
@ -1,16 +1,17 @@
|
||||
#include "track.h"
|
||||
|
||||
#define OUTLIER_WINDOW 21
|
||||
|
||||
#define WINDOW_OE 31
|
||||
int Track::_elevationWindow = 3;
|
||||
int Track::_speedWindow = 5;
|
||||
int Track::_heartRateWindow = 3;
|
||||
int Track::_cadenceWindow = 3;
|
||||
int Track::_powerWindow = 3;
|
||||
|
||||
#define WINDOW_EF 3
|
||||
#define WINDOW_SF 7
|
||||
#define WINDOW_HF 3
|
||||
#define WINDOW_CF 3
|
||||
#define WINDOW_PF 3
|
||||
qreal Track::_pauseSpeed = 0.5;
|
||||
int Track::_pauseInterval = 10;
|
||||
|
||||
#define PAUSE_SPEED 0.5
|
||||
#define PAUSE_TIME_DIFF 10
|
||||
bool Track::_outlierEliminate = true;
|
||||
|
||||
|
||||
static qreal median(QVector<qreal> v)
|
||||
@ -48,24 +49,26 @@ static QSet<int> eliminate(const QVector<qreal> &v, int window)
|
||||
|
||||
static Graph filter(const Graph &g, int window)
|
||||
{
|
||||
qreal acc = 0;
|
||||
Graph ret;
|
||||
|
||||
if (g.size() < window)
|
||||
return ret;
|
||||
return Graph();
|
||||
if (window < 2)
|
||||
return Graph(g);
|
||||
|
||||
qreal acc = 0;
|
||||
Graph ret(g.size());
|
||||
|
||||
for (int i = 0; i < window; i++)
|
||||
acc += g.at(i).y();
|
||||
for (int i = 0; i <= window/2; i++)
|
||||
ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
|
||||
ret[i] = GraphPoint(g.at(i).s(), g.at(i).t(), acc/window);
|
||||
|
||||
for (int i = window/2 + 1; i < g.size() - window/2; i++) {
|
||||
acc += g.at(i + window/2).y() - g.at(i - (window/2 + 1)).y();
|
||||
ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
|
||||
ret[i] = GraphPoint(g.at(i).s(), g.at(i).t(), acc/window);
|
||||
}
|
||||
|
||||
for (int i = g.size() - window/2; i < g.size(); i++)
|
||||
ret.append(GraphPoint(g.at(i).s(), g.at(i).t(), acc/window));
|
||||
ret[i] = GraphPoint(g.at(i).s(), g.at(i).t(), acc/window);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -104,15 +107,16 @@ Track::Track(const TrackData &data) : _data(data)
|
||||
|
||||
_pause = 0;
|
||||
for (int i = 1; i < data.count(); i++) {
|
||||
if (_time.at(i) > _time.at(i-1) + PAUSE_TIME_DIFF
|
||||
&& _speed.at(i) < PAUSE_SPEED) {
|
||||
if (_time.at(i) > _time.at(i-1) + _pauseInterval
|
||||
&& _speed.at(i) < _pauseSpeed) {
|
||||
_pause += _time.at(i) - _time.at(i-1);
|
||||
_stop.insert(i-1);
|
||||
_stop.insert(i);
|
||||
}
|
||||
}
|
||||
|
||||
_outliers = eliminate(_speed, WINDOW_OE);
|
||||
if (_outlierEliminate)
|
||||
_outliers = eliminate(_speed, OUTLIER_WINDOW);
|
||||
|
||||
QSet<int>::const_iterator it;
|
||||
for (it = _stop.constBegin(); it != _stop.constEnd(); ++it)
|
||||
@ -137,7 +141,7 @@ Graph Track::elevation() const
|
||||
raw.append(GraphPoint(_distance.at(i), _time.at(i),
|
||||
_data.at(i).elevation()));
|
||||
|
||||
return filter(raw, WINDOW_EF);
|
||||
return filter(raw, _elevationWindow);
|
||||
}
|
||||
|
||||
Graph Track::speed() const
|
||||
@ -161,7 +165,7 @@ Graph Track::speed() const
|
||||
raw.append(GraphPoint(_distance.at(i), _time.at(i), v));
|
||||
}
|
||||
|
||||
filtered = filter(raw, WINDOW_SF);
|
||||
filtered = filter(raw, _speedWindow);
|
||||
|
||||
QSet<int>::const_iterator it;
|
||||
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
|
||||
@ -179,7 +183,7 @@ Graph Track::heartRate() const
|
||||
raw.append(GraphPoint(_distance.at(i), _time.at(i),
|
||||
_data.at(i).heartRate()));
|
||||
|
||||
return filter(raw, WINDOW_HF);
|
||||
return filter(raw, _heartRateWindow);
|
||||
}
|
||||
|
||||
Graph Track::temperature() const
|
||||
@ -212,7 +216,7 @@ Graph Track::cadence() const
|
||||
raw.append(GraphPoint(_distance.at(i), _time.at(i), c));
|
||||
}
|
||||
|
||||
filtered = filter(raw, WINDOW_CF);
|
||||
filtered = filter(raw, _cadenceWindow);
|
||||
|
||||
QSet<int>::const_iterator it;
|
||||
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
|
||||
@ -239,7 +243,7 @@ Graph Track::power() const
|
||||
raw.append(GraphPoint(_distance.at(i), _time.at(i), p));
|
||||
}
|
||||
|
||||
filtered = filter(raw, WINDOW_PF);
|
||||
filtered = filter(raw, _powerWindow);
|
||||
|
||||
QSet<int>::const_iterator it;
|
||||
for (it = stop.constBegin(); it != stop.constEnd(); ++it)
|
||||
|
21
src/track.h
21
src/track.h
@ -33,6 +33,16 @@ public:
|
||||
|
||||
bool isNull() const {return (_data.size() < 2);}
|
||||
|
||||
static void setElevationFilter(int window) {_elevationWindow = window;}
|
||||
static void setSpeedFilter(int window) {_speedWindow = window;}
|
||||
static void setHeartRateFilter(int window) {_heartRateWindow = window;}
|
||||
static void setCadenceFilter(int window) {_cadenceWindow = window;}
|
||||
static void setPowerFilter(int window) {_powerWindow = window;}
|
||||
static void setPauseSpeed(qreal speed) {_pauseSpeed = speed;}
|
||||
static void setPauseInterval(int interval) {_pauseInterval = interval;}
|
||||
static void setOutlierElimination(bool eliminate)
|
||||
{_outlierEliminate = eliminate;}
|
||||
|
||||
private:
|
||||
bool discardStopPoint(int i) const;
|
||||
|
||||
@ -46,6 +56,17 @@ private:
|
||||
QSet<int> _stop;
|
||||
|
||||
qreal _pause;
|
||||
|
||||
static bool _outlierEliminate;
|
||||
|
||||
static int _elevationWindow;
|
||||
static int _speedWindow;
|
||||
static int _heartRateWindow;
|
||||
static int _cadenceWindow;
|
||||
static int _powerWindow;
|
||||
|
||||
static qreal _pauseSpeed;
|
||||
static int _pauseInterval;
|
||||
};
|
||||
|
||||
#endif // TRACK_H
|
||||
|
@ -1,106 +1,256 @@
|
||||
/*
|
||||
* Based on libgeotrans with the following Source Code Disclaimer:
|
||||
|
||||
1. The GEOTRANS source code ("the software") is provided free of charge by
|
||||
the National Imagery and Mapping Agency (NIMA) of the United States
|
||||
Department of Defense. Although NIMA makes no copyright claim under Title 17
|
||||
U.S.C., NIMA claims copyrights in the source code under other legal regimes.
|
||||
NIMA hereby grants to each user of the software a license to use and
|
||||
distribute the software, and develop derivative works.
|
||||
|
||||
2. Warranty Disclaimer: The software was developed to meet only the internal
|
||||
requirements of the U.S. National Imagery and Mapping Agency. The software
|
||||
is provided "as is," and no warranty, express or implied, including but not
|
||||
limited to the implied warranties of merchantability and fitness for
|
||||
particular purpose or arising by statute or otherwise in law or from a
|
||||
course of dealing or usage in trade, is made by NIMA as to the accuracy and
|
||||
functioning of the software.
|
||||
|
||||
3. NIMA and its personnel are not required to provide technical support or
|
||||
general assistance with respect to the software.
|
||||
|
||||
4. Neither NIMA nor its personnel will be liable for any claims, losses, or
|
||||
damages arising from or connected with the use of the software. The user
|
||||
agrees to hold harmless the United States National Imagery and Mapping
|
||||
Agency. The user's sole and exclusive remedy is to stop using the software.
|
||||
|
||||
5. NIMA requests that products developed using the software credit the
|
||||
source of the software with the following statement, "The product was
|
||||
developed using GEOTRANS, a product of the National Imagery and Mapping
|
||||
Agency and U.S. Army Engineering Research and Development Center."
|
||||
|
||||
6. For any products developed using the software, NIMA requires a disclaimer
|
||||
that use of the software does not indicate endorsement or approval of the
|
||||
product by the Secretary of Defense or the National Imagery and Mapping
|
||||
Agency. Pursuant to the United States Code, 10 U.S.C. Sec. 2797, the name of
|
||||
the National Imagery and Mapping Agency, the initials "NIMA", the seal of
|
||||
the National Imagery and Mapping Agency, or any colorable imitation thereof
|
||||
shall not be used to imply approval, endorsement, or authorization of a
|
||||
product without prior written permission from United States Secretary of
|
||||
Defense.
|
||||
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include "rd.h"
|
||||
#include "wgs84.h"
|
||||
#include "ellipsoid.h"
|
||||
#include "transversemercator.h"
|
||||
|
||||
|
||||
TransverseMercator::TransverseMercator()
|
||||
{
|
||||
_centralMeridian = 0;
|
||||
_scale = 1.0;
|
||||
_falseEasting = 0;
|
||||
_falseNorthing = 0;
|
||||
}
|
||||
#define SPHSN(lat) \
|
||||
((double)(_e.radius() / sqrt(1.e0 - _es * pow(sin(lat), 2))))
|
||||
#define SPHTMD(lat) \
|
||||
((double)(_ap * lat - _bp * sin(2.e0 * lat) + _cp * sin(4.e0 * lat) \
|
||||
- _dp * sin(6.e0 * lat) + _ep * sin(8.e0 * lat)))
|
||||
#define DENOM(lat) \
|
||||
((double)(sqrt(1.e0 - _es * pow(sin(lat),2))))
|
||||
#define SPHSR(lat) \
|
||||
((double)(_e.radius() * (1.e0 - _es) / pow(DENOM(lat), 3)))
|
||||
|
||||
TransverseMercator::TransverseMercator(double centralMeridian, double scale,
|
||||
|
||||
TransverseMercator::TransverseMercator(const Ellipsoid &ellipsoid,
|
||||
double latitudeOrigin, double longitudeOrigin, double scale,
|
||||
double falseEasting, double falseNorthing)
|
||||
{
|
||||
_centralMeridian = centralMeridian;
|
||||
double tn, tn2, tn3, tn4, tn5;
|
||||
double b;
|
||||
|
||||
|
||||
_e = ellipsoid;
|
||||
_longitudeOrigin = deg2rad(longitudeOrigin);
|
||||
_latitudeOrigin = deg2rad(latitudeOrigin);
|
||||
_scale = scale;
|
||||
_falseEasting = falseEasting;
|
||||
_falseNorthing = falseNorthing;
|
||||
|
||||
_es = 2 * _e.flattening() - _e.flattening() * _e.flattening();
|
||||
_ebs = (1 / (1 - _es)) - 1;
|
||||
|
||||
b = _e.radius() * (1 - _e.flattening());
|
||||
|
||||
tn = (_e.radius() - b) / (_e.radius() + b);
|
||||
tn2 = tn * tn;
|
||||
tn3 = tn2 * tn;
|
||||
tn4 = tn3 * tn;
|
||||
tn5 = tn4 * tn;
|
||||
|
||||
_ap = _e.radius() * (1.e0 - tn + 5.e0 * (tn2 - tn3) / 4.e0 + 81.e0
|
||||
* (tn4 - tn5) / 64.e0);
|
||||
_bp = 3.e0 * _e.radius() * (tn - tn2 + 7.e0 * (tn3 - tn4) / 8.e0 + 55.e0
|
||||
* tn5 / 64.e0 ) / 2.e0;
|
||||
_cp = 15.e0 * _e.radius() * (tn2 - tn3 + 3.e0 * (tn4 - tn5 ) / 4.e0) / 16.0;
|
||||
_dp = 35.e0 * _e.radius() * (tn3 - tn4 + 11.e0 * tn5 / 16.e0) / 48.e0;
|
||||
_ep = 315.e0 * _e.radius() * (tn4 - tn5) / 512.e0;
|
||||
}
|
||||
|
||||
QPointF TransverseMercator::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
QPointF p;
|
||||
double rl;
|
||||
double cl, c2, c3, c5, c7;
|
||||
double dlam;
|
||||
double eta, eta2, eta3, eta4;
|
||||
double sl, sn;
|
||||
double t, tan2, tan3, tan4, tan5, tan6;
|
||||
double t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
||||
double tmd, tmdo;
|
||||
double x, y;
|
||||
|
||||
const double e2 = WGS84_FLATTENING * (2 - WGS84_FLATTENING);
|
||||
const double n = WGS84_FLATTENING / (2 - WGS84_FLATTENING);
|
||||
const double rectifyingRadius = WGS84_RADIUS / (1 + n)
|
||||
* (1 + 0.25*pow(n, 2) + 0.015625*pow(n, 4));
|
||||
|
||||
double A = e2;
|
||||
double B = (5 * pow(e2, 2) - pow(e2, 3)) / 6.0;
|
||||
double C = (104 * pow(e2, 3) - 45 * pow(e2, 4)) / 120.0;
|
||||
double D = (1237 * pow(e2, 4)) / 1260.0;
|
||||
dlam = deg2rad(c.lon()) - _longitudeOrigin;
|
||||
|
||||
double phi = deg2rad(c.lat());
|
||||
double lambda = deg2rad(c.lon());
|
||||
double lambda0 = deg2rad(_centralMeridian);
|
||||
if (dlam > M_PI)
|
||||
dlam -= (2 * M_PI);
|
||||
if (dlam < -M_PI)
|
||||
dlam += (2 * M_PI);
|
||||
if (fabs(dlam) < 2.e-10)
|
||||
dlam = 0.0;
|
||||
|
||||
double deltaLambda = lambda - lambda0;
|
||||
rl = deg2rad(c.lat());
|
||||
sl = sin(rl);
|
||||
cl = cos(rl);
|
||||
c2 = cl * cl;
|
||||
c3 = c2 * cl;
|
||||
c5 = c3 * c2;
|
||||
c7 = c5 * c2;
|
||||
t = sl / cl;
|
||||
tan2 = t * t;
|
||||
tan3 = tan2 * t;
|
||||
tan4 = tan3 * t;
|
||||
tan5 = tan4 * t;
|
||||
tan6 = tan5 * t;
|
||||
eta = _ebs * c2;
|
||||
eta2 = eta * eta;
|
||||
eta3 = eta2 * eta;
|
||||
eta4 = eta3 * eta;
|
||||
|
||||
double phiStar = phi - sin(phi) * cos(phi) * (A + B*pow(sin(phi), 2)
|
||||
+ C*pow(sin(phi), 4) + D*pow(sin(phi), 6));
|
||||
sn = SPHSN(rl);
|
||||
tmd = SPHTMD(rl);
|
||||
tmdo = SPHTMD (_latitudeOrigin);
|
||||
|
||||
double xiPrim = atan(tan(phiStar) / cos(deltaLambda));
|
||||
double etaPrim = atanh(cos(phiStar) * sin(deltaLambda));
|
||||
|
||||
double beta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 5/16.0 * pow(n, 3)
|
||||
+ 41/180.0 * pow(n, 4);
|
||||
double beta2 = 13/48.0 * pow(n, 2) - 3/5.0 * pow(n, 3) + 557/1440.0
|
||||
* pow(n, 4);
|
||||
double beta3 = 61/240.0 * pow(n, 3) - 103/140.0 * pow(n, 4);
|
||||
double beta4 = 49561/161280.0 * pow(n, 4);
|
||||
t1 = (tmd - tmdo) * _scale;
|
||||
t2 = sn * sl * cl * _scale / 2.e0;
|
||||
t3 = sn * sl * c3 * _scale * (5.e0 - tan2 + 9.e0 * eta + 4.e0 * eta2)
|
||||
/ 24.e0;
|
||||
t4 = sn * sl * c5 * _scale * (61.e0 - 58.e0 * tan2 + tan4 + 270.e0 * eta
|
||||
- 330.e0 * tan2 * eta + 445.e0 * eta2 + 324.e0 * eta3 - 680.e0 * tan2
|
||||
* eta2 + 88.e0 * eta4 - 600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4)
|
||||
/ 720.e0;
|
||||
t5 = sn * sl * c7 * _scale * (1385.e0 - 3111.e0 * tan2 + 543.e0 * tan4
|
||||
- tan6) / 40320.e0;
|
||||
|
||||
p.ry() = _falseNorthing + _scale * rectifyingRadius * (xiPrim + beta1
|
||||
* sin(2*xiPrim) * cosh(2*etaPrim) + beta2 * sin(4*xiPrim)
|
||||
* cosh(4*etaPrim) + beta3 * sin(6*xiPrim) * cosh(6*etaPrim) + beta4
|
||||
* sin(8*xiPrim) * cosh(8*etaPrim));
|
||||
p.rx() = _falseEasting + _scale * rectifyingRadius * (etaPrim + beta1
|
||||
* cos(2*xiPrim) * sinh(2*etaPrim) + beta2 * cos(4*xiPrim)
|
||||
* sinh(4*etaPrim) + beta3 * cos(6*xiPrim) * sinh(6*etaPrim) + beta4
|
||||
* cos(8*xiPrim) * sinh(8*etaPrim));
|
||||
y = _falseNorthing + t1 + pow(dlam, 2.e0) * t2 + pow(dlam, 4.e0) * t3
|
||||
+ pow(dlam, 6.e0) * t4 + pow(dlam, 8.e0) * t5;
|
||||
|
||||
return p;
|
||||
|
||||
t6 = sn * cl * _scale;
|
||||
t7 = sn * c3 * _scale * (1.e0 - tan2 + eta) /6.e0;
|
||||
t8 = sn * c5 * _scale * (5.e0 - 18.e0 * tan2 + tan4 + 14.e0 * eta - 58.e0
|
||||
* tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3 - 64.e0 * tan2 * eta2 - 24.e0
|
||||
* tan2 * eta3) / 120.e0;
|
||||
t9 = sn * c7 * _scale * (61.e0 - 479.e0 * tan2 + 179.e0 * tan4 - tan6)
|
||||
/ 5040.e0;
|
||||
|
||||
x = _falseEasting + dlam * t6 + pow(dlam, 3.e0) * t7 + pow(dlam, 5.e0)
|
||||
* t8 + pow(dlam, 7.e0) * t9;
|
||||
|
||||
return QPointF(x, y);
|
||||
}
|
||||
|
||||
Coordinates TransverseMercator::xy2ll(const QPointF &p) const
|
||||
{
|
||||
const double e2 = WGS84_FLATTENING * (2 - WGS84_FLATTENING);
|
||||
const double n = WGS84_FLATTENING / (2 - WGS84_FLATTENING);
|
||||
const double rectifyingRadius = WGS84_RADIUS / (1 + n)
|
||||
* (1 + 0.25*pow(n, 2) + 0.015625*pow(n, 4));
|
||||
double cl;
|
||||
double de;
|
||||
double dlam;
|
||||
double eta, eta2, eta3, eta4;
|
||||
double ftphi;
|
||||
double sn;
|
||||
double sr;
|
||||
double t, tan2, tan4;
|
||||
double t10, t11, t12, t13, t14, t15, t16, t17;
|
||||
double tmd, tmdo;
|
||||
double lat, lon;
|
||||
|
||||
double xi = (p.y() - _falseNorthing) / (_scale * rectifyingRadius);
|
||||
double eta = (p.x() - _falseEasting) / (_scale * rectifyingRadius);
|
||||
|
||||
double delta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 37/96.0 * pow(n, 3)
|
||||
- 1/360.0 * pow(n, 4);
|
||||
double delta2 = 1/48.0 * pow(n, 2) + 1/15.0 * pow(n, 3) - 437/1440.0
|
||||
* pow(n, 4);
|
||||
double delta3 = 17/480.0 * pow(n, 3) - 37/840.0 * pow(n, 4);
|
||||
double delta4 = 4397/161280.0 * pow(n, 4);
|
||||
tmdo = SPHTMD(_latitudeOrigin);
|
||||
tmd = tmdo + (p.y() - _falseNorthing) / _scale;
|
||||
|
||||
double xiPrim = xi - delta1 * sin(2*xi) * cosh(2*eta) - delta2 * sin(4*xi)
|
||||
* cosh(4*eta) - delta3 * sin(6*xi) * cosh(6*eta) - delta4 * sin(8*xi)
|
||||
* cosh(8*eta);
|
||||
double etaPrim = eta - delta1 * cos(2*xi) * sinh(2*eta) - delta2 * cos(4*xi)
|
||||
* sinh(4*eta) - delta3 * cos(6*xi) * sinh(6*eta) - delta4 * cos(8*xi)
|
||||
* sinh(8*eta);
|
||||
sr = SPHSR(0.e0);
|
||||
ftphi = tmd / sr;
|
||||
|
||||
double phiStar = asin(sin(xiPrim) / cosh(etaPrim));
|
||||
double deltaLambda = atan(sinh(etaPrim) / cos(xiPrim));
|
||||
for (int i = 0; i < 5 ; i++) {
|
||||
t10 = SPHTMD(ftphi);
|
||||
sr = SPHSR(ftphi);
|
||||
ftphi = ftphi + (tmd - t10) / sr;
|
||||
}
|
||||
|
||||
double AStar = e2 + pow(e2, 2) + pow(e2, 3) + pow(e2, 4);
|
||||
double BStar = (7 * pow(e2, 2) + 17 * pow(e2, 3) + 30 * pow(e2, 4)) / -6;
|
||||
double CStar = (224 * pow(e2, 3) + 889 * pow(e2, 4)) / 120;
|
||||
double DStar = (4279 * pow(e2, 4)) / -1260;
|
||||
sr = SPHSR(ftphi);
|
||||
sn = SPHSN(ftphi);
|
||||
|
||||
double phi = phiStar + sin(phiStar) * cos(phiStar) * (AStar + BStar
|
||||
* pow(sin(phiStar), 2) + CStar * pow(sin(phiStar), 4) + DStar
|
||||
* pow(sin(phiStar), 6));
|
||||
cl = cos(ftphi);
|
||||
|
||||
return Coordinates(_centralMeridian + rad2deg(deltaLambda), rad2deg(phi));
|
||||
t = tan(ftphi);
|
||||
tan2 = t * t;
|
||||
tan4 = tan2 * tan2;
|
||||
eta = _ebs * pow(cl, 2);
|
||||
eta2 = eta * eta;
|
||||
eta3 = eta2 * eta;
|
||||
eta4 = eta3 * eta;
|
||||
de = p.x() - _falseEasting;
|
||||
if (fabs(de) < 0.0001)
|
||||
de = 0.0;
|
||||
|
||||
t10 = t / (2.e0 * sr * sn * pow(_scale, 2));
|
||||
t11 = t * (5.e0 + 3.e0 * tan2 + eta - 4.e0 * pow(eta, 2) - 9.e0 * tan2
|
||||
* eta) / (24.e0 * sr * pow(sn, 3) * pow(_scale, 4));
|
||||
t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4 - 252.e0 * tan2
|
||||
* eta - 3.e0 * eta2 + 100.e0 * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
|
||||
* eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2 + 84.e0 * tan2 * eta3 - 192.e0
|
||||
* tan2 * eta4) / (720.e0 * sr * pow(sn, 5) * pow(_scale, 6));
|
||||
t13 = t * (1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0 * pow(t,6))
|
||||
/ (40320.e0 * sr * pow(sn, 7) * pow(_scale, 8));
|
||||
lat = ftphi - pow(de, 2) * t10 + pow(de, 4) * t11 - pow(de, 6) * t12
|
||||
+ pow(de, 8) * t13;
|
||||
|
||||
t14 = 1.e0 / (sn * cl * _scale);
|
||||
t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn, 3) * cl * pow(_scale, 3));
|
||||
t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2 + 8.e0 * tan2 * eta
|
||||
+ 24.e0 * tan4 - 4.e0 * eta3 + 4.e0 * tan2 * eta2 + 24.e0 * tan2 * eta3)
|
||||
/ (120.e0 * pow(sn, 5) * cl * pow(_scale, 5));
|
||||
t17 = (61.e0 + 662.e0 * tan2 + 1320.e0 * tan4 + 720.e0 * pow(t,6))
|
||||
/ (5040.e0 * pow(sn, 7) * cl * pow(_scale, 7));
|
||||
|
||||
dlam = de * t14 - pow(de, 3) * t15 + pow(de, 5) * t16 - pow(de, 7) * t17;
|
||||
|
||||
lon = _longitudeOrigin + dlam;
|
||||
while (lat > deg2rad(90.0)) {
|
||||
lat = M_PI - lat;
|
||||
lon += M_PI;
|
||||
if (lon > M_PI)
|
||||
lon -= (2 * M_PI);
|
||||
}
|
||||
|
||||
while (lat < deg2rad(-90.0)) {
|
||||
lat = - (lat + M_PI);
|
||||
lon += M_PI;
|
||||
if (lon > M_PI)
|
||||
lon -= (2 * M_PI);
|
||||
}
|
||||
|
||||
if (lon > (2 * M_PI))
|
||||
lon -= (2 * M_PI);
|
||||
if (lon < -M_PI)
|
||||
lon += (2 * M_PI);
|
||||
|
||||
return Coordinates(rad2deg(lon), rad2deg(lat));
|
||||
}
|
||||
|
@ -2,22 +2,29 @@
|
||||
#define TRANSVERSEMERCATOR_H
|
||||
|
||||
#include "projection.h"
|
||||
#include "ellipsoid.h"
|
||||
|
||||
class TransverseMercator : public Projection
|
||||
{
|
||||
public:
|
||||
TransverseMercator();
|
||||
TransverseMercator(double centralMeridian, double scale,
|
||||
double falseEasting, double falseNorthing);
|
||||
TransverseMercator(const Ellipsoid &ellipsoid, double latitudeOrigin,
|
||||
double longitudeOrigin, double scale, double falseEasting,
|
||||
double falseNorthing);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
|
||||
private:
|
||||
double _centralMeridian;
|
||||
Ellipsoid _e;
|
||||
double _longitudeOrigin;
|
||||
double _latitudeOrigin;
|
||||
double _scale;
|
||||
double _falseEasting;
|
||||
double _falseNorthing;
|
||||
|
||||
double _es;
|
||||
double _ebs;
|
||||
double _ap, _bp, _cp, _dp, _ep;
|
||||
};
|
||||
|
||||
#endif // TRANSVERSEMERCATOR_H
|
||||
|
13
src/utm.cpp
13
src/utm.cpp
@ -1,6 +1,14 @@
|
||||
#include "ellipsoid.h"
|
||||
#include "utm.h"
|
||||
|
||||
UTM::UTM(const Coordinates &c)
|
||||
UTM::UTM(const Ellipsoid &ellipsoid, int zone)
|
||||
: _tm(ellipsoid, 0, (qAbs(zone) - 1)*6 - 180 + 3, 0.9996, 500000,
|
||||
zone < 0 ? 10000000 : 0)
|
||||
{
|
||||
}
|
||||
|
||||
UTM::UTM(const Ellipsoid &ellipsoid, const Coordinates &c)
|
||||
: _tm(ellipsoid, 0, 0, 0, 0, 0)
|
||||
{
|
||||
int zone = int((c.lon() + 180)/6) + 1;
|
||||
|
||||
@ -18,5 +26,6 @@ UTM::UTM(const Coordinates &c)
|
||||
}
|
||||
double cm = (zone - 1)*6 - 180 + 3;
|
||||
|
||||
_tm = TransverseMercator(cm, 0.9996, 500000, (c.lat() < 0) ? 10000000 : 0);
|
||||
_tm = TransverseMercator(ellipsoid, 0, cm, 0.9996, 500000,
|
||||
(c.lat() < 0) ? 10000000 : 0);
|
||||
}
|
||||
|
@ -7,9 +7,8 @@
|
||||
class UTM : public Projection
|
||||
{
|
||||
public:
|
||||
UTM(int zone) : _tm((qAbs(zone) - 1)*6 - 180 + 3, 0.9996, 500000,
|
||||
zone < 0 ? 10000000 : 0) {}
|
||||
UTM(const Coordinates &c);
|
||||
UTM(const Ellipsoid &ellipsoid, int zone);
|
||||
UTM(const Ellipsoid &ellipsoid, const Coordinates &c);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const
|
||||
{return _tm.ll2xy(c);}
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "config.h"
|
||||
#include "format.h"
|
||||
#include "tooltip.h"
|
||||
#include "map.h"
|
||||
#include "waypointitem.h"
|
||||
|
||||
|
||||
@ -46,11 +45,6 @@ WaypointItem::WaypointItem(const Waypoint &waypoint, Map *map,
|
||||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
void WaypointItem::setMap(Map *map)
|
||||
{
|
||||
setPos(map->ll2xy(_waypoint.coordinates()));
|
||||
}
|
||||
|
||||
void WaypointItem::updateShape()
|
||||
{
|
||||
QPainterPath p;
|
||||
@ -106,14 +100,6 @@ void WaypointItem::paint(QPainter *painter,
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
void WaypointItem::setScale(qreal scale)
|
||||
{
|
||||
QPointF p = _map->ll2xy(_waypoint.coordinates());
|
||||
setPos(QPointF(p.x(), -p.y()) * scale);
|
||||
}
|
||||
*/
|
||||
|
||||
void WaypointItem::setUnits(enum Units units)
|
||||
{
|
||||
setToolTip(toolTip(units));
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef WAYPOINTITEM_H
|
||||
#define WAYPOINTITEM_H
|
||||
|
||||
#include <cmath>
|
||||
#include <QGraphicsItem>
|
||||
#include "waypoint.h"
|
||||
#include "units.h"
|
||||
|
||||
class Map;
|
||||
#include "map.h"
|
||||
|
||||
class WaypointItem : public QGraphicsItem
|
||||
{
|
||||
@ -14,9 +14,10 @@ public:
|
||||
|
||||
const Waypoint &waypoint() const {return _waypoint;}
|
||||
|
||||
void setMap(Map *map);
|
||||
void setMap(Map *map) {setPos(map->ll2xy(_waypoint.coordinates()));}
|
||||
void setUnits(Units units);
|
||||
void showLabel(bool show);
|
||||
void setDigitalZoom(int zoom) {setScale(pow(2, -zoom));}
|
||||
|
||||
QPainterPath shape() const {return _shape;}
|
||||
QRectF boundingRect() const {return _shape.boundingRect();}
|
||||
|
Reference in New Issue
Block a user