Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+16
-17
@@ -13,20 +13,19 @@
|
||||
//------------------------------------------------------------------------------
|
||||
namespace TargetManagement
|
||||
{
|
||||
ObjectShootbackTarget::ObjectShootbackTarget(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
ObjectShootbackTarget::ObjectShootbackTarget(MainHandler *mainHandler) : m_mainHandler(mainHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
ObjectShootbackTarget::~ObjectShootbackTarget()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
if (isValid())
|
||||
m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id());
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -44,7 +43,7 @@ bool ObjectShootbackTarget::isUsed() const
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackTarget::createObject(const ShootbackTarget &data)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_data = data;
|
||||
|
||||
if (m_data.id() <= 0)
|
||||
@@ -57,20 +56,20 @@ Core::FunctionReplyObject ObjectShootbackTarget::createObject(const ShootbackTar
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting ShootbackTarget-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New TgtShootbackTarget: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New TgtShootbackTarget: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackTarget::updateObject(const ShootbackTarget &data)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START, id=" << data.id()
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id=" << data.id()
|
||||
<< " size =" << data.visibleParticipants().size();
|
||||
if (!isValid())
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Object not valid/blocked"));
|
||||
@@ -85,12 +84,12 @@ Core::FunctionReplyObject ObjectShootbackTarget::updateObject(const ShootbackTar
|
||||
}
|
||||
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "Data changed for ShootbackTargetId: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for ShootbackTargetId: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END, id=" << data.id()
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, id=" << data.id()
|
||||
<< " size =" << data.visibleParticipants().size();
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
}
|
||||
@@ -112,7 +111,7 @@ Core::FunctionReplyObject ObjectShootbackTarget::setUsed(bool isUsed)
|
||||
//------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject ObjectShootbackTarget::removeObject()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
if (isUsed())
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackTarget still in use"));
|
||||
|
||||
@@ -122,7 +121,7 @@ Core::FunctionReplyObject ObjectShootbackTarget::removeObject()
|
||||
if (!m_mainHandler->dds()->dtsTgt()->removeShootbackTargetByKey(m_data.id()))
|
||||
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "ShootbackTarget with id %1 can not be removed from DDS")).arg(m_data.id());
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
}
|
||||
|
||||
@@ -145,10 +144,10 @@ void ObjectShootbackTarget::updateVolatileData(const Core::GeoPosition &position
|
||||
//------------------------------------------------------------------------------
|
||||
void ObjectShootbackTarget::onPublishData()
|
||||
{
|
||||
TRACE_LOG() << "Publish ShootbackTarget-data to dds (" << m_data.id() << ") ...";
|
||||
TRACE_LOG(m_logger) << "Publish ShootbackTarget-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_mainHandler->dds()->dtsTgt()->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing ShootbackTarget-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing ShootbackTarget-data to dds";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user