mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-01 05:19:15 +02:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
2bdab0f449 | |||
4e23df3a66 | |||
23f5a317d0 | |||
80bc9f1f01 | |||
dec3f10df3 | |||
296d4c6c9d | |||
668558cf2e | |||
a6053a4d7b | |||
535361dada | |||
e9e7660beb | |||
eb5692a0ab | |||
367427b26a |
37
Info.plist
37
Info.plist
@ -99,6 +99,22 @@
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>nmea</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/vnd.nmea.nmea</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>nmea.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>NMEA 0183 data</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>UTImportedTypeDeclarations</key>
|
||||
@ -208,6 +224,27 @@
|
||||
<string>application/vnd.fai.igc</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.nmea.nmea</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>http://www.nmea.org/content/nmea_standards/nmea_0183_v_410.asp</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>NMEA 0183 data</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>nmea</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.nmea.nmea</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
</dict>
|
||||
|
13
gpxsee.pro
13
gpxsee.pro
@ -1,5 +1,5 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 3.1
|
||||
VERSION = 3.2
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
@ -69,7 +69,8 @@ HEADERS += src/config.h \
|
||||
src/assert.h \
|
||||
src/cadencegraph.h \
|
||||
src/powergraph.h \
|
||||
src/igcparser.h
|
||||
src/igcparser.h \
|
||||
src/nmeaparser.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/gui.cpp \
|
||||
src/poi.cpp \
|
||||
@ -118,7 +119,9 @@ SOURCES += src/main.cpp \
|
||||
src/graph.cpp \
|
||||
src/cadencegraph.cpp \
|
||||
src/powergraph.cpp \
|
||||
src/igcparser.cpp
|
||||
src/igcparser.cpp \
|
||||
src/path.cpp \
|
||||
src/nmeaparser.cpp
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts
|
||||
macx {
|
||||
@ -129,6 +132,7 @@ macx {
|
||||
icons/kml.icns \
|
||||
icons/fit.icns \
|
||||
icons/igc.icns \
|
||||
icons/nmea.icns \
|
||||
pkg/maps.txt
|
||||
APP_RESOURCES.path = Contents/Resources
|
||||
QMAKE_BUNDLE_DATA += APP_RESOURCES
|
||||
@ -139,6 +143,7 @@ win32 {
|
||||
icons/tcx.ico \
|
||||
icons/kml.ico \
|
||||
icons/fit.ico \
|
||||
icons/igc.ico
|
||||
icons/igc.ico \
|
||||
icons/nmea.ico
|
||||
}
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
|
BIN
icons/nmea.icns
Normal file
BIN
icons/nmea.icns
Normal file
Binary file not shown.
BIN
icons/nmea.ico
Normal file
BIN
icons/nmea.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
145
icons/nmea.svg
Normal file
145
icons/nmea.svg
Normal file
@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
id="svg3390"
|
||||
height="185"
|
||||
width="185">
|
||||
<metadata
|
||||
id="metadata3404">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs3402" />
|
||||
<path
|
||||
style="fill:#ffffff;stroke:#999999;stroke-width:2.18774867"
|
||||
id="path3392"
|
||||
d="m 128.23996,2.2548915 -95.377018,0 0,181.0580085 134.394868,0 0,-141.313567 z m 0,0 0,39.7444415 39.01785,0" />
|
||||
<rect
|
||||
y="124.9782"
|
||||
x="16.573463"
|
||||
height="49.84631"
|
||||
width="131.6837"
|
||||
id="rect3426"
|
||||
style="fill:#0083d7;fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<g
|
||||
id="g3828"
|
||||
transform="matrix(0.89093793,0,0,0.84489692,3.5017807,-51.565424)">
|
||||
<g
|
||||
id="g3715">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3717"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2;stroke-linejoin:round"
|
||||
cx="113"
|
||||
cy="90.875"
|
||||
id="ellipse3719"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<polyline
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:4"
|
||||
points="62.3563,178.566 73.5,125.854 96,151.875 113,90.875 136.5,172.375 148.831,160.03 "
|
||||
id="polyline3721" />
|
||||
<g
|
||||
id="g3723">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3725"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="73.5"
|
||||
cy="125.854"
|
||||
id="ellipse3727"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3729">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3731"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="136.5"
|
||||
cy="172.375"
|
||||
id="ellipse3733"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3735">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3737"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="60.700001"
|
||||
cy="186.39999"
|
||||
id="ellipse3739"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3741">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3743"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="154.5"
|
||||
cy="154.354"
|
||||
id="ellipse3745"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
<g
|
||||
id="g3747">
|
||||
<circle
|
||||
style="fill:#000000"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3749"
|
||||
r="7.0209999" />
|
||||
<circle
|
||||
style="fill:none;fill-opacity:0;stroke:#000000;stroke-width:2"
|
||||
cx="96"
|
||||
cy="151.875"
|
||||
id="ellipse3751"
|
||||
r="7.0209999" />
|
||||
</g>
|
||||
</g>
|
||||
<text
|
||||
transform="scale(0.9437456,1.0596076)"
|
||||
id="text3921"
|
||||
y="155.86783"
|
||||
x="21.076782"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40px;line-height:100%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
y="155.86783"
|
||||
x="21.076782"
|
||||
id="tspan3429">NMEA</tspan></text>
|
||||
</svg>
|
After Width: | Height: | Size: 4.1 KiB |
@ -190,234 +190,239 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="550"/>
|
||||
<location filename="../src/gui.cpp" line="552"/>
|
||||
<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="614"/>
|
||||
<location filename="../src/gui.cpp" line="616"/>
|
||||
<source>Open file</source>
|
||||
<translation>Otevřít soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="695"/>
|
||||
<location filename="../src/gui.cpp" line="697"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Otevřít POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="225"/>
|
||||
<location filename="../src/gui.cpp" line="227"/>
|
||||
<source>Open</source>
|
||||
<translation>Otevřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="209"/>
|
||||
<location filename="../src/gui.cpp" line="211"/>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="217"/>
|
||||
<location filename="../src/gui.cpp" line="566"/>
|
||||
<location filename="../src/gui.cpp" line="567"/>
|
||||
<location filename="../src/gui.cpp" line="219"/>
|
||||
<location filename="../src/gui.cpp" line="568"/>
|
||||
<location filename="../src/gui.cpp" line="569"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Ovládací klávesy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="241"/>
|
||||
<location filename="../src/gui.cpp" line="243"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<location filename="../src/gui.cpp" line="249"/>
|
||||
<source>Reload</source>
|
||||
<translation>Znovu načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="478"/>
|
||||
<source>Show</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="398"/>
|
||||
<location filename="../src/gui.cpp" line="470"/>
|
||||
<location filename="../src/gui.cpp" line="400"/>
|
||||
<location filename="../src/gui.cpp" line="472"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>Supported files (*.csv *.fit *.gpx *.kml *.tcx)</source>
|
||||
<translation>Podporované soubory (*.csv *.fit *.gpx *.kml *.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="112"/>
|
||||
<source>FIT files (*.fit)</source>
|
||||
<translation>Soubory FIT (*.fit)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="215"/>
|
||||
<location filename="../src/gui.cpp" line="589"/>
|
||||
<location filename="../src/gui.cpp" line="590"/>
|
||||
<location filename="../src/gui.cpp" line="113"/>
|
||||
<source>IGC files (*.igc)</source>
|
||||
<translation>Soubory IGC (*.igc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="114"/>
|
||||
<source>NMEA files (*.nmea)</source>
|
||||
<translation>Soubory NMEA (*.nmea)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="217"/>
|
||||
<location filename="../src/gui.cpp" line="591"/>
|
||||
<location filename="../src/gui.cpp" line="592"/>
|
||||
<source>Data sources</source>
|
||||
<translation>Zdroje dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="255"/>
|
||||
<location filename="../src/gui.cpp" line="257"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Nahrát POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="258"/>
|
||||
<location filename="../src/gui.cpp" line="260"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Zavřit POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="260"/>
|
||||
<location filename="../src/gui.cpp" line="262"/>
|
||||
<source>Overlap POIs</source>
|
||||
<translation>Překrývat POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="264"/>
|
||||
<location filename="../src/gui.cpp" line="266"/>
|
||||
<source>Show POI labels</source>
|
||||
<translation>Zobrazovat názvy POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="269"/>
|
||||
<location filename="../src/gui.cpp" line="271"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Zobrazit POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="278"/>
|
||||
<location filename="../src/gui.cpp" line="280"/>
|
||||
<source>Show map</source>
|
||||
<translation>Zobrazit mapu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="284"/>
|
||||
<location filename="../src/gui.cpp" line="286"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Vymazat mezipaměť dlaždic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="293"/>
|
||||
<location filename="../src/gui.cpp" line="297"/>
|
||||
<location filename="../src/gui.cpp" line="576"/>
|
||||
<location filename="../src/gui.cpp" line="295"/>
|
||||
<location filename="../src/gui.cpp" line="299"/>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<source>Next map</source>
|
||||
<translation>Následující mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="304"/>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<source>Show tracks</source>
|
||||
<translation>Zobrazit cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="308"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<source>Show routes</source>
|
||||
<translation>Zobrazit trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="312"/>
|
||||
<location filename="../src/gui.cpp" line="314"/>
|
||||
<source>Show waypoints</source>
|
||||
<translation>Zobrazit navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="316"/>
|
||||
<location filename="../src/gui.cpp" line="318"/>
|
||||
<source>Waypoint labels</source>
|
||||
<translation>Názvy navigačních bodů</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="327"/>
|
||||
<location filename="../src/gui.cpp" line="329"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Zobrazovat grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="349"/>
|
||||
<location filename="../src/gui.cpp" line="351"/>
|
||||
<source>Show grid</source>
|
||||
<translation>Zobrazit mřížku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="355"/>
|
||||
<location filename="../src/gui.cpp" line="357"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Zobrazovat nástrojové lišty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="361"/>
|
||||
<location filename="../src/gui.cpp" line="363"/>
|
||||
<source>Metric</source>
|
||||
<translation>Metrické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="366"/>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperiální</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="372"/>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Celoobrazovkový režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="380"/>
|
||||
<location filename="../src/gui.cpp" line="382"/>
|
||||
<source>Next</source>
|
||||
<translation>Následující</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="383"/>
|
||||
<location filename="../src/gui.cpp" line="385"/>
|
||||
<source>Previous</source>
|
||||
<translation>Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="387"/>
|
||||
<location filename="../src/gui.cpp" line="389"/>
|
||||
<source>Last</source>
|
||||
<translation>Poslední</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="390"/>
|
||||
<location filename="../src/gui.cpp" line="392"/>
|
||||
<source>First</source>
|
||||
<translation>První</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="412"/>
|
||||
<location filename="../src/gui.cpp" line="414"/>
|
||||
<source>Map</source>
|
||||
<translation>Mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="419"/>
|
||||
<location filename="../src/gui.cpp" line="421"/>
|
||||
<source>Graph</source>
|
||||
<translation>Graf</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="427"/>
|
||||
<location filename="../src/gui.cpp" line="429"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="428"/>
|
||||
<location filename="../src/gui.cpp" line="430"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="439"/>
|
||||
<location filename="../src/gui.cpp" line="441"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="440"/>
|
||||
<location filename="../src/gui.cpp" line="442"/>
|
||||
<source>Display</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="448"/>
|
||||
<location filename="../src/gui.cpp" line="450"/>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="449"/>
|
||||
<location filename="../src/gui.cpp" line="451"/>
|
||||
<source>Units</source>
|
||||
<translation>Jednotky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="457"/>
|
||||
<location filename="../src/gui.cpp" line="459"/>
|
||||
<source>Help</source>
|
||||
<translation>Nápověda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="580"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Předchozí mapa</translation>
|
||||
</message>
|
||||
@ -427,12 +432,12 @@
|
||||
<translation>Soubory GPX (*.gpx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="114"/>
|
||||
<location filename="../src/gui.cpp" line="115"/>
|
||||
<source>TCX files (*.tcx)</source>
|
||||
<translation>Soubory TCX (*.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="113"/>
|
||||
<location filename="../src/gui.cpp" line="114"/>
|
||||
<source>KML files (*.kml)</source>
|
||||
<translation>Soubory KML (*.kml)</translation>
|
||||
</message>
|
||||
@ -442,28 +447,28 @@
|
||||
<translation>Soubory CSV (*.csv)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="114"/>
|
||||
<location filename="../src/gui.cpp" line="115"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="781"/>
|
||||
<location filename="../src/gui.cpp" line="784"/>
|
||||
<location filename="../src/gui.cpp" line="783"/>
|
||||
<location filename="../src/gui.cpp" line="786"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="793"/>
|
||||
<location filename="../src/gui.cpp" line="795"/>
|
||||
<source>Routes</source>
|
||||
<translation>Trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="981"/>
|
||||
<location filename="../src/gui.cpp" line="983"/>
|
||||
<source>No GPX files loaded</source>
|
||||
<translation>Nejsou načteny žádné GPX soubory</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/gui.cpp" line="985"/>
|
||||
<location filename="../src/gui.cpp" line="987"/>
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n soubor</numerusform>
|
||||
@ -472,121 +477,126 @@
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="569"/>
|
||||
<location filename="../src/gui.cpp" line="571"/>
|
||||
<source>Next file</source>
|
||||
<translation>Následující soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="546"/>
|
||||
<location filename="../src/gui.cpp" line="548"/>
|
||||
<source>Version </source>
|
||||
<translation>Verze </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="230"/>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<source>Print...</source>
|
||||
<translation>Tisknout...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="235"/>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportovat do PDF...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="795"/>
|
||||
<location filename="../src/gui.cpp" line="797"/>
|
||||
<source>Waypoints</source>
|
||||
<translation>Navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="570"/>
|
||||
<location filename="../src/gui.cpp" line="572"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Předchozí soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="320"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<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="322"/>
|
||||
<source>Route waypoints</source>
|
||||
<translation>Body tras</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="572"/>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<source>First file</source>
|
||||
<translation>První soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="573"/>
|
||||
<location filename="../src/gui.cpp" line="575"/>
|
||||
<source>Last file</source>
|
||||
<translation>Poslední soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<location filename="../src/gui.cpp" line="576"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Modifikátor nahradit/přidat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="593"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<source>Map (tiles) source URLs are read on program startup from the following file:</source>
|
||||
<translation>URL mapových zdrojů (dlaždic) jsou načteny při startu programu z následujícího souboru:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="596"/>
|
||||
<location filename="../src/gui.cpp" line="598"/>
|
||||
<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="604"/>
|
||||
<location filename="../src/gui.cpp" line="606"/>
|
||||
<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="684"/>
|
||||
<location filename="../src/gui.cpp" line="686"/>
|
||||
<source>Error loading data file:</source>
|
||||
<translation>Datový soubor nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="687"/>
|
||||
<location filename="../src/gui.cpp" line="712"/>
|
||||
<location filename="../src/gui.cpp" line="689"/>
|
||||
<location filename="../src/gui.cpp" line="714"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Řádka: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="709"/>
|
||||
<location filename="../src/gui.cpp" line="711"/>
|
||||
<source>Error loading POI file:</source>
|
||||
<translation>Soubor POI nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="791"/>
|
||||
<location filename="../src/gui.cpp" line="793"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="220"/>
|
||||
<location filename="../src/gui.cpp" line="544"/>
|
||||
<location filename="../src/gui.cpp" line="222"/>
|
||||
<location filename="../src/gui.cpp" line="546"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>O aplikaci GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="481"/>
|
||||
<location filename="../src/gui.cpp" line="483"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigace</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="592"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<source>Map sources</source>
|
||||
<translation>Mapové zdroje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="603"/>
|
||||
<location filename="../src/gui.cpp" line="605"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="335"/>
|
||||
<location filename="../src/gui.cpp" line="798"/>
|
||||
<location filename="../src/gui.cpp" line="337"/>
|
||||
<location filename="../src/gui.cpp" line="800"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="342"/>
|
||||
<location filename="../src/gui.cpp" line="800"/>
|
||||
<location filename="../src/gui.cpp" line="344"/>
|
||||
<location filename="../src/gui.cpp" line="802"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
|
@ -4,7 +4,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "3.1"
|
||||
!define VERSION "3.2"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
@ -27,6 +27,7 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
!define REGKML "GPXSee.kml"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -112,7 +113,11 @@ Section "GPXSee (required)" SEC_APP
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
@ -182,6 +187,8 @@ Section "Uninstall"
|
||||
DeleteRegKey HKCR ".fit"
|
||||
DeleteRegKey HKCR "${REGIGC}"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
@ -203,4 +210,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
|
||||
!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
|
||||
|
@ -4,7 +4,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "3.1"
|
||||
!define VERSION "3.2"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
@ -27,6 +27,7 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
|
||||
!define REGKML "GPXSee.kml"
|
||||
!define REGFIT "GPXSee.fit"
|
||||
!define REGIGC "GPXSee.igc"
|
||||
!define REGNMEA "GPXSee.nmea"
|
||||
|
||||
; Start menu page configuration
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
||||
@ -120,6 +121,10 @@ Section "GPXSee (required)" SEC_APP
|
||||
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
|
||||
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
|
||||
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
|
||||
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
|
||||
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
|
||||
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
@ -186,6 +191,8 @@ Section "Uninstall"
|
||||
DeleteRegKey HKCR ".fit"
|
||||
DeleteRegKey HKCR "${REGIGC}"
|
||||
DeleteRegKey HKCR ".igc"
|
||||
DeleteRegKey HKCR "${REGNMEA}"
|
||||
DeleteRegKey HKCR ".nmea"
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
SectionEnd
|
||||
@ -207,4 +214,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
|
||||
!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
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "kmlparser.h"
|
||||
#include "fitparser.h"
|
||||
#include "igcparser.h"
|
||||
#include "nmeaparser.h"
|
||||
#include "data.h"
|
||||
|
||||
|
||||
@ -24,6 +25,8 @@ Data::Data() : _errorLine(0)
|
||||
_waypointData));
|
||||
_parsers.insert("igc", new IGCParser(_trackData, _routeData,
|
||||
_waypointData));
|
||||
_parsers.insert("nmea", new NMEAParser(_trackData, _routeData,
|
||||
_waypointData));
|
||||
}
|
||||
|
||||
Data::~Data()
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "graph.h"
|
||||
|
||||
QDebug operator<<(QDebug dbg, const GraphPoint &graphpoint)
|
||||
QDebug operator<<(QDebug dbg, const GraphPoint &point)
|
||||
{
|
||||
dbg.nospace() << "GraphPoint(" << graphpoint.s() << ", "
|
||||
<< graphpoint.t() << ", " << graphpoint.y() << ")";
|
||||
dbg.nospace() << "GraphPoint(" << point.s() << ", " << point.t() << ", "
|
||||
<< point.y() << ")";
|
||||
|
||||
return dbg.maybeSpace();
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ private:
|
||||
};
|
||||
|
||||
Q_DECLARE_TYPEINFO(GraphPoint, Q_PRIMITIVE_TYPE);
|
||||
QDebug operator<<(QDebug dbg, const GraphPoint &graphpoint);
|
||||
QDebug operator<<(QDebug dbg, const GraphPoint &point);
|
||||
|
||||
|
||||
class Graph : public QVector<GraphPoint>
|
||||
|
@ -117,12 +117,12 @@ void GraphItem::emitSliderPositionChanged(qreal pos)
|
||||
{
|
||||
if (_type == Time) {
|
||||
if (_graph.hasTime()) {
|
||||
if (pos <= _graph.last().t())
|
||||
if (pos >= _graph.first().t() && pos <= _graph.last().t())
|
||||
emit sliderPositionChanged(distanceAtTime(pos));
|
||||
else
|
||||
emit sliderPositionChanged(_graph.last().s() + 1);
|
||||
emit sliderPositionChanged(NAN);
|
||||
} else
|
||||
emit sliderPositionChanged(_graph.last().s() + 1);
|
||||
emit sliderPositionChanged(NAN);
|
||||
} else
|
||||
emit sliderPositionChanged(pos);
|
||||
}
|
||||
|
@ -400,6 +400,8 @@ void GraphView::emitSliderPositionChanged(const QPointF &pos)
|
||||
return;
|
||||
|
||||
_sliderPos = (pos.x() / _slider->area().width()) * bounds().width();
|
||||
_sliderPos = qMax(_sliderPos, bounds().left());
|
||||
_sliderPos = qMin(_sliderPos, bounds().right());
|
||||
updateSliderPosition();
|
||||
|
||||
emit sliderPositionChanged(_sliderPos);
|
||||
|
11
src/gui.cpp
11
src/gui.cpp
@ -108,17 +108,18 @@ GUI::~GUI()
|
||||
|
||||
const QString GUI::fileFormats() const
|
||||
{
|
||||
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.tcx)") + ";;"
|
||||
+ tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
|
||||
return tr("Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)")
|
||||
+ ";;" + tr("CSV files (*.csv)") + ";;" + tr("FIT files (*.fit)") + ";;"
|
||||
+ tr("GPX files (*.gpx)") + ";;" + tr("IGC files (*.igc)") + ";;"
|
||||
+ tr("KML files (*.kml)") + ";;" + tr("TCX files (*.tcx)") + ";;"
|
||||
+ tr("All files (*)");
|
||||
+ tr("KML files (*.kml)") + ";;" + tr("NMEA files (*.nmea)") + ";;"
|
||||
+ tr("TCX files (*.tcx)") + ";;" + tr("All files (*)");
|
||||
}
|
||||
|
||||
void GUI::createBrowser()
|
||||
{
|
||||
QStringList filter;
|
||||
filter << "*.gpx" << "*.tcx" << "*.kml" << "*.fit" << "*.csv" << "*.igc";
|
||||
filter << "*.gpx" << "*.tcx" << "*.kml" << "*.fit" << "*.csv" << "*.igc"
|
||||
<< "*.nmea";
|
||||
_browser = new FileBrowser(this);
|
||||
_browser->setFilter(filter);
|
||||
}
|
||||
|
@ -1,22 +1,8 @@
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
#include "misc.h"
|
||||
#include "igcparser.h"
|
||||
|
||||
|
||||
static int str2int(const char *str, size_t len)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
for (const char *sp = str; sp < str + len; sp++) {
|
||||
if (::isdigit(*sp))
|
||||
res = res * 10 + *sp - '0';
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool readLat(const char *data, qreal &lat)
|
||||
{
|
||||
int d = str2int(data, 2);
|
||||
@ -93,6 +79,8 @@ static bool readTimestamp(const char *data, QTime &time)
|
||||
return false;
|
||||
|
||||
time = QTime(h, m, s);
|
||||
if (!time.isValid())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -108,7 +96,7 @@ static bool readARecord(const char *line, qint64 len)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IGCParser::readHRecord(const char *line, qint64 len)
|
||||
bool IGCParser::readHRecord(const char *line, int len)
|
||||
{
|
||||
if (len < 10 || ::strncmp(line, "HFDTE", 5))
|
||||
return true;
|
||||
@ -131,7 +119,7 @@ bool IGCParser::readHRecord(const char *line, qint64 len)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IGCParser::readBRecord(const char *line, qint64 len)
|
||||
bool IGCParser::readBRecord(const char *line, int len)
|
||||
{
|
||||
qreal lat, lon, ele;
|
||||
QTime time;
|
||||
@ -161,7 +149,7 @@ bool IGCParser::readBRecord(const char *line, qint64 len)
|
||||
|
||||
|
||||
if (time < _time)
|
||||
_date.addDays(1);
|
||||
_date = _date.addDays(1);
|
||||
_time = time;
|
||||
|
||||
Trackpoint t(Coordinates(lon, lat));
|
||||
@ -172,7 +160,7 @@ bool IGCParser::readBRecord(const char *line, qint64 len)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IGCParser::readCRecord(const char *line, qint64 len)
|
||||
bool IGCParser::readCRecord(const char *line, int len)
|
||||
{
|
||||
qreal lat, lon;
|
||||
|
||||
|
@ -19,9 +19,9 @@ public:
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
bool readHRecord(const char *line, qint64 len);
|
||||
bool readBRecord(const char *line, qint64 len);
|
||||
bool readCRecord(const char *line, qint64 len);
|
||||
bool readHRecord(const char *line, int len);
|
||||
bool readBRecord(const char *line, int len);
|
||||
bool readCRecord(const char *line, int len);
|
||||
|
||||
int _errorLine;
|
||||
QString _errorString;
|
||||
|
15
src/misc.cpp
15
src/misc.cpp
@ -1,4 +1,5 @@
|
||||
#include <cmath>
|
||||
#include <cctype>
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
@ -33,3 +34,17 @@ double niceNum(double x, int round)
|
||||
|
||||
return nf * pow(10.0, expv);
|
||||
}
|
||||
|
||||
int str2int(const char *str, int len)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
for (const char *sp = str; sp < str + len; sp++) {
|
||||
if (::isdigit(*sp))
|
||||
res = res * 10 + *sp - '0';
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -2,5 +2,6 @@
|
||||
#define MISC_H
|
||||
|
||||
double niceNum(double x, int round);
|
||||
int str2int(const char *str, int len);
|
||||
|
||||
#endif // MISC_H
|
||||
|
527
src/nmeaparser.cpp
Normal file
527
src/nmeaparser.cpp
Normal file
@ -0,0 +1,527 @@
|
||||
#include <cstring>
|
||||
#include "misc.h"
|
||||
#include "nmeaparser.h"
|
||||
|
||||
|
||||
static bool validSentence(const char *line, int len)
|
||||
{
|
||||
const char *lp;
|
||||
|
||||
if (len < 10 || line[0] != '$')
|
||||
return false;
|
||||
|
||||
for (lp = line + len - 1; lp > line; lp--)
|
||||
if (!::isspace(*lp))
|
||||
break;
|
||||
if (*(lp-2) != '*' || !::isalnum(*(lp-1)) || !::isalnum(*(lp)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool readFloat(const char *data, int len, qreal &f)
|
||||
{
|
||||
bool ok;
|
||||
|
||||
f = QString(QByteArray::fromRawData(data, len)).toFloat(&ok);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool NMEAParser::readAltitude(const char *data, int len, qreal &ele)
|
||||
{
|
||||
if (!len) {
|
||||
ele = NAN;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!readFloat(data, len, ele)) {
|
||||
_errorString = "Invalid altitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readGeoidHeight(const char *data, int len, qreal &gh)
|
||||
{
|
||||
if (!len) {
|
||||
gh = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!readFloat(data, len, gh)) {
|
||||
_errorString = "Invalid geoid height";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readTime(const char *data, int len, QTime &time)
|
||||
{
|
||||
int h, m, s, ms = 0;
|
||||
|
||||
|
||||
if (!len) {
|
||||
time = QTime();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len < 6)
|
||||
goto error;
|
||||
|
||||
h = str2int(data, 2);
|
||||
m = str2int(data + 2, 2);
|
||||
s = str2int(data + 4, 2);
|
||||
if (h < 0 || m < 0 || s < 0)
|
||||
goto error;
|
||||
|
||||
if (len > 7 && data[6] == '.') {
|
||||
if ((ms = str2int(data + 7, len - 7)) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
time = QTime(h, m, s, ms);
|
||||
if (!time.isValid())
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
_errorString = "Invalid time";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NMEAParser::readDate(const char *data, int len, QDate &date)
|
||||
{
|
||||
int y, m, d;
|
||||
|
||||
|
||||
if (!len) {
|
||||
date = QDate();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len < 6)
|
||||
goto error;
|
||||
|
||||
d = str2int(data, 2);
|
||||
m = str2int(data + 2, 2);
|
||||
y = str2int(data + 4, len - 4);
|
||||
if (d < 0 || m < 0 || y < 0)
|
||||
goto error;
|
||||
|
||||
if (len - 4 == 2)
|
||||
date = QDate(y + 2000 < QDate::currentDate().year()
|
||||
? 2000 + y : 1900 + y, m, d);
|
||||
else
|
||||
date = QDate(y, m, d);
|
||||
if (!date.isValid())
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
_errorString = "Invalid date";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NMEAParser::readLat(const char *data, int len, qreal &lat)
|
||||
{
|
||||
int d, mi;
|
||||
qreal mf;
|
||||
bool ok;
|
||||
|
||||
|
||||
if (!len) {
|
||||
lat = NAN;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len < 7 || data[4] != '.')
|
||||
goto error;
|
||||
|
||||
d = str2int(data, 2);
|
||||
mi = str2int(data + 2, 2);
|
||||
mf = QString(QByteArray::fromRawData(data + 4, len - 4)).toFloat(&ok);
|
||||
if (d < 0 || mi < 0 || !ok)
|
||||
goto error;
|
||||
|
||||
lat = d + (((qreal)mi + mf) / 60.0);
|
||||
if (lat > 90)
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
_errorString = "Invalid ltitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NMEAParser::readNS(const char *data, int len, qreal &lat)
|
||||
{
|
||||
if (!len) {
|
||||
lat = NAN;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len != 1 || !(*data == 'N' || *data == 'S')) {
|
||||
_errorString = "Invalid N/S value";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*data == 'S')
|
||||
lat = -lat;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readLon(const char *data, int len, qreal &lon)
|
||||
{
|
||||
int d, mi;
|
||||
qreal mf;
|
||||
bool ok;
|
||||
|
||||
|
||||
if (!len) {
|
||||
lon = NAN;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len < 8 || data[5] != '.')
|
||||
goto error;
|
||||
|
||||
d = str2int(data, 3);
|
||||
mi = str2int(data + 3, 2);
|
||||
mf = QString(QByteArray::fromRawData(data + 5, len - 5)).toFloat(&ok);
|
||||
if (d < 0 || mi < 0 || !ok)
|
||||
goto error;
|
||||
|
||||
lon = d + (((qreal)mi + mf) / 60.0);
|
||||
if (lon > 180)
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
_errorString = "Invalid longitude";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NMEAParser::readEW(const char *data, int len, qreal &lon)
|
||||
{
|
||||
if (!len) {
|
||||
lon = NAN;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (len != 1 || !(*data == 'E' || *data == 'W')) {
|
||||
_errorString = "Invalid E/W value";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*data == 'W')
|
||||
lon = -lon;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readRMC(const char *line, int len)
|
||||
{
|
||||
int col = 1;
|
||||
const char *vp = line;
|
||||
qreal lat, lon;
|
||||
QTime time;
|
||||
QDate date;
|
||||
bool valid = true;
|
||||
|
||||
for (const char *lp = line; lp < line + len; lp++) {
|
||||
if (*lp == ',' || *lp == '*') {
|
||||
switch (col) {
|
||||
case 1:
|
||||
if (!readTime(vp, lp - vp, time))
|
||||
return false;
|
||||
break;
|
||||
case 2:
|
||||
if (*vp != 'A')
|
||||
valid = false;
|
||||
break;
|
||||
case 3:
|
||||
if (!readLat(vp, lp - vp, lat))
|
||||
return false;
|
||||
break;
|
||||
case 4:
|
||||
if (!readNS(vp, lp - vp, lat))
|
||||
return false;
|
||||
break;
|
||||
case 5:
|
||||
if (!readLon(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 6:
|
||||
if (!readEW(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 9:
|
||||
if (!readDate(vp, lp - vp, date))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
col++;
|
||||
vp = lp + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (col < 9) {
|
||||
_errorString = "Invalid RMC sentence";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!date.isNull()) {
|
||||
if (_date.isNull() && !_time.isNull() && !_tracks.last().isEmpty())
|
||||
_tracks.last().last().setTimestamp(QDateTime(date, _time, Qt::UTC));
|
||||
_date = date;
|
||||
}
|
||||
|
||||
if (valid && !_GGA && !std::isnan(lat) && !std::isnan(lon)) {
|
||||
Trackpoint t(Coordinates(lon, lat));
|
||||
if (!_date.isNull() && !time.isNull())
|
||||
t.setTimestamp(QDateTime(_date, time, Qt::UTC));
|
||||
_tracks.last().append(t);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readGGA(const char *line, int len)
|
||||
{
|
||||
int col = 1;
|
||||
const char *vp = line;
|
||||
qreal lat, lon, ele, gh;
|
||||
|
||||
for (const char *lp = line; lp < line + len; lp++) {
|
||||
if (*lp == ',' || *lp == '*') {
|
||||
switch (col) {
|
||||
case 1:
|
||||
if (!readTime(vp, lp - vp, _time))
|
||||
return false;
|
||||
break;
|
||||
case 2:
|
||||
if (!readLat(vp, lp - vp, lat))
|
||||
return false;
|
||||
break;
|
||||
case 3:
|
||||
if (!readNS(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 4:
|
||||
if (!readLon(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 5:
|
||||
if (!readEW(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 9:
|
||||
if (!readAltitude(vp, lp - vp, ele))
|
||||
return false;
|
||||
break;
|
||||
case 10:
|
||||
if ((lp - vp) && !((lp - vp) == 1 && *vp == 'M')) {
|
||||
_errorString = "Invalid altitude units";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (!readGeoidHeight(vp, lp - vp, gh))
|
||||
return false;
|
||||
break;
|
||||
case 12:
|
||||
if ((lp - vp) && !((lp - vp) == 1 && *vp == 'M')) {
|
||||
_errorString = "Invalid geoid height units";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
col++;
|
||||
vp = lp + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (col < 12) {
|
||||
_errorString = "Invalid GGA sentence";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!std::isnan(lat) && !std::isnan(lon)) {
|
||||
Trackpoint t(Coordinates(lon, lat));
|
||||
if (!(_time.isNull() || _date.isNull()))
|
||||
t.setTimestamp(QDateTime(_date, _time, Qt::UTC));
|
||||
if (!std::isnan(ele))
|
||||
t.setElevation(ele - gh);
|
||||
_tracks.last().append(t);
|
||||
|
||||
_GGA = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readWPL(const char *line, int len)
|
||||
{
|
||||
int col = 1;
|
||||
const char *vp = line;
|
||||
qreal lat, lon;
|
||||
QString name;
|
||||
|
||||
for (const char *lp = line; lp < line + len; lp++) {
|
||||
if (*lp == ',' || *lp == '*') {
|
||||
switch (col) {
|
||||
case 1:
|
||||
if (!readLat(vp, lp - vp, lat))
|
||||
return false;
|
||||
break;
|
||||
case 2:
|
||||
if (!readNS(vp, lp - vp, lat))
|
||||
return false;
|
||||
break;
|
||||
case 3:
|
||||
if (!readLon(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 4:
|
||||
if (!readEW(vp, lp - vp, lon))
|
||||
return false;
|
||||
break;
|
||||
case 5:
|
||||
name = QString(QByteArray(vp, lp - vp));
|
||||
break;
|
||||
}
|
||||
|
||||
col++;
|
||||
vp = lp + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (col < 4) {
|
||||
_errorString = "Invalid WPL sentence";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!std::isnan(lat) && !std::isnan(lon)) {
|
||||
Waypoint w(Coordinates(lon, lat));
|
||||
w.setName(name);
|
||||
_waypoints.append(w);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::readZDA(const char *line, int len)
|
||||
{
|
||||
int col = 1;
|
||||
const char *vp = line;
|
||||
int d, m, y;
|
||||
|
||||
for (const char *lp = line; lp < line + len; lp++) {
|
||||
if (*lp == ',' || *lp == '*') {
|
||||
switch (col) {
|
||||
case 2:
|
||||
if (!(lp - vp))
|
||||
return true;
|
||||
if ((d = str2int(vp, lp - vp)) < 0) {
|
||||
_errorString = "Invalid day";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!(lp - vp))
|
||||
return true;
|
||||
if ((m = str2int(vp, lp - vp)) < 0) {
|
||||
_errorString = "Invalid month";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (!(lp - vp))
|
||||
return true;
|
||||
if ((y = str2int(vp, lp - vp)) < 0) {
|
||||
_errorString = "Invalid year";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
col++;
|
||||
vp = lp + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (col < 4) {
|
||||
_errorString = "Invalid ZDA sentence";
|
||||
return false;
|
||||
}
|
||||
|
||||
_date = QDate(y, m, d);
|
||||
if (!_date.isValid()) {
|
||||
_errorString = "Invalid date";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NMEAParser::loadFile(QFile *file)
|
||||
{
|
||||
qint64 len;
|
||||
char line[80 + 2 + 1 + 1];
|
||||
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
_date = QDate();
|
||||
_time = QTime();
|
||||
_GGA = false;
|
||||
|
||||
_tracks.append(TrackData());
|
||||
|
||||
while (!file->atEnd()) {
|
||||
len = file->readLine(line, sizeof(line));
|
||||
|
||||
if (len < 0) {
|
||||
_errorString = "I/O error";
|
||||
return false;
|
||||
} else if (len > (qint64)sizeof(line) - 1) {
|
||||
_errorString = "Line limit exceeded";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validSentence(line, len)) {
|
||||
if (!memcmp(line + 3, "RMC,", 4)) {
|
||||
if (!readRMC(line + 7, len))
|
||||
return false;
|
||||
} else if (!memcmp(line + 3, "GGA,", 4)) {
|
||||
if (!readGGA(line + 7, len))
|
||||
return false;
|
||||
} else if (!memcmp(line + 3, "WPL,", 4)) {
|
||||
if (!readWPL(line + 7, len))
|
||||
return false;
|
||||
} else if (!memcmp(line + 3, "ZDA,", 4)) {
|
||||
if (!readZDA(line + 7, len))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
if (!_tracks.last().size() && !_waypoints.size()) {
|
||||
_errorString = "No usable NMEA sentence found";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
43
src/nmeaparser.h
Normal file
43
src/nmeaparser.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef NMEAPARSER_H
|
||||
#define NMEAPARSER_H
|
||||
|
||||
#include <QDate>
|
||||
#include "parser.h"
|
||||
|
||||
|
||||
class NMEAParser : public Parser
|
||||
{
|
||||
public:
|
||||
NMEAParser(QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Waypoint> &waypoints) : Parser(tracks, routes, waypoints)
|
||||
{_errorLine = 0; _GGA = false;}
|
||||
~NMEAParser() {}
|
||||
|
||||
bool loadFile(QFile *file);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
bool readEW(const char *data, int len, qreal &lon);
|
||||
bool readLon(const char *data, int len, qreal &lon);
|
||||
bool readNS(const char *data, int len, qreal &lat);
|
||||
bool readLat(const char *data, int len, qreal &lat);
|
||||
bool readDate(const char *data, int len, QDate &date);
|
||||
bool readTime(const char *data, int len, QTime &time);
|
||||
bool readAltitude(const char *data, int len, qreal &ele);
|
||||
bool readGeoidHeight(const char *data, int len, qreal &gh);
|
||||
|
||||
bool readRMC(const char *line, int len);
|
||||
bool readGGA(const char *line, int len);
|
||||
bool readWPL(const char *line, int len);
|
||||
bool readZDA(const char *line, int len);
|
||||
|
||||
int _errorLine;
|
||||
QString _errorString;
|
||||
|
||||
QDate _date;
|
||||
QTime _time;
|
||||
bool _GGA;
|
||||
};
|
||||
|
||||
#endif // NMEAPARSER_H
|
9
src/path.cpp
Normal file
9
src/path.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "path.h"
|
||||
|
||||
QDebug operator<<(QDebug dbg, const PathPoint &point)
|
||||
{
|
||||
dbg.nospace() << "PathPoint(" << point.distance() << ", "
|
||||
<< point.coordinates() << ")";
|
||||
|
||||
return dbg.maybeSpace();
|
||||
}
|
21
src/path.h
21
src/path.h
@ -4,6 +4,25 @@
|
||||
#include <QVector>
|
||||
#include "coordinates.h"
|
||||
|
||||
typedef QVector<Coordinates> Path;
|
||||
class PathPoint
|
||||
{
|
||||
public:
|
||||
PathPoint() :
|
||||
_coordinates(Coordinates()), _distance(NAN) {}
|
||||
PathPoint(const Coordinates &coordinates, qreal distance)
|
||||
: _coordinates(coordinates), _distance(distance) {}
|
||||
|
||||
const Coordinates &coordinates() const {return _coordinates;}
|
||||
qreal distance() const {return _distance;}
|
||||
|
||||
private:
|
||||
Coordinates _coordinates;
|
||||
qreal _distance;
|
||||
};
|
||||
|
||||
Q_DECLARE_TYPEINFO(PathPoint, Q_PRIMITIVE_TYPE);
|
||||
QDebug operator<<(QDebug dbg, const PathPoint &point);
|
||||
|
||||
typedef QVector<PathPoint> Path;
|
||||
|
||||
#endif // PATH_H
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <cmath>
|
||||
#include <QApplication>
|
||||
#include <QCursor>
|
||||
#include <QPainter>
|
||||
@ -26,7 +27,6 @@ PathItem::PathItem(QGraphicsItem *parent) : QGraphicsObject(parent)
|
||||
_pen = QPen(brush, PATH_WIDTH);
|
||||
|
||||
_units = Metric;
|
||||
_distance = 0;
|
||||
|
||||
_marker = new MarkerItem(this);
|
||||
|
||||
@ -72,14 +72,48 @@ void PathItem::setUnits(enum Units units)
|
||||
_units = units;
|
||||
}
|
||||
|
||||
QPointF PathItem::position(qreal x) const
|
||||
{
|
||||
int low = 0;
|
||||
int high = _distance.count() - 1;
|
||||
int mid = 0;
|
||||
|
||||
|
||||
Q_ASSERT(_distance.count() == _path.elementCount());
|
||||
Q_ASSERT(high > low);
|
||||
Q_ASSERT(x >= _distance.at(low) && x <= _distance.at(high));
|
||||
|
||||
while (low <= high) {
|
||||
mid = low + ((high - low) / 2);
|
||||
qreal val = _distance.at(mid);
|
||||
if (val > x)
|
||||
high = mid - 1;
|
||||
else if (val < x)
|
||||
low = mid + 1;
|
||||
else
|
||||
return _path.elementAt(mid);
|
||||
}
|
||||
|
||||
QLineF l;
|
||||
qreal p1, p2;
|
||||
if (_distance.at(mid) < x) {
|
||||
l = QLineF(_path.elementAt(mid), _path.elementAt(mid+1));
|
||||
p1 = _distance.at(mid); p2 = _distance.at(mid+1);
|
||||
} else {
|
||||
l = QLineF(_path.elementAt(mid-1), _path.elementAt(mid));
|
||||
p1 = _distance.at(mid-1); p2 = _distance.at(mid);
|
||||
}
|
||||
|
||||
return l.pointAt((x - p1) / (p2 - p1));
|
||||
}
|
||||
|
||||
void PathItem::moveMarker(qreal distance)
|
||||
{
|
||||
if (distance > _distance)
|
||||
_marker->setVisible(false);
|
||||
else {
|
||||
if (distance >= _distance.first() && distance <= _distance.last()) {
|
||||
_marker->setVisible(true);
|
||||
_marker->setPos(_path.pointAtPercent(distance / _distance));
|
||||
}
|
||||
_marker->setPos(position(distance));
|
||||
} else
|
||||
_marker->setVisible(false);
|
||||
}
|
||||
|
||||
void PathItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||
|
@ -34,6 +34,7 @@ signals:
|
||||
protected:
|
||||
void updateShape();
|
||||
|
||||
QVector<qreal> _distance;
|
||||
QPainterPath _path;
|
||||
QPainterPath _shape;
|
||||
QPen _pen;
|
||||
@ -41,9 +42,10 @@ protected:
|
||||
MarkerItem *_marker;
|
||||
|
||||
Units _units;
|
||||
qreal _distance;
|
||||
|
||||
private:
|
||||
QPointF position(qreal distance) const;
|
||||
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
};
|
||||
|
@ -4,13 +4,16 @@
|
||||
#include <QVector>
|
||||
#include "routedata.h"
|
||||
#include "graph.h"
|
||||
#include "path.h"
|
||||
|
||||
class Route
|
||||
{
|
||||
public:
|
||||
Route(const RouteData &data);
|
||||
|
||||
const RouteData &route() const {return _data;}
|
||||
const RouteData &routeData() const {return _data;}
|
||||
const QVector<qreal> &distanceData() const {return _distance;}
|
||||
|
||||
Graph elevation() const;
|
||||
|
||||
qreal distance() const;
|
||||
|
@ -16,7 +16,7 @@ QString RouteItem::toolTip()
|
||||
if (!_desc.isEmpty())
|
||||
tt.insert(qApp->translate("RouteItem", "Description"), _desc);
|
||||
tt.insert(qApp->translate("RouteItem", "Distance"),
|
||||
Format::distance(_distance, _units));
|
||||
Format::distance(_distance.last(), _units));
|
||||
|
||||
return tt.toString();
|
||||
}
|
||||
@ -24,27 +24,33 @@ QString RouteItem::toolTip()
|
||||
RouteItem::RouteItem(const Route &route, QGraphicsItem *parent)
|
||||
: PathItem(parent)
|
||||
{
|
||||
const RouteData &r = route.route();
|
||||
Q_ASSERT(r.count() >= 2);
|
||||
const RouteData &r = route.routeData();
|
||||
const QVector<qreal> &d = route.distanceData();
|
||||
QPointF p;
|
||||
|
||||
|
||||
Q_ASSERT(r.count() >= 2);
|
||||
Q_ASSERT(r.size() == d.size());
|
||||
|
||||
_name = r.name();
|
||||
_desc = r.description();
|
||||
|
||||
new WaypointItem(r.at(0), this);
|
||||
p = r.at(0).coordinates().toMercator();
|
||||
new WaypointItem(r.first(), this);
|
||||
p = r.first().coordinates().toMercator();
|
||||
_path.moveTo(QPointF(p.x(), -p.y()));
|
||||
_distance.append(d.first());
|
||||
for (int i = 1; i < r.size(); i++) {
|
||||
if (r.at(i).coordinates() == r.at(i-1).coordinates())
|
||||
continue;
|
||||
p = r.at(i).coordinates().toMercator();
|
||||
_path.lineTo(QPointF(p.x(), -p.y()));
|
||||
_distance.append(d.at(i));
|
||||
new WaypointItem(r.at(i), this);
|
||||
}
|
||||
|
||||
updateShape();
|
||||
|
||||
_distance = route.distance();
|
||||
|
||||
_marker->setPos(_path.pointAtPercent(0));
|
||||
_marker->setPos(_path.elementAt(0));
|
||||
|
||||
_pen.setStyle(Qt::DotLine);
|
||||
|
||||
|
@ -213,13 +213,13 @@ QDateTime Track::date() const
|
||||
return (_data.size()) ? _data.first().timestamp() : QDateTime();
|
||||
}
|
||||
|
||||
Path Track::track() const
|
||||
Path Track::path() const
|
||||
{
|
||||
Path ret;
|
||||
|
||||
for (int i = 0; i < _data.size(); i++)
|
||||
if (!_outliers.contains(i))
|
||||
ret.append(_data.at(i).coordinates());
|
||||
ret.append(PathPoint(_data.at(i).coordinates(), _distance.at(i)));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class Track
|
||||
public:
|
||||
Track(const TrackData &data);
|
||||
|
||||
Path track() const;
|
||||
Path path() const;
|
||||
Graph elevation() const;
|
||||
Graph speed() const;
|
||||
Graph heartRate() const;
|
||||
|
@ -15,7 +15,7 @@ QString TrackItem::toolTip()
|
||||
if (!_desc.isEmpty())
|
||||
tt.insert(qApp->translate("TrackItem", "Description"), _desc);
|
||||
tt.insert(qApp->translate("TrackItem", "Distance"),
|
||||
Format::distance(_distance, _units));
|
||||
Format::distance(_distance.last(), _units));
|
||||
if (_time > 0)
|
||||
tt.insert(qApp->translate("TrackItem", "Time"),
|
||||
Format::timeSpan(_time));
|
||||
@ -30,14 +30,18 @@ TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
|
||||
: PathItem(parent)
|
||||
{
|
||||
QPointF p;
|
||||
QVector<Coordinates> t = track.track();
|
||||
Q_ASSERT(t.count() >= 2);
|
||||
const Path &path = track.path();
|
||||
Q_ASSERT(path.count() >= 2);
|
||||
|
||||
p = t.first().toMercator();
|
||||
p = path.first().coordinates().toMercator();
|
||||
_path.moveTo(QPointF(p.x(), -p.y()));
|
||||
for (int i = 1; i < t.size(); i++) {
|
||||
p = t.at(i).toMercator();
|
||||
_distance.append(path.first().distance());
|
||||
for (int i = 1; i < path.size(); i++) {
|
||||
if (path.at(i).coordinates() == path.at(i-1).coordinates())
|
||||
continue;
|
||||
p = path.at(i).coordinates().toMercator();
|
||||
_path.lineTo(QPointF(p.x(), -p.y()));
|
||||
_distance.append(path.at(i).distance());
|
||||
}
|
||||
|
||||
updateShape();
|
||||
@ -45,10 +49,9 @@ TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
|
||||
_name = track.name();
|
||||
_desc = track.description();
|
||||
_date = track.date();
|
||||
_distance = track.distance();
|
||||
_time = track.time();
|
||||
|
||||
_marker->setPos(_path.pointAtPercent(0));
|
||||
_marker->setPos(_path.elementAt(0));
|
||||
|
||||
setToolTip(toolTip());
|
||||
}
|
||||
|
Reference in New Issue
Block a user