mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-04-20 20:29:10 +02:00
Compare commits
3 Commits
51511a9bf9
...
80ec7f624e
Author | SHA1 | Date | |
---|---|---|---|
80ec7f624e | |||
bfeb6d266e | |||
af3e5d41c2 |
@ -29,8 +29,8 @@ build_script:
|
|||||||
copy release\GPXSee.exe installer
|
copy release\GPXSee.exe installer
|
||||||
windeployqt --release installer\GPXSee.exe
|
windeployqt --release installer\GPXSee.exe
|
||||||
copy pkg\windows\gpxsee64.nsi installer
|
copy pkg\windows\gpxsee64.nsi installer
|
||||||
xcopy pkg\common\csv installer\csv /i
|
xcopy data\csv installer\csv /i
|
||||||
xcopy pkg\common\maps installer\maps /i
|
xcopy data\maps installer\maps /i
|
||||||
xcopy lang\*.qm installer\translations\ /sy
|
xcopy lang\*.qm installer\translations\ /sy
|
||||||
xcopy icons\symbols installer\symbols /i
|
xcopy icons\symbols installer\symbols /i
|
||||||
copy licence.txt installer
|
copy licence.txt installer
|
||||||
|
Can't render this file because it is too large.
|
13
gpxsee.pro
13
gpxsee.pro
@ -29,6 +29,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/GUI/pluginparameters.h \
|
src/GUI/pluginparameters.h \
|
||||||
src/common/garmin.h \
|
src/common/garmin.h \
|
||||||
src/common/coordinates.h \
|
src/common/coordinates.h \
|
||||||
|
src/common/hash.h \
|
||||||
src/common/linec.h \
|
src/common/linec.h \
|
||||||
src/common/range.h \
|
src/common/range.h \
|
||||||
src/common/rectc.h \
|
src/common/rectc.h \
|
||||||
@ -481,9 +482,9 @@ macx {
|
|||||||
locale.path = Contents/Resources/translations
|
locale.path = Contents/Resources/translations
|
||||||
locale.files = $$files(lang/*.qm)
|
locale.files = $$files(lang/*.qm)
|
||||||
csv.path = Contents/Resources
|
csv.path = Contents/Resources
|
||||||
csv.files = pkg/common/csv
|
csv.files = data/csv
|
||||||
maps.path = Contents/Resources
|
maps.path = Contents/Resources
|
||||||
maps.files = pkg/common/maps
|
maps.files = data/maps
|
||||||
symbols.path = Contents/Resources/symbols
|
symbols.path = Contents/Resources/symbols
|
||||||
symbols.files = $$files(icons/symbols/*.png)
|
symbols.files = $$files(icons/symbols/*.png)
|
||||||
icons.path = Contents/Resources/icons
|
icons.path = Contents/Resources/icons
|
||||||
@ -536,9 +537,9 @@ win32 {
|
|||||||
unix:!macx:!android {
|
unix:!macx:!android {
|
||||||
isEmpty(PREFIX):PREFIX = /usr/local
|
isEmpty(PREFIX):PREFIX = /usr/local
|
||||||
|
|
||||||
maps.files = $$files(pkg/common/maps/*)
|
maps.files = $$files(data/maps/*)
|
||||||
maps.path = $$PREFIX/share/gpxsee/maps
|
maps.path = $$PREFIX/share/gpxsee/maps
|
||||||
csv.files = $$files(pkg/common/csv/*)
|
csv.files = $$files(data/csv/*)
|
||||||
csv.path = $$PREFIX/share/gpxsee/csv
|
csv.path = $$PREFIX/share/gpxsee/csv
|
||||||
symbols.files = $$files(icons/symbols/*.png)
|
symbols.files = $$files(icons/symbols/*.png)
|
||||||
symbols.path = $$PREFIX/share/gpxsee/symbols
|
symbols.path = $$PREFIX/share/gpxsee/symbols
|
||||||
@ -586,9 +587,9 @@ android {
|
|||||||
pkg/android/build.gradle \
|
pkg/android/build.gradle \
|
||||||
pkg/android/res/values/libs.xml
|
pkg/android/res/values/libs.xml
|
||||||
|
|
||||||
maps.files = $$files(pkg/common/maps/*)
|
maps.files = $$files(data/maps/*)
|
||||||
maps.path = /assets/maps
|
maps.path = /assets/maps
|
||||||
csv.files = $$files(pkg/common/csv/*)
|
csv.files = $$files(data/csv/*)
|
||||||
csv.path = /assets/csv
|
csv.path = /assets/csv
|
||||||
symbols.files = $$files(icons/symbols/*.png)
|
symbols.files = $$files(icons/symbols/*.png)
|
||||||
symbols.path = /assets/symbols
|
symbols.path = /assets/symbols
|
||||||
|
@ -204,7 +204,7 @@
|
|||||||
|
|
||||||
<!-- Mapsforge rendertheme -->
|
<!-- Mapsforge rendertheme -->
|
||||||
<qresource prefix="/mapsforge">
|
<qresource prefix="/mapsforge">
|
||||||
<file alias="default.xml">data/default.xml</file>
|
<file alias="default.xml">data/mapsforge/default.xml</file>
|
||||||
|
|
||||||
<file alias="patterns/hills.svg">icons/map/mapsforge/patterns/hills.svg</file>
|
<file alias="patterns/hills.svg">icons/map/mapsforge/patterns/hills.svg</file>
|
||||||
<file alias="patterns/farmland.svg">icons/map/mapsforge/patterns/farmland.svg</file>
|
<file alias="patterns/farmland.svg">icons/map/mapsforge/patterns/farmland.svg</file>
|
||||||
|
@ -28,10 +28,10 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
#endif
|
#endif
|
||||||
setApplicationVersion(APP_VERSION);
|
setApplicationVersion(APP_VERSION);
|
||||||
|
|
||||||
QTranslator *gpxsee = new QTranslator(this);
|
QTranslator *app = new QTranslator(this);
|
||||||
if (gpxsee->load(QLocale::system(), "gpxsee", "_",
|
if (app->load(QLocale::system(), "gpxsee", "_",
|
||||||
ProgramPaths::translationsDir()))
|
ProgramPaths::translationsDir()))
|
||||||
installTranslator(gpxsee);
|
installTranslator(app);
|
||||||
|
|
||||||
QTranslator *qt = new QTranslator(this);
|
QTranslator *qt = new QTranslator(this);
|
||||||
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
|
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QTabBar>
|
#include <QTabBar>
|
||||||
#include <QGeoPositionInfoSource>
|
#include <QGeoPositionInfoSource>
|
||||||
|
#include "common/config.h"
|
||||||
#include "common/programpaths.h"
|
#include "common/programpaths.h"
|
||||||
#include "common/downloader.h"
|
#include "common/downloader.h"
|
||||||
#include "data/data.h"
|
#include "data/data.h"
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "common/config.h"
|
|
||||||
#include "data/waypoint.h"
|
#include "data/waypoint.h"
|
||||||
#include "map/projection.h"
|
#include "map/projection.h"
|
||||||
#include "searchpointer.h"
|
#include "searchpointer.h"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef SEARCHPOINTER_H
|
#ifndef SEARCHPOINTER_H
|
||||||
#define SEARCHPOINTER_H
|
#define SEARCHPOINTER_H
|
||||||
|
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class SearchPointer
|
class SearchPointer
|
||||||
|
@ -1,21 +1,7 @@
|
|||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
#include <QtGlobal>
|
|
||||||
#include <QPoint>
|
|
||||||
|
|
||||||
#define APP_NAME "GPXSee"
|
#define APP_NAME "GPXSee"
|
||||||
#define APP_HOMEPAGE "http://www.gpxsee.org"
|
#define APP_HOMEPAGE "http://www.gpxsee.org"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
#define HASH_T uint
|
|
||||||
#else // QT6
|
|
||||||
#define HASH_T size_t
|
|
||||||
#endif // QT6
|
|
||||||
|
|
||||||
inline HASH_T qHash(const QPoint &p)
|
|
||||||
{
|
|
||||||
return ::qHash(p.x()) ^ ::qHash(p.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
|
18
src/common/hash.h
Normal file
18
src/common/hash.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef HASH_H
|
||||||
|
#define HASH_H
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
#include <QPoint>
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
#define HASH_T uint
|
||||||
|
#else // QT6
|
||||||
|
#define HASH_T size_t
|
||||||
|
#endif // QT6
|
||||||
|
|
||||||
|
inline HASH_T qHash(const QPoint &p)
|
||||||
|
{
|
||||||
|
return ::qHash(p.x()) ^ ::qHash(p.y());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // HASH_H
|
@ -4,7 +4,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QCache>
|
#include <QCache>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
#include "area.h"
|
#include "area.h"
|
||||||
|
|
||||||
class QString;
|
class QString;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
#include "common/coordinates.h"
|
#include "common/coordinates.h"
|
||||||
#include "link.h"
|
#include "link.h"
|
||||||
#include "style.h"
|
#include "style.h"
|
||||||
|
@ -5,6 +5,13 @@
|
|||||||
|
|
||||||
using namespace ENC;
|
using namespace ENC;
|
||||||
|
|
||||||
|
#define UINT16(x) \
|
||||||
|
(((quint16)*(const uchar*)(x)) \
|
||||||
|
| ((quint16)(*((const uchar*)(x) + 1)) << 8))
|
||||||
|
|
||||||
|
#define INT32(x) ((qint32)UINT32(x))
|
||||||
|
#define INT16(x) ((qint16)UINT16(x))
|
||||||
|
|
||||||
struct DR {
|
struct DR {
|
||||||
char RecordLength[5];
|
char RecordLength[5];
|
||||||
char InterchangeLevel;
|
char InterchangeLevel;
|
||||||
@ -91,14 +98,14 @@ bool ISO8211::fieldType(const QString &str, int cnt, FieldType &type, int &size)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ISO8211::readDR(QFile &file, QVector<FieldDefinition> &fields) const
|
int ISO8211::readDR(QVector<FieldDefinition> &fields)
|
||||||
{
|
{
|
||||||
DR ddr;
|
DR ddr;
|
||||||
QByteArray fieldLen, fieldPos;
|
QByteArray fieldLen, fieldPos;
|
||||||
int len, lenSize, posSize, tagSize, offset;
|
int len, lenSize, posSize, tagSize, offset;
|
||||||
|
|
||||||
static_assert(sizeof(ddr) == 24, "Invalid DR alignment");
|
static_assert(sizeof(ddr) == 24, "Invalid DR alignment");
|
||||||
if (file.read((char*)&ddr, sizeof(ddr)) != sizeof(ddr))
|
if (_file.read((char*)&ddr, sizeof(ddr)) != sizeof(ddr))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
len = Util::str2int(ddr.RecordLength, sizeof(ddr.RecordLength));
|
len = Util::str2int(ddr.RecordLength, sizeof(ddr.RecordLength));
|
||||||
@ -119,9 +126,9 @@ int ISO8211::readDR(QFile &file, QVector<FieldDefinition> &fields) const
|
|||||||
|
|
||||||
r.tag.resize(tagSize);
|
r.tag.resize(tagSize);
|
||||||
|
|
||||||
if (file.read(r.tag.data(), tagSize) != tagSize
|
if (_file.read(r.tag.data(), tagSize) != tagSize
|
||||||
|| file.read(fieldLen.data(), lenSize) != lenSize
|
|| _file.read(fieldLen.data(), lenSize) != lenSize
|
||||||
|| file.read(fieldPos.data(), posSize) != posSize)
|
|| _file.read(fieldPos.data(), posSize) != posSize)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
r.pos = offset + Util::str2int(fieldPos.constData(), posSize);
|
r.pos = offset + Util::str2int(fieldPos.constData(), posSize);
|
||||||
@ -134,13 +141,13 @@ int ISO8211::readDR(QFile &file, QVector<FieldDefinition> &fields) const
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ISO8211::readDDA(QFile &file, const FieldDefinition &def, SubFields &fields)
|
bool ISO8211::readDDA(const FieldDefinition &def, SubFields &fields)
|
||||||
{
|
{
|
||||||
static QRegularExpression re("(\\d*)(\\w+)\\(*(\\d*)\\)*");
|
static QRegularExpression re("(\\d*)(\\w+)\\(*(\\d*)\\)*");
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
|
|
||||||
ba.resize(def.size);
|
ba.resize(def.size);
|
||||||
if (!(file.seek(def.pos) && file.read(ba.data(), ba.size()) == ba.size()))
|
if (!(_file.seek(def.pos) && _file.read(ba.data(), ba.size()) == ba.size()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QList<QByteArray> list(ba.split('\x1f'));
|
QList<QByteArray> list(ba.split('\x1f'));
|
||||||
@ -197,7 +204,7 @@ bool ISO8211::readDDR()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int len = readDR(_file, fields);
|
int len = readDR(fields);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
_errorString = "Not a ISO8211 file";
|
_errorString = "Not a ISO8211 file";
|
||||||
return false;
|
return false;
|
||||||
@ -205,7 +212,7 @@ bool ISO8211::readDDR()
|
|||||||
|
|
||||||
for (int i = 0; i < fields.size(); i++) {
|
for (int i = 0; i < fields.size(); i++) {
|
||||||
SubFields def;
|
SubFields def;
|
||||||
if (!readDDA(_file, fields.at(i), def)) {
|
if (!readDDA(fields.at(i), def)) {
|
||||||
_errorString = QString("Error reading %1 DDA field")
|
_errorString = QString("Error reading %1 DDA field")
|
||||||
.arg(QString(fields.at(i).tag));
|
.arg(QString(fields.at(i).tag));
|
||||||
return false;
|
return false;
|
||||||
@ -221,14 +228,14 @@ bool ISO8211::readDDR()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ISO8211::readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
bool ISO8211::readUDA(quint64 pos, const FieldDefinition &def,
|
||||||
const SubFields &fields, Data &data) const
|
const SubFields &fields, Data &data)
|
||||||
{
|
{
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
|
|
||||||
ba.resize(def.size);
|
ba.resize(def.size);
|
||||||
if (!(file.seek(pos + def.pos)
|
if (!(_file.seek(pos + def.pos)
|
||||||
&& file.read(ba.data(), ba.size()) == ba.size()))
|
&& _file.read(ba.data(), ba.size()) == ba.size()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char *sp;
|
const char *sp;
|
||||||
@ -299,7 +306,7 @@ bool ISO8211::readRecord(Record &record)
|
|||||||
|
|
||||||
QVector<FieldDefinition> fields;
|
QVector<FieldDefinition> fields;
|
||||||
qint64 pos = _file.pos();
|
qint64 pos = _file.pos();
|
||||||
int len = readDR(_file, fields);
|
int len = readDR(fields);
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
_errorString = "Error reading DR";
|
_errorString = "Error reading DR";
|
||||||
@ -321,7 +328,7 @@ bool ISO8211::readRecord(Record &record)
|
|||||||
|
|
||||||
f.setTag(def.tag);
|
f.setTag(def.tag);
|
||||||
|
|
||||||
if (!readUDA(_file, pos, def, it.value(), f.rdata())) {
|
if (!readUDA(pos, def, it.value(), f.rdata())) {
|
||||||
_errorString = QString("Error reading %1 record")
|
_errorString = QString("Error reading %1 record")
|
||||||
.arg(QString(def.tag));
|
.arg(QString(def.tag));
|
||||||
return false;
|
return false;
|
||||||
|
@ -12,13 +12,6 @@
|
|||||||
| ((quint32)(*((const uchar*)(x) + 2)) << 16) \
|
| ((quint32)(*((const uchar*)(x) + 2)) << 16) \
|
||||||
| ((quint32)(*((const uchar*)(x) + 3)) << 24))
|
| ((quint32)(*((const uchar*)(x) + 3)) << 24))
|
||||||
|
|
||||||
#define UINT16(x) \
|
|
||||||
(((quint16)*(const uchar*)(x)) \
|
|
||||||
| ((quint16)(*((const uchar*)(x) + 1)) << 8))
|
|
||||||
|
|
||||||
#define INT32(x) ((qint32)UINT32(x))
|
|
||||||
#define INT16(x) ((qint16)UINT16(x))
|
|
||||||
|
|
||||||
namespace ENC {
|
namespace ENC {
|
||||||
|
|
||||||
class ISO8211
|
class ISO8211
|
||||||
@ -113,10 +106,10 @@ private:
|
|||||||
static bool fieldType(const QString &str, int cnt, FieldType &type,
|
static bool fieldType(const QString &str, int cnt, FieldType &type,
|
||||||
int &size);
|
int &size);
|
||||||
|
|
||||||
int readDR(QFile &file, QVector<FieldDefinition> &fields) const;
|
int readDR(QVector<FieldDefinition> &fields);
|
||||||
bool readDDA(QFile &file, const FieldDefinition &def, SubFields &fields);
|
bool readDDA(const FieldDefinition &def, SubFields &fields);
|
||||||
bool readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
bool readUDA(quint64 pos, const FieldDefinition &def,
|
||||||
const SubFields &fields, Data &data) const;
|
const SubFields &fields, Data &data);
|
||||||
|
|
||||||
QFile _file;
|
QFile _file;
|
||||||
FieldsMap _map;
|
FieldsMap _map;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define IMG_SHIELD_H
|
#define IMG_SHIELD_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
|
|
||||||
#define FIRST_SHIELD Shield::USInterstate
|
#define FIRST_SHIELD Shield::USInterstate
|
||||||
#define LAST_SHIELD Shield::Oval
|
#define LAST_SHIELD Shield::Oval
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
#include "common/hash.h"
|
||||||
#include "osm.h"
|
#include "osm.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "aqmmap.h"
|
#include "aqmmap.h"
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include "common/config.h"
|
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
class AQMMap : public Map
|
class AQMMap : public Map
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QCache>
|
#include <QCache>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "common/rtree.h"
|
#include "common/rtree.h"
|
||||||
#include "common/range.h"
|
#include "common/range.h"
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include "common/coordinates.h"
|
#include "common/coordinates.h"
|
||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "common/config.h"
|
|
||||||
#include "tar.h"
|
#include "tar.h"
|
||||||
#include "ozf.h"
|
#include "ozf.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include "common/config.h"
|
#include "common/hash.h"
|
||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "common/kv.h"
|
#include "common/kv.h"
|
||||||
#include "common/downloader.h"
|
#include "common/downloader.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user