Migrates remaining services and plugins to generated rtiddsgen API
Converts accessor calls to plain member access across the residual service set.
This commit is contained in:
104 files changed
+2424
-2430
No files matched your search
@@ -98,13 +98,13 @@
|
||||
<topicType name="AlarmAction">
|
||||
<column name="setMarker" idlType="boolean"/>
|
||||
<column name="messageWindow" idlType="boolean"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::EventType"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::PdmEventType"/>
|
||||
<column name="vulnerabilityState" idlType="long" comment="Only trigger, when this state is reached"/>
|
||||
</topicType>
|
||||
<topicType name="AlarmConfig" isDataObject="1" routeToClient="1" routeToServer="0" routeInReplay="0">
|
||||
<column name="operatorId" idlType="long"/>
|
||||
<column name="participantId" idlType="long"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::EventType"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::PdmEventType"/>
|
||||
<column name="messageWindow" idlType="boolean"/>
|
||||
<column name="setMarker" idlType="boolean"/>
|
||||
<column name="id" idlType="long" isKey="1"/>
|
||||
@@ -122,7 +122,7 @@
|
||||
<column name="id" idlType="long" isKey="1"/>
|
||||
<column name="operatorId" idlType="long"/>
|
||||
<column name="eventId" idlType="long" comment="ExerciseEventManagement::EventType"/>
|
||||
<column name="eventType" idlType="ProjectDataManagement::EventType"/>
|
||||
<column name="eventType" idlType="ProjectDataManagement::PdmEventType"/>
|
||||
<column name="time" idlType="long long"/>
|
||||
<column name="equipmentNumber" idlType="long"/>
|
||||
<column name="participantId" idlType="long" isOptional="1"/>
|
||||
|
||||
@@ -91,7 +91,7 @@ int DdsHandler::exerciseId() const
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
|
||||
} // Namespace AlarmManagement
|
||||
+75
-75
@@ -20,17 +20,17 @@ namespace AlarmManagement
|
||||
static AlarmConfig toDds(const Database::AlmConfig &data)
|
||||
{
|
||||
AlarmConfig almConfig;
|
||||
almConfig.id(data.id);
|
||||
almConfig.operatorId(data.operatorId);
|
||||
almConfig.id = data.id;
|
||||
almConfig.operatorId = data.operatorId;
|
||||
if (data.participantId.isValid())
|
||||
almConfig.participantId(data.participantId.toInt());
|
||||
almConfig.participantId = data.participantId.toInt();
|
||||
else
|
||||
almConfig.participantId(0);
|
||||
almConfig.eventTypeId(data.eventTypeId);
|
||||
almConfig.messageWindow(data.messageWindow);
|
||||
almConfig.global(data.global);
|
||||
almConfig.vulnerabilityState(data.vulnerabilityState);
|
||||
almConfig.setMarker(data.setMarker);
|
||||
almConfig.participantId = 0;
|
||||
almConfig.eventTypeId = data.eventTypeId;
|
||||
almConfig.messageWindow = data.messageWindow;
|
||||
almConfig.global = data.global;
|
||||
almConfig.vulnerabilityState = data.vulnerabilityState;
|
||||
almConfig.setMarker = data.setMarker;
|
||||
return almConfig;
|
||||
}
|
||||
|
||||
@@ -100,10 +100,10 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId,
|
||||
DEBUG_LOG(m_logger) << "key= " << i.key() << ": "
|
||||
<< " operatorId=" << i.value().operatorId
|
||||
<< " participantId=" << i.value().participantId.toInt()
|
||||
<< " eventTypeId=" << i.value().eventTypeId.underlying();
|
||||
<< " eventTypeId=" << i.value().eventTypeId;
|
||||
if ((operatorId == i.value().operatorId)
|
||||
&& (participantId == i.value().participantId)
|
||||
&& (eventTypeId == ProjectDataManagement::PdmEventType_def::Unknown || eventTypeId == i.value().eventTypeId.underlying()))
|
||||
&& (eventTypeId == static_cast<int>(ProjectDataManagement::PdmEventType::EventType_Unknown) || eventTypeId == static_cast<int>(i.value().eventTypeId)))
|
||||
{
|
||||
const int key = i.key();
|
||||
DEBUG_LOG(m_logger) << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId;
|
||||
@@ -142,69 +142,69 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
const ConfigureAlarmsRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onConfigureAlarmsRequest " << request;
|
||||
if (request.participantIds().size() == 0)
|
||||
if (request.participantIds.size() == 0)
|
||||
{
|
||||
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database. There were no participants given."));
|
||||
m_mainHandler->dds()->ftsAlm()->configureAlarmsReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (request.remove())
|
||||
if (request.remove)
|
||||
{
|
||||
// remove only this one Alarm, not all types of the participant for operator
|
||||
// in DB,
|
||||
// from DDS
|
||||
DEBUG_LOG(m_logger) << "request.remove()";
|
||||
if (request.participantIds().size() > 0 &&
|
||||
request.alarms().size() > 0)
|
||||
if (request.participantIds.size() > 0 &&
|
||||
request.alarms.size() > 0)
|
||||
{
|
||||
int participantId = request.participantIds()[0];
|
||||
int eventTypeId = request.alarms()[0].eventTypeId().underlying();
|
||||
DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId()
|
||||
int participantId = request.participantIds[0];
|
||||
int eventTypeId = static_cast<int>(request.alarms[0].eventTypeId);
|
||||
DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId
|
||||
<< " participantId=" << participantId
|
||||
<< " eventTypeId=" << eventTypeId;
|
||||
removeAlarmConfig(request.operatorId(), participantId, eventTypeId);
|
||||
removeAlarmConfig(request.operatorId, participantId, eventTypeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// remove old configuration
|
||||
for (int participantId : request.participantIds())
|
||||
for (int participantId : request.participantIds)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "remove old configuration participantId=" << participantId;
|
||||
removeAlarmConfig(request.operatorId(), participantId, 0);
|
||||
removeAlarmConfig(request.operatorId, participantId, 0);
|
||||
}
|
||||
if ( request.global())
|
||||
if ( request.global)
|
||||
{
|
||||
removeGlobalAlarmConfig(request.operatorId());
|
||||
removeGlobalAlarmConfig(request.operatorId);
|
||||
}
|
||||
|
||||
for (int participantId : request.participantIds())
|
||||
for (int participantId : request.participantIds)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "participantId: " << participantId;
|
||||
for (const AlarmManagement::AlarmAction &action : request.alarms())
|
||||
for (const AlarmManagement::AlarmAction &action : request.alarms)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "action: " << action;
|
||||
|
||||
AlarmManagement::AlarmConfig almConfig;
|
||||
almConfig.operatorId(request.operatorId());
|
||||
almConfig.participantId(participantId);
|
||||
almConfig.eventTypeId(action.eventTypeId());
|
||||
almConfig.messageWindow(action.messageWindow());
|
||||
almConfig.vulnerabilityState(action.vulnerabilityState());
|
||||
almConfig.setMarker(action.setMarker());
|
||||
almConfig.global(request.global());
|
||||
almConfig.operatorId = request.operatorId;
|
||||
almConfig.participantId = participantId;
|
||||
almConfig.eventTypeId = action.eventTypeId;
|
||||
almConfig.messageWindow = action.messageWindow;
|
||||
almConfig.vulnerabilityState = action.vulnerabilityState;
|
||||
almConfig.setMarker = action.setMarker;
|
||||
almConfig.global = request.global;
|
||||
|
||||
Database::AlmConfig newConfig;
|
||||
newConfig.operatorId = request.operatorId();
|
||||
newConfig.operatorId = request.operatorId;
|
||||
if (participantId != 0)
|
||||
newConfig.participantId = participantId;
|
||||
|
||||
newConfig.eventTypeId = action.eventTypeId();
|
||||
newConfig.messageWindow = action.messageWindow();
|
||||
newConfig.vulnerabilityState = action.vulnerabilityState();
|
||||
newConfig.setMarker = action.setMarker();
|
||||
newConfig.global = request.global();
|
||||
newConfig.eventTypeId = action.eventTypeId;
|
||||
newConfig.messageWindow = action.messageWindow;
|
||||
newConfig.vulnerabilityState = action.vulnerabilityState;
|
||||
newConfig.setMarker = action.setMarker;
|
||||
newConfig.global = request.global;
|
||||
if (!m_mainHandler->db()->insert(newConfig))
|
||||
{
|
||||
Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database."));
|
||||
@@ -212,7 +212,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "m_dbAlmConfig.insert id=" << newConfig.id;
|
||||
|
||||
almConfig.id(newConfig.id);
|
||||
almConfig.id = newConfig.id;
|
||||
m_alarms.insert(newConfig.id, newConfig);
|
||||
m_mainHandler->dds()->dtsAlm()->publish(almConfig);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId();
|
||||
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId;
|
||||
if (modType == DataModification::eRemoved ||
|
||||
modType == DataModification::eModified)
|
||||
return;
|
||||
@@ -255,11 +255,11 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
<< " alarm.operatorId=" << alarm.operatorId
|
||||
<< " friendyFire =" << friendlyFireBool;*/
|
||||
|
||||
if ((alarm.eventTypeId == eventDatalocal.eventTypeId().underlying()) ||
|
||||
(alarm.eventTypeId == ProjectDataManagement::PdmEventType_def::FriendlyFire && friendlyFireBool))
|
||||
if ((alarm.eventTypeId == eventDatalocal.eventTypeId) ||
|
||||
(alarm.eventTypeId == ProjectDataManagement::PdmEventType::EventType_FriendlyFire && friendlyFireBool))
|
||||
{
|
||||
if (friendlyFireBool && eventDatalocal.eventTypeId() == ProjectDataManagement::PdmEventType_def::FireEvent)
|
||||
eventDatalocal.eventTypeId(ProjectDataManagement::PdmEventType_def::FriendlyFire);
|
||||
if (friendlyFireBool && eventDatalocal.eventTypeId == ProjectDataManagement::PdmEventType::EventType_FireEvent)
|
||||
eventDatalocal.eventTypeId = ProjectDataManagement::PdmEventType::EventType_FriendlyFire;
|
||||
|
||||
participants.clear();
|
||||
if (alarm.participantId.isValid())
|
||||
@@ -275,13 +275,13 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event
|
||||
DEBUG_LOG(m_logger) << " allVulnerabilityStates=" << allVulnerabilityStates
|
||||
<< " vulnerabilityCheck=" << vulnerabilityCheck
|
||||
<< " participantId=" << participantId
|
||||
<< " eventDatalocal.participantId()=" << eventDatalocal.participantId();
|
||||
<< " eventDatalocal.participantId=" << eventDatalocal.participantId;
|
||||
if (((allVulnerabilityStates || vulnerabilityCheck) &&
|
||||
(participantId == eventDatalocal.participantId())) || globalAlarm)
|
||||
(participantId == eventDatalocal.participantId)) || globalAlarm)
|
||||
{
|
||||
if (sentEventToOperator.contains(alarm.operatorId))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId;
|
||||
DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId << " already handled for Operator:" << alarm.operatorId;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -311,13 +311,13 @@ void HandlerConfigureAlarms::sendWindow(const ExerciseEventManagement::Event &ev
|
||||
QJsonObject eventObject = getEventProperties(eventData);
|
||||
QJsonObject obj;
|
||||
|
||||
wi.id(m_windowIndex);
|
||||
wi.operatorId(config.operatorId);
|
||||
wi.time(eventData.sampleTime());
|
||||
wi.eventId(eventData.id());
|
||||
wi.id = m_windowIndex;
|
||||
wi.operatorId = config.operatorId;
|
||||
wi.time = eventData.sampleTime;
|
||||
wi.eventId = eventData.id;
|
||||
|
||||
if (eventData.eventTypeId() == ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline
|
||||
|| eventData.eventTypeId() == ProjectDataManagement::PdmEventType_def::CrossLocalBorderline)
|
||||
if (eventData.eventTypeId == ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline
|
||||
|| eventData.eventTypeId == ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline)
|
||||
{
|
||||
if (eventObject.contains(QStringLiteral("Global")))
|
||||
obj[QStringLiteral("Global")] = eventObject.value(QStringLiteral("Global"));
|
||||
@@ -325,23 +325,23 @@ void HandlerConfigureAlarms::sendWindow(const ExerciseEventManagement::Event &ev
|
||||
if (eventObject.contains(QStringLiteral("FriendlyFire")))
|
||||
obj[QStringLiteral("FriendlyFire")] = eventObject.value(QStringLiteral("FriendlyFire"));
|
||||
if (eventObject.contains(QStringLiteral("AesId")))
|
||||
wi.aesId(eventObject.value(QStringLiteral("AesId")).toInt());
|
||||
wi.aesId = eventObject.value(QStringLiteral("AesId")).toInt();
|
||||
// AesEvent from the radio:
|
||||
int originatorType = eventObject[QStringLiteral("OriginatorType")].toInt();
|
||||
if (originatorType == ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation
|
||||
|| originatorType == ProjectDataManagement::StateChangeOriginator_def::FunctionalArea)
|
||||
if (originatorType == static_cast<int>(ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation)
|
||||
|| originatorType == static_cast<int>(ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_FunctionalArea))
|
||||
obj[QStringLiteral("aesId")] = eventObject[QStringLiteral("OriginatorId")].toInt();
|
||||
|
||||
wi.equipmentNumber(eventData.equipmentNumber());
|
||||
wi.eventType(eventData.eventTypeId());
|
||||
wi.participantId(eventData.participantId());
|
||||
wi.position(eventData.position());
|
||||
wi.equipmentNumber = eventData.equipmentNumber;
|
||||
wi.eventType = eventData.eventTypeId;
|
||||
wi.participantId = eventData.participantId;
|
||||
wi.position = eventData.position;
|
||||
|
||||
const QByteArray propertiesStr = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
wi.properties() = propertiesStr.data();
|
||||
wi.properties = propertiesStr.data();
|
||||
m_mainHandler->dds()->dtsAlm()->publish(wi);
|
||||
// take data from dds-bus after 1 min
|
||||
const auto id = wi.id();
|
||||
const auto id = wi.id;
|
||||
QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_mainHandler->dds()->dtsAlm()->removeNotificationByKey(id); });
|
||||
incrementWindowIndex(); // m_windowIndex++;
|
||||
|
||||
@@ -351,7 +351,7 @@ void HandlerConfigureAlarms::sendWindow(const ExerciseEventManagement::Event &ev
|
||||
|
||||
QJsonObject HandlerConfigureAlarms::getEventProperties(const ExerciseEventManagement::Event &eventData)
|
||||
{
|
||||
return LtsUtils::JsonObject::fromJson(eventData.properties());
|
||||
return LtsUtils::JsonObject::fromJson(eventData.properties.c_str());
|
||||
}
|
||||
|
||||
void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &eventData,
|
||||
@@ -359,17 +359,17 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
|
||||
{
|
||||
int defaultOffset = 10000;
|
||||
|
||||
DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties();
|
||||
DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties;
|
||||
|
||||
QString contentStr;
|
||||
contentStr = QStringLiteral("Equip No.: ");
|
||||
const int participantId = eventData.participantId();
|
||||
const int participantId = eventData.participantId;
|
||||
const int equipNo = m_mainHandler->hdlParticipant()->participantId2EquipNo(participantId);
|
||||
QJsonObject eventObject = getEventProperties(eventData);
|
||||
|
||||
contentStr += QString::number(equipNo);
|
||||
contentStr += QStringLiteral(" ");
|
||||
contentStr += ProjectDataManagement::toString(eventData.eventTypeId());
|
||||
contentStr += ProjectDataManagement::toString(eventData.eventTypeId);
|
||||
if (eventObject.contains(QStringLiteral("AesName")))
|
||||
{
|
||||
contentStr += QStringLiteral(" (");
|
||||
@@ -381,17 +381,17 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev
|
||||
const QByteArray contentArr = contentStr.toUtf8();
|
||||
|
||||
MarkerManagement::MarkerDescription ma;
|
||||
ma.content(contentArr.data());
|
||||
ma.markerType(MarkerManagement::MarkerType_def::Situation);
|
||||
ma.content = contentArr.data();
|
||||
ma.markerType = MarkerManagement::MarkerType::Situation;
|
||||
|
||||
MarkerManagement::Marker mcr;
|
||||
mcr.operatorId(config.operatorId);
|
||||
mcr.note(ma.content()); // really?
|
||||
mcr.timeStamp(eventData.sampleTime());
|
||||
mcr.timeStampOffset(defaultOffset);
|
||||
mcr.descriptions().push_back(ma);
|
||||
mcr.position(eventData.position());
|
||||
mcr.fileContentId(0); // we cannot save an image here
|
||||
mcr.operatorId = config.operatorId;
|
||||
mcr.note = ma.content; // really?
|
||||
mcr.timeStamp = eventData.sampleTime;
|
||||
mcr.timeStampOffset = defaultOffset;
|
||||
mcr.descriptions.push_back(ma);
|
||||
mcr.position = eventData.position;
|
||||
mcr.fileContentId = 0; // we cannot save an image here
|
||||
m_mainHandler->dds()->ftcMrk()->markerModifyRequest(mcr, this);
|
||||
|
||||
} // end sendMarker
|
||||
|
||||
+48
-48
@@ -76,18 +76,18 @@ bool HandlerEmergencyCall::init()
|
||||
|
||||
bool HandlerEmergencyCall::createEmergencyCallObject(const AlarmManagement::AlmEmergencyCall &data)
|
||||
{
|
||||
if (!isNewEmergencyCall(data) || std::isnan(data.position().lat()))
|
||||
if (!isNewEmergencyCall(data) || std::isnan(data.position.lat))
|
||||
return false;
|
||||
|
||||
Database::AlmEmergencyCall newData;
|
||||
newData.id = 0;
|
||||
newData.operatorId = 0;
|
||||
newData.sampleTime = data.sampleTime();
|
||||
newData.incomingTime = data.sampleTime();
|
||||
newData.sampleTime = data.sampleTime;
|
||||
newData.incomingTime = data.sampleTime;
|
||||
newData.expired = false;
|
||||
newData.issi = data.issi();
|
||||
newData.position.setX(data.position().lon());
|
||||
newData.position.setY(data.position().lat());
|
||||
newData.issi = data.issi;
|
||||
newData.position.setX(data.position.lon);
|
||||
newData.position.setY(data.position.lat);
|
||||
newData.comment = QStringLiteral("");
|
||||
newData.name = QStringLiteral("");
|
||||
ObjectEmergencyCall *ifs(new ObjectEmergencyCall(m_mainHandler, this));
|
||||
@@ -111,18 +111,18 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger)<< ret();
|
||||
|
||||
if (request.expired())
|
||||
if (request.expired)
|
||||
{
|
||||
AcknowledgeSOSInAllExercises ackInEx;
|
||||
ackInEx.id(request.id());
|
||||
ackInEx.timestamp(request.timestamp());
|
||||
ackInEx.incomingTime(request.incomingTime());
|
||||
ackInEx.name(request.name());
|
||||
ackInEx.issi(request.issi());
|
||||
ackInEx.operatorId(request.operatorId());
|
||||
ackInEx.comment(request.comment());
|
||||
ackInEx.expired(request.expired());
|
||||
WARNING_LOG(m_logger) << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi();
|
||||
ackInEx.id = request.id;
|
||||
ackInEx.timestamp = request.timestamp;
|
||||
ackInEx.incomingTime = request.incomingTime;
|
||||
ackInEx.name = request.name;
|
||||
ackInEx.issi = request.issi;
|
||||
ackInEx.operatorId = request.operatorId;
|
||||
ackInEx.comment = request.comment;
|
||||
ackInEx.expired = request.expired;
|
||||
WARNING_LOG(m_logger) << "onEmergencyCallAcknowledgeRequest: issi: "<<ackInEx.issi;
|
||||
m_mainHandler->dds()->publishSOS()->write(ackInEx);
|
||||
}
|
||||
m_mainHandler->dds()->ftsAlm()->emergencyCallAcknowledgeReply(cookie,ret);
|
||||
@@ -134,8 +134,8 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(
|
||||
for(auto _ifs : qAsConst(m_emergencyObjMap))
|
||||
{
|
||||
auto data = _ifs->getData();
|
||||
if (data.issi == request.issi()
|
||||
&& data.incomingTime == request.incomingTime()
|
||||
if (data.issi == request.issi
|
||||
&& data.incomingTime == request.incomingTime
|
||||
&& !data.expired)
|
||||
{
|
||||
ifs = _ifs;
|
||||
@@ -145,8 +145,8 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
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());
|
||||
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
|
||||
@@ -155,15 +155,15 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest(
|
||||
return Core::FunctionReplyObject(ifs->getData().id);
|
||||
}
|
||||
|
||||
WARNING_LOG(m_logger) << "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();
|
||||
newData.sampleTime = request.timestamp();
|
||||
newData.deleted = request.timestamp();
|
||||
newData.operatorId = request.operatorId();
|
||||
newData.name = QString::fromStdString(request.name());
|
||||
newData.comment = QString::fromStdString(request.comment());
|
||||
newData.issi = request.issi;
|
||||
newData.sampleTime = request.timestamp;
|
||||
newData.deleted = request.timestamp;
|
||||
newData.operatorId = request.operatorId;
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.comment = QString::fromStdString(request.comment);
|
||||
return ifs->updateObject(newData);
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ bool HandlerEmergencyCall::isExerciseValidForEmergencyCall() const
|
||||
exmDtc->waitForHistoricalDataExercise();
|
||||
const ExerciseManagement::Exercise exercise = exmDtc->exercise(m_mainHandler->dds()->exerciseId());
|
||||
|
||||
if (exercise.state() != ExerciseManagement::ExerciseState::Started
|
||||
&& exercise.state() != ExerciseManagement::ExerciseState::Paused)
|
||||
if (exercise.state != ExerciseManagement::ExerciseState::Started
|
||||
&& exercise.state != ExerciseManagement::ExerciseState::Paused)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -185,8 +185,8 @@ bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata)
|
||||
for(const auto &ifs : qAsConst(m_emergencyObjMap))
|
||||
{
|
||||
const auto &data = ifs->getData();
|
||||
if (data.issi == newdata.issi()
|
||||
&& data.incomingTime == newdata.incomingTime()
|
||||
if (data.issi == newdata.issi
|
||||
&& data.incomingTime == newdata.incomingTime
|
||||
&& !data.expired)
|
||||
{
|
||||
WARNING_LOG(m_logger)<<" SOS EXISTS and not yet quit! issi: "<<data.issi<<" incomingTime: "<<data.incomingTime<<" expired: "<<data.expired;
|
||||
@@ -202,16 +202,16 @@ void HandlerEmergencyCall::onEmergencyCallChanged(const TrainingAreaBase::Emerge
|
||||
return;
|
||||
|
||||
AlarmManagement::AlmEmergencyCall emc;
|
||||
emc.id(0);
|
||||
emc.operatorId(0); // global
|
||||
emc.sampleTime(data.sampleTime());
|
||||
emc.incomingTime(data.sampleTime());
|
||||
emc.expired(false);
|
||||
emc.issi(data.equipmentNumber());
|
||||
emc.id = 0;
|
||||
emc.operatorId = 0; // global
|
||||
emc.sampleTime = data.sampleTime;
|
||||
emc.incomingTime = data.sampleTime;
|
||||
emc.expired = false;
|
||||
emc.issi = data.equipmentNumber;
|
||||
Core::GeoPosition position;
|
||||
position.lat(data.position().lat());
|
||||
position.lon(data.position().lon());
|
||||
emc.position(position);
|
||||
position.lat = data.position.lat;
|
||||
position.lon = data.position.lon;
|
||||
emc.position = position;
|
||||
|
||||
createEmergencyCallObject(emc);
|
||||
}
|
||||
@@ -222,14 +222,14 @@ void HandlerEmergencyCall::onAcknowledgeSOSInExercises(const AcknowledgeSOSInAll
|
||||
Q_UNUSED(modType)
|
||||
|
||||
EmergencyCallAcknowledgeRequest request;
|
||||
request.comment(data.comment());
|
||||
request.expired(data.expired());
|
||||
request.id(data.id());
|
||||
request.issi(data.issi());
|
||||
request.incomingTime(data.incomingTime());
|
||||
request.name(data.name());
|
||||
request.timestamp(data.timestamp());
|
||||
request.operatorId(data.operatorId());
|
||||
request.comment = data.comment;
|
||||
request.expired = data.expired;
|
||||
request.id = data.id;
|
||||
request.issi = data.issi;
|
||||
request.incomingTime = data.incomingTime;
|
||||
request.name = data.name;
|
||||
request.timestamp = data.timestamp;
|
||||
request.operatorId = data.operatorId;
|
||||
emergencyCallAcknowledgeRequest(request);
|
||||
|
||||
DEBUG_LOG(m_logger)<< "onAcknowledgeEmergencyInExercises END ";
|
||||
|
||||
+23
-23
@@ -64,13 +64,13 @@ bool HandlerParticipant::init()
|
||||
{
|
||||
const ParticipantManagement::Participant &participant = i.value();
|
||||
|
||||
if (participant.equipmentNumber().is_set())
|
||||
if (participant.equipmentNumber.is_set())
|
||||
{
|
||||
m_partId2EquipNoMap.insert(participant.id(), participant.equipmentNumber().get());
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get();
|
||||
m_partId2EquipNoMap.insert(participant.id, participant.equipmentNumber.get());
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id << "EquimentNo=" << participant.equipmentNumber.get();
|
||||
}
|
||||
else
|
||||
m_partId2EquipNoMap.insert(participant.id(), 0);
|
||||
m_partId2EquipNoMap.insert(participant.id, 0);
|
||||
}
|
||||
|
||||
// Get 'static' data for all dynamicParticipants (playerdata)
|
||||
@@ -81,16 +81,16 @@ bool HandlerParticipant::init()
|
||||
{
|
||||
const ParticipantManagement::DynamicParticipantData &dynamicParticipant = i.value();
|
||||
|
||||
if (dynamicParticipant.stateHistory().size() > 0)
|
||||
if (dynamicParticipant.stateHistory.size() > 0)
|
||||
{
|
||||
std::vector<ParticipantManagement::StateInformation> states = dynamicParticipant.stateHistory();
|
||||
std::vector<ParticipantManagement::StateInformation> states = dynamicParticipant.stateHistory;
|
||||
ParticipantManagement::StateInformation state = states[0];
|
||||
int vulnerability = state.vulnerabilityState().underlying();
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId(), vulnerability);
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability;
|
||||
int vulnerability = static_cast<int>(state.vulnerabilityState);
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId, vulnerability);
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId << "vulnerability=" << vulnerability;
|
||||
}
|
||||
else
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId(), -1);
|
||||
m_partId2VulnerabilityMap.insert(i.value().participantId, -1);
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "HandlerParticipant::init() finished. ";
|
||||
@@ -102,41 +102,41 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged - remove: " << data.id();
|
||||
m_participantHierarchy.remove(data.id());
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged - remove: " << data.id;
|
||||
m_participantHierarchy.remove(data.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged:" << data;
|
||||
m_participantHierarchy.insert(data.id(),
|
||||
m_participantHierarchy.insert(data.id,
|
||||
AlarmManagement::HandlerParticipant::ParticipantHierarchy(data));
|
||||
const int equipNo = data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0;
|
||||
m_partId2EquipNoMap.insert(data.id(), equipNo);
|
||||
const int equipNo = data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0;
|
||||
m_partId2EquipNoMap.insert(data.id, equipNo);
|
||||
|
||||
}
|
||||
} // end of onParticipantChanged()
|
||||
|
||||
void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onDynamicParticipant participantId=" << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "onDynamicParticipant participantId=" << data.participantId;
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "onDynamicParticipant()"
|
||||
<< " participantId: " << data.participantId();
|
||||
if (data.stateHistory().size() > 0)
|
||||
<< " participantId: " << data.participantId;
|
||||
if (data.stateHistory.size() > 0)
|
||||
{
|
||||
std::vector<ParticipantManagement::StateInformation> states = data.stateHistory();
|
||||
std::vector<ParticipantManagement::StateInformation> states = data.stateHistory;
|
||||
ParticipantManagement::StateInformation state = states[0];
|
||||
int vulnerability = state.vulnerabilityState().underlying();
|
||||
m_partId2VulnerabilityMap.insert(data.participantId(), vulnerability);
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << data.participantId()
|
||||
int vulnerability = static_cast<int>(state.vulnerabilityState);
|
||||
m_partId2VulnerabilityMap.insert(data.participantId, vulnerability);
|
||||
DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << data.participantId
|
||||
<< " vulnerability=" << vulnerability;
|
||||
}
|
||||
else
|
||||
m_partId2VulnerabilityMap.insert(data.participantId(), -1);
|
||||
m_partId2VulnerabilityMap.insert(data.participantId, -1);
|
||||
|
||||
}
|
||||
} // end of onParticipantChanged()
|
||||
|
||||
@@ -36,9 +36,9 @@ public:
|
||||
|
||||
ParticipantHierarchy() = default;
|
||||
explicit ParticipantHierarchy(const ParticipantManagement::Participant &p)
|
||||
: participantId(p.id())
|
||||
, superiorId(p.superiorId())
|
||||
, inferiorIds(p.inferiorIds())
|
||||
: participantId(p.id)
|
||||
, superiorId(p.superiorId)
|
||||
, inferiorIds(p.inferiorIds)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
+10
-10
@@ -61,16 +61,16 @@ Core::FunctionReplyObject ObjectEmergencyCall::removeObject()
|
||||
void ObjectEmergencyCall::onPublishData()
|
||||
{
|
||||
AlarmManagement::AlmEmergencyCall ddsData;
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.sampleTime(m_data.sampleTime);
|
||||
ddsData.incomingTime(m_data.incomingTime);
|
||||
ddsData.name(m_data.name.toStdString());
|
||||
ddsData.issi(m_data.issi);
|
||||
ddsData.position(Core::GeoPosition2D(m_data.position.x(), m_data.position.y()));
|
||||
ddsData.expired(m_data.expired);
|
||||
ddsData.deleted(m_data.deleted);
|
||||
ddsData.operatorId(m_data.operatorId);
|
||||
ddsData.comment(m_data.comment.toStdString());
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.sampleTime = m_data.sampleTime;
|
||||
ddsData.incomingTime = m_data.incomingTime;
|
||||
ddsData.name = m_data.name.toStdString();
|
||||
ddsData.issi = m_data.issi;
|
||||
ddsData.position = Core::GeoPosition2D(m_data.position.x(), m_data.position.y());
|
||||
ddsData.expired = m_data.expired;
|
||||
ddsData.deleted = m_data.deleted;
|
||||
ddsData.operatorId = m_data.operatorId;
|
||||
ddsData.comment = m_data.comment.toStdString();
|
||||
|
||||
INFO_LOG(m_logger) << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
|
||||
Reference in new issue
Block a user