Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+19
-19
@@ -44,7 +44,7 @@ AlmTests::~AlmTests()
|
||||
// ------------------------------------------------------------------
|
||||
bool AlmTests::init(int domainId, int testId, int operatorId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_operatorId = operatorId;
|
||||
@@ -73,7 +73,7 @@ bool AlmTests::init(int domainId, int testId, int operatorId)
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest m_testId=" << m_testId;
|
||||
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
|
||||
if (m_testId <= 1) // Send FTC ConfigureAlarms and EEM Event
|
||||
{
|
||||
QTimer::singleShot(0, this, &AlmTests::tryConfigureAlarms);
|
||||
@@ -102,7 +102,7 @@ void AlmTests::startTest()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::tryConfigureAlarms()
|
||||
{
|
||||
INFO_LOG() << "trying to send createRequest Operator Message";
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Operator Message";
|
||||
|
||||
std::vector<AlarmManagement::AlarmAction> alarms;
|
||||
alarms.resize(2);
|
||||
@@ -124,7 +124,7 @@ void AlmTests::tryConfigureAlarms()
|
||||
|
||||
if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
} // tryConfigureAlarms
|
||||
@@ -132,7 +132,7 @@ void AlmTests::tryConfigureAlarms()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::tryCreateParticipant()
|
||||
{
|
||||
INFO_LOG() << "trying to create Participant index = " << m_participantIndex;
|
||||
INFO_LOG(m_logger) << "trying to create Participant index = " << m_participantIndex;
|
||||
ParticipantManagement::Participant participant;
|
||||
switch (m_participantIndex)
|
||||
{
|
||||
@@ -153,10 +153,10 @@ void AlmTests::tryCreateParticipant()
|
||||
participant.partyId(5);
|
||||
break;
|
||||
}
|
||||
DEBUG_LOG() << "Publishing Participant";
|
||||
DEBUG_LOG(m_logger) << "Publishing Participant";
|
||||
if (!m_dtsPpm->publish(participant))
|
||||
{
|
||||
ERROR_LOG() << "Error publish Participant";
|
||||
ERROR_LOG(m_logger) << "Error publish Participant";
|
||||
failExit();
|
||||
}
|
||||
m_participantIndex++;
|
||||
@@ -165,7 +165,7 @@ void AlmTests::tryCreateParticipant()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::tryConfigureAlarmsList()
|
||||
{
|
||||
INFO_LOG() << "trying to send createRequest Operator Message";
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Operator Message";
|
||||
|
||||
std::vector<AlarmManagement::AlarmAction> alarms;
|
||||
alarms.resize(2);
|
||||
@@ -188,7 +188,7 @@ void AlmTests::tryConfigureAlarmsList()
|
||||
|
||||
if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
} // tryConfigureAlarmsList
|
||||
@@ -196,7 +196,7 @@ void AlmTests::tryConfigureAlarmsList()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::trySendEvent()
|
||||
{
|
||||
INFO_LOG() << "trying to send ParticipantEvent";
|
||||
INFO_LOG(m_logger) << "trying to send ParticipantEvent";
|
||||
|
||||
ExerciseEventManagement::Event pe;
|
||||
|
||||
@@ -215,10 +215,10 @@ void AlmTests::trySendEvent()
|
||||
|
||||
QString properties = QString::fromUtf8(QJsonDocument(obj).toJson());
|
||||
pe.properties(properties.toStdString());
|
||||
DEBUG_LOG() << "Publishing EEM Event";
|
||||
DEBUG_LOG(m_logger) << "Publishing EEM Event";
|
||||
if (!m_dtsEem->publish(pe))
|
||||
{
|
||||
ERROR_LOG() << "Error publish EEM Event";
|
||||
ERROR_LOG(m_logger) << "Error publish EEM Event";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -226,10 +226,10 @@ void AlmTests::trySendEvent()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "onConfigureAlarmsReply, error = " << replyObject.error();
|
||||
INFO_LOG(m_logger) << "onConfigureAlarmsReply, error = " << replyObject.error();
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error ConfigureAlarms - aborting";
|
||||
ERROR_LOG(m_logger) << "Error ConfigureAlarms - aborting";
|
||||
failExit();
|
||||
}
|
||||
} // onConfigureAlarmsReply
|
||||
@@ -237,11 +237,11 @@ void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObje
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::checkAlarm()
|
||||
{
|
||||
INFO_LOG() << "checkAlarm";
|
||||
INFO_LOG(m_logger) << "checkAlarm";
|
||||
m_dtcAlm->waitForHistoricalDataNotification();
|
||||
qint32 id = 0;
|
||||
AlarmManagement::Notification notification = m_dtcAlm->notification(id);
|
||||
INFO_LOG() << "Recived AlarmManagement::Notification: " << notification
|
||||
INFO_LOG(m_logger) << "Recived AlarmManagement::Notification: " << notification
|
||||
<< " testId: " << m_testId;
|
||||
|
||||
switch (m_testId)
|
||||
@@ -249,12 +249,12 @@ void AlmTests::checkAlarm()
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
INFO_LOG() << "ExitSuccess";
|
||||
INFO_LOG(m_logger) << "ExitSuccess";
|
||||
ExitSuccess();
|
||||
break;
|
||||
default:
|
||||
// nothing
|
||||
INFO_LOG() << "failExit";
|
||||
INFO_LOG(m_logger) << "failExit";
|
||||
failExit();
|
||||
break;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ void AlmTests::failExit()
|
||||
// ------------------------------------------------------------------
|
||||
void AlmTests::ExitSuccess()
|
||||
{
|
||||
DEBUG_LOG() << "SUCCESS";
|
||||
DEBUG_LOG(m_logger) << "SUCCESS";
|
||||
m_bTestsSuccessful = true;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
} // ExitSuccess
|
||||
|
||||
@@ -46,6 +46,7 @@ protected Q_SLOTS:
|
||||
void ExitSuccess();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
private:
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace AlarmManagement
|
||||
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: m_ddsConnector(ddsConnector)
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -40,34 +40,34 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
m_dtsAlm = AlarmManagement::Interface::Dts::create(m_ddsConnector);
|
||||
bool bRet = m_dtsAlm->enableAll();
|
||||
INFO_LOG() << "Dts initialised";
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
|
||||
m_dtcAlm = AlarmManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcAlm->enableAcknowledgeSOSInAllExercises();
|
||||
INFO_LOG() << "Dts initialised";
|
||||
INFO_LOG(m_logger) << "Dts initialised";
|
||||
|
||||
m_ftsAlm = AlarmManagement::Interface::Fts::create(m_ddsConnector);
|
||||
bRet &= m_ftsAlm->enableAll();
|
||||
INFO_LOG() << "Fts initialised";
|
||||
INFO_LOG(m_logger) << "Fts initialised";
|
||||
|
||||
m_dtcEem = ExerciseEventManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcEem->enableEvent();
|
||||
INFO_LOG() << "Dtc EEM initialised";
|
||||
INFO_LOG(m_logger) << "Dtc EEM initialised";
|
||||
|
||||
m_ftcMrk = MarkerManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
bRet &= m_ftcMrk->enableMarkerModify();
|
||||
INFO_LOG() << "Ftc MRK initialised";
|
||||
INFO_LOG(m_logger) << "Ftc MRK initialised";
|
||||
|
||||
m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcPpm->enableParticipant();
|
||||
INFO_LOG() << "Dtc PPM initialised";
|
||||
INFO_LOG(m_logger) << "Dtc PPM initialised";
|
||||
|
||||
m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_exmDtc->enableExercise();
|
||||
|
||||
m_dtcTab = TrainingAreaBase::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet &= m_dtcTab->enableEmergencyCall();
|
||||
INFO_LOG() << "Dtc TAB initialised";
|
||||
INFO_LOG(m_logger) << "Dtc TAB initialised";
|
||||
|
||||
|
||||
m_dtsEmergencyCallPublisher = std::make_shared<DDSConnector::Publisher>(m_ddsConnector->getDomainParticipant(),
|
||||
@@ -77,7 +77,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_dtsEmergencyCallPublisher->getDdsPublisher(),
|
||||
DDS::Helper::getShortTopicName(DDS::topic_type_name<AlarmManagement::AcknowledgeSOSInAllExercises>::value()));
|
||||
|
||||
INFO_LOG() << "Dtc TAB initialised";
|
||||
INFO_LOG(m_logger) << "Dtc TAB initialised";
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
qint64 currentPartitionTime() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
|
||||
+26
-26
@@ -51,7 +51,7 @@ HandlerConfigureAlarms::~HandlerConfigureAlarms()
|
||||
|
||||
bool HandlerConfigureAlarms::init()
|
||||
{
|
||||
INFO_LOG() << "Start HandlerConfigureAlarms.";
|
||||
INFO_LOG(m_logger) << "Start HandlerConfigureAlarms.";
|
||||
|
||||
auto dtcEem = m_mainHandler->dds()->dtcEem();
|
||||
|
||||
@@ -61,7 +61,7 @@ bool HandlerConfigureAlarms::init()
|
||||
// publish data from db-table 'alm_config'
|
||||
auto cb = [this](const Database::AlmConfig & data)
|
||||
{
|
||||
DEBUG_LOG() << "restore AlarmConfig from DB data: id=" << data.id
|
||||
DEBUG_LOG(m_logger) << "restore AlarmConfig from DB data: id=" << data.id
|
||||
<< " operatorId=" << data.operatorId
|
||||
<< " participantId=" << data.participantId.toInt()
|
||||
<< " global=" << data.global
|
||||
@@ -75,7 +75,7 @@ bool HandlerConfigureAlarms::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cb))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'alm_config'!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'alm_config'!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
|
||||
int participantId,
|
||||
int eventTypeId)
|
||||
{
|
||||
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
|
||||
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size()
|
||||
<< " operatorId=" << operatorId
|
||||
<< " participantId=" << participantId
|
||||
<< " eventTypeId=" << eventTypeId;
|
||||
@@ -97,7 +97,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
DEBUG_LOG() << "key= " << i.key() << ": "
|
||||
DEBUG_LOG(m_logger) << "key= " << i.key() << ": "
|
||||
<< " operatorId=" << i.value().operatorId
|
||||
<< " participantId=" << i.value().participantId.toInt()
|
||||
<< " eventTypeId=" << i.value().eventTypeId.underlying();
|
||||
@@ -106,7 +106,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
|
||||
&& (eventTypeId == ProjectDataManagement::EventType_def::Unknown || eventTypeId == i.value().eventTypeId.underlying()))
|
||||
{
|
||||
const int key = i.key();
|
||||
DEBUG_LOG() << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
|
||||
DEBUG_LOG(m_logger) << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
|
||||
m_mainHandler->db()->removeAlmConfig(key);
|
||||
m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key);
|
||||
m_alarms.remove(key); // is ok, QMapIterator work on a copy
|
||||
@@ -116,20 +116,20 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
|
||||
|
||||
void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
|
||||
{
|
||||
DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
|
||||
DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size();
|
||||
|
||||
// Find Key
|
||||
QMapIterator<int, Database::AlmConfig> i(m_alarms);
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
DEBUG_LOG() << "key= " << i.key()
|
||||
DEBUG_LOG(m_logger) << "key= " << i.key()
|
||||
<< " participantId=" << i.value().participantId.toInt();
|
||||
if ((operatorId == i.value().operatorId)
|
||||
&& (i.value().participantId.toInt()) == 0)
|
||||
{
|
||||
const int key = i.key();
|
||||
DEBUG_LOG() << "found alarm to remove: " << key;
|
||||
DEBUG_LOG(m_logger) << "found alarm to remove: " << key;
|
||||
m_mainHandler->db()->removeAlmConfig(key);
|
||||
m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key);
|
||||
m_alarms.remove(key); // is ok, QMapIterator work on a copy
|
||||
@@ -141,7 +141,7 @@ void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId)
|
||||
void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ConfigureAlarmsRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onConfigureAlarmsRequest " << request;
|
||||
DEBUG_LOG(m_logger) << "onConfigureAlarmsRequest " << request;
|
||||
if (request.participantIds().size() == 0)
|
||||
{
|
||||
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database. There were no participants given."));
|
||||
@@ -154,13 +154,13 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
// remove only this one Alarm, not all types of the participant for operator
|
||||
// in DB,
|
||||
// from DDS
|
||||
DEBUG_LOG() << "request.remove()";
|
||||
DEBUG_LOG(m_logger) << "request.remove()";
|
||||
if (request.participantIds().size() > 0 &&
|
||||
request.alarms().size() > 0)
|
||||
{
|
||||
int participantId = request.participantIds()[0];
|
||||
int eventTypeId = request.alarms()[0].eventTypeId().underlying();
|
||||
DEBUG_LOG() << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
|
||||
DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
|
||||
<< " participantId=" << participantId
|
||||
<< " eventTypeId=" << eventTypeId;
|
||||
removeAlarmConfig(request.operatorId(), participantId, eventTypeId);
|
||||
@@ -171,7 +171,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
// remove old configuration
|
||||
for (int participantId : request.participantIds())
|
||||
{
|
||||
DEBUG_LOG() << "remove old configuration participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "remove old configuration participantId=" << participantId;
|
||||
removeAlarmConfig(request.operatorId(), participantId, 0);
|
||||
}
|
||||
if ( request.global())
|
||||
@@ -181,10 +181,10 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
|
||||
for (int participantId : request.participantIds())
|
||||
{
|
||||
DEBUG_LOG() << "participantId: " << participantId;
|
||||
DEBUG_LOG(m_logger) << "participantId: " << participantId;
|
||||
for (const AlarmManagement::AlarmAction &action : request.alarms())
|
||||
{
|
||||
DEBUG_LOG() << "action: " << action;
|
||||
DEBUG_LOG(m_logger) << "action: " << action;
|
||||
|
||||
AlarmManagement::AlarmConfig almConfig;
|
||||
almConfig.operatorId(request.operatorId());
|
||||
@@ -210,7 +210,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database."));
|
||||
m_mainHandler->dds()->ftsAlm()->configureAlarmsReply(cookie, ret);
|
||||
}
|
||||
DEBUG_LOG() << "m_dbAlmConfig.insert id=" << newConfig.id;
|
||||
DEBUG_LOG(m_logger) << "m_dbAlmConfig.insert id=" << newConfig.id;
|
||||
|
||||
almConfig.id(newConfig.id);
|
||||
m_alarms.insert(newConfig.id, newConfig);
|
||||
@@ -224,11 +224,11 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId();
|
||||
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId();
|
||||
if (modType == DataModification::eRemoved ||
|
||||
modType == DataModification::eModified)
|
||||
return;
|
||||
DEBUG_LOG() << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
|
||||
DEBUG_LOG(m_logger) << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size();
|
||||
|
||||
ExerciseEventManagement::Event eventDatalocal = eventData;
|
||||
|
||||
@@ -248,7 +248,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
for (const Database::AlmConfig &alarm : std::as_const(m_alarms))
|
||||
{
|
||||
{
|
||||
/*DEBUG_LOG() << " alarmConfigItem.id=" << alarm.id
|
||||
/*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id
|
||||
<< " alarmConfigItem.participantId=" << alarm.participantId
|
||||
<< " alarmConfigItem.eventTypeId=" << alarm.eventTypeId
|
||||
<< " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId().underlying()
|
||||
@@ -272,7 +272,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
bool allVulnerabilityStates = alarm.vulnerabilityState == -1;
|
||||
bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState;
|
||||
bool globalAlarm = participantId == 0;
|
||||
DEBUG_LOG() << " allVulnerabilityStates=" << allVulnerabilityStates
|
||||
DEBUG_LOG(m_logger) << " allVulnerabilityStates=" << allVulnerabilityStates
|
||||
<< " vulnerabilityCheck=" << vulnerabilityCheck
|
||||
<< " participantId=" << participantId
|
||||
<< " eventDatalocal.participantId()=" << eventDatalocal.participantId();
|
||||
@@ -281,19 +281,19 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
{
|
||||
if (sentEventToOperator.contains(alarm.operatorId))
|
||||
{
|
||||
DEBUG_LOG() << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
|
||||
DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
|
||||
continue;
|
||||
}
|
||||
|
||||
sentEventToOperator += alarm.operatorId;
|
||||
if (alarm.messageWindow)
|
||||
{
|
||||
DEBUG_LOG() << "send Window to Operator:" << alarm.operatorId;
|
||||
DEBUG_LOG(m_logger) << "send Window to Operator:" << alarm.operatorId;
|
||||
sendWindow(eventDatalocal, alarm);
|
||||
}
|
||||
if (alarm.setMarker)
|
||||
{
|
||||
DEBUG_LOG() << "set Marker to Operator:" << alarm.operatorId;
|
||||
DEBUG_LOG(m_logger) << "set Marker to Operator:" << alarm.operatorId;
|
||||
sendMarker(eventDatalocal, alarm);
|
||||
}
|
||||
}
|
||||
@@ -359,7 +359,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
|
||||
{
|
||||
int defaultOffset = 10000;
|
||||
|
||||
DEBUG_LOG() << "eventProperties =" << eventData.properties();
|
||||
DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties();
|
||||
|
||||
QString contentStr;
|
||||
contentStr = QStringLiteral("Equip No.: ");
|
||||
@@ -376,7 +376,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
|
||||
contentStr += eventObject.value(QStringLiteral("AesName")).toString();
|
||||
contentStr += QStringLiteral(")");
|
||||
}
|
||||
DEBUG_LOG() << "contentStr=" << contentStr;
|
||||
DEBUG_LOG(m_logger) << "contentStr=" << contentStr;
|
||||
|
||||
const QByteArray contentArr = contentStr.toUtf8();
|
||||
|
||||
@@ -399,6 +399,6 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
|
||||
void HandlerConfigureAlarms::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
Q_UNUSED(replyObject);
|
||||
INFO_LOG() << "************** onMarkerCreateReply";
|
||||
INFO_LOG(m_logger) << "************** onMarkerCreateReply";
|
||||
} // end onMarkerCreateReply
|
||||
} // namespace AlarmManagement
|
||||
@@ -48,6 +48,8 @@ private Q_SLOTS:
|
||||
void onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType);
|
||||
|
||||
private: // methods
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ConfigureAlarmsRequest &request) override;
|
||||
void sendWindow(const ExerciseEventManagement::Event &eventData,
|
||||
|
||||
+15
-15
@@ -34,7 +34,7 @@ HandlerEmergencyCall::~HandlerEmergencyCall()
|
||||
|
||||
bool HandlerEmergencyCall::init()
|
||||
{
|
||||
INFO_LOG() << "Start HandlerEmergencyCall.";
|
||||
INFO_LOG(m_logger) << "Start HandlerEmergencyCall.";
|
||||
|
||||
auto dtcTab = m_mainHandler->dds()->dtcTab();
|
||||
|
||||
@@ -48,7 +48,7 @@ bool HandlerEmergencyCall::init()
|
||||
bool bRet = true;
|
||||
auto cbEmergencyCall = [this, &bRet](const Database::AlmEmergencyCall &data)
|
||||
{
|
||||
WARNING_LOG()<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id;
|
||||
WARNING_LOG(m_logger)<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id;
|
||||
if (!this->isExerciseValidForEmergencyCall() && !data.expired)
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,7 @@ bool HandlerEmergencyCall::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ bool HandlerEmergencyCall::init()
|
||||
|
||||
if (!m_mainHandler->db()->select(cbEmergencyCall) || !bRet)
|
||||
{
|
||||
ERROR_LOG() <<"Error reading data from database 'alm_emergency_call!";
|
||||
ERROR_LOG(m_logger) <<"Error reading data from database 'alm_emergency_call!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -95,21 +95,21 @@ bool HandlerEmergencyCall::createEmergencyCallObject(const AlarmManagement::AlmE
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG()<< ret();
|
||||
ERROR_LOG(m_logger)<< ret();
|
||||
return false;
|
||||
}
|
||||
|
||||
WARNING_LOG()<< "Entry createEmergencyCallObject in the DB id: "<<ifs->getData().id<<" issi: "<<ifs->getData().issi<<" expired: "<<ifs->getData().expired;
|
||||
WARNING_LOG(m_logger)<< "Entry createEmergencyCallObject in the DB id: "<<ifs->getData().id<<" issi: "<<ifs->getData().issi<<" expired: "<<ifs->getData().expired;
|
||||
m_emergencyObjMap.insert(ifs->getId(), ifs);
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie, const EmergencyCallAcknowledgeRequest &request)
|
||||
{
|
||||
WARNING_LOG() << "[onEmergencyCallAcknowledgeRequest] request: " << request;
|
||||
WARNING_LOG(m_logger) << "[onEmergencyCallAcknowledgeRequest] request: " << request;
|
||||
Core::FunctionReplyObject ret = emergencyCallAcknowledgeRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG()<< ret();
|
||||
WARNING_LOG(m_logger)<< ret();
|
||||
|
||||
if (request.expired())
|
||||
{
|
||||
@@ -122,7 +122,7 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa
|
||||
ackInEx.operatorId(request.operatorId());
|
||||
ackInEx.comment(request.comment());
|
||||
ackInEx.expired(request.expired());
|
||||
WARNING_LOG() << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi();
|
||||
WARNING_LOG(m_logger) << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi();
|
||||
m_mainHandler->dds()->publishSOS()->write(ackInEx);
|
||||
}
|
||||
m_mainHandler->dds()->ftsAlm()->emergencyCallAcknowledgeReply(cookie,ret);
|
||||
@@ -145,17 +145,17 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
WARNING_LOG()<<" Couldn't acknowledge SOS with issi: " <<request.issi()<< ": already acknowledged or issi doesn't exist.";
|
||||
WARNING_LOG(m_logger)<<" Couldn't acknowledge SOS with issi: " <<request.issi()<< ": already acknowledged or issi doesn't exist.";
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "already acknowledged or issi(%1) couldn't be found")).arg(request.issi());
|
||||
}
|
||||
|
||||
if (ifs->getData().expired) // if already expired do nothing
|
||||
{
|
||||
WARNING_LOG() << "SOS Already expired do nothing";
|
||||
WARNING_LOG(m_logger) << "SOS Already expired do nothing";
|
||||
return Core::FunctionReplyObject(ifs->getData().id);
|
||||
}
|
||||
|
||||
WARNING_LOG() << "emergencyCallAcknowledgeRequest: issi found!: "<<request.issi()<<" ifs->state: "<<ifs->getData().expired;
|
||||
WARNING_LOG(m_logger) << "emergencyCallAcknowledgeRequest: issi found!: "<<request.issi()<<" ifs->state: "<<ifs->getData().expired;
|
||||
Database::AlmEmergencyCall newData(ifs->getData());
|
||||
newData.expired = true;
|
||||
newData.issi = request.issi();
|
||||
@@ -189,7 +189,7 @@ bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata)
|
||||
&& data.incomingTime == newdata.incomingTime()
|
||||
&& !data.expired)
|
||||
{
|
||||
WARNING_LOG()<<" SOS EXISTS and not yet quit! issi: "<<data.issi<<" incomingTime: "<<data.incomingTime<<" expired: "<<data.expired;
|
||||
WARNING_LOG(m_logger)<<" SOS EXISTS and not yet quit! issi: "<<data.issi<<" incomingTime: "<<data.incomingTime<<" expired: "<<data.expired;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -218,7 +218,7 @@ void HandlerEmergencyCall::onEmergencyCallChanged(const TrainingAreaBase::Emerge
|
||||
|
||||
void HandlerEmergencyCall::onAcknowledgeSOSInExercises(const AcknowledgeSOSInAllExercises &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG()<< "onAcknowledgeSOSInExercises START ";
|
||||
DEBUG_LOG(m_logger)<< "onAcknowledgeSOSInExercises START ";
|
||||
Q_UNUSED(modType)
|
||||
|
||||
EmergencyCallAcknowledgeRequest request;
|
||||
@@ -232,7 +232,7 @@ void HandlerEmergencyCall::onAcknowledgeSOSInExercises(const AcknowledgeSOSInAll
|
||||
request.operatorId(data.operatorId());
|
||||
emergencyCallAcknowledgeRequest(request);
|
||||
|
||||
DEBUG_LOG()<< "onAcknowledgeEmergencyInExercises END ";
|
||||
DEBUG_LOG(m_logger)<< "onAcknowledgeEmergencyInExercises END ";
|
||||
}
|
||||
|
||||
} // namespace AlarmManagement
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool createEmergencyCallObject(const AlmEmergencyCall &data);
|
||||
void onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie,
|
||||
const EmergencyCallAcknowledgeRequest &request) override final;
|
||||
@@ -45,6 +46,7 @@ private slots:
|
||||
void onAcknowledgeSOSInExercises(const AlarmManagement::AcknowledgeSOSInAllExercises &data, DataModification modType);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
Initialization *m_mainHandler;
|
||||
std::shared_ptr<HandlerConfigureAlarms> m_configAlarmHandler;
|
||||
QMap<int, ObjectEmergencyCall *> m_emergencyObjMap; // Key = DangerAreaId
|
||||
|
||||
+15
-16
@@ -11,10 +11,9 @@
|
||||
|
||||
using namespace AlarmManagement;
|
||||
|
||||
HandlerParticipant::HandlerParticipant(const std::shared_ptr<DdsHandler> &ddsHandler)
|
||||
: QObject()
|
||||
, m_ddsHandler(ddsHandler)
|
||||
{
|
||||
HandlerParticipant::HandlerParticipant(const std::shared_ptr<DdsHandler> &ddsHandler) : QObject()
|
||||
, m_ddsHandler(ddsHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -44,13 +43,13 @@ bool HandlerParticipant::init()
|
||||
|
||||
if (!dtcPpm->enableParticipant())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableParticipant data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableParticipant data topic client";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dtcPpm->enableDynamicParticipantData())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -66,7 +65,7 @@ bool HandlerParticipant::init()
|
||||
if (participant.equipmentNumber().is_set())
|
||||
{
|
||||
m_partId2EquipNoMap.insert(participant.id(), participant.equipmentNumber().get());
|
||||
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get();
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get();
|
||||
}
|
||||
else
|
||||
m_partId2EquipNoMap.insert(participant.id(), 0);
|
||||
@@ -86,13 +85,13 @@ bool HandlerParticipant::init()
|
||||
ParticipantManagement::StateInformation state = states[0];
|
||||
int vulnerability = state.vulnerabilityState().underlying();
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId(), vulnerability);
|
||||
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability;
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability;
|
||||
}
|
||||
else
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId(), -1);
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipant::init() finished. ";
|
||||
INFO_LOG(m_logger) << "HandlerParticipant::init() finished. ";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -101,12 +100,12 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantChanged - remove: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged - remove: " << data.id();
|
||||
m_participantHierarchy.remove(data.id());
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantChanged:" << data;
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged:" << data;
|
||||
m_participantHierarchy.insert(data.id(),
|
||||
AlarmManagement::HandlerParticipant::ParticipantHierarchy(data));
|
||||
const int equipNo = data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0;
|
||||
@@ -117,13 +116,13 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
|
||||
|
||||
void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onDynamicParticipant participantId=" << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "onDynamicParticipant participantId=" << data.participantId();
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "onDynamicParticipant()"
|
||||
INFO_LOG(m_logger) << "onDynamicParticipant()"
|
||||
<< " participantId: " << data.participantId();
|
||||
if (data.stateHistory().size() > 0)
|
||||
{
|
||||
@@ -131,7 +130,7 @@ void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement
|
||||
ParticipantManagement::StateInformation state = states[0];
|
||||
int vulnerability = state.vulnerabilityState().underlying();
|
||||
m_partId2VulnerabilityMap.insert(data.participantId(), vulnerability);
|
||||
DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << data.participantId()
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << data.participantId()
|
||||
<< " vulnerability=" << vulnerability;
|
||||
}
|
||||
else
|
||||
@@ -178,7 +177,7 @@ QVector<int> HandlerParticipant::getRecursiveInferiorIds(const int participantId
|
||||
int HandlerParticipant::participantId2EquipNo(const int participantId) const
|
||||
{
|
||||
int ret = m_partId2EquipNoMap.value(participantId, 0);
|
||||
INFO_LOG() << "participantId2EquipNo participantId=" << participantId
|
||||
INFO_LOG(m_logger) << "participantId2EquipNo participantId=" << participantId
|
||||
<< " EquipmentNumber=" << ret;
|
||||
return ret;
|
||||
} // end of participantId2EquipNo()
|
||||
@@ -186,7 +185,7 @@ int HandlerParticipant::participantId2EquipNo(const int participantId) const
|
||||
int HandlerParticipant::participantId2Vulnerability(const int participantId) const
|
||||
{
|
||||
int ret = m_partId2VulnerabilityMap.value(participantId, 0);
|
||||
INFO_LOG() << "m_partId2VulnerabilityMap participantId=" << participantId
|
||||
INFO_LOG(m_logger) << "m_partId2VulnerabilityMap participantId=" << participantId
|
||||
<< " Vulnerability=" << ret;
|
||||
return ret;
|
||||
} // end of participantId2Vulnerability()
|
||||
@@ -78,6 +78,8 @@ private Q_SLOTS:
|
||||
void onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
|
||||
|
||||
private: // methoden
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
QVector<AlarmManagement::HandlerParticipant::ParticipantHierarchy> getInferiorParts(int participantId) const;
|
||||
|
||||
private: // attributes
|
||||
|
||||
@@ -19,7 +19,7 @@ using namespace AlarmManagement;
|
||||
Initialization::Initialization()
|
||||
: m_logger(getLogger("Initialization"))
|
||||
{
|
||||
INFO_LOG() << "Initialization::Initialization";
|
||||
INFO_LOG(m_logger) << "Initialization::Initialization";
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -32,32 +32,32 @@ Initialization::~Initialization()
|
||||
m_dbHandler = nullptr;
|
||||
m_ddsHandler = nullptr;
|
||||
|
||||
INFO_LOG() << "Initialization::~Initialization";
|
||||
INFO_LOG(m_logger) << "Initialization::~Initialization";
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector, const QSqlDatabase &sqlDb)
|
||||
{
|
||||
INFO_LOG() << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId()
|
||||
INFO_LOG(m_logger) << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId()
|
||||
<< " exerciseId=" << ddsConnector->getPartitionId();
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(ddsConnector);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "m_ddsHandler initialized. ";
|
||||
INFO_LOG(m_logger) << "m_ddsHandler initialized. ";
|
||||
|
||||
// initialize database
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(ddsConnector->getPartitionId(), sqlDb))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "DbHandler initialized. ";
|
||||
INFO_LOG(m_logger) << "DbHandler initialized. ";
|
||||
|
||||
|
||||
// create handlers
|
||||
@@ -65,7 +65,7 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
m_handlerConfigureAlarms = std::make_shared<HandlerConfigureAlarms>(this);
|
||||
m_handlerEmergencyCall = std::make_shared<HandlerEmergencyCall>(m_handlerConfigureAlarms, this);
|
||||
|
||||
DEBUG_LOG() << "initialize successfully finished";
|
||||
DEBUG_LOG(m_logger) << "initialize successfully finished";
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
@@ -76,20 +76,20 @@ bool Initialization::loadFromDatabase()
|
||||
// initialize handlers
|
||||
if (!m_handlerParticipant || !m_handlerParticipant->init())
|
||||
{
|
||||
ERROR_LOG() << "Can not initialize Participant handler";
|
||||
ERROR_LOG(m_logger) << "Can not initialize Participant handler";
|
||||
return false;
|
||||
}
|
||||
if (!m_handlerConfigureAlarms || !m_handlerConfigureAlarms->init())
|
||||
{
|
||||
ERROR_LOG() << "Can not initialize Alarm handler";
|
||||
ERROR_LOG(m_logger) << "Can not initialize Alarm handler";
|
||||
return false;
|
||||
}
|
||||
if (!m_handlerEmergencyCall || !m_handlerEmergencyCall->init())
|
||||
{
|
||||
ERROR_LOG() << "Can not initialize EmergencyCall handler";
|
||||
ERROR_LOG(m_logger) << "Can not initialize EmergencyCall handler";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "loadFromDatabase successfully finished";
|
||||
DEBUG_LOG(m_logger) << "loadFromDatabase successfully finished";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ public:
|
||||
std::shared_ptr<HandlerParticipant> hdlParticipant() const { return m_handlerParticipant; }
|
||||
|
||||
private: // attributes
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DbHandler> m_dbHandler; ///< Pointer to DB handler
|
||||
std::shared_ptr<HandlerConfigureAlarms> m_handlerConfigureAlarms;
|
||||
|
||||
+7
-8
@@ -4,10 +4,9 @@
|
||||
|
||||
namespace AlarmManagement{
|
||||
|
||||
ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent) : QObject(parent)
|
||||
, m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
ObjectEmergencyCall::~ObjectEmergencyCall()
|
||||
@@ -23,7 +22,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::createObject(const Database::AlmE
|
||||
{
|
||||
if (!m_mainHandler->db()->insert(m_data))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Order into database."));
|
||||
WARNING_LOG() << "New EmergencyCall created Id: " << m_data.id;
|
||||
WARNING_LOG(m_logger) << "New EmergencyCall created Id: " << m_data.id;
|
||||
}
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -40,7 +39,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::updateObject(const Database::AlmE
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating EmergencyCall 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();
|
||||
@@ -71,10 +70,10 @@ void ObjectEmergencyCall::onPublishData()
|
||||
ddsData.operatorId(m_data.operatorId);
|
||||
ddsData.comment(m_data.comment.toStdString());
|
||||
|
||||
INFO_LOG() << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dtsAlm()->publish(ddsData))
|
||||
ERROR_LOG() << "Error publishing AlmEmergencyCall-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AlmEmergencyCall-data to dds";
|
||||
}
|
||||
|
||||
}// namespace AlarmManagement
|
||||
@@ -32,6 +32,7 @@ protected Q_SLOTS:
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
Initialization *m_mainHandler;
|
||||
Database::AlmEmergencyCall m_data;
|
||||
};
|
||||
|
||||
+20
-21
@@ -26,23 +26,22 @@ namespace AreaEffectSimulation
|
||||
|
||||
|
||||
|
||||
AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent)
|
||||
: QObject(parent)
|
||||
, m_effector(parent)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent) : QObject(parent)
|
||||
, m_effector(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
AbstractFiringStrategy::~AbstractFiringStrategy()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
void AbstractFiringStrategy::calculateDispersionTrajectory()
|
||||
{
|
||||
DEBUG_LOG() << "calculateDispersionTrajectory";
|
||||
DEBUG_LOG(m_logger) << "calculateDispersionTrajectory";
|
||||
// 1. Neuen Zielpunkt berechnen
|
||||
|
||||
const auto &intendendTrajectory = m_effector->intendendTrajectory();
|
||||
@@ -50,7 +49,7 @@ void AbstractFiringStrategy::calculateDispersionTrajectory()
|
||||
// sanity check:
|
||||
if (intendendTrajectory.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of intendendTrajectory not sufficiant, size=" << intendendTrajectory.size();
|
||||
return;
|
||||
}
|
||||
@@ -73,7 +72,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// sanity check:
|
||||
if (relativeTrajectory.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of relativeTrajectory not sufficiant, size=" << relativeTrajectory.size();
|
||||
return {};
|
||||
}
|
||||
@@ -89,7 +88,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365
|
||||
for (const TrajectoryPoint &trajPntRelPos : std::as_const(relativeTrajectory))
|
||||
{
|
||||
DEBUG_LOG() << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
|
||||
DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
|
||||
|
||||
// // geographic offers nice feature to add an offset:
|
||||
// const QPointF &trajectoryAbsGeo = launchUtm.geographic(trajPntRelPos);
|
||||
@@ -104,7 +103,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// Position des Participants mit der m_participantId
|
||||
const double zValue = effectorPositionGeo.z() + trajPntRelPos.position.z(); // trajPntRelPos.position.z() ist die Hoehe
|
||||
|
||||
DEBUG_LOG() << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo;
|
||||
DEBUG_LOG(m_logger) << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo;
|
||||
geometry.emplace_back(Core::GeoPositionRelativeTime(trajPntAbsGeo.x(), trajPntAbsGeo.y(), zValue, trajPntRelPos.time));
|
||||
}
|
||||
return geometry;
|
||||
@@ -115,7 +114,7 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std::
|
||||
// sanity check:
|
||||
if (trajectoryGeometry.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of trajectoryGeometry not sufficiant, size=" << trajectoryGeometry.size();
|
||||
return {};
|
||||
}
|
||||
@@ -133,14 +132,14 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std::
|
||||
|
||||
int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajectoryTimeAware, const QJsonObject &properties)
|
||||
{
|
||||
DEBUG_LOG() << "sendChargeEffect";
|
||||
DEBUG_LOG(m_logger) << "sendChargeEffect";
|
||||
|
||||
const auto &trajGeometry = trajectoryTimeAware.geometry();
|
||||
|
||||
// sanity check:
|
||||
if (trajGeometry.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of trajectoryTimeAware.geometry not sufficiant, size=" << trajGeometry.size();
|
||||
return -1;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto
|
||||
chargeEffect.trajectoryTimeAware(trajectoryTimeAware);
|
||||
|
||||
const auto &reply = m_effector->mainHandler()->chargeEffectHandler()->createChargeEffect(chargeEffect);
|
||||
DEBUG_LOG() << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId();
|
||||
DEBUG_LOG(m_logger) << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId();
|
||||
return reply.id();
|
||||
}
|
||||
|
||||
@@ -178,21 +177,21 @@ Core::GeoPosition AbstractFiringStrategy::participantPosition(int participantId)
|
||||
|
||||
int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "getGearTypeId"
|
||||
DEBUG_LOG(m_logger) << "getGearTypeId"
|
||||
<< ", chargeTypeId:" << chargeTypeId << ", participantId:" << participantId;
|
||||
|
||||
m_effector->mainHandler()->dds()->ppmDtc()->enableDynamicParticipantData(true);
|
||||
m_effector->mainHandler()->dds()->ppmDtc()->waitForHistoricalDataDynamicParticipantData(1000);
|
||||
const ParticipantManagement::DynamicParticipantData &dynamicParticipantData = m_effector->mainHandler()->dds()->ppmDtc()->dynamicParticipantData(participantId);
|
||||
DEBUG_LOG() << "gearSize " << dynamicParticipantData.gear().size();
|
||||
DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size();
|
||||
|
||||
const auto& participantData_gear = dynamicParticipantData.gear();
|
||||
for (const auto &gear : std::as_const(participantData_gear))
|
||||
{
|
||||
DEBUG_LOG() << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId;
|
||||
DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId;
|
||||
if (gear.chargeTypeId() == chargeTypeId)
|
||||
{
|
||||
DEBUG_LOG() << "getGearTypeId return: " << gear.gearTypeId();
|
||||
DEBUG_LOG(m_logger) << "getGearTypeId return: " << gear.gearTypeId();
|
||||
if (gear.gearTypeId() != 0)
|
||||
return gear.gearTypeId();
|
||||
else
|
||||
|
||||
+73
-73
@@ -83,7 +83,7 @@ ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId)
|
||||
this,
|
||||
[this]()
|
||||
{
|
||||
DEBUG_LOG() << "Wirkfeldplanung";
|
||||
DEBUG_LOG(m_logger) << "Wirkfeldplanung";
|
||||
doEffectClusterModifyRequest();
|
||||
});
|
||||
}
|
||||
@@ -91,28 +91,28 @@ ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId)
|
||||
void ModuleTestEffectCluster::onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onEffectClusterModifyReply: " << m_replyError << ", aesItemId=" << replyObject.id();
|
||||
DEBUG_LOG(m_logger) << " got reply - onEffectClusterModifyReply: " << m_replyError << ", aesItemId=" << replyObject.id();
|
||||
m_aesItemId = replyObject.id();
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onEffectClusterModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onEffectClusterModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onAcknowledgeExternalAesItemReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onAcknowledgeExternalAesItemReply: " << m_replyError;
|
||||
sendTabExFire();
|
||||
// AES::EffectState von ES_Received -> ES_Created
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onAcknowledgeExternalAesItemReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onAcknowledgeExternalAesItemReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onModifyPartyDataReply: " << m_replyError << " " << replyObject.additionalInfo();
|
||||
DEBUG_LOG(m_logger) << " got reply - onModifyPartyDataReply: " << m_replyError << " " << replyObject.additionalInfo();
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onModifyPartyDataReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onModifyPartyDataReply: " << replyObject.translated();
|
||||
if (!m_participantChangeRequestDone)
|
||||
{
|
||||
participantChangeRequest();
|
||||
@@ -123,24 +123,24 @@ void ModuleTestEffectCluster::onModifyPartyDataReply(const Core::FunctionReplyOb
|
||||
void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " \n\ngot reply - onModifyParticipantDataReply error: " << m_replyError << ", additionalInfo: " << replyObject.additionalInfo();
|
||||
DEBUG_LOG(m_logger) << " \n\ngot reply - onModifyParticipantDataReply error: " << m_replyError << ", additionalInfo: " << replyObject.additionalInfo();
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onModifyParticipantDataReply: " << replyObject.translated();
|
||||
DEBUG_LOG() << "onModifyParticipantDataReply => Set Participant Pos";
|
||||
ERROR_LOG(m_logger) << " got reply - onModifyParticipantDataReply: " << replyObject.translated();
|
||||
DEBUG_LOG(m_logger) << "onModifyParticipantDataReply => Set Participant Pos";
|
||||
QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object().value(QLatin1String("participants")).toArray();
|
||||
DEBUG_LOG() << "available_in_exercise jsonDocument.size()=" << jsonArray.size();
|
||||
DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument.size()=" << jsonArray.size();
|
||||
// ParticipantId aus dem Result bestimmen, keine Unit
|
||||
// Dieser einfache Test arbeitet mit einem Participant
|
||||
for (auto it = jsonArray.constBegin(); it != jsonArray.constEnd(); ++it)
|
||||
{
|
||||
int participantId = it->toInt();
|
||||
DEBUG_LOG() << "participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "participantId=" << participantId;
|
||||
ParticipantManagement::Participant participant = m_ppmDtc->participant(participantId);
|
||||
if (m_ppmDtc->type(participant.typeId()).typeClass().underlying() != ParticipantManagement::TypeClass::Unit)
|
||||
{
|
||||
DEBUG_LOG() << "m_participant1.id=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participant1.id=" << participantId;
|
||||
m_participant1.id(participantId); // wichtig zum loeschen
|
||||
DEBUG_LOG() << "m_participantId keine Unit=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participantId keine Unit=" << participantId;
|
||||
setParticipantPos(participantId);
|
||||
setEquipmentGearCharge(participantId);
|
||||
|
||||
@@ -150,7 +150,7 @@ void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionR
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "m_participant0.id=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "m_participant0.id=" << participantId;
|
||||
m_participant0.id(participantId); // wichtig zum loeschen
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie
|
||||
if (aesItemView.aesItemId() != m_aesItemId)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << " got onAesItemViewChanged: "
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged: "
|
||||
<< ", aesItemId=" << aesItemView.aesItemId() << ", aesType=" << aesType << ", effectStateId=" << aesItemView.effectStateId();
|
||||
|
||||
QCOMPARE(aesItemView.effectStateId(), m_effectStates[m_effectStateCounter]);
|
||||
@@ -176,14 +176,14 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie
|
||||
|
||||
if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsReceived)
|
||||
{
|
||||
DEBUG_LOG() << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId();
|
||||
sendAcknowledgeExternalAesItemRequest(aesItemView.aesItemId());
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::sendTabExFire()
|
||||
{
|
||||
DEBUG_LOG() << "sendTabExFire";
|
||||
DEBUG_LOG(m_logger) << "sendTabExFire";
|
||||
TrainingAreaBase::EX_Fire exFire;
|
||||
exFire.effectorId(m_effectorId); // Kenner z.B B1
|
||||
exFire.identifier(m_identifier.toStdString()); // Verein z.B 451100
|
||||
@@ -199,16 +199,16 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying();
|
||||
DEBUG_LOG() << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
++m_counterDds.cntEffectClusterEffects;
|
||||
|
||||
m_effects = effects;
|
||||
DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEffect, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onChargeEffectChanged state=" << chargeEffect.state();
|
||||
DEBUG_LOG(m_logger) << "onChargeEffectChanged state=" << chargeEffect.state();
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
@@ -225,7 +225,7 @@ void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEf
|
||||
}
|
||||
else if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
participantDeleteRequest();
|
||||
DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType)
|
||||
@@ -236,12 +236,12 @@ void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeA
|
||||
|
||||
++m_counterDds.cntTrajectory;
|
||||
|
||||
DEBUG_LOG() << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory;
|
||||
DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory;
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::dumpCnt()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " Counter: "
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Counter: "
|
||||
<< " cntEffectCluster = " << m_counterDds.cntEffectCluster << ", cntAtEffectCluster = " << m_counterDds.cntAtEffectCluster
|
||||
<< ", cntGunToTargetLine = " << m_counterDds.cntAtEffectClusterGunToTargetLine << ", cntClusterEffects = " << m_counterDds.cntEffectClusterEffects
|
||||
<< ", cntTrajectory = " << m_counterDds.cntTrajectory;
|
||||
@@ -258,7 +258,7 @@ bool ModuleTestEffectCluster::waitForData(const std::function<bool()> &func, int
|
||||
|
||||
for (int i = 0; i < retryCount; ++i)
|
||||
{
|
||||
TRACE_LOG() << " waitForData - i: " << i;
|
||||
TRACE_LOG(m_logger) << " waitForData - i: " << i;
|
||||
if (func())
|
||||
return true;
|
||||
QTest::qWait(1000);
|
||||
@@ -299,7 +299,7 @@ EffectCluster ModuleTestEffectCluster::getEcForTneVerification(const QString &ea
|
||||
|
||||
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(cp.geographic(), width, height, rot));
|
||||
|
||||
DEBUG_LOG() << " bottomLeft" << bottomLeft;
|
||||
DEBUG_LOG(m_logger) << " bottomLeft" << bottomLeft;
|
||||
|
||||
eaData.area().cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0));
|
||||
eaData.area().height(height);
|
||||
@@ -359,23 +359,23 @@ std::vector<Core::RelativePositionRelativeTime> ModuleTestEffectCluster::parseTr
|
||||
}
|
||||
}
|
||||
points.push_back(p);
|
||||
DEBUG_LOG() << "Punkt gelesen: offsetY" << p.offsetX() << ", offsetY" << p.offsetY() << ", offsetZ" << p.offsetZ() << ", time=" << p.relativeTime();
|
||||
DEBUG_LOG(m_logger) << "Punkt gelesen: offsetY" << p.offsetX() << ", offsetY" << p.offsetY() << ", offsetZ" << p.offsetZ() << ", time=" << p.relativeTime();
|
||||
}
|
||||
}
|
||||
|
||||
if (xml.hasError())
|
||||
{
|
||||
DEBUG_LOG() << "XML Fehler:" << xml.errorString();
|
||||
DEBUG_LOG(m_logger) << "XML Fehler:" << xml.errorString();
|
||||
}
|
||||
DEBUG_LOG() << "file.close()";
|
||||
DEBUG_LOG(m_logger) << "file.close()";
|
||||
file.close();
|
||||
DEBUG_LOG() << "return points";
|
||||
DEBUG_LOG(m_logger) << "return points";
|
||||
return points;
|
||||
}
|
||||
|
||||
int ModuleTestEffectCluster::sendAcknowledgeExternalAesItemRequest(int aesItemId)
|
||||
{
|
||||
DEBUG_LOG() << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemId;
|
||||
int ret = m_aesFtc->acknowledgeExternalAesItemRequest(AcknowledgeExternalAesItemRequest(aesItemId), this);
|
||||
return ret;
|
||||
}
|
||||
@@ -387,9 +387,9 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
m_reference = dateTimeString;
|
||||
|
||||
if (eaData.effectStart().is_set())
|
||||
INFO_LOG() << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString();
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString();
|
||||
else
|
||||
INFO_LOG() << " effectClusterModifyRequest with effectStart: not set ";
|
||||
INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
// if (eaData.flightCurve().is_set())
|
||||
@@ -439,7 +439,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
AreaEffectSimulation::EffectorData effector;
|
||||
effector.angleOfFall(0);
|
||||
effector.participantId(m_participant1.id()); // Participant
|
||||
DEBUG_LOG() << "effector.participantId(m_participant1.id()=" << m_participant1.id();
|
||||
DEBUG_LOG(m_logger) << "effector.participantId(m_participant1.id()=" << m_participant1.id();
|
||||
|
||||
effector.flightTime(39526.3);
|
||||
effector.peakHeight(2002.0);
|
||||
@@ -454,26 +454,26 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
effector.mhpPosition(mhpPosition);
|
||||
effector.trajectoryRelative(trajectory);
|
||||
|
||||
DEBUG_LOG() << "effector";
|
||||
DEBUG_LOG(m_logger) << "effector";
|
||||
|
||||
std::vector<AreaEffectSimulation::EffectorData> effectors;
|
||||
effectors.push_back(effector);
|
||||
|
||||
DEBUG_LOG() << "Nach effector";
|
||||
DEBUG_LOG(m_logger) << "Nach effector";
|
||||
|
||||
eaData.id(0);
|
||||
eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_ADLER);
|
||||
eaData.firePurposeId(2);
|
||||
eaData.partyId(4);
|
||||
eaData.participantId(m_participant0.id()); // Unit
|
||||
DEBUG_LOG() << "eaData.participantId(m_participant0.id()=" << m_participant0.id();
|
||||
DEBUG_LOG(m_logger) << "eaData.participantId(m_participant0.id()=" << m_participant0.id();
|
||||
eaData.externalId(7);
|
||||
eaData.effectMarkingInTa(1);
|
||||
|
||||
eaData.name(dateTimeString.toStdString());
|
||||
eaData.element(dateTimeString.toStdString());
|
||||
|
||||
DEBUG_LOG() << "Vor send effectClusterModifyRequest";
|
||||
DEBUG_LOG(m_logger) << "Vor send effectClusterModifyRequest";
|
||||
|
||||
int ret = m_aesFtc->effectClusterModifyRequest(EffectClusterModifyRequest(eaData.id(),
|
||||
eaData.name(),
|
||||
@@ -493,7 +493,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest()
|
||||
eaData.effectMarkingInTa(),
|
||||
eaData.properties()),
|
||||
this);
|
||||
DEBUG_LOG() << "send effectClusterModifyRequest ret=" << ret;
|
||||
DEBUG_LOG(m_logger) << "send effectClusterModifyRequest ret=" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -502,31 +502,31 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }, 1))
|
||||
{
|
||||
ERROR_LOG() << "Error on request"
|
||||
ERROR_LOG(m_logger) << "Error on request"
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared; }, durPrep))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated; }, durAct))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, durExp))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i
|
||||
|
||||
void ModuleTestEffectCluster::disconnectFromParty()
|
||||
{
|
||||
DEBUG_LOG() << "PPM::ModifyPartyDataRequest";
|
||||
DEBUG_LOG(m_logger) << "PPM::ModifyPartyDataRequest";
|
||||
|
||||
ParticipantManagement::Party party;
|
||||
|
||||
@@ -559,14 +559,14 @@ void ModuleTestEffectCluster::disconnectFromParty()
|
||||
|
||||
if (!m_ppmFtc->modifyPartyDataRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error creating party data";
|
||||
ERROR_LOG(m_logger) << "Error creating party data";
|
||||
// failExit();
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::connectToParty()
|
||||
{
|
||||
DEBUG_LOG() << "PPM::ModifyPartyDataRequest";
|
||||
DEBUG_LOG(m_logger) << "PPM::ModifyPartyDataRequest";
|
||||
|
||||
ParticipantManagement::Party party;
|
||||
|
||||
@@ -592,14 +592,14 @@ void ModuleTestEffectCluster::connectToParty()
|
||||
|
||||
if (!m_ppmFtc->modifyPartyDataRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error creating party data";
|
||||
ERROR_LOG(m_logger) << "Error creating party data";
|
||||
// failExit();
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::participantChangeRequest()
|
||||
{
|
||||
DEBUG_LOG() << "PPM::participantChangerequest";
|
||||
DEBUG_LOG(m_logger) << "PPM::participantChangerequest";
|
||||
|
||||
m_participant0.id(0);
|
||||
m_participant0.partyId(4);
|
||||
@@ -643,14 +643,14 @@ void ModuleTestEffectCluster::participantChangeRequest()
|
||||
req.data(data);
|
||||
if (!m_ppmFtc->modifyParticipantDataRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error creating party data";
|
||||
ERROR_LOG(m_logger) << "Error creating party data";
|
||||
// failExit();
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::participantDeleteRequest()
|
||||
{
|
||||
DEBUG_LOG() << "PPM::participantDeleteRequest";
|
||||
DEBUG_LOG(m_logger) << "PPM::participantDeleteRequest";
|
||||
|
||||
m_participant0.isDeleted(true);
|
||||
|
||||
@@ -664,14 +664,14 @@ void ModuleTestEffectCluster::participantDeleteRequest()
|
||||
req.data(data);
|
||||
if (!m_ppmFtc->modifyParticipantDataRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error creating party data";
|
||||
ERROR_LOG(m_logger) << "Error creating party data";
|
||||
// failExit();
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleTestEffectCluster::setParticipantPos(int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "setupParticipants";
|
||||
DEBUG_LOG(m_logger) << "setupParticipants";
|
||||
TrainingAreaBase::TabPosition position;
|
||||
Core::GeoPosition geoPos;
|
||||
TrainingAreaBase::EquipmentPosition pos;
|
||||
@@ -680,7 +680,7 @@ void ModuleTestEffectCluster::setParticipantPos(int participantId)
|
||||
geoPos.lat(0.91579597);
|
||||
geoPos.z(0.0);
|
||||
|
||||
DEBUG_LOG() << " initTestCase_data1 ...";
|
||||
DEBUG_LOG(m_logger) << " initTestCase_data1 ...";
|
||||
pos.equipmentNumber(participantId * -1); // ParticipantId
|
||||
pos.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
position.reportingSource(Core::PositionReportingSource::SetByOperator);
|
||||
@@ -691,7 +691,7 @@ void ModuleTestEffectCluster::setParticipantPos(int participantId)
|
||||
|
||||
void ModuleTestEffectCluster::setEquipmentGearCharge(int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "setupEquipmentGearCharge";
|
||||
DEBUG_LOG(m_logger) << "setupEquipmentGearCharge";
|
||||
TrainingAreaBase::EquipmentGearChargeState egs;
|
||||
TrainingAreaBase::GearCharge charge;
|
||||
std::vector<TrainingAreaBase::GearCharge> charges;
|
||||
@@ -729,7 +729,7 @@ void ModuleTestEffectCluster::setEquipmentGearCharge(int participantId)
|
||||
|
||||
void ModuleTestEffectCluster::onPartyChanged(const ParticipantManagement::Party &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onPartyChanged:" << data;
|
||||
DEBUG_LOG(m_logger) << "onPartyChanged:" << data;
|
||||
// Remove Participant:
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
@@ -741,14 +741,14 @@ void ModuleTestEffectCluster::onPartyChanged(const ParticipantManagement::Party
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "onPartyChanged id= " << data.id();
|
||||
DEBUG_LOG(m_logger) << "onPartyChanged id= " << data.id();
|
||||
if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Connected)
|
||||
{
|
||||
DEBUG_LOG() << "onPartyChanged saaConnectedState == connected";
|
||||
DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == connected";
|
||||
}
|
||||
else if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Disconnected)
|
||||
{
|
||||
DEBUG_LOG() << "onPartyChanged saaConnectedState == disconnected => connectToParty";
|
||||
DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == disconnected => connectToParty";
|
||||
connectToParty();
|
||||
}
|
||||
}
|
||||
@@ -762,7 +762,7 @@ void ModuleTestEffectCluster::initTestCase()
|
||||
// DdsConnector
|
||||
//
|
||||
|
||||
DEBUG_LOG() << "DDSConnector: m_domainId " << m_domainId << ", m_exerciseId " << m_exerciseId;
|
||||
DEBUG_LOG(m_logger) << "DDSConnector: m_domainId " << m_domainId << ", m_exerciseId " << m_exerciseId;
|
||||
|
||||
QFile file(s_REQUEST_SPL_FILE);
|
||||
const bool bFileExists = file.exists();
|
||||
@@ -774,14 +774,14 @@ void ModuleTestEffectCluster::initTestCase()
|
||||
QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!");
|
||||
if (!bInit)
|
||||
{
|
||||
ERROR_LOG() << " ERROR, ddsConnector.init failed!!";
|
||||
ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!";
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << " ddsConnector.init successfull";
|
||||
INFO_LOG(m_logger) << " ddsConnector.init successfull";
|
||||
|
||||
// cmd
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
//
|
||||
// Aes
|
||||
@@ -802,12 +802,12 @@ void ModuleTestEffectCluster::initTestCase()
|
||||
|
||||
m_aesDtc->enableAesItemView();
|
||||
m_aesDtc->enableChargeEffect();
|
||||
DEBUG_LOG() << " waitForHistoricalDataAesItemView... ";
|
||||
DEBUG_LOG(m_logger) << " waitForHistoricalDataAesItemView... ";
|
||||
m_aesDtc->waitForHistoricalDataAesItemView(2000);
|
||||
DEBUG_LOG() << " waitForHistoricalDataAesItemView... Done";
|
||||
DEBUG_LOG(m_logger) << " waitForHistoricalDataAesItemView... Done";
|
||||
|
||||
QMap<qint32, AreaEffectSimulation::AesItemView> aesItemViewsCont = m_aesDtc->aesItemViews();
|
||||
DEBUG_LOG() << " aesItemViewsCont.size() " << aesItemViewsCont.size();
|
||||
DEBUG_LOG(m_logger) << " aesItemViewsCont.size() " << aesItemViewsCont.size();
|
||||
|
||||
//
|
||||
// PDM
|
||||
@@ -832,13 +832,13 @@ void ModuleTestEffectCluster::initTestCase()
|
||||
QVERIFY2(bRet, "ERROR, enableAll m_exmDtc failed!!");
|
||||
|
||||
m_exmDtc->waitForHistoricalDataExercise(2000);
|
||||
DEBUG_LOG() << " waitForHistoricalDataExercise... Done";
|
||||
DEBUG_LOG(m_logger) << " waitForHistoricalDataExercise... Done";
|
||||
|
||||
const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId);
|
||||
QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!");
|
||||
m_traingAreaId = exercise.trainingAreaId();
|
||||
|
||||
DEBUG_LOG() << " ExerciseManagement"
|
||||
DEBUG_LOG(m_logger) << " ExerciseManagement"
|
||||
<< ", m_traingAreaId = " << m_traingAreaId;
|
||||
//
|
||||
// PPM ParticipantManagement
|
||||
@@ -861,7 +861,7 @@ void ModuleTestEffectCluster::initTestCase()
|
||||
bRet = bRet && m_tabDts->enableAll();
|
||||
QVERIFY2(bRet, "ERROR, m_tabDts enableAll failed!!");
|
||||
|
||||
DEBUG_LOG() << "disconnectFromParty";
|
||||
DEBUG_LOG(m_logger) << "disconnectFromParty";
|
||||
disconnectFromParty();
|
||||
// connectToParty();
|
||||
|
||||
@@ -896,9 +896,9 @@ void ModuleTestEffectCluster::cleanupTestCase()
|
||||
// finish last (dds) calls:
|
||||
waitForData([]() { return false; }, 10);
|
||||
|
||||
INFO_LOG() << " ddsConnector destroy...";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...";
|
||||
m_ddsConnector.reset();
|
||||
INFO_LOG() << " ddsConnector destroy...DONE";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...DONE";
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
+2
@@ -61,6 +61,8 @@ public:
|
||||
ModuleTestEffectCluster(int domainId, int exerciseId);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
+86
-86
@@ -102,65 +102,65 @@ ModuleTestExplosionCluster::ModuleTestExplosionCluster(int domainId, int exercis
|
||||
void ModuleTestExplosionCluster::onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onSetSimulatedParticipantFormationReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onSetSimulatedParticipantFormationReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onSetSimulatedParticipantFormationReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onSetSimulatedParticipantFormationReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onExplosionClusterModifyReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onExplosionClusterSingleEffectOnlyModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onExplosionClusterOcModifyReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onExplosionClusterOcModifyReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterOcModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterOcModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onExplosionClusterPauseResumeReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onExplosionClusterPauseResumeReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onExplosionClusterPauseResumeReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onTargetPositionsModifyReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onTargetPositionsModifyReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onTargetPositionsModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onTargetPositionsModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onSetBuildingStatesReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onSetBuildingStatesReply: " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onSetBuildingStatesReply: " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onSetBuildingStatesReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onSetBuildingStatesReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluster &data, DataModification modType)
|
||||
@@ -177,7 +177,7 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste
|
||||
{
|
||||
long now = time(nullptr) * 1000;
|
||||
long diff = now - m_objectRequestedTimePointMsec;
|
||||
DEBUG_LOG() << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId()
|
||||
DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId()
|
||||
<< ", OBJECT IS NOT Modifiable ANYMORE"
|
||||
<< " ((diff = " << diff << ")";
|
||||
}
|
||||
@@ -187,10 +187,10 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste
|
||||
if (m_data.effectStart().is_set())
|
||||
startTimeMsec = m_data.effectStart().get();
|
||||
|
||||
DEBUG_LOG() << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId()
|
||||
DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId()
|
||||
<< ", startTimeMsec=" << startTimeMsec
|
||||
<< ", cntExplosionCluster=" << m_counterDds.cntExplosionCluster;
|
||||
TRACE_LOG() << " got changed - m_data: " << m_data;
|
||||
TRACE_LOG(m_logger) << " got changed - m_data: " << m_data;
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onBuildingStateChanged(const Buildings::BuildingState &bldgState, DataModification modType)
|
||||
@@ -198,7 +198,7 @@ void ModuleTestExplosionCluster::onBuildingStateChanged(const Buildings::Buildin
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
// DEBUG_LOG() << " got changed - BuildingState.id: " << bldgState.id() << ", data.damagePerc " << bldgState.damagePercent() << "m_bldgIdToFilter " << m_bldgIdToFilter;
|
||||
// DEBUG_LOG(m_logger) << " got changed - BuildingState.id: " << bldgState.id() << ", data.damagePerc " << bldgState.damagePercent() << "m_bldgIdToFilter " << m_bldgIdToFilter;
|
||||
|
||||
if (m_bldgIdToFilter == bldgState.id())
|
||||
m_buildingStateVec.push_back(bldgState);
|
||||
@@ -210,7 +210,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying();
|
||||
DEBUG_LOG() << " got onAesItemViewChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
|
||||
switch (aesType) {
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
|
||||
@@ -233,11 +233,11 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying();
|
||||
DEBUG_LOG() << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType;
|
||||
++m_counterDds.cntExplosionClusterEffects;
|
||||
|
||||
m_effects = effects;
|
||||
DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects;
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType)
|
||||
@@ -248,7 +248,7 @@ void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTi
|
||||
|
||||
++m_counterDds.cntTrajectory;
|
||||
|
||||
DEBUG_LOG() << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory;
|
||||
DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory;
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::dumpCnt()
|
||||
@@ -278,11 +278,11 @@ bool ModuleTestExplosionCluster::setFilterForBldgState(const QString &bldgName)
|
||||
const int bldgId = getBldgId(bldgName);
|
||||
if (bldgId<=0)
|
||||
{
|
||||
ERROR_LOG() << " getBldgId failed for '" << bldgName << "'";
|
||||
ERROR_LOG(m_logger) << " getBldgId failed for '" << bldgName << "'";
|
||||
return false;
|
||||
}
|
||||
m_bldgIdToFilter = bldgId;
|
||||
INFO_LOG() << " setFilterForBldgState for '" << bldgName << "' to " << m_bldgIdToFilter;
|
||||
INFO_LOG(m_logger) << " setFilterForBldgState for '" << bldgName << "' to " << m_bldgIdToFilter;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -307,13 +307,13 @@ bool ModuleTestExplosionCluster::checkSingleEffects(uint idx, const LtsCoordTran
|
||||
|
||||
if (se.singleEffectTime() < 1000)
|
||||
{
|
||||
ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": singleEffectTime failed, SingleEffect = " << se;
|
||||
ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": singleEffectTime failed, SingleEffect = " << se;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (se.zPlacement() != zPlace)
|
||||
{
|
||||
ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": zPlacement failed, SingleEffect = " << se;
|
||||
ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": zPlacement failed, SingleEffect = " << se;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -322,9 +322,9 @@ bool ModuleTestExplosionCluster::checkSingleEffects(uint idx, const LtsCoordTran
|
||||
|
||||
if (dist3D > maxDist3D)
|
||||
{
|
||||
ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": position failed, dist3D = " << dist3D;
|
||||
ERROR_LOG() << " idx = " << idx << ", Impact IST = " << ltsPos;
|
||||
ERROR_LOG() << " idx = " << idx << ", Impact SHD = " << coord;
|
||||
ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": position failed, dist3D = " << dist3D;
|
||||
ERROR_LOG(m_logger) << " idx = " << idx << ", Impact IST = " << ltsPos;
|
||||
ERROR_LOG(m_logger) << " idx = " << idx << ", Impact SHD = " << coord;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ bool ModuleTestExplosionCluster::waitForData(const std::function<bool ()> &func,
|
||||
|
||||
for (int i = 0; i < retryCount; ++i)
|
||||
{
|
||||
TRACE_LOG() << " waitForData - i: " << i;
|
||||
TRACE_LOG(m_logger) << " waitForData - i: " << i;
|
||||
if (func())
|
||||
return true;
|
||||
QTest::qWait(100);
|
||||
@@ -636,9 +636,9 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName)
|
||||
int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionCluster &eaData)
|
||||
{
|
||||
if (eaData.effectStart().is_set())
|
||||
INFO_LOG() << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString();
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString();
|
||||
else
|
||||
INFO_LOG() << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
FlightCurve fc;
|
||||
if (eaData.flightCurve().is_set())
|
||||
@@ -686,9 +686,9 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC
|
||||
int ModuleTestExplosionCluster::doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request)
|
||||
{
|
||||
if (request.effectStart().is_set())
|
||||
INFO_LOG() << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart().get()).toString();
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart().get()).toString();
|
||||
else
|
||||
INFO_LOG() << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set ";
|
||||
|
||||
int ret = m_aesFtc->explosionClusterSingleEffectOnlyModifyRequest(request, this);
|
||||
return ret;
|
||||
@@ -711,32 +711,32 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }, 1))
|
||||
{
|
||||
ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
@@ -762,14 +762,14 @@ void ModuleTestExplosionCluster::setupParticipants()
|
||||
QPointF pos = utmPos.geographic();
|
||||
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedPositionRequest(req, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,14 +782,14 @@ void ModuleTestExplosionCluster::setupParticipants()
|
||||
QPointF pos = utmPos.geographic();
|
||||
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedPositionRequest(req, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,14 +808,14 @@ void ModuleTestExplosionCluster::setupParticipants()
|
||||
QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}"));
|
||||
req_SSPF.formation( prop.toStdString() );
|
||||
|
||||
INFO_LOG() << " SetSimulatedParticipantFormation ... req = " << req_SSPF ;
|
||||
INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ;
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedParticipantFormationRequest(req_SSPF, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -832,18 +832,18 @@ void ModuleTestExplosionCluster::setupParticipants()
|
||||
QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}"));
|
||||
req_SSPF.formation( prop.toStdString() );
|
||||
|
||||
INFO_LOG() << " SetSimulatedParticipantFormation ... req = " << req_SSPF ;
|
||||
INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ;
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedParticipantFormationRequest(req_SSPF, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...DONE";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...DONE";
|
||||
}
|
||||
|
||||
bool ModuleTestExplosionCluster::checkParticipant_5()
|
||||
@@ -852,7 +852,7 @@ bool ModuleTestExplosionCluster::checkParticipant_5()
|
||||
const int partId = 5;
|
||||
const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId);
|
||||
QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat());
|
||||
INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
|
||||
return mgrsStr == QStringLiteral("32U PD 76900 18000");
|
||||
}
|
||||
@@ -863,7 +863,7 @@ bool ModuleTestExplosionCluster::checkParticipant_6()
|
||||
const int partId = 6;
|
||||
const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId);
|
||||
QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat());
|
||||
INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
|
||||
return mgrsStr == QStringLiteral("32U PD 76000 19000");
|
||||
}
|
||||
@@ -877,12 +877,12 @@ bool ModuleTestExplosionCluster::checkParticipant_89()
|
||||
const LtsUtils::QPoint3D ¢erCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger);
|
||||
if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x()))
|
||||
{
|
||||
WARNING_LOG() << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(centerCoordGeo.x(), centerCoordGeo.y());
|
||||
INFO_LOG() << " for unit with partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
INFO_LOG(m_logger) << " for unit with partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
|
||||
return mgrsStr == QStringLiteral("32U PD 50000 18000");
|
||||
}
|
||||
@@ -896,12 +896,12 @@ bool ModuleTestExplosionCluster::checkParticipant_99()
|
||||
const LtsUtils::QPoint3D ¢erCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger);
|
||||
if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x()))
|
||||
{
|
||||
WARNING_LOG() << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
|
||||
WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(centerCoordGeo.x(), centerCoordGeo.y());
|
||||
INFO_LOG() << " for unit with partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
INFO_LOG(m_logger) << " for unit with partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
|
||||
return mgrsStr == QStringLiteral("32U PD 01000 18000");
|
||||
}
|
||||
@@ -954,7 +954,7 @@ void ModuleTestExplosionCluster::resetBldgs()
|
||||
for (int bldgId : std::as_const(bldgIds))
|
||||
{
|
||||
const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState();
|
||||
INFO_LOG() << "resetBldgs: bldgId " << bldgId
|
||||
INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId
|
||||
<< ", state= " << bldgState
|
||||
<< ", bldgName= " << m_bldgIdToName[bldgId];
|
||||
QVERIFY2(bldgState.underlying()==ProjectDataManagement::VulnerabilityState_def::CombatReady, "ERROR, bldgState failed!!");
|
||||
@@ -1016,14 +1016,14 @@ void ModuleTestExplosionCluster::initTestCase()
|
||||
QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!");
|
||||
if (!bInit)
|
||||
{
|
||||
ERROR_LOG() << " ERROR, ddsConnector.init failed!!";
|
||||
ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!";
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << " ddsConnector.init successfull";
|
||||
INFO_LOG(m_logger) << " ddsConnector.init successfull";
|
||||
|
||||
// cmd
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
//
|
||||
// Aes
|
||||
@@ -1215,16 +1215,16 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_00()
|
||||
|
||||
|
||||
double rot = 0;
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
rot = 1;
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
rot = 30;
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
rot = 60;
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
|
||||
rot = -30;
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90);
|
||||
}
|
||||
|
||||
void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
|
||||
@@ -1259,7 +1259,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
|
||||
QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!");
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat());
|
||||
DEBUG_LOG() << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs();
|
||||
DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs();
|
||||
QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!");
|
||||
|
||||
//
|
||||
@@ -1269,19 +1269,19 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
|
||||
const int simId = m_data.id();
|
||||
AreaEffectSimulation::AesItemView itemView;
|
||||
|
||||
DEBUG_LOG() << " TNE VERIFICATION: simId = " << simId;
|
||||
DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId;
|
||||
|
||||
const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView);
|
||||
|
||||
QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!");
|
||||
QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!");
|
||||
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
const double rot = m_data.area().rotation();
|
||||
const double rotSfmOrg = compassToMathAngleForSfm(rot);
|
||||
const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:"
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:"
|
||||
<< " randomNumber = ????????"
|
||||
<< ", width=" << m_data.area().width()
|
||||
<< ", height=" << m_data.area().height()
|
||||
@@ -1295,7 +1295,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01()
|
||||
for (const Core::GeoPosition &geoCoord : std::as_const(formRef))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat());
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
@@ -1358,7 +1358,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
|
||||
QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!");
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat());
|
||||
DEBUG_LOG() << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs();
|
||||
DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs();
|
||||
QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!");
|
||||
|
||||
//
|
||||
@@ -1368,19 +1368,19 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
|
||||
const int simId = m_data.id();
|
||||
AreaEffectSimulation::AesItemView itemView;
|
||||
|
||||
DEBUG_LOG() << " TNE VERIFICATION: simId = " << simId;
|
||||
DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId;
|
||||
|
||||
const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView);
|
||||
|
||||
QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!");
|
||||
QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!");
|
||||
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
const double rot = m_data.area().rotation();
|
||||
const double rotSfmOrg = compassToMathAngleForSfm(rot);
|
||||
const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90);
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:"
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:"
|
||||
<< " randomNumber = ????????"
|
||||
<< ", width=" << m_data.area().width()
|
||||
<< ", height=" << m_data.area().height()
|
||||
@@ -1394,7 +1394,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02()
|
||||
for (const Core::GeoPosition &geoCoord : std::as_const(formRef))
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat());
|
||||
INFO_LOG() << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
@@ -1960,14 +1960,14 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }, 1))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, 2))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id();
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1991,15 +1991,15 @@ void ModuleTestExplosionCluster::test_remove_effect_start()
|
||||
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting to make sure, that next step is never reached:";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting to make sure, that next step is never reached:";
|
||||
if (waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, 60))
|
||||
{
|
||||
ERROR_LOG() << "Next step is accidentically reached of explosion cluster with id " << m_data.id();
|
||||
ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id();
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " object effectState: " << m_data.effectStateId();
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " object effectState: " << m_data.effectStateId();
|
||||
QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated, "ERROR, ExplosionCluster in wrong state");
|
||||
dumpCnt();
|
||||
|
||||
@@ -2298,7 +2298,7 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on
|
||||
|
||||
const QPointF impactPointF(0.20256382834808495, 0.9161105453111705);
|
||||
request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y()));
|
||||
INFO_LOG() << Q_FUNC_INFO << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs();
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs();
|
||||
|
||||
request.chargeTypeId(371);
|
||||
request.externalId(815);
|
||||
@@ -2701,9 +2701,9 @@ void ModuleTestExplosionCluster::cleanupTestCase()
|
||||
// finish last (dds) calls:
|
||||
waitForData([]() { return false; }, 10);
|
||||
|
||||
INFO_LOG() << " ddsConnector destroy...";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...";
|
||||
m_ddsConnector.reset();
|
||||
INFO_LOG() << " ddsConnector destroy...DONE";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...DONE";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
@@ -59,6 +59,8 @@ public:
|
||||
ModuleTestExplosionCluster(int domainId, int exerciseId);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
+8
-8
@@ -596,7 +596,7 @@ bool ModuleTestLimits::waitForData(const std::function<bool ()> &func, int retry
|
||||
|
||||
for (int i = 0; i < retryCount; ++i)
|
||||
{
|
||||
TRACE_LOG() << " waitForData - i: " << i;
|
||||
TRACE_LOG(m_logger) << " waitForData - i: " << i;
|
||||
if (func())
|
||||
return true;
|
||||
QTest::qWait(100);
|
||||
@@ -860,14 +860,14 @@ void ModuleTestLimits::initTestCase()
|
||||
QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!");
|
||||
if (!bInit)
|
||||
{
|
||||
ERROR_LOG() << " ERROR, ddsConnector.init failed!!";
|
||||
ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!";
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << " ddsConnector.init successfull";
|
||||
INFO_LOG(m_logger) << " ddsConnector.init successfull";
|
||||
|
||||
// cmd
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
//
|
||||
// Aes
|
||||
@@ -1126,9 +1126,9 @@ void ModuleTestLimits::cleanupTestCase()
|
||||
// finish last (dds) calls:
|
||||
waitForData([]() { return false; }, 10);
|
||||
|
||||
INFO_LOG() << " ddsConnector destroy...";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...";
|
||||
m_ddsConnector.reset();
|
||||
INFO_LOG() << " ddsConnector destroy...DONE";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...DONE";
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1147,14 +1147,14 @@ void ModuleTestLimits::setupParticipant()
|
||||
req.onlyOutdatedParticipants(false);
|
||||
req.position(Core::GeoPosition(m_partPos.lon(), m_partPos.lat(), 0.0));
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedPositionRequest(req, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return !m_replyError; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
|
||||
QVERIFY2(m_replyError == false, "ERROR, setupParticipant failed");
|
||||
|
||||
+2
-2
@@ -242,9 +242,9 @@ public:
|
||||
void onSetSimulatedPositionReply(const Core::FunctionReplyObject &reply) override
|
||||
{
|
||||
m_replyError = reply.error();
|
||||
DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
if (!reply.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << reply.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << reply.translated();
|
||||
}
|
||||
|
||||
// ChargeAdministrationModifyReplyHandler interface
|
||||
|
||||
+47
-47
@@ -79,39 +79,39 @@ ModuleTestAesOthers::ModuleTestAesOthers(int domainId, int exerciseId)
|
||||
void ModuleTestAesOthers::onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onBoobyTrapModifyReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onBoobyTrapModifyReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onBoobyTrapModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onBoobyTrapModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::onBoobyTrapRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << " got reply - onBoobyTrapRemoveReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onBoobyTrapRemoveReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onBoobyTrapRemoveReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onBoobyTrapRemoveReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
m_replyError = replyObject.error();
|
||||
DEBUG_LOG() << " got reply - onOffRouteMineModifyReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onOffRouteMineModifyReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onOffRouteMineModifyReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onOffRouteMineModifyReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::onOffRouteMineRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << " got reply - onOffRouteMineRemoveReply : " << m_replyError;
|
||||
DEBUG_LOG(m_logger) << " got reply - onOffRouteMineRemoveReply : " << m_replyError;
|
||||
if (!replyObject.str().empty())
|
||||
ERROR_LOG() << " got reply - onOffRouteMineRemoveReply: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << " got reply - onOffRouteMineRemoveReply: " << replyObject.translated();
|
||||
}
|
||||
|
||||
|
||||
@@ -128,10 +128,10 @@ void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModificati
|
||||
if (m_dataBoobyTrap.effectStart().is_set())
|
||||
startTimeMsec = m_dataBoobyTrap.effectStart().get();
|
||||
|
||||
DEBUG_LOG() << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id() << ", state=" << m_dataBoobyTrap.effectStateId()
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id() << ", state=" << m_dataBoobyTrap.effectStateId()
|
||||
<< ", startTimeMsec=" << startTimeMsec
|
||||
<< ", cntBoobyTrap=" << m_counterDds.cntBoobyTrap;
|
||||
TRACE_LOG() << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap;
|
||||
TRACE_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap;
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModification modType)
|
||||
@@ -147,10 +147,10 @@ void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModi
|
||||
if (m_dataOffRouteMine.effectStart().is_set())
|
||||
startTimeMsec = m_dataOffRouteMine.effectStart().get();
|
||||
|
||||
DEBUG_LOG() << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id() << ", state=" << m_dataOffRouteMine.effectStateId()
|
||||
DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id() << ", state=" << m_dataOffRouteMine.effectStateId()
|
||||
<< ", startTimeMsec=" << startTimeMsec
|
||||
<< ", cntOffRouteMine=" << m_counterDds.cntOffRouteMine;
|
||||
TRACE_LOG() << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine;
|
||||
TRACE_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D
|
||||
return;
|
||||
|
||||
AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying();
|
||||
DEBUG_LOG() << " got onAesItemViewChanged, aesType=" << aesType;
|
||||
DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType;
|
||||
|
||||
switch (aesType)
|
||||
{
|
||||
@@ -197,7 +197,7 @@ bool ModuleTestAesOthers::waitForData(const std::function<bool ()> &func, int re
|
||||
|
||||
for (int i = 0; i < retryCount; ++i)
|
||||
{
|
||||
DEBUG_LOG() << " waitForData - i: " << i;
|
||||
DEBUG_LOG(m_logger) << " waitForData - i: " << i;
|
||||
if (func())
|
||||
return true;
|
||||
QTest::qWait(100);
|
||||
@@ -210,23 +210,23 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }, 1))
|
||||
{
|
||||
ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
@@ -234,10 +234,10 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int
|
||||
|
||||
if (durExp > 0)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
@@ -250,23 +250,23 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }, 1))
|
||||
{
|
||||
ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber;
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared...";
|
||||
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated...";
|
||||
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
@@ -274,10 +274,10 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
|
||||
|
||||
if (durExp > 0)
|
||||
{
|
||||
INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired...";
|
||||
if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp))
|
||||
{
|
||||
ERROR_LOG() << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id()
|
||||
<< ", lineNumber = " << lineNumber;
|
||||
QVERIFY2(false, "ERROR, exit");
|
||||
return;
|
||||
@@ -288,7 +288,7 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in
|
||||
|
||||
void ModuleTestAesOthers::setupParticipants()
|
||||
{
|
||||
INFO_LOG() << " setupParticipant ...";
|
||||
INFO_LOG(m_logger) << " setupParticipant ...";
|
||||
|
||||
QVERIFY2(m_ppmFtc, "ERROR, no m_ppmFtc");
|
||||
|
||||
@@ -304,18 +304,18 @@ void ModuleTestAesOthers::setupParticipants()
|
||||
QPointF pos = utmPos.geographic();
|
||||
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedPositionRequest(req, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
}
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...DONE";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...DONE";
|
||||
}
|
||||
|
||||
bool ModuleTestAesOthers::checkParticipant_18()
|
||||
@@ -324,7 +324,7 @@ bool ModuleTestAesOthers::checkParticipant_18()
|
||||
const int partId = 18;
|
||||
const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId);
|
||||
QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat());
|
||||
INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr;
|
||||
|
||||
return mgrsStr == QStringLiteral("32U PD 76900 18100");
|
||||
}
|
||||
@@ -392,17 +392,17 @@ int ModuleTestAesOthers::doMoveParticipant(int participantId, const QString &new
|
||||
QPointF pos = utmPos.geographic();
|
||||
req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0));
|
||||
|
||||
INFO_LOG() << " setSimulatedPositionRequest ...";
|
||||
INFO_LOG(m_logger) << " setSimulatedPositionRequest ...";
|
||||
m_replyError = true;
|
||||
m_ppmFtc->setSimulatedPositionRequest(req, this);
|
||||
|
||||
// expected condition:
|
||||
if (!waitForData([this]() { return m_replyError == false; }))
|
||||
{
|
||||
ERROR_LOG() << "Error on request";
|
||||
ERROR_LOG(m_logger) << "Error on request";
|
||||
}
|
||||
}
|
||||
INFO_LOG() << " doMoveParticipant ...DONE";
|
||||
INFO_LOG(m_logger) << " doMoveParticipant ...DONE";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -423,14 +423,14 @@ void ModuleTestAesOthers::initTestCase()
|
||||
QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!");
|
||||
if (!bInit)
|
||||
{
|
||||
ERROR_LOG() << " ERROR, ddsConnector.init failed!!";
|
||||
ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!";
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << " ddsConnector.init successfull";
|
||||
INFO_LOG(m_logger) << " ddsConnector.init successfull";
|
||||
|
||||
// cmd
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
INFO_LOG() << " ddsConnector.initPublisherSubscriber done";
|
||||
INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done";
|
||||
|
||||
//
|
||||
// Aes
|
||||
@@ -610,7 +610,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name,
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId
|
||||
<< ", name =" << name << "'"
|
||||
<< ", impactCoord= " << impactCoord.mgrs()
|
||||
<< ", rotationAngle = " << rotationAngle
|
||||
@@ -666,7 +666,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name,
|
||||
|
||||
// wait to let it disappear:
|
||||
waitForData([]() { return false; }, 15);
|
||||
INFO_LOG() << Q_FUNC_INFO << " END"
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " END"
|
||||
<< ", name =" << name << "'"
|
||||
<< ", impactCoord= " << impactCoord.mgrs()
|
||||
<< ", rotationAngle = " << rotationAngle
|
||||
@@ -713,7 +713,7 @@ void ModuleTestAesOthers::test_offRouteMine_02()
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId;
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId;
|
||||
|
||||
QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!");
|
||||
|
||||
@@ -767,7 +767,7 @@ void ModuleTestAesOthers::test_offRouteMine_02()
|
||||
|
||||
// wait to let it disappear:
|
||||
waitForData([]() { return false; }, 15);
|
||||
INFO_LOG() << Q_FUNC_INFO << " END" << ", name =" << orm.name() << "'";
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << ", name =" << orm.name() << "'";
|
||||
}
|
||||
|
||||
void ModuleTestAesOthers::cleanupTestCase()
|
||||
@@ -775,9 +775,9 @@ void ModuleTestAesOthers::cleanupTestCase()
|
||||
// finish last (dds) calls:
|
||||
waitForData([]() { return false; }, 10);
|
||||
|
||||
INFO_LOG() << " ddsConnector destroy...";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...";
|
||||
m_ddsConnector.reset();
|
||||
INFO_LOG() << " ddsConnector destroy...DONE";
|
||||
INFO_LOG(m_logger) << " ddsConnector destroy...DONE";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
@@ -54,6 +54,8 @@ public:
|
||||
ModuleTestAesOthers(int domainId, int exerciseId);
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
void onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
+10
-10
@@ -54,11 +54,11 @@ bool ConvertMineArea::init(int exerciseId)
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
ERROR_LOG() << "Error opening db, exiting..";
|
||||
ERROR_LOG(m_logger) << "Error opening db, exiting..";
|
||||
return false;
|
||||
}
|
||||
|
||||
ERROR_LOG() << "Database open";
|
||||
ERROR_LOG(m_logger) << "Database open";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -81,15 +81,15 @@ bool ConvertMineArea::initDBInternal()
|
||||
QSqlDriver *driver = m_dbConnection.driver();
|
||||
if (!driver)
|
||||
{
|
||||
WARNING_LOG() << "No SQL driver loaded - no database available!";
|
||||
WARNING_LOG(m_logger) << "No SQL driver loaded - no database available!";
|
||||
return false;
|
||||
}
|
||||
const QString driverName = m_dbConnection.driverName();
|
||||
DEBUG_LOG() << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
DEBUG_LOG(m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
<< ", schema: " << schemaName() << ", used driver: " << driverName;
|
||||
if (!m_dbConnection.isOpen())
|
||||
{
|
||||
WARNING_LOG() << "Database connection is no open - can not initialize database interface";
|
||||
WARNING_LOG(m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
return false;
|
||||
}
|
||||
if (driverName == QLatin1String("QSQLITE"))
|
||||
@@ -189,9 +189,9 @@ bool ConvertMineArea::tryConvertMineArea()
|
||||
|
||||
data.endPosition = endPositionUtm.geographic();
|
||||
|
||||
DEBUG_LOG() << "aesId: " << data.mineAreaId << ", id: " << data.id;
|
||||
DEBUG_LOG() << "EndpositionUtm: x: " << endPositionUtm.x << ", y: " << endPositionUtm.y;
|
||||
DEBUG_LOG() << "Geographic: x: " << data.endPosition.x() << " y: " << data.endPosition.y();
|
||||
DEBUG_LOG(m_logger) << "aesId: " << data.mineAreaId << ", id: " << data.id;
|
||||
DEBUG_LOG(m_logger) << "EndpositionUtm: x: " << endPositionUtm.x << ", y: " << endPositionUtm.y;
|
||||
DEBUG_LOG(m_logger) << "Geographic: x: " << data.endPosition.x() << " y: " << data.endPosition.y();
|
||||
|
||||
vecMineArea.append(data);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ bool ConvertMineArea::tryConvertMineArea()
|
||||
if (!m_query->prepare(stmt3))
|
||||
{
|
||||
m_lastError = m_query->lastError();
|
||||
ERROR_LOG() << "lastError: " << m_lastError.text();
|
||||
ERROR_LOG(m_logger) << "lastError: " << m_lastError.text();
|
||||
return false;
|
||||
}
|
||||
for ( const Database::AesMineAreaSegment &mineAreaSegment : vecMineArea)
|
||||
@@ -216,7 +216,7 @@ bool ConvertMineArea::tryConvertMineArea()
|
||||
if (!m_query->exec(m_bEmitMessageOnError))
|
||||
{
|
||||
m_lastError = m_query->lastError();
|
||||
ERROR_LOG() << "lastError: " << m_lastError.text();
|
||||
ERROR_LOG(m_logger) << "lastError: " << m_lastError.text();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
@@ -47,6 +47,8 @@ public:
|
||||
QSqlError getLastError() const;
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
QSqlDatabase m_dbConnection;
|
||||
NSqlQuery *m_query;
|
||||
QSqlError m_lastError;
|
||||
|
||||
+18
-18
@@ -29,7 +29,7 @@ TestBase::TestBase(const char *loggerName, QObject *parent)
|
||||
|
||||
bool TestBase::init(int domainId, int exerciseId, int testId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
m_testId = testId;
|
||||
|
||||
// initialize DDS
|
||||
@@ -38,15 +38,15 @@ bool TestBase::init(int domainId, int exerciseId, int testId)
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
INFO_LOG() << "init create ftc";
|
||||
INFO_LOG(m_logger) << "init create ftc";
|
||||
m_ftc = AreaEffectSimulation::Interface::Ftc::create(m_ddsConnector);
|
||||
INFO_LOG() << "init init ftc";
|
||||
INFO_LOG(m_logger) << "init init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
|
||||
m_dtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsConnector);
|
||||
bRet = bRet && m_dtc->enableAll();
|
||||
|
||||
INFO_LOG() << "init end - bRet = " << bRet;
|
||||
INFO_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -67,27 +67,27 @@ bool TestBase::checkAesItem(const AreaEffectSimulation::AesItem &a,
|
||||
{
|
||||
if (a.name() != b.name())
|
||||
{
|
||||
WARNING_LOG() << "name does not match: " << a.name() << " - " << b.name();
|
||||
WARNING_LOG(m_logger) << "name does not match: " << a.name() << " - " << b.name();
|
||||
return false;
|
||||
}
|
||||
if (a.effectStart() != b.effectStart())
|
||||
{
|
||||
WARNING_LOG() << "effectStart does not match: " << a.effectStart() << " - " << b.effectStart();
|
||||
WARNING_LOG(m_logger) << "effectStart does not match: " << a.effectStart() << " - " << b.effectStart();
|
||||
return false;
|
||||
}
|
||||
if (a.chargeStruct().chargeTypeId() != b.chargeStruct().chargeTypeId())
|
||||
{
|
||||
WARNING_LOG() << "chargeTypeId does not match: " << a.chargeStruct().chargeTypeId() << " - " << b.chargeStruct().chargeTypeId();
|
||||
WARNING_LOG(m_logger) << "chargeTypeId does not match: " << a.chargeStruct().chargeTypeId() << " - " << b.chargeStruct().chargeTypeId();
|
||||
return false;
|
||||
}
|
||||
if (a.partyId() != b.partyId())
|
||||
{
|
||||
WARNING_LOG() << "partyId does not match: " << a.partyId() << " - " << b.partyId();
|
||||
WARNING_LOG(m_logger) << "partyId does not match: " << a.partyId() << " - " << b.partyId();
|
||||
return false;
|
||||
}
|
||||
if (a.participantId() != b.participantId())
|
||||
{
|
||||
WARNING_LOG() << "participantId does not match: " << a.participantId() << " - " << b.participantId();
|
||||
WARNING_LOG(m_logger) << "participantId does not match: " << a.participantId() << " - " << b.participantId();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -95,19 +95,19 @@ bool TestBase::checkAesItem(const AreaEffectSimulation::AesItem &a,
|
||||
|
||||
void TestBase::failExit()
|
||||
{
|
||||
ERROR_LOG() << "fail exit!";
|
||||
ERROR_LOG(m_logger) << "fail exit!";
|
||||
m_bTestsSuccessful = false;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
void TestBase::onAesCreateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got create " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got create " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
<< ", error = " << replyObject.error()
|
||||
<< " and errorString = '" << replyObject.translated() << "'";
|
||||
m_replyError = replyObject.error();
|
||||
if (m_replyError && !m_bExpectedFailure)
|
||||
ERROR_LOG() << "Got create " << m_aesTypeName << " reply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got create " << m_aesTypeName << " reply error: " << replyObject();
|
||||
else
|
||||
m_expectedAesId = replyObject.id(); // only works as expected because reply is sent before publishing data occours
|
||||
}
|
||||
@@ -116,34 +116,34 @@ void TestBase::onAesModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (m_expectedAesId != replyObject.id())
|
||||
return;
|
||||
INFO_LOG() << "Got modify " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modify " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
<< ", error = " << replyObject.error()
|
||||
<< " and errorString = '" << replyObject.translated() << "'";
|
||||
m_replyError = replyObject.error();
|
||||
if (m_replyError && !m_bExpectedFailure)
|
||||
ERROR_LOG() << "Got modify " << m_aesTypeName << " reply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got modify " << m_aesTypeName << " reply error: " << replyObject();
|
||||
else
|
||||
m_expectedAesId = replyObject.id();
|
||||
}
|
||||
|
||||
void TestBase::onAesRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got remove " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
m_replyError = replyObject.error();
|
||||
if (m_replyError && !m_bExpectedFailure)
|
||||
ERROR_LOG() << "Got remove " << m_aesTypeName << " reply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply error: " << replyObject();
|
||||
else
|
||||
m_expectedAesId = replyObject.id();
|
||||
}
|
||||
|
||||
void TestBase::onAesTriggerReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got trigger " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got trigger " << m_aesTypeName << " reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
m_replyError = replyObject.error();
|
||||
if (m_replyError && !m_bExpectedFailure)
|
||||
ERROR_LOG() << "Got remove " << m_aesTypeName << " reply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply error: " << replyObject();
|
||||
else
|
||||
m_expectedAesId = replyObject.id();
|
||||
}
|
||||
|
||||
+3
-3
@@ -46,17 +46,17 @@ protected:
|
||||
template <typename T>
|
||||
void onAesChanged(const T &dataIn, DataModification modType, T &dataOut)
|
||||
{
|
||||
INFO_LOG() << "Got " << m_aesTypeName << " with mod type " << (int)modType
|
||||
INFO_LOG(m_logger) << "Got " << m_aesTypeName << " with mod type " << (int)modType
|
||||
<< ", id: " << dataIn.id() << ", chargeType: " << dataIn.chargeStruct().chargeTypeId()
|
||||
<< ", effectState: " << dataIn.effectStateId();
|
||||
if (m_expectedAesId == dataIn.id())
|
||||
{
|
||||
DEBUG_LOG() << "Expected aes id - updating data for " << m_aesTypeName;
|
||||
DEBUG_LOG(m_logger) << "Expected aes id - updating data for " << m_aesTypeName;
|
||||
dataOut = dataIn;
|
||||
}
|
||||
if (modType == DataModification::eRemoved && dataOut.id() == dataIn.id())
|
||||
{
|
||||
DEBUG_LOG() << "Removed " << m_aesTypeName << " with id " << dataIn.id();
|
||||
DEBUG_LOG(m_logger) << "Removed " << m_aesTypeName << " with id " << dataIn.id();
|
||||
m_expectedAesId = dataIn.id();
|
||||
}
|
||||
}
|
||||
|
||||
+61
-61
@@ -83,8 +83,8 @@ void UnitTestTrajectory::test_duration()
|
||||
|
||||
posEnd = LtsUtils::QPoint3D(10000, 0, 0);
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
QVERIFY2(qFuzzyCompare(duration, 28.55686245854129), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.80338497797008), "beta failed");
|
||||
QVERIFY2(qFuzzyCompare(vOut, 377.1213082434484), "v failed");
|
||||
@@ -93,8 +93,8 @@ void UnitTestTrajectory::test_duration()
|
||||
posEnd = LtsUtils::QPoint3D(10000, 0, 10);
|
||||
// ^^
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
QVERIFY2(qFuzzyCompare(duration, 28.48529092398576), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.75384726032234), "beta failed");
|
||||
QVERIFY2(qFuzzyCompare(vOut, 377.9382777961657), "v failed");
|
||||
@@ -130,8 +130,8 @@ void UnitTestTrajectory::test_calcDuration()
|
||||
double duration;
|
||||
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 4.515236409857309), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed");
|
||||
@@ -149,15 +149,15 @@ void UnitTestTrajectory::test_calcDuration2()
|
||||
for (peakHeightAbs = 5; peakHeightAbs < 12; ++peakHeightAbs)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
|
||||
{ // Low
|
||||
peakHeightAbs = 8;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 2.554203427256403), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 17.74467162505693), "beta failed"); // 18.9 ??
|
||||
@@ -167,14 +167,14 @@ void UnitTestTrajectory::test_calcDuration2()
|
||||
for (peakHeightAbs = 71; peakHeightAbs < 79; ++peakHeightAbs)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
{ // High
|
||||
peakHeightAbs = 73;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 7.715639359362986), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 71.09542415738834), "beta failed");
|
||||
@@ -195,8 +195,8 @@ void UnitTestTrajectory::test_calcPeak()
|
||||
double peakHeightAbs;
|
||||
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG() << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG(m_logger) << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(peakHeightAbs, 25), "peakHeight failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed");
|
||||
@@ -215,8 +215,8 @@ void UnitTestTrajectory::test_calcPeak2()
|
||||
double peakHeightAbs;
|
||||
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG() << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG(m_logger) << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
// eightAbs 122.625, beta [deg] 78.47682271026333, v 50.0589902015612 (ctory/trajectory_unit_test.cpp:178)
|
||||
QVERIFY2(qFuzzyCompare(peakHeightAbs, 122.625), "peakHeight failed");
|
||||
@@ -241,13 +241,13 @@ void UnitTestTrajectory::test_calcPeak3_continuity()
|
||||
const int flightDurationMax = 50;
|
||||
const int flightDurationIncrement = 1;
|
||||
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos;
|
||||
|
||||
for (int curFD = flightDurationMin; curFD <= flightDurationMax; curFD += flightDurationIncrement)
|
||||
{
|
||||
double time = curFD;
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut;
|
||||
INFO_LOG(m_logger) << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut;
|
||||
} // for
|
||||
}
|
||||
|
||||
@@ -346,20 +346,20 @@ void UnitTestTrajectory::test_calcDuration_realistic40km()
|
||||
double duration;
|
||||
int peakHeightAbs;
|
||||
|
||||
INFO_LOG() << "Loop: START";
|
||||
INFO_LOG(m_logger) << "Loop: START";
|
||||
for (peakHeightAbs = 500; peakHeightAbs <= 3000; peakHeightAbs+=250)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
INFO_LOG() << "Loop: END";
|
||||
INFO_LOG(m_logger) << "Loop: END";
|
||||
|
||||
// Als realistisch stugen wir mal eine Geschwindigkeit von 1000m/s ein:
|
||||
peakHeightAbs = 2000;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 40.38550218769218 ), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 11.30993247402021), "beta failed");
|
||||
@@ -380,8 +380,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 1000m
|
||||
{
|
||||
duration1 = TrajectoryHelper::flightDurationSec(posStart, endPos1, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration1, 10.01527884771829), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 26.19718605846828), "beta failed");
|
||||
@@ -391,8 +391,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 2000m
|
||||
{
|
||||
duration2 = TrajectoryHelper::flightDurationSec(posStart, endPos2, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration2, 10.01527884771829), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 13.82033952701046), "beta failed");
|
||||
@@ -403,8 +403,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 2000m, 99m
|
||||
{
|
||||
duration3 = TrajectoryHelper::flightDurationSec(posStart, endPos3, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration3, 7.219644478296471 ), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 10.05585466470648 ), "beta failed");
|
||||
@@ -438,9 +438,9 @@ void UnitTestTrajectory::test_calcDuration_downToZero()
|
||||
|
||||
peakHeightAbs = 123;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut, &reason);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> reason '" << reason << "'";
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> reason '" << reason << "'";
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 7.347880052033394), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 14.18247037775737), "beta failed"); // 18.9 ??
|
||||
@@ -509,7 +509,7 @@ void UnitTestTrajectory::test_realStartPoint()
|
||||
|
||||
LtsUtils::QPoint3D realStartPoint = TrajectoryHelper::realStartPoint(apo, idealHit);
|
||||
|
||||
ERROR_LOG() << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint;
|
||||
ERROR_LOG(m_logger) << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint;
|
||||
QVERIFY2(qFuzzyCompare(realStartPoint, result), "realStartPoint failed");
|
||||
|
||||
// next step:
|
||||
@@ -517,8 +517,8 @@ void UnitTestTrajectory::test_realStartPoint()
|
||||
double duration;
|
||||
const double heightAbs = apo.z();
|
||||
duration = TrajectoryHelper::flightDurationSec(realStartPoint, idealHit, heightAbs, &betaOut, &vOut);
|
||||
ERROR_LOG() << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs;
|
||||
ERROR_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
ERROR_LOG(m_logger) << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs;
|
||||
ERROR_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), betaDeg), "flightDurationSec failed");
|
||||
}
|
||||
@@ -581,18 +581,18 @@ void UnitTestTrajectory::test_generateTrajectoryBiedziak()
|
||||
// check Scheitelpunkt / Apogaeum
|
||||
{
|
||||
const auto &item35 = trajectoryOut[35];
|
||||
INFO_LOG() << "iqtem35 = " << item35;
|
||||
INFO_LOG(m_logger) << "iqtem35 = " << item35;
|
||||
QVERIFY2(qFuzzyCompare(item35.z(), 148.044675655973), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
{
|
||||
// Hier ist der Scheitelpunkt:
|
||||
const auto &item36 = trajectoryOut[36];
|
||||
INFO_LOG() << "item36 = " << item36;
|
||||
INFO_LOG(m_logger) << "item36 = " << item36;
|
||||
QVERIFY2(qFuzzyCompare(item36.z(), 148.087567297406), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
{
|
||||
const auto &item37 = trajectoryOut[37];
|
||||
INFO_LOG() << "item37 = " << item37;
|
||||
INFO_LOG(m_logger) << "item37 = " << item37;
|
||||
QVERIFY2(qFuzzyCompare(item37.z(), 147.905786767084), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
}
|
||||
@@ -611,8 +611,8 @@ void UnitTestTrajectory::test_vulcano_beta_Abschusswinkel()
|
||||
const double betaRad = XY::calculateBetaRad(v0, height);
|
||||
const double betaDeg = betaRad * LtsCoordTrans::rad2deg();
|
||||
|
||||
INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(betaDeg, 29.99727415506499), "calculateBetaRad failed");
|
||||
}
|
||||
@@ -644,13 +644,13 @@ void UnitTestTrajectory::test_vulcano_apogaeumCosmos()
|
||||
const double betaRad = XY::calculateBetaRad(v0, height);
|
||||
const double betaDeg = betaRad * LtsCoordTrans::rad2deg();
|
||||
|
||||
INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaRad);
|
||||
|
||||
INFO_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG() << " -> apo " << apo;
|
||||
INFO_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << " -> apo " << apo;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(apo.x(), 50 ), "calculateBetaRad/calculateApogaeum failed"); // 100m / 2.0
|
||||
QVERIFY2(qFuzzyCompare(apo.y(), height), "calculateBetaRad/calculateApogaeum failed");
|
||||
@@ -691,15 +691,15 @@ void UnitTestTrajectory::test_vulcano_apogaeum()
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad());
|
||||
|
||||
const QVector2D apoDiff(apo - expectedAPO);
|
||||
DEBUG_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
DEBUG_LOG() << " -> apo " << apo << " diff = "<< apoDiff.length();
|
||||
DEBUG_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
DEBUG_LOG(m_logger) << " -> apo " << apo << " diff = "<< apoDiff.length();
|
||||
|
||||
QVERIFY2(apoDiff.length() < 1, "calculateApogaeum failed");
|
||||
|
||||
// und zurück:
|
||||
const double calcBetaRad = XY::calculateBetaRad(v0, expectedAPO.y());
|
||||
double betaDiff = fabs(calcBetaRad*LtsCoordTrans::rad2deg() - betaDeg);
|
||||
DEBUG_LOG() << " zurück: betaDiff = " << betaDiff;
|
||||
DEBUG_LOG(m_logger) << " zurück: betaDiff = " << betaDiff;
|
||||
|
||||
QVERIFY2(betaDiff < 0.001, "calculateBetaRad failed");
|
||||
}
|
||||
@@ -784,15 +784,15 @@ void UnitTestTrajectory::test_vulcano_tap()
|
||||
|
||||
const QPointF &tapRelToImpact = XY::calculateTapRelToIdealHit(vFall, alphaDeg*LtsCoordTrans::deg2rad(), tapT);
|
||||
|
||||
INFO_LOG() << "calculateTapRelToIdealHit with vFall = " << vFall
|
||||
INFO_LOG(m_logger) << "calculateTapRelToIdealHit with vFall = " << vFall
|
||||
<< ", alphaDeg = " << alphaDeg
|
||||
<< ", tapT = " << tapT;
|
||||
INFO_LOG() << " -> tapRelToImpact " << tapRelToImpact
|
||||
INFO_LOG(m_logger) << " -> tapRelToImpact " << tapRelToImpact
|
||||
<< " , lenght = " << QVector2D(tapRelToImpact).length();
|
||||
QVERIFY2((expectedLength - QVector2D(tapRelToImpact).length()) < 1, "calculateTapRelToIdealHit abs failed");
|
||||
|
||||
const QVector2D diff(tapRelToImpact - expectedTAP);
|
||||
INFO_LOG() << " -> diff.QVector2D.length = " << diff.length();
|
||||
INFO_LOG(m_logger) << " -> diff.QVector2D.length = " << diff.length();
|
||||
QVERIFY2(diff.length() < 0.1, "calculateTapRelToIdealHit rel failed");
|
||||
}
|
||||
|
||||
@@ -821,10 +821,10 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve()
|
||||
QFETCH(double, expectedDeltaTime);
|
||||
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad());
|
||||
INFO_LOG() << ", apo " << apo;
|
||||
INFO_LOG(m_logger) << ", apo " << apo;
|
||||
|
||||
const QVector2D diff(apo - expectedAPO);
|
||||
INFO_LOG() << ", diff " << diff.length();
|
||||
INFO_LOG(m_logger) << ", diff " << diff.length();
|
||||
QVERIFY2(diff.length() < 0.1, "calculateApogaeum rel failed");
|
||||
|
||||
//
|
||||
@@ -839,7 +839,7 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve()
|
||||
const QVector<QPointF> &phase1_bal = XY::generateBallisticCurveUntil(v0, betaDeg*LtsCoordTrans::deg2rad(),
|
||||
x_distancePhase1, secPerIntervall,
|
||||
&deltaXperStep_out, &secPerIntervall_out);
|
||||
INFO_LOG() << "generateBallisticCurveUntil: "
|
||||
INFO_LOG(m_logger) << "generateBallisticCurveUntil: "
|
||||
<< ", phase1_bal.size() = " << phase1_bal.size()
|
||||
<< ", phase1_bal.last() = " << std::setprecision(16) << phase1_bal.last()
|
||||
<< ", deltaXperStep_out = " << std::setprecision(16) << deltaXperStep_out
|
||||
@@ -957,10 +957,10 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
&reasonOut);
|
||||
|
||||
if (!reasonOut.isEmpty())
|
||||
ERROR_LOG() << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'";
|
||||
ERROR_LOG(m_logger) << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'";
|
||||
|
||||
|
||||
INFO_LOG() << "trajectoryVulcano: "
|
||||
INFO_LOG(m_logger) << "trajectoryVulcano: "
|
||||
<< ", ret = " << ret
|
||||
<< ", trajectoryOut.size() = " << trajectoryOut.size();
|
||||
|
||||
@@ -968,7 +968,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
QVERIFY2(trajectoryOut.size() == expectedSize, "trajectoryVulcano2 failed");
|
||||
|
||||
// const QPoint3D &apo3D = trajectoryOut[40]; // more or less wellknown
|
||||
// INFO_LOG() << "trajectoryVulcano: "
|
||||
// INFO_LOG(m_logger) << "trajectoryVulcano: "
|
||||
// << ", ret = " << ret
|
||||
// << ", trajectoryOut.size() = " << trajectoryOut.size()
|
||||
// << ", apo3D = " << apo3D;
|
||||
@@ -976,7 +976,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
// // recalculate to distance between apo and origin (on flat xy)
|
||||
// LtsUtils::QPoint3D apoToOrigin = apo3D - origin;
|
||||
// double xyDist = QVector2D(apoToOrigin.toPointF()).length();
|
||||
// INFO_LOG() << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist;
|
||||
// INFO_LOG(m_logger) << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist;
|
||||
|
||||
// QVERIFY2(fabs( 12248.0 - xyDist ) < 1, "generateBallisticCurveUntil3 failed");
|
||||
// QVERIFY2(fabs( 8127.0 + origin.z() - apo3D.z() ) < 1, "generateBallisticCurveUntil4 failed");
|
||||
@@ -993,7 +993,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
|
||||
int i=0;
|
||||
for (auto &item : std::as_const(trajectoryOut))
|
||||
INFO_LOG() << "i = " << i++ << ", item " << item;
|
||||
INFO_LOG(m_logger) << "i = " << i++ << ", item " << item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
@@ -77,4 +77,6 @@ private Q_SLOTS:
|
||||
// void cleanup();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
+15
-15
@@ -85,22 +85,22 @@ void TrajectoryGenerator::cleanup()
|
||||
|
||||
void TrajectoryGenerator::initElevation(LtsElevation::LtsElevationManager *ltsElevationManager)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_ltsElevationManager = ltsElevationManager;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
LtsElevation::LtsElevationManager *TrajectoryGenerator::getElevationManager()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return m_ltsElevationManager;
|
||||
}
|
||||
|
||||
bool TrajectoryGenerator::hasElevationManager() const
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return m_ltsElevationManager;
|
||||
}
|
||||
|
||||
@@ -268,14 +268,14 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
CONT_T &trajectoryOut)
|
||||
{
|
||||
// use zone of impact:
|
||||
INFO_LOG() << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y();
|
||||
INFO_LOG() << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y();
|
||||
INFO_LOG(m_logger) << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y();
|
||||
INFO_LOG(m_logger) << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &iPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition_geo.toPointF());
|
||||
const LtsCoordTrans::UtmCoordinate &oPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(originatorPosition_geo.toPointF(), iPosition.zone);
|
||||
|
||||
INFO_LOG() << " oPosition " << oPosition.mgrs();
|
||||
INFO_LOG() << " iPosition " << iPosition.mgrs();
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition.mgrs();
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition.mgrs();
|
||||
|
||||
const double distance = sqrt(pow(iPosition.x - oPosition.x, 2.) + pow(iPosition.y - oPosition.y, 2.));
|
||||
|
||||
@@ -287,18 +287,18 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
oHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(originatorPosition_geo.x(), originatorPosition_geo.y()) : 0;
|
||||
if (oHeight < 300)
|
||||
oHeight = 100;
|
||||
INFO_LOG() << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager...";
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager...";
|
||||
}
|
||||
if (std::isnan(iHeight) && m_ltsElevationManager)
|
||||
{
|
||||
iHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(impactPosition_geo.x(), impactPosition_geo.y()) : 0;
|
||||
if (iHeight < 300)
|
||||
iHeight = 100;
|
||||
INFO_LOG() << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. ";
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. ";
|
||||
}
|
||||
|
||||
INFO_LOG() << " oPosition " << oPosition << " ; oHeight=" << oHeight;
|
||||
INFO_LOG() << " iPosition " << iPosition << " ; iHeight=" << iHeight;
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition << " ; oHeight=" << oHeight;
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition << " ; iHeight=" << iHeight;
|
||||
|
||||
// z-Values:
|
||||
const QVector<double> &zValues = this->trajectoryBiedziak(distance, iHeight - oHeight, elevation_angle_degree);
|
||||
@@ -324,7 +324,7 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
p2D.x(), p2D.y(), oHeight + zValues[i]); // x, y, z
|
||||
} // for
|
||||
|
||||
//// DEBUG_LOG() << string4poly(geo);
|
||||
//// DEBUG_LOG(m_logger) << string4poly(geo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
@@ -89,6 +89,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
|
||||
QString *reasonOut);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
/*! \name Ideal trajectory */
|
||||
template <typename CONT_T>
|
||||
bool generateTrajectoryBiedziak(const LtsUtils::QPoint3D &originatorPosition_geo,
|
||||
@@ -97,6 +98,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
|
||||
CONT_T &trajectoryOut);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
explicit TrajectoryGenerator();
|
||||
|
||||
public:
|
||||
|
||||
+15
-15
@@ -45,31 +45,31 @@ bool FireAutomaton::init(int32_t time, TimeType type, int32_t rounds, const QVec
|
||||
{
|
||||
if(m_state != State::Stopped && m_state != State::Uninitialized)
|
||||
{
|
||||
ERROR_LOG() << " init failed - fire automaton must be in state unitialized or stopped.";
|
||||
ERROR_LOG(m_logger) << " init failed - fire automaton must be in state unitialized or stopped.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(time < 0)
|
||||
{
|
||||
ERROR_LOG() << " init failed - time invalid.";
|
||||
ERROR_LOG(m_logger) << " init failed - time invalid.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(effectorIds.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << " init failed - effector Ids invalid.";
|
||||
ERROR_LOG(m_logger) << " init failed - effector Ids invalid.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(rounds <= 0)
|
||||
{
|
||||
ERROR_LOG() << " init failed - number of rounds invalid.";
|
||||
ERROR_LOG(m_logger) << " init failed - number of rounds invalid.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(pattern.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << " init failed - invalid fire pattern.";
|
||||
ERROR_LOG(m_logger) << " init failed - invalid fire pattern.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -80,13 +80,13 @@ bool FireAutomaton::init(int32_t time, TimeType type, int32_t rounds, const QVec
|
||||
|
||||
if(!readPattern(pattern))
|
||||
{
|
||||
ERROR_LOG() << " init failed - firing pattern invalid.";
|
||||
ERROR_LOG(m_logger) << " init failed - firing pattern invalid.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!calculateSchedule(rounds))
|
||||
{
|
||||
ERROR_LOG() << " init failed - firing schedule invalid.";
|
||||
ERROR_LOG(m_logger) << " init failed - firing schedule invalid.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ bool FireAutomaton::start()
|
||||
{
|
||||
if(m_state != State::Stopped)
|
||||
{
|
||||
ERROR_LOG() << " start failed - fire automaton must be in state stopped.";
|
||||
ERROR_LOG(m_logger) << " start failed - fire automaton must be in state stopped.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ bool FireAutomaton::resume()
|
||||
{
|
||||
if(m_state != State::Paused)
|
||||
{
|
||||
ERROR_LOG() << " resume failed - fire automaton must be in state paused.";
|
||||
ERROR_LOG(m_logger) << " resume failed - fire automaton must be in state paused.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ bool FireAutomaton::pause()
|
||||
{
|
||||
if(m_state != State::Running)
|
||||
{
|
||||
ERROR_LOG() << " pause failed - fire automaton must be in state running.";
|
||||
ERROR_LOG(m_logger) << " pause failed - fire automaton must be in state running.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ bool FireAutomaton::performStep()
|
||||
{
|
||||
if(m_state != State::Stopped && m_state != State::Stepping)
|
||||
{
|
||||
ERROR_LOG() << " performStep failed - fire automaton must be in state stepping or stopped.";
|
||||
ERROR_LOG(m_logger) << " performStep failed - fire automaton must be in state stepping or stopped.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ bool FireAutomaton::readPattern(const QString& pattern)
|
||||
|
||||
if(!patternElementFromString(element, patternElement))
|
||||
{
|
||||
WARNING_LOG() << " skipped invalid firing pattern elements.";
|
||||
WARNING_LOG(m_logger) << " skipped invalid firing pattern elements.";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ bool FireAutomaton::readPattern(const QString& pattern)
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << " a pattern may contain at most one fill element.";
|
||||
ERROR_LOG(m_logger) << " a pattern may contain at most one fill element.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,7 @@ bool FireAutomaton::readPattern(const QString& pattern)
|
||||
|
||||
if(m_pattern.empty())
|
||||
{
|
||||
ERROR_LOG() << " error occured reading firing pattern.";
|
||||
ERROR_LOG(m_logger) << " error occured reading firing pattern.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ bool FireAutomaton::calculateSchedule(int32_t rounds)
|
||||
|
||||
if(rounds > 0)
|
||||
{
|
||||
ERROR_LOG() << " scheduling error - fire pattern does not provide sufficient slots to schedule all rounds. " << rounds;
|
||||
ERROR_LOG(m_logger) << " scheduling error - fire pattern does not provide sufficient slots to schedule all rounds. " << rounds;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -72,6 +72,7 @@ private slots:
|
||||
void nextTick();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
enum class PatternElement {
|
||||
All,
|
||||
AllFill,
|
||||
@@ -89,6 +90,7 @@ private:
|
||||
QVector<int32_t> getEffectorIds(int32_t tick) const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QVector<int32_t> m_effectorIds;
|
||||
QVector<FireAutomaton::PatternElement> m_pattern;
|
||||
QVector<QVector<int32_t>> m_schedule;
|
||||
|
||||
+33
-33
@@ -132,18 +132,18 @@ FiringTimer::FiringTimer(const QString &debugInfo)
|
||||
{
|
||||
++s_counter;
|
||||
d->m_debugInfo = debugInfo;
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
}
|
||||
|
||||
FiringTimer::~FiringTimer()
|
||||
{
|
||||
--s_counter;
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this;
|
||||
QString debugInfoSave = d->m_debugInfo;
|
||||
delete d;
|
||||
//DEBUG_LOG() << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG() << "debugInfo='" << debugInfoSave << "'" << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
//DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
DEBUG_LOG(m_logger) << "debugInfo='" << debugInfoSave << "'" << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this;
|
||||
}
|
||||
|
||||
void FiringTimer::setDebugInfo(const QString &debugInfo)
|
||||
@@ -153,14 +153,14 @@ void FiringTimer::setDebugInfo(const QString &debugInfo)
|
||||
|
||||
void FiringTimer::reset()
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START";
|
||||
d->reset();
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDurationMsec)
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START,"
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START,"
|
||||
<< ", effectDurationMsec=" << effectDurationMsec
|
||||
<< ", ammoCount=" << ammoCount
|
||||
<< ", ammoFlightDurationMsec=" << ammoFlightDurationMsec;
|
||||
@@ -170,7 +170,7 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu
|
||||
d->m_ammoCount = ammoCount;
|
||||
d->m_ammoFlightDurationMsec = ammoFlightDurationMsec;
|
||||
d->m_intervallMsec = static_cast<double>(d->m_effectDurationMsec) / d->m_ammoCount; // ensure float calculation
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " m_intervallMsec " << d->m_intervallMsec;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " m_intervallMsec " << d->m_intervallMsec;
|
||||
|
||||
d->m_firingTimer->stop();
|
||||
d->m_firingTimer->setSingleShot(false);
|
||||
@@ -178,24 +178,24 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu
|
||||
connect(d->m_firingTimer, &QTimer::timeout,
|
||||
this, &FiringTimer::onFiringTimout, Qt::UniqueConnection);
|
||||
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END";
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FiringTimer::startFiring()
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START";
|
||||
|
||||
if ((d->m_currentFiringMode != FiringMode::FM_Undefined) &&
|
||||
(d->m_currentFiringMode != FiringMode::FM_Paused))
|
||||
{
|
||||
ERROR_LOG() << MY_Q_FUNC_INFO << " wrong firingMode, cur = " << (int)d->m_currentFiringMode;
|
||||
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode, cur = " << (int)d->m_currentFiringMode;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (remainingAmmoCount() <= 0)
|
||||
{
|
||||
ERROR_LOG() << MY_Q_FUNC_INFO << " no ammo left"
|
||||
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left"
|
||||
<< " (total ammoCount was: " << d->m_ammoCount
|
||||
<< " cur firingMode = " << (int)d->m_currentFiringMode;
|
||||
return false;
|
||||
@@ -213,7 +213,7 @@ bool FiringTimer::startFiring()
|
||||
#endif // SUPPORT_STATE_CHANGE_DELAYED
|
||||
|
||||
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount;
|
||||
|
||||
d->m_firingTimer->start();
|
||||
d->m_currentFiringMode = FiringMode::FM_Active;
|
||||
@@ -227,7 +227,7 @@ bool FiringTimer::startFiring()
|
||||
d->m_pausedMsec += pausedElapsedMsec;
|
||||
d->m_etPaused->invalidate();
|
||||
}
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " start firing after [ms]: " << pausedElapsedMsec
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing after [ms]: " << pausedElapsedMsec
|
||||
<< ", m_activeMsec in total = " << d->m_activeMsec
|
||||
<< ", m_pausedMsec in total = " << d->m_pausedMsec;
|
||||
|
||||
@@ -256,7 +256,7 @@ bool FiringTimer::startFiring()
|
||||
// to fire at the beginning of the interval:
|
||||
onFiringTimout();
|
||||
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -270,17 +270,17 @@ bool FiringTimer::startFiringDelay(qint64 delayMsec)
|
||||
|
||||
bool FiringTimer::pauseFiring()
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START";
|
||||
|
||||
if (d->m_currentFiringMode != FiringMode::FM_Active)
|
||||
{
|
||||
ERROR_LOG() << MY_Q_FUNC_INFO << " wrong firingMode";
|
||||
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (remainingAmmoCount() <= 0)
|
||||
{
|
||||
ERROR_LOG() << MY_Q_FUNC_INFO << " no ammo left"
|
||||
ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left"
|
||||
<< " (total ammoCount was: " << d->m_ammoCount;
|
||||
return false;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ bool FiringTimer::pauseFiring()
|
||||
#endif // SUPPORT_STATE_CHANGE_DELAYED
|
||||
|
||||
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount;
|
||||
d->m_firingTimer->stop();
|
||||
d->m_currentFiringMode = FiringMode::FM_Paused;
|
||||
d->m_etPaused->start();
|
||||
@@ -305,14 +305,14 @@ bool FiringTimer::pauseFiring()
|
||||
const qint64 activeElapsedMsec = d->m_etActive->elapsed();
|
||||
d->m_activeMsec += activeElapsedMsec;
|
||||
d->m_etActive->invalidate();
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec
|
||||
<< ", m_activeMsec in total = " << d->m_activeMsec
|
||||
<< ", m_pausedMsec in total = " << d->m_pausedMsec;
|
||||
|
||||
QString log = QString(QStringLiteral("pauseFiring_at_%1")).arg(QDateTime::currentMSecsSinceEpoch()) ;
|
||||
d->m_logHistorie.append(log);
|
||||
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ long FiringTimer::intervallMsec() const
|
||||
#ifdef SUPPORT_STATE_CHANGE_DELAYED
|
||||
void FiringTimer::emitStateChangeDelayed(AreaEffectSimulation::FiringTimer::CMD cmd, int firedAmmoCount)
|
||||
{
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd
|
||||
<< ", firedAmmoCount = " << firedAmmoCount;
|
||||
emit stateChangeDelayedAsInt(static_cast<int>(cmd), firedAmmoCount);
|
||||
}
|
||||
@@ -380,11 +380,11 @@ QString FiringTimer::toString(const CMD cmd)
|
||||
|
||||
void FiringTimer::onFiringTimout()
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START";
|
||||
|
||||
++d->m_firedAmmoCount;
|
||||
|
||||
INFO_LOG() << MY_Q_FUNC_INFO << " emit firing with: " << d->m_firedAmmoCount
|
||||
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit firing with: " << d->m_firedAmmoCount
|
||||
<< " of total ammoCount = " << d->m_ammoCount;
|
||||
emit firing(d->m_firedAmmoCount, d->m_ammoCount);
|
||||
|
||||
@@ -396,7 +396,7 @@ void FiringTimer::onFiringTimout()
|
||||
int currentFiringNumber = d->m_firedAmmoCount;
|
||||
int totalFiringNumber = d->m_ammoCount;
|
||||
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber;
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber;
|
||||
|
||||
QTimer::singleShot(d->m_ammoFlightDurationMsec, this, [this, currentFiringNumber, totalFiringNumber]()
|
||||
{
|
||||
@@ -408,7 +408,7 @@ void FiringTimer::onFiringTimout()
|
||||
}
|
||||
#endif // SUPPORT_STATE_CHANGE_DELAYED
|
||||
|
||||
INFO_LOG() << MY_Q_FUNC_INFO << " emit impact " << currentFiringNumber
|
||||
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit impact " << currentFiringNumber
|
||||
<< " of total = " << totalFiringNumber;
|
||||
emit impact(currentFiringNumber, totalFiringNumber);
|
||||
|
||||
@@ -430,7 +430,7 @@ void FiringTimer::onFiringTimout()
|
||||
|
||||
if (d->m_firedAmmoCount >= d->m_ammoCount)
|
||||
{
|
||||
INFO_LOG() << MY_Q_FUNC_INFO << " no ammo left, finishing firing"
|
||||
INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left, finishing firing"
|
||||
<< ", " << d->m_firedAmmoCount << " of total ammoCount = " << d->m_ammoCount << " are fired";
|
||||
d->m_firingTimer->stop();
|
||||
|
||||
@@ -440,7 +440,7 @@ void FiringTimer::onFiringTimout()
|
||||
|
||||
// !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !!
|
||||
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec
|
||||
<< ", m_activeMsec in total = " << d->m_activeMsec
|
||||
<< ", m_pausedMsec in total = " << d->m_pausedMsec
|
||||
<< " now FiringTimoutExpiredPlus ...";
|
||||
@@ -465,12 +465,12 @@ void FiringTimer::onFiringTimout()
|
||||
d->m_firingTimer->start();
|
||||
}
|
||||
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount;
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount;
|
||||
}
|
||||
|
||||
void FiringTimer::onFiringTimoutExpiredPlus()
|
||||
{
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START";
|
||||
|
||||
d->m_currentFiringMode = FiringMode::FM_ExpiredPlus;
|
||||
|
||||
@@ -480,7 +480,7 @@ void FiringTimer::onFiringTimoutExpiredPlus()
|
||||
|
||||
// !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !!
|
||||
|
||||
DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing2 after [ms]: " << activeElapsedMsec
|
||||
DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing2 after [ms]: " << activeElapsedMsec
|
||||
<< ", m_activeMsec in total = " << d->m_activeMsec
|
||||
<< ", m_pausedMsec in total = " << d->m_pausedMsec;
|
||||
|
||||
@@ -488,7 +488,7 @@ void FiringTimer::onFiringTimoutExpiredPlus()
|
||||
|
||||
emit firingFinishedPlus();
|
||||
|
||||
TRACE_LOG() << MY_Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,12 +18,11 @@
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent)
|
||||
: QObject(parent)
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent) : QObject(parent)
|
||||
, m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_currentTimeMSec(-1)
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
, m_currentTimeMSec(-1),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
DdsHandler::~DdsHandler()
|
||||
@@ -45,7 +44,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;
|
||||
}
|
||||
|
||||
@@ -84,7 +83,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsDts = AreaEffectSimulation::Interface::Dts::create(m_ddsConnector);
|
||||
m_ddsFts = AreaEffectSimulation::Interface::Fts::create(m_ddsConnector);
|
||||
bRet &= m_ddsDts->enableAll();
|
||||
DEBUG_LOG() << "initialized Dts: " << bRet;
|
||||
DEBUG_LOG(m_logger) << "initialized Dts: " << bRet;
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
bRet &= m_ddsFts->enableTargetPositionsModify();
|
||||
@@ -95,7 +94,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
bRet &= m_ddsFts->enableAcknowledgeExternalAesItem();
|
||||
bRet &= m_ddsFts->enableSetAesItemEffectorState();
|
||||
|
||||
DEBUG_LOG() << "initialized Fts: " << bRet;
|
||||
DEBUG_LOG(m_logger) << "initialized Fts: " << bRet;
|
||||
|
||||
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_pdmDtc->enableChargeType();
|
||||
|
||||
@@ -78,6 +78,7 @@ private slots:
|
||||
void onPartitionTimeChanged(const Core::PartitionTime ¤tTime);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
|
||||
+13
-13
@@ -26,31 +26,31 @@ EffectorStateMachine::~EffectorStateMachine() { stopAllTimer(); }
|
||||
|
||||
int EffectorStateMachine::intervalFire()
|
||||
{
|
||||
DEBUG_LOG() << "intervalFire";
|
||||
DEBUG_LOG(m_logger) << "intervalFire";
|
||||
return QRandomGenerator::global()->bounded(Settings::getEffectorIntervalFireMin(), Settings::getEffectorIntervalFireMax() + 1);
|
||||
}
|
||||
|
||||
int EffectorStateMachine::intervalReportFired()
|
||||
{
|
||||
DEBUG_LOG() << "intervalReportFired";
|
||||
DEBUG_LOG(m_logger) << "intervalReportFired";
|
||||
return QRandomGenerator::global()->bounded(Settings::getEffectorIntervalReportFiredMin(), Settings::getEffectorIntervalReportFiredMax() + 1);
|
||||
}
|
||||
|
||||
int EffectorStateMachine::intervalReportFireReadiness()
|
||||
{
|
||||
DEBUG_LOG() << "intervalReportFireReadiness";
|
||||
DEBUG_LOG(m_logger) << "intervalReportFireReadiness";
|
||||
return QRandomGenerator::global()->bounded(m_intervalReportFireReadinessMin, m_intervalReportFireReadinessMax + 1);
|
||||
}
|
||||
|
||||
int EffectorStateMachine::intervalInitialFireReadiness()
|
||||
{
|
||||
DEBUG_LOG() << "intervalInitialFireReadiness";
|
||||
DEBUG_LOG(m_logger) << "intervalInitialFireReadiness";
|
||||
return QRandomGenerator::global()->bounded(Settings::getEffectorInitialReportFireReadinessMin(), Settings::getEffectorInitialReportFireReadinessMax() + 1);
|
||||
}
|
||||
|
||||
void EffectorStateMachine::init()
|
||||
{
|
||||
DEBUG_LOG() << "EffectorStateMachine::init";
|
||||
DEBUG_LOG(m_logger) << "EffectorStateMachine::init";
|
||||
emit logMessage(
|
||||
QStringLiteral("intervalFire min=%1 max=%2, intervalReportFired min=%3 max=%4, intervalReportFireReadiness min=%5 max=%6 , initialFireReadiness min=%7 max=%8")
|
||||
.arg(
|
||||
@@ -109,7 +109,7 @@ QString EffectorStateMachine::getStateStr(AreaEffectSimulation::AesEffectorState
|
||||
|
||||
bool EffectorStateMachine::overrideReportFireReadinessMinMax(int newMin, int newMax)
|
||||
{
|
||||
DEBUG_LOG() << "Override ReadinessMinMax min: " << newMin << " max: " << newMax;
|
||||
DEBUG_LOG(m_logger) << "Override ReadinessMinMax min: " << newMin << " max: " << newMax;
|
||||
|
||||
m_intervalReportFireReadinessMin = newMin;
|
||||
m_intervalReportFireReadinessMax = newMax;
|
||||
@@ -118,7 +118,7 @@ bool EffectorStateMachine::overrideReportFireReadinessMinMax(int newMin, int new
|
||||
|
||||
bool EffectorStateMachine::resetReportFireReadinessMinMax()
|
||||
{
|
||||
DEBUG_LOG() << "Reset ReadinessMinMax min:" << Settings::getEffectorIntervalReportFireReadinessMin()
|
||||
DEBUG_LOG(m_logger) << "Reset ReadinessMinMax min:" << Settings::getEffectorIntervalReportFireReadinessMin()
|
||||
<< " max: " << Settings::getEffectorIntervalReportFireReadinessMax();
|
||||
|
||||
m_intervalReportFireReadinessMin = Settings::getEffectorIntervalReportFireReadinessMin();
|
||||
@@ -156,7 +156,7 @@ bool EffectorStateMachine::reportNotFireReadiness()
|
||||
}
|
||||
QString timestamp = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss"));
|
||||
emit logMessage(QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr));
|
||||
DEBUG_LOG() << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr);
|
||||
DEBUG_LOG(m_logger) << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr);
|
||||
emit signalNotReadyToFire();
|
||||
return true;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ bool EffectorStateMachine::reportFireReadiness()
|
||||
|
||||
bool EffectorStateMachine::fireOrder()
|
||||
{
|
||||
DEBUG_LOG() << "fireOrder";
|
||||
DEBUG_LOG(m_logger) << "fireOrder";
|
||||
|
||||
AreaEffectSimulation::AesEffectorState newState = AreaEffectSimulation::AesEffectorState::EsReceivedOrder;
|
||||
|
||||
@@ -209,7 +209,7 @@ bool EffectorStateMachine::fireOrder()
|
||||
if (m_currentState == newState)
|
||||
{
|
||||
emit logMessage(QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr));
|
||||
DEBUG_LOG() << QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr);
|
||||
DEBUG_LOG(m_logger) << QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ bool EffectorStateMachine::fireOrder()
|
||||
if (Settings::getEffectorIntervalFireMin() >= 0)
|
||||
{
|
||||
emit logMessage(QStringLiteral("m_timerFire.start()"));
|
||||
DEBUG_LOG() << QStringLiteral("m_timerFire.start()");
|
||||
DEBUG_LOG(m_logger) << QStringLiteral("m_timerFire.start()");
|
||||
m_timerFire.setInterval(intervalFire());
|
||||
m_timerFire.start();
|
||||
}
|
||||
@@ -228,12 +228,12 @@ bool EffectorStateMachine::fireOrder()
|
||||
else
|
||||
{
|
||||
emit logMessage(QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr));
|
||||
DEBUG_LOG() << QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr);
|
||||
DEBUG_LOG(m_logger) << QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr);
|
||||
return false;
|
||||
}
|
||||
QString timestamp = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss"));
|
||||
emit logMessage(QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr));
|
||||
DEBUG_LOG() << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr);
|
||||
DEBUG_LOG(m_logger) << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr);
|
||||
emit signalReceivedOrder();
|
||||
return true;
|
||||
}
|
||||
|
||||
+13
-13
@@ -37,7 +37,7 @@ bool HandlerChargeEffect::init()
|
||||
|
||||
if (!m_mainHandler)
|
||||
{
|
||||
ERROR_LOG() << QStringLiteral("Not possible to init HandlerChargeEffect --> No MainHandler present.");
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Not possible to init HandlerChargeEffect --> No MainHandler present.");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ bool HandlerChargeEffect::init()
|
||||
|
||||
if (!m_mainHandler->db()->select(chargeEffectDbData))
|
||||
{
|
||||
ERROR_LOG() << QStringLiteral("Not possible to init HandlerChargeEffect --> Not possible to get database data.");
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Not possible to init HandlerChargeEffect --> Not possible to get database data.");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void HandlerChargeEffect::onChargeEffectModifyRequest(const rti::core::SampleIde
|
||||
{
|
||||
if (!m_mainHandler)
|
||||
{
|
||||
ERROR_LOG() << QStringLiteral("Not possible to process ChargeEffectModifyRequest --> No MainHandler present.");
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Not possible to process ChargeEffectModifyRequest --> No MainHandler present.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -117,13 +117,13 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId)
|
||||
|
||||
if (chargeEffect == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "onChargeEffectExpired: got invalid chargeEffectId " << chargeEffectId;
|
||||
ERROR_LOG(m_logger) << "onChargeEffectExpired: got invalid chargeEffectId " << chargeEffectId;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chargeEffect->remove())
|
||||
{
|
||||
ERROR_LOG() << "onChargeEffectExpired: failed to remove ChargeEffect with id " << chargeEffectId;
|
||||
ERROR_LOG(m_logger) << "onChargeEffectExpired: failed to remove ChargeEffect with id " << chargeEffectId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId)
|
||||
const int trajId = m_trajObjIds.value(chargeEffectId, -1);
|
||||
if (!m_trajectoryHandler->remove(trajId))
|
||||
{
|
||||
ERROR_LOG() << "onChargeEffectExpired: failed to remove trajectory from chargeEffect id " << chargeEffectId;
|
||||
ERROR_LOG(m_logger) << "onChargeEffectExpired: failed to remove trajectory from chargeEffect id " << chargeEffectId;
|
||||
return;
|
||||
}
|
||||
m_trajObjIds.remove(chargeEffectId);
|
||||
@@ -143,7 +143,7 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId)
|
||||
|
||||
void HandlerChargeEffect::onChargeEffectStateChanged(const int id, AesEffectState newState)
|
||||
{
|
||||
DEBUG_LOG() << " [CHARGE EFFECT STATE] state changed !! id: " << id << " state: " << newState;
|
||||
DEBUG_LOG(m_logger) << " [CHARGE EFFECT STATE] state changed !! id: " << id << " state: " << newState;
|
||||
|
||||
if (id <= 0)
|
||||
return;
|
||||
@@ -165,8 +165,8 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf
|
||||
m_chargeEffects.insert(newChargeEffect->id(), newChargeEffect);
|
||||
|
||||
// Create ChargeAdministration Entry for reports
|
||||
DEBUG_LOG() << "newChargeEffect id: " << newChargeEffect->id();
|
||||
DEBUG_LOG() << "request.originatorTypeId: " << request.originatorTypeId();
|
||||
DEBUG_LOG(m_logger) << "newChargeEffect id: " << newChargeEffect->id();
|
||||
DEBUG_LOG(m_logger) << "request.originatorTypeId: " << request.originatorTypeId();
|
||||
if (request.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
{
|
||||
int amount = 1;
|
||||
@@ -185,7 +185,7 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf
|
||||
{
|
||||
int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware().get()));
|
||||
if (trajId < 0)
|
||||
ERROR_LOG() << " Couldn't create trajectory for chargeEffect id: " << newChargeEffect->id();
|
||||
ERROR_LOG(m_logger) << " Couldn't create trajectory for chargeEffect id: " << newChargeEffect->id();
|
||||
else
|
||||
m_trajObjIds.insert(newChargeEffect->id(), trajId);
|
||||
}
|
||||
@@ -233,7 +233,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf
|
||||
{
|
||||
reply.setStr("Not possible to update ChargeEffect --> No MainHandler present.");
|
||||
|
||||
ERROR_LOG() << reply.str();
|
||||
ERROR_LOG(m_logger) << reply.str();
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf
|
||||
|
||||
reply.setStr("Not possible to update ChargeEffect --> Got invalid id.");
|
||||
|
||||
ERROR_LOG() << reply.str();
|
||||
ERROR_LOG(m_logger) << reply.str();
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -257,7 +257,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf
|
||||
{
|
||||
// update failed should the trajectory be created again?
|
||||
reply.setStr("Not possible to update ChargeEffect --> Got invalid trajectory id.");
|
||||
ERROR_LOG() << " Couldn't update trajectory: unknown chargeEffect id: " << chargeEffetObj->id();
|
||||
ERROR_LOG(m_logger) << " Couldn't update trajectory: unknown chargeEffect id: " << chargeEffetObj->id();
|
||||
}
|
||||
|
||||
return reply;
|
||||
|
||||
+2
@@ -39,6 +39,8 @@ public:
|
||||
void onChargeEffectStateChanged(const int id, AesEffectState newState);
|
||||
|
||||
private: // methods
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
Core::FunctionReplyObject updateChargeEffect(const ChargeEffectModifyRequest &request);
|
||||
|
||||
private: // attributes
|
||||
|
||||
+5
-5
@@ -28,7 +28,7 @@ HandlerEffector::HandlerEffector(AreaEffectSimulation::MainHandler *mainhandler,
|
||||
|
||||
bool HandlerEffector::init()
|
||||
{
|
||||
DEBUG_LOG() << "HandlerEffector::init";
|
||||
DEBUG_LOG(m_logger) << "HandlerEffector::init";
|
||||
|
||||
connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged,
|
||||
this, &HandlerEffector::onParticipantChanged);
|
||||
@@ -48,7 +48,7 @@ void HandlerEffector::createEffector(int participantId)
|
||||
{
|
||||
if (m_effectors.contains(participantId))
|
||||
return;
|
||||
DEBUG_LOG()<<"createEffector participantId:" << participantId;
|
||||
DEBUG_LOG(m_logger)<<"createEffector participantId:" << participantId;
|
||||
ObjectEffector* objectEffector = new ObjectEffector(m_mainHandler, this);
|
||||
objectEffector->init(participantId);
|
||||
|
||||
@@ -58,17 +58,17 @@ void HandlerEffector::createEffector(int participantId)
|
||||
// TODO Wird aufgerufen, wenn zur Laufzeit ein Effektor geloescht wird. (Topic?)
|
||||
void HandlerEffector::deleteEffector(int participantId)
|
||||
{
|
||||
DEBUG_LOG()<<"deleteEffector participantId:" << participantId;
|
||||
DEBUG_LOG(m_logger)<<"deleteEffector participantId:" << participantId;
|
||||
delete m_effectors[participantId];
|
||||
m_effectors.remove(participantId);
|
||||
}
|
||||
|
||||
void HandlerEffector::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
|
||||
{
|
||||
//DEBUG_LOG()<<"onParticipantChanged participantId:" << data.id();
|
||||
//DEBUG_LOG(m_logger)<<"onParticipantChanged participantId:" << data.id();
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.id();
|
||||
if (m_effectors.contains(data.id()))
|
||||
deleteEffector(data.id());
|
||||
return;
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace AreaEffectSimulation
|
||||
ObjectEffector* getObjectEffector (int participantId) {return m_effectors.value(participantId);};
|
||||
|
||||
private: // methods
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void createEffector(int participantId);
|
||||
void deleteEffector(int participantId);
|
||||
|
||||
|
||||
+16
-16
@@ -36,21 +36,21 @@ HandlerTrajectory::HandlerTrajectory(MainHandler *mainHandler)
|
||||
|
||||
HandlerTrajectory::~HandlerTrajectory()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
delete d;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
int HandlerTrajectory::create(const TrajectoryData &providedData)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
int newId = -1;
|
||||
|
||||
auto *ifs = new ObjectTrajectory(d->m_mainHandler);
|
||||
if (!ifs)
|
||||
{
|
||||
ERROR_LOG()<<" couldn't create ObjectTrajectory!";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
ERROR_LOG(m_logger)<<" couldn't create ObjectTrajectory!";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -66,17 +66,17 @@ int HandlerTrajectory::create(const TrajectoryData &providedData)
|
||||
ifs->publish();
|
||||
}
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END, newId = " << newId;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, newId = " << newId;
|
||||
return newId;
|
||||
}
|
||||
|
||||
bool HandlerTrajectory::update(const TrajectoryData &providedData)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START, id = " << providedData.id;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << providedData.id;
|
||||
bool success = false;
|
||||
if (!providedData.isIdValid())
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END ";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END ";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,25 +87,25 @@ bool HandlerTrajectory::update(const TrajectoryData &providedData)
|
||||
success = true;
|
||||
}
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END, success = " << success;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, success = " << success;
|
||||
return success;
|
||||
}
|
||||
|
||||
bool HandlerTrajectory::remove(const int trajId)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START, id = " << trajId;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << trajId;
|
||||
|
||||
if (trajId <= 0)
|
||||
{
|
||||
ERROR_LOG() << " remove topic: got Invalid trajectory Id: "<<trajId;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END ";
|
||||
ERROR_LOG(m_logger) << " remove topic: got Invalid trajectory Id: "<<trajId;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END ";
|
||||
return false;
|
||||
}
|
||||
|
||||
auto *ifs = d->m_objectMap[trajId];
|
||||
if (!ifs->removeTopic())
|
||||
{
|
||||
ERROR_LOG() << "failed to remove trajectory with id " << trajId;
|
||||
ERROR_LOG(m_logger) << "failed to remove trajectory with id " << trajId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,13 +113,13 @@ bool HandlerTrajectory::remove(const int trajId)
|
||||
delete ifs;
|
||||
ifs = nullptr;
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END ";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END ";
|
||||
return true;
|
||||
}
|
||||
|
||||
int HandlerTrajectory::createUpdate(const TrajectoryData &providedData)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START, id = " << providedData.id;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << providedData.id;
|
||||
|
||||
int ret = -1;
|
||||
|
||||
@@ -130,7 +130,7 @@ int HandlerTrajectory::createUpdate(const TrajectoryData &providedData)
|
||||
} else {
|
||||
ret = create(providedData);
|
||||
}
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END, id ret " << ret;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, id ret " << ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public:
|
||||
int createUpdate(const TrajectoryData& providedData);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int count() const;
|
||||
|
||||
class Private;
|
||||
|
||||
@@ -46,9 +46,8 @@
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
QRandomGenerator(time(nullptr));
|
||||
#else
|
||||
@@ -95,7 +94,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if(!m_dbHandler->init(exerciseId, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -104,7 +103,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_dbHandlerEx0 = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandlerEx0->init(0, Settings::settings())) // need a second db connection due to username/password
|
||||
{
|
||||
ERROR_LOG() << "Could not init DbHandler";
|
||||
ERROR_LOG(m_logger) << "Could not init DbHandler";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError,
|
||||
QStringLiteral("Could not init DbHandler"));
|
||||
return false;
|
||||
@@ -120,7 +119,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -158,7 +157,7 @@ bool MainHandler::initAESHandler()
|
||||
// prepare some basics for HandlerExplosionCluster
|
||||
// - TrajectoryGenerator
|
||||
// - LtsElevationManager
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " ****** std::make_shared<HandlerExplosionCluster...";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ****** std::make_shared<HandlerExplosionCluster...";
|
||||
const int exerciseId = dds()->exerciseId();
|
||||
LtsElevation::LTS_ELEVATION_MANAGER_TYPE ltsElevationManager = LtsElevation::LtsElevationManager::createInstance(exerciseId,
|
||||
dds()->exmDtc(),
|
||||
@@ -176,7 +175,7 @@ bool MainHandler::initAESHandler()
|
||||
#ifndef Q_OS_WIN // GUEZE-2195
|
||||
if (!ltsElevationManager)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " LtsElevation::createInstance failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " LtsElevation::createInstance failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -188,7 +187,7 @@ bool MainHandler::initAESHandler()
|
||||
this->dds()->asmDtc());
|
||||
if (!trajectoryGenerator)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " TrajectoryGenerator::getInstance failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " TrajectoryGenerator::getInstance failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -196,7 +195,7 @@ bool MainHandler::initAESHandler()
|
||||
m_handlerExplosionCluster = std::make_shared<HandlerExplosionCluster>(this);
|
||||
if (!m_handlerExplosionCluster->init())
|
||||
return false;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " ****** std::make_shared<HandlerExplosionCluster... DONE";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ****** std::make_shared<HandlerExplosionCluster... DONE";
|
||||
|
||||
m_handlerFunctionalArea = std::make_shared<HandlerFunctionalArea>(this);
|
||||
if (!m_handlerFunctionalArea->init())
|
||||
@@ -248,7 +247,7 @@ bool MainHandler::initAESHandler()
|
||||
m_handlerBorderline = std::make_shared<HandlerBorderline>(this);
|
||||
if (!m_handlerBorderline->init())
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerBorderline failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerBorderline failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -257,7 +256,7 @@ bool MainHandler::initAESHandler()
|
||||
m_handlerGasPipe = std::make_shared<HandlerGasPipe>(this);
|
||||
if (!m_handlerGasPipe->init())
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerGasPipe failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerGasPipe failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -266,7 +265,7 @@ bool MainHandler::initAESHandler()
|
||||
m_handlerChargeEffect = std::make_shared<HandlerChargeEffect>(this);
|
||||
if (!m_handlerChargeEffect->init())
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
@@ -279,7 +278,7 @@ bool MainHandler::initAESHandler()
|
||||
m_handlerEffector = std::make_shared<HandlerEffector>(this);
|
||||
if (!m_handlerEffector->init())
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed.";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -115,8 +115,10 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool initAESHandler();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<HandlerAirSupportImpact> m_handlerAirSupportImpact;
|
||||
std::shared_ptr<HandlerExplosionSingle> m_handlerExplosionSingle;
|
||||
std::shared_ptr<HandlerExplosionArea> m_handlerExplosionArea;
|
||||
|
||||
+11
-12
@@ -21,12 +21,11 @@ namespace AreaEffectSimulation
|
||||
static const int s_samePointDistance = 10; // 10m
|
||||
static const int s_smoothDistance = 10; // 10m
|
||||
static const int s_timeoutInterval = 10 * 60 * 1000; // 10min
|
||||
MineCorridorCreator::MineCorridorCreator(int equipNo, ObjectMineCorridor *omc)
|
||||
: m_timer(new QTimer(this))
|
||||
MineCorridorCreator::MineCorridorCreator(int equipNo, ObjectMineCorridor *omc) : m_timer(new QTimer(this))
|
||||
, m_timeoutTimer(new QTimer(this))
|
||||
, m_omc(omc)
|
||||
, m_equipNo(equipNo)
|
||||
{
|
||||
, m_equipNo(equipNo),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_timeoutTimer->setInterval(s_timeoutInterval);
|
||||
m_timeoutTimer->setSingleShot(true);
|
||||
connect(m_timeoutTimer, &QTimer::timeout, this, &MineCorridorCreator::timeout, Qt::QueuedConnection);
|
||||
@@ -54,7 +53,7 @@ void MineCorridorCreator::addPosition(const Core::GeoPosition2D &pos, qint64 ts)
|
||||
const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), last.zone);
|
||||
if (isSamePoint(last, utm, s_samePointDistance))
|
||||
{
|
||||
DEBUG_LOG() << "got duplicated point (" << last.x << "/" << last.y
|
||||
DEBUG_LOG(m_logger) << "got duplicated point (" << last.x << "/" << last.y
|
||||
<< " - " << utm.x << "/" << utm.y << " from " << m_equipNo << " - ignoring";
|
||||
return;
|
||||
}
|
||||
@@ -69,7 +68,7 @@ void MineCorridorCreator::creationFinished()
|
||||
|
||||
if (m_sortedCorridorData.size() < 2)
|
||||
{
|
||||
WARNING_LOG() << "To few points to create mine corridor for " << m_equipNo;
|
||||
WARNING_LOG(m_logger) << "To few points to create mine corridor for " << m_equipNo;
|
||||
return;
|
||||
}
|
||||
checkCorridorData(true);
|
||||
@@ -94,13 +93,13 @@ static void outputCoords(NGL::INGLLogger &logger, NGL::LogLevel level, const std
|
||||
|
||||
void MineCorridorCreator::checkCorridorData(bool bFinished)
|
||||
{
|
||||
DEBUG_LOG() << "Checking corridor data (finished: " << bFinished << ") for equipment " << m_equipNo;
|
||||
DEBUG_LOG(m_logger) << "Checking corridor data (finished: " << bFinished << ") for equipment " << m_equipNo;
|
||||
std::vector<LtsCoordTrans::UtmCoordinate> coords;
|
||||
coords.reserve(m_sortedCorridorData.size());
|
||||
for (const auto &c : std::as_const(m_sortedCorridorData))
|
||||
coords.push_back(c);
|
||||
const auto coordsSmoothed = ramerDouglasPeucker(coords, s_smoothDistance);
|
||||
DEBUG_LOG() << "Calculated points:";
|
||||
DEBUG_LOG(m_logger) << "Calculated points:";
|
||||
outputCoords(m_logger, NGL::LogLevel::Debug, coordsSmoothed);
|
||||
if (coordsSmoothed.size() < 2)
|
||||
return;
|
||||
@@ -108,7 +107,7 @@ void MineCorridorCreator::checkCorridorData(bool bFinished)
|
||||
segments.reserve(coordsSmoothed.size());
|
||||
for (const LtsCoordTrans::UtmCoordinate &utm : coordsSmoothed)
|
||||
{
|
||||
DEBUG_LOG() << "Mine Corridor calculated point: " << qRound(utm.x) << "/" << qRound(utm.y);
|
||||
DEBUG_LOG(m_logger) << "Mine Corridor calculated point: " << qRound(utm.x) << "/" << qRound(utm.y);
|
||||
const QPointF geo(utm.geographic());
|
||||
segments.emplace_back(Core::GeoPosition2D(geo.x(), geo.y()));
|
||||
}
|
||||
@@ -181,7 +180,7 @@ std::vector<LtsCoordTrans::UtmCoordinate> MineCorridorCreator::ramerDouglasPeuck
|
||||
// If max distance is greater than epsilon, recursively simplify
|
||||
if (dmax > epsilon)
|
||||
{
|
||||
TRACE_LOG() << "Input points, split index = " << index;
|
||||
TRACE_LOG(m_logger) << "Input points, split index = " << index;
|
||||
outputCoords(m_logger, NGL::LogLevel::Trace, pointList);
|
||||
// Recursive call
|
||||
const std::vector<LtsCoordTrans::UtmCoordinate> firstLine(pointList.begin(), pointList.begin() + index + 1);
|
||||
@@ -191,9 +190,9 @@ std::vector<LtsCoordTrans::UtmCoordinate> MineCorridorCreator::ramerDouglasPeuck
|
||||
out.erase(--out.end());
|
||||
|
||||
const auto recResults2 = ramerDouglasPeucker(lastLine, epsilon);
|
||||
TRACE_LOG() << "Output points left:";
|
||||
TRACE_LOG(m_logger) << "Output points left:";
|
||||
outputCoords(m_logger, NGL::LogLevel::Trace, out);
|
||||
TRACE_LOG() << "Output points right:";
|
||||
TRACE_LOG(m_logger) << "Output points right:";
|
||||
outputCoords(m_logger, NGL::LogLevel::Trace, recResults2);
|
||||
|
||||
out.insert(out.end(), recResults2.begin(), recResults2.end());
|
||||
|
||||
+2
@@ -33,6 +33,7 @@ Q_SIGNALS:
|
||||
private Q_SLOTS:
|
||||
void onCheckCorridorData();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void checkCorridorData(bool bFinished);
|
||||
static bool isSamePoint(const LtsCoordTrans::UtmCoordinate &p1, const LtsCoordTrans::UtmCoordinate &p2, double epsilon);
|
||||
static double perpendicularDistance(const LtsCoordTrans::UtmCoordinate &pt,
|
||||
@@ -41,6 +42,7 @@ private:
|
||||
std::vector<LtsCoordTrans::UtmCoordinate> ramerDouglasPeucker(const std::vector<LtsCoordTrans::UtmCoordinate> &pointList,
|
||||
double epsilon) const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<qint64, LtsCoordTrans::UtmCoordinate> m_sortedCorridorData;
|
||||
QTimer *m_timer;
|
||||
QTimer *m_timeoutTimer;
|
||||
|
||||
@@ -44,7 +44,7 @@ void ObjectBase::setEffectState(AesEffectState newState)
|
||||
Q_UNUSED(newState)
|
||||
m_publishDataTimer->start();
|
||||
AesEffectState es = checkEnterNewState(); // can create loop because checkEnterNewState is calling trySwitchFoo() but it's ok
|
||||
DEBUG_LOG() << id() << " New effect state is " << es;
|
||||
DEBUG_LOG(m_logger) << id() << " New effect state is " << es;
|
||||
emit effectStateChanged();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool ObjectBase::isObjectInTrainingArea() const
|
||||
|
||||
AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
DEBUG_LOG() << id() << " checkEnterNewState - cur effect state is " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " checkEnterNewState - cur effect state is " << effectState();
|
||||
bool bNeedToPublishNewData = false;
|
||||
switch (effectState().underlying())
|
||||
{
|
||||
@@ -147,13 +147,13 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec() - flightDurationMsec();
|
||||
|
||||
DEBUG_LOG() << id() << " timeUntilFiredMSec: " << timeToTickMsec;
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilFiredMSec: " << timeToTickMsec;
|
||||
}
|
||||
else // setup EsAvtivated
|
||||
{
|
||||
timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec(); // time until activation
|
||||
|
||||
DEBUG_LOG() << id() << " timeUntilActivationMSec: " << timeToTickMsec
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilActivationMSec: " << timeToTickMsec
|
||||
<< " cur: " << partitionTimeMSec()
|
||||
<< " activation: " << activationTime().toMSecsSinceEpoch();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
if (!trySwitchToActivated())
|
||||
{
|
||||
WARNING_LOG() << id() << " Error switching to active ...";
|
||||
WARNING_LOG(m_logger) << id() << " Error switching to active ...";
|
||||
QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
// start timer for done
|
||||
m_aesTriggerTimer->stop(); // if it is called directly by someone
|
||||
qint64 timeUntilFinishedMSec = endTime().toMSecsSinceEpoch() - partitionTimeMSec();
|
||||
DEBUG_LOG() << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec
|
||||
DEBUG_LOG(m_logger) << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec
|
||||
<< " cur: " << partitionTimeMSec()
|
||||
<< " activation: " << activationTime().toMSecsSinceEpoch();
|
||||
if (timeUntilFinishedMSec > 0)
|
||||
@@ -208,7 +208,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
{
|
||||
if (!trySwitchToExpired())
|
||||
{
|
||||
WARNING_LOG() << id() << " Error switching from active to expired ...";
|
||||
WARNING_LOG(m_logger) << id() << " Error switching from active to expired ...";
|
||||
QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ AesEffectState ObjectBase::checkEnterNewState()
|
||||
case AesEffectState::EsRemoved:
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << id() << " Unknown new state " << effectState();
|
||||
ERROR_LOG(m_logger) << id() << " Unknown new state " << effectState();
|
||||
break;
|
||||
}
|
||||
if (bNeedToPublishNewData)
|
||||
@@ -239,7 +239,7 @@ bool ObjectBase::trySwitchToReceived()
|
||||
if (!isUsingEffectStateReceived())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToReceived succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToReceived succeeded";
|
||||
setEffectState(AesEffectState::EsReceived);
|
||||
return true;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ bool ObjectBase::trySwitchToCreated()
|
||||
isUsingEffectStateReceived())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToCreated succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToCreated succeeded";
|
||||
setEffectState(AesEffectState::EsCreated);
|
||||
return true;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ bool ObjectBase::trySwitchToPrepared()
|
||||
if (!isActivationTimeSet())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToPrepared succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToPrepared succeeded";
|
||||
setEffectState(AesEffectState::EsPrepared);
|
||||
return true;
|
||||
}
|
||||
@@ -290,29 +290,29 @@ bool ObjectBase::trySwitchToFired()
|
||||
{
|
||||
if (effectState() != AesEffectState::EsPrepared)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - not prepared: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not prepared: " << effectState();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aesType() != AesType::AtExplosionArea && aesType() != AesType::AtEffectCluster)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isFiringTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - firing time is not reached";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - firing time is not reached";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isActivationTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToFired failed - activation time already reached!";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - activation time already reached!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToFired succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToFired succeeded";
|
||||
setEffectState(AesEffectState::EsFired);
|
||||
return true;
|
||||
}
|
||||
@@ -324,17 +324,17 @@ bool ObjectBase::trySwitchToActivated()
|
||||
effectState() != AesEffectState::EsPaused &&
|
||||
effectState() != AesEffectState::EsFired)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState();
|
||||
return false;
|
||||
}
|
||||
if (!isActivationTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated failed - activation time not reached: "
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - activation time not reached: "
|
||||
<< isActivationTimeSet() << " - " << time(nullptr) << " - " << activationTime().toSecsSinceEpoch();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToActivated succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToActivated succeeded";
|
||||
setEffectState(AesEffectState::EsActivated);
|
||||
return true;
|
||||
}
|
||||
@@ -347,7 +347,7 @@ bool ObjectBase::trySwitchToPaused()
|
||||
if (!isPausingSupported())
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToPaused succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToPaused succeeded";
|
||||
setEffectState(AesEffectState::EsPaused);
|
||||
return true;
|
||||
}
|
||||
@@ -358,24 +358,24 @@ bool ObjectBase::trySwitchToExpired()
|
||||
if (effectState() != AesEffectState::EsActivated &&
|
||||
effectState() != AesEffectState::EsPaused)
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired failed - not active or paused: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - not active or paused: " << effectState();
|
||||
return false;
|
||||
}
|
||||
if (!isEndTimeReached())
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired failed - end time not reached: "
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - end time not reached: "
|
||||
<< isEndTimeSet() << " - " << time(nullptr) << " - " << endTime().toSecsSinceEpoch();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << id() << " trySwitchToExpired succeeded";
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToExpired succeeded";
|
||||
setEffectState(AesEffectState::EsExpired);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectBase::trySwitchToRemoved()
|
||||
{
|
||||
DEBUG_LOG() << id() << " trySwitchToRemoved: " << effectState();
|
||||
DEBUG_LOG(m_logger) << id() << " trySwitchToRemoved: " << effectState();
|
||||
switch (effectState().underlying())
|
||||
{
|
||||
case AesEffectState::EsReceived:
|
||||
|
||||
@@ -204,7 +204,7 @@ template <typename T> class ObjectBaseTmpl : public ObjectBase
|
||||
// check effect start for new elements if not OC
|
||||
if ((0 == m_data.id) && (isActivationTimeSet() && activationTime() < QDateTime::currentDateTimeUtc()) && !ignoreActivationTimeCheck)
|
||||
{
|
||||
DEBUG_LOG() << "m_data.id : " << m_data.id << ", isActivationTimeSet :" << isActivationTimeSet()
|
||||
DEBUG_LOG(m_logger) << "m_data.id : " << m_data.id << ", isActivationTimeSet :" << isActivationTimeSet()
|
||||
<< ", activationTime :" << activationTime().toMSecsSinceEpoch() << ", ignoreActivationTimeCheck :" << ignoreActivationTimeCheck;
|
||||
// << ", QDateTime::currentDateTimeUtc() :" << QDateTime::currentDateTimeUtc().msecsTo();
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Effect start is in the past."));
|
||||
@@ -331,7 +331,7 @@ template <typename T> class ObjectBaseTmpl : public ObjectBase
|
||||
|
||||
void onPublishData() override
|
||||
{
|
||||
DEBUG_LOG() << id() << " Publishing data for " << m_typeName << " with name '" << m_data.name << "'"
|
||||
DEBUG_LOG(m_logger) << id() << " Publishing data for " << m_typeName << " with name '" << m_data.name << "'"
|
||||
<< " isCentral=" << m_data.isCentral;
|
||||
ObjectBase::onPublishData();
|
||||
}
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ Core::FunctionReplyObject ObjectChargeAdministration::updateObject(const Databas
|
||||
|
||||
Core::FunctionReplyObject ObjectChargeAdministration::claimPlannedCharge(int count)
|
||||
{
|
||||
DEBUG_LOG() << "claimPlannedCharge for id : " << m_data.chargeTypeId << ", count: " << count;
|
||||
DEBUG_LOG(m_logger) << "claimPlannedCharge for id : " << m_data.chargeTypeId << ", count: " << count;
|
||||
|
||||
// Works both directions, can "claim" negative count!
|
||||
if (m_data.amount - m_data.planned < count)
|
||||
@@ -81,11 +81,11 @@ Core::FunctionReplyObject ObjectChargeAdministration::consumeCharge(int count, b
|
||||
if (m_data.planned < count)
|
||||
{
|
||||
// consume what is possible
|
||||
WARNING_LOG() << "Cannot consume " << count << ", consuming instead " << m_data.planned << " planned";
|
||||
WARNING_LOG(m_logger) << "Cannot consume " << count << ", consuming instead " << m_data.planned << " planned";
|
||||
count = m_data.planned;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "consumeCharge for id : " << m_data.chargeTypeId << ", count: " << count;
|
||||
DEBUG_LOG(m_logger) << "consumeCharge for id : " << m_data.chargeTypeId << ", count: " << count;
|
||||
|
||||
if (wasPlanned && m_data.planned < count)
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Wanted to consume %1 planned charges, but only %2 had been planned.")).arg(count).arg(m_data.planned);
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ class ObjectChargeAdministration final : public QObject
|
||||
void onPublishData();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
MainHandler *m_mainHandler;
|
||||
Database::AesChargeAdministration m_data;
|
||||
|
||||
+13
-13
@@ -58,7 +58,7 @@ Core::FunctionReplyObject ObjectChargeEffect::create(const ChargeEffectModifyReq
|
||||
}
|
||||
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply.str();
|
||||
ERROR_LOG(m_logger) << reply.str();
|
||||
if (reply.id() == 0)
|
||||
reply.setId(m_data.id);
|
||||
return reply;
|
||||
@@ -96,7 +96,7 @@ Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyReq
|
||||
}
|
||||
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply.str();
|
||||
ERROR_LOG(m_logger) << reply.str();
|
||||
|
||||
return reply;
|
||||
}
|
||||
@@ -111,13 +111,13 @@ Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyReq
|
||||
void ObjectChargeEffect::updatedProperties(const Database::AesChargeEffect &dbData)
|
||||
{
|
||||
// update properties // "used": true/false
|
||||
DEBUG_LOG()<<" !!! update charge effect when not EsPrepared !!! ";
|
||||
DEBUG_LOG(m_logger)<<" !!! update charge effect when not EsPrepared !!! ";
|
||||
const QString tmpProps = m_data.properties;
|
||||
m_data.properties = dbData.properties; // update properties is allowed!!
|
||||
if (!m_mainHandler->db()->update(m_data))
|
||||
{
|
||||
m_data.properties = tmpProps;
|
||||
ERROR_LOG()<<" Couldn't update charge effect when not EsPrepared!!!";
|
||||
ERROR_LOG(m_logger)<<" Couldn't update charge effect when not EsPrepared!!!";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,14 +127,14 @@ bool ObjectChargeEffect::remove()
|
||||
{
|
||||
if (!m_mainHandler)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to remove ChargeEffect --> No MainHandler present.";
|
||||
ERROR_LOG(m_logger) << "Not possible to remove ChargeEffect --> No MainHandler present.";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->removeChargeEffectByKey(m_data.id))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to remove ChargeEffect --> Could not remove from DDS.";
|
||||
ERROR_LOG(m_logger) << "Not possible to remove ChargeEffect --> Could not remove from DDS.";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -198,14 +198,14 @@ void ObjectChargeEffect::publish()
|
||||
{
|
||||
if (!m_mainHandler)
|
||||
{
|
||||
ERROR_LOG() << QStringLiteral("Not possible to publish ChargeEffect --> Could not remove from DDS.");
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Not possible to publish ChargeEffect --> Could not remove from DDS.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(dataBaseToDataTopic(m_data)))
|
||||
{
|
||||
ERROR_LOG() << QStringLiteral("Not possible to publish ChargeEffect --> DDS publish failed.");
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Not possible to publish ChargeEffect --> DDS publish failed.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ void ObjectChargeEffect::setNextState()
|
||||
if (oldState != m_state)
|
||||
m_stateChanged = true;
|
||||
|
||||
DEBUG_LOG() << "Switching from " << oldState << "to " << m_state;
|
||||
DEBUG_LOG(m_logger) << "Switching from " << oldState << "to " << m_state;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -317,7 +317,7 @@ void ObjectChargeEffect::calculateInitEffectState()
|
||||
|
||||
if (oldState != m_state)
|
||||
m_stateChanged = true;
|
||||
DEBUG_LOG() << "Setting init state: " << m_state;
|
||||
DEBUG_LOG(m_logger) << "Setting init state: " << m_state;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -330,7 +330,7 @@ void ObjectChargeEffect::startStateTimer()
|
||||
{
|
||||
qint64 timeToActivatedMsecs = m_data.effectStart.toMSecsSinceEpoch() - QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
DEBUG_LOG() << "Time to Avtivated [ms]: " << timeToActivatedMsecs;
|
||||
DEBUG_LOG(m_logger) << "Time to Avtivated [ms]: " << timeToActivatedMsecs;
|
||||
|
||||
m_stateTimer->start(timeToActivatedMsecs);
|
||||
|
||||
@@ -340,7 +340,7 @@ void ObjectChargeEffect::startStateTimer()
|
||||
{
|
||||
qint64 timeToExpiredMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration - QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
DEBUG_LOG() << "Time to Expired [ms]: " << timeToExpiredMsecs;
|
||||
DEBUG_LOG(m_logger) << "Time to Expired [ms]: " << timeToExpiredMsecs;
|
||||
|
||||
m_stateTimer->start(timeToExpiredMsecs);
|
||||
|
||||
@@ -350,7 +350,7 @@ void ObjectChargeEffect::startStateTimer()
|
||||
{
|
||||
qint64 timeToFinishMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration + s_afterglowMsecs - QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
DEBUG_LOG() << "Time to finish/deletion [ms]: " << timeToFinishMsecs;
|
||||
DEBUG_LOG(m_logger) << "Time to finish/deletion [ms]: " << timeToFinishMsecs;
|
||||
|
||||
m_stateTimer->start(timeToFinishMsecs);
|
||||
|
||||
|
||||
+12
-12
@@ -65,7 +65,7 @@ EffectorData ObjectEffector::effectorData() const
|
||||
|
||||
void ObjectEffector::assignAesItemRequest(int aesItemId)
|
||||
{
|
||||
DEBUG_LOG() << "assignAesItemRequest aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "assignAesItemRequest aesItemId=" << aesItemId;
|
||||
m_aesItemId = aesItemId;
|
||||
// Statemachine mit new anlegen
|
||||
if (m_effectorStateMachine)
|
||||
@@ -101,7 +101,7 @@ void ObjectEffector::assignAesItemRequest(int aesItemId)
|
||||
|
||||
void ObjectEffector::deleteAssignmentAesItem()
|
||||
{
|
||||
DEBUG_LOG() << "deleteAssignmentAesItem";
|
||||
DEBUG_LOG(m_logger) << "deleteAssignmentAesItem";
|
||||
if (m_effectorStateMachine)
|
||||
{
|
||||
delete m_effectorStateMachine;
|
||||
@@ -119,7 +119,7 @@ bool ObjectEffector::reportFireReadinessRequest() // Feuerbereitschaft melden
|
||||
|
||||
void ObjectEffector::fireOrderRequest() // Feuerbefehl erhalten
|
||||
{
|
||||
DEBUG_LOG() << "fireOrderRequest";
|
||||
DEBUG_LOG(m_logger) << "fireOrderRequest";
|
||||
if (!m_effectorStateMachine)
|
||||
return;
|
||||
|
||||
@@ -128,7 +128,7 @@ void ObjectEffector::fireOrderRequest() // Feuerbefehl erhalten
|
||||
|
||||
void ObjectEffector::fireRequest() // Feuern
|
||||
{
|
||||
DEBUG_LOG() << "fireRequest";
|
||||
DEBUG_LOG(m_logger) << "fireRequest";
|
||||
if (!m_effectorStateMachine)
|
||||
return;
|
||||
m_effectorStateMachine->fire();
|
||||
@@ -136,7 +136,7 @@ void ObjectEffector::fireRequest() // Feuern
|
||||
|
||||
bool ObjectEffector::reportFiredRequest() // Abgefeuert melden
|
||||
{
|
||||
DEBUG_LOG() << "reportFiredRequest";
|
||||
DEBUG_LOG(m_logger) << "reportFiredRequest";
|
||||
if (!m_effectorStateMachine)
|
||||
return false;
|
||||
return m_effectorStateMachine->reportFired();
|
||||
@@ -144,7 +144,7 @@ bool ObjectEffector::reportFiredRequest() // Abgefeuert melden
|
||||
|
||||
void ObjectEffector::reportEmptyChargeRequest(bool emptyCharge) // Munition leer
|
||||
{
|
||||
DEBUG_LOG() << "reportEmptyChargeRequest";
|
||||
DEBUG_LOG(m_logger) << "reportEmptyChargeRequest";
|
||||
if (!m_effectorStateMachine)
|
||||
return;
|
||||
m_effectorStateMachine->setEmptyCharge(emptyCharge);
|
||||
@@ -166,7 +166,7 @@ void ObjectEffector::resetReadynessTimer()
|
||||
void ObjectEffector::sendEffectorToDds()
|
||||
{
|
||||
// Effector Effector;
|
||||
DEBUG_LOG() << "sendEffectorToDds NewState= " << m_effectorStateMachine->getCurrentStateStr() << ", participantId=" << m_participantId
|
||||
DEBUG_LOG(m_logger) << "sendEffectorToDds NewState= " << m_effectorStateMachine->getCurrentStateStr() << ", participantId=" << m_participantId
|
||||
<< ", aesItemId=" << m_aesItemId;
|
||||
AreaEffectSimulation::Effector effector;
|
||||
effector.id(m_participantId);
|
||||
@@ -178,11 +178,11 @@ void ObjectEffector::sendEffectorToDds()
|
||||
|
||||
void ObjectEffector::onEffectorFired()
|
||||
{
|
||||
DEBUG_LOG() << "onEffectorFired";
|
||||
DEBUG_LOG(m_logger) << "onEffectorFired";
|
||||
|
||||
if (m_firingStrategy == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Not possible to fire. No firing strategy specified.";
|
||||
ERROR_LOG(m_logger) << "Not possible to fire. No firing strategy specified.";
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ void ObjectEffector::onEffectorFired()
|
||||
// Input: SAA-Format, relativ zum Geschoss in metern und die Zeit relativ zur Abschusszeit
|
||||
void ObjectEffector::setIndendedTrajectory(const std::vector<Core::RelativePositionRelativeTime> &geometryRelativeToLaunchOrigin)
|
||||
{
|
||||
DEBUG_LOG() << "setTrajectory #points=" << geometryRelativeToLaunchOrigin.size();
|
||||
DEBUG_LOG(m_logger) << "setTrajectory #points=" << geometryRelativeToLaunchOrigin.size();
|
||||
m_intendendTrajectory.clear();
|
||||
for (const Core::RelativePositionRelativeTime &geoPosRelTime : geometryRelativeToLaunchOrigin)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ void ObjectEffector::setIndendedTrajectory(const std::vector<Core::RelativePosit
|
||||
|
||||
void ObjectEffector::setEffectorData(const EffectorData &effectorData)
|
||||
{
|
||||
DEBUG_LOG() << "setEffectorData";
|
||||
DEBUG_LOG(m_logger) << "setEffectorData";
|
||||
m_effectorData = effectorData;
|
||||
setIndendedTrajectory(effectorData.trajectoryRelative());
|
||||
delete m_firingStrategy;
|
||||
@@ -221,7 +221,7 @@ void ObjectEffector::setEffectorData(const EffectorData &effectorData)
|
||||
|
||||
void ObjectEffector::logMessage(QString message)
|
||||
{
|
||||
DEBUG_LOG() << "EffectorStateMachine logMessage=" << message << ", aesItemId=" << m_aesItemId << ", m_participantId=" << m_participantId;
|
||||
DEBUG_LOG(m_logger) << "EffectorStateMachine logMessage=" << message << ", aesItemId=" << m_aesItemId << ", m_participantId=" << m_participantId;
|
||||
}
|
||||
|
||||
} // namespace AreaEffectSimulation
|
||||
+2
@@ -41,6 +41,8 @@ protected Q_SLOTS:
|
||||
|
||||
private:
|
||||
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
Core::FunctionReplyObject createObject(const Database::AesMineCorridor &data,
|
||||
const std::vector<Core::GeoPosition2D> &segmentsDds,
|
||||
const QVector<Database::AesMineCorridorSegment> &segmentsDb);
|
||||
|
||||
+16
-16
@@ -43,7 +43,7 @@ AsmTests::~AsmTests()
|
||||
// ------------------------------------------------------------------
|
||||
bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_trainingAreaId = trainingAreaId; // overwritten when new exercise created
|
||||
@@ -56,15 +56,15 @@ bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
}
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc";
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
m_ftc = AssetManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc";
|
||||
DEBUG_LOG(m_logger) << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Training Area Id = " << trainingAreaId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Training Area Id = " << trainingAreaId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
|
||||
if (!bRet)
|
||||
failExit();
|
||||
@@ -74,7 +74,7 @@ bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
if (m_testId == 1)
|
||||
QTimer::singleShot(0, this, &AsmTests::tryCreate);
|
||||
else if (m_testId == 2)
|
||||
@@ -181,7 +181,7 @@ void AsmTests::setRequestData(AssetManagement::TrainingAreaModifyRequest &reques
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::tryCreate()
|
||||
{
|
||||
INFO_LOG() << "trying to send ModifyRequest TrainingArea (create)";
|
||||
INFO_LOG(m_logger) << "trying to send ModifyRequest TrainingArea (create)";
|
||||
|
||||
AssetManagement::TrainingAreaModifyRequest request;
|
||||
|
||||
@@ -189,7 +189,7 @@ void AsmTests::tryCreate()
|
||||
|
||||
if (!m_ftc->trainingAreaModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -201,13 +201,13 @@ void AsmTests::tryCreate()
|
||||
void AsmTests::tryModify()
|
||||
{
|
||||
AssetManagement::TrainingAreaModifyRequest request;
|
||||
INFO_LOG() << "trying to send modify request for training Area Id = " << m_trainingAreaId;
|
||||
INFO_LOG(m_logger) << "trying to send modify request for training Area Id = " << m_trainingAreaId;
|
||||
|
||||
setRequestData(request, m_trainingAreaId);
|
||||
|
||||
if (!m_ftc->trainingAreaModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -218,10 +218,10 @@ void AsmTests::tryModify()
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::tryDelete()
|
||||
{
|
||||
INFO_LOG() << "trying to send delete request for exercise Id = " << m_trainingAreaId;
|
||||
INFO_LOG(m_logger) << "trying to send delete request for exercise Id = " << m_trainingAreaId;
|
||||
if (!m_ftc->trainingAreaRemoveRequest(TrainingAreaRemoveRequest(m_trainingAreaId), this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void AsmTests::tryDelete()
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got modifyReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
@@ -246,7 +246,7 @@ void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyO
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::onTrainingAreaRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
|
||||
+2
-3
@@ -51,9 +51,8 @@ ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandle
|
||||
// ####### ClientMessage end #######
|
||||
|
||||
// ####### BaseDlRequest begin #######
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid)
|
||||
: ClientMessage(dataManager, client, type, typeId, uuid)
|
||||
{}
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid) : ClientMessage(dataManager, client, type, typeId, uuid),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
void BaseDlRequest::process()
|
||||
{
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ bool WebSocketInterfaceHandler::init()
|
||||
{
|
||||
cleanup();
|
||||
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
m_dataManager = new DataManager(m_mainHandler);
|
||||
|
||||
@@ -44,16 +44,16 @@ bool WebSocketInterfaceHandler::init()
|
||||
|
||||
m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this);
|
||||
|
||||
DEBUG_LOG() << "Initialising LtsWebSocketServer";
|
||||
DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer";
|
||||
if (!m_webSocketServer->init(QStringLiteral("ASM"), Settings::getWebSocketServerPortRange(1)))
|
||||
{
|
||||
ERROR_LOG() << "Failed to initialise LtsWebSocketServer";
|
||||
ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
DEBUG_LOG() << "Connection signals and slots";
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "Connection signals and slots";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace AssetManagement
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsDts = AssetManagement::Interface::Dts::create(m_ddsConnector);
|
||||
m_ddsFts = AssetManagement::Interface::Fts::create(m_ddsConnector);
|
||||
bool 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";
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
std::shared_ptr<AssetManagement::Interface::Fts> fts() const { return m_ddsFts; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
|
||||
@@ -39,7 +39,7 @@ bool HandlerAsset::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -47,11 +47,11 @@ bool HandlerAsset::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectAssetMap.size() = " << m_objectAssetMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectAssetMap.size() = " << m_objectAssetMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void HandlerAsset::onAssetModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
{
|
||||
const auto ret = assetModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->assetModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerAsset::onAssetRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectAsset
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onAssetModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Asset &request) override;
|
||||
Core::FunctionReplyObject assetModifyRequest(const Asset &request);
|
||||
@@ -37,6 +38,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, ObjectAsset *> m_objectAssetMap;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
|
||||
@@ -45,11 +45,11 @@ bool HandlerLocation::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cb))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "#Locations published: " << iCnt;
|
||||
DEBUG_LOG(m_logger) << "#Locations published: " << iCnt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
|
||||
bool init();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
}
|
||||
@@ -39,7 +39,7 @@ bool HandlerRelayInfo::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -47,11 +47,11 @@ bool HandlerRelayInfo::init()
|
||||
};
|
||||
if (!m_mainHandler->db()->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void HandlerRelayInfo::onRelayInfoModifyRequest(const rti::core::SampleIdentity
|
||||
{
|
||||
const auto ret = relayInfoModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->relayInfoModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerRelayInfo::onRelayInfoRemoveRequest(const rti::core::SampleIdentity
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectRelayInfo
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onRelayInfoModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const RelayInfo &request) override;
|
||||
Core::FunctionReplyObject relayInfoModifyRequest(const RelayInfo &request);
|
||||
@@ -37,6 +38,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, ObjectRelayInfo*> m_objectRelayInfoMap;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
|
||||
+22
-22
@@ -42,7 +42,7 @@ bool HandlerTrainingArea::init()
|
||||
QVector<Database::AsmMapDescription> dataVecMD;
|
||||
if (!m_mainHandler->db()->select(dataVecMD))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,38 +58,38 @@ bool HandlerTrainingArea::init()
|
||||
{
|
||||
case AssetManagement::MapDescriptionType_def::Map2D:
|
||||
mapDescriptionSeq.map2D.insert(data.objOrder, data);
|
||||
INFO_LOG() << "map2D.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "map2D.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::Scene3D:
|
||||
mapDescriptionSeq.scene3D.insert(data.objOrder, data);
|
||||
INFO_LOG() << "Scene3D.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "Scene3D.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::Elevation:
|
||||
mapDescriptionSeq.elevation.insert(data.objOrder, data);
|
||||
INFO_LOG() << "Elevation.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "Elevation.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::SceneObj:
|
||||
mapDescriptionSeq.sceneObj.insert(data.objOrder, data);
|
||||
INFO_LOG() << "sceneObj.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "sceneObj.insert order =" << data.objOrder;
|
||||
break;
|
||||
}
|
||||
mapDescriptionSeqences.insert(data.trainingAreaId, mapDescriptionSeq);
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_objectMapDescriptionMap.insert(ifs->getId(), ifs);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size();
|
||||
|
||||
QVector<Database::AsmTrainingArea> dataVec;
|
||||
// read all training areas from database
|
||||
if (!m_mainHandler->db()->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -125,13 +125,13 @@ bool HandlerTrainingArea::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_objectTrainingAreaMap.insert(ifs->getId(), ifs);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -139,16 +139,16 @@ bool HandlerTrainingArea::init()
|
||||
//----------------------------------------------------------------------------------------------
|
||||
void HandlerTrainingArea::removeMapDescriptions(int trainingAreaId)
|
||||
{
|
||||
INFO_LOG() << "removeMapDescriptions trainingAreaId = " << trainingAreaId
|
||||
INFO_LOG(m_logger) << "removeMapDescriptions trainingAreaId = " << trainingAreaId
|
||||
<< " m_objectMapDescriptionMap.size = " << m_objectMapDescriptionMap.size();
|
||||
QMapIterator< int, ObjectMapDescription *> it(m_objectMapDescriptionMap);
|
||||
while ( it.hasNext())
|
||||
{
|
||||
it.next();
|
||||
INFO_LOG() << "remove map description key = " << it.key();
|
||||
INFO_LOG(m_logger) << "remove map description key = " << it.key();
|
||||
if ( it.value()->getData().trainingAreaId() == trainingAreaId)
|
||||
{
|
||||
DEBUG_LOG() << "remove id= " << it.key();
|
||||
DEBUG_LOG(m_logger) << "remove id= " << it.key();
|
||||
|
||||
ObjectMapDescription *ifs = m_objectMapDescriptionMap.value(it.key());
|
||||
|
||||
@@ -165,7 +165,7 @@ void HandlerTrainingArea::onTrainingAreaModifyRequest(const rti::core::SampleIde
|
||||
{
|
||||
const auto ret = trainingAreaModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->trainingAreaModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
}
|
||||
if (request.id() > 0) // Modify
|
||||
{
|
||||
DEBUG_LOG() << "modify: delete old entries in map_description";
|
||||
DEBUG_LOG(m_logger) << "modify: delete old entries in map_description";
|
||||
removeMapDescriptions(ifs->getId());
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert topographic entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert topographic entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -240,7 +240,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert elevation entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert elevation entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -265,7 +265,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert scene3D entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert scene3D entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -290,7 +290,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert sceneObjects entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert sceneObjects entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -335,7 +335,7 @@ void HandlerTrainingArea::onTrainingAreaRemoveRequest(const rti::core::SampleIde
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectTrainingArea
|
||||
@@ -356,7 +356,7 @@ void HandlerTrainingArea::onMapDescriptionModifyRequest(const rti::core::SampleI
|
||||
{
|
||||
const auto ret = mapDescriptionModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->mapDescriptionModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ void HandlerTrainingArea::onMapDescriptionRemoveRequest(const rti::core::SampleI
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectMapDescription
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onTrainingAreaModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const TrainingArea &request) override;
|
||||
Core::FunctionReplyObject trainingAreaModifyRequest(const TrainingArea &request);
|
||||
@@ -58,6 +59,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectTrainingArea *> m_objectTrainingAreaMap;
|
||||
QMap<int, ObjectMapDescription *> m_objectMapDescriptionMap;
|
||||
MainHandler *m_mainHandler;
|
||||
|
||||
+2
@@ -34,6 +34,8 @@ public:
|
||||
void onWorkstationLogoutRequest(const rti::core::SampleIdentity &cookie, const WorkstationLogout &request) override final;
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
QMap<int, QTimer*> m_logoutRequestMap;
|
||||
};
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
namespace AssetManagement
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_handlerTrainingArea(nullptr)
|
||||
, m_handlerWorkstationLogout(nullptr)
|
||||
, m_handlerAsset(nullptr)
|
||||
@@ -30,8 +29,8 @@ MainHandler::MainHandler(QObject *parent)
|
||||
, m_handlerRelayInfo(nullptr)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_dbHandler(nullptr)
|
||||
, m_handlerWebSocket(nullptr)
|
||||
{}
|
||||
, m_handlerWebSocket(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -52,29 +51,29 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
if (!m_dbHandler->init(0, 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);
|
||||
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.";
|
||||
|
||||
// read project specific data from database
|
||||
// publish project specific data
|
||||
// initialize all handlers
|
||||
if (!initAsmHandler())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation AsmHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation AsmHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation AsmHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation AsmHandler succesful.";
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
@@ -83,73 +82,73 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
bool MainHandler::initAsmHandler()
|
||||
{
|
||||
DEBUG_LOG() << "Start Initialisation AsmHandler";
|
||||
DEBUG_LOG(m_logger) << "Start Initialisation AsmHandler";
|
||||
|
||||
// TrainingArea
|
||||
m_handlerTrainingArea = std::make_shared<HandlerTrainingArea>(this);
|
||||
DEBUG_LOG() << "Reset HandlerTrainingArea succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerTrainingArea succesful.";
|
||||
|
||||
if (!m_handlerTrainingArea->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerTrainingArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerTrainingArea failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerTrainingArea succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerTrainingArea succesful.";
|
||||
|
||||
// WorkstationLogout
|
||||
m_handlerWorkstationLogout = std::make_shared<HandlerWorkstationLogout>(this);
|
||||
DEBUG_LOG() << "Reset HandlerWorkstationLogout succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerWorkstationLogout succesful.";
|
||||
|
||||
if (!m_handlerWorkstationLogout->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerWorkstationLogout failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerWorkstationLogout failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerWorkstationLogout succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerWorkstationLogout succesful.";
|
||||
|
||||
// Asset
|
||||
m_handlerAsset = std::make_shared<HandlerAsset>(this);
|
||||
DEBUG_LOG() << "Reset HandlerAsset succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerAsset succesful.";
|
||||
|
||||
if (!m_handlerAsset->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerAsset failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerAsset failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerAsset succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerAsset succesful.";
|
||||
|
||||
// Location
|
||||
m_handlerLocation = std::make_shared<HandlerLocation>(this);
|
||||
DEBUG_LOG() << "Reset HandlerLocation succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerLocation succesful.";
|
||||
|
||||
if (!m_handlerLocation->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerLocation failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerLocation failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerLocation succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerLocation succesful.";
|
||||
|
||||
// RelayInfo
|
||||
m_handlerRelayInfo = std::make_shared<HandlerRelayInfo>(this);
|
||||
DEBUG_LOG() << "Reset HandlerRelayInfo succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerRelayInfo succesful.";
|
||||
|
||||
if (!m_handlerRelayInfo->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerRelayInfo failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerRelayInfo failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerRelayInfo succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerRelayInfo succesful.";
|
||||
|
||||
// WebSocketServer
|
||||
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
||||
DEBUG_LOG() << "Reset WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler succesful.";
|
||||
if (!m_handlerWebSocket->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer);
|
||||
DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,10 @@ public:
|
||||
int exerciseId() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool initAsmHandler();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// std::shared_ptr<HandlerMapDescription> m_handlerMapDesc;
|
||||
std::shared_ptr<HandlerTrainingArea> m_handlerTrainingArea;
|
||||
std::shared_ptr<HandlerWorkstationLogout> m_handlerWorkstationLogout;
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectAsset::ObjectAsset(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectAsset::ObjectAsset(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectAsset::createObject(const Asset &data)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmAsset-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New assetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New assetId: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectAsset::updateObject(const Asset &data)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmAsset-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for assetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for assetId: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectAsset::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectAsset::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmAsset-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmAsset-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmAsset-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmAsset-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
static Asset toDdsData(const Database::AsmAsset &dbData); // db -> dds
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
+5
-6
@@ -12,10 +12,9 @@
|
||||
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_order(-1)
|
||||
{
|
||||
ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler) : m_mainHandler(mainHandler)
|
||||
, m_order(-1),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
bool ObjectMapDescription::isValid() const
|
||||
@@ -38,7 +37,7 @@ Core::FunctionReplyObject ObjectMapDescription::createObject(const MapDescriptio
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmMapDescription-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New MapDescription Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New MapDescription Id: " << m_data.id();
|
||||
}
|
||||
else if (order != m_order && m_order >= 0)
|
||||
{
|
||||
@@ -64,7 +63,7 @@ Core::FunctionReplyObject ObjectMapDescription::updateObject(const MapDescriptio
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmMapDescription-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for MapDescription Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for MapDescription Id: " << m_data.id();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
static MapDescription toDdsData(const Database::AsmMapDescription &dbData); // db -> dds
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
MapDescription m_data;
|
||||
int m_order;
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectRelayInfo::createObject(const RelayInfo &data)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmEgcuRelayInfo-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New relayInfo Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New relayInfo Id: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectRelayInfo::updateObject(const RelayInfo &data)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmEgcuRelayInfo-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for relayInfo Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for relayInfo Id: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectRelayInfo::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectRelayInfo::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmEgcuRelayInfo-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmEgcuRelayInfo-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
static RelayInfo toDdsData(const Database::AsmEgcuRelayInfo &dbData); // db -> dds
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
+6
-7
@@ -14,9 +14,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -53,7 +52,7 @@ Core::FunctionReplyObject ObjectTrainingArea::createObject(const TrainingArea &d
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmTrainingArea-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New mapId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New mapId: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -75,7 +74,7 @@ Core::FunctionReplyObject ObjectTrainingArea::updateObject(const TrainingArea &d
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmTrainingArea-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for mapId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for mapId: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -115,10 +114,10 @@ Core::FunctionReplyObject ObjectTrainingArea::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectTrainingArea::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmTrainingArea-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmTrainingArea-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
static Database::AsmTrainingArea toDbData(const TrainingArea &ddsData); // dds -> db
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
+20
-20
@@ -36,7 +36,7 @@ AvmFtTests::~AvmFtTests()
|
||||
// ------------------------------------------------------------------------------
|
||||
bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_menuStructId = menuId;
|
||||
@@ -47,14 +47,14 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc AVM";
|
||||
DEBUG_LOG(m_logger) << "create ftc AVM";
|
||||
m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc AVM";
|
||||
DEBUG_LOG(m_logger) << "init ftc AVM";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end AVM - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end AVM - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
if (m_testId <= 1)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryCreate);
|
||||
else if (m_testId == 2)
|
||||
@@ -74,7 +74,7 @@ void AvmFtTests::startTest()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryCreate()
|
||||
{
|
||||
INFO_LOG() << "trying to send createMenuStructRequest";
|
||||
INFO_LOG(m_logger) << "trying to send createMenuStructRequest";
|
||||
|
||||
m_menuStructId = -2;
|
||||
ModifyMenuStructRequest request;
|
||||
@@ -101,7 +101,7 @@ void AvmFtTests::tryCreate()
|
||||
|
||||
if (!m_ftc->modifyMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void AvmFtTests::tryCreate()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryModify()
|
||||
{
|
||||
INFO_LOG() << "trying to send modify request for menuStructId = " << m_menuStructId;
|
||||
INFO_LOG(m_logger) << "trying to send modify request for menuStructId = " << m_menuStructId;
|
||||
ModifyMenuStructRequest request;
|
||||
request.id(m_menuStructId);
|
||||
request.name("TestGlobalMenuModify");
|
||||
@@ -134,7 +134,7 @@ void AvmFtTests::tryModify()
|
||||
|
||||
if (!m_ftc->modifyMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -142,13 +142,13 @@ void AvmFtTests::tryModify()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryDelete()
|
||||
{
|
||||
INFO_LOG() << "trying to send delete request for menuStructId = " << m_menuStructId;
|
||||
INFO_LOG(m_logger) << "trying to send delete request for menuStructId = " << m_menuStructId;
|
||||
RemoveMenuStructRequest request;
|
||||
request.id(m_menuStructId);
|
||||
|
||||
if (!m_ftc->removeMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -167,15 +167,15 @@ void AvmFtTests::createMenuStructReply(const Core::FunctionReplyObject &replyObj
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onCreateMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onCreateMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
m_menuStructId = replyObject.id();
|
||||
|
||||
DEBUG_LOG() << "m_testId = " << m_testId;
|
||||
DEBUG_LOG(m_logger) << "m_testId = " << m_testId;
|
||||
|
||||
if(m_testId == 0)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryModify);
|
||||
@@ -188,11 +188,11 @@ void AvmFtTests::modifyMenuStructReply(const Core::FunctionReplyObject &replyObj
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onModifyMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onModifyMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got modifyRequest with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
if(m_testId == 0)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryDelete);
|
||||
@@ -205,11 +205,11 @@ void AvmFtTests::onRemoveMenuStructReply(const Core::FunctionReplyObject &replyO
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onRemoveMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onRemoveMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
+1
@@ -50,6 +50,7 @@ protected Q_SLOTS:
|
||||
void tryModify();
|
||||
void tryDelete();
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onModifyMenuStructReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void createMenuStructReply(const Core::FunctionReplyObject &replyObject);
|
||||
void modifyMenuStructReply(const Core::FunctionReplyObject &replyObject);
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ private slots:
|
||||
void test();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void create();
|
||||
void modify();
|
||||
void remove();
|
||||
|
||||
+33
-33
@@ -38,7 +38,7 @@ MvsTests::~MvsTests()
|
||||
//----------------------------------------------------------------------------------
|
||||
bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int stationId, int exerciseId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_teamId = teamId;
|
||||
@@ -52,18 +52,18 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc MVS";
|
||||
DEBUG_LOG(m_logger) << "create ftc MVS";
|
||||
m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc MVS";
|
||||
DEBUG_LOG(m_logger) << "init ftc MVS";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end MVS - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end MVS - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Team Id = " << teamId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG() << "Receiver Id = " << receiverId;
|
||||
DEBUG_LOG() << "Radio Station Id = " << stationId;
|
||||
DEBUG_LOG() << "Exercise Id = " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Team Id = " << teamId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Receiver Id = " << receiverId;
|
||||
DEBUG_LOG(m_logger) << "Radio Station Id = " << stationId;
|
||||
DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
switch (m_testId)
|
||||
{
|
||||
// case 1:
|
||||
@@ -99,18 +99,18 @@ void MvsTests::startTest()
|
||||
tryModifyAvsVideoReceiver();
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << "Unknown test case !";
|
||||
ERROR_LOG(m_logger) << "Unknown test case !";
|
||||
failExit();
|
||||
break;
|
||||
}
|
||||
INFO_LOG() << "********* endTest **************";
|
||||
INFO_LOG(m_logger) << "********* endTest **************";
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//void MvsTests::tryCreateVideoTeam()
|
||||
//{
|
||||
// INFO_LOG() << "trying to send createRequest VideoTeam";
|
||||
// INFO_LOG(m_logger) << "trying to send createRequest VideoTeam";
|
||||
// VideoTeamModifyRequest request;
|
||||
|
||||
// request.id(0);
|
||||
@@ -125,7 +125,7 @@ void MvsTests::startTest()
|
||||
|
||||
// if (!m_ftc->videoTeamModifyRequest(request, this))
|
||||
// {
|
||||
// INFO_LOG() << "Error requesting create data, as expected";
|
||||
// INFO_LOG(m_logger) << "Error requesting create data, as expected";
|
||||
// successExit();
|
||||
// }
|
||||
|
||||
@@ -150,7 +150,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
|
||||
if (!m_ftc->videoTeamModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
|
||||
// if (!m_ftc->videoTeamRemoveRequest(request, this))
|
||||
// {
|
||||
// ERROR_LOG() << "Error requesting remove data";
|
||||
// ERROR_LOG(m_logger) << "Error requesting remove data";
|
||||
// failExit();
|
||||
// }
|
||||
|
||||
@@ -176,7 +176,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::tryCreateVideoReceiver()
|
||||
{
|
||||
INFO_LOG() << "trying to send createRequest VideoReceiver";
|
||||
INFO_LOG(m_logger) << "trying to send createRequest VideoReceiver";
|
||||
VideoReceiverModifyRequest request;
|
||||
|
||||
request.id(0);
|
||||
@@ -189,7 +189,7 @@ void MvsTests::tryCreateVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void MvsTests::tryModifyVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ void MvsTests::tryModifyAvsVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyAvsRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify AVS data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify AVS data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ void MvsTests::tryModifyActiveVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyActiveRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify active data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify active data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ void MvsTests::tryDeleteVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverRemoveRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data";
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ void MvsTests::tryDeleteVideoReceiver()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::failExit()
|
||||
{
|
||||
ERROR_LOG() << "FAIL EXIT !";
|
||||
ERROR_LOG(m_logger) << "FAIL EXIT !";
|
||||
m_bTestsSuccessful = false;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void MvsTests::failExit()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::successExit()
|
||||
{
|
||||
INFO_LOG() << "SUCCES EXIT !";
|
||||
INFO_LOG(m_logger) << "SUCCES EXIT !";
|
||||
m_bTestsSuccessful = true;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -291,14 +291,14 @@ void MvsTests::successExit()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onVideoTeamModifyReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onVideoTeamModifyReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onVideoTeamModifyReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onVideoTeamModifyReply error: " << replyObject();
|
||||
QTimer::singleShot(0, qApp, SLOT(quit()));
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got Reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_teamId = replyObject.id();
|
||||
@@ -309,14 +309,14 @@ void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObje
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onVideoReceiverModifyReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onVideoReceiverModifyReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onVideoReceiverModifyReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onVideoReceiverModifyReply error: " << replyObject();
|
||||
QTimer::singleShot(0, qApp, SLOT(quit()));
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got Reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_receiverId = replyObject.id();
|
||||
@@ -327,7 +327,7 @@ void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &reply
|
||||
// ------------------------------------------------------------------------------
|
||||
void MvsTests::onError(const QString &reason)
|
||||
{
|
||||
ERROR_LOG() << "Got Reply error: " << reason;
|
||||
ERROR_LOG(m_logger) << "Got Reply error: " << reason;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ void MvsTests::onReply(const Core::FunctionReplyObject &replyObject)
|
||||
onError(replyObject.translated());
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got Reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
// QTimer::singleShot(0, qApp, SLOT(quit()));
|
||||
}
|
||||
|
||||
+1
-1
@@ -373,7 +373,7 @@ bool AssetAssignmentManager::hasPendingModifications(int assetId)
|
||||
|
||||
void AssetAssignmentManager::logPending()
|
||||
{
|
||||
DEBUG_LOG() << "pending Mounts, Modifications (Asset), Unmounts, Removes: "
|
||||
DEBUG_LOG(m_logger) << "pending Mounts, Modifications (Asset), Unmounts, Removes: "
|
||||
<< m_pendingMounts.size() << ", "
|
||||
<< m_pendingModifications.size() << ", "
|
||||
<< m_pendingUnmounts.size() << ", "
|
||||
|
||||
+2
-2
@@ -323,7 +323,7 @@ void AudioVideoHandlerImpl::onAssetChanged(Asset *asset)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(asset);
|
||||
DEBUG_LOG() << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")";
|
||||
|
||||
updateDeviceConfig(asset);
|
||||
}
|
||||
@@ -332,7 +332,7 @@ void AudioVideoHandlerImpl::onMountingPointChanged(MountingPoint *mountingPoint)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(mountingPoint);
|
||||
DEBUG_LOG() << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")";
|
||||
|
||||
updateDeviceConfig(mountingPoint->asset());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ AVSocket::~AVSocket()
|
||||
|
||||
void AVSocket::onDisconnected()
|
||||
{
|
||||
// WARNING_LOG() << "Disconnected from A/V system ("
|
||||
// WARNING_LOG(m_logger) << "Disconnected from A/V system ("
|
||||
// << getConnectionString()
|
||||
// << ") - trying to reconnect";
|
||||
m_bSuccessfullyLoggedIn = false;
|
||||
@@ -80,7 +80,7 @@ void AVSocket::onError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
if (!m_bErrorInTcpComWarnedOnce)
|
||||
{
|
||||
ERROR_LOG() << "Error in tcp communication with A/V system ("
|
||||
ERROR_LOG(m_logger) << "Error in tcp communication with A/V system ("
|
||||
<< getConnectionString()
|
||||
<< "): " << QVariant::fromValue(error).toString();
|
||||
m_bErrorInTcpComWarnedOnce = true;
|
||||
@@ -123,7 +123,7 @@ bool AVSocket::sendInternal(const QByteArray &cmd)
|
||||
{
|
||||
if (!m_avsSocket || !m_avsSocket->isWritable())
|
||||
{
|
||||
WARNING_LOG() << "AVS not connected - can not send command '"
|
||||
WARNING_LOG(m_logger) << "AVS not connected - can not send command '"
|
||||
<< cmd << "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ void AvaComm::parseResponse(const QByteArray &line)
|
||||
}
|
||||
|
||||
default:
|
||||
DEBUG_LOG() << "Response not implemented: " << line;
|
||||
DEBUG_LOG(m_logger) << "Response not implemented: " << line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -288,13 +288,13 @@ void AvaControl::keepAlive()
|
||||
void AvaControl::onConnected()
|
||||
{
|
||||
m_connected = true;
|
||||
DEBUG_LOG() << "connected";
|
||||
DEBUG_LOG(m_logger) << "connected";
|
||||
}
|
||||
|
||||
void AvaControl::onDisconnected()
|
||||
{
|
||||
m_connected = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
m_queue.flush();
|
||||
}
|
||||
|
||||
@@ -303,12 +303,12 @@ void AvaControl::onTimeout()
|
||||
ICommand *cmd = m_queue.currentCommand();
|
||||
if (cmd->canTimeout())
|
||||
{
|
||||
INFO_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
INFO_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
m_queue.done();
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR_LOG() << "command timed out";
|
||||
ERROR_LOG(m_logger) << "command timed out";
|
||||
failed(cmd);
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void AvaControl::queue(ICommand *cmd, LtsUtils::IConnection *connection)
|
||||
|
||||
if (!m_connected)
|
||||
{
|
||||
DEBUG_LOG() << "not connected -> dropping command";
|
||||
DEBUG_LOG(m_logger) << "not connected -> dropping command";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ void AvaControl::failed(AvaCommands::SetScript *cmd)
|
||||
|
||||
void AvaControl::failed(ICommand *cmd)
|
||||
{
|
||||
ERROR_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
ERROR_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
Q_ASSERT(cmd == m_queue.currentCommand());
|
||||
auto cmdSetScript = dynamic_cast<AvaCommands::SetScript*>(cmd);
|
||||
if (cmdSetScript)
|
||||
|
||||
@@ -64,7 +64,7 @@ void AvaSession::onConnected()
|
||||
m_established = true;
|
||||
if (m_keepAliveEnabled)
|
||||
m_keepAliveTimer.start();
|
||||
DEBUG_LOG() << "session established";
|
||||
DEBUG_LOG(m_logger) << "session established";
|
||||
emit sessionEstablished();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void AvaSession::onDisconnected()
|
||||
{
|
||||
m_keepAliveTimer.stop();
|
||||
m_established = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
emit disconnected();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -37,7 +37,7 @@ void AvsCommandQueue::queue(std::unique_ptr<ICommand> cmd, std::unique_ptr<LtsUt
|
||||
|
||||
bool noPendingCommand = m_queue.empty();
|
||||
m_queue.push_back(CommandWithConn{std::move(cmd), std::move(connection)});
|
||||
DEBUG_LOG() << "queueing command, queue size: " << m_queue.size();
|
||||
DEBUG_LOG(m_logger) << "queueing command, queue size: " << m_queue.size();
|
||||
tryReduce();
|
||||
if (noPendingCommand)
|
||||
nextCommand();
|
||||
@@ -48,7 +48,7 @@ void AvsCommandQueue::done()
|
||||
Q_ASSERT(!m_queue.empty());
|
||||
m_timer.stop();
|
||||
m_queue.pop_front();
|
||||
DEBUG_LOG() << "command finished, queue size: " << m_queue.size();
|
||||
DEBUG_LOG(m_logger) << "command finished, queue size: " << m_queue.size();
|
||||
if (m_queue.empty())
|
||||
emit queueEmpty();
|
||||
else
|
||||
@@ -79,7 +79,7 @@ void AvsCommandQueue::flush()
|
||||
if (m_queue.empty())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "flushing " << m_queue.size() << " commands";
|
||||
DEBUG_LOG(m_logger) << "flushing " << m_queue.size() << " commands";
|
||||
m_timer.stop();
|
||||
m_queue.clear();
|
||||
emit queueEmpty();
|
||||
@@ -95,7 +95,7 @@ void AvsCommandQueue::nextCommand()
|
||||
{
|
||||
Q_ASSERT(!m_queue.empty());
|
||||
|
||||
DEBUG_LOG() << "sending next command";
|
||||
DEBUG_LOG(m_logger) << "sending next command";
|
||||
ICommand *cmd = currentCommand();
|
||||
m_timer.start();
|
||||
cmd->send();
|
||||
@@ -124,7 +124,7 @@ void AvsCommandQueue::tryReduce()
|
||||
if (!lastCommand.cmd->nullifies(current.cmd.get()))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "dropping command due to override";
|
||||
DEBUG_LOG(m_logger) << "dropping command due to override";
|
||||
m_queue.erase(m_queue.begin() + i);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
Database::AvmDeviceConfig deviceConfig = m_handler->toDeviceConfig(config);
|
||||
bool status = m_db->insert(deviceConfig);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while inserting device config";
|
||||
ERROR_LOG(m_logger) << "Error while inserting device config";
|
||||
|
||||
m_cache.insert(config.id(), deviceConfig);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
newDeviceConfig.id = oldDeviceConfig.id;
|
||||
bool status = m_db->update(newDeviceConfig);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while updating device config";
|
||||
ERROR_LOG(m_logger) << "Error while updating device config";
|
||||
|
||||
m_cache[config.id()] = newDeviceConfig;
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
|
||||
bool status = m_db->removeAvmDeviceConfig(m_cache.value(configId).id);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while removing device config";
|
||||
ERROR_LOG(m_logger) << "Error while removing device config";
|
||||
|
||||
m_cache.remove(configId);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -230,7 +230,7 @@ bool CnrHandler::init()
|
||||
|
||||
if (!m_db->select(m_channels))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting cnr channels from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting cnr channels from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ bool CnrHandler::init()
|
||||
QVector<AvmCnrConfig> cnrConfigs;
|
||||
if (!m_db->select(cnrConfigs))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting CNR configs from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting CNR configs from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ void CnrHandler::onRemoveCnrConfigRequest(const rti::core::SampleIdentity &cooki
|
||||
{
|
||||
auto ret = removeCnrConfig(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeCnrConfigReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -284,19 +284,19 @@ void CnrHandler::onModifyCnrConfigRequest(const rti::core::SampleIdentity &cooki
|
||||
{
|
||||
auto ret = (request.id() < 1 ? createCnrConfig(request) : modifyCnrConfig(request));
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyCnrConfigReply(cookie, ret);
|
||||
}
|
||||
|
||||
void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString &hostname)
|
||||
{
|
||||
DEBUG_LOG() << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'";
|
||||
DEBUG_LOG(m_logger) << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'";
|
||||
auto it = m_cnrRadioStations.find(id);
|
||||
if (it != m_cnrRadioStations.end() && it.value() == hostname)
|
||||
return;
|
||||
if (hostname.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!";
|
||||
WARNING_LOG(m_logger) << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!";
|
||||
return;
|
||||
}
|
||||
m_cnrRadioStations[id] = hostname;
|
||||
@@ -305,7 +305,7 @@ void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString
|
||||
|
||||
void CnrHandler::onRadioStationRemoved(int id)
|
||||
{
|
||||
DEBUG_LOG() << "Removing radio station with id " << id;
|
||||
DEBUG_LOG(m_logger) << "Removing radio station with id " << id;
|
||||
auto it = m_cnrRadioStations.find(id);
|
||||
if (it == m_cnrRadioStations.end())
|
||||
return;
|
||||
@@ -347,7 +347,7 @@ void CnrHandler::onDbDeleteAvmCnrConfig(const QVariant &id)
|
||||
if (!m_cache.contains(configId))
|
||||
return; // the notification was a result of our own removal of the entry
|
||||
|
||||
DEBUG_LOG() << "DB deleted AvmCnrConfig with id: " << configId;
|
||||
DEBUG_LOG(m_logger) << "DB deleted AvmCnrConfig with id: " << configId;
|
||||
|
||||
removeCnrConfig(Core::RemoveElementRequest(configId));
|
||||
}
|
||||
@@ -385,7 +385,7 @@ void CnrHandler::reevalutate()
|
||||
{
|
||||
auto reply = modifyCnrConfig(toRequest(cnrConfig));
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply();
|
||||
ERROR_LOG(m_logger) << reply();
|
||||
}
|
||||
|
||||
trans.commit();
|
||||
@@ -558,7 +558,7 @@ bool CnrHandler::isNameUnique(const std::string &name, const boost::optional<int
|
||||
*/
|
||||
Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigRequest &request, const boost::optional<int32_t> &dbId)
|
||||
{
|
||||
DEBUG_LOG() << "CreateCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "CreateCnrConfigRequest: " << request;
|
||||
|
||||
auto reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -586,7 +586,7 @@ Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigReque
|
||||
|
||||
Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "ModifyCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "ModifyCnrConfigRequest: " << request;
|
||||
|
||||
auto reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -630,7 +630,7 @@ Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigReque
|
||||
|
||||
Core::FunctionReplyObject CnrHandler::removeCnrConfig(const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "RemoveCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "RemoveCnrConfigRequest: " << request;
|
||||
|
||||
int32_t configId = request.id();
|
||||
Core::FunctionReplyObject reply(configId);
|
||||
|
||||
+9
-9
@@ -144,7 +144,7 @@ bool CnrTvcProfileHandler::init()
|
||||
bool status = m_db->select(circuitContainersDb);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
bool status = m_db->selectByContainerId(circuitsContentDb, circuitContainerDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
{
|
||||
status = m_db->removeAvmCnrTvcProfileData(invalid.id);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id;
|
||||
ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id;
|
||||
auto newEnd = std::remove_if(circuitsContentDb.begin(), circuitsContentDb.end(), [&invalid] (const Database::AvmCnrTvcProfileData &circuit) { return circuit.id == invalid.id; });
|
||||
circuitsContentDb.erase(newEnd, circuitsContentDb.end());
|
||||
}
|
||||
@@ -198,7 +198,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
status = m_db->removeAvmCnrTvcProfile(circuitContainerDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id;
|
||||
ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ void CnrTvcProfileHandler::onModifyCnrTvcProfileRequest(const rti::core::SampleI
|
||||
rep = modifyProfile(request);
|
||||
|
||||
if (rep.error())
|
||||
WARNING_LOG() << rep.str();
|
||||
WARNING_LOG(m_logger) << rep.str();
|
||||
|
||||
m_fts->modifyCnrTvcProfileReply(cookie, rep);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void CnrTvcProfileHandler::onRemoveCnrTvcProfileRequest(const rti::core::SampleI
|
||||
Core::FunctionReplyObject rep = removeProfile(request);
|
||||
|
||||
if (rep.error())
|
||||
WARNING_LOG() << rep.str();
|
||||
WARNING_LOG(m_logger) << rep.str();
|
||||
|
||||
m_fts->removeCnrTvcProfileReply(cookie, rep);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ void CnrTvcProfileHandler::addProfile(const CnrTvcProfile &profile)
|
||||
|
||||
bool status = m_dts->publish(profile);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id());
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::removeProfile(int64_t id)
|
||||
@@ -375,7 +375,7 @@ void CnrTvcProfileHandler::removeProfile(int64_t id)
|
||||
|
||||
bool status = m_dts->removeCnrTvcProfileByKey(id);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id);
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id);
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile)
|
||||
@@ -393,7 +393,7 @@ void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile)
|
||||
|
||||
bool status = m_dts->publish(profile);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id());
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::onCnrConfigChanged(const CnrConfig &cnrConfig)
|
||||
|
||||
@@ -27,14 +27,14 @@ namespace AudioVideoManagement
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
|
||||
+3
-4
@@ -70,14 +70,13 @@ bool isStreamOfInterest(const AudioVideoManagement::Stream &stream, bool isAudio
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc)
|
||||
: m_context(context)
|
||||
DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc) : m_context(context)
|
||||
, m_dts(dts)
|
||||
, m_videoTeamHandler(handlerVideoTeams)
|
||||
, m_ismDtc(ismDtc)
|
||||
, m_timer(new QTimer)
|
||||
, m_isInitialized(false)
|
||||
{
|
||||
, m_isInitialized(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(ismDtc);
|
||||
if(!m_ismDtc->isMainStructureElementEnabled())
|
||||
|
||||
@@ -69,6 +69,8 @@ signals:
|
||||
void assetUnassigned(Asset *asset);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
ExerciseContext m_context;
|
||||
std::map<int, std::unique_ptr<Asset>> m_assets;
|
||||
std::map<int, std::unique_ptr<MountingPoint>> m_mountingPoints;
|
||||
|
||||
+13
-14
@@ -35,16 +35,15 @@ bool isActive(ExerciseManagement::ExerciseState state)
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId)
|
||||
: QObject()
|
||||
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId) : QObject()
|
||||
, m_exContext(exerciseId)
|
||||
, m_curExerciseState(ExerciseManagement::ExerciseState::Unknown)
|
||||
, m_curAVOperatingMode(AVControl::OperatingMode::Unknown)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_updateTimer(new QTimer(this))
|
||||
, m_lastSeenTimer(new QTimer(this))
|
||||
, m_bWarnedOnce(false)
|
||||
{
|
||||
, m_bWarnedOnce(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_updateTimer->setSingleShot(true);
|
||||
connect(m_updateTimer, &QTimer::timeout, this, &ExerciseHandler::onUpdateTimerTimeout);
|
||||
|
||||
@@ -74,7 +73,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
m_recordSession.type = avTypeRecordSession();
|
||||
if (!db()->insert(m_recordSession))
|
||||
{
|
||||
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
return;
|
||||
}
|
||||
emit avDbReloadNeeded();
|
||||
@@ -88,7 +87,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
m_replaySession.type = avTypePlaybackSession();
|
||||
if (!db()->insert(m_replaySession))
|
||||
{
|
||||
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
return;
|
||||
}
|
||||
emit avDbReloadNeeded();
|
||||
@@ -98,7 +97,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newState)
|
||||
{
|
||||
Q_ASSERT(newState != ExerciseManagement::ExerciseState::Unknown);
|
||||
INFO_LOG() << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
|
||||
INFO_LOG(m_logger) << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
|
||||
|
||||
if (m_curExerciseState == newState)
|
||||
return;
|
||||
@@ -120,12 +119,12 @@ void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newS
|
||||
{
|
||||
if (newIsActive)
|
||||
{
|
||||
DEBUG_LOG() << m_exContext << " activated";
|
||||
DEBUG_LOG(m_logger) << m_exContext << " activated";
|
||||
emit contextActivated();
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << m_exContext << " deactivated";
|
||||
DEBUG_LOG(m_logger) << m_exContext << " deactivated";
|
||||
emit contextDeactivated();
|
||||
}
|
||||
}
|
||||
@@ -163,12 +162,12 @@ void ExerciseHandler::onUpdateTimerTimeout()
|
||||
if (m_curAVOperatingMode == desiredOperatingMode)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
|
||||
DEBUG_LOG(m_logger) << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
|
||||
if (!avControl()->setOperatingModeForContext(m_exContext, desiredOperatingMode))
|
||||
{
|
||||
if (!m_bWarnedOnce)
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << m_exContext
|
||||
DEBUG_LOG(m_logger) << "Context: " << m_exContext
|
||||
<< " - could not change operating mode, maybe not yet connected to AVS - trying again in 5 seconds";
|
||||
m_bWarnedOnce = true;
|
||||
}
|
||||
@@ -205,7 +204,7 @@ void ExerciseHandler::onLastSeenTimerTimeout()
|
||||
m_lastSeen.lastSeen.isNull() ||
|
||||
m_lastSeen.lastSeen.addDays(1) < QDateTime::currentDateTimeUtc())
|
||||
{
|
||||
INFO_LOG() << "Exercise with id " << m_exContext.id()
|
||||
INFO_LOG(m_logger) << "Exercise with id " << m_exContext.id()
|
||||
<< " not seen since more than 1 day -> removing";
|
||||
// not seen at all or not since more than 1 day -> remove
|
||||
setNewExerciseState(ExerciseManagement::ExerciseState::Terminated);
|
||||
@@ -224,13 +223,13 @@ void ExerciseHandler::onOperatingModeChanged(const ExerciseContext &context,
|
||||
|
||||
if (desiredOperatingMode != om)
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << context << " Got " << om
|
||||
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
|
||||
<< " for " << comp << " but expected " << desiredOperatingMode;
|
||||
m_updateTimer->start(100);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << context << " Got " << om
|
||||
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
|
||||
<< " for " << comp << " which is the expected value";
|
||||
m_updateTimer->stop();
|
||||
}
|
||||
|
||||
+5
-6
@@ -52,11 +52,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
ExercisesHandler::ExercisesHandler(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
ExercisesHandler::ExercisesHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler)
|
||||
, m_triggerAvUpdateTimer(new QTimer(this))
|
||||
, m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc()))
|
||||
{
|
||||
, m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc())),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_triggerAvUpdateTimer->setSingleShot(true);
|
||||
m_triggerAvUpdateTimer->setInterval(1000);
|
||||
connect(m_triggerAvUpdateTimer, &QTimer::timeout,
|
||||
@@ -98,7 +97,7 @@ bool ExercisesHandler::init()
|
||||
connect(exmDtc(), &ExerciseManagement::Interface::Dtc::exerciseChanged,
|
||||
this, &ExercisesHandler::onExerciseChanged);
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " done";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " done";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ ExerciseHandler *ExercisesHandler::getOrCreateExerciseHandler(int exerciseId)
|
||||
|
||||
ExerciseHandler *ExercisesHandler::createExerciseHandler(int exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << "Creating handler for exercise " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Creating handler for exercise " << exerciseId;
|
||||
|
||||
ExerciseParts parts(m_mainHandler, m_assetAssignmentManager->exercise(exerciseId));
|
||||
ExerciseHandler *exH = parts.exerciseHandler();
|
||||
|
||||
@@ -78,6 +78,7 @@ public slots:
|
||||
void onAvDbReloadNeeded();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void createExerciseHandlerFromLastSeen(const Database::AvmExerciseLastSeen &lastSeen);
|
||||
ExerciseHandler *getOrCreateExerciseHandler(int exerciseId);
|
||||
ExerciseHandler *createExerciseHandler(int exerciseId);
|
||||
@@ -92,6 +93,7 @@ private slots:
|
||||
void exerciseFinished(int exerciseId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
QTimer *m_triggerAvUpdateTimer;
|
||||
std::unique_ptr<AssetAssignmentManager> m_assetAssignmentManager;
|
||||
|
||||
+15
-15
@@ -156,7 +156,7 @@ bool FrequencyPlanningHandler::init()
|
||||
QVector<Database::AvmFrequencyPlanning> frequencyPlannings;
|
||||
if (!m_db->select(frequencyPlannings))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting frequency plannings from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting frequency plannings from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -169,11 +169,11 @@ bool FrequencyPlanningHandler::init()
|
||||
m_activePlannings.insert(exerciseId, currentDbData);
|
||||
|
||||
if (!m_dts->publish(ActiveFrequencyPlanning(exerciseId, currentDbData.frequencyPlanningId)))
|
||||
ERROR_LOG() << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId;
|
||||
ERROR_LOG(m_logger) << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId;
|
||||
};
|
||||
if (!m_db->select(cbAfp))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting AvmActiveFrequencyPlannings from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting AvmActiveFrequencyPlannings from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void FrequencyPlanningHandler::onModifyFrequencyPlanningRequest(const rti::core:
|
||||
{
|
||||
auto ret = request.id() > 0 ? handleModify(request) : handleCreate(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void FrequencyPlanningHandler::onRemoveFrequencyPlanningRequest(const rti::core:
|
||||
{
|
||||
auto ret = handleRemove(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ void FrequencyPlanningHandler::onModifyActiveFrequencyPlanningRequest(const rti:
|
||||
{
|
||||
auto ret = modifyActiveFrequencyPlanningRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyActiveFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ void FrequencyPlanningHandler::onRemoveActiveFrequencyPlanningRequest(const rti:
|
||||
{
|
||||
auto ret = removeActiveFrequencyPlanningRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeActiveFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre
|
||||
status = m_db->insert(dbEntry);
|
||||
if (!status)
|
||||
{
|
||||
WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB";
|
||||
WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB";
|
||||
break;
|
||||
}
|
||||
dbEntries.push_back(dbEntry);
|
||||
@@ -307,7 +307,7 @@ Q_ASSERT(request.id() > 0);
|
||||
status = m_db->insert(dbEntry);
|
||||
if (!status)
|
||||
{
|
||||
WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB";
|
||||
WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB";
|
||||
break;
|
||||
}
|
||||
dbEntries.push_back(dbEntry);
|
||||
@@ -444,7 +444,7 @@ std::vector<Database::AvmFrequencyPlanningData> FrequencyPlanningHandler::insert
|
||||
|
||||
Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlanningRequest(const ModifyActiveFrequencyPlanningRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "ModifyActiveFrequencyPlanningRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "ModifyActiveFrequencyPlanningRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -480,7 +480,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlannin
|
||||
|
||||
Core::FunctionReplyObject FrequencyPlanningHandler::removeActiveFrequencyPlanningRequest(const RemoveActiveFrequencyPlanningRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "RemoveActiveFrequencyPlanningRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "RemoveActiveFrequencyPlanningRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject reply(request.exerciseId());
|
||||
|
||||
@@ -668,7 +668,7 @@ bool FrequencyPlanningHandler::collectAndPublish(const Database::AvmFrequencyPla
|
||||
bool status = m_db->selectByFrequencyPlanningId(dbEntries, planDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error selecting AvmFrequencyPlanningData from db";
|
||||
ERROR_LOG(m_logger) << "Error selecting AvmFrequencyPlanningData from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ void FrequencyPlanningHandler::addPlan(const FrequencyPlanning &plan)
|
||||
|
||||
bool status = m_dts->publish(plan);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id());
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void FrequencyPlanningHandler::updatePlan(const FrequencyPlanning &plan)
|
||||
|
||||
bool status = m_dts->publish(plan);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id());
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
@@ -720,7 +720,7 @@ void FrequencyPlanningHandler::removePlan(int32_t planId)
|
||||
|
||||
bool status = m_dts->removeFrequencyPlanningByKey(planId);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId);
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId);
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
|
||||
+8
-9
@@ -16,26 +16,25 @@
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(db);
|
||||
}
|
||||
|
||||
bool FrequencySetHandler::init()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
QVector<Database::AvmFrequencySet> frequencySets;
|
||||
|
||||
// Don't use select() with callback here as the callback (body of for-loop below) would use the DB, too.
|
||||
if (!m_db->select(frequencySets))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting frequency sets from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting frequency sets from db";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Found " << frequencySets.size() << " Frequency Sets";
|
||||
DEBUG_LOG(m_logger) << "Found " << frequencySets.size() << " Frequency Sets";
|
||||
|
||||
for (const Database::AvmFrequencySet ¤tfrequencySet : std::as_const(frequencySets))
|
||||
addFrequencySet(toDdsFrequencySet(currentfrequencySet));
|
||||
@@ -66,7 +65,7 @@ FrequencySet FrequencySetHandler::toDdsFrequencySet(const Database::AvmFrequency
|
||||
};
|
||||
m_db->selectByFrequencySetId(cb, result.id());
|
||||
|
||||
DEBUG_LOG() << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries";
|
||||
DEBUG_LOG(m_logger) << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries";
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -122,7 +121,7 @@ void FrequencySetHandler::addFrequencySet(const FrequencySet &frequencySet)
|
||||
m_frequencySetDatas.insert(frequencySet.id(), dataIds);
|
||||
|
||||
if (!m_dts->publish(frequencySet))
|
||||
ERROR_LOG() << "Error while publishing Frequency Set with id " << frequencySet.id();
|
||||
ERROR_LOG(m_logger) << "Error while publishing Frequency Set with id " << frequencySet.id();
|
||||
}
|
||||
|
||||
} // namespace AudioVideoManagement
|
||||
Loaded 100 of 2102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user