mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-17 12:24:24 +02:00
Compare commits
20 Commits
11.11
...
ab76521990
Author | SHA1 | Date | |
---|---|---|---|
ab76521990 | |||
ee73908231 | |||
3af98b6785 | |||
05657ccdce | |||
a698aa96cd | |||
a7fef63461 | |||
83217d31a7 | |||
4191f5414f | |||
bf81994aa0 | |||
21c02010f7 | |||
c209e24db8 | |||
9ff7ecea97 | |||
78e3c78197 | |||
38cd871178 | |||
5594bf74b6 | |||
65515143eb | |||
29895420b6 | |||
88f7e13500 | |||
51335a0f84 | |||
077cc20934 |
@ -1,4 +1,4 @@
|
|||||||
version: 11.11.{build}
|
version: 11.12.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
45
.github/workflows/codeql.yml
vendored
Normal file
45
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'cpp' ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools qt5-qmake qttools5-dev-tools libqt5opengl5-dev qtpositioning5-dev libqt5svg5-dev
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
|
||||||
|
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||||
|
# queries: security-extended,security-and-quality
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
|
with:
|
||||||
|
category: "/language:${{matrix.language}}"
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 11.11
|
VERSION = 11.12
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
|
@ -188,6 +188,7 @@
|
|||||||
<file alias="silo.png">icons/map/marine/silo.png</file>
|
<file alias="silo.png">icons/map/marine/silo.png</file>
|
||||||
<file alias="turning-basin.png">icons/map/marine/turning-basin.png</file>
|
<file alias="turning-basin.png">icons/map/marine/turning-basin.png</file>
|
||||||
<file alias="entry-prohibited-line.png">icons/map/marine/entry-prohibited-line.png</file>
|
<file alias="entry-prohibited-line.png">icons/map/marine/entry-prohibited-line.png</file>
|
||||||
|
<file alias="safety-zone-line.png">icons/map/marine/safety-zone-line.png</file>
|
||||||
<file alias="cable-area-line.png">icons/map/marine/cable-area-line.png</file>
|
<file alias="cable-area-line.png">icons/map/marine/cable-area-line.png</file>
|
||||||
<file alias="pipeline-area-line.png">icons/map/marine/pipeline-area-line.png</file>
|
<file alias="pipeline-area-line.png">icons/map/marine/pipeline-area-line.png</file>
|
||||||
<file alias="windmotor.png">icons/map/marine/windmotor.png</file>
|
<file alias="windmotor.png">icons/map/marine/windmotor.png</file>
|
||||||
|
BIN
icons/map/marine/safety-zone-line.png
Normal file
BIN
icons/map/marine/safety-zone-line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 B |
@ -2397,12 +2397,12 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/temperaturegraph.cpp" line="111"/>
|
<location filename="../src/GUI/temperaturegraph.cpp" line="111"/>
|
||||||
<source>C</source>
|
<source>C</source>
|
||||||
<translation>°C</translation>
|
<translation>C</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/temperaturegraph.cpp" line="115"/>
|
<location filename="../src/GUI/temperaturegraph.cpp" line="115"/>
|
||||||
<source>F</source>
|
<source>F</source>
|
||||||
<translation>°F</translation>
|
<translation>F</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -2410,12 +2410,12 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/temperaturegraphitem.cpp" line="21"/>
|
<location filename="../src/GUI/temperaturegraphitem.cpp" line="21"/>
|
||||||
<source>C</source>
|
<source>C</source>
|
||||||
<translation>°C</translation>
|
<translation>C</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/temperaturegraphitem.cpp" line="21"/>
|
<location filename="../src/GUI/temperaturegraphitem.cpp" line="21"/>
|
||||||
<source>F</source>
|
<source>F</source>
|
||||||
<translation>°F</translation>
|
<translation>F</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/temperaturegraphitem.cpp" line="24"/>
|
<location filename="../src/GUI/temperaturegraphitem.cpp" line="24"/>
|
||||||
|
@ -34,8 +34,10 @@ android {
|
|||||||
* Changing them manually might break the compilation!
|
* Changing them manually might break the compilation!
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
|
|
||||||
compileSdkVersion androidCompileSdkVersion.toInteger()
|
//compileSdkVersion androidCompileSdkVersion.toInteger()
|
||||||
buildToolsVersion androidBuildToolsVersion
|
compileSdkVersion 31
|
||||||
|
//buildToolsVersion androidBuildToolsVersion
|
||||||
|
buildToolsVersion '31.0.0'
|
||||||
ndkVersion androidNdkVersion
|
ndkVersion androidNdkVersion
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
# Project-wide Gradle settings.
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
|
||||||
|
|
||||||
# Enable building projects in parallel
|
|
||||||
org.gradle.parallel=true
|
|
||||||
|
|
||||||
# Gradle caching allows reusing the build artifacts from a previous
|
|
||||||
# build with the same inputs. However, over time, the cache size will
|
|
||||||
# grow. Uncomment the following line to enable it.
|
|
||||||
#org.gradle.caching=true
|
|
@ -37,7 +37,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "11.11"
|
!define VERSION "11.12"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#define CATMOR 40
|
#define CATMOR 40
|
||||||
#define CATTRK 54
|
#define CATTRK 54
|
||||||
#define CATREA 56
|
#define CATREA 56
|
||||||
|
#define CATSIT 61
|
||||||
#define CATSCF 65
|
#define CATSCF 65
|
||||||
#define CATWAT 69
|
#define CATWAT 69
|
||||||
#define CATWRK 71
|
#define CATWRK 71
|
||||||
@ -24,6 +25,7 @@
|
|||||||
#define WATLEV 187
|
#define WATLEV 187
|
||||||
|
|
||||||
#define I_CATACH 17000
|
#define I_CATACH 17000
|
||||||
|
#define I_CATSIT 17002
|
||||||
#define I_RESTRN 17004
|
#define I_RESTRN 17004
|
||||||
#define I_CATHAF 17008
|
#define I_CATHAF 17008
|
||||||
#define I_RDOCAL 17017
|
#define I_RDOCAL 17017
|
||||||
|
@ -97,6 +97,7 @@ int ISO8211::readDR(QFile &file, QVector<FieldDefinition> &fields) const
|
|||||||
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");
|
||||||
if (file.read((char*)&ddr, sizeof(ddr)) != sizeof(ddr))
|
if (file.read((char*)&ddr, sizeof(ddr)) != sizeof(ddr))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -187,12 +188,16 @@ bool ISO8211::readDDA(QFile &file, const FieldDefinition &def, SubFields &fields
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ISO8211::readDDR(QFile &file)
|
bool ISO8211::readDDR()
|
||||||
{
|
{
|
||||||
QVector<FieldDefinition> fields;
|
QVector<FieldDefinition> fields;
|
||||||
qint64 pos = file.pos();
|
|
||||||
int len = readDR(file, fields);
|
|
||||||
|
|
||||||
|
if (!_file.open(QIODevice::ReadOnly)) {
|
||||||
|
_errorString = _file.errorString();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int len = readDR(_file, fields);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
_errorString = "Not a ISO8211 file";
|
_errorString = "Not a ISO8211 file";
|
||||||
return false;
|
return false;
|
||||||
@ -200,7 +205,7 @@ bool ISO8211::readDDR(QFile &file)
|
|||||||
|
|
||||||
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(_file, 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;
|
||||||
@ -208,7 +213,7 @@ bool ISO8211::readDDR(QFile &file)
|
|||||||
_map.insert(fields.at(i).tag, def);
|
_map.insert(fields.at(i).tag, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.pos() != pos + len || fields.size() < 2) {
|
if (_file.pos() != len || fields.size() < 2) {
|
||||||
_errorString = "DDR format error";
|
_errorString = "DDR format error";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -230,6 +235,7 @@ bool ISO8211::readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
|||||||
const char *dp = ba.constData();
|
const char *dp = ba.constData();
|
||||||
const char *ep = ba.constData() + ba.size() - 1;
|
const char *ep = ba.constData() + ba.size() - 1;
|
||||||
|
|
||||||
|
data.clear();
|
||||||
data.setFields(&fields);
|
data.setFields(&fields);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -286,11 +292,14 @@ bool ISO8211::readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ISO8211::readRecord(QFile &file, Record &record)
|
bool ISO8211::readRecord(Record &record)
|
||||||
{
|
{
|
||||||
|
if (_file.atEnd())
|
||||||
|
return false;
|
||||||
|
|
||||||
QVector<FieldDefinition> fields;
|
QVector<FieldDefinition> fields;
|
||||||
qint64 pos = file.pos();
|
qint64 pos = _file.pos();
|
||||||
int len = readDR(file, fields);
|
int len = readDR(_file, fields);
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
_errorString = "Error reading DR";
|
_errorString = "Error reading DR";
|
||||||
@ -312,7 +321,7 @@ bool ISO8211::readRecord(QFile &file, Record &record)
|
|||||||
|
|
||||||
f.setTag(def.tag);
|
f.setTag(def.tag);
|
||||||
|
|
||||||
if (!readUDA(file, pos, def, it.value(), f.rdata())) {
|
if (!readUDA(_file, 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;
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#ifndef ENC_ISO8211_H
|
#ifndef ENC_ISO8211_H
|
||||||
#define ENC_ISO8211_H
|
#define ENC_ISO8211_H
|
||||||
|
|
||||||
|
#include <QFile>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
class QFile;
|
|
||||||
|
|
||||||
#define UINT32(x) \
|
#define UINT32(x) \
|
||||||
(((quint32)*(const uchar*)(x)) \
|
(((quint32)*(const uchar*)(x)) \
|
||||||
| ((quint32)(*((const uchar*)(x) + 1)) << 8) \
|
| ((quint32)(*((const uchar*)(x) + 1)) << 8) \
|
||||||
@ -102,8 +101,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool readDDR(QFile &file);
|
ISO8211(const QString &path) : _file(path) {}
|
||||||
bool readRecord(QFile &file, Record &record);
|
bool readDDR();
|
||||||
|
bool readRecord(Record &record);
|
||||||
|
|
||||||
const QString &errorString() const {return _errorString;}
|
const QString &errorString() const {return _errorString;}
|
||||||
|
|
||||||
@ -118,6 +118,7 @@ private:
|
|||||||
bool readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
bool readUDA(QFile &file, quint64 pos, const FieldDefinition &def,
|
||||||
const SubFields &fields, Data &data) const;
|
const SubFields &fields, Data &data) const;
|
||||||
|
|
||||||
|
QFile _file;
|
||||||
FieldsMap _map;
|
FieldsMap _map;
|
||||||
QString _errorString;
|
QString _errorString;
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <QFile>
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "objects.h"
|
#include "objects.h"
|
||||||
#include "attributes.h"
|
#include "attributes.h"
|
||||||
@ -51,22 +50,24 @@ static QMap<uint,uint> orderMapInit()
|
|||||||
map.insert(TYPE(UWTROC), 26);
|
map.insert(TYPE(UWTROC), 26);
|
||||||
map.insert(TYPE(WATTUR), 27);
|
map.insert(TYPE(WATTUR), 27);
|
||||||
map.insert(TYPE(PILBOP), 28);
|
map.insert(TYPE(PILBOP), 28);
|
||||||
map.insert(TYPE(I_RDOCAL), 29);
|
map.insert(TYPE(SISTAT), 29);
|
||||||
map.insert(TYPE(I_TRNBSN), 30);
|
map.insert(TYPE(I_SISTAT), 29);
|
||||||
map.insert(TYPE(HRBFAC), 31);
|
map.insert(TYPE(I_RDOCAL), 30);
|
||||||
map.insert(TYPE(I_HRBFAC), 31);
|
map.insert(TYPE(I_TRNBSN), 31);
|
||||||
map.insert(TYPE(PILPNT), 32);
|
map.insert(TYPE(HRBFAC), 32);
|
||||||
map.insert(TYPE(ACHBRT), 33);
|
map.insert(TYPE(I_HRBFAC), 32);
|
||||||
map.insert(TYPE(I_ACHBRT), 33);
|
map.insert(TYPE(PILPNT), 33);
|
||||||
map.insert(TYPE(CRANES), 34);
|
map.insert(TYPE(ACHBRT), 34);
|
||||||
map.insert(TYPE(I_CRANES), 34);
|
map.insert(TYPE(I_ACHBRT), 34);
|
||||||
map.insert(TYPE(I_WTWGAG), 35);
|
map.insert(TYPE(CRANES), 35);
|
||||||
map.insert(TYPE(PYLONS), 36);
|
map.insert(TYPE(I_CRANES), 35);
|
||||||
map.insert(TYPE(LNDMRK), 37);
|
map.insert(TYPE(I_WTWGAG), 36);
|
||||||
map.insert(TYPE(SILTNK), 38);
|
map.insert(TYPE(PYLONS), 37);
|
||||||
map.insert(TYPE(LNDELV), 39);
|
map.insert(TYPE(LNDMRK), 38);
|
||||||
map.insert(TYPE(SMCFAC), 40);
|
map.insert(TYPE(SILTNK), 39);
|
||||||
map.insert(TYPE(BUISGL), 41);
|
map.insert(TYPE(LNDELV), 40);
|
||||||
|
map.insert(TYPE(SMCFAC), 41);
|
||||||
|
map.insert(TYPE(BUISGL), 42);
|
||||||
|
|
||||||
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
|
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
|
||||||
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
|
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
|
||||||
@ -220,6 +221,22 @@ static QString hUnits(uint type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QString sistat(uint type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
return "SS (Port Control)";
|
||||||
|
case 3:
|
||||||
|
return "SS (INT)";
|
||||||
|
case 6:
|
||||||
|
return "SS (Lock)";
|
||||||
|
case 8:
|
||||||
|
return "SS (Bridge)";
|
||||||
|
default:
|
||||||
|
return "SS";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
|
MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
|
||||||
const QVector<QByteArray> ¶ms) : _type(type), _pos(c), _label(label)
|
const QVector<QByteArray> ¶ms) : _type(type), _pos(c), _label(label)
|
||||||
{
|
{
|
||||||
@ -233,6 +250,10 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
|
|||||||
if (!params.at(1).isEmpty())
|
if (!params.at(1).isEmpty())
|
||||||
_label = QString("VHF ") + QString::fromLatin1(params.at(1));
|
_label = QString("VHF ") + QString::fromLatin1(params.at(1));
|
||||||
_param = QVariant(params.at(0).toDouble());
|
_param = QVariant(params.at(0).toDouble());
|
||||||
|
} else if (type>>16 == I_SISTAT || type>>16 == SISTAT) {
|
||||||
|
if (_label.isEmpty())
|
||||||
|
_label = sistat(type & 0xFF);
|
||||||
|
_type = TYPE(SISTAT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +530,9 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL)
|
|||||||
|| (OBJL == BUAARE && key == CATBUA)
|
|| (OBJL == BUAARE && key == CATBUA)
|
||||||
|| (OBJL == SMCFAC && key == CATSCF)
|
|| (OBJL == SMCFAC && key == CATSCF)
|
||||||
|| (OBJL == BUISGL && key == FUNCTN)
|
|| (OBJL == BUISGL && key == FUNCTN)
|
||||||
|| (OBJL == WATTUR && key == CATWAT))
|
|| (OBJL == WATTUR && key == CATWAT)
|
||||||
|
|| (OBJL == SISTAT && key == CATSIT)
|
||||||
|
|| (OBJL == I_SISTAT && key == I_CATSIT))
|
||||||
subtype = av.at(1).toByteArray().toUInt();
|
subtype = av.at(1).toByteArray().toUInt();
|
||||||
else if (OBJL == I_DISMAR && key == CATDIS)
|
else if (OBJL == I_DISMAR && key == CATDIS)
|
||||||
subtype |= av.at(1).toByteArray().toUInt();
|
subtype |= av.at(1).toByteArray().toUInt();
|
||||||
@ -727,31 +750,25 @@ bool MapData::bounds(const QVector<ISO8211::Record> &gv, Rect &b)
|
|||||||
|
|
||||||
MapData::MapData(const QString &path): _fileName(path)
|
MapData::MapData(const QString &path): _fileName(path)
|
||||||
{
|
{
|
||||||
QFile file(_fileName);
|
|
||||||
QVector<ISO8211::Record> gv;
|
QVector<ISO8211::Record> gv;
|
||||||
ISO8211 ddf;
|
ISO8211 ddf(_fileName);
|
||||||
|
ISO8211::Record record;
|
||||||
uint COMF = 1;
|
uint COMF = 1;
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!ddf.readDDR()) {
|
||||||
_errorString = file.errorString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ddf.readDDR(file)) {
|
|
||||||
_errorString = ddf.errorString();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
while (!file.atEnd()) {
|
|
||||||
ISO8211::Record record;
|
|
||||||
if (!ddf.readRecord(file, record)) {
|
|
||||||
_errorString = ddf.errorString();
|
_errorString = ddf.errorString();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
while (ddf.readRecord(record)) {
|
||||||
if (!processRecord(record, gv, COMF, _name)) {
|
if (!processRecord(record, gv, COMF, _name)) {
|
||||||
_errorString = "Invalid S-57 record";
|
_errorString = "Invalid S-57 record";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!ddf.errorString().isNull()) {
|
||||||
|
_errorString = ddf.errorString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Rect b;
|
Rect b;
|
||||||
if (!bounds(gv, b)) {
|
if (!bounds(gv, b)) {
|
||||||
@ -783,30 +800,22 @@ MapData::~MapData()
|
|||||||
|
|
||||||
void MapData::load()
|
void MapData::load()
|
||||||
{
|
{
|
||||||
QFile file(_fileName);
|
|
||||||
RecordMap vi, vc, ve, vf;
|
RecordMap vi, vc, ve, vf;
|
||||||
QVector<ISO8211::Record> fe;
|
QVector<ISO8211::Record> fe;
|
||||||
uint COMF = 1, SOMF = 1;
|
ISO8211 ddf(_fileName);
|
||||||
ISO8211 ddf;
|
ISO8211::Record record;
|
||||||
uint PRIM, OBJL;
|
uint PRIM, OBJL, COMF = 1, SOMF = 1;
|
||||||
Poly *poly;
|
Poly *poly;
|
||||||
Line *line;
|
Line *line;
|
||||||
Point *point;
|
Point *point;
|
||||||
double min[2], max[2];
|
double min[2], max[2];
|
||||||
|
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadOnly))
|
if (!ddf.readDDR())
|
||||||
return;
|
|
||||||
|
|
||||||
if (!ddf.readDDR(file))
|
|
||||||
return;
|
|
||||||
while (!file.atEnd()) {
|
|
||||||
ISO8211::Record record;
|
|
||||||
if (!ddf.readRecord(file, record))
|
|
||||||
return;
|
return;
|
||||||
|
while (ddf.readRecord(record))
|
||||||
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF))
|
if (!processRecord(record, fe, vi, vc, ve, vf, COMF, SOMF))
|
||||||
return;
|
qWarning("Invalid S-57 record");
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < fe.size(); i++) {
|
for (int i = 0; i < fe.size(); i++) {
|
||||||
const ISO8211::Record &r = fe.at(i);
|
const ISO8211::Record &r = fe.at(i);
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
#define RIVERS 114
|
#define RIVERS 114
|
||||||
#define ROADWY 116
|
#define ROADWY 116
|
||||||
#define SLCONS 122
|
#define SLCONS 122
|
||||||
|
#define SISTAT 123
|
||||||
#define SILTNK 125
|
#define SILTNK 125
|
||||||
#define SLOTOP 126
|
#define SLOTOP 126
|
||||||
#define SMCFAC 128
|
#define SMCFAC 128
|
||||||
@ -90,6 +91,7 @@
|
|||||||
#define I_ACHARE 17001
|
#define I_ACHARE 17001
|
||||||
#define I_DISMAR 17004
|
#define I_DISMAR 17004
|
||||||
#define I_RESARE 17005
|
#define I_RESARE 17005
|
||||||
|
#define I_SISTAT 17007
|
||||||
#define I_BERTHS 17010
|
#define I_BERTHS 17010
|
||||||
#define I_BRIDGE 17011
|
#define I_BRIDGE 17011
|
||||||
#define I_CBLOHD 17012
|
#define I_CBLOHD 17012
|
||||||
|
@ -67,6 +67,9 @@ void Style::polygonStyle()
|
|||||||
QImage(":/marine/entry-prohibited-line.png"));
|
QImage(":/marine/entry-prohibited-line.png"));
|
||||||
_polygons[SUBTYPE(I_RESARE, 17)] = Polygon(
|
_polygons[SUBTYPE(I_RESARE, 17)] = Polygon(
|
||||||
QImage(":/marine/entry-prohibited-line.png"));
|
QImage(":/marine/entry-prohibited-line.png"));
|
||||||
|
_polygons[SUBTYPE(RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||||
|
_polygons[SUBTYPE(I_RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||||
|
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||||
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
|
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
|
||||||
_polygons[SUBTYPE(I_ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
|
_polygons[SUBTYPE(I_ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
|
||||||
_polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor("#eb49eb"),
|
_polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor("#eb49eb"),
|
||||||
@ -117,7 +120,8 @@ void Style::polygonStyle()
|
|||||||
<< TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC)
|
<< TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC)
|
||||||
<< TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1)
|
<< TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1)
|
||||||
<< SUBTYPE(RESARE, 9) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2)
|
<< SUBTYPE(RESARE, 9) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2)
|
||||||
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << TYPE(CBLARE)
|
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 12)
|
||||||
|
<< SUBTYPE(I_RESARE, 12) << SUBTYPE(RESARE, 1) << TYPE(CBLARE)
|
||||||
<< TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(MARKUL, 3);
|
<< TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(MARKUL, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,6 +245,7 @@ void Style::pointStyle()
|
|||||||
_points[SUBTYPE(I_DISMAR, 2)].setTextFontSize(Small);
|
_points[SUBTYPE(I_DISMAR, 2)].setTextFontSize(Small);
|
||||||
_points[SUBTYPE(I_DISMAR, 2)].setHaloColor(QColor());
|
_points[SUBTYPE(I_DISMAR, 2)].setHaloColor(QColor());
|
||||||
_points[SUBTYPE(I_DISMAR, 3)] = _points[SUBTYPE(I_DISMAR, 2)];
|
_points[SUBTYPE(I_DISMAR, 3)] = _points[SUBTYPE(I_DISMAR, 2)];
|
||||||
|
_points[SUBTYPE(I_DISMAR, 4)] = _points[SUBTYPE(I_DISMAR, 2)];
|
||||||
_points[TYPE(CGUSTA)] = Point(QImage(":/marine/coast-guard.png"));
|
_points[TYPE(CGUSTA)] = Point(QImage(":/marine/coast-guard.png"));
|
||||||
_points[TYPE(RDOSTA)] = Point(QImage(":/marine/radio.png"));
|
_points[TYPE(RDOSTA)] = Point(QImage(":/marine/radio.png"));
|
||||||
_points[TYPE(RADSTA)] = Point(QImage(":/marine/radar.png"));
|
_points[TYPE(RADSTA)] = Point(QImage(":/marine/radar.png"));
|
||||||
@ -255,6 +260,7 @@ void Style::pointStyle()
|
|||||||
_points[SUBTYPE(WATTUR, 3)] = Point(QImage(":/marine/overfalls.png"));
|
_points[SUBTYPE(WATTUR, 3)] = Point(QImage(":/marine/overfalls.png"));
|
||||||
_points[SUBTYPE(WATTUR, 4)] = Point(QImage(":/marine/overfalls.png"));
|
_points[SUBTYPE(WATTUR, 4)] = Point(QImage(":/marine/overfalls.png"));
|
||||||
_points[TYPE(PILBOP)] = Point(QImage(":/marine/boarding-place.png"));
|
_points[TYPE(PILBOP)] = Point(QImage(":/marine/boarding-place.png"));
|
||||||
|
_points[TYPE(SISTAT)] = Point(QImage(":/marine/pylon.png"));
|
||||||
|
|
||||||
_points[SUBTYPE(SMCFAC, 7)] = Point(QImage(":/POI/restaurant-11.png"));
|
_points[SUBTYPE(SMCFAC, 7)] = Point(QImage(":/POI/restaurant-11.png"));
|
||||||
_points[SUBTYPE(SMCFAC, 11)] = Point(QImage(":/POI/pharmacy-11.png"));
|
_points[SUBTYPE(SMCFAC, 11)] = Point(QImage(":/POI/pharmacy-11.png"));
|
||||||
|
@ -301,7 +301,7 @@ void RasterTile::processPolygons(QList<TextItem*> &textItems)
|
|||||||
QList<TextItem *> labels;
|
QList<TextItem *> labels;
|
||||||
|
|
||||||
for (int i = 0; i < _polygons.size(); i++) {
|
for (int i = 0; i < _polygons.size(); i++) {
|
||||||
MapData::Poly &poly = _polygons[i];
|
const MapData::Poly &poly = _polygons.at(i);
|
||||||
bool exists = set.contains(poly.label.text());
|
bool exists = set.contains(poly.label.text());
|
||||||
|
|
||||||
if (poly.label.text().isEmpty())
|
if (poly.label.text().isEmpty())
|
||||||
@ -343,7 +343,7 @@ void RasterTile::processLines(QList<TextItem*> &textItems)
|
|||||||
void RasterTile::processStreetNames(QList<TextItem*> &textItems)
|
void RasterTile::processStreetNames(QList<TextItem*> &textItems)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _lines.size(); i++) {
|
for (int i = 0; i < _lines.size(); i++) {
|
||||||
MapData::Poly &poly = _lines[i];
|
const MapData::Poly &poly = _lines.at(i);
|
||||||
const Style::Line &style = _style->line(poly.type);
|
const Style::Line &style = _style->line(poly.type);
|
||||||
|
|
||||||
if (style.img().isNull() && style.foreground() == Qt::NoPen)
|
if (style.img().isNull() && style.foreground() == Qt::NoPen)
|
||||||
@ -433,7 +433,7 @@ void RasterTile::processPoints(QList<TextItem*> &textItems)
|
|||||||
std::sort(_points.begin(), _points.end());
|
std::sort(_points.begin(), _points.end());
|
||||||
|
|
||||||
for (int i = 0; i < _points.size(); i++) {
|
for (int i = 0; i < _points.size(); i++) {
|
||||||
MapData::Point &point = _points[i];
|
const MapData::Point &point = _points.at(i);
|
||||||
const Style::Point &style = _style->point(point.type);
|
const Style::Point &style = _style->point(point.type);
|
||||||
bool poi = Style::isPOI(point.type);
|
bool poi = Style::isPOI(point.type);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef SECTION_H
|
#ifndef IMG_SECTION_H
|
||||||
#define SECTION_H
|
#define IMG_SECTION_H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
@ -14,4 +14,4 @@ struct Section {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SECTION_H
|
#endif // IMG_SECTION_H
|
||||||
|
@ -384,10 +384,13 @@ void Style::defaultLineStyle()
|
|||||||
_lines[0x10307] = Line(QPen(QColor("#05620e"), 1, Qt::SolidLine));
|
_lines[0x10307] = Line(QPen(QColor("#05620e"), 1, Qt::SolidLine));
|
||||||
_lines[0x10401] = Line(QImage(":/marine/cable.png"));
|
_lines[0x10401] = Line(QImage(":/marine/cable.png"));
|
||||||
_lines[0x10402] = Line(QImage(":/marine/pipeline.png"));
|
_lines[0x10402] = Line(QImage(":/marine/pipeline.png"));
|
||||||
_lines[0x10405] = Line(QPen(QColor("#e728e7"), 1, Qt::DashLine));
|
_lines[0x10404] = Line(QImage(":/marine/fishing-farm-line.png"));
|
||||||
|
_lines[0x10405] = Line(QImage(":/marine/pipeline-area-line.png"));
|
||||||
|
_lines[0x10406] = Line(QImage(":/marine/cable-area-line.png"));
|
||||||
_lines[0x10409] = Line(QPen(QColor("#000000"), 1, Qt::DotLine));
|
_lines[0x10409] = Line(QPen(QColor("#000000"), 1, Qt::DotLine));
|
||||||
_lines[0x10501] = Line(QImage(":/marine/noanchor-line.png"));
|
_lines[0x10501] = Line(QImage(":/marine/noanchor-line.png"));
|
||||||
_lines[0x10503] = Line(QPen(QColor("#e728e7"), 1, Qt::DashLine));
|
_lines[0x10503] = Line(QPen(QColor("#e728e7"), 1, Qt::DashLine));
|
||||||
|
_lines[0x10505] = Line(QImage(":/marine/safety-zone-line.png"));
|
||||||
_lines[0x10507] = Line(QPen(QColor("#e728e7"), 1, Qt::DashLine));
|
_lines[0x10507] = Line(QPen(QColor("#e728e7"), 1, Qt::DashLine));
|
||||||
_lines[0x10601] = Line(QPen(QColor("#000000"), 1, Qt::SolidLine));
|
_lines[0x10601] = Line(QPen(QColor("#000000"), 1, Qt::SolidLine));
|
||||||
_lines[0x10606] = Line(QImage(":/marine/anchor-line.png"));
|
_lines[0x10606] = Line(QImage(":/marine/anchor-line.png"));
|
||||||
@ -663,8 +666,10 @@ void Style::defaultPointStyle()
|
|||||||
_points[0x10216] = Point(QImage(":/marine/mooring-buoy.png"));
|
_points[0x10216] = Point(QImage(":/marine/mooring-buoy.png"));
|
||||||
_points[0x10305] = Point(QImage(":/marine/chimney.png"));
|
_points[0x10305] = Point(QImage(":/marine/chimney.png"));
|
||||||
_points[0x10306] = Point(QImage(":/marine/church.png"));
|
_points[0x10306] = Point(QImage(":/marine/church.png"));
|
||||||
|
_points[0x10307] = Point(QImage(":/marine/silo.png"));
|
||||||
_points[0x10308] = Point(QImage(":/marine/tower.png"));
|
_points[0x10308] = Point(QImage(":/marine/tower.png"));
|
||||||
_points[0x1030a] = Point(QImage(":/marine/triangulation-point.png"));
|
_points[0x1030a] = Point(QImage(":/marine/triangulation-point.png"));
|
||||||
|
_points[0x1030b] = Point(QImage(":/marine/radio.png"));
|
||||||
_points[0x10400] = Point(QImage(":/marine/obstruction.png"));
|
_points[0x10400] = Point(QImage(":/marine/obstruction.png"));
|
||||||
_points[0x10401] = Point(QImage(":/marine/obstruction.png"));
|
_points[0x10401] = Point(QImage(":/marine/obstruction.png"));
|
||||||
_points[0x10402] = Point(QImage(":/marine/wreck.png"));
|
_points[0x10402] = Point(QImage(":/marine/wreck.png"));
|
||||||
@ -673,9 +678,12 @@ void Style::defaultPointStyle()
|
|||||||
_points[0x1040a] = Point(QImage(":/marine/rock-dangerous.png"));
|
_points[0x1040a] = Point(QImage(":/marine/rock-dangerous.png"));
|
||||||
_points[0x1040c] = Point(QImage(":/marine/rock-exposed.png"));
|
_points[0x1040c] = Point(QImage(":/marine/rock-exposed.png"));
|
||||||
_points[0x10701] = Point(QImage(":/marine/anchorage.png"));
|
_points[0x10701] = Point(QImage(":/marine/anchorage.png"));
|
||||||
|
_points[0x10702] = Point(QImage(":/marine/boarding-place.png"));
|
||||||
_points[0x10703] = Point(QImage(":/marine/yacht-harbor.png"));
|
_points[0x10703] = Point(QImage(":/marine/yacht-harbor.png"));
|
||||||
_points[0x10704] = Point(QImage(":/marine/pile.png"));
|
_points[0x10704] = Point(QImage(":/marine/pile.png"));
|
||||||
_points[0x10705] = Point(QImage(":/marine/anchoring-prohibited.png"));
|
_points[0x10705] = Point(QImage(":/marine/anchoring-prohibited.png"));
|
||||||
|
_points[0x1070a] = Point(QImage(":/marine/coast-guard.png"));
|
||||||
|
_points[0x1070b] = Point(QImage(":/marine/fishing-harbor.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Style::itemInfo(SubFile *file, SubFile::Handle &hdl,
|
bool Style::itemInfo(SubFile *file, SubFile::Handle &hdl,
|
||||||
|
@ -381,7 +381,7 @@ void OziMap::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
|||||||
Map *OziMap::createTAR(const QString &path, const Projection &, bool *isDir)
|
Map *OziMap::createTAR(const QString &path, const Projection &, bool *isDir)
|
||||||
{
|
{
|
||||||
if (isDir)
|
if (isDir)
|
||||||
*isDir = true;
|
*isDir = false;
|
||||||
|
|
||||||
return new OziMap(path, true);
|
return new OziMap(path, true);
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ Map *OziMap::createTAR(const QString &path, const Projection &, bool *isDir)
|
|||||||
Map *OziMap::createMAP(const QString &path, const Projection &, bool *isDir)
|
Map *OziMap::createMAP(const QString &path, const Projection &, bool *isDir)
|
||||||
{
|
{
|
||||||
if (isDir)
|
if (isDir)
|
||||||
*isDir = true;
|
*isDir = false;
|
||||||
|
|
||||||
return new OziMap(path, false);
|
return new OziMap(path, false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user