- 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>
210 lines
4.7 KiB
C++
Executable File
210 lines
4.7 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include <QObject>
|
|
#include <QByteArray>
|
|
#include <QList>
|
|
#include <QMap>
|
|
#include <QPair>
|
|
#include <QTimer>
|
|
#include <QTcpSocket>
|
|
|
|
|
|
#include <LtsUtilsCore/sfm_bytemessage_converter.h>
|
|
|
|
#include "handler_aes_data.h"
|
|
#include "send_to_tab.h"
|
|
|
|
#include "logger.h"
|
|
|
|
namespace TrainingAreaBaseOC
|
|
{
|
|
class ConnectionHandler;
|
|
class MainHandler;
|
|
class RecvFromTab;
|
|
|
|
enum class DdlState
|
|
{
|
|
NotStarted = 0,
|
|
Initiated = 1,
|
|
Downloading = 2
|
|
};
|
|
|
|
class TxDdlHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TxDdlHandler();
|
|
|
|
void addData(const QByteArray &data);
|
|
|
|
signals:
|
|
void send(const QByteArray &data);
|
|
|
|
public slots:
|
|
void process(const QByteArray &data);
|
|
|
|
private slots:
|
|
void startNextDomainDownload();
|
|
void sendAbortOrRestartTimeout();
|
|
|
|
private:
|
|
const qint32 s_maxResendCnt = 5;
|
|
|
|
struct DdlData
|
|
{
|
|
QByteArray data = QByteArray();
|
|
qint32 offset = 0;
|
|
};
|
|
|
|
void initiateDomainDownload();
|
|
void domainDownload();
|
|
void sendAbort(quint8 error = 0);
|
|
|
|
DdlState m_state;
|
|
qint32 m_segmentToggle;
|
|
qint32 m_sentCnt;
|
|
QTimer *m_responseTimer;
|
|
|
|
QList<DdlData> m_dataToSend;
|
|
};
|
|
|
|
class RxDdlHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit RxDdlHandler(bool isMultiplexed = false);
|
|
|
|
void process(const QByteArray &data);
|
|
|
|
signals:
|
|
void send(const QByteArray &data);
|
|
void received(const QByteArray &data);
|
|
void receivedMultiplexed(const QByteArray &data, quint32 multiplexer);
|
|
|
|
private:
|
|
void sendDPConfirmation(const quint32 ccs, const quint32 toggle, const quint32 wirkfeldMultiplex = 0);
|
|
|
|
bool m_isMultiplexed = false;
|
|
DdlState m_state = DdlState::NotStarted;
|
|
|
|
quint32 m_multiplexer = 0;
|
|
QByteArray m_messageData;
|
|
};
|
|
|
|
class CanagHandler : public QObject
|
|
, public SendToTab
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CanagHandler(MainHandler *mainHandler);
|
|
~CanagHandler();
|
|
|
|
bool init();
|
|
|
|
bool txData(const OcTelegrams::DemandCyclicPositions &data) override;
|
|
bool txData(const OcTelegrams::TechnicalStateOc &data) override;
|
|
bool txData(const OcTelegrams::DemandSelftestSfm &data) override;
|
|
bool txData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBase &data) override;
|
|
|
|
signals:
|
|
void sendMessage(const LtsUtils::SfmMessage &);
|
|
public slots:
|
|
void handleSfmTelegram(const LtsUtils::SfmMessage &message);
|
|
private slots:
|
|
void sendDemandDeviceId();
|
|
void sendDeviceMessage();
|
|
void sendOcExcon(const QByteArray &data);
|
|
void sendFireSmokeMarkerExcon(const QByteArray &data);
|
|
void sendExconOc(const QByteArray &data);
|
|
void sendExconFireSmokeMarker(const QByteArray &data);
|
|
void sendSfmAwes(const QByteArray &data);
|
|
void sendConnectionTestSfm();
|
|
void receivedExconOc(const QByteArray &data);
|
|
void receivedExconFireSmokeMarker(const QByteArray &data);
|
|
void receivedSfmAwes(const QByteArray &data, quint32 multiplexer);
|
|
void sfmAliveTimeout();
|
|
void sendFreeText();
|
|
void sendSyncTime(uint32_t syncTimeSec);
|
|
|
|
private:
|
|
void send(const LtsUtils::SfmMessage &message);
|
|
void send(quint32 canId, const QByteArray &data);
|
|
|
|
void openSocket();
|
|
|
|
void readSettings();
|
|
void fillMessageMap();
|
|
|
|
void demandInitialSfmData();
|
|
void sendDemandTechnicalStateSfm();
|
|
void sendDemandSpecificsEquipment();
|
|
void sendDemandSpecificsExercise();
|
|
|
|
void handleDisplayMessage(const LtsUtils::SfmMessage &message);
|
|
|
|
enum CanId
|
|
{
|
|
DemandDeviceId = 1,
|
|
DeviceId = 2,
|
|
Time = 7,
|
|
EnterLeaveAes = 80,
|
|
ParameterSfmTx = 243,
|
|
ParameterSfmRx = 244,
|
|
ParameterOcRx = 263,
|
|
ParameterOcTx = 264,
|
|
TechnicalStateSfm = 452,
|
|
TechnicalStateOc = 466,
|
|
FireSmokeMarkerExconDataRx = 510,
|
|
FireSmokeMarkerExconDataTx = 511,
|
|
ExconFireSmokeMarkerDataRx = 512,
|
|
ExconFireSmokeMarkerDataTx = 513,
|
|
ExconOcDataRx = 520,
|
|
ExconOcDataTx = 521,
|
|
OcExconDataRx = 522,
|
|
OcExconDataTx = 523,
|
|
DemandAwesData = 530,
|
|
AwesDataRx = 531,
|
|
AwesDataTx = 532,
|
|
Position = 540,
|
|
DemandCyclicPosition = 545,
|
|
DisplayMessage = 684,
|
|
SpecificsExercise = 732,
|
|
SpecificsOc = 738,
|
|
SpecificsEquipment = 742,
|
|
EquipmentId = 765,
|
|
ConnectionTestSfm = 1101,
|
|
ConnectionTestSfmReply = 1102,
|
|
WakeUp = 1760,
|
|
WakeUpSfm = 1773
|
|
};
|
|
|
|
MainHandler *m_mainHandler;
|
|
std::shared_ptr<ConnectionHandler> m_connectionHandler;
|
|
std::shared_ptr<HandlerAesData> m_handlerAesData;
|
|
std::shared_ptr<RecvFromTab> m_rxHandler;
|
|
|
|
QByteArray m_freeText;
|
|
|
|
QTimer *m_deviceMessageTimer;
|
|
QTimer *m_freeTextCollectionTimer;
|
|
QTimer *m_sfmAliveTimer;
|
|
QTimer *m_sfmConnectionCheckTimer;
|
|
|
|
QTcpSocket *m_syncSocket;
|
|
|
|
OcTelegrams::TechnicalStateSfm m_technicalStateSfm;
|
|
bool m_sfmConnectionEstablished;
|
|
|
|
QMap<CanId, LtsUtils::SfmMessage *> m_messages;
|
|
QMap<CanId, TxDdlHandler *> m_txDdlHandler;
|
|
QMap<CanId, RxDdlHandler *> m_rxDdlHandler;
|
|
};
|
|
|
|
}
|