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
+4
-1
@@ -80,7 +80,10 @@ if(QT6_GUI_AVAILABLE)
|
||||
SmoMonitorsGuiPluginInterface
|
||||
LtsDataView
|
||||
GuiPluginInterface
|
||||
|
||||
advancedSymbology
|
||||
advancedSymbologyGui
|
||||
svcPpmCommon
|
||||
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
+14
-12
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "bld_config_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_bld_config_dialog.h"
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace Buildings
|
||||
BldConfigDialog::BldConfigDialog(int bldEntityId, const QString& displayName, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_bldEntityId(bldEntityId),
|
||||
m_displayName(displayName), m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::BldConfigDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -63,13 +65,13 @@ bool BldConfigDialog::init(LtsSession::LtsSession* session)
|
||||
void BldConfigDialog::fillCbx()
|
||||
{
|
||||
m_ui->cmbStatus->clear();
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange),
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange);
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady),
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill),
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill);
|
||||
m_ui->cmbStatus->setCurrentIndex(m_ui->cmbStatus->findData(m_bldState.vulnerabilityState().underlying()));
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange),static_cast<int>(
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange));
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady),static_cast<int>(
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady));
|
||||
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill),static_cast<int>(
|
||||
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill));
|
||||
m_ui->cmbStatus->setCurrentIndex(m_ui->cmbStatus->findData(static_cast<int>(m_bldState.vulnerabilityState)));
|
||||
}
|
||||
|
||||
bool BldConfigDialog::apply()
|
||||
@@ -84,16 +86,16 @@ bool BldConfigDialog::apply()
|
||||
|
||||
m_requestHelper->addRequest([this]() {
|
||||
Buildings::Building building;
|
||||
building.buildingId(m_bldEntityId);
|
||||
building.buildingId = m_bldEntityId;
|
||||
|
||||
SetBuildingStatesRequest requestData;
|
||||
requestData.buildings({building});
|
||||
requestData.buildings = {building};
|
||||
|
||||
ProjectDataManagement::VulnerabilityState state =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(m_ui->cmbStatus->currentData().toInt());
|
||||
requestData.vulnerabilityState(state);
|
||||
requestData.vulnerabilityState = state;
|
||||
|
||||
requestData.resetContamination(m_ui->chbResetContamination->isChecked());
|
||||
requestData.resetContamination = m_ui->chbResetContamination->isChecked();
|
||||
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentIndex: " << m_ui->cmbStatus->currentIndex();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state;
|
||||
@@ -111,7 +113,7 @@ void Buildings::BldConfigDialog::slotCmbStatusCurrentIndexChanged(int index)
|
||||
Q_UNUSED(index)
|
||||
ProjectDataManagement::VulnerabilityState state =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(m_ui->cmbStatus->currentData().toInt());
|
||||
if (state == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
|
||||
if (state == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
|
||||
{
|
||||
m_ui->chbResetContamination->setEnabled(true);
|
||||
m_ui->chbResetContamination->setChecked(false);
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "bld_history_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_bld_history_dialog.h"
|
||||
|
||||
#include "bld_history_dialog_model.h"
|
||||
@@ -14,6 +15,7 @@ BuildingHistoryDialog::BuildingHistoryDialog(const QString &bldName, QWidget *pa
|
||||
, m_model(new BuildingHistoryDialogModel(this))
|
||||
, m_proxyModel(new BuildingHistoryDialogProxyModel(this))
|
||||
, m_ui(new Ui::BuildingHistoryDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_proxyModel->setSourceModel(m_model);
|
||||
|
||||
+54
-52
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "bld_history_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <Buildings/bld_data_plugin_interface.h>
|
||||
@@ -17,6 +18,7 @@ BuildingHistoryDialogModel::BuildingHistoryDialogModel(QObject* parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<Buildings::HistoryStateItemEx>(
|
||||
{tr("Time"), tr("Charge Type"), tr("Originator"), tr("Damage [%]"), tr("Contamination")}, parent),
|
||||
m_mseId(-1)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +39,7 @@ bool BuildingHistoryDialogModel::initModel(int mseId, LtsSession::LtsSession* se
|
||||
connect(dtc.get(), &Interface::Dtc::historyStateChanged, this, &BuildingHistoryDialogModel::onHistoryStateChanged);
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_mseId=" << m_mseId;
|
||||
reinitModel(dtc->historyState(m_mseId).stateHistory());
|
||||
reinitModel(dtc->historyState(m_mseId).stateHistory);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,15 +55,15 @@ QVariant BuildingHistoryDialogModel::data(const QModelIndex& index, int role) co
|
||||
switch (index.column())
|
||||
{
|
||||
case Time:
|
||||
return QDateTime::fromMSecsSinceEpoch(data.time());
|
||||
return QDateTime::fromMSecsSinceEpoch(data.time);
|
||||
case Charge:
|
||||
return data.chargeTypeName;
|
||||
case Originator:
|
||||
return data.originatorName;
|
||||
case Damage:
|
||||
return data.damagePercent();
|
||||
return data.damagePercent;
|
||||
case Contamination:
|
||||
return getContaminations(data.contaminationStates());
|
||||
return getContaminations(data.contaminationStates);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
@@ -69,7 +71,7 @@ QVariant BuildingHistoryDialogModel::data(const QModelIndex& index, int role) co
|
||||
void BuildingHistoryDialogModel::onHistoryStateChanged(const Buildings::HistoryState& data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onHistoryStateChanged";
|
||||
if (m_mseId != data.mseId())
|
||||
if (m_mseId != data.mseId)
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
@@ -79,7 +81,7 @@ void BuildingHistoryDialogModel::onHistoryStateChanged(const Buildings::HistoryS
|
||||
endResetModel();
|
||||
return;
|
||||
}
|
||||
reinitModel(data.stateHistory());
|
||||
reinitModel(data.stateHistory);
|
||||
}
|
||||
|
||||
QString BuildingHistoryDialogModel::getChargeTypeName(int chargeTypeId, bool shortName) const
|
||||
@@ -92,42 +94,42 @@ QString BuildingHistoryDialogModel::getChargeTypeName(int chargeTypeId, bool sho
|
||||
|
||||
QString BuildingHistoryDialogModel::getOriginatorName(const HistoryStateItemEx& data) const
|
||||
{
|
||||
QString originatorType(ProjectDataManagement::toString(data.originatorType()));
|
||||
QString originatorType(ProjectDataManagement::toString(data.originatorType));
|
||||
QString originator;
|
||||
switch (data.originatorType().underlying())
|
||||
switch (data.originatorType)
|
||||
{
|
||||
case ProjectDataManagement::StateChangeOriginator::Participant: {
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Participant: {
|
||||
|
||||
if (data.originatorParticipantId() > 0)
|
||||
if (data.originatorParticipantId > 0)
|
||||
{
|
||||
ParticipantManagement::Participant participant = m_ppmDtc->participant(data.originatorParticipantId());
|
||||
if (participant.equipmentNumber().is_set())
|
||||
originator = QString::number(participant.equipmentNumber().get());
|
||||
ParticipantManagement::Participant participant = m_ppmDtc->participant(data.originatorParticipantId);
|
||||
if (participant.equipmentNumber.has_value())
|
||||
originator = QString::number(participant.equipmentNumber.get());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation:
|
||||
case ProjectDataManagement::StateChangeOriginator::FunctionalArea: {
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_FunctionalArea: {
|
||||
AreaEffectSimulation::AesItem aesItem;
|
||||
m_aesDtc->aesItemFromId(data.aesId(), aesItem);
|
||||
if (aesItem.id() > 0)
|
||||
originator = QString::fromStdString(aesItem.name());
|
||||
m_aesDtc->aesItemFromId(data.aesId, aesItem);
|
||||
if (aesItem.id > 0)
|
||||
originator = QString::fromStdString(aesItem.name);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::DusMine:
|
||||
case ProjectDataManagement::StateChangeOriginator::ExerciseControl:
|
||||
case ProjectDataManagement::StateChangeOriginator::ObserverController:
|
||||
case ProjectDataManagement::StateChangeOriginator::WoundTreatmentDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::MedicalTimeout:
|
||||
case ProjectDataManagement::StateChangeOriginator::MaintainanceDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::Initialization:
|
||||
case ProjectDataManagement::StateChangeOriginator::Sanitation:
|
||||
case ProjectDataManagement::StateChangeOriginator::Unknown:
|
||||
return ProjectDataManagement::toString(data.originatorType());
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_DusMine:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ExerciseControl:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ObserverController:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_WoundTreatmentDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MaintainanceDevice:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Initialization:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation:
|
||||
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Unknown:
|
||||
return ProjectDataManagement::toString(data.originatorType);
|
||||
}
|
||||
|
||||
QString chargeTypeShortName = getChargeTypeName(data.chargeTypeId());
|
||||
QString chargeTypeShortName = getChargeTypeName(data.chargeTypeId);
|
||||
if (!originator.isEmpty() && !chargeTypeShortName.isEmpty())
|
||||
originatorType += QStringLiteral("(%1 - %2)").arg(originator, chargeTypeShortName);
|
||||
else if (!originator.isEmpty())
|
||||
@@ -145,9 +147,9 @@ QString BuildingHistoryDialogModel::getContaminations(
|
||||
for (const auto& cs : contaminationStates)
|
||||
{
|
||||
AreaEffectSimulation::AesItem item;
|
||||
m_aesDtc->aesItemFromId(cs.aesId(), item);
|
||||
m_aesDtc->aesItemFromId(cs.aesId, item);
|
||||
const ProjectDataManagement::GearClass& gc =
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId());
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct.chargeTypeId);
|
||||
DEBUG_LOG(m_logger) << "gc=" << gc;
|
||||
if (gc == ProjectDataManagement::GearClass::GearClass_Unknown)
|
||||
continue;
|
||||
@@ -171,16 +173,16 @@ void BuildingHistoryDialogModel::reinitModel(const std::vector<Buildings::Histor
|
||||
|
||||
if (newData.size() == 0)
|
||||
return;
|
||||
m_vecData.resize(newData.size() + newData[0].contaminationStates().size());
|
||||
m_vecData.resize(newData.size() + newData[0].contaminationStates.size());
|
||||
contaminationOffest = 0;
|
||||
|
||||
for (size_t stateHistoryIndex = 0; stateHistoryIndex < newData.size(); ++stateHistoryIndex)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "\n\nstateHistoryIndex=" << stateHistoryIndex;
|
||||
|
||||
if (((newData.at(stateHistoryIndex).contaminationStates().size() > 0 && stateHistoryIndex == 0) ||
|
||||
(stateHistoryIndex > 0 && (newData.at(stateHistoryIndex).contaminationStates().size() >
|
||||
newData.at(stateHistoryIndex - 1).contaminationStates().size()))) &&
|
||||
if (((newData.at(stateHistoryIndex).contaminationStates.size() > 0 && stateHistoryIndex == 0) ||
|
||||
(stateHistoryIndex > 0 && (newData.at(stateHistoryIndex).contaminationStates.size() >
|
||||
newData.at(stateHistoryIndex - 1).contaminationStates.size()))) &&
|
||||
(stateHistoryIndex > 0))
|
||||
DEBUG_LOG(m_logger) << "1. State ist Kontamination";
|
||||
else
|
||||
@@ -188,27 +190,27 @@ void BuildingHistoryDialogModel::reinitModel(const std::vector<Buildings::Histor
|
||||
DEBUG_LOG(m_logger) << "State aus StateItem nehmen: stateHistoryIndex=" << stateHistoryIndex;
|
||||
auto& data = m_vecData[stateHistoryIndex];
|
||||
data = HistoryStateItemEx(newData.at(stateHistoryIndex));
|
||||
data.chargeTypeName = getChargeTypeName(data.chargeTypeId());
|
||||
data.chargeTypeName = getChargeTypeName(data.chargeTypeId);
|
||||
QString originatorName = getOriginatorName(data);
|
||||
|
||||
data.originatorName = originatorName;
|
||||
if (newData.at(stateHistoryIndex).contaminationStates().empty())
|
||||
if (newData.at(stateHistoryIndex).contaminationStates.empty())
|
||||
data.contamination.clear();
|
||||
else
|
||||
data.contamination = QStringLiteral("C");
|
||||
DEBUG_LOG(m_logger) << "indexModel=" << indexModel << " chargeTypeId=" << data.chargeTypeId()
|
||||
<< " chargeTypeName=" << getChargeTypeName(data.chargeTypeId())
|
||||
DEBUG_LOG(m_logger) << "indexModel=" << indexModel << " chargeTypeId=" << data.chargeTypeId
|
||||
<< " chargeTypeName=" << getChargeTypeName(data.chargeTypeId)
|
||||
<< " originatorName=" << getOriginatorName(data);
|
||||
indexModel++;
|
||||
}
|
||||
|
||||
unsigned int contaminationIndex = 0;
|
||||
|
||||
for (const auto& contaminationState : newData.at(stateHistoryIndex).contaminationStates())
|
||||
for (const auto& contaminationState : newData.at(stateHistoryIndex).contaminationStates)
|
||||
{
|
||||
|
||||
AreaEffectSimulation::AesItem item;
|
||||
m_aesDtc->aesItemFromId(contaminationState.aesId(), item);
|
||||
m_aesDtc->aesItemFromId(contaminationState.aesId, item);
|
||||
DEBUG_LOG(m_logger) << "m_vecData.size=" << m_vecData.size() << " indexModel=" << indexModel
|
||||
<< " newData.size()=" << newData.size()
|
||||
<< " contaminationOffest=" << contaminationOffest;
|
||||
@@ -217,8 +219,8 @@ void BuildingHistoryDialogModel::reinitModel(const std::vector<Buildings::Histor
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "stateHistoryIndex=" << stateHistoryIndex << " contaminationIndex="
|
||||
<< " newData.at(stateHistoryIndex-1).contaminationStates().size() ="
|
||||
<< newData.at(stateHistoryIndex - 1).contaminationStates().size();
|
||||
if (contaminationIndex < newData.at(stateHistoryIndex - 1).contaminationStates().size())
|
||||
<< newData.at(stateHistoryIndex - 1).contaminationStates.size();
|
||||
if (contaminationIndex < newData.at(stateHistoryIndex - 1).contaminationStates.size())
|
||||
{
|
||||
contaminationIndex++;
|
||||
DEBUG_LOG(m_logger) << "continue";
|
||||
@@ -231,16 +233,16 @@ void BuildingHistoryDialogModel::reinitModel(const std::vector<Buildings::Histor
|
||||
auto& data = m_vecData[indexModel];
|
||||
|
||||
data = HistoryStateItemEx(newData.at(stateHistoryIndex));
|
||||
data.chargeTypeName = getChargeTypeName(item.chargeStruct().chargeTypeId());
|
||||
QString originatorName = QString::fromStdString(item.name());
|
||||
data.chargeTypeName = getChargeTypeName(item.chargeStruct.chargeTypeId);
|
||||
QString originatorName = QString::fromStdString(item.name);
|
||||
|
||||
data.originatorName = originatorName;
|
||||
data.contamination = QStringLiteral("C");
|
||||
::rti::core::int64 time = item.effectStart().get();
|
||||
data.time(time);
|
||||
DEBUG_LOG(m_logger) << " indexModel=" << indexModel << " AesId=" << contaminationState.aesId()
|
||||
<< " chargeTypeId=" << data.chargeTypeId()
|
||||
<< " chargeTypeName=" << getChargeTypeName(data.chargeTypeId())
|
||||
::rti::core::int64 time = item.effectStart.get();
|
||||
data.time = time;
|
||||
DEBUG_LOG(m_logger) << " indexModel=" << indexModel << " AesId=" << contaminationState.aesId
|
||||
<< " chargeTypeId=" << data.chargeTypeId
|
||||
<< " chargeTypeName=" << getChargeTypeName(data.chargeTypeId)
|
||||
<< " originatorName=" << getOriginatorName(data);
|
||||
|
||||
indexModel++;
|
||||
@@ -267,7 +269,7 @@ bool BuildingHistoryDialogProxyModel::lessThan(const QModelIndex& source_left, c
|
||||
switch (source_left.column())
|
||||
{
|
||||
case BuildingHistoryDialogModel::Time:
|
||||
return dataLeft.time() < dataRight.time();
|
||||
return dataLeft.time < dataRight.time;
|
||||
case BuildingHistoryDialogModel::Charge:
|
||||
case BuildingHistoryDialogModel::Originator:
|
||||
case BuildingHistoryDialogModel::Damage:
|
||||
|
||||
+31
-29
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "bld_hitline_info_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_bld_hitline_info_dialog.h"
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace Buildings
|
||||
HitLineInfoDialog::HitLineInfoDialog(int hitLineId, QWidget* parent)
|
||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_hitLineId(hitLineId),
|
||||
m_ui(new Ui::HitLineInfoDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -67,11 +69,11 @@ bool HitLineInfoDialog::init(LtsSession::LtsSession* session)
|
||||
session->getForeignGuiInterface<SituationMap::ForeignGuiInterface>(m_sitMapGuiIfc);
|
||||
|
||||
m_bldDtc->buildingHitLineInfos([this](const BuildingHitLineInfo& data) {
|
||||
if (data.id() == m_hitLineId)
|
||||
if (data.id == m_hitLineId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Found Building HitLine Id: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Found Building HitLine Id: " << data.id;
|
||||
m_hitLineInfo = data;
|
||||
m_participantOriginator = m_ppmDtc->participant(data.originatorParticipantId());
|
||||
m_participantOriginator = m_ppmDtc->participant(data.originatorParticipantId);
|
||||
showHitLineInfos();
|
||||
}
|
||||
});
|
||||
@@ -85,55 +87,55 @@ void HitLineInfoDialog::showHitLineInfos()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id:" << m_hitLineId;
|
||||
|
||||
if (m_hitLineInfo.buildingId() <= 0 || m_hitLineInfo.originatorParticipantId() <= 0)
|
||||
if (m_hitLineInfo.buildingId <= 0 || m_hitLineInfo.originatorParticipantId <= 0)
|
||||
return;
|
||||
|
||||
m_ui->lblHitLineId->setText(QString::number(m_hitLineId));
|
||||
|
||||
m_ui->lblSampleTime->setText(DTG::toStringMSec(m_hitLineInfo.sampleTime()));
|
||||
m_ui->lblSampleTime->setText(DTG::toStringMSec(m_hitLineInfo.sampleTime));
|
||||
|
||||
m_ui->lblOriginatorEquipNr->setText(QString::number(m_participantOriginator.equipmentNumber().get()));
|
||||
m_ui->lblOriginatorEquipNr->setText(QString::number(m_participantOriginator.equipmentNumber.get()));
|
||||
|
||||
m_ui->lblOriginatorParty->setText(
|
||||
ParticipantManagement::trPartyName(m_ppmDtc->party(m_hitLineInfo.originatorPartyId()).name()));
|
||||
ParticipantManagement::trPartyName(m_ppmDtc->party(m_hitLineInfo.originatorPartyId).name));
|
||||
|
||||
m_ui->lblOriginatorDesignator->setText(QString::fromStdString(m_participantOriginator.designator()));
|
||||
m_ui->lblOriginatorDesignator->setText(QString::fromStdString(m_participantOriginator.designator));
|
||||
|
||||
m_ui->lblOriginatorTactIdentifier->setText(QString::fromStdString(m_participantOriginator.tacticalIdentifier()));
|
||||
m_ui->lblOriginatorTactIdentifier->setText(QString::fromStdString(m_participantOriginator.tacticalIdentifier));
|
||||
|
||||
m_ui->lblOriginatorType->setText(
|
||||
ParticipantManagement::trTypeName(m_ppmDtc->type(m_participantOriginator.typeId()).name()));
|
||||
ParticipantManagement::trTypeName(m_ppmDtc->type(m_participantOriginator.typeId).name));
|
||||
|
||||
QString mgrs =
|
||||
LtsCoordTrans::mgrsFromGeographic(m_hitLineInfo.originatorPos().lon(), m_hitLineInfo.originatorPos().lat());
|
||||
if (qFuzzyIsNull(m_hitLineInfo.originatorPos().z()))
|
||||
LtsCoordTrans::mgrsFromGeographic(m_hitLineInfo.originatorPos.lon, m_hitLineInfo.originatorPos.lat);
|
||||
if (qFuzzyIsNull(m_hitLineInfo.originatorPos.z))
|
||||
m_ui->lblOriginatorPos->setText(tr("Position: %1").arg(mgrs));
|
||||
else
|
||||
m_ui->lblOriginatorPos->setText(tr("Position: %1 %2").arg(mgrs).arg(m_hitLineInfo.originatorPos().z()));
|
||||
m_ui->lblOriginatorPos->setText(tr("Position: %1 %2").arg(mgrs).arg(m_hitLineInfo.originatorPos.z));
|
||||
|
||||
m_ui->lblBuildingId->setText(QString::number(m_hitLineInfo.buildingId()));
|
||||
m_ui->lblBuildingId->setText(QString::number(m_hitLineInfo.buildingId));
|
||||
if (m_ismDtc)
|
||||
m_ui->lblBuildingName->setText(m_ismDtc->getBuildingDisplayName(m_hitLineInfo.buildingId()));
|
||||
m_ui->lblBuildingName->setText(m_ismDtc->getBuildingDisplayName(m_hitLineInfo.buildingId));
|
||||
|
||||
mgrs = LtsCoordTrans::mgrsFromGeographic(m_hitLineInfo.buildingPos().lon(), m_hitLineInfo.buildingPos().lat());
|
||||
if (qFuzzyIsNull(m_hitLineInfo.buildingPos().z()))
|
||||
mgrs = LtsCoordTrans::mgrsFromGeographic(m_hitLineInfo.buildingPos.lon, m_hitLineInfo.buildingPos.lat);
|
||||
if (qFuzzyIsNull(m_hitLineInfo.buildingPos.z))
|
||||
m_ui->lblBuildingPos->setText(tr("Position: %1").arg(mgrs));
|
||||
else
|
||||
m_ui->lblBuildingPos->setText(tr("Position: %1 %2").arg(mgrs).arg(m_hitLineInfo.buildingPos().z()));
|
||||
m_ui->lblBuildingPos->setText(tr("Position: %1 %2").arg(mgrs).arg(m_hitLineInfo.buildingPos.z));
|
||||
|
||||
Buildings::BuildingState bldState = m_bldDtc->buildingState((m_hitLineInfo.buildingId()));
|
||||
ProjectDataManagement::VulnerabilityState st = bldState.vulnerabilityState();
|
||||
Buildings::BuildingState bldState = m_bldDtc->buildingState((m_hitLineInfo.buildingId));
|
||||
ProjectDataManagement::VulnerabilityState st = bldState.vulnerabilityState;
|
||||
m_ui->lblBuildingStatus->setText(toString(st));
|
||||
|
||||
m_ui->lblBuildingDamagePercent->setText(QString::number(bldState.damagePercent()));
|
||||
m_ui->lblBuildingDamagePercent->setText(QString::number(bldState.damagePercent));
|
||||
|
||||
m_ui->lblBuildingDamageOldPercent->setText(QString::number(bldState.damagePercentOld()));
|
||||
m_ui->lblBuildingDamageOldPercent->setText(QString::number(bldState.damagePercentOld));
|
||||
|
||||
m_ui->lblChargeTypeId->setText(QString::number(m_hitLineInfo.chargeTypeId()));
|
||||
m_ui->lblChargeTypeId->setText(QString::number(m_hitLineInfo.chargeTypeId));
|
||||
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_hitLineInfo.chargeTypeId()));
|
||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_hitLineInfo.chargeTypeId));
|
||||
|
||||
const QString contamination = getContaminations(m_hitLineInfo.contaminationStates());
|
||||
const QString contamination = getContaminations(m_hitLineInfo.contaminationStates);
|
||||
m_ui->lbContamination->setHidden(contamination.isEmpty());
|
||||
m_ui->lblContamination->setHidden(contamination.isEmpty());
|
||||
m_ui->lblContamination->setText(contamination.isEmpty() ? QStringLiteral("-") : contamination);
|
||||
@@ -148,9 +150,9 @@ HitLineInfoDialog::getContaminations(const std::vector<Buildings::ContaminationS
|
||||
for (const auto& cs : contaminationStates)
|
||||
{
|
||||
AreaEffectSimulation::AesItem item;
|
||||
m_aesDtc->aesItemFromId(cs.aesId(), item);
|
||||
m_aesDtc->aesItemFromId(cs.aesId, item);
|
||||
const ProjectDataManagement::GearClass& gc =
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId());
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct.chargeTypeId);
|
||||
if (gc == ProjectDataManagement::GearClass::GearClass_Unknown)
|
||||
continue;
|
||||
QString gearClassName = ProjectDataManagement::toString(gc).trimmed();
|
||||
@@ -164,13 +166,13 @@ HitLineInfoDialog::getContaminations(const std::vector<Buildings::ContaminationS
|
||||
void HitLineInfoDialog::onFindOriginatorOnMap()
|
||||
{
|
||||
if (m_sitMapGuiIfc)
|
||||
m_sitMapGuiIfc->centerMapToParticipant(m_participantOriginator.id());
|
||||
m_sitMapGuiIfc->centerMapToParticipant(m_participantOriginator.id);
|
||||
}
|
||||
|
||||
void HitLineInfoDialog::onFindBuildingOnMap()
|
||||
{
|
||||
if (m_sitMapGuiIfc)
|
||||
m_sitMapGuiIfc->centerMapToBuildingObject(m_hitLineInfo.buildingId());
|
||||
m_sitMapGuiIfc->centerMapToBuildingObject(m_hitLineInfo.buildingId);
|
||||
}
|
||||
|
||||
} // namespace Buildings
|
||||
+75
-74
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "bld_info_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "bld_history_dialog.h"
|
||||
#include "egcu_info_dialog.h"
|
||||
@@ -125,7 +126,7 @@ void BldInfoDialog::retranslate()
|
||||
preIcon.fill(Qt::transparent);
|
||||
preIcon.setDevicePixelRatio(dpr);
|
||||
m_ui->lblIcon->setPixmap(preIcon);
|
||||
QImage img = m_ui->lblIcon->pixmap()->toImage();
|
||||
QImage img = m_ui->lblIcon->pixmap().toImage();
|
||||
QPainter painter(&img);
|
||||
painter.setPen(QPen(Qt::black, 3, Qt::SolidLine, Qt::FlatCap, Qt::RoundJoin));
|
||||
painter.setBrush(Qt::transparent);
|
||||
@@ -154,7 +155,7 @@ bool BldInfoDialog::init(LtsSession::LtsSession* session)
|
||||
m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc);
|
||||
m_session->getDtc<ProjectDataManagement::DataInterface>(m_pdmDtc);
|
||||
|
||||
const bool isBridge = m_mse.structureElementTypeId() == InfrastructureManagement::StructureElementType::Bridge;
|
||||
const bool isBridge = m_mse.structureElementTypeId == InfrastructureManagement::StructureElementType::Bridge;
|
||||
const bool isResourceManagerApp = m_session->app() == LtsAppDescriptor::App::ResourceManager;
|
||||
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " m_mse" << m_mse << ", isBridge=" << isBridge;
|
||||
@@ -169,8 +170,8 @@ bool BldInfoDialog::init(LtsSession::LtsSession* session)
|
||||
showBuildingInfos();
|
||||
|
||||
auto predicate = [](const InfrastructureManagement::InstrumentationAsset& a) {
|
||||
return (!a.isDeleted() &&
|
||||
(a.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit));
|
||||
return (!a.isDeleted &&
|
||||
(a.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit));
|
||||
};
|
||||
QMap<int, QVector<InfrastructureManagement::InstrumentationAsset>> assetsMapBuilding;
|
||||
m_ismDtc->waitForHistoricalDataInstrumentationAsset(500);
|
||||
@@ -189,20 +190,20 @@ bool BldInfoDialog::init(LtsSession::LtsSession* session)
|
||||
InfrastructureManagement::MountingPointAsset mpa;
|
||||
for (const auto& mpax : std::as_const(mountingPointAssets))
|
||||
{
|
||||
if (mpax.assetId() == instrumentationAsset.id())
|
||||
if (mpax.assetId == instrumentationAsset.id)
|
||||
{
|
||||
mpa = mpax;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mpa.assetId() != instrumentationAsset.id())
|
||||
if (mpa.assetId != instrumentationAsset.id)
|
||||
continue;
|
||||
|
||||
std::string name = mpa.name().empty() ? instrumentationAsset.name() : mpa.name();
|
||||
int assetId = mpa.assetId();
|
||||
std::string name = mpa.name.empty() ? instrumentationAsset.name : mpa.name;
|
||||
int assetId = mpa.assetId;
|
||||
QPushButton* w = new QPushButton(QString::fromStdString(name), this);
|
||||
w->setProperty("assetId", assetId);
|
||||
w->setProperty("assetName", QString::fromStdString(instrumentationAsset.name()));
|
||||
w->setProperty("assetName", QString::fromStdString(instrumentationAsset.name));
|
||||
l->addWidget(w);
|
||||
connect(w, &QPushButton::clicked, this, &BldInfoDialog::onEgcuInfoDialogRequested);
|
||||
}
|
||||
@@ -374,7 +375,7 @@ QString BldInfoDialog::getFloorName(int floorSeId)
|
||||
InfrastructureManagement::StructureElement floorSe;
|
||||
if (!getRoom(floorSeId, floorSe))
|
||||
return QStringLiteral("<unknown floor>");
|
||||
return QString::fromStdString(floorSe.displayName());
|
||||
return QString::fromStdString(floorSe.displayName);
|
||||
}
|
||||
|
||||
bool BldInfoDialog::getRoom(int roomSeId, InfrastructureManagement::StructureElement& roomSe)
|
||||
@@ -414,7 +415,7 @@ int BldInfoDialog::findFloorIdByRoomId(int roomId) noexcept(false)
|
||||
return -1;
|
||||
}
|
||||
|
||||
const std::vector<int32_t> path = roomSe.path();
|
||||
const std::vector<int32_t> path = roomSe.path;
|
||||
|
||||
for (const int parentSeId : path)
|
||||
{
|
||||
@@ -422,28 +423,28 @@ int BldInfoDialog::findFloorIdByRoomId(int roomId) noexcept(false)
|
||||
if (!getRoom(parentSeId, parentSe))
|
||||
continue;
|
||||
|
||||
if (parentSe.structureElementTypeId().underlying() != StructureElementType::Floor)
|
||||
if (parentSe.structureElementTypeId != StructureElementType::Floor)
|
||||
continue;
|
||||
|
||||
m_floorNames.insert(parentSeId, QString::fromStdString(parentSe.displayName()));
|
||||
m_floorNames.insert(parentSeId, QString::fromStdString(parentSe.displayName));
|
||||
m_roomToFloorCache.insert(roomId, parentSeId);
|
||||
return parentSeId;
|
||||
}
|
||||
|
||||
throw QStringLiteral("findFloorId: floor id for room %1 not found").arg(roomSe.id());
|
||||
throw QStringLiteral("findFloorId: floor id for room %1 not found").arg(roomSe.id);
|
||||
}
|
||||
|
||||
void BldInfoDialog::addParticipantPosition(const ParticipantManagement::ParticipantPosition& data, DataModification)
|
||||
{
|
||||
if (data.buildingId() != m_mse.id())
|
||||
if (data.buildingId != m_mse.id)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const int roomId = data.roomId();
|
||||
const int participantId = data.participantId();
|
||||
const int participantPartyId = data.partyId();
|
||||
const int roomId = data.roomId;
|
||||
const int participantId = data.participantId;
|
||||
const int participantPartyId = data.partyId;
|
||||
int participantFloorId;
|
||||
|
||||
participantFloorId = findFloorIdByRoomId(roomId);
|
||||
@@ -541,7 +542,7 @@ void BldInfoDialog::updateFloorParticipantTable()
|
||||
|
||||
floorPartyParticipantCountStrings +=
|
||||
QStringLiteral("<font color='#%1'>%2</font>")
|
||||
.arg(QString::number((unsigned int)parties.value(party).color(), 16))
|
||||
.arg(QString::number((unsigned int)parties.value(party).color, 16))
|
||||
.arg(count);
|
||||
}
|
||||
|
||||
@@ -556,7 +557,7 @@ void BldInfoDialog::updateFloorParticipantTable()
|
||||
|
||||
void BldInfoDialog::showBuildingInfos(const Buildings::BuildingState& bldState)
|
||||
{
|
||||
if (bldState.id() <= 0)
|
||||
if (bldState.id <= 0)
|
||||
{
|
||||
m_ui->lblBldId->clear();
|
||||
m_ui->lblStructElementId->clear();
|
||||
@@ -570,42 +571,42 @@ void BldInfoDialog::showBuildingInfos(const Buildings::BuildingState& bldState)
|
||||
return;
|
||||
}
|
||||
|
||||
m_ui->lblBldId->setText(QString::number(bldState.id()));
|
||||
m_ui->lblStructElementId->setText(QString::number(bldState.structureElementId()));
|
||||
m_ui->lblAssetId->setText(QString::number(bldState.assetId()));
|
||||
m_ui->lblBldId->setText(QString::number(bldState.id));
|
||||
m_ui->lblStructElementId->setText(QString::number(bldState.structureElementId));
|
||||
m_ui->lblAssetId->setText(QString::number(bldState.assetId));
|
||||
|
||||
m_ui->lblOrganisatorParticipantId->clear();
|
||||
if (bldState.originatorParticipantId())
|
||||
if (bldState.originatorParticipantId)
|
||||
{
|
||||
if (m_ppmDtc)
|
||||
{
|
||||
ParticipantManagement::Participant player = m_ppmDtc->participant(bldState.originatorParticipantId());
|
||||
if (player.equipmentNumber().is_set())
|
||||
m_ui->lblOrganisatorParticipantId->setText(QString::number(player.equipmentNumber().get()));
|
||||
ParticipantManagement::Participant player = m_ppmDtc->participant(bldState.originatorParticipantId);
|
||||
if (player.equipmentNumber.has_value())
|
||||
m_ui->lblOrganisatorParticipantId->setText(QString::number(player.equipmentNumber.get()));
|
||||
}
|
||||
}
|
||||
else if (bldState.aesId())
|
||||
else if (bldState.aesId)
|
||||
{
|
||||
if (m_aesDtc)
|
||||
{
|
||||
AreaEffectSimulation::AesItem aesItem;
|
||||
m_aesDtc->aesItemFromId(bldState.aesId(), aesItem);
|
||||
m_ui->lblOrganisatorParticipantId->setText(QString::fromStdString(aesItem.name()));
|
||||
m_aesDtc->aesItemFromId(bldState.aesId, aesItem);
|
||||
m_ui->lblOrganisatorParticipantId->setText(QString::fromStdString(aesItem.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
m_ui->lblOrganisatorParticipantId->setText(tr("EXCON"));
|
||||
|
||||
m_ui->lblDamagePercent->setText(QString::number(bldState.damagePercent()));
|
||||
m_ui->lblDamagePercentOld->setText(QString::number(bldState.damagePercentOld()));
|
||||
m_ui->lblDamagePercent->setText(QString::number(bldState.damagePercent));
|
||||
m_ui->lblDamagePercentOld->setText(QString::number(bldState.damagePercentOld));
|
||||
|
||||
QStringList contaminationList;
|
||||
for (const auto& cs : bldState.contaminationStates())
|
||||
for (const auto& cs : bldState.contaminationStates)
|
||||
{
|
||||
AreaEffectSimulation::AesItem item;
|
||||
m_aesDtc->aesItemFromId(cs.aesId(), item);
|
||||
m_aesDtc->aesItemFromId(cs.aesId, item);
|
||||
const ProjectDataManagement::GearClass& gc =
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId());
|
||||
m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct.chargeTypeId);
|
||||
if (gc == ProjectDataManagement::GearClass::GearClass_Unknown)
|
||||
continue;
|
||||
QString gearClassName = ProjectDataManagement::toString(gc).trimmed();
|
||||
@@ -617,12 +618,12 @@ void BldInfoDialog::showBuildingInfos(const Buildings::BuildingState& bldState)
|
||||
m_ui->lblContamination->setHidden(contaminationList.isEmpty());
|
||||
m_ui->lblContamination->setText(contaminationList.join(QStringLiteral("+")));
|
||||
|
||||
ProjectDataManagement::VulnerabilityState st = bldState.vulnerabilityState();
|
||||
ProjectDataManagement::VulnerabilityState st = bldState.vulnerabilityState;
|
||||
m_ui->lblStatus->setText(toString(st));
|
||||
|
||||
m_ui->twFloorParticipantCount->hideColumn(2);
|
||||
DEBUG_LOG(m_logger) << "fillOwnership";
|
||||
fillOwnership(bldState.id());
|
||||
fillOwnership(bldState.id);
|
||||
DEBUG_LOG(m_logger) << "Vor fillContaminationTable";
|
||||
fillContaminationTable(bldState);
|
||||
DEBUG_LOG(m_logger) << "Nach fillContaminationTable";
|
||||
@@ -633,14 +634,14 @@ void BldInfoDialog::fillContaminationTable(const Buildings::BuildingState& bldSt
|
||||
clearColumn(2);
|
||||
bool showContaminationCol = false;
|
||||
DEBUG_LOG(m_logger) << "fillContaminationTable bldState.contaminationStates().size()="
|
||||
<< bldState.contaminationStates().size();
|
||||
for (const auto& cs : bldState.contaminationStates())
|
||||
<< bldState.contaminationStates.size();
|
||||
for (const auto& cs : bldState.contaminationStates)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "cs.rooms().size()=" << cs.rooms().size();
|
||||
DEBUG_LOG(m_logger) << "cs.rooms().size()=" << cs.rooms.size();
|
||||
|
||||
for (unsigned int i = 0; i < cs.rooms().size(); i++)
|
||||
for (unsigned int i = 0; i < cs.rooms.size(); i++)
|
||||
{
|
||||
int floorIdContamination = findFloorIdByRoomId(cs.rooms()[i]);
|
||||
int floorIdContamination = findFloorIdByRoomId(cs.rooms[i]);
|
||||
DEBUG_LOG(m_logger) << "floorIdContamination=" << floorIdContamination;
|
||||
if (floorIdContamination == -1)
|
||||
{
|
||||
@@ -680,7 +681,7 @@ void BldInfoDialog::fillContaminationTable(const Buildings::BuildingState& bldSt
|
||||
void BldInfoDialog::fillOwnership(int buildingId)
|
||||
{
|
||||
CentralEffectSimulation::BuildingOwnership ownership = m_cesDtc->buildingOwnership(buildingId);
|
||||
if (ownership.buildingId() == buildingId)
|
||||
if (ownership.buildingId == buildingId)
|
||||
fillOwnership(ownership);
|
||||
}
|
||||
|
||||
@@ -704,41 +705,41 @@ void BldInfoDialog::fillOwnership(const CentralEffectSimulation::BuildingOwnersh
|
||||
m_ui->twOwnership->setUpdatesEnabled(false);
|
||||
|
||||
clearColumn(1);
|
||||
m_ui->twOwnership->setRowCount(ownership.ownerships().size());
|
||||
m_ui->twOwnership->setRowCount(ownership.ownerships.size());
|
||||
int row = m_ui->twOwnership->rowCount();
|
||||
|
||||
for (const auto& data : ownership.ownerships())
|
||||
for (const auto& data : ownership.ownerships)
|
||||
{
|
||||
--row;
|
||||
int column = 0;
|
||||
QTableWidgetItem* pItem = nullptr;
|
||||
|
||||
for (const InfrastructureManagement::StructureElement& elem : m_mse.elements())
|
||||
for (const InfrastructureManagement::StructureElement& elem : m_mse.elements)
|
||||
{
|
||||
if (elem.id() == data.floorId())
|
||||
if (elem.id == data.floorId)
|
||||
{
|
||||
QString name = QString::fromStdString(elem.displayName());
|
||||
QString name = QString::fromStdString(elem.displayName);
|
||||
if (name.isEmpty())
|
||||
name = QString::fromStdString(elem.name());
|
||||
name = QString::fromStdString(elem.name);
|
||||
pItem = new QTableWidgetItem(name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!pItem)
|
||||
pItem = new QTableWidgetItem(QString::number(data.floorId()));
|
||||
m_rowToFloorId.insert(row, data.floorId());
|
||||
m_floorIdToRow.insert(data.floorId(), row);
|
||||
pItem = new QTableWidgetItem(QString::number(data.floorId));
|
||||
m_rowToFloorId.insert(row, data.floorId);
|
||||
m_floorIdToRow.insert(data.floorId, row);
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_rowToFloorId.insert"
|
||||
<< " row=" << row << " column=" << column << " data.floorId()=" << data.floorId();
|
||||
<< " row=" << row << " column=" << column << " data.floorId()=" << data.floorId;
|
||||
m_ui->twOwnership->setItem(row, column++, pItem);
|
||||
|
||||
pItem = new QTableWidgetItem();
|
||||
if (m_ppmDtc && data.partyId() > 0)
|
||||
if (m_ppmDtc && data.partyId > 0)
|
||||
{
|
||||
const auto& party = m_ppmDtc->party(data.partyId());
|
||||
pItem->setData(Qt::BackgroundRole, QColor::fromRgb(QRgb(party.color())));
|
||||
pItem->setData(Qt::DisplayRole, ParticipantManagement::trPartyName(party.name()));
|
||||
const auto& party = m_ppmDtc->party(data.partyId);
|
||||
pItem->setData(Qt::BackgroundRole, QColor::fromRgb(QRgb(party.color)));
|
||||
pItem->setData(Qt::DisplayRole, ParticipantManagement::trPartyName(party.name));
|
||||
}
|
||||
m_ui->twOwnership->setItem(row, column++, pItem);
|
||||
}
|
||||
@@ -750,8 +751,8 @@ void BldInfoDialog::onBuildingStateChanged(const Buildings::BuildingState& data,
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.id();
|
||||
if (data.id() != m_mseId)
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.id;
|
||||
if (data.id != m_mseId)
|
||||
return;
|
||||
|
||||
showBuildingInfos(data);
|
||||
@@ -762,8 +763,8 @@ void BldInfoDialog::onBuildingOwnershipChanged(const CentralEffectSimulation::Bu
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.buildingId();
|
||||
if (data.buildingId() != m_mseId)
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.buildingId;
|
||||
if (data.buildingId != m_mseId)
|
||||
return;
|
||||
|
||||
fillOwnership(data);
|
||||
@@ -774,8 +775,8 @@ void BldInfoDialog::onMainStructureElementChanged(const InfrastructureManagement
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.id();
|
||||
if (data.id() != m_mseId)
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " id:" << data.id;
|
||||
if (data.id != m_mseId)
|
||||
return;
|
||||
|
||||
m_mse = data;
|
||||
@@ -787,23 +788,23 @@ void BldInfoDialog::onMountingPointAssetChanged(const InfrastructureManagement::
|
||||
const DataModification& modType)
|
||||
{
|
||||
InfrastructureManagement::StructureElement se;
|
||||
m_ismDtc->getStructureElementById(data.structureElementId(), se);
|
||||
if (se.mainStructureElementId() != m_mseId)
|
||||
m_ismDtc->getStructureElementById(data.structureElementId, se);
|
||||
if (se.mainStructureElementId != m_mseId)
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eAdded)
|
||||
{
|
||||
auto instrumentationAsset = m_ismDtc->instrumentationAsset(data.assetId());
|
||||
if (instrumentationAsset.mountingPointTypeId() !=
|
||||
auto instrumentationAsset = m_ismDtc->instrumentationAsset(data.assetId);
|
||||
if (instrumentationAsset.mountingPointTypeId !=
|
||||
InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
|
||||
return;
|
||||
QString name = QString::fromStdString(data.name());
|
||||
QString name = QString::fromStdString(data.name);
|
||||
if (name.isNull())
|
||||
name = QString::fromStdString(instrumentationAsset.hostname());
|
||||
name = QString::fromStdString(instrumentationAsset.hostname);
|
||||
|
||||
QVBoxLayout* l = qobject_cast<QVBoxLayout*>(m_ui->gbSegments->layout());
|
||||
QPushButton* w = new QPushButton(name, this);
|
||||
w->setProperty("assetId", data.assetId());
|
||||
w->setProperty("assetId", data.assetId);
|
||||
l->addWidget(w);
|
||||
connect(w, &QPushButton::clicked, this, &BldInfoDialog::onEgcuInfoDialogRequested);
|
||||
m_ui->gbSegments->setVisible(egcuVisibility());
|
||||
@@ -815,7 +816,7 @@ void BldInfoDialog::onMountingPointAssetChanged(const InfrastructureManagement::
|
||||
const QList<QPushButton*>& list = m_ui->gbSegments->findChildren<QPushButton*>();
|
||||
for (QPushButton* pb : std::as_const(list))
|
||||
{
|
||||
if (pb->property("assetId").toInt() == data.assetId())
|
||||
if (pb->property("assetId").toInt() == data.assetId)
|
||||
{
|
||||
|
||||
if (m_ui->gbSegments->layout()->count() == 1)
|
||||
@@ -833,9 +834,9 @@ void BldInfoDialog::onMountingPointAssetChanged(const InfrastructureManagement::
|
||||
const QList<QPushButton*>& list = m_ui->gbSegments->findChildren<QPushButton*>();
|
||||
for (QPushButton* pb : std::as_const(list))
|
||||
{
|
||||
if (pb->property("assetId").toInt() == data.assetId())
|
||||
pb->setText(data.name().empty() ? pb->property("assetName").toString()
|
||||
: QString::fromStdString(data.name()));
|
||||
if (pb->property("assetId").toInt() == data.assetId)
|
||||
pb->setText(data.name.empty() ? pb->property("assetName").toString()
|
||||
: QString::fromStdString(data.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -169,20 +169,20 @@ void InterfaceImpl::onBuildinSearchStringEntered(const QString &searchString)
|
||||
|
||||
const auto cb = [this, searchString, &bldIdCont, &bridgeIdCont](const InfrastructureManagement::MainStructureElement & data) -> void
|
||||
{
|
||||
if (data.isDeleted())
|
||||
if (data.isDeleted)
|
||||
return;
|
||||
|
||||
const std::vector<InfrastructureManagement::StructureElement>& elements = data.elements();
|
||||
const std::vector<InfrastructureManagement::StructureElement>& elements = data.elements;
|
||||
if (elements.empty())
|
||||
return;
|
||||
|
||||
const InfrastructureManagement::StructureElement &firstElement = elements.front();
|
||||
|
||||
const InfrastructureManagement::StructureElementType type = static_cast<InfrastructureManagement::StructureElementType>(firstElement.structureElementTypeId());
|
||||
const InfrastructureManagement::StructureElementType type = static_cast<InfrastructureManagement::StructureElementType>(firstElement.structureElementTypeId);
|
||||
|
||||
if (type == InfrastructureManagement::StructureElementType::Building)
|
||||
{
|
||||
if (!(m_ismDataIfc && m_ismDataIfc->isBuildingsInCurrentExercise(data.id())))
|
||||
if (!(m_ismDataIfc && m_ismDataIfc->isBuildingsInCurrentExercise(data.id)))
|
||||
return;
|
||||
} else if (type != InfrastructureManagement::StructureElementType::Bridge)
|
||||
return;
|
||||
@@ -195,10 +195,10 @@ void InterfaceImpl::onBuildinSearchStringEntered(const QString &searchString)
|
||||
|
||||
|
||||
|
||||
if (m_ismDtc->mainFootprint(data.id()).elements().size() < 3)
|
||||
if (m_ismDtc->mainFootprint(data.id).elements.size() < 3)
|
||||
return;
|
||||
|
||||
const QString &displayName = firstElement.displayName().empty() ? QString::fromStdString(firstElement.name()) : QString::fromStdString(firstElement.displayName());
|
||||
const QString &displayName = firstElement.displayName.empty() ? QString::fromStdString(firstElement.name) : QString::fromStdString(firstElement.displayName);
|
||||
|
||||
|
||||
|
||||
@@ -209,10 +209,10 @@ void InterfaceImpl::onBuildinSearchStringEntered(const QString &searchString)
|
||||
{
|
||||
switch (type) {
|
||||
case InfrastructureManagement::StructureElementType::Building:
|
||||
bldIdCont.append(data.id());
|
||||
bldIdCont.append(data.id);
|
||||
break;
|
||||
case InfrastructureManagement::StructureElementType::Bridge:
|
||||
bridgeIdCont.append(data.id());
|
||||
bridgeIdCont.append(data.id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -342,7 +342,7 @@ void InterfaceImpl::showEffectGenerationUnitWindow(int mountingPointId)
|
||||
return;
|
||||
|
||||
auto mpa = ismDtc->mountingPointAsset(mpaId);
|
||||
int assetId = mpa.assetId();
|
||||
int assetId = mpa.assetId;
|
||||
|
||||
EgcuInfoDialog *dialog = new EgcuInfoDialog(assetId, menuGroup());
|
||||
DEBUG_LOG(m_logger) << " new EgcuInfoDialog: ";
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "bridge_history_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ui_bridge_history_dialog.h"
|
||||
|
||||
#include "bridge_history_dialog_model.h"
|
||||
@@ -14,6 +15,7 @@ BridgeHistoryDialog::BridgeHistoryDialog(const QString &bldName, QWidget *parent
|
||||
, m_model(new BridgeHistoryDialogModel(this))
|
||||
, m_proxyModel(new BridgeHistoryDialogProxyModel(this))
|
||||
, m_ui(new Ui::BridgeHistoryDialog)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_proxyModel->setSourceModel(m_model);
|
||||
|
||||
+8
-6
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "bridge_history_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <Buildings/bld_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_to_string.h>
|
||||
@@ -28,6 +29,7 @@ BridgeHistoryDialogModel::BridgeHistoryDialogModel(QObject *parent)
|
||||
},
|
||||
parent)
|
||||
, m_ddsId(-1)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
bool BridgeHistoryDialogModel::initModel(int dds_id,
|
||||
@@ -56,17 +58,17 @@ QVariant BridgeHistoryDialogModel::data(const QModelIndex &index, int role) cons
|
||||
switch (index.column())
|
||||
{
|
||||
case Time:
|
||||
return QDateTime::fromMSecsSinceEpoch(data.sampleTime());
|
||||
return QDateTime::fromMSecsSinceEpoch(data.sampleTime);
|
||||
case State:
|
||||
if(data.status() == 0)
|
||||
if(data.status == 0)
|
||||
{
|
||||
return QString(toString(InfrastructureManagement::BridgeStatus::Intact));
|
||||
}
|
||||
else if (data.status() == 1)
|
||||
else if (data.status == 1)
|
||||
{
|
||||
return QString(toString(InfrastructureManagement::BridgeStatus::Broken));
|
||||
}
|
||||
return data.status();
|
||||
return data.status;
|
||||
}
|
||||
return QVariant();
|
||||
|
||||
@@ -93,7 +95,7 @@ void BridgeHistoryDialogModel::reinitModel(const QMap<int, Buildings::BridgeStat
|
||||
QVector<Buildings::BridgeStatus> relevantStates;
|
||||
for (auto& status : newData )
|
||||
{
|
||||
if(status.buildingId() != m_ddsId)
|
||||
if(status.buildingId != m_ddsId)
|
||||
continue;
|
||||
relevantStates.append(status);
|
||||
}
|
||||
@@ -132,7 +134,7 @@ bool BridgeHistoryDialogProxyModel::lessThan(const QModelIndex &source_left, con
|
||||
switch (source_left.column())
|
||||
{
|
||||
case BridgeHistoryDialogModel::Time:
|
||||
return dataLeft.sampleTime() < dataRight.sampleTime();
|
||||
return dataLeft.sampleTime < dataRight.sampleTime;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
+7
-7
@@ -86,7 +86,7 @@ BridgeInfoDialog::~BridgeInfoDialog()
|
||||
|
||||
void BridgeInfoDialog::retranslate()
|
||||
{
|
||||
if (m_mse.structureElementTypeId() == InfrastructureManagement::StructureElementType::Bridge)
|
||||
if (m_mse.structureElementTypeId == InfrastructureManagement::StructureElementType::Bridge)
|
||||
translate(m_ui, tr("Bridge: %1").arg( m_ismDtc->getBuildingDisplayName(m_mse)));
|
||||
else
|
||||
translate(m_ui, tr("Building: %1").arg( m_ismDtc->getBuildingDisplayName(m_mse)));
|
||||
@@ -151,7 +151,7 @@ void BridgeInfoDialog::showBridgeInfos()
|
||||
{
|
||||
m_ui->lblBuildingName->setText(buildingDisplayName());
|
||||
|
||||
if (m_mse.structureElementTypeId() == InfrastructureManagement::StructureElementType::Bridge)
|
||||
if (m_mse.structureElementTypeId == InfrastructureManagement::StructureElementType::Bridge)
|
||||
{
|
||||
m_ui->lbStatus->show();
|
||||
m_ui->cbStatus->show();
|
||||
@@ -209,14 +209,14 @@ void BridgeInfoDialog::bridgeStatusChanged()
|
||||
InfrastructureManagement::MainStructureElementModifyBridgeStatusRequest data;
|
||||
|
||||
|
||||
data.id(m_mse.id());
|
||||
data.id = m_mse.id;
|
||||
switch (m_ui->cbStatus->currentData().toInt())
|
||||
{
|
||||
case InfrastructureManagement::BridgeStatus::Intact:
|
||||
data.status(InfrastructureManagement::BridgeStatus::Intact);
|
||||
case static_cast<int>(InfrastructureManagement::BridgeStatus::Intact):
|
||||
data.status = InfrastructureManagement::BridgeStatus::Intact;
|
||||
break;
|
||||
case InfrastructureManagement::BridgeStatus::Broken:
|
||||
data.status(InfrastructureManagement::BridgeStatus::Broken);
|
||||
case static_cast<int>(InfrastructureManagement::BridgeStatus::Broken):
|
||||
data.status = InfrastructureManagement::BridgeStatus::Broken;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
+46
-46
@@ -134,7 +134,7 @@ QString EgcuInfoDialog::structureElementName(int seId)
|
||||
{
|
||||
InfrastructureManagement::StructureElement se;
|
||||
m_ismDtc->getStructureElementById(seId, se);
|
||||
return QString::fromStdString(se.displayName());
|
||||
return QString::fromStdString(se.displayName);
|
||||
}
|
||||
|
||||
void EgcuInfoDialog::showBuildingInfos()
|
||||
@@ -148,13 +148,13 @@ void EgcuInfoDialog::onInstrumentationAssetChanged(
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id:" << data.id();
|
||||
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id:" << data.id;
|
||||
|
||||
|
||||
|
||||
if (data.id() != m_instrumentationAsset.id())
|
||||
if (data.id != m_instrumentationAsset.id)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "Insert instrumentation asset id=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "Insert instrumentation asset id=" << data.id;
|
||||
m_instrumentationAsset = data;
|
||||
showEgcuInfos();
|
||||
}
|
||||
@@ -164,11 +164,11 @@ void EgcuInfoDialog::onMainStructureElementChanged(const InfrastructureManagemen
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
if (data.id() != m_structureElement.mainStructureElementId())
|
||||
if (data.id != m_structureElement.mainStructureElementId)
|
||||
return;
|
||||
for (const auto &se : data.elements())
|
||||
for (const auto &se : data.elements)
|
||||
{
|
||||
if (se.id() != m_structureElement.id())
|
||||
if (se.id != m_structureElement.id)
|
||||
continue;
|
||||
m_structureElement = se;
|
||||
showEgcuInfos(se);
|
||||
@@ -178,7 +178,7 @@ void EgcuInfoDialog::onMainStructureElementChanged(const InfrastructureManagemen
|
||||
void EgcuInfoDialog::onEffectOverrideChanged(int relayId, InfrastructureManagement::EffectOverride override)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onEffectOverrideChanged"
|
||||
<< " m_structureElement.id=" << m_structureElement.id()
|
||||
<< " m_structureElement.id=" << m_structureElement.id
|
||||
<< " relayId=" << relayId
|
||||
<< " override=" << override;
|
||||
|
||||
@@ -192,9 +192,9 @@ void EgcuInfoDialog::onEffectOverrideChanged(int relayId, InfrastructureManageme
|
||||
|
||||
|
||||
InfrastructureManagement::StructureElementUpdateEffectOverrideRequest request;
|
||||
request.structureElementId(m_structureElement.id());
|
||||
request.effectId(relayId);
|
||||
request.effectOverride(override);
|
||||
request.structureElementId = m_structureElement.id;
|
||||
request.effectId = relayId;
|
||||
request.effectOverride = override;
|
||||
m_requestHelper->startSingleRequest([request, this]()
|
||||
{
|
||||
return m_ftc->structureElementUpdateEffectOverrideRequest(request, this);
|
||||
@@ -203,35 +203,35 @@ void EgcuInfoDialog::onEffectOverrideChanged(int relayId, InfrastructureManageme
|
||||
|
||||
void EgcuInfoDialog::onRelayInfoChanged(const AssetManagement::RelayInfo &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onRelayInfosChanged id:" << data.id();
|
||||
DEBUG_LOG(m_logger) << "onRelayInfosChanged id:" << data.id;
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
if (m_relayInfoWidgets.contains(data.id()))
|
||||
if (m_relayInfoWidgets.contains(data.id))
|
||||
{
|
||||
m_relayInfoWidgets[data.id()]->deleteLater();
|
||||
m_relayInfoWidgets.remove(data.id());
|
||||
m_relayInfoWidgets[data.id]->deleteLater();
|
||||
m_relayInfoWidgets.remove(data.id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (m_relayInfoWidgets.contains(data.id()))
|
||||
if (m_relayInfoWidgets.contains(data.id))
|
||||
{
|
||||
m_relayInfoWidgets[data.id()]->setName(QString::fromStdString(data.name()));
|
||||
DEBUG_LOG(m_logger) << "contains Name=" << QString::fromStdString(data.name());
|
||||
m_relayInfoWidgets[data.id]->setName(QString::fromStdString(data.name));
|
||||
DEBUG_LOG(m_logger) << "contains Name=" << QString::fromStdString(data.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
RelayInfoWidget *w = new RelayInfoWidget(data.id(), this);
|
||||
m_relayInfoWidgets.insert(data.id(), w);
|
||||
w->setName(QString::fromStdString(data.name()));
|
||||
DEBUG_LOG(m_logger) << "Name=" << QString::fromStdString(data.name());
|
||||
RelayInfoWidget *w = new RelayInfoWidget(data.id, this);
|
||||
m_relayInfoWidgets.insert(data.id, w);
|
||||
w->setName(QString::fromStdString(data.name));
|
||||
DEBUG_LOG(m_logger) << "Name=" << QString::fromStdString(data.name);
|
||||
connect(w, &RelayInfoWidget::effectOverrideChanged, this, &EgcuInfoDialog::onEffectOverrideChanged);
|
||||
w->setEffectOverrideEnabled(InfrastructureManagement::EffectOverride::PermanentOn, readAllowance(InfrastructureManagement::EffectOverride::PermanentOn, data.property()));
|
||||
w->setEffectOverrideEnabled(InfrastructureManagement::EffectOverride::PermanentOff, readAllowance(InfrastructureManagement::EffectOverride::PermanentOff, data.property()));
|
||||
w->setLedVisible(readShowStatus(data.property()));
|
||||
w->setEffectOverrideEnabled(InfrastructureManagement::EffectOverride::PermanentOn, readAllowance(InfrastructureManagement::EffectOverride::PermanentOn, data.property));
|
||||
w->setEffectOverrideEnabled(InfrastructureManagement::EffectOverride::PermanentOff, readAllowance(InfrastructureManagement::EffectOverride::PermanentOff, data.property));
|
||||
w->setLedVisible(readShowStatus(data.property));
|
||||
m_relayLayout->addWidget(w);
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "data.name=" << data.name();
|
||||
DEBUG_LOG(m_logger) << "data.name=" << data.name;
|
||||
}
|
||||
|
||||
bool EgcuInfoDialog::readAllowance(InfrastructureManagement::EffectOverride eo, const std::string &properties)
|
||||
@@ -267,27 +267,27 @@ bool EgcuInfoDialog::readShowStatus(const std::string &properties)
|
||||
|
||||
void EgcuInfoDialog::onRelayStateChanged(const Buildings::RelayState &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onRelayStateChanged id:" << data.id();
|
||||
DEBUG_LOG(m_logger) << "onRelayStateChanged id:" << data.id;
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
if (data.id() != m_instrumentationAsset.id())
|
||||
if (data.id != m_instrumentationAsset.id)
|
||||
return;
|
||||
|
||||
for (const Buildings::RelayStateItem &relayState : data.relayStates())
|
||||
for (const Buildings::RelayStateItem &relayState : data.relayStates)
|
||||
{
|
||||
if (!m_relayInfoWidgets.contains(relayState.id()))
|
||||
if (!m_relayInfoWidgets.contains(relayState.id))
|
||||
continue;
|
||||
m_relayInfoWidgets[relayState.id()]->setState(relayState.state(),
|
||||
data.stateTime(),
|
||||
data.offlineTime());
|
||||
m_relayInfoWidgets[relayState.id]->setState(relayState.state,
|
||||
data.stateTime,
|
||||
data.offlineTime);
|
||||
}
|
||||
}
|
||||
|
||||
void EgcuInfoDialog::onMountPointAssetChanged(const InfrastructureManagement::MountingPointAsset &data, DataModification modType)
|
||||
{
|
||||
if (m_assetId != data.assetId())
|
||||
if (m_assetId != data.assetId)
|
||||
return;
|
||||
|
||||
if (modType != DataModification::eAdded &&
|
||||
@@ -297,9 +297,9 @@ void EgcuInfoDialog::onMountPointAssetChanged(const InfrastructureManagement::Mo
|
||||
return;
|
||||
}
|
||||
|
||||
m_instrumentationAsset = m_ismDtc->instrumentationAsset(data.assetId());
|
||||
m_ismDtc->getStructureElementById(data.structureElementId(), m_structureElement);
|
||||
m_ui->lblSegment->setText(QString::fromStdString(data.name()));
|
||||
m_instrumentationAsset = m_ismDtc->instrumentationAsset(data.assetId);
|
||||
m_ismDtc->getStructureElementById(data.structureElementId, m_structureElement);
|
||||
m_ui->lblSegment->setText(QString::fromStdString(data.name));
|
||||
showEgcuInfos(m_structureElement);
|
||||
|
||||
retranslate();
|
||||
@@ -310,12 +310,12 @@ void EgcuInfoDialog::onMountPointAssetChanged(const InfrastructureManagement::Mo
|
||||
void EgcuInfoDialog::showEgcuInfos(const InfrastructureManagement::StructureElement &se)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "EgcuInfoDialog::showEgcuInfos";
|
||||
m_ui->lblAssetName->setText(QString::fromStdString(m_instrumentationAsset.name()));
|
||||
m_ui->lblAssetId->setText(QString::number(m_instrumentationAsset.id()));
|
||||
m_ui->lblHostName->setText(QString::fromStdString(m_instrumentationAsset.hostname()));
|
||||
m_ui->lblAssetName->setText(QString::fromStdString(m_instrumentationAsset.name));
|
||||
m_ui->lblAssetId->setText(QString::number(m_instrumentationAsset.id));
|
||||
m_ui->lblHostName->setText(QString::fromStdString(m_instrumentationAsset.hostname));
|
||||
|
||||
|
||||
if (se.id() == 0)
|
||||
if (se.id == 0)
|
||||
return;
|
||||
|
||||
m_ui->lblRoom->hide();
|
||||
@@ -323,20 +323,20 @@ void EgcuInfoDialog::showEgcuInfos(const InfrastructureManagement::StructureElem
|
||||
m_ui->lblFloor->hide();
|
||||
m_ui->lbxFloor->hide();
|
||||
|
||||
switch (se.path().size()) {
|
||||
switch (se.path.size()) {
|
||||
case 4:
|
||||
m_ui->lblRoom->setText(structureElementName(se.path()[2]));
|
||||
m_ui->lblRoom->setText(structureElementName(se.path[2]));
|
||||
m_ui->lblRoom->show();
|
||||
m_ui->lbxRoom->show();
|
||||
Q_FALLTHROUGH();
|
||||
case 3:
|
||||
m_ui->lblFloor->setText(structureElementName(se.path()[1]));
|
||||
m_ui->lblFloor->setText(structureElementName(se.path[1]));
|
||||
m_ui->lblFloor->show();
|
||||
m_ui->lbxFloor->show();
|
||||
Q_FALLTHROUGH();
|
||||
case 2:
|
||||
{
|
||||
m_ui->lblBuildingName->setText(structureElementName(se.path()[0]));
|
||||
m_ui->lblBuildingName->setText(structureElementName(se.path[0]));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -346,7 +346,7 @@ void EgcuInfoDialog::showEgcuInfos(const InfrastructureManagement::StructureElem
|
||||
|
||||
|
||||
QJsonParseError parserError;
|
||||
QByteArray content = QByteArray::fromStdString(se.properties());
|
||||
QByteArray content = QByteArray::fromStdString(se.properties);
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError));
|
||||
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public:
|
||||
void onStructureElementUpdateEffectOverrideReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
||||
|
||||
QString buildingDisplayName() const override;
|
||||
QString egcuName() const { return QString::fromStdString(m_instrumentationAsset.name()); }
|
||||
QString egcuName() const { return QString::fromStdString(m_instrumentationAsset.name); }
|
||||
|
||||
private:
|
||||
void retranslate() override;
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ bool InfoDialogBase::init(LtsSession::LtsSession* session)
|
||||
[this](const InfrastructureManagement::MainStructureElement& mse, DataModification mod) {
|
||||
if (mod != DataModification::eModified)
|
||||
return;
|
||||
QJsonObject obj = QJsonDocument::fromJson(QByteArray::fromStdString(mse.properties())).object();
|
||||
QJsonObject obj = QJsonDocument::fromJson(QByteArray::fromStdString(mse.properties)).object();
|
||||
if (!obj.contains(QStringLiteral("available_in_exercise")))
|
||||
{
|
||||
deleteLater();
|
||||
@@ -93,7 +93,7 @@ void InfoDialogBase::onShowEgcuMonitor()
|
||||
{
|
||||
if (!m_smoGuiIfc)
|
||||
return;
|
||||
int seId = m_ismDtc->mainStructureElement(m_mseId).structureElementId();
|
||||
int seId = m_ismDtc->mainStructureElement(m_mseId).structureElementId;
|
||||
m_smoGuiIfc->showEgcuMonitor({seId}, true);
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "relay_info.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "ui_relay_info.h"
|
||||
|
||||
@@ -72,7 +73,7 @@ void RelayInfoWidget::setState(bool state, qint64 stateTime, qint64 offlineTime)
|
||||
|
||||
void RelayInfoWidget::setEffectOverride(InfrastructureManagement::EffectOverride override)
|
||||
{
|
||||
switch (override.underlying())
|
||||
switch (override)
|
||||
{
|
||||
case InfrastructureManagement::EffectOverride::Automatic:
|
||||
m_ui->tbAuto->setChecked(true);
|
||||
@@ -88,7 +89,7 @@ void RelayInfoWidget::setEffectOverride(InfrastructureManagement::EffectOverride
|
||||
|
||||
void RelayInfoWidget::setEffectOverrideEnabled(InfrastructureManagement::EffectOverride override, bool enable)
|
||||
{
|
||||
switch (override.underlying())
|
||||
switch (override)
|
||||
{
|
||||
case InfrastructureManagement::EffectOverride::Automatic:
|
||||
m_ui->tbAuto->setEnabled(enable);
|
||||
|
||||
Reference in new issue
Block a user