Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -32,7 +32,7 @@ PreTests::PreTests(QObject *parent)
//----------------------------------------------------------------------------------
bool PreTests::init(int domainId, int exerciseId, int testId, int presentationId)
{
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_exerciseId = exerciseId;
@@ -42,18 +42,18 @@ bool PreTests::init(int domainId, int exerciseId, int testId, int presentationId
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, m_exerciseId));
if (!m_ddsConnector->init())
return false;
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
m_ddsConnector->initPublisherSubscriber();
DEBUG_LOG() << "create ftc PRE";
DEBUG_LOG(m_logger) << "create ftc PRE";
m_ftc = PresentationManagement::Interface::Ftc::create(m_ddsConnector);
DEBUG_LOG() << "init ftc PRE";
DEBUG_LOG(m_logger) << "init ftc PRE";
bool bRet = m_ftc->enableAll();
DEBUG_LOG() << "init end PRE - bRet = " << bRet;
DEBUG_LOG(m_logger) << "init end PRE - bRet = " << bRet;
DEBUG_LOG() << "Domain Id = " << domainId;
DEBUG_LOG() << "Exercise Id = " << exerciseId;
DEBUG_LOG() << "Test Id = " << testId;
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId;
DEBUG_LOG(m_logger) << "Test Id = " << testId;
//TODO: add connects
@@ -63,7 +63,7 @@ bool PreTests::init(int domainId, int exerciseId, int testId, int presentationId
//----------------------------------------------------------------------------------
void PreTests::startTest()
{
INFO_LOG() << "startTest";
INFO_LOG(m_logger) << "startTest";
switch (m_testId)
{
case 1:
@@ -82,18 +82,18 @@ void PreTests::startTest()
tryChangeStatus();
break;
default:
ERROR_LOG() << "Unknown test case !";
ERROR_LOG(m_logger) << "Unknown test case !";
failExit();
break;
}
INFO_LOG() << "********* endTest **************";
INFO_LOG(m_logger) << "********* endTest **************";
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
//----------------------------------------------------------------------------------
void PreTests::tryCreate()
{
INFO_LOG() << "trying to send createRequest Presentation";
INFO_LOG(m_logger) << "trying to send createRequest Presentation";
m_presentationId = -1;
PresentationModifyRequest request;
@@ -119,7 +119,7 @@ void PreTests::tryCreate()
if (!m_ftc->presentationModifyRequest(request, this))
{
ERROR_LOG() << "Error requesting create data";
ERROR_LOG(m_logger) << "Error requesting create data";
failExit();
}
@@ -150,10 +150,10 @@ void PreTests::tryModify()
vectorPc[1].duration(60);
vectorPc[1].startTime(QDateTime(QDate(2017,2,14), QTime(9,45)).toMSecsSinceEpoch());
INFO_LOG() << "trying to send modify request for presentation Id = " << m_presentationId;
INFO_LOG(m_logger) << "trying to send modify request for presentation Id = " << m_presentationId;
if (!m_ftc->presentationModifyRequest(request, this))
{
ERROR_LOG() << "Error requesting modify data";
ERROR_LOG(m_logger) << "Error requesting modify data";
failExit();
}
@@ -167,10 +167,10 @@ void PreTests::tryDelete()
request.id(m_presentationId);
INFO_LOG() << "trying to send delete request for presentation Id = " << m_presentationId;
INFO_LOG(m_logger) << "trying to send delete request for presentation Id = " << m_presentationId;
if (!m_ftc->presentationRemoveRequest(request, this))
{
ERROR_LOG() << "Error requesting delete data";
ERROR_LOG(m_logger) << "Error requesting delete data";
failExit();
}
}
@@ -181,11 +181,11 @@ void PreTests::tryGetContent()
GetPresentationContentRequest request;
request.presentationId(m_presentationId);
INFO_LOG() << "trying to send content request for presentation Id = " << m_presentationId;
INFO_LOG(m_logger) << "trying to send content request for presentation Id = " << m_presentationId;
if (!m_ftc->getPresentationContentRequest(request, this))
{
ERROR_LOG() << "Error requesting content for presentationId: " << m_presentationId;
ERROR_LOG(m_logger) << "Error requesting content for presentationId: " << m_presentationId;
failExit();
}
@@ -202,10 +202,10 @@ void PreTests::tryChangeStatus()
request.lastModified(QDateTime::currentMSecsSinceEpoch());
request.fileStatus(FileStatus::Deleted);
INFO_LOG() << "trying to send change status request for presentation Id = " << m_presentationId;
INFO_LOG(m_logger) << "trying to send change status request for presentation Id = " << m_presentationId;
if (!m_ftc->presentationChangeStatusRequest(request, this))
{
ERROR_LOG() << "Error requesting change status";
ERROR_LOG(m_logger) << "Error requesting change status";
failExit();
}
@@ -215,7 +215,7 @@ void PreTests::tryChangeStatus()
//----------------------------------------------------------------------------------
void PreTests::failExit()
{
ERROR_LOG() << "FAIL EXIT !";
ERROR_LOG(m_logger) << "FAIL EXIT !";
m_bTestsSuccessful = false;
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -223,14 +223,14 @@ void PreTests::failExit()
//----------------------------------------------------------------------------------
void PreTests::onPresentationCreateReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG() << "END (onPresentationCreateReply)";
DEBUG_LOG(m_logger) << "END (onPresentationCreateReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onPresentationCreateReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onPresentationCreateReply error: " << replyObject();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return;
}
INFO_LOG() << "Got createReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
m_presentationId = replyObject.id();
@@ -245,15 +245,15 @@ void PreTests::onPresentationModifyReply(const Core::FunctionReplyObject &replyO
{
if (m_presentationId == -1)
return onPresentationCreateReply(replyObject);
DEBUG_LOG() << "END (onPresentationModifyReply)";
DEBUG_LOG(m_logger) << "END (onPresentationModifyReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onPresentationModifyReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onPresentationModifyReply error: " << replyObject();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return;
}
INFO_LOG() << "Got createReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
m_presentationId = replyObject.id();
@@ -267,15 +267,15 @@ void PreTests::onPresentationModifyReply(const Core::FunctionReplyObject &replyO
//----------------------------------------------------------------------------------
void PreTests::onPresentationChangeStatusReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG() << "END (onPresentationChangeStatusReply)";
DEBUG_LOG(m_logger) << "END (onPresentationChangeStatusReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onPresentationChangeStatusReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onPresentationChangeStatusReply error: " << replyObject();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return;
}
INFO_LOG() << "Got changeStatusReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got changeStatusReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
m_presentationId = replyObject.id();
@@ -289,16 +289,16 @@ void PreTests::onPresentationChangeStatusReply(const Core::FunctionReplyObject &
//----------------------------------------------------------------------------------
void PreTests::onPresentationRemoveReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG() << "END (onPresentationRemoveReply)";
DEBUG_LOG(m_logger) << "END (onPresentationRemoveReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onPresentationRemoveReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onPresentationRemoveReply error: " << replyObject();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return;
}
INFO_LOG() << "Got reply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got reply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
@@ -307,16 +307,16 @@ void PreTests::onPresentationRemoveReply(const Core::FunctionReplyObject &replyO
//----------------------------------------------------------------------------------
void PreTests::onGetPresentationContentReply(const GetPresentationContentReply &replyObject)
{
DEBUG_LOG() << "END (onGetPresentationContentReply)";
DEBUG_LOG(m_logger) << "END (onGetPresentationContentReply)";
if (replyObject.errorString().size() > 0)
{
ERROR_LOG() << "Got onGetPresentationContentReply error: " << replyObject.errorString();
ERROR_LOG(m_logger) << "Got onGetPresentationContentReply error: " << replyObject.errorString();
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
return;
}
INFO_LOG() << "Got reply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got reply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString()
<< " and content size " << replyObject.content().size();
@@ -14,14 +14,14 @@ namespace PresentationManagement
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: m_ddsConnector(ddsConnector)
{
DEBUG_LOG() << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
bool DdsHandler::init(const QStringList &qosFileList)
{
if(!m_ddsConnector->init(qosFileList))
{
ERROR_LOG() << "Error initializing dds connections - aborting";
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
return false;
}
@@ -35,10 +35,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
m_ddsFts = PresentationManagement::Interface::Fts::create(m_ddsConnector);
bool bRet = m_ddsDts->enableAll();
INFO_LOG() << "Dts initialised";
INFO_LOG(m_logger) << "Dts initialised";
bRet &= m_ddsFts->enableAll();
INFO_LOG() << "Fts initialised";
INFO_LOG(m_logger) << "Fts initialised";
return bRet;
}
@@ -45,6 +45,7 @@ public:
}
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
std::shared_ptr<PresentationManagement::Interface::Dts> m_ddsDts;
@@ -46,10 +46,10 @@ bool HandlerPresentation::init()
};
if (!m_mainHandler->db()->select(cb))
{
ERROR_LOG() << "Error reading data from database!";
ERROR_LOG(m_logger) << "Error reading data from database!";
return false;
}
DEBUG_LOG() << "m_objectPresentationMap.size() = " << m_objectPresentationMap.size();
DEBUG_LOG(m_logger) << "m_objectPresentationMap.size() = " << m_objectPresentationMap.size();
}
{
@@ -59,7 +59,7 @@ bool HandlerPresentation::init()
ObjectPresentation *objPre = m_objectPresentationMap.value(data.presentationId);
if (!objPre || !objPre->isValid())
{
WARNING_LOG() << "Cannot find presentation Id = " << data.presentationId
WARNING_LOG(m_logger) << "Cannot find presentation Id = " << data.presentationId
<< " for presentationContent " << data.id;
return;
}
@@ -67,7 +67,7 @@ bool HandlerPresentation::init()
};
if (!m_mainHandler->db()->select(cb))
{
ERROR_LOG() << "Error reading data from database!";
ERROR_LOG(m_logger) << "Error reading data from database!";
return false;
}
}
@@ -83,10 +83,10 @@ bool HandlerPresentation::init()
void HandlerPresentation::onPresentationModifyRequest(const rti::core::SampleIdentity &cookie,
const PresentationModifyRequest &request)
{
DEBUG_LOG() << "onPresentationModifyRequest: " << request;
DEBUG_LOG(m_logger) << "onPresentationModifyRequest: " << request;
auto ret = request.id() > 0 ? presentationModifyRequest(request) : presentationCreateRequest(request);
if (ret.error())
WARNING_LOG() << ret();
WARNING_LOG(m_logger) << ret();
m_mainHandler->dds()->fts()->presentationModifyReply(cookie, ret);
}
@@ -131,7 +131,7 @@ Core::FunctionReplyObject HandlerPresentation::presentationModifyRequest(const P
void HandlerPresentation::onPresentationRemoveRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request)
{
DEBUG_LOG() << "onPresentationRemoveRequest: " << request;
DEBUG_LOG(m_logger) << "onPresentationRemoveRequest: " << request;
Core::FunctionReplyObject ret;
int presentationId = request.id();
@@ -151,10 +151,10 @@ void HandlerPresentation::onPresentationRemoveRequest(const rti::core::SampleIde
return;
}
DEBUG_LOG() << "Deleting presentation id = " << presentationId;
DEBUG_LOG(m_logger) << "Deleting presentation id = " << presentationId;
ret = ifs->removeObject(); // removes all from db due to fk
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
// delete ObjectPresentation (including Map)
delete ifs;
@@ -211,7 +211,7 @@ void HandlerPresentation::onPresentationChangeStatusRequest(const rti::core::Sam
}
Core::FunctionReplyObject ret = ifs->changeStatus(request);
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
m_mainHandler->dds()->fts()->presentationChangeStatusReply(cookie, ret);
}
@@ -44,6 +44,7 @@ public:
}
private:
NGL::INGLLogger &m_logger;
void onPresentationModifyRequest(const rti::core::SampleIdentity &cookie,
const PresentationModifyRequest &request) override;
Core::FunctionReplyObject presentationCreateRequest(const PresentationModifyRequest &request);
@@ -56,6 +57,7 @@ private:
const PresentationChangeStatusRequest &request) override;
private:
NGL::INGLLogger &m_logger;
Initialization *m_mainHandler;
QMap<int, ObjectPresentation *> m_objectPresentationMap;
};
@@ -42,6 +42,8 @@ public:
int exerciseId() const;
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<HandlerPresentation> m_handlerPresentation;
@@ -16,9 +16,8 @@
namespace PresentationManagement
{
//----------------------------------------------------------------------------------------------------
ObjectPresentation::ObjectPresentation(Initialization *mainHandler)
: m_mainHandler(mainHandler)
{
ObjectPresentation::ObjectPresentation(Initialization *mainHandler) : m_mainHandler(mainHandler),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
}
ObjectPresentation::ObjectPresentation(const Presentation &data, Initialization *mainHandler)
@@ -79,12 +78,12 @@ Core::FunctionReplyObject ObjectPresentation::createObject(const PresentationMod
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting PresentationContent-data into database"));
else
{
DEBUG_LOG() << "New presentation content id : " << conDbData.id;
DEBUG_LOG(m_logger) << "New presentation content id : " << conDbData.id;
conData.id(conDbData.id);
}
}
DEBUG_LOG() << "New Id: " << m_data.id();
DEBUG_LOG(m_logger) << "New Id: " << m_data.id();
trans.commit();
onPublishData();
@@ -114,9 +113,9 @@ Core::FunctionReplyObject ObjectPresentation::updateObject(const PresentationMod
for (const auto &content : std::as_const(m_content))
{
if (m_mainHandler->db()->removePrePresentationContent(content.id()))
DEBUG_LOG() << "Removed presentation content id " << content.id();
DEBUG_LOG(m_logger) << "Removed presentation content id " << content.id();
else
ERROR_LOG() << "Failed to remove presentation content id " << content.id();
ERROR_LOG(m_logger) << "Failed to remove presentation content id " << content.id();
}
m_content = request.content();
@@ -132,7 +131,7 @@ Core::FunctionReplyObject ObjectPresentation::updateObject(const PresentationMod
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting PresentationContent-data into database"));
else
{
DEBUG_LOG() << "New presentation content id : " << conDbData.id;
DEBUG_LOG(m_logger) << "New presentation content id : " << conDbData.id;
conData.id(conDbData.id);
}
@@ -180,7 +179,7 @@ Core::FunctionReplyObject ObjectPresentation::changeStatus(const PresentationCha
//------------------------------------------------------------------------------------------------------------
void ObjectPresentation::onPublishData()
{
INFO_LOG() << "Publish Presentation-data to dds (" << m_data.id() << ") ...";
INFO_LOG(m_logger) << "Publish Presentation-data to dds (" << m_data.id() << ") ...";
m_mainHandler->dds()->dts()->publish(m_data);
}
@@ -54,6 +54,7 @@ public:
void onPublishData();
private:
NGL::INGLLogger &m_logger;
Initialization *m_mainHandler;
Presentation m_data;
std::vector<PresentationContent> m_content;