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
+2
-2
@@ -93,7 +93,7 @@ void EquipmentErrorRegistrationModel::doEventRequests()
|
||||
{
|
||||
int64_t reqEnd = ((startTime + 24 * 60 * 60 * 1000) > endTime ? endTime : startTime + 24 * 60 * 60 * 1000);
|
||||
|
||||
m_requests += m_eemForeign->requestData(startTime, reqEnd, {ProjectDataManagement::PdmEventType_def::EquipmentErrorReport});
|
||||
m_requests += m_eemForeign->requestData(startTime, reqEnd, {ProjectDataManagement::PdmEventType::EventType_EquipmentErrorReport});
|
||||
|
||||
|
||||
startTime += (24 * 60 * 60 * 1000) + 1;
|
||||
@@ -133,7 +133,7 @@ void EquipmentErrorRegistrationModel::onRequestedDataAvailable(TimeLineManagemen
|
||||
|
||||
void EquipmentErrorRegistrationModel::onLiveEvent(const ExerciseEventManagement::Event &ev)
|
||||
{
|
||||
if (ev.eventTypeId() != ProjectDataManagement::PdmEventType_def::EquipmentErrorReport)
|
||||
if (ev.eventTypeId() != ProjectDataManagement::PdmEventType::EventType_EquipmentErrorReport)
|
||||
return;
|
||||
INFO_LOG(m_logger) << "Event EquipmentNumber=" << ev.equipmentNumber();
|
||||
insertRow(event2Entry(ev));
|
||||
|
||||
+9
-9
@@ -201,9 +201,9 @@ QVariant HgrAndMineSearchModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(m_ppmDtc->participant(entry.participantId).typeId()).typeClass();
|
||||
const ProjectDataManagement::VulnerabilityClass vc = typeClass == ParticipantManagement::TypeClass::Human ?
|
||||
ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries :
|
||||
ProjectDataManagement::VulnerabilityClass_def::VehicleDamages;
|
||||
ProjectDataManagement::VulnerabilityState vs = static_cast<ProjectDataManagement::VulnerabilityState_def::type>(entry.vbg);
|
||||
ProjectDataManagement::VulnerabilityClass::SoldierInjuries :
|
||||
ProjectDataManagement::VulnerabilityClass::VehicleDamages;
|
||||
ProjectDataManagement::VulnerabilityState vs = static_cast<ProjectDataManagement::VulnerabilityState>(entry.vbg);
|
||||
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
|
||||
}
|
||||
return vulnerabilityState;
|
||||
@@ -253,7 +253,7 @@ void HgrAndMineSearchModel::onEquipmentSystemEventDataReply(const Core::Function
|
||||
return;
|
||||
HgrAndMineSearchEntry entry;
|
||||
|
||||
entry.type = ProjectDataManagement::HgrMineSearchFilterType(ProjectDataManagement::HgrMineSearchFilterType_def::Handgrenade);
|
||||
entry.type = ProjectDataManagement::HgrMineSearchFilterType(ProjectDataManagement::HgrMineSearchFilterType::Handgrenade);
|
||||
entry.pos = event.position();
|
||||
entry.timeStamp = event.timeStamp();
|
||||
entry.source = event.equipmentNumber();
|
||||
@@ -287,7 +287,7 @@ void HgrAndMineSearchModel::onRequestedDataAvailable(TimeLineManagement::Timelin
|
||||
event.properties().size())).object();
|
||||
entry.type = m_evtFlt.value(obj.value(QStringLiteral("OriginatorChargeTypeId")).toInt());
|
||||
|
||||
if (entry.type == ProjectDataManagement::HgrMineSearchFilterType::inner_enum::Mine)
|
||||
if (entry.type == ProjectDataManagement::HgrMineSearchFilterType::Mine)
|
||||
continue;
|
||||
|
||||
entry.pos = event.position();
|
||||
@@ -347,9 +347,9 @@ void HgrAndMineSearchModel::doEventRequests()
|
||||
arr += QJsonValue(it.key());
|
||||
const QJsonObject filter({{QStringLiteral("OriginatorChargeTypeId"), arr}});
|
||||
|
||||
m_requests += m_eemForeign->requestData(startTime, reqEnd, {ProjectDataManagement::PdmEventType_def::Hit,
|
||||
ProjectDataManagement::PdmEventType_def::HitEffectSimulation,
|
||||
ProjectDataManagement::PdmEventType_def::HitMine}, filter);
|
||||
m_requests += m_eemForeign->requestData(startTime, reqEnd, {ProjectDataManagement::PdmEventType::EventType_Hit,
|
||||
ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation,
|
||||
ProjectDataManagement::PdmEventType::EventType_HitMine}, filter);
|
||||
|
||||
|
||||
startTime += (24 * 60 * 60 * 1000) + 1;
|
||||
@@ -364,7 +364,7 @@ void HgrAndMineSearchModel::doInsertMines()
|
||||
HgrAndMineSearchEntry entry;
|
||||
QJsonObject properties;
|
||||
|
||||
entry.type = ProjectDataManagement::HgrMineSearchFilterType::inner_enum::Mine;
|
||||
entry.type = ProjectDataManagement::HgrMineSearchFilterType::Mine;
|
||||
entry.timeStamp = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
for (auto it = dusMineStates.constBegin(); it != dusMineStates.constEnd(); ++it)
|
||||
|
||||
+13
-13
@@ -173,16 +173,16 @@ QVariant BasePlayerModel::headerData(int section, Qt::Orientation orientation, i
|
||||
cfc.data.push_back(std::move(cfd));
|
||||
};
|
||||
|
||||
fill(ProjectDataManagement::VulnerabilityState_def::CombatReady, m_tactStatusGreen);
|
||||
fill(ProjectDataManagement::VulnerabilityState::CombatReady, m_tactStatusGreen);
|
||||
{
|
||||
LtsWidgets::ComboboxFilterData cfd;
|
||||
cfd.data = ProjectDataManagement::VulnerabilityState_def::LightDamage;
|
||||
cfd.data = ProjectDataManagement::VulnerabilityState::LightDamage;
|
||||
cfd.text = tr("Wounded / Damaged");
|
||||
cfd.icon = m_tactStatusYellow;
|
||||
cfc.data.push_back(std::move(cfd));
|
||||
}
|
||||
fill(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill, m_tactStatusRed);
|
||||
fill(ProjectDataManagement::VulnerabilityState_def::NotReady, m_tactStatusOrange);
|
||||
fill(ProjectDataManagement::VulnerabilityState::CatastrophicKill, m_tactStatusRed);
|
||||
fill(ProjectDataManagement::VulnerabilityState::NotReady, m_tactStatusOrange);
|
||||
|
||||
return cfc.toVariant();
|
||||
}
|
||||
@@ -245,11 +245,11 @@ QVariant BasePlayerModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
switch (data.vulnerabilityState.underlying())
|
||||
{
|
||||
case ProjectDataManagement::VulnerabilityState::NotReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NotReady:
|
||||
return m_tactStatusOrange;
|
||||
case ProjectDataManagement::VulnerabilityState::CombatReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
|
||||
return m_tactStatusGreen;
|
||||
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
|
||||
return m_tactStatusRed;
|
||||
default:
|
||||
return m_tactStatusYellow;
|
||||
@@ -343,14 +343,14 @@ QVariant BasePlayerModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
switch (data.vulnerabilityState.underlying())
|
||||
{
|
||||
case ProjectDataManagement::VulnerabilityState::NotReady:
|
||||
case ProjectDataManagement::VulnerabilityState::CombatReady:
|
||||
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NotReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
|
||||
return data.vulnerabilityState.underlying();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
|
||||
return ProjectDataManagement::VulnerabilityState::LightDamage;
|
||||
}
|
||||
case ColPosition:
|
||||
return data.isOutdated;
|
||||
@@ -786,8 +786,8 @@ QString BasePlayerModel::vulnerabilityStateString(ParticipantManagement::TypeCla
|
||||
ProjectDataManagement::VulnerabilityState vulState) const
|
||||
{
|
||||
const ProjectDataManagement::VulnerabilityClass vc = typeClass == ParticipantManagement::TypeClass::Human ?
|
||||
ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries :
|
||||
ProjectDataManagement::VulnerabilityClass_def::VehicleDamages;
|
||||
ProjectDataManagement::VulnerabilityClass::SoldierInjuries :
|
||||
ProjectDataManagement::VulnerabilityClass::VehicleDamages;
|
||||
|
||||
return ProjectDataManagement::toString(vulState, vc);
|
||||
}
|
||||
|
||||
+9
-9
@@ -87,7 +87,7 @@ void CheckButtonHandler::addTacticalState()
|
||||
m_vbgs.reserve(13);
|
||||
|
||||
|
||||
ProjectDataManagement::VulnerabilityState vs = ProjectDataManagement::VulnerabilityState_def::CombatReady;
|
||||
ProjectDataManagement::VulnerabilityState vs = ProjectDataManagement::VulnerabilityState::CombatReady;
|
||||
QAction *a1 = new QAction(ProjectDataManagement::toString(vs) + tr(" (Bldg: without cont. reset)"), m_menuTacticalState);
|
||||
m_vbgs += a1;
|
||||
m_menuTacticalState->addAction(a1);
|
||||
@@ -97,7 +97,7 @@ void CheckButtonHandler::addTacticalState()
|
||||
connect(m_vbgs.last(), &QAction::triggered, this, &CheckButtonHandler::combatReadyRequested);
|
||||
|
||||
|
||||
vs = ProjectDataManagement::VulnerabilityState_def::CombatReady;
|
||||
vs = ProjectDataManagement::VulnerabilityState::CombatReady;
|
||||
QAction *a2 = new QAction(ProjectDataManagement::toString(vs) + tr(" (Bldg: with cont. reset)"), m_menuTacticalState);
|
||||
m_vbgs += a2;
|
||||
m_menuTacticalState->addAction(a2);
|
||||
@@ -107,7 +107,7 @@ void CheckButtonHandler::addTacticalState()
|
||||
connect(m_vbgs.last(), &QAction::triggered, this, &CheckButtonHandler::combatReadyResetContamintationRequested);
|
||||
|
||||
|
||||
vs = ProjectDataManagement::VulnerabilityState_def::NoChange;
|
||||
vs = ProjectDataManagement::VulnerabilityState::NoChange;
|
||||
QAction *a3 = new QAction( tr("Contamination reset only"), m_menuTacticalState);
|
||||
m_vbgs += a3;
|
||||
m_menuTacticalState->addAction(a3);
|
||||
@@ -116,11 +116,11 @@ void CheckButtonHandler::addTacticalState()
|
||||
|
||||
for (int i = 1; i <= 9; ++i)
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState vs(static_cast<ProjectDataManagement::VulnerabilityState_def::type>(i));
|
||||
ProjectDataManagement::VulnerabilityState vs(static_cast<ProjectDataManagement::VulnerabilityState>(i));
|
||||
QAction *ac = new QAction(ProjectDataManagement::toString(vs), m_menuTacticalState);
|
||||
m_vbgs += ac;
|
||||
m_menuTacticalState->addAction(ac);
|
||||
if (i == static_cast<int>(ProjectDataManagement::VulnerabilityState_def::CombatReady))
|
||||
if (i == static_cast<int>(ProjectDataManagement::VulnerabilityState::CombatReady))
|
||||
{
|
||||
connect(m_vbgs.last(), &QAction::triggered,
|
||||
this, [this]() { sendInitRequest(m_selectedParticipants, false, false, true, false);});
|
||||
@@ -246,12 +246,12 @@ std::vector<int> CheckButtonHandler::setSelectedParticipantIds(const std::vector
|
||||
m_selectedParticipants.push_back(partIter.key());
|
||||
|
||||
if (!hasSoldier)
|
||||
hasSoldier = (tc == ParticipantManagement::TypeClass_def::Human);
|
||||
hasSoldier = (tc == ParticipantManagement::TypeClass::Human);
|
||||
if (!hasVehicles)
|
||||
hasVehicles = (tc != ParticipantManagement::TypeClass_def::Human &&
|
||||
tc != ParticipantManagement::TypeClass_def::SupportEntity);
|
||||
hasVehicles = (tc != ParticipantManagement::TypeClass::Human &&
|
||||
tc != ParticipantManagement::TypeClass::SupportEntity);
|
||||
if (!hasOC)
|
||||
hasOC = (tc == ParticipantManagement::TypeClass_def::SupportEntity);
|
||||
hasOC = (tc == ParticipantManagement::TypeClass::SupportEntity);
|
||||
}
|
||||
|
||||
const bool enable = m_selectedParticipants.size() != 0;
|
||||
|
||||
+4
-4
@@ -290,12 +290,12 @@ void ServiceMonitorDialog::setAllOverrides(InfrastructureManagement::EffectOverr
|
||||
|
||||
void ServiceMonitorDialog::onAllOff()
|
||||
{
|
||||
setAllOverrides(InfrastructureManagement::EffectOverride_def::PermanentOff);
|
||||
setAllOverrides(InfrastructureManagement::EffectOverride::PermanentOff);
|
||||
}
|
||||
|
||||
void ServiceMonitorDialog::onAllAuto()
|
||||
{
|
||||
setAllOverrides(InfrastructureManagement::EffectOverride_def::Automatic);
|
||||
setAllOverrides(InfrastructureManagement::EffectOverride::Automatic);
|
||||
}
|
||||
|
||||
void ServiceMonitorDialog::onTableViewSelectionChanged(const QItemSelection &selected)
|
||||
@@ -310,8 +310,8 @@ void ServiceMonitorDialog::onTableViewSelectionChanged(const QItemSelection &sel
|
||||
|
||||
EgcuModel *em = qobject_cast<EgcuModel*>(m_ui->ltsDataView->sourceModel());
|
||||
auto type = em->getStructureElementType(m_ui->ltsDataView->selectedRows().first());
|
||||
if (type != InfrastructureManagement::StructureElementType_def::Building &&
|
||||
type != InfrastructureManagement::StructureElementType_def::MountingPoint)
|
||||
if (type != InfrastructureManagement::StructureElementType::Building &&
|
||||
type != InfrastructureManagement::StructureElementType::MountingPoint)
|
||||
ena = false;
|
||||
}
|
||||
m_buttonBox->getButton(LtsWidgets::DialogButton::Edit)->setEnabled(ena);
|
||||
|
||||
+9
-9
@@ -61,16 +61,16 @@ bool EgcuEdit::init(const EgcuData &data, LtsSession::LtsSession *session)
|
||||
QLabel *name = new QLabel(QString::fromStdString(relayInfo.name()), this);
|
||||
|
||||
QComboBox *cb = new QComboBox(this);
|
||||
if (EgcuModel::readAllowance(InfrastructureManagement::EffectOverride_def::PermanentOn, relayInfo.property()))
|
||||
cb->addItem(tr("On"), InfrastructureManagement::EffectOverride_def::PermanentOn);
|
||||
if (EgcuModel::readAllowance(InfrastructureManagement::EffectOverride_def::PermanentOff, relayInfo.property()))
|
||||
cb->addItem(tr("Off"), InfrastructureManagement::EffectOverride_def::PermanentOff);
|
||||
cb->addItem(tr("Auto"), InfrastructureManagement::EffectOverride_def::Automatic);
|
||||
if (EgcuModel::readAllowance(InfrastructureManagement::EffectOverride::PermanentOn, relayInfo.property()))
|
||||
cb->addItem(tr("On"), InfrastructureManagement::EffectOverride::PermanentOn);
|
||||
if (EgcuModel::readAllowance(InfrastructureManagement::EffectOverride::PermanentOff, relayInfo.property()))
|
||||
cb->addItem(tr("Off"), InfrastructureManagement::EffectOverride::PermanentOff);
|
||||
cb->addItem(tr("Auto"), InfrastructureManagement::EffectOverride::Automatic);
|
||||
|
||||
l->addWidget(name, l->rowCount(), 0);
|
||||
l->addWidget(cb, l->rowCount()-1, 1);
|
||||
|
||||
cb->setCurrentIndex(cb->findData(InfrastructureManagement::EffectOverride_def::Automatic));
|
||||
cb->setCurrentIndex(cb->findData(InfrastructureManagement::EffectOverride::Automatic));
|
||||
m_relayCbs.insert(relayInfo.id(), cb);
|
||||
};
|
||||
|
||||
@@ -90,7 +90,7 @@ bool EgcuEdit::init(const EgcuData &data, LtsSession::LtsSession *session)
|
||||
const std::vector<InfrastructureManagement::StructureElement> &vecElements = data.mainStructureElement.elements();
|
||||
for (const auto &se : vecElements)
|
||||
{
|
||||
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType_def::Floor)
|
||||
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType::Floor)
|
||||
continue;
|
||||
QTreeWidgetItem *twi = new QTreeWidgetItem(m_ui->twRooms, {QString::fromStdString(se.displayName())});
|
||||
twi->setFlags(twi->flags() | Qt::ItemIsAutoTristate | Qt::ItemIsUserCheckable);
|
||||
@@ -101,7 +101,7 @@ bool EgcuEdit::init(const EgcuData &data, LtsSession::LtsSession *session)
|
||||
|
||||
for (const auto &se : vecElements)
|
||||
{
|
||||
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType_def::Room)
|
||||
if (se.structureElementTypeId() != InfrastructureManagement::StructureElementType::Room)
|
||||
continue;
|
||||
|
||||
if (se.path().size() < 2)
|
||||
@@ -260,7 +260,7 @@ bool EgcuEdit::apply()
|
||||
for (auto it = m_relayCbs.cbegin(); it != m_relayCbs.cend(); ++it)
|
||||
{
|
||||
QJsonObject objRelay;
|
||||
if (it.value()->currentData().toInt() == InfrastructureManagement::EffectOverride_def::Automatic)
|
||||
if (it.value()->currentData().toInt() == InfrastructureManagement::EffectOverride::Automatic)
|
||||
continue;
|
||||
objRelay[QString::number(it.key())] = it.value()->currentData().toInt();
|
||||
arrRelays.append(objRelay);
|
||||
|
||||
+39
-39
@@ -189,17 +189,17 @@ QString EgcuModel::getOverridesFlash(const QByteArray &properties)
|
||||
if ( !overridesObj.contains(QStringLiteral("flash")))
|
||||
return {};
|
||||
|
||||
InfrastructureManagement::EffectOverride flash = static_cast<InfrastructureManagement::EffectOverride::inner_enum>(overridesObj.value(QStringLiteral("flash")).toInt());
|
||||
InfrastructureManagement::EffectOverride flash = static_cast<InfrastructureManagement::EffectOverride>(overridesObj.value(QStringLiteral("flash")).toInt());
|
||||
QString res;
|
||||
switch(flash.underlying())
|
||||
{
|
||||
case InfrastructureManagement::EffectOverride_def::PermanentOff:
|
||||
case InfrastructureManagement::EffectOverride::PermanentOff:
|
||||
res = tr("Off");
|
||||
break;
|
||||
case InfrastructureManagement::EffectOverride_def::PermanentOn:
|
||||
case InfrastructureManagement::EffectOverride::PermanentOn:
|
||||
res = tr("On");
|
||||
break;
|
||||
case InfrastructureManagement::EffectOverride_def::Automatic:
|
||||
case InfrastructureManagement::EffectOverride::Automatic:
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
@@ -216,13 +216,13 @@ QString EgcuModel::getOverridesString(const EgcuData &data) const
|
||||
QString res;
|
||||
switch(override.underlying())
|
||||
{
|
||||
case InfrastructureManagement::EffectOverride_def::PermanentOff:
|
||||
case InfrastructureManagement::EffectOverride::PermanentOff:
|
||||
res = tr("Off");
|
||||
break;
|
||||
case InfrastructureManagement::EffectOverride_def::PermanentOn:
|
||||
case InfrastructureManagement::EffectOverride::PermanentOn:
|
||||
res = tr("On");
|
||||
break;
|
||||
case InfrastructureManagement::EffectOverride_def::Automatic:
|
||||
case InfrastructureManagement::EffectOverride::Automatic:
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
@@ -464,11 +464,11 @@ void EgcuModel::initData()
|
||||
else
|
||||
parentIndex = indexFromItem(m_rootItem);
|
||||
|
||||
if (currentElement.mountingPointTypeId() == InfrastructureManagement::MountingPointType_def::BuildingSensorModule)
|
||||
if (currentElement.mountingPointTypeId() == InfrastructureManagement::MountingPointType::BuildingSensorModule)
|
||||
continue;
|
||||
|
||||
bool bMseHasMountedBsm = mseHasMountedAsset(mse, InfrastructureManagement::MountingPointType_def::BuildingSensorModule);
|
||||
bool bMseHasMountedEgcu = mseHasMountedAsset(mse, InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit);
|
||||
bool bMseHasMountedBsm = mseHasMountedAsset(mse, InfrastructureManagement::MountingPointType::BuildingSensorModule);
|
||||
bool bMseHasMountedEgcu = mseHasMountedAsset(mse, InfrastructureManagement::MountingPointType::EffectGenerationControlUnit);
|
||||
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ NGLTreeItem* EgcuModel::createItemFromMountingPoint(const InfrastructureManageme
|
||||
|
||||
switch (mountingPoint.type().underlying())
|
||||
{
|
||||
case InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit:
|
||||
case InfrastructureManagement::MountingPointType::EffectGenerationControlUnit:
|
||||
{
|
||||
|
||||
|
||||
@@ -521,16 +521,16 @@ NGLTreeItem* EgcuModel::createItemFromMountingPoint(const InfrastructureManageme
|
||||
return new NGLTreeItem(QVariant::fromValue(mpData));
|
||||
break;
|
||||
}
|
||||
case InfrastructureManagement::MountingPointType_def::Unknown:
|
||||
case InfrastructureManagement::MountingPointType_def::AnnouncementUnit:
|
||||
case InfrastructureManagement::MountingPointType_def::BuildingSensorModule:
|
||||
case InfrastructureManagement::MountingPointType_def::BuildingControlUnit:
|
||||
case InfrastructureManagement::MountingPointType_def::OutdoorCamera:
|
||||
case InfrastructureManagement::MountingPointType_def::IndoorCamera:
|
||||
case InfrastructureManagement::MountingPointType_def::OutdoorIPS:
|
||||
case InfrastructureManagement::MountingPointType_def::IndoorIPS:
|
||||
case InfrastructureManagement::MountingPointType_def::MeteoDataUnit:
|
||||
case InfrastructureManagement::MountingPointType_def::VirtualIPS:
|
||||
case InfrastructureManagement::MountingPointType::Unknown:
|
||||
case InfrastructureManagement::MountingPointType::AnnouncementUnit:
|
||||
case InfrastructureManagement::MountingPointType::BuildingSensorModule:
|
||||
case InfrastructureManagement::MountingPointType::BuildingControlUnit:
|
||||
case InfrastructureManagement::MountingPointType::OutdoorCamera:
|
||||
case InfrastructureManagement::MountingPointType::IndoorCamera:
|
||||
case InfrastructureManagement::MountingPointType::OutdoorIPS:
|
||||
case InfrastructureManagement::MountingPointType::IndoorIPS:
|
||||
case InfrastructureManagement::MountingPointType::MeteoDataUnit:
|
||||
case InfrastructureManagement::MountingPointType::VirtualIPS:
|
||||
default:
|
||||
return {};
|
||||
break;
|
||||
@@ -572,14 +572,14 @@ InfrastructureManagement::StructureElementType EgcuModel::getStructureElementTyp
|
||||
{
|
||||
NGLTreeItem *item = privateData(index);
|
||||
if (!item)
|
||||
return InfrastructureManagement::StructureElementType_def::get_default();
|
||||
return InfrastructureManagement::StructureElementType::get_default();
|
||||
|
||||
if (item->data().canConvert<EgcuData>())
|
||||
return InfrastructureManagement::StructureElementType_def::MountingPoint;
|
||||
return InfrastructureManagement::StructureElementType::MountingPoint;
|
||||
else if (item->data().canConvert<InfrastructureManagement::StructureElement>())
|
||||
return item->data().value<InfrastructureManagement::StructureElement>().structureElementTypeId();
|
||||
else
|
||||
return InfrastructureManagement::StructureElementType_def::get_default();
|
||||
return InfrastructureManagement::StructureElementType::get_default();
|
||||
}
|
||||
|
||||
void EgcuModel::udpatePropertiesForRelayOverride(const int relay,
|
||||
@@ -604,14 +604,14 @@ void EgcuModel::udpatePropertiesForRelayOverride(const int relay,
|
||||
if (key != relay)
|
||||
continue;
|
||||
|
||||
if (state.underlying() != InfrastructureManagement::EffectOverride_def::Automatic)
|
||||
if (state.underlying() != InfrastructureManagement::EffectOverride::Automatic)
|
||||
arrRelays[i] = QJsonObject({qMakePair<QString, QJsonValue>(keyStr, state.underlying())});
|
||||
else
|
||||
arrRelays.removeAt(i);
|
||||
containsRelay = true;
|
||||
break;
|
||||
}
|
||||
if (!containsRelay && state.underlying() != InfrastructureManagement::EffectOverride_def::Automatic)
|
||||
if (!containsRelay && state.underlying() != InfrastructureManagement::EffectOverride::Automatic)
|
||||
arrRelays.append(QJsonObject({qMakePair<QString, QJsonValue>(QString::number(relay), state.underlying())}));
|
||||
|
||||
if (arrRelays.isEmpty())
|
||||
@@ -639,7 +639,7 @@ void EgcuModel::udpatePropertiesForOverride(const QString &tagName,
|
||||
QJsonObject docObj = QJsonObject(doc.object());
|
||||
QJsonObject overridesObj = docObj.value(QStringLiteral("Overrides")).toObject();
|
||||
|
||||
if (state.underlying() != InfrastructureManagement::EffectOverride_def::Automatic)
|
||||
if (state.underlying() != InfrastructureManagement::EffectOverride::Automatic)
|
||||
overridesObj.insert(tagName, state.underlying());
|
||||
else
|
||||
overridesObj.remove(tagName);
|
||||
@@ -681,7 +681,7 @@ void EgcuModel::findBuildings(NGLTreeItem *item, QMap<int, InfrastructureManagem
|
||||
return;
|
||||
|
||||
InfrastructureManagement::StructureElement se = item->data().value<InfrastructureManagement::StructureElement>();
|
||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Building)
|
||||
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
|
||||
buildings[se.mainStructureElementId()] = se;
|
||||
}
|
||||
|
||||
@@ -712,7 +712,7 @@ void EgcuModel::getContextMenu(const QModelIndexList &indexes, QMenu &menu)
|
||||
menu.addAction(addContextMenuHeaderItem(tr("On")));
|
||||
for (const AssetManagement::RelayInfo &relayInfo : std::as_const(m_relayInfos))
|
||||
{
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride_def::PermanentOn, egcus, relayInfo);
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride::PermanentOn, egcus, relayInfo);
|
||||
if (a)
|
||||
menu.addAction(a);
|
||||
}
|
||||
@@ -720,25 +720,25 @@ void EgcuModel::getContextMenu(const QModelIndexList &indexes, QMenu &menu)
|
||||
menu.addAction(addContextMenuHeaderItem(tr("Off")));
|
||||
for (const AssetManagement::RelayInfo &relayInfo : std::as_const(m_relayInfos))
|
||||
{
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride_def::PermanentOff, egcus, relayInfo);
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride::PermanentOff, egcus, relayInfo);
|
||||
if (a)
|
||||
menu.addAction(a);
|
||||
}
|
||||
|
||||
if (!buildings.isEmpty())
|
||||
menu.addAction(getGenericAction(InfrastructureManagement::EffectOverride_def::PermanentOff, tr("Flash"), QLatin1String("flash"), buildings));
|
||||
menu.addAction(getGenericAction(InfrastructureManagement::EffectOverride::PermanentOff, tr("Flash"), QLatin1String("flash"), buildings));
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addAction(addContextMenuHeaderItem(tr("Auto")));
|
||||
for (const AssetManagement::RelayInfo &relayInfo : std::as_const(m_relayInfos))
|
||||
{
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride_def::Automatic, egcus, relayInfo);
|
||||
QAction *a = getRelayAction(InfrastructureManagement::EffectOverride::Automatic, egcus, relayInfo);
|
||||
if (a)
|
||||
menu.addAction(a);
|
||||
}
|
||||
|
||||
if (!buildings.isEmpty())
|
||||
menu.addAction(getGenericAction(InfrastructureManagement::EffectOverride_def::Automatic, tr("Flash"), QLatin1String("flash"), buildings));
|
||||
menu.addAction(getGenericAction(InfrastructureManagement::EffectOverride::Automatic, tr("Flash"), QLatin1String("flash"), buildings));
|
||||
|
||||
if (m_sitMapGuiIfc && buildings.size() == 1)
|
||||
{
|
||||
@@ -809,7 +809,7 @@ void EgcuModel::setAllOverrides(InfrastructureManagement::EffectOverride eo, con
|
||||
for (const InfrastructureManagement::StructureElement &building : std::as_const(buildings))
|
||||
{
|
||||
auto copy = building;
|
||||
udpatePropertiesForOverride(QLatin1String("flash"), eo == InfrastructureManagement::EffectOverride_def::PermanentOn ? InfrastructureManagement::EffectOverride_def::Automatic : eo, copy);
|
||||
udpatePropertiesForOverride(QLatin1String("flash"), eo == InfrastructureManagement::EffectOverride::PermanentOn ? InfrastructureManagement::EffectOverride::Automatic : eo, copy);
|
||||
|
||||
if (!requests.contains(building.mainStructureElementId()))
|
||||
{
|
||||
@@ -1181,9 +1181,9 @@ bool EgcuModel::readAllowance(InfrastructureManagement::EffectOverride eo, const
|
||||
return true;
|
||||
|
||||
QJsonObject docObj = QJsonObject(doc.object());
|
||||
if (eo == InfrastructureManagement::EffectOverride_def::PermanentOn)
|
||||
if (eo == InfrastructureManagement::EffectOverride::PermanentOn)
|
||||
return docObj.value(QStringLiteral("allowPermanentOn")).toBool(true);
|
||||
else if (eo == InfrastructureManagement::EffectOverride_def::PermanentOff)
|
||||
else if (eo == InfrastructureManagement::EffectOverride::PermanentOff)
|
||||
return docObj.value(QStringLiteral("allowPermanentOff")).toBool(true);
|
||||
else
|
||||
return true;
|
||||
@@ -1310,7 +1310,7 @@ EgcuData::EgcuData(const InfrastructureManagement::InstrumentationAsset &ia, con
|
||||
, mountingPointAsset(mpa),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
for (int relayId : relayIds)
|
||||
effectOverrides.insert(relayId, InfrastructureManagement::EffectOverride_def::Automatic);
|
||||
effectOverrides.insert(relayId, InfrastructureManagement::EffectOverride::Automatic);
|
||||
|
||||
|
||||
update(mse);
|
||||
@@ -1366,10 +1366,10 @@ void EgcuData::update(const InfrastructureManagement::StructureElement &se, cons
|
||||
allRelayIds.remove(relayId);
|
||||
int value = objState.value(relayIdString).toInt();
|
||||
if (effectOverrides.contains(relayId))
|
||||
effectOverrides[relayId] = static_cast<InfrastructureManagement::EffectOverride::inner_enum>(value);
|
||||
effectOverrides[relayId] = static_cast<InfrastructureManagement::EffectOverride>(value);
|
||||
}
|
||||
for (auto relayId : std::as_const(allRelayIds))
|
||||
effectOverrides[relayId] = InfrastructureManagement::EffectOverride_def::Automatic;
|
||||
effectOverrides[relayId] = InfrastructureManagement::EffectOverride::Automatic;
|
||||
}
|
||||
|
||||
void EgcuData::update(const Buildings::RelayState &data)
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ void PartyEquipmentCheckDialog::onPartyCbChanged()
|
||||
|
||||
void PartyEquipmentCheckDialog::onTypeClassCbChanged()
|
||||
{
|
||||
const auto tc = ParticipantManagement::TypeClass_def::type(m_ui->cbTypeClass->currentData().toInt());
|
||||
const auto tc = ParticipantManagement::TypeClass(m_ui->cbTypeClass->currentData().toInt());
|
||||
m_partyPlayerProxyModel->setTypeClass(tc);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -41,15 +41,15 @@ bool StructureElementEdit::init(const InfrastructureManagement::StructureElement
|
||||
if (!session->getFtc<InfrastructureManagement::DataInterface>(m_ismFtc))
|
||||
return false;
|
||||
|
||||
if (m_structureElement.structureElementTypeId() != InfrastructureManagement::StructureElementType_def::Building)
|
||||
if (m_structureElement.structureElementTypeId() != InfrastructureManagement::StructureElementType::Building)
|
||||
{
|
||||
m_ui->groupBox->hide();
|
||||
}
|
||||
|
||||
|
||||
m_ui->cbFlashing->addItem(tr("Off"), InfrastructureManagement::EffectOverride_def::PermanentOff);
|
||||
m_ui->cbFlashing->addItem(tr("Auto"), InfrastructureManagement::EffectOverride_def::Automatic);
|
||||
m_ui->cbFlashing->setCurrentIndex(m_ui->cbFlashing->findData(InfrastructureManagement::EffectOverride_def::Automatic));
|
||||
m_ui->cbFlashing->addItem(tr("Off"), InfrastructureManagement::EffectOverride::PermanentOff);
|
||||
m_ui->cbFlashing->addItem(tr("Auto"), InfrastructureManagement::EffectOverride::Automatic);
|
||||
m_ui->cbFlashing->setCurrentIndex(m_ui->cbFlashing->findData(InfrastructureManagement::EffectOverride::Automatic));
|
||||
|
||||
updateComboBoxes();
|
||||
|
||||
@@ -139,7 +139,7 @@ bool StructureElementEdit::apply()
|
||||
|
||||
QJsonObject resultObj;
|
||||
QJsonObject overrideObj;
|
||||
if (m_ui->cbFlashing->currentData().toInt() != InfrastructureManagement::EffectOverride_def::Automatic)
|
||||
if (m_ui->cbFlashing->currentData().toInt() != InfrastructureManagement::EffectOverride::Automatic)
|
||||
overrideObj.insert(QStringLiteral("flash"), m_ui->cbFlashing->currentData().toInt());
|
||||
if (overrideObj.size())
|
||||
resultObj.insert (QStringLiteral("Overrides"), overrideObj);
|
||||
|
||||
Reference in new issue
Block a user