Merge feature/qt6-migration-basis-modules-merge-viewer-validation into feature/migrate-lts-projects-and-application
Cherry-picks5501d1e50(stub-header updates, superseded by4223ca2ffrelocation); resolves 1 content + 24 modify/delete conflicts; validates BUILD_RTI=ON BUILD_GRANTLEE=ON incl. Tools Groups 6-11.
This commit is contained in:
1295 files changed
+22136
-20217
No files matched your search
@@ -43,7 +43,8 @@ QString DataTopicWrapper::typeFq() const
|
||||
|
||||
QString MemberInformationWrapper::ddsToQVariant() const
|
||||
{
|
||||
return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral("())");
|
||||
// rtiddsgen 7.7 generates plain public members - access them directly.
|
||||
return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral(")");
|
||||
}
|
||||
|
||||
QString MemberInformationWrapper::qVariantToDds() const
|
||||
@@ -51,7 +52,7 @@ QString MemberInformationWrapper::qVariantToDds() const
|
||||
const QString ddsType =
|
||||
isOptional() ? (QStringLiteral("dds::core::optional<") + cppDdsType() + QLatin1Char('>')) : (cppDdsType());
|
||||
|
||||
return QStringLiteral("data.") + cppMemberName() + QStringLiteral("() = fromQVariant<") + ddsType +
|
||||
return QStringLiteral("data.") + cppMemberName() + QStringLiteral(" = fromQVariant<") + ddsType +
|
||||
QStringLiteral(">(q.value(i++))");
|
||||
}
|
||||
|
||||
@@ -61,14 +62,15 @@ QString MemberInformationWrapper::ddsToJsonElement() const
|
||||
if (cppMemberName().isEmpty())
|
||||
return QStringLiteral("obj[QStringLiteral(\"") + cppType() + QStringLiteral("\")] = element;");
|
||||
|
||||
const QString memberAccess = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
|
||||
// rtiddsgen 7.7 generates plain public members for every kind of
|
||||
// member (struct or not), so no getter call is emitted.
|
||||
const QString memberAccess = cppMemberName();
|
||||
if (!isOptional())
|
||||
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||
QStringLiteral("element.") + memberAccess + cppToJsonPost();
|
||||
|
||||
const QString optionalAccess =
|
||||
isCppStruct() ? cppMemberName() + QStringLiteral(".is_set()") : cppMemberName() + QStringLiteral("().is_set()");
|
||||
const QString getValue = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
|
||||
const QString optionalAccess = cppMemberName() + QStringLiteral(".is_set()");
|
||||
const QString getValue = cppMemberName();
|
||||
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
|
||||
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||
QStringLiteral("*element.") + getValue + cppToJsonPost();
|
||||
@@ -86,12 +88,10 @@ QString MemberInformationWrapper::jsonElementToDds() const
|
||||
if (isOptional())
|
||||
ret += QStringLiteral("if (!val.isNull()) ");
|
||||
|
||||
if (isCppStruct())
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost();
|
||||
else
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral("(") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost() + QStringLiteral(")");
|
||||
// rtiddsgen 7.7 generates plain public members - assign instead of
|
||||
// calling a setter.
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,9 @@ class IdlDataWrapper final : public NameWrapper
|
||||
|
||||
QString nameGetter() const
|
||||
{
|
||||
return m_data.name + (m_data.isOptional ? QStringLiteral("().get") : QString());
|
||||
// rtiddsgen 7.7 generates public data members (no getters); optional
|
||||
// members are omg::types::optional<T> and are unwrapped via .get().
|
||||
return m_data.name + (m_data.isOptional ? QStringLiteral(".get()") : QString());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -874,6 +874,13 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation& mi) const
|
||||
datatype == QLatin1String("long long"))
|
||||
{
|
||||
mi.cpp.type = QStringLiteral("qint64");
|
||||
// IDL `long long` is int64_t (long) in the rtiddsgen 4.7 output, while the Qt side is
|
||||
// qint64 (long long). Those are distinct types, so assignments such as
|
||||
// `optional<int64_t> = optional<qint64>` do not compile. Carry the generated type
|
||||
// separately, as the sequence<octet> branch below already does, so the DDS-facing code
|
||||
// emitted from cppDdsType() names the type the struct member really has. The spelling
|
||||
// is the one rtiddsgen itself writes, matching what the `long` branch does with int32_t.
|
||||
mi.cpp.ddsType = QStringLiteral("int64_t");
|
||||
mi.cpp.fromVariantPost = QStringLiteral(".toLongLong()");
|
||||
mi.cpp.fromJsonPost = QStringLiteral(".toDouble()");
|
||||
mi.cpp.toJsonPre = QStringLiteral("static_cast<qint64>(");
|
||||
@@ -1039,7 +1046,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
|
||||
pre += columnNamePrefix;
|
||||
pre += member.name + QLatin1Char('_');
|
||||
ret += buildDbTableInformationFromIdlData(cttiChild, tableName, StructBuilder::camelCaseToUnderline(pre),
|
||||
cppStructure + member.name + QStringLiteral("()."));
|
||||
cppStructure + member.name + QStringLiteral("."));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Dao::Dao(int exerciseId)
|
||||
, m_bEmitMessageOnError(true)
|
||||
, m_bCanHandleSchemas(true)
|
||||
, m_ownDatabaseConnection(true)
|
||||
, m_logger(&getLogger("Db"))
|
||||
, m_logger(getLogger("Db"))
|
||||
{}
|
||||
|
||||
Dao::~Dao()
|
||||
@@ -55,7 +55,7 @@ bool Dao::init(const QString &dbUser,
|
||||
{
|
||||
m_ownDatabaseConnection = true;
|
||||
|
||||
m_dbConnection = DBConnection::open(*m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
m_dbConnection = DBConnection::open(m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
|
||||
return initInternal();
|
||||
}
|
||||
@@ -65,15 +65,15 @@ bool Dao::initInternal()
|
||||
QSqlDriver *driver = m_dbConnection.driver();
|
||||
if (!driver)
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "No SQL driver loaded - no database available!";
|
||||
WARNING_LOG(m_logger) << "No SQL driver loaded - no database available!";
|
||||
return false;
|
||||
}
|
||||
const QString driverName = m_dbConnection.driverName();
|
||||
DEBUG_LOG(*m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
DEBUG_LOG(m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
<< ", schema: " << schemaName() << ", used driver: " << driverName;
|
||||
if (!m_dbConnection.isOpen())
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
WARNING_LOG(m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
return false;
|
||||
}
|
||||
if (driverName == QLatin1String("QSQLITE"))
|
||||
@@ -82,7 +82,7 @@ bool Dao::initInternal()
|
||||
{% if has_db_notifications %}
|
||||
if (!driver->hasFeature(QSqlDriver::EventNotifications))
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
WARNING_LOG(m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,7 +91,7 @@ bool Dao::initInternal()
|
||||
{% for cpp_struct in cpp_structs %}{% for db_notify in cpp_struct.dbNotifications %}driver->subscribeToNotification(QStringLiteral("{{ db_notify }}"));{% endfor %}{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, *m_logger));
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, m_logger));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ QSqlError Dao::getLastError() const
|
||||
{% if has_db_notifications %}
|
||||
void Dao::onNotification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload)
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "Notification source = " << source;
|
||||
DEBUG_LOG(m_logger) << "Notification source = " << source;
|
||||
if (source == QSqlDriver::SelfSource)
|
||||
return;
|
||||
// search coresponding signal
|
||||
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
bool m_bEmitMessageOnError;
|
||||
bool m_bCanHandleSchemas;
|
||||
bool m_ownDatabaseConnection;
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
|
||||
private:
|
||||
bool initInternal();
|
||||
|
||||
@@ -50,7 +50,7 @@ DatabaseInterfaceImpl::DatabaseInterfaceImpl(int exerciseId)
|
||||
, m_bEmitMessageOnError(true)
|
||||
, m_bCanHandleSchemas(true)
|
||||
, m_ownDatabaseConnection(true)
|
||||
, m_logger(&getLogger("Db"))
|
||||
, m_logger(getLogger("Db"))
|
||||
{}
|
||||
|
||||
DatabaseInterfaceImpl::~DatabaseInterfaceImpl()
|
||||
@@ -83,7 +83,7 @@ bool DatabaseInterfaceImpl::init(const QString &dbUser,
|
||||
{
|
||||
m_ownDatabaseConnection = true;
|
||||
|
||||
m_dbConnection = DBConnection::open(*m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
m_dbConnection = DBConnection::open(m_logger, dbUser, dbPasswd, dbDriver, dbHost, dbName, schemaName());
|
||||
|
||||
return initInternal();
|
||||
}
|
||||
@@ -93,15 +93,15 @@ bool DatabaseInterfaceImpl::initInternal()
|
||||
QSqlDriver *driver = m_dbConnection.driver();
|
||||
if (!driver)
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "No SQL driver loaded - no database available!";
|
||||
WARNING_LOG(m_logger) << "No SQL driver loaded - no database available!";
|
||||
return false;
|
||||
}
|
||||
const QString driverName = m_dbConnection.driverName();
|
||||
DEBUG_LOG(*m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
DEBUG_LOG(m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName()
|
||||
<< ", schema: " << schemaName() << ", used driver: " << driverName;
|
||||
if (!m_dbConnection.isOpen())
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
WARNING_LOG(m_logger) << "Database connection is no open - can not initialize database interface";
|
||||
return false;
|
||||
}
|
||||
if (driverName == QLatin1String("QSQLITE"))
|
||||
@@ -110,7 +110,7 @@ bool DatabaseInterfaceImpl::initInternal()
|
||||
{% if has_db_notifications %}
|
||||
if (!driver->hasFeature(QSqlDriver::EventNotifications))
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
WARNING_LOG(m_logger) << "Can not subscribe to notifications - sqldriver does not support this feature!";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,7 +120,7 @@ bool DatabaseInterfaceImpl::initInternal()
|
||||
driver->subscribeToNotification(QStringLiteral("{{ db_notify }}"));{% endfor %}{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, *m_logger));
|
||||
m_query = std::unique_ptr<NSqlQuery>(new NSqlQuery(m_dbConnection, m_logger));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ QSqlError DatabaseInterfaceImpl::getLastError() const
|
||||
{% if has_db_notifications %}
|
||||
void DatabaseInterfaceImpl::onNotification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload)
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "Notification source = " << source;
|
||||
DEBUG_LOG(m_logger) << "Notification source = " << source;
|
||||
// no need to emit notification signals
|
||||
if (source == QSqlDriver::SelfSource)
|
||||
return;
|
||||
@@ -561,7 +561,7 @@ bool DatabaseInterfaceImpl::selectBy{{ fk.cppMemberNameCc }}(QVector<Database::{
|
||||
SqlQueryJanitor janitor(m_query);
|
||||
if (!selectPrepareInternal{{ cpp_struct.name }}(QStringLiteral(" WHERE {{ fk.dbColumnName }} = :{{ fk.dbColumnName }}") + orderBy))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
ERROR_LOG(m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
m_lastError = m_query->lastError();
|
||||
return false;
|
||||
}
|
||||
@@ -578,7 +578,7 @@ bool DatabaseInterfaceImpl::selectBy{{ fk.cppMemberNameCc }}(const std::function
|
||||
SqlQueryJanitor janitor(m_query);
|
||||
if (!selectPrepareInternal{{ cpp_struct.name }}(QStringLiteral(" WHERE {{ fk.dbColumnName }} = :{{ fk.dbColumnName }}") + orderBy))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
ERROR_LOG(m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
m_lastError = m_query->lastError();
|
||||
return false;
|
||||
}
|
||||
@@ -658,7 +658,7 @@ bool DatabaseInterfaceImpl::remove{{ cpp_struct.nameCc }}By{{ fk.cppMemberNameCc
|
||||
|
||||
if (!m_query->prepare(stmt))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
ERROR_LOG(m_logger) << "Error preparing query: " << m_query->lastError().text();
|
||||
m_lastError = m_query->lastError();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ protected:
|
||||
bool m_bEmitMessageOnError;
|
||||
bool m_bCanHandleSchemas;
|
||||
bool m_ownDatabaseConnection;
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
private:
|
||||
bool initInternal();
|
||||
};// class DatabaseInterfaceImpl
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{% endif %}
|
||||
|
||||
#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 %}
|
||||
#include <{{ ext_service.baseFilePath }}.hpp>
|
||||
|
||||
@@ -63,7 +63,7 @@ std::shared_ptr<Dtc> Dtc::create(const std::shared_ptr<DDSConnector::DdsConnecto
|
||||
DtcImpl::DtcImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: Dtc()
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_logger(&getLogger("Dtc"))
|
||||
, m_logger(getLogger("Dtc"))
|
||||
{}
|
||||
|
||||
DtcImpl::~DtcImpl()
|
||||
@@ -75,7 +75,7 @@ bool DtcImpl::enableAll(bool enable)
|
||||
{ {% for dt in dataTopics.member %} {% if dt.dtcImpl %} {% if dt.autosubscribe %}
|
||||
if (!enable{{ dt.name }}(enable))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error initializing data topic {{ dt.name }}";
|
||||
ERROR_LOG(m_logger) << "Error initializing data topic {{ dt.name }}";
|
||||
return false;
|
||||
}
|
||||
{% endif %} {% endif %} {% endfor %}
|
||||
@@ -97,7 +97,7 @@ bool DtcImpl::checkEnabled(const DTC &dtc) const
|
||||
if (!dtc)
|
||||
{
|
||||
using TOPIC = typename DtcConstraints<DTC>::TOPIC ;
|
||||
WARNING_LOG(*m_logger) << "Error retrieving data topic "
|
||||
WARNING_LOG(m_logger) << "Error retrieving data topic "
|
||||
<< DDS::topic_type_name<TOPIC>::value() << " - not enabled";
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
@@ -176,7 +176,7 @@ bool DtcImpl::enable{{ dt.name }}(bool enable)
|
||||
{
|
||||
if (m_dtc{{ dt.name }})
|
||||
{
|
||||
INFO_LOG(*m_logger) << "{{ dt.name }} already enabled!";
|
||||
INFO_LOG(m_logger) << "{{ dt.name }} already enabled!";
|
||||
return true;
|
||||
}
|
||||
m_dtc{{ dt.name }}.reset(m_ddsConnector->createDTC<DTC::{{ dt.name }}Impl>());
|
||||
@@ -200,7 +200,7 @@ bool DtcImpl::waitForHistoricalData{{ dt.name }}(int timeoutMSec)
|
||||
if (!is{{ dt.name }}Enabled())
|
||||
{
|
||||
enable{{ dt.name }}();
|
||||
DEBUG_LOG(*m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
DEBUG_LOG(m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
}
|
||||
|
||||
if (!waitForHistoricalData(m_dtc{{ dt.name }}, timeoutMSec))
|
||||
@@ -228,7 +228,7 @@ QMap<{{ dt.key.cppType }},::{{ namespace }}::{{ dt.type }}> DtcImpl::{{ dt.nameF
|
||||
if (!is{{ dt.name }}Enabled())
|
||||
{
|
||||
enable{{ dt.name }}();
|
||||
DEBUG_LOG(*m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
DEBUG_LOG(m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
waitForHistoricalData{{ dt.name }}(10);
|
||||
}
|
||||
return m_{{ dt.nameFlc }}Cont;
|
||||
@@ -239,7 +239,7 @@ bool DtcImpl::{{ dt.nameFlc }}s(const std::function<void(const ::{{ namespace }}
|
||||
if (!is{{ dt.name }}Enabled())
|
||||
{
|
||||
enable{{ dt.name }}();
|
||||
DEBUG_LOG(*m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
DEBUG_LOG(m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
waitForHistoricalData{{ dt.name }}(10);
|
||||
}
|
||||
return iterateAll(m_dtc{{ dt.name }}, m_{{ dt.nameFlc }}Cont, cb);
|
||||
@@ -250,7 +250,7 @@ bool DtcImpl::{{ dt.nameFlc }}s(const std::function<bool(const ::{{ namespace }}
|
||||
if (!is{{ dt.name }}Enabled())
|
||||
{
|
||||
enable{{ dt.name }}();
|
||||
DEBUG_LOG(*m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
DEBUG_LOG(m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
waitForHistoricalData{{ dt.name }}(10);
|
||||
}
|
||||
return iterateUntil(m_dtc{{ dt.name }}, m_{{ dt.nameFlc }}Cont, cb);
|
||||
@@ -261,7 +261,7 @@ bool DtcImpl::{{ dt.nameFlc }}s(const std::function<bool(const ::{{ namespace }}
|
||||
if (!is{{ dt.name }}Enabled())
|
||||
{
|
||||
enable{{ dt.name }}();
|
||||
DEBUG_LOG(*m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
DEBUG_LOG(m_logger) << "NEED TO ENABLE ! {{ dt.name }}" ;
|
||||
waitForHistoricalData{{ dt.name }}(10);
|
||||
}
|
||||
return getOne(m_dtc{{ dt.name }}, m_{{ dt.nameFlc }}Cont, {{ dt.key.nameFlc }});
|
||||
|
||||
@@ -95,7 +95,7 @@ protected:
|
||||
::{{ namespace }}::{{ dt.type }} m_{{ dt.nameFlc }};
|
||||
{% endif %} {% endif %} {% endfor %}
|
||||
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
|
||||
signals:
|
||||
{% for dt in dataTopics.member %}
|
||||
|
||||
@@ -25,7 +25,7 @@ std::shared_ptr<Dts> Dts::create(const std::shared_ptr<DDSConnector::DdsConnecto
|
||||
DtsImpl::DtsImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: Dts()
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_logger(&getLogger("Dts"))
|
||||
, m_logger(getLogger("Dts"))
|
||||
{}
|
||||
|
||||
DtsImpl::~DtsImpl()
|
||||
@@ -38,7 +38,7 @@ bool DtsImpl::enableAll(bool enable)
|
||||
{% for dt in dataTopics.member %} {% if dt.dtsImpl %}
|
||||
if (!enable{{ dt.name }}(enable))
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error initializing data topic {{ dt.name }}";
|
||||
WARNING_LOG(m_logger) << "Error initializing data topic {{ dt.name }}";
|
||||
return false;
|
||||
}
|
||||
{% endif %} {% endfor %}
|
||||
@@ -55,7 +55,7 @@ bool DtsImpl::enable{{ dt.name }}(bool enable)
|
||||
{
|
||||
if (m_dts{{ dt.name }})
|
||||
{
|
||||
INFO_LOG(*m_logger) << "{{ ft.name }} already enabled!";
|
||||
INFO_LOG(m_logger) << "{{ ft.name }} already enabled!";
|
||||
return true;
|
||||
}
|
||||
m_dts{{ dt.name }}.reset(m_ddsConnector->createDTS<DTS::{{ dt.name }}Impl>());
|
||||
@@ -72,7 +72,7 @@ bool DtsImpl::publish(const {{ namespace }}::{{ dt.type }} &data)
|
||||
{
|
||||
if (!m_dts{{ dt.name }})
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error publishing data topic {{ dt.name }} - not enabled";
|
||||
WARNING_LOG(m_logger) << "Error publishing data topic {{ dt.name }} - not enabled";
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
@@ -84,11 +84,13 @@ bool DtsImpl::remove{{ dt.name }}ByKey({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc
|
||||
{
|
||||
if (!m_dts{{ dt.name }})
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error removing data topic {{ dt.name }} - not enabled";
|
||||
WARNING_LOG(m_logger) << "Error removing data topic {{ dt.name }} - not enabled";
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
{{ namespace }}::{{ dt.name }} data;
|
||||
// rtiddsgen -stl generates plain public data members, so the key is
|
||||
// assigned directly instead of the old setter call data.{{ dt.key.name }}(...).
|
||||
data.{{ dt.key.name }} = {{ dt.key.name }};
|
||||
return m_dts{{ dt.name }}->remove(data, errorMsgIfSampleDoesNotExists);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ protected:
|
||||
{% for dt in dataTopics.member %} {% if dt.dtsImpl %}
|
||||
std::unique_ptr<DTS::{{ dt.name }}> m_dts{{ dt.name }};
|
||||
{% endif %} {% endfor %}
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
|
||||
@@ -53,14 +53,14 @@ Q_DECL_EXPORT std::shared_ptr<Ftc> Ftc::create(const std::shared_ptr<DDSConnecto
|
||||
FtcImpl::FtcImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: Ftc()
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_logger(&getLogger("Ftc"))
|
||||
, m_logger(getLogger("Ftc"))
|
||||
{}
|
||||
|
||||
bool FtcImpl::enableAll(bool enable)
|
||||
{ {% for ft in functionTopics.member %}
|
||||
if (!enable{{ ft.name }}(enable))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error initializing function topic {{ ft.name }}";
|
||||
ERROR_LOG(m_logger) << "Error initializing function topic {{ ft.name }}";
|
||||
return false;
|
||||
}
|
||||
{% endfor %}
|
||||
@@ -80,7 +80,7 @@ bool FtcImpl::enable{{ ft.name }}(bool enable)
|
||||
{
|
||||
if (m_ftc{{ ft.name }})
|
||||
{
|
||||
INFO_LOG(*m_logger) << "{{ ft.name }} already enabled!";
|
||||
INFO_LOG(m_logger) << "{{ ft.name }} already enabled!";
|
||||
return true;
|
||||
}
|
||||
m_ftc{{ ft.name }}.reset(
|
||||
@@ -116,17 +116,9 @@ static T buildErrorReason(int reason, int requestId)
|
||||
}
|
||||
|
||||
T reply;
|
||||
{% if ft.isCoreFt %}
|
||||
reply.setId(requestId);
|
||||
reply.setStr(errString.c_str());
|
||||
for (const auto& arg : errArgs)
|
||||
reply.arg(arg);
|
||||
{% else %}
|
||||
reply.id = requestId;
|
||||
reply.errorString = errString.c_str();
|
||||
for (const auto& arg : errArgs)
|
||||
reply.errorParams.push_back(arg);
|
||||
{% endif %}
|
||||
reply.errorString = errString;
|
||||
reply.errorParams = errArgs;
|
||||
return reply;
|
||||
}
|
||||
|
||||
@@ -143,7 +135,7 @@ int64_t FtcImpl::{{ ft.requestFlc }}(const {{ ft.requestType }} &request, const
|
||||
{
|
||||
if (!m_ftc{{ ft.name }})
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error requesting function topic {{ ft.name }} - not enabled";
|
||||
WARNING_LOG(m_logger) << "Error requesting function topic {{ ft.name }} - not enabled";
|
||||
Q_ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
@@ -203,17 +195,14 @@ int64_t FtcImpl::{{ ft.requestFlc }}(const {{ ft.requestType }} &request, const
|
||||
{% if ft.isCoreFt %}
|
||||
const auto _reply = future.get(); // throws if exception set
|
||||
|
||||
Core::FunctionReplyObject fro;
|
||||
fro.setId(_reply.id);
|
||||
fro.setStr(_reply.errorString.c_str());
|
||||
for (const auto& arg : _reply.errorParams)
|
||||
fro.arg(arg);
|
||||
fro.setAdditionalInfo(_reply.additionalInfo.c_str());
|
||||
Core::FunctionReplyObject fro(
|
||||
{% for rp in ft.replyParams %} _reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
|
||||
);
|
||||
fro.setUniqueId(m_last{{ ft.request }}UniqueId);
|
||||
|
||||
if (fro.error())
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "FTC call failed: " << fro.translated();
|
||||
ERROR_LOG(m_logger) << "FTC call failed: " << fro.translated();
|
||||
throw std::runtime_error(fro.translated().toStdString().c_str());
|
||||
}
|
||||
|
||||
@@ -230,7 +219,7 @@ void FtcImpl::{{ ft.onReply }}(const {{ namespace }}::{{ ft.reply }} &reply, int
|
||||
auto it = m_{{ ft.replyHandlerFlc }}.find(uniqueId);
|
||||
if (it == m_{{ ft.replyHandlerFlc }}.end())
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error replying function topic {{ ft.name }} - no replyHandler";
|
||||
WARNING_LOG(m_logger) << "Error replying function topic {{ ft.name }} - no replyHandler";
|
||||
Q_ASSERT(false);
|
||||
return;
|
||||
}
|
||||
@@ -243,12 +232,10 @@ void FtcImpl::{{ ft.onReply }}(const {{ namespace }}::{{ ft.reply }} &reply, int
|
||||
|
||||
m_last{{ ft.request }}UniqueId = uniqueId + {{ ft.replyHandlerHash }};
|
||||
{% if ft.isCoreFt %}
|
||||
Core::FunctionReplyObject fro;
|
||||
fro.setId(reply.id);
|
||||
fro.setStr(reply.errorString.c_str());
|
||||
for (const auto& arg : reply.errorParams)
|
||||
fro.arg(arg);
|
||||
fro.setAdditionalInfo(reply.additionalInfo.c_str());
|
||||
Core::FunctionReplyObject fro(
|
||||
{% for rp in ft.replyParams %}
|
||||
reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
|
||||
);
|
||||
fro.setUniqueId(m_last{{ ft.request }}UniqueId);
|
||||
cb(fro);
|
||||
{% else %}
|
||||
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
|
||||
private:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace Interface
|
||||
} // namespace {{ namespace }}
|
||||
|
||||
@@ -24,7 +24,7 @@ std::shared_ptr<Fts> Fts::create(const std::shared_ptr<DDSConnector::DdsConnecto
|
||||
FtsImpl::FtsImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: Fts()
|
||||
, m_ddsConnector(ddsConnector)
|
||||
, m_logger(&getLogger("Fts"))
|
||||
, m_logger(getLogger("Fts"))
|
||||
{}
|
||||
|
||||
FtsImpl::~FtsImpl()
|
||||
@@ -34,11 +34,11 @@ FtsImpl::~FtsImpl()
|
||||
|
||||
bool FtsImpl::enableAll(bool enable)
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "FtsImpl::enableAll(" << (enable ? "true" : "false") << ")";
|
||||
DEBUG_LOG(m_logger) << "FtsImpl::enableAll(" << (enable ? "true" : "false") << ")";
|
||||
{% for ft in functionTopics.member %}
|
||||
if (!enable{{ ft.name }}(enable))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error initializing function topic {{ ft.name }}";
|
||||
ERROR_LOG(m_logger) << "Error initializing function topic {{ ft.name }}";
|
||||
return false;
|
||||
}
|
||||
{% endfor %}
|
||||
@@ -55,7 +55,7 @@ bool FtsImpl::enable{{ ft.name }}(bool enable)
|
||||
{
|
||||
if (m_fts{{ ft.name }})
|
||||
{
|
||||
INFO_LOG(*m_logger) << "{{ ft.name }} already enabled!";
|
||||
INFO_LOG(m_logger) << "{{ ft.name }} already enabled!";
|
||||
return true;
|
||||
}
|
||||
m_fts{{ ft.name }}.reset(m_ddsConnector->createFTS<FTS::{{ ft.name }}>());
|
||||
@@ -73,7 +73,7 @@ bool FtsImpl::{{ ft.replyFlc }}(const rti::core::SampleIdentity &cookie, const {
|
||||
{
|
||||
if (!m_fts{{ ft.name }})
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Error publishing function topic {{ dt.name }} - not enabled";
|
||||
WARNING_LOG(m_logger) << "Error publishing function topic {{ dt.name }} - not enabled";
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
@@ -96,10 +96,10 @@ void FtsImpl::set{{ ft.requestHandler }}({{ ft.requestHandler }} *handler)
|
||||
void FtsImpl::{{ ft.onRequest }}(const rti::core::SampleIdentity &cookie,
|
||||
const {{ namespace }}::{{ ft.request }} &request)
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "{{ ft.onRequest }}";
|
||||
DEBUG_LOG(m_logger) << "{{ ft.onRequest }}";
|
||||
if (!m_{{ ft.requestHandlerFlc }})
|
||||
{
|
||||
WARNING_LOG(*m_logger) << "Incoming {{ ft.request }} without registered handler!";
|
||||
WARNING_LOG(m_logger) << "Incoming {{ ft.request }} without registered handler!";
|
||||
Q_ASSERT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
private:
|
||||
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
NGL::INGLLogger* m_logger;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
|
||||
@@ -48,6 +48,18 @@ QJsonValue toJson(qint64 vec)
|
||||
{
|
||||
return QJsonValue(QString::number(vec));
|
||||
}
|
||||
// IDL 64-bit integers map to int64_t, which is 'long' on LP64 and therefore
|
||||
// distinct from qint64 ('long long'); without this overload the generic
|
||||
// toJson(std::vector<T>) is ambiguous for sequence<int64_t> members.
|
||||
QJsonValue toJson(long vec)
|
||||
{
|
||||
return QJsonValue(QString::number(vec));
|
||||
}
|
||||
template<>
|
||||
long fromJson(const QJsonValue &val, type<long>)
|
||||
{
|
||||
return val.toString().toLong();
|
||||
}
|
||||
|
||||
// std::string
|
||||
QJsonValue toJson(const std::string &element)
|
||||
|
||||
+69
-26
@@ -171,8 +171,20 @@ std::vector<T> fromJson(const QVariant &jsonData, type<std::vector<T>>)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Primary fallback for any migrated plain-`enum class` enumerators that have no
|
||||
// explicit specialization below - most importantly the nested foreign
|
||||
// ProjectDataManagement / Core enums a plugin reads back from the database (they are
|
||||
// not in this service's idl_enums, so the per-own-enum specializations do not cover
|
||||
// them). Giving the primary template a body (rather than leaving it declaration-only)
|
||||
// is what lets those foreign-enum instantiations resolve, so the plugin .so links. The
|
||||
// explicit specializations for primitives / own enums / structs / vectors / optionals
|
||||
// all take precedence over this fallback, so it is only ever instantiated for an enum
|
||||
// type, where `static_cast<T>(val.toInt())` is the correct conversion.
|
||||
template<typename T>
|
||||
T fromQVariant(const QVariant &val, type<T>);
|
||||
T fromQVariant(const QVariant &val, type<T>)
|
||||
{
|
||||
return static_cast<T>(val.toInt());
|
||||
}
|
||||
|
||||
template<>
|
||||
bool fromQVariant(const QVariant &val, type<bool>)
|
||||
@@ -198,6 +210,17 @@ long long fromQVariant(const QVariant &val, type<long long>)
|
||||
return val.toLongLong();
|
||||
}
|
||||
|
||||
// rtiddsgen 4.7 spells the 64 bit integer members int64_t, which is `long` on LP64 and thus
|
||||
// a different type from the Qt side's qint64 (`long long`). The tag dispatch above is keyed on
|
||||
// the exact type, so the generated type needs its own conversion even though the two are the
|
||||
// same width. GrantleeWrappers::cppDdsType() names the generated member type, so this is the
|
||||
// overload the record replay code instantiates for those members.
|
||||
template<>
|
||||
int64_t fromQVariant(const QVariant &val, type<int64_t>)
|
||||
{
|
||||
return static_cast<int64_t>(val.toLongLong());
|
||||
}
|
||||
|
||||
template<>
|
||||
double fromQVariant(const QVariant &val, type<double>)
|
||||
{
|
||||
@@ -255,6 +278,23 @@ T fromQVariant(const QVariant &val)
|
||||
return fromQVariant(val, type<T>{});
|
||||
}
|
||||
|
||||
// rtiddsgen 7.7 spells the migrated enumerators as plain `enum class` in the service
|
||||
// namespace (the legacy dds::core::safe_enum<T> wrapper is gone). The record_replay
|
||||
// plugin still instantiates fromQVariant<Enum>() for each enum member it reads back,
|
||||
// and none of the generic overloads above are ever deduced for those types, so each of
|
||||
// this service's own enumerations needs its own explicit specialization. `idl_enums`
|
||||
// carries the service's own enumerations by local name and this block runs inside
|
||||
// `namespace {{ namespace }}`, so the local name resolves to the fully-qualified enum
|
||||
// type. (Nested foreign PDM enumerations are still not covered - same limitation as the
|
||||
// documented svcBuildings exclusion.)
|
||||
{% for enumeration in idl_enums %}
|
||||
template<>
|
||||
{{ enumeration.name }} fromQVariant(const QVariant &val, type<{{ enumeration.name }}>)
|
||||
{
|
||||
return static_cast<{{ enumeration.name }}>(val.toInt());
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
{% for dt in serializeTopics.member %}
|
||||
//
|
||||
// Begin {{ dt.typeFq }}
|
||||
@@ -338,7 +378,7 @@ RecordReplayPlugin::RecordReplayPlugin()
|
||||
: m_exerciseId(0)
|
||||
, m_bCanHandleSchemasRead(true)
|
||||
, m_bCanHandleSchemasWrite(true)
|
||||
, m_logger(&getLogger("RecordReplay"))
|
||||
, m_logger(getLogger("RecordReplay"))
|
||||
{}
|
||||
|
||||
RecordReplayPlugin::~RecordReplayPlugin() = default;
|
||||
@@ -465,7 +505,7 @@ std::map<QString, std::vector<RecordReplayPlugin::RecSnapshot>> RecordReplayPlug
|
||||
{
|
||||
// the current snapshot data does not match the starting time -> reread m_{{ dt.nameFlc }}Keys
|
||||
readLastSnapshotKeysFor{{ dt.name }}(q, nextSampleTime);
|
||||
//DEBUG_LOG(*m_logger) << "fromTime: " << fromTime << ", m_snapshotParticipantMapTime: " << m_snapshotParticipantMapTime
|
||||
//DEBUG_LOG(m_logger) << "fromTime: " << fromTime << ", m_snapshotParticipantMapTime: " << m_snapshotParticipantMapTime
|
||||
// << " - rereading snapshot times! Map now contains " << m_snapshot{{ dt.name }}Map.size() << " entries";
|
||||
}
|
||||
|
||||
@@ -541,7 +581,7 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
|
||||
|
||||
if (m_dtc{{ dt.name }}->hasSamples())
|
||||
{
|
||||
TRACE_LOG(*m_logger) << "m_dtc{{ dt.name }}->hasSamples() == true ";
|
||||
TRACE_LOG(m_logger) << "m_dtc{{ dt.name }}->hasSamples() == true ";
|
||||
|
||||
const QString stmt(QStringLiteral("INSERT INTO ") + getTableName(QStringLiteral("{{ dt.recTable.name }}"), m_bCanHandleSchemasWrite) +
|
||||
QStringLiteral(" ( dds_is_alive, {% for row in dt.recTable.cppMember %} {{ row.dbColumnName }}{% if not forloop.last %}, {% endif %}{% endfor %}) VALUES "
|
||||
@@ -551,11 +591,11 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
|
||||
return false;
|
||||
|
||||
dds::sub::LoanedSamples<DATA> samples = m_dtc{{ dt.name }}->takeAlive();
|
||||
TRACE_LOG(*m_logger) << "samples count: " << samples.length();
|
||||
TRACE_LOG(m_logger) << "samples count: " << samples.length();
|
||||
for (const auto &sample : samples)
|
||||
{
|
||||
const DATA &data = sample.data();
|
||||
INFO_LOG(*m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }}();
|
||||
INFO_LOG(m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }};
|
||||
|
||||
{% for row in dt.recTable.cppMember %}
|
||||
q.bindValue(QStringLiteral(":{{ row.dbColumnName }}"), {{ row.ddsToQVariant }});
|
||||
@@ -565,7 +605,10 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
|
||||
if (!q.exec())
|
||||
return false;
|
||||
|
||||
minRecordSampleTime = std::min(minRecordSampleTime, data.sampleTime());
|
||||
// rtiddsgen 4.7 declares sample_time as int64_t (long), while the record
|
||||
// boundary is qint64 (long long); std::min requires both arguments to be
|
||||
// the same type, so narrow the generated member explicitly.
|
||||
minRecordSampleTime = std::min(minRecordSampleTime, static_cast<qint64>(data.sampleTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +622,7 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
|
||||
if (!q.prepare(stmt))
|
||||
return false;
|
||||
|
||||
DEBUG_LOG(*m_logger) << "disposedSamples count: " << disposedSamples.length();
|
||||
DEBUG_LOG(m_logger) << "disposedSamples count: " << disposedSamples.length();
|
||||
auto dr = m_dtc{{ dt.name }}->dataReader()->dataReader();
|
||||
{{ dt.name }} data;
|
||||
for (const auto &sample : disposedSamples)
|
||||
@@ -615,12 +658,12 @@ bool RecordReplayPlugin::readLastSnapshotFor{{ dt.name }}(NSqlQuery &q, qint64 s
|
||||
|
||||
if (!q.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error while fetch max(time_stamp) for topic {{ dt.name }}";
|
||||
ERROR_LOG(m_logger) << "Error while fetch max(time_stamp) for topic {{ dt.name }}";
|
||||
return false;
|
||||
}
|
||||
if (!q.next() || q.value(0).isNull())
|
||||
{
|
||||
INFO_LOG(*m_logger) << "No snapshot available for topic {{ dt.name }}";
|
||||
INFO_LOG(m_logger) << "No snapshot available for topic {{ dt.name }}";
|
||||
return true;
|
||||
}
|
||||
const qint64 idSnapshot = q.value(0).toLongLong();
|
||||
@@ -645,10 +688,10 @@ bool RecordReplayPlugin::readLastSnapshotFor{{ dt.name }}(NSqlQuery &q, qint64 s
|
||||
{% endfor %}
|
||||
|
||||
if (bIsAlive)
|
||||
m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data);
|
||||
m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data);
|
||||
else
|
||||
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data);
|
||||
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}());
|
||||
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data);
|
||||
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }});
|
||||
}
|
||||
m_snapshot{{ dt.name }}MapTime = timeSnapshot;
|
||||
|
||||
@@ -677,10 +720,10 @@ bool RecordReplayPlugin::read{{ dt.name }}(NSqlQuery &q, qint64 fromTime, qint64
|
||||
{% endfor %}
|
||||
|
||||
if (bIsAlive)
|
||||
m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data);
|
||||
m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data);
|
||||
else
|
||||
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data);
|
||||
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}());
|
||||
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data);
|
||||
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -693,7 +736,7 @@ bool RecordReplayPlugin::updateSnapshotKeys{{ dt.name }}(NSqlQuery &q, qint64 fr
|
||||
QStringLiteral(" AND sample_time <= ") + QString::number(toTime) +
|
||||
QStringLiteral(" ORDER BY sample_time "));
|
||||
|
||||
DEBUG_LOG(*m_logger) << "stmt: " << stmt;
|
||||
DEBUG_LOG(m_logger) << "stmt: " << stmt;
|
||||
|
||||
if (!q.exec(stmt))
|
||||
return false;
|
||||
@@ -705,13 +748,13 @@ bool RecordReplayPlugin::updateSnapshotKeys{{ dt.name }}(NSqlQuery &q, qint64 fr
|
||||
const bool isAlive = q.value(2).toBool();
|
||||
if (isAlive)
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "INSERT {{ dt.name }} key: " << key << ", pk: " << pk << ", isAlive: " << isAlive;
|
||||
DEBUG_LOG(m_logger) << "INSERT {{ dt.name }} key: " << key << ", pk: " << pk << ", isAlive: " << isAlive;
|
||||
m_snapshot{{ dt.name }}Map[key] = pk;
|
||||
m_{{ dt.nameFlc }}Keys.insert(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "REMOVE {{ dt.name }} key: " << key << ", pk: " << pk << ", isAlive: " << isAlive;
|
||||
DEBUG_LOG(m_logger) << "REMOVE {{ dt.name }} key: " << key << ", pk: " << pk << ", isAlive: " << isAlive;
|
||||
m_snapshot{{ dt.name }}Map.erase(key);
|
||||
m_{{ dt.nameFlc }}Keys.erase(key);
|
||||
}
|
||||
@@ -720,7 +763,7 @@ bool RecordReplayPlugin::updateSnapshotKeys{{ dt.name }}(NSqlQuery &q, qint64 fr
|
||||
// new validity time for snapshot data
|
||||
m_snapshot{{ dt.name }}MapTime = toTime;
|
||||
|
||||
DEBUG_LOG(*m_logger) << "updateSnapshotKeys{{ dt.name }}(" << fromTime << ", " << toTime << ") = "
|
||||
DEBUG_LOG(m_logger) << "updateSnapshotKeys{{ dt.name }}(" << fromTime << ", " << toTime << ") = "
|
||||
<< m_snapshot{{ dt.name }}Map.size();
|
||||
|
||||
return true;
|
||||
@@ -737,13 +780,13 @@ bool RecordReplayPlugin::readLastSnapshotKeysFor{{ dt.name }}(NSqlQuery &q, qint
|
||||
return false;
|
||||
if (!q.next() || q.value(0).isNull())
|
||||
{
|
||||
DEBUG_LOG(*m_logger) << "no snapshot entry for {{ dt.name }} found";
|
||||
DEBUG_LOG(m_logger) << "no snapshot entry for {{ dt.name }} found";
|
||||
return true;
|
||||
}
|
||||
|
||||
m_snapshot{{ dt.name }}Map = LtsUtils::BigintArray2D::fromPgString(q.value(0).toString())();
|
||||
|
||||
DEBUG_LOG(*m_logger) << "Map size {{ dt.name }}: " << m_snapshot{{ dt.name }}Map.size();
|
||||
DEBUG_LOG(m_logger) << "Map size {{ dt.name }}: " << m_snapshot{{ dt.name }}Map.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -758,7 +801,7 @@ qint64 RecordReplayPlugin::getNextSampleTimeFor{{ dt.name }}(NSqlQuery &q, qint6
|
||||
if (q.execAndFetch(stmt) && !q.value(0).isNull())
|
||||
ret = q.value(0).toLongLong();
|
||||
|
||||
DEBUG_LOG(*m_logger) << "next min sampleTime for {{ dt.name }} is " << ret << " (> " << fromTime << ")";
|
||||
DEBUG_LOG(m_logger) << "next min sampleTime for {{ dt.name }} is " << ret << " (> " << fromTime << ")";
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -795,7 +838,7 @@ void RecordReplayPlugin::clearData{{ dt.name }}()
|
||||
{{ dt.name }} tmpData;
|
||||
for (auto key : m_{{ dt.nameFlc }}Keys)
|
||||
{
|
||||
tmpData.{{ dt.key.name }}(key);
|
||||
tmpData.{{ dt.key.name }} = key;
|
||||
m_dts{{ dt.name }}->remove(tmpData);
|
||||
}
|
||||
}
|
||||
@@ -812,12 +855,12 @@ bool RecordReplayPlugin::copyInitialData{{ dt.name }}(NSqlQuery &queryFrom, NSql
|
||||
|
||||
if (!queryFrom.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(*m_logger) << "Error while fetch max(time_stamp) for topic {{ dt.name }}";
|
||||
ERROR_LOG(m_logger) << "Error while fetch max(time_stamp) for topic {{ dt.name }}";
|
||||
return false;
|
||||
}
|
||||
if (!queryFrom.next() || queryFrom.value(0).isNull())
|
||||
{
|
||||
INFO_LOG(*m_logger) << "No snapshot available for topic {{ dt.name }}";
|
||||
INFO_LOG(m_logger) << "No snapshot available for topic {{ dt.name }}";
|
||||
return true;
|
||||
}
|
||||
const qint64 idSnapshot = queryFrom.value(0).toLongLong();
|
||||
|
||||
+5
-3
@@ -18,8 +18,10 @@
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_dts_types.h>
|
||||
#include <{{ include_prefix }}/logger.h>
|
||||
|
||||
// TODO: Problem with QT5_WRAP_CPP ...
|
||||
#include <../../Common/PluginInterfaces/record_replay_plugin.h>
|
||||
// Resolved from the Lts include root (see include_directories(BEFORE .../Lts)
|
||||
// in the root CMakeLists); the old <../../Common/...> spelling only worked
|
||||
// for in-source builds.
|
||||
#include <Common/PluginInterfaces/record_replay_plugin.h>
|
||||
|
||||
#include <LtsUtilsCore/pgarray.h>
|
||||
|
||||
@@ -119,7 +121,7 @@ protected:
|
||||
int64_t m_snapshot{{ dt.name }}MapTime = -1; // time for which the snapshot is valid
|
||||
{% endif %} {% endfor %}
|
||||
|
||||
NGL::INGLLogger* m_logger;
|
||||
NGL::INGLLogger& m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
// TODO: Problem with QT5_WRAP_CPP ...
|
||||
#include <../../DDS/Generic/topic_type_plugin.h>
|
||||
// Resolved from the Lts include root (see include_directories(BEFORE .../Lts)
|
||||
// in the root CMakeLists); the old <../../DDS/...> spelling only worked for
|
||||
// in-source builds because moc/gcc do not resolve it relative to this file.
|
||||
#include <DDS/Generic/topic_type_plugin.h>
|
||||
|
||||
namespace {{ namespace }}
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// filename: {{ namespace_abbr }}_translation.h
|
||||
|
||||
#include <string>
|
||||
#include <{{ namespace_abbr }}_enums.hpp>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_enums.hpp>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
|
||||
|
||||
class QString;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltscoordinate_export.h"
|
||||
#include <LtsCoordinate/ltscoordinate_export.h>
|
||||
|
||||
#include <Core/core.hpp>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -48,7 +48,7 @@ class LTSCOORDINATE_EXPORT LtsCoordVector
|
||||
utmVectorRef.reserve(m_geo_coordinates.size());
|
||||
|
||||
for (const auto& geoCoord : std::as_const(m_geo_coordinates))
|
||||
utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat(), zone));
|
||||
utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat, zone));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -29,13 +29,13 @@ double LtsCoordinate::elevationAt(double defaultElevation, bool* bIsCovered) con
|
||||
if (!std::isnan(m_elevation))
|
||||
return m_elevation;
|
||||
if (m_getElevationCB)
|
||||
m_elevation = m_getElevationCB(m_geo.lon(), m_geo.lat(), defaultElevation, bIsCovered);
|
||||
m_elevation = m_getElevationCB(m_geo.lon, m_geo.lat, defaultElevation, bIsCovered);
|
||||
return m_elevation;
|
||||
}
|
||||
|
||||
void LtsCoordinate::setZValueAccordingElevation(double defaultElevation)
|
||||
{
|
||||
m_geo.z(elevationAt(defaultElevation));
|
||||
m_geo.z = elevationAt(defaultElevation);
|
||||
}
|
||||
|
||||
double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaultElevation, bool* bIsCovered)
|
||||
@@ -46,7 +46,7 @@ double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaul
|
||||
void LtsCoordinate::replaceZValueByElevationIfValue(double zValueToBeReplaced, double defaultElevation)
|
||||
{
|
||||
|
||||
if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z())) || qFuzzyCompare(m_geo.z(), zValueToBeReplaced))
|
||||
if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z)) || qFuzzyCompare(m_geo.z, zValueToBeReplaced))
|
||||
setZValueAccordingElevation(defaultElevation);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void LtsCoordinate::convertGeoToUtm() const
|
||||
|
||||
int zone = -1;
|
||||
|
||||
if (std::isnan(m_geo.lon()) || std::isnan(m_geo.lat()))
|
||||
if (std::isnan(m_geo.lon) || std::isnan(m_geo.lat))
|
||||
{
|
||||
fprintf(stderr, "Error while fromGeographic, value is NaN\n");
|
||||
m_utm2D = LtsCoordTrans::UtmCoordinate();
|
||||
@@ -90,7 +90,7 @@ void LtsCoordinate::convertGeoToUtm() const
|
||||
++s_conversion_counter;
|
||||
#endif
|
||||
|
||||
m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone);
|
||||
m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone);
|
||||
Q_ASSERT_X(m_utm2D.zone > 0, "LtsCoordinate", "zone has to be set");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltscoordinate_export.h"
|
||||
#include <LtsCoordinate/ltscoordinate_export.h>
|
||||
|
||||
#include <Core/core.hpp>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -35,7 +35,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
explicit LtsCoordinate(const Core::GeoPosition& geoPos) : m_geo(geoPos) {}
|
||||
|
||||
explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon(), geoPos2D.lat(), std::nan("")) {}
|
||||
explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon, geoPos2D.lat, std::nan("")) {}
|
||||
|
||||
LtsCoordinate(const LtsCoordTrans::UtmCoordinate& utm2D, double zValue) = delete;
|
||||
|
||||
@@ -67,7 +67,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
bool hasGeo() const
|
||||
{
|
||||
return !(valueIsNullOrNan(m_geo.lon()) || valueIsNullOrNan(m_geo.lat()));
|
||||
return !(valueIsNullOrNan(m_geo.lon) || valueIsNullOrNan(m_geo.lat));
|
||||
}
|
||||
|
||||
bool hasUtm() const
|
||||
@@ -95,7 +95,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
Core::GeoPosition2D geoPosition2D() const
|
||||
{
|
||||
return Core::GeoPosition2D(m_geo.longitude, m_geo.latitude);
|
||||
return Core::GeoPosition2D(m_geo.lon, m_geo.lat);
|
||||
}
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate& utmCoordinate() const
|
||||
@@ -107,23 +107,23 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
double& rz()
|
||||
{
|
||||
return m_geo.altitude;
|
||||
return m_geo.z;
|
||||
}
|
||||
|
||||
double z() const
|
||||
{
|
||||
return m_geo.z();
|
||||
return m_geo.z;
|
||||
}
|
||||
|
||||
void setZ(double value)
|
||||
{
|
||||
m_geo.z(value);
|
||||
m_geo.z = value;
|
||||
}
|
||||
|
||||
LtsCoordTrans::UtmCoordinate utmCoordinateDiffZone(int zone) const
|
||||
{
|
||||
|
||||
m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone);
|
||||
m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone);
|
||||
return m_utm2D_differentZone;
|
||||
}
|
||||
|
||||
@@ -146,17 +146,17 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
QPointF toGeoPointF() const
|
||||
{
|
||||
return QPointF(m_geo.lon(), m_geo.lat());
|
||||
return QPointF(m_geo.lon, m_geo.lat);
|
||||
}
|
||||
|
||||
QPoint3D toGeoPoint3D() const
|
||||
{
|
||||
return QPoint3D(m_geo.lon(), m_geo.lat(), m_geo.z());
|
||||
return QPoint3D(m_geo.lon, m_geo.lat, m_geo.z);
|
||||
}
|
||||
|
||||
UtmCoordinate3D toUtmCoordinate3D() const
|
||||
{
|
||||
return UtmCoordinate3D(utmCoordinate(), m_geo.z());
|
||||
return UtmCoordinate3D(utmCoordinate(), m_geo.z);
|
||||
}
|
||||
|
||||
using elevationCbFunc = std::function<double(double, double, double, bool*)>;
|
||||
@@ -174,7 +174,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
|
||||
double heightOverElevation() const
|
||||
{
|
||||
return m_geo.z() - elevationAt();
|
||||
return m_geo.z - elevationAt();
|
||||
}
|
||||
|
||||
double distanceUtm2D(const LtsCoordinate& other) const
|
||||
@@ -203,13 +203,13 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
void clearGeo() const
|
||||
{
|
||||
clearGeoLonLat();
|
||||
m_geo.z(std::nan(""));
|
||||
m_geo.z = std::nan("");
|
||||
}
|
||||
|
||||
void clearGeoLonLat() const
|
||||
{
|
||||
m_geo.lon(0);
|
||||
m_geo.lat(0);
|
||||
m_geo.lon = 0;
|
||||
m_geo.lat = 0;
|
||||
}
|
||||
|
||||
void clearUtm() const
|
||||
@@ -245,7 +245,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
|
||||
const auto& utmTemp = utmCoordinateInternal(zone);
|
||||
pntRef.rx() = utmTemp.x;
|
||||
pntRef.ry() = utmTemp.y;
|
||||
pntRef.rz() = m_geo.z();
|
||||
pntRef.rz() = m_geo.z;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -31,9 +31,6 @@ if(QT6_GUI_AVAILABLE)
|
||||
PRIVATE
|
||||
NGLLogger
|
||||
## LtsSessionDataDds
|
||||
## ExmDataPluginInterface # External dependency - missing
|
||||
## situationMapCommon # External dependency - missing
|
||||
## situationMapElevationMap # External dependency - missing
|
||||
PUBLIC
|
||||
LtsUtilsCoreHeaderOnly
|
||||
Qt6::Core
|
||||
@@ -42,7 +39,14 @@ if(QT6_GUI_AVAILABLE)
|
||||
endif()
|
||||
|
||||
if(BUILD_RTI)
|
||||
target_link_libraries(LtsElevation PRIVATE AsmDataPluginInterface)
|
||||
# All ElevationMapManager / resource_path / exm-dtc usages live inside
|
||||
# #ifdef BUILD_RTI in lts_elevation_manager.cpp (Qt5 dependencies restored).
|
||||
target_link_libraries(LtsElevation PRIVATE
|
||||
AsmDataPluginInterface
|
||||
ExmDataPluginInterface
|
||||
situationMapCommon
|
||||
situationMapElevationMap
|
||||
)
|
||||
endif()
|
||||
|
||||
ADD_SUBDIRECTORY(UnitTest_Elevation)
|
||||
@@ -6,6 +6,12 @@
|
||||
#include <AssetManagement/asm_data_plugin_interface.h>
|
||||
#include <ExerciseManagement/exm_data_plugin_interface.h>
|
||||
#include <Viewer/SituationMap/ElevationMap/elevation_map_manager.h>
|
||||
#include <Viewer/SituationMap/Common/resource_path.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QHash>
|
||||
#include <QSharedPointer>
|
||||
#include <QUrl>
|
||||
|
||||
static_assert((int)SituationMap::ElevationMapManager::LineOfSight::LOS_UNDEFINED ==
|
||||
(int)LtsElevation::LineOfSight::LOS_UNDEFINED,
|
||||
@@ -106,15 +112,71 @@ LtsElevationManager::createInstance(int exerciseId, const std::shared_ptr<Exerci
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QStringList filePaths_rough_to_fine;
|
||||
// Qt5 logic restored (the qt6 port had dropped the exerciseId->trainingAreaId
|
||||
// caching and always returned nullptr here).
|
||||
#ifdef BUILD_RTI
|
||||
filePaths_rough_to_fine = getFilenamesForExercise(exerciseId);
|
||||
int trainingAreaId = -1;
|
||||
|
||||
// remember for future calls
|
||||
// (so createInstance should work WITHOUT dtcs)
|
||||
// Idea: MainHandler: createInstance with exerciseId and valid dtcs
|
||||
// Plugin or simular: createInstance with exerciseId and no dtcs
|
||||
static QHash<int, int> s_exIdToTaIdStore;
|
||||
|
||||
const auto exTaIt = s_exIdToTaIdStore.find(exerciseId);
|
||||
if (exTaIt != s_exIdToTaIdStore.end())
|
||||
{
|
||||
// CASE 1:
|
||||
// already created:
|
||||
trainingAreaId = *exTaIt;
|
||||
}
|
||||
else
|
||||
{
|
||||
// CASE 2:
|
||||
// ... or create on demand:
|
||||
if (!exmDtc || !asmDtc)
|
||||
{
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " no dtcs for exerciseId=" << exerciseId
|
||||
<< ", asmDtc=" << asmDtc
|
||||
<< ", exmDtc=" << exmDtc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// exId to taId
|
||||
trainingAreaId = exerciseIdToTrainingAreaId(exerciseId, exmDtc);
|
||||
if (trainingAreaId <= 0)
|
||||
{
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " Error getting trainingAreaId"
|
||||
<< ", exerciseId=" << exerciseId
|
||||
<< ", trainingAreaId=" << trainingAreaId;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// store and remember:
|
||||
s_exIdToTaIdStore[exerciseId] = trainingAreaId;
|
||||
}
|
||||
|
||||
// CASE 1: Following should work even with invalid asmDtc:
|
||||
LTS_ELEVATION_MANAGER_TYPE temp = createInstanceForTrainingAreaId(trainingAreaId, asmDtc);
|
||||
if (!temp)
|
||||
{
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " Error on createInstanceForTrainingAreaId"
|
||||
<< ", exerciseId=" << exerciseId
|
||||
<< ", trainingAreaId=" << trainingAreaId;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// add exmDtc
|
||||
temp->initDDS(exmDtc, asmDtc);
|
||||
|
||||
TRACE_LOG(logger) << Q_FUNC_INFO << " END, exerciseId=" << exerciseId;
|
||||
return temp;
|
||||
#else
|
||||
Q_UNUSED(exerciseId);
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " BUILD_RTI=OFF, cannot get filenames for exercise";
|
||||
#endif
|
||||
Q_UNUSED(filePaths_rough_to_fine);
|
||||
Q_UNUSED(exmDtc);
|
||||
Q_UNUSED(asmDtc);
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " BUILD_RTI=OFF, cannot create instance";
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
LTS_ELEVATION_MANAGER_TYPE LtsElevationManager::getInstance(int exerciseId)
|
||||
@@ -291,19 +353,19 @@ QStringList LtsElevationManager::getFilenamesForTrainingArea(int trainingAreaId)
|
||||
{
|
||||
d->m_asmDtc->waitForHistoricalDataTrainingArea(1000);
|
||||
const AssetManagement::TrainingArea& ta = d->m_asmDtc->trainingArea(trainingAreaId);
|
||||
if (ta.id() != trainingAreaId)
|
||||
if (ta.id != trainingAreaId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error on s_asmDtc->trainingArea"
|
||||
<< ", trainingAreaId=" << trainingAreaId;
|
||||
return {};
|
||||
}
|
||||
const std::vector<AssetManagement::MapDescription>& mdVec = ta.elevation();
|
||||
const std::vector<AssetManagement::MapDescription>& mdVec = ta.elevation;
|
||||
filePaths_rough_to_fine.reserve(mdVec.size());
|
||||
|
||||
for (const AssetManagement::MapDescription& md : std::as_const(mdVec))
|
||||
{
|
||||
|
||||
QUrl url(QString::fromStdString(md.url()));
|
||||
QUrl url(QString::fromStdString(md.url));
|
||||
QString filePathAbs = url.toLocalFile();
|
||||
if (QDir::isRelativePath(filePathAbs))
|
||||
filePathAbs = SituationMap::getResourcePath() + QStringLiteral("/elevation/") + filePathAbs;
|
||||
@@ -372,13 +434,13 @@ int LtsElevationManager::exerciseIdToTrainingAreaId(int exerciseId,
|
||||
exmDtc->waitForHistoricalDataExercise(1000);
|
||||
|
||||
const ExerciseManagement::Exercise& exm = exmDtc->exercise(exerciseId);
|
||||
if (exm.id() != exerciseId)
|
||||
if (exm.id != exerciseId)
|
||||
{
|
||||
ERROR_LOG(logger) << Q_FUNC_INFO << " Error on m_exmDtc->exercise"
|
||||
<< ", exerciseId=" << exerciseId;
|
||||
return -1;
|
||||
}
|
||||
trainingAreaId = exm.trainingAreaId();
|
||||
trainingAreaId = exm.trainingAreaId;
|
||||
|
||||
if (trainingAreaId <= 0)
|
||||
{
|
||||
|
||||
@@ -252,22 +252,22 @@ void LtsLogin::logoff()
|
||||
QString cmd;
|
||||
switch (m_shutdownAction.underlying())
|
||||
{
|
||||
case AssetManagement::ShutdownAction_def::Shutdown:
|
||||
case AssetManagement::ShutdownAction::Shutdown:
|
||||
#ifdef LTS_DEBUG
|
||||
cmd = QStringLiteral("xeyes");
|
||||
#else
|
||||
cmd = QStringLiteral("systemctl poweroff");
|
||||
#endif
|
||||
break;
|
||||
case AssetManagement::ShutdownAction_def::Reboot:
|
||||
case AssetManagement::ShutdownAction::Reboot:
|
||||
#ifdef LTS_DEBUG
|
||||
cmd = QStringLiteral("kcalc");
|
||||
#else
|
||||
cmd = QStringLiteral("systemctl reboot");
|
||||
#endif
|
||||
break;
|
||||
case AssetManagement::ShutdownAction_def::Logout:
|
||||
case AssetManagement::ShutdownAction_def::NoAction:
|
||||
case AssetManagement::ShutdownAction::Logout:
|
||||
case AssetManagement::ShutdownAction::NoAction:
|
||||
emit signalLogoffDone();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,9 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
|
||||
}
|
||||
|
||||
const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended)
|
||||
const QVector<QStringRef> iidParameters = jsonIid.splitRef(QLatin1Char(':'));
|
||||
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split
|
||||
// provides the same zero-copy tokenization.
|
||||
const QList<QStringView> iidParameters = QStringView{jsonIid}.split(QLatin1Char(':'));
|
||||
|
||||
DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid;
|
||||
|
||||
|
||||
@@ -32,8 +32,10 @@ NGL_TARGET_LINK_LIBRARIES(LtsSessionDataDds
|
||||
PRIVATE
|
||||
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddsconnector>,ddsconnector,>>
|
||||
PUBLIC
|
||||
$<$<BOOL:${BUILD_RTI}>:nddscore>
|
||||
$<$<BOOL:${BUILD_RTI}>:RTI::nddscore>
|
||||
$<$<BOOL:${BUILD_RTI}>:ddsQoS>
|
||||
# Generated Core type support (topic_type_support<Core::PartitionTime>, ...)
|
||||
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>>
|
||||
NGLLogger
|
||||
Qt6::Core
|
||||
)
|
||||
@@ -112,7 +114,7 @@ IF(BUILD_RTI)
|
||||
PRIVATE
|
||||
ddsconnector
|
||||
PUBLIC
|
||||
nddscore
|
||||
RTI::nddscore
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(LtsSession PUBLIC BUILD_RTI)
|
||||
ENDIF()
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
#include <LtsWidgets/lts_tab_widget.h>
|
||||
#include <PluginInterfaces/data_plugin_interface.h>
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#ifdef BUILD_FILTERMANAGEMENT
|
||||
// Complete type needed for dynamic_pointer_cast of m_ohvIfc (BUILD_RTI code below);
|
||||
// the header is self-contained (Qt only), the FilterManagement plugin is only the implementor.
|
||||
#ifdef BUILD_RTI
|
||||
#include <Lts/Plugins/OnlineHelp/ohp_online_help_viewer_gui_plugin_interface.h> // XXX: grrr..
|
||||
#endif
|
||||
#include <QtWidgets/QApplication>
|
||||
@@ -156,7 +158,7 @@ QString LtsSession::toString() const
|
||||
str.append(QStringLiteral(", workspaceId='%1'").arg(workspaceId()));
|
||||
#ifdef BUILD_RTI
|
||||
str.append(QStringLiteral(", appToString='%1'").arg(appToString(app())));
|
||||
str.append(QStringLiteral(", partitionType=%1, exerciseId='%2'").arg(partitionType()).arg(exerciseId()));
|
||||
str.append(QStringLiteral(", partitionType=%1, exerciseId='%2'").arg(static_cast<int>(partitionType())).arg(exerciseId()));
|
||||
str.append(QStringLiteral(", LtsSessionDataDds=%1").arg(LtsSessionDataDds::toString()));
|
||||
#else
|
||||
str.append(QStringLiteral(", app=Login (stub)"));
|
||||
|
||||
@@ -20,30 +20,6 @@
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
namespace
|
||||
{
|
||||
// Convert LtsSession::PartitionType to IDL::PartitionType
|
||||
IDL::PartitionType toIdlPartitionType(LtsSession::PartitionType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case LtsSession::PartitionType::Any:
|
||||
return IDL::PartitionType::Any;
|
||||
case LtsSession::PartitionType::Global:
|
||||
return IDL::PartitionType::Global;
|
||||
case LtsSession::PartitionType::Exercise:
|
||||
return IDL::PartitionType::Exercise;
|
||||
case LtsSession::PartitionType::AllExercises:
|
||||
return IDL::PartitionType::AllExercises;
|
||||
case LtsSession::PartitionType::Replay:
|
||||
return IDL::PartitionType::Replay;
|
||||
case LtsSession::PartitionType::Invalid:
|
||||
default:
|
||||
return IDL::PartitionType::Any;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
/**
|
||||
@@ -74,7 +50,7 @@ class DdsConnectionContainer
|
||||
for (int i = ddsConnections.size() - 1; i >= 0; --i)
|
||||
{
|
||||
const DdsConnection& conn = ddsConnections.at(i);
|
||||
if (toIdlPartitionType(conn.partitionType) != IDL::PartitionType::Global)
|
||||
if (conn.partitionType != IDL::PartitionType::Global)
|
||||
continue;
|
||||
auto ret = conn.ddsConnector.lock();
|
||||
if (ret != nullptr)
|
||||
@@ -242,7 +218,7 @@ bool LtsSessionDataDds::init(const DdsConnectionParams& connParams)
|
||||
#endif
|
||||
|
||||
m_ddsConnector = std::make_shared<DDSConnector::DdsConnector>(
|
||||
connParams.domainId, toIdlPartitionType(connParams.partitionType), connParams.partitionId,
|
||||
connParams.domainId, connParams.partitionType, connParams.partitionId,
|
||||
connParams.exerciseId, // same as partition Id in live but not in replay
|
||||
type);
|
||||
s_ddsConnections()->insertConnection(connParams, m_ddsConnector);
|
||||
@@ -277,7 +253,7 @@ bool LtsSessionDataDds::init(const dds::domain::DomainParticipant& dp, const Dds
|
||||
if (m_ddsConnector == nullptr)
|
||||
{
|
||||
m_ddsConnector =
|
||||
std::make_shared<DDSConnector::DdsConnector>(dp, toIdlPartitionType(connParams.partitionType), type, connParams.partitionId);
|
||||
std::make_shared<DDSConnector::DdsConnector>(dp, connParams.partitionType, type, connParams.partitionId);
|
||||
|
||||
s_ddsConnections()->insertConnection(connParams, m_ddsConnector);
|
||||
}
|
||||
@@ -292,38 +268,27 @@ Fetcher* LtsSessionDataDds::fetcher(const QString& yourPluginsName)
|
||||
return m_fetcher;
|
||||
}
|
||||
|
||||
QString LtsSessionDataDds::partitionTypeString(PartitionType partitionType)
|
||||
QString LtsSessionDataDds::partitionTypeString(IDL::PartitionType partitionType)
|
||||
{
|
||||
switch (partitionType)
|
||||
{
|
||||
case PartitionType::AllExercises:
|
||||
case IDL::PartitionType::AllExercises:
|
||||
return QStringLiteral("AllExercises");
|
||||
case PartitionType::Any:
|
||||
case IDL::PartitionType::Any:
|
||||
return QStringLiteral("Any");
|
||||
case PartitionType::Exercise:
|
||||
case IDL::PartitionType::Exercise:
|
||||
return QStringLiteral("Exercise");
|
||||
case PartitionType::Global:
|
||||
case IDL::PartitionType::Global:
|
||||
return QStringLiteral("Global");
|
||||
case PartitionType::Replay:
|
||||
case IDL::PartitionType::Replay:
|
||||
return QStringLiteral("Replay");
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QStringLiteral("Invalid (%1)").arg(int(partitionType));
|
||||
}
|
||||
|
||||
LtsSession::PartitionType LtsSessionDataDds::toPartitionType(IDL::PartitionType idlType)
|
||||
{
|
||||
switch (idlType)
|
||||
{
|
||||
case IDL::PartitionType::Any: return PartitionType::Any;
|
||||
case IDL::PartitionType::Exercise: return PartitionType::Exercise;
|
||||
case IDL::PartitionType::Replay: return PartitionType::Replay;
|
||||
case IDL::PartitionType::AllExercises: return PartitionType::AllExercises;
|
||||
case IDL::PartitionType::Global: return PartitionType::Global;
|
||||
default: return PartitionType::Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
QString LtsSessionDataDds::toString() const
|
||||
{
|
||||
return QStringLiteral("(LtsSessionDataDds: id=%1, partitionId=%2, partitionType=%3(%4), exerciseId=%5)")
|
||||
@@ -349,9 +314,9 @@ int LtsSessionDataDds::partitionId() const
|
||||
return m_ddsConnector ? m_ddsConnector->getPartitionId() : -1;
|
||||
}
|
||||
|
||||
PartitionType LtsSessionDataDds::partitionType() const
|
||||
IDL::PartitionType LtsSessionDataDds::partitionType() const
|
||||
{
|
||||
return m_ddsConnector ? toPartitionType(m_ddsConnector->getPartitionType()) : PartitionType::Global;
|
||||
return m_ddsConnector ? m_ddsConnector->getPartitionType() : IDL::PartitionType::Global;
|
||||
}
|
||||
|
||||
QStringList LtsSessionDataDds::qosFile() const
|
||||
@@ -394,7 +359,7 @@ bool LtsSessionDataDds::initInternal()
|
||||
assert(m_dtcPartitionTime.get());
|
||||
|
||||
m_dtcPartitionTime->setSubscriberCallback([this](const Core::PartitionTime& data, DataModification) {
|
||||
m_curMSecSinceEpoch = data.timeStamp();
|
||||
m_curMSecSinceEpoch = data.timeStamp;
|
||||
emit partitionTimeChangedInternal();
|
||||
});
|
||||
connect(this, &LtsSessionDataDds::partitionTimeChangedInternal, this,
|
||||
|
||||
@@ -38,12 +38,12 @@ struct DdsConnectionParams
|
||||
|
||||
DdsConnectionParams() = default;
|
||||
explicit DdsConnectionParams(const Core::ReplayPartition &rp)
|
||||
: domainId(rp.domainId())
|
||||
, partitionId(rp.id())
|
||||
, exerciseId(rp.exerciseId())
|
||||
: domainId(rp.domainId)
|
||||
, partitionId(rp.id)
|
||||
, exerciseId(rp.exerciseId)
|
||||
, partitionType(IDL::PartitionType::Replay)
|
||||
{
|
||||
setTcpConnectionUrl(rp.tcpConnectionUrl());
|
||||
setTcpConnectionUrl(rp.tcpConnectionUrl);
|
||||
}
|
||||
|
||||
bool isValid() const { return domainId >= 0 && partitionType != IDL::PartitionType::Any; }
|
||||
|
||||
@@ -20,7 +20,7 @@ void add(qint64 time_offset)
|
||||
time += time_offset;
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
+6
-18
@@ -46,21 +46,15 @@ RequestHelper::RequestHelper(QObject* parent, bool quiet,
|
||||
}
|
||||
|
||||
void RequestHelper::addRequest(const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler)
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler)
|
||||
{
|
||||
m_requestFunctions.append(RequestFunctionContainer(requestFunction, baseReplyHandler));
|
||||
}
|
||||
|
||||
bool RequestHelper::requestReply(const FunctionReplyType& baseReply)
|
||||
bool RequestHelper::requestReply(const Core::FunctionReply& baseReply)
|
||||
{
|
||||
#ifdef BUILD_RTI
|
||||
// Bei BUILD_RTI=ON: baseReply ist Core::FunctionReply, cast von dds::core::Reference
|
||||
// Die Implementation erwartet Core::FunctionReplyObject
|
||||
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.errorString(), baseReply.errorParams());
|
||||
#else
|
||||
// Stub-Version: nur id und error string
|
||||
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.str().c_str());
|
||||
#endif
|
||||
// rtiddsgen 7.7 generates plain public members (no getters/setters)
|
||||
const Core::FunctionReplyObject fro(baseReply.id, baseReply.errorString, baseReply.errorParams);
|
||||
return _requestReply(fro, &baseReply);
|
||||
}
|
||||
|
||||
@@ -69,7 +63,7 @@ bool RequestHelper::requestReply(const Core::FunctionReplyObject& replyObject)
|
||||
return _requestReply(replyObject, nullptr);
|
||||
}
|
||||
|
||||
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const FunctionReplyType* baseReply)
|
||||
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply)
|
||||
{
|
||||
m_errorString = fro.translated();
|
||||
|
||||
@@ -100,14 +94,8 @@ bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Fu
|
||||
if (baseReply)
|
||||
m_singleRequestCustomFunctionReply(*baseReply);
|
||||
else
|
||||
#ifdef BUILD_RTI
|
||||
m_singleRequestCustomFunctionReply(
|
||||
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
|
||||
#else
|
||||
// Stub-Version: FunctionReply mit passendem Konstruktor
|
||||
m_singleRequestCustomFunctionReply(
|
||||
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (fro.error())
|
||||
@@ -195,7 +183,7 @@ void RequestHelper::slotNextRequest()
|
||||
|
||||
void RequestHelper::startSingleBackgroundRequest(
|
||||
const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const FunctionReplyType&)>& baseReplyHandler)
|
||||
const std::function<void(const Core::FunctionReply&)>& baseReplyHandler)
|
||||
{
|
||||
m_blockingCall = false;
|
||||
startSingleRequest(requestFunction, baseReplyHandler);
|
||||
|
||||
@@ -8,8 +8,15 @@
|
||||
# --- Library LtsWebSocketCommon --------------------------------------------------------------------------------
|
||||
#
|
||||
# Make ${Qt6_WebSockets} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets)
|
||||
set(Qt6_WebSockets ${Qt6_WebSockets})
|
||||
# Link the real WebSockets module whenever the websocket code path is
|
||||
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
|
||||
# Qt6::WebSockets import are set when the real module was found. The old
|
||||
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
|
||||
# discovery takes the minimal path) and the Qt6_WebSockets variable was
|
||||
# never defined, so the websocket code compiled without the module on
|
||||
# the link line.
|
||||
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
|
||||
set(Qt6_WebSockets Qt6::WebSockets)
|
||||
else()
|
||||
set(Qt6_WebSockets "")
|
||||
endif()
|
||||
|
||||
@@ -35,6 +35,7 @@ template <typename T> class DataManagerBaseDl
|
||||
}
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<T> m_dbInterface;
|
||||
};
|
||||
} // namespace LtsWebSocket
|
||||
@@ -1,8 +1,16 @@
|
||||
# Modified CMakeLists.txt from github.com/wille-io/httq
|
||||
|
||||
# Make ${Qt6_WebSockets} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets)
|
||||
set(Qt6_WebSockets ${Qt6_WebSockets})
|
||||
# Link the real WebSockets module whenever the websocket code path is
|
||||
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
|
||||
# Qt6::WebSockets import are set when the real module was found. The old
|
||||
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
|
||||
# discovery takes the minimal path) and the Qt6_WebSockets variable was
|
||||
# never defined, so AbstractServer.cpp compiled the websocket code
|
||||
# without the module on the link line (undefined reference to
|
||||
# QWebSocketServer::handleConnection).
|
||||
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
|
||||
set(Qt6_WebSockets Qt6::WebSockets)
|
||||
else()
|
||||
set(Qt6_WebSockets "")
|
||||
endif()
|
||||
|
||||
@@ -9,6 +9,14 @@ IF(BUILD_RTI)
|
||||
INCLUDE(MacroRTIDDSGen)
|
||||
INCLUDE(MacroCodeGenIdl)
|
||||
|
||||
# Resolve <DDS/...> includes (generic_data_reader.h, generic_dtc.h, ...) to the
|
||||
# real headers under Lts/DDS/ instead of the migration stub tree in include/.
|
||||
# The generated core_dtc_impl.h relies on GenericDtc::TopicType, which only the
|
||||
# real DDSGeneric::GenericDataReader base provides — the stub variant lacks it.
|
||||
# Same fix the migrated service CMakeLists (FileManagement/FilterManagement)
|
||||
# already enforce; svcFileManagement links svcCoreClient, so Core must build.
|
||||
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
|
||||
|
||||
SET(xml_FILE core.xml)
|
||||
|
||||
#
|
||||
@@ -111,13 +119,11 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcCoreClient SHARED ${SRCS_client})
|
||||
|
||||
# Add compile definition for export macros
|
||||
TARGET_COMPILE_DEFINITIONS(svcCoreClient
|
||||
PRIVATE
|
||||
MAKE_SVCCORECLIENT_LIB
|
||||
)
|
||||
|
||||
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
|
||||
# MAKE_<SYMBOL>_LIB compile guard, but the generated core_[d|f]tc_impl.h
|
||||
# headers require MAKE_SVCCORECLIENT_LIB — same situation as ddscore above,
|
||||
# which defines MAKE_DDSCORE_LIB explicitly for the same reason.
|
||||
TARGET_COMPILE_DEFINITIONS(svcCoreClient PRIVATE MAKE_SVCCORECLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcCoreClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
|
||||
@@ -59,9 +59,9 @@ void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, cons
|
||||
|
||||
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
|
||||
{
|
||||
if (!m_state.ports.has_value())
|
||||
if (!m_state.ports.is_set())
|
||||
m_state.ports = std::vector<Core::PortInformation>();
|
||||
m_state.ports.value().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
|
||||
publishState();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <Core/core_export.h>
|
||||
|
||||
#if BUILD_RTI
|
||||
// Resolves to the codegen-generated core_dtc.h via the build-dir include
|
||||
// root (build4/Lts). The old <Core/core_dtc.h> spelling hit the migration
|
||||
// stub tree (include/Core/core_dtc.h), whose DDS::Core::Interface forward
|
||||
// declarations don't match the generated Core::Interface::Dtc.
|
||||
#include <DDS/Core/core_dtc.h>
|
||||
#else
|
||||
// Forward declarations for moc compatibility when BUILD_RTI=OFF
|
||||
@@ -66,7 +70,9 @@ public:
|
||||
template<typename E>
|
||||
bool isLocked(const E &data, int exerciseId)
|
||||
{
|
||||
auto it = m_lockedEntitys.constFind(key(data.id(), exerciseId, QString::fromStdString(typeid(E).name())));
|
||||
// rtiddsgen -stl generates plain public data members, so the id is
|
||||
// accessed directly instead of the old getter call data.id().
|
||||
auto it = m_lockedEntitys.constFind(key(data.id, exerciseId, QString::fromStdString(typeid(E).name())));
|
||||
return !(it == m_lockedEntitys.cend());
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@ NGL_ADD_LIBRARY2(AAR SV WS HLA ddsconnector SHARED ${SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(ddsconnector
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
# dds_connector.h includes the generated ddsconnector_export.h with a
|
||||
# quoted include; consumers (svcFilterManagement etc.) resolve it only
|
||||
# if the binary dir with the GENERATE_EXPORT_HEADER output is exported.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(ddsconnector
|
||||
|
||||
@@ -58,7 +58,7 @@ class GenericDtc
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ class GenericDtcSampleInfo
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ class Ddtc
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
|
||||
@@ -127,7 +127,7 @@ class DdtcSampleInfo
|
||||
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
|
||||
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
|
||||
bool hasSamples() const { return BaseClass::hasSamples(); }
|
||||
std::shared_ptr<DRO_OBJECT> dataReader() { return BaseClass::dataReader(); }
|
||||
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
|
||||
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
|
||||
};
|
||||
} // namespace DTC
|
||||
@@ -111,6 +111,17 @@ class GenericDtcImplSubscriberTemplate : public DDSGeneric::SubscriberListenerCa
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool readAlive(TopicTypeRead& data) override final
|
||||
{
|
||||
auto samples = readAlive();
|
||||
if (samples.length() > 0)
|
||||
{
|
||||
data = samples[0].data();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
dds::sub::LoanedSamples<TopicTypeRead> takeAlive() const override final
|
||||
{
|
||||
if (!m_dataReaderObject)
|
||||
@@ -124,6 +135,17 @@ class GenericDtcImplSubscriberTemplate : public DDSGeneric::SubscriberListenerCa
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool takeAlive(TopicTypeRead& data) override final
|
||||
{
|
||||
auto samples = takeAlive();
|
||||
if (samples.length() > 0)
|
||||
{
|
||||
data = samples[0].data();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
dds::sub::LoanedSamples<TopicTypeRead> takeDisposed() const override final
|
||||
{
|
||||
if (!m_dataReaderObject)
|
||||
@@ -132,6 +154,17 @@ class GenericDtcImplSubscriberTemplate : public DDSGeneric::SubscriberListenerCa
|
||||
return m_dataReaderObject->takeDisposed();
|
||||
}
|
||||
|
||||
bool takeDisposed(TopicTypeRead& data) override final
|
||||
{
|
||||
auto samples = takeDisposed();
|
||||
if (samples.length() > 0)
|
||||
{
|
||||
data = samples[0].data();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasSamples() const override final
|
||||
{
|
||||
if (!m_dataReaderObject)
|
||||
|
||||
@@ -47,7 +47,6 @@ class FunctionTopicTests : public QObject
|
||||
const DdsUnitTests::FunctionRequestWithState& request);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void requestWithState();
|
||||
|
||||
std::unique_ptr<FTS::FunctionTopicTest> m_fts;
|
||||
@@ -65,5 +64,6 @@ class FunctionTopicTests : public QObject
|
||||
DdsUnitTests::FunctionRequestWithState m_requestTopicWithState;
|
||||
DdsUnitTests::FunctionReplyWithState m_replyTopicWithState;
|
||||
|
||||
NGL::INGLLogger& m_logger;
|
||||
Qt::HANDLE m_mainThreadId;
|
||||
};
|
||||
@@ -430,7 +430,10 @@ private:
|
||||
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
|
||||
// QueuedConnection to make sure the data is handled in the correct Qt (main) thread
|
||||
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
|
||||
Q_RETURN_ARG(ReplyTopic, reply.data()),
|
||||
// Qt6: QMetaMethod::invoke takes QMetaMethodArgument; pass the
|
||||
// registered topic type name like Q_ARG does, but with the
|
||||
// runtime name (ReplyTopic is a template parameter).
|
||||
QtPrivate::Invoke::argument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()),
|
||||
Q_ARG(int, request.uniqueId),
|
||||
Q_ARG(bool, !inProgress)); // finished yes/no
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ NGL_ADD_LIBRARY2(WS AAR SV HLA ddsfts SHARED ${SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(ddsfts
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
# generic_fts_internal.h includes the generated ddsfts_export.h with a
|
||||
# quoted include; consumers (the generated *_topic_type_plugin.cpp)
|
||||
# resolve it only if the binary dir with the export header is exported.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../Proxies/TrainingAreaBase
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(ddsfts
|
||||
|
||||
@@ -63,8 +63,12 @@ private:
|
||||
void sendReplyState(Core::FtReplyState replyState, const rti::core::SampleIdentity &requestSampleIdentity)
|
||||
{
|
||||
connext::WriteSample<ReplyTopic> reply;
|
||||
reply.data().replyState(replyState);
|
||||
// rtiddsgen -stl generates plain public data members, so the reply
|
||||
// state is assigned directly instead of the old setter call.
|
||||
reply.data().replyState = replyState;
|
||||
|
||||
// FtReplyState doesn't exist anymore with rtiddsgen 7.7 - the
|
||||
// enum values are directly available in Core::FtReplyState.
|
||||
bool bLastTelegram = ((replyState != Core::FtReplyState::InProgress) &&
|
||||
(replyState != Core::FtReplyState::NotStarted));
|
||||
m_replier->send_reply(reply, requestSampleIdentity, bLastTelegram);
|
||||
@@ -79,7 +83,7 @@ private:
|
||||
template <typename T, typename std::enable_if<HasStatusFunction<T>::value, int>::type = 0>
|
||||
void setReply(T &data, Core::FtReplyState status)
|
||||
{
|
||||
data.replyState(status);
|
||||
data.replyState = status;
|
||||
}
|
||||
|
||||
template <typename T, typename std::enable_if<!HasStatusFunction<T>::value, int>::type = 0>
|
||||
@@ -235,6 +239,9 @@ protected:
|
||||
<< "[s], -> age: " << age
|
||||
<< "[s], data: " << s;
|
||||
ReplyTopic rt;
|
||||
// Generated topic types have plain public data members, so the
|
||||
// error information is assigned directly instead of the old
|
||||
// setter calls.
|
||||
rt.errorString = tr_lts("dds", "Topic %1 was outdated and therefore ignored. Does the client time match the server time?");
|
||||
rt.errorParams = {TopicNameHelper::requestTopicName()};
|
||||
sendReply(request.identity(), rt);
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Declares the FTS::GenericFts template that generic_fts_impl.h's
|
||||
// GenericFtsImpl derives from. Present in the qt5 original; without it
|
||||
// GenericFts is no known template at the point of derivation.
|
||||
#include "generic_fts.h"
|
||||
#include <ddsfts_export.h>
|
||||
#include "logger.h"
|
||||
|
||||
|
||||
+7
-7
@@ -18,25 +18,25 @@ AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantMan
|
||||
{
|
||||
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
||||
switch (role.underlying()) {
|
||||
case ParticipantManagement::Role_def::Unknown:
|
||||
case ParticipantManagement::Role::Unknown:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::Friend:
|
||||
case ParticipantManagement::Role::Friend:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::Friend;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::Neutral:
|
||||
case ParticipantManagement::Role::Neutral:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::Neutral;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::Enemy:
|
||||
case ParticipantManagement::Role::Enemy:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::HostileFaker;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::Pending:
|
||||
case ParticipantManagement::Role::Pending:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::Pending;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::AssumedFriend:
|
||||
case ParticipantManagement::Role::AssumedFriend:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::AssumedFriend;
|
||||
break;
|
||||
case ParticipantManagement::Role_def::Suspect:
|
||||
case ParticipantManagement::Role::Suspect:
|
||||
identity = AdvancedSymbology::SidcDefinitions::Identity::SuspectJoker;
|
||||
break;
|
||||
}
|
||||
|
||||
+20
-20
@@ -65,7 +65,7 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantMa
|
||||
symDataToRender.fillColorReplace = true;
|
||||
|
||||
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());
|
||||
|
||||
@@ -161,30 +161,30 @@ AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataM
|
||||
{
|
||||
switch (state.underlying())
|
||||
{
|
||||
case ProjectDataManagement::VulnerabilityState::CombatReady:
|
||||
case ProjectDataManagement::VulnerabilityState::TemporarySeverance:
|
||||
case ProjectDataManagement::VulnerabilityState::NearMiss:
|
||||
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect:
|
||||
return AdvancedSymbology::Injury::NoInjury;
|
||||
case ProjectDataManagement::VulnerabilityState::LightDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::MediumDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::HeavyDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::NotReady:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_LightDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NotReady:
|
||||
return AdvancedSymbology::Injury::Hit;
|
||||
case ProjectDataManagement::VulnerabilityState::MobilityKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleMobilityKill:
|
||||
return AdvancedSymbology::Injury::MobilityKill;
|
||||
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_WeaponSystemDamage:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleWeaponSystemDamage:
|
||||
return AdvancedSymbology::Injury::WeaponKill;
|
||||
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
|
||||
return AdvancedSymbology::Injury::TotalKill;
|
||||
case ProjectDataManagement::VulnerabilityState::NContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::BContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::CContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged:
|
||||
case ProjectDataManagement::VulnerabilityState::Reserved:
|
||||
case ProjectDataManagement::VulnerabilityState::NoChange:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_BContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CContamination:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VulnerabilityBitsChanged:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_Reserved:
|
||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange:
|
||||
break;
|
||||
}
|
||||
return AdvancedSymbology::Injury::NoInjury;
|
||||
|
||||
+3
-3
@@ -100,10 +100,10 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
|
||||
|
||||
const ProjectDataManagement::VulnerabilityClass vc =
|
||||
typeClass == ParticipantManagement::TypeClass::Human
|
||||
? ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries
|
||||
: ProjectDataManagement::VulnerabilityClass_def::VehicleDamages;
|
||||
? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
|
||||
: ProjectDataManagement::VulnerabilityClass::VehicleDamages;
|
||||
ProjectDataManagement::VulnerabilityState vs =
|
||||
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarmConfig.vulnerabilityState());
|
||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
|
||||
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
|
||||
}
|
||||
return vulnerabilityState;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ struct NotificationEx : public AlarmManagement::Notification
|
||||
int equipmentNumber = 0;
|
||||
int participantId = 0;
|
||||
int aesId = 0;
|
||||
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown;
|
||||
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
|
||||
NotificationEx() = default;
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ void InterfaceImpl::clearInterfaces()
|
||||
|
||||
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
|
||||
{
|
||||
if (data.eventType() != ProjectDataManagement::PdmEventType_def::EmergencyCall)
|
||||
if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||
return;
|
||||
|
||||
const int issi = data.equipmentNumber();
|
||||
|
||||
+18
-18
@@ -57,55 +57,55 @@ AlarmDialog::AlarmDialog(QWidget* parent)
|
||||
alarmCheckBox.name = QLatin1String("NuclearAgentEntry");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxNMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxNMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterNuclear;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterNuclear;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("DangerAreasEntry");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxDanerAreaMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxDangerAreaMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterDangerArea;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterDangerArea;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("MineAreaEntry");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaEntryMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaEntryMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterMineArea;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("MineAreaHit");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaHitMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaHitMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitMine;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("DirectFire");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxDirectFireMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxDirectFireMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::Hit;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("IndirectFire");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxIndirectFireMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxIndirectFireMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitEffectSimulation;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("CrossLocalBorderlines");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxLocalBorderMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxLocalBorderMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossLocalBorderline;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("CrossGlobalBorderlines");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxGlobalBorderMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxGlobalBorderMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossGlobalBorderline;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
alarmCheckBox.name = QLatin1String("AirSupport");
|
||||
alarmCheckBox.checkboxMarker = m_ui->cbxAirSupportMarker;
|
||||
alarmCheckBox.checkboxWindow = m_ui->cbxAirSupportMessage;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::AirSupport;
|
||||
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
|
||||
m_checkBoxes.append(alarmCheckBox);
|
||||
|
||||
setOnlineHelpFilename(QLatin1String("Situation-Configure_Global_Alarms"));
|
||||
@@ -176,57 +176,57 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data,
|
||||
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
|
||||
switch (data.eventTypeId().underlying())
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType_def::EnterNuclear: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
|
||||
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
|
||||
m_ui->cbxNMarker->setChecked(setMarker);
|
||||
m_ui->cbxNMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::EnterDangerArea: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea: {
|
||||
DEBUG_LOG(m_logger) << "EnterDangerArea zuweisen ";
|
||||
m_ui->cbxDanerAreaMarker->setChecked(setMarker);
|
||||
m_ui->cbxDangerAreaMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::EnterMineArea: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_EnterMineArea: {
|
||||
DEBUG_LOG(m_logger) << "EnterMineArea zuweisen ";
|
||||
m_ui->cbxMineAreaEntryMarker->setChecked(setMarker);
|
||||
m_ui->cbxMineAreaEntryMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::HitMine: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
|
||||
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
|
||||
m_ui->cbxMineAreaHitMarker->setChecked(setMarker);
|
||||
m_ui->cbxMineAreaHitMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
|
||||
case ProjectDataManagement::PdmEventType_def::Hit: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_Hit: {
|
||||
DEBUG_LOG(m_logger) << "Hit zuweisen ";
|
||||
m_ui->cbxDirectFireMarker->setChecked(setMarker);
|
||||
m_ui->cbxDirectFireMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
|
||||
DEBUG_LOG(m_logger) << "HitEffectSimulation zuweisen ";
|
||||
m_ui->cbxIndirectFireMarker->setChecked(setMarker);
|
||||
m_ui->cbxIndirectFireMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
|
||||
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
|
||||
m_ui->cbxLocalBorderMarker->setChecked(setMarker);
|
||||
m_ui->cbxLocalBorderMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
|
||||
m_ui->cbxGlobalBorderMarker->setChecked(setMarker);
|
||||
m_ui->cbxGlobalBorderMessage->setChecked(messageWindow);
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::AirSupport: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
|
||||
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
|
||||
m_ui->cbxAirSupportMarker->setChecked(setMarker);
|
||||
m_ui->cbxAirSupportMessage->setChecked(messageWindow);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public:
|
||||
QCheckBox *checkboxMarker = nullptr;
|
||||
QCheckBox *checkboxWindow = nullptr;
|
||||
QString name;
|
||||
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown;
|
||||
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
|
||||
};
|
||||
|
||||
explicit AlarmDialog(QWidget *parent = nullptr);
|
||||
|
||||
+26
-26
@@ -115,7 +115,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
|
||||
switch (alarm.eventTypeId().underlying())
|
||||
{
|
||||
case ProjectDataManagement::PdmEventType_def::Hit: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_Hit: {
|
||||
DEBUG_LOG(m_logger) << "Hit zuweisen ";
|
||||
m_ui->cbxDirectFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
@@ -123,43 +123,43 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
if (alarm.vulnerabilityState() >= 0)
|
||||
{
|
||||
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()));
|
||||
m_ui->cbStatusDirect->setCurrentIndex(index);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
|
||||
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
|
||||
m_ui->cbxIndirectFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::AirSupport: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
|
||||
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
|
||||
m_ui->cbxAirSupport->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::HitMine: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
|
||||
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
|
||||
m_ui->cbxMines->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::HitB:
|
||||
case ProjectDataManagement::PdmEventType_def::HitN:
|
||||
case ProjectDataManagement::PdmEventType_def::HitC: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitB:
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitN:
|
||||
case ProjectDataManagement::PdmEventType::EventType_HitC: {
|
||||
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
|
||||
m_ui->cbxNbcAgent->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::FriendlyFire: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
|
||||
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
|
||||
m_ui->cbxFriendlyFire->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
@@ -167,27 +167,27 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
||||
if (alarm.vulnerabilityState() >= 0)
|
||||
{
|
||||
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()));
|
||||
m_ui->cbStatusFriendly->setCurrentIndex(index);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::Manipulation: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
|
||||
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
|
||||
m_ui->cbxManipulation->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
|
||||
m_ui->cbxGlobalBorderLine->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
||||
break;
|
||||
}
|
||||
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: {
|
||||
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
|
||||
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
|
||||
m_ui->cbxLocalBorderLine->setChecked(true);
|
||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
||||
@@ -215,7 +215,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
|
||||
{
|
||||
if (m_ui->cbxDirectFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Hit);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
|
||||
int statusDirect = -1;
|
||||
if (m_ui->cbStatusDirect->currentIndex() > 0)
|
||||
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
|
||||
@@ -224,7 +224,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
|
||||
}
|
||||
if (m_ui->cbxFriendlyFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::FriendlyFire);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
|
||||
int statusFriendly = -1;
|
||||
if (m_ui->cbStatusFriendly->currentIndex() > 0)
|
||||
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
|
||||
@@ -234,41 +234,41 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
|
||||
alarmActionDds.vulnerabilityState(-1);
|
||||
if (m_ui->cbxIndirectFire->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitEffectSimulation);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxAirSupport->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::AirSupport);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxMines->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitMine);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxNbcAgent->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitN);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitB);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitC);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxManipulation->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Manipulation);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxGlobalBorderLine->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
if (m_ui->cbxLocalBorderLine->isChecked())
|
||||
{
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossLocalBorderline);
|
||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
|
||||
alarmsDds.push_back(alarmActionDds);
|
||||
}
|
||||
}
|
||||
@@ -298,9 +298,9 @@ void ConfigParticipantsDialog::fillCbx()
|
||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
|
||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
|
||||
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->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::TemporarySeverance));
|
||||
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
|
||||
}
|
||||
|
||||
} // namespace ParticipantAlarms
|
||||
+1
-1
@@ -100,7 +100,7 @@ void ParticipantsDialog::onSelectionChanged()
|
||||
{
|
||||
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
|
||||
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;
|
||||
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
|
||||
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
||||
|
||||
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;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
|
||||
|
||||
+2
-2
@@ -180,9 +180,9 @@ void AesChargeEffectItemInfo::onShowDetails()
|
||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
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));
|
||||
else if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
|
||||
else if (gearClass == ProjectDataManagement::GearClass::Chemical)
|
||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
|
||||
}
|
||||
else
|
||||
|
||||
+23
-23
@@ -107,8 +107,8 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
|
||||
setOnlineHelpFilename(QStringLiteral("Info_Dialog-BoobyTrap"));
|
||||
break;
|
||||
}
|
||||
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
|
||||
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary: {
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMine:
|
||||
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
|
||||
handleOffRouteMine(aesItemView);
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged, this,
|
||||
&AesInfoDialog::onOffRouteMineChanged);
|
||||
@@ -284,14 +284,14 @@ bool AesInfoDialog::init(LtsSession::LtsSession* session, const std::shared_ptr<
|
||||
|
||||
m_ui->lbAesId->setText(tr("AES Id:"));
|
||||
|
||||
if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
|
||||
if (m_aesType == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
|
||||
{
|
||||
|
||||
handleMineAraeSingleMine();
|
||||
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dusMineStateChanged, this,
|
||||
&AesInfoDialog::onDusMineStateChanged);
|
||||
}
|
||||
else if (m_aesType == AreaEffectSimulation::AesType_def::AtDusSingleMine)
|
||||
else if (m_aesType == AreaEffectSimulation::AesType::AtDusSingleMine)
|
||||
{
|
||||
|
||||
handleSingleDusMine();
|
||||
@@ -363,7 +363,7 @@ void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
|
||||
<< " data.id(): " << data.id();
|
||||
|
||||
handleAesItem(data, AesType_def::AtBoobyTrap);
|
||||
handleAesItem(data, AesType::AtBoobyTrap);
|
||||
|
||||
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
|
||||
|
||||
@@ -390,7 +390,7 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine&
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
|
||||
<< " data.id(): " << data.id();
|
||||
|
||||
handleAesItem(data, AesType_def::AtOffRouteMine);
|
||||
handleAesItem(data, AesType::AtOffRouteMine);
|
||||
|
||||
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
|
||||
|
||||
@@ -595,17 +595,17 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
|
||||
|
||||
QStringList chargeTypesNames;
|
||||
QStringList chargeTypesShortNames;
|
||||
if (data.medicMode() != AesOperatingMode_def::OmNotUsed)
|
||||
if (data.medicMode() != AesOperatingMode::OmNotUsed)
|
||||
{
|
||||
chargeTypesNames << m_pdmDtc->trChargeTypeName(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);
|
||||
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
|
||||
}
|
||||
if (data.deconMode() != AesOperatingMode_def::OmNotUsed)
|
||||
if (data.deconMode() != AesOperatingMode::OmNotUsed)
|
||||
{
|
||||
chargeTypesNames << m_pdmDtc->trChargeTypeName(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));
|
||||
}
|
||||
|
||||
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)
|
||||
m_ui->lbAesId->setText(tr("DUS Mine Id:"));
|
||||
else
|
||||
@@ -763,28 +763,28 @@ void AesInfoDialog::handleSingleDusMine()
|
||||
|
||||
switch (dsm.effectStateId().underlying())
|
||||
{
|
||||
case AesEffectState_def::EsExpired:
|
||||
case AesEffectState::EsExpired:
|
||||
m_ui->lblStatus->setText(tr("Inactive"));
|
||||
break;
|
||||
case AesEffectState_def::EsRemoved:
|
||||
case AesEffectState::EsRemoved:
|
||||
m_ui->lblStatus->setText(tr("Removed"));
|
||||
break;
|
||||
case AesEffectState_def::EsCreated:
|
||||
case AesEffectState::EsCreated:
|
||||
m_ui->lblStatus->setText(tr("Created"));
|
||||
break;
|
||||
case AesEffectState_def::EsPrepared:
|
||||
case AesEffectState::EsPrepared:
|
||||
m_ui->lblStatus->setText(tr("Prepared"));
|
||||
break;
|
||||
case AesEffectState_def::EsActivated:
|
||||
case AesEffectState::EsActivated:
|
||||
m_ui->lblStatus->setText(tr("Active"));
|
||||
break;
|
||||
case AesEffectState_def::EsPaused:
|
||||
case AesEffectState::EsPaused:
|
||||
m_ui->lblStatus->setText(tr("Paused"));
|
||||
break;
|
||||
case AesEffectState_def::EsError:
|
||||
case AesEffectState::EsError:
|
||||
m_ui->lblStatus->setText(tr("Error"));
|
||||
break;
|
||||
case AesEffectState_def::EsReceived:
|
||||
case AesEffectState::EsReceived:
|
||||
m_ui->lblStatus->setText(tr("Received"));
|
||||
break;
|
||||
default:
|
||||
@@ -847,8 +847,8 @@ void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
|
||||
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId());
|
||||
switch (gearClass.underlying())
|
||||
{
|
||||
case ProjectDataManagement::GearClass_def::Biological:
|
||||
case ProjectDataManagement::GearClass_def::Chemical:
|
||||
case ProjectDataManagement::GearClass::Biological:
|
||||
case ProjectDataManagement::GearClass::Chemical:
|
||||
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
|
||||
break;
|
||||
default:
|
||||
@@ -916,7 +916,7 @@ void AesInfoDialog::onShowDetails()
|
||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||
{
|
||||
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);
|
||||
if (dialog)
|
||||
@@ -925,7 +925,7 @@ void AesInfoDialog::onShowDetails()
|
||||
break;
|
||||
}
|
||||
|
||||
if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
|
||||
if (gearClass == ProjectDataManagement::GearClass::Chemical)
|
||||
{
|
||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
|
||||
if (dialog)
|
||||
@@ -1146,7 +1146,7 @@ void AesInfoDialog::onShowDetails()
|
||||
|
||||
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;
|
||||
MineResetRequest req(0, {m_aesEntityId});
|
||||
|
||||
-1
@@ -36,7 +36,6 @@ class AesInfoDialog : public LtsWidgets::LtsDialog,
|
||||
}
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void retranslate() override;
|
||||
|
||||
void handleNContamination(const AesItemView& aesItemView);
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ void AirSupportExplosionClusterImpactList::createModel()
|
||||
{
|
||||
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_model->setSourceModel(m_effectClusterModel);
|
||||
}
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamina
|
||||
bcContaOut.propagationDirection = bcContamination.propagationDirection();
|
||||
|
||||
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
|
||||
ProjectDataManagement::VolatilityType_def::get_default(),
|
||||
ProjectDataManagement::VolatilityType::get_default(),
|
||||
bcContamination.impactRadius(),
|
||||
QDateTime::currentDateTime());
|
||||
|
||||
|
||||
+4
-4
@@ -132,12 +132,12 @@ void BCContaminationEdit::enableUiElements(bool enable)
|
||||
|
||||
m_ui->cbWeather->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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->bCContamination(m_aesItem.id());
|
||||
@@ -270,7 +270,7 @@ void BCContaminationEdit::setData(const BCContamination &contamination, bool cop
|
||||
if (copy)
|
||||
{
|
||||
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->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart().is_set() ? contamination.effectStart().get() : 0);
|
||||
@@ -348,7 +348,7 @@ bool BCContaminationEdit::apply()
|
||||
chargeType,
|
||||
pos,
|
||||
radius,
|
||||
static_cast<AesWeatherSource::inner_enum>(weathersource),
|
||||
static_cast<AesWeatherSource>(weathersource),
|
||||
LtsUtils::toOptional(partyId),
|
||||
LtsUtils::toOptional(participantId),
|
||||
dds::core::optional<double>(),
|
||||
|
||||
+13
-13
@@ -51,20 +51,20 @@ void BaseEdit::onAesItemModifyReply(const Core::FunctionReplyObject& replyObject
|
||||
bool BaseEdit::isModifiable() const
|
||||
{
|
||||
AesEffectState effectState = m_aesItem.effectStateId();
|
||||
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsCreated ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsUnknown ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsReceived) &&
|
||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsCreated ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsUnknown ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsReceived) &&
|
||||
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
|
||||
}
|
||||
|
||||
bool BaseEdit::isOnlyNameModifiable() const
|
||||
{
|
||||
AesEffectState effectState = m_aesItem.effectStateId();
|
||||
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated) &&
|
||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
|
||||
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ void BaseEdit::setEffectStartEnabled(LtsWidgets::LtsDateTimeEdit* dte, bool enab
|
||||
m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
|
||||
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
|
||||
|
||||
enable = (exercise.state() == ExerciseManagement::ExerciseState_def::Started ||
|
||||
exercise.state() == ExerciseManagement::ExerciseState_def::Paused);
|
||||
enable = (exercise.state() == ExerciseManagement::ExerciseState::Started ||
|
||||
exercise.state() == ExerciseManagement::ExerciseState::Paused);
|
||||
|
||||
if (exercise.state() == ExerciseManagement::ExerciseState_def::Created)
|
||||
if (exercise.state() == ExerciseManagement::ExerciseState::Created)
|
||||
dte->setChecked(false);
|
||||
else
|
||||
dte->setChecked(dte->msecsSinceEpoch() > 0);
|
||||
@@ -268,7 +268,7 @@ void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
|
||||
if (data.id() != m_aesItem.id())
|
||||
return;
|
||||
|
||||
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState_def::EsRemoved)
|
||||
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState::EsRemoved)
|
||||
{
|
||||
|
||||
__unchange__();
|
||||
@@ -302,7 +302,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ bool AesItemSortFilterProxyModel::checkFilter(int source_row) const
|
||||
return false;
|
||||
|
||||
const auto effectStateId = aesEffectStateId(source_row);
|
||||
if (effectStateId == AesEffectState_def::EsRemoved)
|
||||
if (effectStateId == AesEffectState::EsRemoved)
|
||||
return false;
|
||||
|
||||
if (showExpired())
|
||||
|
||||
+5
-5
@@ -347,11 +347,11 @@ public:
|
||||
{
|
||||
const auto es = aesItem(row).effectStateId();
|
||||
|
||||
return es != AreaEffectSimulation::AesEffectState_def::EsCreated &&
|
||||
es != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
|
||||
es != AreaEffectSimulation::AesEffectState_def::EsActivated &&
|
||||
es != AreaEffectSimulation::AesEffectState_def::EsPaused &&
|
||||
es != AreaEffectSimulation::AesEffectState_def::EsReceived;
|
||||
return es != AreaEffectSimulation::AesEffectState::EsCreated &&
|
||||
es != AreaEffectSimulation::AesEffectState::EsPrepared &&
|
||||
es != AreaEffectSimulation::AesEffectState::EsActivated &&
|
||||
es != AreaEffectSimulation::AesEffectState::EsPaused &&
|
||||
es != AreaEffectSimulation::AesEffectState::EsReceived;
|
||||
}
|
||||
bool isExternal(int row) const override
|
||||
{
|
||||
|
||||
+10
-10
@@ -35,21 +35,21 @@ Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
|
||||
{
|
||||
switch(state.underlying())
|
||||
{
|
||||
case AesEffectState_def::EsUnknown:
|
||||
case AesEffectState::EsUnknown:
|
||||
return Qt::BrushStyle::NoBrush;
|
||||
case AesEffectState_def::EsPrepared:
|
||||
case AesEffectState_def::EsFired:
|
||||
case AesEffectState::EsPrepared:
|
||||
case AesEffectState::EsFired:
|
||||
return Qt::BrushStyle::BDiagPattern;
|
||||
case AesEffectState_def::EsCreated:
|
||||
case AesEffectState_def::EsReceived:
|
||||
case AesEffectState::EsCreated:
|
||||
case AesEffectState::EsReceived:
|
||||
return Qt::BrushStyle::VerPattern;
|
||||
case AesEffectState_def::EsActivated:
|
||||
case AesEffectState::EsActivated:
|
||||
return Qt::BrushStyle::CrossPattern;
|
||||
case AesEffectState_def::EsRemoved:
|
||||
case AesEffectState::EsRemoved:
|
||||
return Qt::BrushStyle::NoBrush;
|
||||
case AesEffectState_def::EsPaused:
|
||||
case AesEffectState_def::EsExpired:
|
||||
case AesEffectState_def::EsError:
|
||||
case AesEffectState::EsPaused:
|
||||
case AesEffectState::EsExpired:
|
||||
case AesEffectState::EsError:
|
||||
return Qt::BrushStyle::SolidPattern;
|
||||
}
|
||||
return Qt::BrushStyle::NoBrush;
|
||||
|
||||
+4
-4
@@ -83,12 +83,12 @@ void BorderlineEdit::enableUiElements(bool enable)
|
||||
|
||||
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->borderline(m_aesItem.id());
|
||||
@@ -155,7 +155,7 @@ void BorderlineEdit::setData(const Borderline &borderline, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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()));
|
||||
if ( borderline.partyId().is_set())
|
||||
@@ -285,7 +285,7 @@ Borderline BorderlineEdit::jsonToBorderline(const QByteArray &content)
|
||||
borderline.effectMarkingInTa(obj[QStringLiteral("effectMarkingInTa")].toInt());
|
||||
borderline.effectStart(obj[QStringLiteral("effectStart")].toDouble());
|
||||
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.id(0);
|
||||
borderline.name(obj[QStringLiteral("leIdentifier")].toString().toStdString());
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ QVector<Borderline> BorderlinesModel::jsonToBorderlineVector(const QByteArray &c
|
||||
borderline.effectMarkingInTa(objArr[QStringLiteral("effectMarkingInTa")].toInt());
|
||||
borderline.effectStart(objArr[QStringLiteral("effectStart")].toDouble());
|
||||
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.id(0);
|
||||
borderline.name(objArr[QStringLiteral("name")].toString().toStdString());
|
||||
|
||||
+3
-3
@@ -98,13 +98,13 @@ bool ChargeAdministrationModel::initModel(LtsSession::LtsSession* session,
|
||||
}
|
||||
|
||||
QVector<ProjectDataManagement::ChargeType> chargesForGearClass =
|
||||
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Artillery) +
|
||||
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Mortar);
|
||||
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Artillery) +
|
||||
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Mortar);
|
||||
|
||||
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
|
||||
const bool enableRocket = ps->value(QStringLiteral("aes"), QStringLiteral("enableRocket"), false).toBool();
|
||||
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 ProjectDataManagement::ChargeType& ct : std::as_const(chargesForGearClass))
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ void ChargeEffectEdit::onSelectionChanged()
|
||||
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(m_ui->dvParticipants->selectedRows().first()));
|
||||
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;
|
||||
|
||||
DEBUG_LOG(m_logger) << "typeClass: " << m_ppmDtc->type(data.typeId()).typeClass()
|
||||
|
||||
+4
-4
@@ -66,12 +66,12 @@ void DangerAreaEdit::enableUiElements(bool enable)
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->dangerArea(m_aesItem.id());
|
||||
@@ -139,7 +139,7 @@ void DangerAreaEdit::setPbAesItemsText()
|
||||
if (item.id() <= 0)
|
||||
continue;
|
||||
|
||||
if (item.effectStateId() != AesEffectState_def::EsActivated)
|
||||
if (item.effectStateId() != AesEffectState::EsActivated)
|
||||
continue;
|
||||
sl << QString::fromStdString(item.name().c_str());
|
||||
}
|
||||
@@ -153,7 +153,7 @@ void DangerAreaEdit::setData(const DangerArea &aesItem, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->dteEffectStart->setMsecsSinceEpoch(aesItem.effectStart().is_set() ? aesItem.effectStart().get() : 0);
|
||||
|
||||
+3
-3
@@ -176,9 +176,9 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
|
||||
const QString &hdr = this->headerData(BcName, Qt::Horizontal, Qt::DisplayRole).toString();
|
||||
tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name())));
|
||||
|
||||
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass_def::Artillery)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Mortar)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Rocket);
|
||||
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass::Artillery)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Mortar)
|
||||
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Rocket);
|
||||
|
||||
toolTipHelper(this, idx, ColGearType, tooltip);
|
||||
if (bIsArtilleryOrMortar)
|
||||
|
||||
+11
-11
@@ -280,12 +280,12 @@ void ExplosionEdit::enableUiElements(bool enable)
|
||||
}
|
||||
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
AesItem baseData;
|
||||
@@ -307,7 +307,7 @@ void ExplosionEdit::enableUiElements(bool enable)
|
||||
if (name != m_ui->leIdentifier->text())
|
||||
m_ui->leIdentifier->setText(name);
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsPaused)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsPaused)
|
||||
__unchange__();
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ void ExplosionEdit::setBaseData(const AesItem &baseData, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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()));
|
||||
int idx = m_ui->cbChargeType->findData(baseData.chargeStruct().chargeTypeId());
|
||||
@@ -810,16 +810,16 @@ bool ExplosionEdit::apply()
|
||||
void ExplosionEdit::onFireClicked()
|
||||
{
|
||||
m_ui->pbFire->setEnabled(false);
|
||||
if ((m_aesItem.effectStateId() != AesEffectState_def::EsActivated &&
|
||||
m_aesItem.effectStateId() != AesEffectState_def::EsPaused &&
|
||||
m_aesItem.effectStateId() != AesEffectState_def::EsCreated &&
|
||||
m_aesItem.effectStateId() != AesEffectState_def::EsPrepared)
|
||||
if ((m_aesItem.effectStateId() != AesEffectState::EsActivated &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsPaused &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsCreated &&
|
||||
m_aesItem.effectStateId() != AesEffectState::EsPrepared)
|
||||
|| m_aesItem.id() <= 0)
|
||||
return;
|
||||
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsCreated ||
|
||||
m_aesItem.effectStateId() == AesEffectState_def::EsPrepared)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsCreated ||
|
||||
m_aesItem.effectStateId() == AesEffectState::EsPrepared)
|
||||
{
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + 3000);
|
||||
m_ui->dteEffectStart->setChecked(true);
|
||||
@@ -836,7 +836,7 @@ void ExplosionEdit::onFireClicked()
|
||||
m_requestHelper->addRequest([ = ]()
|
||||
{
|
||||
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<int32_t>(),
|
||||
dds::core::optional<int32_t>())
|
||||
|
||||
+3
-3
@@ -326,9 +326,9 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowExplosionClusterListDialog(QWidget *
|
||||
ExplosionList *listWidget;
|
||||
|
||||
listWidget = new ExplosionClusterList(menuGroup(),
|
||||
{ProjectDataManagement::GearClass_def::Artillery,
|
||||
ProjectDataManagement::GearClass_def::Mortar,
|
||||
ProjectDataManagement::GearClass_def::Rocket},
|
||||
{ProjectDataManagement::GearClass::Artillery,
|
||||
ProjectDataManagement::GearClass::Mortar,
|
||||
ProjectDataManagement::GearClass::Rocket},
|
||||
parent);
|
||||
|
||||
if (listWidget->init(m_session))
|
||||
|
||||
+1
-1
@@ -288,7 +288,7 @@ void ExplosionAreaList::createModel()
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+89
-89
@@ -63,7 +63,7 @@ static int s_timeUntilMinimumSec = 10;
|
||||
static const char *const VALUE_VALID_PROPERTY_NAME = "VALUE_VALID";
|
||||
static const char *const LAST_VALUE = "LAST_VALUE";
|
||||
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;
|
||||
if (contraintsDistance.isEmpty())
|
||||
{
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000});
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800});
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000});
|
||||
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;
|
||||
if (contraintsDistanceVulcano.isEmpty())
|
||||
{
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000});
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -107,10 +107,10 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
|
||||
return {0, 100000};
|
||||
return *it;
|
||||
}
|
||||
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; }
|
||||
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).second; }
|
||||
int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; }
|
||||
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;
|
||||
if (contraintsFlightDuration.isEmpty())
|
||||
{
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150});
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60});
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
|
||||
if (contraintsFlightDurationVulcano.isEmpty())
|
||||
{
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999});
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -145,16 +145,16 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inn
|
||||
return {10, 100};
|
||||
return *it;
|
||||
}
|
||||
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
|
||||
int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
if (contraintsPeak.isEmpty())
|
||||
{
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000});
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000});
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsPeakVulcano;
|
||||
if (contraintsPeakVulcano.isEmpty())
|
||||
{
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500});
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500});
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -190,8 +190,8 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum
|
||||
return {100, 10000};
|
||||
return *it;
|
||||
}
|
||||
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; }
|
||||
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).second; }
|
||||
int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; }
|
||||
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;
|
||||
|
||||
m_geometrieButtonGroup = new QButtonGroup(this);
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
|
||||
m_geometrieButtonGroup->setExclusive(true);
|
||||
|
||||
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);
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
|
||||
m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
|
||||
|
||||
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
|
||||
@@ -469,7 +469,7 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
|
||||
if (copy)
|
||||
{
|
||||
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.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);
|
||||
|
||||
|
||||
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
|
||||
switch (geometryType)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
m_ui->geometrieAimPointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
m_ui->geometriePointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
m_ui->geometrieAreaBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
m_ui->geometrieLineBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
m_ui->geometrieRadialBtn->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
@@ -614,7 +614,7 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
|
||||
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->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
|
||||
@@ -696,11 +696,11 @@ void ExplosionsEdit::onChargeTypeChanged()
|
||||
phfd = FlighDurationOrPeakHeight::FDPH_flightDuration;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)
|
||||
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
|
||||
{
|
||||
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
|
||||
const double impactRadius = m_pdmDtc->impactRadius(chargeTypeId, igniterTypeId, 0);
|
||||
@@ -792,7 +792,7 @@ void ExplosionsEdit::getPosition()
|
||||
|
||||
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 QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
|
||||
@@ -815,17 +815,17 @@ void ExplosionsEdit::getPosition()
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
{
|
||||
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
m_sitMapGuiIfc->getCircle(this,
|
||||
SLOT(onCircleData(QPointF, double)),
|
||||
nullptr,
|
||||
@@ -1024,7 +1024,7 @@ void ExplosionsEdit::onDropAngleChanged() { doCalculations(true); }
|
||||
|
||||
void ExplosionsEdit::onWidthChanged(int width)
|
||||
{
|
||||
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
|
||||
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
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::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";
|
||||
|
||||
@@ -1176,7 +1176,7 @@ bool ExplosionsEdit::setValueAccordingContraints(int newValue, ExplosionsEdit::F
|
||||
bool bRet = false;
|
||||
|
||||
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();
|
||||
|
||||
switch (phfd)
|
||||
@@ -1242,7 +1242,7 @@ void ExplosionsEdit::switchTo(FlighDurationOrPeakHeight phfd)
|
||||
}
|
||||
|
||||
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();
|
||||
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
|
||||
}
|
||||
@@ -1273,7 +1273,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
|
||||
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;
|
||||
|
||||
DoCalculationsExitGuard exitGuard(this, executeEnableUiElements);
|
||||
@@ -1519,7 +1519,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
|
||||
|
||||
|
||||
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();
|
||||
|
||||
@@ -1670,10 +1670,10 @@ void ExplosionsEdit::handleLaserPrecisionChargeType(const int chargeTypeId)
|
||||
const auto geoButtons = m_geometrieButtonGroup->buttons();
|
||||
if (chargeTypeId == s_laserPrecisionChargeTypeId)
|
||||
{
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1767,15 +1767,15 @@ void ExplosionsEdit::enableUiElements(bool enable)
|
||||
m_ui->pbPosition->setEnabled(m_sitMapGuiIfc && enable);
|
||||
m_ui->positionEdit->setEnabled(enable);
|
||||
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
|
||||
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
|
||||
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
|
||||
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
|
||||
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
|
||||
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(
|
||||
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->cbGearClass->setEnabled(enable);
|
||||
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->leElement->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::EsActivated);
|
||||
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
|
||||
@@ -1879,7 +1879,7 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
if (!enableBasics)
|
||||
return;
|
||||
|
||||
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired)
|
||||
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
return;
|
||||
|
||||
int numberTrajectoriesRef = 0;
|
||||
@@ -1927,7 +1927,7 @@ void ExplosionsEdit::enableUiFireButton()
|
||||
else
|
||||
{
|
||||
|
||||
if (m_explosionClusterData.effectStateId() == AesEffectState_def::EsPaused)
|
||||
if (m_explosionClusterData.effectStateId() == AesEffectState::EsPaused)
|
||||
bPause = false;
|
||||
}
|
||||
}
|
||||
@@ -1966,26 +1966,26 @@ void ExplosionsEdit::showPreviewObject()
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
@@ -2013,7 +2013,7 @@ bool ExplosionsEdit::isDataSufficiant()
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
|
||||
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
|
||||
break;
|
||||
@@ -2054,7 +2054,7 @@ bool ExplosionsEdit::apply()
|
||||
|
||||
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));
|
||||
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
|
||||
@@ -2065,7 +2065,7 @@ bool ExplosionsEdit::apply()
|
||||
|
||||
break;
|
||||
}
|
||||
case AesExplosionGeometry_def::EgLine:
|
||||
case AesExplosionGeometry::EgLine:
|
||||
{
|
||||
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
|
||||
|
||||
@@ -2081,9 +2081,9 @@ bool ExplosionsEdit::apply()
|
||||
|
||||
break;
|
||||
}
|
||||
case AesExplosionGeometry_def::EgAimPoint:
|
||||
case AesExplosionGeometry_def::EgArea:
|
||||
case AesExplosionGeometry_def::EgPoint:
|
||||
case AesExplosionGeometry::EgAimPoint:
|
||||
case AesExplosionGeometry::EgArea:
|
||||
case AesExplosionGeometry::EgPoint:
|
||||
default:
|
||||
{
|
||||
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
|
||||
@@ -2118,7 +2118,7 @@ bool ExplosionsEdit::apply()
|
||||
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);
|
||||
else
|
||||
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
|
||||
@@ -2223,7 +2223,7 @@ bool ExplosionsEdit::apply()
|
||||
|
||||
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)
|
||||
return;
|
||||
|
||||
@@ -2249,8 +2249,8 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2275,7 +2275,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
onChargeTypeChanged();
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2296,7 +2296,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
m_ui->sbDurationSec->setSingleStep(60);
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(true);
|
||||
@@ -2315,7 +2315,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
m_ui->sbDurationSec->setValue(60);
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2351,10 +2351,10 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
|
||||
void ExplosionsEdit::onFireClicked()
|
||||
{
|
||||
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
|
||||
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) ||
|
||||
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState_def::EsFired)
|
||||
if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) ||
|
||||
(m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState::EsFired)
|
||||
|
||||
)
|
||||
|| m_aesItem.id() <= 0)
|
||||
@@ -2375,7 +2375,7 @@ void ExplosionsEdit::onFireClicked()
|
||||
|
||||
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->setChecked(true);
|
||||
@@ -2433,7 +2433,7 @@ void ExplosionsEdit::onFireClicked()
|
||||
|
||||
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);
|
||||
fillCharges();
|
||||
@@ -2441,10 +2441,10 @@ void ExplosionsEdit::onGearClassChanged()
|
||||
fillParties();
|
||||
onPartyChanged();
|
||||
|
||||
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar;
|
||||
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
|
||||
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
|
||||
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;
|
||||
}
|
||||
|
||||
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 int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
|
||||
@@ -2609,7 +2609,7 @@ void ExplosionsEdit::fillCharges()
|
||||
DEBUG_LOG(m_logger) << " fillCharges"
|
||||
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano
|
||||
<< ", impactRadius4Debug = " << impactRadius4Debug << ", isAdlerChargeType = " << isAdlerChargeType;
|
||||
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass_def::Artillery))
|
||||
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery))
|
||||
continue;
|
||||
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
|
||||
}
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ private Q_SLOTS:
|
||||
void onEffectDurationChanged(int value);
|
||||
|
||||
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 isGuiVulcano();
|
||||
|
||||
+22
-22
@@ -88,11 +88,11 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_geometrieButtonGroup = new QButtonGroup(this);
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
|
||||
m_geometrieButtonGroup->setExclusive(true);
|
||||
|
||||
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
|
||||
@@ -220,20 +220,20 @@ void ExplosionsEditAdler::showPreviewObject()
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
@@ -260,7 +260,7 @@ bool ExplosionsEditAdler::isDataSufficiant()
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
bHasTargetArea &= m_ui->lblDimensionYDepth->text().toInt() > 0;
|
||||
bHasTargetArea &= m_ui->lblWidthRadius->text().toInt() > 0;
|
||||
break;
|
||||
@@ -290,7 +290,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
if (ecData.effectStart().is_set())
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -301,22 +301,22 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart);
|
||||
|
||||
// Geometry/Area
|
||||
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
|
||||
switch (geometryType)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
m_ui->geometrieAimPointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
m_ui->geometriePointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
m_ui->geometrieAreaBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
m_ui->geometrieLineBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
m_ui->geometrieRadialBtn->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
@@ -380,7 +380,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
|
||||
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->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->rbAngleGroupUpper->setEnabled(enable);
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
m_ui->pbStateChange->setEnabled(true);
|
||||
else
|
||||
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
|
||||
@@ -600,7 +600,7 @@ void ExplosionsEditAdler::setPbStateChangeName()
|
||||
|
||||
m_ui->pbStateChange->show();
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
m_ui->pbStateChange->setText(tr("Acknowledge"));
|
||||
else
|
||||
{
|
||||
@@ -624,7 +624,7 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
|
||||
// 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); });
|
||||
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
{
|
||||
AreaEffectSimulation::AcknowledgeExternalAesItemRequest request;
|
||||
request.aesId(m_aesItem.id());
|
||||
@@ -758,7 +758,7 @@ void ExplosionsEditAdler::setEffectClusterDataFromJson(const std::string &proper
|
||||
else
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
+102
-102
@@ -67,7 +67,7 @@ static const char *const LAST_VALUE = "LAST_VALUE";
|
||||
static QLatin1String emptyEntryComboBox = QLatin1String("--");
|
||||
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
|
||||
// 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;
|
||||
if (contraintsDistance.isEmpty())
|
||||
{
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000}); // Haubitze
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800}); // Mörser
|
||||
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {15000, 90000}); // Rakete
|
||||
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {10000, 38400}); // Minenrakete
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000}); // Haubitze
|
||||
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800}); // Mörser
|
||||
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {15000, 90000}); // Rakete
|
||||
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {10000, 38400}); // Minenrakete
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
|
||||
if (contraintsDistanceVulcano.isEmpty())
|
||||
{
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000}); // Haubitze
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000}); // Rakete
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000}); // Haubitze
|
||||
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000}); // Rakete
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -111,16 +111,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataMana
|
||||
return {0, 100000};
|
||||
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;
|
||||
}
|
||||
int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
|
||||
int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
|
||||
{
|
||||
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
|
||||
// Haubitze: von 6 bis 150 Sekunden
|
||||
@@ -131,15 +131,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
|
||||
static QHash<int, QPair<int, int>> contraintsFlightDuration;
|
||||
if (contraintsFlightDuration.isEmpty())
|
||||
{
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150}); // Haubitze
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60}); // Mörser
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150}); // Haubitze
|
||||
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60}); // Mörser
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
|
||||
if (contraintsFlightDurationVulcano.isEmpty())
|
||||
{
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999}); // Haubitze
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999}); // Rakete
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999}); // Haubitze
|
||||
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999}); // Rakete
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -155,16 +155,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
|
||||
return {10, 100};
|
||||
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;
|
||||
}
|
||||
int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
|
||||
int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
|
||||
{
|
||||
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
|
||||
// Haubitze: von 250 bis 15000m
|
||||
@@ -175,15 +175,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
|
||||
static QHash<int, QPair<int, int>> contraintsPeak;
|
||||
if (contraintsPeak.isEmpty())
|
||||
{
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000}); // Haubitze
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000}); // Mörser
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000}); // Haubitze
|
||||
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000}); // Mörser
|
||||
}
|
||||
|
||||
static QHash<int, QPair<int, int>> contraintsPeakVulcano;
|
||||
if (contraintsPeakVulcano.isEmpty())
|
||||
{
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500}); // Haubitze
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500}); // Rakete
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500}); // Haubitze
|
||||
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500}); // Rakete
|
||||
}
|
||||
if (chargeTypeIdIsVulcano(chargeTypeId))
|
||||
{
|
||||
@@ -200,19 +200,19 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
|
||||
return {100, 10000};
|
||||
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;
|
||||
}
|
||||
int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
|
||||
int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
|
||||
{
|
||||
return getMinMaxPeakHeight(gearClass, chargeTypeId).second;
|
||||
}
|
||||
|
||||
bool ExplosionsEditAdlerStandAlone::isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry)
|
||||
{
|
||||
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)
|
||||
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
|
||||
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint)
|
||||
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -270,11 +270,11 @@ ExplosionsEditAdlerStandAlone::ExplosionsEditAdlerStandAlone(const QString &menu
|
||||
headline->setAlignment(Qt::AlignCenter);
|
||||
|
||||
m_geometrieButtonGroup = new QButtonGroup(this);
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
|
||||
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
|
||||
m_geometrieButtonGroup->setExclusive(true);
|
||||
|
||||
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);
|
||||
|
||||
// initial adjustment:
|
||||
m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
|
||||
m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
|
||||
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
|
||||
|
||||
// pay attention!!! firePurposeId vs purpose !!!
|
||||
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
|
||||
@@ -569,7 +569,7 @@ bool ExplosionsEditAdlerStandAlone::init(int aesItemId, bool copy, LtsSession::L
|
||||
if (copy)
|
||||
{
|
||||
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.effectStateId(m_aesItem.effectStateId());
|
||||
}
|
||||
@@ -624,22 +624,22 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
|
||||
m_ui->leElement->setText(QString::fromStdString(ecData.element()));
|
||||
|
||||
// Geometry/Area
|
||||
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
|
||||
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
|
||||
switch (geometryType)
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
m_ui->geometrieAimPointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
m_ui->geometriePointBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
m_ui->geometrieAreaBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
m_ui->geometrieLineBtn->setChecked(true);
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
m_ui->geometrieRadialBtn->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
@@ -709,7 +709,7 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
|
||||
// with firingType
|
||||
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)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
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->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
|
||||
@@ -793,11 +793,11 @@ void ExplosionsEditAdlerStandAlone::onChargeTypeChanged()
|
||||
|
||||
FlighDurationOrPeakHeight phfd = FlighDurationOrPeakHeight::FDPH_peakHeight;
|
||||
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);
|
||||
|
||||
// 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 igniterFunctionId = m_ui->cbIgniterFunction->currentData().toInt();
|
||||
@@ -915,7 +915,7 @@ void ExplosionsEditAdlerStandAlone::getPosition()
|
||||
|
||||
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 QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
|
||||
@@ -938,16 +938,16 @@ void ExplosionsEditAdlerStandAlone::getPosition()
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
{
|
||||
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
|
||||
return;
|
||||
}
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
m_sitMapGuiIfc->getCircle(this,
|
||||
SLOT(onCircleData(QPointF, double)),
|
||||
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::setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd,
|
||||
ProjectDataManagement::GearClass_def::type gearClass,
|
||||
ProjectDataManagement::GearClass gearClass,
|
||||
int chargeTypeId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " setMinMaxConstraints START";
|
||||
@@ -1218,7 +1218,7 @@ bool ExplosionsEditAdlerStandAlone::setValueAccordingContraints(int newValue, Ex
|
||||
bool bRet = false;
|
||||
|
||||
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();
|
||||
|
||||
switch (phfd)
|
||||
@@ -1269,7 +1269,7 @@ void ExplosionsEditAdlerStandAlone::switchTo(FlighDurationOrPeakHeight phfd)
|
||||
}
|
||||
|
||||
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();
|
||||
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
|
||||
}
|
||||
@@ -1304,7 +1304,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
|
||||
return;
|
||||
|
||||
// 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;
|
||||
|
||||
doCalculationsAdlerStandAloneExitGuard exitGuard(this, executeEnableUiElements);
|
||||
@@ -1506,7 +1506,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
|
||||
//
|
||||
|
||||
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();
|
||||
|
||||
@@ -1784,7 +1784,7 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
|
||||
m_ui->cbParticipantUnits->setEnabled(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);
|
||||
m_ui->dteEffectStart->setChecked(true);
|
||||
m_ui->dteEffectStart->setEnabled(showEffectStart);
|
||||
@@ -1795,15 +1795,15 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
|
||||
m_ui->positionEdit->setEnabled(enable);
|
||||
// m_ui->sbAltitude->setEnabled(enable);
|
||||
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
|
||||
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
|
||||
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
|
||||
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|
||||
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
|
||||
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
|
||||
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(
|
||||
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->cbGearClass->setEnabled(enable);
|
||||
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->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->lblLoadNumber->setEnabled(!isRocket && enable);
|
||||
m_ui->cbLoadType->setEnabled(!isRocket && enable);
|
||||
@@ -1856,8 +1856,8 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
|
||||
|
||||
// [GUEZE-2960] Explizite Kunden-Forderung:
|
||||
// ZpNumber nicht_ mehr modifizierbar, wenn Wirkfeld aktiv
|
||||
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated);
|
||||
m_ui->leElement->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::EsActivated);
|
||||
|
||||
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.
|
||||
// // Beim Wechsel auf einen anderen Munitionstyp soll wieder als Default die untere Winkelgruppe ausgewählt werden &&
|
||||
// // die Eingabemaske muss wieder auswählbar sein.
|
||||
// const ProjectDataManagement::GearClass_def::type gearClassType =
|
||||
// static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
|
||||
// const ProjectDataManagement::GearClass gearClassType =
|
||||
// static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
|
||||
|
||||
// // const bool usePeakHeight = m_ui->sBox_peakHeight->styleSheet().isEmpty();
|
||||
// const bool useFlightDuration = m_ui->sBox_flightDuration->styleSheet().isEmpty();
|
||||
|
||||
// m_ui->cbFlightCurve->setEnabled(enable &&
|
||||
// (gearClassType != ProjectDataManagement::GearClass_def::Mortar) &&
|
||||
// (gearClassType != ProjectDataManagement::GearClass::Mortar) &&
|
||||
// useFlightDuration
|
||||
// );
|
||||
// }
|
||||
@@ -1943,7 +1943,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
|
||||
if (!enableBasics)
|
||||
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
|
||||
|
||||
int numberTrajectoriesRef = 0;
|
||||
@@ -2000,7 +2000,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
|
||||
else
|
||||
{
|
||||
// re-openening dialog:
|
||||
if (m_effectClusterData.effectStateId() == AesEffectState_def::EsPaused)
|
||||
if (m_effectClusterData.effectStateId() == AesEffectState::EsPaused)
|
||||
bPause = false;
|
||||
}
|
||||
}
|
||||
@@ -2040,24 +2040,24 @@ void ExplosionsEditAdlerStandAlone::showPreviewObject()
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
if (m_previewPolygon.isEmpty())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
|
||||
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
|
||||
return;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
if (m_previewCircleCenter.isNull())
|
||||
return;
|
||||
|
||||
@@ -2085,7 +2085,7 @@ bool ExplosionsEditAdlerStandAlone::isDataSufficiant()
|
||||
bool bHasTargetArea = !m_coord.isNull();
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
|
||||
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
|
||||
break;
|
||||
@@ -2136,7 +2136,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
|
||||
|
||||
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));
|
||||
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
|
||||
@@ -2147,7 +2147,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
|
||||
|
||||
break;
|
||||
}
|
||||
case AesExplosionGeometry_def::EgLine:
|
||||
case AesExplosionGeometry::EgLine:
|
||||
{
|
||||
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
|
||||
|
||||
@@ -2163,9 +2163,9 @@ bool ExplosionsEditAdlerStandAlone::apply()
|
||||
|
||||
break;
|
||||
}
|
||||
case AesExplosionGeometry_def::EgAimPoint:
|
||||
case AesExplosionGeometry_def::EgArea:
|
||||
case AesExplosionGeometry_def::EgPoint:
|
||||
case AesExplosionGeometry::EgAimPoint:
|
||||
case AesExplosionGeometry::EgArea:
|
||||
case AesExplosionGeometry::EgPoint:
|
||||
default:
|
||||
{
|
||||
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);
|
||||
else
|
||||
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
|
||||
@@ -2308,7 +2308,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
|
||||
|
||||
// Rocket-Spezifika:
|
||||
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)
|
||||
{
|
||||
RocketUtility::addRocketPropertiesToRequest(request, m_ppmDtc);
|
||||
@@ -2327,7 +2327,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
|
||||
*/
|
||||
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)
|
||||
return;
|
||||
|
||||
@@ -2353,8 +2353,8 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
|
||||
|
||||
switch (m_currentGeometry.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: // What is AimPoint?
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint: // What is AimPoint?
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2386,7 +2386,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
|
||||
onChargeTypeChanged();
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2412,7 +2412,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
|
||||
m_ui->sbDurationSec->setSingleStep(60);
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(true);
|
||||
@@ -2437,7 +2437,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
|
||||
m_ui->sbDurationSec->setValue(60); // 1 min
|
||||
}
|
||||
break;
|
||||
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
|
||||
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
|
||||
{
|
||||
m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
|
||||
m_ui->sbHeight2SBox->setEnabled(false);
|
||||
@@ -2473,10 +2473,10 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
|
||||
void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << " onFireClicked";
|
||||
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) || // initially the effectStateId is Unknown...
|
||||
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|
||||
// || (m_aesItem.effectStateId() == AesEffectState_def::EsPaused) // Maybe EsPaused will be supported in future
|
||||
if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) || // initially the effectStateId is Unknown...
|
||||
(m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
||||
|| (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|
||||
// || (m_aesItem.effectStateId() == AesEffectState::EsPaused) // Maybe EsPaused will be supported in future
|
||||
)
|
||||
|| m_aesItem.id() <= 0)
|
||||
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;
|
||||
|
||||
@@ -2564,7 +2564,7 @@ void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
|
||||
*/
|
||||
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);
|
||||
fillCharges();
|
||||
@@ -2572,10 +2572,10 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
|
||||
fillParties();
|
||||
onPartyChanged();
|
||||
|
||||
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar;
|
||||
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
|
||||
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
|
||||
if (!lastVal.isNull())
|
||||
lastGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(lastVal.toInt());
|
||||
lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
|
||||
|
||||
{
|
||||
// GUEZE-2459
|
||||
@@ -2586,7 +2586,7 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
|
||||
// Default is Upper
|
||||
m_ui->rbAngleGroupUpper->setChecked(true);
|
||||
// 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";
|
||||
m_ui->rbAngleGroupLower->setCheckable(false);
|
||||
@@ -2711,7 +2711,7 @@ bool ExplosionsEditAdlerStandAlone::isValidParty(qint32 partyId)
|
||||
|
||||
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);
|
||||
m_ui->dteEffectStart->setEnabled(showEffectStart);
|
||||
m_ui->dteEffectStart->setVisible(showEffectStart);
|
||||
@@ -2793,7 +2793,7 @@ double ExplosionsEditAdlerStandAlone::getElevation(const double lon, const doubl
|
||||
|
||||
void ExplosionsEditAdlerStandAlone::onWidthChanged(int width)
|
||||
{
|
||||
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
|
||||
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
|
||||
{
|
||||
m_ui->sbDimensionY_Tiefe->setValue(width);
|
||||
|
||||
@@ -2891,7 +2891,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
|
||||
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 int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
|
||||
@@ -2916,7 +2916,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
|
||||
DEBUG_LOG(m_logger) << " fillCharges"
|
||||
<< ", 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;
|
||||
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
|
||||
}
|
||||
@@ -2934,7 +2934,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
|
||||
|
||||
void ExplosionsEditAdlerStandAlone::fillFiringTypCbox()
|
||||
{
|
||||
QVector<AreaEffectSimulation::FiringType::type> firetypes{FiringType::ReportReadyToFire,
|
||||
QVector<AreaEffectSimulation::FiringType> firetypes{FiringType::ReportReadyToFire,
|
||||
FiringType::FireWithIndicationTOT,
|
||||
FiringType::FireWithIndicationTTF,
|
||||
FiringType::FireOnCommand,
|
||||
@@ -3047,7 +3047,7 @@ void ExplosionsEditAdlerStandAlone::mmiToJsonproperties(QJsonObject &data)
|
||||
data[AdlerJson::JsonKeys::TYP()] = m_ui->cbTargetType->currentData().toInt();
|
||||
data[AdlerJson::JsonKeys::SUB_TYP()] = m_ui->cbTargetSubType->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())
|
||||
data[AdlerJson::JsonKeys::ABFEUERUNGSZEIT()] = m_ui->dteEffectStart->msecsSinceEpoch() / 1000.0;
|
||||
else
|
||||
|
||||
+10
-10
@@ -102,7 +102,7 @@ class ExplosionsEditAdlerStandAlone final
|
||||
void onEffectDurationChanged(int value);
|
||||
|
||||
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 isGuiVulcano();
|
||||
@@ -148,15 +148,15 @@ class ExplosionsEditAdlerStandAlone final
|
||||
bool isSmoke();
|
||||
void updateActorComboBox(const Core::GeoPosition &coordGeo);
|
||||
|
||||
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId);
|
||||
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
int getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
|
||||
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
int getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
|
||||
bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry);
|
||||
|
||||
struct Charges
|
||||
|
||||
+13
-13
@@ -27,7 +27,7 @@ namespace AreaEffectSimulation
|
||||
namespace RocketUtility
|
||||
{
|
||||
|
||||
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type geometry)
|
||||
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geometry)
|
||||
{
|
||||
if (wirkmittelCombobox == nullptr)
|
||||
return;
|
||||
@@ -39,13 +39,13 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
|
||||
switch (geometry)
|
||||
{
|
||||
case AesExplosionGeometry::type::EgAimPoint:
|
||||
case AesExplosionGeometry::type::EgPoint:
|
||||
case AesExplosionGeometry::type::EgLine:
|
||||
case AesExplosionGeometry::EgAimPoint:
|
||||
case AesExplosionGeometry::EgPoint:
|
||||
case AesExplosionGeometry::EgLine:
|
||||
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++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)
|
||||
{
|
||||
@@ -60,15 +60,15 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
|
||||
}
|
||||
}
|
||||
return;
|
||||
case AesExplosionGeometry::type::EgRadial:
|
||||
case AesExplosionGeometry::type::EgArea:
|
||||
case AesExplosionGeometry::EgRadial:
|
||||
case AesExplosionGeometry::EgArea:
|
||||
{
|
||||
const int currentIndex = wirkmittelCombobox->currentIndex();
|
||||
|
||||
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++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)
|
||||
{
|
||||
@@ -100,15 +100,15 @@ void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std
|
||||
{
|
||||
switch (request.explosionGeometry().underlying())
|
||||
{
|
||||
case AesExplosionGeometry::type::EgAimPoint:
|
||||
case AesExplosionGeometry::type::EgPoint:
|
||||
case AesExplosionGeometry::EgAimPoint:
|
||||
case AesExplosionGeometry::EgPoint:
|
||||
addRocketPropertiesForPointGeometry(request, ppmDtc);
|
||||
return;
|
||||
case AesExplosionGeometry::type::EgLine:
|
||||
case AesExplosionGeometry::EgLine:
|
||||
addRocketPropertiesForLinearGeometry(request, ppmDtc);
|
||||
return;
|
||||
case AesExplosionGeometry::type::EgRadial:
|
||||
case AesExplosionGeometry::type::EgArea:
|
||||
case AesExplosionGeometry::EgRadial:
|
||||
case AesExplosionGeometry::EgArea:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class EffectClusterModifyRequest;
|
||||
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 addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
|
||||
void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
|
||||
|
||||
+48
-48
@@ -163,7 +163,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
|
||||
|
||||
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";
|
||||
m_ui->sbDecontaminationMinutes->setEnabled(false);
|
||||
@@ -209,17 +209,17 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
|
||||
m_ui->sbWidth->setEnabled(enable);
|
||||
|
||||
|
||||
const bool deconAvailable = type.deconMode() != AesOperatingMode_def::OmNotAvailable;
|
||||
const bool maintAvailable = type.maintMode() != AesOperatingMode_def::OmNotAvailable;
|
||||
const bool medicAvailable = type.medicMode() != AesOperatingMode_def::OmNotAvailable;
|
||||
const bool deconAvailable = type.deconMode() != AesOperatingMode::OmNotAvailable;
|
||||
const bool maintAvailable = type.maintMode() != AesOperatingMode::OmNotAvailable;
|
||||
const bool medicAvailable = type.medicMode() != AesOperatingMode::OmNotAvailable;
|
||||
|
||||
m_ui->cbDecontamination->setEnabled(enable && deconAvailable);
|
||||
m_ui->cbMaintenance->setEnabled(enable && maintAvailable);
|
||||
m_ui->cbMedical->setEnabled(enable && medicAvailable);
|
||||
|
||||
m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && deconAvailable);
|
||||
m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && maintAvailable);
|
||||
m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && medicAvailable);
|
||||
m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && deconAvailable);
|
||||
m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && maintAvailable);
|
||||
m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && medicAvailable);
|
||||
m_ui->sbSupplyMinutes->setEnabled(false);
|
||||
m_ui->sbSupplyMinutes->setValue(0);
|
||||
m_ui->cbSupply->setCurrentIndex(0);
|
||||
@@ -244,7 +244,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
|
||||
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()));
|
||||
__unchange__();
|
||||
@@ -252,7 +252,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
|
||||
setUnchangeable();
|
||||
disableButtons(true);
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->functionalArea(m_aesItem.id());
|
||||
@@ -327,7 +327,7 @@ void FunctionalAreaEdit::setData(const FunctionalArea &area, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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()));
|
||||
@@ -394,19 +394,19 @@ void FunctionalAreaEdit::fillCbx()
|
||||
QString byOperator = tr("by operator");
|
||||
QString bytimeout = tr("by wait time");
|
||||
|
||||
m_ui->cbDecontamination->addItem(unused, AesOperatingMode_def::OmNotUsed);
|
||||
m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode_def::OmObserver);
|
||||
m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
|
||||
m_ui->cbDecontamination->addItem(unused, AesOperatingMode::OmNotUsed);
|
||||
m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode::OmObserver);
|
||||
m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
|
||||
|
||||
m_ui->cbMaintenance->addItem(unused, AesOperatingMode_def::OmNotUsed);
|
||||
m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode_def::OmObserver);
|
||||
m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
|
||||
m_ui->cbMaintenance->addItem(unused, AesOperatingMode::OmNotUsed);
|
||||
m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode::OmObserver);
|
||||
m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
|
||||
|
||||
m_ui->cbMedical->addItem(unused, AesOperatingMode_def::OmNotUsed);
|
||||
m_ui->cbMedical->addItem(byOperator, AesOperatingMode_def::OmObserver);
|
||||
m_ui->cbMedical->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
|
||||
m_ui->cbMedical->addItem(unused, AesOperatingMode::OmNotUsed);
|
||||
m_ui->cbMedical->addItem(byOperator, AesOperatingMode::OmObserver);
|
||||
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)
|
||||
@@ -450,22 +450,22 @@ void FunctionalAreaEdit::onRectData(const QPointF ¢erPoint, double width, do
|
||||
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
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()
|
||||
@@ -488,9 +488,9 @@ void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged()
|
||||
m_ui->sbDecontaminationMinutes->setValue(type.deconTime());
|
||||
m_ui->sbMaintanenceMinutes->setValue(type.maintTime());
|
||||
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->cbMaintenance->setCurrentIndex(m_ui->cbMaintenance->findData(type.maintMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::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->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::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.maintMode().underlying()));
|
||||
m_ui->cbMedical->setCurrentIndex(m_ui->cbMedical->findData(type.medicMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.medicMode().underlying()));
|
||||
}
|
||||
}
|
||||
enableUiElements(true);
|
||||
@@ -613,32 +613,32 @@ bool FunctionalAreaEdit::apply()
|
||||
int functionalAreaType = m_ui->cbFunctionalAreaType->currentData().toInt();
|
||||
int playerId = 0;
|
||||
const auto pointSymbol = m_sidc.toStdString();
|
||||
AesOperatingMode deconMode = static_cast<AesOperatingMode_def::type>(m_ui->cbDecontamination->currentData().toInt());
|
||||
int deconTime = (AesOperatingMode_def::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());
|
||||
int maintTime = (AesOperatingMode_def::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());
|
||||
int medicTime = (AesOperatingMode_def::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 deconMode = static_cast<AesOperatingMode>(m_ui->cbDecontamination->currentData().toInt());
|
||||
int deconTime = (AesOperatingMode::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()) ? 1000 * 60 * m_ui->sbDecontaminationMinutes->value() : 0;
|
||||
AesOperatingMode maintMode = static_cast<AesOperatingMode>(m_ui->cbMaintenance->currentData().toInt());
|
||||
int maintTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()) ? 1000 * 60 * m_ui->sbMaintanenceMinutes->value() : 0;
|
||||
AesOperatingMode medicMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
|
||||
int medicTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
|
||||
AesOperatingMode supplyMode = static_cast<AesOperatingMode>(m_ui->cbSupply->currentData().toInt());
|
||||
if ( functionalAreaType != 7 )
|
||||
supplyMode = AesOperatingMode_def::OmNotUsed;
|
||||
int supplyTime = (AesOperatingMode_def::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());
|
||||
int notfightTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
|
||||
supplyMode = AesOperatingMode::OmNotUsed;
|
||||
int supplyTime = (AesOperatingMode::OmWaitingTime == m_ui->cbSupply->currentData().toInt()) ? 1000 * 60 * m_ui->sbSupplyMinutes->value() : 0;
|
||||
AesOperatingMode notfightMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
|
||||
int notfightTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
|
||||
if ( functionalAreaType == 7 )
|
||||
{
|
||||
deconMode = AesOperatingMode_def::OmNotUsed;
|
||||
maintMode = AesOperatingMode_def::OmNotUsed;
|
||||
medicMode = AesOperatingMode_def::OmNotUsed;
|
||||
notfightMode = AesOperatingMode_def::OmNotUsed;
|
||||
deconMode = AesOperatingMode::OmNotUsed;
|
||||
maintMode = AesOperatingMode::OmNotUsed;
|
||||
medicMode = AesOperatingMode::OmNotUsed;
|
||||
notfightMode = AesOperatingMode::OmNotUsed;
|
||||
}
|
||||
if ( functionalAreaType == 8 )
|
||||
{
|
||||
deconMode = AesOperatingMode_def::OmNotUsed;
|
||||
maintMode = AesOperatingMode_def::OmNotUsed;
|
||||
medicMode = AesOperatingMode_def::OmNotUsed;
|
||||
supplyMode = AesOperatingMode_def::OmNotUsed;
|
||||
notfightMode = AesOperatingMode_def::OmObserver;
|
||||
deconMode = AesOperatingMode::OmNotUsed;
|
||||
maintMode = AesOperatingMode::OmNotUsed;
|
||||
medicMode = AesOperatingMode::OmNotUsed;
|
||||
supplyMode = AesOperatingMode::OmNotUsed;
|
||||
notfightMode = AesOperatingMode::OmObserver;
|
||||
}
|
||||
|
||||
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 ::dds::core::optional< int32_t > participantIdOpt = LtsUtils::toOptional(playerId);
|
||||
if (supplyMode == AesOperatingMode_def::OmWaitingTime)
|
||||
if (supplyMode == AesOperatingMode::OmWaitingTime)
|
||||
{
|
||||
partyId = 0;
|
||||
playerId = m_participant.id();
|
||||
|
||||
+3
-3
@@ -76,12 +76,12 @@ void GasPipeEdit::enableUiElements(bool enable)
|
||||
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->gasPipe(m_aesItem.id());
|
||||
@@ -136,7 +136,7 @@ void GasPipeEdit::setData(const GasPipe &aesItem, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->sbWidth->setValue(aesItem.width());
|
||||
|
||||
+9
-9
@@ -114,12 +114,12 @@ void MineAreaEdit::enableUiElements(bool enable)
|
||||
else
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
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));
|
||||
|
||||
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->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType_def::LptPioneer));
|
||||
m_ui->cbLayingProcedure->addItem(tr("Pioneer"), AesMaLayingProcedureType::LptPioneer);
|
||||
m_ui->cbLayingProcedure->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType::LptPioneer));
|
||||
|
||||
m_ui->cbLayingMethod->addItem(tr("Open"), 0);
|
||||
m_ui->cbLayingMethod->addItem(tr("Covered"), 1);
|
||||
@@ -246,7 +246,7 @@ void MineAreaEdit::setData(const MineArea &data, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(data.chargeStruct().chargeTypeId()));
|
||||
@@ -323,7 +323,7 @@ void MineAreaEdit::getPosition()
|
||||
double width = m_ui->sbWidth->value();
|
||||
|
||||
int maxSegments = m_segments;
|
||||
if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType_def::LptArtillery)
|
||||
if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType::LptArtillery)
|
||||
maxSegments = 1;
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ bool MineAreaEdit::apply()
|
||||
std::string name = m_ui->leIdentifier->text().toStdString();
|
||||
int chargeTypeId = m_ui->cbChargeType->currentData().toInt();
|
||||
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;
|
||||
int partyId = m_ui->cbParty->currentData().toInt();
|
||||
int playerId = 0;
|
||||
@@ -429,7 +429,7 @@ bool MineAreaEdit::apply()
|
||||
|
||||
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)
|
||||
m_pdmGuiIfc->setChargeTypePropertyFilter(m_ui->cbChargeType, QStringLiteral("canBeThrown"), true);
|
||||
else
|
||||
|
||||
+3
-3
@@ -76,12 +76,12 @@ void MineCorridorEdit::enableUiElements(bool enable)
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->mineCorridor(m_aesItem.id());
|
||||
@@ -134,7 +134,7 @@ void MineCorridorEdit::setData(const MineCorridor &aesItem, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->sbWidth->setValue(aesItem.width());
|
||||
|
||||
+3
-3
@@ -126,12 +126,12 @@ void BoobyTrapEdit::enableUiElements(bool enable)
|
||||
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
||||
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->boobyTrap(m_aesItem.id());
|
||||
@@ -225,7 +225,7 @@ void BoobyTrapEdit::setData(const BoobyTrap &bt, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->dteEffectStart->setMsecsSinceEpoch(bt.effectStart().is_set() ? bt.effectStart().get() : 0);
|
||||
|
||||
+3
-3
@@ -176,12 +176,12 @@ void OffRouteMineEdit::enableUiElements(bool enable)
|
||||
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
||||
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->offRouteMine(m_aesItem.id());
|
||||
@@ -249,7 +249,7 @@ void OffRouteMineEdit::setData(const OffRouteMine &orm, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
m_aesItem.id(0);
|
||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
|
||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
|
||||
}
|
||||
const Area &area = orm.area();
|
||||
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) ||
|
||||
|
||||
+12
-12
@@ -157,9 +157,9 @@ void NContaminationEdit::onWeatherChanged(int index )
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
|
||||
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt());
|
||||
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic ||
|
||||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic)
|
||||
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
|
||||
if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
|
||||
weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
|
||||
{
|
||||
m_ui->rotationAngleEdit->showSpinbox(1, false);
|
||||
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 radial2 = direction + (fabs(spanAngle) / 2.0);
|
||||
|
||||
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt());
|
||||
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic ||
|
||||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic)
|
||||
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
|
||||
if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
|
||||
weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
|
||||
{
|
||||
radial1 = spanAngle;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ double NContaminationEdit::spanAngle() const
|
||||
double radial2 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(1), LtsAngleEditBase::AngleUnitType::Deg,
|
||||
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;
|
||||
|
||||
double spanAngle = radial2 - radial1;
|
||||
@@ -213,7 +213,7 @@ double NContaminationEdit::spanAngle() 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;
|
||||
|
||||
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->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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->nContamination(m_aesItem.id());
|
||||
@@ -322,7 +322,7 @@ void NContaminationEdit::setData(const NContamination &contamination, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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()));
|
||||
@@ -385,7 +385,7 @@ bool NContaminationEdit::apply()
|
||||
int partyId = 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 Core::GeoPosition2D pos(p.x(), p.y());
|
||||
const NContaminationModifyRequest req(m_aesItem.id(),
|
||||
|
||||
+6
-6
@@ -81,12 +81,12 @@ void TechnicalAreaEdit::enableUiElements(bool enable)
|
||||
m_ui->sbWidth->setEnabled(enable);
|
||||
m_ui->pbClear->setEnabled(enable);
|
||||
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()));
|
||||
__unchange__();
|
||||
}
|
||||
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
|
||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
||||
{
|
||||
QString name = m_ui->leIdentifier->text();
|
||||
auto baseData = m_dtc->technicalArea(m_aesItem.id());
|
||||
@@ -137,7 +137,7 @@ void TechnicalAreaEdit::setData(const TechnicalArea &area, bool copy)
|
||||
if (copy)
|
||||
{
|
||||
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->sbWidth->setValue(area.area().width());
|
||||
@@ -161,9 +161,9 @@ inline void TechnicalAreaEdit::fillCbx()
|
||||
|
||||
|
||||
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 )
|
||||
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 ¢erPoint, double width, dou
|
||||
bool TechnicalAreaEdit::apply()
|
||||
{
|
||||
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(),
|
||||
m_ui->sbWidth->value(),
|
||||
m_ui->sbHeight->value(),
|
||||
|
||||
-1
@@ -29,7 +29,6 @@ class TopicEditor : public TopicEditorBase::TopicEditor
|
||||
~TopicEditor();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
void updateInternalData() override final;
|
||||
void retranslate() override final;
|
||||
|
||||
|
||||
+2
-2
@@ -111,7 +111,7 @@ void EditCombatNetRadioDialog::setUiValues(const CnrConfig& cnrConfig)
|
||||
m_ui->chkGlobal->setChecked(m_isGlobal);
|
||||
initCbChannels(cnrConfig.cnrChannelId());
|
||||
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)
|
||||
{
|
||||
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();
|
||||
|
||||
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->lbUnit->setDisabled(disableParty);
|
||||
m_ui->cbParty->setDisabled(disableParty);
|
||||
|
||||
+2
-2
@@ -73,10 +73,10 @@ bool EditFrequencyPlanningResourceDataModel::isFiltered(const AudioVideoManageme
|
||||
DataModification modType) const
|
||||
{
|
||||
|
||||
if (m_frequencyBand != FrequencyBand_def::REL && data.frequencyBand() != m_frequencyBand)
|
||||
if (m_frequencyBand != FrequencyBand::REL && data.frequencyBand() != m_frequencyBand)
|
||||
return true;
|
||||
|
||||
if (m_frequencyBand == FrequencyBand_def::REL && data.frequencyBand() != FrequencyBand_def::VHF)
|
||||
if (m_frequencyBand == FrequencyBand::REL && data.frequencyBand() != FrequencyBand::VHF)
|
||||
return true;
|
||||
|
||||
Q_UNUSED(modType);
|
||||
|
||||
+4
-4
@@ -45,12 +45,12 @@ EditFrequencyPlanningSetResourceDialog::EditFrequencyPlanningSetResourceDialog(
|
||||
|
||||
for (const auto &it : dataVec)
|
||||
{
|
||||
if((operatingMode == RcOperatingMode_def::AkwEncEccm ||
|
||||
operatingMode == RcOperatingMode_def::AkwEncNone)
|
||||
if((operatingMode == RcOperatingMode::AkwEncEccm ||
|
||||
operatingMode == RcOperatingMode::AkwEncNone)
|
||||
&& it.akwRadioCircuit() == 0)
|
||||
continue;
|
||||
if((operatingMode != RcOperatingMode_def::AkwEncEccm &&
|
||||
operatingMode != RcOperatingMode_def::AkwEncNone)
|
||||
if((operatingMode != RcOperatingMode::AkwEncEccm &&
|
||||
operatingMode != RcOperatingMode::AkwEncNone)
|
||||
&& it.akwRadioCircuit() != 0)
|
||||
continue;
|
||||
m_frequencyResourceDataModel->insertRow(it);
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ class FrequencyPlanningDialog : public LtsWidgets::LtsDialog,
|
||||
void setButtonSetActivePlanningEnabled();
|
||||
static void setBackgroundColor(QWidget* w, Qt::GlobalColor color, bool bSetColor);
|
||||
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;
|
||||
|
||||
private:
|
||||
|
||||
+14
-14
@@ -23,9 +23,9 @@ FrequencyPlanningWidget::FrequencyPlanningWidget(const std::shared_ptr<Interface
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::VHF), FrequencyBand_def::VHF);
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::HF), FrequencyBand_def::HF);
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::UHF), FrequencyBand_def::UHF);
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::VHF), FrequencyBand::VHF);
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::HF), FrequencyBand::HF);
|
||||
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::UHF), FrequencyBand::UHF);
|
||||
|
||||
connect(m_ui->leName, &QLineEdit::textChanged, this, &FrequencyPlanningWidget::onNameChanged);
|
||||
connect(m_ui->cbFrequencyBand, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
@@ -51,15 +51,15 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
|
||||
switch (ft.underlying())
|
||||
{
|
||||
|
||||
case FrequencyBand_def::HF: {
|
||||
case FrequencyBand::HF: {
|
||||
createHFWidget(data);
|
||||
break;
|
||||
}
|
||||
case FrequencyBand_def::UHF: {
|
||||
case FrequencyBand::UHF: {
|
||||
createUHFWidget(data);
|
||||
break;
|
||||
}
|
||||
case FrequencyBand_def::VHF: {
|
||||
case FrequencyBand::VHF: {
|
||||
createVHFWidget(data);
|
||||
break;
|
||||
}
|
||||
@@ -72,13 +72,13 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
|
||||
m_ui->lbxFrequencyBand->setVisible(true);
|
||||
switch (ft.underlying())
|
||||
{
|
||||
case FrequencyBand_def::HF:
|
||||
case FrequencyBand::HF:
|
||||
createHFWidget(data);
|
||||
break;
|
||||
case FrequencyBand_def::UHF:
|
||||
case FrequencyBand::UHF:
|
||||
createUHFWidget(data);
|
||||
break;
|
||||
case FrequencyBand_def::VHF:
|
||||
case FrequencyBand::VHF:
|
||||
createVHFWidget(data);
|
||||
break;
|
||||
default:
|
||||
@@ -117,7 +117,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool 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);
|
||||
}
|
||||
else
|
||||
@@ -129,7 +129,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool restrict)
|
||||
QJsonObject FrequencyPlanningWidget::toJson() const
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ void FrequencyPlanningWidget::onFrequencyBandChanged()
|
||||
{
|
||||
switch (m_ui->cbFrequencyBand->currentData().toInt())
|
||||
{
|
||||
case FrequencyBand_def::HF:
|
||||
case FrequencyBand::HF:
|
||||
createHFWidget();
|
||||
break;
|
||||
case FrequencyBand_def::UHF:
|
||||
case FrequencyBand::UHF:
|
||||
createUHFWidget();
|
||||
break;
|
||||
case FrequencyBand_def::VHF:
|
||||
case FrequencyBand::VHF:
|
||||
createVHFWidget();
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public:
|
||||
FrequencyPlanningWidget(const std::shared_ptr<Interface::Dtc> &avmDtc, QSet<int> &allocatedDataSets, QWidget *parent = nullptr);
|
||||
~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 setName(const QString& name);
|
||||
void setRelaisRestrictions(bool restrict);
|
||||
|
||||
Loaded 100 of 1295 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user