From 9ff7ecea9750af525ef9402a33c24f4089353c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 11 Jan 2023 23:03:54 +0100 Subject: [PATCH] ENC signal stations --- src/map/ENC/attributes.h | 2 ++ src/map/ENC/mapdata.cpp | 58 ++++++++++++++++++++++++++++------------ src/map/ENC/objects.h | 2 ++ src/map/ENC/style.cpp | 2 ++ 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/map/ENC/attributes.h b/src/map/ENC/attributes.h index 8b434f12..4aa64450 100644 --- a/src/map/ENC/attributes.h +++ b/src/map/ENC/attributes.h @@ -10,6 +10,7 @@ #define CATMOR 40 #define CATTRK 54 #define CATREA 56 +#define CATSIT 61 #define CATSCF 65 #define CATWAT 69 #define CATWRK 71 @@ -24,6 +25,7 @@ #define WATLEV 187 #define I_CATACH 17000 +#define I_CATSIT 17002 #define I_RESTRN 17004 #define I_CATHAF 17008 #define I_RDOCAL 17017 diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index 3b2df86d..f9c02583 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -51,22 +51,24 @@ static QMap orderMapInit() map.insert(TYPE(UWTROC), 26); map.insert(TYPE(WATTUR), 27); map.insert(TYPE(PILBOP), 28); - map.insert(TYPE(I_RDOCAL), 29); - map.insert(TYPE(I_TRNBSN), 30); - map.insert(TYPE(HRBFAC), 31); - map.insert(TYPE(I_HRBFAC), 31); - map.insert(TYPE(PILPNT), 32); - map.insert(TYPE(ACHBRT), 33); - map.insert(TYPE(I_ACHBRT), 33); - map.insert(TYPE(CRANES), 34); - map.insert(TYPE(I_CRANES), 34); - map.insert(TYPE(I_WTWGAG), 35); - map.insert(TYPE(PYLONS), 36); - map.insert(TYPE(LNDMRK), 37); - map.insert(TYPE(SILTNK), 38); - map.insert(TYPE(LNDELV), 39); - map.insert(TYPE(SMCFAC), 40); - map.insert(TYPE(BUISGL), 41); + map.insert(TYPE(SISTAT), 29); + map.insert(TYPE(I_SISTAT), 29); + map.insert(TYPE(I_RDOCAL), 30); + map.insert(TYPE(I_TRNBSN), 31); + map.insert(TYPE(HRBFAC), 32); + map.insert(TYPE(I_HRBFAC), 32); + map.insert(TYPE(PILPNT), 33); + map.insert(TYPE(ACHBRT), 34); + map.insert(TYPE(I_ACHBRT), 34); + map.insert(TYPE(CRANES), 35); + map.insert(TYPE(I_CRANES), 35); + map.insert(TYPE(I_WTWGAG), 36); + map.insert(TYPE(PYLONS), 37); + map.insert(TYPE(LNDMRK), 38); + map.insert(TYPE(SILTNK), 39); + map.insert(TYPE(LNDELV), 40); + map.insert(TYPE(SMCFAC), 41); + map.insert(TYPE(BUISGL), 42); map.insert(TYPE(I_DISMAR), 0xFFFFFFFE); map.insert(TYPE(SOUNDG), 0xFFFFFFFF); @@ -220,6 +222,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, const QVector ¶ms) : _type(type), _pos(c), _label(label) { @@ -233,6 +251,10 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label, if (!params.at(1).isEmpty()) _label = QString("VHF ") + QString::fromLatin1(params.at(1)); _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 +531,9 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL) || (OBJL == BUAARE && key == CATBUA) || (OBJL == SMCFAC && key == CATSCF) || (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(); else if (OBJL == I_DISMAR && key == CATDIS) subtype |= av.at(1).toByteArray().toUInt(); diff --git a/src/map/ENC/objects.h b/src/map/ENC/objects.h index 164713b5..36781e22 100644 --- a/src/map/ENC/objects.h +++ b/src/map/ENC/objects.h @@ -71,6 +71,7 @@ #define RIVERS 114 #define ROADWY 116 #define SLCONS 122 +#define SISTAT 123 #define SILTNK 125 #define SLOTOP 126 #define SMCFAC 128 @@ -90,6 +91,7 @@ #define I_ACHARE 17001 #define I_DISMAR 17004 #define I_RESARE 17005 +#define I_SISTAT 17007 #define I_BERTHS 17010 #define I_BRIDGE 17011 #define I_CBLOHD 17012 diff --git a/src/map/ENC/style.cpp b/src/map/ENC/style.cpp index 2ac56212..f7c5dacb 100644 --- a/src/map/ENC/style.cpp +++ b/src/map/ENC/style.cpp @@ -245,6 +245,7 @@ void Style::pointStyle() _points[SUBTYPE(I_DISMAR, 2)].setTextFontSize(Small); _points[SUBTYPE(I_DISMAR, 2)].setHaloColor(QColor()); _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(RDOSTA)] = Point(QImage(":/marine/radio.png")); _points[TYPE(RADSTA)] = Point(QImage(":/marine/radar.png")); @@ -259,6 +260,7 @@ void Style::pointStyle() _points[SUBTYPE(WATTUR, 3)] = 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(SISTAT)] = Point(QImage(":/marine/pylon.png")); _points[SUBTYPE(SMCFAC, 7)] = Point(QImage(":/POI/restaurant-11.png")); _points[SUBTYPE(SMCFAC, 11)] = Point(QImage(":/POI/pharmacy-11.png"));