Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules
Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.
This commit is contained in:
1200 files changed
+20421
-18259
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)
|
||||
|
||||
+39
-25
@@ -198,6 +198,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>)
|
||||
{
|
||||
@@ -338,7 +349,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 +476,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 +552,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 +562,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 +576,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 +593,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 +629,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 +659,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 +691,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 +707,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 +719,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 +734,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 +751,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 +772,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 +809,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 +826,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();
|
||||
|
||||
+4
-2
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user