- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung - 44 Export-Header Include-Pfade korrigiert (_export.h) - 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h) - INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros - Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits) - FATAL_LOG Makro hinzugefügt - InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h) - FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h) - AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp) - SymbolAppearance Klasse vollständig definiert mit content() Methode - BuildingComponentFilter Klasse definiert mit Copy-Konstruktor - Ftc Factory: nullptr Return (abstract class) - AesFilter Klasse in aes.hpp hinzugefügt - Dtc Klasse in ppm.hpp mit participantChanged Signal - AesType Enum: alle 15 At* Werte definiert - AesEffectState_def: EsReceived hinzugefügt - DataModification Enum: eAdded/eModified/eRemoved - function_reply_object.h → core_types.h Include-Pfad (72 Dateien) - Enum-Class-Streaming Template-Operator in INGLLogger.h - ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen - ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge - QRegExp → QRegularExpression in tpm_js_parser.cpp - .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert - Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
394 lines
9.2 KiB
C++
Executable File
394 lines
9.2 KiB
C++
Executable File
|
|
|
|
#pragma once
|
|
|
|
#include <QString>
|
|
#include <QVector>
|
|
#include "buildingcontrolcommon_export.h"
|
|
#include <bcu_types.h>
|
|
|
|
class QJsonObject;
|
|
namespace BuildingControlUnit
|
|
{
|
|
namespace Json
|
|
{
|
|
namespace Telegrams
|
|
{
|
|
class BUILDINGCONTROLCOMMON_EXPORT BaseTelegram
|
|
{
|
|
protected:
|
|
explicit BaseTelegram(const QString &telegramId)
|
|
: m_telegramId(telegramId)
|
|
{}
|
|
public:
|
|
virtual ~BaseTelegram() = default;
|
|
|
|
QString telegramId() const
|
|
{
|
|
return m_telegramId;
|
|
}
|
|
virtual QByteArray toJson() const = 0;
|
|
|
|
static BaseTelegram *telegramFromJson(const QByteArray &jsonMsg);
|
|
protected:
|
|
virtual QByteArray toJsonInternal(const QJsonObject &data) const;
|
|
private:
|
|
QString m_telegramId;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT BaseReport : public BaseTelegram
|
|
{
|
|
protected:
|
|
explicit BaseReport(const QString &telegramId)
|
|
: BaseTelegram(telegramId)
|
|
{}
|
|
|
|
protected:
|
|
QByteArray toJsonInternal(const QJsonObject &_data) const override;
|
|
static void fromJsonInternal(const QJsonObject &data, BaseReport *tele, bool &bOk);
|
|
public:
|
|
qint64 timestamp = 0;
|
|
};
|
|
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT BsmTriggerFlashlight : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("BsmTriggerFlashlight"); }
|
|
BsmTriggerFlashlight()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static BsmTriggerFlashlight *fromJson(const QJsonObject &data);
|
|
|
|
int sensorId = 0;
|
|
int numberOfFlashes = 1;
|
|
int pauseBetweenFlashesSec = 1;
|
|
QString hostname;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT SetDamageState : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("SetDamageState"); }
|
|
explicit SetDamageState()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static SetDamageState *fromJson(const QJsonObject &data);
|
|
|
|
DamageState damageState = DamageState::NoDamage;
|
|
QVector<int> roomIds;
|
|
int originatorId = 0;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT SetContaminationState : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("SetContaminationState"); }
|
|
explicit SetContaminationState()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static SetContaminationState *fromJson(const QJsonObject &data);
|
|
|
|
std::vector<BuildingControlUnit::ContaminationState> contaminationStates;
|
|
|
|
};
|
|
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT ResetContaminationState : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("ResetContaminationState"); }
|
|
explicit ResetContaminationState()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static ResetContaminationState *fromJson(const QJsonObject &data);
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT SetEffectStates : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("SetEffectStates"); }
|
|
explicit SetEffectStates()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static SetEffectStates *fromJson(const QJsonObject &data);
|
|
|
|
QString segment = QString();
|
|
QVector<BcuEffectState> effectStates;
|
|
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT SwitchRelay : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("SwitchRelay"); }
|
|
explicit SwitchRelay()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static SwitchRelay *fromJson(const QJsonObject &data);
|
|
|
|
QString segment;
|
|
SwitchRelayValues switchRelayValues;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT RelayState : public BaseReport
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("RelayState"); }
|
|
explicit RelayState()
|
|
: BaseReport(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static RelayState *fromJson(const QJsonObject &data);
|
|
|
|
struct RelayStateInfo
|
|
{
|
|
int id = 0;
|
|
bool state = false;
|
|
};
|
|
QVector<RelayStateInfo> relayStates;
|
|
QString segment = QString();
|
|
qint64 stateTime = 0;
|
|
qint64 offlineTime = 0;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT EffectOverride : public BaseReport
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("EffectOverrides"); }
|
|
explicit EffectOverride()
|
|
: BaseReport(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static EffectOverride *fromJson(const QJsonObject &data);
|
|
|
|
struct OverrideInfo
|
|
{
|
|
int id = 0;
|
|
int effectOverride = 0;
|
|
};
|
|
QVector<OverrideInfo> overrides;
|
|
QString segment = QString();
|
|
qint64 stateTime = 0;
|
|
qint64 offlineTime = 0;
|
|
};
|
|
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT SetFortifyFactor : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("SetFortifyFactor"); }
|
|
explicit SetFortifyFactor()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static SetFortifyFactor *fromJson(const QJsonObject &data);
|
|
|
|
struct FortifyInfo
|
|
{
|
|
int roomId = 0;
|
|
double fortifyFactor = 1.0;
|
|
};
|
|
QVector<FortifyInfo> fortifyFactors;
|
|
|
|
int originatorId = 0;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT CentralEffectSimulationHit : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("CentralEffectSimulationHit"); }
|
|
explicit CentralEffectSimulationHit()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static CentralEffectSimulationHit *fromJson(const QJsonObject &data);
|
|
|
|
qint64 effectTimeMSec = 0;
|
|
int chargeTypeId = 0;
|
|
int destructiveFactor = -1;
|
|
int penetrationFactor = -1;
|
|
int aesId = 0;
|
|
struct
|
|
{
|
|
double x = 0;
|
|
double y = 0;
|
|
double z = 0;
|
|
} relPosition;
|
|
QString properties;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT CentralEffectSimulationHit3D : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("CentralEffectSimulationHit3D"); }
|
|
explicit CentralEffectSimulationHit3D()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static CentralEffectSimulationHit3D *fromJson(const QJsonObject &data);
|
|
|
|
qint64 effectTimeMSec{0};
|
|
int chargeTypeId{0};
|
|
int destructiveFactor{-1};
|
|
int penetrationFactor{-1};
|
|
int aesId{0};
|
|
struct
|
|
{
|
|
double x{0};
|
|
double y{0};
|
|
double z{0};
|
|
} impactPosition, detonationLocation;
|
|
double detonationDistance{0};
|
|
QString properties;
|
|
};
|
|
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT DebugSimulateBSMHit : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("DebugSimulateBSMHit"); }
|
|
explicit DebugSimulateBSMHit()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static DebugSimulateBSMHit *fromJson(const QJsonObject &data);
|
|
|
|
qint64 effectTimeMSec = 0;
|
|
int sensorId = 0;
|
|
int originatorId = 0;
|
|
int chargeTypeId = 0;
|
|
int deposition1 = 0;
|
|
int deposition2 = 0;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT HitResult : public BaseReport
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("HitResult"); }
|
|
explicit HitResult()
|
|
: BaseReport(telegramId())
|
|
, hitResult(HitResultInfo())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static HitResult *fromJson(const QJsonObject &data);
|
|
|
|
struct HitRoomInfo
|
|
{
|
|
int roomId = 0;
|
|
int damagePercent = 0;
|
|
int remainingEffectPercent = 0;
|
|
double fortifyFactor = 1.0;
|
|
};
|
|
|
|
struct ContaminationStateInfo
|
|
{
|
|
int aesId = 0;
|
|
std::vector<int> rooms;
|
|
};
|
|
|
|
struct HitResultInfo
|
|
{
|
|
int sensorId = 0;
|
|
int originatorId = 0;
|
|
OriginatorType originatorType = OriginatorType::Unknown;
|
|
int chargeTypeId = 0;
|
|
int damagePercentOld = 0;
|
|
int damagePercentNew = 0;
|
|
int effectSoundId = 0;
|
|
int hitOnRoomId = 0;
|
|
DamageState damageState = DamageState::Unknown;
|
|
QVector<HitRoomInfo> rooms;
|
|
QVector<ContaminationStateInfo> contaminations;
|
|
} hitResult;
|
|
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT BsmState : public BaseReport
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("BsmState"); }
|
|
explicit BsmState()
|
|
: BaseReport(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static BsmState *fromJson(const QJsonObject &data);
|
|
|
|
struct BsmStateInfo
|
|
{
|
|
QString hostname;
|
|
QString versionInfo;
|
|
int id = 0;
|
|
quint16 port;
|
|
bool connected = false;
|
|
};
|
|
QVector<BsmStateInfo> bsmStates;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT GetBsmBitTimeout : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("GetBsmBitTimeout"); }
|
|
explicit GetBsmBitTimeout()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static GetBsmBitTimeout *fromJson(const QJsonObject &data);
|
|
|
|
int sensorId = 0;
|
|
};
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT GetBsmConfiguration : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("GetBsmConfiguration"); }
|
|
explicit GetBsmConfiguration()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static GetBsmConfiguration *fromJson(const QJsonObject &data);
|
|
|
|
int sensorId = 0;
|
|
};
|
|
|
|
|
|
class BUILDINGCONTROLCOMMON_EXPORT GetBsmTechnicalStatus : public BaseTelegram
|
|
{
|
|
public:
|
|
static QString telegramId() { return QStringLiteral("GetBsmTechnicalStatus"); }
|
|
explicit GetBsmTechnicalStatus()
|
|
: BaseTelegram(telegramId())
|
|
{}
|
|
|
|
QByteArray toJson() const override;
|
|
static GetBsmTechnicalStatus *fromJson(const QJsonObject &data);
|
|
|
|
int sensorId = 0;
|
|
};
|
|
|
|
}
|
|
}
|
|
}
|