mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-04-20 12:19:11 +02:00
Compare commits
13 Commits
59523f46ef
...
8ae8c3b0a3
Author | SHA1 | Date | |
---|---|---|---|
8ae8c3b0a3 | |||
733b018350 | |||
810e999068 | |||
|
6de21ff702 | ||
b13bac3af9 | |||
|
294490bb12 | ||
e1d1842fa6 | |||
|
ae4405ca9d | ||
f138323f5a | |||
|
18618aadb9 | ||
|
a7c698fc27 | ||
|
ddb072e1df | ||
091393ad5f |
@ -9,9 +9,9 @@ GPS log file formats.
|
||||
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS,
|
||||
QuadTiles).
|
||||
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
|
||||
Garmin IMG/GMAP & JNX maps, TwoNav RMaps, GeoTIFF images, BSB charts, KMZ maps,
|
||||
AlpineQuest maps, Locus/OsmAnd/RMaps SQLite maps, Mapsforge vector maps,
|
||||
QCT maps, GEMF maps, Osmdroid SQLite maps, Orux maps,
|
||||
Garmin IMG/GMAP & JNX maps, TwoNav RMaps, GeoTIFF images, BSB charts,
|
||||
ENC charts KMZ maps, AlpineQuest maps, Locus/OsmAnd/RMaps SQLite maps,
|
||||
Mapsforge vector maps, QCT maps, GEMF maps, Osmdroid SQLite maps, Orux maps,
|
||||
ESRI World-File georeferenced images).
|
||||
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts
|
||||
graphs.
|
||||
@ -29,7 +29,7 @@ GPS log file formats.
|
||||
## Build
|
||||
Build requirements:
|
||||
* Qt5 >= 5.11 or Qt6 >= 6.2 (Android builds require Qt6)
|
||||
* C++11 or newer compiler (tested: msvc2017, gcc 7.5.0, clang/Apple LLVM version
|
||||
* C++11 or newer compiler (tested: msvc2019, gcc 7.5.0, clang/Apple LLVM version
|
||||
10.0.0)
|
||||
|
||||
Build steps:
|
||||
|
@ -1247,7 +1247,7 @@
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="158"/>
|
||||
<source>Electronic Navigational Charts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ENC námořní mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="165"/>
|
||||
|
@ -1246,7 +1246,7 @@
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="158"/>
|
||||
<source>Electronic Navigational Charts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ENC-Seekarten</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="165"/>
|
||||
|
@ -1240,7 +1240,7 @@
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="158"/>
|
||||
<source>Electronic Navigational Charts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Elektronikus navigációs térképek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="165"/>
|
||||
|
@ -1246,7 +1246,7 @@
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="158"/>
|
||||
<source>Electronic Navigational Charts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Elektroniska sjökort</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="165"/>
|
||||
|
@ -1245,7 +1245,7 @@
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="158"/>
|
||||
<source>Electronic Navigational Charts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Elektronik Seyir Haritaları</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/map/maplist.cpp" line="165"/>
|
||||
|
@ -181,13 +181,14 @@ Section "GPXSee" SEC_APP
|
||||
!insertmacro FILE_ASSOCIATION_ADD "qct" "QuickChart Map File" 24
|
||||
!insertmacro FILE_ASSOCIATION_ADD "trk" "TwoNav Track File" 25
|
||||
!insertmacro FILE_ASSOCIATION_ADD "gemf" "GEMF Map File" 26
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 27
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 27
|
||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 28
|
||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 29
|
||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 30
|
||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 31
|
||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 32
|
||||
!insertmacro FILE_ASSOCIATION_ADD "000" "IHO S-57 Electronic Navigation Chart" 27
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 28
|
||||
!insertmacro FILE_ASSOCIATION_ADD "kmz" "KML geographic compressed data" 28
|
||||
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 29
|
||||
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 30
|
||||
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 Data" 31
|
||||
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 32
|
||||
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 33
|
||||
|
||||
WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
|
||||
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
|
||||
@ -237,6 +238,7 @@ Section "GPXSee" SEC_APP
|
||||
WriteRegStr HKCR ".qct\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".trk\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".gemf\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".000\OpenWithList" "GPXSee.exe" ""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
@ -392,6 +394,7 @@ Section "Uninstall"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "qct"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "trk"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "gemf"
|
||||
!insertmacro FILE_ASSOCIATION_REMOVE "000"
|
||||
|
||||
DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
|
||||
@ -440,6 +443,7 @@ Section "Uninstall"
|
||||
DeleteRegValue HKCR ".qct\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".trk\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".gemf\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".000\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
@ -319,10 +319,5 @@ bool ISO8211::readRecord(QFile &file, Record &record)
|
||||
}
|
||||
}
|
||||
|
||||
if (file.pos() != pos + len) {
|
||||
_errorString = "Record format error";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -463,6 +463,9 @@ MapData::Poly *MapData::polyObject(const ISO8211::Record &r,
|
||||
bool MapData::processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &rv, uint &COMF, QString &name)
|
||||
{
|
||||
if (record.size() < 2)
|
||||
return false;
|
||||
|
||||
const ISO8211::Field &f = record.at(1);
|
||||
const QByteArray &ba = f.tag();
|
||||
|
||||
@ -485,6 +488,9 @@ bool MapData::processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
|
||||
RecordMap &vf, uint &COMF, uint &SOMF)
|
||||
{
|
||||
if (record.size() < 2)
|
||||
return false;
|
||||
|
||||
const ISO8211::Field &f = record.at(1);
|
||||
const QByteArray &ba = f.tag();
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
#define ENC_MAPDATA_H
|
||||
|
||||
#include <climits>
|
||||
#include <QPainterPath>
|
||||
#include "common/rectc.h"
|
||||
#include "common/rtree.h"
|
||||
#include "common/polygon.h"
|
||||
|
@ -200,4 +200,6 @@ void RasterTile::render()
|
||||
//painter.setPen(Qt::red);
|
||||
//painter.setBrush(Qt::NoBrush);
|
||||
//painter.drawRect(QRect(_rect.topLeft(), _pixmap.size()));
|
||||
|
||||
_valid = true;
|
||||
}
|
||||
|
@ -18,11 +18,12 @@ public:
|
||||
const QList<MapData::Poly*> &polygons, const QList<MapData::Point*> &points)
|
||||
: _proj(proj), _transform(transform), _zoom(zoom), _rect(rect),
|
||||
_ratio(ratio), _pixmap(rect.width() * ratio, rect.height() * ratio),
|
||||
_lines(lines), _polygons(polygons), _points(points) {}
|
||||
_lines(lines), _polygons(polygons), _points(points), _valid(false) {}
|
||||
|
||||
int zoom() const {return _zoom;}
|
||||
QPoint xy() const {return _rect.topLeft();}
|
||||
const QPixmap &pixmap() const {return _pixmap;}
|
||||
bool isValid() const {return _valid;}
|
||||
|
||||
void render();
|
||||
|
||||
@ -48,6 +49,7 @@ private:
|
||||
QList<MapData::Line*> _lines;
|
||||
QList<MapData::Poly*> _polygons;
|
||||
QList<MapData::Point*> _points;
|
||||
bool _valid;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
#include <QPainter>
|
||||
#include <QPixmapCache>
|
||||
#include <QtConcurrent>
|
||||
#include "common/range.h"
|
||||
#include "common/wgs84.h"
|
||||
#include "ENC/rastertile.h"
|
||||
#include "rectd.h"
|
||||
#include "pcs.h"
|
||||
#include "encmap.h"
|
||||
@ -58,6 +56,8 @@ int ENCMap::zoomFit(const QSize &size, const RectC &rect)
|
||||
|
||||
int ENCMap::zoomIn()
|
||||
{
|
||||
cancelJobs();
|
||||
|
||||
_zoom = qMin(_zoom + 1, ZOOMS.max());
|
||||
updateTransform();
|
||||
return _zoom;
|
||||
@ -65,6 +65,8 @@ int ENCMap::zoomIn()
|
||||
|
||||
int ENCMap::zoomOut()
|
||||
{
|
||||
cancelJobs();
|
||||
|
||||
_zoom = qMax(_zoom - 1, ZOOMS.min());
|
||||
updateTransform();
|
||||
return _zoom;
|
||||
@ -96,6 +98,55 @@ void ENCMap::updateTransform()
|
||||
_transform.proj2img(prect.bottomRight()));
|
||||
}
|
||||
|
||||
bool ENCMap::isRunning(int zoom, const QPoint &xy) const
|
||||
{
|
||||
for (int i = 0; i < _jobs.size(); i++) {
|
||||
const QList<ENC::RasterTile> &tiles = _jobs.at(i)->tiles();
|
||||
for (int j = 0; j < tiles.size(); j++) {
|
||||
const ENC::RasterTile &mt = tiles.at(j);
|
||||
if (mt.zoom() == zoom && mt.xy() == xy)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ENCMap::runJob(ENCMapJob *job)
|
||||
{
|
||||
_jobs.append(job);
|
||||
|
||||
connect(job, &ENCMapJob::finished, this, &ENCMap::jobFinished);
|
||||
job->run();
|
||||
}
|
||||
|
||||
void ENCMap::removeJob(ENCMapJob *job)
|
||||
{
|
||||
_jobs.removeOne(job);
|
||||
job->deleteLater();
|
||||
}
|
||||
|
||||
void ENCMap::jobFinished(ENCMapJob *job)
|
||||
{
|
||||
const QList<ENC::RasterTile> &tiles = job->tiles();
|
||||
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
const ENC::RasterTile &mt = tiles.at(i);
|
||||
if (mt.isValid())
|
||||
QPixmapCache::insert(key(mt.zoom(), mt.xy()), mt.pixmap());
|
||||
}
|
||||
|
||||
removeJob(job);
|
||||
|
||||
emit tilesLoaded();
|
||||
}
|
||||
|
||||
void ENCMap::cancelJobs()
|
||||
{
|
||||
for (int i = 0; i < _jobs.size(); i++)
|
||||
_jobs.at(i)->cancel();
|
||||
}
|
||||
|
||||
QString ENCMap::key(int zoom, const QPoint &xy) const
|
||||
{
|
||||
return path() + "-" + QString::number(zoom) + "_"
|
||||
@ -116,6 +167,8 @@ void ENCMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||
for (int i = 0; i < width; i++) {
|
||||
for (int j = 0; j < height; j++) {
|
||||
QPoint ttl(tl.x() + i * TILE_SIZE, tl.y() + j * TILE_SIZE);
|
||||
if (isRunning(_zoom, ttl))
|
||||
continue;
|
||||
|
||||
QPixmap pm;
|
||||
if (QPixmapCache::find(key(_zoom, ttl), &pm))
|
||||
@ -149,6 +202,8 @@ void ENCMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (!tiles.isEmpty()) {
|
||||
if (flags & Map::Block) {
|
||||
QFuture<void> future = QtConcurrent::map(tiles, &RasterTile::render);
|
||||
future.waitForFinished();
|
||||
|
||||
@ -158,6 +213,9 @@ void ENCMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||
painter->drawPixmap(mt.xy(), pm);
|
||||
QPixmapCache::insert(key(mt.zoom(), mt.xy()), pm);
|
||||
}
|
||||
} else
|
||||
runJob(new ENCMapJob(tiles));
|
||||
}
|
||||
}
|
||||
|
||||
void ENCMap::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
||||
|
@ -1,12 +1,42 @@
|
||||
#ifndef ENCMAP_H
|
||||
#define ENCMAP_H
|
||||
|
||||
#include <QtConcurrent>
|
||||
#include "map.h"
|
||||
#include "projection.h"
|
||||
#include "transform.h"
|
||||
#include "ENC/mapdata.h"
|
||||
#include "ENC/rastertile.h"
|
||||
|
||||
class QFile;
|
||||
class ENCMapJob : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ENCMapJob(const QList<ENC::RasterTile> &tiles)
|
||||
: _tiles(tiles) {}
|
||||
|
||||
void run()
|
||||
{
|
||||
connect(&_watcher, &QFutureWatcher<void>::finished, this,
|
||||
&ENCMapJob::handleFinished);
|
||||
_future = QtConcurrent::map(_tiles, &ENC::RasterTile::render);
|
||||
_watcher.setFuture(_future);
|
||||
}
|
||||
void cancel() {_future.cancel();}
|
||||
const QList<ENC::RasterTile> &tiles() const {return _tiles;}
|
||||
|
||||
signals:
|
||||
void finished(ENCMapJob *job);
|
||||
|
||||
private slots:
|
||||
void handleFinished() {emit finished(this);}
|
||||
|
||||
private:
|
||||
QFutureWatcher<void> _watcher;
|
||||
QFuture<void> _future;
|
||||
QList<ENC::RasterTile> _tiles;
|
||||
};
|
||||
|
||||
class ENCMap : public Map
|
||||
{
|
||||
@ -43,9 +73,16 @@ public:
|
||||
|
||||
static Map *create(const QString &path, const Projection &, bool *isMap);
|
||||
|
||||
private slots:
|
||||
void jobFinished(ENCMapJob *job);
|
||||
|
||||
private:
|
||||
Transform transform(int zoom) const;
|
||||
void updateTransform();
|
||||
bool isRunning(int zoom, const QPoint &xy) const;
|
||||
void runJob(ENCMapJob *job);
|
||||
void removeJob(ENCMapJob *job);
|
||||
void cancelJobs();
|
||||
QString key(int zoom, const QPoint &xy) const;
|
||||
|
||||
ENC::MapData _data;
|
||||
@ -56,6 +93,8 @@ private:
|
||||
QRectF _bounds;
|
||||
int _zoom;
|
||||
|
||||
QList<ENCMapJob*> _jobs;
|
||||
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user