1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-23 23:24:24 +02:00

Compare commits

..

31 Commits

Author SHA1 Message Date
22c7ea7de6 Do not use functions deprecated in Qt 6.8 2024-10-16 01:21:28 +02:00
78f2e1f47d Translated using Weblate (Hungarian)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/hu/
2024-10-15 21:15:39 +02:00
364867101f Translated using Weblate (Swedish)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2024-10-13 09:15:43 +02:00
28a7e94986 Some more IMG style enhancements 2024-10-09 23:17:16 +02:00
3474b8db96 Improved default IMG style 2024-10-09 07:35:17 +02:00
c28f12e0bb Added Israleli grid projection 2024-10-05 00:26:51 +02:00
749282085e Added missing style for marine chart isobaths 2024-10-05 00:24:57 +02:00
3b276882e0 Code cleanup 2024-10-03 07:51:53 +02:00
9ec5ea45d8 Update install-qt-action version 2024-10-02 08:04:42 +02:00
7b516ca5e4 Free the QVector/QList memory where memory should be released 2024-09-28 19:49:42 +02:00
5d86852299 Revert "Use jom for Windows CI builds"
This reverts commit 7b6640761a.
2024-09-24 10:52:05 +02:00
068ac5e91d Translated using Weblate (Korean)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ko/
2024-09-24 08:54:31 +02:00
7b6640761a Use jom for Windows CI builds 2024-09-24 08:50:53 +02:00
da95287a8d Use OpenSSL 3.3 in the Windows Qt6 build 2024-09-24 08:28:41 +02:00
7e200d1cce Use Qt 6.7.2 for macOS builds 2024-09-24 08:16:22 +02:00
ffaf4250ac Merge remote-tracking branch 'weblate/master' 2024-09-24 08:15:07 +02:00
39ad9cb7ad Version++ 2024-09-24 08:14:40 +02:00
219e4c3762 Translated using Weblate (Spanish)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/es/
2024-09-22 12:40:53 +02:00
09858f603d Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/
2024-09-22 12:40:52 +02:00
225e6da48b Use the "Round" HiDPI scaling policy (the default in Qt5) in Qt6
As of Qt 6.7.2 the rendering is completely broken and full of various render
artifacts when the default "PassThrough" policy is used and the user has
a fractional screen size like 125% set.
2024-09-21 13:38:56 +02:00
23c398caf7 Add a comment for the splitter refresh hack 2024-09-21 13:20:32 +02:00
17ef334c4c Revert "Clean up the splitter/graph tabs logic"
This reverts commit b01dcc4569.
2024-09-21 13:14:49 +02:00
b01dcc4569 Clean up the splitter/graph tabs logic 2024-09-21 11:36:51 +02:00
762e374adf Significantly improved tracks/graps rendering performance 2024-09-20 22:29:15 +02:00
c68a2a1ac4 Improve the graph clearing logic 2024-09-20 09:34:54 +02:00
672fca9dd5 Merge branch 'origin/master' into Weblate. 2024-09-20 07:10:25 +00:00
8c2e2f65c3 Fixed display artifact in the graph tab bar
Yet another workaroud for the Qt 6.7 bug that draws QGraphicsScene items
to the graph tab bar. Follow up to 6ce0b03295.
2024-09-20 09:05:55 +02:00
c5a7a4bb0e Version++ 2024-09-20 09:05:42 +02:00
4f77d7a40e Translated using Weblate (Esperanto)
Currently translated at 91.5% (447 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/eo/
2024-09-18 19:40:56 +02:00
285a9a55f3 Translated using Weblate (Russian)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2024-09-18 19:40:55 +02:00
9c00ff53c2 Translated using Weblate (Finnish)
Currently translated at 95.4% (466 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2024-09-18 19:40:55 +02:00
34 changed files with 192 additions and 116 deletions

View File

@ -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:

View File

@ -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'

View File

@ -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

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else {
TARGET = GPXSee
}
VERSION = 13.25
VERSION = 13.27
QT += core \

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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"

View File

@ -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;
}
}
}
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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));
}
}

View File

@ -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();

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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);

View File

@ -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"));

View File

@ -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)

View File

@ -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();
}
}

View File

@ -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;

View File

@ -478,7 +478,7 @@ void MapData::clearTiles()
}
qDeleteAll(_tiles);
_tiles.clear();
_tiles = QList<TileTree*>();
}
bool MapData::pathCb(VectorTile *tile, void *context)

View File

@ -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,

View File

@ -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)));