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
-1
@@ -47,7 +47,6 @@ class BldConfigDialog : public LtsWidgets::LtsDialog,
|
||||
void slotCmbStatusCurrentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void fillCbx();
|
||||
|
||||
private:
|
||||
|
||||
-1
@@ -58,7 +58,6 @@ class InfoDialogBase : public LtsWidgets::LtsDialog
|
||||
void onShowEgcuMonitor();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger& m_logger;
|
||||
virtual void showBuildingInfos() = 0;
|
||||
virtual QString buildingDisplayName() const = 0;
|
||||
|
||||
|
||||
-2
@@ -49,7 +49,6 @@ public:
|
||||
int changedCallbackCount() { return m_settingsChangedCb.size() ;}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void callSettingsChangedCb(Part part);
|
||||
static SymbolVisibility readSymbolVisibility(const QJsonObject &obj,
|
||||
const QString &val,
|
||||
@@ -62,7 +61,6 @@ private Q_SLOTS:
|
||||
void onParticipantChanged(const ParticipantManagement::Participant &data, ParticipantManagement::DataModification mod);
|
||||
void onRebuildCollapsExpandFilter();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool isInCollapsedTree(int participantId, QSet<int> &visitedIds) const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
-1
@@ -63,7 +63,6 @@ public:
|
||||
void showSnapshot();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSnapshotRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
void onReplayPartitionRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject);}
|
||||
void onChangeReplayStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject);}
|
||||
|
||||
-1
@@ -30,7 +30,6 @@ public:
|
||||
|
||||
static bool createTable(NSqlQuery &q, const QString &tableName, const QSqlRecord &record, const QSqlIndex &pk, NGL::INGLLogger &logger);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool loadPlugin(const LtsPluginManager::PluginInstance &pi);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
-1
@@ -70,7 +70,6 @@ private slots:
|
||||
void slotRunExportStep();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QVector<ExportStep *> parseFilterSteps(
|
||||
int parentTopicId, QJsonObject &detailData, const QVector<TopicReplay::Interface::SituationReplayTime> &allSitReplayTimes
|
||||
);
|
||||
|
||||
-1
@@ -18,7 +18,6 @@ public:
|
||||
bool exportDynamicData(qint64 fromTime, qint64 toTime);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
struct StaticTableToCopy
|
||||
{
|
||||
QString schema;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ void DataPlugin::onTranslationBlobChanged(const ProjectDataManagement::Translati
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
NGL::setTranslationDataJson(LtsUtils::toQByteArray(data.payload()), data.md5sum().c_str(), true);
|
||||
NGL::setTranslationDataJson(LtsUtils::toQByteArray(data.payload), data.md5sum.c_str(), true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
-1
@@ -234,7 +234,6 @@ private slots:
|
||||
void onParticipantOwnPositionChanged(const Point3D &newPos, int64_t sampleTime);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void startChangedDelayTimer();
|
||||
void startOwnPositionOutdatedTimer();
|
||||
QList<Sim2SituationMapBase *> listOfSim2Map() const;
|
||||
|
||||
-1
@@ -67,7 +67,6 @@ public:
|
||||
QVector<ProjectDataManagement::CasEffect> casEffects(const AreaEffectSimulation::ChargeStruct &chargeStruct);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void initializePdm();
|
||||
void onChargeTypeChanged(const ProjectDataManagement::ChargeType &data, DataModification mod);
|
||||
void onGearTypeChargeTypeChanged(const ProjectDataManagement::GearTypeChargeType &data, DataModification mod);
|
||||
|
||||
-1
@@ -168,7 +168,6 @@ public:
|
||||
void setSourceModel(QAbstractItemModel *sourceModel) override;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -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 << ") ...";
|
||||
|
||||
|
||||
+7
-7
@@ -63,7 +63,7 @@ void HandlerCodificationData::onCodificationDataModifyRequest(const rti::core::S
|
||||
const CodificationData &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onCodificationDataModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? codificationDataModifyRequest(request) : codificationDataCreateRequest(request);
|
||||
auto ret = request.id > 0 ? codificationDataModifyRequest(request) : codificationDataCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->codificationDataModifyReply(cookie, ret);
|
||||
@@ -85,9 +85,9 @@ Core::FunctionReplyObject HandlerCodificationData::codificationDataCreateRequest
|
||||
|
||||
Core::FunctionReplyObject HandlerCodificationData::codificationDataModifyRequest(const CodificationData &request)
|
||||
{
|
||||
ObjectCodificationData *ifs = m_codificationdataObjMap.value(request.id());
|
||||
ObjectCodificationData *ifs = m_codificationdataObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Codification table with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Codification table with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(request);
|
||||
} // end of onCodificationDataModifyRequest()
|
||||
@@ -99,10 +99,10 @@ void HandlerCodificationData::onCodificationDataRemoveRequest(const rti::core::S
|
||||
DEBUG_LOG(m_logger) << "onCodificationDataRemoveRequest: " << request;
|
||||
|
||||
|
||||
ObjectCodificationData *ifs = m_codificationdataObjMap.value(request.id());
|
||||
ObjectCodificationData *ifs = m_codificationdataObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Codification table with id %1 not found")).arg(request.id());
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Codification table with id %1 not found")).arg(request.id);
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->codificationDataRemoveReply(cookie, ret);
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ void HandlerCodificationData::onCodificationDataRemoveRequest(const rti::core::S
|
||||
|
||||
if (m_ddsHandler->topicLockMaster()->isLocked(ifs->getData(), m_ddsHandler->exerciseId()))
|
||||
{
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Codification '%1' is used by another user!")).arg(ifs->getData().identifier());
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Codification '%1' is used by another user!")).arg(ifs->getData().identifier);
|
||||
m_ddsHandler->fts()->codificationDataRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void HandlerCodificationData::onCodificationDataRemoveRequest(const rti::core::S
|
||||
{
|
||||
// delete codification object
|
||||
delete ifs;
|
||||
m_codificationdataObjMap.remove(request.id());
|
||||
m_codificationdataObjMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->codificationDataRemoveReply(cookie, ret);
|
||||
|
||||
+49
-49
@@ -22,7 +22,7 @@ ObjectCodificationData::ObjectCodificationData(const std::shared_ptr<DdsHandler>
|
||||
|
||||
ObjectCodificationData::~ObjectCodificationData()
|
||||
{
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id());
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id);
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -31,9 +31,9 @@ Core::FunctionReplyObject ObjectCodificationData::createObject(const Codificatio
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::createObject()";
|
||||
|
||||
m_ddsData = ddsData;
|
||||
if (m_ddsData.id() <= 0)
|
||||
if (m_ddsData.id <= 0)
|
||||
{
|
||||
m_ddsData.isUsed(false);
|
||||
m_ddsData.isUsed = false;
|
||||
|
||||
Database::CodCodificationTable dbData;
|
||||
dbData = toDbData(ddsData);
|
||||
@@ -41,14 +41,14 @@ Core::FunctionReplyObject ObjectCodificationData::createObject(const Codificatio
|
||||
if (!m_dbHandler->db()->insert(dbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting codification_table data into database"));
|
||||
|
||||
m_ddsData.id(dbData.id);
|
||||
DEBUG_LOG(m_logger) << "New codificationTable id: " << m_ddsData.id();
|
||||
m_ddsData.id = dbData.id;
|
||||
DEBUG_LOG(m_logger) << "New codificationTable id: " << m_ddsData.id;
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
} // end of createObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -57,22 +57,22 @@ Core::FunctionReplyObject ObjectCodificationData::updateObject(const Codificatio
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::updateObject()";
|
||||
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(ddsData.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(ddsData.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
// convert request ddsData -> dbData
|
||||
Database::CodCodificationTable dbData;
|
||||
dbData = toDbData(ddsData);
|
||||
|
||||
if (!m_dbHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(ddsData.id(), tr_lts("dds", "Error updating codification_table data in database"));
|
||||
return Core::FunctionReplyObject(ddsData.id, tr_lts("dds", "Error updating codification_table data in database"));
|
||||
// update internal objectdata
|
||||
m_ddsData = ddsData;
|
||||
DEBUG_LOG(m_logger) << "Data changed for codification_table id: " << m_ddsData.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for codification_table id: " << m_ddsData.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -82,21 +82,21 @@ Core::FunctionReplyObject ObjectCodificationData::removeObject()
|
||||
DEBUG_LOG(m_logger) << "ObjectCodificationData::removeObject()";
|
||||
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_ddsData.id(), tr_lts("dds", "codification_table data still in use"));
|
||||
return Core::FunctionReplyObject(m_ddsData.id, tr_lts("dds", "codification_table data still in use"));
|
||||
|
||||
if (!m_dbHandler->db()->removeCodCodificationTable(m_ddsData.id()))
|
||||
return Core::FunctionReplyObject(m_ddsData.id(), tr_lts("dds", "codification_table with id %1 can not be removed")).arg(m_ddsData.id());
|
||||
if (!m_dbHandler->db()->removeCodCodificationTable(m_ddsData.id))
|
||||
return Core::FunctionReplyObject(m_ddsData.id, tr_lts("dds", "codification_table with id %1 can not be removed")).arg(m_ddsData.id);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Removed codification_table id " << m_ddsData.id();
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id());
|
||||
DEBUG_LOG(m_logger) << "Removed codification_table id " << m_ddsData.id;
|
||||
m_ddsHandler->dts()->removeCodificationDataByKey(m_ddsData.id);
|
||||
|
||||
return Core::FunctionReplyObject(m_ddsData.id());
|
||||
return Core::FunctionReplyObject(m_ddsData.id);
|
||||
} // end of removeObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ObjectCodificationData::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish CodificationData data to dds (" << m_ddsData.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish CodificationData data to dds (" << m_ddsData.id << ") ...";
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing CodificationData data to dds";
|
||||
@@ -105,13 +105,13 @@ void ObjectCodificationData::onPublishData()
|
||||
|
||||
bool ObjectCodificationData::isValid() const
|
||||
{
|
||||
return m_ddsData.id() > 0;
|
||||
return m_ddsData.id > 0;
|
||||
} // end of isValid()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectCodificationData::isUsed() const
|
||||
{
|
||||
return m_ddsData.isUsed();
|
||||
return m_ddsData.isUsed;
|
||||
} // end of isUsed()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -120,24 +120,24 @@ CodificationManagement::CodificationData ObjectCodificationData::toDdsData(const
|
||||
{
|
||||
CodificationManagement::CodificationData ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.numeralCodeTableColumnIndex(dbData.numeralCodeTableColumnIndex.toStdString());
|
||||
ddsData.numeralCodeTableRowIndex(dbData.numeralCodeTableRowIndex.toStdString());
|
||||
ddsData.authenticationTableColumnIndex(dbData.authenticationTableColumnIndex.toStdString());
|
||||
ddsData.authenticationTableRowIndex(dbData.authenticationTableRowIndex.toStdString());
|
||||
ddsData.authenticationTableMatirx(dbData.authenticationTableMatirx.toStdString());
|
||||
ddsData.logisticalTermTableColumnIndex(dbData.logisticalTermTableColumnIndex.toStdString());
|
||||
ddsData.logisticalTermTableRowIndex(dbData.logisticalTermTableRowIndex.toStdString());
|
||||
ddsData.logisticalTermTableMatrix(dbData.logisticalTermTableMatrix.toStdString());
|
||||
ddsData.phraseTable(dbData.phraseTable.toStdString());
|
||||
ddsData.note(dbData.note.toStdString());
|
||||
ddsData.identifier(dbData.identifier.toStdString()),
|
||||
ddsData.validityTime(dbData.validityTime);
|
||||
ddsData.partyId(dbData.partyId);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.numeralCodeTableColumnIndex = dbData.numeralCodeTableColumnIndex.toStdString();
|
||||
ddsData.numeralCodeTableRowIndex = dbData.numeralCodeTableRowIndex.toStdString();
|
||||
ddsData.authenticationTableColumnIndex = dbData.authenticationTableColumnIndex.toStdString();
|
||||
ddsData.authenticationTableRowIndex = dbData.authenticationTableRowIndex.toStdString();
|
||||
ddsData.authenticationTableMatirx = dbData.authenticationTableMatirx.toStdString();
|
||||
ddsData.logisticalTermTableColumnIndex = dbData.logisticalTermTableColumnIndex.toStdString();
|
||||
ddsData.logisticalTermTableRowIndex = dbData.logisticalTermTableRowIndex.toStdString();
|
||||
ddsData.logisticalTermTableMatrix = dbData.logisticalTermTableMatrix.toStdString();
|
||||
ddsData.phraseTable = dbData.phraseTable.toStdString();
|
||||
ddsData.note = dbData.note.toStdString();
|
||||
ddsData.identifier = dbData.identifier.toStdString(),
|
||||
ddsData.validityTime = dbData.validityTime;
|
||||
ddsData.partyId = dbData.partyId;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
@@ -147,20 +147,20 @@ Database::CodCodificationTable ObjectCodificationData::toDbData(const Codificati
|
||||
{
|
||||
Database::CodCodificationTable dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.numeralCodeTableColumnIndex = QString::fromStdString(ddsData.numeralCodeTableColumnIndex());
|
||||
dbData.numeralCodeTableRowIndex = QString::fromStdString(ddsData.numeralCodeTableRowIndex());
|
||||
dbData.authenticationTableColumnIndex = QString::fromStdString(ddsData.authenticationTableColumnIndex());
|
||||
dbData.authenticationTableRowIndex = QString::fromStdString(ddsData.authenticationTableRowIndex());
|
||||
dbData.authenticationTableMatirx = QString::fromStdString(ddsData.authenticationTableMatirx());
|
||||
dbData.logisticalTermTableColumnIndex = QString::fromStdString(ddsData.logisticalTermTableColumnIndex());
|
||||
dbData.logisticalTermTableRowIndex = QString::fromStdString(ddsData.logisticalTermTableRowIndex());
|
||||
dbData.logisticalTermTableMatrix = QString::fromStdString(ddsData.logisticalTermTableMatrix());
|
||||
dbData.phraseTable = QString::fromStdString(ddsData.phraseTable());
|
||||
dbData.note = QString::fromStdString(ddsData.note());
|
||||
dbData.identifier = QString::fromStdString(ddsData.identifier());
|
||||
dbData.validityTime = ddsData.validityTime();
|
||||
dbData.partyId = ddsData.partyId();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.numeralCodeTableColumnIndex = QString::fromStdString(ddsData.numeralCodeTableColumnIndex);
|
||||
dbData.numeralCodeTableRowIndex = QString::fromStdString(ddsData.numeralCodeTableRowIndex);
|
||||
dbData.authenticationTableColumnIndex = QString::fromStdString(ddsData.authenticationTableColumnIndex);
|
||||
dbData.authenticationTableRowIndex = QString::fromStdString(ddsData.authenticationTableRowIndex);
|
||||
dbData.authenticationTableMatirx = QString::fromStdString(ddsData.authenticationTableMatirx);
|
||||
dbData.logisticalTermTableColumnIndex = QString::fromStdString(ddsData.logisticalTermTableColumnIndex);
|
||||
dbData.logisticalTermTableRowIndex = QString::fromStdString(ddsData.logisticalTermTableRowIndex);
|
||||
dbData.logisticalTermTableMatrix = QString::fromStdString(ddsData.logisticalTermTableMatrix);
|
||||
dbData.phraseTable = QString::fromStdString(ddsData.phraseTable);
|
||||
dbData.note = QString::fromStdString(ddsData.note);
|
||||
dbData.identifier = QString::fromStdString(ddsData.identifier);
|
||||
dbData.validityTime = ddsData.validityTime;
|
||||
dbData.partyId = ddsData.partyId;
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ public:
|
||||
Core::FunctionReplyObject updateObject(const CodificationManagement::CodificationData &ddsData);
|
||||
Core::FunctionReplyObject removeObject();
|
||||
|
||||
qint32 getId() const { return m_ddsData.id(); }
|
||||
QString getName() const { return QString::fromStdString(m_ddsData.name()); }
|
||||
qint32 getId() const { return m_ddsData.id; }
|
||||
QString getName() const { return QString::fromStdString(m_ddsData.name); }
|
||||
const CodificationData &getData() const { return m_ddsData; }
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
@@ -132,10 +132,10 @@ void EvlTests::tryCreateCriterium()
|
||||
m_eTestStep = eCreateCriterium;
|
||||
EvlCriteriumModifyRequest data;
|
||||
|
||||
data.id(0); // id = 0 -> Create request
|
||||
data.name("Test Criterium");
|
||||
data.description("Test description");
|
||||
data.operatorId(m_operatorId);
|
||||
data.id = 0; // id = 0 -> Create request
|
||||
data.name = "Test Criterium";
|
||||
data.description = "Test description";
|
||||
data.operatorId = m_operatorId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send EvlCriteriumModifyRequest";
|
||||
if (!m_ftc->evlCriteriumModifyRequest(data, this))
|
||||
@@ -152,15 +152,15 @@ void EvlTests::tryModifyCriterium()
|
||||
m_eTestStep = eModifyCriterium;
|
||||
EvlCriteriumModifyRequest data;
|
||||
|
||||
data.id(m_criteriumId);
|
||||
data.name("Name criterium modified");
|
||||
data.description("Description modified");
|
||||
data.operatorId(m_operatorId);
|
||||
data.id = m_criteriumId;
|
||||
data.name = "Name criterium modified";
|
||||
data.description = "Description modified";
|
||||
data.operatorId = m_operatorId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send EvlCriteriumModifyRequest for criteriumId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send EvlCriteriumModifyRequest for criteriumId:" << data.id;
|
||||
if (!m_ftc->evlCriteriumModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for criteriumId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for criteriumId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -172,12 +172,12 @@ void EvlTests::tryRemoveCriterium()
|
||||
m_eTestStep = eRemoveCriterium;
|
||||
EvlCriteriumRemoveRequest data;
|
||||
|
||||
data.id(m_criteriumId);
|
||||
data.id = m_criteriumId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for criteriumId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for criteriumId:" << data.id;
|
||||
if (!m_ftc->evlCriteriumRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for criteriumId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for criteriumId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -193,11 +193,11 @@ void EvlTests::tryGetAllCriteria()
|
||||
m_criteriumId = -1;
|
||||
auto cb = [this] (const Evaluations::EvaluationCriterium &c)
|
||||
{
|
||||
m_criteriumId = c.id();
|
||||
INFO_LOG(m_logger) << "Evl(" << c.id() << ") :"
|
||||
<< " name:" << c.name()
|
||||
<< " desc:" << c.description()
|
||||
<< " operatorId:" << c.operatorId();
|
||||
m_criteriumId = c.id;
|
||||
INFO_LOG(m_logger) << "Evl(" << c.id << ") :"
|
||||
<< " name:" << c.name
|
||||
<< " desc:" << c.description
|
||||
<< " operatorId:" << c.operatorId;
|
||||
};
|
||||
m_dtc->evaluationCriteriums(cb);
|
||||
if (m_criteriumId == -1)
|
||||
@@ -227,17 +227,17 @@ void EvlTests::tryGetCriterium()
|
||||
m_dtc->waitForHistoricalDataEvaluationCriterium(5000);
|
||||
Evaluations::EvaluationCriterium data = m_dtc->evaluationCriterium(m_criteriumId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for criteriumId " << m_criteriumId << " returnVal: " << data.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for criteriumId " << m_criteriumId << " returnVal: " << data.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Evl(" << data.id() << ") :"
|
||||
<< " name:" << data.name()
|
||||
<< " desc:" << data.description()
|
||||
<< " operatorId:" << data.operatorId();
|
||||
INFO_LOG(m_logger) << "Evl(" << data.id << ") :"
|
||||
<< " name:" << data.name
|
||||
<< " desc:" << data.description
|
||||
<< " operatorId:" << data.operatorId;
|
||||
}
|
||||
|
||||
if (m_testId == 0)
|
||||
@@ -264,21 +264,21 @@ void EvlTests::tryCreateElement()
|
||||
m_eTestStep = eCreateElement;
|
||||
EvlElementModifyRequest data;
|
||||
|
||||
data.id(0);
|
||||
data.criteriumId(m_criteriumId);
|
||||
data.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
data.note("Test test test");
|
||||
data.phaseId(1);
|
||||
data.rating(10);
|
||||
data.id = 0;
|
||||
data.criteriumId = m_criteriumId;
|
||||
data.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.note = "Test test test";
|
||||
data.phaseId = 1;
|
||||
data.rating = 10;
|
||||
|
||||
QJsonObject obj;
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(QStringLiteral("av_0011"));
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QStringLiteral("av_0011, av_0012, av_0013"));
|
||||
data.videoContent().set(QJsonDocument(obj).toJson().constData());
|
||||
data.videoContent.set(QJsonDocument(obj).toJson().constData());
|
||||
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(QStringLiteral("vhf01"));
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QStringLiteral("vhf01, hf01, hf02, vhf03"));
|
||||
data.audioContent().set(QJsonDocument(obj).toJson().constData());
|
||||
data.audioContent.set(QJsonDocument(obj).toJson().constData());
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send evlElementModifyRequest";
|
||||
if (!m_ftc->evlElementModifyRequest(data, this))
|
||||
@@ -295,26 +295,26 @@ void EvlTests::tryModifyElement()
|
||||
m_eTestStep = eModifyElement;
|
||||
EvlElementModifyRequest data;
|
||||
|
||||
data.id(m_elementId);
|
||||
data.criteriumId(m_criteriumId);
|
||||
data.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
data.note("Test1 test2 test3");
|
||||
data.phaseId(2);
|
||||
data.rating(5);
|
||||
data.id = m_elementId;
|
||||
data.criteriumId = m_criteriumId;
|
||||
data.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.note = "Test1 test2 test3";
|
||||
data.phaseId = 2;
|
||||
data.rating = 5;
|
||||
|
||||
QJsonObject obj;
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(QStringLiteral("av_0013"));
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QStringLiteral("av_0011, av_0012, av_0013"));
|
||||
data.videoContent().set(QJsonDocument(obj).toJson().constData());
|
||||
data.videoContent.set(QJsonDocument(obj).toJson().constData());
|
||||
|
||||
obj[QStringLiteral("actualStream")] = QJsonValue(QStringLiteral("hf01"));
|
||||
obj[QStringLiteral("allStreams")] = QJsonValue(QStringLiteral("vhf01, hf01, hf02, vhf03"));
|
||||
data.audioContent().set(QJsonDocument(obj).toJson().constData());
|
||||
data.audioContent.set(QJsonDocument(obj).toJson().constData());
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send evlElementModifyRequest for elementId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send evlElementModifyRequest for elementId:" << data.id;
|
||||
if (!m_ftc->evlElementModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for snapshotId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for snapshotId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -326,13 +326,13 @@ void EvlTests::tryRemoveElement()
|
||||
m_eTestStep = eRemoveElement;
|
||||
EvlElementRemoveRequest data;
|
||||
|
||||
data.id(m_elementId);
|
||||
data.criteriumId(m_criteriumId);
|
||||
data.id = m_elementId;
|
||||
data.criteriumId = m_criteriumId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for elementId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for elementId:" << data.id;
|
||||
if (!m_ftc->evlElementRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for elementId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for elementId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -344,8 +344,8 @@ void EvlTests::tryCreateSanNineLiner()
|
||||
m_eTestStep = eCreateSanNineLiner;
|
||||
SanNineLinerModifyRequest data;
|
||||
|
||||
data.id(0);
|
||||
data.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
data.id = 0;
|
||||
data.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
data.line1_position(Core::GeoPosition2D(0.100000, 0.2450000));
|
||||
data.line2_radioFrequencyCallSignSuffix("32.00 FM, Troublemaker");
|
||||
|
||||
@@ -401,9 +401,9 @@ void EvlTests::tryCreateSanNineLiner()
|
||||
vecCl.push_back(std::move(cl));
|
||||
|
||||
QJsonDocument doc = SanCategoryLine::toJson(vecCl);
|
||||
data.lines(doc.toJson().toStdString());
|
||||
data.lines = doc.toJson().toStdString();
|
||||
|
||||
INFO_LOG(m_logger) << "lines: " << data.lines();
|
||||
INFO_LOG(m_logger) << "lines: " << data.lines;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send sanNineLinerRequest";
|
||||
if (!m_ftc->sanNineLinerModifyRequest(data, this))
|
||||
@@ -420,8 +420,8 @@ void EvlTests::tryModifySanNineLiner()
|
||||
m_eTestStep = eModifySanNineLiner;
|
||||
SanNineLinerModifyRequest data;
|
||||
|
||||
data.id(m_sanNineLinerId);
|
||||
data.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
data.id = m_sanNineLinerId;
|
||||
data.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
data.line1_position(Core::GeoPosition2D(0.200000, 0.4560000));
|
||||
data.line2_radioFrequencyCallSignSuffix("39.000 FM, Troublemaker");
|
||||
|
||||
@@ -476,9 +476,9 @@ void EvlTests::tryModifySanNineLiner()
|
||||
vecCl.push_back(std::move(cl));
|
||||
|
||||
QJsonDocument doc = SanCategoryLine::toJson(vecCl);
|
||||
data.lines(doc.toJson().toStdString());
|
||||
data.lines = doc.toJson().toStdString();
|
||||
|
||||
INFO_LOG(m_logger) << "lines: " << data.lines();
|
||||
INFO_LOG(m_logger) << "lines: " << data.lines;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send sanNineLinerRequest";
|
||||
if (!m_ftc->sanNineLinerModifyRequest(data, this))
|
||||
@@ -495,12 +495,12 @@ void EvlTests::tryRemoveSanNineLiner()
|
||||
m_eTestStep = eRemoveSanNineLiner;
|
||||
EvlCriteriumRemoveRequest data;
|
||||
|
||||
data.id(m_sanNineLinerId);
|
||||
data.id = m_sanNineLinerId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for sanNineLinerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for sanNineLinerId:" << data.id;
|
||||
if (!m_ftc->sanNineLinerRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for sanNineLinerId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for sanNineLinerId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
QTest::qWait(1000);
|
||||
@@ -525,19 +525,19 @@ void EvlTests::tryGetSanNineLiner()
|
||||
m_dtc->waitForHistoricalDataSanNineLiner(5000);
|
||||
Evaluations::SanNineLiner data = m_dtc->sanNineLiner(m_sanNineLinerId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for sanNineLiner " << m_sanNineLinerId << " returnVal: " << data.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for sanNineLiner " << m_sanNineLinerId << " returnVal: " << data.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "SanNineLiner(" << data.id() << ") :"
|
||||
<< " lastModified: " << data.lastModified()
|
||||
<< " position lat: " << data.line1_position().lat()
|
||||
<< " position lon: " << data.line1_position().lon()
|
||||
<< " radiofreq, CallSign: " << data.line2_RadioFrequencyCallSignSuffix()
|
||||
<< " lines: " << data.lines();
|
||||
INFO_LOG(m_logger) << "SanNineLiner(" << data.id << ") :"
|
||||
<< " lastModified: " << data.lastModified
|
||||
<< " position lat: " << data.line1_position.lat
|
||||
<< " position lon: " << data.line1_position.lon
|
||||
<< " radiofreq, CallSign: " << data.line2_RadioFrequencyCallSignSuffix
|
||||
<< " lines: " << data.lines;
|
||||
|
||||
}
|
||||
|
||||
@@ -696,21 +696,21 @@ void EvlTests::onSanNineLinerRemoveReply(const Core::FunctionReplyObject &replyO
|
||||
//-----------------------------------------------------------------------------
|
||||
void EvlTests::onReceiveCriteriumChanged(const EvaluationCriterium &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onReceiveCriteriumChanged() criteriumId:" << data.id()
|
||||
INFO_LOG(m_logger) << "onReceiveCriteriumChanged() criteriumId:" << data.id
|
||||
<< " modificationType: = " << (int)modType<< " received";
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG(m_logger) << "*** Criterium added received. criteriumId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Criterium added received. criteriumId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG(m_logger) << "*** Criterium modified received. criteriumId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Criterium modified received. criteriumId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG(m_logger) << "*** Criterium removed received. criteriumId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Criterium removed received. criteriumId:" << data.id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -720,9 +720,9 @@ void EvlTests::onReceiveCriteriumChanged(const EvaluationCriterium &data, DataMo
|
||||
//-----------------------------------------------------------------------------
|
||||
void EvlTests::getCriteriumModifyRequestData(EvlCriteriumModifyRequest &data)
|
||||
{
|
||||
data.name("Name criterium modified");
|
||||
data.description("Description modified");
|
||||
data.operatorId(m_operatorId);
|
||||
data.name = "Name criterium modified";
|
||||
data.description = "Description modified";
|
||||
data.operatorId = m_operatorId;
|
||||
|
||||
} // end of getCriteriumModifyRequestData()
|
||||
|
||||
@@ -737,7 +737,7 @@ void EvlTests::getSanNineLinerModifyRequestData(SanNineLinerModifyRequest &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool EvlTests::onCompareCreatedData(EvaluationCriterium &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -745,17 +745,17 @@ bool EvlTests::onCompareCreatedData(EvaluationCriterium &data)
|
||||
|
||||
getCriteriumModifyRequestData(createData);
|
||||
|
||||
if (createData.name() != data.name())
|
||||
if (createData.name != data.name)
|
||||
return false;
|
||||
|
||||
if (createData.operatorId() != data.operatorId())
|
||||
if (createData.operatorId != data.operatorId)
|
||||
return false;
|
||||
|
||||
if (createData.description() != data.description())
|
||||
if (createData.description != data.description)
|
||||
return false;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
@@ -763,19 +763,19 @@ bool EvlTests::onCompareCreatedData(EvaluationCriterium &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool EvlTests::onCompareCreatedData(SanNineLiner &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
SanNineLinerModifyRequest createData;
|
||||
|
||||
getSanNineLinerModifyRequestData(createData);
|
||||
|
||||
if (createData.line1_position() != data.line1_position())
|
||||
if (createData.line1_position != data.line1_position)
|
||||
return false;
|
||||
|
||||
if (createData.line2_radioFrequencyCallSignSuffix() != data.line2_RadioFrequencyCallSignSuffix())
|
||||
if (createData.line2_radioFrequencyCallSignSuffix != data.line2_RadioFrequencyCallSignSuffix)
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
|
||||
@@ -83,9 +83,9 @@ void HandlerComment::createDefaultSchema()
|
||||
rti::core::SampleIdentity cookie;
|
||||
EvlSchemaModifyRequest request;
|
||||
|
||||
request.id(0);
|
||||
request.schemadata() = Evaluations::Settings::defaultSchema().toStdString();
|
||||
request.sendToTa(false);
|
||||
request.id = 0;
|
||||
request.schemadata = Evaluations::Settings::defaultSchema().toStdString();
|
||||
request.sendToTa = false;
|
||||
onEvlSchemaModifyRequest(cookie, request);
|
||||
}
|
||||
|
||||
@@ -94,21 +94,21 @@ void HandlerComment::onEvlCommentModifyRequest(const rti::core::SampleIdentity &
|
||||
const EvlCommentModifyRequest &request)
|
||||
{
|
||||
Database::EvlComment data;
|
||||
data.id = request.id();
|
||||
data.ts = QDateTime::fromMSecsSinceEpoch(request.ts());
|
||||
data.senderOperatorId = request.senderOperatorId();
|
||||
data.id = request.id;
|
||||
data.ts = QDateTime::fromMSecsSinceEpoch(request.ts);
|
||||
data.senderOperatorId = request.senderOperatorId;
|
||||
|
||||
if (request.receiverOperatorId().is_set())
|
||||
data.receiverOperatorId = request.receiverOperatorId().get();
|
||||
if (request.receiverOperatorId.is_set())
|
||||
data.receiverOperatorId = request.receiverOperatorId.get();
|
||||
|
||||
data.text = QString::fromStdString(request.text());
|
||||
data.hierarchy = QString::fromStdString(request.hierarchy());
|
||||
data.schemaId = request.schemaId();
|
||||
data.elementId = request.elementId();
|
||||
data.text = QString::fromStdString(request.text);
|
||||
data.hierarchy = QString::fromStdString(request.hierarchy);
|
||||
data.schemaId = request.schemaId;
|
||||
data.elementId = request.elementId;
|
||||
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (request.id() <= 0)
|
||||
if (request.id <= 0)
|
||||
{
|
||||
ObjectComment *ifs(new ObjectComment(m_ddsHandler, m_db));
|
||||
ret = ifs->createObject(data);
|
||||
@@ -124,7 +124,7 @@ void HandlerComment::onEvlCommentModifyRequest(const rti::core::SampleIdentity &
|
||||
}
|
||||
else
|
||||
{
|
||||
data.id = request.id();
|
||||
data.id = request.id;
|
||||
ObjectComment *ifs = m_mapObjectComment.value(data.id);
|
||||
ret = ifs->updateObject(data);
|
||||
}
|
||||
@@ -137,12 +137,12 @@ void HandlerComment::onEvlSchemaModifyRequest(const rti::core::SampleIdentity &c
|
||||
const EvlSchemaModifyRequest &request)
|
||||
{
|
||||
Database::EvlSchema data;
|
||||
data.id = request.id();
|
||||
data.schemadata = QString::fromStdString(request.schemadata());
|
||||
data.sendToTa = request.sendToTa();
|
||||
data.id = request.id;
|
||||
data.schemadata = QString::fromStdString(request.schemadata);
|
||||
data.sendToTa = request.sendToTa;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (request.id() <= 0 && !m_mapObjectSchema.contains(std::abs(request.id())))
|
||||
if (request.id <= 0 && !m_mapObjectSchema.contains(std::abs(request.id)))
|
||||
{
|
||||
ObjectSchema *ifs(new ObjectSchema(m_ddsHandler, m_db));
|
||||
ret = ifs->createObject(data);
|
||||
|
||||
@@ -84,12 +84,12 @@ void HandlerCriterium::onEvlCriteriumModifyRequest(const rti::core::SampleIdenti
|
||||
const EvlCriteriumModifyRequest &request)
|
||||
{
|
||||
Database::EvlCriterium data;
|
||||
data.name = QString::fromStdString(request.name());
|
||||
data.description = QString::fromStdString(request.description());
|
||||
data.operatorId = request.operatorId();
|
||||
data.name = QString::fromStdString(request.name);
|
||||
data.description = QString::fromStdString(request.description);
|
||||
data.operatorId = request.operatorId;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (request.id() <= 0)
|
||||
if (request.id <= 0)
|
||||
{
|
||||
ObjectCriterium *ifs = new ObjectCriterium(m_ddsHandler, m_db);
|
||||
ret = ifs->createObject(data);
|
||||
@@ -105,7 +105,7 @@ void HandlerCriterium::onEvlCriteriumModifyRequest(const rti::core::SampleIdenti
|
||||
}
|
||||
else
|
||||
{
|
||||
data.id = request.id();
|
||||
data.id = request.id;
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(data.id);
|
||||
ret = ifs->updateObject(data);
|
||||
}
|
||||
@@ -118,11 +118,11 @@ void HandlerCriterium::onEvlCriteriumRemoveRequest(const rti::core::SampleIdenti
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onEvlCriteriumRemoveRequest: " << request;
|
||||
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.id());
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.id);
|
||||
Core::FunctionReplyObject ret;
|
||||
if (!ifs)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.id);
|
||||
m_ddsHandler->fts()->evlCriteriumRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -134,31 +134,31 @@ void HandlerCriterium::onEvlCriteriumRemoveRequest(const rti::core::SampleIdenti
|
||||
void HandlerCriterium::onEvlElementModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const EvlElementModifyRequest &request)
|
||||
{
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.criteriumId());
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.criteriumId);
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (!ifs)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.criteriumId(), tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.criteriumId());
|
||||
ret = Core::FunctionReplyObject(request.criteriumId, tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.criteriumId);
|
||||
m_ddsHandler->fts()->evlElementModifyReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
Database::EvlElement data;
|
||||
|
||||
data.criteriumId = request.criteriumId();
|
||||
data.id = request.id();
|
||||
data.duration = request.duration();
|
||||
data.note = QString::fromStdString(request.note());
|
||||
data.phaseId = request.phaseId();
|
||||
data.rating = request.rating();
|
||||
data.time = request.timestamp();
|
||||
if (request.audioContent().is_set())
|
||||
data.audioContent = QString::fromStdString(request.audioContent().get());
|
||||
if (request.videoContent().is_set())
|
||||
data.videoContent = QString::fromStdString(request.videoContent().get());
|
||||
if (request.situationContent().is_set())
|
||||
data.situationContent = QString::fromStdString(request.situationContent().get());
|
||||
data.criteriumId = request.criteriumId;
|
||||
data.id = request.id;
|
||||
data.duration = request.duration;
|
||||
data.note = QString::fromStdString(request.note);
|
||||
data.phaseId = request.phaseId;
|
||||
data.rating = request.rating;
|
||||
data.time = request.timestamp;
|
||||
if (request.audioContent.is_set())
|
||||
data.audioContent = QString::fromStdString(request.audioContent.get());
|
||||
if (request.videoContent.is_set())
|
||||
data.videoContent = QString::fromStdString(request.videoContent.get());
|
||||
if (request.situationContent.is_set())
|
||||
data.situationContent = QString::fromStdString(request.situationContent.get());
|
||||
|
||||
if (data.id <= 0)
|
||||
{
|
||||
@@ -189,23 +189,23 @@ void HandlerCriterium::onEvlElementModifyRequest(const rti::core::SampleIdentity
|
||||
void HandlerCriterium::onEvlElementRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const EvlElementRemoveRequest &request)
|
||||
{
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.criteriumId());
|
||||
ObjectCriterium *ifs = m_criteriumObjMap.value(request.criteriumId);
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (!ifs)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.criteriumId(), tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.criteriumId());
|
||||
ret = Core::FunctionReplyObject(request.criteriumId, tr_lts("dds", "No EvlCriterium with id %1 found")).arg(request.criteriumId);
|
||||
m_ddsHandler->fts()->evlElementModifyReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectEvaluationElement *oee = ifs->getElement(request.id());
|
||||
ObjectEvaluationElement *oee = ifs->getElement(request.id);
|
||||
if (!oee)
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "No EvaluationElement with id %1 found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "No EvaluationElement with id %1 found")).arg(request.id);
|
||||
else
|
||||
{
|
||||
ret = oee->removeObject();
|
||||
ifs->removeElement(request.id());
|
||||
ifs->removeElement(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->evlElementRemoveReply(cookie, ret);
|
||||
|
||||
+16
-16
@@ -85,22 +85,22 @@ void HandlerSanNineLiner::onSanNineLinerModifyRequest(const rti::core::SampleIde
|
||||
const SanNineLinerModifyRequest &request)
|
||||
{
|
||||
Database::SanNineLiner data;
|
||||
data.id = request.id();
|
||||
data.lastModified = request.lastModified();
|
||||
data.position = QPointF(request.line1_position().lon(), request.line1_position().lat());
|
||||
data.id = request.id;
|
||||
data.lastModified = request.lastModified;
|
||||
data.position = QPointF(request.line1_position.lon, request.line1_position.lat);
|
||||
|
||||
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(request.line1_position().lon(),
|
||||
request.line1_position().lat()));
|
||||
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(request.line1_position.lon,
|
||||
request.line1_position.lat));
|
||||
data.positionXM = coord.x;
|
||||
data.positionYM = coord.y;
|
||||
|
||||
data.radioFrequencySuffixCallsign = QString::fromStdString(request.line2_radioFrequencyCallSignSuffix());
|
||||
data.radioFrequencySuffixCallsign = QString::fromStdString(request.line2_radioFrequencyCallSignSuffix);
|
||||
|
||||
INFO_LOG(m_logger) << "lines: " << request.lines();
|
||||
INFO_LOG(m_logger) << "lines: " << request.lines;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectSanNineLiner *ifs = nullptr;
|
||||
if (request.id() <= 0)
|
||||
if (request.id <= 0)
|
||||
{
|
||||
ifs = new ObjectSanNineLiner(m_ddsHandler, m_db);
|
||||
ret = ifs->createObject(data);
|
||||
@@ -119,7 +119,7 @@ void HandlerSanNineLiner::onSanNineLinerModifyRequest(const rti::core::SampleIde
|
||||
}
|
||||
else
|
||||
{
|
||||
data.id = request.id();
|
||||
data.id = request.id;
|
||||
ifs = m_mapObjectSanNineLiner.value(data.id);
|
||||
ret = ifs->updateObject(data);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ void HandlerSanNineLiner::onSanNineLinerModifyRequest(const rti::core::SampleIde
|
||||
// line3 - line9 in object_san_category_line
|
||||
INFO_LOG(m_logger) << "data.id: " << data.id;
|
||||
|
||||
QVector<Database::SanCategoryLine> linesCategory = SanCategoryLine::fromJson(request.lines(), data.id);
|
||||
QVector<Database::SanCategoryLine> linesCategory = SanCategoryLine::fromJson(request.lines, data.id);
|
||||
INFO_LOG(m_logger) << "LinesCategory count: " << linesCategory.count();
|
||||
|
||||
for (Database::SanCategoryLine cl : qAsConst(linesCategory))
|
||||
@@ -165,22 +165,22 @@ void HandlerSanNineLiner::onSanNineLinerRemoveRequest(const rti::core::SampleIde
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
|
||||
ObjectSanNineLiner *ifs = m_mapObjectSanNineLiner.value(request.id());
|
||||
ObjectSanNineLiner *ifs = m_mapObjectSanNineLiner.value(request.id);
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
if (!ifs)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "SanNineLiner with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "SanNineLiner with id %1 not found")).arg(request.id);
|
||||
m_ddsHandler->fts()->sanNineLinerRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_db->removeCategoryLinesPerNineLiner(request.id()))
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "SanCategoryLine with id %1 not found")).arg(request.id());
|
||||
if (!m_db->removeCategoryLinesPerNineLiner(request.id))
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "SanCategoryLine with id %1 not found")).arg(request.id);
|
||||
else
|
||||
{
|
||||
ifs->removeObject();
|
||||
m_mapObjectSanNineLiner.remove(request.id());
|
||||
m_mapObjectSanNineLiner.remove(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->sanNineLinerRemoveReply(cookie, ret);
|
||||
|
||||
@@ -55,15 +55,15 @@ void ObjectComment::onPublishData()
|
||||
{
|
||||
Evaluations::EvaluationComment ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.ts(m_data.ts.toMSecsSinceEpoch());
|
||||
ddsData.senderOperatorId(m_data.senderOperatorId);
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.ts = m_data.ts.toMSecsSinceEpoch();
|
||||
ddsData.senderOperatorId = m_data.senderOperatorId;
|
||||
if (!m_data.receiverOperatorId.isNull())
|
||||
ddsData.receiverOperatorId(m_data.receiverOperatorId.toUInt());
|
||||
ddsData.text(m_data.text.toStdString());
|
||||
ddsData.hierarchy(m_data.hierarchy.toStdString());
|
||||
ddsData.schemaId(m_data.schemaId);
|
||||
ddsData.elementId(m_data.elementId);
|
||||
ddsData.receiverOperatorId = m_data.receiverOperatorId.toUInt();
|
||||
ddsData.text = m_data.text.toStdString();
|
||||
ddsData.hierarchy = m_data.hierarchy.toStdString();
|
||||
ddsData.schemaId = m_data.schemaId;
|
||||
ddsData.elementId = m_data.elementId;
|
||||
|
||||
INFO_LOG(m_logger) << "Publish EvlComment-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
@@ -131,9 +131,9 @@ void ObjectSchema::onPublishData()
|
||||
{
|
||||
Evaluations::EvaluationSchema ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.schemadata(m_data.schemadata.toStdString());
|
||||
ddsData.sendToTa(m_data.sendToTa);
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.schemadata = m_data.schemadata.toStdString();
|
||||
ddsData.sendToTa = m_data.sendToTa;
|
||||
|
||||
INFO_LOG(m_logger) << "Publish EvlSchema-data to dds (id = " << m_data.id << ", send to training area = " << m_data.sendToTa << ") ...";
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@ void ObjectCriterium::onPublishData()
|
||||
{
|
||||
Evaluations::EvaluationCriterium ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.name(m_data.name.toStdString());
|
||||
ddsData.description(m_data.description.toStdString());
|
||||
ddsData.operatorId(m_data.operatorId);
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.name = m_data.name.toStdString();
|
||||
ddsData.description = m_data.description.toStdString();
|
||||
ddsData.operatorId = m_data.operatorId;
|
||||
|
||||
INFO_LOG(m_logger) << "Publish EvlCriterium-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
|
||||
+13
-13
@@ -58,23 +58,23 @@ void ObjectEvaluationElement::onPublishData()
|
||||
{
|
||||
Evaluations::EvaluationElement ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.criteriumId(m_data.criteriumId);
|
||||
ddsData.phaseId(m_data.phaseId);
|
||||
ddsData.duration(m_data.duration);
|
||||
ddsData.situation(!m_data.situationContent.isNull());
|
||||
ddsData.video(!m_data.videoContent.isNull());
|
||||
ddsData.audio(!m_data.audioContent.isNull());
|
||||
ddsData.note(m_data.note.toStdString());
|
||||
ddsData.rating(m_data.rating);
|
||||
ddsData.timestamp(m_data.time);
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.criteriumId = m_data.criteriumId;
|
||||
ddsData.phaseId = m_data.phaseId;
|
||||
ddsData.duration = m_data.duration;
|
||||
ddsData.situation = !m_data.situationContent.isNull();
|
||||
ddsData.video = !m_data.videoContent.isNull();
|
||||
ddsData.audio = !m_data.audioContent.isNull();
|
||||
ddsData.note = m_data.note.toStdString();
|
||||
ddsData.rating = m_data.rating;
|
||||
ddsData.timestamp = m_data.time;
|
||||
|
||||
if (!m_data.audioContent.isNull())
|
||||
ddsData.audioContent(m_data.audioContent.toString().toStdString());
|
||||
ddsData.audioContent = m_data.audioContent.toString().toStdString();
|
||||
if (!m_data.videoContent.isNull())
|
||||
ddsData.videoContent(m_data.videoContent.toString().toStdString());
|
||||
ddsData.videoContent = m_data.videoContent.toString().toStdString();
|
||||
if (!m_data.situationContent.isNull())
|
||||
ddsData.situationContent(m_data.situationContent.toString().toStdString());
|
||||
ddsData.situationContent = m_data.situationContent.toString().toStdString();
|
||||
|
||||
INFO_LOG(m_logger) << "Publish EvlElement-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
|
||||
@@ -69,15 +69,15 @@ void ObjectSanNineLiner::onPublishData()
|
||||
{
|
||||
Evaluations::SanNineLiner ddsData;
|
||||
|
||||
ddsData.id(m_data.id);
|
||||
ddsData.lastModified(m_data.lastModified);
|
||||
ddsData.line1_position(Core::GeoPosition2D(m_data.position.x(), m_data.position.y()));
|
||||
ddsData.line2_RadioFrequencyCallSignSuffix(m_data.radioFrequencySuffixCallsign.toStdString());
|
||||
ddsData.id = m_data.id;
|
||||
ddsData.lastModified = m_data.lastModified;
|
||||
ddsData.line1_position = Core::GeoPosition2D(m_data.position.x(), m_data.position.y());
|
||||
ddsData.line2_RadioFrequencyCallSignSuffix = m_data.radioFrequencySuffixCallsign.toStdString();
|
||||
|
||||
QJsonDocument doc = SanCategoryLine::toJson(m_lines);
|
||||
ddsData.lines(QString::fromUtf8(doc.toJson(QJsonDocument::Compact)).toStdString());
|
||||
ddsData.lines = QString::fromUtf8(doc.toJson(QJsonDocument::Compact)).toStdString();
|
||||
|
||||
INFO_LOG(m_logger) << "Publish SanNineLiner-data to dds (" << m_data.id << ") other lines: " << ddsData.lines();
|
||||
INFO_LOG(m_logger) << "Publish SanNineLiner-data to dds (" << m_data.id << ") other lines: " << ddsData.lines;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(ddsData))
|
||||
ERROR_LOG(m_logger) << "Error publishing SanNineLiner-data to dds";
|
||||
|
||||
+94
-94
@@ -77,19 +77,19 @@ void EemTests::startTest()
|
||||
if (m_testId == 1) // publish dynamicParticipantData
|
||||
{
|
||||
const qint64 time = QDateTime::currentMSecsSinceEpoch();
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::MediumDamage, time - 15000 * 60, 38);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage, time - 15000 * 60, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::MediumDamage, time - 13000 * 30, 38);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage, time - 13000 * 30, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::HeavyDamage, time - 10000 * 60, 38);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage, time - 10000 * 60, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::MobilityKill, time - 8000 * 30, 38);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill, time - 8000 * 30, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::MobilityKill, time - 6000 * 60, 38);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill, time - 6000 * 60, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::CatastrophicKill, time - 4000 * 30, 38);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill, time - 4000 * 30, 38);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::CatastrophicKill, time - 2000, 38);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill, time - 2000, 38);
|
||||
QTest::qWait(500);
|
||||
}
|
||||
|
||||
@@ -101,14 +101,14 @@ void EemTests::startTest()
|
||||
QTest::qWait(500);
|
||||
|
||||
// dynamic participant data for ied
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::HeavyDamage, time + 1000 * 60, 49, ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage, time + 1000 * 60, 49, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::MobilityKill, time + 2000 * 60, 49, ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill, time + 2000 * 60, 49, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::CatastrophicKill, time + 3000 * 60, 70, ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice);
|
||||
tryCreateDynamicParticipantData(1, ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill, time + 3000 * 60, 70, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice);
|
||||
QTest::qWait(5000);
|
||||
|
||||
checkEvents(ProjectDataManagement::PdmEventType::HitEffectSimulation, 3);
|
||||
checkEvents(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation, 3);
|
||||
}
|
||||
|
||||
if (m_testId == 3)
|
||||
@@ -123,11 +123,11 @@ void EemTests::startTest()
|
||||
if (m_testId == 6)
|
||||
{
|
||||
const qint64 time = QDateTime::currentMSecsSinceEpoch();
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::HeavyDamage, time - 10000 * 60, 0, ProjectDataManagement::StateChangeOriginator::Sanitation);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage, time - 10000 * 60, 0, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::MediumDamage, time - 8000 * 30, 0, ProjectDataManagement::StateChangeOriginator::Sanitation);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage, time - 8000 * 30, 0, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation);
|
||||
QTest::qWait(500);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::LightDamage, time - 5000 * 30, 0, ProjectDataManagement::StateChangeOriginator::Sanitation);
|
||||
tryCreateDynamicParticipantData(2, ProjectDataManagement::VulnerabilityState::VulnerabilityState_LightDamage, time - 5000 * 30, 0, ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation);
|
||||
QTest::qWait(500);
|
||||
|
||||
checkEvents(ProjectDataManagement::PdmEventType::Sanitation, 3);
|
||||
@@ -149,23 +149,23 @@ void EemTests::tryCreateDynamicParticipantData(int participantId, ProjectDataMan
|
||||
ParticipantManagement::DynamicParticipantData dp;
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
ParticipantManagement::StateInformation si;
|
||||
si.stateTime(esTime);
|
||||
si.vulnerabilityState(vulnState);
|
||||
si.stateTime = esTime;
|
||||
si.vulnerabilityState = vulnState;
|
||||
if (chargeTypeId > 0)
|
||||
si.originatorChargeTypeId(chargeTypeId);
|
||||
si.originatorId(participantId + 1);
|
||||
si.originatorType(originator);
|
||||
si.vitality(100);
|
||||
if (originator == ProjectDataManagement::StateChangeOriginator::Sanitation)
|
||||
si.originatorChargeTypeId = chargeTypeId;
|
||||
si.originatorId = participantId + 1;
|
||||
si.originatorType = originator;
|
||||
si.vitality = 100;
|
||||
if (originator == ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation)
|
||||
{
|
||||
si.sanitationResult(ParticipantManagement::SanitationResult::Sufficient);
|
||||
si.sanitationProceduresTaken(1);
|
||||
si.sanitationResult = ParticipantManagement::SanitationResult::Sufficient;
|
||||
si.sanitationProceduresTaken = 1;
|
||||
}
|
||||
|
||||
dp.participantId(participantId);
|
||||
dp.participantId = participantId;
|
||||
//dp.isManipulated(true);
|
||||
dp.stateHistory().push_back(si);
|
||||
dp.sampleTime(esTime);
|
||||
dp.stateHistory.push_back(si);
|
||||
dp.sampleTime = esTime;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData for participant " << participantId ;
|
||||
if (!m_ppmDts->publish(dp))
|
||||
@@ -180,17 +180,17 @@ void EemTests::trySendFireEvent()
|
||||
{
|
||||
TrainingAreaBase::EquipmentGearAssignment gearAssigment;
|
||||
|
||||
gearAssigment.equipmentNumber(1002);
|
||||
gearAssigment.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
gearAssigment.equipmentNumber = 1002;
|
||||
gearAssigment.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
std::vector<TrainingAreaBase::Gear> gears;
|
||||
|
||||
gears.resize(2);
|
||||
gears[0].gearId(132456);
|
||||
gears[0].gearTypeId(1003); // Sniper
|
||||
gears[1].gearId(45778);
|
||||
gears[1].gearTypeId(1006); // HMG
|
||||
gears[0].gearId = 132456;
|
||||
gears[0].gearTypeId = 1003; // Sniper
|
||||
gears[1].gearId = 45778;
|
||||
gears[1].gearTypeId = 1006; // HMG
|
||||
|
||||
gearAssigment.gears(gears);
|
||||
gearAssigment.gears = gears;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearAssigment";
|
||||
if (!m_tabDts->publish(gearAssigment))
|
||||
@@ -201,17 +201,17 @@ void EemTests::trySendFireEvent()
|
||||
|
||||
TrainingAreaBase::EquipmentGearChargeState gearChargeState;
|
||||
|
||||
gearChargeState.equipmentNumber(1002);
|
||||
gearChargeState.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
gearChargeState.equipmentNumber = 1002;
|
||||
gearChargeState.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
std::vector<TrainingAreaBase::GearCharge> vGearCharge;
|
||||
vGearCharge.resize(1);
|
||||
vGearCharge[0].gearId(132456);
|
||||
vGearCharge[0].gearTypeId(1003);
|
||||
vGearCharge[0].chargeTypeId(44);
|
||||
vGearCharge[0].remain(250);
|
||||
vGearCharge[0].gearId = 132456;
|
||||
vGearCharge[0].gearTypeId = 1003;
|
||||
vGearCharge[0].chargeTypeId = 44;
|
||||
vGearCharge[0].remain = 250;
|
||||
|
||||
gearChargeState.charge(vGearCharge);
|
||||
gearChargeState.charge = vGearCharge;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearChargeState";
|
||||
if (!m_tabDts->publish(gearChargeState))
|
||||
@@ -221,16 +221,16 @@ void EemTests::trySendFireEvent()
|
||||
}
|
||||
|
||||
TrainingAreaBase::EquipmentGearEvent gearEvent;
|
||||
gearEvent.equipmentNumber(1002);
|
||||
gearEvent.sampleTime(QDateTime::currentMSecsSinceEpoch()+1000);
|
||||
gearEvent.equipmentNumber = 1002;
|
||||
gearEvent.sampleTime = QDateTime::currentMSecsSinceEpoch()+1000;
|
||||
|
||||
TrainingAreaBase::GearCharge gc;
|
||||
gc.gearId(132456);
|
||||
gc.gearTypeId(1003);
|
||||
gc.chargeTypeId(44);
|
||||
gc.remain(200);
|
||||
gearEvent.chargeAmount(200);
|
||||
gearEvent.charge(gc);
|
||||
gc.gearId = 132456;
|
||||
gc.gearTypeId = 1003;
|
||||
gc.chargeTypeId = 44;
|
||||
gc.remain = 200;
|
||||
gearEvent.chargeAmount = 200;
|
||||
gearEvent.charge = gc;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearEvent";
|
||||
if (!m_tabDts->publish(gearEvent))
|
||||
@@ -239,13 +239,13 @@ void EemTests::trySendFireEvent()
|
||||
failExit();
|
||||
}
|
||||
|
||||
gearEvent.equipmentNumber(1003);
|
||||
gc.gearId(45678);
|
||||
gc.gearTypeId(1009);
|
||||
gc.chargeTypeId(9);
|
||||
gc.remain(350);
|
||||
gearEvent.chargeAmount(100);
|
||||
gearEvent.charge(gc);
|
||||
gearEvent.equipmentNumber = 1003;
|
||||
gc.gearId = 45678;
|
||||
gc.gearTypeId = 1009;
|
||||
gc.chargeTypeId = 9;
|
||||
gc.remain = 350;
|
||||
gearEvent.chargeAmount = 100;
|
||||
gearEvent.charge = gc;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publish EquipmentGearEvent";
|
||||
if (!m_tabDts->publish(gearEvent))
|
||||
@@ -263,9 +263,9 @@ void EemTests::trySendFireEvent()
|
||||
int noEvents = 0;
|
||||
for(const ExerciseEventManagement::Event &e : events)
|
||||
{
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
if (e.eventTypeId() == ProjectDataManagement::PdmEventType_def::WeaponAssignment ||
|
||||
e.eventTypeId() == ProjectDataManagement::PdmEventType_def::FireEvent)
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id << ", eventType: " << e.eventTypeId;
|
||||
if (e.eventTypeId == ProjectDataManagement::PdmEventType::WeaponAssignment ||
|
||||
e.eventTypeId == ProjectDataManagement::PdmEventType::FireEvent)
|
||||
noEvents ++;
|
||||
}
|
||||
|
||||
@@ -283,27 +283,27 @@ void EemTests::trySendBiteMessage()
|
||||
{
|
||||
TrainingAreaBase::EquipmentBite bite;
|
||||
|
||||
bite.batteryState(2);
|
||||
bite.equipmentNumber(1002);
|
||||
bite.biteState(16);
|
||||
bite.configError(true);
|
||||
bite.configState(8);
|
||||
bite.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
bite.batteryState = 2;
|
||||
bite.equipmentNumber = 1002;
|
||||
bite.biteState = 16;
|
||||
bite.configError = true;
|
||||
bite.configState = 8;
|
||||
bite.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
std::vector<TrainingAreaBase::EquipmentBiteError> beVec;
|
||||
beVec.resize(2);
|
||||
|
||||
beVec[0].canDeviceNumber(1000);
|
||||
beVec[0].errorNumber(23);
|
||||
beVec[0].subdeviceNumber(110);
|
||||
beVec[0].uniqueId(198765);
|
||||
beVec[0].canDeviceNumber = 1000;
|
||||
beVec[0].errorNumber = 23;
|
||||
beVec[0].subdeviceNumber = 110;
|
||||
beVec[0].uniqueId = 198765;
|
||||
|
||||
beVec[1].canDeviceNumber(1001);
|
||||
beVec[1].errorNumber(24);
|
||||
beVec[1].subdeviceNumber(111);
|
||||
beVec[1].uniqueId(9876);
|
||||
beVec[1].canDeviceNumber = 1001;
|
||||
beVec[1].errorNumber = 24;
|
||||
beVec[1].subdeviceNumber = 111;
|
||||
beVec[1].uniqueId = 9876;
|
||||
|
||||
bite.biteErrors(beVec);
|
||||
bite.biteErrors = beVec;
|
||||
|
||||
if (!m_tabDts->publish(bite))
|
||||
{
|
||||
@@ -318,12 +318,12 @@ void EemTests::trySendBuildingState()
|
||||
{
|
||||
Buildings::BuildingState bState;
|
||||
|
||||
bState.id(301);
|
||||
bState.damagePercent(80);
|
||||
bState.damagePercentOld(0);
|
||||
bState.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
bState.vulnerabilityState(ProjectDataManagement::VulnerabilityState::CatastrophicKill);
|
||||
bState.structureElementId(26);
|
||||
bState.id = 301;
|
||||
bState.damagePercent = 80;
|
||||
bState.damagePercentOld = 0;
|
||||
bState.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
bState.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill;
|
||||
bState.structureElementId = 26;
|
||||
// bState.aesId(1);
|
||||
// bState.assetId(10);
|
||||
// bState.chargeTypeId(44);
|
||||
@@ -346,18 +346,18 @@ void EemTests::tryCreateIed(qint64 time)
|
||||
{
|
||||
GuezIedManagement::Ied ied;
|
||||
|
||||
ied.id(100);
|
||||
ied.name("Test IED");
|
||||
ied.partyId(4);
|
||||
ied.equipmentNumber(1003);
|
||||
ied.type(GuezIedManagement::IedType::IedBigPyro);
|
||||
ied.explosiveForce(100);
|
||||
ied.pairingState(GuezIedManagement::IedPairingState_def::NotPaired);
|
||||
ied.tacticalState(GuezIedManagement::IedTacticalState_def::TriggeredByControlDevice);
|
||||
ied.pyrotechnics(true);
|
||||
ied.symbol("AP6D|CMPL|10014000001103000000");
|
||||
ied.id = 100;
|
||||
ied.name = "Test IED";
|
||||
ied.partyId = 4;
|
||||
ied.equipmentNumber = 1003;
|
||||
ied.type = GuezIedManagement::IedType::IedBigPyro;
|
||||
ied.explosiveForce = 100;
|
||||
ied.pairingState = GuezIedManagement::IedPairingState::NotPaired;
|
||||
ied.tacticalState = GuezIedManagement::IedTacticalState::TriggeredByControlDevice;
|
||||
ied.pyrotechnics = true;
|
||||
ied.symbol = "AP6D|CMPL|10014000001103000000";
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
ied.sampleTime(esTime);
|
||||
ied.sampleTime = esTime;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing Ied " ;
|
||||
if (!m_gimDts->publish(ied))
|
||||
@@ -377,13 +377,13 @@ void EemTests::checkEvents(const ProjectDataManagement::PdmEventType &et, int ex
|
||||
|
||||
for (const ExerciseEventManagement::Event &e : events)
|
||||
{
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id() << ", eventType: " << e.eventTypeId().underlying();
|
||||
if (e.eventTypeId() == et)
|
||||
INFO_LOG(m_logger) << "eventId: " << e.id << ", eventType: " << e.eventTypeId;
|
||||
if (e.eventTypeId == et)
|
||||
{
|
||||
QJsonObject prop = LtsUtils::JsonObject::fromJson(e.properties());
|
||||
QJsonObject prop = LtsUtils::JsonObject::fromJson(e.properties);
|
||||
|
||||
int ot = prop[QStringLiteral("OriginatorType")].toInt();
|
||||
if (et == ProjectDataManagement::PdmEventType::HitEffectSimulation && ot == 20) //ImprovisedExplosiveDevice
|
||||
if (et == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation && ot == 20) //ImprovisedExplosiveDevice
|
||||
noEvents ++;
|
||||
if (et == ProjectDataManagement::PdmEventType::Sanitation && ot == 10) // Sanitation
|
||||
noEvents ++;
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public Q_SLOTS:
|
||||
protected Q_SLOTS:
|
||||
|
||||
void tryCreateDynamicParticipantData(int participantId, ProjectDataManagement::VulnerabilityState vulnState, qint64 time, int chargeTypeId,
|
||||
ProjectDataManagement::StateChangeOriginator originator = ProjectDataManagement::StateChangeOriginator::Participant);
|
||||
ProjectDataManagement::StateChangeOriginator originator = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Participant);
|
||||
void trySendFireEvent();
|
||||
void trySendBiteMessage();
|
||||
void trySendBuildingState();
|
||||
|
||||
+9
-3
@@ -4,9 +4,15 @@
|
||||
# $Author$
|
||||
#
|
||||
|
||||
# Make ${Qt6_WebSockets} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets)
|
||||
set(Qt6_WebSockets ${Qt6_WebSockets})
|
||||
# Link the real WebSockets module whenever the websocket code path is
|
||||
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
|
||||
# Qt6::WebSockets import are set when the real module was found. The old
|
||||
# QT6_GUI_AVAILABLE condition never holds in this environment (Qt6
|
||||
# discovery takes the minimal path) and the Qt6_WebSockets variable was
|
||||
# never defined, so the websocket code compiled without the module on the
|
||||
# link line and failed only at link time.
|
||||
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
|
||||
set(Qt6_WebSockets Qt6::WebSockets)
|
||||
else()
|
||||
set(Qt6_WebSockets "")
|
||||
endif()
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
bool init(const QStringList &qosFileList = QStringList());
|
||||
|
||||
void setRunningState(Core::RunningState rs);
|
||||
void addPortToPacemaker(quint16 port, Core::PortType type);
|
||||
void addPortToPacemaker(quint16 port, Core::CorePortType type);
|
||||
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
std::shared_ptr<ExerciseEventManagement::Interface::Dts> dts() const { return m_ddsDts; }
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<topicType name="Event" isDataObject="1" routeToClient="0" routeToServer="0" routeInReplay="0" recordTopic="0">
|
||||
<column name="id" idlType="long long" isKey="1"/>
|
||||
<column name="sampleTime" idlType="long long"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::EventType"/>
|
||||
<column name="eventTypeId" idlType="ProjectDataManagement::PdmEventType"/>
|
||||
<column name="participantId" idlType="long"/>
|
||||
<column name="partyId" idlType="long"/>
|
||||
<column name="equipmentNumber" idlType="long"/>
|
||||
|
||||
+6
-6
@@ -188,8 +188,8 @@ void HandlerDynamicParticipantData::tryCreateHitEvent(Database::EemEvent eData,
|
||||
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::Participant)
|
||||
{
|
||||
ParticipantManagement::Participant originData = m_partMap.value(stateInfo.originatorId());
|
||||
if (originData.equipmentNumber().is_set())
|
||||
obj[QStringLiteral("OriginatorEquipmentNumber")] = originData.equipmentNumber().get();
|
||||
if (originData.equipmentNumber.is_set())
|
||||
obj[QStringLiteral("OriginatorEquipmentNumber")] = originData.equipmentNumber.get();
|
||||
|
||||
if (originData.partyId() == eData.partyId)
|
||||
obj[QStringLiteral("FriendlyFire")] = true;
|
||||
@@ -269,7 +269,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
|
||||
|
||||
Database::EemEvent eData;
|
||||
eData.participantId = data.participantId();
|
||||
eData.equipmentNumber = pData.equipmentNumber().is_set() ? pData.equipmentNumber().get() : -1;
|
||||
eData.equipmentNumber = pData.equipmentNumber.is_set() ? pData.equipmentNumber.get() : -1;
|
||||
eData.partyId = pData.partyId();
|
||||
eData.sampleTime = data.sampleTime();
|
||||
eData.eventTypeId = ProjectDataManagement::PdmEventType_def::Unknown;
|
||||
@@ -373,7 +373,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
|
||||
Database::EemEvent eData;
|
||||
eData.id = 0;
|
||||
eData.participantId = data.participantId();
|
||||
eData.equipmentNumber = pData.equipmentNumber().is_set() ? pData.equipmentNumber().get() : -1;
|
||||
eData.equipmentNumber = pData.equipmentNumber.is_set() ? pData.equipmentNumber.get() : -1;
|
||||
eData.partyId = pData.partyId();
|
||||
eData.sampleTime = data.sampleTime();
|
||||
eData.eventTypeId = ProjectDataManagement::PdmEventType_def::FireEvent;
|
||||
@@ -508,8 +508,8 @@ void HandlerDynamicParticipantData::onBuildingStateChanged(const Buildings::Buil
|
||||
if (data.originatorType() == ProjectDataManagement::StateChangeOriginator::Participant)
|
||||
{
|
||||
ParticipantManagement::Participant originData = m_partMap.value(data.originatorParticipantId());
|
||||
if (originData.equipmentNumber().is_set())
|
||||
obj[QStringLiteral("OriginatorEquipmentNumber")] = originData.equipmentNumber().get();
|
||||
if (originData.equipmentNumber.is_set())
|
||||
obj[QStringLiteral("OriginatorEquipmentNumber")] = originData.equipmentNumber.get();
|
||||
}
|
||||
if (data.originatorType() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
||||
{
|
||||
|
||||
+7
-7
@@ -90,8 +90,8 @@ void HandlerParticipantEvent::onAesItemViewChanged(const AreaEffectSimulation::A
|
||||
Database::EemEvent eData = m_aesMap[data.id()];
|
||||
eData.sampleTime = data.effectStart();
|
||||
|
||||
if (data.partyId().is_set())
|
||||
eData.partyId = data.partyId().get();
|
||||
if (data.partyId.is_set())
|
||||
eData.partyId = data.partyId.get();
|
||||
|
||||
switch(modType)
|
||||
{
|
||||
@@ -242,14 +242,14 @@ void HandlerParticipantEvent::onExplosionSingleChanged(const AreaEffectSimulatio
|
||||
{
|
||||
|
||||
Database::EemEvent eData = m_aesMap[data.id()];
|
||||
if ( !data.effectStart().is_set())
|
||||
if ( !data.effectStart.is_set())
|
||||
{
|
||||
return;
|
||||
}
|
||||
eData.sampleTime = data.effectStart().get();
|
||||
eData.sampleTime = data.effectStart.get();
|
||||
|
||||
if (data.partyId().is_set())
|
||||
eData.partyId = data.partyId().get();
|
||||
if (data.partyId.is_set())
|
||||
eData.partyId = data.partyId.get();
|
||||
|
||||
switch(modType)
|
||||
{
|
||||
@@ -280,7 +280,7 @@ void HandlerParticipantEvent::onExplosionSingleChanged(const AreaEffectSimulatio
|
||||
obj[QStringLiteral("AesType")] = QJsonValue(AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||
obj[QStringLiteral("ChargeTypeId")] = QJsonValue(data.chargeStruct().chargeTypeId());
|
||||
obj[QStringLiteral("duration")] = QJsonValue(aesItem.effectDuration());
|
||||
obj[QStringLiteral("endTime")] = QJsonValue(data.effectStart().get() + aesItem.effectDuration());
|
||||
obj[QStringLiteral("endTime")] = QJsonValue(data.effectStart.get() + aesItem.effectDuration());
|
||||
eData.properties = QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact));
|
||||
|
||||
//const Core::GeoPosition geoPosition ( data.impactPosition().lon(), data.impactPosition().lat(), 0);
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ bool MainHandler::loadFromDatabase()
|
||||
ERROR_LOG(m_logger) << "Can not initialize WebSocket Event server";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->addPortToPacemaker(m_webSocketEventServer->listenPort(), Core::PortType::WebSocketServer);
|
||||
m_ddsHandler->addPortToPacemaker(m_webSocketEventServer->listenPort(), Core::CorePortType::WebSocketServer);
|
||||
|
||||
if (!m_handlerEerEvent || !m_handlerEerEvent->init())
|
||||
{
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ void WebSocketEventServer::historyDataRequested(const QSqlDatabase &db, QWebSock
|
||||
{
|
||||
const QString ids = query.queryItemValue(QStringLiteral("eventTypeId"));
|
||||
// split/unsplit to make sure only integers are there
|
||||
const QVector<QStringRef> idVec = ids.splitRef(QLatin1Char(','));
|
||||
const QStringList idVec = ids.split(QLatin1Char(','));
|
||||
QStringList eventList;
|
||||
eventList.reserve(idVec.size());
|
||||
for (const auto &id : idVec)
|
||||
|
||||
+43
-43
@@ -136,11 +136,11 @@ void ExmTests::tryCreateTrainingArea()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modifyRequest TrainingArea (create)";
|
||||
AssetManagement::TrainingAreaModifyRequest request;
|
||||
request.id(0);
|
||||
request.name("TestTrainingAreaCreate");
|
||||
request.bottomLeft(Core::GeoPosition2D(11.61/180*M_PI, 53.07/180*M_PI));
|
||||
request.height(1000000);
|
||||
request.width(1000000);
|
||||
request.id = 0;
|
||||
request.name = "TestTrainingAreaCreate";
|
||||
request.bottomLeft = Core::GeoPosition2D(11.61/180*M_PI, 53.07/180*M_PI);
|
||||
request.height = 1000000;
|
||||
request.width = 1000000;
|
||||
|
||||
if (!m_ftc_asm->trainingAreaModifyRequest(request, this))
|
||||
|
||||
@@ -176,14 +176,14 @@ void ExmTests::tryCreate()
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Exercise";
|
||||
ExerciseCreateRequest req;
|
||||
req.name(std::string("TestExerciseCreate"));
|
||||
req.beginTime(10);
|
||||
req.endTime(20);
|
||||
req.trainingAreaId(m_trainingAreaId);
|
||||
req.radioGroupId(radioGroupId);
|
||||
req.symbolFillTypeId(symbolFillType);
|
||||
req.forces(std::string("Forces"));
|
||||
req.description(std::string("Description"));
|
||||
req.name = std::string("TestExerciseCreate");
|
||||
req.beginTime = 10;
|
||||
req.endTime = 20;
|
||||
req.trainingAreaId = m_trainingAreaId;
|
||||
req.radioGroupId = radioGroupId;
|
||||
req.symbolFillTypeId = symbolFillType;
|
||||
req.forces = std::string("Forces");
|
||||
req.description = std::string("Description");
|
||||
|
||||
if (!m_ftc->exerciseCreateRequest(req, this))
|
||||
{
|
||||
@@ -198,17 +198,17 @@ void ExmTests::tryModify()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to send modify request for exercise Id = " << m_exerciseId;
|
||||
ExerciseModifyRequest req;
|
||||
req.id(m_exerciseId);
|
||||
req.name(std::string("ExerciseModifyTest"));
|
||||
req.beginTime(1000);
|
||||
req.endTime(2000);
|
||||
req.trainingAreaId(m_trainingAreaId);
|
||||
req.radioGroupId(1);
|
||||
req.symbolFillTypeId(1);
|
||||
req.forces(std::string("ForcesUpdated"));
|
||||
req.description(std::string("DescriptionUpdated"));
|
||||
req.activePhaseId(m_phaseId);
|
||||
req.newState(ExerciseState::Created);
|
||||
req.id = m_exerciseId;
|
||||
req.name = std::string("ExerciseModifyTest");
|
||||
req.beginTime = 1000;
|
||||
req.endTime = 2000;
|
||||
req.trainingAreaId = m_trainingAreaId;
|
||||
req.radioGroupId = 1;
|
||||
req.symbolFillTypeId = 1;
|
||||
req.forces = std::string("ForcesUpdated");
|
||||
req.description = std::string("DescriptionUpdated");
|
||||
req.activePhaseId = m_phaseId;
|
||||
req.newState = ExerciseState::Created;
|
||||
if (!m_ftc->exerciseModifyRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
@@ -268,20 +268,20 @@ void ExmTests::tryStartExercise()
|
||||
m_dtc->waitForHistoricalDataExercise();
|
||||
ExerciseManagement::Exercise ex = m_dtc->exercise(m_exerciseId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Training area id = " << ex.trainingAreaId();
|
||||
DEBUG_LOG(m_logger) << "Training area id = " << ex.trainingAreaId;
|
||||
|
||||
ExerciseModifyRequest req;
|
||||
req.id(m_exerciseId);
|
||||
req.name(std::string("ExerciseStarted"));
|
||||
req.beginTime(ex.beginTime());
|
||||
req.endTime(ex.endTime());
|
||||
req.trainingAreaId(ex.trainingAreaId());
|
||||
req.radioGroupId(ex.radioGroupId());
|
||||
req.symbolFillTypeId(ex.symbolFillTypeId());
|
||||
req.activePhaseId(ex.activePhaseId());
|
||||
req.forces(ex.forces());
|
||||
req.description(ex.description());
|
||||
req.newState(ExerciseState::Started);
|
||||
req.id = m_exerciseId;
|
||||
req.name = std::string("ExerciseStarted");
|
||||
req.beginTime = ex.beginTime;
|
||||
req.endTime = ex.endTime;
|
||||
req.trainingAreaId = ex.trainingAreaId;
|
||||
req.radioGroupId = ex.radioGroupId;
|
||||
req.symbolFillTypeId = ex.symbolFillTypeId;
|
||||
req.activePhaseId = ex.activePhaseId;
|
||||
req.forces = ex.forces;
|
||||
req.description = ex.description;
|
||||
req.newState = ExerciseState::Started;
|
||||
if (!m_ftc->exerciseModifyRequest(req, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
@@ -311,7 +311,7 @@ void ExmTests::tryGetAllExercises()
|
||||
bool bAtLeastOneFound = false;
|
||||
auto cb = [this, &bAtLeastOneFound](const ExerciseManagement::Exercise &ex)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Exe(" << ex.id() << ") : " << ex.name();
|
||||
INFO_LOG(m_logger) << "Exe(" << ex.id << ") : " << ex.name;
|
||||
bAtLeastOneFound = true;
|
||||
};
|
||||
m_dtc->exercises(cb);
|
||||
@@ -330,17 +330,17 @@ void ExmTests::tryGetExercise()
|
||||
m_dtc->waitForHistoricalDataExercise();
|
||||
ExerciseManagement::Exercise data = m_dtc->exercise(m_exerciseId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for exercise " << m_exerciseId;
|
||||
DEBUG_LOG(m_logger) << "data.id() = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "data.id() = " << data.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "## Exe(" << data.id() << ") : name = " << data.name()
|
||||
<< ", begin = " << data.beginTime() << ", end = " << data.endTime()
|
||||
<< ", state = " << data.state();
|
||||
INFO_LOG(m_logger) << "## Exe(" << data.id << ") : name = " << data.name
|
||||
<< ", begin = " << data.beginTime << ", end = " << data.endTime
|
||||
<< ", state = " << data.state;
|
||||
}
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ void ExmTests::tryGetExercise()
|
||||
void ExmTests::onExerciseChanged(const ExerciseManagement::Exercise &data,
|
||||
DataModification modType)
|
||||
{
|
||||
const int id = data.id();
|
||||
const int id = data.id;
|
||||
DEBUG_LOG(m_logger) << "onExerciseChanged for exercise " << id
|
||||
<< " - modType: " << (int)modType;
|
||||
if (m_exerciseId == id)
|
||||
|
||||
+5
-5
@@ -92,8 +92,8 @@ bool DataTopicTests::initPublisher()
|
||||
bool DataTopicTests::write(const ExerciseManagement::Exercise &data)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish topic Exercise ";
|
||||
DEBUG_LOG(m_logger) << "ExeId: " << data.id() << ", state: " << data.state()
|
||||
<< ", partitionName: " << data.partitionName();
|
||||
DEBUG_LOG(m_logger) << "ExeId: " << data.id << ", state: " << data.state
|
||||
<< ", partitionName: " << data.partitionName;
|
||||
|
||||
return m_dtsExercise->write(data);
|
||||
}
|
||||
@@ -147,9 +147,9 @@ void DataTopicTests::processData(const ExerciseManagement::Exercise &instance, D
|
||||
Q_UNUSED(modType);
|
||||
INFO_LOG(m_logger) << "process Lts_Exercise";
|
||||
|
||||
DEBUG_LOG(m_logger) << "exerciseId: " << instance.id();
|
||||
DEBUG_LOG(m_logger) << "name: " << instance.name();
|
||||
DEBUG_LOG(m_logger) << "state: " << instance.state();
|
||||
DEBUG_LOG(m_logger) << "exerciseId: " << instance.id;
|
||||
DEBUG_LOG(m_logger) << "name: " << instance.name;
|
||||
DEBUG_LOG(m_logger) << "state: " << instance.state;
|
||||
|
||||
m_receivedExerciseData = instance;
|
||||
|
||||
|
||||
+7
-7
@@ -56,11 +56,11 @@ void DataTopicTestsMain::publishTestCase()
|
||||
DEBUG_LOG(m_logger) <<"DataTopicTestsMain: publish data";
|
||||
|
||||
// Topic Exercise
|
||||
m_sentExerciseData.id(222);
|
||||
m_sentExerciseData.state(ExerciseManagement::ExerciseState::Started);
|
||||
m_sentExerciseData.name("UnitTest Exe 222");
|
||||
m_sentExerciseData.isUsed(true);
|
||||
m_sentExerciseData.partitionName(IDL::exercisePartition(222));
|
||||
m_sentExerciseData.id = 222;
|
||||
m_sentExerciseData.state = ExerciseManagement::ExerciseState::Started;
|
||||
m_sentExerciseData.name = "UnitTest Exe 222";
|
||||
m_sentExerciseData.isUsed = true;
|
||||
m_sentExerciseData.partitionName = IDL::exercisePartition(222);
|
||||
|
||||
QVERIFY2(m_dtTest->write(m_sentExerciseData), "Publishing Topic Exercise failed");
|
||||
|
||||
@@ -73,8 +73,8 @@ void DataTopicTestsMain::subscribeTestCase()
|
||||
|
||||
ExerciseManagement::Exercise recvExercise = m_dtTest->getReceivedExerciseData();
|
||||
|
||||
QCOMPARE(recvExercise.id(), m_sentExerciseData.id());
|
||||
QCOMPARE(recvExercise.state(), m_sentExerciseData.state());
|
||||
QCOMPARE(recvExercise.id, m_sentExerciseData.id);
|
||||
QCOMPARE(recvExercise.state, m_sentExerciseData.state);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ LtsWebSocket::ReplyMessage *DataManager::exerciseInformation(const QString &uuid
|
||||
exInfo.startTime = exData.startTime.toMSecsSinceEpoch();
|
||||
exInfo.stopTime = exData.stopTime.toMSecsSinceEpoch();
|
||||
exInfo.timeZone = exData.defaultTimeZone;
|
||||
exInfo.status = exData.exerciseStateId.underlying();
|
||||
exInfo.status = exData.exerciseStateId;
|
||||
exInfo.description = exData.description;
|
||||
|
||||
data.append(exInfo);
|
||||
|
||||
+27
-27
@@ -21,38 +21,38 @@ inline Exercise convert(const ExmExercise &dbData)
|
||||
{
|
||||
ExerciseManagement::Exercise ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
|
||||
// behaviour of QDateTime::toMSecsSinceEpoch() is undefinded if not valid:
|
||||
if (dbData.beginTime.isValid())
|
||||
ddsData.beginTime(dbData.beginTime.toMSecsSinceEpoch());
|
||||
ddsData.beginTime = dbData.beginTime.toMSecsSinceEpoch();
|
||||
if (dbData.endTime.isValid())
|
||||
ddsData.endTime(dbData.endTime.toMSecsSinceEpoch());
|
||||
ddsData.endTime = dbData.endTime.toMSecsSinceEpoch();
|
||||
if (dbData.created.isValid())
|
||||
ddsData.created(dbData.created.toMSecsSinceEpoch());
|
||||
ddsData.created = dbData.created.toMSecsSinceEpoch();
|
||||
if (dbData.startTime.isValid())
|
||||
ddsData.startTime(dbData.startTime.toMSecsSinceEpoch());
|
||||
ddsData.startTime = dbData.startTime.toMSecsSinceEpoch();
|
||||
if (dbData.stopTime.isValid())
|
||||
ddsData.stopTime(dbData.stopTime.toMSecsSinceEpoch());
|
||||
ddsData.stopTime = dbData.stopTime.toMSecsSinceEpoch();
|
||||
|
||||
ddsData.trainingAreaId(dbData.trainingAreaId);
|
||||
ddsData.trainingAreaId = dbData.trainingAreaId;
|
||||
if (!dbData.radioGroupId.isNull() && dbData.radioGroupId.canConvert<unsigned int>())
|
||||
ddsData.radioGroupId(dbData.radioGroupId.toUInt());
|
||||
ddsData.activePhaseId(dbData.activePhaseId);
|
||||
ddsData.symbolFillTypeId(dbData.symbolFillTypeId);
|
||||
ddsData.linkedExerciseId(dbData.linkedExerciseId);
|
||||
ddsData.radioGroupId = dbData.radioGroupId.toUInt();
|
||||
ddsData.activePhaseId = dbData.activePhaseId;
|
||||
ddsData.symbolFillTypeId = dbData.symbolFillTypeId;
|
||||
ddsData.linkedExerciseId = dbData.linkedExerciseId;
|
||||
if (!dbData.defaultTimeZone.isEmpty())
|
||||
ddsData.defaultTimeZone(dbData.defaultTimeZone.at(0).toLatin1());
|
||||
ddsData.defaultTimeZone = dbData.defaultTimeZone.at(0).toLatin1();
|
||||
else
|
||||
ddsData.defaultTimeZone('Z');
|
||||
ddsData.sendToWMS(dbData.sendToWms);
|
||||
ddsData.transferred(dbData.transferred);
|
||||
ddsData.hasHlaInterface(dbData.hasHlaInterface);
|
||||
ddsData.state(dbData.exerciseStateId);
|
||||
ddsData.forces(dbData.forces.toStdString());
|
||||
ddsData.description(dbData.description.toStdString());
|
||||
ddsData.partitionName(IDL::exercisePartition(dbData.id));
|
||||
ddsData.defaultTimeZone = 'Z';
|
||||
ddsData.sendToWMS = dbData.sendToWms;
|
||||
ddsData.transferred = dbData.transferred;
|
||||
ddsData.hasHlaInterface = dbData.hasHlaInterface;
|
||||
ddsData.state = dbData.exerciseStateId;
|
||||
ddsData.forces = dbData.forces.toStdString();
|
||||
ddsData.description = dbData.description.toStdString();
|
||||
ddsData.partitionName = IDL::exercisePartition(dbData.id);
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -61,12 +61,12 @@ inline ExercisePhase convert(const ExmExercisePhase &dbData)
|
||||
{
|
||||
ExerciseManagement::ExercisePhase ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.description(dbData.description.toStdString());
|
||||
ddsData.beginTime(dbData.beginTime.toMSecsSinceEpoch());
|
||||
ddsData.endTime(dbData.endTime.toMSecsSinceEpoch());
|
||||
ddsData.exerciseId(dbData.exerciseId);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.description = dbData.description.toStdString();
|
||||
ddsData.beginTime = dbData.beginTime.toMSecsSinceEpoch();
|
||||
ddsData.endTime = dbData.endTime.toMSecsSinceEpoch();
|
||||
ddsData.exerciseId = dbData.exerciseId;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ namespace ExerciseManagement
|
||||
|
||||
QString ExerciseStateManager::toString(ExerciseManagement::ExerciseState state)
|
||||
{
|
||||
switch (state.underlying())
|
||||
switch (state)
|
||||
{
|
||||
case ExerciseState::Unknown:
|
||||
return tr("UNKNOWN");
|
||||
@@ -74,7 +74,7 @@ namespace ExerciseManagement
|
||||
return tr("TERMINATED");
|
||||
}
|
||||
|
||||
return tr("Unknown State: (%1)").arg(state.underlying());
|
||||
return tr("Unknown State: (%1)").arg(state);
|
||||
}
|
||||
|
||||
void ExerciseStateManager::setStateInternal(ExerciseManagement::ExerciseState state)
|
||||
|
||||
+98
-98
@@ -167,23 +167,23 @@ static Database::ExmExercise copyBaseData(const T &in)
|
||||
Database::ExmExercise newData;
|
||||
|
||||
// exerciseState defined in ObjectExercise
|
||||
newData.id = in.id();
|
||||
newData.name = QString::fromStdString(in.name());
|
||||
newData.beginTime = QDateTime::fromMSecsSinceEpoch(in.beginTime());
|
||||
newData.endTime = QDateTime::fromMSecsSinceEpoch(in.endTime());
|
||||
newData.startTime = QDateTime::fromMSecsSinceEpoch(in.startTime());
|
||||
newData.stopTime = QDateTime::fromMSecsSinceEpoch(in.stopTime());
|
||||
newData.trainingAreaId = in.trainingAreaId();
|
||||
if (in.radioGroupId().is_set())
|
||||
newData.radioGroupId = in.radioGroupId().get();
|
||||
newData.symbolFillTypeId = in.symbolFillTypeId();
|
||||
newData.linkedExerciseId = in.linkedExerciseId();
|
||||
newData.defaultTimeZone = QLatin1Char(in.defaultTimeZone());
|
||||
newData.sendToWms = in.sendToWMS();
|
||||
newData.transferred = in.transferred();
|
||||
newData.hasHlaInterface = in.hasHlaInterface();
|
||||
newData.forces = QString::fromStdString(in.forces());
|
||||
newData.description = QString::fromStdString(in.description());
|
||||
newData.id = in.id;
|
||||
newData.name = QString::fromStdString(in.name);
|
||||
newData.beginTime = QDateTime::fromMSecsSinceEpoch(in.beginTime);
|
||||
newData.endTime = QDateTime::fromMSecsSinceEpoch(in.endTime);
|
||||
newData.startTime = QDateTime::fromMSecsSinceEpoch(in.startTime);
|
||||
newData.stopTime = QDateTime::fromMSecsSinceEpoch(in.stopTime);
|
||||
newData.trainingAreaId = in.trainingAreaId;
|
||||
if (in.radioGroupId.is_set())
|
||||
newData.radioGroupId = in.radioGroupId.get();
|
||||
newData.symbolFillTypeId = in.symbolFillTypeId;
|
||||
newData.linkedExerciseId = in.linkedExerciseId;
|
||||
newData.defaultTimeZone = QLatin1Char(in.defaultTimeZone);
|
||||
newData.sendToWms = in.sendToWMS;
|
||||
newData.transferred = in.transferred;
|
||||
newData.hasHlaInterface = in.hasHlaInterface;
|
||||
newData.forces = QString::fromStdString(in.forces);
|
||||
newData.description = QString::fromStdString(in.description);
|
||||
|
||||
return newData;
|
||||
}
|
||||
@@ -241,11 +241,11 @@ Core::FunctionReplyObject HandlerExercise::exerciseCreateRequest(const ExerciseC
|
||||
|
||||
// Create default phase for exercise
|
||||
ExercisePhaseCreateRequest phaseData;
|
||||
phaseData.name(tr("Phase 1").toStdString());
|
||||
phaseData.description(tr("Default exercise phase").toStdString());
|
||||
phaseData.beginTime(request.beginTime());
|
||||
phaseData.endTime(request.endTime());
|
||||
phaseData.exerciseId(ifs->id());
|
||||
phaseData.name = tr("Phase 1").toStdString();
|
||||
phaseData.description = tr("Default exercise phase").toStdString();
|
||||
phaseData.beginTime = request.beginTime;
|
||||
phaseData.endTime = request.endTime;
|
||||
phaseData.exerciseId = ifs->id();
|
||||
ret = m_mainHandler->exercisePhaseHandler()->exercisePhaseCreateRequest(phaseData);
|
||||
|
||||
if (hasError(ret, ifs))
|
||||
@@ -291,21 +291,21 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
{
|
||||
INFO_LOG(m_logger) << "onExerciseModifyRequest: " << request;
|
||||
|
||||
ObjectExercise *ifs = m_exeObjMap.value(request.id());
|
||||
ObjectExercise *ifs = m_exeObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Exercise with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Exercise with id %1 not found")).arg(request.id);
|
||||
|
||||
if (ifs->exerciseState() == ExerciseState::Created &&
|
||||
request.newState() == ExerciseState::Started)
|
||||
request.newState == ExerciseState::Started)
|
||||
{
|
||||
// check if the running exercise has CnrChannels, which are already included in the global CnrConfigs
|
||||
QStringList doubleChannelNames = doubleChannels(request.id(), 0);
|
||||
QStringList doubleChannelNames = doubleChannels(request.id, 0);
|
||||
|
||||
if (!doubleChannelNames.isEmpty())
|
||||
{
|
||||
std::sort(doubleChannelNames.begin(), doubleChannelNames.end());
|
||||
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "The following channel(s) are already planned in the global CnrConfig: %1")).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "The following channel(s) are already planned in the global CnrConfig: %1")).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
}
|
||||
|
||||
// check if another exercise is already running, only allow N active exercises in parallel
|
||||
@@ -317,7 +317,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
|
||||
if (ex->linkedExerciseId() == request.id())
|
||||
if (ex->linkedExerciseId() == request.id)
|
||||
{
|
||||
doubleChannelNames = doubleChannels(ex->id(), 0);
|
||||
|
||||
@@ -325,7 +325,7 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
{
|
||||
std::sort(doubleChannelNames.begin(), doubleChannelNames.end());
|
||||
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "The following channel(s) are planned in the global CnrConfig and the linked exercise %1: %2")).arg(ex->name()).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "The following channel(s) are planned in the global CnrConfig and the linked exercise %1: %2")).arg(ex->name()).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,48 +343,48 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
++iCntRunningExercises;
|
||||
}
|
||||
if (iCntRunningExercises >= Settings::maxStartedExercises())
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Can not start exercise - only %1 started exercise(s) allowed")).arg(Settings::maxStartedExercises());
|
||||
}
|
||||
|
||||
if (request.newState() == ExerciseState::Stopped)
|
||||
if (request.newState == ExerciseState::Stopped)
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
const auto state = ex->exerciseState();
|
||||
if (ex->id() != request.id() && state == ExerciseState::Stopped)
|
||||
if (ex->id() != request.id && state == ExerciseState::Stopped)
|
||||
++iCnt;
|
||||
}
|
||||
if (Settings::maxStoppedExercises() > 0 && iCnt >= Settings::maxStoppedExercises())
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Can not stop exercise - there are %1 stopped exercise(s) from maximal %2 allowed")).arg(iCnt).arg(Settings::maxStoppedExercises());
|
||||
}
|
||||
|
||||
if (request.hasHlaInterface() && (request.newState() == ExerciseState::Started ||
|
||||
request.newState() == ExerciseState::Paused))
|
||||
if (request.hasHlaInterface && (request.newState == ExerciseState::Started ||
|
||||
request.newState == ExerciseState::Paused))
|
||||
{
|
||||
int iCnt = 0;
|
||||
for (const ObjectExercise *ex : qAsConst(m_exeObjMap))
|
||||
{
|
||||
if (ex->id() != request.id() && ex->data().hasHlaInterface && (ex->exerciseState() == ExerciseState::Started ||
|
||||
if (ex->id() != request.id && ex->data().hasHlaInterface && (ex->exerciseState() == ExerciseState::Started ||
|
||||
ex->exerciseState() == ExerciseState::Paused))
|
||||
++iCnt;
|
||||
}
|
||||
if (iCnt >= Settings::maxHlaExercises())
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Can not modify exercise - only %1 running exercise(s) with HLA allowed")).arg(Settings::maxHlaExercises());
|
||||
}
|
||||
|
||||
if (ifs->exerciseState() != ExerciseManagement::ExerciseState::Created)
|
||||
{
|
||||
if (request.linkedExerciseId() != ifs->linkedExerciseId())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not change linked exercise when exercise is already started"));
|
||||
if (request.sendToWMS() == false && ifs->data().sendToWms == true)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Exercise is already visible in WMS - can not reset this option"));
|
||||
if (request.linkedExerciseId != ifs->linkedExerciseId())
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not change linked exercise when exercise is already started"));
|
||||
if (request.sendToWMS == false && ifs->data().sendToWms == true)
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Exercise is already visible in WMS - can not reset this option"));
|
||||
}
|
||||
|
||||
if (request.linkedExerciseId() == 0)
|
||||
if (request.linkedExerciseId == 0)
|
||||
{
|
||||
if (ifs->linkedExerciseId() != 0)
|
||||
{
|
||||
@@ -392,61 +392,61 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
if (linked != nullptr)
|
||||
{
|
||||
if (!linked->setLinkedExerciseId(0))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not update unlinked exercise"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not update unlinked exercise"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else // request.linkedExercise() != 0
|
||||
{
|
||||
ObjectExercise *linked = m_exeObjMap.value(request.linkedExerciseId());
|
||||
ObjectExercise *linked = m_exeObjMap.value(request.linkedExerciseId);
|
||||
if (linked == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not find linked exercise with id %1")).arg(request.linkedExerciseId());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not find linked exercise with id %1")).arg(request.linkedExerciseId);
|
||||
|
||||
if (linked->linkedExerciseId() != request.id())
|
||||
if (linked->linkedExerciseId() != request.id)
|
||||
{
|
||||
if (linked->linkedExerciseId() != 0)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "The exercise to link already has another linked exercise"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "The exercise to link already has another linked exercise"));
|
||||
|
||||
// own state is checked above
|
||||
if (linked->exerciseState() != ExerciseManagement::ExerciseState::Created)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not link to an already running exercise"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not link to an already running exercise"));
|
||||
|
||||
QStringList doubleChannelNames = doubleChannels(request.id(), request.linkedExerciseId());
|
||||
QStringList doubleChannelNames = doubleChannels(request.id, request.linkedExerciseId);
|
||||
|
||||
if (!doubleChannelNames.isEmpty())
|
||||
{
|
||||
std::sort(doubleChannelNames.begin(), doubleChannelNames.end());
|
||||
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Linked exercise has overlapping CnrConfig(s) for channel(s): %1")).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Linked exercise has overlapping CnrConfig(s) for channel(s): %1")).arg(doubleChannelNames.join(QLatin1String(", ")));
|
||||
}
|
||||
|
||||
if (!linked->setLinkedExerciseId(request.id()))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not update linked exercise"));
|
||||
if (!linked->setLinkedExerciseId(request.id))
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not update linked exercise"));
|
||||
}
|
||||
if (linked->sendToWms() != request.sendToWMS())
|
||||
if (linked->sendToWms() != request.sendToWMS)
|
||||
{
|
||||
if (!linked->setSendToWms(request.sendToWMS()))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not update linked exercise"));
|
||||
if (!linked->setSendToWms(request.sendToWMS))
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not update linked exercise"));
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Linked exercise: " << request.linkedExerciseId()
|
||||
DEBUG_LOG(m_logger) << "Linked exercise: " << request.linkedExerciseId
|
||||
<< ", state: " << ifs->exerciseState()
|
||||
<< ", new: " << request.newState();
|
||||
if (request.linkedExerciseId() != 0 && ifs->exerciseState() != request.newState())
|
||||
<< ", new: " << request.newState;
|
||||
if (request.linkedExerciseId != 0 && ifs->exerciseState() != request.newState)
|
||||
{
|
||||
if (request.newState() == ExerciseManagement::ExerciseState::Started ||
|
||||
request.newState() == ExerciseManagement::ExerciseState::Stopped)
|
||||
if (request.newState == ExerciseManagement::ExerciseState::Started ||
|
||||
request.newState == ExerciseManagement::ExerciseState::Stopped)
|
||||
{
|
||||
ObjectExercise *ifsLinked = m_exeObjMap.value(request.linkedExerciseId());
|
||||
ObjectExercise *ifsLinked = m_exeObjMap.value(request.linkedExerciseId);
|
||||
if (!ifsLinked)
|
||||
WARNING_LOG(m_logger) << "Linked exercise with id " << request.linkedExerciseId() << " not found!";
|
||||
WARNING_LOG(m_logger) << "Linked exercise with id " << request.linkedExerciseId << " not found!";
|
||||
else
|
||||
{
|
||||
if (ifsLinked->exerciseState() != ExerciseManagement::ExerciseState::Paused ||
|
||||
request.newState() == ExerciseManagement::ExerciseState::Stopped)
|
||||
request.newState == ExerciseManagement::ExerciseState::Stopped)
|
||||
{
|
||||
auto retLinked = ifsLinked->switchToState(request.newState(), request.operatorId(), request.workstationId());
|
||||
auto retLinked = ifsLinked->switchToState(request.newState, request.operatorId, request.workstationId);
|
||||
if (retLinked.error())
|
||||
return retLinked;
|
||||
}
|
||||
@@ -455,20 +455,20 @@ Core::FunctionReplyObject HandlerExercise::exerciseModifyRequest(const ExerciseM
|
||||
}
|
||||
|
||||
// state change to started requested? (case 'start' or 'resume')
|
||||
if ((request.newState() != ifs->exerciseState() ) &&
|
||||
(request.newState() == ExerciseManagement::ExerciseState::Started))
|
||||
if ((request.newState != ifs->exerciseState() ) &&
|
||||
(request.newState == ExerciseManagement::ExerciseState::Started))
|
||||
{
|
||||
QString mesg;
|
||||
if (!checkEquipmentNumbersOnAllExercises(request.id(), mesg))
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
if (!checkEquipmentNumbersOnAllExercises(request.id, mesg))
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Can not start exercise - equipment numbers already in use: %1 ")).arg(mesg);
|
||||
}
|
||||
|
||||
Database::ExmExercise data(copyBaseData(request));
|
||||
data.exerciseStateId = request.newState();
|
||||
data.activePhaseId = request.activePhaseId();
|
||||
data.operatorId = request.operatorId();
|
||||
data.workstationId = request.workstationId();
|
||||
data.exerciseStateId = request.newState;
|
||||
data.activePhaseId = request.activePhaseId;
|
||||
data.operatorId = request.operatorId;
|
||||
data.workstationId = request.workstationId;
|
||||
|
||||
return ifs->updateObject(data);
|
||||
}
|
||||
@@ -527,8 +527,8 @@ void HandlerExercise::onGetExerciseImageRequest(const rti::core::SampleIdentity
|
||||
Core::FunctionReplyObject fro;
|
||||
GetExerciseImageReply reply;
|
||||
|
||||
int32_t exerciseId = request.exerciseId();
|
||||
reply.id(exerciseId);
|
||||
int32_t exerciseId = request.exerciseId;
|
||||
reply.id = exerciseId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onGetExerciseImageRequest id = " << exerciseId;
|
||||
|
||||
@@ -538,13 +538,13 @@ void HandlerExercise::onGetExerciseImageRequest(const rti::core::SampleIdentity
|
||||
|
||||
if (fro.error())
|
||||
{
|
||||
reply.id(fro.id());
|
||||
reply.errorString(fro.str());
|
||||
reply.errorParams(fro.args());
|
||||
reply.id = fro.id();
|
||||
reply.errorString = fro.str();
|
||||
reply.errorParams = fro.args();
|
||||
}
|
||||
else
|
||||
{
|
||||
reply.imageData(LtsUtils::convert<std::vector<uint8_t>>(exmImg.image));
|
||||
reply.imageData = LtsUtils::convert<std::vector<uint8_t>>(exmImg.image);
|
||||
|
||||
// TODO: reimpl optimization routines (e.g. use ImageMagick instead of GuiApplication, which won't work without an X server)
|
||||
// QPixmap excPx(LtsUtils::getPixmap(exmImg.image));
|
||||
@@ -580,15 +580,15 @@ void HandlerExercise::onGetExerciseImageRequest(const rti::core::SampleIdentity
|
||||
void HandlerExercise::onExerciseImageModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ExerciseImageModifyRequest &request)
|
||||
{
|
||||
qint32 exerciseId = request.id();
|
||||
qint32 exerciseId = request.id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onExerciseImageModifyRequest id = " << exerciseId << ", image size = " << request.image().size();
|
||||
DEBUG_LOG(m_logger) << "onExerciseImageModifyRequest id = " << exerciseId << ", image size = " << request.image.size();
|
||||
|
||||
Database::ExmExerciseImage exImg;
|
||||
exImg.exerciseId = exerciseId;
|
||||
|
||||
bool result = m_db->selectExmExerciseImage(exerciseId, exImg);
|
||||
exImg.image = LtsUtils::toQByteArray(request.image());
|
||||
exImg.image = LtsUtils::toQByteArray(request.image);
|
||||
|
||||
if (result)
|
||||
{
|
||||
@@ -617,25 +617,25 @@ void HandlerExercise::onExerciseRemoveRequest(const rti::core::SampleIdentity &c
|
||||
const ExerciseManagement::ExerciseRemoveRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectExercise *ifs = m_exeObjMap.value(request.id());
|
||||
ObjectExercise *ifs = m_exeObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Exercise with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Exercise with id %1 not found")).arg(request.id);
|
||||
m_ddsHandler->fts()->exerciseRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ExerciseManagement::Exercise ddsData;
|
||||
ddsData.id(request.id());
|
||||
ddsData.id = request.id;
|
||||
|
||||
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ddsData, 0))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Exercise '%1' is used by another user!")).arg(ifs->data().name);
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Exercise '%1' is used by another user!")).arg(ifs->data().name);
|
||||
m_mainHandler->dds()->fts()->exerciseRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = ifs->removeObject(request.force());
|
||||
ret = ifs->removeObject(request.force);
|
||||
|
||||
if (ret.error())
|
||||
{
|
||||
@@ -645,7 +645,7 @@ void HandlerExercise::onExerciseRemoveRequest(const rti::core::SampleIdentity &c
|
||||
{
|
||||
// delete ObjectExercise (including ExerciseStateMachine)
|
||||
delete ifs;
|
||||
m_exeObjMap.remove(request.id());
|
||||
m_exeObjMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->exerciseRemoveReply(cookie, ret);
|
||||
@@ -692,8 +692,8 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
|
||||
const auto cb = [&eqNoForEx](const ParticipantManagement::Participant &data) -> void
|
||||
{
|
||||
if (data.equipmentNumber().is_set())
|
||||
eqNoForEx.insert(data.equipmentNumber().get());
|
||||
if (data.equipmentNumber.is_set())
|
||||
eqNoForEx.insert(data.equipmentNumber.get());
|
||||
};
|
||||
ppmDtcForEx->participants(cb);
|
||||
}
|
||||
@@ -712,7 +712,7 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
|
||||
const auto cb = [this, &usedEqNumbers, exerciseIdToBeStarted, eqNoForEx](const ParticipantManagement::EquipmentExerciseMapping &equipmentExerciseMapping) -> void
|
||||
{
|
||||
const int exerciseId = equipmentExerciseMapping.exerciseId();
|
||||
const int exerciseId = equipmentExerciseMapping.exerciseId;
|
||||
|
||||
// in case of resume exercise:
|
||||
if (exerciseId == exerciseIdToBeStarted)
|
||||
@@ -729,12 +729,12 @@ bool HandlerExercise::checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStar
|
||||
if ((ifs->exerciseState() == ExerciseState::Started) ||
|
||||
(ifs->exerciseState() == ExerciseState::Paused))
|
||||
{
|
||||
const std::vector<ParticipantManagement::Equipment2ParticipantId> &mapping = equipmentExerciseMapping.mapping();
|
||||
const std::vector<ParticipantManagement::Equipment2ParticipantId> &mapping = equipmentExerciseMapping.mapping;
|
||||
for (const auto &eq2p : qAsConst(mapping))
|
||||
if (eqNoForEx.contains(eq2p.equipmentNumber()))
|
||||
if (eqNoForEx.contains(eq2p.equipmentNumber))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " !!! eq = " << eq2p.equipmentNumber() << " is already used in exercise =" << exerciseId;
|
||||
usedEqNumbers[exerciseId].insert(eq2p.equipmentNumber());
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " !!! eq = " << eq2p.equipmentNumber << " is already used in exercise =" << exerciseId;
|
||||
usedEqNumbers[exerciseId].insert(eq2p.equipmentNumber);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -792,17 +792,17 @@ QStringList HandlerExercise::doubleChannels(int exerciseAId, int exerciseBId) co
|
||||
|
||||
for (auto it = cnrConfigs.constBegin(); it != cnrConfigs.constEnd(); ++it)
|
||||
{
|
||||
int cnrExerciseId = it.value().exerciseId().is_set() ? it.value().exerciseId().get() : 0;
|
||||
int cnrExerciseId = it.value().exerciseId.is_set() ? it.value().exerciseId.get() : 0;
|
||||
|
||||
if (cnrExerciseId == exerciseAId)
|
||||
{
|
||||
exerciseAChannelIds.append(it.value().cnrChannelId());
|
||||
exerciseAChannelIds.append(it.value().cnrChannelId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cnrExerciseId == exerciseBId)
|
||||
{
|
||||
exerciseBChannelIds.append(it.value().cnrChannelId());
|
||||
exerciseBChannelIds.append(it.value().cnrChannelId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -814,7 +814,7 @@ QStringList HandlerExercise::doubleChannels(int exerciseAId, int exerciseBId) co
|
||||
for (int exerciseAChannelId : qAsConst(exerciseAChannelIds))
|
||||
{
|
||||
if (exerciseBChannelIds.contains(exerciseAChannelId))
|
||||
doubleChannelNames.append(QString::fromStdString(m_ddsHandler->avmDtc()->cnrChannel(exerciseAChannelId).name()));
|
||||
doubleChannelNames.append(QString::fromStdString(m_ddsHandler->avmDtc()->cnrChannel(exerciseAChannelId).name));
|
||||
}
|
||||
|
||||
return doubleChannelNames;
|
||||
|
||||
+20
-20
@@ -69,11 +69,11 @@ Core::FunctionReplyObject HandlerExercisePhase::exercisePhaseCreateRequest(const
|
||||
{
|
||||
Database::ExmExercisePhase newData;
|
||||
|
||||
newData.name = QString::fromStdString(request.name());
|
||||
newData.description = QString::fromStdString(request.description());
|
||||
newData.beginTime = QDateTime::fromMSecsSinceEpoch(request.beginTime());
|
||||
newData.endTime = QDateTime::fromMSecsSinceEpoch(request.endTime());
|
||||
newData.exerciseId = request.exerciseId();
|
||||
newData.name = QString::fromStdString(request.name);
|
||||
newData.description = QString::fromStdString(request.description);
|
||||
newData.beginTime = QDateTime::fromMSecsSinceEpoch(request.beginTime);
|
||||
newData.endTime = QDateTime::fromMSecsSinceEpoch(request.endTime);
|
||||
newData.exerciseId = request.exerciseId;
|
||||
|
||||
ObjectExercisePhase *ifs(new ObjectExercisePhase(m_ddsHandler, m_db));
|
||||
Core::FunctionReplyObject ret = ifs->createObject(newData);
|
||||
@@ -122,21 +122,21 @@ void HandlerExercisePhase::onExercisePhaseModifyRequest(const rti::core::SampleI
|
||||
DEBUG_LOG(m_logger) << "onExercisePhaseModifyRequest " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
ObjectExercisePhase *ifs = m_exercisePhaseObjMap.value(request.id());
|
||||
ObjectExercisePhase *ifs = m_exercisePhaseObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ExercisePhase with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ExercisePhase with id %1 not found")).arg(request.id);
|
||||
m_ddsHandler->fts()->exercisePhaseModifyReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
Database::ExmExercisePhase data;
|
||||
data.id = request.id();
|
||||
data.name = QString::fromStdString(request.name());
|
||||
data.description = QString::fromStdString(request.description());
|
||||
data.beginTime = QDateTime::fromMSecsSinceEpoch(request.beginTime());
|
||||
data.endTime = QDateTime::fromMSecsSinceEpoch(request.endTime());
|
||||
data.exerciseId = request.exerciseId();
|
||||
data.id = request.id;
|
||||
data.name = QString::fromStdString(request.name);
|
||||
data.description = QString::fromStdString(request.description);
|
||||
data.beginTime = QDateTime::fromMSecsSinceEpoch(request.beginTime);
|
||||
data.endTime = QDateTime::fromMSecsSinceEpoch(request.endTime);
|
||||
data.exerciseId = request.exerciseId;
|
||||
|
||||
ret = ifs->updateObject(data);
|
||||
if (ret.error())
|
||||
@@ -148,30 +148,30 @@ void HandlerExercisePhase::onExercisePhaseRemoveRequest(const rti::core::SampleI
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onExercisePhaseRemoveRequest " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectExercisePhase *ifs = m_exercisePhaseObjMap.value(request.id());
|
||||
ObjectExercisePhase *ifs = m_exercisePhaseObjMap.value(request.id);
|
||||
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ExercisePhase with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ExercisePhase with id %1 not found")).arg(request.id);
|
||||
m_ddsHandler->fts()->exercisePhaseRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
// check if phase is active phase in corresponding exercise
|
||||
ObjectExercise *exercise = m_mainHandler->exerciseHandler()->getExerciseById(ifs->getData().exerciseId);
|
||||
if (exercise->data().activePhaseId == request.id())
|
||||
if (exercise->data().activePhaseId == request.id)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ExercisePhase with id %1 is current phase in exercise")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ExercisePhase with id %1 is current phase in exercise")).arg(request.id);
|
||||
m_ddsHandler->fts()->exercisePhaseRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ExerciseManagement::ExercisePhase ddsData;
|
||||
ddsData.id(request.id());
|
||||
ddsData.id = request.id;
|
||||
|
||||
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ddsData, 0))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "ExercisePhase '%1' is used by another user!")).arg(ifs->getData().name);
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "ExercisePhase '%1' is used by another user!")).arg(ifs->getData().name);
|
||||
m_mainHandler->dds()->fts()->exercisePhaseRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ void HandlerExercisePhase::onExercisePhaseRemoveRequest(const rti::core::SampleI
|
||||
{
|
||||
// delete ObjectExercise (including ExerciseStateMachine)
|
||||
delete ifs;
|
||||
m_exercisePhaseObjMap.remove(request.id());
|
||||
m_exercisePhaseObjMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->exercisePhaseRemoveReply(cookie, ret);
|
||||
|
||||
@@ -135,7 +135,7 @@ bool MainHandler::initWebSocketHandler()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ddsHandler->pacemaker()->addPort(m_websocketHandler->webSocketPort(), Core::PortType::WebSocketServer);
|
||||
m_ddsHandler->pacemaker()->addPort(m_websocketHandler->webSocketPort(), Core::CorePortType::WebSocketServer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Ied DtcImplCustom::iedForEquipmentNumber(int equipmentNumber) const
|
||||
{
|
||||
for (const auto &ied : m_iedCont)
|
||||
{
|
||||
if (ied.equipmentNumber() == equipmentNumber)
|
||||
if (ied.equipmentNumber == equipmentNumber)
|
||||
return ied;
|
||||
}
|
||||
return {};
|
||||
|
||||
@@ -321,13 +321,13 @@ void HandlerIed::onPairIedRequest(const rti::core::SampleIdentity &cookie,
|
||||
{
|
||||
case IedPairingState_def::PairedToParticipant:
|
||||
{
|
||||
data.pairedParticipantId.setValue(request.pairedParticipantId().get());
|
||||
data.partyId = m_ppmDtc->participant(request.pairedParticipantId().get()).partyId();
|
||||
data.pairedParticipantId.setValue(request.pairedParticipantId.get());
|
||||
data.partyId = m_ppmDtc->participant(request.pairedParticipantId.get()).partyId();
|
||||
break;
|
||||
}
|
||||
case IedPairingState_def::PairedToOps:
|
||||
{
|
||||
data.pairedOpsId.setValue(request.pairedOpsId().get());
|
||||
data.pairedOpsId.setValue(request.pairedOpsId.get());
|
||||
break;
|
||||
}
|
||||
case IedPairingState_def::NotPaired:
|
||||
|
||||
+38
-38
@@ -88,10 +88,10 @@ void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::Sp
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
if (data.operationalState() != MV_VERLEGEN &&
|
||||
data.operationalState() != WMV_VERLEGEN)
|
||||
if (data.operationalState != MV_VERLEGEN &&
|
||||
data.operationalState != WMV_VERLEGEN)
|
||||
return;
|
||||
if (!data.position().is_set())
|
||||
if (!data.position.is_set())
|
||||
return;
|
||||
{
|
||||
// convert TrainingAreaBase::LaneData back to sondersensorik_fahrspur_rt
|
||||
@@ -99,10 +99,10 @@ void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::Sp
|
||||
//Interpretationsstatus auf 0 setzen
|
||||
daten_intern.intstat = 0;
|
||||
|
||||
daten_intern.daten.header.identitaet = data.equipmentNumber();
|
||||
daten_intern.daten.gps_zeit.gps_zeit = data.sampleTime() / 1000;
|
||||
daten_intern.daten.gps_position = relativeFromGeographic(data.position().get().lon(), data.position().get().lat());
|
||||
daten_intern.daten.ss_betriebszustand = data.operationalState();
|
||||
daten_intern.daten.header.identitaet = data.equipmentNumber;
|
||||
daten_intern.daten.gps_zeit.gps_zeit = data.sampleTime / 1000;
|
||||
daten_intern.daten.gps_position = relativeFromGeographic(data.position.get().lon, data.position.get().lat);
|
||||
daten_intern.daten.ss_betriebszustand = data.operationalState;
|
||||
|
||||
// old code copied from zssi_wi_Empfaenger.cpp
|
||||
/*
|
||||
@@ -132,16 +132,16 @@ void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::Sp
|
||||
template<typename T>
|
||||
void HandlerMinelayerData::convertMinelayerDataToXdrData(const TrainingAreaBase::MinelayerTrailerData &inData, T &outData)
|
||||
{
|
||||
outData.header.identitaet = inData.equipmentNumber();
|
||||
outData.gps_zeit.gps_zeit = inData.sampleTime() / 1000; // derived from Tetra telegram
|
||||
outData.header.identitaet = inData.equipmentNumber;
|
||||
outData.gps_zeit.gps_zeit = inData.sampleTime / 1000; // derived from Tetra telegram
|
||||
|
||||
outData.gps_position = relativeFromGeographic(inData.position().lon(), inData.position().lat());
|
||||
outData.verlegedaten.sperren_id = inData.barrierId();
|
||||
outData.verlegedaten.verlegedichte = inData.layingDensity();
|
||||
outData.verlegedaten.wirkbeginn.gps_zeit = inData.effectStart() / 1000; // derived from Tetra telegram
|
||||
outData.verlegedaten.wirkzeit = inData.effectDuration();
|
||||
outData.verlegedaten.minentyp = inData.chargeTypeId();
|
||||
outData.verlegedaten.anzahl_verlegter_minen = inData.mineCount();
|
||||
outData.gps_position = relativeFromGeographic(inData.position.lon, inData.position.lat);
|
||||
outData.verlegedaten.sperren_id = inData.barrierId;
|
||||
outData.verlegedaten.verlegedichte = inData.layingDensity;
|
||||
outData.verlegedaten.wirkbeginn.gps_zeit = inData.effectStart / 1000; // derived from Tetra telegram
|
||||
outData.verlegedaten.wirkzeit = inData.effectDuration;
|
||||
outData.verlegedaten.minentyp = inData.chargeTypeId;
|
||||
outData.verlegedaten.anzahl_verlegter_minen = inData.mineCount;
|
||||
}
|
||||
|
||||
void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, DataModification modType)
|
||||
@@ -194,7 +194,7 @@ void HandlerMinelayerData::onMinelayerThrowerData(const TrainingAreaBase::Minela
|
||||
{
|
||||
VERLEGEDATEN_INTERN daten_intern;
|
||||
convertMinelayerDataToXdrData(data, daten_intern.daten);
|
||||
daten_intern.daten.verlegedaten.ausstossart = static_cast<ausstossart_et>(data.throwingType().underlying());
|
||||
daten_intern.daten.verlegedaten.ausstossart = static_cast<ausstossart_et>(data.throwingType);
|
||||
|
||||
/*
|
||||
if ( checkeTelegrammZeit(telegramm_rt.gps_zeit.gps_zeit) ) {
|
||||
@@ -240,8 +240,8 @@ Core::GeoPosition2D HandlerMinelayerData::geographicFromRelative(const gps_posit
|
||||
const QPointF point(m_baseCoord.geographic(position.utm_ostwert - m_baseCoord.x, position.utm_nordwert - m_baseCoord.y));
|
||||
|
||||
Core::GeoPosition2D ret;
|
||||
ret.lon(point.x());
|
||||
ret.lat(point.y());
|
||||
ret.lon = point.x();
|
||||
ret.lat = point.y();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -267,9 +267,9 @@ int HandlerMinelayerData::partyIdFromEquipmentNumber(int eqNumber) const
|
||||
std::function<bool(const ParticipantManagement::Participant &data)> cb =
|
||||
[eqNumber, &partyId](const ParticipantManagement::Participant & participant) -> bool
|
||||
{
|
||||
if (participant.equipmentNumber() == eqNumber)
|
||||
if (participant.equipmentNumber == eqNumber)
|
||||
{
|
||||
partyId = participant.partyId();
|
||||
partyId = participant.partyId;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -292,18 +292,18 @@ static inline double compassFromMathAngleForSfm(int mathAngle)
|
||||
void HandlerMinelayerData::onSendMinefield(const wirkfeld_minensperre_rt &minefield, int fzArt)
|
||||
{
|
||||
AreaEffectSimulation::MineArea outData;
|
||||
outData.participantId(minefield.header.identitaet);
|
||||
outData.partyId(partyIdFromEquipmentNumber(minefield.header.identitaet)); // Get from PPM;
|
||||
outData.name(QString::fromUtf8(tr_lts("dds", "_%1")).arg(minefield.beschreibung.kennung).toStdString());
|
||||
outData.effectStart(minefield.beschreibung.wirkbeginn.gps_zeit * 1000LL); // derived from Tetra telegram
|
||||
outData.effectDuration(minefield.beschreibung.wirkdauer * (1000 * 60 * 60)); // orig resolution is 1h based
|
||||
outData.density(minefield.beschreibung.verlegedichte / 100.0); // derived from Tetra telegram
|
||||
outData.chargeStruct().chargeTypeId(minefield.beschreibung.minentyp); // is already in TAB converted to chargeTypeId
|
||||
outData.layingProcedureType(static_cast<AreaEffectSimulation::AesMaLayingProcedureType::inner_enum>(fzArt));
|
||||
outData.width(minefield.beschreibung.verlegetiefe);
|
||||
outData.isLaidHidden(false);
|
||||
outData.layingProcedureType(AreaEffectSimulation::AesMaLayingProcedureType::LptPioneer);
|
||||
outData.isCenterLine(true);
|
||||
outData.participantId = minefield.header.identitaet;
|
||||
outData.partyId = partyIdFromEquipmentNumber(minefield.header.identitaet); // Get from PPM;
|
||||
outData.name = QString::fromUtf8(tr_lts("dds", "_%1")).arg(minefield.beschreibung.kennung).toStdString();
|
||||
outData.effectStart = minefield.beschreibung.wirkbeginn.gps_zeit * 1000LL; // derived from Tetra telegram
|
||||
outData.effectDuration = minefield.beschreibung.wirkdauer * (1000 * 60 * 60); // orig resolution is 1h based
|
||||
outData.density = minefield.beschreibung.verlegedichte / 100.0; // derived from Tetra telegram
|
||||
outData.chargeStruct.chargeTypeId = minefield.beschreibung.minentyp; // is already in TAB converted to chargeTypeId
|
||||
outData.layingProcedureType = static_cast<AreaEffectSimulation::AesMaLayingProcedureType>(fzArt);
|
||||
outData.width = minefield.beschreibung.verlegetiefe;
|
||||
outData.isLaidHidden = false;
|
||||
outData.layingProcedureType = AreaEffectSimulation::AesMaLayingProcedureType::LptPioneer;
|
||||
outData.isCenterLine = true;
|
||||
|
||||
// segments
|
||||
std::vector<AreaEffectSimulation::MineSegment> segVec;
|
||||
@@ -311,23 +311,23 @@ void HandlerMinelayerData::onSendMinefield(const wirkfeld_minensperre_rt &minefi
|
||||
for (const auto &seg : minefield.beschreibung.segmente)
|
||||
{
|
||||
AreaEffectSimulation::MineSegment segment;
|
||||
segment.positionStart(geographicFromRelative(seg.startpunkt));
|
||||
const LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionStart().lon(), segment.positionStart().lat()});
|
||||
segment.positionStart = geographicFromRelative(seg.startpunkt);
|
||||
const LtsCoordTrans::UtmCoordinate startPositionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic({segment.positionStart.lon, segment.positionStart.lat});
|
||||
|
||||
QLineF line;
|
||||
line.setP1({startPositionUtm.x, startPositionUtm.y});
|
||||
line.setAngle(seg.drehwinkel);
|
||||
line.setLength(double(seg.anzahl / outData.density()));
|
||||
line.setLength(double(seg.anzahl / outData.density));
|
||||
|
||||
LtsCoordTrans::UtmCoordinate endPositionUtm = startPositionUtm;
|
||||
endPositionUtm.x = line.p2().x();
|
||||
endPositionUtm.y = line.p2().y();
|
||||
|
||||
QPointF endPos = endPositionUtm.geographic();
|
||||
segment.positionEnd({endPos.x(), endPos.y()});
|
||||
segment.positionEnd = {endPos.x(), endPos.y()};
|
||||
segVec.emplace_back(segment);
|
||||
}
|
||||
outData.segments(segVec);
|
||||
outData.segments = segVec;
|
||||
|
||||
INFO_LOG(m_logger) << "Sending new minefield from generator to AES: " << outData;
|
||||
|
||||
|
||||
+80
-80
@@ -128,10 +128,10 @@ void MrkTests::tryModify()
|
||||
MarkerModifyRequest data;
|
||||
getMarkerModifyRequestData(data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send MarkerModifyRequest for markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send MarkerModifyRequest for markerId:" << data.id;
|
||||
if (!m_ftc->markerModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for markerId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for markerId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModify()
|
||||
@@ -142,12 +142,12 @@ void MrkTests::tryRemove()
|
||||
m_eTestStep = eRemove;
|
||||
MarkerRemoveRequest data;
|
||||
|
||||
data.id(m_markerId);
|
||||
data.id = m_markerId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for markerId:" << data.id;
|
||||
if (!m_ftc->markerRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for markerId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for markerId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemove()
|
||||
@@ -172,11 +172,11 @@ void MrkTests::tryGetAllMarkers()
|
||||
for (auto it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Mrk(" << it.key() << ") :"
|
||||
<< " note:" << it.value().note()
|
||||
<< " operatorId:" << it.value().operatorId()
|
||||
<< " timeStamp:" << it.value().timeStamp()
|
||||
<< " timeStampOffset:" << it.value().timeStampOffset()
|
||||
<< " description count:" << it.value().descriptions().size();
|
||||
<< " note:" << it.value().note
|
||||
<< " operatorId:" << it.value().operatorId
|
||||
<< " timeStamp:" << it.value().timeStamp
|
||||
<< " timeStampOffset:" << it.value().timeStampOffset
|
||||
<< " description count:" << it.value().descriptions.size();
|
||||
}
|
||||
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
@@ -200,18 +200,18 @@ void MrkTests::tryGetMarker()
|
||||
m_dtc->waitForHistoricalDataMarker();
|
||||
MarkerManagement::Marker data = m_dtc->marker(m_markerId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for markerId " << m_markerId << " returnVal:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for markerId " << m_markerId << " returnVal:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Mrk(" << data.id() << ") :"
|
||||
<< " note:" << data.note()
|
||||
<< " operatorId:" << data.operatorId()
|
||||
<< " timeStamp:" << data.timeStamp()
|
||||
<< " timeStampOffset:" << data.timeStampOffset()
|
||||
INFO_LOG(m_logger) << "Mrk(" << data.id << ") :"
|
||||
<< " note:" << data.note
|
||||
<< " operatorId:" << data.operatorId
|
||||
<< " timeStamp:" << data.timeStamp
|
||||
<< " timeStampOffset:" << data.timeStampOffset
|
||||
;
|
||||
}
|
||||
|
||||
@@ -256,13 +256,13 @@ void MrkTests::tryCreateSnapshot()
|
||||
m_eTestStep = eCreate;
|
||||
Snapshot data;
|
||||
|
||||
data.id(0); // create
|
||||
data.name("Snapshot 1");
|
||||
data.description("Dies ist ein Test");
|
||||
data.mapSettings("78000 92000 xxxx");
|
||||
data.operatorId(100);
|
||||
data.timeStamp(QDateTime::currentMSecsSinceEpoch());
|
||||
data.planOverlay("Plan Overlay");
|
||||
data.id = 0; // create
|
||||
data.name = "Snapshot 1";
|
||||
data.description = "Dies ist ein Test";
|
||||
data.mapSettings = "78000 92000 xxxx";
|
||||
data.operatorId = 100;
|
||||
data.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
data.planOverlay = "Plan Overlay";
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send SnapshotCreateRequest";
|
||||
if (!m_ftc->snapshotModifyRequest(data, this))
|
||||
@@ -278,15 +278,15 @@ void MrkTests::tryModifySnapshot()
|
||||
m_eTestStep = eModify;
|
||||
Snapshot data;
|
||||
|
||||
data.id(m_snapshotId);
|
||||
data.name("Snapshot modify");
|
||||
data.description("Dies ist ein Test modify");
|
||||
data.planOverlay("Plan Overlay updated");
|
||||
data.id = m_snapshotId;
|
||||
data.name = "Snapshot modify";
|
||||
data.description = "Dies ist ein Test modify";
|
||||
data.planOverlay = "Plan Overlay updated";
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send SnapshotModifyRequest for snapshotId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send SnapshotModifyRequest for snapshotId:" << data.id;
|
||||
if (!m_ftc->snapshotModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for snapshotId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for snapshotId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModifySnapshot()
|
||||
@@ -297,12 +297,12 @@ void MrkTests::tryRemoveSnapshot()
|
||||
m_eTestStep = eRemove;
|
||||
SnapshotRemoveRequest data;
|
||||
|
||||
data.id(m_snapshotId);
|
||||
data.id = m_snapshotId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for snapshotId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for snapshotId:" << data.id;
|
||||
if (!m_ftc->snapshotRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for snapshotId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for snapshotId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemoveSnapshot()
|
||||
@@ -468,15 +468,15 @@ void MrkTests::onReceiveMarkerChanged(const Marker &data, DataModification modTy
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG(m_logger) << "*** Marker added received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker added received. markerId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG(m_logger) << "*** Marker modified received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker modified received. markerId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG(m_logger) << "*** Marker removed received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker removed received. markerId:" << data.id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -489,10 +489,10 @@ void MrkTests::getMarkerCreateRequestData(MarkerModifyRequest &data)
|
||||
if (m_testId == 0)
|
||||
currentTime = currentTime / 10;
|
||||
|
||||
data.note("TestMarkerCreate");
|
||||
data.operatorId(100);
|
||||
data.timeStamp(currentTime);
|
||||
data.timeStampOffset(33000);
|
||||
data.note = "TestMarkerCreate";
|
||||
data.operatorId = 100;
|
||||
data.timeStamp = currentTime;
|
||||
data.timeStampOffset = 33000;
|
||||
|
||||
getMarkerDescriptionCreateRequestData(data);
|
||||
|
||||
@@ -502,15 +502,15 @@ void MrkTests::getMarkerCreateRequestData(MarkerModifyRequest &data)
|
||||
void MrkTests::getMarkerDescriptionCreateRequestData(MarkerModifyRequest &data)
|
||||
{
|
||||
// Info: FK fuer markerId wird in object_marker gesetzt.
|
||||
data.descriptions().resize(3);
|
||||
data.descriptions()[0].markerType(MarkerManagement::MarkerType::Audio);
|
||||
data.descriptions()[0].content("Audio07, Audio08*, Audio09");
|
||||
data.descriptions.resize(3);
|
||||
data.descriptions[0].markerType = MarkerManagement::MarkerType::Audio;
|
||||
data.descriptions[0].content("Audio07, Audio08*, Audio09");
|
||||
|
||||
data.descriptions()[1].markerType(MarkerManagement::MarkerType::Video);
|
||||
data.descriptions()[1].content("cam07, cam08, cam09*");
|
||||
data.descriptions[1].markerType = MarkerManagement::MarkerType::Video;
|
||||
data.descriptions[1].content("cam07, cam08, cam09*");
|
||||
|
||||
data.descriptions()[2].markerType(MarkerManagement::MarkerType::Video);
|
||||
data.descriptions()[2].content("cam06, cam07, cam08, cam09*");
|
||||
data.descriptions[2].markerType = MarkerManagement::MarkerType::Video;
|
||||
data.descriptions[2].content("cam06, cam07, cam08, cam09*");
|
||||
} // end of getMarkerDescriptionCreateRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -520,22 +520,22 @@ void MrkTests::getMarkerModifyRequestData(MarkerModifyRequest &data)
|
||||
if (m_testId == 0)
|
||||
currentTime = currentTime / 10;
|
||||
|
||||
data.id(m_markerId);
|
||||
data.note("TestMarkerModify");
|
||||
data.operatorId(100);
|
||||
data.timeStamp(currentTime * 1000);
|
||||
data.timeStampOffset(77 * 1000);
|
||||
data.id = m_markerId;
|
||||
data.note = "TestMarkerModify";
|
||||
data.operatorId = 100;
|
||||
data.timeStamp = currentTime * 1000;
|
||||
data.timeStampOffset = 77 * 1000;
|
||||
|
||||
getMarkerDescriptionCreateRequestData(data);
|
||||
for (auto &desc : data.descriptions())
|
||||
desc.content(std::string("+++MOD+++") + desc.content());
|
||||
for (auto &desc : data.descriptions)
|
||||
desc.content = std::string("+++MOD+++") + desc.content;
|
||||
|
||||
} // end of getMarkerModifyRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -543,21 +543,21 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
|
||||
getMarkerCreateRequestData(createData);
|
||||
|
||||
if (createData.note() != data.note())
|
||||
if (createData.note != data.note)
|
||||
return false;
|
||||
|
||||
if (createData.operatorId() != data.operatorId())
|
||||
if (createData.operatorId != data.operatorId)
|
||||
return false;
|
||||
|
||||
if (createData.timeStamp() != data.timeStamp())
|
||||
if (createData.timeStamp != data.timeStamp)
|
||||
return false;
|
||||
|
||||
if (createData.timeStampOffset() != data.timeStampOffset())
|
||||
if (createData.timeStampOffset != data.timeStampOffset)
|
||||
return false;
|
||||
|
||||
// Descriptions vergleichen
|
||||
|
||||
if (createData.descriptions().size() != data.descriptions().size())
|
||||
if (createData.descriptions.size() != data.descriptions.size())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error onCompareCreatedData() different number of description data.";
|
||||
failExit();
|
||||
@@ -565,20 +565,20 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
}
|
||||
|
||||
int foundCount = 0;
|
||||
for (const auto &expected : createData.descriptions())
|
||||
for (const auto &expected : createData.descriptions)
|
||||
{
|
||||
for (const auto &got : data.descriptions())
|
||||
for (const auto &got : data.descriptions)
|
||||
{
|
||||
// we've got one description per type
|
||||
if (got.markerType() != expected.markerType())
|
||||
if (got.markerType != expected.markerType)
|
||||
continue;
|
||||
++foundCount;
|
||||
|
||||
if (got.content() != expected.content())
|
||||
if (got.content != expected.content)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Content for description does not match: "
|
||||
<< got.content() << " - "
|
||||
<< expected.content();
|
||||
<< got.content << " - "
|
||||
<< expected.content;
|
||||
failExit();
|
||||
return false;
|
||||
}
|
||||
@@ -591,7 +591,7 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
@@ -599,43 +599,43 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MrkTests::onCompareModifiedData(Marker &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
MarkerModifyRequest modifyData;
|
||||
|
||||
getMarkerModifyRequestData(modifyData);
|
||||
|
||||
if (modifyData.id() != data.id())
|
||||
if (modifyData.id != data.id)
|
||||
return false;
|
||||
|
||||
if (modifyData.note() != data.note())
|
||||
if (modifyData.note != data.note)
|
||||
return false;
|
||||
|
||||
if (modifyData.operatorId() != data.operatorId())
|
||||
if (modifyData.operatorId != data.operatorId)
|
||||
return false;
|
||||
|
||||
if (modifyData.timeStamp() != data.timeStamp())
|
||||
if (modifyData.timeStamp != data.timeStamp)
|
||||
return false;
|
||||
|
||||
if (modifyData.timeStampOffset() != data.timeStampOffset())
|
||||
if (modifyData.timeStampOffset != data.timeStampOffset)
|
||||
return false;
|
||||
|
||||
// Alle Descriptions zu dieser MarkerId holen ...
|
||||
int foundCount = 0;
|
||||
for (const auto &expected : modifyData.descriptions())
|
||||
for (const auto &expected : modifyData.descriptions)
|
||||
{
|
||||
for (const auto &got : data.descriptions())
|
||||
for (const auto &got : data.descriptions)
|
||||
{
|
||||
// we've got one description per type
|
||||
if (got.markerType() != expected.markerType())
|
||||
if (got.markerType != expected.markerType)
|
||||
continue;
|
||||
++foundCount;
|
||||
|
||||
if (got.content() != expected.content())
|
||||
if (got.content != expected.content)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Content for description does not match: "
|
||||
<< got.content() << " - "
|
||||
<< expected.content();
|
||||
<< got.content << " - "
|
||||
<< expected.content;
|
||||
failExit();
|
||||
return false;
|
||||
}
|
||||
@@ -648,7 +648,7 @@ bool MrkTests::onCompareModifiedData(Marker &data)
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareModifiedData()
|
||||
|
||||
@@ -53,8 +53,8 @@ bool HandlerMarker::init()
|
||||
// TODO: select descBymarkerId
|
||||
for (const Database::MrkMarkerDescription &desc : qAsConst(dataDescriptionVec))
|
||||
{
|
||||
if (desc.markerId == ddsMoData.id())
|
||||
ddsMoData.descriptions().push_back(ObjectMarker::toDdsData(desc));
|
||||
if (desc.markerId == ddsMoData.id)
|
||||
ddsMoData.descriptions.push_back(ObjectMarker::toDdsData(desc));
|
||||
}
|
||||
|
||||
ObjectMarker *ifs(new ObjectMarker(m_ddsHandler, m_db));
|
||||
@@ -91,7 +91,7 @@ void HandlerMarker::onMarkerModifyRequest(const rti::core::SampleIdentity &cooki
|
||||
const Marker &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "MarkerModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? markerModifyRequest(request) : markerCreateRequest(request);
|
||||
auto ret = request.id > 0 ? markerModifyRequest(request) : markerCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->markerModifyReply(cookie, ret);
|
||||
@@ -120,10 +120,10 @@ Core::FunctionReplyObject HandlerMarker::markerCreateRequest(const Marker &reque
|
||||
|
||||
Core::FunctionReplyObject HandlerMarker::markerModifyRequest(const Marker &request)
|
||||
{
|
||||
ObjectMarker *ifs = m_objectMarkerMap.value(request.id());
|
||||
ObjectMarker *ifs = m_objectMarkerMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
tr_lts("dds", "Marker with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Marker with id %1 not found")).arg(request.id);
|
||||
|
||||
return ifs->updateObject(request);
|
||||
} // end of markerModifyRequest()
|
||||
@@ -142,13 +142,13 @@ void HandlerMarker::onMarkerRemoveRequest(const rti::core::SampleIdentity &cooki
|
||||
|
||||
Core::FunctionReplyObject HandlerMarker::markerRemoveRequest(const Core::RemoveElementRequest &request)
|
||||
{
|
||||
ObjectMarker *ifs = m_objectMarkerMap.value(request.id());
|
||||
ObjectMarker *ifs = m_objectMarkerMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(),
|
||||
tr_lts("dds", "Marker with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id,
|
||||
tr_lts("dds", "Marker with id %1 not found")).arg(request.id);
|
||||
|
||||
if (m_ddsHandler->topicLockMaster()->isLocked(ifs->getData(), m_ddsHandler->ddsConnector()->getPartitionId()))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Marker '%1' is used by another user!")).arg(ifs->getName());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Marker '%1' is used by another user!")).arg(ifs->getName());
|
||||
|
||||
const Core::FunctionReplyObject ret = ifs->removeObject();
|
||||
|
||||
@@ -157,7 +157,7 @@ Core::FunctionReplyObject HandlerMarker::markerRemoveRequest(const Core::RemoveE
|
||||
|
||||
// delete ObjectMarker
|
||||
delete ifs;
|
||||
m_objectMarkerMap.remove(request.id());
|
||||
m_objectMarkerMap.remove(request.id);
|
||||
|
||||
return ret;
|
||||
} // end of onMarkerRemoveRequest()
|
||||
|
||||
@@ -67,7 +67,7 @@ void HandlerSnapshot::onSnapshotModifyRequest(const rti::core::SampleIdentity &c
|
||||
const Snapshot &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "SnapshotModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? snapshotModifyRequest(request) : snapshotCreateRequest(request);
|
||||
auto ret = request.id > 0 ? snapshotModifyRequest(request) : snapshotCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->snapshotModifyReply(cookie, ret);
|
||||
@@ -91,26 +91,26 @@ Core::FunctionReplyObject HandlerSnapshot::snapshotCreateRequest(const Snapshot
|
||||
|
||||
Core::FunctionReplyObject HandlerSnapshot::snapshotModifyRequest(const Snapshot &request)
|
||||
{
|
||||
ObjectSnapshot *ifs = m_objectSnapshotMap.value(request.id());
|
||||
ObjectSnapshot *ifs = m_objectSnapshotMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Snapshot with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Snapshot with id %1 not found")).arg(request.id);
|
||||
|
||||
Snapshot ddsData = ifs->getData();
|
||||
ddsData.name(request.name());
|
||||
ddsData.description(request.description());
|
||||
ddsData.fileContentId(request.fileContentId());
|
||||
ddsData.name = request.name;
|
||||
ddsData.description = request.description;
|
||||
ddsData.fileContentId = request.fileContentId;
|
||||
|
||||
if (request.mapSettings().size() > 0)
|
||||
ddsData.mapSettings(request.mapSettings());
|
||||
if (request.mapSettings.size() > 0)
|
||||
ddsData.mapSettings = request.mapSettings;
|
||||
|
||||
if (request.movementTracks().size() > 0)
|
||||
ddsData.movementTracks(request.movementTracks());
|
||||
if (request.movementTracks.size() > 0)
|
||||
ddsData.movementTracks = request.movementTracks;
|
||||
|
||||
if (request.planOverlay().size() > 0)
|
||||
ddsData.planOverlay(request.planOverlay());
|
||||
if (request.planOverlay.size() > 0)
|
||||
ddsData.planOverlay = request.planOverlay;
|
||||
|
||||
if (request.filter().size() > 0)
|
||||
ddsData.filter(request.filter());
|
||||
if (request.filter.size() > 0)
|
||||
ddsData.filter = request.filter;
|
||||
|
||||
return ifs->updateObject(ddsData);
|
||||
} // end of onSnapshotModifyRequest()
|
||||
@@ -119,17 +119,17 @@ Core::FunctionReplyObject HandlerSnapshot::snapshotModifyRequest(const Snapshot
|
||||
void HandlerSnapshot::onSnapshotRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSnapshotRemoveRequest() id:" << request.id();
|
||||
DEBUG_LOG(m_logger) << "onSnapshotRemoveRequest() id:" << request.id;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectSnapshot *ifs = m_objectSnapshotMap.value(request.id());
|
||||
ObjectSnapshot *ifs = m_objectSnapshotMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Snapshot with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Snapshot with id %1 not found")).arg(request.id);
|
||||
else
|
||||
{
|
||||
if (m_ddsHandler->topicLockMaster()->isLocked(ifs->getData(), m_ddsHandler->ddsConnector()->getPartitionId()))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Snapshot '%1' is used by another user!")).arg(ifs->getName());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Snapshot '%1' is used by another user!")).arg(ifs->getName());
|
||||
m_ddsHandler->fts()->snapshotRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ void HandlerSnapshot::onSnapshotRemoveRequest(const rti::core::SampleIdentity &c
|
||||
{
|
||||
// delete ObjectSnapshot
|
||||
delete ifs;
|
||||
m_objectSnapshotMap.remove(request.id());
|
||||
m_objectSnapshotMap.remove(request.id);
|
||||
}
|
||||
|
||||
m_ddsHandler->fts()->snapshotRemoveReply(cookie, ret);
|
||||
|
||||
@@ -23,7 +23,7 @@ ObjectMarker::ObjectMarker(const std::shared_ptr<DdsHandler> &ddsHandler, const
|
||||
|
||||
ObjectMarker::~ObjectMarker()
|
||||
{
|
||||
m_ddsHandler->dts()->removeMarkerByKey(m_dataMarkerObject.id());
|
||||
m_ddsHandler->dts()->removeMarkerByKey(m_dataMarkerObject.id);
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -31,7 +31,7 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
{
|
||||
m_dataMarkerObject = data;
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
Database::MrkMarker dbDataMarker = toDbData(data);
|
||||
DBTransaction trans(m_db->database());
|
||||
@@ -39,15 +39,15 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting MrkMarker-data into database"));
|
||||
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataMarkerObject.id(dbDataMarker.id);
|
||||
m_dataMarkerObject.id = dbDataMarker.id;
|
||||
DEBUG_LOG(m_logger) << "New MarkerId: " << dbDataMarker.id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Handle MarkerDescription for markerId:" << dbDataMarker.id << " number of depending descriptions: " << data.descriptions().size();
|
||||
DEBUG_LOG(m_logger) << "Handle MarkerDescription for markerId:" << dbDataMarker.id << " number of depending descriptions: " << data.descriptions.size();
|
||||
|
||||
// Behandlung von MarkerDescription
|
||||
for (size_t i = 0; i < data.descriptions().size(); ++i)
|
||||
for (size_t i = 0; i < data.descriptions.size(); ++i)
|
||||
{
|
||||
MarkerDescription &mrkDesc = m_dataMarkerObject.descriptions()[i];
|
||||
MarkerDescription &mrkDesc = m_dataMarkerObject.descriptions[i];
|
||||
Database::MrkMarkerDescription dbDataDesc = toDbData(mrkDesc);
|
||||
|
||||
// Struct MarkerDescription vorbereiten
|
||||
@@ -56,7 +56,7 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
if (!m_db->insert(dbDataDesc))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting MarkerDescription-data into database"));
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
mrkDesc.id(dbDataDesc.id);
|
||||
mrkDesc.id = dbDataDesc.id;
|
||||
}
|
||||
|
||||
trans.commit();
|
||||
@@ -65,7 +65,7 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id());
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id);
|
||||
|
||||
} // end of createObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -73,49 +73,49 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
Core::FunctionReplyObject ObjectMarker::updateObject(const Marker &data)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
const Database::MrkMarker dbDataMarker = toDbData(data);
|
||||
auto newData = data;
|
||||
|
||||
DBTransaction trans(m_db->database());
|
||||
if (!m_db->update(dbDataMarker))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating MrkMarker-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating MrkMarker-data into database"));
|
||||
|
||||
DEBUG_LOG(m_logger) << "Data changed for markerId: " << m_dataMarkerObject.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for markerId: " << m_dataMarkerObject.id;
|
||||
|
||||
|
||||
INFO_LOG(m_logger) << "Handle MarkerDescriptions for markerId:" << data.id()
|
||||
INFO_LOG(m_logger) << "Handle MarkerDescriptions for markerId:" << data.id
|
||||
<< ". Number of pending descriptions (new/previous):"
|
||||
<< data.descriptions().size() << "/" << m_dataMarkerObject.descriptions().size();
|
||||
<< data.descriptions.size() << "/" << m_dataMarkerObject.descriptions.size();
|
||||
|
||||
// Descriptions mit id -> schon vorhanden
|
||||
// Desctiptions ohne id -> neu einfügen
|
||||
for (auto &desc : newData.descriptions())
|
||||
for (auto &desc : newData.descriptions)
|
||||
{
|
||||
Database::MrkMarkerDescription dbDesc = toDbData(desc);
|
||||
dbDesc.markerId = dbDataMarker.id; // FK auf MarkerId
|
||||
if (desc.id() > 0)
|
||||
if (desc.id > 0)
|
||||
{
|
||||
// immer update ...
|
||||
if (!m_db->update(dbDesc))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating MrkMarkerDescription-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating MrkMarkerDescription-data into database"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_db->insert(dbDesc))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error inserting MarkerDescription-data into database"));
|
||||
desc.id(dbDesc.id);
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error inserting MarkerDescription-data into database"));
|
||||
desc.id = dbDesc.id;
|
||||
}
|
||||
}
|
||||
|
||||
// jetzt noch prüfen ob ggf. etwas rausgefallen ist
|
||||
for (const auto &oldDesc : m_dataMarkerObject.descriptions())
|
||||
for (const auto &oldDesc : m_dataMarkerObject.descriptions)
|
||||
{
|
||||
bool bFound = false;
|
||||
for (const auto &newDesc : newData.descriptions())
|
||||
for (const auto &newDesc : newData.descriptions)
|
||||
{
|
||||
if (newDesc.id() == oldDesc.id())
|
||||
if (newDesc.id == oldDesc.id)
|
||||
{
|
||||
bFound = true;
|
||||
break;
|
||||
@@ -123,11 +123,11 @@ Core::FunctionReplyObject ObjectMarker::updateObject(const Marker &data)
|
||||
}
|
||||
if (!bFound)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Description with id " << oldDesc.id() << " was removed - removing from db";
|
||||
if (!m_db->removeMrkMarkerDescription(oldDesc.id()))
|
||||
return Core::FunctionReplyObject(data.id(),
|
||||
DEBUG_LOG(m_logger) << "Description with id " << oldDesc.id << " was removed - removing from db";
|
||||
if (!m_db->removeMrkMarkerDescription(oldDesc.id))
|
||||
return Core::FunctionReplyObject(data.id,
|
||||
tr_lts("dds", "MarkerDescription with id %1 can not be removed"))
|
||||
.arg(oldDesc.id());
|
||||
.arg(oldDesc.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,54 +138,54 @@ Core::FunctionReplyObject ObjectMarker::updateObject(const Marker &data)
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id());
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id);
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Core::FunctionReplyObject ObjectMarker::removeObject()
|
||||
{
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id(), tr_lts("dds", "Marker still in use"));
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id, tr_lts("dds", "Marker still in use"));
|
||||
|
||||
// MarkerDescription werden automatisch entfernt (ON DELETE CASCADE)
|
||||
if (!m_db->removeMrkMarker(m_dataMarkerObject.id()))
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id(), tr_lts("dds", "Marker with id %1 can not be removed")).arg(m_dataMarkerObject.id());
|
||||
if (!m_db->removeMrkMarker(m_dataMarkerObject.id))
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id, tr_lts("dds", "Marker with id %1 can not be removed")).arg(m_dataMarkerObject.id);
|
||||
|
||||
m_ddsHandler->dts()->removeMarkerByKey(m_dataMarkerObject.id());
|
||||
m_ddsHandler->dts()->removeMarkerByKey(m_dataMarkerObject.id);
|
||||
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id());
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id);
|
||||
} // end of removeObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Core::FunctionReplyObject ObjectMarker::setUsed(bool isUsed)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id(), tr_lts("dds", "Trying to update an already removed Marker object"));
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id, tr_lts("dds", "Trying to update an already removed Marker object"));
|
||||
|
||||
m_dataMarkerObject.isUsed(isUsed);
|
||||
m_dataMarkerObject.isUsed = isUsed;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id());
|
||||
return Core::FunctionReplyObject(m_dataMarkerObject.id);
|
||||
} // end of setUsed()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectMarker::isValid() const
|
||||
{
|
||||
return m_dataMarkerObject.id() > 0;
|
||||
return m_dataMarkerObject.id > 0;
|
||||
} // end of isValid()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectMarker::isUsed() const
|
||||
{
|
||||
return m_dataMarkerObject.isUsed();
|
||||
return m_dataMarkerObject.isUsed;
|
||||
} // end of isUsed()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ObjectMarker::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish MrkMarker-data to dds markerId:" << m_dataMarkerObject.id() ;
|
||||
INFO_LOG(m_logger) << "Publish MrkMarker-data to dds markerId:" << m_dataMarkerObject.id ;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataMarkerObject))
|
||||
WARNING_LOG(m_logger) << "Error publishing MrkMarker-data to dds";
|
||||
@@ -202,16 +202,16 @@ Database::MrkMarker ObjectMarker::toDbData(const Marker &ddsData)
|
||||
{
|
||||
Database::MrkMarker dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.operatorId = ddsData.operatorId();
|
||||
dbData.note = QString::fromStdString(ddsData.note());
|
||||
dbData.timeStamp = ddsData.timeStamp();
|
||||
dbData.timeStampOffset = ddsData.timeStampOffset();
|
||||
dbData.mapSettings = QString::fromStdString(ddsData.mapSettings());
|
||||
dbData.filter = QString::fromStdString(ddsData.filter());
|
||||
dbData.position.setX(ddsData.position().lon());
|
||||
dbData.position.setY(ddsData.position().lat());
|
||||
dbData.fileContentId = ddsData.fileContentId();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.operatorId = ddsData.operatorId;
|
||||
dbData.note = QString::fromStdString(ddsData.note);
|
||||
dbData.timeStamp = ddsData.timeStamp;
|
||||
dbData.timeStampOffset = ddsData.timeStampOffset;
|
||||
dbData.mapSettings = QString::fromStdString(ddsData.mapSettings);
|
||||
dbData.filter = QString::fromStdString(ddsData.filter);
|
||||
dbData.position.setX(ddsData.position.lon);
|
||||
dbData.position.setY(ddsData.position.lat);
|
||||
dbData.fileContentId = ddsData.fileContentId;
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -222,19 +222,19 @@ Marker ObjectMarker::toDdsData(const Database::MrkMarker &dbData)
|
||||
{
|
||||
Marker ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.operatorId(dbData.operatorId);
|
||||
ddsData.note(dbData.note.toStdString());
|
||||
ddsData.timeStamp(dbData.timeStamp);
|
||||
ddsData.timeStampOffset(dbData.timeStampOffset);
|
||||
ddsData.mapSettings(dbData.mapSettings.toStdString());
|
||||
ddsData.filter(dbData.filter.toStdString());
|
||||
ddsData.position(Core::GeoPosition(dbData.position.x(), dbData.position.y(), 0.0));
|
||||
ddsData.fileContentId(dbData.fileContentId);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.operatorId = dbData.operatorId;
|
||||
ddsData.note = dbData.note.toStdString();
|
||||
ddsData.timeStamp = dbData.timeStamp;
|
||||
ddsData.timeStampOffset = dbData.timeStampOffset;
|
||||
ddsData.mapSettings = dbData.mapSettings.toStdString();
|
||||
ddsData.filter = dbData.filter.toStdString();
|
||||
ddsData.position = Core::GeoPosition(dbData.position.x(), dbData.position.y(), 0.0);
|
||||
ddsData.fileContentId = dbData.fileContentId;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
@@ -245,9 +245,9 @@ Database::MrkMarkerDescription ObjectMarker::toDbData(const MarkerDescription &d
|
||||
{
|
||||
Database::MrkMarkerDescription dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.markerTypeId = ddsData.markerType();
|
||||
dbData.content = QString::fromStdString(ddsData.content());
|
||||
dbData.id = ddsData.id;
|
||||
dbData.markerTypeId = ddsData.markerType;
|
||||
dbData.content = QString::fromStdString(ddsData.content);
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -258,9 +258,9 @@ MarkerDescription ObjectMarker::toDdsData(const Database::MrkMarkerDescription &
|
||||
{
|
||||
MarkerDescription ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.markerType(dbData.markerTypeId);
|
||||
ddsData.content(dbData.content.toStdString());
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.markerType = dbData.markerTypeId;
|
||||
ddsData.content = dbData.content.toStdString();
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
|
||||
@@ -32,9 +32,9 @@ public:
|
||||
|
||||
Core::FunctionReplyObject setUsed(bool isUsed);
|
||||
|
||||
qint32 getId() const { return m_dataMarkerObject.id(); }
|
||||
qint32 getId() const { return m_dataMarkerObject.id; }
|
||||
Marker getData() const { return m_dataMarkerObject; }
|
||||
QString getName() const { return QString::fromStdString(m_dataMarkerObject.name()); }
|
||||
QString getName() const { return QString::fromStdString(m_dataMarkerObject.name); }
|
||||
|
||||
bool isValid() const;
|
||||
bool isUsed() const;
|
||||
|
||||
@@ -22,7 +22,7 @@ ObjectSnapshot::ObjectSnapshot(const std::shared_ptr<DdsHandler> &ddsHandler, co
|
||||
|
||||
ObjectSnapshot::~ObjectSnapshot()
|
||||
{
|
||||
m_ddsHandler->dts()->removeSnapshotByKey(m_dataSnapshot.id());
|
||||
m_ddsHandler->dts()->removeSnapshotByKey(m_dataSnapshot.id);
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -37,13 +37,13 @@ Core::FunctionReplyObject ObjectSnapshot::createObject(const MarkerManagement::S
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Snapshot-data into database"));
|
||||
}
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataSnapshot.id(dbDataSnapshot.id);
|
||||
m_dataSnapshot.id = dbDataSnapshot.id;
|
||||
DEBUG_LOG(m_logger) << "New SnapshotrId: " << dbDataSnapshot.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id());
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id);
|
||||
|
||||
} // end of createObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -51,45 +51,45 @@ Core::FunctionReplyObject ObjectSnapshot::createObject(const MarkerManagement::S
|
||||
Core::FunctionReplyObject ObjectSnapshot::updateObject(const Snapshot &data)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Object not valid"));
|
||||
|
||||
Database::MrkSnapshot dbDataSnapshot = toDbData(data);
|
||||
|
||||
if (!m_db->update(dbDataSnapshot))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating MrkSnapshot-data into database"));
|
||||
return Core::FunctionReplyObject(data.id, tr_lts("dds", "Error updating MrkSnapshot-data into database"));
|
||||
|
||||
m_dataSnapshot = data;
|
||||
DEBUG_LOG(m_logger) << "Data changed for snapshotId: " << m_dataSnapshot.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for snapshotId: " << m_dataSnapshot.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id());
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id);
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Core::FunctionReplyObject ObjectSnapshot::removeObject()
|
||||
{
|
||||
if (!m_db->removeMrkSnapshot(m_dataSnapshot.id()))
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id(), tr_lts("dds", "Snapshot with id %1 can not be removed")).arg(m_dataSnapshot.id());
|
||||
if (!m_db->removeMrkSnapshot(m_dataSnapshot.id))
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id, tr_lts("dds", "Snapshot with id %1 can not be removed")).arg(m_dataSnapshot.id);
|
||||
|
||||
//m_ddsHandler->dts()->startTransaction();
|
||||
m_ddsHandler->dts()->removeSnapshotByKey(m_dataSnapshot.id());
|
||||
m_ddsHandler->dts()->removeSnapshotByKey(m_dataSnapshot.id);
|
||||
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id());
|
||||
return Core::FunctionReplyObject(m_dataSnapshot.id);
|
||||
} // end of removeObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectSnapshot::isValid() const
|
||||
{
|
||||
return m_dataSnapshot.id() > 0;
|
||||
return m_dataSnapshot.id > 0;
|
||||
} // end of isValid()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
void ObjectSnapshot::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish MrkSnapshot -data to dds snapshotId:" << m_dataSnapshot.id() ;
|
||||
INFO_LOG(m_logger) << "Publish MrkSnapshot -data to dds snapshotId:" << m_dataSnapshot.id ;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataSnapshot))
|
||||
ERROR_LOG(m_logger) << "Error publishing MrkMarker-data to dds";
|
||||
@@ -106,16 +106,16 @@ Database::MrkSnapshot ObjectSnapshot::toDbData(const Snapshot &ddsData)
|
||||
{
|
||||
Database::MrkSnapshot dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.operatorId = ddsData.operatorId();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.description = QString::fromStdString(ddsData.description());
|
||||
dbData.fileContentId = ddsData.fileContentId();
|
||||
dbData.timeStamp = ddsData.timeStamp();
|
||||
dbData.mapSettings = QString::fromStdString(ddsData.mapSettings());
|
||||
dbData.movementTracks = QString::fromStdString(ddsData.movementTracks());
|
||||
dbData.filter = QString::fromStdString(ddsData.filter());
|
||||
dbData.planOverlay = QString::fromStdString(ddsData.planOverlay());
|
||||
dbData.id = ddsData.id;
|
||||
dbData.operatorId = ddsData.operatorId;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
dbData.description = QString::fromStdString(ddsData.description);
|
||||
dbData.fileContentId = ddsData.fileContentId;
|
||||
dbData.timeStamp = ddsData.timeStamp;
|
||||
dbData.mapSettings = QString::fromStdString(ddsData.mapSettings);
|
||||
dbData.movementTracks = QString::fromStdString(ddsData.movementTracks);
|
||||
dbData.filter = QString::fromStdString(ddsData.filter);
|
||||
dbData.planOverlay = QString::fromStdString(ddsData.planOverlay);
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -126,17 +126,17 @@ Snapshot ObjectSnapshot::toDdsData(const Database::MrkSnapshot &dbData)
|
||||
{
|
||||
Snapshot ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.operatorId(dbData.operatorId);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.description(dbData.description.toStdString());
|
||||
ddsData.fileContentId(dbData.fileContentId);
|
||||
ddsData.timeStamp(dbData.timeStamp);
|
||||
ddsData.mapSettings(dbData.mapSettings.toStdString());
|
||||
ddsData.movementTracks(dbData.movementTracks.toStdString());
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.operatorId = dbData.operatorId;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.description = dbData.description.toStdString();
|
||||
ddsData.fileContentId = dbData.fileContentId;
|
||||
ddsData.timeStamp = dbData.timeStamp;
|
||||
ddsData.mapSettings = dbData.mapSettings.toStdString();
|
||||
ddsData.movementTracks = dbData.movementTracks.toStdString();
|
||||
|
||||
ddsData.filter(dbData.filter.toStdString());
|
||||
ddsData.planOverlay(dbData.planOverlay.toStdString());
|
||||
ddsData.filter = dbData.filter.toStdString();
|
||||
ddsData.planOverlay = dbData.planOverlay.toStdString();
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
Core::FunctionReplyObject updateObject(const MarkerManagement::Snapshot &data);
|
||||
Core::FunctionReplyObject removeObject();
|
||||
|
||||
qint32 getId() const{ return m_dataSnapshot.id(); }
|
||||
qint32 getId() const{ return m_dataSnapshot.id; }
|
||||
Snapshot getData() const { return m_dataSnapshot; }
|
||||
QString getName() const { return QString::fromStdString(m_dataSnapshot.name()); }
|
||||
QString getName() const { return QString::fromStdString(m_dataSnapshot.name); }
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,9 +51,9 @@ int ExercisesHandler::findEquipmentNumber(int participantId, int exerciseId)
|
||||
|
||||
bool ExercisesHandler::sendEquipmentMessage(const TrainingAreaBase::SendEquipmentMessageRequest &request)
|
||||
{
|
||||
if (request.equipmentNumbers().size() == 0)
|
||||
if (request.equipmentNumbers.size() == 0)
|
||||
return false;
|
||||
const int equipmentNumber = request.equipmentNumbers().at(0);
|
||||
const int equipmentNumber = request.equipmentNumbers.at(0);
|
||||
auto it = m_equipNo2ExerciseId.constFind(equipmentNumber);
|
||||
if (it == m_equipNo2ExerciseId.cend())
|
||||
{
|
||||
@@ -67,9 +67,9 @@ bool ExercisesHandler::sendEquipmentMessage(const TrainingAreaBase::SendEquipmen
|
||||
|
||||
bool ExercisesHandler::sendOcEquipmentMessage(const OcSituationServer::SendEquipmentMessageRequest &request)
|
||||
{
|
||||
if (request.equipmentNumbers().size() == 0)
|
||||
if (request.equipmentNumbers.size() == 0)
|
||||
return false;
|
||||
const int equipmentNumber = request.equipmentNumbers().at(0);
|
||||
const int equipmentNumber = request.equipmentNumbers.at(0);
|
||||
auto it = m_equipNo2ExerciseId.constFind(equipmentNumber);
|
||||
if (it == m_equipNo2ExerciseId.cend())
|
||||
{
|
||||
@@ -104,7 +104,7 @@ void ExercisesHandler::onEquipmentExerciseMappingChanged(const ParticipantManage
|
||||
|
||||
for (auto it = m_equipNo2ExerciseId.begin(); it != m_equipNo2ExerciseId.end(); )
|
||||
{
|
||||
if (it.value() != data.exerciseId())
|
||||
if (it.value() != data.exerciseId)
|
||||
++it;
|
||||
else
|
||||
it = m_equipNo2ExerciseId.erase(it);
|
||||
@@ -114,13 +114,13 @@ void ExercisesHandler::onEquipmentExerciseMappingChanged(const ParticipantManage
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping())
|
||||
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping)
|
||||
{
|
||||
m_equipNo2ExerciseId[e2p.equipmentNumber()] = data.exerciseId();
|
||||
m_equipNo2ExerciseId[e2p.equipmentNumber] = data.exerciseId;
|
||||
QPair<int,int> exePart;
|
||||
exePart.first = data.exerciseId();
|
||||
exePart.second = e2p.participantId();
|
||||
m_participant2EquipNumber[exePart] = e2p.equipmentNumber();
|
||||
exePart.first = data.exerciseId;
|
||||
exePart.second = e2p.participantId;
|
||||
m_participant2EquipNumber[exePart] = e2p.equipmentNumber;
|
||||
}
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
@@ -134,7 +134,7 @@ void ExercisesHandler::onEquipmentMessageChanged(const TrainingAreaBase::Equipme
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
const int equipmentNumber = data.equipmentNumber();
|
||||
const int equipmentNumber = data.equipmentNumber;
|
||||
const auto it = m_equipNo2ExerciseId.constFind(equipmentNumber);
|
||||
if (it == m_equipNo2ExerciseId.constEnd())
|
||||
{
|
||||
|
||||
+47
-47
@@ -83,19 +83,19 @@ Core::FunctionReplyObject HandlerOperatorMessage::createOperatorMessageRequest(c
|
||||
|
||||
Database::MsgMessageData newMsg;
|
||||
newMsg.timeStamp = m_ddsHandler->currentPartitionTime();
|
||||
newMsg.senderId = request.senderId();
|
||||
newMsg.senderId = request.senderId;
|
||||
INFO_LOG(m_logger) << "newMsg.senderId=" << newMsg.senderId;
|
||||
newMsg.subject = QString::fromStdString(request.subject());
|
||||
newMsg.message = QString::fromStdString(request.message());
|
||||
newMsg.senderType = request.senderType();
|
||||
newMsg.subject = QString::fromStdString(request.subject);
|
||||
newMsg.message = QString::fromStdString(request.message);
|
||||
newMsg.senderType = request.senderType;
|
||||
|
||||
INFO_LOG(m_logger) << "newMsg.senderType.underlying()=" << newMsg.senderType.underlying();
|
||||
newMsg.senderText = toAddressStr(newMsg.senderType, newMsg.senderId, request.exerciseId());
|
||||
newMsg.recipientType = request.recipientType();
|
||||
newMsg.exerciseId = request.exerciseId();
|
||||
INFO_LOG(m_logger) << "newMsg.senderType.underlying()=" << newMsg.senderType;
|
||||
newMsg.senderText = toAddressStr(newMsg.senderType, newMsg.senderId, request.exerciseId);
|
||||
newMsg.recipientType = request.recipientType;
|
||||
newMsg.exerciseId = request.exerciseId;
|
||||
|
||||
QString recipientText;
|
||||
for (int32_t i : request.recipientIds())
|
||||
for (int32_t i : request.recipientIds)
|
||||
{
|
||||
recipientText.append(toAddressStr(newMsg.recipientType, i, newMsg.exerciseId));
|
||||
recipientText.append(QString::fromStdString(" "));
|
||||
@@ -109,7 +109,7 @@ Core::FunctionReplyObject HandlerOperatorMessage::createOperatorMessageRequest(c
|
||||
newMsg.recipientText = recipientText;
|
||||
// Only Operator messages
|
||||
Core::FunctionReplyObject ret(newMsg.id);
|
||||
if (newMsg.senderType == Messaging::AddressType_def::type::Operator)
|
||||
if (newMsg.senderType == Messaging::AddressType::type::Operator)
|
||||
ret = insertInDbAndPublish(newMsg);
|
||||
|
||||
const int correspondingOutboxMsgId = ret.id();
|
||||
@@ -122,7 +122,7 @@ Core::FunctionReplyObject HandlerOperatorMessage::createOperatorMessageRequest(c
|
||||
//if (correspondingOutboxMsgId > 0) // messages received from TETRA dont have a corresponding outbox id
|
||||
newMsg.correspondingOutboxMessageId = correspondingOutboxMsgId; // can be also 0 - from TETRA
|
||||
|
||||
for (const auto recipientId : request.recipientIds())
|
||||
for (const auto recipientId : request.recipientIds)
|
||||
{
|
||||
newMsg.recipientId = recipientId;
|
||||
newMsg.recipientText = toAddressStr(newMsg.recipientType, newMsg.recipientId, newMsg.exerciseId);
|
||||
@@ -149,17 +149,17 @@ void HandlerOperatorMessage::onModifyOperatorMessageRequest(const rti::core::Sam
|
||||
// 4. neu publishen bzw. von dds löschen
|
||||
// 5. mit ok antworten
|
||||
|
||||
auto it = m_dbOperatorMessageData.find(request.id());
|
||||
auto it = m_dbOperatorMessageData.find(request.id);
|
||||
if (it == m_dbOperatorMessageData.end())
|
||||
{
|
||||
const auto ret = Core::FunctionReplyObject(0, tr_lts("dds", "Could not find message with id %1")).arg(request.id());
|
||||
const auto ret = Core::FunctionReplyObject(0, tr_lts("dds", "Could not find message with id %1")).arg(request.id);
|
||||
m_ddsHandler->fts()->modifyOperatorMessageReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
Database::MsgMessageData data = it.value();
|
||||
data.isDeleted = request.isDeleted();
|
||||
data.isSend = request.isSend();
|
||||
data.isRead = request.isRead();
|
||||
data.isDeleted = request.isDeleted;
|
||||
data.isSend = request.isSend;
|
||||
data.isRead = request.isRead;
|
||||
const auto ret = modifyDbAndPublish(data);
|
||||
|
||||
m_ddsHandler->fts()->modifyOperatorMessageReply(cookie, ret);
|
||||
@@ -169,21 +169,21 @@ void HandlerOperatorMessage::onModifyOperatorMessageRequest(const rti::core::Sam
|
||||
OperatorMessage HandlerOperatorMessage::toDdsData(const Database::MsgMessageData &dbData)
|
||||
{
|
||||
OperatorMessage ddsData;
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.senderId(dbData.senderId);
|
||||
ddsData.recipientId(dbData.recipientId);
|
||||
ddsData.exerciseId(dbData.exerciseId);
|
||||
ddsData.subject(dbData.subject.toStdString());
|
||||
ddsData.message(dbData.message.toStdString());
|
||||
ddsData.recipientText(dbData.recipientText.toStdString());
|
||||
ddsData.senderText(dbData.senderText.toStdString());
|
||||
ddsData.isRead(dbData.isRead);
|
||||
ddsData.isSend(dbData.isSend);
|
||||
ddsData.isDeleted(dbData.isDeleted);
|
||||
ddsData.senderType(dbData.senderType);
|
||||
ddsData.recipientType(dbData.recipientType);
|
||||
ddsData.correspondingOutboxMessageId(dbData.correspondingOutboxMessageId); // can also be 0
|
||||
ddsData.timeStamp(dbData.timeStamp);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.senderId = dbData.senderId;
|
||||
ddsData.recipientId = dbData.recipientId;
|
||||
ddsData.exerciseId = dbData.exerciseId;
|
||||
ddsData.subject = dbData.subject.toStdString();
|
||||
ddsData.message = dbData.message.toStdString();
|
||||
ddsData.recipientText = dbData.recipientText.toStdString();
|
||||
ddsData.senderText = dbData.senderText.toStdString();
|
||||
ddsData.isRead = dbData.isRead;
|
||||
ddsData.isSend = dbData.isSend;
|
||||
ddsData.isDeleted = dbData.isDeleted;
|
||||
ddsData.senderType = dbData.senderType;
|
||||
ddsData.recipientType = dbData.recipientType;
|
||||
ddsData.correspondingOutboxMessageId = dbData.correspondingOutboxMessageId; // can also be 0
|
||||
ddsData.timeStamp = dbData.timeStamp;
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -192,12 +192,12 @@ OperatorMessage HandlerOperatorMessage::toDdsData(const Database::MsgMessageData
|
||||
Core::FunctionReplyObject HandlerOperatorMessage::insertInDbAndPublish(Database::MsgMessageData newMsg)
|
||||
{
|
||||
// Length Check:
|
||||
if (newMsg.recipientType == Messaging::AddressType_def::type::ObserverController)
|
||||
if (newMsg.recipientType == Messaging::AddressType::type::ObserverController)
|
||||
{
|
||||
newMsg.subject = newMsg.subject.left(m_maxSubjectLength);
|
||||
newMsg.message = newMsg.message.left(m_maxOcContentLength);
|
||||
}
|
||||
if (newMsg.recipientType == Messaging::AddressType_def::type::Participant)
|
||||
if (newMsg.recipientType == Messaging::AddressType::type::Participant)
|
||||
{
|
||||
newMsg.subject = newMsg.subject.left(m_maxSubjectLength);
|
||||
newMsg.message.clear();
|
||||
@@ -208,8 +208,8 @@ Core::FunctionReplyObject HandlerOperatorMessage::insertInDbAndPublish(Database:
|
||||
|
||||
m_dbOperatorMessageData.insert(newMsg.id, newMsg);
|
||||
|
||||
if ((newMsg.recipientType == Messaging::AddressType_def::type::ObserverController)
|
||||
|| (newMsg.recipientType == Messaging::AddressType_def::type::Participant))
|
||||
if ((newMsg.recipientType == Messaging::AddressType::type::ObserverController)
|
||||
|| (newMsg.recipientType == Messaging::AddressType::type::Participant))
|
||||
{
|
||||
|
||||
int32_t equipmentNumber = m_exercisesHandler->findEquipmentNumber(newMsg.recipientId, newMsg.exerciseId);
|
||||
@@ -236,7 +236,7 @@ Core::FunctionReplyObject HandlerOperatorMessage::insertInDbAndPublish(Database:
|
||||
<< " subject=" << subject
|
||||
<< " message=" << message;
|
||||
static int s_requestId = 1;
|
||||
if (newMsg.recipientType == Messaging::AddressType_def::type::ObserverController)
|
||||
if (newMsg.recipientType == Messaging::AddressType::type::ObserverController)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Send to OC senderId=" << newMsg.senderId << " sendertype: " << newMsg.senderType << " subject " << subject;
|
||||
m_exercisesHandler->sendOcEquipmentMessage({s_requestId++,
|
||||
@@ -267,7 +267,7 @@ Core::FunctionReplyObject HandlerOperatorMessage::insertInDbAndPublish(Database:
|
||||
m_ddsHandler->dts()->publish(toDdsData(newMsg));
|
||||
|
||||
INFO_LOG(m_logger) << "insertInDbAndPublish id=" << newMsg.id;
|
||||
if (newMsg.recipientType == Messaging::AddressType_def::type::ObserverController && newMsg.recipientId > 0)
|
||||
if (newMsg.recipientType == Messaging::AddressType::type::ObserverController && newMsg.recipientId > 0)
|
||||
{
|
||||
INFO_LOG(m_logger) << "O/C-Message in Member-Variable kopieren: id = " << newMsg.id;
|
||||
}
|
||||
@@ -317,13 +317,13 @@ void HandlerOperatorMessage::onEquipmentMessageChanged(const TrainingAreaBase::E
|
||||
CreateOperatorMessageRequest request;
|
||||
DEBUG_LOG(m_logger) << "onEquipmentMessageChanged: " << data;
|
||||
|
||||
request.senderType() = Messaging::AddressType_def::type::Participant;
|
||||
request.senderId(data.sender());
|
||||
DEBUG_LOG(m_logger) << "request.senderId = " << request.senderId();
|
||||
request.recipientType(Messaging::AddressType_def::type::Operator);
|
||||
request.recipientIds().push_back(data.receiver());
|
||||
request.subject() = data.subject();
|
||||
request.message() = data.text();
|
||||
request.senderType = Messaging::AddressType::type::Participant;
|
||||
request.senderId = data.sender;
|
||||
DEBUG_LOG(m_logger) << "request.senderId = " << request.senderId;
|
||||
request.recipientType = Messaging::AddressType::type::Operator;
|
||||
request.recipientIds.push_back(data.receiver);
|
||||
request.subject = data.subject;
|
||||
request.message = data.text;
|
||||
|
||||
createOperatorMessageRequest(request);
|
||||
// Todo Fragen, ob die Meldung vom DDS geloescht werden soll.
|
||||
@@ -332,13 +332,13 @@ void HandlerOperatorMessage::onEquipmentMessageChanged(const TrainingAreaBase::E
|
||||
void HandlerOperatorMessage::onOperatorChanged(const OperatorManagement::User &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "************** onOperatorChanged ";
|
||||
m_operatorMap.insert(data.id(), data.name());
|
||||
m_operatorMap.insert(data.id, data.name);
|
||||
} // end of onOperatorChanged
|
||||
|
||||
QString HandlerOperatorMessage::toAddressStr(const AddressType addressType, const qint32 addressId, int exerciseId)
|
||||
{
|
||||
QString result;
|
||||
switch (addressType.underlying())
|
||||
switch (addressType)
|
||||
{
|
||||
case AddressType::Operator:
|
||||
// nicht per Request sondern hier aus OPM holen
|
||||
@@ -357,7 +357,7 @@ QString HandlerOperatorMessage::toAddressStr(const AddressType addressType, cons
|
||||
default:
|
||||
result = QString::fromStdString("No valid addressType:");
|
||||
QString numberStr ;
|
||||
numberStr.setNum(addressType.underlying());
|
||||
numberStr.setNum(addressType);
|
||||
result.append(numberStr);
|
||||
}
|
||||
return result;
|
||||
|
||||
+92
-92
@@ -146,7 +146,7 @@ void NomTests::tryCreateHQ()
|
||||
qint64 expiryTime = currentTime + Settings::expiryIntervalMSec();
|
||||
NotificationManagement::NomNotification notif;
|
||||
|
||||
notif.title(tr("HQ Reports ").toStdString());
|
||||
notif.title = tr("HQ Reports ").toStdString();
|
||||
|
||||
// format: "[Open HQ Report Dialog](//flmHQReport/party=3&folder=51&file=12)"
|
||||
// Open HQ Report Dialog : this text link will display on notification and is clickable
|
||||
@@ -161,24 +161,24 @@ void NomTests::tryCreateHQ()
|
||||
QString linkName = QStringLiteral("Open HQ Report Dialog");
|
||||
QString content = QStringLiteral("[%1](//flmHQReport/?party=%2&folder=%3&file=%4)");
|
||||
content = content.arg(linkName).arg(partyId).arg(folderId).arg(fileId);
|
||||
notif.content(content.toStdString());
|
||||
notif.timeStamp(currentTime);
|
||||
notif.expiryTime(expiryTime);
|
||||
notif.content = content.toStdString();
|
||||
notif.timeStamp = currentTime;
|
||||
notif.expiryTime = expiryTime;
|
||||
|
||||
notif.priority(static_cast<NotificationManagement::Priority_def::type>(Settings::notificationPriority()));
|
||||
notif.processedPriority(NotificationManagement::Priority_def::Highest);
|
||||
notif.exerciseId(m_exerciseId);
|
||||
notif.priority = static_cast<NotificationManagement::Priority_def::type>(Settings::notificationPriority());
|
||||
notif.processedPriority = NotificationManagement::Priority::Highest;
|
||||
notif.exerciseId = m_exerciseId;
|
||||
|
||||
for (const auto &userId : m_opmDtc->getOperatorsByOperatorRight(OperatorRights::FileManagementFilesEdit))
|
||||
{
|
||||
NotificationManagement::Address addr;
|
||||
addr.addressId(userId);
|
||||
addr.isRead(false);
|
||||
addr.addressId = userId;
|
||||
addr.isRead = false;
|
||||
QString name = QStringLiteral("Operator ") + QString::number(userId);
|
||||
addr.name(name.toStdString());
|
||||
addr.addressType(NotificationManagement::AddressType_def::Operator);
|
||||
addr.addressSubId(userId+10);
|
||||
notif.recipientIds().push_back(addr);
|
||||
addr.name = name.toStdString();
|
||||
addr.addressType = NotificationManagement::AddressType::Operator;
|
||||
addr.addressSubId = userId+10;
|
||||
notif.recipientIds.push_back(addr);
|
||||
}
|
||||
|
||||
// NotificationManagement::Address addrSender;
|
||||
@@ -189,7 +189,7 @@ void NomTests::tryCreateHQ()
|
||||
// notif.sender(addrSender);
|
||||
|
||||
NotificationManagement::CreateNotificationRequest notifReq;
|
||||
notifReq.notification(notif);
|
||||
notifReq.notification = notif;
|
||||
|
||||
if (!m_ftc->createNotificationRequest(notifReq, this))
|
||||
ERROR_LOG(m_logger) << "Error requesting create Notification data";
|
||||
@@ -204,15 +204,15 @@ void NomTests::tryReadReceipt()
|
||||
m_dtc->waitForHistoricalDataNomNotification();
|
||||
NotificationManagement::NomNotification data = m_dtc->nomNotification(m_notificationId);
|
||||
|
||||
NotificationManagement::Address recipientAddress = data.recipientIds().front();
|
||||
NotificationManagement::Address recipientAddress = data.recipientIds.front();
|
||||
//NotificationManagement::Address recipientAddress = data.recipientIds().at(2);
|
||||
NotificationManagement::ReadReceiptRequest request;
|
||||
request.addressId(recipientAddress.id());
|
||||
request.operatorId(recipientAddress.addressId());
|
||||
request.workstationId(0);
|
||||
request.addressId = recipientAddress.id;
|
||||
request.operatorId = recipientAddress.addressId;
|
||||
request.workstationId = 0;
|
||||
|
||||
request.notificationIds({m_notificationId});
|
||||
request.processed(true);
|
||||
request.notificationIds = {m_notificationId};
|
||||
request.processed = true;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
if (!m_ftc->readReceiptRequest(request, this))
|
||||
@@ -258,24 +258,24 @@ void NomTests::tryGetAllNotifications()
|
||||
for (const NomNotification ¬if : m_dtc->nomNotifications())
|
||||
{
|
||||
// needed for Test 11 tryGetNotification
|
||||
m_notificationId = notif.id();
|
||||
m_notificationId = notif.id;
|
||||
|
||||
INFO_LOG(m_logger) << "Nom(" << notif.id() << ") :"
|
||||
<< " title:" << notif.title()
|
||||
<< " content:" << notif.content()
|
||||
<< " timeStamp:" << notif.timeStamp()
|
||||
<< " priority:" << notif.priority()
|
||||
<< " processed: " << notif.processed()
|
||||
<< " processedTime: " << notif.processTime()
|
||||
<< " processPrio: " << notif.processedPriority()
|
||||
<< " recipient count:" << notif.recipientIds().size();
|
||||
INFO_LOG(m_logger) << "Nom(" << notif.id << ") :"
|
||||
<< " title:" << notif.title
|
||||
<< " content:" << notif.content
|
||||
<< " timeStamp:" << notif.timeStamp
|
||||
<< " priority:" << notif.priority
|
||||
<< " processed: " << notif.processed
|
||||
<< " processedTime: " << notif.processTime
|
||||
<< " processPrio: " << notif.processedPriority
|
||||
<< " recipient count:" << notif.recipientIds.size();
|
||||
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
<< " name: " << notif.sender().name()
|
||||
<< ", addressId: " << notif.sender().addressId()
|
||||
<< ", addressSubId: " << notif.sender().addressSubId()
|
||||
<< ", addressSubSubId: " << notif.sender().addressSubSubId()
|
||||
<< ", addressType: " << notif.sender().addressType();
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender.id << ") :"
|
||||
<< " name: " << notif.sender.name
|
||||
<< ", addressId: " << notif.sender.addressId
|
||||
<< ", addressSubId: " << notif.sender.addressSubId
|
||||
<< ", addressSubSubId: " << notif.sender.addressSubSubId
|
||||
<< ", addressType: " << notif.sender.addressType;
|
||||
}
|
||||
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
@@ -299,40 +299,40 @@ void NomTests::tryGetNotification()
|
||||
m_dtc->waitForHistoricalDataNomNotification();
|
||||
NotificationManagement::NomNotification notif = m_dtc->nomNotification(m_notificationId);
|
||||
|
||||
if (notif.id() <= 0)
|
||||
if (notif.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for notificationId " << m_notificationId << " returnVal:" << notif.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for notificationId " << m_notificationId << " returnVal:" << notif.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "NomNotification(" << notif.id() << ") :"
|
||||
<< " title:" << notif.title()
|
||||
<< " content:" << notif.content()
|
||||
<< " timeStamp:" << notif.timeStamp()
|
||||
<< " priority:" << notif.priority()
|
||||
<< " processed: " << notif.processed()
|
||||
<< " processedTime: " << notif.processTime()
|
||||
<< " processPrio: " << notif.processedPriority()
|
||||
<< " recipient count:" << notif.recipientIds().size();
|
||||
INFO_LOG(m_logger) << "NomNotification(" << notif.id << ") :"
|
||||
<< " title:" << notif.title
|
||||
<< " content:" << notif.content
|
||||
<< " timeStamp:" << notif.timeStamp
|
||||
<< " priority:" << notif.priority
|
||||
<< " processed: " << notif.processed
|
||||
<< " processedTime: " << notif.processTime
|
||||
<< " processPrio: " << notif.processedPriority
|
||||
<< " recipient count:" << notif.recipientIds.size();
|
||||
|
||||
for (const NotificationManagement::Address &addr : notif.recipientIds())
|
||||
for (const NotificationManagement::Address &addr : notif.recipientIds)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Recipient(" << addr.id() << ") :"
|
||||
<< " name: " << addr.name()
|
||||
<< ", addressId: " << addr.addressId()
|
||||
<< ", addressSubId: " << addr.addressSubId()
|
||||
<< ", addressSubSubId: " << addr.addressSubSubId()
|
||||
<< ", addressType: " << addr.addressType()
|
||||
<< ", isRead: " << addr.isRead();
|
||||
INFO_LOG(m_logger) << "Recipient(" << addr.id << ") :"
|
||||
<< " name: " << addr.name
|
||||
<< ", addressId: " << addr.addressId
|
||||
<< ", addressSubId: " << addr.addressSubId
|
||||
<< ", addressSubSubId: " << addr.addressSubSubId
|
||||
<< ", addressType: " << addr.addressType
|
||||
<< ", isRead: " << addr.isRead;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender().id() << ") :"
|
||||
<< " name: " << notif.sender().name()
|
||||
<< ", addressId: " << notif.sender().addressId()
|
||||
<< ", addressSubId: " << notif.sender().addressSubId()
|
||||
<< ", addressSubSubId: " << notif.sender().addressSubSubId()
|
||||
<< ", addressType: " << notif.sender().addressType();
|
||||
INFO_LOG(m_logger) << "SenderAddress(" << notif.sender.id << ") :"
|
||||
<< " name: " << notif.sender.name
|
||||
<< ", addressId: " << notif.sender.addressId
|
||||
<< ", addressSubId: " << notif.sender.addressSubId
|
||||
<< ", addressSubSubId: " << notif.sender.addressSubSubId
|
||||
<< ", addressType: " << notif.sender.addressType;
|
||||
}
|
||||
|
||||
if (m_testId == 0)
|
||||
@@ -442,15 +442,15 @@ void NomTests::onReceiveNotificationChanged(const NomNotification &data, DataMod
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG(m_logger) << "*** NomNotification added received. notificationId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** NomNotification added received. notificationId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG(m_logger) << "*** NomNotification modified received. notificationId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** NomNotification modified received. notificationId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG(m_logger) << "*** NomNotification removed received. notificationId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** NomNotification removed received. notificationId:" << data.id;
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -466,47 +466,47 @@ void NomTests::getCreateNotificationRequestData(CreateNotificationRequest &data)
|
||||
qint64 expiryTime = currentTime + 100 * 1000;
|
||||
NotificationManagement::NomNotification notif;
|
||||
|
||||
notif.title("TestNotificationCreate");
|
||||
notif.content("Dies ist ein Test mit Content");
|
||||
notif.timeStamp(currentTime);
|
||||
notif.expiryTime(expiryTime);
|
||||
notif.priority(NotificationManagement::Priority_def::High);
|
||||
notif.processedPriority(NotificationManagement::Priority_def::Low);
|
||||
notif.exerciseId(m_exerciseId);
|
||||
notif.title = "TestNotificationCreate";
|
||||
notif.content = "Dies ist ein Test mit Content";
|
||||
notif.timeStamp = currentTime;
|
||||
notif.expiryTime = expiryTime;
|
||||
notif.priority = NotificationManagement::Priority::High;
|
||||
notif.processedPriority = NotificationManagement::Priority::Low;
|
||||
notif.exerciseId = m_exerciseId;
|
||||
|
||||
for (int i=10; i< 24; i++)
|
||||
{
|
||||
NotificationManagement::Address addr;
|
||||
addr.addressId(i);
|
||||
addr.isRead(false);
|
||||
addr.addressId = i;
|
||||
addr.isRead = false;
|
||||
QString name = QStringLiteral("Operator ") + QString::number(i);
|
||||
addr.name(name.toStdString());
|
||||
addr.addressType(NotificationManagement::AddressType_def::Operator);
|
||||
addr.addressSubId(i+10);
|
||||
notif.recipientIds().push_back(addr);
|
||||
addr.name = name.toStdString();
|
||||
addr.addressType = NotificationManagement::AddressType::Operator;
|
||||
addr.addressSubId = i+10;
|
||||
notif.recipientIds.push_back(addr);
|
||||
}
|
||||
|
||||
NotificationManagement::Address wsAddr;
|
||||
wsAddr.addressId(302);
|
||||
wsAddr.isRead(false);
|
||||
wsAddr.addressId = 302;
|
||||
wsAddr.isRead = false;
|
||||
QString name = QStringLiteral("Workstation 2 ");
|
||||
wsAddr.name(name.toStdString());
|
||||
wsAddr.addressType(NotificationManagement::AddressType_def::Workstation);
|
||||
notif.recipientIds().push_back(wsAddr);
|
||||
wsAddr.name = name.toStdString();
|
||||
wsAddr.addressType = NotificationManagement::AddressType::Workstation;
|
||||
notif.recipientIds.push_back(wsAddr);
|
||||
|
||||
NotificationManagement::Address addrSender;
|
||||
addrSender.addressId(ParticipantManagement::Offset);
|
||||
addrSender.name(QStringLiteral("svcParticipantManagement ").toStdString());
|
||||
addrSender.addressType(NotificationManagement::AddressType_def::Service);
|
||||
notif.sender(addrSender);
|
||||
addrSender.addressId = ParticipantManagement::Offset;
|
||||
addrSender.name = QStringLiteral("svcParticipantManagement ").toStdString();
|
||||
addrSender.addressType = NotificationManagement::AddressType::Service;
|
||||
notif.sender = addrSender;
|
||||
|
||||
data.notification(notif);
|
||||
data.notification = notif;
|
||||
} // end of getCreateNotificationRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool NomTests::onCompareCreatedData(NomNotification &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -514,14 +514,14 @@ bool NomTests::onCompareCreatedData(NomNotification &data)
|
||||
|
||||
getCreateNotificationRequestData(createData);
|
||||
|
||||
if (createData.notification().title() != data.title())
|
||||
if (createData.notification.title != data.title)
|
||||
return false;
|
||||
|
||||
if (createData.notification().priority() != data.priority())
|
||||
if (createData.notification.priority != data.priority)
|
||||
return false;
|
||||
if (createData.notification().content() != data.content())
|
||||
if (createData.notification.content != data.content)
|
||||
return false;
|
||||
if (createData.notification().processedPriority() != data.processedPriority())
|
||||
if (createData.notification.processedPriority != data.processedPriority)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -64,6 +64,6 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const { return m_dtcCore->partitionTime().timeStamp(); }
|
||||
qint64 DdsHandler::currentPartitionTime() const { return m_dtcCore->partitionTime().timeStamp; }
|
||||
|
||||
} // Namespace NotificationManagement
|
||||
+13
-13
@@ -58,20 +58,20 @@ bool HandlerNotification::init()
|
||||
// Remove old notifications
|
||||
if (isRemoveable(notif))
|
||||
{
|
||||
INFO_LOG(m_logger) << "Remove old notification " << notif.title() << ", id = " << notif.id();
|
||||
removeNotificationIds.append(notif.id());
|
||||
INFO_LOG(m_logger) << "Remove old notification " << notif.title << ", id = " << notif.id;
|
||||
removeNotificationIds.append(notif.id);
|
||||
return;
|
||||
}
|
||||
|
||||
// alle Addressen zu der NomNotification eintragen
|
||||
for (const Database::NomAddress &addr : qAsConst(dataAddressVec))
|
||||
{
|
||||
if (addr.notificationId == notif.id())
|
||||
if (addr.notificationId == notif.id)
|
||||
{
|
||||
if (addr.isSender)
|
||||
notif.sender(ObjectNotification::toDdsData(addr));
|
||||
notif.sender = ObjectNotification::toDdsData(addr);
|
||||
else
|
||||
notif.recipientIds().push_back(ObjectNotification::toDdsData(addr));
|
||||
notif.recipientIds.push_back(ObjectNotification::toDdsData(addr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void HandlerNotification::onCreateNotificationRequest(const rti::core::SampleIde
|
||||
DEBUG_LOG(m_logger) << "onCreateNotificationRequest: " << request;
|
||||
|
||||
ObjectNotification *ifs(new ObjectNotification(m_ddsHandler, m_db));
|
||||
const Core::FunctionReplyObject ret = ifs->createObject(request.notification());
|
||||
const Core::FunctionReplyObject ret = ifs->createObject(request.notification);
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
@@ -152,7 +152,7 @@ void HandlerNotification::onReadReceiptRequest(const rti::core::SampleIdentity &
|
||||
DEBUG_LOG(m_logger) << "onReadReceiptRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
for (const auto notificationId : request.notificationIds())
|
||||
for (const auto notificationId : request.notificationIds)
|
||||
{
|
||||
ObjectNotification *ifs = m_objectNotificationMap.value(notificationId);
|
||||
if (ifs == nullptr)
|
||||
@@ -173,7 +173,7 @@ void HandlerNotification::onDeleteMessageRequest(const rti::core::SampleIdentity
|
||||
DEBUG_LOG(m_logger) << "onDeleteMessageRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
for (const auto notificationId : request.notificationIds())
|
||||
for (const auto notificationId : request.notificationIds)
|
||||
{
|
||||
ObjectNotification *ifs = m_objectNotificationMap.value(notificationId);
|
||||
if (ifs == nullptr)
|
||||
@@ -191,7 +191,7 @@ void HandlerNotification::onDeleteMessageRequest(const rti::core::SampleIdentity
|
||||
void HandlerNotification::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
|
||||
{
|
||||
if (modType == DataModification::eAdded ||
|
||||
(modType == DataModification::eModified && data.state() != ExerciseManagement::ExerciseState::Stopped))
|
||||
(modType == DataModification::eModified && data.state != ExerciseManagement::ExerciseState::Stopped))
|
||||
return;
|
||||
|
||||
// Remove notification for given exercise
|
||||
@@ -200,7 +200,7 @@ void HandlerNotification::onExerciseChanged(const ExerciseManagement::Exercise &
|
||||
{
|
||||
it.next();
|
||||
ObjectNotification* obj = it.value();
|
||||
if (obj->notification().exerciseId() != data.id())
|
||||
if (obj->notification().exerciseId != data.id)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Remove notification " << obj->id();
|
||||
@@ -244,15 +244,15 @@ void HandlerNotification::onCheckRemove()
|
||||
bool HandlerNotification::isRemoveable(const NomNotification ¬if)
|
||||
{
|
||||
// NomNotification from exercises will not be removed
|
||||
if (notif.exerciseId() != 0)
|
||||
if (notif.exerciseId != 0)
|
||||
return false;
|
||||
|
||||
qint64 expiryInterval = Settings::expiryIntervalMSec();
|
||||
qint64 currentTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
// Remove notification if expiryTime + expiryInterval / processTime + expiryInterval
|
||||
if (currentTime > ( notif.expiryTime() + expiryInterval) ||
|
||||
(notif.processed() > 0 && currentTime > ( notif.processTime() + expiryInterval)))
|
||||
if (currentTime > ( notif.expiryTime + expiryInterval) ||
|
||||
(notif.processed > 0 && currentTime > ( notif.processTime + expiryInterval)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
+92
-92
@@ -29,14 +29,14 @@ ObjectNotification::ObjectNotification(const std::shared_ptr<DdsHandler> &ddsHan
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
ObjectNotification::~ObjectNotification() { m_ddsHandler->dts()->removeNomNotificationByKey(m_dataNotificationObject.id()); } // end of dtor()
|
||||
ObjectNotification::~ObjectNotification() { m_ddsHandler->dts()->removeNomNotificationByKey(m_dataNotificationObject.id); } // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification &data)
|
||||
{
|
||||
m_dataNotificationObject = data;
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
Database::NomNotification dbDataNotification = toDbData(data);
|
||||
dbDataNotification.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -45,15 +45,15 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting NomNotification-data into database"));
|
||||
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataNotificationObject.id(dbDataNotification.id);
|
||||
m_dataNotificationObject.id = dbDataNotification.id;
|
||||
DEBUG_LOG(m_logger) << "New NotificationId: " << dbDataNotification.id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds().size();
|
||||
DEBUG_LOG(m_logger) << "Handle Address for notificationId:" << dbDataNotification.id << " number of depending recipients: " << data.recipientIds.size();
|
||||
|
||||
// Behandlung von Recipients
|
||||
for (size_t i = 0; i < data.recipientIds().size(); ++i)
|
||||
for (size_t i = 0; i < data.recipientIds.size(); ++i)
|
||||
{
|
||||
Address &recipientAddress = m_dataNotificationObject.recipientIds()[i];
|
||||
Address &recipientAddress = m_dataNotificationObject.recipientIds[i];
|
||||
Database::NomAddress dbDataRecipientAddr = toDbData(recipientAddress);
|
||||
|
||||
// Struct Address vorbereiten
|
||||
@@ -64,10 +64,10 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
if (!m_db->insert(dbDataRecipientAddr))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting RecipientAddress-data into database"));
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
recipientAddress.id(dbDataRecipientAddr.id);
|
||||
recipientAddress.id = dbDataRecipientAddr.id;
|
||||
}
|
||||
|
||||
Address &senderAddress = m_dataNotificationObject.sender();
|
||||
Address &senderAddress = m_dataNotificationObject.sender;
|
||||
Database::NomAddress dbDataSenderAddr = toDbData(senderAddress);
|
||||
|
||||
// Struct Address vorbereiten
|
||||
@@ -78,7 +78,7 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
if (!m_db->insert(dbDataSenderAddr))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting SenderAddress-data into database"));
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
senderAddress.id(dbDataSenderAddr.id);
|
||||
senderAddress.id = dbDataSenderAddr.id;
|
||||
|
||||
trans.commit();
|
||||
}
|
||||
@@ -86,7 +86,7 @@ Core::FunctionReplyObject ObjectNotification::createObject(const NomNotification
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id());
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id);
|
||||
|
||||
} // end of createObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -96,7 +96,7 @@ QString ObjectNotification::contentArgsToJson()
|
||||
int i = 1;
|
||||
QJsonArray jsonArray;
|
||||
|
||||
for (const std::string& arg : qAsConst(m_dataNotificationObject.contentArgs()))
|
||||
for (const std::string& arg : qAsConst(m_dataNotificationObject.contentArgs))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << ".arg() ersetzt immer den kleinsten freien Platzhalter"
|
||||
<< ", arg=" << arg;
|
||||
@@ -168,29 +168,29 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
|
||||
Database::NomAddress dbDataAddr;
|
||||
|
||||
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds()))
|
||||
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds))
|
||||
{
|
||||
if (data.operatorId() > 0 && recipientAddr.addressType() == AddressType_def::Operator && recipientAddr.addressId() != data.operatorId())
|
||||
if (data.operatorId > 0 && recipientAddr.addressType == AddressType::Operator && recipientAddr.addressId != data.operatorId)
|
||||
continue;
|
||||
|
||||
if (data.workstationId() > 0 && recipientAddr.addressType() == AddressType_def::Workstation && recipientAddr.addressId() != data.workstationId())
|
||||
if (data.workstationId > 0 && recipientAddr.addressType == AddressType::Workstation && recipientAddr.addressId != data.workstationId)
|
||||
continue;
|
||||
|
||||
dbDataAddr = toDbData(recipientAddr);
|
||||
DEBUG_LOG(m_logger) << "Found Operator " << data.operatorId() << " with repicpentID " << dbDataAddr.id;
|
||||
DEBUG_LOG(m_logger) << "Found Operator " << data.operatorId << " with repicpentID " << dbDataAddr.id;
|
||||
dbDataAddr.notificationId = dbDataNotification.id;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (dbDataAddr.id <= 0)
|
||||
return Core::FunctionReplyObject(data.addressId(), tr_lts("dds", "No Address found"));
|
||||
return Core::FunctionReplyObject(data.addressId, tr_lts("dds", "No Address found"));
|
||||
|
||||
dbDataAddr.isRead = true;
|
||||
|
||||
DBTransaction trans(m_db->database());
|
||||
// NomNotification shall be marked as processed
|
||||
if (data.processed())
|
||||
if (data.processed)
|
||||
{
|
||||
// but hasn't been so yet
|
||||
if (dbDataNotification.processed <= 0)
|
||||
@@ -216,25 +216,25 @@ Core::FunctionReplyObject ObjectNotification::readReceipt(const ReadReceipt &dat
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id;
|
||||
|
||||
const std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
const Address sender = m_dataNotificationObject.sender();
|
||||
const std::vector<Address> recipients = m_dataNotificationObject.recipientIds;
|
||||
const Address sender = m_dataNotificationObject.sender;
|
||||
m_dataNotificationObject = toDdsData(dbDataNotification);
|
||||
m_dataNotificationObject.sender(sender);
|
||||
m_dataNotificationObject.sender = sender;
|
||||
|
||||
for (const Address &addr : qAsConst(recipients))
|
||||
{
|
||||
if (addr.id() == dbDataAddr.id)
|
||||
m_dataNotificationObject.recipientIds().push_back(toDdsData(dbDataAddr));
|
||||
if (addr.id == dbDataAddr.id)
|
||||
m_dataNotificationObject.recipientIds.push_back(toDdsData(dbDataAddr));
|
||||
else
|
||||
m_dataNotificationObject.recipientIds().push_back(addr);
|
||||
m_dataNotificationObject.recipientIds.push_back(addr);
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id());
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id);
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -247,14 +247,14 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
Database::NomAddress dbDataAddr;
|
||||
|
||||
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds()))
|
||||
for (const Address &recipientAddr : qAsConst(m_dataNotificationObject.recipientIds))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "recipientAddr="
|
||||
<< ", id: " << recipientAddr.id() << ", addressId: " << recipientAddr.addressId() << ", isDeleted: " << recipientAddr.isDeleted();
|
||||
if (data.operatorId() > 0 && recipientAddr.addressType() == AddressType_def::Operator && recipientAddr.addressId() != data.operatorId())
|
||||
<< ", id: " << recipientAddr.id << ", addressId: " << recipientAddr.addressId << ", isDeleted: " << recipientAddr.isDeleted;
|
||||
if (data.operatorId > 0 && recipientAddr.addressType == AddressType::Operator && recipientAddr.addressId != data.operatorId)
|
||||
continue;
|
||||
|
||||
if (data.workstationId() > 0 && recipientAddr.addressType() == AddressType_def::Workstation && recipientAddr.addressId() != data.workstationId())
|
||||
if (data.workstationId > 0 && recipientAddr.addressType == AddressType::Workstation && recipientAddr.addressId != data.workstationId)
|
||||
continue;
|
||||
|
||||
dbDataAddr = toDbData(recipientAddr);
|
||||
@@ -264,7 +264,7 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
}
|
||||
|
||||
if (dbDataAddr.id <= 0)
|
||||
return Core::FunctionReplyObject(data.addressId(), tr_lts("dds", "No Address found"));
|
||||
return Core::FunctionReplyObject(data.addressId, tr_lts("dds", "No Address found"));
|
||||
|
||||
dbDataAddr.isDeleted = true;
|
||||
|
||||
@@ -275,60 +275,60 @@ Core::FunctionReplyObject ObjectNotification::deleteMessage(const DeleteMessage
|
||||
|
||||
trans.commit();
|
||||
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Data changed for NotificationId: " << m_dataNotificationObject.id;
|
||||
|
||||
std::vector<Address> recipients = m_dataNotificationObject.recipientIds();
|
||||
Address sender = m_dataNotificationObject.sender();
|
||||
std::vector<Address> recipients = m_dataNotificationObject.recipientIds;
|
||||
Address sender = m_dataNotificationObject.sender;
|
||||
m_dataNotificationObject = toDdsData(dbDataNotification);
|
||||
m_dataNotificationObject.sender(sender);
|
||||
m_dataNotificationObject.sender = sender;
|
||||
|
||||
for (const Address &addr : qAsConst(recipients))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "addr="
|
||||
<< ", id: " << addr.id() << ", addressId: " << addr.addressId() << ", isDeleted: " << addr.isDeleted();
|
||||
<< ", id: " << addr.id << ", addressId: " << addr.addressId << ", isDeleted: " << addr.isDeleted;
|
||||
|
||||
if (addr.id() == dbDataAddr.id)
|
||||
m_dataNotificationObject.recipientIds().push_back(toDdsData(dbDataAddr));
|
||||
if (addr.id == dbDataAddr.id)
|
||||
m_dataNotificationObject.recipientIds.push_back(toDdsData(dbDataAddr));
|
||||
else
|
||||
m_dataNotificationObject.recipientIds().push_back(addr);
|
||||
m_dataNotificationObject.recipientIds.push_back(addr);
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id());
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id);
|
||||
} // end of updateObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Core::FunctionReplyObject ObjectNotification::deleteObject(const DeleteMessage &data, int notificationId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ObjectNotification::deleteObject"
|
||||
<< ", notificationId: " << notificationId << ", addressId: " << data.addressId() << ", operatorId: " << data.operatorId()
|
||||
<< ", workstationId: " << data.workstationId();
|
||||
<< ", notificationId: " << notificationId << ", addressId: " << data.addressId << ", operatorId: " << data.operatorId
|
||||
<< ", workstationId: " << data.workstationId;
|
||||
deleteMessage(data, notificationId);
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id());
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectNotification::removeObject()
|
||||
{
|
||||
if (!m_db->removeNomNotification(m_dataNotificationObject.id()))
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id(), tr_lts("dds", "NomNotification with id %1 can not be removed from DB"))
|
||||
.arg(m_dataNotificationObject.id());
|
||||
if (!m_db->removeNomNotification(m_dataNotificationObject.id))
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id, tr_lts("dds", "NomNotification with id %1 can not be removed from DB"))
|
||||
.arg(m_dataNotificationObject.id);
|
||||
|
||||
if (!m_ddsHandler->dts()->removeNomNotificationByKey(m_dataNotificationObject.id()))
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id(), tr_lts("dds", "NomNotification with id %1 can not be removed from DDS"))
|
||||
.arg(m_dataNotificationObject.id());
|
||||
if (!m_ddsHandler->dts()->removeNomNotificationByKey(m_dataNotificationObject.id))
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id, tr_lts("dds", "NomNotification with id %1 can not be removed from DDS"))
|
||||
.arg(m_dataNotificationObject.id);
|
||||
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id());
|
||||
return Core::FunctionReplyObject(m_dataNotificationObject.id);
|
||||
} // end of removeObject()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool ObjectNotification::isValid() const { return m_dataNotificationObject.id() > 0; } // end of isValid()
|
||||
bool ObjectNotification::isValid() const { return m_dataNotificationObject.id > 0; } // end of isValid()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ObjectNotification::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id();
|
||||
INFO_LOG(m_logger) << "Publish NomNotification-data to dds notificationId:" << m_dataNotificationObject.id;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataNotificationObject))
|
||||
WARNING_LOG(m_logger) << "Error publishing NomNotification-data to dds";
|
||||
@@ -345,20 +345,20 @@ Database::NomNotification ObjectNotification::toDbData(const NomNotification &dd
|
||||
{
|
||||
Database::NomNotification dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.exerciseId = ddsData.exerciseId();
|
||||
dbData.content = QString::fromStdString(ddsData.content());
|
||||
dbData.id = ddsData.id;
|
||||
dbData.exerciseId = ddsData.exerciseId;
|
||||
dbData.content = QString::fromStdString(ddsData.content);
|
||||
QString properties = contentArgsToJson();
|
||||
dbData.properties = properties;
|
||||
dbData.title = QString::fromStdString(ddsData.title());
|
||||
dbData.messageType = ddsData.messageType().underlying();
|
||||
dbData.notificationType = ddsData.notificationType().underlying();
|
||||
dbData.processTime = ddsData.processTime();
|
||||
dbData.processed = ddsData.processed();
|
||||
dbData.processedPriority = ddsData.processedPriority();
|
||||
dbData.expiryTime = ddsData.expiryTime();
|
||||
dbData.priorityId = ddsData.priority();
|
||||
dbData.timeStamp = ddsData.timeStamp();
|
||||
dbData.title = QString::fromStdString(ddsData.title);
|
||||
dbData.messageType = ddsData.messageType;
|
||||
dbData.notificationType = ddsData.notificationType;
|
||||
dbData.processTime = ddsData.processTime;
|
||||
dbData.processed = ddsData.processed;
|
||||
dbData.processedPriority = ddsData.processedPriority;
|
||||
dbData.expiryTime = ddsData.expiryTime;
|
||||
dbData.priorityId = ddsData.priority;
|
||||
dbData.timeStamp = ddsData.timeStamp;
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -369,20 +369,20 @@ NomNotification ObjectNotification::toDdsData(const Database::NomNotification &d
|
||||
{
|
||||
NomNotification ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.content(dbData.content.toStdString());
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.content = dbData.content.toStdString();
|
||||
std::vector< std::string > contentArgs = jsonToContentArgs(dbData.properties);
|
||||
ddsData.contentArgs(contentArgs);
|
||||
ddsData.title(dbData.title.toStdString());
|
||||
ddsData.messageType(static_cast<NotificationManagement::MessageType::inner_enum>(dbData.messageType));
|
||||
ddsData.notificationType(static_cast<NotificationManagement::NotificationType::inner_enum>(dbData.notificationType));
|
||||
ddsData.timeStamp(dbData.timeStamp);
|
||||
ddsData.priority(dbData.priorityId);
|
||||
ddsData.exerciseId(dbData.exerciseId);
|
||||
ddsData.expiryTime(dbData.expiryTime);
|
||||
ddsData.processTime(dbData.processTime);
|
||||
ddsData.processed(dbData.processed);
|
||||
ddsData.processedPriority(dbData.processedPriority.underlying());
|
||||
ddsData.contentArgs = contentArgs;
|
||||
ddsData.title = dbData.title.toStdString();
|
||||
ddsData.messageType = static_cast<NotificationManagement::MessageType>(dbData.messageType);
|
||||
ddsData.notificationType = static_cast<NotificationManagement::NotificationType>(dbData.notificationType);
|
||||
ddsData.timeStamp = dbData.timeStamp;
|
||||
ddsData.priority = dbData.priorityId;
|
||||
ddsData.exerciseId = dbData.exerciseId;
|
||||
ddsData.expiryTime = dbData.expiryTime;
|
||||
ddsData.processTime = dbData.processTime;
|
||||
ddsData.processed = dbData.processed;
|
||||
ddsData.processedPriority = dbData.processedPriority;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
@@ -393,14 +393,14 @@ Database::NomAddress ObjectNotification::toDbData(const Address &ddsData)
|
||||
{
|
||||
Database::NomAddress dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.addressId = ddsData.addressId();
|
||||
dbData.addressSubId = ddsData.addressSubId();
|
||||
dbData.addressSubSubId = ddsData.addressSubSubId();
|
||||
dbData.addressTypeId = ddsData.addressType().underlying();
|
||||
dbData.isRead = ddsData.isRead();
|
||||
dbData.isDeleted = ddsData.isDeleted();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.id = ddsData.id;
|
||||
dbData.addressId = ddsData.addressId;
|
||||
dbData.addressSubId = ddsData.addressSubId;
|
||||
dbData.addressSubSubId = ddsData.addressSubSubId;
|
||||
dbData.addressTypeId = ddsData.addressType;
|
||||
dbData.isRead = ddsData.isRead;
|
||||
dbData.isDeleted = ddsData.isDeleted;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -411,14 +411,14 @@ Address ObjectNotification::toDdsData(const Database::NomAddress &dbData)
|
||||
{
|
||||
Address ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.addressType(dbData.addressTypeId);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.addressId(dbData.addressId);
|
||||
ddsData.addressSubId(dbData.addressSubId);
|
||||
ddsData.addressSubSubId(dbData.addressSubSubId);
|
||||
ddsData.isRead(dbData.isRead);
|
||||
ddsData.isDeleted(dbData.isDeleted);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.addressType = dbData.addressTypeId;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.addressId = dbData.addressId;
|
||||
ddsData.addressSubId = dbData.addressSubId;
|
||||
ddsData.addressSubSubId = dbData.addressSubSubId;
|
||||
ddsData.isRead = dbData.isRead;
|
||||
ddsData.isDeleted = dbData.isDeleted;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ public:
|
||||
|
||||
Core::FunctionReplyObject setUsed(bool isUsed);
|
||||
|
||||
qint32 id() const { return m_dataNotificationObject.id(); }
|
||||
qint32 id() const { return m_dataNotificationObject.id; }
|
||||
NomNotification notification() const { return m_dataNotificationObject; }
|
||||
QString title() const { return QString::fromStdString(m_dataNotificationObject.title()); }
|
||||
QString title() const { return QString::fromStdString(m_dataNotificationObject.title); }
|
||||
|
||||
bool isValid() const;
|
||||
bool isUsed() const;
|
||||
|
||||
+38
-38
@@ -98,25 +98,25 @@ void PreTests::tryCreate()
|
||||
m_presentationId = -1;
|
||||
PresentationModifyRequest request;
|
||||
|
||||
request.name("Test Presentation");
|
||||
request.description("Description Presentation");
|
||||
request.operatorId(100);
|
||||
request.lastModified(QDateTime(QDate(2017,2,14), QTime(9,34)).toMSecsSinceEpoch());
|
||||
request.name = "Test Presentation";
|
||||
request.description = "Description Presentation";
|
||||
request.operatorId = 100;
|
||||
request.lastModified = QDateTime(QDate(2017,2,14), QTime(9,34)).toMSecsSinceEpoch();
|
||||
|
||||
std::vector<PresentationContent> vectorPc;
|
||||
|
||||
vectorPc.resize(2);
|
||||
vectorPc[0].presentationTopicType("pdf");
|
||||
vectorPc[0].channel("1V");
|
||||
vectorPc[0].duration(30);
|
||||
vectorPc[0].startTime(QDateTime(QDate(2017,2,13), QTime(12,34)).toMSecsSinceEpoch());
|
||||
vectorPc[0].presentationTopicType = "pdf";
|
||||
vectorPc[0].channel = "1V";
|
||||
vectorPc[0].duration = 30;
|
||||
vectorPc[0].startTime = QDateTime(QDate(2017,2,13), QTime(12,34)).toMSecsSinceEpoch();
|
||||
|
||||
vectorPc[1].presentationTopicType("text");
|
||||
vectorPc[1].channel("2V");
|
||||
vectorPc[1].duration(30);
|
||||
vectorPc[1].startTime(QDateTime(QDate(2017,2,14), QTime(9,45)).toMSecsSinceEpoch());
|
||||
vectorPc[1].presentationTopicType = "text";
|
||||
vectorPc[1].channel = "2V";
|
||||
vectorPc[1].duration = 30;
|
||||
vectorPc[1].startTime = QDateTime(QDate(2017,2,14), QTime(9,45)).toMSecsSinceEpoch();
|
||||
|
||||
request.content(vectorPc);
|
||||
request.content = vectorPc;
|
||||
|
||||
if (!m_ftc->presentationModifyRequest(request, this))
|
||||
{
|
||||
@@ -132,24 +132,24 @@ void PreTests::tryModify()
|
||||
{
|
||||
PresentationModifyRequest request;
|
||||
|
||||
request.id(m_presentationId);
|
||||
request.name("Presentation Modify");
|
||||
request.description("Description Presentation Modify");
|
||||
request.operatorId(102);
|
||||
request.lastModified(QDateTime(QDate(2017,2,16), QTime(10,34)).toMSecsSinceEpoch());
|
||||
request.id = m_presentationId;
|
||||
request.name = "Presentation Modify";
|
||||
request.description = "Description Presentation Modify";
|
||||
request.operatorId = 102;
|
||||
request.lastModified = QDateTime(QDate(2017,2,16), QTime(10,34)).toMSecsSinceEpoch();
|
||||
|
||||
std::vector<PresentationContent> &vectorPc = request.content();
|
||||
std::vector<PresentationContent> &vectorPc = request.content;
|
||||
|
||||
vectorPc.resize(2);
|
||||
vectorPc[0].presentationTopicType("pdf");
|
||||
vectorPc[0].channel("1V2");
|
||||
vectorPc[0].duration(60);
|
||||
vectorPc[0].startTime(QDateTime(QDate(2017,2,13), QTime(12,34)).toMSecsSinceEpoch());
|
||||
vectorPc[0].presentationTopicType = "pdf";
|
||||
vectorPc[0].channel = "1V2";
|
||||
vectorPc[0].duration = 60;
|
||||
vectorPc[0].startTime = QDateTime(QDate(2017,2,13), QTime(12,34)).toMSecsSinceEpoch();
|
||||
|
||||
vectorPc[1].presentationTopicType("text");
|
||||
vectorPc[1].channel("2V");
|
||||
vectorPc[1].duration(60);
|
||||
vectorPc[1].startTime(QDateTime(QDate(2017,2,14), QTime(9,45)).toMSecsSinceEpoch());
|
||||
vectorPc[1].presentationTopicType = "text";
|
||||
vectorPc[1].channel = "2V";
|
||||
vectorPc[1].duration = 60;
|
||||
vectorPc[1].startTime = QDateTime(QDate(2017,2,14), QTime(9,45)).toMSecsSinceEpoch();
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send modify request for presentation Id = " << m_presentationId;
|
||||
if (!m_ftc->presentationModifyRequest(request, this))
|
||||
@@ -166,7 +166,7 @@ void PreTests::tryDelete()
|
||||
{
|
||||
PresentationRemoveRequest request;
|
||||
|
||||
request.id(m_presentationId);
|
||||
request.id = m_presentationId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send delete request for presentation Id = " << m_presentationId;
|
||||
if (!m_ftc->presentationRemoveRequest(request, this))
|
||||
@@ -181,7 +181,7 @@ void PreTests::tryGetContent()
|
||||
{
|
||||
GetPresentationContentRequest request;
|
||||
|
||||
request.presentationId(m_presentationId);
|
||||
request.presentationId = m_presentationId;
|
||||
INFO_LOG(m_logger) << "trying to send content request for presentation Id = " << m_presentationId;
|
||||
|
||||
if (!m_ftc->getPresentationContentRequest(request, this))
|
||||
@@ -198,10 +198,10 @@ void PreTests::tryChangeStatus()
|
||||
{
|
||||
PresentationChangeStatusRequest request;
|
||||
|
||||
request.id(m_presentationId);
|
||||
request.operatorId(101);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.fileStatus(FileStatus::Deleted);
|
||||
request.id = m_presentationId;
|
||||
request.operatorId = 101;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
request.fileStatus = FileStatus::Deleted;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send change status request for presentation Id = " << m_presentationId;
|
||||
if (!m_ftc->presentationChangeStatusRequest(request, this))
|
||||
@@ -310,16 +310,16 @@ void PreTests::onGetPresentationContentReply(const GetPresentationContentReply &
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "END (onGetPresentationContentReply)";
|
||||
|
||||
if (replyObject.errorString().size() > 0)
|
||||
if (replyObject.errorString.size() > 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got onGetPresentationContentReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onGetPresentationContentReply error: " << replyObject.errorString;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "Got reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString()
|
||||
<< " and content size " << replyObject.content().size();
|
||||
INFO_LOG(m_logger) << "Got reply with id " << replyObject.id
|
||||
<< " and errorString " << replyObject.errorString
|
||||
<< " and content size " << replyObject.content.size();
|
||||
|
||||
if(m_testId == 0)
|
||||
QTimer::singleShot(0, this, &PreTests::tryDelete);
|
||||
|
||||
+16
-16
@@ -84,7 +84,7 @@ void HandlerPresentation::onPresentationModifyRequest(const rti::core::SampleIde
|
||||
const PresentationModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onPresentationModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? presentationModifyRequest(request) : presentationCreateRequest(request);
|
||||
auto ret = request.id > 0 ? presentationModifyRequest(request) : presentationCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->presentationModifyReply(cookie, ret);
|
||||
@@ -112,11 +112,11 @@ Core::FunctionReplyObject HandlerPresentation::presentationCreateRequest(const P
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject HandlerPresentation::presentationModifyRequest(const PresentationModifyRequest &request)
|
||||
{
|
||||
PresentationManagement::ObjectPresentation *ifs = m_objectPresentationMap.value(request.id());
|
||||
PresentationManagement::ObjectPresentation *ifs = m_objectPresentationMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Presentation with id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Presentation with id %1 not found")).arg(request.id);
|
||||
|
||||
int oldId = request.id();
|
||||
int oldId = request.id;
|
||||
Core::FunctionReplyObject ret = ifs->updateObject(request);
|
||||
if (ret.error())
|
||||
return ret;
|
||||
@@ -133,7 +133,7 @@ void HandlerPresentation::onPresentationRemoveRequest(const rti::core::SampleIde
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onPresentationRemoveRequest: " << request;
|
||||
Core::FunctionReplyObject ret;
|
||||
int presentationId = request.id();
|
||||
int presentationId = request.id;
|
||||
|
||||
// gest presentation object
|
||||
PresentationManagement::ObjectPresentation *ifs = m_objectPresentationMap.value(presentationId);
|
||||
@@ -146,7 +146,7 @@ void HandlerPresentation::onPresentationRemoveRequest(const rti::core::SampleIde
|
||||
|
||||
if (m_mainHandler->dds()->topicLockMaster()->isLocked(ifs->getData(), m_mainHandler->exerciseId()))
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Presentation '%1' is used by another user!")).arg(ifs->getName());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Presentation '%1' is used by another user!")).arg(ifs->getName());
|
||||
m_mainHandler->dds()->fts()->presentationRemoveReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -173,26 +173,26 @@ void HandlerPresentation::onGetPresentationContentRequest(const rti::core::Sampl
|
||||
Core::FunctionReplyObject fro;
|
||||
GetPresentationContentReply reply;
|
||||
|
||||
ObjectPresentation *ifs = m_objectPresentationMap.value(request.presentationId());
|
||||
ObjectPresentation *ifs = m_objectPresentationMap.value(request.presentationId);
|
||||
|
||||
if (ifs)
|
||||
{
|
||||
reply.id(ifs->getId());
|
||||
reply.id = ifs->getId();
|
||||
/*
|
||||
if (ifs->getContent().size() <= 0)
|
||||
fro = Core::FunctionReplyObject(request.presentationId(), tr_lts("dds", "No content for presentation "));
|
||||
fro = Core::FunctionReplyObject(request.presentationId, tr_lts("dds", "No content for presentation "));
|
||||
else
|
||||
*/
|
||||
reply.content(ifs->getContent());
|
||||
reply.content = ifs->getContent();
|
||||
}
|
||||
else
|
||||
fro = Core::FunctionReplyObject(request.presentationId(), tr_lts("dds", "No valid presentation id for retrieving presentation content"));
|
||||
fro = Core::FunctionReplyObject(request.presentationId, tr_lts("dds", "No valid presentation id for retrieving presentation content"));
|
||||
|
||||
if (fro.error())
|
||||
{
|
||||
reply.id(fro.id());
|
||||
reply.errorString(fro.str());
|
||||
reply.errorParams(fro.args());
|
||||
reply.id = fro.id();
|
||||
reply.errorString = fro.str();
|
||||
reply.errorParams = fro.args();
|
||||
}
|
||||
|
||||
m_mainHandler->dds()->fts()->getPresentationContentReply(cookie, reply);
|
||||
@@ -202,10 +202,10 @@ void HandlerPresentation::onGetPresentationContentRequest(const rti::core::Sampl
|
||||
void HandlerPresentation::onPresentationChangeStatusRequest(const rti::core::SampleIdentity &cookie,
|
||||
const PresentationChangeStatusRequest &request)
|
||||
{
|
||||
ObjectPresentation *ifs = m_objectPresentationMap.value(request.id());
|
||||
ObjectPresentation *ifs = m_objectPresentationMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Presentation with id %1 not found")).arg(request.id());
|
||||
Core::FunctionReplyObject ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "Presentation with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->fts()->presentationChangeStatusReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
+78
-78
@@ -36,7 +36,7 @@ ObjectPresentation::~ObjectPresentation()
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
bool ObjectPresentation::isValid() const
|
||||
{
|
||||
return m_data.id() > 0;
|
||||
return m_data.id > 0;
|
||||
}
|
||||
|
||||
void ObjectPresentation::addPresentationContent(PresentationContent &&data)
|
||||
@@ -50,12 +50,12 @@ Core::FunctionReplyObject ObjectPresentation::createObject(const PresentationMod
|
||||
m_data = Presentation();
|
||||
m_content.clear();
|
||||
|
||||
m_data.name(request.name());
|
||||
m_data.description(request.description());
|
||||
m_data.operatorId(request.operatorId());
|
||||
m_data.lastModified(request.lastModified());
|
||||
m_data.name = request.name;
|
||||
m_data.description = request.description;
|
||||
m_data.operatorId = request.operatorId;
|
||||
m_data.lastModified = request.lastModified;
|
||||
|
||||
m_content = request.content();
|
||||
m_content = request.content;
|
||||
//for(auto it = request.content().begin(); it != request.content().end(); ++it)
|
||||
// m_content.append(*it);
|
||||
|
||||
@@ -65,68 +65,68 @@ Core::FunctionReplyObject ObjectPresentation::createObject(const PresentationMod
|
||||
Database::PrePresentation dbData(toDbData(m_data));
|
||||
if (!m_mainHandler->db()->insert(dbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Presentation-data into database"));
|
||||
m_data.id(dbData.id);
|
||||
m_data.id = dbData.id;
|
||||
|
||||
// Insert PresentationContent
|
||||
for (PresentationContent &conData : m_content)
|
||||
{
|
||||
conData.presentationId(m_data.id());
|
||||
conData.presentationId = m_data.id;
|
||||
|
||||
Database::PrePresentationContent conDbData = toDbData(conData);
|
||||
conDbData.id = 0;
|
||||
conDbData.presentationId = m_data.id();
|
||||
conDbData.presentationId = m_data.id;
|
||||
|
||||
if (!m_mainHandler->db()->insert(conDbData))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting PresentationContent-data into database"));
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New presentation content id : " << conDbData.id;
|
||||
conData.id(conDbData.id);
|
||||
conData.id = conDbData.id;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "New Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New Id: " << m_data.id;
|
||||
trans.commit();
|
||||
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectPresentation::updateObject(const PresentationModifyRequest &request)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Object not valid/blocked"));
|
||||
|
||||
m_data.id(request.id());
|
||||
m_data.name(request.name());
|
||||
m_data.description(request.description());
|
||||
m_data.operatorId(request.operatorId());
|
||||
m_data.lastModified(request.lastModified());
|
||||
m_data.fileStatus(request.fileStatus());
|
||||
m_data.id = request.id;
|
||||
m_data.name = request.name;
|
||||
m_data.description = request.description;
|
||||
m_data.operatorId = request.operatorId;
|
||||
m_data.lastModified = request.lastModified;
|
||||
m_data.fileStatus = request.fileStatus;
|
||||
|
||||
DBTransaction trans(m_mainHandler->db()->database());
|
||||
|
||||
Database::PrePresentation dbData(toDbData(m_data));
|
||||
if (!m_mainHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Error updating Presentation-data into database"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating Presentation-data into database"));
|
||||
|
||||
for (const auto &content : qAsConst(m_content))
|
||||
{
|
||||
if (m_mainHandler->db()->removePrePresentationContent(content.id()))
|
||||
DEBUG_LOG(m_logger) << "Removed presentation content id " << content.id();
|
||||
if (m_mainHandler->db()->removePrePresentationContent(content.id))
|
||||
DEBUG_LOG(m_logger) << "Removed presentation content id " << content.id;
|
||||
else
|
||||
ERROR_LOG(m_logger) << "Failed to remove presentation content id " << content.id();
|
||||
ERROR_LOG(m_logger) << "Failed to remove presentation content id " << content.id;
|
||||
}
|
||||
|
||||
m_content = request.content();
|
||||
m_content = request.content;
|
||||
for (PresentationContent &conData : m_content)
|
||||
{
|
||||
conData.presentationId(m_data.id());
|
||||
conData.presentationId = m_data.id;
|
||||
|
||||
Database::PrePresentationContent conDbData = toDbData(conData);
|
||||
conDbData.presentationId = m_data.id();
|
||||
conDbData.presentationId = m_data.id;
|
||||
conDbData.id = 0;
|
||||
|
||||
if (!m_mainHandler->db()->insert(conDbData))
|
||||
@@ -134,7 +134,7 @@ Core::FunctionReplyObject ObjectPresentation::updateObject(const PresentationMod
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "New presentation content id : " << conDbData.id;
|
||||
conData.id(conDbData.id);
|
||||
conData.id = conDbData.id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -143,17 +143,17 @@ Core::FunctionReplyObject ObjectPresentation::updateObject(const PresentationMod
|
||||
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectPresentation::removeObject()
|
||||
{
|
||||
// remove also presentationContent data via foreign key
|
||||
if (!m_mainHandler->db()->removePrePresentation(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Presentation with id %1 can not be removed from DB")).arg(m_data.id());
|
||||
if (!m_mainHandler->db()->removePrePresentation(m_data.id))
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Presentation with id %1 can not be removed from DB")).arg(m_data.id);
|
||||
|
||||
int id = m_data.id();
|
||||
int id = m_data.id;
|
||||
m_content.clear();
|
||||
m_data = Presentation();
|
||||
|
||||
@@ -164,24 +164,24 @@ Core::FunctionReplyObject ObjectPresentation::removeObject()
|
||||
Core::FunctionReplyObject ObjectPresentation::changeStatus(const PresentationChangeStatusRequest &request)
|
||||
{
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Trying to update an already removed Presentation object"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Trying to update an already removed Presentation object"));
|
||||
|
||||
m_data.fileStatus(request.fileStatus());
|
||||
m_data.operatorId(request.operatorId());
|
||||
m_data.lastModified(request.lastModified());
|
||||
m_data.fileStatus = request.fileStatus;
|
||||
m_data.operatorId = request.operatorId;
|
||||
m_data.lastModified = request.lastModified;
|
||||
Database::PrePresentation dbData(toDbData(m_data));
|
||||
if (!m_mainHandler->db()->update(dbData))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "Error updating Presentation-data into database"));
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating Presentation-data into database"));
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
void ObjectPresentation::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish Presentation-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish Presentation-data to dds (" << m_data.id << ") ...";
|
||||
|
||||
m_mainHandler->dds()->dts()->publish(m_data);
|
||||
}
|
||||
@@ -195,12 +195,12 @@ Database::PrePresentation ObjectPresentation::toDbData(const Presentation &ddsDa
|
||||
{
|
||||
Database::PrePresentation dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.name = QString::fromStdString(ddsData.name());
|
||||
dbData.description = QString::fromStdString(ddsData.description());
|
||||
dbData.lastModified = ddsData.lastModified();
|
||||
dbData.operatorId = ddsData.operatorId();
|
||||
dbData.fileStatusId = ddsData.fileStatus();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.name = QString::fromStdString(ddsData.name);
|
||||
dbData.description = QString::fromStdString(ddsData.description);
|
||||
dbData.lastModified = ddsData.lastModified;
|
||||
dbData.operatorId = ddsData.operatorId;
|
||||
dbData.fileStatusId = ddsData.fileStatus;
|
||||
|
||||
return dbData;
|
||||
}
|
||||
@@ -211,16 +211,16 @@ Presentation ObjectPresentation::toDdsData(const Database::PrePresentation &dbDa
|
||||
{
|
||||
Presentation ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.name(dbData.name.toStdString());
|
||||
ddsData.description(dbData.description.toStdString());
|
||||
ddsData.operatorId(dbData.operatorId);
|
||||
ddsData.lastModified(dbData.lastModified);
|
||||
ddsData.fileStatus(dbData.fileStatusId);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.name = dbData.name.toStdString();
|
||||
ddsData.description = dbData.description.toStdString();
|
||||
ddsData.operatorId = dbData.operatorId;
|
||||
ddsData.lastModified = dbData.lastModified;
|
||||
ddsData.fileStatus = dbData.fileStatusId;
|
||||
|
||||
// init data not in db
|
||||
ddsData.isDeleted(false);
|
||||
ddsData.isUsed(false);
|
||||
ddsData.isDeleted = false;
|
||||
ddsData.isUsed = false;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -228,19 +228,19 @@ Presentation ObjectPresentation::toDdsData(const Database::PrePresentation &dbDa
|
||||
Database::PrePresentationContent ObjectPresentation::toDbData(const PresentationContent &ddsData)
|
||||
{
|
||||
Database::PrePresentationContent dbData;
|
||||
dbData.id = ddsData.id();
|
||||
dbData.presentationId = ddsData.presentationId();
|
||||
dbData.presentationTopicType = QString::fromStdString(ddsData.presentationTopicType());
|
||||
dbData.channel = QString::fromStdString(ddsData.channel());
|
||||
dbData.description = QString::fromStdString(ddsData.description());
|
||||
dbData.duration = ddsData.duration();
|
||||
dbData.startTime = ddsData.startTime();
|
||||
dbData.attributes = QString::fromStdString(ddsData.attributes());
|
||||
dbData.x = ddsData.x();
|
||||
dbData.y = ddsData.y();
|
||||
dbData.width = ddsData.width();
|
||||
dbData.height = ddsData.height();
|
||||
dbData.index = ddsData.index();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.presentationId = ddsData.presentationId;
|
||||
dbData.presentationTopicType = QString::fromStdString(ddsData.presentationTopicType);
|
||||
dbData.channel = QString::fromStdString(ddsData.channel);
|
||||
dbData.description = QString::fromStdString(ddsData.description);
|
||||
dbData.duration = ddsData.duration;
|
||||
dbData.startTime = ddsData.startTime;
|
||||
dbData.attributes = QString::fromStdString(ddsData.attributes);
|
||||
dbData.x = ddsData.x;
|
||||
dbData.y = ddsData.y;
|
||||
dbData.width = ddsData.width;
|
||||
dbData.height = ddsData.height;
|
||||
dbData.index = ddsData.index;
|
||||
|
||||
return dbData;
|
||||
}
|
||||
@@ -248,19 +248,19 @@ Database::PrePresentationContent ObjectPresentation::toDbData(const Presentation
|
||||
PresentationContent ObjectPresentation::toDdsData(const Database::PrePresentationContent &dbData)
|
||||
{
|
||||
PresentationContent ddsData;
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.presentationId(dbData.presentationId);
|
||||
ddsData.presentationTopicType(dbData.presentationTopicType.toStdString());
|
||||
ddsData.channel(dbData.channel.toStdString());
|
||||
ddsData.description(dbData.description.toStdString());
|
||||
ddsData.startTime(dbData.startTime);
|
||||
ddsData.attributes(dbData.attributes.toStdString());
|
||||
ddsData.duration(dbData.duration);
|
||||
ddsData.x(dbData.x);
|
||||
ddsData.y(dbData.y);
|
||||
ddsData.width(dbData.width);
|
||||
ddsData.height(dbData.height);
|
||||
ddsData.index(dbData.index);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.presentationId = dbData.presentationId;
|
||||
ddsData.presentationTopicType = dbData.presentationTopicType.toStdString();
|
||||
ddsData.channel = dbData.channel.toStdString();
|
||||
ddsData.description = dbData.description.toStdString();
|
||||
ddsData.startTime = dbData.startTime;
|
||||
ddsData.attributes = dbData.attributes.toStdString();
|
||||
ddsData.duration = dbData.duration;
|
||||
ddsData.x = dbData.x;
|
||||
ddsData.y = dbData.y;
|
||||
ddsData.width = dbData.width;
|
||||
ddsData.height = dbData.height;
|
||||
ddsData.index = dbData.index;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ public:
|
||||
Core::FunctionReplyObject removeObject();
|
||||
Core::FunctionReplyObject changeStatus(const PresentationChangeStatusRequest &request);
|
||||
|
||||
qint32 getId() const { return m_data.id(); }
|
||||
QString getName() const { return QString::fromStdString(m_data.name()); }
|
||||
qint32 getId() const { return m_data.id; }
|
||||
QString getName() const { return QString::fromStdString(m_data.name); }
|
||||
const std::vector<PresentationContent> &getContent() const { return m_content; }
|
||||
const Presentation &getData() const { return m_data; }
|
||||
|
||||
|
||||
+6
-6
@@ -96,8 +96,8 @@ void PdmTests::tryGetAllVulnerabilityKinds()
|
||||
m_id = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
const ProjectDataManagement::VulnerabilityClass &vc = it.value().vulnerabilityClassId();
|
||||
INFO_LOG(m_logger) << "VulnerabilityKind(" << it.key() << ") : " << it.value().name()
|
||||
const ProjectDataManagement::VulnerabilityClass &vc = it.value().vulnerabilityClassId;
|
||||
INFO_LOG(m_logger) << "VulnerabilityKind(" << it.key() << ") : " << it.value().name
|
||||
<< ", translation " << m_dtc->trVulnerabilityKindName(it.key(), vc);
|
||||
}
|
||||
}
|
||||
@@ -111,15 +111,15 @@ void PdmTests::tryGetVulnerabilityKind()
|
||||
INFO_LOG(m_logger) << "trying get itemData for Vulnerability kind " << m_id;
|
||||
ProjectDataManagement::VulnerabilityKind data = m_dtc->vulnerabilityKind(m_id);
|
||||
|
||||
if (data.taVulnerabilityKind() <= 0)
|
||||
if (data.taVulnerabilityKind <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for id " << m_id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
const ProjectDataManagement::VulnerabilityClass &vc = data.vulnerabilityClassId();
|
||||
INFO_LOG(m_logger) << "## VulnerabilityKind: (" << data.taVulnerabilityKind() << "), name: " << data.name()
|
||||
const ProjectDataManagement::VulnerabilityClass &vc = data.vulnerabilityClassId;
|
||||
INFO_LOG(m_logger) << "## VulnerabilityKind: (" << data.taVulnerabilityKind << "), name: " << data.name
|
||||
<< ", translation " << m_dtc->trVulnerabilityKindName(m_id, vc);
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void PdmTests::tryGetAllBiteComponentTexts()
|
||||
INFO_LOG(m_logger) << "Amount of bite component texts = " << map.size();
|
||||
m_id = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
INFO_LOG(m_logger) << "BiteComponent(" << it.key() << ") : " << it.value().name()
|
||||
INFO_LOG(m_logger) << "BiteComponent(" << it.key() << ") : " << it.value().name
|
||||
<< ", translation " << m_dtc->trBiteComponentTextName(it.key());
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -23,26 +23,26 @@ ChargeTypeRename::ChargeTypeRename(const std::shared_ptr<DdsHandler> &dds, const
|
||||
|
||||
void ChargeTypeRename::onUpdateChargeNamesRequest(const rti::core::SampleIdentity &cookie, const UpdateChargeNamesRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject fro(request.id());
|
||||
if (request.id() <= 0)
|
||||
Core::FunctionReplyObject fro(request.id);
|
||||
if (request.id <= 0)
|
||||
{
|
||||
fro = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Name update on ChargeType, but no Charge Type Id given"));
|
||||
fro = Core::FunctionReplyObject(request.id, tr_lts("dds", "Name update on ChargeType, but no Charge Type Id given"));
|
||||
m_dds->fts()->updateChargeNamesReply(cookie, fro);
|
||||
return;
|
||||
}
|
||||
Database::PdmChargeType ct;
|
||||
if (!m_db->selectPdmChargeType(request.id(), ct))
|
||||
if (!m_db->selectPdmChargeType(request.id, ct))
|
||||
{
|
||||
fro = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Name update on ChargeType, Charge Type could not be fetched from DB"));
|
||||
fro = Core::FunctionReplyObject(request.id, tr_lts("dds", "Name update on ChargeType, Charge Type could not be fetched from DB"));
|
||||
m_dds->fts()->updateChargeNamesReply(cookie, fro);
|
||||
return;
|
||||
}
|
||||
ct.name = QString::fromStdString(request.name());
|
||||
ct.shortName = QString::fromStdString(request.shortName());
|
||||
ct.name = QString::fromStdString(request.name);
|
||||
ct.shortName = QString::fromStdString(request.shortName);
|
||||
|
||||
if (!m_db->update(ct))
|
||||
{
|
||||
fro = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Name update on ChargeType, Cannot update DB (select worked before)"));
|
||||
fro = Core::FunctionReplyObject(request.id, tr_lts("dds", "Name update on ChargeType, Cannot update DB (select worked before)"));
|
||||
m_dds->fts()->updateChargeNamesReply(cookie, fro);
|
||||
return;
|
||||
}
|
||||
@@ -55,12 +55,12 @@ void ChargeTypeRename::onUpdateChargeNamesRequest(const rti::core::SampleIdentit
|
||||
void ChargeTypeRename::onUpdateChargeTypeRequest(const rti::core::SampleIdentity &cookie, const ChargeType &request)
|
||||
{
|
||||
Database::PdmChargeType ct;
|
||||
ct.disEntity = QString::fromStdString(request.disEntity());
|
||||
ct.id = request.id();
|
||||
ct.name = QString::fromStdString(request.name());
|
||||
ct.predefinedName = QString::fromStdString(request.predefinedName());
|
||||
ct.properties = QString::fromStdString(request.properties());
|
||||
ct.shortName = QString::fromStdString(request.shortName());
|
||||
ct.disEntity = QString::fromStdString(request.disEntity);
|
||||
ct.id = request.id;
|
||||
ct.name = QString::fromStdString(request.name);
|
||||
ct.predefinedName = QString::fromStdString(request.predefinedName);
|
||||
ct.properties = QString::fromStdString(request.properties);
|
||||
ct.shortName = QString::fromStdString(request.shortName);
|
||||
m_db->update(ct);
|
||||
m_dds->fts()->updateChargeTypeReply(cookie, Core::FunctionReplyObject(ct.id));
|
||||
m_dds->dts()->publish(request);
|
||||
|
||||
+139
-139
@@ -18,13 +18,13 @@ namespace Database
|
||||
inline BuildingChargeEffect convert(const PdmBuildingChargeEffect &data)
|
||||
{
|
||||
BuildingChargeEffect ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.chargeTypeId(data.chargeTypeId);
|
||||
ddsData.destructiveFactor(data.destructiveFactor);
|
||||
ddsData.penetrationFactor(data.penetrationFactor);
|
||||
ddsData.hitSound(data.hitSound);
|
||||
ddsData.difcueLight(data.difcueLight);
|
||||
ddsData.difcuePyro(data.difcuePyro);
|
||||
ddsData.id = data.id;
|
||||
ddsData.chargeTypeId = data.chargeTypeId;
|
||||
ddsData.destructiveFactor = data.destructiveFactor;
|
||||
ddsData.penetrationFactor = data.penetrationFactor;
|
||||
ddsData.hitSound = data.hitSound;
|
||||
ddsData.difcueLight = data.difcueLight;
|
||||
ddsData.difcuePyro = data.difcuePyro;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -32,14 +32,14 @@ inline BuildingChargeEffect convert(const PdmBuildingChargeEffect &data)
|
||||
inline ChargeType convert(const PdmChargeType &data)
|
||||
{
|
||||
ChargeType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.shortName(data.shortName.toStdString());
|
||||
ddsData.predefinedName(data.predefinedName.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.legacyId(data.chargeLegacyId);
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.shortName = data.shortName.toStdString();
|
||||
ddsData.predefinedName = data.predefinedName.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
ddsData.legacyId = data.chargeLegacyId;
|
||||
if (!data.disEntity.isEmpty())
|
||||
ddsData.disEntity(data.disEntity.toStdString());
|
||||
ddsData.disEntity = data.disEntity.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -47,24 +47,24 @@ inline ChargeType convert(const PdmChargeType &data)
|
||||
inline SanitationMaterial convert(const PdmSanitationMaterial &data)
|
||||
{
|
||||
SanitationMaterial ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.description(data.description.toStdString());
|
||||
ddsData.version(data.version.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.description = data.description.toStdString();
|
||||
ddsData.version = data.version.toStdString();
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
inline SanitationProcedure convert(const PdmSanitationProcedures &data)
|
||||
{
|
||||
SanitationProcedure ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.longName(data.longName.toStdString());
|
||||
ddsData.type(data.type.toStdString());
|
||||
ddsData.typeId(data.typeId);
|
||||
ddsData.minimumQualification(data.minimumQualification);
|
||||
ddsData.dataCode(data.dataCode);
|
||||
ddsData.version(data.version.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.longName = data.longName.toStdString();
|
||||
ddsData.type = data.type.toStdString();
|
||||
ddsData.pdm_typeId = data.typeId;
|
||||
ddsData.minimumQualification = data.minimumQualification;
|
||||
ddsData.dataCode = data.dataCode;
|
||||
ddsData.version = data.version.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -72,12 +72,12 @@ inline SanitationProcedure convert(const PdmSanitationProcedures &data)
|
||||
inline SanitationInjury convert(const PdmSanitationInjury &data)
|
||||
{
|
||||
SanitationInjury ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.kind(data.kind);
|
||||
ddsData.place1(data.place1);
|
||||
ddsData.place2(data.place2);
|
||||
ddsData.vbg(data.vbg);
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.kind = data.kind;
|
||||
ddsData.place1 = data.place1;
|
||||
ddsData.place2 = data.place2;
|
||||
ddsData.vbg = data.vbg;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -85,27 +85,27 @@ inline SanitationInjury convert(const PdmSanitationInjury &data)
|
||||
inline SanitationInjuryKind convert(const PdmSanitationInjuryKind &data)
|
||||
{
|
||||
SanitationInjuryKind ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.version(data.version.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.version = data.version.toStdString();
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
inline SanitationInjuryPlace1 convert(const PdmSanitationInjuryPlace1 &data)
|
||||
{
|
||||
SanitationInjuryPlace1 ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.version(data.version.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.version = data.version.toStdString();
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
inline SanitationInjuryPlace2 convert(const PdmSanitationInjuryPlace2 &data)
|
||||
{
|
||||
SanitationInjuryPlace2 ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.version(data.version.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.version = data.version.toStdString();
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ inline SanitationInjuryPlace2 convert(const PdmSanitationInjuryPlace2 &data)
|
||||
inline GearTypeChargeType convert(const PdmGearTypeChargeType &data)
|
||||
{
|
||||
GearTypeChargeType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.gearTypeId(data.gearTypeId);
|
||||
ddsData.chargeTypeId(data.chargeTypeId);
|
||||
ddsData.maxRange(data.maxRange);
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.gearTypeId = data.gearTypeId;
|
||||
ddsData.chargeTypeId = data.chargeTypeId;
|
||||
ddsData.maxRange = data.maxRange;
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -125,11 +125,11 @@ inline GearTypeChargeType convert(const PdmGearTypeChargeType &data)
|
||||
inline GearType convert(const PdmGearType &data)
|
||||
{
|
||||
GearType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.gearClassId(data.gearClassId);
|
||||
ddsData.tasCode(data.tasCode);
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.gearClassId = data.gearClassId;
|
||||
ddsData.tasCode = data.tasCode;
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -137,10 +137,10 @@ inline GearType convert(const PdmGearType &data)
|
||||
inline IgniterType convert(const PdmIgniterType &data)
|
||||
{
|
||||
IgniterType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.shortName(data.shortName.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.shortName = data.shortName.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -148,10 +148,10 @@ inline IgniterType convert(const PdmIgniterType &data)
|
||||
inline IgniterFunction convert(const PdmIgniterFunction &data)
|
||||
{
|
||||
IgniterFunction ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.shortName(data.shortName.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.shortName = data.shortName.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -159,10 +159,10 @@ inline IgniterFunction convert(const PdmIgniterFunction &data)
|
||||
inline LoadType convert(const PdmLoadType &data)
|
||||
{
|
||||
LoadType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.shortName(data.shortName.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.shortName = data.shortName.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -170,16 +170,16 @@ inline LoadType convert(const PdmLoadType &data)
|
||||
inline ChargeTypeIgniterTypeIgniterFunction convert(const PdmChargeTypeIgniterTypeIgniterFunction &data)
|
||||
{
|
||||
ChargeTypeIgniterTypeIgniterFunction ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.chargeTypeId(data.chargeTypeId);
|
||||
ddsData.igniterTypeId(data.igniterTypeId);
|
||||
ddsData.igniterFunctionId(data.igniterFunctionId);
|
||||
ddsData.igniterFunctionBaseId(data.igniterFunctionBaseId);
|
||||
ddsData.impactArea(data.impactArea.toStdString());
|
||||
ddsData.impactRadius(data.impactRadius);
|
||||
ddsData.hazardDistance(data.hazardDistance);
|
||||
ddsData.chargeLegacyId(data.chargeLegacyId);
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.chargeTypeId = data.chargeTypeId;
|
||||
ddsData.igniterTypeId = data.igniterTypeId;
|
||||
ddsData.igniterFunctionId = data.igniterFunctionId;
|
||||
ddsData.igniterFunctionBaseId = data.igniterFunctionBaseId;
|
||||
ddsData.impactArea = data.impactArea.toStdString();
|
||||
ddsData.impactRadius = data.impactRadius;
|
||||
ddsData.hazardDistance = data.hazardDistance;
|
||||
ddsData.chargeLegacyId = data.chargeLegacyId;
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -187,11 +187,11 @@ inline ChargeTypeIgniterTypeIgniterFunction convert(const PdmChargeTypeIgniterTy
|
||||
inline ChargeTypeLoadType convert(const PdmChargeTypeLoadType &data)
|
||||
{
|
||||
ChargeTypeLoadType ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.chargeTypeId(data.chargeTypeId);
|
||||
ddsData.loadTypeId(data.loadTypeId);
|
||||
ddsData.numbers(data.numbers());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.chargeTypeId = data.chargeTypeId;
|
||||
ddsData.loadTypeId = data.loadTypeId;
|
||||
ddsData.numbers = data.numbers();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -199,10 +199,10 @@ inline ChargeTypeLoadType convert(const PdmChargeTypeLoadType &data)
|
||||
inline LanguageHmi convert(const PdmLanguage &data)
|
||||
{
|
||||
LanguageHmi ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.dbLocale(data.dbLocale.toStdString());
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.isoCode(data.isoCode.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.dbLocale = data.dbLocale.toStdString();
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.isoCode = data.isoCode.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -210,9 +210,9 @@ inline LanguageHmi convert(const PdmLanguage &data)
|
||||
inline LanguageXdu convert(const PdmLanguageXdu &data)
|
||||
{
|
||||
LanguageXdu ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.isoCode(data.isoCode.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.isoCode = data.isoCode.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -220,16 +220,16 @@ inline LanguageXdu convert(const PdmLanguageXdu &data)
|
||||
inline RadioGroup convert(const PdmRadioGroup &data)
|
||||
{
|
||||
RadioGroup ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.issi(data.issi);
|
||||
ddsData.group_issi1(data.groupIssi1);
|
||||
ddsData.group_issi2(data.groupIssi2);
|
||||
ddsData.base_group(data.baseGroup);
|
||||
ddsData.radioHostname(data.radioHostname.toStdString());
|
||||
ddsData.radioPort(data.radioPort);
|
||||
ddsData.radioBackupHostname(data.radioBackupHostname.toStdString());
|
||||
ddsData.radioBackupPort(data.radioBackupPort);
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.issi = data.issi;
|
||||
ddsData.group_issi1 = data.groupIssi1;
|
||||
ddsData.group_issi2 = data.groupIssi2;
|
||||
ddsData.base_group = data.baseGroup;
|
||||
ddsData.radioHostname = data.radioHostname.toStdString();
|
||||
ddsData.radioPort = data.radioPort;
|
||||
ddsData.radioBackupHostname = data.radioBackupHostname.toStdString();
|
||||
ddsData.radioBackupPort = data.radioBackupPort;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -237,11 +237,11 @@ inline RadioGroup convert(const PdmRadioGroup &data)
|
||||
inline VulnerabilityKind convert(const PdmVulnerabilityKind &data)
|
||||
{
|
||||
VulnerabilityKind ddsData;
|
||||
ddsData.id(data.taVulnerabilityKind); // in db there is no id anymore, IO 2021-03-10
|
||||
ddsData.playerTypeClassId(data.playerTypeClassId);
|
||||
ddsData.taVulnerabilityKind(data.taVulnerabilityKind);
|
||||
ddsData.vulnerabilityClassId(data.vulnerabilityClassId);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.id = data.taVulnerabilityKind; // in db there is no id anymore, IO 2021-03-10
|
||||
ddsData.playerTypeClassId = data.playerTypeClassId;
|
||||
ddsData.taVulnerabilityKind = data.taVulnerabilityKind;
|
||||
ddsData.vulnerabilityClassId = data.vulnerabilityClassId;
|
||||
ddsData.name = data.name.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -249,10 +249,10 @@ inline VulnerabilityKind convert(const PdmVulnerabilityKind &data)
|
||||
inline FirePurpose convert(const PdmFirePurpose &data)
|
||||
{
|
||||
FirePurpose ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.description(data.description.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.description = data.description.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -260,12 +260,12 @@ inline FirePurpose convert(const PdmFirePurpose &data)
|
||||
inline NuclearPreset convert(const PdmNuclearPreset &data)
|
||||
{
|
||||
NuclearPreset ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.detonationValue(data.detonationValue);
|
||||
ddsData.impactRadius(data.impactRadius);
|
||||
ddsData.borderLengthInner(data.borderLengthInner);
|
||||
ddsData.borderLengthOuter(data.borderLengthOuter);
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.detonationValue = data.detonationValue;
|
||||
ddsData.impactRadius = data.impactRadius;
|
||||
ddsData.borderLengthInner = data.borderLengthInner;
|
||||
ddsData.borderLengthOuter = data.borderLengthOuter;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -273,11 +273,11 @@ inline NuclearPreset convert(const PdmNuclearPreset &data)
|
||||
inline CanComponentString convert(const PdmCanComponentString &data)
|
||||
{
|
||||
CanComponentString ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.bitMask(data.bitMask);
|
||||
ddsData.canDeviceId(data.canDeviceId);
|
||||
ddsData.subDeviceId(data.subDeviceId);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.pdm_bitMask = data.bitMask;
|
||||
ddsData.canDeviceId = data.canDeviceId;
|
||||
ddsData.subDeviceId = data.subDeviceId;
|
||||
ddsData.name = data.name.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -285,11 +285,11 @@ inline CanComponentString convert(const PdmCanComponentString &data)
|
||||
inline BiteComponentText convert(const PdmBiteComponentText &data)
|
||||
{
|
||||
BiteComponentText ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.canDeviceId(data.canDeviceId);
|
||||
ddsData.subDeviceId(data.subDeviceId);
|
||||
ddsData.errorNumber(data.errorNumber);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.canDeviceId = data.canDeviceId;
|
||||
ddsData.subDeviceId = data.subDeviceId;
|
||||
ddsData.errorNumber = data.errorNumber;
|
||||
ddsData.name = data.name.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -297,10 +297,10 @@ inline BiteComponentText convert(const PdmBiteComponentText &data)
|
||||
inline EquipmentSystemEventFilter convert(const PdmEquipmentSystemEventFilter &data)
|
||||
{
|
||||
EquipmentSystemEventFilter ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.equipmentFunctionId(data.equipmentFunctionalId);
|
||||
ddsData.subDeviceId(data.subDeviceId);
|
||||
ddsData.deviceSpecificCode(data.deviceSpecificCode);
|
||||
ddsData.id = data.id;
|
||||
ddsData.equipmentFunctionId = data.equipmentFunctionalId;
|
||||
ddsData.subDeviceId = data.subDeviceId;
|
||||
ddsData.deviceSpecificCode = data.deviceSpecificCode;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -308,9 +308,9 @@ inline EquipmentSystemEventFilter convert(const PdmEquipmentSystemEventFilter &d
|
||||
inline EventFilterHgrMineSearch convert(const PdmEventFilterHgrMineSearch &data)
|
||||
{
|
||||
EventFilterHgrMineSearch ddsData;
|
||||
ddsData.id(data.id);
|
||||
ddsData.chargeTypeId(data.chargeTypeId);
|
||||
ddsData.hgrMineSearchFilterType(data.hgrMineSearchFilterTypeId);
|
||||
ddsData.id = data.id;
|
||||
ddsData.chargeTypeId = data.chargeTypeId;
|
||||
ddsData.hgrMineSearchFilterType = data.hgrMineSearchFilterTypeId;
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -319,10 +319,10 @@ inline TargetType convert(const PdmTargetType &data)
|
||||
{
|
||||
TargetType ddsData;
|
||||
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.abbreviation(data.abbreviation.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.abbreviation = data.abbreviation.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -331,10 +331,10 @@ inline TargetSubType convert(const PdmTargetSubType &data)
|
||||
{
|
||||
TargetSubType ddsData;
|
||||
|
||||
ddsData.id(data.id);
|
||||
ddsData.name(data.name.toStdString());
|
||||
ddsData.abbreviation(data.abbreviation.toStdString());
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.name = data.name.toStdString();
|
||||
ddsData.abbreviation = data.abbreviation.toStdString();
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
@@ -342,10 +342,10 @@ inline TargetTypeTargetSubType convert(const PdmTargetTypeTargetSubType &data)
|
||||
{
|
||||
TargetTypeTargetSubType ddsData;
|
||||
|
||||
ddsData.id(data.id);
|
||||
ddsData.targetTypeId(data.targetTypeId);
|
||||
ddsData.targetSubTypeId(data.targetSubtypeId);
|
||||
ddsData.properties(data.properties.toStdString());
|
||||
ddsData.id = data.id;
|
||||
ddsData.targetTypeId = data.targetTypeId;
|
||||
ddsData.targetSubTypeId = data.targetSubtypeId;
|
||||
ddsData.properties = data.properties.toStdString();
|
||||
|
||||
return ddsData;
|
||||
}
|
||||
|
||||
+48
-40
@@ -65,7 +65,7 @@ void DtcImplCustom::fillChargeTypeIgniterTypeIgniterFunctionProps()
|
||||
props.chargeTypeId = ctitif.chargeTypeId;
|
||||
props.igniterTypeId = ctitif.igniterTypeId;
|
||||
props.igniterFunctionId = ctitif.igniterFunctionId;
|
||||
props.igniterFunctionBase = ctitif.igniterFunctionBase;
|
||||
props.igniterFunctionBase = ctitif.igniterFunctionBaseId;
|
||||
props.impactRadius = ctitif.impactRadius;
|
||||
props.hazardDistance = ctitif.hazardDistance;
|
||||
props.chargeLegacyId = ctitif.chargeLegacyId;
|
||||
@@ -210,16 +210,16 @@ void DtcImplCustom::mergeProperties(QHash<int, ChargeTypeIgniterTypeIgniterFunct
|
||||
|
||||
void DtcImplCustom::onChargeTypeChanged(const ChargeType &ct)
|
||||
{
|
||||
if (ct.id() <= 0)
|
||||
if (ct.id <= 0)
|
||||
return;
|
||||
|
||||
QHash<int, ChargeTypeIgniterTypeIgniterFunctionProps>::iterator it;
|
||||
for (it = m_ctItIfProps.begin(); it != m_ctItIfProps.end(); ++it)
|
||||
{
|
||||
if (it->chargeTypeId != ct.id())
|
||||
if (it->chargeTypeId != ct.id)
|
||||
continue;
|
||||
|
||||
QJsonObject ctProps = propertiesToJson(ct.properties());
|
||||
QJsonObject ctProps = propertiesToJson(ct.properties);
|
||||
QJsonObject itProps = propertiesToJson(igniterType(it->igniterTypeId).properties);
|
||||
QJsonObject ifProps = propertiesToJson(igniterFunction(it->igniterFunctionId).properties);
|
||||
QJsonObject ctitifProps = propertiesToJson(chargeTypeIgniterTypeIgniterFunction(it.key()).properties);
|
||||
@@ -242,7 +242,7 @@ void DtcImplCustom::onChargeTypeIgniterTypeIgniterFunctionChanged(const ChargeTy
|
||||
it->chargeTypeId = ctitif.chargeTypeId;
|
||||
it->igniterTypeId = ctitif.igniterTypeId;
|
||||
it->igniterFunctionId = ctitif.igniterFunctionId;
|
||||
it->igniterFunctionBase = ctitif.igniterFunctionBase;
|
||||
it->igniterFunctionBase = ctitif.igniterFunctionBaseId;
|
||||
it->impactRadius = ctitif.impactRadius;
|
||||
it->hazardDistance = ctitif.hazardDistance;
|
||||
it->chargeLegacyId = ctitif.chargeLegacyId;
|
||||
@@ -257,9 +257,9 @@ void DtcImplCustom::onChargeTypeIgniterTypeIgniterFunctionChanged(const ChargeTy
|
||||
}
|
||||
}
|
||||
|
||||
QVector<ProjectDataManagement::ChargeTypeData> DtcImplCustom::chargesForGearClass(GearClass gearClass)
|
||||
QVector<ProjectDataManagement::ChargeType> DtcImplCustom::chargesForGearClass(GearClass gearClass)
|
||||
{
|
||||
QVector<ProjectDataManagement::ChargeTypeData> ret;
|
||||
QVector<ProjectDataManagement::ChargeType> ret;
|
||||
|
||||
if (!isGearTypeEnabled())
|
||||
{
|
||||
@@ -277,9 +277,9 @@ QVector<ProjectDataManagement::ChargeTypeData> DtcImplCustom::chargesForGearClas
|
||||
const auto gearTypesList = gearTypes();
|
||||
for (const auto &gearType : gearTypesList)
|
||||
{
|
||||
if (gearType.gearClassId() != gearClass.id())
|
||||
if (gearType.gearClassId != gearClass)
|
||||
continue;
|
||||
const int gearTypeId = gearType.id();
|
||||
const int gearTypeId = gearType.id;
|
||||
for (auto gIt = gear2ChargeMap.begin(); gIt != gear2ChargeMap.end(); ++gIt)
|
||||
{
|
||||
if (gIt->gearTypeId == gearTypeId)
|
||||
@@ -395,10 +395,10 @@ int DtcImplCustom::getTargetTypeIdFromAdlerTargetType(const QString &typ)
|
||||
|
||||
for (const auto &targetType : targetTypeMap)
|
||||
{
|
||||
if (adlerTargetTypeName(targetType) != typ)
|
||||
if (adlerTargetTypeName(targetType.id) != typ)
|
||||
continue;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " - adlerTargetTypeName: " << typ << ", targetTypeId:" << targetType;
|
||||
return targetType;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " - adlerTargetTypeName: " << typ << ", targetTypeId:" << targetType.id;
|
||||
return targetType.id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -419,10 +419,10 @@ int DtcImplCustom::getTargetSubTypeIdFromAdlerTargetSubType(const QString &subTy
|
||||
|
||||
for (const auto &targetSubType : targetSubTypeMap)
|
||||
{
|
||||
if (adlerTargetSubTypeName(targetSubType.targetSubTypeId) != subTyp)
|
||||
if (adlerTargetSubTypeName(targetSubType.id) != subTyp)
|
||||
continue;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " - adlerTargetSubTypName: " << subTyp << ", targetSubTypeId:" << targetSubType.targetSubTypeId;
|
||||
return targetSubType.targetSubTypeId;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " - adlerTargetSubTypName: " << subTyp << ", targetSubTypeId:" << targetSubType.id;
|
||||
return targetSubType.id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -444,10 +444,10 @@ int DtcImplCustom::getChargeTypeIdFromAdlerCharges(const QString &geschosssorte)
|
||||
|
||||
for (const auto &charge : chargeMap)
|
||||
{
|
||||
if (adlerChargeTypeName(charge.chargeTypeId) != geschosssorte)
|
||||
if (adlerChargeTypeName(charge.id) != geschosssorte)
|
||||
continue;
|
||||
INFO_LOG(m_logger) << "---- geschosssorte: " << geschosssorte << ", chargeTypeId:" << charge.chargeTypeId;
|
||||
return charge.chargeTypeId;
|
||||
INFO_LOG(m_logger) << "---- geschosssorte: " << geschosssorte << ", chargeTypeId:" << charge.id;
|
||||
return charge.id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -795,9 +795,9 @@ GearClass DtcImplCustom::gearClassFromChargeTypeId(int chargeTypeId)
|
||||
const auto &gearType = gearTypesMap.value(gearType2ChargeType.gearTypeId);
|
||||
|
||||
// update cache:
|
||||
s_gearClassChargeTypeCache[requestedCTID] = gearType.gearClassId();
|
||||
s_gearClassChargeTypeCache[requestedCTID] = gearType.gearClassId;
|
||||
|
||||
return gearType.gearClassId();
|
||||
return gearType.gearClassId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -952,7 +952,7 @@ QStringList DtcImplCustom::sanitationProceduresList(qint64 procedures)
|
||||
return ret << tr("DCU Connected");
|
||||
ret.reserve(proc.size());
|
||||
for (const auto &s : proc)
|
||||
ret << trSanitationProcedureName(s.name);
|
||||
ret << ProjectDataManagement::trSanitationProcedureName(s.name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -969,9 +969,9 @@ int DtcImplCustom::chargeTypeIdFromLegacyId(GearClass gearClass, int legacyId)
|
||||
for (const auto &charge : chargeMap)
|
||||
{
|
||||
// igniterType/igniterFunction default 0
|
||||
auto chargeIgniterFunction = getChargeTypeIgniterTypeIgniterFunction(charge.chargeTypeId, 0, 0);
|
||||
auto chargeIgniterFunction = getChargeTypeIgniterTypeIgniterFunction(charge.id, 0, 0);
|
||||
if (chargeIgniterFunction.chargeLegacyId == legacyId)
|
||||
return charge.chargeTypeId;
|
||||
return charge.id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -991,7 +991,7 @@ bool DtcImplCustom::isRocket(int chargeTypeId)
|
||||
{
|
||||
const GearClass gearClass = gearClassFromChargeTypeId(chargeTypeId);
|
||||
|
||||
return gearClass.underlying() == GearClass::GearClass_Rocket;
|
||||
return gearClass == GearClass::GearClass_Rocket;
|
||||
}
|
||||
|
||||
ChargeTypeIgniterTypeIgniterFunction DtcImplCustom::getChargeTypeIgniterTypeIgniterFunction(int chargeTypeId, int igniterTypeId, int igniterFunctionId)
|
||||
@@ -1283,7 +1283,7 @@ QString DtcImplCustom::trRadioGroupName(int radioGroupId) { return translate(&Dt
|
||||
QString DtcImplCustom::trVulnerabilityKindName(int vulnerabilityKindId, VulnerabilityClass vulnerabilityClassId)
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityKind vk = DtcImpl::vulnerabilityKind(vulnerabilityKindId);
|
||||
if (vk.vulnerabilityClassId() == vulnerabilityClassId)
|
||||
if (vk.vulnerabilityClassId == vulnerabilityClassId)
|
||||
return translate(&DtcImpl::vulnerabilityKind, &ProjectDataManagement::trVulnerabilityKindName, vulnerabilityKindId);
|
||||
else
|
||||
{
|
||||
@@ -1317,9 +1317,18 @@ QString DtcImplCustom::trSanitationInjuryPlace2Name(int sanitationInjuryPlace2Id
|
||||
return translate(&DtcImpl::sanitationInjuryPlace2, &ProjectDataManagement::trSanitationInjuryPlace2Name, sanitationInjuryPlace2Id);
|
||||
}
|
||||
|
||||
QJsonObject DtcImplCustom::propertiesToJson(const QJsonObject &properties)
|
||||
QJsonObject DtcImplCustom::propertiesToJson(const std::string &properties)
|
||||
{
|
||||
return properties;
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(properties.c_str(), properties.size()));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(props, &parserError));
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot parse properties: no valid json:" << properties;
|
||||
return {};
|
||||
}
|
||||
|
||||
return doc.object();
|
||||
}
|
||||
|
||||
void DtcImplCustom::setProps(ChargeTypeIgniterTypeIgniterFunctionProps &props, QJsonObject obj)
|
||||
@@ -1328,10 +1337,10 @@ void DtcImplCustom::setProps(ChargeTypeIgniterTypeIgniterFunctionProps &props, Q
|
||||
const int tmp = obj.value(QStringLiteral("volatilityTypeId")).toInt(0);
|
||||
switch (tmp)
|
||||
{
|
||||
case VolatilityType_def::Floating:
|
||||
case static_cast<int>(VolatilityType::Floating):
|
||||
props.volatilityTypeId = VolatilityType::Floating;
|
||||
break;
|
||||
case VolatilityType_def::Resident:
|
||||
case static_cast<int>(VolatilityType::Resident):
|
||||
props.volatilityTypeId = VolatilityType::Resident;
|
||||
break;
|
||||
default:
|
||||
@@ -1378,12 +1387,12 @@ void DtcImplCustom::setProps(ChargeTypeIgniterTypeIgniterFunctionProps &props, Q
|
||||
{
|
||||
QJsonObject objFt = it->toObject();
|
||||
CasEffect ce;
|
||||
ce.severityType(static_cast<SeverityType::inner_enum>(objFt.value(QStringLiteral("severityType")).toInt()));
|
||||
ce.iedClass(objFt.value(QStringLiteral("iedClass")).toInt());
|
||||
ce.impactRadius(objFt.value(QStringLiteral("impactRadius")).toInt());
|
||||
ce.severityType = static_cast<SeverityType>(objFt.value(QStringLiteral("severityType")).toInt());
|
||||
ce.iedClass = objFt.value(QStringLiteral("iedClass")).toInt();
|
||||
ce.impactRadius = objFt.value(QStringLiteral("impactRadius")).toInt();
|
||||
props.casEffects.append(ce);
|
||||
}
|
||||
std::sort(props.casEffects.begin(), props.casEffects.end(), [](const CasEffect &a, const CasEffect &b) { return a.severityType < b.severityType; });
|
||||
std::sort(props.casEffects.begin(), props.casEffects.end(), [](const CasEffect &a, const CasEffect &b) { return static_cast<int>(a.severityType) < static_cast<int>(b.severityType); });
|
||||
|
||||
// Caution: Negate as suppressVisibility is negation of isVisible!
|
||||
props.isVisible = !obj.value(QStringLiteral("suppressVisibility")).toBool(false);
|
||||
@@ -1486,14 +1495,14 @@ DtcImplCustom::GearTypeProps DtcImplCustom::gearTypeProps(int gearTypeId)
|
||||
|
||||
void DtcImplCustom::onGearTypeChargeTypeChanged(const GearTypeChargeType >ct)
|
||||
{
|
||||
if (gtct.id() <= 0)
|
||||
if (gtct.id <= 0)
|
||||
return;
|
||||
QJsonParseError parserError;
|
||||
const QByteArray props(QByteArray::fromRawData(gtct.properties().c_str(), gtct.properties().size()));
|
||||
const QByteArray props(QByteArray::fromRawData(gtct.properties.c_str(), gtct.properties.size()));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(props, &parserError));
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
{
|
||||
m_gtctProps.remove(gtct.id());
|
||||
m_gtctProps.remove(gtct.id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1503,7 +1512,7 @@ void DtcImplCustom::onGearTypeChargeTypeChanged(const GearTypeChargeType >ct)
|
||||
gtctp.factoryDefault = obj.value(QStringLiteral("factoryDefault")).toInt(0);
|
||||
gtctp.maxCharge = obj.value(QStringLiteral("maxCharge")).toInt(0);
|
||||
|
||||
m_gtctProps.insert(gtct.id(), gtctp);
|
||||
m_gtctProps.insert(gtct.id, gtctp);
|
||||
}
|
||||
|
||||
DtcImplCustom::GearTypeChargeTypeProps DtcImplCustom::gearTypeChargeTypeProps(int gearTypeChargeTypeId)
|
||||
@@ -1592,7 +1601,7 @@ double DtcImplCustom::getLethalRadius(int chargeTypeId, int igniterTypeId, int i
|
||||
const auto &vec = casEffects(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
for (const ProjectDataManagement::CasEffect &casEffect : vec)
|
||||
{
|
||||
if (casEffect.severityType == SeverityType_def::lethal)
|
||||
if (casEffect.severityType == SeverityType::lethal)
|
||||
return casEffect.impactRadius;
|
||||
}
|
||||
return 0.0;
|
||||
@@ -1603,7 +1612,7 @@ double DtcImplCustom::getNonLethalRadius(int chargeTypeId, int igniterTypeId, in
|
||||
const auto &vec = casEffects(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
for (const ProjectDataManagement::CasEffect &casEffect : vec)
|
||||
{
|
||||
if (casEffect.severityType == SeverityType_def::medium)
|
||||
if (casEffect.severityType == SeverityType::medium)
|
||||
return casEffect.impactRadius;
|
||||
}
|
||||
return 0.0;
|
||||
@@ -1709,7 +1718,6 @@ QString DtcImplCustom::adlerTargetSubTypeName(int targetSubTypeId)
|
||||
}
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
int DtcImplCustom::getAmountFireMarkers(int firePurposeId)
|
||||
{
|
||||
|
||||
+2
-11
@@ -54,7 +54,7 @@ class DtcImplCustom final : public Interface::DtcImpl
|
||||
|
||||
// custom procs, body must be implemented by user
|
||||
// Might need a "baseChargesForGearClass" later on...
|
||||
QVector<ProjectDataManagement::ChargeTypeData> chargesForGearClass(GearClass gearClass) override;
|
||||
QVector<ProjectDataManagement::ChargeType> chargesForGearClass(GearClass gearClass) override;
|
||||
QVector<ProjectDataManagement::IgniterType> ignitersForChargeType(int chargeTypeId) override;
|
||||
QVector<ProjectDataManagement::ChargeTypeIgniterTypeIgniterFunction> igniterFunctionsForChargeTypeIgniterType(int chargeTypeId, int igniterTypeId) override;
|
||||
QVector<ProjectDataManagement::LoadType> loadsForChargeType(int chargeTypeId) override;
|
||||
@@ -252,7 +252,6 @@ class DtcImplCustom final : public Interface::DtcImpl
|
||||
|
||||
ChargeTypeIgniterTypeIgniterFunctionProps chargeTypeIgniterTypeIgniterFunctionProps(int chargeTypeId, int igniterTypeId, int igniterFunctionId);
|
||||
DtcImplCustom::ChargeTypeLoadTypeProps chargeTypeLoadTypeProps(int chargeTypeId, int loadTypeId);
|
||||
ChargeTypeIgniterTypeIgniterFunction chargeTypeIgniterTypeIgniterFunction(int id) const;
|
||||
|
||||
QString suffix(int chargeTypeId, bool omitBaseSuffix = false);
|
||||
static QString offsetName(UleisClassOffset o);
|
||||
@@ -266,21 +265,13 @@ class DtcImplCustom final : public Interface::DtcImpl
|
||||
void setProps(ChargeTypeIgniterTypeIgniterFunctionProps &props, QJsonObject obj);
|
||||
void setProps(ChargeTypeLoadTypeProps &props, QJsonObject obj);
|
||||
|
||||
QJsonObject propertiesToJson(const QJsonObject &properties);
|
||||
QJsonObject propertiesToJson(const std::string &properties);
|
||||
void mergeProperties(QHash<int, ChargeTypeIgniterTypeIgniterFunctionProps>::iterator &it,
|
||||
const QJsonObject &ifProps,
|
||||
const QJsonObject &ctProps,
|
||||
const QJsonObject &ctitifProps,
|
||||
const QJsonObject &itProps);
|
||||
|
||||
// enable* methods
|
||||
void enableIgniterType(bool enable) override;
|
||||
void enableChargeTypeIgniterTypeIgniterFunction(bool enable) override;
|
||||
void enableIgniterFunction(bool enable) override;
|
||||
void enableLoadType(bool enable) override;
|
||||
void enableChargeTypeLoadType(bool enable) override;
|
||||
void enableTargetType(bool enable) override;
|
||||
|
||||
private:
|
||||
QHash<int, ChargeTypeIgniterTypeIgniterFunctionProps> m_ctItIfProps;
|
||||
QHash<int, ChargeTypeLoadTypeProps> m_ctLtProps;
|
||||
|
||||
@@ -65,7 +65,7 @@ void Translation::publishData()
|
||||
arr += obj;
|
||||
|
||||
const QJsonObject jObj{ {QStringLiteral("translations"), arr} };
|
||||
const QByteArray data = QJsonDocument(jObj).toBinaryData();
|
||||
const QByteArray data = QJsonDocument(jObj).toJson(QJsonDocument::Compact);
|
||||
const QByteArray compressed = qCompress(data, 9);
|
||||
const QByteArray md5Sum = QCryptographicHash::hash(compressed, QCryptographicHash::Md5).toHex();
|
||||
|
||||
@@ -95,11 +95,11 @@ void Translation::onInsertUpdateTranslationRequest(const rti::core::SampleIdenti
|
||||
const InsertUpdateTranslationRequest &request)
|
||||
{
|
||||
Database::PdmTranslation te;
|
||||
te.isoCode = QString::fromStdString(request.isoCode());
|
||||
te.context = QString::fromStdString(request.ctx());
|
||||
te.key = QString::fromStdString(request.key());
|
||||
te.disambiguation = QString::fromStdString(request.disambiguation());
|
||||
te.translation = QString::fromStdString(request.translation());
|
||||
te.isoCode = QString::fromStdString(request.isoCode);
|
||||
te.context = QString::fromStdString(request.ctx);
|
||||
te.key = QString::fromStdString(request.key);
|
||||
te.disambiguation = QString::fromStdString(request.disambiguation);
|
||||
te.translation = QString::fromStdString(request.translation);
|
||||
|
||||
// not fast but also not really needed ...
|
||||
te.id = -1;
|
||||
|
||||
+273
-273
File diff suppressed because it is too large.
Load diff
+14
-14
@@ -155,7 +155,7 @@ QByteArray HandlerReportGetData::getUnitPowerResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -180,7 +180,7 @@ QByteArray HandlerReportGetData::getParticipantDistanceResult(int reportId) cons
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -204,7 +204,7 @@ QByteArray HandlerReportGetData::getMineAreaResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -232,7 +232,7 @@ QByteArray HandlerReportGetData::getNbcResult(int reportId) const
|
||||
|
||||
QJsonDocument doc(array);
|
||||
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -258,7 +258,7 @@ QByteArray HandlerReportGetData::getFiringsResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -287,7 +287,7 @@ QByteArray HandlerReportGetData::getAirSupportResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -313,7 +313,7 @@ QByteArray HandlerReportGetData::getChargeResupplyResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -340,7 +340,7 @@ QByteArray HandlerReportGetData::getChargeAdminResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -367,7 +367,7 @@ QByteArray HandlerReportGetData::getMaintenanceResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -409,7 +409,7 @@ QByteArray HandlerReportGetData::getTreatmentResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -435,7 +435,7 @@ QByteArray HandlerReportGetData::getBuildingDamageResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -496,7 +496,7 @@ QByteArray HandlerReportGetData::getSanitationMaterialResult(int reportId) const
|
||||
*/
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -516,7 +516,7 @@ QByteArray HandlerReportGetData::getSanNineLinerResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -546,5 +546,5 @@ QByteArray HandlerReportGetData::getTreatmentTimelineResult(int reportId) const
|
||||
return QByteArray();
|
||||
|
||||
QJsonDocument doc(array);
|
||||
return doc.toBinaryData();
|
||||
return doc.toJson(QJsonDocument::Compact);
|
||||
}
|
||||
+2
-2
@@ -88,8 +88,8 @@ bool HandlerReportData::generateMaintenanceResult(const CreateModifyReportReques
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), vrData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), vrData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(vrData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
|
||||
qInsert.bindValue(QStringLiteral(":time_event"), vrData.time_event);
|
||||
qInsert.bindValue(QStringLiteral(":time_position"), vrData.time_position_changed);
|
||||
|
||||
+2
-2
@@ -151,8 +151,8 @@ bool HandlerReportData::generateParticipantDistanceResult(const CreateModifyRepo
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), typeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), partId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(partId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
|
||||
// double dist = static_cast<double>(static_cast<int>(itt.value()*100+0.5))/100.0; // round to 2 decimals
|
||||
int dist = static_cast<int>(itt.value());
|
||||
|
||||
+7
-7
@@ -134,8 +134,8 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), tData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), tData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(tData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":vitality"), tData.vitality);
|
||||
qInsert.bindValue(QStringLiteral(":vulnerability"), tData.vulnerability);
|
||||
qInsert.bindValue(QStringLiteral(":vbg"), tData.vulnerabilityState);
|
||||
@@ -186,12 +186,12 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
DEBUG_LOG(m_logger) << "Initial Time enter area = " << tData.time_enter_area;
|
||||
DEBUG_LOG(m_logger) << "Initial Time 9 liner = " << tData.time_nine_liner;
|
||||
|
||||
//if (tData.time_treatment > 0 && participant.equipmentNumber().is_set())
|
||||
//if (tData.time_treatment > 0 && participant.equipmentNumber.is_set())
|
||||
// get FunctionalArea for participants with vulnerabilityState > 0, too
|
||||
if (participant.equipmentNumber().is_set())
|
||||
if (participant.equipmentNumber.is_set())
|
||||
{
|
||||
// re-calculate time enter in Functional Area
|
||||
QPair<int, qint64> fa = getNextFunctionalAreaEntry(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
QPair<int, qint64> fa = getNextFunctionalAreaEntry(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
qint64 time_enter_fa = fa.second;
|
||||
int area_id = fa.first;
|
||||
QString area_name;
|
||||
@@ -210,7 +210,7 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
if (tData.time_treatment > 0 )
|
||||
{
|
||||
// recalculate time_nine_liner
|
||||
qint64 time_9liner = get9LinerTime(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
qint64 time_9liner = get9LinerTime(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
if (time_9liner > 0 && time_9liner != tData.time_nine_liner)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Re-calculated time 9 liner = " << time_9liner;
|
||||
@@ -218,7 +218,7 @@ bool HandlerReportData::generateTreatmentResult(const CreateModifyReportRequest
|
||||
}
|
||||
|
||||
// recalculate time_position_changed
|
||||
qint64 time_pos_changed = getPosChangedTime(participant.equipmentNumber().get(), tData.time_vulnerability);
|
||||
qint64 time_pos_changed = getPosChangedTime(participant.equipmentNumber.get(), tData.time_vulnerability);
|
||||
if (time_pos_changed > 0 && time_pos_changed != tData.time_position_changed)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Re-calculated time position changed = " << time_pos_changed;
|
||||
|
||||
+2
-2
@@ -109,8 +109,8 @@ bool HandlerReportData::generateTreatmentTimelineResult(const CreateModifyReport
|
||||
qInsert.bindValue(QStringLiteral(":pTypeId"), tData.participantTypeId);
|
||||
qInsert.bindValue(QStringLiteral(":participantId"), tData.participantId);
|
||||
qInsert.bindValue(QStringLiteral(":participantName"), ppmDtc->hierarchyFromParticipant(tData.participantId));
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber().is_set() ?
|
||||
participant.equipmentNumber().get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":participantEqNo"), participant.equipmentNumber.is_set() ?
|
||||
participant.equipmentNumber.get() : 0);
|
||||
qInsert.bindValue(QStringLiteral(":vitality"), tData.vitality);
|
||||
qInsert.bindValue(QStringLiteral(":vulnerability"), tData.vulnerability);
|
||||
qInsert.bindValue(QStringLiteral(":vbg"), tData.vulnerabilityState);
|
||||
|
||||
+147
-147
@@ -157,20 +157,20 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
INFO_LOG(m_logger) << "trying to send createRequest Report";
|
||||
CreateModifyReportRequest request;
|
||||
|
||||
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType.underlying());
|
||||
request.name(repName.toStdString());
|
||||
request.description("Test Report Description");
|
||||
request.reportType(repType);
|
||||
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType);
|
||||
request.name = repName.toStdString();
|
||||
request.description = "Test Report Description";
|
||||
request.reportType = repType;
|
||||
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Valid);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Valid;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
// common request data
|
||||
request.startTime(QDateTime(QDate::currentDate().addYears(-2), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.endTime(QDateTime(QDate::currentDate().addDays(1), QTime(16, 30)).toMSecsSinceEpoch());
|
||||
request.startTime = QDateTime(QDate::currentDate().addYears(-2), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.endTime = QDateTime(QDate::currentDate().addDays(1), QTime(16, 30)).toMSecsSinceEpoch();
|
||||
if (repType != ReportType::Nbc) // && repType != ReportType::MineArea)
|
||||
request.partyId(2);
|
||||
request.partyId = 2;
|
||||
|
||||
// participant Ids
|
||||
std::vector<qint32> vecPartIds;
|
||||
@@ -184,7 +184,7 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartIds[6] = 13;
|
||||
vecPartIds[7] = 14;
|
||||
vecPartIds[8] = 15;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
// participant types
|
||||
std::vector<qint32> vecPartTypes;
|
||||
@@ -193,135 +193,135 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartTypes[0] = 55;
|
||||
vecPartTypes[1] = 74;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
switch (repType.underlying())
|
||||
switch (repType)
|
||||
{
|
||||
case ReportManagement::ReportType::UnitPower:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addYears(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.intervalTime(7200000); // 120 min
|
||||
request.visualisationType(ReportManagement::VisualisationType::Line);
|
||||
request.groupByParty(false);
|
||||
request.startTime = QDateTime(QDate::currentDate().addYears(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.intervalTime = 7200000; // 120 min
|
||||
request.visualisationType = ReportManagement::VisualisationType::Line;
|
||||
request.groupByParty = false;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ParticipantDistance:
|
||||
{
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::MineArea:
|
||||
{
|
||||
request.mineAreaIds().resize(1);
|
||||
request.mineAreaIds()[0] = 2;
|
||||
request.mineAreaIds.resize(1);
|
||||
request.mineAreaIds[0] = 2;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Nbc:
|
||||
{
|
||||
request.nbcIds().resize(1);
|
||||
request.nbcIds()[0] = 3;
|
||||
request.nbcIds.resize(1);
|
||||
request.nbcIds[0] = 3;
|
||||
|
||||
request.chargeTypeIds().resize(1);
|
||||
request.chargeTypeIds()[0] = 341;
|
||||
request.chargeTypeIds.resize(1);
|
||||
request.chargeTypeIds[0] = 341;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Firings:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
// request.intervalTime(1800000); // 30 min
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 38;
|
||||
request.chargeTypeIds()[1] = 39;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 38;
|
||||
request.chargeTypeIds[1] = 39;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::AirSupport:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.partyId(4);
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.partyId = 4;
|
||||
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 52;
|
||||
vecPartIds[1] = 53;
|
||||
vecPartIds[2] = 54;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.resize(2);
|
||||
|
||||
vecPartTypes[0] = 57;
|
||||
vecPartTypes[1] = 78;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(4);
|
||||
request.chargeTypeIds()[0] = 471;
|
||||
request.chargeTypeIds()[1] = 472;
|
||||
request.chargeTypeIds()[2] = 473;
|
||||
request.chargeTypeIds()[3] = 474;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(4);
|
||||
request.chargeTypeIds[0] = 471;
|
||||
request.chargeTypeIds[1] = 472;
|
||||
request.chargeTypeIds[2] = 473;
|
||||
request.chargeTypeIds[3] = 474;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ExplosiveDevice:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.partyId(3);
|
||||
request.startTime = QDateTime(QDate::currentDate().addDays(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.partyId = 3;
|
||||
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 30;
|
||||
vecPartIds[1] = 31;
|
||||
vecPartIds[2] = 32;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.resize(2);
|
||||
|
||||
vecPartTypes[0] = 77;
|
||||
vecPartTypes[1] = 78;
|
||||
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.intervalTime(0);
|
||||
request.chargeTypeIds().resize(3);
|
||||
request.chargeTypeIds()[0] = 48;
|
||||
request.chargeTypeIds()[1] = 49;
|
||||
request.chargeTypeIds()[2] = 70;
|
||||
request.intervalTime = 0;
|
||||
request.chargeTypeIds.resize(3);
|
||||
request.chargeTypeIds[0] = 48;
|
||||
request.chargeTypeIds[1] = 49;
|
||||
request.chargeTypeIds[2] = 70;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ChargeResupply:
|
||||
{
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 38;
|
||||
request.chargeTypeIds()[1] = 39;
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 38;
|
||||
request.chargeTypeIds[1] = 39;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::ChargeAdministration:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.chargeTypeIds().resize(2);
|
||||
request.chargeTypeIds()[0] = 371;
|
||||
request.chargeTypeIds()[1] = 372;
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.chargeTypeIds.resize(2);
|
||||
request.chargeTypeIds[0] = 371;
|
||||
request.chargeTypeIds[1] = 372;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -333,117 +333,117 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
vecPartIds[0] = 30;
|
||||
vecPartIds[1] = 31;
|
||||
vecPartIds[2] = 32;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
// participant types
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(2);
|
||||
vecPartTypes[0] = 77;
|
||||
vecPartTypes[1] = 78;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Decontamination:
|
||||
{
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::Treatment:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentChain:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Bar);
|
||||
request.groupByParty(false);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Bar;
|
||||
request.groupByParty = false;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentTimeline:
|
||||
{
|
||||
request.startTime() = 1646118000000;
|
||||
request.endTime() = 1646118010000;
|
||||
request.startTime = 1646118000000;
|
||||
request.endTime = 1646118010000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(2);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.visualisationType(visType);
|
||||
request.groupByParty(true);
|
||||
request.visualisationType = visType;
|
||||
request.groupByParty = true;
|
||||
break;
|
||||
}
|
||||
case ReportManagement::ReportType::TreatmentPriority:
|
||||
{
|
||||
request.startTime() = 1594218400000;
|
||||
request.endTime() = 1594219400000;
|
||||
request.startTime = 1594218400000;
|
||||
request.endTime = 1594219400000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartIds.resize(3);
|
||||
vecPartIds[0] = 5;
|
||||
vecPartIds[1] = 6;
|
||||
vecPartIds[2] = 7;
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantIds = vecPartIds;
|
||||
|
||||
vecPartTypes.clear();
|
||||
vecPartTypes.resize(1);
|
||||
vecPartTypes[0] = 55;
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.participantTypes = vecPartTypes;
|
||||
|
||||
request.cornerBottomLeft().lon(0.09);
|
||||
request.cornerBottomLeft().lat(0.245);
|
||||
request.width(40000);
|
||||
request.height(100000);
|
||||
request.cornerBottomLeft.lon = 0.09;
|
||||
request.cornerBottomLeft.lat = 0.245;
|
||||
request.width = 40000;
|
||||
request.height = 100000;
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
|
||||
case ReportManagement::ReportType::BuildingDamage:
|
||||
{
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.chargeTypeIds().resize(1);
|
||||
request.chargeTypeIds()[0] = 301; // building Id
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.chargeTypeIds.resize(1);
|
||||
request.chargeTypeIds[0] = 301; // building Id
|
||||
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -452,31 +452,31 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
|
||||
|
||||
// request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
int noMaterials = 27;
|
||||
request.chargeTypeIds().resize(noMaterials);
|
||||
request.chargeTypeIds.resize(noMaterials);
|
||||
for (int i = 0; i < noMaterials; i++)
|
||||
request.chargeTypeIds()[i] = i+1;
|
||||
request.chargeTypeIds[i] = i+1;
|
||||
// request.chargeTypeIds().resize(1);
|
||||
// request.chargeTypeIds()[0] = 8;
|
||||
request.startTime(1650455273000);
|
||||
request.endTime(1651232873000);
|
||||
request.startTime = 1650455273000;
|
||||
request.endTime = 1651232873000;
|
||||
|
||||
vecPartIds.clear();
|
||||
vecPartTypes.clear();
|
||||
request.partyId(2);
|
||||
request.participantIds(vecPartIds);
|
||||
request.participantTypes(vecPartTypes);
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.partyId = 2;
|
||||
request.participantIds = vecPartIds;
|
||||
request.participantTypes = vecPartTypes;
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
|
||||
case ReportManagement::ReportType::MedevacNineLiner:
|
||||
{
|
||||
request.cornerBottomLeft().lon(0.09);
|
||||
request.cornerBottomLeft().lat(0.245);
|
||||
request.width(40000);
|
||||
request.height(100000);
|
||||
request.startTime(QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch());
|
||||
request.visualisationType(ReportManagement::VisualisationType::Table);
|
||||
request.cornerBottomLeft.lon = 0.09;
|
||||
request.cornerBottomLeft.lat = 0.245;
|
||||
request.width = 40000;
|
||||
request.height = 100000;
|
||||
request.startTime = QDateTime(QDate::currentDate().addMonths(-1), QTime(9, 30)).toMSecsSinceEpoch();
|
||||
request.visualisationType = ReportManagement::VisualisationType::Table;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -504,31 +504,31 @@ void RepTests::tryModify()
|
||||
|
||||
CreateModifyReportRequest request;
|
||||
|
||||
request.id(m_reportId);
|
||||
request.name("Test Report Updated");
|
||||
request.description("Updated Description");
|
||||
request.id = m_reportId;
|
||||
request.name = "Test Report Updated";
|
||||
request.description = "Updated Description";
|
||||
|
||||
request.reportType(rep.reportType());
|
||||
request.description(rep.description());
|
||||
request.partyId(rep.partyId());
|
||||
request.startTime(rep.startTime());
|
||||
request.endTime(rep.endTime());
|
||||
request.visualisationType(rep.visualisationType());
|
||||
request.intervalTime(rep.intervalTime());
|
||||
request.chargeTypeIds(rep.chargeTypeIds());
|
||||
request.groupByParty(rep.groupByParty());
|
||||
request.mineAreaIds(rep.mineAreaIds());
|
||||
request.nbcIds(rep.nbcIds());
|
||||
request.participantIds(rep.participantIds());
|
||||
request.participantTypes(rep.participantTypes());
|
||||
request.unitIds(rep.unitIds());
|
||||
request.reportType = rep.reportType;
|
||||
request.description = rep.description;
|
||||
request.partyId = rep.partyId;
|
||||
request.startTime = rep.startTime;
|
||||
request.endTime = rep.endTime;
|
||||
request.visualisationType = rep.visualisationType;
|
||||
request.intervalTime = rep.intervalTime;
|
||||
request.chargeTypeIds = rep.chargeTypeIds;
|
||||
request.groupByParty = rep.groupByParty;
|
||||
request.mineAreaIds = rep.mineAreaIds;
|
||||
request.nbcIds = rep.nbcIds;
|
||||
request.participantIds = rep.participantIds;
|
||||
request.participantTypes = rep.participantTypes;
|
||||
request.unitIds = rep.unitIds;
|
||||
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Valid);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Valid;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
DEBUG_LOG(m_logger) << "Start modify";
|
||||
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType();
|
||||
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType;
|
||||
|
||||
if (!m_ftc->createModifyReportRequest(request, this))
|
||||
{
|
||||
@@ -545,8 +545,8 @@ void RepTests::tryGetData()
|
||||
DEBUG_LOG(m_logger) << "trying to send get data request for report Id = " << m_reportId;
|
||||
GetReportDataRequest request;
|
||||
|
||||
request.reportId(m_reportId);
|
||||
request.reportType(ReportManagement::ReportType::ChargeAdministration);
|
||||
request.reportId = m_reportId;
|
||||
request.reportType = ReportManagement::ReportType::ChargeAdministration;
|
||||
|
||||
if (!m_ftc->getReportDataRequest(request, this))
|
||||
{
|
||||
@@ -563,10 +563,10 @@ void RepTests::tryChangeStatus()
|
||||
DEBUG_LOG(m_logger) << "trying to send change status request for report Id = " << m_reportId;
|
||||
ReportChangeStatusRequest request;
|
||||
|
||||
request.id(m_reportId);
|
||||
request.operatorId(m_operatorId);
|
||||
request.fileStatus(ReportManagement::FileStatus::Deleted);
|
||||
request.lastModified(QDateTime::currentMSecsSinceEpoch());
|
||||
request.id = m_reportId;
|
||||
request.operatorId = m_operatorId;
|
||||
request.fileStatus = ReportManagement::FileStatus::Deleted;
|
||||
request.lastModified = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
if (!m_ftc->reportChangeStatusRequest(request, this))
|
||||
{
|
||||
@@ -592,14 +592,14 @@ void RepTests::tryDelete()
|
||||
void RepTests::onCreateModifyReportReply(const CreateModifyReportReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "END (onCreateModifyReportReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
if (replyObject.errorString.size() > 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id
|
||||
<< " and errorString " << replyObject.errorString;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -620,16 +620,16 @@ void RepTests::onRemoveReportReply(const Core::FunctionReplyObject &replyObject)
|
||||
void RepTests::onGetReportDataReply(const GetReportDataReply &replyObject)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "END (onGetReportDataReply)";
|
||||
if (replyObject.errorString().size() > 0)
|
||||
if (replyObject.errorString.size() > 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString();
|
||||
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString;
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.errorString();
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id
|
||||
<< " and errorString " << replyObject.errorString;
|
||||
|
||||
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData());
|
||||
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Size reportData: " << reportData.size();
|
||||
}
|
||||
|
||||
+6
-6
@@ -86,7 +86,7 @@ void SrpDtTests::tryGetAllSituationReplays()
|
||||
INFO_LOG(m_logger) << "Amout of existing situation replays = " << map.size();
|
||||
m_situationReplayId = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
INFO_LOG(m_logger) << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
INFO_LOG(m_logger) << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId ;
|
||||
}
|
||||
|
||||
QTimer::singleShot(10, this, &SrpDtTests::tryGetSituationReplay);
|
||||
@@ -98,15 +98,15 @@ void SrpDtTests::tryGetSituationReplay()
|
||||
INFO_LOG(m_logger) << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
SituationReplay::SitReplay data = m_dtc->sitReplay(m_situationReplayId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
if (data.id <= 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
<< ", on exercise " << data.exerciseId();
|
||||
INFO_LOG(m_logger) << "## SitReplay(" << data.id << "), replayPartition: " << data.replayPartitionId
|
||||
<< ", on exercise " << data.exerciseId;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
}
|
||||
@@ -114,8 +114,8 @@ void SrpDtTests::tryGetSituationReplay()
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::onReceiveSituationReplayData(const SituationReplay::SitReplay &data)
|
||||
{
|
||||
if (m_situationReplayId == data.id())
|
||||
INFO_LOG(m_logger) << "##################### Data for id = " << data.id() << " received";
|
||||
if (m_situationReplayId == data.id)
|
||||
INFO_LOG(m_logger) << "##################### Data for id = " << data.id << " received";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
+9
-9
@@ -91,12 +91,12 @@ void SrpFtTests::tryStart()
|
||||
double pace = 2.0;
|
||||
|
||||
ChangeReplayStateRequest req;
|
||||
req.id(0);
|
||||
req.replayPartitionId(m_replayPartitionId);
|
||||
req.state(SrpState::Started);
|
||||
req.beginTime(beginTime);
|
||||
req.endTime(endTime); // infinite
|
||||
req.pace(pace);
|
||||
req.id = 0;
|
||||
req.replayPartitionId = m_replayPartitionId;
|
||||
req.state = SrpState::Started;
|
||||
req.beginTime = beginTime;
|
||||
req.endTime = endTime; // infinite
|
||||
req.pace = pace;
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
@@ -208,9 +208,9 @@ void SrpFtTests::failExit()
|
||||
void SrpFtTests::switchToState(SrpState state)
|
||||
{
|
||||
ChangeReplayStateRequest req;
|
||||
req.id(m_situationReplayId);
|
||||
req.replayPartitionId(m_replayPartitionId);
|
||||
req.state(state);
|
||||
req.id = m_situationReplayId;
|
||||
req.replayPartitionId = m_replayPartitionId;
|
||||
req.state = state;
|
||||
|
||||
if (!m_ftc->changeReplayStateRequest(req, this))
|
||||
{
|
||||
|
||||
@@ -94,13 +94,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
void DdsHandler::publishPartitionTime(const Core::PartitionTime &partitionTime)
|
||||
{
|
||||
INFO_LOG(m_logger) << "publish partitionTime: " << partitionTime.timeStamp();
|
||||
INFO_LOG(m_logger) << "publish partitionTime: " << partitionTime.timeStamp;
|
||||
m_dtsPartitionTime->write(partitionTime);
|
||||
}
|
||||
|
||||
bool DdsHandler::parseOptions(const QString &opts, ConnectionParams ¶ms)
|
||||
{
|
||||
QVector<QStringRef> parts = opts.splitRef(QLatin1Char(','));
|
||||
const QStringList parts = opts.split(QLatin1Char(','));
|
||||
if (parts.size() < 2 || parts.size() > 3)
|
||||
return false;
|
||||
bool bOk;
|
||||
@@ -112,7 +112,7 @@ bool DdsHandler::parseOptions(const QString &opts, ConnectionParams ¶ms)
|
||||
return false;
|
||||
if (parts.size() == 3)
|
||||
{
|
||||
QString str = parts.at(2).toString();
|
||||
QString str = parts.at(2);
|
||||
// '_' is not allowed in a scheme, but rti needs it ...
|
||||
str.replace(QLatin1String("tcpv4_lan"), QLatin1String("tcpv4lan"));
|
||||
QUrl url = QUrl::fromUserInput(str);
|
||||
|
||||
+29
-29
@@ -77,17 +77,17 @@ Core::FunctionReplyObject HandlerSituationReplay::startReplayRequest(const Situa
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onStartReplayRequest: " << request;
|
||||
// Start only own replay
|
||||
if (request.replayPartitionId() != m_partitionId)
|
||||
return Core::FunctionReplyObject(request.replayPartitionId(),tr_lts("dds", "Wrong replay partition"));
|
||||
if (request.replayPartitionId != m_partitionId)
|
||||
return Core::FunctionReplyObject(request.replayPartitionId,tr_lts("dds", "Wrong replay partition"));
|
||||
if (m_objSrp && m_objSrp->srpState() != SrpState::Stopped)
|
||||
return Core::FunctionReplyObject(request.replayPartitionId(), tr_lts("dds", "Replay is not yet stopped"));
|
||||
return Core::FunctionReplyObject(request.replayPartitionId, tr_lts("dds", "Replay is not yet stopped"));
|
||||
|
||||
Database::SrpSituationReplay newData;
|
||||
newData.srpStateId = SrpState::Started;
|
||||
newData.replayPartitionId = m_partitionId;
|
||||
newData.beginTime = request.beginTime();
|
||||
newData.endTime = request.endTime();
|
||||
newData.pace = request.pace().is_set() ? request.pace().get() : 1;
|
||||
newData.beginTime = request.beginTime;
|
||||
newData.endTime = request.endTime;
|
||||
newData.pace = request.pace.is_set() ? request.pace.get() : 1;
|
||||
|
||||
// round to sec
|
||||
newData.beginTime = (newData.beginTime / 1000) * 1000;
|
||||
@@ -95,7 +95,7 @@ Core::FunctionReplyObject HandlerSituationReplay::startReplayRequest(const Situa
|
||||
newData.endTime = ((newData.endTime / 1000) + 1) * 1000;
|
||||
|
||||
if (!m_objSrp && !createObject(newData))
|
||||
return Core::FunctionReplyObject(request.replayPartitionId(),tr_lts("dds", "Internal error"));
|
||||
return Core::FunctionReplyObject(request.replayPartitionId,tr_lts("dds", "Internal error"));
|
||||
|
||||
m_objSrp->setSrpData(newData);
|
||||
return Core::FunctionReplyObject(m_objSrp->getId());
|
||||
@@ -106,10 +106,10 @@ Core::FunctionReplyObject HandlerSituationReplay::stopReplayRequest(const Situat
|
||||
DEBUG_LOG(m_logger) << "onStopReplayRequest: " << request;
|
||||
|
||||
if (m_objSrp == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "SituationReplay for replayPartitionId %1 not found")).arg(request.replayPartitionId());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "SituationReplay for replayPartitionId %1 not found")).arg(request.replayPartitionId);
|
||||
|
||||
if (m_objSrp && (m_objSrp->getId() != request.id() || m_objSrp->getReplayPartitionId() != request.replayPartitionId()))
|
||||
return Core::FunctionReplyObject(request.id(),tr_lts("dds", "Given request id %1 not equal object id %2")).arg(request.id()).arg(m_objSrp->getId());
|
||||
if (m_objSrp && (m_objSrp->getId() != request.id || m_objSrp->getReplayPartitionId() != request.replayPartitionId))
|
||||
return Core::FunctionReplyObject(request.id,tr_lts("dds", "Given request id %1 not equal object id %2")).arg(request.id).arg(m_objSrp->getId());
|
||||
|
||||
Core::FunctionReplyObject ret = m_objSrp->switchToState(SrpState::Stopped);
|
||||
if (!ret.error())
|
||||
@@ -123,42 +123,42 @@ Core::FunctionReplyObject HandlerSituationReplay::stopReplayRequest(const Situat
|
||||
|
||||
Core::FunctionReplyObject HandlerSituationReplay::changeReplayStateRequest(const SituationReplay::ChangeReplayStateRequest &request)
|
||||
{
|
||||
if (request.state() != SrpState_def::Started)
|
||||
if (request.state != SrpState::Started)
|
||||
{
|
||||
if (m_objSrp == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "SituationReplay for replayPartitionId %1 not found")).arg(request.replayPartitionId());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "SituationReplay for replayPartitionId %1 not found")).arg(request.replayPartitionId);
|
||||
|
||||
if (m_objSrp && (m_objSrp->getId() != request.id() || m_objSrp->getReplayPartitionId() != request.replayPartitionId()))
|
||||
return Core::FunctionReplyObject(request.id(),tr_lts("dds", "Given request id %1 not equal object id %2")).arg(request.id()).arg(m_objSrp->getId());
|
||||
if (m_objSrp && (m_objSrp->getId() != request.id || m_objSrp->getReplayPartitionId() != request.replayPartitionId))
|
||||
return Core::FunctionReplyObject(request.id,tr_lts("dds", "Given request id %1 not equal object id %2")).arg(request.id).arg(m_objSrp->getId());
|
||||
}
|
||||
|
||||
if (request.pace().is_set())
|
||||
m_objSrp->setPace(request.pace().get());
|
||||
if (request.pace.is_set())
|
||||
m_objSrp->setPace(request.pace.get());
|
||||
|
||||
switch (request.state().underlying())
|
||||
switch (request.state)
|
||||
{
|
||||
case SrpState_def::Unknown:
|
||||
if (request.pace().is_set())
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not handle command 'Unknown' in changeReplayStateRequest"));
|
||||
case SrpState_def::Started:
|
||||
case SrpState::Unknown:
|
||||
if (request.pace.is_set())
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not handle command 'Unknown' in changeReplayStateRequest"));
|
||||
case SrpState::Started:
|
||||
return startReplayRequest(request);
|
||||
case SrpState_def::Resumed:
|
||||
case SrpState::Resumed:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Resume request: " << request.beginTime() << ", cur playback time: " << m_objSrp->currentReplayTime();
|
||||
if (request.beginTime() != 0 && request.beginTime() != m_objSrp->currentReplayTime())
|
||||
DEBUG_LOG(m_logger) << "Resume request: " << request.beginTime << ", cur playback time: " << m_objSrp->currentReplayTime();
|
||||
if (request.beginTime != 0 && request.beginTime != m_objSrp->currentReplayTime())
|
||||
{
|
||||
stopReplayRequest(request);
|
||||
return startReplayRequest(request);
|
||||
}
|
||||
Q_FALLTHROUGH();
|
||||
case SrpState_def::Paused:
|
||||
return m_objSrp->switchToState(request.state());
|
||||
case SrpState::Paused:
|
||||
return m_objSrp->switchToState(request.state);
|
||||
}
|
||||
case SrpState_def::Stopped:
|
||||
case SrpState::Stopped:
|
||||
return stopReplayRequest(request);
|
||||
}
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Unhandled request state %1")).arg(request.state().underlying());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Unhandled request state %1")).arg(static_cast<int>(request.state));
|
||||
}
|
||||
|
||||
void HandlerSituationReplay::onChangeReplayStateRequest(const rti::core::SampleIdentity &cookie,
|
||||
|
||||
+12
-12
@@ -40,13 +40,13 @@ ObjectSituationReplay::~ObjectSituationReplay()
|
||||
|
||||
bool ObjectSituationReplay::isStopped() const
|
||||
{
|
||||
return (m_data.srpStateId == SituationReplay::SrpState_def::Stopped);
|
||||
return (m_data.srpStateId == SituationReplay::SrpState::Stopped);
|
||||
}
|
||||
|
||||
bool ObjectSituationReplay::isRunning() const
|
||||
{
|
||||
return (m_data.srpStateId == SituationReplay::SrpState_def::Started ||
|
||||
m_data.srpStateId == SituationReplay::SrpState_def::Resumed);
|
||||
return (m_data.srpStateId == SituationReplay::SrpState::Started ||
|
||||
m_data.srpStateId == SituationReplay::SrpState::Resumed);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectSituationReplay::createObject(const Database::SrpSituationReplay &data)
|
||||
@@ -55,7 +55,7 @@ Core::FunctionReplyObject ObjectSituationReplay::createObject(const Database::Sr
|
||||
m_data = data;
|
||||
setPace(m_data.pace);
|
||||
m_data.id = 0;
|
||||
m_data.srpStateId = SituationReplay::SrpState_def::Unknown;
|
||||
m_data.srpStateId = SituationReplay::SrpState::Unknown;
|
||||
m_currentReplayTime = m_data.beginTime;
|
||||
if (m_db)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ Core::FunctionReplyObject ObjectSituationReplay::createObject(const Database::Sr
|
||||
// Id is serial -> will be generated by db => inside m_data after db-insert
|
||||
DEBUG_LOG(m_logger) << "New srpId: " << m_data.id;
|
||||
|
||||
switchToState(SituationReplay::SrpState_def::Stopped);
|
||||
switchToState(SituationReplay::SrpState::Stopped);
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ bool ObjectSituationReplay::checkPublishData()
|
||||
onPublishReplayTime();
|
||||
if (m_data.endTime != 0 && m_data.endTime < m_currentReplayTime)
|
||||
{
|
||||
if (switchToState(SrpState_def::Stopped).error())
|
||||
if (switchToState(SrpState::Stopped).error())
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -234,7 +234,7 @@ bool ObjectSituationReplay::checkPublishData()
|
||||
QElapsedTimer timerReadData; if (m_logger.isInfoEnabled()) timerReadData.start();
|
||||
|
||||
m_dbReader->waitForAsyncOperations(m_data.endTime);
|
||||
if (switchToState(SrpState_def::Stopped).error())
|
||||
if (switchToState(SrpState::Stopped).error())
|
||||
return false;
|
||||
|
||||
if (m_logger.isInfoEnabled()) INFO_LOG(m_logger) << "m_dbReader->waitForAsyncOperations took " << timerReadData.elapsed() << " [ms]";
|
||||
@@ -262,21 +262,21 @@ Core::FunctionReplyObject ObjectSituationReplay::switchToState(SrpState newSrpSt
|
||||
<< ", current: " << m_data.srpStateId;
|
||||
if (m_data.srpStateId != newSrpState)
|
||||
{
|
||||
switch (newSrpState.underlying())
|
||||
switch (newSrpState)
|
||||
{
|
||||
case SrpState_def::Paused:
|
||||
case SrpState::Paused:
|
||||
if (!pause())
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Could not pause replay"));
|
||||
break;
|
||||
case SrpState_def::Resumed:
|
||||
case SrpState::Resumed:
|
||||
if (!resume())
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Could not resume replay"));
|
||||
break;
|
||||
case SrpState_def::Started:
|
||||
case SrpState::Started:
|
||||
if (!start())
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Could not start replay"));
|
||||
break;
|
||||
case SrpState_def::Stopped:
|
||||
case SrpState::Stopped:
|
||||
if (!stop())
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Could not stop replay"));
|
||||
break;
|
||||
|
||||
@@ -231,7 +231,7 @@ void StaticPublisher::publishTranslationBlob(const std::shared_ptr<ProjectDataMa
|
||||
return;
|
||||
|
||||
const QJsonObject jObj{ {QStringLiteral("translations"), arr} };
|
||||
const QByteArray data = QJsonDocument(jObj).toBinaryData();
|
||||
const QByteArray data = QJsonDocument(jObj).toJson(QJsonDocument::Compact);
|
||||
const QByteArray compressed = qCompress(data, 9);
|
||||
const QByteArray md5Sum = QCryptographicHash::hash(compressed, QCryptographicHash::Md5).toHex();
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
|
||||
} // Namespace SoundManagement
|
||||
@@ -86,14 +86,14 @@ bool HandlerSounds::init()
|
||||
<< " name=" << soundEntry.name
|
||||
<< " displayName=" << soundEntry.displayName;
|
||||
|
||||
sound.id(soundEntry.index);
|
||||
sound.category(soundEntry.category);
|
||||
sound.soundId(soundEntry.soundId);
|
||||
sound.name(soundEntry.name.toStdString());
|
||||
sound.displayName(soundEntry.displayName.toStdString());
|
||||
sound.duration(soundEntry.duration);
|
||||
sound.isRepeatable(soundEntry.isRepeatable);
|
||||
topicData.sounds().push_back(sound);
|
||||
sound.id = soundEntry.index;
|
||||
sound.category = soundEntry.category;
|
||||
sound.soundId = soundEntry.soundId;
|
||||
sound.name = soundEntry.name.toStdString();
|
||||
sound.displayName = soundEntry.displayName.toStdString();
|
||||
sound.duration = soundEntry.duration;
|
||||
sound.isRepeatable = soundEntry.isRepeatable;
|
||||
topicData.sounds.push_back(sound);
|
||||
index++;
|
||||
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void HandlerSounds::onStopAllSoundsRequest(const rti::core::SampleIdentity &cook
|
||||
DEBUG_LOG(m_logger) << "StopAllSounds: " << request;
|
||||
int failedCount = 0;
|
||||
|
||||
if (request.egcuId() == -1) // stopp all sounds on each EGCU
|
||||
if (request.egcuId == -1) // stopp all sounds on each EGCU
|
||||
{
|
||||
QHashIterator<int, QString> i(m_hostnames);
|
||||
|
||||
@@ -175,9 +175,9 @@ void HandlerSounds::onStopAllSoundsRequest(const rti::core::SampleIdentity &cook
|
||||
}
|
||||
else
|
||||
{
|
||||
QString hostname = m_hostnames.value(request.egcuId());
|
||||
QString hostname = m_hostnames.value(request.egcuId);
|
||||
DEBUG_LOG(m_logger) << "getActiveSound hostname=" << hostname;
|
||||
if (!stopAllSounds(request.egcuId()).isEmpty()) // BLOCKING
|
||||
if (!stopAllSounds(request.egcuId).isEmpty()) // BLOCKING
|
||||
failedCount++;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void HandlerSounds::onGetSoundsRequest(const rti::core::SampleIdentity &cookie,
|
||||
|
||||
QString HandlerSounds::enumToString(const SoundCategory &category)
|
||||
{
|
||||
switch (category.underlying())
|
||||
switch (category)
|
||||
{
|
||||
case SoundManagement::SoundCategory::Aircraft:
|
||||
return QStringLiteral("Aircrafts");
|
||||
@@ -280,17 +280,17 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
|
||||
const ControlSoundRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "ControlSound: " << request
|
||||
<< " category=" << request.category();
|
||||
<< " category=" << request.category;
|
||||
|
||||
const QString user = Settings::somUser();
|
||||
const QString passwd = Settings::somPasswd();
|
||||
const QString hostname = m_hostnames.value(request.egcuId());
|
||||
const QString hostname = m_hostnames.value(request.egcuId);
|
||||
|
||||
switch (request.control().underlying())
|
||||
switch (request.control)
|
||||
{
|
||||
case SoundManagement::PlayControl::StopSound:
|
||||
{
|
||||
onStopSingleSound(request.egcuId(), request.category(), request.soundId());
|
||||
onStopSingleSound(request.egcuId, request.category, request.soundId);
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
|
||||
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
|
||||
break;
|
||||
@@ -298,19 +298,19 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
|
||||
case SoundManagement::PlayControl::PlaySingle:
|
||||
case SoundManagement::PlayControl::PlayLoop: // NOTE: falls through if PlaySingle !
|
||||
{
|
||||
const bool loop = (request.control().underlying() == SoundManagement::PlayControl::PlayLoop);
|
||||
const int durationMs = getDuration(request.category(), request.soundId());
|
||||
const bool loop = (request.control == SoundManagement::PlayControl::PlayLoop);
|
||||
const int durationMs = getDuration(request.category, request.soundId);
|
||||
// QTimer::singleShot(1 * 60 * 1000, this, [id, this]() { m_mainHandler->dds()->dtsAlm()->removeNotificationByKey(id); });
|
||||
const int soundId = request.soundId();
|
||||
const int egcuId = request.egcuId();
|
||||
const SoundManagement::SoundCategory category = request.category();
|
||||
const int soundId = request.soundId;
|
||||
const int egcuId = request.egcuId;
|
||||
const SoundManagement::SoundCategory category = request.category;
|
||||
DEBUG_LOG(m_logger) << "Play: durationMs=" << durationMs
|
||||
<< " egcuId=" << egcuId
|
||||
<< " soundId=" << soundId
|
||||
<< " loop=" << loop;
|
||||
const int control = static_cast<int>(request.control().underlying());
|
||||
const int volumePercent = static_cast<int>(request.volumePercent());
|
||||
const QString msg(playBackgroundSound(user, passwd, hostname, enumToString(request.category()), request.soundId(), volumePercent, control)); // => blocking !!
|
||||
const int control = static_cast<int>(request.control);
|
||||
const int volumePercent = static_cast<int>(request.volumePercent);
|
||||
const QString msg(playBackgroundSound(user, passwd, hostname, enumToString(request.category), request.soundId, volumePercent, control)); // => blocking !!
|
||||
|
||||
if (!msg.isEmpty())
|
||||
{
|
||||
@@ -326,17 +326,17 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
|
||||
// insert into m_soundStates
|
||||
|
||||
SoundManagement::SoundState soundState;
|
||||
soundState.egcuId(egcuId);
|
||||
soundState.soundId(soundId);
|
||||
soundState.category(request.category());
|
||||
soundState.id(m_indexActiveSound);
|
||||
soundState.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
soundState.inLoop(loop);
|
||||
soundState.egcuId = egcuId;
|
||||
soundState.soundId = soundId;
|
||||
soundState.category = request.category;
|
||||
soundState.id = m_indexActiveSound;
|
||||
soundState.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
soundState.inLoop = loop;
|
||||
DEBUG_LOG(m_logger) << "id=" << m_indexActiveSound
|
||||
<< " category=" << request.category()
|
||||
<< " egcuId=" << request.egcuId()
|
||||
<< " soundId=" << request.soundId()
|
||||
<< " time=" << soundState.sampleTime();
|
||||
<< " category=" << request.category
|
||||
<< " egcuId=" << request.egcuId
|
||||
<< " soundId=" << request.soundId
|
||||
<< " time=" << soundState.sampleTime;
|
||||
m_ddsHandler->dtsSom()->publish(soundState);
|
||||
m_soundStates.append(soundState);
|
||||
|
||||
@@ -349,14 +349,14 @@ void HandlerSounds::onControlSoundRequest(const rti::core::SampleIdentity &cooki
|
||||
}
|
||||
case SoundManagement::PlayControl::StopAllSounds:
|
||||
{
|
||||
stopAllSounds(request.egcuId());
|
||||
stopAllSounds(request.egcuId);
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
|
||||
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
|
||||
break;
|
||||
}
|
||||
case SoundManagement::PlayControl::GetState:
|
||||
{
|
||||
getActiveSound(request.egcuId());
|
||||
getActiveSound(request.egcuId);
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(0);
|
||||
m_ddsHandler->ftsSom()->controlSoundReply(cookie, reply);
|
||||
break;
|
||||
@@ -379,10 +379,10 @@ void HandlerSounds::onStopSingleSound(const int egcuId, const SoundManagement::
|
||||
while (it.hasNext())
|
||||
{
|
||||
const SoundState &item = it.next();
|
||||
if ((item.soundId() == soundId) && (item.egcuId() == egcuId) && item.category() == soundCategory)
|
||||
if ((item.soundId == soundId) && (item.egcuId == egcuId) && item.category == soundCategory)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << item.id()
|
||||
<< " egcuId=" << item.egcuId();
|
||||
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << item.id
|
||||
<< " egcuId=" << item.egcuId;
|
||||
|
||||
{
|
||||
// start update request
|
||||
@@ -403,7 +403,7 @@ void HandlerSounds::onStopSingleSound(const int egcuId, const SoundManagement::
|
||||
startRequest(url);
|
||||
}
|
||||
|
||||
m_ddsHandler->dtsSom()->removeSoundStateByKey(item.id());
|
||||
m_ddsHandler->dtsSom()->removeSoundStateByKey(item.id);
|
||||
it.remove();
|
||||
// combination of soundId and egcuId may occur more than once, do not break the loop
|
||||
}
|
||||
@@ -439,13 +439,13 @@ QString HandlerSounds::stopAllSounds(const int egcuId)
|
||||
{
|
||||
const SoundState &ss(it.next());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sound EGCU=" << ss.egcuId() << " soundId=" << ss.soundId();
|
||||
if (ss.egcuId() != egcuId)
|
||||
DEBUG_LOG(m_logger) << "Sound EGCU=" << ss.egcuId << " soundId=" << ss.soundId;
|
||||
if (ss.egcuId != egcuId)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << ss.id()
|
||||
<< " egcuId=" << ss.egcuId();
|
||||
m_ddsHandler->dtsSom()->removeSoundStateByKey(ss.id());
|
||||
DEBUG_LOG(m_logger) << "remove Sound from DDS-BUS id=" << ss.id
|
||||
<< " egcuId=" << ss.egcuId;
|
||||
m_ddsHandler->dtsSom()->removeSoundStateByKey(ss.id);
|
||||
it.remove();
|
||||
}
|
||||
|
||||
@@ -693,23 +693,23 @@ void HandlerSounds::handleSoundReport(const QString &json, const QString &host)
|
||||
int soundId = getSoundIndex(category, name);
|
||||
|
||||
|
||||
soundState.egcuId(egcuId);
|
||||
soundState.soundId(soundId);
|
||||
soundState.category(category);
|
||||
soundState.id(m_indexActiveSound);
|
||||
soundState.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
soundState.egcuId = egcuId;
|
||||
soundState.soundId = soundId;
|
||||
soundState.category = category;
|
||||
soundState.id = m_indexActiveSound;
|
||||
soundState.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
DEBUG_LOG(m_logger) << "id=" << m_indexActiveSound
|
||||
<< " category=" << categoryStr
|
||||
<< " name=" << name
|
||||
<< " egcuId=" << egcuId
|
||||
<< " soundId=" << soundId
|
||||
<< " time=" << soundState.sampleTime();
|
||||
<< " time=" << soundState.sampleTime;
|
||||
|
||||
for (const SoundManagement::SoundState& item : qAsConst(m_soundStates))
|
||||
{
|
||||
if ( (item.egcuId() == soundState.egcuId()) &&
|
||||
(item.category() == soundState.category()) &&
|
||||
(item.soundId() == soundState.soundId()) )
|
||||
if ( (item.egcuId == soundState.egcuId) &&
|
||||
(item.category == soundState.category) &&
|
||||
(item.soundId == soundState.soundId) )
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Sound is already on DDS-Bus";
|
||||
found = true;
|
||||
@@ -750,24 +750,24 @@ void HandlerSounds::onInstrumentationAssetChanged(const InfrastructureManagement
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id()
|
||||
<< " hostname=" << QString::fromStdString(data.hostname())
|
||||
<< " mountingPointTypeId=" << data.mountingPointTypeId()
|
||||
<< " assetStateId=" << data.assetStateId();
|
||||
if ((data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
|
||||
&& data.assetStateId() == InfrastructureManagement::InstrumentationAssetState::Mounted
|
||||
&& data.hostname().size() > 0)
|
||||
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id=" << data.id
|
||||
<< " hostname=" << QString::fromStdString(data.hostname)
|
||||
<< " mountingPointTypeId=" << data.mountingPointTypeId
|
||||
<< " assetStateId=" << data.assetStateId;
|
||||
if ((data.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
|
||||
&& data.assetStateId == InfrastructureManagement::InstrumentationAssetState::Mounted
|
||||
&& data.hostname.size() > 0)
|
||||
{
|
||||
QString hostname = QString::fromStdString(data.hostname());
|
||||
DEBUG_LOG(m_logger) << "m_hostnames.insert id=" << data.id()
|
||||
QString hostname = QString::fromStdString(data.hostname);
|
||||
DEBUG_LOG(m_logger) << "m_hostnames.insert id=" << data.id
|
||||
<< " hostname=" << hostname
|
||||
<< " hostname.size=" << hostname.size()
|
||||
<< " mountingPointTypeId=" << data.mountingPointTypeId()
|
||||
<< " assetStateId=" << data.assetStateId();
|
||||
<< " mountingPointTypeId=" << data.mountingPointTypeId
|
||||
<< " assetStateId=" << data.assetStateId;
|
||||
if (hostname.size() > 0 )
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "insert EGCU in m_hostnames " << data.hostname();
|
||||
m_hostnames.insert(data.id(), QString::fromStdString(data.hostname()));
|
||||
DEBUG_LOG(m_logger) << "insert EGCU in m_hostnames " << data.hostname;
|
||||
m_hostnames.insert(data.id, QString::fromStdString(data.hostname));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,18 +778,18 @@ void HandlerSounds::onMountingPointAssetChanged(const InfrastructureManagement::
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged"
|
||||
<< " id= " << data.id()
|
||||
<< " assetId= " << data.assetId()
|
||||
<< " structureElementId= " << data.structureElementId();
|
||||
m_mountingPointAsset.insert(data.structureElementId(),data.assetId());
|
||||
<< " id= " << data.id
|
||||
<< " assetId= " << data.assetId
|
||||
<< " structureElementId= " << data.structureElementId;
|
||||
m_mountingPointAsset.insert(data.structureElementId,data.assetId);
|
||||
}
|
||||
|
||||
void HandlerSounds::onSoundStateChanged(const SoundManagement::SoundState &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onSoundStateChanged"
|
||||
<< " id= " << data.id()
|
||||
<< " egcuId= " << data.egcuId()
|
||||
<< " soundId=" << data.soundId()
|
||||
<< " id= " << data.id
|
||||
<< " egcuId= " << data.egcuId
|
||||
<< " soundId=" << data.soundId
|
||||
<< " modType=" << modType;
|
||||
|
||||
if (modType != DataModification::eAdded &&
|
||||
|
||||
@@ -39,7 +39,7 @@ using DbHandler = NGLDB::DbServiceHandler<DatabaseInterface>;
|
||||
inline QPointF geographic2Utm(const Core::GeoPosition2D &geoPos, int *zone = nullptr)
|
||||
{
|
||||
const int zoneToUse = zone ? *zone : -1;
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon(), geoPos.lat(), zoneToUse);
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoPos.lon, geoPos.lat, zoneToUse);
|
||||
if (zone)
|
||||
*zone = utm.zone;
|
||||
return {utm.x, utm.y};
|
||||
|
||||
+30
-30
@@ -122,14 +122,14 @@ void TgtTests::tryCreateShootbackArea()
|
||||
{
|
||||
ShootbackAreaModifyRequest request;
|
||||
|
||||
request.id(0); // force create
|
||||
request.name("Test ShootbackArea");
|
||||
request.id = 0; // force create
|
||||
request.name = "Test ShootbackArea";
|
||||
double lon = 0.15530364;
|
||||
double lat = 0.92601523;
|
||||
request.position().lon(lon);
|
||||
request.position().lat(lat);
|
||||
request.width(100);
|
||||
request.height(100);
|
||||
request.position.lon = lon;
|
||||
request.position.lat = lat;
|
||||
request.width = 100;
|
||||
request.height = 100;
|
||||
|
||||
if (!m_ftcTgt->shootbackAreaModifyRequest(request, this))
|
||||
{
|
||||
@@ -144,8 +144,8 @@ void TgtTests::tryUpdateShootbackArea()
|
||||
{
|
||||
ShootbackAreaModifyRequest request;
|
||||
|
||||
request.id(m_shootbackAreaId); // update specific id
|
||||
request.name("Test ShootbackArea Updated");
|
||||
request.id = m_shootbackAreaId; // update specific id
|
||||
request.name = "Test ShootbackArea Updated";
|
||||
|
||||
if (!m_ftcTgt->shootbackAreaModifyRequest(request, this))
|
||||
{
|
||||
@@ -160,7 +160,7 @@ void TgtTests::tryRemoveShootbackArea()
|
||||
{
|
||||
ShootbackAreaRemoveRequest request;
|
||||
|
||||
request.id(m_shootbackAreaId); // remove specific id
|
||||
request.id = m_shootbackAreaId; // remove specific id
|
||||
|
||||
if (!m_ftcTgt->shootbackAreaRemoveRequest(request, this))
|
||||
{
|
||||
@@ -177,9 +177,9 @@ void TgtTests::tryRequestTechnicalState()
|
||||
|
||||
ConfigureTargetRequest request;
|
||||
|
||||
request.id(0);
|
||||
request.participantId(5);
|
||||
request.tgtCommand(TargetManagement::TgtCommand_def::RequestTechnicalState);
|
||||
request.id = 0;
|
||||
request.participantId = 5;
|
||||
request.tgtCommand = TargetManagement::TgtCommand::RequestTechnicalState;
|
||||
|
||||
if (!m_ftcTgt->configureTargetRequest(request, this))
|
||||
{
|
||||
@@ -195,11 +195,11 @@ void TgtTests::tryConfigureTargetMode()
|
||||
|
||||
ConfigureTargetRequest request;
|
||||
|
||||
request.id(0);
|
||||
request.participantId(5);
|
||||
TargetManagement::Mode mode = TargetManagement::Mode_def::ShootBack;
|
||||
request.tgtCommand(TargetManagement::TgtCommand_def::SetMode);
|
||||
request.mode(mode);
|
||||
request.id = 0;
|
||||
request.participantId = 5;
|
||||
TargetManagement::Mode mode = TargetManagement::Mode::ShootBack;
|
||||
request.tgtCommand = TargetManagement::TgtCommand::SetMode;
|
||||
request.mode = mode;
|
||||
|
||||
|
||||
if (!m_ftcTgt->configureTargetRequest(request, this))
|
||||
@@ -216,10 +216,10 @@ void TgtTests::tryConfigureTargetWeapon()
|
||||
|
||||
ConfigureTargetRequest request;
|
||||
|
||||
request.id(0);
|
||||
request.participantId(5);
|
||||
request.tgtCommand(TargetManagement::TgtCommand_def::SetWeapon);
|
||||
request.weapon(1); // AK47
|
||||
request.id = 0;
|
||||
request.participantId = 5;
|
||||
request.tgtCommand = TargetManagement::TgtCommand::SetWeapon;
|
||||
request.weapon = 1; // AK47
|
||||
|
||||
if (!m_ftcTgt->configureTargetRequest(request, this))
|
||||
{
|
||||
@@ -235,10 +235,10 @@ void TgtTests::tryCreateTargetData()
|
||||
{
|
||||
TrainingAreaBase::TargetData targetData;
|
||||
|
||||
targetData.equipmentNumber(1001);
|
||||
targetData.equipmentNumber = 1001;
|
||||
|
||||
// Shoot Back - AK 47
|
||||
targetData.payload() = {0x65, 0x01, 0x01, 0xae, 0xff, 0x00 };
|
||||
targetData.payload = {0x65, 0x01, 0x01, 0xae, 0xff, 0x00 };
|
||||
|
||||
if (!m_dtsTab->publish(targetData))
|
||||
{
|
||||
@@ -252,13 +252,13 @@ void TgtTests::tryCreateParticipant()
|
||||
{
|
||||
INFO_LOG(m_logger) << "trying to create Participant index = " << m_participantIndex;
|
||||
ParticipantManagement::Participant participant;
|
||||
participant.id(5);
|
||||
participant.superiorId(0);
|
||||
participant.inferiorIds().resize(2);
|
||||
participant.inferiorIds().at(0) = 2;
|
||||
participant.inferiorIds().at(1) = 3;
|
||||
participant.partyId(5);
|
||||
participant.equipmentNumber(1001);
|
||||
participant.id = 5;
|
||||
participant.superiorId = 0;
|
||||
participant.inferiorIds.resize(2);
|
||||
participant.inferiorIds.at(0) = 2;
|
||||
participant.inferiorIds.at(1) = 3;
|
||||
participant.partyId = 5;
|
||||
participant.equipmentNumber = 1001;
|
||||
DEBUG_LOG(m_logger) << "Publishing Participant";
|
||||
if (!m_dtsPpm->publish(participant))
|
||||
{
|
||||
|
||||
@@ -84,13 +84,13 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
auto cb = [this](const ParticipantManagement::Participant & participant)
|
||||
{
|
||||
if (participant.equipmentNumber().is_set())
|
||||
if (participant.equipmentNumber.is_set())
|
||||
{
|
||||
m_partId2EquipNoMap.insert(participant.id(), participant.equipmentNumber().get());
|
||||
m_equipNo2partIdMap.insert(participant.equipmentNumber().get(), participant.id());
|
||||
m_partId2EquipNoMap.insert(participant.id, participant.equipmentNumber.get());
|
||||
m_equipNo2partIdMap.insert(participant.equipmentNumber.get(), participant.id);
|
||||
}
|
||||
else
|
||||
m_partId2EquipNoMap.insert(participant.id(), 0);
|
||||
m_partId2EquipNoMap.insert(participant.id, 0);
|
||||
};
|
||||
m_dtcPpm->participants(cb);
|
||||
}
|
||||
@@ -124,12 +124,12 @@ void DdsHandler::onParticipantChanged(const ParticipantManagement::Participant &
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged";
|
||||
if (modType == DataModification::eRemoved)
|
||||
m_partId2EquipNoMap.remove(data.id());
|
||||
m_partId2EquipNoMap.remove(data.id);
|
||||
else
|
||||
{
|
||||
m_partId2EquipNoMap[data.id()] = data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0;
|
||||
if (data.equipmentNumber().is_set())
|
||||
m_equipNo2partIdMap.insert(data.equipmentNumber().get(), data.id());
|
||||
m_partId2EquipNoMap[data.id] = data.equipmentNumber.is_set() ? data.equipmentNumber.get() : 0;
|
||||
if (data.equipmentNumber.is_set())
|
||||
m_equipNo2partIdMap.insert(data.equipmentNumber.get(), data.id);
|
||||
}
|
||||
|
||||
if (m_logger.isTraceEnabled())
|
||||
|
||||
+36
-36
@@ -41,20 +41,20 @@ void HandlerTargetConfig::onTargetDataChanged(const TrainingAreaBase::TargetData
|
||||
|
||||
uint8_t responseCmd = 100;
|
||||
TargetManagement::TargetConfig tgtTargetData;
|
||||
INFO_LOG(m_logger) << "onTargetDataChanged payload.size=" << targetData.payload().size();
|
||||
tgtTargetData.participantId(m_ddsHandler->equipNo2participantId(targetData.equipmentNumber()));
|
||||
for (size_t i = 0; i < targetData.payload().size(); i++)
|
||||
INFO_LOG(m_logger) << "payload[" << i << "]=" << targetData.payload()[i];
|
||||
INFO_LOG(m_logger) << "onTargetDataChanged payload.size=" << targetData.payload.size();
|
||||
tgtTargetData.participantId = m_ddsHandler->equipNo2participantId(targetData.equipmentNumber);
|
||||
for (size_t i = 0; i < targetData.payload.size(); i++)
|
||||
INFO_LOG(m_logger) << "payload[" << i << "]=" << targetData.payload[i];
|
||||
|
||||
if (targetData.payload().size() < 6)
|
||||
if (targetData.payload.size() < 6)
|
||||
return;
|
||||
tgtTargetData.id(0);
|
||||
tgtTargetData.tgtCommand(static_cast <TargetManagement::TgtCommand_def::type>(targetData.payload()[0] - responseCmd));
|
||||
tgtTargetData.mode(static_cast <TargetManagement::Mode_def::type>(targetData.payload()[1]));
|
||||
tgtTargetData.weapon(targetData.payload()[2]);
|
||||
INFO_LOG(m_logger) << "tgtTargetData.tgtCommand =" << tgtTargetData.tgtCommand()
|
||||
<< " mode=" << tgtTargetData.mode()
|
||||
<< " weapon=" << tgtTargetData.weapon();
|
||||
tgtTargetData.id = 0;
|
||||
tgtTargetData.tgtCommand = static_cast <TargetManagement::TgtCommand_def::type>(targetData.payload[0] - responseCmd);
|
||||
tgtTargetData.mode = static_cast <TargetManagement::Mode_def::type>(targetData.payload[1]);
|
||||
tgtTargetData.weapon = targetData.payload[2];
|
||||
INFO_LOG(m_logger) << "tgtTargetData.tgtCommand =" << tgtTargetData.tgtCommand
|
||||
<< " mode=" << tgtTargetData.mode
|
||||
<< " weapon=" << tgtTargetData.weapon;
|
||||
if (!m_dtsTgt->publish(tgtTargetData))
|
||||
ERROR_LOG(m_logger) << "Error publish targetData";
|
||||
} // end of onTargetDataChanged
|
||||
@@ -72,63 +72,63 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
const ConfigureTargetRequest &request)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onConfigureTargetRequest";
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(request.id());
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(request.id);
|
||||
|
||||
DEBUG_LOG(m_logger) << "HandlerTargetConfig onTargetConfigChanged participantId=" << request.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerTargetConfig onTargetConfigChanged participantId=" << request.participantId;
|
||||
|
||||
TrainingAreaBase::SendTargetDataRequest tgt;
|
||||
const int participantId = request.participantId();
|
||||
tgt.equipmentNumber(m_ddsHandler->participantId2EquipNo(participantId));
|
||||
tgt.participantId(request.participantId());
|
||||
const int participantId = request.participantId;
|
||||
tgt.equipmentNumber = m_ddsHandler->participantId2EquipNo(participantId);
|
||||
tgt.participantId = request.participantId;
|
||||
|
||||
tgt.payload().push_back(request.tgtCommand().underlying());
|
||||
tgt.payload.push_back(request.tgtCommand);
|
||||
|
||||
switch (request.tgtCommand().underlying())
|
||||
switch (request.tgtCommand)
|
||||
{
|
||||
case TargetManagement::TgtCommand_def::Unknown:
|
||||
case TargetManagement::TgtCommand_def::PlaySound:
|
||||
case TargetManagement::TgtCommand::Unknown:
|
||||
case TargetManagement::TgtCommand::PlaySound:
|
||||
{
|
||||
WARNING_LOG(m_logger) << "onTargetConfigChanged Command =" << request.tgtCommand() << " not handled.";
|
||||
WARNING_LOG(m_logger) << "onTargetConfigChanged Command =" << request.tgtCommand << " not handled.";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, reply);
|
||||
return;
|
||||
}
|
||||
case TargetManagement::TgtCommand_def::RequestTechnicalState:
|
||||
case TargetManagement::TgtCommand_def::RequestParameter:
|
||||
case TargetManagement::TgtCommand::RequestTechnicalState:
|
||||
case TargetManagement::TgtCommand::RequestParameter:
|
||||
{
|
||||
// No specific data to add to payload
|
||||
break;
|
||||
}
|
||||
case TargetManagement::TgtCommand_def::SetMode:
|
||||
case TargetManagement::TgtCommand::SetMode:
|
||||
{
|
||||
if (!request.mode().is_set())
|
||||
if (!request.mode.is_set())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set mode requested, but mode ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set mode requested, but mode is not set")));
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set mode requested, but mode is not set")));
|
||||
return;
|
||||
}
|
||||
tgt.payload().push_back(request.mode().get().underlying());
|
||||
tgt.payload.push_back(request.mode.get());
|
||||
break;
|
||||
}
|
||||
case TargetManagement::TgtCommand_def::SetWeapon:
|
||||
case TargetManagement::TgtCommand::SetWeapon:
|
||||
{
|
||||
if (!request.weapon().is_set())
|
||||
if (!request.weapon.is_set())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set weapon requested, but weapon ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set weapon requested, but weapon is not set")));
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set weapon requested, but weapon is not set")));
|
||||
return;
|
||||
}
|
||||
tgt.payload().push_back(request.weapon().get());
|
||||
tgt.payload.push_back(request.weapon.get());
|
||||
break;
|
||||
}
|
||||
case TargetManagement::TgtCommand_def::SetParameter:
|
||||
case TargetManagement::TgtCommand::SetParameter:
|
||||
{
|
||||
if (!request.parameterSet().is_set())
|
||||
if (!request.parameterSet.is_set())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Set parameterset requested, but parameterset ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set parameterset requested, but parameterset is not set")));
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId, tr_lts("dds", "Set parameterset requested, but parameterset is not set")));
|
||||
return;
|
||||
}
|
||||
tgt.payload().push_back(request.parameterSet().get());
|
||||
tgt.payload.push_back(request.parameterSet.get());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ void AvsInterface::doConnect()
|
||||
this, &AvsInterface::onConnected);
|
||||
connect(m_socket, &QTcpSocket::disconnected,
|
||||
this, &AvsInterface::onDisonnected);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
|
||||
connect(m_socket, &QTcpSocket::errorOccurred,
|
||||
this, &AvsInterface::onError);
|
||||
connect(m_socket, &QTcpSocket::readyRead,
|
||||
this, &AvsInterface::onReadyRead);
|
||||
|
||||
+18
-18
@@ -55,7 +55,7 @@ bool HandlerInfrastructureData::init(int exerciseId)
|
||||
auto predicate =
|
||||
[](const InfrastructureManagement::InstrumentationAsset & a)
|
||||
{
|
||||
return a.mountingPointTypeId() == InfrastructureManagement::MountingPointType::IndoorCamera;
|
||||
return a.mountingPointTypeId == InfrastructureManagement::MountingPointType::IndoorCamera;
|
||||
};
|
||||
if (!m_dtc->getAllAssetsPerRoom(predicate, assetsMap))
|
||||
{
|
||||
@@ -68,21 +68,21 @@ bool HandlerInfrastructureData::init(int exerciseId)
|
||||
const int roomId = i.key();
|
||||
for (const InfrastructureManagement::InstrumentationAsset &asset : i.value())
|
||||
{
|
||||
auto it = std::find(asset.availableInExercise().begin(),
|
||||
asset.availableInExercise().end(), m_exerciseId);
|
||||
if (it == asset.availableInExercise().end())
|
||||
auto it = std::find(asset.availableInExercise.begin(),
|
||||
asset.availableInExercise.end(), m_exerciseId);
|
||||
if (it == asset.availableInExercise.end())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Asset " << asset.id()
|
||||
DEBUG_LOG(m_logger) << "Asset " << asset.id
|
||||
<< " is not available in current exercise - skipping";
|
||||
continue;
|
||||
}
|
||||
// in interne m_roomId2CameraNameMap eintragen, zur Zeit nur eine Kamera pro Raum möglich
|
||||
m_roomId2CameraNameMap.insert(roomId, QString::fromStdString(asset.name()));
|
||||
m_roomId2CameraNameMap.insert(roomId, QString::fromStdString(asset.name));
|
||||
// und fuer subscribe in m_assetId2RoomIdMap eintragen
|
||||
m_assetId2RoomIdMap.insert(asset.id(), roomId);
|
||||
DEBUG_LOG(m_logger) << " assetId: " << asset.id()
|
||||
<< " mountingPointTypeId: " << asset.mountingPointTypeId()
|
||||
<< " name: " << asset.name();
|
||||
m_assetId2RoomIdMap.insert(asset.id, roomId);
|
||||
DEBUG_LOG(m_logger) << " assetId: " << asset.id
|
||||
<< " mountingPointTypeId: " << asset.mountingPointTypeId
|
||||
<< " name: " << asset.name;
|
||||
}
|
||||
} // for(auto i = assetMap...
|
||||
|
||||
@@ -126,24 +126,24 @@ QString HandlerInfrastructureData::getStreamNameFromRoomId(int roomId) const
|
||||
void HandlerInfrastructureData::onAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
if (data.mountingPointTypeId() != InfrastructureManagement::MountingPointType::IndoorCamera)
|
||||
if (data.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorCamera)
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "onAssetChanged()"
|
||||
<< " assetId: " << data.id()
|
||||
<< " name: " << data.name();
|
||||
<< " assetId: " << data.id
|
||||
<< " name: " << data.name;
|
||||
|
||||
auto it = std::find(data.availableInExercise().begin(),
|
||||
data.availableInExercise().end(), m_exerciseId);
|
||||
if (it == data.availableInExercise().end())
|
||||
auto it = std::find(data.availableInExercise.begin(),
|
||||
data.availableInExercise.end(), m_exerciseId);
|
||||
if (it == data.availableInExercise.end())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Asset " << data.id()
|
||||
DEBUG_LOG(m_logger) << "Asset " << data.id
|
||||
<< " is not available in current exercise - skipping";
|
||||
return;
|
||||
}
|
||||
|
||||
// Hier muss aus der AssetId die zugehoerige roomid verwendet werden !!
|
||||
m_roomId2CameraNameMap.insert(getRoomIdFromAssetId(data.id()), QString::fromStdString(data.name()));
|
||||
m_roomId2CameraNameMap.insert(getRoomIdFromAssetId(data.id), QString::fromStdString(data.name));
|
||||
|
||||
for (auto i = m_roomId2CameraNameMap.begin(); i != m_roomId2CameraNameMap.end(); ++i)
|
||||
{
|
||||
|
||||
+10
-10
@@ -57,7 +57,7 @@ bool HandlerParticipantData::init()
|
||||
// Position in ParticipantsPositionMap eintragen
|
||||
auto cbParticipantPos = [this](const ParticipantManagement::ParticipantPosition &participantPos)
|
||||
{
|
||||
m_participantsPositionMap.insert(participantPos.participantId(), participantPos.roomId());
|
||||
m_participantsPositionMap.insert(participantPos.participantId, participantPos.roomId);
|
||||
};
|
||||
m_dtc->participantPositions(cbParticipantPos);
|
||||
|
||||
@@ -88,12 +88,12 @@ QMap<int, int> HandlerParticipantData::getAllAssignedParticipants() const
|
||||
|
||||
void HandlerParticipantData::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onParticipantChanged() participantId:" << data.id();
|
||||
INFO_LOG(m_logger) << "onParticipantChanged() participantId:" << data.id;
|
||||
|
||||
if (modType != DataModification::eRemoved && data.equipmentNumber().is_set())
|
||||
m_partId2EquipNoMap.insert(data.id(), data.equipmentNumber().get());
|
||||
if (modType != DataModification::eRemoved && data.equipmentNumber.is_set())
|
||||
m_partId2EquipNoMap.insert(data.id, data.equipmentNumber.get());
|
||||
else
|
||||
m_partId2EquipNoMap.remove(data.id());
|
||||
m_partId2EquipNoMap.remove(data.id);
|
||||
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
@@ -107,23 +107,23 @@ void HandlerParticipantData::onParticipantChanged(const ParticipantManagement::P
|
||||
|
||||
void HandlerParticipantData::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType)
|
||||
{
|
||||
const int newRoomId = data.roomId();
|
||||
const int newRoomId = data.roomId;
|
||||
// get reference to room (will be created if not exist)
|
||||
int &roomId = m_participantsPositionMap[data.participantId()];
|
||||
int &roomId = m_participantsPositionMap[data.participantId];
|
||||
// remember old room
|
||||
const int oldRoomId = roomId;
|
||||
// assing new room
|
||||
roomId = modType == DataModification::eRemoved ? 0 : newRoomId;
|
||||
if (newRoomId != oldRoomId)
|
||||
emit participantPositionChanged(oldRoomId, newRoomId, data.participantId());
|
||||
emit participantPositionChanged(oldRoomId, newRoomId, data.participantId);
|
||||
|
||||
INFO_LOG(m_logger) << "onParticipantPositionChanged()"
|
||||
<< " oldRoomId: " << oldRoomId
|
||||
<< " newRoomId: " << newRoomId
|
||||
<< " participantId: " << data.participantId();
|
||||
<< " participantId: " << data.participantId;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
m_participantsPositionMap.remove(data.participantId());
|
||||
m_participantsPositionMap.remove(data.participantId);
|
||||
|
||||
} // end of onParticipantPositionChanged()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+69
-69
@@ -169,10 +169,10 @@ void WhgTests::tryModify()
|
||||
EquipmentTypeWh data;
|
||||
getEqtTypeWhModifyRequestData(data);
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send ModifyEquipementTypeWhRequest for eqtTypeWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send ModifyEquipementTypeWhRequest for eqtTypeWhId:" << data.id;
|
||||
if (!m_ftc->modifyEquipmentTypeWhRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for eqtTypeWhId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for eqtTypeWhId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModify()
|
||||
@@ -183,12 +183,12 @@ void WhgTests::tryRemove()
|
||||
m_eTestStep = eRemove;
|
||||
RemoveEquipmentTypeWhRequest data;
|
||||
|
||||
data.id(m_equipmentTypeWhId);
|
||||
data.id = m_equipmentTypeWhId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for eqtTypeWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for eqtTypeWhId:" << data.id;
|
||||
if (!m_ftc->removeEquipmentTypeWhRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for eqtTypeWhId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for eqtTypeWhId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemove()
|
||||
@@ -213,10 +213,10 @@ void WhgTests::tryGetAllEquipmentTypesWh()
|
||||
for (auto it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
INFO_LOG(m_logger) << "whg(" << it.key() << ") :"
|
||||
<< " name:" << it.value().name()
|
||||
<< " minEquipNo:" << it.value().minEquipNo()
|
||||
<< " maxEquipNo:" << it.value().maxEquipNo()
|
||||
<< " vbAgdus:" << it.value().vbAgdusId();
|
||||
<< " name:" << it.value().name
|
||||
<< " minEquipNo:" << it.value().minEquipNo
|
||||
<< " maxEquipNo:" << it.value().maxEquipNo
|
||||
<< " vbAgdus:" << it.value().vbAgdusId;
|
||||
}
|
||||
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
@@ -240,18 +240,18 @@ void WhgTests::tryGetEquipmentTypeWh()
|
||||
m_dtc->waitForHistoricalDataEquipmentTypeWh();
|
||||
WarehouseGuez::EquipmentTypeWh data = m_dtc->equipmentTypeWh(m_equipmentTypeWhId);
|
||||
|
||||
if (data.id() < 0)
|
||||
if (data.id < 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error receiving data for equipmentTypeId " << m_equipmentTypeWhId << " returnVal:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for equipmentTypeId " << m_equipmentTypeWhId << " returnVal:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "whg(" << data.id() << ") :"
|
||||
<< " name:" << data.name()
|
||||
<< " minEquipNo:" << data.minEquipNo()
|
||||
<< " maxEquipNo:" << data.maxEquipNo()
|
||||
<< " vbAgdus:" << data.vbAgdusId();
|
||||
INFO_LOG(m_logger) << "whg(" << data.id << ") :"
|
||||
<< " name:" << data.name
|
||||
<< " minEquipNo:" << data.minEquipNo
|
||||
<< " maxEquipNo:" << data.maxEquipNo
|
||||
<< " vbAgdus:" << data.vbAgdusId;
|
||||
}
|
||||
|
||||
if (m_testId == 0)
|
||||
@@ -379,21 +379,21 @@ void WhgTests::onRemoveInjuryModelAgdusWhReply(const Core::FunctionReplyObject &
|
||||
//-----------------------------------------------------------------------------
|
||||
void WhgTests::onReceiveEqtTypeChanged(const EquipmentTypeWh &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onReceiveEqtTypeChanged() eqtTypeWhId:" << data.id()
|
||||
INFO_LOG(m_logger) << "onReceiveEqtTypeChanged() eqtTypeWhId:" << data.id
|
||||
<< " modificationType: = " << (int)modType<< " received";
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh added received. eqtTypeWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh added received. eqtTypeWhId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh modified received. eqtTypeWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh modified received. eqtTypeWhId:" << data.id;
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh removed received. eqtTypeWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** EquipmentTypeWh removed received. eqtTypeWhId:" << data.id;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -405,51 +405,51 @@ void WhgTests::onReceiveEqtTypeChanged(const EquipmentTypeWh &data, DataModifica
|
||||
//-----------------------------------------------------------------------------
|
||||
void WhgTests::getEqtTypeWhCreateRequestData(EquipmentTypeWh &data)
|
||||
{
|
||||
data.id(); // -1 for add, 0 is a valid id // 0 should be valid though?!?
|
||||
data.name("TestEqtTypeCreate");
|
||||
data.minEquipNo(1000);
|
||||
data.maxEquipNo(3000);
|
||||
data.vbAgdusId(1);
|
||||
data.configurationAgdusHV(ConfigurationAgdusHV_def::AgdusHWNoHelmetNoWest);
|
||||
data.id; // -1 for add, 0 is a valid id // 0 should be valid though?!?
|
||||
data.name = "TestEqtTypeCreate";
|
||||
data.minEquipNo = 1000;
|
||||
data.maxEquipNo = 3000;
|
||||
data.vbAgdusId = 1;
|
||||
data.configurationAgdusHV = ConfigurationAgdusHV::AgdusHWNoHelmetNoWest;
|
||||
|
||||
} // end of getEqtTypeWhCreateRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void WhgTests::getEqtTypeWhModifyRequestData(EquipmentTypeWh &data)
|
||||
{
|
||||
data.id(m_equipmentTypeWhId);
|
||||
data.name("TestEqtTypeModify");
|
||||
data.maxEquipNo(3100);
|
||||
data.minEquipNo(1100);
|
||||
data.vbAgdusId(2);
|
||||
data.configurationAgdusHV(ConfigurationAgdusHV_def::AgdusHWWithHelmetWithVest);
|
||||
data.id = m_equipmentTypeWhId;
|
||||
data.name = "TestEqtTypeModify";
|
||||
data.maxEquipNo = 3100;
|
||||
data.minEquipNo = 1100;
|
||||
data.vbAgdusId = 2;
|
||||
data.configurationAgdusHV = ConfigurationAgdusHV::AgdusHWWithHelmetWithVest;
|
||||
|
||||
} // end of getEqtTypeWhModifyRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void WhgTests::getInjuryModelWhCreateRequestData(InjuryModelAgdusWh &data)
|
||||
{
|
||||
data.name("TestInjuryModelCreate");
|
||||
data.version("1.0");
|
||||
data.description("This is the description");
|
||||
data.id(0);
|
||||
data.name = "TestInjuryModelCreate";
|
||||
data.version = "1.0";
|
||||
data.description = "This is the description";
|
||||
data.id = 0;
|
||||
|
||||
} // end of getInjuryModelWhCreateRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void WhgTests::getInjuryModelWhModifyRequestData(InjuryModelAgdusWh &data)
|
||||
{
|
||||
data.id(m_injuryModelWhId);
|
||||
data.name("TestInjuryModelWhModify");
|
||||
data.version("2.0");
|
||||
data.description("Description Modify");
|
||||
data.id = m_injuryModelWhId;
|
||||
data.name = "TestInjuryModelWhModify";
|
||||
data.version = "2.0";
|
||||
data.description = "Description Modify";
|
||||
|
||||
} // end of getInjuryModelWhModifyRequestData()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool WhgTests::onCompareCreatedData(EquipmentTypeWh &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -457,27 +457,27 @@ bool WhgTests::onCompareCreatedData(EquipmentTypeWh &data)
|
||||
|
||||
getEqtTypeWhCreateRequestData(createData);
|
||||
|
||||
if (createData.name() != data.name())
|
||||
if (createData.name != data.name)
|
||||
return false;
|
||||
|
||||
if (createData.minEquipNo() != data.minEquipNo())
|
||||
if (createData.minEquipNo != data.minEquipNo)
|
||||
return false;
|
||||
|
||||
if (createData.maxEquipNo() != data.maxEquipNo())
|
||||
if (createData.maxEquipNo != data.maxEquipNo)
|
||||
return false;
|
||||
|
||||
if (createData.vbAgdusId() != data.vbAgdusId())
|
||||
if (createData.vbAgdusId != data.vbAgdusId)
|
||||
return false;
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
|
||||
bool WhgTests::onCompareCreatedData(InjuryModelAgdusWh &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -485,16 +485,16 @@ bool WhgTests::onCompareCreatedData(InjuryModelAgdusWh &data)
|
||||
|
||||
getInjuryModelWhCreateRequestData(createData);
|
||||
|
||||
if (createData.name() != data.name())
|
||||
if (createData.name != data.name)
|
||||
return false;
|
||||
|
||||
if (createData.version() != data.version())
|
||||
if (createData.version != data.version)
|
||||
return false;
|
||||
|
||||
if (createData.description() != data.description())
|
||||
if (createData.description != data.description)
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
@@ -502,28 +502,28 @@ bool WhgTests::onCompareCreatedData(InjuryModelAgdusWh &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool WhgTests::onCompareModifiedData(EquipmentTypeWh &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
EquipmentTypeWh modifyData;
|
||||
|
||||
getEqtTypeWhModifyRequestData(modifyData);
|
||||
|
||||
if (modifyData.id() != data.id())
|
||||
if (modifyData.id != data.id)
|
||||
return false;
|
||||
|
||||
if (modifyData.name() != data.name())
|
||||
if (modifyData.name != data.name)
|
||||
return false;
|
||||
|
||||
if (modifyData.minEquipNo() != data.minEquipNo())
|
||||
if (modifyData.minEquipNo != data.minEquipNo)
|
||||
return false;
|
||||
|
||||
if (modifyData.maxEquipNo() != data.maxEquipNo())
|
||||
if (modifyData.maxEquipNo != data.maxEquipNo)
|
||||
return false;
|
||||
|
||||
if (modifyData.vbAgdusId() != data.vbAgdusId())
|
||||
if (modifyData.vbAgdusId != data.vbAgdusId)
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfully finished onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareModifiedData()
|
||||
@@ -531,25 +531,25 @@ bool WhgTests::onCompareModifiedData(EquipmentTypeWh &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool WhgTests::onCompareModifiedData(InjuryModelAgdusWh &data)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
InjuryModelAgdusWh modifyData;
|
||||
|
||||
getInjuryModelWhModifyRequestData(modifyData);
|
||||
|
||||
if (modifyData.id() != data.id())
|
||||
if (modifyData.id != data.id)
|
||||
return false;
|
||||
|
||||
if (modifyData.name() != data.name())
|
||||
if (modifyData.name != data.name)
|
||||
return false;
|
||||
|
||||
if (modifyData.version() != data.version())
|
||||
if (modifyData.version != data.version)
|
||||
return false;
|
||||
|
||||
if (modifyData.description() != data.description())
|
||||
if (modifyData.description != data.description)
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareModifiedData() for id :" << data.id;
|
||||
|
||||
return true;
|
||||
} // end of onCompareModifiedData()
|
||||
@@ -577,10 +577,10 @@ void WhgTests::tryModifyInjuryModel()
|
||||
InjuryModelAgdusWh data;
|
||||
getInjuryModelWhModifyRequestData(data);
|
||||
|
||||
ERROR_LOG(m_logger) << "trying to send modifyInjuryModelAgdusWhRequest for injuryModelWhId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "trying to send modifyInjuryModelAgdusWhRequest for injuryModelWhId:" << data.id;
|
||||
if (!m_ftc->modifyInjuryModelAgdusWhRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for injuryModelWhId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for injuryModelWhId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModifyInjuryModel()
|
||||
@@ -591,12 +591,12 @@ void WhgTests::tryRemoveInjuryModel()
|
||||
m_eTestStep = eRemoveInjuryModel;
|
||||
Core::RemoveElementRequest data;
|
||||
|
||||
data.id(m_injuryModelWhId);
|
||||
data.id = m_injuryModelWhId;
|
||||
|
||||
INFO_LOG(m_logger) << "trying to send remove request for injuryModelWhId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for injuryModelWhId:" << data.id;
|
||||
if (!m_ftc->removeInjuryModelAgdusWhRequest(data, this))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for injuryModelWhId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for injuryModelWhId:" << data.id;
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemoveInjuryModel()
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ void DataManager::onTextMessageFromScm(const QString &message)
|
||||
{
|
||||
const QJsonObject &port = valPort.toObject();
|
||||
int typeId = port.value(TYPE_ID()).toInt();
|
||||
if (typeId == Core::CorePortType::WebSocketServer)
|
||||
if (typeId == static_cast<int>(Core::CorePortType::WebSocketServer))
|
||||
{
|
||||
int tabPort = port.value(NUMBER()).toInt();
|
||||
DEBUG_LOG(m_logger) << "connect to TAB - port: " << tabPort;
|
||||
|
||||
+35
-35
@@ -55,46 +55,46 @@ bool HandlerEquipmentTypeWh::init()
|
||||
|
||||
void convert(Database::EquipmentTypeWh &data, const EquipmentTypeWh &request)
|
||||
{
|
||||
data.id = request.id();
|
||||
data.name = QString::fromStdString(request.name());
|
||||
data.canAbeSprache = request.configurationAbeLanguage().underlying();
|
||||
data.agdusHelmWeste = request.configurationAgdusHV().underlying();
|
||||
data.canAbeSprAusg = request.configurationAudioResponse();
|
||||
data.canWirkdarstPyro = request.configurationCedPyrotechnic();
|
||||
data.anzeigeAdag = request.configurationDisplayAdag().underlying();
|
||||
data.adagUntergruppe = request.configurationDisplayAdagSubUnit().underlying();
|
||||
data.canMhgrEnergie = request.configurationMhgrEnergieSave();
|
||||
data.canMhgrBetrArt = request.configurationMhgrOperatingMode().underlying();
|
||||
data.canSsFirSan = request.configurationSsFirSan();
|
||||
data.canSsFirFunkt = request.configurationSsFirFunction().underlying();
|
||||
data.canSsMvFunkt = request.configurationSsMineFitFunction().underlying();
|
||||
data.canSsStdFunkt = request.configurationSsStandardFunction().underlying();
|
||||
data.canStartupZeit = request.configurationStartupTime();
|
||||
data.ausstgGrp = request.equipGroup();
|
||||
data.ausstgNrMax = request.maxEquipNo();
|
||||
data.ausstgNrMin = request.minEquipNo();
|
||||
data.vbAgdus = request.vbAgdusId();
|
||||
data.vbEinsatzmittel = request.vbAirSupport();
|
||||
data.vbSteilfeuer = request.vbFireArea();
|
||||
data.vbMinenIed = request.vbMineIed();
|
||||
data.vbAcWaffen = request.vbNc();
|
||||
data.canDevices = request.canDevices();
|
||||
data.posUpdate = request.posUpdate().underlying();
|
||||
data.id = request.id;
|
||||
data.name = QString::fromStdString(request.name);
|
||||
data.canAbeSprache = request.configurationAbeLanguage;
|
||||
data.agdusHelmWeste = request.configurationAgdusHV;
|
||||
data.canAbeSprAusg = request.configurationAudioResponse;
|
||||
data.canWirkdarstPyro = request.configurationCedPyrotechnic;
|
||||
data.anzeigeAdag = request.configurationDisplayAdag;
|
||||
data.adagUntergruppe = request.configurationDisplayAdagSubUnit;
|
||||
data.canMhgrEnergie = request.configurationMhgrEnergieSave;
|
||||
data.canMhgrBetrArt = request.configurationMhgrOperatingMode;
|
||||
data.canSsFirSan = request.configurationSsFirSan;
|
||||
data.canSsFirFunkt = request.configurationSsFirFunction;
|
||||
data.canSsMvFunkt = request.configurationSsMineFitFunction;
|
||||
data.canSsStdFunkt = request.configurationSsStandardFunction;
|
||||
data.canStartupZeit = request.configurationStartupTime;
|
||||
data.ausstgGrp = request.equipGroup;
|
||||
data.ausstgNrMax = request.maxEquipNo;
|
||||
data.ausstgNrMin = request.minEquipNo;
|
||||
data.vbAgdus = request.vbAgdusId;
|
||||
data.vbEinsatzmittel = request.vbAirSupport;
|
||||
data.vbSteilfeuer = request.vbFireArea;
|
||||
data.vbMinenIed = request.vbMineIed;
|
||||
data.vbAcWaffen = request.vbNc;
|
||||
data.canDevices = request.canDevices;
|
||||
data.posUpdate = request.posUpdate;
|
||||
}
|
||||
|
||||
void HandlerEquipmentTypeWh::onModifyEquipmentTypeWhRequest(const rti::core::SampleIdentity &cookie, const EquipmentTypeWh &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onModifyEquipmentTypeWhRequest() id:" << request.id();
|
||||
DEBUG_LOG(m_logger) << "onModifyEquipmentTypeWhRequest() id:" << request.id;
|
||||
|
||||
ObjectEquipmentTypeWh *ifs = nullptr;
|
||||
Core::FunctionReplyObject ret;
|
||||
if (request.id() <= 0) // add with -1
|
||||
if (request.id <= 0) // add with -1
|
||||
{
|
||||
Database::EquipmentTypeWh data;
|
||||
convert(data, request);
|
||||
data.id = 0 - request.id();
|
||||
data.id = 0 - request.id;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Request.id = " << request.id() << ", data.id = " << data.id;
|
||||
DEBUG_LOG(m_logger) << "Request.id = " << request.id << ", data.id = " << data.id;
|
||||
|
||||
ifs = new ObjectEquipmentTypeWh(m_mainHandler);
|
||||
ret = ifs->createObject(data, true);
|
||||
@@ -111,10 +111,10 @@ void HandlerEquipmentTypeWh::onModifyEquipmentTypeWhRequest(const rti::core::Sam
|
||||
else // modify
|
||||
{
|
||||
|
||||
ifs = m_equipmenttypewhObjMap.value(request.id());
|
||||
ifs = m_equipmenttypewhObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "EquipmentTypeWh with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "EquipmentTypeWh with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->fts()->modifyEquipmentTypeWhReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -138,13 +138,13 @@ void HandlerEquipmentTypeWh::onModifyEquipmentTypeWhRequest(const rti::core::Sam
|
||||
//-----------------------------------------------------------------------------
|
||||
void HandlerEquipmentTypeWh::onRemoveEquipmentTypeWhRequest(const rti::core::SampleIdentity &cookie, const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onRemoveEquipmentTypeWhRequest() id:" << request.id();
|
||||
DEBUG_LOG(m_logger) << "onRemoveEquipmentTypeWhRequest() id:" << request.id;
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectEquipmentTypeWh *ifs = m_equipmenttypewhObjMap.value(request.id());
|
||||
ObjectEquipmentTypeWh *ifs = m_equipmenttypewhObjMap.value(request.id);
|
||||
if (ifs == nullptr)
|
||||
{
|
||||
ret = Core::FunctionReplyObject(request.id(), tr_lts("dds", "EquipmentTypeWh with id %1 not found")).arg(request.id());
|
||||
ret = Core::FunctionReplyObject(request.id, tr_lts("dds", "EquipmentTypeWh with id %1 not found")).arg(request.id);
|
||||
m_mainHandler->dds()->fts()->removeEquipmentTypeWhReply(cookie, ret);
|
||||
return;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void HandlerEquipmentTypeWh::onRemoveEquipmentTypeWhRequest(const rti::core::Sam
|
||||
{
|
||||
// delete ObjectEquipmentTypeWH
|
||||
delete ifs;
|
||||
m_equipmenttypewhObjMap.remove(request.id());
|
||||
m_equipmenttypewhObjMap.remove(request.id);
|
||||
}
|
||||
|
||||
sendToEXCON();
|
||||
|
||||
Loaded 100 of 104 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user