mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-07 18:53:02 +02:00
Compare commits
2 Commits
ed4c18b773
...
0d9daf8b4f
Author | SHA1 | Date | |
---|---|---|---|
0d9daf8b4f | |||
ed7fc5fba3 |
@ -44,6 +44,15 @@ ISO8211::SubFieldDefinition ISO8211::fieldType(const QString &str, int cnt)
|
|||||||
return SubFieldDefinition();
|
return SubFieldDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ISO8211::Field *ISO8211::Record::field(quint32 name) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < size(); i++)
|
||||||
|
if (at(i).tag() == name)
|
||||||
|
return &at(i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int ISO8211::readDR(QVector<FieldDefinition> &fields)
|
int ISO8211::readDR(QVector<FieldDefinition> &fields)
|
||||||
{
|
{
|
||||||
DR ddr;
|
DR ddr;
|
||||||
@ -275,16 +284,12 @@ bool ISO8211::readRecord(Record &record)
|
|||||||
|
|
||||||
FieldsMap::const_iterator it(_map.find(def.tag));
|
FieldsMap::const_iterator it(_map.find(def.tag));
|
||||||
if (it == _map.constEnd()) {
|
if (it == _map.constEnd()) {
|
||||||
QByteArray tag(sizeof(quint32), Qt::Initialization::Uninitialized);
|
_errorString = QString("%1: unknown record").arg(NAME(def.tag));
|
||||||
qToLittleEndian<quint32>(def.tag, tag.data());
|
|
||||||
_errorString = QString("%1: unknown record").arg(QString(tag));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!readUDA(pos, def, it->defs(), it->repeat(), data)) {
|
if (!readUDA(pos, def, it->defs(), it->repeat(), data)) {
|
||||||
QByteArray tag(sizeof(quint32), Qt::Initialization::Uninitialized);
|
_errorString = QString("Error reading %1 record").arg(NAME(def.tag));
|
||||||
qToLittleEndian<quint32>(def.tag, tag.data());
|
|
||||||
_errorString = QString("Error reading %1 record").arg(QString(tag));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,11 +299,9 @@ bool ISO8211::readRecord(Record &record)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ISO8211::Field *ISO8211::Record::field(quint32 name) const
|
QString ISO8211::NAME(quint32 tag)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < size(); i++)
|
QByteArray ba(sizeof(quint32), Qt::Initialization::Uninitialized);
|
||||||
if (at(i).tag() == name)
|
qToLittleEndian<quint32>(tag, ba.data());
|
||||||
return &at(i);
|
return QString::fromLatin1(ba);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -38,13 +38,14 @@ public:
|
|||||||
bool atEnd() const {return _file.atEnd();}
|
bool atEnd() const {return _file.atEnd();}
|
||||||
const QString &errorString() const {return _errorString;}
|
const QString &errorString() const {return _errorString;}
|
||||||
|
|
||||||
static constexpr quint32 NAME(const char str[4])
|
static constexpr quint32 TAG(const char name[4])
|
||||||
{
|
{
|
||||||
return static_cast<quint32>(str[0])
|
return static_cast<quint32>(name[0])
|
||||||
+ (static_cast<quint32>(str[1]) << 8)
|
+ (static_cast<quint32>(name[1]) << 8)
|
||||||
+ (static_cast<quint32>(str[2]) << 16)
|
+ (static_cast<quint32>(name[2]) << 16)
|
||||||
+ (static_cast<quint32>(str[3]) << 24);
|
+ (static_cast<quint32>(name[3]) << 24);
|
||||||
}
|
}
|
||||||
|
static QString NAME(quint32 tag);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum FieldType {Unknown, String, Array, S8, S16, S32, U8, U16, U32};
|
enum FieldType {Unknown, String, Array, S8, S16, S32, U8, U16, U32};
|
||||||
|
@ -15,14 +15,14 @@ using namespace ENC;
|
|||||||
#define PRIM_L 2
|
#define PRIM_L 2
|
||||||
#define PRIM_A 3
|
#define PRIM_A 3
|
||||||
|
|
||||||
constexpr quint32 SG2D = ISO8211::NAME("SG2D");
|
constexpr quint32 SG2D = ISO8211::TAG("SG2D");
|
||||||
constexpr quint32 SG3D = ISO8211::NAME("SG3D");
|
constexpr quint32 SG3D = ISO8211::TAG("SG3D");
|
||||||
constexpr quint32 FSPT = ISO8211::NAME("FSPT");
|
constexpr quint32 FSPT = ISO8211::TAG("FSPT");
|
||||||
constexpr quint32 VRPT = ISO8211::NAME("VRPT");
|
constexpr quint32 VRPT = ISO8211::TAG("VRPT");
|
||||||
constexpr quint32 ATTF = ISO8211::NAME("ATTF");
|
constexpr quint32 ATTF = ISO8211::TAG("ATTF");
|
||||||
constexpr quint32 VRID = ISO8211::NAME("VRID");
|
constexpr quint32 VRID = ISO8211::TAG("VRID");
|
||||||
constexpr quint32 FRID = ISO8211::NAME("FRID");
|
constexpr quint32 FRID = ISO8211::TAG("FRID");
|
||||||
constexpr quint32 DSPM = ISO8211::NAME("DSPM");
|
constexpr quint32 DSPM = ISO8211::TAG("DSPM");
|
||||||
|
|
||||||
static QMap<uint,uint> orderMapInit()
|
static QMap<uint,uint> orderMapInit()
|
||||||
{
|
{
|
||||||
@ -85,6 +85,8 @@ static QMap<uint,uint> orderMapInit()
|
|||||||
map.insert(TYPE(LNDELV), 44);
|
map.insert(TYPE(LNDELV), 44);
|
||||||
map.insert(TYPE(SMCFAC), 45);
|
map.insert(TYPE(SMCFAC), 45);
|
||||||
map.insert(TYPE(BUISGL), 46);
|
map.insert(TYPE(BUISGL), 46);
|
||||||
|
map.insert(TYPE(ACHARE), 47);
|
||||||
|
map.insert(TYPE(I_ACHARE), 47);
|
||||||
|
|
||||||
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
|
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
|
||||||
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
|
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
|
||||||
@ -192,7 +194,8 @@ static bool polygonPointCb(const MapData::Poly *polygon, void *context)
|
|||||||
|| type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2)
|
|| type == SUBTYPE(ACHARE, 2) || type == SUBTYPE(I_ACHARE, 2)
|
||||||
|| type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3)
|
|| type == SUBTYPE(ACHARE, 3) || type == SUBTYPE(I_ACHARE, 3)
|
||||||
|| type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9)
|
|| type == SUBTYPE(ACHARE, 9) || type == SUBTYPE(I_ACHARE, 9)
|
||||||
|| type == SUBTYPE(I_BERTHS, 6)
|
|| type == SUBTYPE(I_ACHARE, 10) || type == SUBTYPE(I_ACHARE, 11)
|
||||||
|
|| type == SUBTYPE(I_ACHARE, 12) || type == SUBTYPE(I_BERTHS, 6)
|
||||||
|| type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1)
|
|| type == SUBTYPE(RESARE, 1) || type == SUBTYPE(I_RESARE, 1)
|
||||||
|| type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2)
|
|| type == SUBTYPE(RESARE, 2) || type == SUBTYPE(I_RESARE, 2)
|
||||||
|| type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4)
|
|| type == SUBTYPE(RESARE, 4) || type == SUBTYPE(I_RESARE, 4)
|
||||||
|
@ -412,15 +412,42 @@ void Style::pointStyle(qreal ratio)
|
|||||||
Small);
|
Small);
|
||||||
_points[SUBTYPE(I_BERTHS, 6)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
_points[SUBTYPE(I_BERTHS, 6)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
_points[SUBTYPE(I_BERTHS, 6)].setHaloColor(QColor());
|
_points[SUBTYPE(I_BERTHS, 6)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 1)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 1)].setHaloColor(QColor());
|
||||||
_points[SUBTYPE(ACHARE, 2)] = Point(QImage(":/marine/dw-anchorage.png"),
|
_points[SUBTYPE(ACHARE, 2)] = Point(QImage(":/marine/dw-anchorage.png"),
|
||||||
Small);
|
Small);
|
||||||
|
_points[SUBTYPE(ACHARE, 2)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 2)].setHaloColor(QColor());
|
||||||
_points[SUBTYPE(ACHARE, 3)] = Point(QImage(":/marine/tanker-anchorage.png"),
|
_points[SUBTYPE(ACHARE, 3)] = Point(QImage(":/marine/tanker-anchorage.png"),
|
||||||
Small);
|
Small);
|
||||||
|
_points[SUBTYPE(ACHARE, 3)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 3)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 4)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 4)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 5)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 5)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 6)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 6)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 7)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 7)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(ACHARE, 8)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 8)].setHaloColor(QColor());
|
||||||
_points[SUBTYPE(ACHARE, 9)] = Point(QImage(":/marine/24h-anchorage.png"),
|
_points[SUBTYPE(ACHARE, 9)] = Point(QImage(":/marine/24h-anchorage.png"),
|
||||||
Small);
|
Small);
|
||||||
|
_points[SUBTYPE(ACHARE, 9)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
|
_points[SUBTYPE(ACHARE, 9)].setHaloColor(QColor());
|
||||||
|
_points[SUBTYPE(I_ACHARE, 1)] = _points[SUBTYPE(ACHARE, 1)];
|
||||||
_points[SUBTYPE(I_ACHARE, 2)] = _points[SUBTYPE(ACHARE, 2)];
|
_points[SUBTYPE(I_ACHARE, 2)] = _points[SUBTYPE(ACHARE, 2)];
|
||||||
_points[SUBTYPE(I_ACHARE, 3)] = _points[SUBTYPE(ACHARE, 3)];
|
_points[SUBTYPE(I_ACHARE, 3)] = _points[SUBTYPE(ACHARE, 3)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 4)] = _points[SUBTYPE(ACHARE, 4)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 5)] = _points[SUBTYPE(ACHARE, 5)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 6)] = _points[SUBTYPE(ACHARE, 6)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 7)] = _points[SUBTYPE(ACHARE, 7)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 8)] = _points[SUBTYPE(ACHARE, 8)];
|
||||||
_points[SUBTYPE(I_ACHARE, 9)] = _points[SUBTYPE(ACHARE, 9)];
|
_points[SUBTYPE(I_ACHARE, 9)] = _points[SUBTYPE(ACHARE, 9)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 10)] = _points[SUBTYPE(I_ACHARE, 1)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 11)] = _points[SUBTYPE(I_ACHARE, 1)];
|
||||||
|
_points[SUBTYPE(I_ACHARE, 12)] = _points[SUBTYPE(I_ACHARE, 1)];
|
||||||
_points[SUBTYPE(RESARE, 1)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
_points[SUBTYPE(RESARE, 1)].setTextColor(QColor(0xeb, 0x49, 0xeb));
|
||||||
_points[SUBTYPE(RESARE, 1)].setHaloColor(QColor());
|
_points[SUBTYPE(RESARE, 1)].setHaloColor(QColor());
|
||||||
_points[SUBTYPE(RESARE, 2)] = _points[SUBTYPE(RESARE, 1)];
|
_points[SUBTYPE(RESARE, 2)] = _points[SUBTYPE(RESARE, 1)];
|
||||||
|
@ -12,7 +12,7 @@ using namespace ENC;
|
|||||||
#define EPSILON 1e-6
|
#define EPSILON 1e-6
|
||||||
#define TILE_SIZE 512
|
#define TILE_SIZE 512
|
||||||
|
|
||||||
constexpr quint32 CATD = ISO8211::NAME("CATD");
|
constexpr quint32 CATD = ISO8211::TAG("CATD");
|
||||||
|
|
||||||
Range ENCAtlas::zooms(IntendedUsage usage)
|
Range ENCAtlas::zooms(IntendedUsage usage)
|
||||||
{
|
{
|
||||||
|
@ -15,11 +15,11 @@ using namespace ENC;
|
|||||||
#define EPSILON 1e-6
|
#define EPSILON 1e-6
|
||||||
#define TILE_SIZE 512
|
#define TILE_SIZE 512
|
||||||
|
|
||||||
constexpr quint32 SG2D = ISO8211::NAME("SG2D");
|
constexpr quint32 SG2D = ISO8211::TAG("SG2D");
|
||||||
constexpr quint32 SG3D = ISO8211::NAME("SG3D");
|
constexpr quint32 SG3D = ISO8211::TAG("SG3D");
|
||||||
constexpr quint32 VRID = ISO8211::NAME("VRID");
|
constexpr quint32 VRID = ISO8211::TAG("VRID");
|
||||||
constexpr quint32 DSID = ISO8211::NAME("DSID");
|
constexpr quint32 DSID = ISO8211::TAG("DSID");
|
||||||
constexpr quint32 DSPM = ISO8211::NAME("DSPM");
|
constexpr quint32 DSPM = ISO8211::TAG("DSPM");
|
||||||
|
|
||||||
static Range zooms(const RectC &bounds)
|
static Range zooms(const RectC &bounds)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user