Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+24
-25
@@ -14,15 +14,14 @@
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
ConnectionHandlerSerial::ConnectionHandlerSerial(QObject *parent)
|
||||
: QObject(parent)
|
||||
ConnectionHandlerSerial::ConnectionHandlerSerial(QObject *parent) : QObject(parent)
|
||||
, m_spQuerry(new LtsSerialPortQuerry::LtsSerialPortQuerry(this))
|
||||
, m_serialPort(nullptr)
|
||||
, m_receiveTimeoutTimer(new QTimer(this))
|
||||
, m_currentDataRead(QByteArray())
|
||||
, m_portName(QStringLiteral("COM5"))
|
||||
, m_readBuffer(new QByteArray())
|
||||
{
|
||||
, m_readBuffer(new QByteArray()),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_receiveTimeoutTimer->setInterval(1700);
|
||||
connect(m_spQuerry, &LtsSerialPortQuerry::LtsSerialPortQuerry::connectionEstablished, this, &ConnectionHandlerSerial::open);
|
||||
m_spQuerry->restartQuerry();
|
||||
@@ -33,7 +32,7 @@ ConnectionHandlerSerial::ConnectionHandlerSerial(QObject *parent)
|
||||
|
||||
ConnectionHandlerSerial::~ConnectionHandlerSerial()
|
||||
{
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::~ConnectionHandlerSerial";
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::~ConnectionHandlerSerial";
|
||||
}
|
||||
|
||||
bool ConnectionHandlerSerial::init()
|
||||
@@ -47,35 +46,35 @@ bool ConnectionHandlerSerial::send(const QByteArray &binaryData)
|
||||
|
||||
if (!m_serialPort)
|
||||
{
|
||||
DEBUG_LOG() << "Port is not initialized!";
|
||||
DEBUG_LOG(m_logger) << "Port is not initialized!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_serialPort->isOpen())
|
||||
{
|
||||
DEBUG_LOG() << "Port is not opened!";
|
||||
DEBUG_LOG(m_logger) << "Port is not opened!";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sending data ---------------------------------------------
|
||||
|
||||
const QByteArray writeThis = LtsUtils::byteStreamFromEscMessage(binaryData);
|
||||
DEBUG_LOG() << "Send HEX:" << writeThis.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Send HEX:" << writeThis.toHex(' ');
|
||||
qint64 byteswritten = m_serialPort->write(writeThis);
|
||||
DEBUG_LOG() << "Binary data:" << binaryData.size();
|
||||
DEBUG_LOG() << "Try sending: " << writeThis.size();
|
||||
DEBUG_LOG(m_logger) << "Binary data:" << binaryData.size();
|
||||
DEBUG_LOG(m_logger) << "Try sending: " << writeThis.size();
|
||||
|
||||
|
||||
// Check for errors ---------------------------------------------
|
||||
|
||||
if (byteswritten == -1)
|
||||
{
|
||||
DEBUG_LOG() << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
DEBUG_LOG(m_logger) << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
return false;
|
||||
}
|
||||
else if (byteswritten != writeThis.size())
|
||||
{
|
||||
DEBUG_LOG() << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
DEBUG_LOG(m_logger) << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,7 +88,7 @@ bool ConnectionHandlerSerial::open()
|
||||
|
||||
m_currentDataRead.clear();
|
||||
m_receiveTimeoutTimer->start();
|
||||
DEBUG_LOG() << "(Re)openend serial port " << m_serialPort->portName() << " baudrate: " << m_serialPort->baudRate();
|
||||
DEBUG_LOG(m_logger) << "(Re)openend serial port " << m_serialPort->portName() << " baudrate: " << m_serialPort->baudRate();
|
||||
|
||||
emit connectedToSerialConverter();
|
||||
return true;
|
||||
@@ -105,8 +104,8 @@ void ConnectionHandlerSerial::read()
|
||||
const QByteArray ba = m_serialPort->readAll();
|
||||
m_currentDataRead.append(ba);
|
||||
|
||||
//DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG() << "Data size" << ba.size();
|
||||
//DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data size" << ba.size();
|
||||
int idxStart = -1;
|
||||
int idxEnd = -1;
|
||||
while ((idxStart = m_currentDataRead.indexOf(0x02)) >= 0 &&
|
||||
@@ -118,27 +117,27 @@ void ConnectionHandlerSerial::read()
|
||||
|
||||
QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1);
|
||||
m_currentDataRead = m_currentDataRead.mid(idxEnd + 1);
|
||||
DEBUG_LOG() << "Data Message found: " << message.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data Message found: " << message.toHex(' ');
|
||||
message = LtsUtils::byteStreamToEscMessage(message);
|
||||
|
||||
if (message.size() > 2)
|
||||
{
|
||||
ERROR_LOG() << "Message to long: " << message.size();
|
||||
ERROR_LOG(m_logger) << "Message to long: " << message.size();
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Frame from sfm as binary " << message.toHex();
|
||||
DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex();
|
||||
//got message now remove frame
|
||||
|
||||
|
||||
unsigned int byte = 0;
|
||||
byte = message.at(0) & 0xFF;
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::read var byte is" << byte;
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::read var byte is" << byte;
|
||||
|
||||
|
||||
if (!isValidCommandByte(byte))
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read Commandbyte is invalid. Returning";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read Commandbyte is invalid. Returning";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,30 +148,30 @@ void ConnectionHandlerSerial::read()
|
||||
if (message.size() > 1 &&
|
||||
!isValidPayloadByte(message.at(1)))
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read Payloadbyte is invalid. Returning";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read Payloadbyte is invalid. Returning";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (message.size() != 2)
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandlerSerial::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandlerSerial::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Binary data from serial port: " << message.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Binary data from serial port: " << message.toHex(' ');
|
||||
m_receiveTimeoutTimer->start();
|
||||
|
||||
emit received(message);
|
||||
}
|
||||
|
||||
if (m_serialPort->bytesAvailable() > 0)
|
||||
DEBUG_LOG() << "Still " << m_serialPort->bytesAvailable() << " available to be read";
|
||||
DEBUG_LOG(m_logger) << "Still " << m_serialPort->bytesAvailable() << " available to be read";
|
||||
}
|
||||
|
||||
bool ConnectionHandlerSerial::isValidCommandByte(const unsigned char command)
|
||||
{
|
||||
DEBUG_LOG() << "ConnectionHandlerSerial::isValidCommandByte" << command << (command == 192 ||
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::isValidCommandByte" << command << (command == 192 ||
|
||||
command == 240 ||
|
||||
command == 244 ||
|
||||
command == 255 ||
|
||||
|
||||
+1
@@ -47,6 +47,7 @@ private slots:
|
||||
void read();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool isValidCommandByte(const unsigned char command);
|
||||
bool isValidPayloadByte(const unsigned char payload);
|
||||
LtsSerialPortQuerry::LtsSerialPortQuerry *m_spQuerry;
|
||||
|
||||
+27
-28
@@ -15,12 +15,11 @@
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
ConnectionHandlerTcp::ConnectionHandlerTcp(QObject *parent)
|
||||
: QObject(parent)
|
||||
ConnectionHandlerTcp::ConnectionHandlerTcp(QObject *parent) : QObject(parent)
|
||||
, m_socket(nullptr)
|
||||
, m_timer(new QTimer(this))
|
||||
, m_currentDataRead(QByteArray())
|
||||
{
|
||||
, m_currentDataRead(QByteArray()),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_timer->setInterval(5000);
|
||||
connect(m_timer, &QTimer::timeout, this, &ConnectionHandlerTcp::open);
|
||||
|
||||
@@ -54,27 +53,27 @@ bool ConnectionHandlerTcp::send(const QByteArray &message)
|
||||
|
||||
if (!m_socket->isOpen())
|
||||
{
|
||||
ERROR_LOG() << "Port is not opened!";
|
||||
ERROR_LOG(m_logger) << "Port is not opened!";
|
||||
return false;
|
||||
}
|
||||
|
||||
const QByteArray writeThis = LtsUtils::byteStreamFromEscMessage(message);
|
||||
DEBUG_LOG() << "Send HEX:" << writeThis.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Send HEX:" << writeThis.toHex(' ');
|
||||
qint64 byteswritten = m_socket->write(writeThis);
|
||||
DEBUG_LOG() << "Binary data:" << message.size();
|
||||
DEBUG_LOG() << "Try sending: " << message.size();
|
||||
DEBUG_LOG(m_logger) << "Binary data:" << message.size();
|
||||
DEBUG_LOG(m_logger) << "Try sending: " << message.size();
|
||||
|
||||
// Check for errors ---------------------------------------------
|
||||
|
||||
if (byteswritten == -1)
|
||||
{
|
||||
ERROR_LOG() << "Failed to write data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
ERROR_LOG(m_logger) << "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() << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
ERROR_LOG(m_logger) << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,10 +86,10 @@ bool ConnectionHandlerTcp::open()
|
||||
m_socket->connectToHost(Settings::hostName(), Settings::port());
|
||||
if (!m_socket->waitForConnected())
|
||||
{
|
||||
ERROR_LOG() << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString();
|
||||
ERROR_LOG(m_logger) << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString();
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "(Re)openend tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort();
|
||||
INFO_LOG(m_logger) << "(Re)openend tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -109,8 +108,8 @@ void ConnectionHandlerTcp::read()
|
||||
const QByteArray ba = m_socket->readAll();
|
||||
m_currentDataRead.append(ba);
|
||||
|
||||
//DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG() << "Data size" << ba.size();
|
||||
//DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data size" << ba.size();
|
||||
int idxStart = -1;
|
||||
int idxEnd = -1;
|
||||
while ((idxStart = m_currentDataRead.indexOf(0x02)) >= 0 &&
|
||||
@@ -122,27 +121,27 @@ void ConnectionHandlerTcp::read()
|
||||
|
||||
QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1);
|
||||
m_currentDataRead = m_currentDataRead.mid(idxEnd + 1);
|
||||
DEBUG_LOG() << "Data Message found: " << message.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Data Message found: " << message.toHex(' ');
|
||||
message = LtsUtils::byteStreamToEscMessage(message);
|
||||
|
||||
if (message.size() > 2)
|
||||
{
|
||||
ERROR_LOG() << "Message to long: " << message.size();
|
||||
ERROR_LOG(m_logger) << "Message to long: " << message.size();
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Frame from sfm as binary " << message.toHex();
|
||||
DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex();
|
||||
//got message now remove frame
|
||||
|
||||
|
||||
unsigned int byte = 0;
|
||||
byte = message.at(0) & 0xFF;
|
||||
DEBUG_LOG() << "ConnectionHandler::read var byte is" << byte;
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandler::read var byte is" << byte;
|
||||
|
||||
|
||||
if (!isValidCommandByte(byte))
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandler::read Commandbyte is invalid. Returning";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read Commandbyte is invalid. Returning";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,29 +152,29 @@ void ConnectionHandlerTcp::read()
|
||||
if (message.size() > 1 &&
|
||||
!isValidPayloadByte(message.at(1)))
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandler::read Payloadbyte is invalid. Returning";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read Payloadbyte is invalid. Returning";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (message.size() != 2)
|
||||
{
|
||||
ERROR_LOG() << "ConnectionHandler::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
ERROR_LOG(m_logger) << "ConnectionHandler::read No 2nd byte was appended (QByteArray has bad size). Returning.";
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Binary data from serial port: " << message.toHex(' ');
|
||||
DEBUG_LOG(m_logger) << "Binary data from serial port: " << message.toHex(' ');
|
||||
|
||||
emit received(message);
|
||||
}
|
||||
|
||||
if (m_socket->bytesAvailable() > 0)
|
||||
DEBUG_LOG() << "Still " << m_socket->bytesAvailable() << " available to be read";
|
||||
DEBUG_LOG(m_logger) << "Still " << m_socket->bytesAvailable() << " available to be read";
|
||||
}
|
||||
|
||||
void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
DEBUG_LOG() << "Spontaneous error " << error << " doesn't have to be an error ...";
|
||||
DEBUG_LOG(m_logger) << "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()) +
|
||||
@@ -187,20 +186,20 @@ void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
case QTcpSocket::SocketError::SocketAccessError:
|
||||
case QTcpSocket::SocketError::SocketResourceError:
|
||||
{
|
||||
ERROR_LOG() << "Closing port WITHOUT trying to reopen it.";
|
||||
ERROR_LOG(m_logger) << "Closing port WITHOUT trying to reopen it.";
|
||||
close();
|
||||
m_timer->start();
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QTcpSocket::SocketError::RemoteHostClosedError:
|
||||
{
|
||||
ERROR_LOG() << errStr;
|
||||
ERROR_LOG(m_logger) << errStr;
|
||||
m_timer->start();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ERROR_LOG() << errStr;
|
||||
ERROR_LOG(m_logger) << errStr;
|
||||
close();
|
||||
m_timer->start();
|
||||
break;
|
||||
@@ -210,7 +209,7 @@ void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error)
|
||||
|
||||
bool ConnectionHandlerTcp::isValidCommandByte(const unsigned char command)
|
||||
{
|
||||
DEBUG_LOG() << "ConnectionHandler::isValidCommandByte" << command << (command == 192 ||
|
||||
DEBUG_LOG(m_logger) << "ConnectionHandler::isValidCommandByte" << command << (command == 192 ||
|
||||
command == 240 ||
|
||||
command == 244 ||
|
||||
command == 255 ||
|
||||
|
||||
@@ -49,6 +49,7 @@ private slots:
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool isValidCommandByte(const unsigned char command);
|
||||
bool isValidPayloadByte(const unsigned char payload);
|
||||
QTcpSocket *m_socket;
|
||||
|
||||
+29
-30
@@ -12,12 +12,11 @@
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
ControlUnitHandler::ControlUnitHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
ControlUnitHandler::ControlUnitHandler(QObject *parent) : QObject(parent)
|
||||
, m_connectionHandler(new ConnectionHandler(this))
|
||||
, m_timer(new QTimer(this))
|
||||
, m_feature(EffectShowManagement::Feature_e::NotSpecified)
|
||||
{
|
||||
, m_feature(EffectShowManagement::Feature_e::NotSpecified),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_timer->setInterval(10000);
|
||||
connect(m_timer, &QTimer::timeout, this, &ControlUnitHandler::onConnectedToSerialConveter);
|
||||
m_timer->start();
|
||||
@@ -32,7 +31,7 @@ bool ControlUnitHandler::init()
|
||||
{
|
||||
if (!m_connectionHandler->init())
|
||||
{
|
||||
DEBUG_LOG() << "Could not init ConnectionHandler";
|
||||
DEBUG_LOG(m_logger) << "Could not init ConnectionHandler";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
commandByte = command + roundCount;
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Bad round count for command FT_SE_CB_WERFER_STATUS";
|
||||
DEBUG_LOG(m_logger) << "Bad round count for command FT_SE_CB_WERFER_STATUS";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -70,7 +69,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
commandByte = command + roundCount;
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Bad round count for command FT_SE_CB_WERFER_MUNITION";
|
||||
DEBUG_LOG(m_logger) << "Bad round count for command FT_SE_CB_WERFER_MUNITION";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -82,7 +81,7 @@ bool ControlUnitHandler::send(const CommandSignal command, const unsigned int ro
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Sending int/byte to connectionHandler: " << commandByte << QString::number(commandByte, 2); // todorm
|
||||
DEBUG_LOG(m_logger) << "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;
|
||||
@@ -97,24 +96,24 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
{
|
||||
if (ba.size() >= 1)
|
||||
{
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(0) " << (ba.at(0));
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(0) & 0xFF " << (ba.at(0) & 0xFF);
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "ControlUnitHandler::onDataReceived ba is empty";
|
||||
DEBUG_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba is empty";
|
||||
return;
|
||||
}
|
||||
if (ba.size() >= 2)
|
||||
{
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(1) " << (ba.at(1));
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba.at(1) & 0xFF " << (ba.at(1) & 0xFF);
|
||||
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);
|
||||
}
|
||||
const unsigned int data = ba.at(0);
|
||||
if (data >= SE_FT_CB_WERFER_MUNITION && data < 93)
|
||||
{
|
||||
DEBUG_LOG() << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION: " << data;
|
||||
DEBUG_LOG() << "ControlUnitHandler::SE_FT_CB_WERFER_MUNITION real: " << data - SE_FT_CB_WERFER_MUNITION;
|
||||
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;
|
||||
emit vehicleRoundCount(data - SE_FT_CB_WERFER_MUNITION);
|
||||
return;
|
||||
}
|
||||
@@ -132,14 +131,14 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
* our defined ReturningSignals enum.
|
||||
*/
|
||||
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived ba " << ba;
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived ba " << ba;
|
||||
const unsigned int commandByte = ba.at(0) & 0xFF;
|
||||
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived byte " << commandByte;
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived byte " << commandByte;
|
||||
const unsigned int byte = ba.at(1) & 0xFF;
|
||||
TRACE_LOG() << "ControlUnitHandler::onDataReceived cmdbyte" << byte;
|
||||
TRACE_LOG(m_logger) << "ControlUnitHandler::onDataReceived cmdbyte" << byte;
|
||||
|
||||
TRACE_LOG() << "onDataReceived byte: " << byte << " commandByte: " << commandByte;
|
||||
TRACE_LOG(m_logger) << "onDataReceived byte: " << byte << " commandByte: " << commandByte;
|
||||
|
||||
switch (commandByte)
|
||||
{
|
||||
@@ -161,7 +160,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
emit safetyStatus(SafetyConfirmation_e::SafetyExpiring);
|
||||
else
|
||||
emit safetyStatus(SafetyConfirmation_e::SafetyNotConfirmed);
|
||||
DEBUG_LOG() << "safety warning ";
|
||||
DEBUG_LOG(m_logger) << "safety warning ";
|
||||
emit safetyWarnings(sst);
|
||||
break;
|
||||
}
|
||||
@@ -176,7 +175,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
else
|
||||
m_feature = EffectShowManagement::Feature_e::NotSpecified;
|
||||
|
||||
DEBUG_LOG() << "Got Vehicle Type " << m_feature;
|
||||
DEBUG_LOG(m_logger) << "Got Vehicle Type " << m_feature;
|
||||
emit vehicleType(m_feature);
|
||||
break;
|
||||
}
|
||||
@@ -188,7 +187,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() << " CB STATUS FEUER " << byte;
|
||||
DEBUG_LOG(m_logger) << " CB STATUS FEUER " << byte;
|
||||
emit vehicleErrorStatus(scr);
|
||||
break;
|
||||
}
|
||||
@@ -206,7 +205,7 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
scr.cardrige4 = byte & BIT_POSITION_4;
|
||||
scr.cardrige5 = byte & BIT_POSITION_3;
|
||||
//emit vehicleSmokeCardridgesStatus(scr);
|
||||
DEBUG_LOG() << " WERFER STATUS ";
|
||||
DEBUG_LOG(m_logger) << " WERFER STATUS ";
|
||||
emit vehicleFireUnits(scr);
|
||||
break;
|
||||
}
|
||||
@@ -218,7 +217,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() << " NB STATUS ";
|
||||
DEBUG_LOG(m_logger) << " NB STATUS ";
|
||||
emit vehicleSmokeCardridgesStatus(scr);
|
||||
break;
|
||||
}
|
||||
@@ -240,13 +239,13 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SALVE_ERLEDIGT:
|
||||
{
|
||||
DEBUG_LOG() << "Volley Done";
|
||||
DEBUG_LOG(m_logger) << "Volley Done";
|
||||
emit vehicleFinshedVolley(byte);
|
||||
break;
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SALVE_UNTERBROCHEN:
|
||||
{
|
||||
DEBUG_LOG() << "Volley Stopped!!";
|
||||
DEBUG_LOG(m_logger) << "Volley Stopped!!";
|
||||
emit vehicleStoppedVolley(byte);
|
||||
//add error to ui
|
||||
CardRidges scr;
|
||||
@@ -256,22 +255,22 @@ void ControlUnitHandler::onDataReceived(const QByteArray &ba)
|
||||
}
|
||||
case ReturningSignal::SE_FT_CB_SICHERHEIT_WIDERRUFEN:
|
||||
{
|
||||
DEBUG_LOG() << "Sicherheit widerrufen!!";
|
||||
DEBUG_LOG(m_logger) << "Sicherheit widerrufen!!";
|
||||
emit vehicleSafetyRevoked();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
DEBUG_LOG() << "onDataReceived switch default";
|
||||
DEBUG_LOG(m_logger) << "onDataReceived switch default";
|
||||
break;
|
||||
}
|
||||
}
|
||||
TRACE_LOG() << "end of onDataReceived";
|
||||
TRACE_LOG(m_logger) << "end of onDataReceived";
|
||||
}
|
||||
|
||||
void ControlUnitHandler::onConnectedToSerialConveter()
|
||||
{
|
||||
DEBUG_LOG() << "Send Type Request";
|
||||
DEBUG_LOG(m_logger) << "Send Type Request";
|
||||
send(CommandSignal::FT_SE_CB_FZRSTYP);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ private slots:
|
||||
void onDisconnectedFromSerialConveter();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
ConnectionHandler *m_connectionHandler;
|
||||
QTimer *m_timer;
|
||||
EffectShowManagement::Feature_e m_feature;
|
||||
|
||||
@@ -16,7 +16,7 @@ DdsHandler::DdsHandler(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any, exerciseId))
|
||||
, m_exerciseId(exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsFts = EffectShowClient::Interface::Fts::create(m_ddsConnector);
|
||||
|
||||
bRet &= m_ddsDts->enableAll();
|
||||
INFO_LOG() << "Dts initialised";
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
INFO_LOG() << "Fts initialised";
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
|
||||
if (!bRet)
|
||||
return false;
|
||||
@@ -54,13 +54,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
if (!m_dtcTab->enableFireSmokeMarkerData())
|
||||
{
|
||||
ERROR_LOG() << "Error initializing TrainingAreaBase DTC";
|
||||
ERROR_LOG(m_logger) << "Error initializing TrainingAreaBase DTC";
|
||||
return false;
|
||||
}
|
||||
m_ftcTab = TrainingAreaBase::Interface::Ftc::create(m_ddsConnector);
|
||||
if (!m_ftcTab->enableSendFireSmokeMarkerData())
|
||||
{
|
||||
ERROR_LOG() << "Error initializing TrainingAreaBase FTC";
|
||||
ERROR_LOG(m_logger) << "Error initializing TrainingAreaBase FTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ftcNom = NotificationManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
if (!m_ftcNom->enableCreateNotification())
|
||||
{
|
||||
ERROR_LOG() << "Error initializing NotificationManagement FTC";
|
||||
ERROR_LOG(m_logger) << "Error initializing NotificationManagement FTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
if (!m_dtcAsm->enableAsset())
|
||||
{
|
||||
ERROR_LOG() << "Error initializing AssetManagement DTC";
|
||||
ERROR_LOG(m_logger) << "Error initializing AssetManagement DTC";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
std::shared_ptr<Core::Interface::Dtc> dtcCore() const { return m_dtcCore;}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
|
||||
|
||||
+13
-13
@@ -76,8 +76,8 @@ void HandlerFiringExplosion::setFiringClearanceDuration()
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escOrder)
|
||||
{
|
||||
DEBUG_LOG() << "onStartHandlerFiring()";
|
||||
DEBUG_LOG() << "numOfVolley: " << escOrder.numOfVolley
|
||||
DEBUG_LOG(m_logger) << "onStartHandlerFiring()";
|
||||
DEBUG_LOG(m_logger) << "numOfVolley: " << escOrder.numOfVolley
|
||||
<< "shotsInTotal: " << escOrder.shotsPerVolley
|
||||
<< "duration: " << escOrder.duration;
|
||||
if (escOrder.numOfVolley < 0)
|
||||
@@ -94,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() << "Changed number of Shots Remain: " << m_firingExplosionEntity.numberOfShot();
|
||||
DEBUG_LOG(m_logger) << "Changed number of Shots Remain: " << m_firingExplosionEntity.numberOfShot();
|
||||
m_isNew = false;
|
||||
}
|
||||
m_firingExplosionEntity.duration(escOrder.duration * 1000);
|
||||
@@ -103,7 +103,7 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
m_firingExplosionEntity.firingClearanceTime().set(escOrder.startTime);
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "reset clearance time";
|
||||
WARNING_LOG(m_logger) << "reset clearance time";
|
||||
m_firingExplosionEntity.firingClearanceTime().reset();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
m_firingExplosionEntity.numberOfShot() <= 0 ||
|
||||
m_firingExplosionEntity.numberOfVolley() <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Won't start Explosion ";
|
||||
WARNING_LOG(m_logger) << "Won't start Explosion ";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,8 +123,8 @@ void HandlerFiringExplosion::onStartHandlerFiring(const Database::EscOrder &escO
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerFiringExplosion::onEndHandlerFiring(const Database::EscOrder &escOrder)
|
||||
{
|
||||
DEBUG_LOG() << "onStopHandlerFiring()";
|
||||
DEBUG_LOG() << "numOfVolley: " << escOrder.numOfVolley
|
||||
DEBUG_LOG(m_logger) << "onStopHandlerFiring()";
|
||||
DEBUG_LOG(m_logger) << "numOfVolley: " << escOrder.numOfVolley
|
||||
<< "shotsInTotal: " << escOrder.shotsPerVolley
|
||||
<< "duration: " << escOrder.duration;
|
||||
if (escOrder.numOfVolley < 0 || escOrder.idOrder != m_firingExplosionEntity.idOrder())
|
||||
@@ -154,7 +154,7 @@ void HandlerFiringExplosion::onEffectShowStopped(qint16 idEffectShow)
|
||||
{
|
||||
if (idEffectShow != m_firingExplosionEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
m_firingExplosionEntity.isActive(false);
|
||||
@@ -164,7 +164,7 @@ void HandlerFiringExplosion::onEffectShowContinued(const ConvertFromTab::EffectS
|
||||
{
|
||||
if (effectShowContinue.idEffectShow != m_firingExplosionEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingExplosionEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ void HandlerFiringExplosion::onStatusExplosionFiring(const StatusExplosionFiring
|
||||
void HandlerFiringExplosion::onEffectShowStarted()
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "onEffectShowStarted";
|
||||
DEBUG_LOG(m_logger) << "onEffectShowStarted";
|
||||
m_mainHandler->handlerVehicle()->setExplosionParameter(m_firingExplosionEntity.remainingVolleys(),
|
||||
m_firingExplosionEntity.remainingShots(),
|
||||
m_firingExplosionEntity.remainingTime());
|
||||
@@ -227,10 +227,10 @@ bool HandlerFiringExplosion::onEffectShowInterrupted()
|
||||
|
||||
if (!m_firingExplosionEntity.isActive() && m_isInterrupted == false)
|
||||
{
|
||||
DEBUG_LOG() << "onEffectShowInterrupted is active so return";
|
||||
DEBUG_LOG(m_logger) << "onEffectShowInterrupted is active so return";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "onEffectShowInterrupted";
|
||||
DEBUG_LOG(m_logger) << "onEffectShowInterrupted";
|
||||
m_mainHandler->handlerControlUnit()->send(CommandSignal::FT_SE_CB_SICHERHEIT_WIDERRUFEN);
|
||||
m_mainHandler->handlerVehicle()->effectShowControl(EffectShowControl_e::StopTimer);
|
||||
|
||||
@@ -246,7 +246,7 @@ bool HandlerFiringExplosion::onEffectShowInterrupted()
|
||||
void HandlerFiringExplosion::onManuallyExplosionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallyExplosionRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onManuallyExplosionRequest ";
|
||||
DEBUG_LOG(m_logger) << "onManuallyExplosionRequest ";
|
||||
//override order!
|
||||
if (m_firingExplosionEntity.idEffectShow() == 0)
|
||||
{
|
||||
|
||||
+2
@@ -54,11 +54,13 @@ private Q_SLOTS:
|
||||
void onEffectShowStarted();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onManuallyExplosionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallyExplosionRequest &request);
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
EffectShowClient::FiringExplosionEntity m_firingExplosionEntity;
|
||||
bool m_isInterrupted = false;
|
||||
|
||||
+6
-6
@@ -27,7 +27,7 @@ HandlerFiringSmoke::HandlerFiringSmoke(MainHandler *mainHandler,
|
||||
, ManuallySmokeRequestHandler(mainHandler->dds()->fts())
|
||||
, m_mainHandler(mainHandler)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerFiringSmoke ctor";
|
||||
DEBUG_LOG(m_logger) << "HandlerFiringSmoke ctor";
|
||||
}
|
||||
//=============================================================================
|
||||
HandlerFiringSmoke::~HandlerFiringSmoke()
|
||||
@@ -81,8 +81,8 @@ void HandlerFiringSmoke::onStartHandlerFiring(const Database::EscOrder &escOrder
|
||||
if (m_firingSmokeEntity.lengthOfFogZone() <= 0 ||
|
||||
m_firingSmokeEntity.duration() <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Won't start Smoke ";
|
||||
DEBUG_LOG() << "areaWidth: " << escOrder.areaWidth
|
||||
WARNING_LOG(m_logger) << "Won't start Smoke ";
|
||||
DEBUG_LOG(m_logger) << "areaWidth: " << escOrder.areaWidth
|
||||
<< "duration: " << escOrder.duration;
|
||||
return;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void HandlerFiringSmoke::onEffectShowStopped(qint16 idEffectShow)
|
||||
{
|
||||
if (idEffectShow != m_firingSmokeEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void HandlerFiringSmoke::onEffectShowContinued(const ConvertFromTab::EffectShowC
|
||||
{
|
||||
if (effectShowContinue.idEffectShow != m_firingSmokeEntity.idEffectShow())
|
||||
{
|
||||
ERROR_LOG() << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
ERROR_LOG(m_logger) << "EffectShow IDs not consistent: " << effectShowContinue.idEffectShow << " / " << m_firingSmokeEntity.idEffectShow();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ void HandlerFiringSmoke::setSmoking()
|
||||
void HandlerFiringSmoke::onManuallySmokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallySmokeRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onManuallySmokeRequest";
|
||||
DEBUG_LOG(m_logger) << "onManuallySmokeRequest";
|
||||
|
||||
//override order!
|
||||
if (m_firingSmokeEntity.idOrder() == 0)
|
||||
|
||||
@@ -46,11 +46,13 @@ private Q_SLOTS:
|
||||
void onStatusSmokeFiring(const StatusSmokeFiring_t &statusSmokeFiring);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onManuallySmokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ManuallySmokeRequest &request);
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
EffectShowClient::FiringSmokeEntity m_firingSmokeEntity;
|
||||
};
|
||||
|
||||
+19
-19
@@ -76,7 +76,7 @@ void HandlerOperatingCondition::onVehicleBattery(double battery)
|
||||
{
|
||||
m_operatingCondition.batteryVoltage(battery);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data Battery to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data Battery to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleSmokeCardridgesFireStatus(const CardRidges &fireStatus)
|
||||
@@ -116,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() << "Error publishing OperatingConditionEntity-data (Somoking) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (Somoking) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleSmokeCardridgesStatus(const CardRidges &fireStatus)
|
||||
@@ -134,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() << "Error publishing OperatingConditionEntity-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleFireUnits(const CardRidges &fireStatus)
|
||||
@@ -144,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() << "Error publishing OperatingConditionEntity-data (fireStatus) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (fireStatus) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleErrorStatus(const CardRidges &errorStatus)
|
||||
@@ -155,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() << "Error publishing OperatingConditionEntity-data (errorStatus) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (errorStatus) to dds";
|
||||
|
||||
if (isErrorDmf() != m_oldErrorState)
|
||||
{
|
||||
@@ -168,7 +168,7 @@ void HandlerOperatingCondition::onVehicleErrorStatus(const CardRidges &errorStat
|
||||
|
||||
void HandlerOperatingCondition::onOperationalStatusTimeout()
|
||||
{
|
||||
DEBUG_LOG() << "Operational status timeout. Setting operational status to: not operational.";
|
||||
DEBUG_LOG(m_logger) << "Operational status timeout. Setting operational status to: not operational.";
|
||||
m_isOperational = false;
|
||||
m_operatingCondition.readiness(m_isOperational);
|
||||
|
||||
@@ -188,7 +188,7 @@ bool HandlerOperatingCondition::isErrorDmf()
|
||||
|
||||
void HandlerOperatingCondition::onConnectionToSerial()
|
||||
{
|
||||
DEBUG_LOG() << "Connected to Serial: send ammunition Magazine to Control Unit Count: " << m_operatingCondition.ammunitionMagazine();
|
||||
DEBUG_LOG(m_logger) << "Connected to Serial: send ammunition Magazine to Control Unit Count: " << m_operatingCondition.ammunitionMagazine();
|
||||
m_mainHandler->handlerVehicle()->setAmmunitionParameter(m_operatingCondition.ammunitionMagazine());
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ void HandlerOperatingCondition::onVehicleType(const EffectShowManagement::Featur
|
||||
{
|
||||
m_operatingCondition.vehicleFeature(type);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (vehicle type) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (vehicle type) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onSafetyStatus(const SafetyStatus &status)
|
||||
@@ -206,20 +206,20 @@ void HandlerOperatingCondition::onSafetyStatus(const SafetyStatus &status)
|
||||
m_operatingCondition.emergencyStop(status.emergencyStop);
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (SafetyStatus) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (SafetyStatus) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVehicleRoundCount(int loadedRounds)
|
||||
{
|
||||
DEBUG_LOG() << "Got RoundCount Reply from Unit " << loadedRounds;
|
||||
DEBUG_LOG(m_logger) << "Got RoundCount Reply from Unit " << loadedRounds;
|
||||
m_operatingCondition.ammunitionMagazine(loadedRounds);
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_operatingCondition))
|
||||
ERROR_LOG() << "Error publishing OperatingConditionEntity-data (ammunition magazine) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (ammunition magazine) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::onVolleyRounds(int usedRounds)
|
||||
{
|
||||
DEBUG_LOG() << "Got used rounds " << usedRounds;
|
||||
DEBUG_LOG(m_logger) << "Got used rounds " << usedRounds;
|
||||
m_operatingCondition.ammunitionMagazine(m_operatingCondition.ammunitionMagazine() - usedRounds);
|
||||
if (m_operatingCondition.ammunitionMagazine() < 0)
|
||||
m_operatingCondition.ammunitionMagazine(0);
|
||||
@@ -227,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() << "Error publishing OperatingConditionEntity-data (ammunition magazine used) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data (ammunition magazine used) to dds";
|
||||
}
|
||||
|
||||
void HandlerOperatingCondition::sendStatus()
|
||||
@@ -252,7 +252,7 @@ void HandlerOperatingCondition::getVehicleStatus(ConvertToTab::VehicleStatus_t &
|
||||
void HandlerOperatingCondition::onSendAmmunitionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendAmmunitionRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSendAmmunitionRequest";
|
||||
DEBUG_LOG(m_logger) << "onSendAmmunitionRequest";
|
||||
//take available ammo and send excon
|
||||
//then wait for reply from unit
|
||||
m_operatingCondition.ammunitionAvailable(request.ammunitionAvailable());
|
||||
@@ -276,7 +276,7 @@ void HandlerOperatingCondition::onSendAmmunitionRequest(const rti::core::SampleI
|
||||
void HandlerOperatingCondition::onSendSafetyRevokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendSafetyRevokeRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSendSafetyRevokeRequest with " << request.revoke();
|
||||
DEBUG_LOG(m_logger) << "onSendSafetyRevokeRequest with " << request.revoke();
|
||||
m_mainHandler->dds()->fts()->sendSafetyRevokeReply(cookie, Core::FunctionReplyObject());
|
||||
if (request.revoke())
|
||||
{
|
||||
@@ -289,7 +289,7 @@ void HandlerOperatingCondition::onSendSafetyRevokeRequest(const rti::core::Sampl
|
||||
void HandlerOperatingCondition::onSendReadinessRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendReadinessRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSendReadinessRequest";
|
||||
DEBUG_LOG(m_logger) << "onSendReadinessRequest";
|
||||
//Confirm or Revoke Readiness
|
||||
//send to EXCON
|
||||
m_isOperational = request.readiness();
|
||||
@@ -304,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() << "Error publishing OperatingConditionEntity-data readiness) to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing OperatingConditionEntity-data readiness) to dds";
|
||||
|
||||
if (m_isOperational)
|
||||
{
|
||||
DEBUG_LOG() << "Operating condition: operational. Starting timer.";
|
||||
DEBUG_LOG(m_logger) << "Operating condition: operational. Starting timer.";
|
||||
m_operationalStatusTimer->start(15 * 60 * 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Operating condition: not operational. Stopping timer.";
|
||||
DEBUG_LOG(m_logger) << "Operating condition: not operational. Stopping timer.";
|
||||
m_operationalStatusTimer->stop();
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -53,6 +53,7 @@ private slots:
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendAmmunitionRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SendAmmunitionRequest &request);
|
||||
void onSendSafetyRevokeRequest(const rti::core::SampleIdentity &cookie,
|
||||
@@ -63,6 +64,7 @@ private:
|
||||
bool isErrorDmf();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler{nullptr};
|
||||
CardRidges m_readyCardridges;
|
||||
CardRidges m_smokingCardridges;
|
||||
|
||||
@@ -44,7 +44,7 @@ bool HandlerOrder::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -52,11 +52,11 @@ bool HandlerOrder::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cbOrder) || !bRet)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_orderObjMap.size() = " << m_orderObjMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_orderObjMap.size() = " << m_orderObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void HandlerOrder::createOrder(const ConvertFromTab::EffectShowOrder_t &effectSh
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return;
|
||||
}
|
||||
m_orderObjMap.insert(ifs->getId(), ifs);
|
||||
@@ -125,7 +125,7 @@ void HandlerOrder::createOrder(const ConvertFromTab::RelocationOrder_t &relocati
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return;
|
||||
}
|
||||
m_orderObjMap.insert(ifs->getId(), ifs);
|
||||
@@ -136,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() << "current idorder =" ;
|
||||
//ERROR_LOG(m_logger) << "current idorder =" ;
|
||||
if (it.value()->getData().idOrder == orderRetract.id)
|
||||
{
|
||||
int id = it.key();
|
||||
@@ -144,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() << Q_FUNC_INFO << ret();
|
||||
ERROR_LOG(m_logger) << 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() << "EndFireHandler from Remove";
|
||||
DEBUG_LOG(m_logger) << "EndFireHandler from Remove";
|
||||
|
||||
emit endHandlerFiring(it.value()->getData());
|
||||
//Stop the current execution
|
||||
@@ -171,7 +171,7 @@ void HandlerOrder::removeOrder(const ConvertFromTab::OrderRetract_t &orderRetrac
|
||||
void HandlerOrder::sendOrderConfirmation(const ConvertToTab::OrderConfirmation_t &oc)
|
||||
{
|
||||
|
||||
ERROR_LOG() << "Send Order Confirmation to Excon " << oc.orderId << " / ";
|
||||
ERROR_LOG(m_logger) << "Send Order Confirmation to Excon " << oc.orderId << " / ";
|
||||
m_mainHandler->handlerTabData()->orderConfirmation(oc);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void HandlerOrder::sendOrderConfirmation(const ConvertToTab::OrderConfirmation_t
|
||||
void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OrderModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "Order: " << request.id() << " Order: " << request.orderConfirmation();
|
||||
DEBUG_LOG(m_logger) << "Order: " << request.id() << " Order: " << request.orderConfirmation();
|
||||
|
||||
if (request.id() > 0)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
if (ret.error())
|
||||
{
|
||||
m_mainHandler->dds()->fts()->orderModifyReply(cookie, ret);
|
||||
ERROR_LOG() << "Update Order object failed.";
|
||||
ERROR_LOG(m_logger) << "Update Order object failed.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ void HandlerOrder::onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
else
|
||||
{
|
||||
m_mainHandler->dds()->fts()->orderModifyReply(cookie, Core::FunctionReplyObject(request.id()));
|
||||
ERROR_LOG() << "Illegal Order ID";
|
||||
ERROR_LOG(m_logger) << "Illegal Order ID";
|
||||
}
|
||||
}
|
||||
bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
@@ -222,14 +222,14 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
oc.confirmation = orderConf.underlying();
|
||||
oc.answerText = answerText;
|
||||
sendOrderConfirmation(oc);
|
||||
ERROR_LOG() << "Update Order " << oc.orderId << " / ";
|
||||
ERROR_LOG(m_logger) << "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() << "start execution";
|
||||
DEBUG_LOG(m_logger) << "start execution";
|
||||
m_mainHandler->handlerVehicle()->effectShowControl(EffectShowClient::EffectShowControl_e::Start);
|
||||
emit effectShowStarted();
|
||||
break;
|
||||
@@ -242,7 +242,7 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
case EffectShowManagement::OrderConfirmation_e_def::Abort:
|
||||
if (checkForActiveOrder(escOrder.idOrder))
|
||||
{
|
||||
DEBUG_LOG() << "idOrder is " << escOrder.idOrder << " send abbort as is active";
|
||||
DEBUG_LOG(m_logger) << "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);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ bool HandlerOrder::updateOrder(ObjectOrder *order,
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ERROR_LOG() << "Unhandled EffectShowManagement::OrderConfirmation_e_def in HandlerOrder::onOrderModifyRequest"; // todo
|
||||
ERROR_LOG(m_logger) << "Unhandled EffectShowManagement::OrderConfirmation_e_def in HandlerOrder::onOrderModifyRequest"; // todo
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -279,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() << "Error Updating Order " << orderId << " / ";
|
||||
ERROR_LOG(m_logger) << "Error Updating Order " << orderId << " / ";
|
||||
updateOrder(ifs, answerText, orderConf);
|
||||
|
||||
}
|
||||
|
||||
bool HandlerOrder::checkForActiveOrder(int orderId)
|
||||
{
|
||||
DEBUG_LOG() << "check for active Order " << orderId << " ";
|
||||
DEBUG_LOG(m_logger) << "check for active Order " << orderId << " ";
|
||||
if (orderId <= 0)
|
||||
return false;
|
||||
return ((m_mainHandler->handlerFiringExplosion()->getCurrentorderId() == orderId )||( m_mainHandler->handlerFiringSmoke()->getCurrentorderId() == orderId));
|
||||
|
||||
@@ -47,10 +47,12 @@ Q_SIGNALS:
|
||||
void effectShowInterrupted();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onOrderModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OrderModifyRequest &request) override final;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectOrder *> m_orderObjMap;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ HandlerTabData::~HandlerTabData()
|
||||
//=============================================================================
|
||||
bool HandlerTabData::init()
|
||||
{
|
||||
DEBUG_LOG() << "Begin HandlerTabData";
|
||||
DEBUG_LOG(m_logger) << "Begin HandlerTabData";
|
||||
auto dtcTab = m_mainHandler->dds()->dtcTab();
|
||||
connect(dtcTab.get(), &TrainingAreaBase::Interface::Dtc::fireSmokeMarkerDataChanged,
|
||||
this, &HandlerTabData::onFireSmokeMarkerDataChanged);
|
||||
@@ -47,13 +47,13 @@ bool HandlerTabData::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "End HandlerTabData";
|
||||
DEBUG_LOG(m_logger) << "End HandlerTabData";
|
||||
return true;
|
||||
} // end of init()
|
||||
//=============================================================================
|
||||
void HandlerTabData::orderConfirmation(const ConvertToTab::OrderConfirmation_t &orderConfirmation)
|
||||
{
|
||||
DEBUG_LOG() << "Trigger Sending of Order Confirmation ";
|
||||
DEBUG_LOG(m_logger) << "Trigger Sending of Order Confirmation ";
|
||||
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
|
||||
|
||||
out.payload(ConvertToTab::convertOrderConfirmation(orderConfirmation));
|
||||
@@ -63,7 +63,7 @@ void HandlerTabData::orderConfirmation(const ConvertToTab::OrderConfirmation_t &
|
||||
//=============================================================================
|
||||
void HandlerTabData::vehicleStatus(const ConvertToTab::VehicleStatus_t &vehicleStatus)
|
||||
{
|
||||
DEBUG_LOG() << "Trigger Sending of Vehicle Status ";
|
||||
DEBUG_LOG(m_logger) << "Trigger Sending of Vehicle Status ";
|
||||
TrainingAreaBase::SendFireSmokeMarkerDataRequest out;
|
||||
|
||||
out.payload(ConvertToTab::convertVehicleStatus(vehicleStatus));
|
||||
@@ -73,9 +73,9 @@ void HandlerTabData::vehicleStatus(const ConvertToTab::VehicleStatus_t &vehicleS
|
||||
void HandlerTabData::onSendFireSmokeMarkerDataReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
if (reply.error())
|
||||
ERROR_LOG() << "Fire Smoke Marker Data could not be send: " << reply.str();
|
||||
ERROR_LOG(m_logger) << "Fire Smoke Marker Data could not be send: " << reply.str();
|
||||
else
|
||||
DEBUG_LOG() << "Fire Smoke Marker Data send successfully to TAB!";
|
||||
DEBUG_LOG(m_logger) << "Fire Smoke Marker Data send successfully to TAB!";
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSmokeMarkerData &data, DataModification modType)
|
||||
@@ -83,43 +83,43 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got Fire Smoke Marker " << data.sampleTime();
|
||||
DEBUG_LOG(m_logger) << "Got Fire Smoke Marker " << data.sampleTime();
|
||||
|
||||
switch (ConvertFromTab::isTelegram(data))
|
||||
{
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowOrder:
|
||||
{
|
||||
DEBUG_LOG() << "Got Effect Show Order";
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Order";
|
||||
m_mainHandler->handlerOrder()->createOrder(ConvertFromTab::convertEffectShowOrder(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::RelocationOrder:
|
||||
{
|
||||
DEBUG_LOG() << "Got Relocation order ";
|
||||
DEBUG_LOG(m_logger) << "Got Relocation order ";
|
||||
m_mainHandler->handlerOrder()->createOrder(ConvertFromTab::convertRelocationOrder(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowStop:
|
||||
{
|
||||
DEBUG_LOG() << "Got Effect Show Stop ";
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Stop ";
|
||||
emit effectShowStopped(ConvertFromTab::convertEffectShowStop(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::EffectShowContinue:
|
||||
{
|
||||
DEBUG_LOG() << "Got Effect Show Continue ";
|
||||
DEBUG_LOG(m_logger) << "Got Effect Show Continue ";
|
||||
emit effectShowContinued(ConvertFromTab::convertEffectShowContinue(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::OrderRetract:
|
||||
{
|
||||
DEBUG_LOG() << "Got Order Retract ";
|
||||
DEBUG_LOG(m_logger) << "Got Order Retract ";
|
||||
m_mainHandler->handlerOrder()->removeOrder(ConvertFromTab::convertOrderRetract(data));
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::StatusRequest:
|
||||
{
|
||||
DEBUG_LOG() << "Got Status Request " ;
|
||||
DEBUG_LOG(m_logger) << "Got Status Request " ;
|
||||
if (ConvertFromTab::convertStatusRequest(data))
|
||||
{
|
||||
m_mainHandler->handlerOperatingCondition()->sendStatus();
|
||||
@@ -128,9 +128,9 @@ void HandlerTabData::onFireSmokeMarkerDataChanged(const TrainingAreaBase::FireSm
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::MeteoData:
|
||||
{
|
||||
DEBUG_LOG() << "Got Meteo Data ";
|
||||
DEBUG_LOG(m_logger) << "Got Meteo Data ";
|
||||
if (!m_mainHandler->dds()->dts()->publish(ConvertFromTab::convertMeteoData(data)))
|
||||
ERROR_LOG() << "Error publishing MeteoNearVehicle to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing MeteoNearVehicle to dds";
|
||||
break;
|
||||
}
|
||||
case ConvertFromTab::RxTelegram_e::unknown:
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
void vehicleStatus(const ConvertToTab::VehicleStatus_t &vehicleStatus);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendFireSmokeMarkerDataReply(const Core::FunctionReplyObject &reply) override final;
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
@@ -19,14 +19,12 @@ namespace EffectShowClient
|
||||
{
|
||||
//=============================================================================
|
||||
HandlerVehicle::HandlerVehicle(MainHandler *mainHandler,
|
||||
QObject *parent)
|
||||
|
||||
: QObject(parent)
|
||||
QObject *parent) : QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_volleyTimer(new QTimer(this))
|
||||
, m_remainingTimer(new QTimer(this))
|
||||
{
|
||||
DEBUG_LOG() << "HandlerVehicle ctor";
|
||||
, m_remainingTimer(new QTimer(this)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
DEBUG_LOG(m_logger) << "HandlerVehicle ctor";
|
||||
m_volleyTimer->setSingleShot(true);
|
||||
m_remainingTimer->setInterval(1000);
|
||||
m_statusExplosionFiring.remainingTime_s = -1;
|
||||
@@ -41,7 +39,7 @@ HandlerVehicle::~HandlerVehicle()
|
||||
//=============================================================================
|
||||
bool HandlerVehicle::init()
|
||||
{
|
||||
DEBUG_LOG() << "HandlerVehicle::init()";
|
||||
DEBUG_LOG(m_logger) << "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);
|
||||
@@ -75,7 +73,7 @@ int HandlerVehicle::burningTimeSmokeCartridge_s() const
|
||||
//=============================================================================
|
||||
void HandlerVehicle::setExplosionParameter(int numberOfVolley, int numberOfShot, qint64 duration)
|
||||
{
|
||||
DEBUG_LOG() << "Duration: " << duration << " number of shots: " << numberOfShot << " number of volles" << numberOfVolley;
|
||||
DEBUG_LOG(m_logger) << "Duration: " << duration << " number of shots: " << numberOfShot << " number of volles" << numberOfVolley;
|
||||
m_statusExplosionFiring.remainingShots = numberOfShot;
|
||||
m_statusExplosionFiring.remainingTime_s = duration;
|
||||
m_statusExplosionFiring.remainingVolley = numberOfVolley;
|
||||
@@ -196,7 +194,7 @@ void HandlerVehicle::spreadShotsInVolleys(int shots, int volleys)
|
||||
|
||||
void HandlerVehicle::onVolleyStopped(int shots)
|
||||
{
|
||||
DEBUG_LOG() << "Volles Stopped after " << shots << " rounds";
|
||||
DEBUG_LOG(m_logger) << "Volles Stopped after " << shots << " rounds";
|
||||
//m_statusExplosionFiring.remainingTime_s = 0;
|
||||
//stopp timer and take current seconds
|
||||
m_remainingTimer->stop();
|
||||
@@ -220,7 +218,7 @@ void HandlerVehicle::onVolleyStopped(int shots)
|
||||
|
||||
void HandlerVehicle::onVolleyFinished(int shots)
|
||||
{
|
||||
DEBUG_LOG() << "Volley finished after shots: " << shots;
|
||||
DEBUG_LOG(m_logger) << "Volley finished after shots: " << shots;
|
||||
m_remainingTimer->stop();
|
||||
if (m_volleyTimer->isActive())
|
||||
m_volleyTimer->stop();
|
||||
@@ -234,7 +232,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() << "Remaining time: " << m_statusExplosionFiring.remainingTime_s;
|
||||
DEBUG_LOG(m_logger) << "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;
|
||||
@@ -261,7 +259,7 @@ void HandlerVehicle::onVolleyFinished(int shots)
|
||||
|
||||
void HandlerVehicle::onStartVolley()
|
||||
{
|
||||
DEBUG_LOG() << "Send Start Volley";
|
||||
DEBUG_LOG(m_logger) << "Send Start Volley";
|
||||
if (!m_remainingTimer->isActive())
|
||||
m_remainingTimer->start();
|
||||
if (m_volleyTimer->isActive())
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
void effectShowControl(EffectShowClient::EffectShowControl_e effectShowControl);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void spreadShotsInVolleys(int shots, int volleys);
|
||||
|
||||
signals:
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
namespace EffectShowClient
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_dbHandler(nullptr)
|
||||
, m_handlerOrder(nullptr)
|
||||
@@ -29,8 +28,8 @@ MainHandler::MainHandler(QObject *parent)
|
||||
, m_handlerFiringSmoke(nullptr)
|
||||
, m_handlerTabData(nullptr)
|
||||
, m_handlerVehicle(nullptr)
|
||||
, m_handlerControlUnit(nullptr)
|
||||
{}
|
||||
, m_handlerControlUnit(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -54,28 +53,28 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_dbHandler->init(exerciseId, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation ddsHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful.";
|
||||
|
||||
// init control unit handler
|
||||
m_handlerControlUnit = std::make_shared<EffectShowClient::ControlUnitHandler>(this);
|
||||
if (!m_handlerControlUnit->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation control unit handler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation control unit handler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation control unit handler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation control unit handler succesful.";
|
||||
|
||||
// create handler
|
||||
m_handlerOrder = std::make_shared<HandlerOrder>(this, this);
|
||||
@@ -88,38 +87,38 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
// ini handler
|
||||
if (!m_handlerOrder->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerOrder failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerOrder failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerOperatingCondition->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation handlerOperatingCondition failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerOperatingCondition failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerFiringExplosion->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation handlerFiringExplosion failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerFiringExplosion failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerFiringSmoke->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation handlerFiringSmoke failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerFiringSmoke failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!m_handlerTabData->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerTabData failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerTabData failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_handlerVehicle->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation handlerVehicle failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerVehicle failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
std::shared_ptr<ControlUnitHandler> handlerControlUnit() const { return m_handlerControlUnit; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
|
||||
|
||||
@@ -36,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() << "New Order created Id: " << m_data.id;
|
||||
DEBUG_LOG(m_logger) << "New Order created Id: " << m_data.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -55,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() << "Data changed for Changed Id: " << m_data.id;
|
||||
DEBUG_LOG(m_logger) << "Data changed for Changed Id: " << m_data.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -91,13 +91,13 @@ void ObjectOrder::onPublishData()
|
||||
ddsData.startTime(m_data.startTime);
|
||||
ddsData.typeOfOrder(m_data.typeOfOrder);
|
||||
ddsData.info(m_data.info.toStdString());
|
||||
INFO_LOG() << "Publish EscOrder-data to dds (" << m_data.id << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish EscOrder-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (oc == EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance)
|
||||
createNotificationRequest();
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(ddsData))
|
||||
ERROR_LOG() << "Error publishing EscOrder-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing EscOrder-data to dds";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -163,25 +163,25 @@ void ObjectOrder::createNotificationRequest()
|
||||
NotificationManagement::CreateNotification data;
|
||||
getCreateNotificationRequestData(data);
|
||||
|
||||
INFO_LOG() << "trying to send CreateNotificationRequest";
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
if (!m_mainHandler->dds()->ftcNom()->createNotificationRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void ObjectOrder::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting CreateNotification";
|
||||
ERROR_LOG(m_logger) << "Error requesting CreateNotification";
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
} // end of onNotificationCreateReply()
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ class ObjectOrder
|
||||
Core::FunctionReplyObject updateObject() { return updateObject(m_data); }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// Callbackfunctions for FTC
|
||||
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
|
||||
Reference in new issue
Block a user