Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+62
-62
@@ -39,7 +39,7 @@ MrkTests::~MrkTests()
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MrkTests::init(int domainId, int exerciseId, int testId, int markerId, int snapshotId)
|
||||
{
|
||||
INFO_LOG() << "MrkTests::init() "
|
||||
INFO_LOG(m_logger) << "MrkTests::init() "
|
||||
<< " domainId:" << domainId
|
||||
<< " exerciseId:" << exerciseId
|
||||
<< " testId: " << testId
|
||||
@@ -58,18 +58,18 @@ bool MrkTests::init(int domainId, int exerciseId, int testId, int markerId, int
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
// Access to FTC
|
||||
DEBUG_LOG() << "create ftc";
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
m_ftc = MarkerManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc";
|
||||
DEBUG_LOG(m_logger) << "init ftc";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
// Access to DTC
|
||||
DEBUG_LOG() << "create dtc";
|
||||
DEBUG_LOG(m_logger) << "create dtc";
|
||||
m_dtc = MarkerManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init dtc";
|
||||
DEBUG_LOG(m_logger) << "init dtc";
|
||||
bRet = m_dtc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
return bRet;
|
||||
} // end of init()
|
||||
@@ -77,7 +77,7 @@ bool MrkTests::init(int domainId, int exerciseId, int testId, int markerId, int
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest() exerciseId:" << m_exerciseId
|
||||
INFO_LOG(m_logger) << "startTest() exerciseId:" << m_exerciseId
|
||||
<< " testId:" << m_testId
|
||||
<< " markerId:" << m_markerId
|
||||
;
|
||||
@@ -112,10 +112,10 @@ void MrkTests::tryCreate()
|
||||
MarkerModifyRequest data;
|
||||
getMarkerCreateRequestData(data);
|
||||
|
||||
INFO_LOG() << "trying to send MarkerCreateRequest";
|
||||
INFO_LOG(m_logger) << "trying to send MarkerCreateRequest";
|
||||
if (!m_ftc->markerModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
} // end of tryCreate()
|
||||
@@ -127,10 +127,10 @@ void MrkTests::tryModify()
|
||||
MarkerModifyRequest data;
|
||||
getMarkerModifyRequestData(data);
|
||||
|
||||
INFO_LOG() << "trying to send MarkerModifyRequest for markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send MarkerModifyRequest for markerId:" << data.id();
|
||||
if (!m_ftc->markerModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data for markerId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for markerId:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModify()
|
||||
@@ -143,10 +143,10 @@ void MrkTests::tryRemove()
|
||||
|
||||
data.id(m_markerId);
|
||||
|
||||
INFO_LOG() << "trying to send remove request for markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for markerId:" << data.id();
|
||||
if (!m_ftc->markerRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data for markerId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for markerId:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemove()
|
||||
@@ -155,22 +155,22 @@ void MrkTests::tryRemove()
|
||||
void MrkTests::tryGetAllMarkers()
|
||||
{
|
||||
m_eTestStep = eGetAllMarkers;
|
||||
DEBUG_LOG() << "trying to get all markers";
|
||||
DEBUG_LOG(m_logger) << "trying to get all markers";
|
||||
|
||||
m_dtc->waitForHistoricalDataMarker();
|
||||
const QMap<qint32, MarkerManagement::Marker> map = m_dtc->markers();
|
||||
if (map.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting all marker data";
|
||||
ERROR_LOG(m_logger) << "Error requesting all marker data";
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
return;
|
||||
}
|
||||
|
||||
INFO_LOG() << "Amout of existing markers:" << map.size();
|
||||
INFO_LOG(m_logger) << "Amout of existing markers:" << map.size();
|
||||
m_markerId = map.firstKey();
|
||||
for (auto it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
INFO_LOG() << "Mrk(" << it.key() << ") :"
|
||||
INFO_LOG(m_logger) << "Mrk(" << it.key() << ") :"
|
||||
<< " note:" << it.value().note()
|
||||
<< " operatorId:" << it.value().operatorId()
|
||||
<< " timeStamp:" << it.value().timeStamp()
|
||||
@@ -185,14 +185,14 @@ void MrkTests::tryGetAllMarkers()
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::tryGetMarker()
|
||||
{
|
||||
DEBUG_LOG() << "trying to get marker with id:" << m_markerId;
|
||||
DEBUG_LOG(m_logger) << "trying to get marker with id:" << m_markerId;
|
||||
|
||||
if (m_testId > 1)
|
||||
m_eTestStep = eGetMarker;
|
||||
|
||||
if (m_markerId <= 0)
|
||||
{
|
||||
ERROR_LOG() << "invalid markerId - test aborted.";
|
||||
ERROR_LOG(m_logger) << "invalid markerId - test aborted.";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -201,12 +201,12 @@ void MrkTests::tryGetMarker()
|
||||
|
||||
if (data.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Error receiving data for markerId " << m_markerId << " returnVal:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error receiving data for markerId " << m_markerId << " returnVal:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "Mrk(" << data.id() << ") :"
|
||||
INFO_LOG(m_logger) << "Mrk(" << data.id() << ") :"
|
||||
<< " note:" << data.note()
|
||||
<< " operatorId:" << data.operatorId()
|
||||
<< " timeStamp:" << data.timeStamp()
|
||||
@@ -220,7 +220,7 @@ void MrkTests::tryGetMarker()
|
||||
{
|
||||
if (! onCompareCreatedData(data))
|
||||
{
|
||||
ERROR_LOG() << "Compare created data failed!";
|
||||
ERROR_LOG(m_logger) << "Compare created data failed!";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -233,7 +233,7 @@ void MrkTests::tryGetMarker()
|
||||
{
|
||||
if (! onCompareModifiedData(data))
|
||||
{
|
||||
ERROR_LOG() << "Compare modified data failed!";
|
||||
ERROR_LOG(m_logger) << "Compare modified data failed!";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
@@ -263,10 +263,10 @@ void MrkTests::tryCreateSnapshot()
|
||||
data.timeStamp(QDateTime::currentMSecsSinceEpoch());
|
||||
data.planOverlay("Plan Overlay");
|
||||
|
||||
INFO_LOG() << "trying to send SnapshotCreateRequest";
|
||||
INFO_LOG(m_logger) << "trying to send SnapshotCreateRequest";
|
||||
if (!m_ftc->snapshotModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
} // end of tryCreateSnapshot()
|
||||
@@ -282,10 +282,10 @@ void MrkTests::tryModifySnapshot()
|
||||
data.description("Dies ist ein Test modify");
|
||||
data.planOverlay("Plan Overlay updated");
|
||||
|
||||
INFO_LOG() << "trying to send SnapshotModifyRequest for snapshotId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send SnapshotModifyRequest for snapshotId:" << data.id();
|
||||
if (!m_ftc->snapshotModifyRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data for snapshotId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for snapshotId:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
} // end of tryModifySnapshot()
|
||||
@@ -298,10 +298,10 @@ void MrkTests::tryRemoveSnapshot()
|
||||
|
||||
data.id(m_snapshotId);
|
||||
|
||||
INFO_LOG() << "trying to send remove request for snapshotId:" << data.id();
|
||||
INFO_LOG(m_logger) << "trying to send remove request for snapshotId:" << data.id();
|
||||
if (!m_ftc->snapshotRemoveRequest(data, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data for snapshotId:" << data.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for snapshotId:" << data.id();
|
||||
failExit();
|
||||
}
|
||||
} // end of tryRemoveSnapshot()
|
||||
@@ -310,19 +310,19 @@ void MrkTests::tryRemoveSnapshot()
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::onMarkerCreateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_markerId = replyObject.id();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
// QTimer::singleShot(0, this, &MrkTests::tryModify()));
|
||||
@@ -338,17 +338,17 @@ void MrkTests::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
if (m_eTestStep == TestStep::eCreate)
|
||||
return onMarkerCreateReply(replyObject);
|
||||
|
||||
INFO_LOG() << "Got modifyRequest with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data for id:" << replyObject.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting modify data for id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting modify data for id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
// QTimer::singleShot(0, this, &MrkTests::tryDelete()));
|
||||
@@ -361,17 +361,17 @@ void MrkTests::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::onMarkerRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data for markerId:" << replyObject.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for markerId:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting remove data for markerId:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting remove data for markerId:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
{
|
||||
@@ -386,19 +386,19 @@ void MrkTests::onMarkerRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::onSnapshotCreateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_snapshotId = replyObject.id();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
QTimer::singleShot(0, this, &MrkTests::tryModifySnapshot);
|
||||
@@ -413,17 +413,17 @@ void MrkTests::onSnapshotModifyReply(const Core::FunctionReplyObject &replyObjec
|
||||
if (m_eTestStep == TestStep::eCreate)
|
||||
return onSnapshotCreateReply(replyObject);
|
||||
|
||||
INFO_LOG() << "Got modifyRequest with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data for id:" << replyObject.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data for id:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting modify data for id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting modify data for id:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
QTimer::singleShot(0, this, &MrkTests::tryRemoveSnapshot);
|
||||
@@ -435,21 +435,21 @@ void MrkTests::onSnapshotModifyReply(const Core::FunctionReplyObject &replyObjec
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::onSnapshotRemoveReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data for markerId:" << replyObject.id();
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data for markerId:" << replyObject.id();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Requesting remove data for markerId:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting remove data for markerId:" << replyObject.id() << " ... ok.";
|
||||
|
||||
if (m_testId == 0)
|
||||
{
|
||||
INFO_LOG() << "***** FTC/TDC test successfully finished. (used snapshotId:" << replyObject.id() << ") *****";
|
||||
INFO_LOG(m_logger) << "***** FTC/TDC test successfully finished. (used snapshotId:" << replyObject.id() << ") *****";
|
||||
// ansonsten verheriger Ausstieg mit Errorlog.
|
||||
}
|
||||
|
||||
@@ -461,21 +461,21 @@ void MrkTests::onSnapshotRemoveReply(const Core::FunctionReplyObject &replyObjec
|
||||
//-----------------------------------------------------------------------------
|
||||
void MrkTests::onReceiveMarkerChanged(const Marker &data, DataModification modType)
|
||||
{
|
||||
// INFO_LOG() << "onReceiveMarkerChanged() markerId:" << data.id()
|
||||
// INFO_LOG(m_logger) << "onReceiveMarkerChanged() markerId:" << data.id()
|
||||
// << " modificationType: = " << (int)modType<< " received";
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
INFO_LOG() << "*** Marker added received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker added received. markerId:" << data.id();
|
||||
break;
|
||||
|
||||
case DataModification::eModified:
|
||||
INFO_LOG() << "*** Marker modified received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker modified received. markerId:" << data.id();
|
||||
break;
|
||||
|
||||
case DataModification::eRemoved:
|
||||
INFO_LOG() << "*** Marker removed received. markerId:" << data.id();
|
||||
INFO_LOG(m_logger) << "*** Marker removed received. markerId:" << data.id();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -534,7 +534,7 @@ void MrkTests::getMarkerModifyRequestData(MarkerModifyRequest &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
{
|
||||
DEBUG_LOG() << "start onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareCreatedData() for id :" << data.id();
|
||||
|
||||
// Vergleicht die zurueckgelesen Datan mit den statischen create Daten
|
||||
|
||||
@@ -558,7 +558,7 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
|
||||
if (createData.descriptions().size() != data.descriptions().size())
|
||||
{
|
||||
ERROR_LOG() << "Error onCompareCreatedData() different number of description data.";
|
||||
ERROR_LOG(m_logger) << "Error onCompareCreatedData() different number of description data.";
|
||||
failExit();
|
||||
return false;
|
||||
}
|
||||
@@ -575,7 +575,7 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
|
||||
if (got.content() != expected.content())
|
||||
{
|
||||
ERROR_LOG() << "Content for description does not match: "
|
||||
ERROR_LOG(m_logger) << "Content for description does not match: "
|
||||
<< got.content() << " - "
|
||||
<< expected.content();
|
||||
failExit();
|
||||
@@ -585,12 +585,12 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
}
|
||||
if (foundCount != 3)
|
||||
{
|
||||
ERROR_LOG() << "Did not found all three expected descriptions";
|
||||
ERROR_LOG(m_logger) << "Did not found all three expected descriptions";
|
||||
failExit();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareCreatedData() for id :" << data.id();
|
||||
|
||||
return true;
|
||||
} // end of onCompareCreatedData()
|
||||
@@ -598,7 +598,7 @@ bool MrkTests::onCompareCreatedData(Marker &data)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MrkTests::onCompareModifiedData(Marker &data)
|
||||
{
|
||||
DEBUG_LOG() << "start onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "start onCompareModifiedData() for id :" << data.id();
|
||||
|
||||
MarkerModifyRequest modifyData;
|
||||
|
||||
@@ -632,7 +632,7 @@ bool MrkTests::onCompareModifiedData(Marker &data)
|
||||
|
||||
if (got.content() != expected.content())
|
||||
{
|
||||
ERROR_LOG() << "Content for description does not match: "
|
||||
ERROR_LOG(m_logger) << "Content for description does not match: "
|
||||
<< got.content() << " - "
|
||||
<< expected.content();
|
||||
failExit();
|
||||
@@ -642,12 +642,12 @@ bool MrkTests::onCompareModifiedData(Marker &data)
|
||||
}
|
||||
if (foundCount != 3)
|
||||
{
|
||||
ERROR_LOG() << "Did not found all three expected descriptions";
|
||||
ERROR_LOG(m_logger) << "Did not found all three expected descriptions";
|
||||
failExit();
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "successfull finished onCompareModifiedData() for id :" << data.id();
|
||||
DEBUG_LOG(m_logger) << "successfull finished onCompareModifiedData() for id :" << data.id();
|
||||
|
||||
return true;
|
||||
} // end of onCompareModifiedData()
|
||||
|
||||
@@ -65,6 +65,7 @@ protected Q_SLOTS:
|
||||
void onReceiveMarkerChanged(const Marker &data, DataModification modType);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// Callbackfunctions for FTC
|
||||
void onMarkerCreateReply(const Core::FunctionReplyObject &replyObject);
|
||||
void onMarkerModifyReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
@@ -14,16 +14,16 @@ namespace MarkerManagement
|
||||
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)
|
||||
{
|
||||
INFO_LOG() << "--- Start MarkerManagement DDSHandler.";
|
||||
INFO_LOG(m_logger) << "--- Start MarkerManagement DDSHandler.";
|
||||
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsFts = MarkerManagement::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;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
std::shared_ptr<MarkerManagement::Interface::Fts> fts() const { return m_ddsFts; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
std::shared_ptr<MarkerManagement::Interface::Dts> m_ddsDts;
|
||||
|
||||
@@ -32,14 +32,14 @@ HandlerMarker::~HandlerMarker()
|
||||
|
||||
bool HandlerMarker::init()
|
||||
{
|
||||
INFO_LOG() << "--- Start MarkerManagement HandlerMarker.";
|
||||
INFO_LOG(m_logger) << "--- Start MarkerManagement HandlerMarker.";
|
||||
|
||||
QVector<Database::MrkMarkerDescription> dataDescriptionVec;
|
||||
|
||||
// read all marker from database
|
||||
if (!m_db->select(dataDescriptionVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ bool HandlerMarker::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -71,15 +71,15 @@ bool HandlerMarker::init()
|
||||
};
|
||||
if (!m_db->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectMarkerMap.size() = " << m_objectMarkerMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectMarkerMap.size() = " << m_objectMarkerMap.size();
|
||||
|
||||
if (m_ddsHandler->fts() == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "m_ddsHandler->fts() == nullptr!";
|
||||
ERROR_LOG(m_logger) << "m_ddsHandler->fts() == nullptr!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -90,10 +90,10 @@ bool HandlerMarker::init()
|
||||
void HandlerMarker::onMarkerModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Marker &request)
|
||||
{
|
||||
DEBUG_LOG() << "MarkerModifyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "MarkerModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? markerModifyRequest(request) : markerCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->markerModifyReply(cookie, ret);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -132,10 +132,10 @@ Core::FunctionReplyObject HandlerMarker::markerModifyRequest(const Marker &reque
|
||||
void HandlerMarker::onMarkerRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "MarkerRemoveRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "MarkerRemoveRequest: " << request;
|
||||
auto ret = markerRemoveRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->markerRemoveReply(cookie, ret);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
bool init();
|
||||
|
||||
private: // methods
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onMarkerModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Marker &request) override final;
|
||||
Core::FunctionReplyObject markerCreateRequest(const Marker &request);
|
||||
|
||||
@@ -31,7 +31,7 @@ HandlerSnapshot::~HandlerSnapshot()
|
||||
|
||||
bool HandlerSnapshot::init()
|
||||
{
|
||||
INFO_LOG() << "--- Start MarkerManagement HandlerSnapshot.";
|
||||
INFO_LOG(m_logger) << "--- Start MarkerManagement HandlerSnapshot.";
|
||||
|
||||
bool bRet = true;
|
||||
// create markerObjects
|
||||
@@ -44,7 +44,7 @@ bool HandlerSnapshot::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -52,11 +52,11 @@ bool HandlerSnapshot::init()
|
||||
};
|
||||
if (!m_db->select(cb) || !bRet)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectSnapshotMap.size() = " << m_objectSnapshotMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectSnapshotMap.size() = " << m_objectSnapshotMap.size();
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
@@ -65,10 +65,10 @@ bool HandlerSnapshot::init()
|
||||
void HandlerSnapshot::onSnapshotModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Snapshot &request)
|
||||
{
|
||||
DEBUG_LOG() << "SnapshotModifyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "SnapshotModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? snapshotModifyRequest(request) : snapshotCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_ddsHandler->fts()->snapshotModifyReply(cookie, ret);
|
||||
|
||||
} // end of onSnapshotModifyRequest()
|
||||
@@ -118,7 +118,7 @@ Core::FunctionReplyObject HandlerSnapshot::snapshotModifyRequest(const Snapshot
|
||||
void HandlerSnapshot::onSnapshotRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSnapshotRemoveRequest() id:" << request.id();
|
||||
DEBUG_LOG(m_logger) << "onSnapshotRemoveRequest() id:" << request.id();
|
||||
|
||||
Core::FunctionReplyObject ret;
|
||||
ObjectSnapshot *ifs = m_objectSnapshotMap.value(request.id());
|
||||
@@ -136,7 +136,7 @@ void HandlerSnapshot::onSnapshotRemoveRequest(const rti::core::SampleIdentity &c
|
||||
}
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectSnapshot
|
||||
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
bool init();
|
||||
|
||||
private: // methods
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSnapshotModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Snapshot &request) override final;
|
||||
Core::FunctionReplyObject snapshotCreateRequest(const Snapshot &request);
|
||||
|
||||
@@ -36,14 +36,14 @@ Initialization::~Initialization()
|
||||
|
||||
bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector, const QSqlDatabase &sqlDb)
|
||||
{
|
||||
INFO_LOG() << "--- Start MarkerManagement Initialization.";
|
||||
INFO_LOG(m_logger) << "--- Start MarkerManagement Initialization.";
|
||||
|
||||
// initialize DDS
|
||||
// for MarkerManagement => exerciseId = partitionId
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(ddsConnector);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
if (!m_dbHandler->init(ddsConnector->getPartitionId(), sqlDb))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
m_handlerMarker.reset(new HandlerMarker(m_ddsHandler, m_dbHandler->db()));
|
||||
m_handlerSnapshot.reset(new HandlerSnapshot(m_ddsHandler, m_dbHandler->db()));
|
||||
|
||||
INFO_LOG() << "MRK Handler initialized.";
|
||||
INFO_LOG(m_logger) << "MRK Handler initialized.";
|
||||
|
||||
return true;
|
||||
} // end of initialize()
|
||||
@@ -72,16 +72,16 @@ bool Initialization::loadFromDatabase()
|
||||
{
|
||||
if (!m_handlerMarker || !m_handlerMarker->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerMarker failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerMarker failed.";
|
||||
return false;
|
||||
}
|
||||
if (!m_handlerSnapshot || !m_handlerSnapshot->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerSnapshot failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerSnapshot failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "MRK Handler initialized.";
|
||||
INFO_LOG(m_logger) << "MRK Handler initialized.";
|
||||
return true;
|
||||
} // end of loadFromDatabase()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
bool loadFromDatabase();
|
||||
|
||||
private: // attributes
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::unique_ptr<HandlerMarker> m_handlerMarker;
|
||||
|
||||
@@ -39,9 +39,9 @@ Core::FunctionReplyObject ObjectMarker::createObject(const Marker &data)
|
||||
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataMarkerObject.id(dbDataMarker.id);
|
||||
DEBUG_LOG() << "New MarkerId: " << dbDataMarker.id;
|
||||
DEBUG_LOG(m_logger) << "New MarkerId: " << dbDataMarker.id;
|
||||
|
||||
DEBUG_LOG() << "Handle MarkerDescription for markerId:" << dbDataMarker.id << " number of depending descriptions: " << data.descriptions().size();
|
||||
DEBUG_LOG(m_logger) << "Handle MarkerDescription for markerId:" << dbDataMarker.id << " number of depending descriptions: " << data.descriptions().size();
|
||||
|
||||
// Behandlung von MarkerDescription
|
||||
for (size_t i = 0; i < data.descriptions().size(); ++i)
|
||||
@@ -81,10 +81,10 @@ Core::FunctionReplyObject ObjectMarker::updateObject(const Marker &data)
|
||||
if (!m_db->update(dbDataMarker))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating MrkMarker-data into database"));
|
||||
|
||||
DEBUG_LOG() << "Data changed for markerId: " << m_dataMarkerObject.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for markerId: " << m_dataMarkerObject.id();
|
||||
|
||||
|
||||
INFO_LOG() << "Handle MarkerDescriptions for markerId:" << data.id()
|
||||
INFO_LOG(m_logger) << "Handle MarkerDescriptions for markerId:" << data.id()
|
||||
<< ". Number of pending descriptions (new/previous):"
|
||||
<< data.descriptions().size() << "/" << m_dataMarkerObject.descriptions().size();
|
||||
|
||||
@@ -122,7 +122,7 @@ Core::FunctionReplyObject ObjectMarker::updateObject(const Marker &data)
|
||||
}
|
||||
if (!bFound)
|
||||
{
|
||||
DEBUG_LOG() << "Description with id " << oldDesc.id() << " was removed - removing from db";
|
||||
DEBUG_LOG(m_logger) << "Description with id " << oldDesc.id() << " was removed - removing from db";
|
||||
if (!m_db->removeMrkMarkerDescription(oldDesc.id()))
|
||||
return Core::FunctionReplyObject(data.id(),
|
||||
tr_lts("dds", "MarkerDescription with id %1 can not be removed"))
|
||||
@@ -184,10 +184,10 @@ bool ObjectMarker::isUsed() const
|
||||
|
||||
void ObjectMarker::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish MrkMarker-data to dds markerId:" << m_dataMarkerObject.id() ;
|
||||
INFO_LOG(m_logger) << "Publish MrkMarker-data to dds markerId:" << m_dataMarkerObject.id() ;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataMarkerObject))
|
||||
WARNING_LOG() << "Error publishing MrkMarker-data to dds";
|
||||
WARNING_LOG(m_logger) << "Error publishing MrkMarker-data to dds";
|
||||
|
||||
} // end of onPublishData()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -48,9 +48,11 @@ public:
|
||||
static MarkerDescription toDdsData(const Database::MrkMarkerDescription &dbData); // db -> dds
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
Marker m_dataMarkerObject;
|
||||
|
||||
@@ -37,7 +37,7 @@ Core::FunctionReplyObject ObjectSnapshot::createObject(const MarkerManagement::S
|
||||
}
|
||||
// Neue DB Id in lokale Struktur uebernehmen
|
||||
m_dataSnapshot.id(dbDataSnapshot.id);
|
||||
DEBUG_LOG() << "New SnapshotrId: " << dbDataSnapshot.id;
|
||||
DEBUG_LOG(m_logger) << "New SnapshotrId: " << dbDataSnapshot.id;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -58,7 +58,7 @@ Core::FunctionReplyObject ObjectSnapshot::updateObject(const Snapshot &data)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating MrkSnapshot-data into database"));
|
||||
|
||||
m_dataSnapshot = data;
|
||||
DEBUG_LOG() << "Data changed for snapshotId: " << m_dataSnapshot.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for snapshotId: " << m_dataSnapshot.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -88,10 +88,10 @@ bool ObjectSnapshot::isValid() const
|
||||
|
||||
void ObjectSnapshot::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish MrkSnapshot -data to dds snapshotId:" << m_dataSnapshot.id() ;
|
||||
INFO_LOG(m_logger) << "Publish MrkSnapshot -data to dds snapshotId:" << m_dataSnapshot.id() ;
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(m_dataSnapshot))
|
||||
ERROR_LOG() << "Error publishing MrkMarker-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing MrkMarker-data to dds";
|
||||
|
||||
} // end of onPublishData()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -41,10 +41,12 @@ public:
|
||||
static Snapshot toDdsData(const Database::MrkSnapshot &dbData); // db -> dds
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_db;
|
||||
MarkerManagement::Snapshot m_dataSnapshot;
|
||||
|
||||
Reference in new issue
Block a user