mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-23 23:24:24 +02:00
Compare commits
31 Commits
13.25
...
22c7ea7de6
Author | SHA1 | Date | |
---|---|---|---|
22c7ea7de6 | |||
78f2e1f47d | |||
364867101f | |||
28a7e94986 | |||
3474b8db96 | |||
c28f12e0bb | |||
749282085e | |||
3b276882e0 | |||
9ec5ea45d8 | |||
7b516ca5e4 | |||
5d86852299 | |||
068ac5e91d | |||
7b6640761a | |||
da95287a8d | |||
7e200d1cce | |||
ffaf4250ac | |||
39ad9cb7ad | |||
219e4c3762 | |||
09858f603d | |||
225e6da48b | |||
23c398caf7 | |||
17ef334c4c | |||
b01dcc4569 | |||
762e374adf | |||
c68a2a1ac4 | |||
672fca9dd5 | |||
8c2e2f65c3 | |||
c5a7a4bb0e | |||
4f77d7a40e | |||
285a9a55f3 | |||
9c00ff53c2 |
@ -1,4 +1,4 @@
|
||||
version: 13.25.{build}
|
||||
version: 13.27.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
@ -13,7 +13,7 @@ environment:
|
||||
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
|
||||
NSISDEF: /DOPENSSL /DANGLE
|
||||
- QTDIR: C:\Qt\6.7\msvc2019_64
|
||||
OPENSSLDIR: C:\OpenSSL-v32-Win64\bin
|
||||
OPENSSLDIR: C:\OpenSSL-v33-Win64\bin
|
||||
NSISDEF: /DQT6 /DOPENSSL
|
||||
|
||||
install:
|
||||
|
6
.github/workflows/android.yml
vendored
6
.github/workflows/android.yml
vendored
@ -26,14 +26,12 @@ jobs:
|
||||
- name: Setup NDK path
|
||||
run: echo "ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk/23.1.7779620/" >> $GITHUB_ENV
|
||||
- name: Install Qt (Desktop)
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
aqtversion: '==3.1.*'
|
||||
version: '6.4.0'
|
||||
- name: Install Qt (Android)
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
aqtversion: '==3.1.*'
|
||||
version: '6.4.0'
|
||||
target: 'android'
|
||||
arch: 'android_arm64_v8a'
|
||||
|
6
.github/workflows/osx.yml
vendored
6
.github/workflows/osx.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: '5.15.2'
|
||||
- name: Create localization
|
||||
@ -37,9 +37,9 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: '6.7.1'
|
||||
version: '6.7.2'
|
||||
modules: qtpositioning qtserialport qtimageformats
|
||||
- name: Create localization
|
||||
run: lrelease gpxsee.pro
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.25
|
||||
VERSION = 13.27
|
||||
|
||||
|
||||
QT += core \
|
||||
|
@ -486,7 +486,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Ĉiuj</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
|
@ -30,12 +30,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/cadencegraph.cpp" line="28"/>
|
||||
<source>Avg</source>
|
||||
<translation>promedio</translation>
|
||||
<translation>Med.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/cadencegraph.cpp" line="30"/>
|
||||
<source>Max</source>
|
||||
<translation>máx.</translation>
|
||||
<translation>Máx.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/cadencegraph.cpp" line="33"/>
|
||||
|
@ -492,17 +492,17 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Kaikki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
<source>Raster only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Vain rasteri</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="378"/>
|
||||
<source>Vector only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Vain vektori</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="385"/>
|
||||
|
@ -374,32 +374,32 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="221"/>
|
||||
<source>Open...</source>
|
||||
<translation>Megnyitás...</translation>
|
||||
<translation>Megnyitás…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="228"/>
|
||||
<source>Open directory...</source>
|
||||
<translation>Könyvtár megnyitása...</translation>
|
||||
<translation>Könyvtár megnyitása…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="233"/>
|
||||
<source>Print...</source>
|
||||
<translation>Nyomtatás...</translation>
|
||||
<translation>Nyomtatás…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="239"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportálás PDF-be...</translation>
|
||||
<translation>Exportálás PDF-be…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="246"/>
|
||||
<source>Export to PNG...</source>
|
||||
<translation>Exportálás PNG-be...</translation>
|
||||
<translation>Exportálás PNG-be…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="253"/>
|
||||
<source>Close</source>
|
||||
<translation>Fájl bezárása</translation>
|
||||
<translation>Bezárás</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="260"/>
|
||||
@ -409,7 +409,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="266"/>
|
||||
<source>Statistics...</source>
|
||||
<translation>Statisztika...</translation>
|
||||
<translation>Statisztika…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="276"/>
|
||||
@ -419,7 +419,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="288"/>
|
||||
<source>Load POI file...</source>
|
||||
<translation>POI fájl betöltése...</translation>
|
||||
<translation>POI fájl betöltése…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="292"/>
|
||||
@ -459,12 +459,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="339"/>
|
||||
<source>Load map...</source>
|
||||
<translation>Térkép betöltése...</translation>
|
||||
<translation>Térkép betöltése…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="344"/>
|
||||
<source>Load map directory...</source>
|
||||
<translation>Térképmappa megadása...</translation>
|
||||
<translation>Térképmappa megadása…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="347"/>
|
||||
@ -683,7 +683,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="604"/>
|
||||
<source>Options...</source>
|
||||
<translation>Beállítások...</translation>
|
||||
<translation>Beállítások…</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="611"/>
|
||||
|
@ -486,17 +486,17 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>모두</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
<source>Raster only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>래스터만</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="378"/>
|
||||
<source>Vector only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>벡터만</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="385"/>
|
||||
@ -733,7 +733,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="695"/>
|
||||
<source>Layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>레이어</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="704"/>
|
||||
@ -1692,7 +1692,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="388"/>
|
||||
<source>Detect pauses</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>일시 중지 감지</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="391"/>
|
||||
@ -1796,7 +1796,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="537"/>
|
||||
<source>Detection:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>감지:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="538"/>
|
||||
|
@ -486,17 +486,17 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Alle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
<source>Raster only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Kun raster</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="378"/>
|
||||
<source>Vector only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Kun vektor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="385"/>
|
||||
@ -723,7 +723,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="695"/>
|
||||
<source>Layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Lag</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="704"/>
|
||||
|
@ -492,17 +492,17 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Все</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
<source>Raster only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Только растр</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="378"/>
|
||||
<source>Vector only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Только вектор</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="385"/>
|
||||
@ -699,7 +699,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="695"/>
|
||||
<source>Layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Слои</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="721"/>
|
||||
|
@ -504,17 +504,17 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="370"/>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Alla</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="374"/>
|
||||
<source>Raster only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Endast raster</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="378"/>
|
||||
<source>Vector only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Endast vektor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="385"/>
|
||||
@ -711,7 +711,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="695"/>
|
||||
<source>Layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Lager</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="721"/>
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.25"
|
||||
!define VERSION "13.27"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -248,30 +248,33 @@ void GraphItem::setScale(qreal sx, qreal sy)
|
||||
if (_sx == sx && _sy == sy)
|
||||
return;
|
||||
|
||||
prepareGeometryChange();
|
||||
|
||||
_sx = sx; _sy = sy;
|
||||
|
||||
updatePath();
|
||||
}
|
||||
|
||||
void GraphItem::updatePath()
|
||||
{
|
||||
if (_sx == 0 && _sy == 0)
|
||||
return;
|
||||
|
||||
prepareGeometryChange();
|
||||
|
||||
_path = QPainterPath();
|
||||
|
||||
if (!(_type == Time && !_time)) {
|
||||
if (!((_type == Time && !_time) || _sx == 0 || _sy == 0)) {
|
||||
for (int i = 0; i < _graph.size(); i++) {
|
||||
const GraphSegment &segment = _graph.at(i);
|
||||
|
||||
_path.moveTo(segment.first().x(_type) * _sx, -segment.first().y()
|
||||
QPointF p1(segment.first().x(_type) * _sx, -segment.first().y()
|
||||
* _sy);
|
||||
for (int i = 1; i < segment.size(); i++)
|
||||
_path.lineTo(segment.at(i).x(_type) * _sx, -segment.at(i).y()
|
||||
|
||||
_path.moveTo(p1);
|
||||
for (int i = 1; i < segment.size(); i++) {
|
||||
QPointF p2(segment.at(i).x(_type) * _sx, -segment.at(i).y()
|
||||
* _sy);
|
||||
QPointF diff(p1 - p2);
|
||||
if (qAbs(diff.x()) >= 1.0 || qAbs(diff.y()) >= 1.0) {
|
||||
_path.lineTo(p2);
|
||||
p1 = p2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,8 +264,7 @@ QRectF GraphView::bounds() const
|
||||
|
||||
void GraphView::redraw()
|
||||
{
|
||||
if (!_graphs.isEmpty())
|
||||
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN));
|
||||
redraw(viewport()->size() - QSizeF(MARGIN, MARGIN));
|
||||
}
|
||||
|
||||
void GraphView::redraw(const QSizeF &size)
|
||||
@ -275,7 +274,6 @@ void GraphView::redraw(const QSizeF &size)
|
||||
RangeF rx, ry;
|
||||
qreal sx, sy;
|
||||
|
||||
|
||||
if (_bounds.isNull()) {
|
||||
removeItem(_xAxis);
|
||||
removeItem(_yAxis);
|
||||
@ -284,7 +282,10 @@ void GraphView::redraw(const QSizeF &size)
|
||||
removeItem(_slider);
|
||||
removeItem(_info);
|
||||
removeItem(_grid);
|
||||
addItem(_message);
|
||||
if (_graphs.isEmpty())
|
||||
removeItem(_message);
|
||||
else
|
||||
addItem(_message);
|
||||
_scene->setSceneRect(_scene->itemsBoundingRect());
|
||||
return;
|
||||
}
|
||||
|
@ -1171,6 +1171,8 @@ void GUI::loadData(const Data &data)
|
||||
|
||||
for (int i = 0; i < _tabs.count(); i++)
|
||||
graphs.append(_tabs.at(i)->loadData(data, _map));
|
||||
/* Refreshing the splitter is necessary to update the map viewport and
|
||||
properly fit the data! */
|
||||
if (updateGraphTabs())
|
||||
_splitter->refresh();
|
||||
paths = _mapView->loadData(data);
|
||||
|
@ -69,7 +69,7 @@ void PathItem::updateShape()
|
||||
_shape = s.createStroke(_painterPath);
|
||||
}
|
||||
|
||||
void PathItem::addSegment(const Coordinates &c1, const Coordinates &c2)
|
||||
bool PathItem::addSegment(const Coordinates &c1, const Coordinates &c2)
|
||||
{
|
||||
if (fabs(c1.lon() - c2.lon()) > 180.0) {
|
||||
// Split segment on date line crossing
|
||||
@ -91,8 +91,21 @@ void PathItem::addSegment(const Coordinates &c1, const Coordinates &c2)
|
||||
_painterPath.moveTo(_map->ll2xy(Coordinates(180, p.y())));
|
||||
}
|
||||
_painterPath.lineTo(_map->ll2xy(c2));
|
||||
} else
|
||||
_painterPath.lineTo(_map->ll2xy(c2));
|
||||
|
||||
return true;
|
||||
} else {
|
||||
QPointF p(_map->ll2xy(c2));
|
||||
const QPainterPath::Element &e = _painterPath.elementAt(
|
||||
_painterPath.elementCount() - 1);
|
||||
qreal dx = qAbs(p.x() - e.x);
|
||||
qreal dy = qAbs(p.y() - e.y);
|
||||
|
||||
if (dx >= 1.0 || dy >= 1.0) {
|
||||
_painterPath.lineTo(p);
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PathItem::updatePainterPath()
|
||||
@ -101,24 +114,29 @@ void PathItem::updatePainterPath()
|
||||
|
||||
for (int i = 0; i < _path.size(); i++) {
|
||||
const PathSegment &segment = _path.at(i);
|
||||
_painterPath.moveTo(_map->ll2xy(segment.first().coordinates()));
|
||||
const PathPoint *p1 = &segment.first();
|
||||
|
||||
_painterPath.moveTo(_map->ll2xy(p1->coordinates()));
|
||||
|
||||
for (int j = 1; j < segment.size(); j++) {
|
||||
const PathPoint &p1 = segment.at(j-1);
|
||||
const PathPoint &p2 = segment.at(j);
|
||||
unsigned n = segments(p2.distance() - p1.distance());
|
||||
const PathPoint *p2 = &segment.at(j);
|
||||
double dist = p2->distance() - p1->distance();
|
||||
|
||||
if (n > 1) {
|
||||
GreatCircle gc(p1.coordinates(), p2.coordinates());
|
||||
Coordinates last = p1.coordinates();
|
||||
if (dist > GEOGRAPHICAL_MILE) {
|
||||
GreatCircle gc(p1->coordinates(), p2->coordinates());
|
||||
Coordinates last(p1->coordinates());
|
||||
unsigned n = segments(dist);
|
||||
|
||||
for (unsigned k = 1; k <= n; k++) {
|
||||
Coordinates c(gc.pointAt(k/(double)n));
|
||||
addSegment(last, c);
|
||||
last = c;
|
||||
}
|
||||
} else
|
||||
addSegment(p1.coordinates(), p2.coordinates());
|
||||
p1 = p2;
|
||||
} else {
|
||||
if (addSegment(p1->coordinates(), p2->coordinates()))
|
||||
p1 = p2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -289,12 +307,14 @@ QPointF PathItem::position(qreal x) const
|
||||
p1 = seg->at(mid-1).distance(); p2 = seg->at(mid).distance();
|
||||
}
|
||||
|
||||
unsigned n = segments(p2 - p1);
|
||||
if (n > 1) {
|
||||
qreal dist = p2 - p1;
|
||||
|
||||
if (dist > GEOGRAPHICAL_MILE) {
|
||||
GreatCircle gc(c1, c2);
|
||||
unsigned n = segments(dist);
|
||||
|
||||
// Great circle point
|
||||
double f = (x - p1) / (p2 - p1);
|
||||
double f = (x - p1) / (dist);
|
||||
QPointF p(_map->ll2xy(gc.pointAt(f)));
|
||||
|
||||
// Segment line of the great circle path
|
||||
@ -310,7 +330,7 @@ QPointF PathItem::position(qreal x) const
|
||||
+ l.p1().y());
|
||||
} else {
|
||||
QLineF l(_map->ll2xy(c1), _map->ll2xy(c2));
|
||||
return l.pointAt((x - p1) / (p2 - p1));
|
||||
return l.pointAt((x - p1) / (dist));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ private:
|
||||
QPointF position(qreal distance) const;
|
||||
void updatePainterPath();
|
||||
void updateShape();
|
||||
void addSegment(const Coordinates &c1, const Coordinates &c2);
|
||||
bool addSegment(const Coordinates &c1, const Coordinates &c2);
|
||||
void setMarkerInfo(qreal pos);
|
||||
void updateColor();
|
||||
void updateWidth();
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <QDataStream>
|
||||
#include <QTimeZone>
|
||||
#include "common/tifffile.h"
|
||||
#include "common/util.h"
|
||||
#include "exifparser.h"
|
||||
@ -213,7 +214,7 @@ bool EXIFParser::parseTIFF(QFile *file, QVector<Waypoint> &waypoints)
|
||||
GPSIFD.value(GPSAltitudeRef)));
|
||||
wp.setTimestamp(QDateTime(QDate::fromString(text(tiff,
|
||||
GPSIFD.value(GPSDateStamp)), "yyyy:MM:dd"), time(tiff,
|
||||
GPSIFD.value(GPSTimeStamp)), Qt::UTC));
|
||||
GPSIFD.value(GPSTimeStamp)), QTimeZone::utc()));
|
||||
wp.setDescription(text(tiff, IFD0.value(ImageDescription)).trimmed());
|
||||
|
||||
waypoints.append(wp);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <QtEndian>
|
||||
#include <QTimeZone>
|
||||
#include "GUI/format.h"
|
||||
#include "fitparser.h"
|
||||
|
||||
@ -307,7 +308,7 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
switch (field->id) {
|
||||
case 1:
|
||||
waypoint.setTimestamp(QDateTime::fromSecsSinceEpoch(
|
||||
val.toUInt() + 631065600, Qt::UTC));
|
||||
val.toUInt() + 631065600, QTimeZone::utc()));
|
||||
break;
|
||||
case 2:
|
||||
waypoint.rcoordinates().setLat(
|
||||
@ -380,7 +381,7 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
} else if (def->globalId == RECORD) {
|
||||
if (ctx.trackpoint.coordinates().isValid()) {
|
||||
ctx.trackpoint.setTimestamp(QDateTime::fromSecsSinceEpoch(
|
||||
ctx.timestamp + 631065600, Qt::UTC));
|
||||
ctx.timestamp + 631065600, QTimeZone::utc()));
|
||||
ctx.trackpoint.setRatio(ctx.ratio);
|
||||
ctx.segment.append(ctx.trackpoint);
|
||||
ctx.trackpoint = Trackpoint();
|
||||
@ -391,7 +392,7 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
} else if (def->globalId == LOCATION) {
|
||||
if (waypoint.coordinates().isValid()) {
|
||||
waypoint.setTimestamp(QDateTime::fromSecsSinceEpoch(ctx.timestamp
|
||||
+ 631065600, Qt::UTC));
|
||||
+ 631065600, QTimeZone::utc()));
|
||||
ctx.waypoints.append(waypoint);
|
||||
}
|
||||
} else if (def->globalId == LAP && trigger >= 0) {
|
||||
@ -401,7 +402,7 @@ bool FITParser::parseData(CTX &ctx, const MessageDefinition *def)
|
||||
else
|
||||
waypoint.setName("Lap " + QString::number(++ctx.laps));
|
||||
waypoint.setTimestamp(QDateTime::fromSecsSinceEpoch(ctx.timestamp
|
||||
+ 631065600, Qt::UTC));
|
||||
+ 631065600, QTimeZone::utc()));
|
||||
if (trigger != 7 || ctx.laps > 1)
|
||||
ctx.waypoints.append(waypoint);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <cstring>
|
||||
#include <QTimeZone>
|
||||
#include "common/util.h"
|
||||
#include "igcparser.h"
|
||||
|
||||
@ -160,7 +161,7 @@ bool IGCParser::readBRecord(CTX &ctx, const char *line, int len,
|
||||
ctx.time = time;
|
||||
|
||||
Trackpoint t(Coordinates(lon, lat));
|
||||
t.setTimestamp(QDateTime(ctx.date, ctx.time, Qt::UTC));
|
||||
t.setTimestamp(QDateTime(ctx.date, ctx.time, QTimeZone::utc()));
|
||||
t.setElevation(ele);
|
||||
segment.append(t);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <cstring>
|
||||
#include <QTimeZone>
|
||||
#include "common/util.h"
|
||||
#include "nmeaparser.h"
|
||||
|
||||
@ -282,7 +283,8 @@ bool NMEAParser::readRMC(CTX &ctx, const char *line, int len,
|
||||
|
||||
if (!date.isNull()) {
|
||||
if (ctx.date.isNull() && !ctx.time.isNull() && !segment.isEmpty())
|
||||
segment.last().setTimestamp(QDateTime(date, ctx.time, Qt::UTC));
|
||||
segment.last().setTimestamp(QDateTime(date, ctx.time,
|
||||
QTimeZone::utc()));
|
||||
ctx.date = date;
|
||||
}
|
||||
|
||||
@ -290,7 +292,7 @@ bool NMEAParser::readRMC(CTX &ctx, const char *line, int len,
|
||||
if (valid && !ctx.GGA && c.isValid()) {
|
||||
Trackpoint t(c);
|
||||
if (!ctx.date.isNull() && !time.isNull())
|
||||
t.setTimestamp(QDateTime(ctx.date, time, Qt::UTC));
|
||||
t.setTimestamp(QDateTime(ctx.date, time, QTimeZone::utc()));
|
||||
segment.append(t);
|
||||
}
|
||||
|
||||
@ -363,7 +365,7 @@ bool NMEAParser::readGGA(CTX &ctx, const char *line, int len,
|
||||
if (c.isValid()) {
|
||||
Trackpoint t(c);
|
||||
if (!(ctx.time.isNull() || ctx.date.isNull()))
|
||||
t.setTimestamp(QDateTime(ctx.date, ctx.time, Qt::UTC));
|
||||
t.setTimestamp(QDateTime(ctx.date, ctx.time, QTimeZone::utc()));
|
||||
if (!std::isnan(ele))
|
||||
t.setElevation(ele - gh);
|
||||
segment.append(t);
|
||||
|
@ -46,7 +46,7 @@ bool OMDParser::readHeaderFile(const QString &omdPath, Header &hdr)
|
||||
quint8 avgHr = buffer[12];
|
||||
quint8 maxHr = buffer[13];
|
||||
|
||||
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), Qt::UTC);
|
||||
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m), QTimeZone::utc());
|
||||
if (!date.isValid()) {
|
||||
qWarning("%s: invalid date", qPrintable(path));
|
||||
return false;
|
||||
@ -80,7 +80,7 @@ bool OMDParser::readF1(const char *chunk, const Header &hdr, Sequence &seq,
|
||||
return false;
|
||||
}
|
||||
t.setTimestamp(QDateTime(hdr.date.date(),
|
||||
hdr.date.time().addSecs(sec), Qt::UTC));
|
||||
hdr.date.time().addSecs(sec), QTimeZone::utc()));
|
||||
if (hdr.elevation)
|
||||
t.setElevation(alt);
|
||||
|
||||
@ -200,7 +200,7 @@ bool GHPParser::readHeaderFile(const QString &ghpPath, Header &hdr)
|
||||
quint8 avgHr = buffer[61];
|
||||
quint8 maxHr = buffer[60];
|
||||
|
||||
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), Qt::UTC);
|
||||
QDateTime date(QDate(Y + 2000, M, D), QTime(h, m, s), QTimeZone::utc());
|
||||
if (!date.isValid()) {
|
||||
qWarning("%s: invalid date", qPrintable(path));
|
||||
return false;
|
||||
@ -230,7 +230,7 @@ bool GHPParser::readF0(const char *chunk, const Header &hdr, int &time,
|
||||
return false;
|
||||
}
|
||||
t.setTimestamp(QDateTime(hdr.date.date(),
|
||||
hdr.date.time().addMSecs(time * 100), Qt::UTC));
|
||||
hdr.date.time().addMSecs(time * 100), QTimeZone::utc()));
|
||||
t.setSpeed(speed / 360.0);
|
||||
t.setElevation(alt);
|
||||
if (hdr.hr)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef ONMOVEPARSERS_H
|
||||
#define ONMOVEPARSERS_H
|
||||
|
||||
#include <QTimeZone>
|
||||
#include "parser.h"
|
||||
|
||||
class OMDParser : public Parser
|
||||
@ -14,8 +15,8 @@ public:
|
||||
private:
|
||||
struct Header
|
||||
{
|
||||
Header() : date(QDateTime(QDate(1970, 1, 1), QTime(0, 0), Qt::UTC)),
|
||||
elevation(true), hr(true) {}
|
||||
Header() : date(QDateTime(QDate(1970, 1, 1), QTime(0, 0),
|
||||
QTimeZone::utc())), elevation(true), hr(true) {}
|
||||
|
||||
QDateTime date;
|
||||
bool elevation;
|
||||
@ -50,8 +51,8 @@ public:
|
||||
private:
|
||||
struct Header
|
||||
{
|
||||
Header() : date(QDateTime(QDate(1970, 1, 1), QTime(0, 0), Qt::UTC)),
|
||||
hr(true) {}
|
||||
Header() : date(QDateTime(QDate(1970, 1, 1), QTime(0, 0),
|
||||
QTimeZone::utc())), hr(true) {}
|
||||
|
||||
QDateTime date;
|
||||
bool hr;
|
||||
|
@ -12,6 +12,8 @@ int main(int argc, char *argv[])
|
||||
qRegisterMetaTypeStreamOperators<TimeZoneInfo>("TimeZoneInfo");
|
||||
#else // QT6
|
||||
qRegisterMetaType<TimeZoneInfo>("TimeZoneInfo");
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
|
||||
Qt::HighDpiScaleFactorRoundingPolicy::Round);
|
||||
#endif // QT6
|
||||
|
||||
QSurfaceFormat fmt;
|
||||
|
@ -22,7 +22,7 @@ static qint16 limit(const DEMTile *tile, quint16 factor)
|
||||
|
||||
void DEMFile::clear()
|
||||
{
|
||||
_levels.clear();
|
||||
_levels = QVector<Level>();
|
||||
}
|
||||
|
||||
bool DEMFile::load(Handle &hdl)
|
||||
|
@ -25,7 +25,7 @@ private:
|
||||
{
|
||||
if (!_file->readVUInt32SW(_hdl, 4, _value))
|
||||
return false;
|
||||
_shift = (quint8)-8;
|
||||
_shift = -8;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ private:
|
||||
_value <<= bits;
|
||||
_shift += bits;
|
||||
|
||||
while (-1 < (qint8)_shift) {
|
||||
while (_shift >= 0) {
|
||||
if (!_file->readByte(_hdl, &data))
|
||||
return false;
|
||||
|
||||
@ -53,7 +53,7 @@ private:
|
||||
const SubFile *_file;
|
||||
SubFile::Handle &_hdl;
|
||||
quint32 _value;
|
||||
quint8 _shift;
|
||||
qint8 _shift;
|
||||
};
|
||||
|
||||
bool readLine(BitStream &bs);
|
||||
|
@ -161,6 +161,34 @@ static QImage railroad(qreal ratio)
|
||||
return img;
|
||||
}
|
||||
|
||||
static QImage fence(qreal ratio)
|
||||
{
|
||||
QImage img(8 * ratio, 3 * ratio, QImage::Format_ARGB32_Premultiplied);
|
||||
img.setDevicePixelRatio(ratio);
|
||||
img.fill(Qt::transparent);
|
||||
QPainter p(&img);
|
||||
p.setPen(QPen(Qt::gray, 1));
|
||||
p.drawLine(0, 0, 0, 2);
|
||||
p.drawLine(0, 1, 7, 1);
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
static QImage pipeline(qreal ratio)
|
||||
{
|
||||
QImage img(10 * ratio, 4 * ratio, QImage::Format_ARGB32_Premultiplied);
|
||||
img.setDevicePixelRatio(ratio);
|
||||
img.fill(Qt::transparent);
|
||||
QPainter p(&img);
|
||||
p.setPen(QPen(Qt::darkGray, 1));
|
||||
p.drawLine(0, 0, 0, 3);
|
||||
p.drawLine(1, 0, 1, 3);
|
||||
p.drawLine(0, 1, 9, 1);
|
||||
p.drawLine(0, 2, 9, 2);
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
void Style::defaultPolygonStyle()
|
||||
{
|
||||
_polygons[TYPE(0x01)] = Polygon(QBrush(QColor(0xdf, 0xd3, 0xb5)));
|
||||
@ -359,8 +387,11 @@ void Style::defaultLineStyle(qreal ratio)
|
||||
_lines[TYPE(0x0c)] = Line(QPen(QColor(0xff, 0xff, 0xff), 3, Qt::SolidLine),
|
||||
QPen(QColor(0xd5, 0xcd, 0xc0), 5, Qt::SolidLine, Qt::RoundCap,
|
||||
Qt::RoundJoin));
|
||||
_lines[TYPE(0x11)] = Line(QPen(QColor(0xff, 0xff, 0xff), 2, Qt::SolidLine));
|
||||
_lines[TYPE(0x14)] = Line(railroad(ratio));
|
||||
_lines[TYPE(0x16)] = Line(QPen(QColor(0xab, 0xa0, 0x83), 1, Qt::DotLine));
|
||||
_lines[TYPE(0x17)] = Line(fence(ratio));
|
||||
_lines[TYPE(0x17)].setTextFontSize(None);
|
||||
_lines[TYPE(0x18)] = Line(QPen(QColor(0x9f, 0xc4, 0xe1), 2, Qt::SolidLine));
|
||||
_lines[TYPE(0x18)].setTextColor(QColor(0x9f, 0xc4, 0xe1));
|
||||
//_lines[TYPE(0x1a)] = Line(QPen(QColor(0x76, 0x97, 0xb7), 1, Qt::DashLine));
|
||||
@ -389,24 +420,32 @@ void Style::defaultLineStyle(qreal ratio)
|
||||
_lines[TYPE(0x27)] = Line(QPen(QColor(0xff, 0xff, 0xff), 4, Qt::SolidLine),
|
||||
QPen(QColor(0xd5, 0xcd, 0xc0), 5, Qt::SolidLine, Qt::RoundCap,
|
||||
Qt::RoundJoin));
|
||||
//_lines[TYPE(0x28)] = Line(QPen(QColor(0x5a, 0x5a, 0x5a"), 1, Qt::SolidLine));
|
||||
_lines[TYPE(0x28)] = Line(pipeline(ratio));
|
||||
_lines[TYPE(0x29)] = Line(QPen(QColor(0x5a, 0x5a, 0x5a), 1, Qt::SolidLine));
|
||||
_lines[TYPE(0x29)].setTextFontSize(None);
|
||||
_lines[TYPE(0x30)] = Line(QPen(QColor(0xe4, 0xef, 0xcf), 3, Qt::SolidLine),
|
||||
QPen(QColor(0xc9, 0xd3, 0xa5), 5, Qt::SolidLine, Qt::RoundCap,
|
||||
Qt::RoundJoin));
|
||||
|
||||
// NT types
|
||||
_lines[0x10c00] = _lines[TYPE(0x14)];
|
||||
_lines[0x10a00] = _lines[TYPE(0x18)];
|
||||
_lines[0x10b04] = _lines[TYPE(0x1e)];
|
||||
_lines[0x10a01] = _lines[TYPE(0x1f)];
|
||||
_lines[0x10801] = _lines[TYPE(0x02)];
|
||||
_lines[0x10802] = _lines[TYPE(0x03)];
|
||||
_lines[0x10803] = _lines[TYPE(0x04)];
|
||||
_lines[0x10804] = _lines[TYPE(0x05)];
|
||||
_lines[0x10900] = _lines[TYPE(0x20)];
|
||||
_lines[0x10901] = _lines[TYPE(0x21)];
|
||||
_lines[0x10902] = _lines[TYPE(0x22)];
|
||||
_lines[0x10903] = _lines[TYPE(0x23)];
|
||||
_lines[0x10904] = _lines[TYPE(0x24)];
|
||||
_lines[0x10905] = _lines[TYPE(0x25)];
|
||||
_lines[0x10a00] = _lines[TYPE(0x18)];
|
||||
_lines[0x10a01] = _lines[TYPE(0x1f)];
|
||||
_lines[0x10a02] = _lines[TYPE(0x26)];
|
||||
_lines[0x10b02] = _lines[TYPE(0x1c)];
|
||||
_lines[0x10b04] = _lines[TYPE(0x1e)];
|
||||
_lines[0x10c00] = _lines[TYPE(0x14)];
|
||||
_lines[0x10c02] = _lines[TYPE(0x27)];
|
||||
//_lines[0x10c03] = _lines[TYPE(0x28)];
|
||||
_lines[0x10c03] = _lines[TYPE(0x28)];
|
||||
_lines[0x10c04] = _lines[TYPE(0x29)];
|
||||
|
||||
// Marine stuff
|
||||
@ -416,6 +455,7 @@ void Style::defaultLineStyle(qreal ratio)
|
||||
_lines[0x10108] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
|
||||
_lines[0x10301] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine));
|
||||
_lines[0x10307] = Line(QPen(QColor(0x05, 0x62, 0x0e), 1, Qt::SolidLine));
|
||||
_lines[0x10309] = Line(QPen(QColor(0x0e, 0x10, 0x87), 1, Qt::SolidLine));
|
||||
_lines[0x10401] = Line(QImage(":/marine/cable.png"));
|
||||
_lines[0x10402] = Line(QImage(":/marine/pipeline.png"));
|
||||
_lines[0x10404] = Line(QImage(":/marine/fishing-farm-line.png"));
|
||||
|
@ -336,8 +336,8 @@ void Atlas::unload()
|
||||
for (int i = 0; i < _maps.count(); i++)
|
||||
_maps.at(i)->unload();
|
||||
|
||||
_zooms.clear();
|
||||
_bounds.clear();
|
||||
_zooms = QVector<Zoom>();
|
||||
_bounds = QVector<Bounds>();
|
||||
}
|
||||
|
||||
Map *Atlas::createTAR(const QString &path, const Projection &proj, bool *isDir)
|
||||
|
@ -125,7 +125,7 @@ void JNXMap::clearTiles()
|
||||
{
|
||||
for (int i = 0; i < _zooms.size(); i++) {
|
||||
Zoom *z = _zooms[i];
|
||||
z->tiles.clear();
|
||||
z->tiles = QVector<Tile>();
|
||||
z->tree.RemoveAll();
|
||||
}
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ void KMZMap::load(const Projection &in, const Projection &out,
|
||||
|
||||
void KMZMap::unload()
|
||||
{
|
||||
_bounds.clear();
|
||||
_bounds = QVector<Bounds>();
|
||||
|
||||
delete _zip;
|
||||
_zip = 0;
|
||||
|
@ -478,7 +478,7 @@ void MapData::clearTiles()
|
||||
}
|
||||
|
||||
qDeleteAll(_tiles);
|
||||
_tiles.clear();
|
||||
_tiles = QList<TileTree*>();
|
||||
}
|
||||
|
||||
bool MapData::pathCb(VectorTile *tile, void *context)
|
||||
|
@ -763,13 +763,13 @@ void Style::load(const MapData &data, qreal ratio)
|
||||
|
||||
void Style::clear()
|
||||
{
|
||||
_paths.clear();
|
||||
_circles.clear();
|
||||
_pathLabels.clear();
|
||||
_pointLabels.clear();
|
||||
_areaLabels.clear();
|
||||
_symbols.clear();
|
||||
_lineSymbols.clear();
|
||||
_paths = QList<PathRender>();
|
||||
_circles = QList<CircleRender>();
|
||||
_pathLabels = QList<TextRender>();
|
||||
_pointLabels = QList<TextRender>();
|
||||
_areaLabels = QList<TextRender>();
|
||||
_symbols = QList<Symbol>();
|
||||
_lineSymbols = QList<Symbol>();
|
||||
}
|
||||
|
||||
QList<const Style::PathRender *> Style::paths(int zoom, bool closed,
|
||||
|
@ -87,6 +87,10 @@ static Projection parseProjection(const QString &str, const GCS &gcs)
|
||||
return Projection(PCS(gcs, Conversion(9809, Conversion::Setup(
|
||||
52.15616055555555, 5.38763888888889, 0.9999079, 155000, 463000,
|
||||
NAN, NAN), 9001)));
|
||||
case 125: // Israeli New grid
|
||||
return Projection(PCS(gcs, Conversion(9807, Conversion::Setup(
|
||||
31.7343936111111, 35.2045169444444, 1.0000067, 219529.584,
|
||||
626907.39, NAN, NAN), 9001)));
|
||||
case 184: // Swedish Grid
|
||||
return Projection(PCS(gcs, Conversion(9807, Conversion::Setup(0,
|
||||
15.808278, 1, 1500000, 0, NAN, NAN), 9001)));
|
||||
|
Reference in New Issue
Block a user