Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+16
-16
@@ -43,7 +43,7 @@ AsmTests::~AsmTests()
|
||||
// ------------------------------------------------------------------
|
||||
bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_trainingAreaId = trainingAreaId; // overwritten when new exercise created
|
||||
@@ -56,15 +56,15 @@ bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
}
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc";
|
||||
DEBUG_LOG(m_logger) << "create ftc";
|
||||
m_ftc = AssetManagement::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;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Training Area Id = " << trainingAreaId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Training Area Id = " << trainingAreaId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
|
||||
if (!bRet)
|
||||
failExit();
|
||||
@@ -74,7 +74,7 @@ bool AsmTests::init(int domainId, int trainingAreaId, int testId)
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
if (m_testId == 1)
|
||||
QTimer::singleShot(0, this, &AsmTests::tryCreate);
|
||||
else if (m_testId == 2)
|
||||
@@ -181,7 +181,7 @@ void AsmTests::setRequestData(AssetManagement::TrainingAreaModifyRequest &reques
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::tryCreate()
|
||||
{
|
||||
INFO_LOG() << "trying to send ModifyRequest TrainingArea (create)";
|
||||
INFO_LOG(m_logger) << "trying to send ModifyRequest TrainingArea (create)";
|
||||
|
||||
AssetManagement::TrainingAreaModifyRequest request;
|
||||
|
||||
@@ -189,7 +189,7 @@ void AsmTests::tryCreate()
|
||||
|
||||
if (!m_ftc->trainingAreaModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -201,13 +201,13 @@ void AsmTests::tryCreate()
|
||||
void AsmTests::tryModify()
|
||||
{
|
||||
AssetManagement::TrainingAreaModifyRequest request;
|
||||
INFO_LOG() << "trying to send modify request for training Area Id = " << m_trainingAreaId;
|
||||
INFO_LOG(m_logger) << "trying to send modify request for training Area Id = " << m_trainingAreaId;
|
||||
|
||||
setRequestData(request, m_trainingAreaId);
|
||||
|
||||
if (!m_ftc->trainingAreaModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -218,10 +218,10 @@ void AsmTests::tryModify()
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::tryDelete()
|
||||
{
|
||||
INFO_LOG() << "trying to send delete request for exercise Id = " << m_trainingAreaId;
|
||||
INFO_LOG(m_logger) << "trying to send delete request for exercise Id = " << m_trainingAreaId;
|
||||
if (!m_ftc->trainingAreaRemoveRequest(TrainingAreaRemoveRequest(m_trainingAreaId), this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void AsmTests::tryDelete()
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got modifyReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
@@ -246,7 +246,7 @@ void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyO
|
||||
// ------------------------------------------------------------------
|
||||
void AsmTests::onTrainingAreaRemoveReply(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())
|
||||
|
||||
+2
-3
@@ -51,9 +51,8 @@ ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandle
|
||||
// ####### ClientMessage end #######
|
||||
|
||||
// ####### BaseDlRequest begin #######
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid)
|
||||
: ClientMessage(dataManager, client, type, typeId, uuid)
|
||||
{}
|
||||
BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid) : ClientMessage(dataManager, client, type, typeId, uuid),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
void BaseDlRequest::process()
|
||||
{
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ bool WebSocketInterfaceHandler::init()
|
||||
{
|
||||
cleanup();
|
||||
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
m_dataManager = new DataManager(m_mainHandler);
|
||||
|
||||
@@ -44,16 +44,16 @@ bool WebSocketInterfaceHandler::init()
|
||||
|
||||
m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this);
|
||||
|
||||
DEBUG_LOG() << "Initialising LtsWebSocketServer";
|
||||
DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer";
|
||||
if (!m_webSocketServer->init(QStringLiteral("ASM"), Settings::getWebSocketServerPortRange(1)))
|
||||
{
|
||||
ERROR_LOG() << "Failed to initialise LtsWebSocketServer";
|
||||
ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
DEBUG_LOG() << "Connection signals and slots";
|
||||
DEBUG_LOG() << "... ok";
|
||||
DEBUG_LOG(m_logger) << "Connection signals and slots";
|
||||
DEBUG_LOG(m_logger) << "... ok";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace AssetManagement
|
||||
DdsHandler::DdsHandler(int domainId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Any))
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") 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;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
m_ddsDts = AssetManagement::Interface::Dts::create(m_ddsConnector);
|
||||
m_ddsFts = AssetManagement::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;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
std::shared_ptr<AssetManagement::Interface::Fts> fts() const { return m_ddsFts; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
|
||||
@@ -39,7 +39,7 @@ bool HandlerAsset::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -47,11 +47,11 @@ bool HandlerAsset::init()
|
||||
};
|
||||
if (!m_mainHandler->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_objectAssetMap.size() = " << m_objectAssetMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectAssetMap.size() = " << m_objectAssetMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void HandlerAsset::onAssetModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
{
|
||||
const auto ret = assetModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->assetModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerAsset::onAssetRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectAsset
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onAssetModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Asset &request) override;
|
||||
Core::FunctionReplyObject assetModifyRequest(const Asset &request);
|
||||
@@ -37,6 +38,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, ObjectAsset *> m_objectAssetMap;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
|
||||
@@ -45,11 +45,11 @@ bool HandlerLocation::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() << "#Locations published: " << iCnt;
|
||||
DEBUG_LOG(m_logger) << "#Locations published: " << iCnt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
|
||||
bool init();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
}
|
||||
@@ -39,7 +39,7 @@ bool HandlerRelayInfo::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
bRet = false;
|
||||
return;
|
||||
}
|
||||
@@ -47,11 +47,11 @@ bool HandlerRelayInfo::init()
|
||||
};
|
||||
if (!m_mainHandler->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_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void HandlerRelayInfo::onRelayInfoModifyRequest(const rti::core::SampleIdentity
|
||||
{
|
||||
const auto ret = relayInfoModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->relayInfoModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerRelayInfo::onRelayInfoRemoveRequest(const rti::core::SampleIdentity
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectRelayInfo
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onRelayInfoModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const RelayInfo &request) override;
|
||||
Core::FunctionReplyObject relayInfoModifyRequest(const RelayInfo &request);
|
||||
@@ -37,6 +38,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QHash<int, ObjectRelayInfo*> m_objectRelayInfoMap;
|
||||
MainHandler *m_mainHandler;
|
||||
};
|
||||
|
||||
+22
-22
@@ -42,7 +42,7 @@ bool HandlerTrainingArea::init()
|
||||
QVector<Database::AsmMapDescription> dataVecMD;
|
||||
if (!m_mainHandler->db()->select(dataVecMD))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,38 +58,38 @@ bool HandlerTrainingArea::init()
|
||||
{
|
||||
case AssetManagement::MapDescriptionType_def::Map2D:
|
||||
mapDescriptionSeq.map2D.insert(data.objOrder, data);
|
||||
INFO_LOG() << "map2D.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "map2D.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::Scene3D:
|
||||
mapDescriptionSeq.scene3D.insert(data.objOrder, data);
|
||||
INFO_LOG() << "Scene3D.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "Scene3D.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::Elevation:
|
||||
mapDescriptionSeq.elevation.insert(data.objOrder, data);
|
||||
INFO_LOG() << "Elevation.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "Elevation.insert order =" << data.objOrder;
|
||||
break;
|
||||
case AssetManagement::MapDescriptionType_def::SceneObj:
|
||||
mapDescriptionSeq.sceneObj.insert(data.objOrder, data);
|
||||
INFO_LOG() << "sceneObj.insert order =" << data.objOrder;
|
||||
INFO_LOG(m_logger) << "sceneObj.insert order =" << data.objOrder;
|
||||
break;
|
||||
}
|
||||
mapDescriptionSeqences.insert(data.trainingAreaId, mapDescriptionSeq);
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_objectMapDescriptionMap.insert(ifs->getId(), ifs);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size();
|
||||
|
||||
QVector<Database::AsmTrainingArea> dataVec;
|
||||
// read all training areas from database
|
||||
if (!m_mainHandler->db()->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -125,13 +125,13 @@ bool HandlerTrainingArea::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_objectTrainingAreaMap.insert(ifs->getId(), ifs);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -139,16 +139,16 @@ bool HandlerTrainingArea::init()
|
||||
//----------------------------------------------------------------------------------------------
|
||||
void HandlerTrainingArea::removeMapDescriptions(int trainingAreaId)
|
||||
{
|
||||
INFO_LOG() << "removeMapDescriptions trainingAreaId = " << trainingAreaId
|
||||
INFO_LOG(m_logger) << "removeMapDescriptions trainingAreaId = " << trainingAreaId
|
||||
<< " m_objectMapDescriptionMap.size = " << m_objectMapDescriptionMap.size();
|
||||
QMapIterator< int, ObjectMapDescription *> it(m_objectMapDescriptionMap);
|
||||
while ( it.hasNext())
|
||||
{
|
||||
it.next();
|
||||
INFO_LOG() << "remove map description key = " << it.key();
|
||||
INFO_LOG(m_logger) << "remove map description key = " << it.key();
|
||||
if ( it.value()->getData().trainingAreaId() == trainingAreaId)
|
||||
{
|
||||
DEBUG_LOG() << "remove id= " << it.key();
|
||||
DEBUG_LOG(m_logger) << "remove id= " << it.key();
|
||||
|
||||
ObjectMapDescription *ifs = m_objectMapDescriptionMap.value(it.key());
|
||||
|
||||
@@ -165,7 +165,7 @@ void HandlerTrainingArea::onTrainingAreaModifyRequest(const rti::core::SampleIde
|
||||
{
|
||||
const auto ret = trainingAreaModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->trainingAreaModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
}
|
||||
if (request.id() > 0) // Modify
|
||||
{
|
||||
DEBUG_LOG() << "modify: delete old entries in map_description";
|
||||
DEBUG_LOG(m_logger) << "modify: delete old entries in map_description";
|
||||
removeMapDescriptions(ifs->getId());
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert topographic entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert topographic entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -240,7 +240,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert elevation entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert elevation entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -265,7 +265,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert scene3D entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert scene3D entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -290,7 +290,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T
|
||||
mdData.id(0);
|
||||
mdData.trainingAreaId(ifs->getId());
|
||||
ret = md->createObject(mdData, i);
|
||||
DEBUG_LOG() << "insert sceneObjects entries in map_description"
|
||||
DEBUG_LOG(m_logger) << "insert sceneObjects entries in map_description"
|
||||
<< " for training area id " << ifs->getId()
|
||||
<< " mapTypeId=" << mdData.mapTypeId()
|
||||
<< " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId();
|
||||
@@ -335,7 +335,7 @@ void HandlerTrainingArea::onTrainingAreaRemoveRequest(const rti::core::SampleIde
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectTrainingArea
|
||||
@@ -356,7 +356,7 @@ void HandlerTrainingArea::onMapDescriptionModifyRequest(const rti::core::SampleI
|
||||
{
|
||||
const auto ret = mapDescriptionModifyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->dds()->fts()->mapDescriptionModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ void HandlerTrainingArea::onMapDescriptionRemoveRequest(const rti::core::SampleI
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectMapDescription
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
bool init();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onTrainingAreaModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const TrainingArea &request) override;
|
||||
Core::FunctionReplyObject trainingAreaModifyRequest(const TrainingArea &request);
|
||||
@@ -58,6 +59,7 @@ private:
|
||||
const Core::RemoveElementRequest &request) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QMap<int, ObjectTrainingArea *> m_objectTrainingAreaMap;
|
||||
QMap<int, ObjectMapDescription *> m_objectMapDescriptionMap;
|
||||
MainHandler *m_mainHandler;
|
||||
|
||||
+2
@@ -34,6 +34,8 @@ public:
|
||||
void onWorkstationLogoutRequest(const rti::core::SampleIdentity &cookie, const WorkstationLogout &request) override final;
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
QMap<int, QTimer*> m_logoutRequestMap;
|
||||
};
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
namespace AssetManagement
|
||||
{
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_handlerTrainingArea(nullptr)
|
||||
, m_handlerWorkstationLogout(nullptr)
|
||||
, m_handlerAsset(nullptr)
|
||||
@@ -30,8 +29,8 @@ MainHandler::MainHandler(QObject *parent)
|
||||
, m_handlerRelayInfo(nullptr)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_dbHandler(nullptr)
|
||||
, m_handlerWebSocket(nullptr)
|
||||
{}
|
||||
, m_handlerWebSocket(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
@@ -52,29 +51,29 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
if (!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation dbHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId);
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation ddsHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful.";
|
||||
|
||||
// read project specific data from database
|
||||
// publish project specific data
|
||||
// initialize all handlers
|
||||
if (!initAsmHandler())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation AsmHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation AsmHandler failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation AsmHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation AsmHandler succesful.";
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
@@ -83,73 +82,73 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
bool MainHandler::initAsmHandler()
|
||||
{
|
||||
DEBUG_LOG() << "Start Initialisation AsmHandler";
|
||||
DEBUG_LOG(m_logger) << "Start Initialisation AsmHandler";
|
||||
|
||||
// TrainingArea
|
||||
m_handlerTrainingArea = std::make_shared<HandlerTrainingArea>(this);
|
||||
DEBUG_LOG() << "Reset HandlerTrainingArea succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerTrainingArea succesful.";
|
||||
|
||||
if (!m_handlerTrainingArea->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerTrainingArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerTrainingArea failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerTrainingArea succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerTrainingArea succesful.";
|
||||
|
||||
// WorkstationLogout
|
||||
m_handlerWorkstationLogout = std::make_shared<HandlerWorkstationLogout>(this);
|
||||
DEBUG_LOG() << "Reset HandlerWorkstationLogout succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerWorkstationLogout succesful.";
|
||||
|
||||
if (!m_handlerWorkstationLogout->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerWorkstationLogout failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerWorkstationLogout failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerWorkstationLogout succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerWorkstationLogout succesful.";
|
||||
|
||||
// Asset
|
||||
m_handlerAsset = std::make_shared<HandlerAsset>(this);
|
||||
DEBUG_LOG() << "Reset HandlerAsset succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerAsset succesful.";
|
||||
|
||||
if (!m_handlerAsset->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerAsset failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerAsset failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerAsset succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerAsset succesful.";
|
||||
|
||||
// Location
|
||||
m_handlerLocation = std::make_shared<HandlerLocation>(this);
|
||||
DEBUG_LOG() << "Reset HandlerLocation succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerLocation succesful.";
|
||||
|
||||
if (!m_handlerLocation->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerLocation failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerLocation failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerLocation succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerLocation succesful.";
|
||||
|
||||
// RelayInfo
|
||||
m_handlerRelayInfo = std::make_shared<HandlerRelayInfo>(this);
|
||||
DEBUG_LOG() << "Reset HandlerRelayInfo succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset HandlerRelayInfo succesful.";
|
||||
|
||||
if (!m_handlerRelayInfo->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation of HandlerRelayInfo failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation of HandlerRelayInfo failed.";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Initialisation HandlerRelayInfo succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation HandlerRelayInfo succesful.";
|
||||
|
||||
// WebSocketServer
|
||||
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
||||
DEBUG_LOG() << "Reset WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler succesful.";
|
||||
if (!m_handlerWebSocket->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer);
|
||||
DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler succesful.";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,10 @@ public:
|
||||
int exerciseId() const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool initAsmHandler();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
// std::shared_ptr<HandlerMapDescription> m_handlerMapDesc;
|
||||
std::shared_ptr<HandlerTrainingArea> m_handlerTrainingArea;
|
||||
std::shared_ptr<HandlerWorkstationLogout> m_handlerWorkstationLogout;
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectAsset::ObjectAsset(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectAsset::ObjectAsset(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectAsset::createObject(const Asset &data)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmAsset-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New assetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New assetId: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectAsset::updateObject(const Asset &data)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmAsset-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for assetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for assetId: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectAsset::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectAsset::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmAsset-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmAsset-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmAsset-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmAsset-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
static Asset toDdsData(const Database::AsmAsset &dbData); // db -> dds
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
+5
-6
@@ -12,10 +12,9 @@
|
||||
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_order(-1)
|
||||
{
|
||||
ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler) : m_mainHandler(mainHandler)
|
||||
, m_order(-1),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
bool ObjectMapDescription::isValid() const
|
||||
@@ -38,7 +37,7 @@ Core::FunctionReplyObject ObjectMapDescription::createObject(const MapDescriptio
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmMapDescription-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New MapDescription Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New MapDescription Id: " << m_data.id();
|
||||
}
|
||||
else if (order != m_order && m_order >= 0)
|
||||
{
|
||||
@@ -64,7 +63,7 @@ Core::FunctionReplyObject ObjectMapDescription::updateObject(const MapDescriptio
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmMapDescription-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for MapDescription Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for MapDescription Id: " << m_data.id();
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
static MapDescription toDdsData(const Database::AsmMapDescription &dbData); // db -> dds
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
MapDescription m_data;
|
||||
int m_order;
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectRelayInfo::createObject(const RelayInfo &data)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmEgcuRelayInfo-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New relayInfo Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New relayInfo Id: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectRelayInfo::updateObject(const RelayInfo &data)
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmEgcuRelayInfo-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for relayInfo Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for relayInfo Id: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectRelayInfo::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectRelayInfo::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmEgcuRelayInfo-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmEgcuRelayInfo-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
static RelayInfo toDdsData(const Database::AsmEgcuRelayInfo &dbData); // db -> dds
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
+6
-7
@@ -14,9 +14,8 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace AssetManagement
|
||||
{
|
||||
ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -53,7 +52,7 @@ Core::FunctionReplyObject ObjectTrainingArea::createObject(const TrainingArea &d
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmTrainingArea-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New mapId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New mapId: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -75,7 +74,7 @@ Core::FunctionReplyObject ObjectTrainingArea::updateObject(const TrainingArea &d
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmTrainingArea-data into database"));
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for mapId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for mapId: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -115,10 +114,10 @@ Core::FunctionReplyObject ObjectTrainingArea::removeObject()
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectTrainingArea::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dts()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AsmTrainingArea-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AsmTrainingArea-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
static Database::AsmTrainingArea toDbData(const TrainingArea &ddsData); // dds -> db
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
private:
|
||||
|
||||
Reference in new issue
Block a user