Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+16
-17
@@ -19,12 +19,11 @@
|
||||
//---------------------------------------------------------------------------------
|
||||
namespace SituationReplay
|
||||
{
|
||||
SrpDtTests::SrpDtTests(QObject *parent)
|
||||
: QObject(parent)
|
||||
SrpDtTests::SrpDtTests(QObject *parent) : QObject(parent)
|
||||
, m_replayPartitionId(0)
|
||||
, m_situationReplayId(0)
|
||||
, m_bTestsSuccessful(true)
|
||||
{
|
||||
, m_bTestsSuccessful(true),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
|
||||
}
|
||||
|
||||
@@ -35,7 +34,7 @@ SrpDtTests::~SrpDtTests()
|
||||
//---------------------------------------------------------------------------------
|
||||
bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
{
|
||||
DEBUG_LOG() << "init begin";
|
||||
DEBUG_LOG(m_logger) << "init begin";
|
||||
m_replayPartitionId = replayPartitionId;
|
||||
|
||||
// initialize DDS
|
||||
@@ -51,11 +50,11 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
// DdsInterface Publisher
|
||||
//m_ddsConnector->setPublisher(new Publisher(domainId, m_ddsConnector->getPartition(), m_ddsConnector->getDomainParticipant()));
|
||||
|
||||
DEBUG_LOG() << "Create dtc";
|
||||
DEBUG_LOG(m_logger) << "Create dtc";
|
||||
m_dtc = SituationReplay::Interface::Dtc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "Init dtc";
|
||||
DEBUG_LOG(m_logger) << "Init dtc";
|
||||
bool bRet = m_dtc->enableAll();
|
||||
DEBUG_LOG() << "init end - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
|
||||
|
||||
connect(m_dtc.get(), &SituationReplay::Interface::Dtc::sitReplayChanged,
|
||||
this, &SrpDtTests::onReceiveSituationReplayData);
|
||||
@@ -66,26 +65,26 @@ bool SrpDtTests::init(int domainId, int replayPartitionId)
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
QTimer::singleShot(1000, this, &SrpDtTests::tryGetAllSituationReplays);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetAllSituationReplays()
|
||||
{
|
||||
INFO_LOG() << "trying to get all situationReplays";
|
||||
INFO_LOG(m_logger) << "trying to get all situationReplays";
|
||||
const QMap<qint32, SituationReplay::SitReplay> map = m_dtc->sitReplays();
|
||||
if (map.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting all situation replay data";
|
||||
ERROR_LOG(m_logger) << "Error requesting all situation replay data";
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "Amout of existing situation replays = " << map.size();
|
||||
INFO_LOG(m_logger) << "Amout of existing situation replays = " << map.size();
|
||||
m_situationReplayId = map.firstKey();
|
||||
for(auto it = map.begin(); it != map.end(); ++it)
|
||||
INFO_LOG() << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
INFO_LOG(m_logger) << "situationReplay(" << it.key() << ") : " << it.value().replayPartitionId() ;
|
||||
}
|
||||
|
||||
QTimer::singleShot(10, this, &SrpDtTests::tryGetSituationReplay);
|
||||
@@ -94,17 +93,17 @@ void SrpDtTests::tryGetAllSituationReplays()
|
||||
//---------------------------------------------------------------------------------
|
||||
void SrpDtTests::tryGetSituationReplay()
|
||||
{
|
||||
INFO_LOG() << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
INFO_LOG(m_logger) << "trying get itemData for situationReplay " << m_situationReplayId;
|
||||
SituationReplay::SitReplay data = m_dtc->sitReplay(m_situationReplayId);
|
||||
|
||||
if (data.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
ERROR_LOG(m_logger) << "Error receiving data for situation replay " << m_situationReplayId;
|
||||
failExit();
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
INFO_LOG(m_logger) << "## SitReplay(" << data.id() << "), replayPartition: " << data.replayPartitionId()
|
||||
<< ", on exercise " << data.exerciseId();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -114,7 +113,7 @@ void SrpDtTests::tryGetSituationReplay()
|
||||
void SrpDtTests::onReceiveSituationReplayData(const SituationReplay::SitReplay &data)
|
||||
{
|
||||
if (m_situationReplayId == data.id())
|
||||
INFO_LOG() << "##################### Data for id = " << data.id() << " received";
|
||||
INFO_LOG(m_logger) << "##################### Data for id = " << data.id() << " received";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user