Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- 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>
This commit is contained in:
2785 files changed
+18754
-18316
No files matched your search
@@ -32,7 +32,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# Generate esc_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcEscCommon SHARED ${SRCS_common})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcEscCommon SHARED ${SRCS_common})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcEscCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -61,7 +61,7 @@ SET(SRCS_client
|
||||
# generate esc_[d|f]tc.h, esc_[d|f]tc_impl.[cpp|h]
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV WS svcEscClient SHARED ${SRCS_client})
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcEscClient SHARED ${SRCS_client})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcEscClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -89,7 +89,7 @@ SET(SRCS_server
|
||||
# generate esc_[d|f]ts.h, esc_[d|f]ts_impl.[cpp|h]
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY(AAR SV svcEscServer SHARED ${SRCS_server})
|
||||
NGL_ADD_LIBRARY2(AAR SV svcEscServer SHARED ${SRCS_server})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcEscServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
+21
-22
@@ -22,7 +22,6 @@ ConnectionHandlerSerial::ConnectionHandlerSerial(QObject *parent)
|
||||
, m_currentDataRead(QByteArray())
|
||||
, m_portName(QStringLiteral("COM5"))
|
||||
, m_readBuffer(new QByteArray())
|
||||
, m_logger(getLogger("ConnectionHandlerSerial"))
|
||||
{
|
||||
m_receiveTimeoutTimer->setInterval(1700);
|
||||
connect(m_spQuerry, &LtsSerialPortQuerry::LtsSerialPortQuerry::connectionEstablished, this, &ConnectionHandlerSerial::open);
|
||||
@@ -34,7 +33,7 @@ ConnectionHandlerSerial::ConnectionHandlerSerial(QObject *parent)
|
||||
|
||||
ConnectionHandlerSerial::~ConnectionHandlerSerial()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::~ConnectionHandlerSerial";
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::~ConnectionHandlerSerial";
|
||||
}
|
||||
|
||||
bool ConnectionHandlerSerial::init()
|
||||
@@ -48,35 +47,35 @@ bool ConnectionHandlerSerial::send(const QByteArray &binaryData)
|
||||
|
||||
if (!m_serialPort)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Port is not initialized!";
|
||||
DEBUG_LOG() << "Port is not initialized!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_serialPort->isOpen())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Port is not opened!";
|
||||
DEBUG_LOG() << "Port is not opened!";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sending data ---------------------------------------------
|
||||
|
||||
const QByteArray writeThis = LtsUtils::byteStreamFromEscMessage(binaryData);
|
||||
DEBUG_LOG(m_logger) << "Send HEX:" << writeThis.toHex(' ');
|
||||
DEBUG_LOG() << "Send HEX:" << writeThis.toHex(' ');
|
||||
qint64 byteswritten = m_serialPort->write(writeThis);
|
||||
DEBUG_LOG(m_logger) << "Binary data:" << binaryData.size();
|
||||
DEBUG_LOG(m_logger) << "Try sending: " << writeThis.size();
|
||||
DEBUG_LOG() << "Binary data:" << binaryData.size();
|
||||
DEBUG_LOG() << "Try sending: " << writeThis.size();
|
||||
|
||||
|
||||
// Check for errors ---------------------------------------------
|
||||
|
||||
if (byteswritten == -1)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
DEBUG_LOG() << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
return false;
|
||||
}
|
||||
else if (byteswritten != writeThis.size())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
DEBUG_LOG() << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -90,7 +89,7 @@ bool ConnectionHandlerSerial::open()
|
||||
|
||||
m_currentDataRead.clear();
|
||||
m_receiveTimeoutTimer->start();
|
||||
DEBUG_LOG(m_logger) << "(Re)openend serial port " << m_serialPort->portName() << " baudrate: " << m_serialPort->baudRate();
|
||||
DEBUG_LOG() << "(Re)openend serial port " << m_serialPort->portName() << " baudrate: " << m_serialPort->baudRate();
|
||||
|
||||
emit connectedToSerialConverter();
|
||||
return true;
|
||||
@@ -106,8 +105,8 @@ void ConnectionHandlerSerial::read()
|
||||
const QByteArray ba = m_serialPort->readAll();
|
||||
m_currentDataRead.append(ba);
|
||||
|
||||
//DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data size" << ba.size();
|
||||
//DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG() << "Data size" << ba.size();
|
||||
int idxStart = -1;
|
||||
int idxEnd = -1;
|
||||
while ((idxStart = m_currentDataRead.indexOf(0x02)) >= 0 &&
|
||||
@@ -119,27 +118,27 @@ void ConnectionHandlerSerial::read()
|
||||
|
||||
QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1);
|
||||
m_currentDataRead = m_currentDataRead.mid(idxEnd + 1);
|
||||
DEBUG_LOG(m_logger) << "Data Message found: " << message.toHex(' ');
|
||||
DEBUG_LOG() << "Data Message found: " << message.toHex(' ');
|
||||
message = LtsUtils::byteStreamToEscMessage(message);
|
||||
|
||||
if (message.size() > 2)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Message to long: " << message.size();
|
||||
ERROR_LOG() << "Message to long: " << message.size();
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex();
|
||||
DEBUG_LOG() << "Frame from sfm as binary " << message.toHex();
|
||||
//got message now remove frame
|
||||
|
||||
|
||||
unsigned int byte = 0;
|
||||
byte = message.at(0) & 0xFF;
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::read var byte is" << byte;
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::read var byte is" << byte;
|
||||
|
||||
|
||||
if (!isValidCommandByte(byte))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read Commandbyte is invalid. Returning";
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read Commandbyte is invalid. Returning";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,30 +149,30 @@ void ConnectionHandlerSerial::read()
|
||||
if (message.size() > 1 &&
|
||||
!isValidPayloadByte(message.at(1)))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read Payloadbyte is invalid. Returning";
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read Payloadbyte is invalid. Returning";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (message.size() != 2)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Binary data from serial port: " << message.toHex(' ');
|
||||
DEBUG_LOG() << "Binary data from serial port: " << message.toHex(' ');
|
||||
m_receiveTimeoutTimer->start();
|
||||
|
||||
emit received(message);
|
||||
}
|
||||
|
||||
if (m_serialPort->bytesAvailable() > 0)
|
||||
DEBUG_LOG(m_logger) << "Still " << m_serialPort->bytesAvailable() << " available to be read";
|
||||
DEBUG_LOG() << "Still " << m_serialPort->bytesAvailable() << " available to be read";
|
||||
}
|
||||
|
||||
bool ConnectionHandlerSerial::isValidCommandByte(const unsigned char command)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::isValidCommandByte" << command << (command == 192 ||
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::isValidCommandByte" << command << (command == 192 ||
|
||||
command == 240 ||
|
||||
command == 244 ||
|
||||
command == 255 ||
|
||||
|
||||
-1
@@ -55,7 +55,6 @@ private:
|
||||
QByteArray m_currentDataRead;
|
||||
QString m_portName;
|
||||
QByteArray *m_readBuffer;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+24
-25
@@ -20,7 +20,6 @@ ConnectionHandlerTcp::ConnectionHandlerTcp(QObject *parent)
|
||||
, m_socket(nullptr)
|
||||
, m_timer(new QTimer(this))
|
||||
, m_currentDataRead(QByteArray())
|
||||
, m_logger(getLogger("ConnectionHandlerTcp"))
|
||||
{
|
||||
m_timer->setInterval(5000);
|
||||
connect(m_timer, &QTimer::timeout, this, &ConnectionHandlerTcp::open);
|
||||
@@ -55,27 +54,27 @@ bool ConnectionHandlerTcp::send(const QByteArray &message)
|
||||
|
||||
if (!m_socket->isOpen())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Port is not opened!";
|
||||
ERROR_LOG() << "Port is not opened!";
|
||||
return false;
|
||||
}
|
||||
|
||||
const QByteArray writeThis = LtsUtils::byteStreamFromEscMessage(message);
|
||||
DEBUG_LOG(m_logger) << "Send HEX:" << writeThis.toHex(' ');
|
||||
DEBUG_LOG() << "Send HEX:" << writeThis.toHex(' ');
|
||||
qint64 byteswritten = m_socket->write(writeThis);
|
||||
DEBUG_LOG(m_logger) << "Binary data:" << message.size();
|
||||
DEBUG_LOG(m_logger) << "Try sending: " << message.size();
|
||||
DEBUG_LOG() << "Binary data:" << message.size();
|
||||
DEBUG_LOG() << "Try sending: " << message.size();
|
||||
|
||||
// Check for errors ---------------------------------------------
|
||||
|
||||
if (byteswritten == -1)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to write data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
ERROR_LOG() << "Failed to write data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
m_timer->start();
|
||||
return false;
|
||||
}
|
||||
else if (byteswritten != writeThis.size())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
ERROR_LOG() << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -88,10 +87,10 @@ bool ConnectionHandlerTcp::open()
|
||||
m_socket->connectToHost(Settings::hostName(), Settings::port());
|
||||
if (!m_socket->waitForConnected())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString();
|
||||
ERROR_LOG() << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString();
|
||||
return false;
|
||||
}
|
||||
INFO_LOG(m_logger) << "(Re)openend tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort();
|
||||
INFO_LOG() << "(Re)openend tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,8 +109,8 @@ void ConnectionHandlerTcp::read()
|
||||
const QByteArray ba = m_socket->readAll();
|
||||
m_currentDataRead.append(ba);
|
||||
|
||||
//DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data size" << ba.size();
|
||||
//DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG() << "Data size" << ba.size();
|
||||
int idxStart = -1;
|
||||
int idxEnd = -1;
|
||||
while ((idxStart = m_currentDataRead.indexOf(0x02)) >= 0 &&
|
||||
@@ -123,27 +122,27 @@ void ConnectionHandlerTcp::read()
|
||||
|
||||
QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1);
|
||||
m_currentDataRead = m_currentDataRead.mid(idxEnd + 1);
|
||||
DEBUG_LOG(m_logger) << "Data Message found: " << message.toHex(' ');
|
||||
DEBUG_LOG() << "Data Message found: " << message.toHex(' ');
|
||||
message = LtsUtils::byteStreamToEscMessage(message);
|
||||
|
||||
if (message.size() > 2)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Message to long: " << message.size();
|
||||
ERROR_LOG() << "Message to long: " << message.size();
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex();
|
||||
DEBUG_LOG() << "Frame from sfm as binary " << message.toHex();
|
||||
//got message now remove frame
|
||||
|
||||
|
||||
unsigned int byte = 0;
|
||||
byte = message.at(0) & 0xFF;
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandler::read var byte is" << byte;
|
||||
DEBUG_LOG() << "ConnectionHandler::read var byte is" << byte;
|
||||
|
||||
|
||||
if (!isValidCommandByte(byte))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read Commandbyte is invalid. Returning";
|
||||
ERROR_LOG() << "ConnectionHandler::read Commandbyte is invalid. Returning";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,29 +153,29 @@ void ConnectionHandlerTcp::read()
|
||||
if (message.size() > 1 &&
|
||||
!isValidPayloadByte(message.at(1)))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read Payloadbyte is invalid. Returning";
|
||||
ERROR_LOG() << "ConnectionHandler::read Payloadbyte is invalid. Returning";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (message.size() != 2)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
ERROR_LOG() << "ConnectionHandler::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Binary data from serial port: " << message.toHex(' ');
|
||||
DEBUG_LOG() << "Binary data from serial port: " << message.toHex(' ');
|
||||
|
||||
emit received(message);
|
||||
}
|
||||
|
||||
if (m_socket->bytesAvailable() > 0)
|
||||
DEBUG_LOG(m_logger) << "Still " << m_socket->bytesAvailable() << " available to be read";
|
||||
DEBUG_LOG() << "Still " << m_socket->bytesAvailable() << " available to be read";
|
||||
}
|
||||
|
||||
void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Spontaneous error " << error << " doesn't have to be an error ...";
|
||||
DEBUG_LOG() << "Spontaneous error " << error << " doesn't have to be an error ...";
|
||||
|
||||
const QString errStr(QStringLiteral("QTcpSocket::SocketError ") + QString::number(error) +
|
||||
QStringLiteral(" from tcp port ") + QString::number(m_socket->peerPort()) +
|
||||
@@ -188,20 +187,20 @@ void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
case QTcpSocket::SocketError::SocketAccessError:
|
||||
case QTcpSocket::SocketError::SocketResourceError:
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Closing port WITHOUT trying to reopen it.";
|
||||
ERROR_LOG() << "Closing port WITHOUT trying to reopen it.";
|
||||
close();
|
||||
m_timer->start();
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QTcpSocket::SocketError::RemoteHostClosedError:
|
||||
{
|
||||
ERROR_LOG(m_logger) << errStr;
|
||||
ERROR_LOG() << errStr;
|
||||
m_timer->start();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ERROR_LOG(m_logger) << errStr;
|
||||
ERROR_LOG() << errStr;
|
||||
close();
|
||||
m_timer->start();
|
||||
break;
|
||||
@@ -211,7 +210,7 @@ void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
|
||||
bool ConnectionHandlerTcp::isValidCommandByte(const unsigned char command)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandler::isValidCommandByte" << command << (command == 192 ||
|
||||
DEBUG_LOG() << "ConnectionHandler::isValidCommandByte" << command << (command == 192 ||
|
||||
command == 240 ||
|
||||
command == 244 ||
|
||||
command == 255 ||
|
||||
|
||||
@@ -54,6 +54,5 @@ private:
|
||||
QTcpSocket *m_socket;
|
||||
QTimer *m_timer;
|
||||
QByteArray m_currentDataRead;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace EffectShowClient
|
||||
+26
-27
@@ -17,7 +17,6 @@ ControlUnitHandler::ControlUnitHandler(QObject *parent)
|
||||
, m_connectionHandler(new ConnectionHandler(this))
|
||||
, m_timer(new QTimer(this))
|
||||
, m_feature(EffectShowManagement::Feature_e::NotSpecified)
|
||||
, m_logger(getLogger("ControlUnitHandler"))
|
||||
{
|
||||
m_timer->setInterval(10000);
|
||||
connect(m_timer, &QTimer::timeout, this, &ControlUnitHandler::onConnectedToSerialConveter);
|
||||
@@ -33,7 +32,7 @@ bool ControlUnitHandler::init()
|
||||
{
|
||||
if (!m_connectionHandler->init())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Could not init ConnectionHandler";
|
||||
DEBUG_LOG() << "Could not init ConnectionHandler";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,7 +59,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
commandByte = command + roundCount;
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Bad round count for command FT_SE_CB_WERFER_STATUS";
|
||||
DEBUG_LOG() << "Bad round count for command FT_SE_CB_WERFER_STATUS";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -71,7 +70,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
commandByte = command + roundCount;
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Bad round count for command FT_SE_CB_WERFER_MUNITION";
|
||||
DEBUG_LOG() << "Bad round count for command FT_SE_CB_WERFER_MUNITION";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -83,7 +82,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sending int/byte to connectionHandler: " << commandByte << QString::number(commandByte, 2); // todorm
|
||||
DEBUG_LOG() << "Sending int/byte to connectionHandler: " << commandByte << QString::number(commandByte, 2); // todorm
|
||||
// emit sending(QString(QStringLiteral("%1 - %2")).arg(QString::number(commandByte, 2).rightJustified(8, QLatin1Char('0'))).arg(commandByte));
|
||||
|
||||
QByteArray data;
|
||||
@@ -98,24 +97,24 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
{
|
||||
if (ba.size() >= 1)
|
||||
{
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba.at(0) " << (ba.at(0));
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba.at(0) & 0xFF " << (ba.at(0) & 0xFF);
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(0) " << (ba.at(0));
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(0) & 0xFF " << (ba.at(0) & 0xFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba is empty";
|
||||
DEBUG_LOG() << "ControlUnitHandler::onDataReceived ba is empty";
|
||||
return;
|
||||
}
|
||||
if (ba.size() >= 2)
|
||||
{
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba.at(1) " << (ba.at(1));
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba.at(1) & 0xFF " << (ba.at(1) & 0xFF);
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(1) " << (ba.at(1));
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(1) & 0xFF " << (ba.at(1) & 0xFF);
|
||||
}
|
||||
const unsigned int data = ba.at(0);
|
||||
if (data >= SE_FT_CB_WERFER_MUNITION && data < 93)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION: " << data;
|
||||
DEBUG_LOG(m_logger) << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION real: " << data - SE_FT_CB_WERFER_MUNITION;
|
||||
DEBUG_LOG() << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION: " << data;
|
||||
DEBUG_LOG() << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION real: " << data - SE_FT_CB_WERFER_MUNITION;
|
||||
emit vehicleRoundCount(data - SE_FT_CB_WERFER_MUNITION);
|
||||
return;
|
||||
}
|
||||
@@ -133,14 +132,14 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
* our defined ReturningSignals enum.
|
||||
*/
|
||||
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba " << ba;
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba " << ba;
|
||||
const unsigned int commandByte = ba.at(0) & 0xFF;
|
||||
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived byte " << commandByte;
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived byte " << commandByte;
|
||||
const unsigned int byte = ba.at(1) & 0xFF;
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived cmdbyte" << byte;
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived cmdbyte" << byte;
|
||||
|
||||
TRACE_LOG(m_logger) << "onDataReceived byte: " << byte << " commandByte: " << commandByte;
|
||||
TRACE_LOG() << "onDataReceived byte: " << byte << " commandByte: " << commandByte;
|
||||
|
||||
switch (commandByte)
|
||||
{
|
||||
@@ -162,7 +161,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
emit safetyStatus(SafetyConfirmation_e::SafetyExpiring);
|
||||
else
|
||||
emit safetyStatus(SafetyConfirmation_e::SafetyNotConfirmed);
|
||||
DEBUG_LOG(m_logger) << "safety warning ";
|
||||
DEBUG_LOG() << "safety warning ";
|
||||
emit safetyWarnings(sst);
|
||||
break;
|
||||
}
|
||||
@@ -177,7 +176,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
else
|
||||
m_feature = EffectShowManagement::Feature_e::NotSpecified;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got Vehicle Type " << m_feature;
|
||||
DEBUG_LOG() << "Got Vehicle Type " << m_feature;
|
||||
emit vehicleType(m_feature);
|
||||
break;
|
||||
}
|
||||
@@ -189,7 +188,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
scr.cardrige3 = byte & BIT_POSITION_5;
|
||||
scr.cardrige4 = byte & BIT_POSITION_4;
|
||||
scr.cardrige5 = byte & BIT_POSITION_3;
|
||||
DEBUG_LOG(m_logger) << " CB STATUS FEUER " << byte;
|
||||
DEBUG_LOG() << " CB STATUS FEUER " << byte;
|
||||
emit vehicleErrorStatus(scr);
|
||||
break;
|
||||
}
|
||||
@@ -207,7 +206,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
scr.cardrige4 = byte & BIT_POSITION_4;
|
||||
scr.cardrige5 = byte & BIT_POSITION_3;
|
||||
//emit vehicleSmokeCardridgesStatus(scr);
|
||||
DEBUG_LOG(m_logger) << " WERFER STATUS ";
|
||||
DEBUG_LOG() << " WERFER STATUS ";
|
||||
emit vehicleFireUnits(scr);
|
||||
break;
|
||||
}
|
||||
@@ -219,7 +218,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
scr.cardrige3 = byte & BIT_POSITION_5;
|
||||
scr.cardrige4 = byte & BIT_POSITION_4;
|
||||
scr.cardrige5 = byte & BIT_POSITION_3;
|
||||
DEBUG_LOG(m_logger) << " NB STATUS ";
|
||||
DEBUG_LOG() << " NB STATUS ";
|
||||
emit vehicleSmokeCardridgesStatus(scr);
|
||||
break;
|
||||
}
|
||||
@@ -241,13 +240,13 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SALVE_ERLEDIGT:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Volley Done";
|
||||
DEBUG_LOG() << "Volley Done";
|
||||
emit vehicleFinshedVolley(byte);
|
||||
break;
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SALVE_UNTERBROCHEN:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Volley Stopped!!";
|
||||
DEBUG_LOG() << "Volley Stopped!!";
|
||||
emit vehicleStoppedVolley(byte);
|
||||
//add error to ui
|
||||
CardRidges scr;
|
||||
@@ -257,22 +256,22 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SICHERHEIT_WIDERRUFEN:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Sicherheit widerrufen!!";
|
||||
DEBUG_LOG() << "Sicherheit widerrufen!!";
|
||||
emit vehicleSafetyRevoked();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onDataReceived switch default";
|
||||
DEBUG_LOG() << "onDataReceived switch default";
|
||||
break;
|
||||
}
|
||||
}
|
||||
TRACE_LOG(m_logger) << "end of onDataReceived";
|
||||
TRACE_LOG() << "end of onDataReceived";
|
||||
}
|
||||
|
||||
void ControlUnitHandler::onConnectedToSerialConveter()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Send Type Request";
|
||||
DEBUG_LOG() << "Send Type Request";
|
||||
send(CommandSignal::FT_SE_CB_FZRSTYP);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,6 @@ private:
|
||||
ConnectionHandler *m_connectionHandler;
|
||||
QTimer *m_timer;
|
||||
EffectShowManagement::Feature_e m_feature;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
|
||||
};
|
||||
} // namespace EffectShowClient
|
||||
|
||||
@@ -15,9 +15,8 @@ namespace EffectShowClient
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any, exerciseId))
|
||||
, m_exerciseId(exerciseId)
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +24,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,10 +41,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsFts = EffectShowClient::Interface::Fts::create(m_ddsConnector);
|
||||
|
||||
bRet &= m_ddsDts->enableAll();
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
INFO_LOG() << "Dts initialised";
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
INFO_LOG() << "Fts initialised";
|
||||
|
||||
if (!bRet)
|
||||
return false;
|
||||
@@ -55,13 +54,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
if (!m_dtcTab->enableFireSmokeMarkerData())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing TrainingAreaBase DTC";
|
||||
ERROR_LOG() << "Error initializing TrainingAreaBase DTC";
|
||||
return false;
|
||||
}
|
||||
m_ftcTab = TrainingAreaBase::Interface::Ftc::create(m_ddsConnector);
|
||||
if (!m_ftcTab->enableSendFireSmokeMarkerData())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing TrainingAreaBase FTC";
|
||||
ERROR_LOG() << "Error initializing TrainingAreaBase FTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ftcNom = NotificationManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
if (!m_ftcNom->enableCreateNotification())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing NotificationManagement FTC";
|
||||
ERROR_LOG() << "Error initializing NotificationManagement FTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
if (!m_dtcAsm->enableAsset())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing AssetManagement DTC";
|
||||
ERROR_LOG() << "Error initializing AssetManagement DTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ private:
|
||||
std::shared_ptr<NotificationManagement::Interface::Ftc> m_ftcNom;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_dtcAsm;
|
||||
int m_exerciseId;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace EffectShowClient
|
||||
+13
-14
@@ -25,7 +25,6 @@ HandlerFiringExplosion::HandlerFiringExplosion(MainHandler *mainHandler,
|
||||
: QObject(parent)
|
||||
, ManuallyExplosionRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerFiringExplosion"))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -77,8 +76,8 @@ void HandlerFiringExplosion::setFiringClearanceDuration()
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escOrder)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStartHandlerFiring()";
|
||||
DEBUG_LOG(m_logger) << "numOfVolley: " << escOrder.numOfVolley
|
||||
DEBUG_LOG() << "onStartHandlerFiring()";
|
||||
DEBUG_LOG() << "numOfVolley: " << escOrder.numOfVolley
|
||||
<< "shotsInTotal: " << escOrder.shotsPerVolley
|
||||
<< "duration: " << escOrder.duration;
|
||||
if (escOrder.numOfVolley < 0)
|
||||
@@ -95,7 +94,7 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
m_firingExplosionEntity.numberOfShot(escOrder.shotsPerVolley);
|
||||
m_firingExplosionEntity.remainingVolleys(escOrder.numOfVolley);
|
||||
m_firingExplosionEntity.remainingShots(m_firingExplosionEntity.numberOfShot());
|
||||
DEBUG_LOG(m_logger) << "Changed number of Shots Remain: " << m_firingExplosionEntity.numberOfShot();
|
||||
DEBUG_LOG() << "Changed number of Shots Remain: " << m_firingExplosionEntity.numberOfShot();
|
||||
m_isNew = false;
|
||||
}
|
||||
m_firingExplosionEntity.duration(escOrder.duration * 1000);
|
||||
@@ -104,7 +103,7 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
m_firingExplosionEntity.firingClearanceTime().set(escOrder.startTime);
|
||||
else
|
||||
{
|
||||
WARNING_LOG(m_logger) << "reset clearance time";
|
||||
WARNING_LOG() << "reset clearance time";
|
||||
m_firingExplosionEntity.firingClearanceTime().reset();
|
||||
}
|
||||
|
||||
@@ -112,7 +111,7 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
m_firingExplosionEntity.numberOfShot() <= 0 ||
|
||||
m_firingExplosionEntity.numberOfVolley() <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Won't start Explosion ";
|
||||
WARNING_LOG() << "Won't start Explosion ";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,8 +123,8 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerFiringExplosion::onEndHandlerFiring(const Database::EscOrder &escOrder)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStopHandlerFiring()";
|
||||
DEBUG_LOG(m_logger) << "numOfVolley: " << escOrder.numOfVolley
|
||||
DEBUG_LOG() << "onStopHandlerFiring()";
|
||||
DEBUG_LOG() << "numOfVolley: " << escOrder.numOfVolley
|
||||
<< "shotsInTotal: " << escOrder.shotsPerVolley
|
||||
<< "duration: " << escOrder.duration;
|
||||
if (escOrder.numOfVolley < 0 || escOrder.idOrder != m_firingExplosionEntity.idOrder())
|
||||
@@ -155,7 +154,7 @@ void HandlerFiringExplosion::onEffectShowStopped(qint16 idEffectShow)
|
||||
{
|
||||
if (idEffectShow != m_firingExplosionEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
m_firingExplosionEntity.isActive(false);
|
||||
@@ -165,7 +164,7 @@ void HandlerFiringExplosion::onEffectShowContinued(const ConvertFromTab::EffectS
|
||||
{
|
||||
if (effectShowContinue.idEffectShow != m_firingExplosionEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +206,7 @@ void HandlerFiringExplosion::onStatusExplosionFiring(const StatusExplosionFiring
|
||||
void HandlerFiringExplosion::onEffectShowStarted()
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "onEffectShowStarted";
|
||||
DEBUG_LOG() << "onEffectShowStarted";
|
||||
m_mainHandler->handlerVehicle()->setExplosionParameter(m_firingExplosionEntity.remainingVolleys(),
|
||||
m_firingExplosionEntity.remainingShots(),
|
||||
m_firingExplosionEntity.remainingTime());
|
||||
@@ -228,10 +227,10 @@ bool HandlerFiringExplosion::onEffectShowInterrupted()
|
||||
|
||||
if (!m_firingExplosionEntity.isActive() && m_isInterrupted == false)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onEffectShowInterrupted is active so return";
|
||||
DEBUG_LOG() << "onEffectShowInterrupted is active so return";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "onEffectShowInterrupted";
|
||||
DEBUG_LOG() << "onEffectShowInterrupted";
|
||||
m_mainHandler->handlerControlUnit()->send(CommandSignal::FT_SE_CB_SICHERHEIT_WIDERRUFEN);
|
||||
m_mainHandler->handlerVehicle()->effectShowControl(EffectShowControl_e::StopTimer);
|
||||
|
||||
@@ -247,7 +246,7 @@ bool HandlerFiringExplosion::onEffectShowInterrupted()
|
||||
void HandlerFiringExplosion::onManuallyExplosionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallyExplosionRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onManuallyExplosionRequest ";
|
||||
DEBUG_LOG() << "onManuallyExplosionRequest ";
|
||||
//override order!
|
||||
if (m_firingExplosionEntity.idEffectShow() == 0)
|
||||
{
|
||||
|
||||
-1
@@ -64,6 +64,5 @@ private:
|
||||
bool m_isInterrupted = false;
|
||||
bool m_isNew = true;
|
||||
SafetyConfirmation_e m_lastState;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+6
-7
@@ -26,9 +26,8 @@ HandlerFiringSmoke::HandlerFiringSmoke(MainHandler *mainHandler,
|
||||
: QObject(parent)
|
||||
, ManuallySmokeRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerFiringSmoke"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "HandlerFiringSmoke ctor";
|
||||
DEBUG_LOG() << "HandlerFiringSmoke ctor";
|
||||
}
|
||||
//=============================================================================
|
||||
HandlerFiringSmoke::~HandlerFiringSmoke()
|
||||
@@ -82,8 +81,8 @@ void HandlerFiringSmoke::onStartHandlerFiring(const Database::EscOrder &escOrder
|
||||
if (m_firingSmokeEntity.lengthOfFogZone() <= 0 ||
|
||||
m_firingSmokeEntity.duration() <= 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Won't start Smoke ";
|
||||
DEBUG_LOG(m_logger) << "areaWidth: " << escOrder.areaWidth
|
||||
WARNING_LOG() << "Won't start Smoke ";
|
||||
DEBUG_LOG() << "areaWidth: " << escOrder.areaWidth
|
||||
<< "duration: " << escOrder.duration;
|
||||
return;
|
||||
}
|
||||
@@ -111,7 +110,7 @@ void HandlerFiringSmoke::onEffectShowStopped(qint16 idEffectShow)
|
||||
{
|
||||
if (idEffectShow != m_firingSmokeEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +119,7 @@ void HandlerFiringSmoke::onEffectShowContinued(const ConvertFromTab::EffectShowC
|
||||
{
|
||||
if (effectShowContinue.idEffectShow != m_firingSmokeEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -154,7 +153,7 @@ void HandlerFiringSmoke::setSmoking()
|
||||
void HandlerFiringSmoke::onManuallySmokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallySmokeRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onManuallySmokeRequest";
|
||||
DEBUG_LOG() << "onManuallySmokeRequest";
|
||||
|
||||
//override order!
|
||||
if (m_firingSmokeEntity.idOrder() == 0)
|
||||
|
||||
@@ -53,6 +53,5 @@ private:
|
||||
private:
|
||||
MainHandler *m_mainHandler;
|
||||
EffectShowClient::FiringSmokeEntity m_firingSmokeEntity;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
}
|
||||
+19
-20
@@ -33,7 +33,6 @@ HandlerOperatingCondition::HandlerOperatingCondition(MainHandler *mainHandler,
|
||||
, m_isOperational(false)
|
||||
, m_oldErrorState(false)
|
||||
, m_operationalStatusTimer(new QTimer)
|
||||
, m_logger(getLogger("HandlerOperatingCondition"))
|
||||
{}
|
||||
//=============================================================================
|
||||
HandlerOperatingCondition::~HandlerOperatingCondition()
|
||||
@@ -77,7 +76,7 @@ void HandlerOperatingCondition::onVehicleBattery(double battery)
|
||||
{
|
||||
m_operatingCondition.batteryVoltage(battery);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data Battery to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data Battery to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleSmokeCardridgesFireStatus(const CardRidges &fireStatus)
|
||||
@@ -117,7 +116,7 @@ void HandlerOperatingCondition::onVehicleSmokeCardridgesFireStatus(const CardRid
|
||||
m_operatingCondition.smokeCartridge5(StatusSmokeCartridge_e_def::Smoking);
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (Somoking) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (Somoking) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleSmokeCardridgesStatus(const CardRidges &fireStatus)
|
||||
@@ -135,7 +134,7 @@ void HandlerOperatingCondition::onVehicleSmokeCardridgesStatus(const CardRidges
|
||||
m_operatingCondition.smokeCartridge5(m_readyCardridges.cardrige5 ? StatusSmokeCartridge_e_def::Ready : StatusSmokeCartridge_e_def::NotReady);
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleFireUnits(const CardRidges &fireStatus)
|
||||
@@ -145,7 +144,7 @@ void HandlerOperatingCondition::onVehicleFireUnits(const CardRidges &fireStatu
|
||||
m_operatingCondition.firingUnitReadyAftRh(fireStatus.cardrige3);
|
||||
m_operatingCondition.firingUnitReadyAftLh(fireStatus.cardrige4);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (fireStatus) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (fireStatus) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleErrorStatus(const CardRidges &errorStatus)
|
||||
@@ -156,7 +155,7 @@ void HandlerOperatingCondition::onVehicleErrorStatus(const CardRidges &errorStat
|
||||
m_operatingCondition.errorEquipment(errorStatus.cardrige4);
|
||||
m_operatingCondition.errorGeneral(errorStatus.cardrige5);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (errorStatus) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (errorStatus) to dds";
|
||||
|
||||
if (isErrorDmf() != m_oldErrorState)
|
||||
{
|
||||
@@ -169,7 +168,7 @@ void HandlerOperatingCondition::onVehicleErrorStatus(const CardRidges &errorStat
|
||||
|
||||
void HandlerOperatingCondition::onOperationalStatusTimeout()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operational status timeout. Setting operational status to: not operational.";
|
||||
DEBUG_LOG() << "Operational status timeout. Setting operational status to: not operational.";
|
||||
m_isOperational = false;
|
||||
m_operatingCondition.readiness(m_isOperational);
|
||||
|
||||
@@ -189,7 +188,7 @@ bool HandlerOperatingCondition::isErrorDmf()
|
||||
|
||||
void HandlerOperatingCondition::onConnectionToSerial()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Connected to Serial: send ammunition Magazine to Control Unit Count: " << m_operatingCondition.ammunitionMagazine();
|
||||
DEBUG_LOG() << "Connected to Serial: send ammunition Magazine to Control Unit Count: " << m_operatingCondition.ammunitionMagazine();
|
||||
m_mainHandler->handlerVehicle()->setAmmunitionParameter(m_operatingCondition.ammunitionMagazine());
|
||||
}
|
||||
|
||||
@@ -197,7 +196,7 @@ void HandlerOperatingCondition::onVehicleType(const EffectShowManagement::Featur
|
||||
{
|
||||
m_operatingCondition.vehicleFeature(type);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (vehicle type) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (vehicle type) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onSafetyStatus(const SafetyStatus &status)
|
||||
@@ -207,20 +206,20 @@ void HandlerOperatingCondition::onSafetyStatus(const SafetyStatus &status)
|
||||
m_operatingCondition.emergencyStop(status.emergencyStop);
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (SafetyStatus) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (SafetyStatus) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleRoundCount(int loadedRounds)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got RoundCount Reply from Unit " << loadedRounds;
|
||||
DEBUG_LOG() << "Got RoundCount Reply from Unit " << loadedRounds;
|
||||
m_operatingCondition.ammunitionMagazine(loadedRounds);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (ammunition magazine) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (ammunition magazine) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVolleyRounds(int usedRounds)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got used rounds " << usedRounds;
|
||||
DEBUG_LOG() << "Got used rounds " << usedRounds;
|
||||
m_operatingCondition.ammunitionMagazine(m_operatingCondition.ammunitionMagazine() - usedRounds);
|
||||
if (m_operatingCondition.ammunitionMagazine() < 0)
|
||||
m_operatingCondition.ammunitionMagazine(0);
|
||||
@@ -228,7 +227,7 @@ void HandlerOperatingCondition::onVolleyRounds(int usedRounds)
|
||||
if (m_operatingCondition.ammunitionAvailable() < 0)
|
||||
m_operatingCondition.ammunitionAvailable(0);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (ammunition magazine used) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (ammunition magazine used) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::sendStatus()
|
||||
@@ -253,7 +252,7 @@ void HandlerOperatingCondition::getVehicleStatus(ConvertToTab::VehicleStatus_t &
|
||||
void HandlerOperatingCondition::onSendAmmunitionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendAmmunitionRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSendAmmunitionRequest";
|
||||
DEBUG_LOG() << "onSendAmmunitionRequest";
|
||||
//take available ammo and send excon
|
||||
//then wait for reply from unit
|
||||
m_operatingCondition.ammunitionAvailable(request.ammunitionAvailable());
|
||||
@@ -277,7 +276,7 @@ void HandlerOperatingCondition::onSendAmmunitionRequest(const rti::core::SampleI
|
||||
void HandlerOperatingCondition::onSendSafetyRevokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendSafetyRevokeRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSendSafetyRevokeRequest with " << request.revoke();
|
||||
DEBUG_LOG() << "onSendSafetyRevokeRequest with " << request.revoke();
|
||||
m_mainHandler->dds()->fts()->sendSafetyRevokeReply(cookie, Core::FunctionReplyObject());
|
||||
if (request.revoke())
|
||||
{
|
||||
@@ -290,7 +289,7 @@ void HandlerOperatingCondition::onSendSafetyRevokeRequest(const rti::core::Sampl
|
||||
void HandlerOperatingCondition::onSendReadinessRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendReadinessRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSendReadinessRequest";
|
||||
DEBUG_LOG() << "onSendReadinessRequest";
|
||||
//Confirm or Revoke Readiness
|
||||
//send to EXCON
|
||||
m_isOperational = request.readiness();
|
||||
@@ -305,16 +304,16 @@ void HandlerOperatingCondition::onSendReadinessRequest(const rti::core::SampleId
|
||||
//now change operating condition in hope that tetra worked
|
||||
m_operatingCondition.readiness(m_isOperational);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data readiness) to dds";
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data readiness) to dds";
|
||||
|
||||
if (m_isOperational)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operating condition: operational. Starting timer.";
|
||||
DEBUG_LOG() << "Operating condition: operational. Starting timer.";
|
||||
m_operationalStatusTimer->start(15 * 60 * 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Operating condition: not operational. Stopping timer.";
|
||||
DEBUG_LOG() << "Operating condition: not operational. Stopping timer.";
|
||||
m_operationalStatusTimer->stop();
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -70,9 +70,6 @@ private:
|
||||
bool m_oldErrorState;
|
||||
|
||||
QTimer *m_operationalStatusTimer{nullptr};
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
EffectShowClient::OperatingConditionEntity m_operatingCondition;
|
||||
};
|
||||
}
|
||||
@@ -27,7 +27,6 @@ HandlerOrder::HandlerOrder(MainHandler *mainHandler,
|
||||
: QObject(parent)
|
||||
, OrderModifyRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerOrder"))
|
||||
{}
|
||||
//=============================================================================
|
||||
HandlerOrder::~HandlerOrder()
|
||||
@@ -45,7 +44,7 @@ bool HandlerOrder::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -53,11 +52,11 @@ bool HandlerOrder::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbOrder) || !bRet)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_orderObjMap.size() = " << m_orderObjMap.size();
|
||||
DEBUG_LOG() << "m_orderObjMap.size() = " << m_orderObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -96,7 +95,7 @@ void HandlerOrder::createOrder(const ConvertFromTab::EffectShowOrder_t &effectSh
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
return;
|
||||
}
|
||||
m_orderObjMap.insert(ifs->getId(), ifs);
|
||||
@@ -126,7 +125,7 @@ void HandlerOrder::createOrder(const ConvertFromTab::RelocationOrder_t &relocati
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
ERROR_LOG() << ret();
|
||||
return;
|
||||
}
|
||||
m_orderObjMap.insert(ifs->getId(), ifs);
|
||||
@@ -137,7 +136,7 @@ void HandlerOrder::removeOrder(const ConvertFromTab::OrderRetract_t &orderRetrac
|
||||
for (auto it = m_orderObjMap.begin(); it != m_orderObjMap.end(); ++it)
|
||||
{
|
||||
if (it.value()->getData().typeOfOrder == orderRetract.orderType)
|
||||
//ERROR_LOG(m_logger) << "current idorder =" ;
|
||||
//ERROR_LOG() << "current idorder =" ;
|
||||
if (it.value()->getData().idOrder == orderRetract.id)
|
||||
{
|
||||
int id = it.key();
|
||||
@@ -145,14 +144,14 @@ void HandlerOrder::removeOrder(const ConvertFromTab::OrderRetract_t &orderRetrac
|
||||
int def = it.value()->getData().orderConfirmation;
|
||||
ret = it.value()->removeObject();
|
||||
if (ret.error())
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << ret();
|
||||
ERROR_LOG() << Q_FUNC_INFO << ret();
|
||||
else
|
||||
{
|
||||
if (def == EffectShowManagement::OrderConfirmation_e_def::Execution ||
|
||||
def == EffectShowManagement::OrderConfirmation_e_def::InterruptExecution ||
|
||||
def == EffectShowManagement::OrderConfirmation_e_def::FiringReadiness)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "EndFireHandler from Remove";
|
||||
DEBUG_LOG() << "EndFireHandler from Remove";
|
||||
|
||||
emit endHandlerFiring(it.value()->getData());
|
||||
//Stop the current execution
|
||||
@@ -172,7 +171,7 @@ void HandlerOrder::removeOrder(const ConvertFromTab::OrderRetract_t &orderRetrac
|
||||
void HandlerOrder::sendOrderConfirmation(const ConvertToTab::OrderConfirmation_t &oc)
|
||||
{
|
||||
|
||||
ERROR_LOG(m_logger) << "Send Order Confirmation to Excon " << oc.orderId << " / ";
|
||||
ERROR_LOG() << "Send Order Confirmation to Excon " << oc.orderId << " / ";
|
||||
m_mainHandler->handlerTabData()->orderConfirmation(oc);
|
||||
}
|
||||
|
||||
@@ -180,7 +179,7 @@ void HandlerOrder::sendOrderConfirmation(const ConvertToTab::OrderConfirmation_t
|
||||
void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OrderModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Order: " << request.id() << " Order: " << request.orderConfirmation();
|
||||
DEBUG_LOG() << "Order: " << request.id() << " Order: " << request.orderConfirmation();
|
||||
|
||||
if (request.id() > 0)
|
||||
{
|
||||
@@ -195,7 +194,7 @@ void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
if (ret.error())
|
||||
{
|
||||
m_mainHandler->dds()->fts()->orderModifyReply(cookie, ret);
|
||||
ERROR_LOG(m_logger) << "Update Order object failed.";
|
||||
ERROR_LOG() << "Update Order object failed.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,7 +207,7 @@ void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
else
|
||||
{
|
||||
m_mainHandler->dds()->fts()->orderModifyReply(cookie, Core::FunctionReplyObject(request.id()));
|
||||
ERROR_LOG(m_logger) << "Illegal Order ID";
|
||||
ERROR_LOG() << "Illegal Order ID";
|
||||
}
|
||||
}
|
||||
bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
@@ -223,14 +222,14 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
oc.confirmation = orderConf.underlying();
|
||||
oc.answerText = answerText;
|
||||
sendOrderConfirmation(oc);
|
||||
ERROR_LOG(m_logger) << "Update Order " << oc.orderId << " / ";
|
||||
ERROR_LOG() << "Update Order " << oc.orderId << " / ";
|
||||
switch (orderConf.underlying())
|
||||
{
|
||||
case EffectShowManagement::OrderConfirmation_e_def::FiringReadiness:
|
||||
emit startHandlerFiring(order->getData());
|
||||
break;
|
||||
case EffectShowManagement::OrderConfirmation_e_def::Execution:
|
||||
DEBUG_LOG(m_logger) << "start execution";
|
||||
DEBUG_LOG() << "start execution";
|
||||
m_mainHandler->handlerVehicle()->effectShowControl(EffectShowClient::EffectShowControl_e::Start);
|
||||
emit effectShowStarted();
|
||||
break;
|
||||
@@ -243,7 +242,7 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
case EffectShowManagement::OrderConfirmation_e_def::Abort:
|
||||
if (checkForActiveOrder(escOrder.idOrder))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "idOrder is " << escOrder.idOrder << " send abbort as is active";
|
||||
DEBUG_LOG() << "idOrder is " << escOrder.idOrder << " send abbort as is active";
|
||||
m_mainHandler->handlerControlUnit()->send(CommandSignal::FT_SE_CB_SALVE_UNTERBRECHEN);
|
||||
m_mainHandler->handlerVehicle()->effectShowControl(EffectShowControl_e::Abort);
|
||||
}
|
||||
@@ -263,7 +262,7 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ERROR_LOG(m_logger) << "Unhandled EffectShowManagement::OrderConfirmation_e_def in HandlerOrder::onOrderModifyRequest"; // todo
|
||||
ERROR_LOG() << "Unhandled EffectShowManagement::OrderConfirmation_e_def in HandlerOrder::onOrderModifyRequest"; // todo
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -280,14 +279,14 @@ void HandlerOrder::updateOrderWithId(int orderId, const QString &answerText, Eff
|
||||
ifs->setOrderConfirmation(orderConf.underlying());
|
||||
auto ret = ifs->updateObject();
|
||||
if (ret.error())
|
||||
ERROR_LOG(m_logger) << "Error Updating Order " << orderId << " / ";
|
||||
ERROR_LOG() << "Error Updating Order " << orderId << " / ";
|
||||
updateOrder(ifs, answerText, orderConf);
|
||||
|
||||
}
|
||||
|
||||
bool HandlerOrder::checkForActiveOrder(int orderId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "check for active Order " << orderId << " ";
|
||||
DEBUG_LOG() << "check for active Order " << orderId << " ";
|
||||
if (orderId <= 0)
|
||||
return false;
|
||||
return ((m_mainHandler->handlerFiringExplosion()->getCurrentorderId() == orderId )||( m_mainHandler->handlerFiringSmoke()->getCurrentorderId() == orderId));
|
||||
|
||||
@@ -53,7 +53,5 @@ private:
|
||||
private:
|
||||
QMap<int, ObjectOrder *> m_orderObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -22,7 +22,6 @@ HandlerTabData::HandlerTabData(MainHandler *mainHandler,
|
||||
|
||||
: QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("HandlerTabData"))
|
||||
{
|
||||
} // end of ctor()
|
||||
//=============================================================================
|
||||
@@ -32,7 +31,7 @@ HandlerTabData::~HandlerTabData()
|
||||
//=============================================================================
|
||||
bool HandlerTabData::init()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Begin HandlerTabData";
|
||||
DEBUG_LOG() << "Begin HandlerTabData";
|
||||
auto dtcTab = m_mainHandler->dds()->dtcTab();
|
||||
connect(dtcTab.get(), &TrainingAreaBase::Interface::Dtc::fireSmokeMarkerDataChanged,
|
||||
this, &HandlerTabData::onFireSmokeMarkerDataChanged);
|
||||
@@ -48,13 +47,13 @@ bool HandlerTabData::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "End HandlerTabData";
|
||||
DEBUG_LOG() << "End HandlerTabData";
|
||||
return true;
|
||||
} // end of init()
|
||||
//=============================================================================
|
||||
void HandlerTabData::orderConfirmation(const ConvertToTab::OrderConfirmation_t &orderConfirmation)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Trigger Sending of Order Confirmation ";
|
||||
DEBUG_LOG() << "Trigger Sending of Order Confirmation ";
|
||||
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
|
||||
|
||||
out.payload(ConvertToTab::convertOrderConfirmation(orderConfirmation));
|
||||
@@ -64,7 +63,7 @@ void HandlerTabData::orderConfirmation(const ConvertToTab::OrderConfirmation_t &
|
||||
//=============================================================================
|
||||
void HandlerTabData::vehicleStatus(const ConvertToTab::VehicleStatus_t &vehicleStatus)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Trigger Sending of Vehicle Status ";
|
||||
DEBUG_LOG() << "Trigger Sending of Vehicle Status ";
|
||||
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
|
||||
|
||||
out.payload(ConvertToTab::convertVehicleStatus(vehicleStatus));
|
||||
@@ -74,9 +73,9 @@ void HandlerTabData::vehicleStatus(const ConvertToTab::VehicleStatus_t &vehicleS
|
||||
void HandlerTabData::onSendFireSmokeMarkerDataReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
if (reply.error())
|
||||
ERROR_LOG(m_logger) << "Fire Smoke Marker Data could not be send: " << reply.str();
|
||||
ERROR_LOG() << "Fire Smoke Marker Data could not be send: " << reply.str();
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Fire Smoke Marker Data send successfully to TAB!";
|
||||
DEBUG_LOG() << "Fire Smoke Marker Data send successfully to TAB!";
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSmokeMarkerData &data, DataModification modType)
|
||||
@@ -84,43 +83,43 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Got Fire Smoke Marker " << data.sampleTime();
|
||||
DEBUG_LOG() << "Got Fire Smoke Marker " << data.sampleTime();
|
||||
|
||||
switch (ConvertFromTab::isTelegram(data))
|
||||
{
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowOrder:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Order";
|
||||
DEBUG_LOG() << "Got Effect Show Order";
|
||||
m_mainHandler->handlerOrder()->createOrder(ConvertFromTab::convertEffectShowOrder(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::RelocationOrder:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Relocation order ";
|
||||
DEBUG_LOG() << "Got Relocation order ";
|
||||
m_mainHandler->handlerOrder()->createOrder(ConvertFromTab::convertRelocationOrder(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowStop:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Stop ";
|
||||
DEBUG_LOG() << "Got Effect Show Stop ";
|
||||
emit effectShowStopped(ConvertFromTab::convertEffectShowStop(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowContinue:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Continue ";
|
||||
DEBUG_LOG() << "Got Effect Show Continue ";
|
||||
emit effectShowContinued(ConvertFromTab::convertEffectShowContinue(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::OrderRetract:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Order Retract ";
|
||||
DEBUG_LOG() << "Got Order Retract ";
|
||||
m_mainHandler->handlerOrder()->removeOrder(ConvertFromTab::convertOrderRetract(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::StatusRequest:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Status Request " ;
|
||||
DEBUG_LOG() << "Got Status Request " ;
|
||||
if (ConvertFromTab::convertStatusRequest(data))
|
||||
{
|
||||
m_mainHandler->handlerOperatingCondition()->sendStatus();
|
||||
@@ -129,9 +128,9 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::MeteoData:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got Meteo Data ";
|
||||
DEBUG_LOG() << "Got Meteo Data ";
|
||||
if (!m_mainHandler->dds()->dts()->publish(ConvertFromTab::convertMeteoData(data)))
|
||||
ERROR_LOG(m_logger) << "Error publishing MeteoNearVehicle to dds";
|
||||
ERROR_LOG() << "Error publishing MeteoNearVehicle to dds";
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::unknown:
|
||||
|
||||
@@ -63,8 +63,6 @@ private Q_SLOTS:
|
||||
|
||||
private: // attributes
|
||||
MainHandler *m_mainHandler;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace EffectShowClient
|
||||
|
||||
@@ -25,9 +25,8 @@ HandlerVehicle::HandlerVehicle(MainHandler *mainHandler,
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_volleyTimer(new QTimer(this))
|
||||
, m_remainingTimer(new QTimer(this))
|
||||
, m_logger(getLogger("HandlerVehicle"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "HandlerVehicle ctor";
|
||||
DEBUG_LOG() << "HandlerVehicle ctor";
|
||||
m_volleyTimer->setSingleShot(true);
|
||||
m_remainingTimer->setInterval(1000);
|
||||
m_statusExplosionFiring.remainingTime_s = -1;
|
||||
@@ -42,7 +41,7 @@ HandlerVehicle::~HandlerVehicle()
|
||||
//=============================================================================
|
||||
bool HandlerVehicle::init()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "HandlerVehicle::init()";
|
||||
DEBUG_LOG() << "HandlerVehicle::init()";
|
||||
connect(m_mainHandler->handlerControlUnit().get(), &ControlUnitHandler::vehicleBattery, this, &HandlerVehicle::vehicleBattery);
|
||||
connect(m_mainHandler->handlerControlUnit().get(), &ControlUnitHandler::vehicleFinshedVolley, this, &HandlerVehicle::onVolleyFinished);
|
||||
//connect(m_mainHandler->handlerControlUnit().get(), &ControlUnitHandler::vehicleShutDown, this, &HandlerVehicle::vehicleShutDown);
|
||||
@@ -76,7 +75,7 @@ int HandlerVehicle::burningTimeSmokeCartridge_s() const
|
||||
//=============================================================================
|
||||
void HandlerVehicle::setExplosionParameter(int numberOfVolley, int numberOfShot, qint64 duration)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Duration: " << duration << " number of shots: " << numberOfShot << " number of volles" << numberOfVolley;
|
||||
DEBUG_LOG() << "Duration: " << duration << " number of shots: " << numberOfShot << " number of volles" << numberOfVolley;
|
||||
m_statusExplosionFiring.remainingShots = numberOfShot;
|
||||
m_statusExplosionFiring.remainingTime_s = duration;
|
||||
m_statusExplosionFiring.remainingVolley = numberOfVolley;
|
||||
@@ -197,7 +196,7 @@ void HandlerVehicle::spreadShotsInVolleys(int shots, int volleys)
|
||||
|
||||
void HandlerVehicle::onVolleyStopped(int shots)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Volles Stopped after " << shots << " rounds";
|
||||
DEBUG_LOG() << "Volles Stopped after " << shots << " rounds";
|
||||
//m_statusExplosionFiring.remainingTime_s = 0;
|
||||
//stopp timer and take current seconds
|
||||
m_remainingTimer->stop();
|
||||
@@ -221,7 +220,7 @@ void HandlerVehicle::onVolleyStopped(int shots)
|
||||
|
||||
void HandlerVehicle::onVolleyFinished(int shots)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Volley finished after shots: " << shots;
|
||||
DEBUG_LOG() << "Volley finished after shots: " << shots;
|
||||
m_remainingTimer->stop();
|
||||
if (m_volleyTimer->isActive())
|
||||
m_volleyTimer->stop();
|
||||
@@ -235,7 +234,7 @@ void HandlerVehicle::onVolleyFinished(int shots)
|
||||
|
||||
//m_statusExplosionFiring.remainingTime_s = m_statusExplosionFiring.remainingTime_s - (m_timeBetweenShots * (shots - 1)) - pauseTime;
|
||||
m_statusExplosionFiring.remainingTime_s = m_oldTime - (m_timeBetweenShots * shots) - pauseTime;
|
||||
DEBUG_LOG(m_logger) << "Remaining time: " << m_statusExplosionFiring.remainingTime_s;
|
||||
DEBUG_LOG() << "Remaining time: " << m_statusExplosionFiring.remainingTime_s;
|
||||
m_oldTime = m_statusExplosionFiring.remainingTime_s;
|
||||
if (m_statusExplosionFiring.remainingTime_s < 0 || m_statusExplosionFiring.remainingShots == 0)
|
||||
m_statusExplosionFiring.remainingTime_s = 0;
|
||||
@@ -262,7 +261,7 @@ void HandlerVehicle::onVolleyFinished(int shots)
|
||||
|
||||
void HandlerVehicle::onStartVolley()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Send Start Volley";
|
||||
DEBUG_LOG() << "Send Start Volley";
|
||||
if (!m_remainingTimer->isActive())
|
||||
m_remainingTimer->start();
|
||||
if (m_volleyTimer->isActive())
|
||||
|
||||
@@ -125,8 +125,6 @@ private: // attributes
|
||||
StatusSmokeFiring_t m_statusSmokeFiring;
|
||||
QMap<int, int> m_shotsInVolley;
|
||||
QMap<int, double> m_pauseAfterVolley;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace EffectShowClient
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "esc_export.h"
|
||||
#include "svcesccommon_export.h"
|
||||
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
@@ -30,7 +30,6 @@ MainHandler::MainHandler(QObject *parent)
|
||||
, m_handlerTabData(nullptr)
|
||||
, m_handlerVehicle(nullptr)
|
||||
, m_handlerControlUnit(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
@@ -55,28 +54,28 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_dbHandler->init(exerciseId, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
|
||||
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
|
||||
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful.";
|
||||
DEBUG_LOG() << "Initialisation ddsHandler succesful.";
|
||||
|
||||
// init control unit handler
|
||||
m_handlerControlUnit = std::make_shared<EffectShowClient::ControlUnitHandler>(this);
|
||||
if (!m_handlerControlUnit->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation control unit handler failed.";
|
||||
ERROR_LOG() << "Initialisation control unit handler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "Initialisation control unit handler succesful.";
|
||||
DEBUG_LOG() << "Initialisation control unit handler succesful.";
|
||||
|
||||
// create handler
|
||||
m_handlerOrder = std::make_shared<HandlerOrder>(this, this);
|
||||
@@ -89,38 +88,38 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
// ini handler
|
||||
if (!m_handlerOrder->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerOrder failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerOrder failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerOperatingCondition->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerOperatingCondition failed.";
|
||||
ERROR_LOG() << "Initialisation handlerOperatingCondition failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerFiringExplosion->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerFiringExplosion failed.";
|
||||
ERROR_LOG() << "Initialisation handlerFiringExplosion failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerFiringSmoke->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerFiringSmoke failed.";
|
||||
ERROR_LOG() << "Initialisation handlerFiringSmoke failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!m_handlerTabData->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerTabData failed.";
|
||||
ERROR_LOG() << "Initialisation HandlerTabData failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerVehicle->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerVehicle failed.";
|
||||
ERROR_LOG() << "Initialisation handlerVehicle failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,5 @@ private:
|
||||
std::shared_ptr<HandlerTabData> m_handlerTabData;
|
||||
std::shared_ptr<HandlerVehicle> m_handlerVehicle;
|
||||
std::shared_ptr<ControlUnitHandler> m_handlerControlUnit;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
};
|
||||
} // namespace EffectShowClient
|
||||
@@ -19,7 +19,6 @@ namespace EffectShowClient
|
||||
ObjectOrder::ObjectOrder(MainHandler *mainHandler, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ObjectOrder"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +36,7 @@ Core::FunctionReplyObject ObjectOrder::createObject(const Database::EscOrder &da
|
||||
if (!m_mainHandler->db()->insert(m_data))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Order into database."));
|
||||
|
||||
DEBUG_LOG(m_logger) << "New Order created Id: " << m_data.id;
|
||||
DEBUG_LOG() << "New Order created Id: " << m_data.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -56,7 +55,7 @@ Core::FunctionReplyObject ObjectOrder::updateObject(const Database::EscOrder &da
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating Order into database"));
|
||||
|
||||
DEBUG_LOG(m_logger) << "Data changed for Changed Id: " << m_data.id;
|
||||
DEBUG_LOG() << "Data changed for Changed Id: " << m_data.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -92,13 +91,13 @@ void ObjectOrder::onPublishData()
|
||||
ddsData.startTime(m_data.startTime);
|
||||
ddsData.typeOfOrder(m_data.typeOfOrder);
|
||||
ddsData.info(m_data.info.toStdString());
|
||||
INFO_LOG(m_logger) << "Publish EscOrder-data to dds (" << m_data.id << ") ...";
|
||||
INFO_LOG() << "Publish EscOrder-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (oc == EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance)
|
||||
createNotificationRequest();
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing EscOrder-data to dds";
|
||||
ERROR_LOG() << "Error publishing EscOrder-data to dds";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -164,25 +163,25 @@ void ObjectOrder::createNotificationRequest()
|
||||
NotificationManagement::CreateNotification data;
|
||||
getCreateNotificationRequestData(data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
INFO_LOG() << "trying to send CreateNotificationRequest";
|
||||
if (!m_mainHandler->dds()->ftcNom()->createNotificationRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void ObjectOrder::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting CreateNotification";
|
||||
ERROR_LOG() << "Error requesting CreateNotification";
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
} // end of onNotificationCreateReply()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <QObject>
|
||||
#include <NotificationManagement/nom_ftc.h>
|
||||
|
||||
#include <DDS/Core/function_reply_object.h>
|
||||
#include <DDS/Core/core_types.h>
|
||||
|
||||
// Generated
|
||||
#include <EffectShowClient/esc_db.h>
|
||||
@@ -52,7 +52,5 @@ class ObjectOrder
|
||||
|
||||
MainHandler *m_mainHandler;
|
||||
Database::EscOrder m_data;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
} // namespace EffectShowClient
|
||||
Reference in new issue
Block a user