Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
This commit is contained in:
1 parent
eb1d949edc
commit
815e16368e
1718 files changed
+126739
-18495
No files matched your search
+22
-33
@@ -63,58 +63,47 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
|
||||
return QVariant();
|
||||
|
||||
const AlarmManagement::AlarmConfig& alarmConfig = m_vecData.at(index.row());
|
||||
if (alarmConfig.global() != m_global)
|
||||
if (alarmConfig.global != m_global)
|
||||
return QVariant();
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
return alarmConfig.id();
|
||||
return alarmConfig.id;
|
||||
case EquipmentNumber: {
|
||||
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId());
|
||||
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId);
|
||||
if (equipmentNumber == 0)
|
||||
return tr("All");
|
||||
return equipmentNumber;
|
||||
}
|
||||
case Designator:
|
||||
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId());
|
||||
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId);
|
||||
case TactIdentifier:
|
||||
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId());
|
||||
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId);
|
||||
case VulnerabilityState: {
|
||||
QString vulnerabilityState = tr("All Types");
|
||||
if (alarmConfig.vulnerabilityState() >= 0)
|
||||
if (alarmConfig.vulnerabilityState >= 0)
|
||||
{
|
||||
// participant() existiert nicht mehr, suche in participantsList()
|
||||
auto participantIt = std::find_if(
|
||||
m_ppmDtc->participantsList().begin(), m_ppmDtc->participantsList().end(),
|
||||
[id = alarmConfig.participantId()](const ParticipantManagement::Participant& p) {
|
||||
return p.id() == id;
|
||||
});
|
||||
|
||||
ParticipantManagement::TypeClass typeClass = ParticipantManagement::TypeClass::Other;
|
||||
// STUB: type()-Methode nicht verfügbar - verwende Default-Wert
|
||||
// if (participantIt != m_ppmDtc->participantsList().end())
|
||||
// {
|
||||
// typeClass = m_ppmDtc->type(participantIt->typeId()).typeClass();
|
||||
// }
|
||||
ParticipantManagement::TypeClass typeClass =
|
||||
m_ppmDtc->type(m_ppmDtc->participant(alarmConfig.participantId).typeId).typeClass;
|
||||
|
||||
const ProjectDataManagement::VulnerabilityClass vc =
|
||||
typeClass == ParticipantManagement::TypeClass::Human
|
||||
? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
|
||||
: ProjectDataManagement::VulnerabilityClass::VehicleDamages;
|
||||
? ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_SoldierInjuries
|
||||
: ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_VehicleDamages;
|
||||
ProjectDataManagement::VulnerabilityState vs =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState);
|
||||
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
|
||||
}
|
||||
return vulnerabilityState;
|
||||
}
|
||||
|
||||
case EventType:
|
||||
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId()));
|
||||
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId));
|
||||
case MessageWindow:
|
||||
return alarmConfig.messageWindow() ? tr("Yes") : tr("No");
|
||||
return alarmConfig.messageWindow ? tr("Yes") : tr("No");
|
||||
case SetMarker:
|
||||
return alarmConfig.setMarker() ? tr("Yes") : tr("No");
|
||||
return alarmConfig.setMarker ? tr("Yes") : tr("No");
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -122,15 +111,15 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, const DataModification modType)
|
||||
{
|
||||
const int id = data.id();
|
||||
if (data.global() != m_global)
|
||||
const int id = data.id;
|
||||
if (data.global != m_global)
|
||||
return;
|
||||
|
||||
int row = findRowForId(id);
|
||||
|
||||
const int eventTypeId = data.eventTypeId();
|
||||
const bool messageWindow = data.messageWindow();
|
||||
const bool setMarker = data.setMarker();
|
||||
const int eventTypeId = static_cast<int>(data.eventTypeId);
|
||||
const bool messageWindow = data.messageWindow;
|
||||
const bool setMarker = data.setMarker;
|
||||
DEBUG_LOG(getLogger()) << "onAlarmConfigChanged: " << eventTypeId << " messageWindow=" << messageWindow << "setMarker"
|
||||
<< setMarker;
|
||||
|
||||
@@ -140,8 +129,8 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
|
||||
|
||||
DEBUG_LOG(getLogger()) << "AlarmConfig was removed: " << id;
|
||||
AlarmManagement::AlarmConfig data1 = data;
|
||||
data1.setMessageWindow(false);
|
||||
data1.setSetMarker(false);
|
||||
data1.messageWindow = false;
|
||||
data1.setMarker = false;
|
||||
setRowData(row, data1);
|
||||
removeRow(row);
|
||||
return;
|
||||
@@ -153,7 +142,7 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
|
||||
|
||||
return;
|
||||
}
|
||||
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId()) > 0)
|
||||
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId) > 0)
|
||||
setRowData(row, data);
|
||||
break;
|
||||
}
|
||||
|
||||
-1
@@ -6,7 +6,6 @@
|
||||
#include "almcommon_export.h"
|
||||
|
||||
#include <AlarmManagement/alm_dtc.h>
|
||||
#include <AlarmManagement/alm_types.h>
|
||||
#include <GuezNasat/logger.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
|
||||
+33
-33
@@ -49,7 +49,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
|
||||
|
||||
// Register callbacks instead of enableParticipant()
|
||||
const auto cbParticipants = [this](const ParticipantManagement::Participant& participant) {
|
||||
onParticipantChanged(participant, ParticipantManagement::DataModification::eAdded);
|
||||
onParticipantChanged(participant, DataModification::eAdded);
|
||||
};
|
||||
m_ppmDtc->participants(cbParticipants);
|
||||
|
||||
@@ -66,7 +66,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
|
||||
auto cbAesItem = [this](const AreaEffectSimulation::AesItem& item) {
|
||||
onAesItemChanged(item, DataModification::eAdded);
|
||||
};
|
||||
m_aesDtc->bcContaminations(cbAesItem);
|
||||
m_aesDtc->bCContaminations(cbAesItem);
|
||||
m_aesDtc->boobyTraps(cbAesItem);
|
||||
m_aesDtc->offRouteMines(cbAesItem);
|
||||
|
||||
@@ -84,7 +84,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
if (role == Qt::BackgroundRole)
|
||||
{
|
||||
if (notificationEx.eventType() == ProjectDataManagement::PdmEventType::Alarm)
|
||||
if (notificationEx.eventType == ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||
return QColor(Qt::red);
|
||||
return QVariant();
|
||||
}
|
||||
@@ -94,7 +94,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
||||
case Id:
|
||||
return notificationEx.id;
|
||||
case Date:
|
||||
return QDateTime::fromMSecsSinceEpoch(notificationEx.time());
|
||||
return QDateTime::fromMSecsSinceEpoch(notificationEx.time);
|
||||
case EquipmentNumber:
|
||||
if (notificationEx.equipmentNumber)
|
||||
return notificationEx.equipmentNumber;
|
||||
@@ -107,10 +107,10 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
||||
return notificationEx.participantId;
|
||||
case Position:
|
||||
if (role == Qt::DisplayRole)
|
||||
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position().lon(),
|
||||
notificationEx.position().lat());
|
||||
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position.lon,
|
||||
notificationEx.position.lat);
|
||||
else if (role == Qt::UserRole)
|
||||
return QPointF(notificationEx.position().lon(), notificationEx.position().lat());
|
||||
return QPointF(notificationEx.position.lon, notificationEx.position.lat);
|
||||
break;
|
||||
case AesId:
|
||||
return notificationEx.aesId;
|
||||
@@ -124,9 +124,9 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
||||
bool AlarmHistoryModel::isFiltered(const NotificationEx& data, DataModification modType) const
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
if (data.operatorId() == 0)
|
||||
if (data.operatorId == 0)
|
||||
return false;
|
||||
return data.operatorId() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
return data.operatorId != LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
}
|
||||
|
||||
void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType)
|
||||
@@ -135,16 +135,16 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio
|
||||
return;
|
||||
|
||||
NotificationEx notification(data);
|
||||
const QByteArray properties = QByteArray::fromRawData(data.properties().c_str(), data.properties().size());
|
||||
const QByteArray properties = QByteArray::fromRawData(data.properties.c_str(), data.properties.size());
|
||||
const QJsonDocument propertieJsonDoc = QJsonDocument::fromJson(properties);
|
||||
const QJsonObject propertieJsonObj = propertieJsonDoc.object();
|
||||
|
||||
notification.equipmentNumber = data.equipmentNumber();
|
||||
if (data.participantId().has_value())
|
||||
notification.participantId = data.participantId().value();
|
||||
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType());
|
||||
if (data.aesId().has_value())
|
||||
notification.aesId = data.aesId().value();
|
||||
notification.equipmentNumber = data.equipmentNumber;
|
||||
if (data.participantId.has_value())
|
||||
notification.participantId = data.participantId.value();
|
||||
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType);
|
||||
if (data.aesId.has_value())
|
||||
notification.aesId = data.aesId.value();
|
||||
const int global = propertieJsonObj[QStringLiteral("Global")].toInt();
|
||||
const int friendlyFire = propertieJsonObj[QStringLiteral("FriendlyFire")].toInt();
|
||||
|
||||
@@ -155,19 +155,19 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio
|
||||
}
|
||||
|
||||
void AlarmHistoryModel::onParticipantChanged(const ParticipantManagement::Participant& participant,
|
||||
const ParticipantManagement::DataModification modType)
|
||||
const DataModification modType)
|
||||
{
|
||||
if (modType == ParticipantManagement::DataModification::eRemoved)
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
QString designator = participant.designator();
|
||||
m_idDesignatorMap.insert(participant.id(), designator);
|
||||
QString designator = QString::fromStdString(participant.designator);
|
||||
m_idDesignatorMap.insert(participant.id, designator);
|
||||
|
||||
const int equipNo = participant.equipmentNumber.has_value() ? participant.equipmentNumber.value() : 0;
|
||||
m_partId2EquipNoMap.insert(participant.id(), equipNo);
|
||||
m_partId2EquipNoMap.insert(participant.id, equipNo);
|
||||
|
||||
QString tacticalIdentifier = participant.tacticalIdentifier();
|
||||
m_idTactIdentifierMap.insert(participant.id(), tacticalIdentifier);
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id() << " designator=" << designator
|
||||
QString tacticalIdentifier = QString::fromStdString(participant.tacticalIdentifier);
|
||||
m_idTactIdentifierMap.insert(participant.id, tacticalIdentifier);
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id << " designator=" << designator
|
||||
<< " tacticalIdentifier=" << tacticalIdentifier;
|
||||
}
|
||||
|
||||
@@ -199,8 +199,8 @@ void AlarmHistoryModel::onBCContaminationChanged(const AreaEffectSimulation::BCC
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
int id = data.id();
|
||||
QString name = QString::fromStdString(data.name());
|
||||
int id = data.id;
|
||||
QString name = QString::fromStdString(data.name);
|
||||
m_aesNameMap[id] = name;
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "onBCContaminationChanged: id=" << id << " Name=" << name;
|
||||
}
|
||||
@@ -209,8 +209,8 @@ void AlarmHistoryModel::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
int id = data.id();
|
||||
QString name = QString::fromStdString(data.name());
|
||||
int id = data.id;
|
||||
QString name = QString::fromStdString(data.name);
|
||||
m_aesNameMap[id] = name;
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "BoobyTrap: id=" << id << " Name=" << name;
|
||||
}
|
||||
@@ -220,8 +220,8 @@ void AlarmHistoryModel::onOffRouteMineChanged(const AreaEffectSimulation::OffRou
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
int id = data.id();
|
||||
QString name = QString::fromStdString(data.name());
|
||||
int id = data.id;
|
||||
QString name = QString::fromStdString(data.name);
|
||||
m_aesNameMap[id] = name;
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "OffRouteMine: id=" << id << " Name=" << name;
|
||||
}
|
||||
@@ -230,8 +230,8 @@ void AlarmHistoryModel::onAesItemChanged(const AreaEffectSimulation::AesItem& it
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
QString name = QString::fromStdString(item.name());
|
||||
int id = item.id();
|
||||
QString name = QString::fromStdString(item.name);
|
||||
int id = item.id;
|
||||
m_aesNameMap[id] = name;
|
||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "AreaEffectSimulation::AesItem onAesItemChanged: id=" << id
|
||||
<< " Name=" << name;
|
||||
@@ -253,7 +253,7 @@ bool AlarmHistoryProxyModel::lessThan(const QModelIndex& source_left, const QMod
|
||||
switch (source_left.column())
|
||||
{
|
||||
case AlarmHistoryModel::Date:
|
||||
return dataLeft.time() < dataRight.time();
|
||||
return dataLeft.time < dataRight.time;
|
||||
|
||||
case AlarmHistoryModel::Id:
|
||||
case AlarmHistoryModel::Incident:
|
||||
|
||||
+3
-2
@@ -11,7 +11,8 @@
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ProjectDataManagement/project_data_management.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
|
||||
namespace AlarmManagement
|
||||
{
|
||||
@@ -50,7 +51,7 @@ class ALMCOMMON_EXPORT AlarmHistoryModel final : public LtsWidgets::LtsAbstractT
|
||||
bool isFiltered(const NotificationEx& data, DataModification modType) const override;
|
||||
public slots:
|
||||
void onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType);
|
||||
void onParticipantChanged(const ParticipantManagement::Participant& participant, const ParticipantManagement::DataModification modType);
|
||||
void onParticipantChanged(const ParticipantManagement::Participant& participant, const DataModification modType);
|
||||
void onAesItemChanged(const AreaEffectSimulation::AesItem& item, const DataModification modType);
|
||||
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data, const DataModification modType);
|
||||
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, const DataModification modType);
|
||||
|
||||
+7
-7
@@ -57,24 +57,24 @@ void InterfaceImpl::clearInterfaces()
|
||||
|
||||
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
|
||||
{
|
||||
if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||
if (data.eventType != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||
return;
|
||||
|
||||
const int issi = data.equipmentNumber();
|
||||
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
|
||||
const int issi = data.equipmentNumber;
|
||||
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position.lon, data.position.lat);
|
||||
|
||||
|
||||
new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(),
|
||||
tr("ISSI: %1 --- Position: %2\n").arg(issi).arg(positionStr),
|
||||
tr("!!!!!! Emergency Call --- %1 !!!!!").arg(DTG::toStringMSec(data.time())));
|
||||
tr("!!!!!! Emergency Call --- %1 !!!!!").arg(DTG::toStringMSec(data.time)));
|
||||
}
|
||||
|
||||
void InterfaceImpl::showAlarm(const AlarmManagement::Notification &data)
|
||||
{
|
||||
showEmergencyMessage(data);
|
||||
|
||||
if (data.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
|
||||
data.operatorId() == 0)
|
||||
if (data.operatorId == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
|
||||
data.operatorId == 0)
|
||||
{
|
||||
bool bWidgetExists = m_session->widgetExists(menuGroup(), m_alarmHistoryDialogIdentifier, m_alarmHistoryDialogLayoutArea);
|
||||
if (!bWidgetExists)
|
||||
@@ -87,7 +87,7 @@ void InterfaceImpl::onNotificationChanged(const AlarmManagement::Notification &d
|
||||
if (mod != DataModification::eAdded)
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId()
|
||||
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId
|
||||
<< "currentOperatorId: " << LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -7,11 +7,12 @@
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <AlarmManagement/alm_gui_plugin_interface.h>
|
||||
#include <AlarmManagement/alm_data_plugin_interface.h>
|
||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
|
||||
namespace AlarmManagement
|
||||
{
|
||||
|
||||
+18
-17
@@ -2,14 +2,15 @@
|
||||
|
||||
#include "alm_dialog.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "alm_history.h"
|
||||
#include "ui_alm_dialog.h"
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
#include <LtsUtilsSettings/settings.h>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
#include <utility>
|
||||
|
||||
@@ -19,7 +20,7 @@ namespace AlarmManagement
|
||||
AlarmDialog::AlarmDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_configAlarmModel(nullptr),
|
||||
m_dtc(nullptr), m_ftc(nullptr), m_ui(new Ui::AlarmDialog), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||
m_operatorId(-1)
|
||||
m_operatorId(-1), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
AlarmCheckBox alarmCheckBox;
|
||||
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
|
||||
@@ -158,23 +159,23 @@ void AlarmDialog::retranslate()
|
||||
|
||||
void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, DataModification modType)
|
||||
{
|
||||
bool setMarker = data.setMarker();
|
||||
bool messageWindow = data.messageWindow();
|
||||
bool setMarker = data.setMarker;
|
||||
bool messageWindow = data.messageWindow;
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG(m_logger) << "************** onAlarmConfigChanged "
|
||||
<< " id=" << data.id() << " operatorId=" << data.operatorId()
|
||||
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId()
|
||||
<< " eventTypeId=" << data.eventTypeId() << " messageWindow=" << messageWindow
|
||||
<< " id=" << data.id << " operatorId=" << data.operatorId
|
||||
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId
|
||||
<< " eventTypeId=" << data.eventTypeId << " messageWindow=" << messageWindow
|
||||
<< " setMarker=" << setMarker;
|
||||
if (data.global() == false)
|
||||
if (data.global == false)
|
||||
return;
|
||||
|
||||
if (data.operatorId() == m_operatorId)
|
||||
if (data.operatorId == m_operatorId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
|
||||
switch (data.eventTypeId().underlying())
|
||||
switch (data.eventTypeId)
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
|
||||
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
|
||||
@@ -247,28 +248,28 @@ std::vector<AlarmManagement::AlarmAction> AlarmDialog::getCheckedValues() const
|
||||
ret.reserve(m_checkBoxes.size());
|
||||
for (const AlarmCheckBox& item : std::as_const(m_checkBoxes))
|
||||
{
|
||||
alarmActionDds.eventTypeId(item.eventTypeId);
|
||||
alarmActionDds.eventTypeId = item.eventTypeId;
|
||||
if (item.checkboxMarker->isChecked())
|
||||
{
|
||||
alarmActionDds.setMarker(true);
|
||||
alarmActionDds.setMarker = true;
|
||||
DEBUG_LOG(m_logger) << item.name << " setMarker = true";
|
||||
}
|
||||
else
|
||||
{
|
||||
alarmActionDds.setMarker(false);
|
||||
alarmActionDds.setMarker = false;
|
||||
DEBUG_LOG(m_logger) << item.name << " setMarker = false";
|
||||
}
|
||||
if (item.checkboxWindow->isChecked())
|
||||
{
|
||||
alarmActionDds.messageWindow(true);
|
||||
alarmActionDds.messageWindow = true;
|
||||
DEBUG_LOG(m_logger) << item.name << " messageWindow = true";
|
||||
}
|
||||
else
|
||||
{
|
||||
alarmActionDds.messageWindow(false);
|
||||
alarmActionDds.messageWindow = false;
|
||||
DEBUG_LOG(m_logger) << item.name << " messageWindow = false";
|
||||
}
|
||||
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
|
||||
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
|
||||
ret.push_back(alarmActionDds);
|
||||
}
|
||||
return ret;
|
||||
|
||||
+1
@@ -7,6 +7,7 @@
|
||||
#include <AlarmManagement/alm_ftc.h>
|
||||
#include <AlarmManagement/alm_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
#include <AlarmManagement/logger.h>
|
||||
|
||||
|
||||
+4
-2
@@ -2,11 +2,12 @@
|
||||
|
||||
#include "alm_history.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_alm_history.h"
|
||||
|
||||
#include <LtsPrinting/printing.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||
#include <QtWidgets/QTreeView>
|
||||
|
||||
namespace AlarmManagement
|
||||
@@ -14,7 +15,8 @@ namespace AlarmManagement
|
||||
|
||||
AlarmView::AlarmView(LtsSession::LtsSession* session, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_alarmHistoryModel(nullptr),
|
||||
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView)
|
||||
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --- AlarmView Konstruktor() ";
|
||||
m_ui->setupUi(this);
|
||||
|
||||
+60
-60
@@ -50,13 +50,13 @@ ConfigParticipantsDialog::~ConfigParticipantsDialog()
|
||||
|
||||
void ConfigParticipantsDialog::retranslate()
|
||||
{
|
||||
if (!m_participantData.equipmentNumber().is_set())
|
||||
if (!m_participantData.equipmentNumber.has_value())
|
||||
{
|
||||
QString hierarchy = m_ppmDtc->hierarchyFromParticipant(m_participantData.id());
|
||||
QString hierarchy = m_ppmDtc->hierarchyFromParticipant(m_participantData.id);
|
||||
translate(m_ui, m_participantData, hierarchy, tr("Participant Alarm"));
|
||||
}
|
||||
else
|
||||
translate(m_ui, m_participantData, QString::number(m_participantData.equipmentNumber().get()),
|
||||
translate(m_ui, m_participantData, QString::number(m_participantData.equipmentNumber.get()),
|
||||
tr("Participant Alarm"));
|
||||
|
||||
m_uiRequirements->clear();
|
||||
@@ -82,12 +82,12 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
||||
|
||||
m_operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
|
||||
m_ui->lbHierarchy->setText(m_ppmDtc->hierarchyFromParticipant(m_participantData.id()));
|
||||
m_ui->lbHierarchy->setText(m_ppmDtc->hierarchyFromParticipant(m_participantData.id));
|
||||
|
||||
QString equipmentNumbersStr;
|
||||
if (participantData.equipmentNumber().is_set())
|
||||
if (participantData.equipmentNumber.has_value())
|
||||
{
|
||||
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber().get()));
|
||||
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber.get()));
|
||||
equipmentNumbersStr.append(QStringLiteral(": "));
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
||||
|
||||
m_ui->equipmentNoContent->setText(equipmentNumbersStr);
|
||||
|
||||
DEBUG_LOG(m_logger) << "current participantId = " << participantData.id();
|
||||
DEBUG_LOG(m_logger) << "current participantId = " << participantData.id;
|
||||
|
||||
m_typeClass = ppmDtc->type(participantData.typeId()).typeClass();
|
||||
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId();
|
||||
m_typeClass = ppmDtc->type(participantData.typeId).typeClass;
|
||||
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId;
|
||||
fillCbx();
|
||||
|
||||
m_almDtc->alarmConfigs([this](const AlarmManagement::AlarmConfig& alarm) { setAlaramData(alarm); });
|
||||
@@ -110,21 +110,21 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
||||
void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig& alarm)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "setAlaramData:" << alarm;
|
||||
if (alarm.operatorId() != m_operatorId || alarm.participantId() != m_participantData.id() || alarm.global())
|
||||
if (alarm.operatorId != m_operatorId || alarm.participantId != m_participantData.id || alarm.global)
|
||||
return;
|
||||
|
||||
switch (alarm.eventTypeId().underlying())
|
||||
switch (alarm.eventTypeId)
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType::EventType_Hit: {
|
||||
DEBUG_LOG(m_logger) << "Hit zuweisen ";
|
||||
m_ui->cbxDirectFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
if (alarm.vulnerabilityState() >= 0)
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
if (alarm.vulnerabilityState >= 0)
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState vulState =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
|
||||
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
|
||||
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
|
||||
m_ui->cbStatusDirect->setCurrentIndex(index);
|
||||
}
|
||||
break;
|
||||
@@ -132,22 +132,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
|
||||
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
|
||||
m_ui->cbxIndirectFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
|
||||
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
|
||||
m_ui->cbxAirSupport->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
|
||||
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
|
||||
m_ui->cbxMines->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitB:
|
||||
@@ -155,20 +155,20 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitC: {
|
||||
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
|
||||
m_ui->cbxNbcAgent->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
|
||||
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
|
||||
m_ui->cbxFriendlyFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
if (alarm.vulnerabilityState() >= 0)
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
if (alarm.vulnerabilityState >= 0)
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState vulState =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
|
||||
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
|
||||
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
|
||||
m_ui->cbStatusFriendly->setCurrentIndex(index);
|
||||
}
|
||||
break;
|
||||
@@ -176,22 +176,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
|
||||
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
|
||||
m_ui->cbxManipulation->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
|
||||
m_ui->cbxGlobalBorderLine->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
|
||||
m_ui->cbxLocalBorderLine->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -207,68 +207,68 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
|
||||
|
||||
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
||||
|
||||
alarmActionDds.setMarker(m_ui->cbxSetMarker->isChecked());
|
||||
alarmActionDds.messageWindow(m_ui->cbxMessageWindow->isChecked());
|
||||
alarmActionDds.vulnerabilityState(-1);
|
||||
alarmActionDds.setMarker = m_ui->cbxSetMarker->isChecked();
|
||||
alarmActionDds.messageWindow = m_ui->cbxMessageWindow->isChecked();
|
||||
alarmActionDds.vulnerabilityState = -1;
|
||||
|
||||
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
|
||||
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
|
||||
{
|
||||
if (m_ui->cbxDirectFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
|
||||
int statusDirect = -1;
|
||||
if (m_ui->cbStatusDirect->currentIndex() > 0)
|
||||
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
|
||||
alarmActionDds.vulnerabilityState(statusDirect);
|
||||
alarmActionDds.vulnerabilityState = statusDirect;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxFriendlyFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_FriendlyFire;
|
||||
int statusFriendly = -1;
|
||||
if (m_ui->cbStatusFriendly->currentIndex() > 0)
|
||||
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
|
||||
alarmActionDds.vulnerabilityState(statusFriendly);
|
||||
alarmActionDds.vulnerabilityState = statusFriendly;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
alarmActionDds.vulnerabilityState(-1);
|
||||
alarmActionDds.vulnerabilityState = -1;
|
||||
if (m_ui->cbxIndirectFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxAirSupport->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxMines->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxNbcAgent->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitN;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitB;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitC;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxManipulation->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Manipulation;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxGlobalBorderLine->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxLocalBorderLine->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
|
||||
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
}
|
||||
@@ -279,11 +279,11 @@ bool ConfigParticipantsDialog::apply()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "apply";
|
||||
AlarmManagement::ConfigureAlarmsRequest req;
|
||||
req.participantIds(m_participantVector);
|
||||
req.alarms(getCheckedValues());
|
||||
req.operatorId(m_operatorId);
|
||||
req.global(false);
|
||||
req.remove(false);
|
||||
req.participantIds = m_participantVector;
|
||||
req.alarms = getCheckedValues();
|
||||
req.operatorId = m_operatorId;
|
||||
req.global = false;
|
||||
req.remove = false;
|
||||
|
||||
return m_requestHelper->startSingleRequest([req, this]() { return m_almFtc->configureAlarmsRequest(req, this); });
|
||||
}
|
||||
@@ -298,9 +298,9 @@ void ConfigParticipantsDialog::fillCbx()
|
||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
|
||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
|
||||
m_ui->cbStatusDirect->removeItem(
|
||||
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
|
||||
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
|
||||
m_ui->cbStatusFriendly->removeItem(
|
||||
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
|
||||
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
|
||||
}
|
||||
|
||||
} // namespace ParticipantAlarms
|
||||
+10
-10
@@ -99,8 +99,8 @@ void ParticipantsDialog::onSelectionChanged()
|
||||
for (const QModelIndex& index : currentlySelectedParticipants)
|
||||
{
|
||||
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
|
||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
||||
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
|
||||
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
|
||||
m_ppmDtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
|
||||
configureAlarms = true;
|
||||
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
|
||||
}
|
||||
@@ -138,13 +138,13 @@ void ParticipantsDialog::onAddButtonClicked()
|
||||
|
||||
QModelIndex participantIndex = m_ui->dvParticipants->currentIndex();
|
||||
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(participantIndex);
|
||||
DEBUG_LOG(m_logger) << "current participantId = " << data.id();
|
||||
m_participantVector.push_back(data.id());
|
||||
DEBUG_LOG(m_logger) << "current participantId = " << data.id;
|
||||
m_participantVector.push_back(data.id);
|
||||
|
||||
const auto partData = m_participantModel->getParticipantData(participantIndex);
|
||||
addDialog(LtsWidgets::initDialog(new ConfigParticipantsDialog(this), m_ppmDtc, m_almDtc, m_almFtc, partData,
|
||||
m_participantVector, m_equipmentVector),
|
||||
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id()));
|
||||
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id));
|
||||
}
|
||||
|
||||
void ParticipantsDialog::onPrint()
|
||||
@@ -168,12 +168,12 @@ void ParticipantsDialog::setChildrenSelected(const QModelIndex& parent)
|
||||
DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected";
|
||||
|
||||
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(childIndex);
|
||||
DEBUG_LOG(m_logger) << "append participantId = " << data.id();
|
||||
m_participantVector.push_back(data.id());
|
||||
if (data.equipmentNumber().is_set())
|
||||
DEBUG_LOG(m_logger) << "append participantId = " << data.id;
|
||||
m_participantVector.push_back(data.id);
|
||||
if (data.equipmentNumber.has_value())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber().get();
|
||||
m_equipmentVector.push_back(data.equipmentNumber().get());
|
||||
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber.get();
|
||||
m_equipmentVector.push_back(data.equipmentNumber.get());
|
||||
}
|
||||
|
||||
m_ui->dvParticipants->selectionModel()->select(m_participantProxyModel->mapFromSource(childIndex),
|
||||
|
||||
+1
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <AlarmManagement/alm_ftc.h>
|
||||
#include <AlarmManagement/alm_dtc.h>
|
||||
|
||||
|
||||
+8
-8
@@ -37,10 +37,10 @@ void ParticipantAlarmModel::onParticipantChanged(const ParticipantManagement::Pa
|
||||
DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
if (data.partyId() != partyId())
|
||||
if (data.partyId != partyId())
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
|
||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated;
|
||||
onReinitModel(partyId());
|
||||
emit newData();
|
||||
}
|
||||
@@ -50,17 +50,17 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
|
||||
bool isSimulatable = false;
|
||||
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
||||
|
||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
||||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
|
||||
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
|
||||
m_dtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
|
||||
isSimulatable = true;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
|
||||
<< " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId()
|
||||
<< " modId=" << data.modId() << " typeClass=" << m_dtc->type(data.typeId()).typeClass()
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id << " isSimulated:" << data.isSimulated
|
||||
<< " equipmentNo:" << data.equipmentNumber << " typeId=" << data.typeId
|
||||
<< " modId=" << data.modId << " typeClass=" << m_dtc->type(data.typeId).typeClass
|
||||
<< " isSimulatable=" << isSimulatable;
|
||||
|
||||
if (bIsSimulated)
|
||||
*bIsSimulated = data.isSimulated();
|
||||
*bIsSimulated = data.isSimulated;
|
||||
|
||||
return isSimulatable;
|
||||
}
|
||||
|
||||
+9
-9
@@ -96,28 +96,28 @@ void ParticipantShowConfigView::onShowAlarm()
|
||||
void ParticipantShowConfigView::onRemoveAlarm()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onRemoveAlarm"
|
||||
<< " id = " << m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).id()
|
||||
<< " id = " << m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).id
|
||||
<< " eventTypeId = "
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId()
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId
|
||||
<< " operatorId = "
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId()
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId
|
||||
<< " participantId = "
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).participantId();
|
||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).participantId;
|
||||
|
||||
const QModelIndex curIdx = m_ui->widget->currentIndex();
|
||||
if (!curIdx.isValid())
|
||||
return;
|
||||
const AlarmManagement::AlarmConfig& rowdata = m_configAlarmModel->getRowData(curIdx.row());
|
||||
int operatorId = rowdata.operatorId();
|
||||
int operatorId = rowdata.operatorId;
|
||||
std::vector<int32_t> ddsParticipantIds;
|
||||
ddsParticipantIds.push_back(rowdata.participantId());
|
||||
ddsParticipantIds.push_back(rowdata.participantId);
|
||||
bool globalEvent = true;
|
||||
bool remove = true;
|
||||
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
||||
alarmsDds.resize(1);
|
||||
alarmsDds[0].setMarker(false);
|
||||
alarmsDds[0].messageWindow(false);
|
||||
alarmsDds[0].eventTypeId(rowdata.eventTypeId());
|
||||
alarmsDds[0].setMarker = false;
|
||||
alarmsDds[0].messageWindow = false;
|
||||
alarmsDds[0].eventTypeId = rowdata.eventTypeId;
|
||||
AlarmManagement::ConfigureAlarmsRequest request(alarmsDds, operatorId, ddsParticipantIds, globalEvent, remove);
|
||||
|
||||
m_requestHelper->startSingleRequest([request, this]() {
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||
#include <AlarmManagement/alm_dtc.h>
|
||||
#include <AlarmManagement/alm_ftc.h>
|
||||
|
||||
@@ -41,7 +41,6 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
|
||||
void onPrint();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void onConfigureAlarmsReply(const Core::FunctionReplyObject& replyObject) override final;
|
||||
|
||||
private:
|
||||
@@ -57,7 +56,8 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
|
||||
Ui::ParticipantShowConfigView* m_ui;
|
||||
LtsUtils::RequestHelper* m_requestHelper;
|
||||
|
||||
AlarmManagement::
|
||||
AlarmManagement::LOGGER_T m_logger;
|
||||
|
||||
};
|
||||
|
||||
} // namespace ParticipantAlarms
|
||||
+18
-16
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "alm_emergency_call_dialog.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h"
|
||||
#include "ui_alm_emergency_call_dialog.h"
|
||||
|
||||
@@ -18,7 +19,8 @@ namespace AlarmManagement
|
||||
|
||||
EmergencyCallDialog::EmergencyCallDialog(QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
||||
m_session(nullptr), m_ui(new Ui::EmergencyCallDialog), m_requestHelper(new LtsUtils::RequestHelper(this))
|
||||
m_session(nullptr), m_ui(new Ui::EmergencyCallDialog), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
@@ -104,10 +106,10 @@ void EmergencyCallDialog::enaDisa()
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
|
||||
|
||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||
if (sos.id() <= 0)
|
||||
if (sos.id <= 0)
|
||||
return;
|
||||
|
||||
if (!sos.expired())
|
||||
if (!sos.expired)
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, true);
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, true);
|
||||
@@ -158,7 +160,7 @@ void EmergencyCallDialog::onEditBtCliked()
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||
if (sos.id() <= 0)
|
||||
if (sos.id <= 0)
|
||||
return;
|
||||
setAcknowledgeUi();
|
||||
|
||||
@@ -181,16 +183,16 @@ void EmergencyCallDialog::onFindEmergencyOnMap()
|
||||
return;
|
||||
|
||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||
if (sos.id() <= 0)
|
||||
if (sos.id <= 0)
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->setCenterPoint(QPointF(sos.position().lon(), sos.position().lat()));
|
||||
m_sitMapGuiIfc->setCenterPoint(QPointF(sos.position.lon, sos.position.lat));
|
||||
}
|
||||
|
||||
void EmergencyCallDialog::onEmergencyIndexDoubleClicked(const QModelIndex& index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
emit openInfoDlg(getSelectedSOS().id());
|
||||
emit openInfoDlg(getSelectedSOS().id);
|
||||
}
|
||||
|
||||
void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
|
||||
@@ -198,18 +200,18 @@ void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||
if (sos.id() <= 0 || sos.expired())
|
||||
if (sos.id <= 0 || sos.expired)
|
||||
return;
|
||||
|
||||
EmergencyCallAcknowledgeRequest request;
|
||||
request.id(sos.id());
|
||||
request.issi(sos.issi());
|
||||
request.name(sos.name());
|
||||
request.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
request.incomingTime(sos.incomingTime());
|
||||
request.expired(true);
|
||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
request.comment(comment.toStdString());
|
||||
request.id = sos.id;
|
||||
request.issi = sos.issi;
|
||||
request.name = sos.name;
|
||||
request.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
request.incomingTime = sos.incomingTime;
|
||||
request.expired = true;
|
||||
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
request.comment = comment.toStdString();
|
||||
m_requestHelper->startSingleRequest(
|
||||
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
||||
|
||||
|
||||
+4
-4
@@ -82,9 +82,9 @@ QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
|
||||
auto cb = [this](const AlmEmergencyCall &data)
|
||||
{
|
||||
if (data.id() <= 0 || data.expired())
|
||||
if (data.id <= 0 || data.expired)
|
||||
return;
|
||||
this->showEmergencyCallInfoWindow(data.id());
|
||||
this->showEmergencyCallInfoWindow(data.id);
|
||||
};
|
||||
m_dtc->almEmergencyCalls(cb);
|
||||
|
||||
@@ -111,10 +111,10 @@ void InterfaceImpl::onEmergencyCallChanged(const AlmEmergencyCall &data, DataMod
|
||||
{
|
||||
if (modType != DataModification::eAdded)
|
||||
return;
|
||||
if (data.id() <= 0 || data.expired())
|
||||
if (data.id <= 0 || data.expired)
|
||||
return;
|
||||
|
||||
this->showEmergencyCallInfoWindow(data.id());
|
||||
this->showEmergencyCallInfoWindow(data.id);
|
||||
}
|
||||
|
||||
void InterfaceImpl::onOpenInfoDlg(const int &id)
|
||||
|
||||
+29
-27
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "alm_emergency_call_info_dialog.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_alm_emergency_call_info_dialog.h"
|
||||
|
||||
#include <AlarmManagement/alm_operator_rights.h>
|
||||
@@ -46,10 +47,11 @@ QImage renderEmergencySymbol(bool expired = false)
|
||||
|
||||
EmergencyCallInfoDialog::EmergencyCallInfoDialog(int entryId, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog)
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_emergency.id(entryId);
|
||||
m_emergency.id = entryId;
|
||||
}
|
||||
|
||||
EmergencyCallInfoDialog::~EmergencyCallInfoDialog()
|
||||
@@ -77,7 +79,7 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
|
||||
m_dtc->enableAlmEmergencyCall();
|
||||
m_ftc->enableEmergencyCallAcknowledge();
|
||||
|
||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
|
||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
|
||||
setUiValues();
|
||||
|
||||
connect(m_dtc.get(), &AlarmManagement::Interface::Dtc::almEmergencyCallChanged, this,
|
||||
@@ -92,34 +94,34 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
|
||||
|
||||
QString EmergencyCallInfoDialog::emergencyIdentifier() const
|
||||
{
|
||||
return QStringLiteral("emergency_") + QString::number(m_emergency.id());
|
||||
return QStringLiteral("emergency_") + QString::number(m_emergency.id);
|
||||
}
|
||||
|
||||
bool EmergencyCallInfoDialog::setUiValues()
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
if (!m_dtc || !m_ftc || m_emergency.id() < 0)
|
||||
if (!m_dtc || !m_ftc || m_emergency.id < 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << " >> unabled to init EmergencyCallInfoDialog";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi()));
|
||||
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime())));
|
||||
m_ui->lblStatus->setText(m_emergency.expired()
|
||||
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted()))
|
||||
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi));
|
||||
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime)));
|
||||
m_ui->lblStatus->setText(m_emergency.expired
|
||||
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted))
|
||||
: QStringLiteral("--"));
|
||||
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment()));
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position().lon(), m_emergency.position().lat());
|
||||
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment));
|
||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position.lon, m_emergency.position.lat);
|
||||
m_ui->lblPosition->setText(mgrs);
|
||||
|
||||
const bool& hasOperatorRightEmergencyCall =
|
||||
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::EmergencyCall);
|
||||
m_ui->pbAckEmergency->setIcon(QIcon(QStringLiteral("icon:edit.svg")));
|
||||
m_ui->pbAckEmergency->setEnabled(m_emergency.expired() ? false : true);
|
||||
m_ui->pbAckEmergency->setEnabled(m_emergency.expired ? false : true);
|
||||
m_ui->pbAckEmergency->setVisible(hasOperatorRightEmergencyCall);
|
||||
|
||||
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired()));
|
||||
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired));
|
||||
m_ui->lblIcon->setPixmap(iconPixmap);
|
||||
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
@@ -129,7 +131,7 @@ bool EmergencyCallInfoDialog::setUiValues()
|
||||
void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergencyCall data, DataModification modType)
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
if (data.id() != m_emergency.id() || data.id() == 0)
|
||||
if (data.id != m_emergency.id || data.id == 0)
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
@@ -149,9 +151,9 @@ void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergen
|
||||
|
||||
void EmergencyCallInfoDialog::onFindEmergencyOnMap()
|
||||
{
|
||||
if (!m_sitMapGuiIfc || m_emergency.id() <= 0)
|
||||
if (!m_sitMapGuiIfc || m_emergency.id <= 0)
|
||||
return;
|
||||
m_sitMapGuiIfc->setCenterPoint(QPointF(m_emergency.position().lon(), m_emergency.position().lat()));
|
||||
m_sitMapGuiIfc->setCenterPoint(QPointF(m_emergency.position.lon, m_emergency.position.lat));
|
||||
}
|
||||
|
||||
void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
|
||||
@@ -191,18 +193,18 @@ void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
|
||||
|
||||
void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString& comment)
|
||||
{
|
||||
if (m_emergency.id() <= 0)
|
||||
if (m_emergency.id <= 0)
|
||||
return;
|
||||
|
||||
EmergencyCallAcknowledgeRequest request;
|
||||
request.id(m_emergency.id());
|
||||
request.name(m_emergency.name());
|
||||
request.issi(m_emergency.issi());
|
||||
request.timestamp(QDateTime::currentMSecsSinceEpoch());
|
||||
request.incomingTime(m_emergency.incomingTime());
|
||||
request.expired(true);
|
||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
||||
request.comment(comment.toStdString());
|
||||
request.id = m_emergency.id;
|
||||
request.name = m_emergency.name;
|
||||
request.issi = m_emergency.issi;
|
||||
request.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
request.incomingTime = m_emergency.incomingTime;
|
||||
request.expired = true;
|
||||
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||
request.comment = comment.toStdString();
|
||||
bool ret = m_requestHelper->startSingleRequest(
|
||||
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
||||
|
||||
@@ -212,8 +214,8 @@ void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString&
|
||||
|
||||
void EmergencyCallInfoDialog::retranslate()
|
||||
{
|
||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
|
||||
const QString lbName = tr("SOS_%1").arg(m_emergency.issi());
|
||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
|
||||
const QString lbName = tr("SOS_%1").arg(m_emergency.issi);
|
||||
translate(m_ui, lbName);
|
||||
}
|
||||
|
||||
|
||||
+16
-14
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "alm_emergency_call_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -24,6 +25,7 @@ EmergencyCallModel::EmergencyCallModel(QObject *parent)
|
||||
tr("Comment"),
|
||||
}, parent)
|
||||
, m_dtc(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
|
||||
@@ -35,35 +37,35 @@ QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
|
||||
switch (index.column())
|
||||
{
|
||||
case Columns::ID:
|
||||
return almEmergency.id();
|
||||
return almEmergency.id;
|
||||
case SAMPLE_TIME:
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime());
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime);
|
||||
case INCOMING_TIME:
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime());
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime);
|
||||
case NAME:
|
||||
return QString::fromStdString(almEmergency.name());
|
||||
return QString::fromStdString(almEmergency.name);
|
||||
case ISSI:
|
||||
return almEmergency.issi();
|
||||
return almEmergency.issi;
|
||||
case POSITION:
|
||||
{
|
||||
if (std::isnan(almEmergency.position().lat()))
|
||||
if (std::isnan(almEmergency.position.lat))
|
||||
return tr("---");
|
||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(almEmergency.position().lon(), almEmergency.position().lat());
|
||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(almEmergency.position.lon, almEmergency.position.lat);
|
||||
return mgrs;
|
||||
}
|
||||
case EXPIRED:
|
||||
return almEmergency.expired();
|
||||
return almEmergency.expired;
|
||||
case OPERATION_ID:
|
||||
{
|
||||
if (almEmergency.operatorId() == 0)
|
||||
if (almEmergency.operatorId == 0)
|
||||
return QStringLiteral("-");
|
||||
|
||||
return QString::fromStdString(m_opmDtc.get()->user(almEmergency.operatorId()).name());
|
||||
return QString::fromStdString(m_opmDtc.get()->user(almEmergency.operatorId).name);
|
||||
}
|
||||
case DELETED_TIMESTAMP:
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted());
|
||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted);
|
||||
case COMMENT:
|
||||
return QString::fromStdString(almEmergency.comment());
|
||||
return QString::fromStdString(almEmergency.comment);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -89,7 +91,7 @@ bool EmergencyCallModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
|
||||
void EmergencyCallModel::onAlarmEmergencyCallChanged(const AlarmManagement::AlmEmergencyCall &data, const DataModification modType)
|
||||
{
|
||||
const int id = data.id();
|
||||
const int id = data.id;
|
||||
int row = findRowForId(id);
|
||||
switch (modType)
|
||||
{
|
||||
@@ -148,7 +150,7 @@ bool EmergencyCallProxyModel::filterAcceptsRow(int source_row, const QModelIndex
|
||||
bool EmergencyCallProxyModel::checkFilter(int source_row) const
|
||||
{
|
||||
const auto sos = m_sourceModel->getRowData(source_row);
|
||||
if ((sos.expired() && !showExpired()) || (exerciseStopped() && !sos.expired()))
|
||||
if ((sos.expired && !showExpired()) || (exerciseStopped() && !sos.expired))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user