Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+9
-9
@@ -81,11 +81,11 @@ QVariant ConflictsDialogModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
case AIM_STATE:
|
||||
{
|
||||
return itemData.aimState == MountingPointState_def::Equipped ? green : red;
|
||||
return itemData.aimState == MountingPointState::Equipped ? green : red;
|
||||
}
|
||||
case CONFLICT_STATE:
|
||||
{
|
||||
return itemData.conflictState == MountingPointState_def::Equipped ? green : red;
|
||||
return itemData.conflictState == MountingPointState::Equipped ? green : red;
|
||||
}
|
||||
default:
|
||||
return QVariant();
|
||||
@@ -135,12 +135,12 @@ bool ConflictsDialogModel::initModel(int scheduleId,
|
||||
|
||||
|
||||
|
||||
m_visibleTypes = { MountingPointType_def::BuildingSensorModule,
|
||||
m_visibleTypes = { MountingPointType::BuildingSensorModule,
|
||||
|
||||
MountingPointType_def::IndoorCamera,
|
||||
MountingPointType_def::OutdoorIPS,
|
||||
MountingPointType_def::IndoorIPS,
|
||||
MountingPointType_def::EffectGenerationControlUnit
|
||||
MountingPointType::IndoorCamera,
|
||||
MountingPointType::OutdoorIPS,
|
||||
MountingPointType::IndoorIPS,
|
||||
MountingPointType::EffectGenerationControlUnit
|
||||
};
|
||||
|
||||
m_dtc = dtc;
|
||||
@@ -158,12 +158,12 @@ bool ConflictsDialogModel::initModel(int scheduleId,
|
||||
StructureElement ConflictsDialogModel::setBuildingGroup(int groupId)
|
||||
{
|
||||
StructureElement se;
|
||||
BuildingGroup_def::type buildingGroup = static_cast<BuildingGroup_def::type>(groupId);
|
||||
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_def::Section;
|
||||
se.structureElementTypeId() = StructureElementType::Section;
|
||||
return se;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ 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_def::Active ? QLatin1Literal("* ") : QLatin1Literal(" ")) +
|
||||
m_ui->cbComparePlan->addItem((ms.statusId() == ScheduleStatus::Active ? QLatin1Literal("* ") : QLatin1Literal(" ")) +
|
||||
QString::fromStdString(ms.name()), ms.id());
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
+24
-24
@@ -48,10 +48,10 @@ OverviewDialogModel::OverviewDialogModel(QObject *parent)
|
||||
RowData(MountingPointType::IndoorCamera),
|
||||
RowData(MountingPointType::IndoorIPS)};
|
||||
|
||||
m_refMap[MountingPointType_def::BuildingSensorModule] = 0;
|
||||
m_refMap[MountingPointType_def::EffectGenerationControlUnit] = 1;
|
||||
m_refMap[MountingPointType_def::IndoorCamera] = 2;
|
||||
m_refMap[MountingPointType_def::IndoorIPS] = 3;
|
||||
m_refMap[MountingPointType::BuildingSensorModule] = 0;
|
||||
m_refMap[MountingPointType::EffectGenerationControlUnit] = 1;
|
||||
m_refMap[MountingPointType::IndoorCamera] = 2;
|
||||
m_refMap[MountingPointType::IndoorIPS] = 3;
|
||||
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
@@ -186,10 +186,10 @@ MountingPointType OverviewDialogModel::getMountingPointTypeId(int structureEleme
|
||||
|
||||
StructureElement se;
|
||||
if (!m_dtc->getStructureElementById(structureElementId, se))
|
||||
return MountingPointType_def::get_default();
|
||||
return MountingPointType::get_default();
|
||||
|
||||
|
||||
const MountingPointType mpType = (se.mountingPointTypeId() == MountingPointType_def::OutdoorIPS) ? MountingPointType_def::IndoorIPS : se.mountingPointTypeId();
|
||||
const MountingPointType mpType = (se.mountingPointTypeId() == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : se.mountingPointTypeId();
|
||||
m_availableMountingPointTypes.insert(structureElementId, mpType);
|
||||
return mpType;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ 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_def::Active)
|
||||
if (cmpPlanId == 0 && schedule.statusId() != ScheduleStatus::Active)
|
||||
continue;
|
||||
if (cmpPlanId != 0 && cmpPlanId != schedule.id())
|
||||
continue;
|
||||
@@ -251,13 +251,13 @@ QHash<int, MountingPointPlan> OverviewDialogModel::mergePlans(const QHash<int, M
|
||||
{
|
||||
switch(basePlanMpp.mountingPointState().underlying())
|
||||
{
|
||||
case MountingPointState_def::Empty:
|
||||
case MountingPointState::Empty:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(MountingPointState::Empty);
|
||||
break;
|
||||
case MountingPointState_def::Equipped:
|
||||
case MountingPointState::Equipped:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(MountingPointState::Equipped);
|
||||
break;
|
||||
case MountingPointState_def::Idle:
|
||||
case MountingPointState::Idle:
|
||||
mergedPlan[currentMpp.structureElementId()].mountingPointState(currentMpp.mountingPointState());
|
||||
break;
|
||||
default:
|
||||
@@ -306,13 +306,13 @@ void OverviewDialogModel::setNewData()
|
||||
++m_vecData[m_refMap[mpType]].assetCount;
|
||||
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState_def::Defect)
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Defect)
|
||||
++m_vecData[m_refMap[mpType]].assetsDefect;
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState_def::Unmounted)
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Unmounted)
|
||||
++m_vecData[m_refMap[mpType]].assetsFree;
|
||||
|
||||
if (asset.assetStateId() == InstrumentationAssetState_def::Mounted)
|
||||
if (asset.assetStateId() == InstrumentationAssetState::Mounted)
|
||||
{
|
||||
++m_vecData[m_refMap[mpType]].assetsMounted;
|
||||
if (m_basePlanId == 0)
|
||||
@@ -353,7 +353,7 @@ void OverviewDialogModel::setNewData()
|
||||
for(const auto &mse : msesConst)
|
||||
for (const auto &se : mse.elements())
|
||||
if (hasMountedAsset(se.id()))
|
||||
baseMountingPointPlans.insert(se.id(), MountingPointPlan(se.id(), MountingPointState_def::Equipped));
|
||||
baseMountingPointPlans.insert(se.id(), MountingPointPlan(se.id(), MountingPointState::Equipped));
|
||||
}
|
||||
|
||||
|
||||
@@ -376,8 +376,8 @@ void OverviewDialogModel::setNewData()
|
||||
|
||||
for(const auto &bla: totalMPPs)
|
||||
{
|
||||
MountingPointPlan compareMpp = comparedMountingPointPlans.value(bla.structureElementId(), MountingPointPlan(bla.structureElementId(), MountingPointState_def::Idle));
|
||||
MountingPointPlan baseMpp = baseMountingPointPlans.value(bla.structureElementId(), MountingPointPlan(bla.structureElementId(), MountingPointState_def::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());
|
||||
if (!m_refMap.contains(mpType))
|
||||
@@ -386,16 +386,16 @@ void OverviewDialogModel::setNewData()
|
||||
|
||||
switch(baseMpp.mountingPointState().underlying())
|
||||
{
|
||||
case MountingPointState_def::Empty:
|
||||
if (compareMpp.mountingPointState() == MountingPointState_def::Equipped)
|
||||
case MountingPointState::Empty:
|
||||
if (compareMpp.mountingPointState() == MountingPointState::Equipped)
|
||||
++m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
case MountingPointState_def::Equipped:
|
||||
if (compareMpp.mountingPointState() != MountingPointState_def::Equipped)
|
||||
case MountingPointState::Equipped:
|
||||
if (compareMpp.mountingPointState() != MountingPointState::Equipped)
|
||||
--m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
case MountingPointState_def::Idle:
|
||||
if (compareMpp.mountingPointState() == MountingPointState_def::Equipped)
|
||||
case MountingPointState::Idle:
|
||||
if (compareMpp.mountingPointState() == MountingPointState::Equipped)
|
||||
++m_vecData[m_refMap[mpType]].totalDemand;
|
||||
break;
|
||||
default:
|
||||
@@ -404,10 +404,10 @@ void OverviewDialogModel::setNewData()
|
||||
|
||||
switch(compareMpp.mountingPointState().underlying())
|
||||
{
|
||||
case MountingPointState_def::Equipped:
|
||||
case MountingPointState::Equipped:
|
||||
++m_vecData[m_refMap[mpType]].comparePlanDemand;
|
||||
break;
|
||||
case MountingPointState_def::Empty:
|
||||
case MountingPointState::Empty:
|
||||
++m_vecData[m_refMap[mpType]].comparePlanUnmount;
|
||||
break;
|
||||
default:
|
||||
|
||||
+2
-2
@@ -153,7 +153,7 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session,
|
||||
types << MountingPointType::Unknown;
|
||||
for (const QListWidgetItem *lwi : m_ui->lwMountingPointType->findItems(QLatin1String(""), Qt::MatchContains))
|
||||
{
|
||||
MountingPointType mpt = static_cast<MountingPointType::inner_enum>(lwi->data(Qt::UserRole).toInt());
|
||||
MountingPointType mpt = static_cast<MountingPointType>(lwi->data(Qt::UserRole).toInt());
|
||||
if (lwi->isSelected())
|
||||
types << mpt;
|
||||
m_mountedPointSortProxyModel->addToTypeFilter(mpt, lwi->isSelected());
|
||||
@@ -351,7 +351,7 @@ QStringList OverviewMountingPointListDialog::getUsedFilterTypes()
|
||||
QStringList filterList;
|
||||
for (const QListWidgetItem *lwi : m_ui->lwMountingPointType->findItems(QLatin1String(""), Qt::MatchContains))
|
||||
{
|
||||
MountingPointType mpt = static_cast<MountingPointType::inner_enum>(lwi->data(Qt::UserRole).toInt());
|
||||
MountingPointType mpt = static_cast<MountingPointType>(lwi->data(Qt::UserRole).toInt());
|
||||
if (lwi->isSelected())
|
||||
filterList<<toString(mpt);
|
||||
}
|
||||
|
||||
+6
-6
@@ -67,7 +67,7 @@ QVariant ViewMountingPointListModel::data(const QModelIndex &index, int role) co
|
||||
case TYPE:
|
||||
if (itemData.seType == StructureElementType::MountingPoint)
|
||||
{
|
||||
const MountingPointType mpType = (itemData.mpType == MountingPointType_def::OutdoorIPS) ? MountingPointType_def::IndoorIPS : itemData.mpType;
|
||||
const MountingPointType mpType = (itemData.mpType == MountingPointType::OutdoorIPS) ? MountingPointType::IndoorIPS : itemData.mpType;
|
||||
return toString(mpType);
|
||||
}
|
||||
break;
|
||||
@@ -151,10 +151,10 @@ QModelIndex ViewMountingPointListModel::getIndexOfVisableRootItem() const
|
||||
inline StructureElement setBuildingGroup(int groupId)
|
||||
{
|
||||
StructureElement se;
|
||||
InfrastructureManagement::BuildingGroup_def::type buildingGroup = static_cast<InfrastructureManagement::BuildingGroup_def::type>(groupId);
|
||||
InfrastructureManagement::BuildingGroup buildingGroup = static_cast<InfrastructureManagement::BuildingGroup>(groupId);
|
||||
if(buildingGroup == 0)
|
||||
{
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup_def::UnknownGroup;
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup::UnknownGroup;
|
||||
}
|
||||
|
||||
se.id() = maxIntValue - static_cast<int>(buildingGroup);
|
||||
@@ -167,10 +167,10 @@ inline StructureElement setBuildingGroup(int groupId)
|
||||
|
||||
inline int getFakeBuildingGroupId(int seId)
|
||||
{
|
||||
InfrastructureManagement::BuildingGroup_def::type buildingGroup = static_cast<InfrastructureManagement::BuildingGroup_def::type>(seId);
|
||||
InfrastructureManagement::BuildingGroup buildingGroup = static_cast<InfrastructureManagement::BuildingGroup>(seId);
|
||||
if(buildingGroup == 0)
|
||||
{
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup_def::UnknownGroup;
|
||||
buildingGroup = InfrastructureManagement::BuildingGroup::UnknownGroup;
|
||||
}
|
||||
return (maxIntValue - static_cast<int>(buildingGroup));
|
||||
}
|
||||
@@ -286,7 +286,7 @@ void ViewMountingPointListModel::initData()
|
||||
const MountingPointPlan &mpp = mountingPointPlanCont.value(mpId_StructEleId);
|
||||
mpData.aimState = mpp.mountingPointState();
|
||||
} else {
|
||||
mpData.aimState = MountingPointState_def::Idle;
|
||||
mpData.aimState = MountingPointState::Idle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user