Migrates residual Lts sources to generated rtiddsgen API

Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
berrux-dev committed 2026-09-23 12:05:37 +02:00
1 parent 5485a90385
commit 881d44f4dd
512 files changed
+6887 -6426

No files matched your search

+1 -1
View File
@@ -1 +1 @@
torsten.wierschin@life-maps.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMV8yH39fMOQE5BeCsxI8RMUXbDBJvRuS5phTTfrXF0H ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6kKREEjPzWMq8zjhIUCeiPI1MtwVHiZHaKxkePmW4t berrux.kana@axilinx.com
+1 -1
View File
@@ -1,4 +1,4 @@
# export MIGRATE_PIPELINE_ROOT="/home/torsten/sandbox/qt6-migration-pipeline" # export MIGRATE_PIPELINE_ROOT="/home/torsten/sandbox/qt6-migration-pipeline"
export MIGRATE_PIPELINE_ROOT="Passe Deinen Pfad an." export MIGRATE_PIPELINE_ROOT="/home/nkana/repo/qt6-migration-pipeline"
export LANG=C.UTF-8 export LANG=C.UTF-8
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
@@ -437,6 +437,17 @@ if(NOT TARGET Qt6::Svg)
message(STATUS "Created stub target for Qt6::Svg (library not available)") message(STATUS "Created stub target for Qt6::Svg (library not available)")
endif() endif()
# Qt6::SerialPort - create manual target if not found
if(NOT TARGET Qt6::SerialPort AND EXISTS "${QT6_LIB_DIR}/libQt6SerialPort.so.6")
add_library(Qt6::SerialPort SHARED IMPORTED)
set_target_properties(Qt6::SerialPort PROPERTIES
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6SerialPort.so.6"
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtSerialPort;${QT6_INC_DIR}"
INTERFACE_LINK_LIBRARIES "Qt6::Core"
)
message(STATUS "Manually configured Qt6 SerialPort target")
endif()
# Stub Qt6::SerialPort target if not available (needed by TrainingAreaBaseOC) # Stub Qt6::SerialPort target if not available (needed by TrainingAreaBaseOC)
if(NOT TARGET Qt6::SerialPort) if(NOT TARGET Qt6::SerialPort)
add_library(Qt6::SerialPort INTERFACE IMPORTED) add_library(Qt6::SerialPort INTERFACE IMPORTED)
@@ -26,7 +26,7 @@
{% endif %} {% endif %}
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h> #include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
#include <{{ namespace_abbr }}_enums.hpp> #include <{{ include_prefix }}/{{ namespace_abbr }}_enums.hpp>
{% for ext_service in ext_services.member %} {% for ext_service in ext_services.member %}
#include <{{ ext_service.baseFilePath }}.hpp> #include <{{ ext_service.baseFilePath }}.hpp>
@@ -12,7 +12,7 @@
// filename: {{ namespace_abbr }}_translation.h // filename: {{ namespace_abbr }}_translation.h
#include <string> #include <string>
#include <{{ namespace_abbr }}_enums.hpp> #include <{{ include_prefix }}/{{ namespace_abbr }}_enums.hpp>
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h> #include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
class QString; class QString;
@@ -252,22 +252,22 @@ void LtsLogin::logoff()
QString cmd; QString cmd;
switch (m_shutdownAction.underlying()) switch (m_shutdownAction.underlying())
{ {
case AssetManagement::ShutdownAction_def::Shutdown: case AssetManagement::ShutdownAction::Shutdown:
#ifdef LTS_DEBUG #ifdef LTS_DEBUG
cmd = QStringLiteral("xeyes"); cmd = QStringLiteral("xeyes");
#else #else
cmd = QStringLiteral("systemctl poweroff"); cmd = QStringLiteral("systemctl poweroff");
#endif #endif
break; break;
case AssetManagement::ShutdownAction_def::Reboot: case AssetManagement::ShutdownAction::Reboot:
#ifdef LTS_DEBUG #ifdef LTS_DEBUG
cmd = QStringLiteral("kcalc"); cmd = QStringLiteral("kcalc");
#else #else
cmd = QStringLiteral("systemctl reboot"); cmd = QStringLiteral("systemctl reboot");
#endif #endif
break; break;
case AssetManagement::ShutdownAction_def::Logout: case AssetManagement::ShutdownAction::Logout:
case AssetManagement::ShutdownAction_def::NoAction: case AssetManagement::ShutdownAction::NoAction:
emit signalLogoffDone(); emit signalLogoffDone();
break; break;
} }
@@ -20,7 +20,7 @@ void add(qint64 time_offset)
time += time_offset; time += time_offset;
ttm->addTestEvent(new LtsTimelineClassic::Event( ttm->addTestEvent(new LtsTimelineClassic::Event(
0, (int)ProjectDataManagement::PdmEventType_def::Hit, time, 0, 0, 0, 0, QStringList() << QStringLiteral("Test"), 0, (int)ProjectDataManagement::PdmEventType::EventType_Hit, time, 0, 0, 0, 0, QStringList() << QStringLiteral("Test"),
LtsTimelineClassic::Event::drawCustomEventGraphicEllipse, QColor("green"), QString())); LtsTimelineClassic::Event::drawCustomEventGraphicEllipse, QColor("green"), QString()));
} }
@@ -211,7 +211,7 @@ template <typename T> bool inline get2Byte(const QByteArray& data, T& out)
template <typename T> void inline set1Byte(const T in, QByteArray& out) template <typename T> void inline set1Byte(const T in, QByteArray& out)
{ {
static_assert(std::is_integral_v<T> || std::is_enum_v<T>, "Only integrals allowed for raw byte accessd"); static_assert(std::is_integral_v<T> || std::is_enum_v<T>, "Only integrals allowed for raw byte accessd");
unsigned char c = in; unsigned char c = static_cast<unsigned char>(in);
out += c; out += c;
} }
@@ -30,6 +30,13 @@ double QPoint3D::distanceToPoint(const QPoint3D& point) const
return (*this - point).length(); return (*this - point).length();
} }
// The header declares these operators inside namespace LtsUtils; they must
// be defined there too (a `using` directive does not place definitions
// into a namespace). Qt6's QDataStreamOperatorForType metatype machinery
// references the LtsUtils-scoped symbols explicitly.
namespace LtsUtils
{
QDataStream& operator<<(QDataStream& s, const QPoint3D& p) QDataStream& operator<<(QDataStream& s, const QPoint3D& p)
{ {
s << p.x() << p.y() << p.z(); s << p.x() << p.y() << p.z();
@@ -47,3 +54,5 @@ QDataStream& operator>>(QDataStream& s, QPoint3D& p)
p.rz() = z; p.rz() = z;
return s; return s;
} }
} // namespace LtsUtils
@@ -65,7 +65,7 @@ private:
// state is assigned directly instead of the old setter call. // state is assigned directly instead of the old setter call.
reply.data().replyState = replyState; reply.data().replyState = replyState;
// FtReplyState_def doesn't exist anymore with rtiddsgen 7.7 - the // FtReplyState doesn't exist anymore with rtiddsgen 7.7 - the
// enum values are directly available in Core::FtReplyState. // enum values are directly available in Core::FtReplyState.
bool bLastTelegram = ((replyState != Core::FtReplyState::InProgress) && bool bLastTelegram = ((replyState != Core::FtReplyState::InProgress) &&
(replyState != Core::FtReplyState::NotStarted)); (replyState != Core::FtReplyState::NotStarted));
@@ -18,25 +18,25 @@ AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantMan
{ {
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown; AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
switch (role.underlying()) { switch (role.underlying()) {
case ParticipantManagement::Role_def::Unknown: case ParticipantManagement::Role::Unknown:
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown; identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
break; break;
case ParticipantManagement::Role_def::Friend: case ParticipantManagement::Role::Friend:
identity = AdvancedSymbology::SidcDefinitions::Identity::Friend; identity = AdvancedSymbology::SidcDefinitions::Identity::Friend;
break; break;
case ParticipantManagement::Role_def::Neutral: case ParticipantManagement::Role::Neutral:
identity = AdvancedSymbology::SidcDefinitions::Identity::Neutral; identity = AdvancedSymbology::SidcDefinitions::Identity::Neutral;
break; break;
case ParticipantManagement::Role_def::Enemy: case ParticipantManagement::Role::Enemy:
identity = AdvancedSymbology::SidcDefinitions::Identity::HostileFaker; identity = AdvancedSymbology::SidcDefinitions::Identity::HostileFaker;
break; break;
case ParticipantManagement::Role_def::Pending: case ParticipantManagement::Role::Pending:
identity = AdvancedSymbology::SidcDefinitions::Identity::Pending; identity = AdvancedSymbology::SidcDefinitions::Identity::Pending;
break; break;
case ParticipantManagement::Role_def::AssumedFriend: case ParticipantManagement::Role::AssumedFriend:
identity = AdvancedSymbology::SidcDefinitions::Identity::AssumedFriend; identity = AdvancedSymbology::SidcDefinitions::Identity::AssumedFriend;
break; break;
case ParticipantManagement::Role_def::Suspect: case ParticipantManagement::Role::Suspect:
identity = AdvancedSymbology::SidcDefinitions::Identity::SuspectJoker; identity = AdvancedSymbology::SidcDefinitions::Identity::SuspectJoker;
break; break;
} }
@@ -65,7 +65,7 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantMa
symDataToRender.fillColorReplace = true; symDataToRender.fillColorReplace = true;
QColor injuryColor = QColor(100, 100, 0); QColor injuryColor = QColor(100, 100, 0);
ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::CombatReady; ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
const ParticipantManagement::DynamicParticipantData dData = m_ppmDtc->dynamicParticipantData(participant.id()); const ParticipantManagement::DynamicParticipantData dData = m_ppmDtc->dynamicParticipantData(participant.id());
@@ -161,30 +161,30 @@ AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataM
{ {
switch (state.underlying()) switch (state.underlying())
{ {
case ProjectDataManagement::VulnerabilityState::CombatReady: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
case ProjectDataManagement::VulnerabilityState::TemporarySeverance: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::NearMiss: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss:
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect:
return AdvancedSymbology::Injury::NoInjury; return AdvancedSymbology::Injury::NoInjury;
case ProjectDataManagement::VulnerabilityState::LightDamage: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_LightDamage:
case ProjectDataManagement::VulnerabilityState::MediumDamage: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage:
case ProjectDataManagement::VulnerabilityState::HeavyDamage: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage:
case ProjectDataManagement::VulnerabilityState::NotReady: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NotReady:
return AdvancedSymbology::Injury::Hit; return AdvancedSymbology::Injury::Hit;
case ProjectDataManagement::VulnerabilityState::MobilityKill: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill:
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleMobilityKill:
return AdvancedSymbology::Injury::MobilityKill; return AdvancedSymbology::Injury::MobilityKill;
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleWeaponSystemDamage:
return AdvancedSymbology::Injury::WeaponKill; return AdvancedSymbology::Injury::WeaponKill;
case ProjectDataManagement::VulnerabilityState::CatastrophicKill: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
return AdvancedSymbology::Injury::TotalKill; return AdvancedSymbology::Injury::TotalKill;
case ProjectDataManagement::VulnerabilityState::NContamination: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NContamination:
case ProjectDataManagement::VulnerabilityState::BContamination: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_BContamination:
case ProjectDataManagement::VulnerabilityState::CContamination: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CContamination:
case ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VulnerabilityBitsChanged:
case ProjectDataManagement::VulnerabilityState::Reserved: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_Reserved:
case ProjectDataManagement::VulnerabilityState::NoChange: case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange:
break; break;
} }
return AdvancedSymbology::Injury::NoInjury; return AdvancedSymbology::Injury::NoInjury;
@@ -100,10 +100,10 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
const ProjectDataManagement::VulnerabilityClass vc = const ProjectDataManagement::VulnerabilityClass vc =
typeClass == ParticipantManagement::TypeClass::Human typeClass == ParticipantManagement::TypeClass::Human
? ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries ? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
: ProjectDataManagement::VulnerabilityClass_def::VehicleDamages; : ProjectDataManagement::VulnerabilityClass::VehicleDamages;
ProjectDataManagement::VulnerabilityState vs = ProjectDataManagement::VulnerabilityState vs =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarmConfig.vulnerabilityState()); static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
vulnerabilityState = ProjectDataManagement::toString(vs, vc); vulnerabilityState = ProjectDataManagement::toString(vs, vc);
} }
return vulnerabilityState; return vulnerabilityState;
@@ -21,7 +21,7 @@ struct NotificationEx : public AlarmManagement::Notification
int equipmentNumber = 0; int equipmentNumber = 0;
int participantId = 0; int participantId = 0;
int aesId = 0; int aesId = 0;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown; ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
NotificationEx() = default; NotificationEx() = default;
@@ -57,7 +57,7 @@ void InterfaceImpl::clearInterfaces()
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data) void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
{ {
if (data.eventType() != ProjectDataManagement::PdmEventType_def::EmergencyCall) if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
return; return;
const int issi = data.equipmentNumber(); const int issi = data.equipmentNumber();
@@ -57,55 +57,55 @@ AlarmDialog::AlarmDialog(QWidget* parent)
alarmCheckBox.name = QLatin1String("NuclearAgentEntry"); alarmCheckBox.name = QLatin1String("NuclearAgentEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxNMarker; alarmCheckBox.checkboxMarker = m_ui->cbxNMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxNMessage; alarmCheckBox.checkboxWindow = m_ui->cbxNMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterNuclear; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterNuclear;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("DangerAreasEntry"); alarmCheckBox.name = QLatin1String("DangerAreasEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxDanerAreaMarker; alarmCheckBox.checkboxMarker = m_ui->cbxDanerAreaMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxDangerAreaMessage; alarmCheckBox.checkboxWindow = m_ui->cbxDangerAreaMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterDangerArea; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterDangerArea;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("MineAreaEntry"); alarmCheckBox.name = QLatin1String("MineAreaEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaEntryMarker; alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaEntryMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaEntryMessage; alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaEntryMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterMineArea; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("MineAreaHit"); alarmCheckBox.name = QLatin1String("MineAreaHit");
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaHitMarker; alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaHitMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaHitMessage; alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaHitMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitMine; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("DirectFire"); alarmCheckBox.name = QLatin1String("DirectFire");
alarmCheckBox.checkboxMarker = m_ui->cbxDirectFireMarker; alarmCheckBox.checkboxMarker = m_ui->cbxDirectFireMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxDirectFireMessage; alarmCheckBox.checkboxWindow = m_ui->cbxDirectFireMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::Hit; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("IndirectFire"); alarmCheckBox.name = QLatin1String("IndirectFire");
alarmCheckBox.checkboxMarker = m_ui->cbxIndirectFireMarker; alarmCheckBox.checkboxMarker = m_ui->cbxIndirectFireMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxIndirectFireMessage; alarmCheckBox.checkboxWindow = m_ui->cbxIndirectFireMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitEffectSimulation; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("CrossLocalBorderlines"); alarmCheckBox.name = QLatin1String("CrossLocalBorderlines");
alarmCheckBox.checkboxMarker = m_ui->cbxLocalBorderMarker; alarmCheckBox.checkboxMarker = m_ui->cbxLocalBorderMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxLocalBorderMessage; alarmCheckBox.checkboxWindow = m_ui->cbxLocalBorderMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossLocalBorderline; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("CrossGlobalBorderlines"); alarmCheckBox.name = QLatin1String("CrossGlobalBorderlines");
alarmCheckBox.checkboxMarker = m_ui->cbxGlobalBorderMarker; alarmCheckBox.checkboxMarker = m_ui->cbxGlobalBorderMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxGlobalBorderMessage; alarmCheckBox.checkboxWindow = m_ui->cbxGlobalBorderMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossGlobalBorderline; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("AirSupport"); alarmCheckBox.name = QLatin1String("AirSupport");
alarmCheckBox.checkboxMarker = m_ui->cbxAirSupportMarker; alarmCheckBox.checkboxMarker = m_ui->cbxAirSupportMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxAirSupportMessage; alarmCheckBox.checkboxWindow = m_ui->cbxAirSupportMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::AirSupport; alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
m_checkBoxes.append(alarmCheckBox); m_checkBoxes.append(alarmCheckBox);
setOnlineHelpFilename(QLatin1String("Situation-Configure_Global_Alarms")); setOnlineHelpFilename(QLatin1String("Situation-Configure_Global_Alarms"));
@@ -176,57 +176,57 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data,
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen "; DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
switch (data.eventTypeId().underlying()) switch (data.eventTypeId().underlying())
{ {
case ProjectDataManagement::PdmEventType_def::EnterNuclear: { case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen "; DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
m_ui->cbxNMarker->setChecked(setMarker); m_ui->cbxNMarker->setChecked(setMarker);
m_ui->cbxNMessage->setChecked(messageWindow); m_ui->cbxNMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::EnterDangerArea: { case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea: {
DEBUG_LOG(m_logger) << "EnterDangerArea zuweisen "; DEBUG_LOG(m_logger) << "EnterDangerArea zuweisen ";
m_ui->cbxDanerAreaMarker->setChecked(setMarker); m_ui->cbxDanerAreaMarker->setChecked(setMarker);
m_ui->cbxDangerAreaMessage->setChecked(messageWindow); m_ui->cbxDangerAreaMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::EnterMineArea: { case ProjectDataManagement::PdmEventType::EventType_EnterMineArea: {
DEBUG_LOG(m_logger) << "EnterMineArea zuweisen "; DEBUG_LOG(m_logger) << "EnterMineArea zuweisen ";
m_ui->cbxMineAreaEntryMarker->setChecked(setMarker); m_ui->cbxMineAreaEntryMarker->setChecked(setMarker);
m_ui->cbxMineAreaEntryMessage->setChecked(messageWindow); m_ui->cbxMineAreaEntryMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::HitMine: { case ProjectDataManagement::PdmEventType::EventType_HitMine: {
DEBUG_LOG(m_logger) << "HitMine zuweisen "; DEBUG_LOG(m_logger) << "HitMine zuweisen ";
m_ui->cbxMineAreaHitMarker->setChecked(setMarker); m_ui->cbxMineAreaHitMarker->setChecked(setMarker);
m_ui->cbxMineAreaHitMessage->setChecked(messageWindow); m_ui->cbxMineAreaHitMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::Hit: { case ProjectDataManagement::PdmEventType::EventType_Hit: {
DEBUG_LOG(m_logger) << "Hit zuweisen "; DEBUG_LOG(m_logger) << "Hit zuweisen ";
m_ui->cbxDirectFireMarker->setChecked(setMarker); m_ui->cbxDirectFireMarker->setChecked(setMarker);
m_ui->cbxDirectFireMessage->setChecked(messageWindow); m_ui->cbxDirectFireMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: { case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
DEBUG_LOG(m_logger) << "HitEffectSimulation zuweisen "; DEBUG_LOG(m_logger) << "HitEffectSimulation zuweisen ";
m_ui->cbxIndirectFireMarker->setChecked(setMarker); m_ui->cbxIndirectFireMarker->setChecked(setMarker);
m_ui->cbxIndirectFireMessage->setChecked(messageWindow); m_ui->cbxIndirectFireMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: { case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen "; DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
m_ui->cbxLocalBorderMarker->setChecked(setMarker); m_ui->cbxLocalBorderMarker->setChecked(setMarker);
m_ui->cbxLocalBorderMessage->setChecked(messageWindow); m_ui->cbxLocalBorderMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: { case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen "; DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
m_ui->cbxGlobalBorderMarker->setChecked(setMarker); m_ui->cbxGlobalBorderMarker->setChecked(setMarker);
m_ui->cbxGlobalBorderMessage->setChecked(messageWindow); m_ui->cbxGlobalBorderMessage->setChecked(messageWindow);
break; break;
} }
case ProjectDataManagement::PdmEventType_def::AirSupport: { case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
DEBUG_LOG(m_logger) << "AirSupport zuweisen "; DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
m_ui->cbxAirSupportMarker->setChecked(setMarker); m_ui->cbxAirSupportMarker->setChecked(setMarker);
m_ui->cbxAirSupportMessage->setChecked(messageWindow); m_ui->cbxAirSupportMessage->setChecked(messageWindow);
@@ -41,7 +41,7 @@ public:
QCheckBox *checkboxMarker = nullptr; QCheckBox *checkboxMarker = nullptr;
QCheckBox *checkboxWindow = nullptr; QCheckBox *checkboxWindow = nullptr;
QString name; QString name;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown; ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
}; };
explicit AlarmDialog(QWidget *parent = nullptr); explicit AlarmDialog(QWidget *parent = nullptr);
@@ -115,7 +115,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
switch (alarm.eventTypeId().underlying()) switch (alarm.eventTypeId().underlying())
{ {
case ProjectDataManagement::PdmEventType_def::Hit: { case ProjectDataManagement::PdmEventType::EventType_Hit: {
DEBUG_LOG(m_logger) << "Hit zuweisen "; DEBUG_LOG(m_logger) << "Hit zuweisen ";
m_ui->cbxDirectFire->setChecked(true); m_ui->cbxDirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -123,43 +123,43 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
if (alarm.vulnerabilityState() >= 0) if (alarm.vulnerabilityState() >= 0)
{ {
ProjectDataManagement::VulnerabilityState vulState = ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarm.vulnerabilityState()); static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying())); int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusDirect->setCurrentIndex(index); m_ui->cbStatusDirect->setCurrentIndex(index);
} }
break; break;
} }
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: { case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
DEBUG_LOG(m_logger) << "HitIndirect zuweisen "; DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
m_ui->cbxIndirectFire->setChecked(true); m_ui->cbxIndirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::AirSupport: { case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
DEBUG_LOG(m_logger) << "AirSupport zuweisen "; DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
m_ui->cbxAirSupport->setChecked(true); m_ui->cbxAirSupport->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::HitMine: { case ProjectDataManagement::PdmEventType::EventType_HitMine: {
DEBUG_LOG(m_logger) << "HitMine zuweisen "; DEBUG_LOG(m_logger) << "HitMine zuweisen ";
m_ui->cbxMines->setChecked(true); m_ui->cbxMines->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::HitB: case ProjectDataManagement::PdmEventType::EventType_HitB:
case ProjectDataManagement::PdmEventType_def::HitN: case ProjectDataManagement::PdmEventType::EventType_HitN:
case ProjectDataManagement::PdmEventType_def::HitC: { case ProjectDataManagement::PdmEventType::EventType_HitC: {
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen "; DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
m_ui->cbxNbcAgent->setChecked(true); m_ui->cbxNbcAgent->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::FriendlyFire: { case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen "; DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
m_ui->cbxFriendlyFire->setChecked(true); m_ui->cbxFriendlyFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -167,27 +167,27 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
if (alarm.vulnerabilityState() >= 0) if (alarm.vulnerabilityState() >= 0)
{ {
ProjectDataManagement::VulnerabilityState vulState = ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarm.vulnerabilityState()); static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying())); int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusFriendly->setCurrentIndex(index); m_ui->cbStatusFriendly->setCurrentIndex(index);
} }
break; break;
} }
case ProjectDataManagement::PdmEventType_def::Manipulation: { case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
DEBUG_LOG(m_logger) << "Manipulation zuweisen "; DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
m_ui->cbxManipulation->setChecked(true); m_ui->cbxManipulation->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: { case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen "; DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
m_ui->cbxGlobalBorderLine->setChecked(true); m_ui->cbxGlobalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break; break;
} }
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: { case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen "; DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
m_ui->cbxLocalBorderLine->setChecked(true); m_ui->cbxLocalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -215,7 +215,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
{ {
if (m_ui->cbxDirectFire->isChecked()) if (m_ui->cbxDirectFire->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Hit); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
int statusDirect = -1; int statusDirect = -1;
if (m_ui->cbStatusDirect->currentIndex() > 0) if (m_ui->cbStatusDirect->currentIndex() > 0)
statusDirect = m_ui->cbStatusDirect->currentData().toInt(); statusDirect = m_ui->cbStatusDirect->currentData().toInt();
@@ -224,7 +224,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
} }
if (m_ui->cbxFriendlyFire->isChecked()) if (m_ui->cbxFriendlyFire->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::FriendlyFire); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
int statusFriendly = -1; int statusFriendly = -1;
if (m_ui->cbStatusFriendly->currentIndex() > 0) if (m_ui->cbStatusFriendly->currentIndex() > 0)
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt(); statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
@@ -234,41 +234,41 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
alarmActionDds.vulnerabilityState(-1); alarmActionDds.vulnerabilityState(-1);
if (m_ui->cbxIndirectFire->isChecked()) if (m_ui->cbxIndirectFire->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitEffectSimulation); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxAirSupport->isChecked()) if (m_ui->cbxAirSupport->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::AirSupport); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxMines->isChecked()) if (m_ui->cbxMines->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitMine); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxNbcAgent->isChecked()) if (m_ui->cbxNbcAgent->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitN); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitB); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitC); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxManipulation->isChecked()) if (m_ui->cbxManipulation->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Manipulation); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxGlobalBorderLine->isChecked()) if (m_ui->cbxGlobalBorderLine->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
if (m_ui->cbxLocalBorderLine->isChecked()) if (m_ui->cbxLocalBorderLine->isChecked())
{ {
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossLocalBorderline); alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
alarmsDds.push_back(alarmActionDds); alarmsDds.push_back(alarmActionDds);
} }
} }
@@ -298,9 +298,9 @@ void ConfigParticipantsDialog::fillCbx()
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass); ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass); ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
m_ui->cbStatusDirect->removeItem( m_ui->cbStatusDirect->removeItem(
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::TemporarySeverance)); m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
m_ui->cbStatusFriendly->removeItem( m_ui->cbStatusFriendly->removeItem(
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::TemporarySeverance)); m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
} }
} // namespace ParticipantAlarms } // namespace ParticipantAlarms
@@ -100,7 +100,7 @@ void ParticipantsDialog::onSelectionChanged()
{ {
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index)); const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) || if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
configureAlarms = true; configureAlarms = true;
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column(); DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
} }
@@ -51,7 +51,7 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
const ParticipantManagement::ParticipantData data(getParticipantData(index)); const ParticipantManagement::ParticipantData data(getParticipantData(index));
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) || if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
isSimulatable = true; isSimulatable = true;
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated() DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
@@ -180,9 +180,9 @@ void AesChargeEffectItemInfo::onShowDetails()
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc)) if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{ {
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId()); const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
if (gearClass == ProjectDataManagement::GearClass_def::Biological) if (gearClass == ProjectDataManagement::GearClass::Biological)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this)); registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
else if (gearClass == ProjectDataManagement::GearClass_def::Chemical) else if (gearClass == ProjectDataManagement::GearClass::Chemical)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this)); registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
} }
else else
@@ -107,8 +107,8 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
setOnlineHelpFilename(QStringLiteral("Info_Dialog-BoobyTrap")); setOnlineHelpFilename(QStringLiteral("Info_Dialog-BoobyTrap"));
break; break;
} }
case AreaEffectSimulation::AesType_def::AtOffRouteMine: case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary: { case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
handleOffRouteMine(aesItemView); handleOffRouteMine(aesItemView);
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged, this, connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged, this,
&AesInfoDialog::onOffRouteMineChanged); &AesInfoDialog::onOffRouteMineChanged);
@@ -284,14 +284,14 @@ bool AesInfoDialog::init(LtsSession::LtsSession* session, const std::shared_ptr<
m_ui->lbAesId->setText(tr("AES Id:")); m_ui->lbAesId->setText(tr("AES Id:"));
if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines) if (m_aesType == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{ {
handleMineAraeSingleMine(); handleMineAraeSingleMine();
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dusMineStateChanged, this, connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dusMineStateChanged, this,
&AesInfoDialog::onDusMineStateChanged); &AesInfoDialog::onDusMineStateChanged);
} }
else if (m_aesType == AreaEffectSimulation::AesType_def::AtDusSingleMine) else if (m_aesType == AreaEffectSimulation::AesType::AtDusSingleMine)
{ {
handleSingleDusMine(); handleSingleDusMine();
@@ -363,7 +363,7 @@ void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)" DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
<< " data.id(): " << data.id(); << " data.id(): " << data.id();
handleAesItem(data, AesType_def::AtBoobyTrap); handleAesItem(data, AesType::AtBoobyTrap);
m_bcChargeTypeId = data.chargeStruct().chargeTypeId(); m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
@@ -390,7 +390,7 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine&
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)" DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
<< " data.id(): " << data.id(); << " data.id(): " << data.id();
handleAesItem(data, AesType_def::AtOffRouteMine); handleAesItem(data, AesType::AtOffRouteMine);
m_bcChargeTypeId = data.chargeStruct().chargeTypeId(); m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
@@ -595,17 +595,17 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
QStringList chargeTypesNames; QStringList chargeTypesNames;
QStringList chargeTypesShortNames; QStringList chargeTypesShortNames;
if (data.medicMode() != AesOperatingMode_def::OmNotUsed) if (data.medicMode() != AesOperatingMode::OmNotUsed)
{ {
chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true); chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true); chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true);
} }
if (data.maintMode() != AesOperatingMode_def::OmNotUsed) if (data.maintMode() != AesOperatingMode::OmNotUsed)
{ {
chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true); chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true); chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
} }
if (data.deconMode() != AesOperatingMode_def::OmNotUsed) if (data.deconMode() != AesOperatingMode::OmNotUsed)
{ {
chargeTypesNames << m_pdmDtc->trChargeTypeName(413, true); chargeTypesNames << m_pdmDtc->trChargeTypeName(413, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(413, true); chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(413, true);
@@ -693,7 +693,7 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
m_ui->lblChargeTypeId->setText(QString::number(ctId)); m_ui->lblChargeTypeId->setText(QString::number(ctId));
} }
const bool isDus = static_cast<MineClass::type>(m_pdmDtc->mineClass(ctId, 0, 0)) == MineClass::DUS; const bool isDus = static_cast<MineClass>(m_pdmDtc->mineClass(ctId, 0, 0)) == MineClass::DUS;
if (isDus) if (isDus)
m_ui->lbAesId->setText(tr("DUS Mine Id:")); m_ui->lbAesId->setText(tr("DUS Mine Id:"));
else else
@@ -763,28 +763,28 @@ void AesInfoDialog::handleSingleDusMine()
switch (dsm.effectStateId().underlying()) switch (dsm.effectStateId().underlying())
{ {
case AesEffectState_def::EsExpired: case AesEffectState::EsExpired:
m_ui->lblStatus->setText(tr("Inactive")); m_ui->lblStatus->setText(tr("Inactive"));
break; break;
case AesEffectState_def::EsRemoved: case AesEffectState::EsRemoved:
m_ui->lblStatus->setText(tr("Removed")); m_ui->lblStatus->setText(tr("Removed"));
break; break;
case AesEffectState_def::EsCreated: case AesEffectState::EsCreated:
m_ui->lblStatus->setText(tr("Created")); m_ui->lblStatus->setText(tr("Created"));
break; break;
case AesEffectState_def::EsPrepared: case AesEffectState::EsPrepared:
m_ui->lblStatus->setText(tr("Prepared")); m_ui->lblStatus->setText(tr("Prepared"));
break; break;
case AesEffectState_def::EsActivated: case AesEffectState::EsActivated:
m_ui->lblStatus->setText(tr("Active")); m_ui->lblStatus->setText(tr("Active"));
break; break;
case AesEffectState_def::EsPaused: case AesEffectState::EsPaused:
m_ui->lblStatus->setText(tr("Paused")); m_ui->lblStatus->setText(tr("Paused"));
break; break;
case AesEffectState_def::EsError: case AesEffectState::EsError:
m_ui->lblStatus->setText(tr("Error")); m_ui->lblStatus->setText(tr("Error"));
break; break;
case AesEffectState_def::EsReceived: case AesEffectState::EsReceived:
m_ui->lblStatus->setText(tr("Received")); m_ui->lblStatus->setText(tr("Received"));
break; break;
default: default:
@@ -847,8 +847,8 @@ void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId()); m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId());
switch (gearClass.underlying()) switch (gearClass.underlying())
{ {
case ProjectDataManagement::GearClass_def::Biological: case ProjectDataManagement::GearClass::Biological:
case ProjectDataManagement::GearClass_def::Chemical: case ProjectDataManagement::GearClass::Chemical:
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass)); m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
break; break;
default: default:
@@ -916,7 +916,7 @@ void AesInfoDialog::onShowDetails()
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc)) if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{ {
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId); const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId);
if (gearClass == ProjectDataManagement::GearClass_def::Biological) if (gearClass == ProjectDataManagement::GearClass::Biological)
{ {
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this); AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this);
if (dialog) if (dialog)
@@ -925,7 +925,7 @@ void AesInfoDialog::onShowDetails()
break; break;
} }
if (gearClass == ProjectDataManagement::GearClass_def::Chemical) if (gearClass == ProjectDataManagement::GearClass::Chemical)
{ {
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this); AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
if (dialog) if (dialog)
@@ -1146,7 +1146,7 @@ void AesInfoDialog::onShowDetails()
bool AesInfoDialog::onResetDusMines() bool AesInfoDialog::onResetDusMines()
{ {
if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines) if (m_aesType == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{ {
DEBUG_LOG(m_logger) << "onResetDusMines() AtMineAreaSingleMines mineId: " << m_aesEntityId; DEBUG_LOG(m_logger) << "onResetDusMines() AtMineAreaSingleMines mineId: " << m_aesEntityId;
MineResetRequest req(0, {m_aesEntityId}); MineResetRequest req(0, {m_aesEntityId});
@@ -107,7 +107,7 @@ void AirSupportExplosionClusterImpactList::createModel()
{ {
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this); m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass_def::AirSupport}, this); m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::AirSupport}, this);
m_effectClusterModel->initModel(m_session); m_effectClusterModel->initModel(m_session);
m_model->setSourceModel(m_effectClusterModel); m_model->setSourceModel(m_effectClusterModel);
} }
@@ -74,7 +74,7 @@ bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamina
bcContaOut.propagationDirection = bcContamination.propagationDirection(); bcContaOut.propagationDirection = bcContamination.propagationDirection();
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut, const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
ProjectDataManagement::VolatilityType_def::get_default(), ProjectDataManagement::VolatilityType::get_default(),
bcContamination.impactRadius(), bcContamination.impactRadius(),
QDateTime::currentDateTime()); QDateTime::currentDateTime());
@@ -132,12 +132,12 @@ void BCContaminationEdit::enableUiElements(bool enable)
m_ui->cbWeather->setEnabled(enable); m_ui->cbWeather->setEnabled(enable);
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->bCContamination(m_aesItem.id()); auto baseData = m_dtc->bCContamination(m_aesItem.id());
@@ -270,7 +270,7 @@ void BCContaminationEdit::setData(const BCContamination &contamination, bool cop
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name())); m_ui->leIdentifier->setText(QString::fromStdString(contamination.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart().is_set() ? contamination.effectStart().get() : 0); m_ui->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart().is_set() ? contamination.effectStart().get() : 0);
@@ -348,7 +348,7 @@ bool BCContaminationEdit::apply()
chargeType, chargeType,
pos, pos,
radius, radius,
static_cast<AesWeatherSource::inner_enum>(weathersource), static_cast<AesWeatherSource>(weathersource),
LtsUtils::toOptional(partyId), LtsUtils::toOptional(partyId),
LtsUtils::toOptional(participantId), LtsUtils::toOptional(participantId),
dds::core::optional<double>(), dds::core::optional<double>(),
@@ -51,20 +51,20 @@ void BaseEdit::onAesItemModifyReply(const Core::FunctionReplyObject& replyObject
bool BaseEdit::isModifiable() const bool BaseEdit::isModifiable() const
{ {
AesEffectState effectState = m_aesItem.effectStateId(); AesEffectState effectState = m_aesItem.effectStateId();
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused || return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated || effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
effectState == AreaEffectSimulation::AesEffectState_def::EsPrepared || effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
effectState == AreaEffectSimulation::AesEffectState_def::EsCreated || effectState == AreaEffectSimulation::AesEffectState::EsCreated ||
effectState == AreaEffectSimulation::AesEffectState_def::EsUnknown || effectState == AreaEffectSimulation::AesEffectState::EsUnknown ||
effectState == AreaEffectSimulation::AesEffectState_def::EsReceived) && effectState == AreaEffectSimulation::AesEffectState::EsReceived) &&
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC); (!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
} }
bool BaseEdit::isOnlyNameModifiable() const bool BaseEdit::isOnlyNameModifiable() const
{ {
AesEffectState effectState = m_aesItem.effectStateId(); AesEffectState effectState = m_aesItem.effectStateId();
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused || return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated) && effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC); (!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); m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId); ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
enable = (exercise.state() == ExerciseManagement::ExerciseState_def::Started || enable = (exercise.state() == ExerciseManagement::ExerciseState::Started ||
exercise.state() == ExerciseManagement::ExerciseState_def::Paused); exercise.state() == ExerciseManagement::ExerciseState::Paused);
if (exercise.state() == ExerciseManagement::ExerciseState_def::Created) if (exercise.state() == ExerciseManagement::ExerciseState::Created)
dte->setChecked(false); dte->setChecked(false);
else else
dte->setChecked(dte->msecsSinceEpoch() > 0); dte->setChecked(dte->msecsSinceEpoch() > 0);
@@ -268,7 +268,7 @@ void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
if (data.id() != m_aesItem.id()) if (data.id() != m_aesItem.id())
return; return;
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState_def::EsRemoved) if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState::EsRemoved)
{ {
__unchange__(); __unchange__();
@@ -302,7 +302,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
if (aesItemId == 0) if (aesItemId == 0)
{ {
m_aesItem.effectSourceId(ProjectDataManagement::EffectSource_def::ES_Internal); m_aesItem.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add")); m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add"));
} }
@@ -285,7 +285,7 @@ bool AesItemSortFilterProxyModel::checkFilter(int source_row) const
return false; return false;
const auto effectStateId = aesEffectStateId(source_row); const auto effectStateId = aesEffectStateId(source_row);
if (effectStateId == AesEffectState_def::EsRemoved) if (effectStateId == AesEffectState::EsRemoved)
return false; return false;
if (showExpired()) if (showExpired())
@@ -347,11 +347,11 @@ public:
{ {
const auto es = aesItem(row).effectStateId(); const auto es = aesItem(row).effectStateId();
return es != AreaEffectSimulation::AesEffectState_def::EsCreated && return es != AreaEffectSimulation::AesEffectState::EsCreated &&
es != AreaEffectSimulation::AesEffectState_def::EsPrepared && es != AreaEffectSimulation::AesEffectState::EsPrepared &&
es != AreaEffectSimulation::AesEffectState_def::EsActivated && es != AreaEffectSimulation::AesEffectState::EsActivated &&
es != AreaEffectSimulation::AesEffectState_def::EsPaused && es != AreaEffectSimulation::AesEffectState::EsPaused &&
es != AreaEffectSimulation::AesEffectState_def::EsReceived; es != AreaEffectSimulation::AesEffectState::EsReceived;
} }
bool isExternal(int row) const override bool isExternal(int row) const override
{ {
@@ -35,21 +35,21 @@ Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
{ {
switch(state.underlying()) switch(state.underlying())
{ {
case AesEffectState_def::EsUnknown: case AesEffectState::EsUnknown:
return Qt::BrushStyle::NoBrush; return Qt::BrushStyle::NoBrush;
case AesEffectState_def::EsPrepared: case AesEffectState::EsPrepared:
case AesEffectState_def::EsFired: case AesEffectState::EsFired:
return Qt::BrushStyle::BDiagPattern; return Qt::BrushStyle::BDiagPattern;
case AesEffectState_def::EsCreated: case AesEffectState::EsCreated:
case AesEffectState_def::EsReceived: case AesEffectState::EsReceived:
return Qt::BrushStyle::VerPattern; return Qt::BrushStyle::VerPattern;
case AesEffectState_def::EsActivated: case AesEffectState::EsActivated:
return Qt::BrushStyle::CrossPattern; return Qt::BrushStyle::CrossPattern;
case AesEffectState_def::EsRemoved: case AesEffectState::EsRemoved:
return Qt::BrushStyle::NoBrush; return Qt::BrushStyle::NoBrush;
case AesEffectState_def::EsPaused: case AesEffectState::EsPaused:
case AesEffectState_def::EsExpired: case AesEffectState::EsExpired:
case AesEffectState_def::EsError: case AesEffectState::EsError:
return Qt::BrushStyle::SolidPattern; return Qt::BrushStyle::SolidPattern;
} }
return Qt::BrushStyle::NoBrush; return Qt::BrushStyle::NoBrush;
@@ -83,12 +83,12 @@ void BorderlineEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->borderline(m_aesItem.id()); auto baseData = m_dtc->borderline(m_aesItem.id());
@@ -155,7 +155,7 @@ void BorderlineEdit::setData(const Borderline &borderline, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(borderline.name())); m_ui->leIdentifier->setText(QString::fromStdString(borderline.name()));
if ( borderline.partyId().is_set()) if ( borderline.partyId().is_set())
@@ -285,7 +285,7 @@ Borderline BorderlineEdit::jsonToBorderline(const QByteArray &content)
borderline.effectMarkingInTa(obj[QStringLiteral("effectMarkingInTa")].toInt()); borderline.effectMarkingInTa(obj[QStringLiteral("effectMarkingInTa")].toInt());
borderline.effectStart(obj[QStringLiteral("effectStart")].toDouble()); borderline.effectStart(obj[QStringLiteral("effectStart")].toDouble());
int effectStateId = obj[QStringLiteral("effectStateId")].toInt(); int effectStateId = obj[QStringLiteral("effectStateId")].toInt();
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState::inner_enum>(effectStateId)); borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
borderline.operatorId(obj[QStringLiteral("operatorId")].toInt()); borderline.operatorId(obj[QStringLiteral("operatorId")].toInt());
borderline.id(0); borderline.id(0);
borderline.name(obj[QStringLiteral("leIdentifier")].toString().toStdString()); borderline.name(obj[QStringLiteral("leIdentifier")].toString().toStdString());
@@ -144,7 +144,7 @@ QVector<Borderline> BorderlinesModel::jsonToBorderlineVector(const QByteArray &c
borderline.effectMarkingInTa(objArr[QStringLiteral("effectMarkingInTa")].toInt()); borderline.effectMarkingInTa(objArr[QStringLiteral("effectMarkingInTa")].toInt());
borderline.effectStart(objArr[QStringLiteral("effectStart")].toDouble()); borderline.effectStart(objArr[QStringLiteral("effectStart")].toDouble());
int effectStateId = objArr[QStringLiteral("effectStateId")].toInt(); int effectStateId = objArr[QStringLiteral("effectStateId")].toInt();
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState::inner_enum>(effectStateId)); borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
borderline.operatorId(objArr[QStringLiteral("operatorId")].toInt()); borderline.operatorId(objArr[QStringLiteral("operatorId")].toInt());
borderline.id(0); borderline.id(0);
borderline.name(objArr[QStringLiteral("name")].toString().toStdString()); borderline.name(objArr[QStringLiteral("name")].toString().toStdString());
@@ -98,13 +98,13 @@ bool ChargeAdministrationModel::initModel(LtsSession::LtsSession* session,
} }
QVector<ProjectDataManagement::ChargeType> chargesForGearClass = QVector<ProjectDataManagement::ChargeType> chargesForGearClass =
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Artillery) + m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Artillery) +
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Mortar); m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Mortar);
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance(); LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
const bool enableRocket = ps->value(QStringLiteral("aes"), QStringLiteral("enableRocket"), false).toBool(); const bool enableRocket = ps->value(QStringLiteral("aes"), QStringLiteral("enableRocket"), false).toBool();
if (enableRocket) if (enableRocket)
chargesForGearClass += m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Rocket); chargesForGearClass += m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Rocket);
for (const ParticipantManagement::Party& p : std::as_const(parties)) for (const ParticipantManagement::Party& p : std::as_const(parties))
{ {
for (const ProjectDataManagement::ChargeType& ct : std::as_const(chargesForGearClass)) for (const ProjectDataManagement::ChargeType& ct : std::as_const(chargesForGearClass))
@@ -165,7 +165,7 @@ void ChargeEffectEdit::onSelectionChanged()
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(m_ui->dvParticipants->selectedRows().first())); const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(m_ui->dvParticipants->selectedRows().first()));
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id(); DEBUG_LOG(m_logger) << "ParticipantId: " << data.id();
if (m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) if (m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
return; return;
DEBUG_LOG(m_logger) << "typeClass: " << m_ppmDtc->type(data.typeId()).typeClass() DEBUG_LOG(m_logger) << "typeClass: " << m_ppmDtc->type(data.typeId()).typeClass()
@@ -66,12 +66,12 @@ void DangerAreaEdit::enableUiElements(bool enable)
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
setEffectStartEnabled(m_ui->dteEffectStart, enable); setEffectStartEnabled(m_ui->dteEffectStart, enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->dangerArea(m_aesItem.id()); auto baseData = m_dtc->dangerArea(m_aesItem.id());
@@ -139,7 +139,7 @@ void DangerAreaEdit::setPbAesItemsText()
if (item.id() <= 0) if (item.id() <= 0)
continue; continue;
if (item.effectStateId() != AesEffectState_def::EsActivated) if (item.effectStateId() != AesEffectState::EsActivated)
continue; continue;
sl << QString::fromStdString(item.name().c_str()); sl << QString::fromStdString(item.name().c_str());
} }
@@ -153,7 +153,7 @@ void DangerAreaEdit::setData(const DangerArea &aesItem, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(aesItem.effectStart().is_set() ? aesItem.effectStart().get() : 0); m_ui->dteEffectStart->setMsecsSinceEpoch(aesItem.effectStart().is_set() ? aesItem.effectStart().get() : 0);
@@ -176,9 +176,9 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
const QString &hdr = this->headerData(BcName, Qt::Horizontal, Qt::DisplayRole).toString(); const QString &hdr = this->headerData(BcName, Qt::Horizontal, Qt::DisplayRole).toString();
tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name()))); tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name())));
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass_def::Artillery) bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass::Artillery)
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Mortar) || m_gearClasses.contains(ProjectDataManagement::GearClass::Mortar)
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Rocket); || m_gearClasses.contains(ProjectDataManagement::GearClass::Rocket);
toolTipHelper(this, idx, ColGearType, tooltip); toolTipHelper(this, idx, ColGearType, tooltip);
if (bIsArtilleryOrMortar) if (bIsArtilleryOrMortar)
@@ -280,12 +280,12 @@ void ExplosionEdit::enableUiElements(bool enable)
} }
setFireButton(m_aesItem.effectStateId()); setFireButton(m_aesItem.effectStateId());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
AesItem baseData; AesItem baseData;
@@ -307,7 +307,7 @@ void ExplosionEdit::enableUiElements(bool enable)
if (name != m_ui->leIdentifier->text()) if (name != m_ui->leIdentifier->text())
m_ui->leIdentifier->setText(name); m_ui->leIdentifier->setText(name);
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsPaused) if (m_aesItem.effectStateId() == AesEffectState::EsPaused)
__unchange__(); __unchange__();
} }
@@ -323,7 +323,7 @@ void ExplosionEdit::setBaseData(const AesItem &baseData, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromUtf8(baseData.name().c_str())); m_ui->leIdentifier->setText(QString::fromUtf8(baseData.name().c_str()));
int idx = m_ui->cbChargeType->findData(baseData.chargeStruct().chargeTypeId()); int idx = m_ui->cbChargeType->findData(baseData.chargeStruct().chargeTypeId());
@@ -810,16 +810,16 @@ bool ExplosionEdit::apply()
void ExplosionEdit::onFireClicked() void ExplosionEdit::onFireClicked()
{ {
m_ui->pbFire->setEnabled(false); m_ui->pbFire->setEnabled(false);
if ((m_aesItem.effectStateId() != AesEffectState_def::EsActivated && if ((m_aesItem.effectStateId() != AesEffectState::EsActivated &&
m_aesItem.effectStateId() != AesEffectState_def::EsPaused && m_aesItem.effectStateId() != AesEffectState::EsPaused &&
m_aesItem.effectStateId() != AesEffectState_def::EsCreated && m_aesItem.effectStateId() != AesEffectState::EsCreated &&
m_aesItem.effectStateId() != AesEffectState_def::EsPrepared) m_aesItem.effectStateId() != AesEffectState::EsPrepared)
|| m_aesItem.id() <= 0) || m_aesItem.id() <= 0)
return; return;
if (m_aesItem.effectStateId() == AesEffectState_def::EsCreated || if (m_aesItem.effectStateId() == AesEffectState::EsCreated ||
m_aesItem.effectStateId() == AesEffectState_def::EsPrepared) m_aesItem.effectStateId() == AesEffectState::EsPrepared)
{ {
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + 3000); m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + 3000);
m_ui->dteEffectStart->setChecked(true); m_ui->dteEffectStart->setChecked(true);
@@ -836,7 +836,7 @@ void ExplosionEdit::onFireClicked()
m_requestHelper->addRequest([ = ]() m_requestHelper->addRequest([ = ]()
{ {
return m_ftc->explosionAreaPauseResumeRequest(ExplosionAreaPauseResumeRequest(m_aesItem.id(), return m_ftc->explosionAreaPauseResumeRequest(ExplosionAreaPauseResumeRequest(m_aesItem.id(),
m_aesItem.effectStateId() != AesEffectState_def::EsActivated, m_aesItem.effectStateId() != AesEffectState::EsActivated,
dds::core::optional<rti::core::int64>(), dds::core::optional<rti::core::int64>(),
dds::core::optional<int32_t>(), dds::core::optional<int32_t>(),
dds::core::optional<int32_t>()) dds::core::optional<int32_t>())
@@ -326,9 +326,9 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowExplosionClusterListDialog(QWidget *
ExplosionList *listWidget; ExplosionList *listWidget;
listWidget = new ExplosionClusterList(menuGroup(), listWidget = new ExplosionClusterList(menuGroup(),
{ProjectDataManagement::GearClass_def::Artillery, {ProjectDataManagement::GearClass::Artillery,
ProjectDataManagement::GearClass_def::Mortar, ProjectDataManagement::GearClass::Mortar,
ProjectDataManagement::GearClass_def::Rocket}, ProjectDataManagement::GearClass::Rocket},
parent); parent);
if (listWidget->init(m_session)) if (listWidget->init(m_session))
@@ -288,7 +288,7 @@ void ExplosionAreaList::createModel()
ExplosionClusterList::ExplosionClusterList(const QString &menuGroup, const QVector<ProjectDataManagement::GearClass> &gcs, QWidget *parent) ExplosionClusterList::ExplosionClusterList(const QString &menuGroup, const QVector<ProjectDataManagement::GearClass> &gcs, QWidget *parent)
: ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass_def::Artillery, parent), m_model(nullptr), m_gearClasses(gcs) : ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass::Artillery, parent), m_model(nullptr), m_gearClasses(gcs)
{ {
} }
@@ -63,7 +63,7 @@ static int s_timeUntilMinimumSec = 10;
static const char *const VALUE_VALID_PROPERTY_NAME = "VALUE_VALID"; static const char *const VALUE_VALID_PROPERTY_NAME = "VALUE_VALID";
static const char *const LAST_VALUE = "LAST_VALUE"; static const char *const LAST_VALUE = "LAST_VALUE";
static const int s_laserPrecisionChargeTypeId = 376; static const int s_laserPrecisionChargeTypeId = 376;
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId) QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
@@ -81,8 +81,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
static QHash<int, QPair<int, int>> contraintsDistance; static QHash<int, QPair<int, int>> contraintsDistance;
if (contraintsDistance.isEmpty()) if (contraintsDistance.isEmpty())
{ {
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000}); contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000});
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800}); contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800});
} }
@@ -90,8 +90,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
static QHash<int, QPair<int, int>> contraintsDistanceVulcano; static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
if (contraintsDistanceVulcano.isEmpty()) if (contraintsDistanceVulcano.isEmpty())
{ {
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000}); contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000});
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000}); contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000});
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -107,10 +107,10 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
return {0, 100000}; return {0, 100000};
return *it; return *it;
} }
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; } int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; }
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).second; } int getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).second; }
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
@@ -121,15 +121,15 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inn
static QHash<int, QPair<int, int>> contraintsFlightDuration; static QHash<int, QPair<int, int>> contraintsFlightDuration;
if (contraintsFlightDuration.isEmpty()) if (contraintsFlightDuration.isEmpty())
{ {
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150}); contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150});
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60}); contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60});
} }
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano; static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
if (contraintsFlightDurationVulcano.isEmpty()) if (contraintsFlightDurationVulcano.isEmpty())
{ {
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999}); contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999});
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999}); contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999});
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -145,16 +145,16 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inn
return {10, 100}; return {10, 100};
return *it; return *it;
} }
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first; return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first;
} }
int getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second; return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second;
} }
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
@@ -165,15 +165,15 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum
static QHash<int, QPair<int, int>> contraintsPeak; static QHash<int, QPair<int, int>> contraintsPeak;
if (contraintsPeak.isEmpty()) if (contraintsPeak.isEmpty())
{ {
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000}); contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000});
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000}); contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000});
} }
static QHash<int, QPair<int, int>> contraintsPeakVulcano; static QHash<int, QPair<int, int>> contraintsPeakVulcano;
if (contraintsPeakVulcano.isEmpty()) if (contraintsPeakVulcano.isEmpty())
{ {
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500}); contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500});
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500}); contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500});
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -190,8 +190,8 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum
return {100, 10000}; return {100, 10000};
return *it; return *it;
} }
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; } int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; }
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).second; } int getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).second; }
@@ -241,11 +241,11 @@ ExplosionsEdit::ExplosionsEdit(const QString &menuGroup, QWidget *parent)
s_dropAngleUp = 70; s_dropAngleUp = 70;
m_geometrieButtonGroup = new QButtonGroup(this); m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)); m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea)); m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)); m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)); m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true); m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar}; m_gearClassFilter = {ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar};
@@ -416,8 +416,8 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
} }
m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea)); onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose); m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
@@ -469,7 +469,7 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
m_explosionClusterData.id(m_aesItem.id()); m_explosionClusterData.id(m_aesItem.id());
m_explosionClusterData.effectStateId(m_aesItem.effectStateId()); m_explosionClusterData.effectStateId(m_aesItem.effectStateId());
} }
@@ -530,22 +530,22 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
m_ui->dteEffectStart->setMsecsSinceEpoch(ecData.effectStart().is_set() ? ecData.effectStart().get() : 0); m_ui->dteEffectStart->setMsecsSinceEpoch(ecData.effectStart().is_set() ? ecData.effectStart().get() : 0);
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying(); const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType) switch (geometryType)
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true); m_ui->geometrieAimPointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true); m_ui->geometriePointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true); m_ui->geometrieAreaBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true); m_ui->geometrieLineBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true); m_ui->geometrieRadialBtn->setChecked(true);
break; break;
default: default:
@@ -614,7 +614,7 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
setCoord(centerpoint); setCoord(centerpoint);
} }
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{ {
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2); m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2);
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2); m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
@@ -696,11 +696,11 @@ void ExplosionsEdit::onChargeTypeChanged()
phfd = FlighDurationOrPeakHeight::FDPH_flightDuration; phfd = FlighDurationOrPeakHeight::FDPH_flightDuration;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
setMinMaxConstraints(phfd, gearClassType, chargeTypeId); setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint) if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
{ {
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt(); int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
const double impactRadius = m_pdmDtc->impactRadius(chargeTypeId, igniterTypeId, 0); const double impactRadius = m_pdmDtc->impactRadius(chargeTypeId, igniterTypeId, 0);
@@ -792,7 +792,7 @@ void ExplosionsEdit::getPosition()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{ {
const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0); const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0);
const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -815,17 +815,17 @@ void ExplosionsEdit::getPosition()
return; return;
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr); m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{ {
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF()); m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
return; return;
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_sitMapGuiIfc->getCircle(this, m_sitMapGuiIfc->getCircle(this,
SLOT(onCircleData(QPointF, double)), SLOT(onCircleData(QPointF, double)),
nullptr, nullptr,
@@ -1024,7 +1024,7 @@ void ExplosionsEdit::onDropAngleChanged() { doCalculations(true); }
void ExplosionsEdit::onWidthChanged(int width) void ExplosionsEdit::onWidthChanged(int width)
{ {
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{ {
m_ui->sbDimensionY_Tiefe->setValue(width); m_ui->sbDimensionY_Tiefe->setValue(width);
@@ -1123,7 +1123,7 @@ void ExplosionsEdit::onFlightDurationChanged(int data)
void ExplosionsEdit::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QDateTime::fromSecsSinceEpoch(value).toString(QStringLiteral("mm:ss"))); } void ExplosionsEdit::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QDateTime::fromSecsSinceEpoch(value).toString(QStringLiteral("mm:ss"))); }
void ExplosionsEdit::setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId) void ExplosionsEdit::setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
DEBUG_LOG(m_logger) << " setMinMaxConstraints START"; DEBUG_LOG(m_logger) << " setMinMaxConstraints START";
@@ -1176,7 +1176,7 @@ bool ExplosionsEdit::setValueAccordingContraints(int newValue, ExplosionsEdit::F
bool bRet = false; bool bRet = false;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
const ProjectDataManagement::GearClass::type gearClass = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); const ProjectDataManagement::GearClass gearClass = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
switch (phfd) switch (phfd)
@@ -1242,7 +1242,7 @@ void ExplosionsEdit::switchTo(FlighDurationOrPeakHeight phfd)
} }
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
setMinMaxConstraints(phfd, gearClassType, chargeTypeId); setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
} }
@@ -1273,7 +1273,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
return; return;
if ((m_explosionClusterData.effectStateId() == AesEffectState_def::EsPaused) || (m_explosionClusterData.effectStateId() == AesEffectState_def::EsExpired)) if ((m_explosionClusterData.effectStateId() == AesEffectState::EsPaused) || (m_explosionClusterData.effectStateId() == AesEffectState::EsExpired))
return; return;
DoCalculationsExitGuard exitGuard(this, executeEnableUiElements); DoCalculationsExitGuard exitGuard(this, executeEnableUiElements);
@@ -1519,7 +1519,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
@@ -1670,10 +1670,10 @@ void ExplosionsEdit::handleLaserPrecisionChargeType(const int chargeTypeId)
const auto geoButtons = m_geometrieButtonGroup->buttons(); const auto geoButtons = m_geometrieButtonGroup->buttons();
if (chargeTypeId == s_laserPrecisionChargeTypeId) if (chargeTypeId == s_laserPrecisionChargeTypeId)
{ {
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)); onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
for (QAbstractButton *btn : geoButtons) for (QAbstractButton *btn : geoButtons)
{ {
if (m_geometrieButtonGroup->id(btn) != static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)) if (m_geometrieButtonGroup->id(btn) != static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint))
btn->setCheckable(false); btn->setCheckable(false);
} }
} }
@@ -1767,15 +1767,15 @@ void ExplosionsEdit::enableUiElements(bool enable)
m_ui->pbPosition->setEnabled(m_sitMapGuiIfc && enable); m_ui->pbPosition->setEnabled(m_sitMapGuiIfc && enable);
m_ui->positionEdit->setEnabled(enable); m_ui->positionEdit->setEnabled(enable);
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea && (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea); m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
m_ui->sbHeight1SBox->setEnabled(enable); m_ui->sbHeight1SBox->setEnabled(enable);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine); m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine);
m_ui->sbAimingAxis->setEnabled( m_ui->sbAimingAxis->setEnabled(
enable enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); && (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->cbFirePurpose->setEnabled(enable); m_ui->cbFirePurpose->setEnabled(enable);
m_ui->cbGearClass->setEnabled(enable); m_ui->cbGearClass->setEnabled(enable);
m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked()); m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked());
@@ -1792,8 +1792,8 @@ void ExplosionsEdit::enableUiElements(bool enable)
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated); m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated); m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
@@ -1879,7 +1879,7 @@ void ExplosionsEdit::enableUiFireButton()
if (!enableBasics) if (!enableBasics)
return; return;
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired) if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
return; return;
int numberTrajectoriesRef = 0; int numberTrajectoriesRef = 0;
@@ -1927,7 +1927,7 @@ void ExplosionsEdit::enableUiFireButton()
else else
{ {
if (m_explosionClusterData.effectStateId() == AesEffectState_def::EsPaused) if (m_explosionClusterData.effectStateId() == AesEffectState::EsPaused)
bPause = false; bPause = false;
} }
} }
@@ -1966,26 +1966,26 @@ void ExplosionsEdit::showPreviewObject()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty()) if (m_previewPolygon.isEmpty())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius); m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
if (m_previewPolygon.isEmpty()) if (m_previewPolygon.isEmpty())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
@@ -2013,7 +2013,7 @@ bool ExplosionsEdit::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull(); bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0; bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0; bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
break; break;
@@ -2054,7 +2054,7 @@ bool ExplosionsEdit::apply()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AesExplosionGeometry_def::EgRadial: case AesExplosionGeometry::EgRadial:
{ {
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0)); QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0));
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()); bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
@@ -2065,7 +2065,7 @@ bool ExplosionsEdit::apply()
break; break;
} }
case AesExplosionGeometry_def::EgLine: case AesExplosionGeometry::EgLine:
{ {
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate()); const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
@@ -2081,9 +2081,9 @@ bool ExplosionsEdit::apply()
break; break;
} }
case AesExplosionGeometry_def::EgAimPoint: case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry_def::EgArea: case AesExplosionGeometry::EgArea:
case AesExplosionGeometry_def::EgPoint: case AesExplosionGeometry::EgPoint:
default: default:
{ {
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -2118,7 +2118,7 @@ bool ExplosionsEdit::apply()
request.esmParticipantIds().push_back(esmParticipantId2); request.esmParticipantIds().push_back(esmParticipantId2);
} }
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
request.area().rotation(0); request.area().rotation(0);
else else
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400); request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
@@ -2223,7 +2223,7 @@ bool ExplosionsEdit::apply()
void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt) void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
{ {
const AreaEffectSimulation::AesExplosionGeometry::inner_enum newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry::inner_enum>(explosionGeometryInt); const AreaEffectSimulation::AesExplosionGeometry newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry>(explosionGeometryInt);
if (m_currentGeometry == newGeometry) if (m_currentGeometry == newGeometry)
return; return;
@@ -2249,8 +2249,8 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2275,7 +2275,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
onChargeTypeChanged(); onChargeTypeChanged();
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2296,7 +2296,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setSingleStep(60); m_ui->sbDurationSec->setSingleStep(60);
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(true); m_ui->sbHeight2SBox->setEnabled(true);
@@ -2315,7 +2315,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setValue(60); m_ui->sbDurationSec->setValue(60);
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
{ {
m_ui->lblRadiusBreite->setText(tr("Radius [m]")); m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2351,10 +2351,10 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
void ExplosionsEdit::onFireClicked() void ExplosionsEdit::onFireClicked()
{ {
TRACE_LOG(m_logger) << LOGFUNCTION << " START"; TRACE_LOG(m_logger) << LOGFUNCTION << " START";
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) || if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) ||
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) (m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived) || (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsFired) || (m_aesItem.effectStateId() == AesEffectState::EsFired)
) )
|| m_aesItem.id() <= 0) || m_aesItem.id() <= 0)
@@ -2375,7 +2375,7 @@ void ExplosionsEdit::onFireClicked()
const bool bIsObjectModifiable = m_explosionClusterData.isObjectModifiable(); const bool bIsObjectModifiable = m_explosionClusterData.isObjectModifiable();
if ((m_aesItem.effectStateId() == AesEffectState_def::EsCreated || m_aesItem.effectStateId() == AesEffectState_def::EsPrepared) && bIsObjectModifiable) if ((m_aesItem.effectStateId() == AesEffectState::EsCreated || m_aesItem.effectStateId() == AesEffectState::EsPrepared) && bIsObjectModifiable)
{ {
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + m_temporaryData.m_estimatedFlightDurationMsec + 5000); m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + m_temporaryData.m_estimatedFlightDurationMsec + 5000);
m_ui->dteEffectStart->setChecked(true); m_ui->dteEffectStart->setChecked(true);
@@ -2433,7 +2433,7 @@ void ExplosionsEdit::onFireClicked()
void ExplosionsEdit::onGearClassChanged() void ExplosionsEdit::onGearClassChanged()
{ {
const ProjectDataManagement::GearClass_def::type newGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt()); const ProjectDataManagement::GearClass newGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
{ {
QSignalBlocker sb(m_ui->cbChargeType); QSignalBlocker sb(m_ui->cbChargeType);
fillCharges(); fillCharges();
@@ -2441,10 +2441,10 @@ void ExplosionsEdit::onGearClassChanged()
fillParties(); fillParties();
onPartyChanged(); onPartyChanged();
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar; ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE); QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
if (!lastVal.isNull()) if (!lastVal.isNull())
lastGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(lastVal.toInt()); lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
{ {
@@ -2584,7 +2584,7 @@ void ExplosionsEdit::fillCharges()
return; return;
} }
const ProjectDataManagement::GearClass_def::type curGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt()); const ProjectDataManagement::GearClass curGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType); const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType);
const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt(); const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
@@ -2609,7 +2609,7 @@ void ExplosionsEdit::fillCharges()
DEBUG_LOG(m_logger) << " fillCharges" DEBUG_LOG(m_logger) << " fillCharges"
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano << ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano
<< ", impactRadius4Debug = " << impactRadius4Debug << ", isAdlerChargeType = " << isAdlerChargeType; << ", impactRadius4Debug = " << impactRadius4Debug << ", isAdlerChargeType = " << isAdlerChargeType;
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass_def::Artillery)) if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery))
continue; continue;
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id()); m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
} }
@@ -111,7 +111,7 @@ private Q_SLOTS:
void onEffectDurationChanged(int value); void onEffectDurationChanged(int value);
void switchTo(FlighDurationOrPeakHeight phfd); void switchTo(FlighDurationOrPeakHeight phfd);
void setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId); void setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool setValueAccordingContraints(int newValue, ExplosionsEdit::FlighDurationOrPeakHeight phfd); bool setValueAccordingContraints(int newValue, ExplosionsEdit::FlighDurationOrPeakHeight phfd);
bool isGuiVulcano(); bool isGuiVulcano();
@@ -88,11 +88,11 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
m_ui->setupUi(this); m_ui->setupUi(this);
m_geometrieButtonGroup = new QButtonGroup(this); m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)); m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea)); m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)); m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)); m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true); m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar}; m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
@@ -220,20 +220,20 @@ void ExplosionsEditAdler::showPreviewObject()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty()) if (m_previewPolygon.isEmpty())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
@@ -260,7 +260,7 @@ bool ExplosionsEditAdler::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull(); bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->lblDimensionYDepth->text().toInt() > 0; bHasTargetArea &= m_ui->lblDimensionYDepth->text().toInt() > 0;
bHasTargetArea &= m_ui->lblWidthRadius->text().toInt() > 0; bHasTargetArea &= m_ui->lblWidthRadius->text().toInt() > 0;
break; break;
@@ -290,7 +290,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
if (ecData.effectStart().is_set()) if (ecData.effectStart().is_set())
{ {
const QJsonObject propsObj(QJsonDocument::fromJson(QByteArray::fromStdString(ecData.properties())).object()); const QJsonObject propsObj(QJsonDocument::fromJson(QByteArray::fromStdString(ecData.properties())).object());
const FiringType firingType = static_cast<FiringType::inner_enum>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); const FiringType firingType = static_cast<FiringType>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
effectStart = ecData.effectStart().get(); effectStart = ecData.effectStart().get();
@@ -301,22 +301,22 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart); m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart);
// Geometry/Area // Geometry/Area
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying(); const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType) switch (geometryType)
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true); m_ui->geometrieAimPointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true); m_ui->geometriePointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true); m_ui->geometrieAreaBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true); m_ui->geometrieLineBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true); m_ui->geometrieRadialBtn->setChecked(true);
break; break;
default: default:
@@ -380,7 +380,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
m_esmActorCbx->fillActorComboBox(m_ui->cbActors_2, coordGeo, isSmoke, 0); m_esmActorCbx->fillActorComboBox(m_ui->cbActors_2, coordGeo, isSmoke, 0);
} }
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{ {
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height() / 2)))); m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height() / 2))));
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width() / 2)))); m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width() / 2))));
@@ -556,7 +556,7 @@ void ExplosionsEditAdler::enableUiElements(bool enable)
m_ui->rbAngleGroupLower->setEnabled(enable); m_ui->rbAngleGroupLower->setEnabled(enable);
m_ui->rbAngleGroupUpper->setEnabled(enable); m_ui->rbAngleGroupUpper->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived) if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
m_ui->pbStateChange->setEnabled(true); m_ui->pbStateChange->setEnabled(true);
else else
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire); m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
@@ -600,7 +600,7 @@ void ExplosionsEditAdler::setPbStateChangeName()
m_ui->pbStateChange->show(); m_ui->pbStateChange->show();
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived) if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
m_ui->pbStateChange->setText(tr("Acknowledge")); m_ui->pbStateChange->setText(tr("Acknowledge"));
else else
{ {
@@ -624,7 +624,7 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
// Re-Enable PB, so we can call it another time, if it does not react... // Re-Enable PB, so we can call it another time, if it does not react...
QTimer::singleShot(2000, [this]() { m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire); }); QTimer::singleShot(2000, [this]() { m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire); });
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived) if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
{ {
AreaEffectSimulation::AcknowledgeExternalAesItemRequest request; AreaEffectSimulation::AcknowledgeExternalAesItemRequest request;
request.aesId(m_aesItem.id()); request.aesId(m_aesItem.id());
@@ -758,7 +758,7 @@ void ExplosionsEditAdler::setEffectClusterDataFromJson(const std::string &proper
else else
m_ui->rbAngleGroupUpper->setChecked(true); m_ui->rbAngleGroupUpper->setChecked(true);
const FiringType &firingType = static_cast<FiringType::inner_enum>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt()); const FiringType &firingType = static_cast<FiringType>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
m_ui->lblFiringType->setText(AreaEffectSimulation::toString(firingType)); m_ui->lblFiringType->setText(AreaEffectSimulation::toString(firingType));
} }
@@ -67,7 +67,7 @@ static const char *const LAST_VALUE = "LAST_VALUE";
static QLatin1String emptyEntryComboBox = QLatin1String("--"); static QLatin1String emptyEntryComboBox = QLatin1String("--");
static const int ROLE_GEARTYPE_ID = Qt::UserRole + 1; static const int ROLE_GEARTYPE_ID = Qt::UserRole + 1;
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId) QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
// [GUEZE-2458] Minimaler und maximaler Abstand Feuereinheit Wirkeld Steilfeuer // [GUEZE-2458] Minimaler und maximaler Abstand Feuereinheit Wirkeld Steilfeuer
// Es soll zwischen dem Mittelpunkt der Feuereinheit und dem Mittelpunkt des zu bewirkenden Wirkfeldes folgender Abstand als Mindestabstand: // Es soll zwischen dem Mittelpunkt der Feuereinheit und dem Mittelpunkt des zu bewirkenden Wirkfeldes folgender Abstand als Mindestabstand:
@@ -85,17 +85,17 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataMana
static QHash<int, QPair<int, int>> contraintsDistance; static QHash<int, QPair<int, int>> contraintsDistance;
if (contraintsDistance.isEmpty()) if (contraintsDistance.isEmpty())
{ {
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000}); // Haubitze contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000}); // Haubitze
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800}); // Mörser contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800}); // Mörser
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {15000, 90000}); // Rakete // contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {15000, 90000}); // Rakete
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {10000, 38400}); // Minenrakete // contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {10000, 38400}); // Minenrakete
} }
static QHash<int, QPair<int, int>> contraintsDistanceVulcano; static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
if (contraintsDistanceVulcano.isEmpty()) if (contraintsDistanceVulcano.isEmpty())
{ {
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000}); // Haubitze contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000}); // Haubitze
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000}); // Rakete contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000}); // Rakete
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -111,16 +111,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataMana
return {0, 100000}; return {0, 100000};
return *it; return *it;
} }
int ExplosionsEditAdlerStandAlone::getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxDistance(gearClass, chargeTypeId).first; return getMinMaxDistance(gearClass, chargeTypeId).first;
} }
int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxDistance(gearClass, chargeTypeId).second; return getMinMaxDistance(gearClass, chargeTypeId).second;
} }
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
// [GUEZE-2460] Grenzwert Flugdauer Steilfeuer // [GUEZE-2460] Grenzwert Flugdauer Steilfeuer
// Haubitze: von 6 bis 150 Sekunden // Haubitze: von 6 bis 150 Sekunden
@@ -131,15 +131,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
static QHash<int, QPair<int, int>> contraintsFlightDuration; static QHash<int, QPair<int, int>> contraintsFlightDuration;
if (contraintsFlightDuration.isEmpty()) if (contraintsFlightDuration.isEmpty())
{ {
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150}); // Haubitze contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150}); // Haubitze
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60}); // Mörser contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60}); // Mörser
} }
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano; static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
if (contraintsFlightDurationVulcano.isEmpty()) if (contraintsFlightDurationVulcano.isEmpty())
{ {
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999}); // Haubitze contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999}); // Haubitze
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999}); // Rakete contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999}); // Rakete
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -155,16 +155,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
return {10, 100}; return {10, 100};
return *it; return *it;
} }
int ExplosionsEditAdlerStandAlone::getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first; return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first;
} }
int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second; return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second;
} }
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
// [GUEZE-2460] Grenzwert Flugdauer Steilfeuer // [GUEZE-2460] Grenzwert Flugdauer Steilfeuer
// Haubitze: von 250 bis 15000m // Haubitze: von 250 bis 15000m
@@ -175,15 +175,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
static QHash<int, QPair<int, int>> contraintsPeak; static QHash<int, QPair<int, int>> contraintsPeak;
if (contraintsPeak.isEmpty()) if (contraintsPeak.isEmpty())
{ {
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000}); // Haubitze contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000}); // Haubitze
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000}); // Mörser contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000}); // Mörser
} }
static QHash<int, QPair<int, int>> contraintsPeakVulcano; static QHash<int, QPair<int, int>> contraintsPeakVulcano;
if (contraintsPeakVulcano.isEmpty()) if (contraintsPeakVulcano.isEmpty())
{ {
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500}); // Haubitze contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500}); // Haubitze
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500}); // Rakete contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500}); // Rakete
} }
if (chargeTypeIdIsVulcano(chargeTypeId)) if (chargeTypeIdIsVulcano(chargeTypeId))
{ {
@@ -200,19 +200,19 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
return {100, 10000}; return {100, 10000};
return *it; return *it;
} }
int ExplosionsEditAdlerStandAlone::getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxPeakHeight(gearClass, chargeTypeId).first; return getMinMaxPeakHeight(gearClass, chargeTypeId).first;
} }
int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{ {
return getMinMaxPeakHeight(gearClass, chargeTypeId).second; return getMinMaxPeakHeight(gearClass, chargeTypeId).second;
} }
bool ExplosionsEditAdlerStandAlone::isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry) bool ExplosionsEditAdlerStandAlone::isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry)
{ {
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint) return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint)
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint); || (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint);
} }
/*! /*!
@@ -270,11 +270,11 @@ ExplosionsEditAdlerStandAlone::ExplosionsEditAdlerStandAlone(const QString &menu
headline->setAlignment(Qt::AlignCenter); headline->setAlignment(Qt::AlignCenter);
m_geometrieButtonGroup = new QButtonGroup(this); m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)); m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea)); m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)); m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)); m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true); m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar}; m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
@@ -506,8 +506,8 @@ bool ExplosionsEditAdlerStandAlone::init(int aesItemId, bool copy, LtsSession::L
m_ui->startBtn->setEnabled(false); m_ui->startBtn->setEnabled(false);
// initial adjustment: // initial adjustment:
m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea); m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea)); onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
// pay attention!!! firePurposeId vs purpose !!! // pay attention!!! firePurposeId vs purpose !!!
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose); m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
@@ -569,7 +569,7 @@ bool ExplosionsEditAdlerStandAlone::init(int aesItemId, bool copy, LtsSession::L
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
m_effectClusterData.id(m_aesItem.id()); m_effectClusterData.id(m_aesItem.id());
m_effectClusterData.effectStateId(m_aesItem.effectStateId()); m_effectClusterData.effectStateId(m_aesItem.effectStateId());
} }
@@ -624,22 +624,22 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
m_ui->leElement->setText(QString::fromStdString(ecData.element())); m_ui->leElement->setText(QString::fromStdString(ecData.element()));
// Geometry/Area // Geometry/Area
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying(); const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType) switch (geometryType)
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true); m_ui->geometrieAimPointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true); m_ui->geometriePointBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true); m_ui->geometrieAreaBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true); m_ui->geometrieLineBtn->setChecked(true);
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true); m_ui->geometrieRadialBtn->setChecked(true);
break; break;
default: default:
@@ -709,7 +709,7 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
// with firingType // with firingType
setEffectClusterDataFromJson(ecData.properties()); setEffectClusterDataFromJson(ecData.properties());
const FiringType::type firingType = static_cast<FiringType::type>(m_ui->cbFiringType->currentData().toInt()); const FiringType firingType = static_cast<FiringType>(m_ui->cbFiringType->currentData().toInt());
if (firingType == FiringType::FireWithIndicationTTF) if (firingType == FiringType::FireWithIndicationTTF)
{ {
// in case of TTF the dte will be set via the setEffectClusterDataFromJson function // in case of TTF the dte will be set via the setEffectClusterDataFromJson function
@@ -732,7 +732,7 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
setCoord(centerpoint); setCoord(centerpoint);
} }
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{ {
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2); m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2);
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2); m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
@@ -793,11 +793,11 @@ void ExplosionsEditAdlerStandAlone::onChargeTypeChanged()
FlighDurationOrPeakHeight phfd = FlighDurationOrPeakHeight::FDPH_peakHeight; FlighDurationOrPeakHeight phfd = FlighDurationOrPeakHeight::FDPH_peakHeight;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
setMinMaxConstraints(phfd, gearClassType, chargeTypeId); setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
// only for geometryType::Point: // only for geometryType::Point:
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint) if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
{ {
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt(); int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
int igniterFunctionId = m_ui->cbIgniterFunction->currentData().toInt(); int igniterFunctionId = m_ui->cbIgniterFunction->currentData().toInt();
@@ -915,7 +915,7 @@ void ExplosionsEditAdlerStandAlone::getPosition()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{ {
const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0); const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0);
const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -938,16 +938,16 @@ void ExplosionsEditAdlerStandAlone::getPosition()
return; return;
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr); m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{ {
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF()); m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
return; return;
} }
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_sitMapGuiIfc->getCircle(this, m_sitMapGuiIfc->getCircle(this,
SLOT(onCircleData(QPointF, double)), SLOT(onCircleData(QPointF, double)),
nullptr, nullptr,
@@ -1184,7 +1184,7 @@ void ExplosionsEditAdlerStandAlone::onFlightDurationChanged(int data)
void ExplosionsEditAdlerStandAlone::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QTime(0, 0).addSecs(value).toString(QStringLiteral("mm:ss"))); } void ExplosionsEditAdlerStandAlone::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QTime(0, 0).addSecs(value).toString(QStringLiteral("mm:ss"))); }
void ExplosionsEditAdlerStandAlone::setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd, void ExplosionsEditAdlerStandAlone::setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd,
ProjectDataManagement::GearClass_def::type gearClass, ProjectDataManagement::GearClass gearClass,
int chargeTypeId) int chargeTypeId)
{ {
DEBUG_LOG(m_logger) << " setMinMaxConstraints START"; DEBUG_LOG(m_logger) << " setMinMaxConstraints START";
@@ -1218,7 +1218,7 @@ bool ExplosionsEditAdlerStandAlone::setValueAccordingContraints(int newValue, Ex
bool bRet = false; bool bRet = false;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
const ProjectDataManagement::GearClass::type gearClass = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); const ProjectDataManagement::GearClass gearClass = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
switch (phfd) switch (phfd)
@@ -1269,7 +1269,7 @@ void ExplosionsEditAdlerStandAlone::switchTo(FlighDurationOrPeakHeight phfd)
} }
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
setMinMaxConstraints(phfd, gearClassType, chargeTypeId); setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
} }
@@ -1304,7 +1304,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
return; return;
// do not update while EsPause or similar: // do not update while EsPause or similar:
if ((m_effectClusterData.effectStateId() == AesEffectState_def::EsPaused) || (m_effectClusterData.effectStateId() == AesEffectState_def::EsExpired)) if ((m_effectClusterData.effectStateId() == AesEffectState::EsPaused) || (m_effectClusterData.effectStateId() == AesEffectState::EsExpired))
return; return;
doCalculationsAdlerStandAloneExitGuard exitGuard(this, executeEnableUiElements); doCalculationsAdlerStandAloneExitGuard exitGuard(this, executeEnableUiElements);
@@ -1506,7 +1506,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
// //
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt(); const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId); ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt(); const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
@@ -1784,7 +1784,7 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->cbParticipantUnits->setEnabled(enable); m_ui->cbParticipantUnits->setEnabled(enable);
setEffectStartEnabled(m_ui->dteEffectStart, enable); setEffectStartEnabled(m_ui->dteEffectStart, enable);
const AreaEffectSimulation::FiringType::type firingType = static_cast<AreaEffectSimulation::FiringType::type>(m_ui->cbFiringType->currentData().toInt()); const AreaEffectSimulation::FiringType firingType = static_cast<AreaEffectSimulation::FiringType>(m_ui->cbFiringType->currentData().toInt());
const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT); const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT);
m_ui->dteEffectStart->setChecked(true); m_ui->dteEffectStart->setChecked(true);
m_ui->dteEffectStart->setEnabled(showEffectStart); m_ui->dteEffectStart->setEnabled(showEffectStart);
@@ -1795,15 +1795,15 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->positionEdit->setEnabled(enable); m_ui->positionEdit->setEnabled(enable);
// m_ui->sbAltitude->setEnabled(enable); // m_ui->sbAltitude->setEnabled(enable);
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea && (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea); m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
m_ui->sbHeight1SBox->setEnabled(enable); m_ui->sbHeight1SBox->setEnabled(enable);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine); m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine);
m_ui->sbAimingAxis->setEnabled( m_ui->sbAimingAxis->setEnabled(
enable enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine)); && (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->cbFirePurpose->setEnabled(enable); m_ui->cbFirePurpose->setEnabled(enable);
m_ui->cbGearClass->setEnabled(enable); m_ui->cbGearClass->setEnabled(enable);
m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked()); m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked());
@@ -1837,7 +1837,7 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->cbTargetSubType->setEnabled(enable); m_ui->cbTargetSubType->setEnabled(enable);
m_ui->cbFiringType->setEnabled(enable); m_ui->cbFiringType->setEnabled(enable);
const bool isRocket = (m_ui->cbGearClass->currentData().toInt() == ProjectDataManagement::GearClass_def::Rocket); const bool isRocket = (m_ui->cbGearClass->currentData().toInt() == ProjectDataManagement::GearClass::Rocket);
m_ui->lblLoadType->setEnabled(!isRocket && enable); m_ui->lblLoadType->setEnabled(!isRocket && enable);
m_ui->lblLoadNumber->setEnabled(!isRocket && enable); m_ui->lblLoadNumber->setEnabled(!isRocket && enable);
m_ui->cbLoadType->setEnabled(!isRocket && enable); m_ui->cbLoadType->setEnabled(!isRocket && enable);
@@ -1856,8 +1856,8 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
// [GUEZE-2960] Explizite Kunden-Forderung: // [GUEZE-2960] Explizite Kunden-Forderung:
// ZpNumber nicht_ mehr modifizierbar, wenn Wirkfeld aktiv // ZpNumber nicht_ mehr modifizierbar, wenn Wirkfeld aktiv
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated); m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated); m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
@@ -1901,14 +1901,14 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
// // Munitionstyp "Mörser" muss die obere Winkelgruppe ausgewählt && die Eingabemaske "Flugkurve" soll ausgrauen. // // Munitionstyp "Mörser" muss die obere Winkelgruppe ausgewählt && die Eingabemaske "Flugkurve" soll ausgrauen.
// // Beim Wechsel auf einen anderen Munitionstyp soll wieder als Default die untere Winkelgruppe ausgewählt werden && // // Beim Wechsel auf einen anderen Munitionstyp soll wieder als Default die untere Winkelgruppe ausgewählt werden &&
// // die Eingabemaske muss wieder auswählbar sein. // // die Eingabemaske muss wieder auswählbar sein.
// const ProjectDataManagement::GearClass_def::type gearClassType = // const ProjectDataManagement::GearClass gearClassType =
// static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt()); // static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
// // const bool usePeakHeight = m_ui->sBox_peakHeight->styleSheet().isEmpty(); // // const bool usePeakHeight = m_ui->sBox_peakHeight->styleSheet().isEmpty();
// const bool useFlightDuration = m_ui->sBox_flightDuration->styleSheet().isEmpty(); // const bool useFlightDuration = m_ui->sBox_flightDuration->styleSheet().isEmpty();
// m_ui->cbFlightCurve->setEnabled(enable && // m_ui->cbFlightCurve->setEnabled(enable &&
// (gearClassType != ProjectDataManagement::GearClass_def::Mortar) && // (gearClassType != ProjectDataManagement::GearClass::Mortar) &&
// useFlightDuration // useFlightDuration
// ); // );
// } // }
@@ -1943,7 +1943,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
if (!enableBasics) if (!enableBasics)
return; // stay disabled return; // stay disabled
if (m_effectClusterData.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired || m_effectClusterData.remainExplosionNumber() == 0) if (m_effectClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired || m_effectClusterData.remainExplosionNumber() == 0)
return; // stay disabled return; // stay disabled
int numberTrajectoriesRef = 0; int numberTrajectoriesRef = 0;
@@ -2000,7 +2000,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
else else
{ {
// re-openening dialog: // re-openening dialog:
if (m_effectClusterData.effectStateId() == AesEffectState_def::EsPaused) if (m_effectClusterData.effectStateId() == AesEffectState::EsPaused)
bPause = false; bPause = false;
} }
} }
@@ -2040,24 +2040,24 @@ void ExplosionsEditAdlerStandAlone::showPreviewObject()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty()) if (m_previewPolygon.isEmpty())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius); m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false); m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return; return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull()) if (m_previewCircleCenter.isNull())
return; return;
@@ -2085,7 +2085,7 @@ bool ExplosionsEditAdlerStandAlone::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull(); bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0; bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0; bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
break; break;
@@ -2136,7 +2136,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AesExplosionGeometry_def::EgRadial: case AesExplosionGeometry::EgRadial:
{ {
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0)); QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0));
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()); bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
@@ -2147,7 +2147,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
break; break;
} }
case AesExplosionGeometry_def::EgLine: case AesExplosionGeometry::EgLine:
{ {
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate()); const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
@@ -2163,9 +2163,9 @@ bool ExplosionsEditAdlerStandAlone::apply()
break; break;
} }
case AesExplosionGeometry_def::EgAimPoint: case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry_def::EgArea: case AesExplosionGeometry::EgArea:
case AesExplosionGeometry_def::EgPoint: case AesExplosionGeometry::EgPoint:
default: default:
{ {
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -2180,7 +2180,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
} }
} }
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
request.area().rotation(0); request.area().rotation(0);
else else
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400); request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
@@ -2308,7 +2308,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
// Rocket-Spezifika: // Rocket-Spezifika:
const QVariant currentData = m_ui->cbGearClass->currentData(); const QVariant currentData = m_ui->cbGearClass->currentData();
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt()); const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket) if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{ {
RocketUtility::addRocketPropertiesToRequest(request, m_ppmDtc); RocketUtility::addRocketPropertiesToRequest(request, m_ppmDtc);
@@ -2327,7 +2327,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
*/ */
void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt) void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
{ {
const AreaEffectSimulation::AesExplosionGeometry::inner_enum newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry::inner_enum>(explosionGeometryInt); const AreaEffectSimulation::AesExplosionGeometry newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry>(explosionGeometryInt);
if (m_currentGeometry == newGeometry) if (m_currentGeometry == newGeometry)
return; return;
@@ -2353,8 +2353,8 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
switch (m_currentGeometry.underlying()) switch (m_currentGeometry.underlying())
{ {
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: // What is AimPoint? case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint: // What is AimPoint?
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint: case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2386,7 +2386,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
onChargeTypeChanged(); onChargeTypeChanged();
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea: case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2412,7 +2412,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setSingleStep(60); m_ui->sbDurationSec->setSingleStep(60);
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine: case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{ {
m_ui->lblRadiusBreite->setText(tr("Breite [m]")); m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(true); m_ui->sbHeight2SBox->setEnabled(true);
@@ -2437,7 +2437,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setValue(60); // 1 min m_ui->sbDurationSec->setValue(60); // 1 min
} }
break; break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial: case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
{ {
m_ui->lblRadiusBreite->setText(tr("Radius [m]")); m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
m_ui->sbHeight2SBox->setEnabled(false); m_ui->sbHeight2SBox->setEnabled(false);
@@ -2473,10 +2473,10 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
void ExplosionsEditAdlerStandAlone::onStartBtnClicked() void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
{ {
DEBUG_LOG(m_logger) << " onFireClicked"; DEBUG_LOG(m_logger) << " onFireClicked";
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) || // initially the effectStateId is Unknown... if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) || // initially the effectStateId is Unknown...
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) (m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived) || (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
// || (m_aesItem.effectStateId() == AesEffectState_def::EsPaused) // Maybe EsPaused will be supported in future // || (m_aesItem.effectStateId() == AesEffectState::EsPaused) // Maybe EsPaused will be supported in future
) )
|| m_aesItem.id() <= 0) || m_aesItem.id() <= 0)
return; return;
@@ -2498,7 +2498,7 @@ void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
// //
if ((m_aesItem.effectStateId() == AesEffectState_def::EsCreated || m_aesItem.effectStateId() == AesEffectState_def::EsPrepared) && bIsObjectModifiable) if ((m_aesItem.effectStateId() == AesEffectState::EsCreated || m_aesItem.effectStateId() == AesEffectState::EsPrepared) && bIsObjectModifiable)
{ {
ERROR_LOG(m_logger) << LOGFUNCTION << " onFireClicked 2 " << m_data; ERROR_LOG(m_logger) << LOGFUNCTION << " onFireClicked 2 " << m_data;
@@ -2564,7 +2564,7 @@ void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
*/ */
void ExplosionsEditAdlerStandAlone::onGearClassChanged() void ExplosionsEditAdlerStandAlone::onGearClassChanged()
{ {
const ProjectDataManagement::GearClass_def::type newGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt()); const ProjectDataManagement::GearClass newGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
{ {
QSignalBlocker sb(m_ui->cbChargeType); QSignalBlocker sb(m_ui->cbChargeType);
fillCharges(); fillCharges();
@@ -2572,10 +2572,10 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
fillParties(); fillParties();
onPartyChanged(); onPartyChanged();
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar; ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE); QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
if (!lastVal.isNull()) if (!lastVal.isNull())
lastGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(lastVal.toInt()); lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
{ {
// GUEZE-2459 // GUEZE-2459
@@ -2586,7 +2586,7 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
// Default is Upper // Default is Upper
m_ui->rbAngleGroupUpper->setChecked(true); m_ui->rbAngleGroupUpper->setChecked(true);
// GUEZE-3520: Aufraeumen -> getm rid of AesFlightCurve // GUEZE-3520: Aufraeumen -> getm rid of AesFlightCurve
if (newGearClassType == ProjectDataManagement::GearClass_def::Mortar) if (newGearClassType == ProjectDataManagement::GearClass::Mortar)
{ {
DEBUG_LOG(m_logger) << " onGearClassChanged switch to Mortar"; DEBUG_LOG(m_logger) << " onGearClassChanged switch to Mortar";
m_ui->rbAngleGroupLower->setCheckable(false); m_ui->rbAngleGroupLower->setCheckable(false);
@@ -2711,7 +2711,7 @@ bool ExplosionsEditAdlerStandAlone::isValidParty(qint32 partyId)
void ExplosionsEditAdlerStandAlone::setFireBtnState() void ExplosionsEditAdlerStandAlone::setFireBtnState()
{ {
const AreaEffectSimulation::FiringType::type firingType = static_cast<AreaEffectSimulation::FiringType::type>(m_ui->cbFiringType->currentData().toInt()); const AreaEffectSimulation::FiringType firingType = static_cast<AreaEffectSimulation::FiringType>(m_ui->cbFiringType->currentData().toInt());
const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT); const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT);
m_ui->dteEffectStart->setEnabled(showEffectStart); m_ui->dteEffectStart->setEnabled(showEffectStart);
m_ui->dteEffectStart->setVisible(showEffectStart); m_ui->dteEffectStart->setVisible(showEffectStart);
@@ -2793,7 +2793,7 @@ double ExplosionsEditAdlerStandAlone::getElevation(const double lon, const doubl
void ExplosionsEditAdlerStandAlone::onWidthChanged(int width) void ExplosionsEditAdlerStandAlone::onWidthChanged(int width)
{ {
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial) if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{ {
m_ui->sbDimensionY_Tiefe->setValue(width); m_ui->sbDimensionY_Tiefe->setValue(width);
@@ -2891,7 +2891,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
return; return;
} }
const ProjectDataManagement::GearClass_def::type curGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt()); const ProjectDataManagement::GearClass curGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType); const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType);
const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt(); const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
@@ -2916,7 +2916,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
DEBUG_LOG(m_logger) << " fillCharges" DEBUG_LOG(m_logger) << " fillCharges"
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano; << ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano;
if (adlerChargeTypeName.isEmpty() || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass_def::Artillery)) // [Jira E01562-21] if (adlerChargeTypeName.isEmpty() || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery)) // [Jira E01562-21]
continue; continue;
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id()); m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
} }
@@ -2934,7 +2934,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
void ExplosionsEditAdlerStandAlone::fillFiringTypCbox() void ExplosionsEditAdlerStandAlone::fillFiringTypCbox()
{ {
QVector<AreaEffectSimulation::FiringType::type> firetypes{FiringType::ReportReadyToFire, QVector<AreaEffectSimulation::FiringType> firetypes{FiringType::ReportReadyToFire,
FiringType::FireWithIndicationTOT, FiringType::FireWithIndicationTOT,
FiringType::FireWithIndicationTTF, FiringType::FireWithIndicationTTF,
FiringType::FireOnCommand, FiringType::FireOnCommand,
@@ -3047,7 +3047,7 @@ void ExplosionsEditAdlerStandAlone::mmiToJsonproperties(QJsonObject &data)
data[AdlerJson::JsonKeys::TYP()] = m_ui->cbTargetType->currentData().toInt(); data[AdlerJson::JsonKeys::TYP()] = m_ui->cbTargetType->currentData().toInt();
data[AdlerJson::JsonKeys::SUB_TYP()] = m_ui->cbTargetSubType->currentData().toInt(); data[AdlerJson::JsonKeys::SUB_TYP()] = m_ui->cbTargetSubType->currentData().toInt();
data[AdlerJson::JsonKeys::ABFEUERUNGSART()] = m_ui->cbFiringType->currentData().toInt(); data[AdlerJson::JsonKeys::ABFEUERUNGSART()] = m_ui->cbFiringType->currentData().toInt();
const FiringType::type firingType = static_cast<FiringType::type>(m_ui->cbFiringType->currentData().toInt()); const FiringType firingType = static_cast<FiringType>(m_ui->cbFiringType->currentData().toInt());
if (firingType == FiringType::FireWithIndicationTTF && m_ui->dteEffectStart->isChecked()) if (firingType == FiringType::FireWithIndicationTTF && m_ui->dteEffectStart->isChecked())
data[AdlerJson::JsonKeys::ABFEUERUNGSZEIT()] = m_ui->dteEffectStart->msecsSinceEpoch() / 1000.0; data[AdlerJson::JsonKeys::ABFEUERUNGSZEIT()] = m_ui->dteEffectStart->msecsSinceEpoch() / 1000.0;
else else
@@ -102,7 +102,7 @@ class ExplosionsEditAdlerStandAlone final
void onEffectDurationChanged(int value); void onEffectDurationChanged(int value);
void switchTo(FlighDurationOrPeakHeight phfd); void switchTo(FlighDurationOrPeakHeight phfd);
void setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId); void setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool setValueAccordingContraints(int newValue, ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd); bool setValueAccordingContraints(int newValue, ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd);
bool isGuiVulcano(); bool isGuiVulcano();
@@ -148,15 +148,15 @@ class ExplosionsEditAdlerStandAlone final
bool isSmoke(); bool isSmoke();
void updateActorComboBox(const Core::GeoPosition &coordGeo); void updateActorComboBox(const Core::GeoPosition &coordGeo);
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId); QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId); int getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry); bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry);
struct Charges struct Charges
@@ -27,7 +27,7 @@ namespace AreaEffectSimulation
namespace RocketUtility namespace RocketUtility
{ {
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type geometry) void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geometry)
{ {
if (wirkmittelCombobox == nullptr) if (wirkmittelCombobox == nullptr)
return; return;
@@ -39,13 +39,13 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
switch (geometry) switch (geometry)
{ {
case AesExplosionGeometry::type::EgAimPoint: case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::type::EgPoint: case AesExplosionGeometry::EgPoint:
case AesExplosionGeometry::type::EgLine: case AesExplosionGeometry::EgLine:
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter) for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter)
{ {
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter); const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt()); const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket) if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{ {
@@ -60,15 +60,15 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
} }
} }
return; return;
case AesExplosionGeometry::type::EgRadial: case AesExplosionGeometry::EgRadial:
case AesExplosionGeometry::type::EgArea: case AesExplosionGeometry::EgArea:
{ {
const int currentIndex = wirkmittelCombobox->currentIndex(); const int currentIndex = wirkmittelCombobox->currentIndex();
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter) for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter)
{ {
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter); const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt()); const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket) if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{ {
@@ -100,15 +100,15 @@ void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std
{ {
switch (request.explosionGeometry().underlying()) switch (request.explosionGeometry().underlying())
{ {
case AesExplosionGeometry::type::EgAimPoint: case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::type::EgPoint: case AesExplosionGeometry::EgPoint:
addRocketPropertiesForPointGeometry(request, ppmDtc); addRocketPropertiesForPointGeometry(request, ppmDtc);
return; return;
case AesExplosionGeometry::type::EgLine: case AesExplosionGeometry::EgLine:
addRocketPropertiesForLinearGeometry(request, ppmDtc); addRocketPropertiesForLinearGeometry(request, ppmDtc);
return; return;
case AesExplosionGeometry::type::EgRadial: case AesExplosionGeometry::EgRadial:
case AesExplosionGeometry::type::EgArea: case AesExplosionGeometry::EgArea:
default: default:
return; return;
} }
@@ -23,7 +23,7 @@ class EffectClusterModifyRequest;
namespace RocketUtility namespace RocketUtility
{ {
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type geometry); void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geometry);
void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc); void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc); void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc); void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
@@ -163,7 +163,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
const FunctionalAreaType type = m_functionalAreaTypes.value(m_ui->cbFunctionalAreaType->currentData().toInt()); const FunctionalAreaType type = m_functionalAreaTypes.value(m_ui->cbFunctionalAreaType->currentData().toInt());
if (type.supplyMode() == AesOperatingMode_def::OmWaitingTime) if (type.supplyMode() == AesOperatingMode::OmWaitingTime)
{ {
DEBUG_LOG(m_logger) << "SUPPLY-MODE"; DEBUG_LOG(m_logger) << "SUPPLY-MODE";
m_ui->sbDecontaminationMinutes->setEnabled(false); m_ui->sbDecontaminationMinutes->setEnabled(false);
@@ -209,17 +209,17 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
m_ui->sbWidth->setEnabled(enable); m_ui->sbWidth->setEnabled(enable);
const bool deconAvailable = type.deconMode() != AesOperatingMode_def::OmNotAvailable; const bool deconAvailable = type.deconMode() != AesOperatingMode::OmNotAvailable;
const bool maintAvailable = type.maintMode() != AesOperatingMode_def::OmNotAvailable; const bool maintAvailable = type.maintMode() != AesOperatingMode::OmNotAvailable;
const bool medicAvailable = type.medicMode() != AesOperatingMode_def::OmNotAvailable; const bool medicAvailable = type.medicMode() != AesOperatingMode::OmNotAvailable;
m_ui->cbDecontamination->setEnabled(enable && deconAvailable); m_ui->cbDecontamination->setEnabled(enable && deconAvailable);
m_ui->cbMaintenance->setEnabled(enable && maintAvailable); m_ui->cbMaintenance->setEnabled(enable && maintAvailable);
m_ui->cbMedical->setEnabled(enable && medicAvailable); m_ui->cbMedical->setEnabled(enable && medicAvailable);
m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && deconAvailable); m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && deconAvailable);
m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && maintAvailable); m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && maintAvailable);
m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && medicAvailable); m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && medicAvailable);
m_ui->sbSupplyMinutes->setEnabled(false); m_ui->sbSupplyMinutes->setEnabled(false);
m_ui->sbSupplyMinutes->setValue(0); m_ui->sbSupplyMinutes->setValue(0);
m_ui->cbSupply->setCurrentIndex(0); m_ui->cbSupply->setCurrentIndex(0);
@@ -244,7 +244,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
m_ui->pbClearPointSymbol->setEnabled(isGenericFunctionalArea); m_ui->pbClearPointSymbol->setEnabled(isGenericFunctionalArea);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
@@ -252,7 +252,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
setUnchangeable(); setUnchangeable();
disableButtons(true); disableButtons(true);
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->functionalArea(m_aesItem.id()); auto baseData = m_dtc->functionalArea(m_aesItem.id());
@@ -327,7 +327,7 @@ void FunctionalAreaEdit::setData(const FunctionalArea &area, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(area.name())); m_ui->leIdentifier->setText(QString::fromStdString(area.name()));
@@ -394,19 +394,19 @@ void FunctionalAreaEdit::fillCbx()
QString byOperator = tr("by operator"); QString byOperator = tr("by operator");
QString bytimeout = tr("by wait time"); QString bytimeout = tr("by wait time");
m_ui->cbDecontamination->addItem(unused, AesOperatingMode_def::OmNotUsed); m_ui->cbDecontamination->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode_def::OmObserver); m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime); m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbMaintenance->addItem(unused, AesOperatingMode_def::OmNotUsed); m_ui->cbMaintenance->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode_def::OmObserver); m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime); m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbMedical->addItem(unused, AesOperatingMode_def::OmNotUsed); m_ui->cbMedical->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbMedical->addItem(byOperator, AesOperatingMode_def::OmObserver); m_ui->cbMedical->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbMedical->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime); m_ui->cbMedical->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbSupply->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime); m_ui->cbSupply->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
if (curIdxDeconCbx >= 0) if (curIdxDeconCbx >= 0)
@@ -450,22 +450,22 @@ void FunctionalAreaEdit::onRectData(const QPointF &centerPoint, double width, do
void FunctionalAreaEdit::onCbxIdxDeconChanged() void FunctionalAreaEdit::onCbxIdxDeconChanged()
{ {
m_ui->sbDecontaminationMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()); m_ui->sbDecontaminationMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt());
} }
void FunctionalAreaEdit::onCbxIdxMaintChanged() void FunctionalAreaEdit::onCbxIdxMaintChanged()
{ {
m_ui->sbMaintanenceMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()); m_ui->sbMaintanenceMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt());
} }
void FunctionalAreaEdit::onCbxIdxMedicChanged() void FunctionalAreaEdit::onCbxIdxMedicChanged()
{ {
m_ui->sbMedicalMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()); m_ui->sbMedicalMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt());
} }
void FunctionalAreaEdit::onCbxIdxSupplyChanged() void FunctionalAreaEdit::onCbxIdxSupplyChanged()
{ {
m_ui->sbSupplyMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbSupply->currentData().toInt()); m_ui->sbSupplyMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbSupply->currentData().toInt());
} }
void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged() void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged()
@@ -488,9 +488,9 @@ void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged()
m_ui->sbDecontaminationMinutes->setValue(type.deconTime()); m_ui->sbDecontaminationMinutes->setValue(type.deconTime());
m_ui->sbMaintanenceMinutes->setValue(type.maintTime()); m_ui->sbMaintanenceMinutes->setValue(type.maintTime());
m_ui->sbMedicalMinutes->setValue(type.medicTime()); m_ui->sbMedicalMinutes->setValue(type.medicTime());
m_ui->cbDecontamination->setCurrentIndex(m_ui->cbDecontamination->findData(type.deconMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.deconMode().underlying())); m_ui->cbDecontamination->setCurrentIndex(m_ui->cbDecontamination->findData(type.deconMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.deconMode().underlying()));
m_ui->cbMaintenance->setCurrentIndex(m_ui->cbMaintenance->findData(type.maintMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.maintMode().underlying())); m_ui->cbMaintenance->setCurrentIndex(m_ui->cbMaintenance->findData(type.maintMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.maintMode().underlying()));
m_ui->cbMedical->setCurrentIndex(m_ui->cbMedical->findData(type.medicMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.medicMode().underlying())); m_ui->cbMedical->setCurrentIndex(m_ui->cbMedical->findData(type.medicMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.medicMode().underlying()));
} }
} }
enableUiElements(true); enableUiElements(true);
@@ -613,32 +613,32 @@ bool FunctionalAreaEdit::apply()
int functionalAreaType = m_ui->cbFunctionalAreaType->currentData().toInt(); int functionalAreaType = m_ui->cbFunctionalAreaType->currentData().toInt();
int playerId = 0; int playerId = 0;
const auto pointSymbol = m_sidc.toStdString(); const auto pointSymbol = m_sidc.toStdString();
AesOperatingMode deconMode = static_cast<AesOperatingMode_def::type>(m_ui->cbDecontamination->currentData().toInt()); AesOperatingMode deconMode = static_cast<AesOperatingMode>(m_ui->cbDecontamination->currentData().toInt());
int deconTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()) ? 1000 * 60 * m_ui->sbDecontaminationMinutes->value() : 0; int deconTime = (AesOperatingMode::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()) ? 1000 * 60 * m_ui->sbDecontaminationMinutes->value() : 0;
AesOperatingMode maintMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMaintenance->currentData().toInt()); AesOperatingMode maintMode = static_cast<AesOperatingMode>(m_ui->cbMaintenance->currentData().toInt());
int maintTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()) ? 1000 * 60 * m_ui->sbMaintanenceMinutes->value() : 0; int maintTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()) ? 1000 * 60 * m_ui->sbMaintanenceMinutes->value() : 0;
AesOperatingMode medicMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMedical->currentData().toInt()); AesOperatingMode medicMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
int medicTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0; int medicTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
AesOperatingMode supplyMode = static_cast<AesOperatingMode_def::type>(m_ui->cbSupply->currentData().toInt()); AesOperatingMode supplyMode = static_cast<AesOperatingMode>(m_ui->cbSupply->currentData().toInt());
if ( functionalAreaType != 7 ) if ( functionalAreaType != 7 )
supplyMode = AesOperatingMode_def::OmNotUsed; supplyMode = AesOperatingMode::OmNotUsed;
int supplyTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbSupply->currentData().toInt()) ? 1000 * 60 * m_ui->sbSupplyMinutes->value() : 0; int supplyTime = (AesOperatingMode::OmWaitingTime == m_ui->cbSupply->currentData().toInt()) ? 1000 * 60 * m_ui->sbSupplyMinutes->value() : 0;
AesOperatingMode notfightMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMedical->currentData().toInt()); AesOperatingMode notfightMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
int notfightTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0; int notfightTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
if ( functionalAreaType == 7 ) if ( functionalAreaType == 7 )
{ {
deconMode = AesOperatingMode_def::OmNotUsed; deconMode = AesOperatingMode::OmNotUsed;
maintMode = AesOperatingMode_def::OmNotUsed; maintMode = AesOperatingMode::OmNotUsed;
medicMode = AesOperatingMode_def::OmNotUsed; medicMode = AesOperatingMode::OmNotUsed;
notfightMode = AesOperatingMode_def::OmNotUsed; notfightMode = AesOperatingMode::OmNotUsed;
} }
if ( functionalAreaType == 8 ) if ( functionalAreaType == 8 )
{ {
deconMode = AesOperatingMode_def::OmNotUsed; deconMode = AesOperatingMode::OmNotUsed;
maintMode = AesOperatingMode_def::OmNotUsed; maintMode = AesOperatingMode::OmNotUsed;
medicMode = AesOperatingMode_def::OmNotUsed; medicMode = AesOperatingMode::OmNotUsed;
supplyMode = AesOperatingMode_def::OmNotUsed; supplyMode = AesOperatingMode::OmNotUsed;
notfightMode = AesOperatingMode_def::OmObserver; notfightMode = AesOperatingMode::OmObserver;
} }
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(), QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(),
@@ -649,7 +649,7 @@ bool FunctionalAreaEdit::apply()
const Area area(bottomLeftGeo, m_ui->sbWidth->value(), m_ui->sbHeight->value(), 0.0); const Area area(bottomLeftGeo, m_ui->sbWidth->value(), m_ui->sbHeight->value(), 0.0);
const ::dds::core::optional< int32_t > participantIdOpt = LtsUtils::toOptional(playerId); const ::dds::core::optional< int32_t > participantIdOpt = LtsUtils::toOptional(playerId);
if (supplyMode == AesOperatingMode_def::OmWaitingTime) if (supplyMode == AesOperatingMode::OmWaitingTime)
{ {
partyId = 0; partyId = 0;
playerId = m_participant.id(); playerId = m_participant.id();
@@ -76,12 +76,12 @@ void GasPipeEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->cbParty->setEnabled(enable); m_ui->cbParty->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->gasPipe(m_aesItem.id()); auto baseData = m_dtc->gasPipe(m_aesItem.id());
@@ -136,7 +136,7 @@ void GasPipeEdit::setData(const GasPipe &aesItem, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->sbWidth->setValue(aesItem.width()); m_ui->sbWidth->setValue(aesItem.width());
@@ -114,12 +114,12 @@ void MineAreaEdit::enableUiElements(bool enable)
else else
m_ui->pbResetDusMines->hide(); m_ui->pbResetDusMines->hide();
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->mineArea(m_aesItem.id()); auto baseData = m_dtc->mineArea(m_aesItem.id());
@@ -193,10 +193,10 @@ bool MineAreaEdit::init(int aesItemId, bool copy,
m_ui->cbDurationHours->setCurrentIndex(m_ui->cbDurationHours->findData(96)); m_ui->cbDurationHours->setCurrentIndex(m_ui->cbDurationHours->findData(96));
if (strcmp(PROJECTBUILD, "guez") == 0) if (strcmp(PROJECTBUILD, "guez") == 0)
m_ui->cbLayingProcedure->addItem(tr("Artillery"), AesMaLayingProcedureType_def::LptArtillery); m_ui->cbLayingProcedure->addItem(tr("Artillery"), AesMaLayingProcedureType::LptArtillery);
m_ui->cbLayingProcedure->addItem(tr("Pioneer"), AesMaLayingProcedureType_def::LptPioneer); m_ui->cbLayingProcedure->addItem(tr("Pioneer"), AesMaLayingProcedureType::LptPioneer);
m_ui->cbLayingProcedure->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType_def::LptPioneer)); m_ui->cbLayingProcedure->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType::LptPioneer));
m_ui->cbLayingMethod->addItem(tr("Open"), 0); m_ui->cbLayingMethod->addItem(tr("Open"), 0);
m_ui->cbLayingMethod->addItem(tr("Covered"), 1); m_ui->cbLayingMethod->addItem(tr("Covered"), 1);
@@ -246,7 +246,7 @@ void MineAreaEdit::setData(const MineArea &data, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromUtf8(data.name().c_str())); m_ui->leIdentifier->setText(QString::fromUtf8(data.name().c_str()));
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(data.chargeStruct().chargeTypeId())); m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(data.chargeStruct().chargeTypeId()));
@@ -323,7 +323,7 @@ void MineAreaEdit::getPosition()
double width = m_ui->sbWidth->value(); double width = m_ui->sbWidth->value();
int maxSegments = m_segments; int maxSegments = m_segments;
if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType_def::LptArtillery) if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType::LptArtillery)
maxSegments = 1; maxSegments = 1;
@@ -380,7 +380,7 @@ bool MineAreaEdit::apply()
std::string name = m_ui->leIdentifier->text().toStdString(); std::string name = m_ui->leIdentifier->text().toStdString();
int chargeTypeId = m_ui->cbChargeType->currentData().toInt(); int chargeTypeId = m_ui->cbChargeType->currentData().toInt();
s_lastChargeType = chargeTypeId; s_lastChargeType = chargeTypeId;
AesMaLayingProcedureType layingProcedureType = static_cast<AesMaLayingProcedureType_def::type>(m_ui->cbLayingProcedure->currentData().toInt()); AesMaLayingProcedureType layingProcedureType = static_cast<AesMaLayingProcedureType>(m_ui->cbLayingProcedure->currentData().toInt());
bool isLaidHidden = m_ui->cbLayingMethod->currentData().toInt() != 0; bool isLaidHidden = m_ui->cbLayingMethod->currentData().toInt() != 0;
int partyId = m_ui->cbParty->currentData().toInt(); int partyId = m_ui->cbParty->currentData().toInt();
int playerId = 0; int playerId = 0;
@@ -429,7 +429,7 @@ bool MineAreaEdit::apply()
void MineAreaEdit::onLayingProcedureChanged() void MineAreaEdit::onLayingProcedureChanged()
{ {
const bool islptArtillery = m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType_def::LptArtillery; const bool islptArtillery = m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType::LptArtillery;
if (islptArtillery) if (islptArtillery)
m_pdmGuiIfc->setChargeTypePropertyFilter(m_ui->cbChargeType, QStringLiteral("canBeThrown"), true); m_pdmGuiIfc->setChargeTypePropertyFilter(m_ui->cbChargeType, QStringLiteral("canBeThrown"), true);
else else
@@ -76,12 +76,12 @@ void MineCorridorEdit::enableUiElements(bool enable)
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->mineCorridor(m_aesItem.id()); auto baseData = m_dtc->mineCorridor(m_aesItem.id());
@@ -134,7 +134,7 @@ void MineCorridorEdit::setData(const MineCorridor &aesItem, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->sbWidth->setValue(aesItem.width()); m_ui->sbWidth->setValue(aesItem.width());
@@ -126,12 +126,12 @@ void BoobyTrapEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->boobyTrap(m_aesItem.id()); auto baseData = m_dtc->boobyTrap(m_aesItem.id());
@@ -225,7 +225,7 @@ void BoobyTrapEdit::setData(const BoobyTrap &bt, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(bt.name())); m_ui->leIdentifier->setText(QString::fromStdString(bt.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(bt.effectStart().is_set() ? bt.effectStart().get() : 0); m_ui->dteEffectStart->setMsecsSinceEpoch(bt.effectStart().is_set() ? bt.effectStart().get() : 0);
@@ -176,12 +176,12 @@ void OffRouteMineEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->offRouteMine(m_aesItem.id()); auto baseData = m_dtc->offRouteMine(m_aesItem.id());
@@ -249,7 +249,7 @@ void OffRouteMineEdit::setData(const OffRouteMine &orm, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
const Area &area = orm.area(); const Area &area = orm.area();
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) || if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) ||
@@ -157,9 +157,9 @@ void NContaminationEdit::onWeatherChanged(int index )
{ {
Q_UNUSED(index); Q_UNUSED(index);
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt()); AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic || if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic) weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
{ {
m_ui->rotationAngleEdit->showSpinbox(1, false); m_ui->rotationAngleEdit->showSpinbox(1, false);
m_ui->stackedWidget->setCurrentWidget(m_ui->lbAngle); m_ui->stackedWidget->setCurrentWidget(m_ui->lbAngle);
@@ -182,9 +182,9 @@ void NContaminationEdit::setRadials(double direction, double spanAngle)
double radial1 = direction - (fabs(spanAngle) / 2.0); double radial1 = direction - (fabs(spanAngle) / 2.0);
double radial2 = direction + (fabs(spanAngle) / 2.0); double radial2 = direction + (fabs(spanAngle) / 2.0);
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt()); AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic || if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic) weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
{ {
radial1 = spanAngle; radial1 = spanAngle;
} }
@@ -202,7 +202,7 @@ double NContaminationEdit::spanAngle() const
double radial2 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(1), LtsAngleEditBase::AngleUnitType::Deg, double radial2 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(1), LtsAngleEditBase::AngleUnitType::Deg,
m_ui->rotationAngleEdit->getAngleCurrentUnit()); m_ui->rotationAngleEdit->getAngleCurrentUnit());
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource_def::AwsNone) if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource::AwsNone)
return radial1; return radial1;
double spanAngle = radial2 - radial1; double spanAngle = radial2 - radial1;
@@ -213,7 +213,7 @@ double NContaminationEdit::spanAngle() const
double NContaminationEdit::rotatianAngle() const double NContaminationEdit::rotatianAngle() const
{ {
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource_def::AwsNone) if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource::AwsNone)
return 0.0; return 0.0;
double radial1 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(0), LtsAngleEditBase::AngleUnitType::Deg, double radial1 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(0), LtsAngleEditBase::AngleUnitType::Deg,
@@ -244,12 +244,12 @@ void NContaminationEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->cbWeather->setEnabled(enable); m_ui->cbWeather->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->nContamination(m_aesItem.id()); auto baseData = m_dtc->nContamination(m_aesItem.id());
@@ -322,7 +322,7 @@ void NContaminationEdit::setData(const NContamination &contamination, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name())); m_ui->leIdentifier->setText(QString::fromStdString(contamination.name()));
@@ -385,7 +385,7 @@ bool NContaminationEdit::apply()
int partyId = 0; int partyId = 0;
int playerId = 0; int playerId = 0;
AesWeatherSource weatherSourceId = static_cast<AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt()); AesWeatherSource weatherSourceId = static_cast<AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
const QPointF p(m_ui->positionEdit->coordinate()); const QPointF p(m_ui->positionEdit->coordinate());
const Core::GeoPosition2D pos(p.x(), p.y()); const Core::GeoPosition2D pos(p.x(), p.y());
const NContaminationModifyRequest req(m_aesItem.id(), const NContaminationModifyRequest req(m_aesItem.id(),
@@ -81,12 +81,12 @@ void TechnicalAreaEdit::enableUiElements(bool enable)
m_ui->sbWidth->setEnabled(enable); m_ui->sbWidth->setEnabled(enable);
m_ui->pbClear->setEnabled(enable); m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable()); m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired) if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{ {
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name())); m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__(); __unchange__();
} }
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated) if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{ {
QString name = m_ui->leIdentifier->text(); QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->technicalArea(m_aesItem.id()); auto baseData = m_dtc->technicalArea(m_aesItem.id());
@@ -137,7 +137,7 @@ void TechnicalAreaEdit::setData(const TechnicalArea &area, bool copy)
if (copy) if (copy)
{ {
m_aesItem.id(0); m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default()); m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
} }
m_ui->leIdentifier->setText(QString::fromStdString(area.name())); m_ui->leIdentifier->setText(QString::fromStdString(area.name()));
m_ui->sbWidth->setValue(area.area().width()); m_ui->sbWidth->setValue(area.area().width());
@@ -161,9 +161,9 @@ inline void TechnicalAreaEdit::fillCbx()
m_ui->cbType->clear(); m_ui->cbType->clear();
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType_def::TatMout), AesTechnicalAreaType_def::TatMout); m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType::TatMout), AesTechnicalAreaType::TatMout);
if ( enableSoundZones ) if ( enableSoundZones )
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType_def::TatSoundZone), AesTechnicalAreaType_def::TatSoundZone); m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType::TatSoundZone), AesTechnicalAreaType::TatSoundZone);
@@ -204,7 +204,7 @@ void TechnicalAreaEdit::onRectData(const QPointF &centerPoint, double width, dou
bool TechnicalAreaEdit::apply() bool TechnicalAreaEdit::apply()
{ {
std::string name = m_ui->leIdentifier->text().toStdString(); std::string name = m_ui->leIdentifier->text().toStdString();
AesTechnicalAreaType type = static_cast<AesTechnicalAreaType::inner_enum>(m_ui->cbType->currentData().toInt()); AesTechnicalAreaType type = static_cast<AesTechnicalAreaType>(m_ui->cbType->currentData().toInt());
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(), QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(),
m_ui->sbWidth->value(), m_ui->sbWidth->value(),
m_ui->sbHeight->value(), m_ui->sbHeight->value(),
@@ -111,7 +111,7 @@ void EditCombatNetRadioDialog::setUiValues(const CnrConfig& cnrConfig)
m_ui->chkGlobal->setChecked(m_isGlobal); m_ui->chkGlobal->setChecked(m_isGlobal);
initCbChannels(cnrConfig.cnrChannelId()); initCbChannels(cnrConfig.cnrChannelId());
bool disableParty = bool disableParty =
(m_avmDtc->cnrChannel(cnrConfig.cnrChannelId()).frequencyBand() == FrequencyBand_def::REL) || m_isGlobal; (m_avmDtc->cnrChannel(cnrConfig.cnrChannelId()).frequencyBand() == FrequencyBand::REL) || m_isGlobal;
if (!disableParty) if (!disableParty)
{ {
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(cnrConfig.partyId())); m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(cnrConfig.partyId()));
@@ -492,7 +492,7 @@ void EditCombatNetRadioDialog::onChannelChanged(int index)
{ {
int channelId = m_ui->cbChannel->itemData(index).toInt(); int channelId = m_ui->cbChannel->itemData(index).toInt();
bool disableParty = (m_avmDtc->cnrChannel(channelId).frequencyBand() == FrequencyBand_def::REL) || m_isGlobal; bool disableParty = (m_avmDtc->cnrChannel(channelId).frequencyBand() == FrequencyBand::REL) || m_isGlobal;
m_ui->cbUnit->setDisabled(disableParty); m_ui->cbUnit->setDisabled(disableParty);
m_ui->lbUnit->setDisabled(disableParty); m_ui->lbUnit->setDisabled(disableParty);
m_ui->cbParty->setDisabled(disableParty); m_ui->cbParty->setDisabled(disableParty);
@@ -73,10 +73,10 @@ bool EditFrequencyPlanningResourceDataModel::isFiltered(const AudioVideoManageme
DataModification modType) const DataModification modType) const
{ {
if (m_frequencyBand != FrequencyBand_def::REL && data.frequencyBand() != m_frequencyBand) if (m_frequencyBand != FrequencyBand::REL && data.frequencyBand() != m_frequencyBand)
return true; return true;
if (m_frequencyBand == FrequencyBand_def::REL && data.frequencyBand() != FrequencyBand_def::VHF) if (m_frequencyBand == FrequencyBand::REL && data.frequencyBand() != FrequencyBand::VHF)
return true; return true;
Q_UNUSED(modType); Q_UNUSED(modType);
@@ -45,12 +45,12 @@ EditFrequencyPlanningSetResourceDialog::EditFrequencyPlanningSetResourceDialog(
for (const auto &it : dataVec) for (const auto &it : dataVec)
{ {
if((operatingMode == RcOperatingMode_def::AkwEncEccm || if((operatingMode == RcOperatingMode::AkwEncEccm ||
operatingMode == RcOperatingMode_def::AkwEncNone) operatingMode == RcOperatingMode::AkwEncNone)
&& it.akwRadioCircuit() == 0) && it.akwRadioCircuit() == 0)
continue; continue;
if((operatingMode != RcOperatingMode_def::AkwEncEccm && if((operatingMode != RcOperatingMode::AkwEncEccm &&
operatingMode != RcOperatingMode_def::AkwEncNone) operatingMode != RcOperatingMode::AkwEncNone)
&& it.akwRadioCircuit() != 0) && it.akwRadioCircuit() != 0)
continue; continue;
m_frequencyResourceDataModel->insertRow(it); m_frequencyResourceDataModel->insertRow(it);
@@ -103,7 +103,7 @@ class FrequencyPlanningDialog : public LtsWidgets::LtsDialog,
void setButtonSetActivePlanningEnabled(); void setButtonSetActivePlanningEnabled();
static void setBackgroundColor(QWidget* w, Qt::GlobalColor color, bool bSetColor); static void setBackgroundColor(QWidget* w, Qt::GlobalColor color, bool bSetColor);
void setStatus(const QString& statusText, const QString& requester, qint64 timeStampMsecs, void setStatus(const QString& statusText, const QString& requester, qint64 timeStampMsecs,
TransmissionReason reason = TransmissionReason_def::TR_Unknown, Qt::GlobalColor color = Qt::black); TransmissionReason reason = TransmissionReason::TR_Unknown, Qt::GlobalColor color = Qt::black);
void tableColumnOrganiserSetting() override; void tableColumnOrganiserSetting() override;
private: private:
@@ -23,9 +23,9 @@ FrequencyPlanningWidget::FrequencyPlanningWidget(const std::shared_ptr<Interface
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::VHF), FrequencyBand_def::VHF); m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::VHF), FrequencyBand::VHF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::HF), FrequencyBand_def::HF); m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::HF), FrequencyBand::HF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::UHF), FrequencyBand_def::UHF); m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::UHF), FrequencyBand::UHF);
connect(m_ui->leName, &QLineEdit::textChanged, this, &FrequencyPlanningWidget::onNameChanged); connect(m_ui->leName, &QLineEdit::textChanged, this, &FrequencyPlanningWidget::onNameChanged);
connect(m_ui->cbFrequencyBand, qOverload<int>(&QComboBox::currentIndexChanged), this, connect(m_ui->cbFrequencyBand, qOverload<int>(&QComboBox::currentIndexChanged), this,
@@ -51,15 +51,15 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
switch (ft.underlying()) switch (ft.underlying())
{ {
case FrequencyBand_def::HF: { case FrequencyBand::HF: {
createHFWidget(data); createHFWidget(data);
break; break;
} }
case FrequencyBand_def::UHF: { case FrequencyBand::UHF: {
createUHFWidget(data); createUHFWidget(data);
break; break;
} }
case FrequencyBand_def::VHF: { case FrequencyBand::VHF: {
createVHFWidget(data); createVHFWidget(data);
break; break;
} }
@@ -72,13 +72,13 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
m_ui->lbxFrequencyBand->setVisible(true); m_ui->lbxFrequencyBand->setVisible(true);
switch (ft.underlying()) switch (ft.underlying())
{ {
case FrequencyBand_def::HF: case FrequencyBand::HF:
createHFWidget(data); createHFWidget(data);
break; break;
case FrequencyBand_def::UHF: case FrequencyBand::UHF:
createUHFWidget(data); createUHFWidget(data);
break; break;
case FrequencyBand_def::VHF: case FrequencyBand::VHF:
createVHFWidget(data); createVHFWidget(data);
break; break;
default: default:
@@ -117,7 +117,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool restrict)
{ {
if (restrict) if (restrict)
{ {
m_ui->cbFrequencyBand->setCurrentIndex(m_ui->cbFrequencyBand->findData(FrequencyBand_def::VHF)); m_ui->cbFrequencyBand->setCurrentIndex(m_ui->cbFrequencyBand->findData(FrequencyBand::VHF));
m_ui->cbFrequencyBand->setEnabled(false); m_ui->cbFrequencyBand->setEnabled(false);
} }
else else
@@ -129,7 +129,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool restrict)
QJsonObject FrequencyPlanningWidget::toJson() const QJsonObject FrequencyPlanningWidget::toJson() const
{ {
return frequencyPlanningJson(m_radioSpecificaWidget->toJson(), m_ui->leName->text(), return frequencyPlanningJson(m_radioSpecificaWidget->toJson(), m_ui->leName->text(),
static_cast<FrequencyBand::inner_enum>(m_ui->cbFrequencyBand->currentData().toInt()), static_cast<FrequencyBand>(m_ui->cbFrequencyBand->currentData().toInt()),
m_ui->cbRadioStation->currentData().toInt()); m_ui->cbRadioStation->currentData().toInt());
} }
@@ -152,13 +152,13 @@ void FrequencyPlanningWidget::onFrequencyBandChanged()
{ {
switch (m_ui->cbFrequencyBand->currentData().toInt()) switch (m_ui->cbFrequencyBand->currentData().toInt())
{ {
case FrequencyBand_def::HF: case FrequencyBand::HF:
createHFWidget(); createHFWidget();
break; break;
case FrequencyBand_def::UHF: case FrequencyBand::UHF:
createUHFWidget(); createUHFWidget();
break; break;
case FrequencyBand_def::VHF: case FrequencyBand::VHF:
createVHFWidget(); createVHFWidget();
break; break;
} }
@@ -44,7 +44,7 @@ public:
FrequencyPlanningWidget(const std::shared_ptr<Interface::Dtc> &avmDtc, QSet<int> &allocatedDataSets, QWidget *parent = nullptr); FrequencyPlanningWidget(const std::shared_ptr<Interface::Dtc> &avmDtc, QSet<int> &allocatedDataSets, QWidget *parent = nullptr);
~FrequencyPlanningWidget(); ~FrequencyPlanningWidget();
bool init(LtsSession::LtsSession *session, RadioCircuit *data, const CnrConfig &cnrConfigId, int frequencySetId = -1, FrequencyBand ft = FrequencyBand_def::VHF); bool init(LtsSession::LtsSession *session, RadioCircuit *data, const CnrConfig &cnrConfigId, int frequencySetId = -1, FrequencyBand ft = FrequencyBand::VHF);
void setNameDisabled(bool disable); void setNameDisabled(bool disable);
void setName(const QString& name); void setName(const QString& name);
void setRelaisRestrictions(bool restrict); void setRelaisRestrictions(bool restrict);
@@ -25,7 +25,7 @@ RadioSpecificaHfWidget::RadioSpecificaHfWidget(QWidget *parent)
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacingHF_def::CS_100_Hz), ChannelSpacingHF_def::CS_100_Hz); m_ui->cobChannelSpacing->addItem(toString(ChannelSpacingHF::CS_100_Hz), ChannelSpacingHF::CS_100_Hz);
@@ -94,7 +94,7 @@ RadioCircuitHF RadioSpecificaHfWidget::values() const
{ {
RadioCircuitHF spec; RadioCircuitHF spec;
spec.modulationType = ModulationType::AM; spec.modulationType = ModulationType::AM;
spec.channelSpacing = static_cast<ChannelSpacingHF::inner_enum>(m_ui->cobChannelSpacing->currentData().toInt()); spec.channelSpacing = static_cast<ChannelSpacingHF>(m_ui->cobChannelSpacing->currentData().toInt());
spec.frequency = m_ui->sbFrequency->value(); spec.frequency = m_ui->sbFrequency->value();
spec.squelch = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0; spec.squelch = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0;
return spec; return spec;
@@ -36,9 +36,9 @@ RadioSpecificaUhfWidget::RadioSpecificaUhfWidget(QWidget *parent)
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_25_00_kHz), ChannelSpacing_def::CS_25_00_kHz); m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_25_00_kHz), ChannelSpacing::CS_25_00_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_12_50_kHz), ChannelSpacing_def::CS_12_50_kHz); m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_12_50_kHz), ChannelSpacing::CS_12_50_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_8_33_kHz), ChannelSpacing_def::CS_8_33_kHz); m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_8_33_kHz), ChannelSpacing::CS_8_33_kHz);
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance(); LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
@@ -149,8 +149,8 @@ RadioCircuitUHF RadioSpecificaUhfWidget::values() const
{ {
RadioCircuitUHF spec; RadioCircuitUHF spec;
spec.modulationType = static_cast<ModulationType::inner_enum>(m_ui->bgModulationType->checkedButton()->property("enum").toInt()); spec.modulationType = static_cast<ModulationType>(m_ui->bgModulationType->checkedButton()->property("enum").toInt());
spec.channelSpacing = static_cast<ChannelSpacing::inner_enum>(m_ui->cobChannelSpacing->currentData().toInt()); spec.channelSpacing = static_cast<ChannelSpacing>(m_ui->cobChannelSpacing->currentData().toInt());
spec.frequency = m_ui->sbFrequency->value() * 1000; spec.frequency = m_ui->sbFrequency->value() * 1000;
spec.squelchDB = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0; spec.squelchDB = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0;
spec.clipper = m_ui->rbClipperOn->isChecked(); spec.clipper = m_ui->rbClipperOn->isChecked();
@@ -22,11 +22,11 @@ RadioSpecificaVhfWidget::RadioSpecificaVhfWidget(QSet<int> &assignedFrequencySet
m_ui->setupUi(this); m_ui->setupUi(this);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncNone), RcOperatingMode_def::FixedFreqEncNone); m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncNone), RcOperatingMode::FixedFreqEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncHwKr), RcOperatingMode_def::FixedFreqEncHwKr); m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncHwKr), RcOperatingMode::FixedFreqEncHwKr);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncHwKrKl), RcOperatingMode_def::FixedFreqEncHwKrKl); m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncHwKrKl), RcOperatingMode::FixedFreqEncHwKrKl);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::AkwEncNone), RcOperatingMode_def::AkwEncNone); m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::AkwEncNone), RcOperatingMode::AkwEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::AkwEncEccm), RcOperatingMode_def::AkwEncEccm); m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::AkwEncEccm), RcOperatingMode::AkwEncEccm);
m_ui->leFrequencySet->setEnabled(false); m_ui->leFrequencySet->setEnabled(false);
@@ -116,7 +116,7 @@ bool RadioSpecificaVhfWidget::setValues(const QJsonObject &json)
RadioCircuitVHF RadioSpecificaVhfWidget::values() const RadioCircuitVHF RadioSpecificaVhfWidget::values() const
{ {
RadioCircuitVHF spec; RadioCircuitVHF spec;
spec.operatingMode = static_cast<RcOperatingMode::inner_enum>(m_ui->cobOperatingMode->currentData().toInt()); spec.operatingMode = static_cast<RcOperatingMode>(m_ui->cobOperatingMode->currentData().toInt());
spec.freqSetDataId = m_frequencySetDataId; spec.freqSetDataId = m_frequencySetDataId;
spec.pilotTone = isAkwMode(spec.operatingMode) ? false : m_ui->rbPilotToneOn->isChecked(); spec.pilotTone = isAkwMode(spec.operatingMode) ? false : m_ui->rbPilotToneOn->isChecked();
return spec; return spec;
@@ -163,7 +163,7 @@ void RadioSpecificaVhfWidget::onSelectFrequencySetData()
void RadioSpecificaVhfWidget::onOperatingModeChanged() void RadioSpecificaVhfWidget::onOperatingModeChanged()
{ {
RcOperatingMode rcMode = static_cast<RcOperatingMode::inner_enum>(m_ui->cobOperatingMode->currentData().toInt()); RcOperatingMode rcMode = static_cast<RcOperatingMode>(m_ui->cobOperatingMode->currentData().toInt());
const bool enablePilotTone = !isAkwMode(rcMode); const bool enablePilotTone = !isAkwMode(rcMode);
m_ui->lbxPilotTone->setEnabled(enablePilotTone); m_ui->lbxPilotTone->setEnabled(enablePilotTone);
m_ui->rbPilotToneOn->setEnabled(enablePilotTone); m_ui->rbPilotToneOn->setEnabled(enablePilotTone);
@@ -176,7 +176,7 @@ void ElokaDialog::onQueryElokaResponse(const QVector<AvaEloka>&& eloka)
{ {
for (const auto& cnrTvcProfileData : cnrTvcProfile.data()) for (const auto& cnrTvcProfileData : cnrTvcProfile.data())
{ {
if (cnrTvcProfileData.radioSystemId() == RadioSystem::inner_enum::Cnr) if (cnrTvcProfileData.radioSystemId() == RadioSystem::Cnr)
userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr); userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr);
else else
userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc); userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc);
@@ -250,7 +250,7 @@ bool ElokaDialog::isAnnouncement(ElokaData& data)
QMap<qint32, Stream> streams = m_avmDtc->streams(); QMap<qint32, Stream> streams = m_avmDtc->streams();
for (const Stream& stream : std::as_const(streams)) for (const Stream& stream : std::as_const(streams))
{ {
if ((stream.type() == StreamType_def::AudioOut) || (stream.type() == StreamType_def::AudioInOut)) if ((stream.type() == StreamType::AudioOut) || (stream.type() == StreamType::AudioInOut))
announcements.insert(stream.id(), stream); announcements.insert(stream.id(), stream);
} }
@@ -160,7 +160,7 @@ bool ElokaEditDialog::init(const std::vector<qint32>& usedCnr, const std::vector
const QMap<qint32, Stream> streams = m_avmDtc->streams(); const QMap<qint32, Stream> streams = m_avmDtc->streams();
for (const Stream& stream : streams) for (const Stream& stream : streams)
{ {
if ((stream.type() == StreamType_def::AudioOut) || (stream.type() == StreamType_def::AudioInOut)) if ((stream.type() == StreamType::AudioOut) || (stream.type() == StreamType::AudioInOut))
m_announcementMap.insert(stream.id(), stream); m_announcementMap.insert(stream.id(), stream);
} }
@@ -360,7 +360,7 @@ void ElokaEditDialog::onStreamChanged(const Stream& data, DataModification modTy
{ {
DEBUG_LOG(m_logger) << "onStreamChanged"; DEBUG_LOG(m_logger) << "onStreamChanged";
if ((data.type() != StreamType_def::AudioOut) && (data.type() != StreamType_def::AudioInOut)) if ((data.type() != StreamType::AudioOut) && (data.type() != StreamType::AudioInOut))
return; return;
switch (modType) switch (modType)
@@ -410,7 +410,7 @@ void ElokaEditDialog::getUserProfile()
if (cnrTvcProfile.exerciseId() == exerciseId && cnrTvcProfile.operatorId() == operatorId) if (cnrTvcProfile.exerciseId() == exerciseId && cnrTvcProfile.operatorId() == operatorId)
{ {
for (const auto& cnrTvcProfileData : cnrTvcProfile.data()) for (const auto& cnrTvcProfileData : cnrTvcProfile.data())
if (cnrTvcProfileData.radioSystemId() == RadioSystem::inner_enum::Cnr) if (cnrTvcProfileData.radioSystemId() == RadioSystem::Cnr)
m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr); m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr);
else else
m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc); m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc);
@@ -602,15 +602,15 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage
QString strAssetType; QString strAssetType;
switch (mp.type().underlying()) switch (mp.type().underlying())
{ {
case InfrastructureManagement::MountingPointType_def::AnnouncementUnit: case InfrastructureManagement::MountingPointType::AnnouncementUnit:
assetType = BuildingViewer::AssetTypes::AnnouncementUnit; assetType = BuildingViewer::AssetTypes::AnnouncementUnit;
strAssetType = QStringLiteral("AnnouncementUnit"); strAssetType = QStringLiteral("AnnouncementUnit");
break; break;
case InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit: case InfrastructureManagement::MountingPointType::EffectGenerationControlUnit:
assetType = BuildingViewer::AssetTypes::EffectGenerationUnit; assetType = BuildingViewer::AssetTypes::EffectGenerationUnit;
strAssetType = QStringLiteral("EffectGenerationControlUnit"); strAssetType = QStringLiteral("EffectGenerationControlUnit");
break; break;
case InfrastructureManagement::MountingPointType_def::IndoorCamera: { case InfrastructureManagement::MountingPointType::IndoorCamera: {
bool hasSpeaker = false; bool hasSpeaker = false;
QJsonParseError jError; QJsonParseError jError;
const QJsonDocument doc(QJsonDocument::fromJson(mp.properties(), &jError)); const QJsonDocument doc(QJsonDocument::fromJson(mp.properties(), &jError));
@@ -741,7 +741,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
return false; return false;
ParticipantManagement::TypeClass tc = m_ppmDtc->type(participant.typeId()).typeClass(); ParticipantManagement::TypeClass tc = m_ppmDtc->type(participant.typeId()).typeClass();
if (tc == ParticipantManagement::TypeClass_def::SupportUnit || tc == ParticipantManagement::TypeClass_def::Unit) if (tc == ParticipantManagement::TypeClass::SupportUnit || tc == ParticipantManagement::TypeClass::Unit)
{ {
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id " DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
<< participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'"; << participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
@@ -1337,9 +1337,9 @@ void BuildingViewerDdsController::updateBuildingRoomNames(
QString featureID = BuildingViewer::databaseId2FeatureId(buildingDatabaseId); QString featureID = BuildingViewer::databaseId2FeatureId(buildingDatabaseId);
for (const auto& se : vecElements) for (const auto& se : vecElements)
{ {
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Building) if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
m_connection->excSetBuildingDisplayName(featureID, QString::fromStdString(se.displayName())); m_connection->excSetBuildingDisplayName(featureID, QString::fromStdString(se.displayName()));
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room) if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
m_connection->excSetRoomDisplayName(featureID, QString::number(se.mountingPointId()), m_connection->excSetRoomDisplayName(featureID, QString::number(se.mountingPointId()),
QString::fromStdString(se.displayName())); QString::fromStdString(se.displayName()));
} }
@@ -288,7 +288,7 @@ void BuildingEdit::onDestroyElement()
std::vector<int32_t> structureElementIds; std::vector<int32_t> structureElementIds;
getStructureElementIds(m_model->privateData(selIndex), structureElementIds); getStructureElementIds(m_model->privateData(selIndex), structureElementIds);
sendBuildingStateRequest(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill, structureElementIds); sendBuildingStateRequest(ProjectDataManagement::VulnerabilityState::CatastrophicKill, structureElementIds);
} }
void BuildingEdit::getStructureElementIds(NGLTreeItem* item, std::vector<int32_t>& structureElementIds) void BuildingEdit::getStructureElementIds(NGLTreeItem* item, std::vector<int32_t>& structureElementIds)
@@ -141,7 +141,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto& se : vecElements) for (const auto& se : vecElements)
{ {
DEBUG_LOG(m_logger) << "se: =" << se; DEBUG_LOG(m_logger) << "se: =" << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Floor) if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Floor)
{ {
BuildingViewer::TreeItem itemRoom(se); BuildingViewer::TreeItem itemRoom(se);
itemRoom.setSuperior(rootId); itemRoom.setSuperior(rootId);
@@ -162,7 +162,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto& se : vecElements) for (const auto& se : vecElements)
{ {
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room) if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
{ {
double fortifyFactor = 1.0; double fortifyFactor = 1.0;
@@ -63,12 +63,12 @@ bool BldConfigDialog::init(LtsSession::LtsSession* session)
void BldConfigDialog::fillCbx() void BldConfigDialog::fillCbx()
{ {
m_ui->cmbStatus->clear(); m_ui->cmbStatus->clear();
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::NoChange), m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange),
ProjectDataManagement::VulnerabilityState::NoChange); ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange);
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::CombatReady), m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady),
ProjectDataManagement::VulnerabilityState::CombatReady); ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::CatastrophicKill), m_ui->cmbStatus->addItem(toString(ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill),
ProjectDataManagement::VulnerabilityState::CatastrophicKill); ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill);
m_ui->cmbStatus->setCurrentIndex(m_ui->cmbStatus->findData(m_bldState.vulnerabilityState().underlying())); m_ui->cmbStatus->setCurrentIndex(m_ui->cmbStatus->findData(m_bldState.vulnerabilityState().underlying()));
} }
@@ -90,7 +90,7 @@ bool BldConfigDialog::apply()
requestData.buildings({building}); requestData.buildings({building});
ProjectDataManagement::VulnerabilityState state = ProjectDataManagement::VulnerabilityState state =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(m_ui->cmbStatus->currentData().toInt()); static_cast<ProjectDataManagement::VulnerabilityState>(m_ui->cmbStatus->currentData().toInt());
requestData.vulnerabilityState(state); requestData.vulnerabilityState(state);
requestData.resetContamination(m_ui->chbResetContamination->isChecked()); requestData.resetContamination(m_ui->chbResetContamination->isChecked());
@@ -110,8 +110,8 @@ void Buildings::BldConfigDialog::slotCmbStatusCurrentIndexChanged(int index)
{ {
Q_UNUSED(index) Q_UNUSED(index)
ProjectDataManagement::VulnerabilityState state = ProjectDataManagement::VulnerabilityState state =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(m_ui->cmbStatus->currentData().toInt()); static_cast<ProjectDataManagement::VulnerabilityState>(m_ui->cmbStatus->currentData().toInt());
if (state == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) if (state == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
{ {
m_ui->chbResetContamination->setEnabled(true); m_ui->chbResetContamination->setEnabled(true);
m_ui->chbResetContamination->setChecked(false); m_ui->chbResetContamination->setChecked(false);
@@ -422,7 +422,7 @@ int BldInfoDialog::findFloorIdByRoomId(int roomId) noexcept(false)
if (!getRoom(parentSeId, parentSe)) if (!getRoom(parentSeId, parentSe))
continue; continue;
if (parentSe.structureElementTypeId().underlying() != StructureElementType_def::Floor) if (parentSe.structureElementTypeId().underlying() != StructureElementType::Floor)
continue; continue;
m_floorNames.insert(parentSeId, QString::fromStdString(parentSe.displayName())); m_floorNames.insert(parentSeId, QString::fromStdString(parentSe.displayName()));
@@ -178,13 +178,13 @@ void InterfaceImpl::onBuildinSearchStringEntered(const QString &searchString)
const InfrastructureManagement::StructureElement &firstElement = elements.front(); const InfrastructureManagement::StructureElement &firstElement = elements.front();
const InfrastructureManagement::StructureElementType_def::type type = firstElement.structureElementTypeId().underlying(); const InfrastructureManagement::StructureElementType type = static_cast<InfrastructureManagement::StructureElementType>(firstElement.structureElementTypeId());
if (type == InfrastructureManagement::StructureElementType_def::Building) if (type == InfrastructureManagement::StructureElementType::Building)
{ {
if (!(m_ismDataIfc && m_ismDataIfc->isBuildingsInCurrentExercise(data.id()))) if (!(m_ismDataIfc && m_ismDataIfc->isBuildingsInCurrentExercise(data.id())))
return; return;
} else if (type != InfrastructureManagement::StructureElementType_def::Bridge) } else if (type != InfrastructureManagement::StructureElementType::Bridge)
return; return;
@@ -208,10 +208,10 @@ void InterfaceImpl::onBuildinSearchStringEntered(const QString &searchString)
if (displayName.contains(searchString, Qt::CaseSensitivity::CaseInsensitive)) if (displayName.contains(searchString, Qt::CaseSensitivity::CaseInsensitive))
{ {
switch (type) { switch (type) {
case InfrastructureManagement::StructureElementType_def::Building: case InfrastructureManagement::StructureElementType::Building:
bldIdCont.append(data.id()); bldIdCont.append(data.id());
break; break;
case InfrastructureManagement::StructureElementType_def::Bridge: case InfrastructureManagement::StructureElementType::Bridge:
bridgeIdCont.append(data.id()); bridgeIdCont.append(data.id());
break; break;
default: default:
@@ -215,7 +215,7 @@ void BridgeInfoDialog::bridgeStatusChanged()
case InfrastructureManagement::BridgeStatus::Intact: case InfrastructureManagement::BridgeStatus::Intact:
data.status(InfrastructureManagement::BridgeStatus::Intact); data.status(InfrastructureManagement::BridgeStatus::Intact);
break; break;
case InfrastructureManagement::BridgeStatus_def::Broken: case InfrastructureManagement::BridgeStatus::Broken:
data.status(InfrastructureManagement::BridgeStatus::Broken); data.status(InfrastructureManagement::BridgeStatus::Broken);
break; break;
default: default:
@@ -244,9 +244,9 @@ bool EgcuInfoDialog::readAllowance(InfrastructureManagement::EffectOverride eo,
return true; return true;
QJsonObject docObj = QJsonObject(doc.object()); QJsonObject docObj = QJsonObject(doc.object());
if (eo == InfrastructureManagement::EffectOverride_def::PermanentOn) if (eo == InfrastructureManagement::EffectOverride::PermanentOn)
return docObj.value(QStringLiteral("allowPermanentOn")).toBool(true); 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); return docObj.value(QStringLiteral("allowPermanentOff")).toBool(true);
else else
return true; return true;
@@ -367,10 +367,10 @@ void EgcuInfoDialog::showEgcuInfos(const InfrastructureManagement::StructureElem
allRelayIds.removeOne(relayId); allRelayIds.removeOne(relayId);
int value = objState.value(relayIdString).toInt(); int value = objState.value(relayIdString).toInt();
if (m_relayInfoWidgets.contains(relayId)) if (m_relayInfoWidgets.contains(relayId))
m_relayInfoWidgets[relayId]->setEffectOverride(static_cast<InfrastructureManagement::EffectOverride::inner_enum>(value)); m_relayInfoWidgets[relayId]->setEffectOverride(static_cast<InfrastructureManagement::EffectOverride>(value));
} }
for (auto relayId : std::as_const(allRelayIds)) for (auto relayId : std::as_const(allRelayIds))
m_relayInfoWidgets[relayId]->setEffectOverride(InfrastructureManagement::EffectOverride_def::Automatic); m_relayInfoWidgets[relayId]->setEffectOverride(InfrastructureManagement::EffectOverride::Automatic);
} }
} }
@@ -255,8 +255,8 @@ void EgcuOperationalDialog::onInstrumentationAssetChanged(
return; return;
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id:" << data.id(); DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged id:" << data.id();
if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit
&& data.assetStateId() == InfrastructureManagement::InstrumentationAssetState_def::Mounted) && data.assetStateId() == InfrastructureManagement::InstrumentationAssetState::Mounted)
{ {
DEBUG_LOG(m_logger) << "Insert instrumentation asset id=" << data.id(); DEBUG_LOG(m_logger) << "Insert instrumentation asset id=" << data.id();
m_instrumentationAssets.insert(data.id(), data); m_instrumentationAssets.insert(data.id(), data);
@@ -74,13 +74,13 @@ void RelayInfoWidget::setEffectOverride(InfrastructureManagement::EffectOverride
{ {
switch (override.underlying()) switch (override.underlying())
{ {
case InfrastructureManagement::EffectOverride_def::Automatic: case InfrastructureManagement::EffectOverride::Automatic:
m_ui->tbAuto->setChecked(true); m_ui->tbAuto->setChecked(true);
break; break;
case InfrastructureManagement::EffectOverride_def::PermanentOn: case InfrastructureManagement::EffectOverride::PermanentOn:
m_ui->tbOn->setChecked(true); m_ui->tbOn->setChecked(true);
break; break;
case InfrastructureManagement::EffectOverride_def::PermanentOff: case InfrastructureManagement::EffectOverride::PermanentOff:
m_ui->tbOff->setChecked(true); m_ui->tbOff->setChecked(true);
break; break;
} }
@@ -90,13 +90,13 @@ void RelayInfoWidget::setEffectOverrideEnabled(InfrastructureManagement::EffectO
{ {
switch (override.underlying()) switch (override.underlying())
{ {
case InfrastructureManagement::EffectOverride_def::Automatic: case InfrastructureManagement::EffectOverride::Automatic:
m_ui->tbAuto->setEnabled(enable); m_ui->tbAuto->setEnabled(enable);
break; break;
case InfrastructureManagement::EffectOverride_def::PermanentOn: case InfrastructureManagement::EffectOverride::PermanentOn:
m_ui->tbOn->setEnabled(enable); m_ui->tbOn->setEnabled(enable);
break; break;
case InfrastructureManagement::EffectOverride_def::PermanentOff: case InfrastructureManagement::EffectOverride::PermanentOff:
m_ui->tbOff->setEnabled(enable); m_ui->tbOff->setEnabled(enable);
break; break;
} }
@@ -112,11 +112,11 @@ void RelayInfoWidget::onButtonClicked()
QAbstractButton* ab = qobject_cast<QAbstractButton*>(sender()); QAbstractButton* ab = qobject_cast<QAbstractButton*>(sender());
if (!ab) if (!ab)
return; return;
InfrastructureManagement::EffectOverride eo = InfrastructureManagement::EffectOverride_def::Automatic; InfrastructureManagement::EffectOverride eo = InfrastructureManagement::EffectOverride::Automatic;
if (ab == m_ui->tbOff) if (ab == m_ui->tbOff)
eo = InfrastructureManagement::EffectOverride_def::PermanentOff; eo = InfrastructureManagement::EffectOverride::PermanentOff;
else if (ab == m_ui->tbOn) else if (ab == m_ui->tbOn)
eo = InfrastructureManagement::EffectOverride_def::PermanentOn; eo = InfrastructureManagement::EffectOverride::PermanentOn;
emit effectOverrideChanged(m_id, eo); emit effectOverrideChanged(m_id, eo);
} }
@@ -223,7 +223,7 @@ void ParticipantsMoveDialog::onSelectionChanged()
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, isOne && !isParticipantInUseOrAdler); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, isOne && !isParticipantInUseOrAdler);
} }
if (m_ppmDtc->type(data.typeId()).typeClass() != ParticipantManagement::TypeClass_def::Unit) if (m_ppmDtc->type(data.typeId()).typeClass() != ParticipantManagement::TypeClass::Unit)
{ {
if (!data.equipmentNumber().is_set() || data.equipmentNumber().get() <= 0) if (!data.equipmentNumber().is_set() || data.equipmentNumber().get() <= 0)
@@ -734,7 +734,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRequest(
req.participantId(participantData.id()); req.participantId(participantData.id());
bAskOutdated = bAskOutdated =
m_ppmDtc->type(participantData.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit; m_ppmDtc->type(participantData.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit;
} }
bool bOnlyOutdated = false; bool bOnlyOutdated = false;
@@ -51,7 +51,7 @@ bool ParticipantMoveModel::isSelectableBySimulation(const QModelIndex& index, bo
const ParticipantManagement::ParticipantData data(getParticipantData(index)); const ParticipantManagement::ParticipantData data(getParticipantData(index));
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) || if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
isSimulatable = false; isSimulatable = false;
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated() DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
@@ -151,7 +151,7 @@ bool MissionPlanDialog::canBeLocked() const
const auto wpStatus = wayPointCurrentStatus(missionPlan); const auto wpStatus = wayPointCurrentStatus(missionPlan);
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId()); const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
if (uas.uasState() == ProjectDataManagement::UasState_def::Manual || wpStatus == WayPointsStatus::Active) if (uas.uasState() == ProjectDataManagement::UasState::Manual || wpStatus == WayPointsStatus::Active)
return true; return true;
return false; return false;
@@ -168,7 +168,7 @@ bool MissionPlanDialog::canBeUnlocked() const
const auto wpStatus = wayPointCurrentStatus(missionPlan); const auto wpStatus = wayPointCurrentStatus(missionPlan);
const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId()); const auto uas = m_ppmDtc->getUasByParticipantId(missionPlan.participantId(), m_session->exerciseId());
if (uas.uasState() == ProjectDataManagement::UasState_def::Manual || wpStatus != WayPointsStatus::Active) if (uas.uasState() == ProjectDataManagement::UasState::Manual || wpStatus != WayPointsStatus::Active)
return true; return true;
return false; return false;
@@ -233,7 +233,7 @@ void MissionPlanEdit::onDynamicParticipantDataChanged(const ParticipantManagemen
youngestState = si; youngestState = si;
} }
setReady(youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady); setReady(youngestState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady);
} }
void MissionPlanEdit::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data, void MissionPlanEdit::onMissionPlanChanged(const ParticipantManagement::MissionPlan& data,
@@ -314,7 +314,7 @@ bool MissionPlanEdit::apply()
ParticipantManagement::UAS uasP = ParticipantManagement::UAS uasP =
m_ppmDtc->getUasByParticipantId(m_ui->participantCBox->currentData().toInt(), m_session->exerciseId()); m_ppmDtc->getUasByParticipantId(m_ui->participantCBox->currentData().toInt(), m_session->exerciseId());
if (uasP.uasState() == ProjectDataManagement::UasState_def::Manual && if (uasP.uasState() == ProjectDataManagement::UasState::Manual &&
uasP.participantId() != m_missionPlan.participantId()) uasP.participantId() != m_missionPlan.participantId())
{ {
LtsWidgets::LtsMessageDialog::showMessage(this, tr("Waypoints can't be saved!: Uas switched to %1-Mode") LtsWidgets::LtsMessageDialog::showMessage(this, tr("Waypoints can't be saved!: Uas switched to %1-Mode")
@@ -327,11 +327,11 @@ void CreateSimulationDialog::fillCharges()
using namespace ProjectDataManagement; using namespace ProjectDataManagement;
const QVector<GearClass_def::type> gearClasses = { GearClass_def::AirSupport, const QVector<GearClass> gearClasses = { GearClass::AirSupport,
GearClass_def::Artillery, GearClass::Artillery,
GearClass_def::Mortar }; GearClass::Mortar };
for (GearClass_def::type currentGearClass : gearClasses) for (GearClass currentGearClass : gearClasses)
{ {
const QVector<ChargeType> &chargeTypes = m_pdmDtc->chargesForGearClass(currentGearClass); const QVector<ChargeType> &chargeTypes = m_pdmDtc->chargesForGearClass(currentGearClass);
@@ -277,19 +277,19 @@ SymbologyXML::SymbolTypes::t_affil PlanCreator::partyRoleToSymbolAffiliation(con
{ {
switch (partyRole.underlying()) switch (partyRole.underlying())
{ {
case ParticipantManagement::Role_def::Unknown: case ParticipantManagement::Role::Unknown:
return SymbologyXML::SymbolTypes::UNKNOWN; return SymbologyXML::SymbolTypes::UNKNOWN;
case ParticipantManagement::Role_def::Friend: case ParticipantManagement::Role::Friend:
return SymbologyXML::SymbolTypes::FRIEND; return SymbologyXML::SymbolTypes::FRIEND;
case ParticipantManagement::Role_def::Neutral: case ParticipantManagement::Role::Neutral:
return SymbologyXML::SymbolTypes::NEUTRAL; return SymbologyXML::SymbolTypes::NEUTRAL;
case ParticipantManagement::Role_def::Enemy: case ParticipantManagement::Role::Enemy:
return SymbologyXML::SymbolTypes::ENEMY; return SymbologyXML::SymbolTypes::ENEMY;
case ParticipantManagement::Role_def::Pending: case ParticipantManagement::Role::Pending:
return SymbologyXML::SymbolTypes::PENDING; return SymbologyXML::SymbolTypes::PENDING;
case ParticipantManagement::Role_def::AssumedFriend: case ParticipantManagement::Role::AssumedFriend:
return SymbologyXML::SymbolTypes::ASSUMED_FRIEND; return SymbologyXML::SymbolTypes::ASSUMED_FRIEND;
case ParticipantManagement::Role_def::Suspect: case ParticipantManagement::Role::Suspect:
return SymbologyXML::SymbolTypes::SUSPECT; return SymbologyXML::SymbolTypes::SUSPECT;
default: default:
return SymbologyXML::SymbolTypes::AFFIL_UNDEFINED; return SymbologyXML::SymbolTypes::AFFIL_UNDEFINED;
@@ -50,7 +50,7 @@ void SoundAreaEditDialog::onPlaySound(SoundManagement::SoundCategory category, i
qWarning() << "onPlaySound" << volume; qWarning() << "onPlaySound" << volume;
SoundManagement::PlayControl control = SoundManagement::PlayControl control =
inLoop ? SoundManagement::PlayControl_def::PlayLoop : SoundManagement::PlayControl_def::PlaySingle; inLoop ? SoundManagement::PlayControl::PlayLoop : SoundManagement::PlayControl::PlaySingle;
for (const auto& egcuId : std::as_const(m_soundArea->egcuIds)) for (const auto& egcuId : std::as_const(m_soundArea->egcuIds))
{ {
@@ -16,7 +16,7 @@ SoundAreaHelper::SoundAreaHelper(SoundAreaHelper* helper)
{ {
QMap<int32_t, InfrastructureManagement::InstrumentationAsset> assets = m_ismDtc->instrumentationAssets(); QMap<int32_t, InfrastructureManagement::InstrumentationAsset> assets = m_ismDtc->instrumentationAssets();
for (const auto& asset : std::as_const(assets)) for (const auto& asset : std::as_const(assets))
if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit) if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
m_egcuNames.insert(asset.id(), QString::fromStdString(asset.name())); m_egcuNames.insert(asset.id(), QString::fromStdString(asset.name()));
SoundManagement::Sounds sounds = m_somDtc->sounds(); SoundManagement::Sounds sounds = m_somDtc->sounds();
@@ -30,7 +30,7 @@ SoundAreaHelper::SoundAreaHelper(std::shared_ptr<InfrastructureManagement::Inter
{ {
QMap<int32_t, InfrastructureManagement::InstrumentationAsset> assets = m_ismDtc->instrumentationAssets(); QMap<int32_t, InfrastructureManagement::InstrumentationAsset> assets = m_ismDtc->instrumentationAssets();
for (const auto& asset : std::as_const(assets)) for (const auto& asset : std::as_const(assets))
if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit) if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
m_egcuNames.insert(asset.id(), QString::fromStdString(asset.name())); m_egcuNames.insert(asset.id(), QString::fromStdString(asset.name()));
SoundManagement::Sounds sounds = m_somDtc->sounds(); SoundManagement::Sounds sounds = m_somDtc->sounds();
@@ -41,10 +41,10 @@ SoundAreaHelper::SoundAreaHelper(std::shared_ptr<InfrastructureManagement::Inter
QVector<SoundManagement::SoundCategory> SoundAreaHelper::soundCategories() QVector<SoundManagement::SoundCategory> SoundAreaHelper::soundCategories()
{ {
QVector<SoundManagement::SoundCategory> categories = QVector<SoundManagement::SoundCategory>{ QVector<SoundManagement::SoundCategory> categories = QVector<SoundManagement::SoundCategory>{
SoundManagement::SoundCategory_def::Aircraft, SoundManagement::SoundCategory_def::Battlefield, SoundManagement::SoundCategory::Aircraft, SoundManagement::SoundCategory::Battlefield,
SoundManagement::SoundCategory_def::Boat, SoundManagement::SoundCategory_def::Explosion, SoundManagement::SoundCategory::Boat, SoundManagement::SoundCategory::Explosion,
SoundManagement::SoundCategory_def::Helicopter, SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic, SoundManagement::SoundCategory::Helicopter, SoundManagement::SoundCategory::MotorsAndUrbanTraffic,
SoundManagement::SoundCategory_def::Vehicle, SoundManagement::SoundCategory_def::InsideBuilding}; SoundManagement::SoundCategory::Vehicle, SoundManagement::SoundCategory::InsideBuilding};
return categories; return categories;
} }
@@ -52,23 +52,23 @@ QString SoundAreaHelper::categoryName(SoundManagement::SoundCategory category)
{ {
switch (category.underlying()) switch (category.underlying())
{ {
case SoundManagement::SoundCategory_def::Aircraft: case SoundManagement::SoundCategory::Aircraft:
return QStringLiteral("Aircraft"); return QStringLiteral("Aircraft");
case SoundManagement::SoundCategory_def::Battlefield: case SoundManagement::SoundCategory::Battlefield:
return QStringLiteral("Battlefield"); return QStringLiteral("Battlefield");
case SoundManagement::SoundCategory_def::Boat: case SoundManagement::SoundCategory::Boat:
return QStringLiteral("Boat"); return QStringLiteral("Boat");
case SoundManagement::SoundCategory_def::Explosion: case SoundManagement::SoundCategory::Explosion:
return QStringLiteral("Explosion"); return QStringLiteral("Explosion");
case SoundManagement::SoundCategory_def::Helicopter: case SoundManagement::SoundCategory::Helicopter:
return QStringLiteral("Helicopter"); return QStringLiteral("Helicopter");
case SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic: case SoundManagement::SoundCategory::MotorsAndUrbanTraffic:
return QStringLiteral("MotorsAndUrbanTraffic"); return QStringLiteral("MotorsAndUrbanTraffic");
case SoundManagement::SoundCategory_def::Vehicle: case SoundManagement::SoundCategory::Vehicle:
return QStringLiteral("Vehicle"); return QStringLiteral("Vehicle");
case SoundManagement::SoundCategory_def::InsideBuilding: case SoundManagement::SoundCategory::InsideBuilding:
return QStringLiteral("InsideBuilding"); return QStringLiteral("InsideBuilding");
case SoundManagement::SoundCategory_def::Unknown: case SoundManagement::SoundCategory::Unknown:
return QStringLiteral("Unknown"); return QStringLiteral("Unknown");
default: default:
return QString(); return QString();
@@ -84,7 +84,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
{ {
switch (category.underlying()) switch (category.underlying())
{ {
case SoundManagement::SoundCategory_def::Aircraft: case SoundManagement::SoundCategory::Aircraft:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -99,7 +99,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Battlefield: case SoundManagement::SoundCategory::Battlefield:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -120,14 +120,14 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Boat: case SoundManagement::SoundCategory::Boat:
switch (id) switch (id)
{ {
default: default:
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Explosion: case SoundManagement::SoundCategory::Explosion:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -136,7 +136,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Helicopter: case SoundManagement::SoundCategory::Helicopter:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -153,7 +153,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic: case SoundManagement::SoundCategory::MotorsAndUrbanTraffic:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -182,7 +182,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Vehicle: case SoundManagement::SoundCategory::Vehicle:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -191,7 +191,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::InsideBuilding: case SoundManagement::SoundCategory::InsideBuilding:
switch (id) switch (id)
{ {
case 1: case 1:
@@ -212,7 +212,7 @@ QString SoundAreaHelper::soundName(SoundManagement::SoundCategory category, cons
return QStringLiteral("Error"); return QStringLiteral("Error");
} }
case SoundManagement::SoundCategory_def::Unknown: case SoundManagement::SoundCategory::Unknown:
switch (id) switch (id)
{ {
default: default:
@@ -249,23 +249,23 @@ QColor SoundAreaHelper::soundCategoryTextColor(const int32_t& category)
{ {
switch (category) switch (category)
{ {
case SoundManagement::SoundCategory_def::Aircraft: case SoundManagement::SoundCategory::Aircraft:
return {Qt::white}; return {Qt::white};
case SoundManagement::SoundCategory_def::Battlefield: case SoundManagement::SoundCategory::Battlefield:
return {Qt::white}; return {Qt::white};
case SoundManagement::SoundCategory_def::Boat: case SoundManagement::SoundCategory::Boat:
return {Qt::black}; return {Qt::black};
case SoundManagement::SoundCategory_def::Explosion: case SoundManagement::SoundCategory::Explosion:
return {Qt::white}; return {Qt::white};
case SoundManagement::SoundCategory_def::Helicopter: case SoundManagement::SoundCategory::Helicopter:
return {Qt::white}; return {Qt::white};
case SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic: case SoundManagement::SoundCategory::MotorsAndUrbanTraffic:
return {Qt::white}; return {Qt::white};
case SoundManagement::SoundCategory_def::Vehicle: case SoundManagement::SoundCategory::Vehicle:
return {Qt::black}; return {Qt::black};
case SoundManagement::SoundCategory_def::InsideBuilding: case SoundManagement::SoundCategory::InsideBuilding:
return {Qt::black}; return {Qt::black};
case SoundManagement::SoundCategory_def::Unknown: case SoundManagement::SoundCategory::Unknown:
return {Qt::white}; return {Qt::white};
default: default:
return {Qt::black}; return {Qt::black};
@@ -276,23 +276,23 @@ QColor SoundAreaHelper::soundCategoryBackgroundColor(const int32_t& category)
{ {
switch (category) switch (category)
{ {
case SoundManagement::SoundCategory_def::Aircraft: case SoundManagement::SoundCategory::Aircraft:
return QColor::fromRgb(25, 25, 112); return QColor::fromRgb(25, 25, 112);
case SoundManagement::SoundCategory_def::Battlefield: case SoundManagement::SoundCategory::Battlefield:
return QColor::fromRgb(160, 82, 45); return QColor::fromRgb(160, 82, 45);
case SoundManagement::SoundCategory_def::Boat: case SoundManagement::SoundCategory::Boat:
return QColor::fromRgb(127, 255, 212); return QColor::fromRgb(127, 255, 212);
case SoundManagement::SoundCategory_def::Explosion: case SoundManagement::SoundCategory::Explosion:
return QColor::fromRgb(255, 0, 0); return QColor::fromRgb(255, 0, 0);
case SoundManagement::SoundCategory_def::Helicopter: case SoundManagement::SoundCategory::Helicopter:
return QColor::fromRgb(153, 50, 204); return QColor::fromRgb(153, 50, 204);
case SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic: case SoundManagement::SoundCategory::MotorsAndUrbanTraffic:
return QColor::fromRgb(85, 107, 47); return QColor::fromRgb(85, 107, 47);
case SoundManagement::SoundCategory_def::Vehicle: case SoundManagement::SoundCategory::Vehicle:
return QColor::fromRgb(255, 255, 0); return QColor::fromRgb(255, 255, 0);
case SoundManagement::SoundCategory_def::InsideBuilding: case SoundManagement::SoundCategory::InsideBuilding:
return QColor::fromRgb(255, 160, 122); return QColor::fromRgb(255, 160, 122);
case SoundManagement::SoundCategory_def::Unknown: case SoundManagement::SoundCategory::Unknown:
return QColor::fromRgb(119, 136, 153); return QColor::fromRgb(119, 136, 153);
default: default:
return {Qt::white}; return {Qt::white};
@@ -304,24 +304,24 @@ SoundManagement::SoundCategory SoundAreaHelper::soundCategory(const int& i)
switch (i) switch (i)
{ {
case 1: case 1:
return SoundManagement::SoundCategory_def::Aircraft; return SoundManagement::SoundCategory::Aircraft;
case 2: case 2:
return SoundManagement::SoundCategory_def::Battlefield; return SoundManagement::SoundCategory::Battlefield;
case 3: case 3:
return SoundManagement::SoundCategory_def::Boat; return SoundManagement::SoundCategory::Boat;
case 4: case 4:
return SoundManagement::SoundCategory_def::Explosion; return SoundManagement::SoundCategory::Explosion;
case 5: case 5:
return SoundManagement::SoundCategory_def::Helicopter; return SoundManagement::SoundCategory::Helicopter;
case 6: case 6:
return SoundManagement::SoundCategory_def::MotorsAndUrbanTraffic; return SoundManagement::SoundCategory::MotorsAndUrbanTraffic;
case 7: case 7:
return SoundManagement::SoundCategory_def::Vehicle; return SoundManagement::SoundCategory::Vehicle;
case 8: case 8:
return SoundManagement::SoundCategory_def::InsideBuilding; return SoundManagement::SoundCategory::InsideBuilding;
case 9: case 9:
default: default:
return SoundManagement::SoundCategory_def::Unknown; return SoundManagement::SoundCategory::Unknown;
} }
} }
@@ -221,15 +221,15 @@ void InterfaceImpl::onOperatingConditionEntityChanged(const OperatingConditionEn
if (m_vehicleType == EffectShowManagement::Feature_e::Smoke) if (m_vehicleType == EffectShowManagement::Feature_e::Smoke)
{ {
if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (currentSmokeLoad != m_oldSmokeCount) if (currentSmokeLoad != m_oldSmokeCount)
@@ -313,13 +313,13 @@ bool FiringExplosion::statusChangedForOrderedEffectShow(EffectShowStatus_e statu
switch (status) switch (status)
{ {
case EffectShowStatus_e::Fire: case EffectShowStatus_e::Fire:
oc = EffectShowManagement::OrderConfirmation_e_def::Execution; oc = EffectShowManagement::OrderConfirmation_e::Execution;
break; break;
case EffectShowStatus_e::CarriedOut: case EffectShowStatus_e::CarriedOut:
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut; oc = EffectShowManagement::OrderConfirmation_e::OrderCarriedOut;
break; break;
case EffectShowStatus_e::Interrupt: case EffectShowStatus_e::Interrupt:
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptExecution; oc = EffectShowManagement::OrderConfirmation_e::InterruptExecution;
break; break;
default: default:
DEBUG_LOG(m_logger) << "FiringExplosion::statusChangedForOrderedEffectShow switch is defaulting, " DEBUG_LOG(m_logger) << "FiringExplosion::statusChangedForOrderedEffectShow switch is defaulting, "
@@ -129,32 +129,32 @@ void FiringSmoke::onOperatingConditionEntityChanged(const OperatingConditionEnti
Q_UNUSED(modType) Q_UNUSED(modType)
QVector<QColor> onColor = { QVector<QColor> onColor = {
data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0)}; : QColor(255, 255, 0)};
QVector<bool> status = { QVector<bool> status = {
((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking))}; (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking))};
m_smokeState->setSmokeState(status, onColor); m_smokeState->setSmokeState(status, onColor);
m_safetyConfirmationWidget->onOperatingConditionEntityChanged(data); m_safetyConfirmationWidget->onOperatingConditionEntityChanged(data);
@@ -264,10 +264,10 @@ bool FiringSmoke::statusChangedForOrderedEffectShow(EffectShowStatus_e status)
switch (status) switch (status)
{ {
case EffectShowStatus_e::Abort: case EffectShowStatus_e::Abort:
oc = EffectShowManagement::OrderConfirmation_e_def::Abort; oc = EffectShowManagement::OrderConfirmation_e::Abort;
break; break;
case EffectShowStatus_e::CarriedOut: case EffectShowStatus_e::CarriedOut:
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut; oc = EffectShowManagement::OrderConfirmation_e::OrderCarriedOut;
break; break;
default: default:
DEBUG_LOG(m_logger) << "FiringSmoke::statusChangedForOrderedEffectShow switch is defaulting, should " DEBUG_LOG(m_logger) << "FiringSmoke::statusChangedForOrderedEffectShow switch is defaulting, should "
@@ -103,15 +103,15 @@ int OperatingCondition::getSmokeCount()
{ {
const OperatingConditionEntity& data = m_dtc->operatingConditionEntity(); const OperatingConditionEntity& data = m_dtc->operatingConditionEntity();
int currentSmokeLoad = 0; int currentSmokeLoad = 0;
if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) if (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready)
currentSmokeLoad++; currentSmokeLoad++;
return currentSmokeLoad; return currentSmokeLoad;
@@ -126,19 +126,19 @@ void OperatingCondition::onOperatingConditionEntityChanged(const EffectShowClien
m_lastState = data; m_lastState = data;
if (data.vehicleFeature() == if (data.vehicleFeature() ==
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion24)) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Explosion24))
{ {
m_ui->ledAftLh->hide(); m_ui->ledAftLh->hide();
m_ui->ledAftRh->hide(); m_ui->ledAftRh->hide();
} }
else if (data.vehicleFeature() == else if (data.vehicleFeature() ==
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion48)) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Explosion48))
{ {
m_ui->ledAftLh->show(); m_ui->ledAftLh->show();
m_ui->ledAftRh->show(); m_ui->ledAftRh->show();
} }
bool isExp = data.vehicleFeature() != bool isExp = data.vehicleFeature() !=
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke); EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Smoke);
m_ui->frame->setHidden(!isExp); m_ui->frame->setHidden(!isExp);
m_ui->lblMagazine->setHidden(!isExp); m_ui->lblMagazine->setHidden(!isExp);
m_ui->lblMag->setHidden(!isExp); m_ui->lblMag->setHidden(!isExp);
@@ -154,14 +154,14 @@ void OperatingCondition::onOperatingConditionEntityChanged(const EffectShowClien
setBatteryVoltage(data.batteryVoltage()); setBatteryVoltage(data.batteryVoltage());
if (data.vehicleFeature() != if (data.vehicleFeature() !=
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke)) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Smoke))
{ {
if (data.vehicleFeature() == if (data.vehicleFeature() ==
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::NotSpecified)) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::NotSpecified))
return; return;
int max = data.vehicleFeature() == int max = data.vehicleFeature() ==
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Explosion24) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Explosion24)
? 24 ? 24
: 48; : 48;
m_ui->sbMagazine->setMaximum(max); m_ui->sbMagazine->setMaximum(max);
@@ -178,32 +178,32 @@ void OperatingCondition::onOperatingConditionEntityChanged(const EffectShowClien
m_ui->sbMagazine->setMaximum(5); m_ui->sbMagazine->setMaximum(5);
m_ui->sbAvailable->setMaximum(12); m_ui->sbAvailable->setMaximum(12);
QVector<QColor> onColor = { QVector<QColor> onColor = {
data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge1().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge2().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge3().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge4().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0), : QColor(255, 255, 0),
data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e_def::Ready data.smokeCartridge5().underlying() <= EffectShowClient::StatusSmokeCartridge_e::Ready
? QColor(0, 255, 0) ? QColor(0, 255, 0)
: QColor(255, 255, 0)}; : QColor(255, 255, 0)};
QVector<bool> status = { QVector<bool> status = {
((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge1().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge2().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge3().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking)), (data.smokeCartridge4().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking)),
((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Ready) || ((data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Ready) ||
(data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e_def::Smoking))}; (data.smokeCartridge5().underlying() == EffectShowClient::StatusSmokeCartridge_e::Smoking))};
m_smokeState->setSmokeState(status, onColor); m_smokeState->setSmokeState(status, onColor);
} }
@@ -304,7 +304,7 @@ bool OperatingCondition::onSendAmmunition()
EffectShowClient::SendAmmunitionRequest request; EffectShowClient::SendAmmunitionRequest request;
const OperatingConditionEntity& condition = m_dtc->operatingConditionEntity(); const OperatingConditionEntity& condition = m_dtc->operatingConditionEntity();
if (condition.vehicleFeature() == if (condition.vehicleFeature() ==
EffectShowManagement::Feature_e::inner_enum(EffectShowManagement::Feature_e_def::Smoke)) EffectShowManagement::Feature_e(EffectShowManagement::Feature_e::Smoke))
request.ammunitionMagazine(getSmokeCount()); request.ammunitionMagazine(getSmokeCount());
else else
request.ammunitionMagazine(m_ui->sbMagazine->value()); request.ammunitionMagazine(m_ui->sbMagazine->value());
@@ -82,7 +82,7 @@ bool OrderEdit::apply()
OrderModifyRequest orderModifyRequest; OrderModifyRequest orderModifyRequest;
int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText()); int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText());
EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e::inner_enum(key); EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e(key);
orderModifyRequest.orderConfirmation(oc); orderModifyRequest.orderConfirmation(oc);
orderModifyRequest.answerText(m_ui->cbxAnswer->currentText().toStdString()); orderModifyRequest.answerText(m_ui->cbxAnswer->currentText().toStdString());
@@ -107,8 +107,8 @@ bool OrderEdit::checkForAnswerUiRequirement() const
return true; return true;
int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText()); int key = m_orderList.key(m_ui->cbOrderConfirmation->currentText());
return !(((key == EffectShowManagement::OrderConfirmation_e_def::Nonacceptance) || return !(((key == EffectShowManagement::OrderConfirmation_e::Nonacceptance) ||
(key == EffectShowManagement::OrderConfirmation_e_def::Abort)) && (key == EffectShowManagement::OrderConfirmation_e::Abort)) &&
m_ui->cbxAnswer->currentText().isEmpty()); m_ui->cbxAnswer->currentText().isEmpty());
} }
@@ -118,62 +118,62 @@ void OrderEdit::showOrder()
switch (m_order.orderConfirmation().underlying()) switch (m_order.orderConfirmation().underlying())
{ {
case EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance: case EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance] orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::OrderAcceptance]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff] << m_orderList[EffectShowManagement::OrderConfirmation_e::DriveOff]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached]; << m_orderList[EffectShowManagement::OrderConfirmation_e::PositionReached];
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable) if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::FiringReadiness];
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Nonacceptance]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Nonacceptance];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance: case EffectShowManagement::OrderConfirmation_e::OrderAcceptance:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff] orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::DriveOff]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation] << m_orderList[EffectShowManagement::OrderConfirmation_e::InterruptRelocation]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached]; << m_orderList[EffectShowManagement::OrderConfirmation_e::PositionReached];
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable) if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::FiringReadiness];
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::DriveOff: case EffectShowManagement::OrderConfirmation_e::DriveOff:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation] orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::InterruptRelocation]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached]; << m_orderList[EffectShowManagement::OrderConfirmation_e::PositionReached];
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable) if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::FiringReadiness];
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::PositionReached: case EffectShowManagement::OrderConfirmation_e::PositionReached:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::InterruptRelocation];
if (m_fireReadinessAvailable) if (m_fireReadinessAvailable)
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::FiringReadiness];
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::FiringReadiness: case EffectShowManagement::OrderConfirmation_e::FiringReadiness:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::Execution: case EffectShowManagement::OrderConfirmation_e::Execution:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation: case EffectShowManagement::OrderConfirmation_e::InterruptRelocation:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::DriveOff] orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::DriveOff]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::PositionReached]; << m_orderList[EffectShowManagement::OrderConfirmation_e::PositionReached];
if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable) if (m_order.typeOfOrder() != 0 && m_fireReadinessAvailable)
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::FiringReadiness]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::FiringReadiness];
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
case EffectShowManagement::OrderConfirmation_e_def::InterruptExecution: case EffectShowManagement::OrderConfirmation_e::InterruptExecution:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut] orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::OrderCarriedOut]
<< m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
default: default:
orderList << m_orderList[EffectShowManagement::OrderConfirmation_e_def::Abort]; orderList << m_orderList[EffectShowManagement::OrderConfirmation_e::Abort];
break; break;
} }
m_ui->cbOrderConfirmation->addItems(orderList); m_ui->cbOrderConfirmation->addItems(orderList);
@@ -182,27 +182,27 @@ void OrderEdit::showOrder()
void OrderEdit::createOrderList() void OrderEdit::createOrderList()
{ {
EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance; EffectShowManagement::OrderConfirmation_e oc = EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::OrderAcceptance; oc = EffectShowManagement::OrderConfirmation_e::OrderAcceptance;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::DriveOff; oc = EffectShowManagement::OrderConfirmation_e::DriveOff;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::PositionReached; oc = EffectShowManagement::OrderConfirmation_e::PositionReached;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::FiringReadiness; oc = EffectShowManagement::OrderConfirmation_e::FiringReadiness;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::Execution; oc = EffectShowManagement::OrderConfirmation_e::Execution;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptExecution; oc = EffectShowManagement::OrderConfirmation_e::InterruptExecution;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut; oc = EffectShowManagement::OrderConfirmation_e::OrderCarriedOut;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::Abort; oc = EffectShowManagement::OrderConfirmation_e::Abort;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::Nonacceptance; oc = EffectShowManagement::OrderConfirmation_e::Nonacceptance;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
oc = EffectShowManagement::OrderConfirmation_e_def::InterruptRelocation; oc = EffectShowManagement::OrderConfirmation_e::InterruptRelocation;
m_orderList[oc.underlying()] = EffectShowManagement::toString(oc); m_orderList[oc.underlying()] = EffectShowManagement::toString(oc);
} }
@@ -27,7 +27,7 @@ class OrderEdit : public LtsWidgets::LtsDialog, protected EffectShowClient::Inte
bool init(const std::shared_ptr<EffectShowClient::Interface::Ftc>& ftc, bool init(const std::shared_ptr<EffectShowClient::Interface::Ftc>& ftc,
EffectShowManagement::OrderConfirmation_e order = EffectShowManagement::OrderConfirmation_e order =
EffectShowManagement::OrderConfirmation_e_def::WaitingForAcceptance); EffectShowManagement::OrderConfirmation_e::WaitingForAcceptance);
bool apply() override; bool apply() override;
private: private:
@@ -48,7 +48,7 @@ class OrderEdit : public LtsWidgets::LtsDialog, protected EffectShowClient::Inte
LtsUtils::RequestHelper* m_requestHelper; LtsUtils::RequestHelper* m_requestHelper;
Order m_order; Order m_order;
bool m_fireReadinessAvailable; bool m_fireReadinessAvailable;
EffectShowManagement::OrderConfirmation_e_def m_forcedState; EffectShowManagement::OrderConfirmation m_forcedState;
QHash<int, QString> m_orderList; QHash<int, QString> m_orderList;
}; };
@@ -135,8 +135,8 @@ void OrderList::onSelectionChanged()
const QModelIndex idx = m_ui->widget->currentIndex(); const QModelIndex idx = m_ui->widget->currentIndex();
int row = idx.row(); int row = idx.row();
const EffectShowClient::Order order = m_model->getRowData(row); const EffectShowClient::Order order = m_model->getRowData(row);
bool isReady = order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::FiringReadiness || bool isReady = order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::FiringReadiness ||
order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::Execution; order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::Execution;
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, isReady); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, isReady);
@@ -155,15 +155,15 @@ void OrderList::onEditOrder()
const EffectShowClient::Order order = m_model->getRowData(row); const EffectShowClient::Order order = m_model->getRowData(row);
DEBUG_LOG(m_logger) << "--- onEditOrder() "; DEBUG_LOG(m_logger) << "--- onEditOrder() ";
if (order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut) if (order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::OrderCarriedOut)
return; return;
bool fireReadinessEnable = true; bool fireReadinessEnable = true;
const auto orders = m_dtc->orders(); const auto orders = m_dtc->orders();
for (const auto& ord : orders) for (const auto& ord : orders)
{ {
if (ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::FiringReadiness || if (ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::FiringReadiness ||
ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::InterruptExecution || ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::InterruptExecution ||
ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::Execution) ord.orderConfirmation() == EffectShowManagement::OrderConfirmation_e::Execution)
{ {
fireReadinessEnable = false; fireReadinessEnable = false;
@@ -106,16 +106,16 @@ void SafetyConfirmationWidget::onSafetyConfirmationDisplay()
{ {
switch (m_currentState.underlying()) switch (m_currentState.underlying())
{ {
case EffectShowClient::SafetyConfirmation_e_def::SafetyConfirmed: case EffectShowClient::SafetyConfirmation_e::SafetyConfirmed:
m_ui->ltsLedWidget->setColor(QColor(0, 255, 0)); m_ui->ltsLedWidget->setColor(QColor(0, 255, 0));
m_ui->ltsLedWidget->setStatus(true); m_ui->ltsLedWidget->setStatus(true);
break; break;
case EffectShowClient::SafetyConfirmation_e_def::SafetyExpiring: case EffectShowClient::SafetyConfirmation_e::SafetyExpiring:
m_ui->ltsLedWidget->setColor(QColor(0, 255, 0)); m_ui->ltsLedWidget->setColor(QColor(0, 255, 0));
m_ui->ltsLedWidget->setStatus(!m_ui->ltsLedWidget->status()); m_ui->ltsLedWidget->setStatus(!m_ui->ltsLedWidget->status());
QTimer::singleShot(800, this, &SafetyConfirmationWidget::onSafetyConfirmationDisplay); QTimer::singleShot(800, this, &SafetyConfirmationWidget::onSafetyConfirmationDisplay);
break; break;
case EffectShowClient::SafetyConfirmation_e_def::SafetyNotConfirmed: case EffectShowClient::SafetyConfirmation_e::SafetyNotConfirmed:
m_ui->ltsLedWidget->setColor(QColor(255, 0, 0)); m_ui->ltsLedWidget->setColor(QColor(255, 0, 0));
m_ui->ltsLedWidget->setStatus(true); m_ui->ltsLedWidget->setStatus(true);
break; break;
@@ -76,7 +76,7 @@ QString ForeignGuiComboboxInterfaceImpl::getAssignedAesField (const int particip
for (const auto &explosionCluster : m_aesDtc->explosionClusters()) for (const auto &explosionCluster : m_aesDtc->explosionClusters())
{ {
if (explosionCluster.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired) if (explosionCluster.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
continue; continue;
for ( const auto &esmParticipant : explosionCluster.esmParticipantIds()) for ( const auto &esmParticipant : explosionCluster.esmParticipantIds())
{ {
@@ -114,7 +114,7 @@ void ForeignGuiComboboxInterfaceImpl::initEffectShowActors()
ParticipantManagement::Participant participant = m_ppmDtc->participant(it.value()); ParticipantManagement::Participant participant = m_ppmDtc->participant(it.value());
EffectShowManagement::EffectShowVehicleStatus effectShowVehicleStatus = effectShowVehicleStatuss.value(it.value()); EffectShowManagement::EffectShowVehicleStatus effectShowVehicleStatus = effectShowVehicleStatuss.value(it.value());
int equipmentNumber = m_ppmDtc->equipmentNumberByParticipantId(effectShowVehicleStatus.esmParticipantId()); int equipmentNumber = m_ppmDtc->equipmentNumberByParticipantId(effectShowVehicleStatus.esmParticipantId());
bool isSmokeVehicle = effectShowVehicleStatus.feature() == Feature_e_def::Smoke; bool isSmokeVehicle = effectShowVehicleStatus.feature() == Feature_e::Smoke;
@@ -157,10 +157,10 @@ bool ForeignGuiComboboxInterfaceImpl::isMatchedByFilter(const EffectShowVehicleS
enum eFeature enum eFeature
{ {
NotSpecified = Feature_e_def::NotSpecified, NotSpecified = Feature_e::NotSpecified,
Smoke = Feature_e_def::Smoke, Smoke = Feature_e::Smoke,
Explosion24 = Feature_e_def::Explosion24, Explosion24 = Feature_e::Explosion24,
Explosion48 = Feature_e_def::Explosion48, Explosion48 = Feature_e::Explosion48,
SmokeAndExplosion48 = Explosion48 + 1 SmokeAndExplosion48 = Explosion48 + 1
}; };
@@ -224,13 +224,13 @@ QVariant EffectShowActorModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
switch (vehicleStatus.feature().underlying()) switch (vehicleStatus.feature().underlying())
{ {
case EffectShowManagement::Feature_e_def::Smoke: case EffectShowManagement::Feature_e::Smoke:
return tr("Smoke"); return tr("Smoke");
case EffectShowManagement::Feature_e_def::Explosion24: case EffectShowManagement::Feature_e::Explosion24:
return tr("Explosion (24)"); return tr("Explosion (24)");
case EffectShowManagement::Feature_e_def::Explosion48: case EffectShowManagement::Feature_e::Explosion48:
return tr("Explosion (48)"); return tr("Explosion (48)");
case EffectShowManagement::Feature_e_def::NotSpecified: case EffectShowManagement::Feature_e::NotSpecified:
return tr("Not specified"); return tr("Not specified");
} }
return tr("Unknown (%1)").arg(vehicleStatus.feature().underlying()); return tr("Unknown (%1)").arg(vehicleStatus.feature().underlying());
@@ -36,10 +36,10 @@ class EffectShowActorModel final : public LtsWidgets::LtsAbstractTableModel<Part
enum Columns { Name, Status, BITE, Feature, Position, EffectShow, Relocation, RestMagazine, RestAmmunition }; enum Columns { Name, Status, BITE, Feature, Position, EffectShow, Relocation, RestMagazine, RestAmmunition };
enum eFeature { enum eFeature {
NotSpecified = Feature_e_def::NotSpecified, NotSpecified = Feature_e::NotSpecified,
Smoke = Feature_e_def::Smoke, Smoke = Feature_e::Smoke,
Explosion24 = Feature_e_def::Explosion24, Explosion24 = Feature_e::Explosion24,
Explosion48 = Feature_e_def::Explosion48, Explosion48 = Feature_e::Explosion48,
SmokeAndExplosion48 = Explosion48 + 1 SmokeAndExplosion48 = Explosion48 + 1
}; };
@@ -135,10 +135,10 @@ bool EffectShowActorRelocationProxyModel::checkFilter(int source_row) const
const auto effectShowSource = m_sourceModel->getRowData(source_row); const auto effectShowSource = m_sourceModel->getRowData(source_row);
if (effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut && if (effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e::OrderCarriedOut &&
effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e_def::PositionReached && effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e::PositionReached &&
effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e_def::Abort && effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e::Abort &&
effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e_def::Nonacceptance) effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e::Nonacceptance)
return true; return true;
return false; return false;
@@ -149,9 +149,9 @@ QMap<int, QString> EffectShowModel::getParticipantList(bool is_smoke) const
continue; continue;
EffectShowManagement::Feature_e feature = m_effectShowActorModel->getFeature(realRow); EffectShowManagement::Feature_e feature = m_effectShowActorModel->getFeature(realRow);
if (feature != EffectShowManagement::Feature_e_def::NotSpecified && if (feature != EffectShowManagement::Feature_e::NotSpecified &&
((feature == EffectShowManagement::Feature_e_def::Smoke && is_smoke) || ((feature == EffectShowManagement::Feature_e::Smoke && is_smoke) ||
(feature != EffectShowManagement::Feature_e_def::Smoke && !is_smoke))) (feature != EffectShowManagement::Feature_e::Smoke && !is_smoke)))
ret.insert(part.id(), getParticipantName(part.id())); ret.insert(part.id(), getParticipantName(part.id()));
} }
return ret; return ret;
@@ -479,7 +479,7 @@ bool EffectShowProxyModel::checkFilter(int source_row) const
const auto effectShowSource = m_sourceModel->getRowData(source_row); const auto effectShowSource = m_sourceModel->getRowData(source_row);
if (effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut) if (effectShowSource.orderConfirmation() != EffectShowManagement::OrderConfirmation_e::OrderCarriedOut)
return true; return true;
return false; return false;
@@ -727,9 +727,9 @@ bool ExerciseManagementEditDialog::apply()
if (m_exerciseId > 0) if (m_exerciseId > 0)
{ {
ExerciseState state = static_cast<ExerciseState::type>(m_ui->cbState->currentData().toInt()); ExerciseState state = static_cast<ExerciseState>(m_ui->cbState->currentData().toInt());
ExerciseManagement::Exercise data = m_dtc->exercise(m_exerciseId); ExerciseManagement::Exercise data = m_dtc->exercise(m_exerciseId);
if (state == ExerciseState_def::Stopped && data.state() != ExerciseState_def::Stopped) if (state == ExerciseState::Stopped && data.state() != ExerciseState::Stopped)
{ {
if (LtsWidgets::LtsMessageDialog::showMessage( if (LtsWidgets::LtsMessageDialog::showMessage(
this, QString(), tr("Are you sure you want to stop the exercise?"), LtsWidgets::Behaviour::Modal, this, QString(), tr("Are you sure you want to stop the exercise?"), LtsWidgets::Behaviour::Modal,
@@ -737,7 +737,7 @@ bool ExerciseManagementEditDialog::apply()
retVal = false; retVal = false;
} }
else if (state == ExerciseState_def::Terminated && data.state() != ExerciseState_def::Terminated) else if (state == ExerciseState::Terminated && data.state() != ExerciseState::Terminated)
{ {
if (LtsWidgets::LtsMessageDialog::showMessage( if (LtsWidgets::LtsMessageDialog::showMessage(
this, QString(), tr("Are you sure you want to terminate the exercise?"), this, QString(), tr("Are you sure you want to terminate the exercise?"),
@@ -771,7 +771,7 @@ bool ExerciseManagementEditDialog::apply()
request.forces(m_ui->pteForces->toPlainText().toStdString()); request.forces(m_ui->pteForces->toPlainText().toStdString());
request.description(m_ui->pteDescription->toPlainText().toStdString()); request.description(m_ui->pteDescription->toPlainText().toStdString());
request.hasHlaInterface(m_ui->cbStartHlaInterface->isChecked()); request.hasHlaInterface(m_ui->cbStartHlaInterface->isChecked());
request.newState(static_cast<ExerciseState::type>(m_ui->cbState->currentData().toInt())); request.newState(static_cast<ExerciseState>(m_ui->cbState->currentData().toInt()));
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
request.workstationId(LtsSessionData::LtsSessionData::getInstance()->getWorkstationId()); request.workstationId(LtsSessionData::LtsSessionData::getInstance()->getWorkstationId());
@@ -145,8 +145,8 @@ void ExerciseManagementStateEdit::retranslate()
bool ExerciseManagementStateEdit::apply() bool ExerciseManagementStateEdit::apply()
{ {
ExerciseState exState = static_cast<ExerciseState::type>(m_ui->cbState->currentData().toInt()); ExerciseState exState = static_cast<ExerciseState>(m_ui->cbState->currentData().toInt());
if (exState.underlying() == ExerciseState_def::Stopped && if (exState.underlying() == ExerciseState::Stopped &&
LtsWidgets::LtsMessageDialog::showMessage(this, LtsWidgets::LtsMessageDialog::showMessage(this,
tr("Are you sure you want to stop the exercise?"), tr("Are you sure you want to stop the exercise?"),
tr("Stop Exercise"), tr("Stop Exercise"),
@@ -177,7 +177,7 @@ bool ExerciseManagementStateEdit::apply()
request.defaultTimeZone(m_exercise.defaultTimeZone()); request.defaultTimeZone(m_exercise.defaultTimeZone());
request.forces(m_exercise.forces()); request.forces(m_exercise.forces());
request.description(m_exercise.description()); request.description(m_exercise.description());
request.newState(static_cast<ExerciseState::type>(m_ui->cbState->currentData().toInt())); request.newState(static_cast<ExerciseState>(m_ui->cbState->currentData().toInt()));
if(!m_requestHelper->startSingleRequest( if(!m_requestHelper->startSingleRequest(
[this, request]() { [this, request]() {
@@ -99,7 +99,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
FlmHQReportModel *planModel = new FlmHQReportModel(m_ui->listViewPlan); FlmHQReportModel *planModel = new FlmHQReportModel(m_ui->listViewPlan);
if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan)) if (!planModel->init(m_session, partyFolderId, FileType::TacticalPlan))
{ {
WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId; WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId;
@@ -113,7 +113,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId)
FlmHQReportModel *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage); FlmHQReportModel *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage);
if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson)) if (!hqReportModel->init(m_session, hqReportFolderId, FileType::AdlerJson))
{ {
WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId; WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId;
@@ -176,7 +176,7 @@ void HQReportEdit::createModels(const int partyId)
delete m_hqModels.take(partyId); delete m_hqModels.take(partyId);
auto *planModel = new FlmHQReportModel(m_ui->listViewPlan); auto *planModel = new FlmHQReportModel(m_ui->listViewPlan);
if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan)) if (!planModel->init(m_session, partyFolderId, FileType::TacticalPlan))
{ {
WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId; WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId;
delete planModel; delete planModel;
@@ -184,7 +184,7 @@ void HQReportEdit::createModels(const int partyId)
} }
auto *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage); auto *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage);
if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson)) if (!hqReportModel->init(m_session, hqReportFolderId, FileType::AdlerJson))
{ {
WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId; WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId;
delete planModel; delete planModel;
@@ -169,38 +169,38 @@ void FileTopicEditor::updateInternalData()
switch (m_topicData.topicType) switch (m_topicData.topicType)
{ {
case TopicEditorBase::TopicType::Image: case TopicEditorBase::TopicType::Image:
m_fileTypes << FileManagement::FileType_def::Jpg << FileManagement::FileType_def::Png; m_fileTypes << FileManagement::FileType::Jpg << FileManagement::FileType::Png;
break; break;
case TopicEditorBase::TopicType::Pdf: case TopicEditorBase::TopicType::Pdf:
m_fileTypes << FileManagement::FileType_def::Pdf; m_fileTypes << FileManagement::FileType::Pdf;
break; break;
case TopicEditorBase::TopicType::Text: case TopicEditorBase::TopicType::Text:
m_fileTypes << FileManagement::FileType_def::Text << FileManagement::FileType_def::EvaluationSchema; m_fileTypes << FileManagement::FileType::Text << FileManagement::FileType::EvaluationSchema;
break; break;
case TopicEditorBase::TopicType::Xml: case TopicEditorBase::TopicType::Xml:
m_fileTypes << FileManagement::FileType_def::Xml; m_fileTypes << FileManagement::FileType::Xml;
break; break;
case TopicEditorBase::TopicType::TacticalPlan: case TopicEditorBase::TopicType::TacticalPlan:
m_fileTypes << FileManagement::FileType_def::TacticalPlan; m_fileTypes << FileManagement::FileType::TacticalPlan;
break; break;
case TopicEditorBase::TopicType::MSOffice: case TopicEditorBase::TopicType::MSOffice:
m_fileTypes << FileManagement::FileType_def::MSOfficeDocument m_fileTypes << FileManagement::FileType::MSOfficeDocument
<< FileManagement::FileType_def::MSOfficeDocument97 << FileManagement::FileType::MSOfficeDocument97
<< FileManagement::FileType_def::MSOfficePresentation << FileManagement::FileType::MSOfficePresentation
<< FileManagement::FileType_def::MSOfficePresentation97 << FileManagement::FileType::MSOfficePresentation97
<< FileManagement::FileType_def::MSOfficeSpreadsheet << FileManagement::FileType::MSOfficeSpreadsheet
<< FileManagement::FileType_def::MSOfficeSpreadsheet97; << FileManagement::FileType::MSOfficeSpreadsheet97;
break; break;
case TopicEditorBase::TopicType::OpenOffice: case TopicEditorBase::TopicType::OpenOffice:
m_fileTypes << FileManagement::FileType_def::OpenOfficeDocument m_fileTypes << FileManagement::FileType::OpenOfficeDocument
<< FileManagement::FileType_def::OpenOfficePresentation << FileManagement::FileType::OpenOfficePresentation
<< FileManagement::FileType_def::OpenOfficeSpreadsheet; << FileManagement::FileType::OpenOfficeSpreadsheet;
break; break;
default: default:
@@ -1290,7 +1290,7 @@ FileManagement::FileType FileManagementDialogWidget::getFileType(const QString&
if (fti.extension() == ext) if (fti.extension() == ext)
{ {
type = static_cast<FileType::type>(fti.id()); type = static_cast<FileType>(fti.id());
return true; return true;
} }
return false; return false;
Loaded 100 of 512 files, more files were not shown because too many files have changed in this diff. Show more