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
+5
@@ -36,6 +36,11 @@ NGL_WRAP_UI(aes_base_gui_SRCS
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY2(WS AesBaseGui SHARED ${aes_base_gui_SRCS})
|
||||
# aes_base_edit.h includes LtsWidgets/ui_requirement.h (a handwritten header, not a
|
||||
# UI file). Qt6's strict AUTOUIC auto-scan then demands a requirement.ui that does not
|
||||
# exist and fails the autogen step. The real .ui files are wrapped explicitly above via
|
||||
# NGL_WRAP_UI (qt6_wrap_ui), so disable the auto-scan (same approach as LtsWidgets).
|
||||
set_target_properties(AesBaseGui PROPERTIES AUTOUIC OFF)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(AesBaseGui
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Services/
|
||||
|
||||
+14
-14
@@ -71,23 +71,23 @@ bool BaseInfo::setData(const AesItem *item)
|
||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc) || !pdmDtc )
|
||||
return false;
|
||||
|
||||
setEffectDuration(item->effectDuration());
|
||||
m_ui->lblIdentifier->setText(QString::fromStdString(item->name().c_str()));
|
||||
m_ui->lblChargeType->setText(pdmDtc->trChargeTypeShortName(item->chargeStruct().chargeTypeId(), true));
|
||||
m_ui->lblChargeType->setToolTip(pdmDtc->trChargeTypeName(item->chargeStruct().chargeTypeId(), true));
|
||||
m_ui->lblEffectState->setText(AreaEffectSimulation::toString(item->effectStateId()));
|
||||
setEffectDuration(item->effectDuration);
|
||||
m_ui->lblIdentifier->setText(QString::fromStdString(item->name.c_str()));
|
||||
m_ui->lblChargeType->setText(pdmDtc->trChargeTypeShortName(item->chargeStruct.chargeTypeId, true));
|
||||
m_ui->lblChargeType->setToolTip(pdmDtc->trChargeTypeName(item->chargeStruct.chargeTypeId, true));
|
||||
m_ui->lblEffectState->setText(AreaEffectSimulation::toString(item->effectStateId));
|
||||
|
||||
|
||||
setEffectStart(item->effectStart().is_set() ? item->effectStart().get() : 0);
|
||||
setEffectStart(item->effectStart.has_value() ? item->effectStart.get() : 0);
|
||||
|
||||
if (item->participantId().is_set())
|
||||
if (item->participantId.has_value())
|
||||
{
|
||||
if (!ppmDtc)
|
||||
m_ui->lblParticipant->setText(tr("ID: %1").arg(item->participantId().get()));
|
||||
m_ui->lblParticipant->setText(tr("ID: %1").arg(item->participantId.get()));
|
||||
else
|
||||
{
|
||||
ParticipantManagement::Participant participant = ppmDtc->participant(item->partyId().get());
|
||||
m_ui->lblParticipant->setText(QString::fromStdString(participant.name()));
|
||||
ParticipantManagement::Participant participant = ppmDtc->participant(item->partyId.get());
|
||||
m_ui->lblParticipant->setText(QString::fromStdString(participant.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -96,14 +96,14 @@ bool BaseInfo::setData(const AesItem *item)
|
||||
m_ui->lbxParticipant->hide();
|
||||
}
|
||||
|
||||
if (item->partyId().is_set())
|
||||
if (item->partyId.has_value())
|
||||
{
|
||||
if (!ppmDtc)
|
||||
m_ui->lblParty->setText(tr("ID: %1").arg(item->partyId().get()));
|
||||
m_ui->lblParty->setText(tr("ID: %1").arg(item->partyId.get()));
|
||||
else
|
||||
{
|
||||
ParticipantManagement::Party party = ppmDtc->party(item->partyId().get());
|
||||
m_ui->lblParty->setText(ParticipantManagement::trPartyName(party.name()));
|
||||
ParticipantManagement::Party party = ppmDtc->party(item->partyId.get());
|
||||
m_ui->lblParty->setText(ParticipantManagement::trPartyName(party.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+13
-13
@@ -22,7 +22,7 @@ BaseEdit::BaseEdit(const QString& menuGroup, const QString& loggerName, QWidget*
|
||||
m_sitMapGuiIfc(nullptr), m_ppmGuiCbxIfc(nullptr), m_session(nullptr), m_menuGroup(menuGroup),
|
||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_logger(getLogger(loggerName))
|
||||
{
|
||||
m_aesItem.id(0);
|
||||
m_aesItem.id = 0;
|
||||
connect(this, &BaseEdit::visibilityChanged, this, &BaseEdit::onVisibilityChanged);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void BaseEdit::onAesItemModifyReply(const Core::FunctionReplyObject& replyObject
|
||||
|
||||
bool BaseEdit::isModifiable() const
|
||||
{
|
||||
AesEffectState effectState = m_aesItem.effectStateId();
|
||||
AesEffectState effectState = m_aesItem.effectStateId;
|
||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
@@ -62,7 +62,7 @@ bool BaseEdit::isModifiable() const
|
||||
|
||||
bool BaseEdit::isOnlyNameModifiable() const
|
||||
{
|
||||
AesEffectState effectState = m_aesItem.effectStateId();
|
||||
AesEffectState effectState = m_aesItem.effectStateId;
|
||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
|
||||
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
|
||||
@@ -166,10 +166,10 @@ void BaseEdit::setEffectStartEnabled(LtsWidgets::LtsDateTimeEdit* dte, bool enab
|
||||
m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
|
||||
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
|
||||
|
||||
enable = (exercise.state() == ExerciseManagement::ExerciseState::Started ||
|
||||
exercise.state() == ExerciseManagement::ExerciseState::Paused);
|
||||
enable = (exercise.state == ExerciseManagement::ExerciseState::Started ||
|
||||
exercise.state == ExerciseManagement::ExerciseState::Paused);
|
||||
|
||||
if (exercise.state() == ExerciseManagement::ExerciseState::Created)
|
||||
if (exercise.state == ExerciseManagement::ExerciseState::Created)
|
||||
dte->setChecked(false);
|
||||
else
|
||||
dte->setChecked(dte->msecsSinceEpoch() > 0);
|
||||
@@ -217,7 +217,7 @@ void BaseEdit::setCoordinates(const std::vector<Core::GeoPosition2D>& coords)
|
||||
clearCoordinates();
|
||||
const auto cWidgets(coordWidgets());
|
||||
for (size_t i = 0; i < cWidgets.size() && i < static_cast<size_t>(coords.size()); ++i)
|
||||
cWidgets.at(i)->setCoordinate(coords.at(i).lon(), coords.at(i).lat());
|
||||
cWidgets.at(i)->setCoordinate(coords.at(i).lon, coords.at(i).lat);
|
||||
}
|
||||
|
||||
std::vector<Core::GeoPosition2D> BaseEdit::getCoordinates() const
|
||||
@@ -265,10 +265,10 @@ void BaseEdit::enabledCoordinates(bool enable)
|
||||
void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
|
||||
{
|
||||
|
||||
if (data.id() != m_aesItem.id())
|
||||
if (data.id != m_aesItem.id)
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState::EsRemoved)
|
||||
if (modType == DataModification::eRemoved || data.effectStateId == AesEffectState::EsRemoved)
|
||||
{
|
||||
|
||||
__unchange__();
|
||||
@@ -287,7 +287,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
||||
return false;
|
||||
}
|
||||
m_session = session;
|
||||
m_aesItem.id(aesItemId);
|
||||
m_aesItem.id = aesItemId;
|
||||
|
||||
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_dtc))
|
||||
return false;
|
||||
@@ -302,7 +302,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
||||
|
||||
if (aesItemId == 0)
|
||||
{
|
||||
m_aesItem.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
|
||||
m_aesItem.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal;
|
||||
m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add"));
|
||||
}
|
||||
|
||||
@@ -311,8 +311,8 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
||||
|
||||
double BaseEdit::distance(const Core::GeoPosition2D& p1, const Core::GeoPosition2D& p2)
|
||||
{
|
||||
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon(), p1.lat());
|
||||
LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon(), p2.lat(), start.zone);
|
||||
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon, p1.lat);
|
||||
LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon, p2.lat, start.zone);
|
||||
double dx = start.x - end.x;
|
||||
double dy = start.y - end.y;
|
||||
return std::sqrt(dx * dx + dy * dy);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include <AreaEffectSimulation/logger.h>
|
||||
#include <AreaEffectSimulation/aes.hpp>
|
||||
#include <LtsWidgets/lts_dialog.h>
|
||||
#include <LtsWidgets/requirement_widget.h>
|
||||
#include <LtsWidgets/ui_requirement.h>
|
||||
|
||||
|
||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||
|
||||
+20
-16
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "aes_base_model.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
@@ -15,7 +16,8 @@
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
AesGuiBasHelpers::AesGuiBasHelpers() : m_aesDtc(nullptr), m_pdmDtc(nullptr), m_ppmDtc(nullptr) {}
|
||||
AesGuiBasHelpers::AesGuiBasHelpers() : m_aesDtc(nullptr), m_pdmDtc(nullptr), m_ppmDtc(nullptr) , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{}
|
||||
|
||||
bool AesGuiBasHelpers::initModel(LtsSession::LtsSession* session)
|
||||
{
|
||||
@@ -38,24 +40,24 @@ bool AesGuiBasHelpers::initModel(LtsSession::LtsSession* session)
|
||||
|
||||
QVariant AesGuiBasHelpers::stringFromPartyId(const dds::core::optional<int>& id) const
|
||||
{
|
||||
if (!id.is_set())
|
||||
if (!id.has_value())
|
||||
return QObject::tr("---");
|
||||
auto it = m_partyNames.find(id.get());
|
||||
if (it != m_partyNames.end())
|
||||
return it.value();
|
||||
const QString name = ParticipantManagement::trPartyName(m_ppmDtc->party(id.get()).name());
|
||||
const QString name = ParticipantManagement::trPartyName(m_ppmDtc->party(id.get()).name);
|
||||
m_partyNames.insert(id.get(), name);
|
||||
return name;
|
||||
}
|
||||
|
||||
QIcon AesGuiBasHelpers::iconFromPartyId(const dds::core::optional<int>& id) const
|
||||
{
|
||||
if (!id.is_set() || !m_ppmGuiCbxIfc)
|
||||
if (!id.has_value() || !m_ppmGuiCbxIfc)
|
||||
return QIcon();
|
||||
auto it = m_partyIcons.find(id.get());
|
||||
if (it != m_partyIcons.end())
|
||||
return it.value();
|
||||
const QRgb col = QRgb(m_ppmDtc->party(id.get()).color());
|
||||
const QRgb col = QRgb(m_ppmDtc->party(id.get()).color);
|
||||
const QIcon icon = m_ppmGuiCbxIfc->pixmapFromParty(col);
|
||||
m_partyIcons.insert(id.get(), icon);
|
||||
return icon;
|
||||
@@ -63,7 +65,7 @@ QIcon AesGuiBasHelpers::iconFromPartyId(const dds::core::optional<int>& id) cons
|
||||
|
||||
QVariant AesGuiBasHelpers::hierarchyFromParticipantId(const dds::core::optional<int>& id) const
|
||||
{
|
||||
if (!id.is_set())
|
||||
if (!id.has_value())
|
||||
return QObject::tr("---");
|
||||
auto it = m_participantHierarchy.find(id.get());
|
||||
if (it != m_participantHierarchy.end())
|
||||
@@ -109,7 +111,9 @@ void AesGuiBasHelpers::updateEffectStateComboboxFilterData(bool bWithPause)
|
||||
{
|
||||
if (!bWithPause && es == AesEffectState::EsPaused)
|
||||
continue;
|
||||
cfd.data = es;
|
||||
// Qt6 removed Qt5's QVariant template operator=, so store the enum via setValue
|
||||
// (requires the Q_DECLARE_METATYPE added to aes_base_model.h).
|
||||
cfd.data.setValue(es);
|
||||
cfd.text = AreaEffectSimulation::toString(es);
|
||||
cfc.data.push_back(cfd);
|
||||
}
|
||||
@@ -134,7 +138,7 @@ void AesGuiBasHelpers::updateComboboxFilterData(const QSet<int>& availablePartyI
|
||||
for (const int i : std::as_const(availablePartyIds))
|
||||
{
|
||||
cfd.data = i;
|
||||
cfd.text = ParticipantManagement::trPartyName(m_ppmDtc->party(i).name());
|
||||
cfd.text = ParticipantManagement::trPartyName(m_ppmDtc->party(i).name);
|
||||
cfd.icon = iconFromPartyId(i);
|
||||
cfc.data.push_back(cfd);
|
||||
}
|
||||
@@ -164,7 +168,7 @@ void AesGuiBasHelpers::fillAvailableChargeIds(ProjectDataManagement::GearClass g
|
||||
m_availableChargeIds.clear();
|
||||
const QVector<ProjectDataManagement::ChargeType> availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
||||
for (const auto& charge : availableCharges)
|
||||
m_availableChargeIds += charge.id();
|
||||
m_availableChargeIds += charge.id;
|
||||
|
||||
if (m_availableChargeIds.isEmpty())
|
||||
m_availableChargeIds += 0;
|
||||
@@ -178,7 +182,7 @@ void AesGuiBasHelpers::fillAvailableChargeIds(const QVector<ProjectDataManagemen
|
||||
{
|
||||
const QVector<ProjectDataManagement::ChargeType>& availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
||||
for (const auto& charge : std::as_const(availableCharges))
|
||||
m_availableChargeIds += charge.id();
|
||||
m_availableChargeIds += charge.id;
|
||||
}
|
||||
|
||||
if (m_availableChargeIds.isEmpty())
|
||||
@@ -192,7 +196,7 @@ AesItemSortFilterProxyModel::AesItemSortFilterProxyModel(LtsSession::LtsSession*
|
||||
if (m_session->getDtc<ParticipantManagement::DataInterface>(ppmDtc))
|
||||
{
|
||||
auto cb = [this](const ParticipantManagement::Party& party) {
|
||||
m_partyColors[party.id()] = QColor::fromRgb(QRgb(party.color()));
|
||||
m_partyColors[party.id] = QColor::fromRgb(QRgb(party.color));
|
||||
};
|
||||
ppmDtc->partys(cb);
|
||||
}
|
||||
@@ -236,11 +240,11 @@ bool AesItemSortFilterProxyModel::lessThan(const QModelIndex& source_left, const
|
||||
case AesGuiBasHelpers::BcEffectStart: {
|
||||
const auto effectStartLeft = aesEffectStart(source_left.row());
|
||||
const auto effectStartRight = aesEffectStart(source_right.row());
|
||||
if (effectStartLeft.is_set() && effectStartRight.is_set())
|
||||
if (effectStartLeft.has_value() && effectStartRight.has_value())
|
||||
return effectStartLeft.get() < effectStartRight.get();
|
||||
if (effectStartRight.is_set())
|
||||
if (effectStartRight.has_value())
|
||||
return true;
|
||||
if (effectStartLeft.is_set())
|
||||
if (effectStartLeft.has_value())
|
||||
return false;
|
||||
return aesId(source_left.row()) < aesId(source_right.row());
|
||||
}
|
||||
@@ -307,10 +311,10 @@ bool AesItemSortFilterProxyModel::checkFilter(int source_row) const
|
||||
|
||||
const auto effectStart = aesEffectStart(source_row);
|
||||
qint64 effectEnd = 0;
|
||||
if (effectStart.is_set())
|
||||
if (effectStart.has_value())
|
||||
effectEnd = effectStart.get() + aesEffectDuration(source_row);
|
||||
|
||||
if (effectStart.is_set() && effectEnd + m_offset > m_session->partitionTime())
|
||||
if (effectStart.has_value() && effectEnd + m_offset > m_session->partitionTime())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
+45
-35
@@ -22,6 +22,12 @@
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||
|
||||
// Qt6's QVariant no longer has Qt5's permissive template operator, so a scoped
|
||||
// enum must be registered to be stored in / retrieved from a QVariant. The effect-state
|
||||
// combobox filter (ComboboxFilterData::data) and the model's ComboboxFilterRole both
|
||||
// hold AesEffectState in a QVariant for filtering, so register the meta-type here.
|
||||
Q_DECLARE_METATYPE(AreaEffectSimulation::AesEffectState)
|
||||
|
||||
const static int DEFAULT_EFFECT_DURATION = 777777;
|
||||
|
||||
namespace LtsSession
|
||||
@@ -141,9 +147,9 @@ protected:
|
||||
QSet<int> availablePartyIds;
|
||||
for (const T &data : std::as_const(AesGuiBaseModel::m_vecData))
|
||||
{
|
||||
availabelChargeIds.insert(data.chargeStruct().chargeTypeId());
|
||||
if (data.partyId().is_set())
|
||||
availablePartyIds.insert(data.partyId().get());
|
||||
availabelChargeIds.insert(data.chargeStruct.chargeTypeId);
|
||||
if (data.partyId.has_value())
|
||||
availablePartyIds.insert(data.partyId.get());
|
||||
}
|
||||
updateComboboxFilterData(availablePartyIds, availabelChargeIds);
|
||||
}
|
||||
@@ -195,22 +201,22 @@ protected:
|
||||
case BcIsCentral:
|
||||
return QVariant();
|
||||
case BcChargeType:
|
||||
return QObject::tr("Id: %1").arg(item.chargeStruct().chargeTypeId());
|
||||
return QObject::tr("Id: %1").arg(item.chargeStruct.chargeTypeId);
|
||||
case BcEffectDuration:
|
||||
{
|
||||
if (item.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
if (item.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||
return QStringLiteral("---");
|
||||
else
|
||||
return QObject::tr("%1 secs").arg(QString::number(item.effectDuration() / 1000.0, 'f', 3));
|
||||
return QObject::tr("%1 secs").arg(QString::number(item.effectDuration / 1000.0, 'f', 3));
|
||||
}
|
||||
case BcEffectState:
|
||||
return QObject::tr("Id: %1").arg(item.effectStateId().underlying());
|
||||
return QObject::tr("Id: %1").arg(static_cast<int>(item.effectStateId));
|
||||
case BcEffectSource:
|
||||
return QObject::tr("Id: %1").arg(item.effectSourceId().underlying());
|
||||
return QObject::tr("Id: %1").arg(static_cast<int>(item.effectSourceId));
|
||||
case BcParty:
|
||||
return QObject::tr("Id: %1").arg(item.partyId().is_set() ? item.partyId().get() : -1);
|
||||
return QObject::tr("Id: %1").arg(item.partyId.has_value() ? item.partyId.get() : -1);
|
||||
case BcParticipant:
|
||||
return QObject::tr("Id: %1").arg(item.participantId().is_set() ? item.participantId().get() : -1);
|
||||
return QObject::tr("Id: %1").arg(item.participantId.has_value() ? item.participantId.get() : -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,28 +225,28 @@ protected:
|
||||
switch (column)
|
||||
{
|
||||
case BcId:
|
||||
return item.id();
|
||||
return item.id;
|
||||
case BcName:
|
||||
return QString::fromUtf8(item.name().c_str());
|
||||
return QString::fromUtf8(item.name.c_str());
|
||||
case BcChargeType:
|
||||
return chargeTypeName(item.chargeStruct().chargeTypeId());
|
||||
return chargeTypeName(item.chargeStruct.chargeTypeId);
|
||||
case BcEffectDuration:
|
||||
if (item.effectDuration() == DEFAULT_EFFECT_DURATION)
|
||||
if (item.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||
return QStringLiteral("---");
|
||||
else
|
||||
return LtsWidgets::readableDuration(item.effectDuration());
|
||||
return LtsWidgets::readableDuration(item.effectDuration);
|
||||
case BcEffectStart:
|
||||
return item.effectStart().is_set() ? DTG::toStringMSec(item.effectStart().get()) : QObject::tr("---");
|
||||
return item.effectStart.has_value() ? DTG::toStringMSec(item.effectStart.get()) : QObject::tr("---");
|
||||
case BcEffectState:
|
||||
return AreaEffectSimulation::toString(item.effectStateId());
|
||||
return AreaEffectSimulation::toString(item.effectStateId);
|
||||
case BcEffectSource:
|
||||
return ProjectDataManagement::toString(item.effectSourceId());
|
||||
return ProjectDataManagement::toString(item.effectSourceId);
|
||||
case BcParty:
|
||||
return stringFromPartyId(item.partyId());
|
||||
return stringFromPartyId(item.partyId);
|
||||
case BcParticipant:
|
||||
return hierarchyFromParticipantId(item.participantId());
|
||||
return hierarchyFromParticipantId(item.participantId);
|
||||
case BcIsCentral:
|
||||
return simulationTypeText(item.isCentral());
|
||||
return simulationTypeText(item.isCentral);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
@@ -250,7 +256,7 @@ protected:
|
||||
switch (column)
|
||||
{
|
||||
case BcParty:
|
||||
return iconFromPartyId(item.partyId());
|
||||
return iconFromPartyId(item.partyId);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -262,13 +268,17 @@ protected:
|
||||
switch (column)
|
||||
{
|
||||
case BcChargeType:
|
||||
return item.chargeStruct().chargeTypeId();
|
||||
return item.chargeStruct.chargeTypeId;
|
||||
case BcEffectState:
|
||||
return item.effectStateId().underlying();
|
||||
// Qt6 cannot implicitly construct a QVariant from a scoped enum; use the
|
||||
// meta-type-aware helper (needs the Q_DECLARE_METATYPE above). A free
|
||||
// qVariantFromValue is not visible at this template's definition point, so
|
||||
// use the QVariant::fromValue member instead.
|
||||
return QVariant::fromValue(item.effectStateId);
|
||||
case BcParty:
|
||||
return item.partyId().is_set() ? item.partyId().get() : -1;
|
||||
return item.partyId.has_value() ? item.partyId.get() : -1;
|
||||
case BcIsCentral:
|
||||
return simulationTypeText(item.isCentral());
|
||||
return simulationTypeText(item.isCentral);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -284,7 +294,7 @@ public:
|
||||
protected:
|
||||
bool isFiltered(const T &data, DataModification modType) const override
|
||||
{
|
||||
if (!m_availableChargeIds.isEmpty() && !m_availableChargeIds.contains(data.chargeStruct().chargeTypeId()))
|
||||
if (!m_availableChargeIds.isEmpty() && !m_availableChargeIds.contains(data.chargeStruct.chargeTypeId))
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<T>::isFiltered(data, modType);
|
||||
}
|
||||
@@ -342,10 +352,10 @@ public:
|
||||
}
|
||||
T aesItem(int row) const { return m_sourceModel->aesItem(row); }
|
||||
|
||||
int aesId(int row) const override { return aesItem(row).id(); }
|
||||
int aesId(int row) const override { return aesItem(row).id; }
|
||||
bool isExpired(int row) const override
|
||||
{
|
||||
const auto es = aesItem(row).effectStateId();
|
||||
const auto es = aesItem(row).effectStateId;
|
||||
|
||||
return es != AreaEffectSimulation::AesEffectState::EsCreated &&
|
||||
es != AreaEffectSimulation::AesEffectState::EsPrepared &&
|
||||
@@ -355,14 +365,14 @@ public:
|
||||
}
|
||||
bool isExternal(int row) const override
|
||||
{
|
||||
return aesItem(row).externalId() > 0;
|
||||
return aesItem(row).externalId > 0;
|
||||
}
|
||||
protected:
|
||||
AesEffectState aesEffectStateId(int row) const override { return aesItem(row).effectStateId(); }
|
||||
ProjectDataManagement::EffectSource aesEffectSourceId(int row) const override { return aesItem(row).effectSourceId(); }
|
||||
dds::core::optional<rti::core::int64> aesEffectStart(int row) const override { return aesItem(row).effectStart(); }
|
||||
int32_t aesEffectDuration(int row) const override { return aesItem(row).effectDuration(); }
|
||||
virtual int32_t partyId(int row) const override { return aesItem(row).partyId().is_set()?aesItem(row).partyId().get():-1; }
|
||||
AesEffectState aesEffectStateId(int row) const override { return aesItem(row).effectStateId; }
|
||||
ProjectDataManagement::EffectSource aesEffectSourceId(int row) const override { return aesItem(row).effectSourceId; }
|
||||
dds::core::optional<rti::core::int64> aesEffectStart(int row) const override { return aesItem(row).effectStart; }
|
||||
int32_t aesEffectDuration(int row) const override { return aesItem(row).effectDuration; }
|
||||
virtual int32_t partyId(int row) const override { return aesItem(row).partyId.has_value()?aesItem(row).partyId.get():-1; }
|
||||
|
||||
AesGuiBaseModel<T> *m_sourceModel = nullptr;
|
||||
};
|
||||
|
||||
+14
-12
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#include "aes_itemlist.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
#include "aes_base_model.h"
|
||||
#include "ui_aes_itemlist.h"
|
||||
@@ -27,6 +28,7 @@ AesItemList::AesItemList(const QString& menuGroup, QWidget* parent)
|
||||
m_menuGroup(menuGroup), m_requestHelper(new LtsUtils::RequestHelper(this)), m_showExpired(false),
|
||||
m_bHasAddEditOperatorRights(true), m_bHasAddAdlerOperatorRights(false), m_session(nullptr),
|
||||
m_ui(new Ui::AesItemList)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@@ -174,15 +176,15 @@ void AesItemList::onAdlerBtn()
|
||||
|
||||
DEBUG_LOG(m_logger) << "onAdlerBtn aesEffectState=" << aesEffectState;
|
||||
|
||||
switch (aesEffectState.underlying())
|
||||
switch (aesEffectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
||||
switch (effectSource.underlying())
|
||||
switch (effectSource)
|
||||
{
|
||||
case ProjectDataManagement::EffectSource::ES_ADLER: {
|
||||
AcknowledgeExternalAesItemRequest req;
|
||||
int aesId = model()->aesId(currentRow());
|
||||
req.aesId(aesId);
|
||||
req.aesId = aesId;
|
||||
m_requestHelper->startSingleRequest(
|
||||
[req, this]() { return m_ftc->acknowledgeExternalAesItemRequest(req, this); });
|
||||
|
||||
@@ -191,7 +193,7 @@ void AesItemList::onAdlerBtn()
|
||||
default: {
|
||||
ExplosionClusterReleaseReceivedRequest req;
|
||||
int aesId = model()->aesId(currentRow());
|
||||
req.id(aesId);
|
||||
req.id = aesId;
|
||||
m_requestHelper->startSingleRequest(
|
||||
[req, this]() { return m_ftc->explosionClusterReleaseReceivedRequest(req, this); });
|
||||
break;
|
||||
@@ -206,10 +208,10 @@ void AesItemList::onAdlerBtn()
|
||||
effectSource == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
||||
{
|
||||
AreaEffectSimulation::SetAesItemEffectorStateRequest req;
|
||||
req.aesId(model()->aesId(currentRow()));
|
||||
req.newEffectorState(AesEffectorState::EsReadyToFire);
|
||||
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId()
|
||||
<< ", AesEffectorState: " << req.newEffectorState();
|
||||
req.aesId = model()->aesId(currentRow());
|
||||
req.newEffectorState = AesEffectorState::EsReadyToFire;
|
||||
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId
|
||||
<< ", AesEffectorState: " << req.newEffectorState;
|
||||
|
||||
m_requestHelper->startSingleRequest(
|
||||
[req, this]() { return m_ftc->setAesItemEffectorStateRequest(req, this); });
|
||||
@@ -227,7 +229,7 @@ void AesItemList::onHandleAdler()
|
||||
DEBUG_LOG(m_logger) << "onHandleAdler aesEffectState=" << aesEffectState;
|
||||
auto* adlerBtn = m_buttonBox->getButton(ADLER_BTN);
|
||||
|
||||
switch (aesEffectState.underlying())
|
||||
switch (aesEffectState)
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
||||
adlerBtn->setText(tr("Mark received"));
|
||||
@@ -238,11 +240,11 @@ void AesItemList::onHandleAdler()
|
||||
case AreaEffectSimulation::AesEffectState::EsCreated:
|
||||
case AreaEffectSimulation::AesEffectState::EsPrepared: {
|
||||
ProjectDataManagement::EffectSource effectSource = model()->aesEffectSourceId(currentRow());
|
||||
if (effectSource.underlying() == ProjectDataManagement::EffectSource::ES_ADLER ||
|
||||
effectSource.underlying() == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
||||
if (effectSource == ProjectDataManagement::EffectSource::ES_ADLER ||
|
||||
effectSource == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
||||
{
|
||||
const EffectCluster& ecData = m_dtc->effectCluster(model()->aesId(currentRow()));
|
||||
if (ecData.effectorState() == AreaEffectSimulation::AesEffectorState::EsNotReadyToFire)
|
||||
if (ecData.effectorState == AreaEffectSimulation::AesEffectorState::EsNotReadyToFire)
|
||||
{
|
||||
adlerBtn->setText(tr("Ready To Fire"));
|
||||
adlerBtn->show();
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ QPixmap PixmapLabel::scaledPixmap(const QSize &size, const Qt::AspectRatioMode &
|
||||
|
||||
Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
|
||||
{
|
||||
switch(state.underlying())
|
||||
switch(state)
|
||||
{
|
||||
case AesEffectState::EsUnknown:
|
||||
return Qt::BrushStyle::NoBrush;
|
||||
|
||||
Reference in new issue
Block a user