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:
1718 files changed
+126739
-18495
No files matched your search
+15
-13
@@ -6,6 +6,7 @@
|
||||
#include "ism_overview_conflicts_model.h"
|
||||
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <LtsPrinting/printing.h>
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtGui/QAction>
|
||||
@@ -19,6 +20,7 @@ ConflictsDialog::ConflictsDialog(const QString &menuGroup, QWidget *parent)
|
||||
, m_ui(new Ui::ConflictsDialog)
|
||||
, m_sourceModel(nullptr)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setOnlineHelpFilename(QStringLiteral("Ressourcen-Conflicts"));
|
||||
@@ -37,8 +39,8 @@ ConflictsDialog::~ConflictsDialog()
|
||||
|
||||
void ConflictsDialog::retranslate()
|
||||
{
|
||||
QString plan1 = QString::fromStdString(m_dtc->mainSchedule(m_scheduleId).name());
|
||||
QString plan2 = QString::fromStdString(m_dtc->mainSchedule(m_anotherScheduleId).name());
|
||||
QString plan1 = QString::fromStdString(m_dtc->mainSchedule(m_scheduleId).name);
|
||||
QString plan2 = QString::fromStdString(m_dtc->mainSchedule(m_anotherScheduleId).name);
|
||||
translate(m_ui, tr("Conflicts: %1 - %2").arg(plan1, plan2));
|
||||
}
|
||||
|
||||
@@ -116,7 +118,7 @@ void ConflictsDialog::updateModel()
|
||||
void ConflictsDialog::dataChanged(const InfrastructureManagement::MainSchedule &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType);
|
||||
if (data.id() == m_scheduleId)
|
||||
if (data.id == m_scheduleId)
|
||||
m_sourceModel->initModel(m_scheduleId, m_anotherScheduleId, m_dtc);
|
||||
}
|
||||
|
||||
@@ -137,31 +139,31 @@ void ConflictsDialog::onPrint()
|
||||
header += QStringLiteral("<p>");
|
||||
header += QStringLiteral("<b>") + tr("Overview Conflicts") + QStringLiteral("</b>");
|
||||
header += QStringLiteral("<hr/>");
|
||||
header += tr("Current Instrumentation Plan: %1").arg(QString::fromStdString(plan1.name()));
|
||||
header += tr("Current Instrumentation Plan: %1").arg(QString::fromStdString(plan1.name));
|
||||
|
||||
header += QStringLiteral(" - ");
|
||||
if (plan1.timeStart().is_set())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(plan1.timeStart().get()));
|
||||
if (plan1.timeStart.has_value())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(plan1.timeStart.get()));
|
||||
else
|
||||
header += tr("START: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral(" - ");
|
||||
if (plan1.timeEnd().is_set())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(plan1.timeEnd().get()));
|
||||
if (plan1.timeEnd.has_value())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(plan1.timeEnd.get()));
|
||||
else
|
||||
header += tr("END: %1").arg(tr("[N/A]"));
|
||||
|
||||
header += QStringLiteral("<br/>");
|
||||
|
||||
header += tr("Compared Instrumentation Plan: %1").arg(QString::fromStdString(plan2.name()));
|
||||
header += tr("Compared Instrumentation Plan: %1").arg(QString::fromStdString(plan2.name));
|
||||
|
||||
header += QStringLiteral(" - ");
|
||||
if (plan2.timeStart().is_set())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(plan2.timeStart().get()));
|
||||
if (plan2.timeStart.has_value())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(plan2.timeStart.get()));
|
||||
else
|
||||
header += tr("START: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral(" - ");
|
||||
if (plan2.timeEnd().is_set())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(plan2.timeEnd().get()));
|
||||
if (plan2.timeEnd.has_value())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(plan2.timeEnd.get()));
|
||||
else
|
||||
header += tr("END: %1").arg(tr("[N/A]"));
|
||||
|
||||
|
||||
+53
-51
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "ism_overview_conflicts_model.h"
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QElapsedTimer>
|
||||
@@ -21,6 +22,7 @@ namespace InfrastructureManagement
|
||||
|
||||
ConflictsDialogModel::ConflictsDialogModel(QObject *parent)
|
||||
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), { tr("Name"), tr("Type"), tr("Aim State"), tr("Conflict State") })
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_dtc(nullptr)
|
||||
, m_scheduleId(-1)
|
||||
, m_anotherScheduleId(-1)
|
||||
@@ -99,8 +101,8 @@ QVariant ConflictsDialogModel::headerData(int section, Qt::Orientation orientati
|
||||
{
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
|
||||
{
|
||||
QString plan1 = QString::fromStdString(m_dtc->mainSchedule(m_scheduleId).name());
|
||||
QString plan2 = QString::fromStdString(m_dtc->mainSchedule(m_anotherScheduleId).name());
|
||||
QString plan1 = QString::fromStdString(m_dtc->mainSchedule(m_scheduleId).name);
|
||||
QString plan2 = QString::fromStdString(m_dtc->mainSchedule(m_anotherScheduleId).name);
|
||||
|
||||
Columns col = static_cast<Columns>(section);
|
||||
switch (col)
|
||||
@@ -160,10 +162,10 @@ StructureElement ConflictsDialogModel::setBuildingGroup(int groupId)
|
||||
StructureElement se;
|
||||
BuildingGroup buildingGroup = static_cast<BuildingGroup>(groupId);
|
||||
|
||||
se.id() = maxIntValue - static_cast<int>(buildingGroup);
|
||||
se.name() = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.displayName() = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.structureElementTypeId() = StructureElementType::Section;
|
||||
se.id = maxIntValue - static_cast<int>(buildingGroup);
|
||||
se.name = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.displayName = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.structureElementTypeId = StructureElementType::Section;
|
||||
return se;
|
||||
}
|
||||
|
||||
@@ -193,27 +195,27 @@ void ConflictsDialogModel::initData()
|
||||
#endif
|
||||
|
||||
InfrastructureManagement::MainSchedule currentSchedule = m_dtc->mainSchedule(m_scheduleId);
|
||||
for (const InfrastructureManagement::MountingPointPlan ¤tPlan : currentSchedule.elements())
|
||||
for (const InfrastructureManagement::MountingPointPlan ¤tPlan : currentSchedule.elements)
|
||||
{
|
||||
StructureElement se;
|
||||
if (!m_dtc->getStructureElementById(currentPlan.structureElementId(), se))
|
||||
if (!m_dtc->getStructureElementById(currentPlan.structureElementId, se))
|
||||
continue;
|
||||
|
||||
if (m_visibleTypes.contains(se.mountingPointTypeId()))
|
||||
currentMountingPoints.insert(currentPlan.structureElementId(), currentPlan);
|
||||
if (m_visibleTypes.contains(se.mountingPointTypeId))
|
||||
currentMountingPoints.insert(currentPlan.structureElementId, currentPlan);
|
||||
}
|
||||
|
||||
|
||||
InfrastructureManagement::MainSchedule compareSchedule = m_dtc->mainSchedule(m_anotherScheduleId);
|
||||
for (const InfrastructureManagement::MountingPointPlan &comparePlan : compareSchedule.elements())
|
||||
for (const InfrastructureManagement::MountingPointPlan &comparePlan : compareSchedule.elements)
|
||||
{
|
||||
if (!currentMountingPoints.contains(comparePlan.structureElementId()))
|
||||
if (!currentMountingPoints.contains(comparePlan.structureElementId))
|
||||
continue;
|
||||
|
||||
StructureElement structEl;
|
||||
if (!m_dtc->getStructureElementById(comparePlan.structureElementId(), structEl))
|
||||
if (!m_dtc->getStructureElementById(comparePlan.structureElementId, structEl))
|
||||
continue;
|
||||
if (!m_visibleTypes.contains(structEl.mountingPointTypeId()))
|
||||
if (!m_visibleTypes.contains(structEl.mountingPointTypeId))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -227,25 +229,25 @@ void ConflictsDialogModel::initData()
|
||||
|
||||
|
||||
|
||||
const MountingPointPlan &mp1 = currentMountingPoints[comparePlan.structureElementId()];
|
||||
if ((mp1.mountingPointState() == MountingPointState::Equipped && comparePlan.mountingPointState() == MountingPointState::Empty) ||
|
||||
(mp1.mountingPointState() == MountingPointState::Empty && comparePlan.mountingPointState() == MountingPointState::Equipped))
|
||||
const MountingPointPlan &mp1 = currentMountingPoints[comparePlan.structureElementId];
|
||||
if ((mp1.mountingPointState == MountingPointState::Equipped && comparePlan.mountingPointState == MountingPointState::Empty) ||
|
||||
(mp1.mountingPointState == MountingPointState::Empty && comparePlan.mountingPointState == MountingPointState::Equipped))
|
||||
{
|
||||
compareMountingPoints.insert(comparePlan.structureElementId(), comparePlan);
|
||||
compareMountingPoints.insert(comparePlan.structureElementId, comparePlan);
|
||||
StructureElement se;
|
||||
|
||||
if (!m_dtc->getStructureElementById(comparePlan.structureElementId(), se))
|
||||
if (!m_dtc->getStructureElementById(comparePlan.structureElementId, se))
|
||||
continue;
|
||||
|
||||
const std::vector<int> &path = se.path();
|
||||
const std::vector<int> &path = se.path;
|
||||
for(const auto &seId : path)
|
||||
conflictedStructElIds.insert(seId);
|
||||
|
||||
if(conflictedMainStructElements.contains(se.mainStructureElementId()))
|
||||
if(conflictedMainStructElements.contains(se.mainStructureElementId))
|
||||
continue;
|
||||
|
||||
const MainStructureElement &mse = m_dtc->mainStructureElement(se.mainStructureElementId());
|
||||
conflictedMainStructElements.insert(mse.id(), mse);
|
||||
const MainStructureElement &mse = m_dtc->mainStructureElement(se.mainStructureElementId);
|
||||
conflictedMainStructElements.insert(mse.id, mse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,64 +257,64 @@ void ConflictsDialogModel::initData()
|
||||
for (const MainStructureElement &mse : conflictedMainStructElements)
|
||||
{
|
||||
|
||||
if (mse.structureElementTypeId() != StructureElementType::Building)
|
||||
if (mse.structureElementTypeId != StructureElementType::Building)
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
QModelIndex groupIndex;
|
||||
const StructureElement bse = setBuildingGroup(mse.groupId());
|
||||
if(!m_availableBuildingGroups.contains(bse.id()))
|
||||
const StructureElement bse = setBuildingGroup(mse.groupId);
|
||||
if(!m_availableBuildingGroups.contains(bse.id))
|
||||
{
|
||||
ConflictStructureElementData buildingGroup;
|
||||
buildingGroup.name = QString::fromStdString(bse.displayName());
|
||||
buildingGroup.name = QString::fromStdString(bse.displayName);
|
||||
NGLTreeItem *groupItem = new NGLTreeItem(QVariant::fromValue(buildingGroup));
|
||||
QModelIndex groupParentIndex;
|
||||
groupParentIndex = indexFromItem(m_rootItem);
|
||||
|
||||
insertRow(rowCount(groupParentIndex), groupParentIndex, groupItem);
|
||||
groupIndex = index(groupItem->row(), 0, groupParentIndex);
|
||||
m_mountingPointIndexes.insert(bse.id(), groupIndex);
|
||||
m_mountingPointIndexes.insert(bse.id, groupIndex);
|
||||
|
||||
m_availableBuildingGroups.insert(bse.id());
|
||||
m_availableBuildingGroups.insert(bse.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
groupIndex = m_mountingPointIndexes.value(bse.id(), indexFromItem(m_rootItem));
|
||||
groupIndex = m_mountingPointIndexes.value(bse.id, indexFromItem(m_rootItem));
|
||||
}
|
||||
|
||||
for (const StructureElement ¤tElement : mse.elements())
|
||||
for (const StructureElement ¤tElement : mse.elements)
|
||||
{
|
||||
NGLTreeItem *item = nullptr;
|
||||
if (!conflictedStructElIds.contains(currentElement.id()))
|
||||
if (!conflictedStructElIds.contains(currentElement.id))
|
||||
continue;
|
||||
|
||||
if (currentElement.structureElementTypeId() == StructureElementType::MountingPoint)
|
||||
if (currentElement.structureElementTypeId == StructureElementType::MountingPoint)
|
||||
{
|
||||
if (!currentMountingPoints.contains(currentElement.id()))
|
||||
if (!currentMountingPoints.contains(currentElement.id))
|
||||
continue;
|
||||
|
||||
const MountingPointPlan &mountingPoint = currentMountingPoints[currentElement.id()];
|
||||
const MountingPointPlan &mountingPoint = currentMountingPoints[currentElement.id];
|
||||
|
||||
|
||||
if (mountingPoint.mountingPointState() == MountingPointState::Idle)
|
||||
if (mountingPoint.mountingPointState == MountingPointState::Idle)
|
||||
continue;
|
||||
|
||||
auto compareMountingPointState = compareMountingPoints.value(currentElement.id()).mountingPointState();
|
||||
auto compareMountingPointState = compareMountingPoints.value(currentElement.id).mountingPointState;
|
||||
|
||||
if (mountingPoint.mountingPointState() == compareMountingPointState)
|
||||
if (mountingPoint.mountingPointState == compareMountingPointState)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "No conflict for mounting point id = " << currentElement.id() << " - " << currentElement.name();
|
||||
DEBUG_LOG(m_logger) << "No conflict for mounting point id = " << currentElement.id << " - " << currentElement.name;
|
||||
continue;
|
||||
}
|
||||
|
||||
ConflictMountingPointData mpData;
|
||||
mpData.seType = currentElement.structureElementTypeId();
|
||||
mpData.id = currentElement.id();
|
||||
mpData.name = currentElement.displayName().empty() ? QString::fromStdString(currentElement.name()) : QString::fromStdString(currentElement.displayName());
|
||||
mpData.aimState = mountingPoint.mountingPointState();
|
||||
mpData.seType = currentElement.structureElementTypeId;
|
||||
mpData.id = currentElement.id;
|
||||
mpData.name = currentElement.displayName.empty() ? QString::fromStdString(currentElement.name) : QString::fromStdString(currentElement.displayName);
|
||||
mpData.aimState = mountingPoint.mountingPointState;
|
||||
mpData.conflictState = compareMountingPointState;
|
||||
mpData.mpType = currentElement.mountingPointTypeId();
|
||||
mpData.mpType = currentElement.mountingPointTypeId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "## MP Id = " << mpData.id;
|
||||
DEBUG_LOG(m_logger) << "## MP Name = " << mpData.name;
|
||||
@@ -325,12 +327,12 @@ void ConflictsDialogModel::initData()
|
||||
else
|
||||
{
|
||||
ConflictStructureElementData ssed;
|
||||
ssed.name = currentElement.displayName().empty() ? QString::fromStdString(currentElement.name()) : QString::fromStdString(currentElement.displayName());
|
||||
ssed.name = currentElement.displayName.empty() ? QString::fromStdString(currentElement.name) : QString::fromStdString(currentElement.displayName);
|
||||
|
||||
item = new NGLTreeItem(QVariant::fromValue(ssed));
|
||||
}
|
||||
|
||||
const auto &path = currentElement.path();
|
||||
const auto &path = currentElement.path;
|
||||
|
||||
QModelIndex parentIndex;
|
||||
if (path.size() > 1)
|
||||
@@ -338,21 +340,21 @@ void ConflictsDialogModel::initData()
|
||||
parentIndex = m_mountingPointIndexes.value(path.at(path.size() - 2), indexFromItem(m_rootItem));
|
||||
if (!parentIndex.isValid())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id();
|
||||
for (const StructureElement &se : mse.elements())
|
||||
DEBUG_LOG(m_logger) << " se: " << se.id() << ", " << se.displayName() << ", " << se.name();
|
||||
DEBUG_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id << " mseid: " << mse.id;
|
||||
for (const StructureElement &se : mse.elements)
|
||||
DEBUG_LOG(m_logger) << " se: " << se.id << ", " << se.displayName << ", " << se.name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
parentIndex = groupIndex.isValid() ? groupIndex : indexFromItem(m_rootItem);
|
||||
DEBUG_LOG(m_logger) << "Insert row under root: " << currentElement.displayName();
|
||||
DEBUG_LOG(m_logger) << "Insert row under root: " << currentElement.displayName;
|
||||
}
|
||||
|
||||
insertRow(rowCount(parentIndex), parentIndex, item);
|
||||
|
||||
m_mountingPointIndexes.insert(currentElement.id(), index(item->row(), 0, parentIndex));
|
||||
m_mountingPointIndexes.insert(currentElement.id, index(item->row(), 0, parentIndex));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+12
-10
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "ism_overview_dialog.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "ism_overview_conflicts_dialog.h"
|
||||
#include "ui_ism_overview_dialog.h"
|
||||
#include "ism_overview_dialog_model.h"
|
||||
@@ -25,6 +26,7 @@ OverviewDialog::OverviewDialog(const QString &menuGroup, LtsSession::LtsSession
|
||||
, m_session(session)
|
||||
, m_ui(new Ui::OverviewDialog)
|
||||
, m_menuGroup(menuGroup)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_ui->setupUi(this);
|
||||
@@ -104,7 +106,7 @@ void OverviewDialog::setCbBasePlan()
|
||||
m_ui->cbBasePlan->addItem(tr("Actual Mountings"), 0);
|
||||
m_ui->cbBasePlan->insertSeparator(1);
|
||||
for (auto ms : m_dtc->mainSchedules())
|
||||
m_ui->cbBasePlan->addItem(QString::fromStdString(ms.name()), ms.id());
|
||||
m_ui->cbBasePlan->addItem(QString::fromStdString(ms.name), ms.id);
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
@@ -116,8 +118,8 @@ void OverviewDialog::setCbComparePlan()
|
||||
m_ui->cbComparePlan->addItem(tr("All active(*) plans"),0);
|
||||
m_ui->cbComparePlan->insertSeparator(1);
|
||||
for (auto ms : m_dtc->mainSchedules())
|
||||
m_ui->cbComparePlan->addItem((ms.statusId() == ScheduleStatus::Active ? QLatin1Literal("* ") : QLatin1Literal(" ")) +
|
||||
QString::fromStdString(ms.name()), ms.id());
|
||||
m_ui->cbComparePlan->addItem((ms.statusId == ScheduleStatus::Active ? QStringLiteral("* ") : QStringLiteral(" ")) +
|
||||
QString::fromStdString(ms.name), ms.id);
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
@@ -127,19 +129,19 @@ void OverviewDialog::onPrint()
|
||||
|
||||
QString header;
|
||||
header += QStringLiteral("<p>");
|
||||
header += tr("Instrumentation Plan: %1").arg(QString::fromStdString(ms.name()));
|
||||
header += tr("Instrumentation Plan: %1").arg(QString::fromStdString(ms.name));
|
||||
header += QStringLiteral("<br/>");
|
||||
header += tr("Status: %1").arg(toString(ms.statusId()));
|
||||
header += tr("Status: %1").arg(toString(ms.statusId));
|
||||
header += QStringLiteral("<br/>");
|
||||
header += tr("Created: %1").arg(DTG::toStringMSec(ms.timeCreated()));
|
||||
header += tr("Created: %1").arg(DTG::toStringMSec(ms.timeCreated));
|
||||
header += QStringLiteral("<br/>");
|
||||
if (ms.timeStart().is_set())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(ms.timeStart().get()));
|
||||
if (ms.timeStart.has_value())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(ms.timeStart.get()));
|
||||
else
|
||||
header += tr("START: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral(" - ");
|
||||
if (ms.timeEnd().is_set())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(ms.timeEnd().get()));
|
||||
if (ms.timeEnd.has_value())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(ms.timeEnd.get()));
|
||||
else
|
||||
header += tr("END: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral("<br/>");
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
#include <InfrastructureManagement/ism_data_plugin.h>
|
||||
#include <Plugins/InfrastructureManagement/Data/ism_data_plugin.h>
|
||||
#include <InfrastructureManagement/logger.h>
|
||||
#include <InfrastructureManagement/ism_resource_management_gui_plugin_interface.h>
|
||||
|
||||
|
||||
+41
-39
@@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
#include "ism_overview_dialog_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <utility>
|
||||
#include <InfrastructureManagement/Shared/ism_mounting_point.h>
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
@@ -30,6 +31,7 @@ OverviewDialogModel::OverviewDialogModel(QObject *parent)
|
||||
, m_loadedScheduleId(-1)
|
||||
, m_comparedScheduleId(0)
|
||||
, m_dtc(nullptr)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
@@ -186,10 +188,10 @@ MountingPointType OverviewDialogModel::getMountingPointTypeId(int structureEleme
|
||||
|
||||
StructureElement se;
|
||||
if (!m_dtc->getStructureElementById(structureElementId, se))
|
||||
return MountingPointType::get_default();
|
||||
return MountingPointType::Unknown;
|
||||
|
||||
|
||||
const MountingPointType mpType = (se.mountingPointTypeId() == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : se.mountingPointTypeId();
|
||||
const MountingPointType mpType = (se.mountingPointTypeId == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : se.mountingPointTypeId;
|
||||
m_availableMountingPointTypes.insert(structureElementId, mpType);
|
||||
return mpType;
|
||||
}
|
||||
@@ -198,7 +200,7 @@ bool OverviewDialogModel::hasMountedAsset(int seId)
|
||||
{
|
||||
for (const InfrastructureManagement::MountingPointAsset &asset : std::as_const(m_mountingPointAssets))
|
||||
{
|
||||
if (asset.structureElementId() == seId)
|
||||
if (asset.structureElementId == seId)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -219,46 +221,46 @@ QHash<int, MountingPointPlan> OverviewDialogModel::mergePlans(const QHash<int, M
|
||||
const auto msConst = m_dtc->mainSchedules();
|
||||
for (const auto &schedule : msConst)
|
||||
{
|
||||
if (cmpPlanId == 0 && schedule.statusId() != ScheduleStatus::Active)
|
||||
if (cmpPlanId == 0 && schedule.statusId != ScheduleStatus::Active)
|
||||
continue;
|
||||
if (cmpPlanId != 0 && cmpPlanId != schedule.id())
|
||||
if (cmpPlanId != 0 && cmpPlanId != schedule.id)
|
||||
continue;
|
||||
|
||||
for (const MountingPointPlan ¤tMpp : schedule.elements())
|
||||
for (const MountingPointPlan ¤tMpp : schedule.elements)
|
||||
{
|
||||
if (m_conflictedStructureElementIds.contains(currentMpp.structureElementId()))
|
||||
if (m_conflictedStructureElementIds.contains(currentMpp.structureElementId))
|
||||
continue;
|
||||
|
||||
const MountingPointType mpType = getMountingPointTypeId(currentMpp.structureElementId());
|
||||
const MountingPointType mpType = getMountingPointTypeId(currentMpp.structureElementId);
|
||||
|
||||
if (!m_refMap.contains(mpType))
|
||||
continue;
|
||||
|
||||
if (currPlan.contains(currentMpp.structureElementId()))
|
||||
if (currPlan.contains(currentMpp.structureElementId))
|
||||
{
|
||||
const MountingPointPlan &basePlanMpp = currPlan[currentMpp.structureElementId()];
|
||||
const MountingPointPlan &basePlanMpp = currPlan[currentMpp.structureElementId];
|
||||
|
||||
|
||||
|
||||
if ((basePlanMpp.mountingPointState() == MountingPointState::Equipped && currentMpp.mountingPointState() == MountingPointState::Empty) ||
|
||||
(basePlanMpp.mountingPointState() == MountingPointState::Empty && currentMpp.mountingPointState() == MountingPointState::Equipped))
|
||||
if ((basePlanMpp.mountingPointState == MountingPointState::Equipped && currentMpp.mountingPointState == MountingPointState::Empty) ||
|
||||
(basePlanMpp.mountingPointState == MountingPointState::Empty && currentMpp.mountingPointState == MountingPointState::Equipped))
|
||||
{
|
||||
DEBUG_LOG(m_logger)<<" conflicted name: "<<currentMpp.structureElementId();
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(MountingPointState::Idle);
|
||||
m_conflictedStructureElementIds.insert(basePlanMpp.structureElementId());
|
||||
DEBUG_LOG(m_logger)<<" conflicted name: "<<currentMpp.structureElementId;
|
||||
mergedPlan[currentMpp.structureElementId].mountingPointState = MountingPointState::Idle;
|
||||
m_conflictedStructureElementIds.insert(basePlanMpp.structureElementId);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(basePlanMpp.mountingPointState().underlying())
|
||||
switch(basePlanMpp.mountingPointState)
|
||||
{
|
||||
case MountingPointState::Empty:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(MountingPointState::Empty);
|
||||
mergedPlan[currentMpp.structureElementId].mountingPointState = MountingPointState::Empty;
|
||||
break;
|
||||
case MountingPointState::Equipped:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(MountingPointState::Equipped);
|
||||
mergedPlan[currentMpp.structureElementId].mountingPointState = MountingPointState::Equipped;
|
||||
break;
|
||||
case MountingPointState::Idle:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(currentMpp.mountingPointState());
|
||||
mergedPlan[currentMpp.structureElementId].mountingPointState = currentMpp.mountingPointState;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -267,7 +269,7 @@ QHash<int, MountingPointPlan> OverviewDialogModel::mergePlans(const QHash<int, M
|
||||
}
|
||||
else
|
||||
{
|
||||
mergedPlan[currentMpp.structureElementId()] = currentMpp;
|
||||
mergedPlan[currentMpp.structureElementId] = currentMpp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,20 +301,20 @@ void OverviewDialogModel::setNewData()
|
||||
for (const InstrumentationAsset &asset : iaConst )
|
||||
{
|
||||
|
||||
const MountingPointType mpType = (asset.mountingPointTypeId() == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : asset.mountingPointTypeId();
|
||||
const MountingPointType mpType = (asset.mountingPointTypeId == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : asset.mountingPointTypeId;
|
||||
if (!m_refMap.contains(mpType))
|
||||
continue;
|
||||
|
||||
++m_vecData[m_refMap[mpType]].assetCount;
|
||||
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Defect)
|
||||
if (asset.assetStateId == InstrumentationAssetState::Defect)
|
||||
++m_vecData[m_refMap[mpType]].assetsDefect;
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Unmounted)
|
||||
if (asset.assetStateId == InstrumentationAssetState::Unmounted)
|
||||
++m_vecData[m_refMap[mpType]].assetsFree;
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Mounted)
|
||||
if (asset.assetStateId == InstrumentationAssetState::Mounted)
|
||||
{
|
||||
++m_vecData[m_refMap[mpType]].assetsMounted;
|
||||
if (m_basePlanId == 0)
|
||||
@@ -333,16 +335,16 @@ void OverviewDialogModel::setNewData()
|
||||
{
|
||||
MainSchedule baseSchedule = m_dtc->mainSchedules().value(m_basePlanId);
|
||||
|
||||
for (const MountingPointPlan &mpp : baseSchedule.elements())
|
||||
for (const MountingPointPlan &mpp : baseSchedule.elements)
|
||||
{
|
||||
const MountingPointType mpType = getMountingPointTypeId(mpp.structureElementId());
|
||||
const MountingPointType mpType = getMountingPointTypeId(mpp.structureElementId);
|
||||
|
||||
if (!m_refMap.contains(mpType))
|
||||
continue;
|
||||
|
||||
baseMountingPointPlans.insert(mpp.structureElementId(), mpp);
|
||||
baseMountingPointPlans.insert(mpp.structureElementId, mpp);
|
||||
|
||||
if (mpp.mountingPointState() == MountingPointState::Equipped)
|
||||
if (mpp.mountingPointState == MountingPointState::Equipped)
|
||||
++m_vecData[m_refMap[mpType]].basePlanDemand;
|
||||
}
|
||||
}
|
||||
@@ -351,9 +353,9 @@ void OverviewDialogModel::setNewData()
|
||||
|
||||
const auto msesConst = m_dtc->mainStructureElements();
|
||||
for(const auto &mse : msesConst)
|
||||
for (const auto &se : mse.elements())
|
||||
if (hasMountedAsset(se.id()))
|
||||
baseMountingPointPlans.insert(se.id(), MountingPointPlan(se.id(), MountingPointState::Equipped));
|
||||
for (const auto &se : mse.elements)
|
||||
if (hasMountedAsset(se.id))
|
||||
baseMountingPointPlans.insert(se.id, MountingPointPlan(se.id, MountingPointState::Equipped));
|
||||
}
|
||||
|
||||
|
||||
@@ -376,33 +378,33 @@ void OverviewDialogModel::setNewData()
|
||||
|
||||
for(const auto &bla: totalMPPs)
|
||||
{
|
||||
MountingPointPlan compareMpp = comparedMountingPointPlans.value(bla.structureElementId(), MountingPointPlan(bla.structureElementId(), MountingPointState::Idle));
|
||||
MountingPointPlan baseMpp = baseMountingPointPlans.value(bla.structureElementId(), MountingPointPlan(bla.structureElementId(), MountingPointState::Idle));
|
||||
MountingPointPlan compareMpp = comparedMountingPointPlans.value(bla.structureElementId, MountingPointPlan(bla.structureElementId, MountingPointState::Idle));
|
||||
MountingPointPlan baseMpp = baseMountingPointPlans.value(bla.structureElementId, MountingPointPlan(bla.structureElementId, MountingPointState::Idle));
|
||||
|
||||
const MountingPointType mpType = getMountingPointTypeId(bla.structureElementId());
|
||||
const MountingPointType mpType = getMountingPointTypeId(bla.structureElementId);
|
||||
if (!m_refMap.contains(mpType))
|
||||
continue;
|
||||
|
||||
|
||||
switch(baseMpp.mountingPointState().underlying())
|
||||
switch(baseMpp.mountingPointState)
|
||||
{
|
||||
case MountingPointState::Empty:
|
||||
if (compareMpp.mountingPointState() == MountingPointState::Equipped)
|
||||
if (compareMpp.mountingPointState == MountingPointState::Equipped)
|
||||
++m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
case MountingPointState::Equipped:
|
||||
if (compareMpp.mountingPointState() != MountingPointState::Equipped)
|
||||
if (compareMpp.mountingPointState != MountingPointState::Equipped)
|
||||
--m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
case MountingPointState::Idle:
|
||||
if (compareMpp.mountingPointState() == MountingPointState::Equipped)
|
||||
if (compareMpp.mountingPointState == MountingPointState::Equipped)
|
||||
++m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch(compareMpp.mountingPointState().underlying())
|
||||
switch(compareMpp.mountingPointState)
|
||||
{
|
||||
case MountingPointState::Equipped:
|
||||
++m_vecData[m_refMap[mpType]].comparePlanDemand;
|
||||
|
||||
+10
-8
@@ -15,6 +15,7 @@
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <qscrollbar.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
using namespace InfrastructureManagement;
|
||||
|
||||
@@ -26,6 +27,7 @@ OverviewMountingPointListDialog::OverviewMountingPointListDialog(const QString &
|
||||
, m_actionMenu(new QMenu(this))
|
||||
, m_printMountingAction(new QAction(tr("To Mount"), this))
|
||||
, m_printUnmountingAction(new QAction(tr("To Unmount"), this))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
@@ -226,7 +228,7 @@ void OverviewMountingPointListDialog::retranslate()
|
||||
if (m_dtc)
|
||||
{
|
||||
MainSchedule ms = m_dtc->mainSchedule(m_scheduleId);
|
||||
const QString msName = QString::fromStdString(ms.name());
|
||||
const QString msName = QString::fromStdString(ms.name);
|
||||
translate(m_ui, tr("Completeness Check '%1'").arg(msName));
|
||||
}
|
||||
else
|
||||
@@ -242,7 +244,7 @@ void OverviewMountingPointListDialog::addMountingPointTypeFilter(MountingPointTy
|
||||
|
||||
m_mountedPointSortProxyModel->addToTypeFilter(mpt, isInitChecked);
|
||||
m_unmountedPointSortProxyModel->addToTypeFilter(mpt, isInitChecked);
|
||||
lwi->setData(Qt::UserRole, mpt.underlying());
|
||||
lwi->setData(Qt::UserRole, static_cast<int>(mpt));
|
||||
const QString text = toString(mpt);
|
||||
lwi->setText(text);
|
||||
lwi->setSelected(isInitChecked);
|
||||
@@ -266,17 +268,17 @@ void OverviewMountingPointListDialog::onPrint(QAction *action)
|
||||
MainSchedule ms = m_dtc->mainSchedule(m_dataIfc->scheduleId());
|
||||
QString header;
|
||||
header += QStringLiteral("<p>");
|
||||
header += tr("Instrumentation Plan: %1").arg(QString::fromStdString(ms.name()));
|
||||
header += tr("Instrumentation Plan: %1").arg(QString::fromStdString(ms.name));
|
||||
header += QStringLiteral("<br/>");
|
||||
header += tr("Created: %1").arg(DTG::toStringMSec(ms.timeCreated()));
|
||||
header += tr("Created: %1").arg(DTG::toStringMSec(ms.timeCreated));
|
||||
header += QStringLiteral("<br/>");
|
||||
if (ms.timeStart().is_set())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(ms.timeStart().get()));
|
||||
if (ms.timeStart.has_value())
|
||||
header += tr("START: %1").arg(DTG::toStringMSec(ms.timeStart.get()));
|
||||
else
|
||||
header += tr("START: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral(" - ");
|
||||
if (ms.timeEnd().is_set())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(ms.timeEnd().get()));
|
||||
if (ms.timeEnd.has_value())
|
||||
header += tr("END: %1").arg(DTG::toStringMSec(ms.timeEnd.get()));
|
||||
else
|
||||
header += tr("END: %1").arg(tr("[N/A]"));
|
||||
header += QStringLiteral("<br/>");
|
||||
|
||||
+36
-34
@@ -6,7 +6,8 @@
|
||||
|
||||
#include <InfrastructureManagement/ism_translation.h>
|
||||
|
||||
#include <InfrastructureManagement/ism_mounting_point.h>
|
||||
#include <InfrastructureManagement/Shared/ism_mounting_point.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -24,6 +25,7 @@ namespace InfrastructureManagement
|
||||
static const int maxIntValue = std::numeric_limits<int>::max();
|
||||
ViewMountingPointListModel::ViewMountingPointListModel(QObject *parent)
|
||||
: NGLTreeModel(parent, new NGLTreeItem(QVariant()), { tr("Name"), tr("Type"), tr("Aim State") })
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_visRoot(new NGLTreeItem(tr("Mounting Points")))
|
||||
, m_dtc(nullptr)
|
||||
, m_dataChangedTimer(new QTimer(this))
|
||||
@@ -96,7 +98,7 @@ QVariant ViewMountingPointListModel::data(const QModelIndex &index, int role) co
|
||||
else if (role == Qt::UserRole && item->data().canConvert<OverviewSimpleMountingPointData>())
|
||||
return item->data().value<OverviewSimpleMountingPointData>().id;
|
||||
else if (role == (Qt::UserRole + 1) && item->data().canConvert<OverviewSimpleMountingPointData>())
|
||||
return item->data().value<OverviewSimpleMountingPointData>().aimState.underlying();
|
||||
return static_cast<int>(item->data().value<OverviewSimpleMountingPointData>().aimState);
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
@@ -152,15 +154,15 @@ inline StructureElement setBuildingGroup(int groupId)
|
||||
{
|
||||
StructureElement se;
|
||||
InfrastructureManagement::BuildingGroup buildingGroup = static_cast<InfrastructureManagement::BuildingGroup>(groupId);
|
||||
if(buildingGroup == 0)
|
||||
if(static_cast<int>(buildingGroup) == 0)
|
||||
{
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup::UnknownGroup;
|
||||
}
|
||||
|
||||
se.id() = maxIntValue - static_cast<int>(buildingGroup);
|
||||
se.name() = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.displayName() = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.structureElementTypeId() = InfrastructureManagement::StructureElementType::Section;
|
||||
se.id = maxIntValue - static_cast<int>(buildingGroup);
|
||||
se.name = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.displayName = InfrastructureManagement::toString(buildingGroup).toStdString();
|
||||
se.structureElementTypeId = InfrastructureManagement::StructureElementType::Section;
|
||||
return se;
|
||||
}
|
||||
|
||||
@@ -168,7 +170,7 @@ inline StructureElement setBuildingGroup(int groupId)
|
||||
inline int getFakeBuildingGroupId(int seId)
|
||||
{
|
||||
InfrastructureManagement::BuildingGroup buildingGroup = static_cast<InfrastructureManagement::BuildingGroup>(seId);
|
||||
if(buildingGroup == 0)
|
||||
if(static_cast<int>(buildingGroup) == 0)
|
||||
{
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup::UnknownGroup;
|
||||
}
|
||||
@@ -206,8 +208,8 @@ void ViewMountingPointListModel::initData()
|
||||
{
|
||||
|
||||
const InfrastructureManagement::MainSchedule ¤tSchedule = m_dtc->mainSchedule(m_scheduleId);
|
||||
for (const MountingPointPlan &mpp : std::as_const(currentSchedule.elements()))
|
||||
mountingPointPlanCont.insert(mpp.structureElementId(), mpp);
|
||||
for (const MountingPointPlan &mpp : std::as_const(currentSchedule.elements))
|
||||
mountingPointPlanCont.insert(mpp.structureElementId, mpp);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,39 +227,39 @@ void ViewMountingPointListModel::initData()
|
||||
for (const MainStructureElement &mse : mainStructEles)
|
||||
{
|
||||
|
||||
if (mse.structureElementTypeId() != StructureElementType::Building)
|
||||
if (mse.structureElementTypeId != StructureElementType::Building)
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
|
||||
QModelIndex groupIndex;
|
||||
const StructureElement bse= setBuildingGroup(mse.groupId());
|
||||
if (m_availableBuildingGroups.contains(bse.id()) == false)
|
||||
const StructureElement bse= setBuildingGroup(mse.groupId);
|
||||
if (m_availableBuildingGroups.contains(bse.id) == false)
|
||||
{
|
||||
OverviewSimpleBuildingGroupData buildingGroup;
|
||||
buildingGroup.name = QString::fromStdString(bse.displayName());
|
||||
buildingGroup.id = bse.id();
|
||||
buildingGroup.name = QString::fromStdString(bse.displayName);
|
||||
buildingGroup.id = bse.id;
|
||||
NGLTreeItem *groupItem = new NGLTreeItem(QVariant::fromValue(buildingGroup));
|
||||
QModelIndex groupParentIndex;
|
||||
groupParentIndex = indexFromItem(m_visRoot);
|
||||
insertRow(rowCount(groupParentIndex), groupParentIndex, groupItem);
|
||||
groupIndex = index(groupItem->row(), 0, groupParentIndex);
|
||||
m_mountingPointIndexes.insert(bse.id(), groupIndex);
|
||||
m_availableBuildingGroups.insert(bse.id());
|
||||
m_mountingPointIndexes.insert(bse.id, groupIndex);
|
||||
m_availableBuildingGroups.insert(bse.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
groupIndex = m_mountingPointIndexes.value(bse.id(), indexFromItem(m_visRoot));
|
||||
groupIndex = m_mountingPointIndexes.value(bse.id, indexFromItem(m_visRoot));
|
||||
}
|
||||
|
||||
for (const StructureElement ¤tElement : mse.elements())
|
||||
for (const StructureElement ¤tElement : mse.elements)
|
||||
{
|
||||
NGLTreeItem *item = nullptr;
|
||||
|
||||
if (currentElement.structureElementTypeId() == StructureElementType::MountingPoint)
|
||||
if (currentElement.structureElementTypeId == StructureElementType::MountingPoint)
|
||||
{
|
||||
MountingPoint mountingPoint = m_dataInterface->mountingPoint(currentElement.id());
|
||||
MountingPoint mountingPoint = m_dataInterface->mountingPoint(currentElement.id);
|
||||
|
||||
if (!mountingPoint.isValid())
|
||||
continue;
|
||||
@@ -269,7 +271,7 @@ void ViewMountingPointListModel::initData()
|
||||
continue;
|
||||
|
||||
OverviewSimpleMountingPointData mpData;
|
||||
mpData.seType = currentElement.structureElementTypeId();
|
||||
mpData.seType = currentElement.structureElementTypeId;
|
||||
mpData.id = mountingPoint.id();
|
||||
mpData.name = mountingPoint.name();
|
||||
mpData.mpType = mountingPoint.type();
|
||||
@@ -284,7 +286,7 @@ void ViewMountingPointListModel::initData()
|
||||
if (mountingPointPlanCont.contains(mpId_StructEleId))
|
||||
{
|
||||
const MountingPointPlan &mpp = mountingPointPlanCont.value(mpId_StructEleId);
|
||||
mpData.aimState = mpp.mountingPointState();
|
||||
mpData.aimState = mpp.mountingPointState;
|
||||
} else {
|
||||
mpData.aimState = MountingPointState::Idle;
|
||||
}
|
||||
@@ -295,15 +297,15 @@ void ViewMountingPointListModel::initData()
|
||||
else
|
||||
{
|
||||
OverviewSimpleStructureElementData ssed;
|
||||
if (currentElement.structureElementTypeId() == StructureElementType::Floor)
|
||||
ssed.floor = QString::fromStdString(currentElement.name()).split(QLatin1Literal("_")).value(1, QLatin1String("-10")).toInt();
|
||||
if (currentElement.structureElementTypeId == StructureElementType::Floor)
|
||||
ssed.floor = QString::fromStdString(currentElement.name).split(QStringLiteral("_")).value(1, QLatin1String("-10")).toInt();
|
||||
else
|
||||
ssed.floor = -20;
|
||||
ssed.name = currentElement.displayName().empty() ? QString::fromStdString(currentElement.name()) : QString::fromStdString(currentElement.displayName());
|
||||
ssed.name = currentElement.displayName.empty() ? QString::fromStdString(currentElement.name) : QString::fromStdString(currentElement.displayName);
|
||||
item = new NGLTreeItem(QVariant::fromValue(ssed));
|
||||
}
|
||||
|
||||
const auto &path = currentElement.path();
|
||||
const auto &path = currentElement.path;
|
||||
|
||||
QModelIndex parentIndex;
|
||||
if (path.size() > 1)
|
||||
@@ -311,9 +313,9 @@ void ViewMountingPointListModel::initData()
|
||||
parentIndex = m_mountingPointIndexes.value(path.at(path.size() - 2), indexFromItem(m_visRoot));
|
||||
if (!parentIndex.isValid())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id();
|
||||
for (const StructureElement &se : mse.elements())
|
||||
ERROR_LOG(m_logger) << " se: " << se.id() << ", " << se.displayName() << ", " << se.name();
|
||||
ERROR_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id << " mseid: " << mse.id;
|
||||
for (const StructureElement &se : mse.elements)
|
||||
ERROR_LOG(m_logger) << " se: " << se.id << ", " << se.displayName << ", " << se.name;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -330,7 +332,7 @@ void ViewMountingPointListModel::initData()
|
||||
|
||||
insertRow(rowCount(parentIndex), parentIndex, item);
|
||||
|
||||
m_mountingPointIndexes.insert(currentElement.id(), index(item->row(), 0, parentIndex));
|
||||
m_mountingPointIndexes.insert(currentElement.id, index(item->row(), 0, parentIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,8 +340,8 @@ void ViewMountingPointListModel::initData()
|
||||
|
||||
#ifdef BENCHMARK
|
||||
const InfrastructureManagement::MainSchedule ¤tSchedule = m_dtc->mainSchedule(m_scheduleId);
|
||||
qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << currentSchedule.id();
|
||||
qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << currentSchedule.name().c_str();
|
||||
qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << currentSchedule.id;
|
||||
qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << currentSchedule.name.c_str();
|
||||
|
||||
|
||||
qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << m_scheduleId << " took " << elapsedTimer1.elapsed() << " [ms]";
|
||||
@@ -353,7 +355,7 @@ bool ViewMountingPointListModel::mountingPointHasAssetMounted(int32_t mountingPo
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
for (const MountingPointAsset &mpa : mountingPointAssetMap)
|
||||
{
|
||||
if (mpa.structureElementId() == mountingPointId)
|
||||
if (mpa.structureElementId == mountingPointId)
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
|
||||
Reference in new issue
Block a user