Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+20
-20
@@ -36,7 +36,7 @@ AvmFtTests::~AvmFtTests()
|
||||
// ------------------------------------------------------------------------------
|
||||
bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_menuStructId = menuId;
|
||||
@@ -47,14 +47,14 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc AVM";
|
||||
DEBUG_LOG(m_logger) << "create ftc AVM";
|
||||
m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc AVM";
|
||||
DEBUG_LOG(m_logger) << "init ftc AVM";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end AVM - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end AVM - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId)
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
if (m_testId <= 1)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryCreate);
|
||||
else if (m_testId == 2)
|
||||
@@ -74,7 +74,7 @@ void AvmFtTests::startTest()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryCreate()
|
||||
{
|
||||
INFO_LOG() << "trying to send createMenuStructRequest";
|
||||
INFO_LOG(m_logger) << "trying to send createMenuStructRequest";
|
||||
|
||||
m_menuStructId = -2;
|
||||
ModifyMenuStructRequest request;
|
||||
@@ -101,7 +101,7 @@ void AvmFtTests::tryCreate()
|
||||
|
||||
if (!m_ftc->modifyMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ void AvmFtTests::tryCreate()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryModify()
|
||||
{
|
||||
INFO_LOG() << "trying to send modify request for menuStructId = " << m_menuStructId;
|
||||
INFO_LOG(m_logger) << "trying to send modify request for menuStructId = " << m_menuStructId;
|
||||
ModifyMenuStructRequest request;
|
||||
request.id(m_menuStructId);
|
||||
request.name("TestGlobalMenuModify");
|
||||
@@ -134,7 +134,7 @@ void AvmFtTests::tryModify()
|
||||
|
||||
if (!m_ftc->modifyMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -142,13 +142,13 @@ void AvmFtTests::tryModify()
|
||||
// ------------------------------------------------------------------------------
|
||||
void AvmFtTests::tryDelete()
|
||||
{
|
||||
INFO_LOG() << "trying to send delete request for menuStructId = " << m_menuStructId;
|
||||
INFO_LOG(m_logger) << "trying to send delete request for menuStructId = " << m_menuStructId;
|
||||
RemoveMenuStructRequest request;
|
||||
request.id(m_menuStructId);
|
||||
|
||||
if (!m_ftc->removeMenuStructRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting delete data";
|
||||
ERROR_LOG(m_logger) << "Error requesting delete data";
|
||||
failExit();
|
||||
}
|
||||
}
|
||||
@@ -167,15 +167,15 @@ void AvmFtTests::createMenuStructReply(const Core::FunctionReplyObject &replyObj
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onCreateMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onCreateMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
m_menuStructId = replyObject.id();
|
||||
|
||||
DEBUG_LOG() << "m_testId = " << m_testId;
|
||||
DEBUG_LOG(m_logger) << "m_testId = " << m_testId;
|
||||
|
||||
if(m_testId == 0)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryModify);
|
||||
@@ -188,11 +188,11 @@ void AvmFtTests::modifyMenuStructReply(const Core::FunctionReplyObject &replyObj
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onModifyMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onModifyMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got modifyRequest with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
if(m_testId == 0)
|
||||
QTimer::singleShot(0, this, &AvmFtTests::tryDelete);
|
||||
@@ -205,11 +205,11 @@ void AvmFtTests::onRemoveMenuStructReply(const Core::FunctionReplyObject &replyO
|
||||
{
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onRemoveMenuStructReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onRemoveMenuStructReply error: " << replyObject();
|
||||
failExit();
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got removeReply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
|
||||
+1
@@ -50,6 +50,7 @@ protected Q_SLOTS:
|
||||
void tryModify();
|
||||
void tryDelete();
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onModifyMenuStructReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void createMenuStructReply(const Core::FunctionReplyObject &replyObject);
|
||||
void modifyMenuStructReply(const Core::FunctionReplyObject &replyObject);
|
||||
|
||||
+2
@@ -43,6 +43,8 @@ private slots:
|
||||
void test();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void create();
|
||||
void modify();
|
||||
void remove();
|
||||
|
||||
+33
-33
@@ -38,7 +38,7 @@ MvsTests::~MvsTests()
|
||||
//----------------------------------------------------------------------------------
|
||||
bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int stationId, int exerciseId)
|
||||
{
|
||||
INFO_LOG() << "init begin";
|
||||
INFO_LOG(m_logger) << "init begin";
|
||||
|
||||
m_testId = testId;
|
||||
m_teamId = teamId;
|
||||
@@ -52,18 +52,18 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st
|
||||
return false;
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
|
||||
DEBUG_LOG() << "create ftc MVS";
|
||||
DEBUG_LOG(m_logger) << "create ftc MVS";
|
||||
m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector);
|
||||
DEBUG_LOG() << "init ftc MVS";
|
||||
DEBUG_LOG(m_logger) << "init ftc MVS";
|
||||
bool bRet = m_ftc->enableAll();
|
||||
DEBUG_LOG() << "init end MVS - bRet = " << bRet;
|
||||
DEBUG_LOG(m_logger) << "init end MVS - bRet = " << bRet;
|
||||
|
||||
DEBUG_LOG() << "Domain Id = " << domainId;
|
||||
DEBUG_LOG() << "Team Id = " << teamId;
|
||||
DEBUG_LOG() << "Test Id = " << testId;
|
||||
DEBUG_LOG() << "Receiver Id = " << receiverId;
|
||||
DEBUG_LOG() << "Radio Station Id = " << stationId;
|
||||
DEBUG_LOG() << "Exercise Id = " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
|
||||
DEBUG_LOG(m_logger) << "Team Id = " << teamId;
|
||||
DEBUG_LOG(m_logger) << "Test Id = " << testId;
|
||||
DEBUG_LOG(m_logger) << "Receiver Id = " << receiverId;
|
||||
DEBUG_LOG(m_logger) << "Radio Station Id = " << stationId;
|
||||
DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::startTest()
|
||||
{
|
||||
INFO_LOG() << "startTest";
|
||||
INFO_LOG(m_logger) << "startTest";
|
||||
switch (m_testId)
|
||||
{
|
||||
// case 1:
|
||||
@@ -99,18 +99,18 @@ void MvsTests::startTest()
|
||||
tryModifyAvsVideoReceiver();
|
||||
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 MvsTests::tryCreateVideoTeam()
|
||||
//{
|
||||
// INFO_LOG() << "trying to send createRequest VideoTeam";
|
||||
// INFO_LOG(m_logger) << "trying to send createRequest VideoTeam";
|
||||
// VideoTeamModifyRequest request;
|
||||
|
||||
// request.id(0);
|
||||
@@ -125,7 +125,7 @@ void MvsTests::startTest()
|
||||
|
||||
// if (!m_ftc->videoTeamModifyRequest(request, this))
|
||||
// {
|
||||
// INFO_LOG() << "Error requesting create data, as expected";
|
||||
// INFO_LOG(m_logger) << "Error requesting create data, as expected";
|
||||
// successExit();
|
||||
// }
|
||||
|
||||
@@ -150,7 +150,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
|
||||
if (!m_ftc->videoTeamModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
|
||||
// if (!m_ftc->videoTeamRemoveRequest(request, this))
|
||||
// {
|
||||
// ERROR_LOG() << "Error requesting remove data";
|
||||
// ERROR_LOG(m_logger) << "Error requesting remove data";
|
||||
// failExit();
|
||||
// }
|
||||
|
||||
@@ -176,7 +176,7 @@ void MvsTests::tryModifyVideoTeam()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::tryCreateVideoReceiver()
|
||||
{
|
||||
INFO_LOG() << "trying to send createRequest VideoReceiver";
|
||||
INFO_LOG(m_logger) << "trying to send createRequest VideoReceiver";
|
||||
VideoReceiverModifyRequest request;
|
||||
|
||||
request.id(0);
|
||||
@@ -189,7 +189,7 @@ void MvsTests::tryCreateVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void MvsTests::tryModifyVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ void MvsTests::tryModifyAvsVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyAvsRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify AVS data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify AVS data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ void MvsTests::tryModifyActiveVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverModifyActiveRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting modify active data";
|
||||
ERROR_LOG(m_logger) << "Error requesting modify active data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ void MvsTests::tryDeleteVideoReceiver()
|
||||
|
||||
if (!m_ftc->videoReceiverRemoveRequest(request, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting remove data";
|
||||
ERROR_LOG(m_logger) << "Error requesting remove data";
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ void MvsTests::tryDeleteVideoReceiver()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::failExit()
|
||||
{
|
||||
ERROR_LOG() << "FAIL EXIT !";
|
||||
ERROR_LOG(m_logger) << "FAIL EXIT !";
|
||||
m_bTestsSuccessful = false;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void MvsTests::failExit()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::successExit()
|
||||
{
|
||||
INFO_LOG() << "SUCCES EXIT !";
|
||||
INFO_LOG(m_logger) << "SUCCES EXIT !";
|
||||
m_bTestsSuccessful = true;
|
||||
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
|
||||
}
|
||||
@@ -291,14 +291,14 @@ void MvsTests::successExit()
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onVideoTeamModifyReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onVideoTeamModifyReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onVideoTeamModifyReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onVideoTeamModifyReply error: " << replyObject();
|
||||
QTimer::singleShot(0, qApp, SLOT(quit()));
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got Reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_teamId = replyObject.id();
|
||||
@@ -309,14 +309,14 @@ void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObje
|
||||
//----------------------------------------------------------------------------------
|
||||
void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "END (onVideoReceiverModifyReply)";
|
||||
DEBUG_LOG(m_logger) << "END (onVideoReceiverModifyReply)";
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Got onVideoReceiverModifyReply error: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Got onVideoReceiverModifyReply error: " << replyObject();
|
||||
QTimer::singleShot(0, qApp, SLOT(quit()));
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "Got Reply with id " << replyObject.id()
|
||||
INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id()
|
||||
<< " and errorString " << replyObject.translated();
|
||||
|
||||
m_receiverId = replyObject.id();
|
||||
@@ -327,7 +327,7 @@ void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &reply
|
||||
// ------------------------------------------------------------------------------
|
||||
void MvsTests::onError(const QString &reason)
|
||||
{
|
||||
ERROR_LOG() << "Got Reply error: " << reason;
|
||||
ERROR_LOG(m_logger) << "Got Reply error: " << reason;
|
||||
failExit();
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ void MvsTests::onReply(const Core::FunctionReplyObject &replyObject)
|
||||
onError(replyObject.translated());
|
||||
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, SLOT(quit()));
|
||||
}
|
||||
|
||||
+1
-1
@@ -373,7 +373,7 @@ bool AssetAssignmentManager::hasPendingModifications(int assetId)
|
||||
|
||||
void AssetAssignmentManager::logPending()
|
||||
{
|
||||
DEBUG_LOG() << "pending Mounts, Modifications (Asset), Unmounts, Removes: "
|
||||
DEBUG_LOG(m_logger) << "pending Mounts, Modifications (Asset), Unmounts, Removes: "
|
||||
<< m_pendingMounts.size() << ", "
|
||||
<< m_pendingModifications.size() << ", "
|
||||
<< m_pendingUnmounts.size() << ", "
|
||||
|
||||
+2
-2
@@ -323,7 +323,7 @@ void AudioVideoHandlerImpl::onAssetChanged(Asset *asset)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(asset);
|
||||
DEBUG_LOG() << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")";
|
||||
|
||||
updateDeviceConfig(asset);
|
||||
}
|
||||
@@ -332,7 +332,7 @@ void AudioVideoHandlerImpl::onMountingPointChanged(MountingPoint *mountingPoint)
|
||||
{
|
||||
Q_ASSERT(m_isActive);
|
||||
Q_ASSERT(mountingPoint);
|
||||
DEBUG_LOG() << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")";
|
||||
DEBUG_LOG(m_logger) << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")";
|
||||
|
||||
updateDeviceConfig(mountingPoint->asset());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ AVSocket::~AVSocket()
|
||||
|
||||
void AVSocket::onDisconnected()
|
||||
{
|
||||
// WARNING_LOG() << "Disconnected from A/V system ("
|
||||
// WARNING_LOG(m_logger) << "Disconnected from A/V system ("
|
||||
// << getConnectionString()
|
||||
// << ") - trying to reconnect";
|
||||
m_bSuccessfullyLoggedIn = false;
|
||||
@@ -80,7 +80,7 @@ void AVSocket::onError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
if (!m_bErrorInTcpComWarnedOnce)
|
||||
{
|
||||
ERROR_LOG() << "Error in tcp communication with A/V system ("
|
||||
ERROR_LOG(m_logger) << "Error in tcp communication with A/V system ("
|
||||
<< getConnectionString()
|
||||
<< "): " << QVariant::fromValue(error).toString();
|
||||
m_bErrorInTcpComWarnedOnce = true;
|
||||
@@ -123,7 +123,7 @@ bool AVSocket::sendInternal(const QByteArray &cmd)
|
||||
{
|
||||
if (!m_avsSocket || !m_avsSocket->isWritable())
|
||||
{
|
||||
WARNING_LOG() << "AVS not connected - can not send command '"
|
||||
WARNING_LOG(m_logger) << "AVS not connected - can not send command '"
|
||||
<< cmd << "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ void AvaComm::parseResponse(const QByteArray &line)
|
||||
}
|
||||
|
||||
default:
|
||||
DEBUG_LOG() << "Response not implemented: " << line;
|
||||
DEBUG_LOG(m_logger) << "Response not implemented: " << line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -288,13 +288,13 @@ void AvaControl::keepAlive()
|
||||
void AvaControl::onConnected()
|
||||
{
|
||||
m_connected = true;
|
||||
DEBUG_LOG() << "connected";
|
||||
DEBUG_LOG(m_logger) << "connected";
|
||||
}
|
||||
|
||||
void AvaControl::onDisconnected()
|
||||
{
|
||||
m_connected = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
m_queue.flush();
|
||||
}
|
||||
|
||||
@@ -303,12 +303,12 @@ void AvaControl::onTimeout()
|
||||
ICommand *cmd = m_queue.currentCommand();
|
||||
if (cmd->canTimeout())
|
||||
{
|
||||
INFO_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
INFO_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
m_queue.done();
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR_LOG() << "command timed out";
|
||||
ERROR_LOG(m_logger) << "command timed out";
|
||||
failed(cmd);
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void AvaControl::queue(ICommand *cmd, LtsUtils::IConnection *connection)
|
||||
|
||||
if (!m_connected)
|
||||
{
|
||||
DEBUG_LOG() << "not connected -> dropping command";
|
||||
DEBUG_LOG(m_logger) << "not connected -> dropping command";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ void AvaControl::failed(AvaCommands::SetScript *cmd)
|
||||
|
||||
void AvaControl::failed(ICommand *cmd)
|
||||
{
|
||||
ERROR_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
ERROR_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
Q_ASSERT(cmd == m_queue.currentCommand());
|
||||
auto cmdSetScript = dynamic_cast<AvaCommands::SetScript*>(cmd);
|
||||
if (cmdSetScript)
|
||||
|
||||
@@ -64,7 +64,7 @@ void AvaSession::onConnected()
|
||||
m_established = true;
|
||||
if (m_keepAliveEnabled)
|
||||
m_keepAliveTimer.start();
|
||||
DEBUG_LOG() << "session established";
|
||||
DEBUG_LOG(m_logger) << "session established";
|
||||
emit sessionEstablished();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void AvaSession::onDisconnected()
|
||||
{
|
||||
m_keepAliveTimer.stop();
|
||||
m_established = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
emit disconnected();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -37,7 +37,7 @@ void AvsCommandQueue::queue(std::unique_ptr<ICommand> cmd, std::unique_ptr<LtsUt
|
||||
|
||||
bool noPendingCommand = m_queue.empty();
|
||||
m_queue.push_back(CommandWithConn{std::move(cmd), std::move(connection)});
|
||||
DEBUG_LOG() << "queueing command, queue size: " << m_queue.size();
|
||||
DEBUG_LOG(m_logger) << "queueing command, queue size: " << m_queue.size();
|
||||
tryReduce();
|
||||
if (noPendingCommand)
|
||||
nextCommand();
|
||||
@@ -48,7 +48,7 @@ void AvsCommandQueue::done()
|
||||
Q_ASSERT(!m_queue.empty());
|
||||
m_timer.stop();
|
||||
m_queue.pop_front();
|
||||
DEBUG_LOG() << "command finished, queue size: " << m_queue.size();
|
||||
DEBUG_LOG(m_logger) << "command finished, queue size: " << m_queue.size();
|
||||
if (m_queue.empty())
|
||||
emit queueEmpty();
|
||||
else
|
||||
@@ -79,7 +79,7 @@ void AvsCommandQueue::flush()
|
||||
if (m_queue.empty())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "flushing " << m_queue.size() << " commands";
|
||||
DEBUG_LOG(m_logger) << "flushing " << m_queue.size() << " commands";
|
||||
m_timer.stop();
|
||||
m_queue.clear();
|
||||
emit queueEmpty();
|
||||
@@ -95,7 +95,7 @@ void AvsCommandQueue::nextCommand()
|
||||
{
|
||||
Q_ASSERT(!m_queue.empty());
|
||||
|
||||
DEBUG_LOG() << "sending next command";
|
||||
DEBUG_LOG(m_logger) << "sending next command";
|
||||
ICommand *cmd = currentCommand();
|
||||
m_timer.start();
|
||||
cmd->send();
|
||||
@@ -124,7 +124,7 @@ void AvsCommandQueue::tryReduce()
|
||||
if (!lastCommand.cmd->nullifies(current.cmd.get()))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "dropping command due to override";
|
||||
DEBUG_LOG(m_logger) << "dropping command due to override";
|
||||
m_queue.erase(m_queue.begin() + i);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
Database::AvmDeviceConfig deviceConfig = m_handler->toDeviceConfig(config);
|
||||
bool status = m_db->insert(deviceConfig);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while inserting device config";
|
||||
ERROR_LOG(m_logger) << "Error while inserting device config";
|
||||
|
||||
m_cache.insert(config.id(), deviceConfig);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
newDeviceConfig.id = oldDeviceConfig.id;
|
||||
bool status = m_db->update(newDeviceConfig);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while updating device config";
|
||||
ERROR_LOG(m_logger) << "Error while updating device config";
|
||||
|
||||
m_cache[config.id()] = newDeviceConfig;
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
|
||||
bool status = m_db->removeAvmDeviceConfig(m_cache.value(configId).id);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Error while removing device config";
|
||||
ERROR_LOG(m_logger) << "Error while removing device config";
|
||||
|
||||
m_cache.remove(configId);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -230,7 +230,7 @@ bool CnrHandler::init()
|
||||
|
||||
if (!m_db->select(m_channels))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting cnr channels from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting cnr channels from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ bool CnrHandler::init()
|
||||
QVector<AvmCnrConfig> cnrConfigs;
|
||||
if (!m_db->select(cnrConfigs))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting CNR configs from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting CNR configs from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ void CnrHandler::onRemoveCnrConfigRequest(const rti::core::SampleIdentity &cooki
|
||||
{
|
||||
auto ret = removeCnrConfig(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeCnrConfigReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -284,19 +284,19 @@ void CnrHandler::onModifyCnrConfigRequest(const rti::core::SampleIdentity &cooki
|
||||
{
|
||||
auto ret = (request.id() < 1 ? createCnrConfig(request) : modifyCnrConfig(request));
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyCnrConfigReply(cookie, ret);
|
||||
}
|
||||
|
||||
void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString &hostname)
|
||||
{
|
||||
DEBUG_LOG() << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'";
|
||||
DEBUG_LOG(m_logger) << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'";
|
||||
auto it = m_cnrRadioStations.find(id);
|
||||
if (it != m_cnrRadioStations.end() && it.value() == hostname)
|
||||
return;
|
||||
if (hostname.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!";
|
||||
WARNING_LOG(m_logger) << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!";
|
||||
return;
|
||||
}
|
||||
m_cnrRadioStations[id] = hostname;
|
||||
@@ -305,7 +305,7 @@ void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString
|
||||
|
||||
void CnrHandler::onRadioStationRemoved(int id)
|
||||
{
|
||||
DEBUG_LOG() << "Removing radio station with id " << id;
|
||||
DEBUG_LOG(m_logger) << "Removing radio station with id " << id;
|
||||
auto it = m_cnrRadioStations.find(id);
|
||||
if (it == m_cnrRadioStations.end())
|
||||
return;
|
||||
@@ -347,7 +347,7 @@ void CnrHandler::onDbDeleteAvmCnrConfig(const QVariant &id)
|
||||
if (!m_cache.contains(configId))
|
||||
return; // the notification was a result of our own removal of the entry
|
||||
|
||||
DEBUG_LOG() << "DB deleted AvmCnrConfig with id: " << configId;
|
||||
DEBUG_LOG(m_logger) << "DB deleted AvmCnrConfig with id: " << configId;
|
||||
|
||||
removeCnrConfig(Core::RemoveElementRequest(configId));
|
||||
}
|
||||
@@ -385,7 +385,7 @@ void CnrHandler::reevalutate()
|
||||
{
|
||||
auto reply = modifyCnrConfig(toRequest(cnrConfig));
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply();
|
||||
ERROR_LOG(m_logger) << reply();
|
||||
}
|
||||
|
||||
trans.commit();
|
||||
@@ -558,7 +558,7 @@ bool CnrHandler::isNameUnique(const std::string &name, const boost::optional<int
|
||||
*/
|
||||
Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigRequest &request, const boost::optional<int32_t> &dbId)
|
||||
{
|
||||
DEBUG_LOG() << "CreateCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "CreateCnrConfigRequest: " << request;
|
||||
|
||||
auto reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -586,7 +586,7 @@ Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigReque
|
||||
|
||||
Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "ModifyCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "ModifyCnrConfigRequest: " << request;
|
||||
|
||||
auto reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -630,7 +630,7 @@ Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigReque
|
||||
|
||||
Core::FunctionReplyObject CnrHandler::removeCnrConfig(const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "RemoveCnrConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "RemoveCnrConfigRequest: " << request;
|
||||
|
||||
int32_t configId = request.id();
|
||||
Core::FunctionReplyObject reply(configId);
|
||||
|
||||
+9
-9
@@ -144,7 +144,7 @@ bool CnrTvcProfileHandler::init()
|
||||
bool status = m_db->select(circuitContainersDb);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
bool status = m_db->selectByContainerId(circuitsContentDb, circuitContainerDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
{
|
||||
status = m_db->removeAvmCnrTvcProfileData(invalid.id);
|
||||
if (!status)
|
||||
ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id;
|
||||
ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id;
|
||||
auto newEnd = std::remove_if(circuitsContentDb.begin(), circuitsContentDb.end(), [&invalid] (const Database::AvmCnrTvcProfileData &circuit) { return circuit.id == invalid.id; });
|
||||
circuitsContentDb.erase(newEnd, circuitsContentDb.end());
|
||||
}
|
||||
@@ -198,7 +198,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c
|
||||
status = m_db->removeAvmCnrTvcProfile(circuitContainerDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id;
|
||||
ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ void CnrTvcProfileHandler::onModifyCnrTvcProfileRequest(const rti::core::SampleI
|
||||
rep = modifyProfile(request);
|
||||
|
||||
if (rep.error())
|
||||
WARNING_LOG() << rep.str();
|
||||
WARNING_LOG(m_logger) << rep.str();
|
||||
|
||||
m_fts->modifyCnrTvcProfileReply(cookie, rep);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void CnrTvcProfileHandler::onRemoveCnrTvcProfileRequest(const rti::core::SampleI
|
||||
Core::FunctionReplyObject rep = removeProfile(request);
|
||||
|
||||
if (rep.error())
|
||||
WARNING_LOG() << rep.str();
|
||||
WARNING_LOG(m_logger) << rep.str();
|
||||
|
||||
m_fts->removeCnrTvcProfileReply(cookie, rep);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ void CnrTvcProfileHandler::addProfile(const CnrTvcProfile &profile)
|
||||
|
||||
bool status = m_dts->publish(profile);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id());
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::removeProfile(int64_t id)
|
||||
@@ -375,7 +375,7 @@ void CnrTvcProfileHandler::removeProfile(int64_t id)
|
||||
|
||||
bool status = m_dts->removeCnrTvcProfileByKey(id);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id);
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id);
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile)
|
||||
@@ -393,7 +393,7 @@ void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile)
|
||||
|
||||
bool status = m_dts->publish(profile);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id());
|
||||
}
|
||||
|
||||
void CnrTvcProfileHandler::onCnrConfigChanged(const CnrConfig &cnrConfig)
|
||||
|
||||
@@ -27,14 +27,14 @@ namespace AudioVideoManagement
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
|
||||
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;
|
||||
|
||||
+3
-4
@@ -70,14 +70,13 @@ bool isStreamOfInterest(const AudioVideoManagement::Stream &stream, bool isAudio
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc)
|
||||
: m_context(context)
|
||||
DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc) : m_context(context)
|
||||
, m_dts(dts)
|
||||
, m_videoTeamHandler(handlerVideoTeams)
|
||||
, m_ismDtc(ismDtc)
|
||||
, m_timer(new QTimer)
|
||||
, m_isInitialized(false)
|
||||
{
|
||||
, m_isInitialized(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(ismDtc);
|
||||
if(!m_ismDtc->isMainStructureElementEnabled())
|
||||
|
||||
@@ -69,6 +69,8 @@ signals:
|
||||
void assetUnassigned(Asset *asset);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
ExerciseContext m_context;
|
||||
std::map<int, std::unique_ptr<Asset>> m_assets;
|
||||
std::map<int, std::unique_ptr<MountingPoint>> m_mountingPoints;
|
||||
|
||||
+13
-14
@@ -35,16 +35,15 @@ bool isActive(ExerciseManagement::ExerciseState state)
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId)
|
||||
: QObject()
|
||||
ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId) : QObject()
|
||||
, m_exContext(exerciseId)
|
||||
, m_curExerciseState(ExerciseManagement::ExerciseState::Unknown)
|
||||
, m_curAVOperatingMode(AVControl::OperatingMode::Unknown)
|
||||
, m_mainHandler(mainHandler)
|
||||
, m_updateTimer(new QTimer(this))
|
||||
, m_lastSeenTimer(new QTimer(this))
|
||||
, m_bWarnedOnce(false)
|
||||
{
|
||||
, m_bWarnedOnce(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_updateTimer->setSingleShot(true);
|
||||
connect(m_updateTimer, &QTimer::timeout, this, &ExerciseHandler::onUpdateTimerTimeout);
|
||||
|
||||
@@ -74,7 +73,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
m_recordSession.type = avTypeRecordSession();
|
||||
if (!db()->insert(m_recordSession))
|
||||
{
|
||||
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
return;
|
||||
}
|
||||
emit avDbReloadNeeded();
|
||||
@@ -88,7 +87,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
m_replaySession.type = avTypePlaybackSession();
|
||||
if (!db()->insert(m_replaySession))
|
||||
{
|
||||
ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting";
|
||||
return;
|
||||
}
|
||||
emit avDbReloadNeeded();
|
||||
@@ -98,7 +97,7 @@ void ExerciseHandler::checkForRecordPlaybackSession()
|
||||
void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newState)
|
||||
{
|
||||
Q_ASSERT(newState != ExerciseManagement::ExerciseState::Unknown);
|
||||
INFO_LOG() << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
|
||||
INFO_LOG(m_logger) << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState;
|
||||
|
||||
if (m_curExerciseState == newState)
|
||||
return;
|
||||
@@ -120,12 +119,12 @@ void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newS
|
||||
{
|
||||
if (newIsActive)
|
||||
{
|
||||
DEBUG_LOG() << m_exContext << " activated";
|
||||
DEBUG_LOG(m_logger) << m_exContext << " activated";
|
||||
emit contextActivated();
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << m_exContext << " deactivated";
|
||||
DEBUG_LOG(m_logger) << m_exContext << " deactivated";
|
||||
emit contextDeactivated();
|
||||
}
|
||||
}
|
||||
@@ -163,12 +162,12 @@ void ExerciseHandler::onUpdateTimerTimeout()
|
||||
if (m_curAVOperatingMode == desiredOperatingMode)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
|
||||
DEBUG_LOG(m_logger) << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode;
|
||||
if (!avControl()->setOperatingModeForContext(m_exContext, desiredOperatingMode))
|
||||
{
|
||||
if (!m_bWarnedOnce)
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << m_exContext
|
||||
DEBUG_LOG(m_logger) << "Context: " << m_exContext
|
||||
<< " - could not change operating mode, maybe not yet connected to AVS - trying again in 5 seconds";
|
||||
m_bWarnedOnce = true;
|
||||
}
|
||||
@@ -205,7 +204,7 @@ void ExerciseHandler::onLastSeenTimerTimeout()
|
||||
m_lastSeen.lastSeen.isNull() ||
|
||||
m_lastSeen.lastSeen.addDays(1) < QDateTime::currentDateTimeUtc())
|
||||
{
|
||||
INFO_LOG() << "Exercise with id " << m_exContext.id()
|
||||
INFO_LOG(m_logger) << "Exercise with id " << m_exContext.id()
|
||||
<< " not seen since more than 1 day -> removing";
|
||||
// not seen at all or not since more than 1 day -> remove
|
||||
setNewExerciseState(ExerciseManagement::ExerciseState::Terminated);
|
||||
@@ -224,13 +223,13 @@ void ExerciseHandler::onOperatingModeChanged(const ExerciseContext &context,
|
||||
|
||||
if (desiredOperatingMode != om)
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << context << " Got " << om
|
||||
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
|
||||
<< " for " << comp << " but expected " << desiredOperatingMode;
|
||||
m_updateTimer->start(100);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Context: " << context << " Got " << om
|
||||
DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om
|
||||
<< " for " << comp << " which is the expected value";
|
||||
m_updateTimer->stop();
|
||||
}
|
||||
|
||||
+5
-6
@@ -52,11 +52,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
ExercisesHandler::ExercisesHandler(MainHandler *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
ExercisesHandler::ExercisesHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler)
|
||||
, m_triggerAvUpdateTimer(new QTimer(this))
|
||||
, m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc()))
|
||||
{
|
||||
, m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc())),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_triggerAvUpdateTimer->setSingleShot(true);
|
||||
m_triggerAvUpdateTimer->setInterval(1000);
|
||||
connect(m_triggerAvUpdateTimer, &QTimer::timeout,
|
||||
@@ -98,7 +97,7 @@ bool ExercisesHandler::init()
|
||||
connect(exmDtc(), &ExerciseManagement::Interface::Dtc::exerciseChanged,
|
||||
this, &ExercisesHandler::onExerciseChanged);
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " done";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " done";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ ExerciseHandler *ExercisesHandler::getOrCreateExerciseHandler(int exerciseId)
|
||||
|
||||
ExerciseHandler *ExercisesHandler::createExerciseHandler(int exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << "Creating handler for exercise " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "Creating handler for exercise " << exerciseId;
|
||||
|
||||
ExerciseParts parts(m_mainHandler, m_assetAssignmentManager->exercise(exerciseId));
|
||||
ExerciseHandler *exH = parts.exerciseHandler();
|
||||
|
||||
@@ -78,6 +78,7 @@ public slots:
|
||||
void onAvDbReloadNeeded();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void createExerciseHandlerFromLastSeen(const Database::AvmExerciseLastSeen &lastSeen);
|
||||
ExerciseHandler *getOrCreateExerciseHandler(int exerciseId);
|
||||
ExerciseHandler *createExerciseHandler(int exerciseId);
|
||||
@@ -92,6 +93,7 @@ private slots:
|
||||
void exerciseFinished(int exerciseId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainHandler *m_mainHandler;
|
||||
QTimer *m_triggerAvUpdateTimer;
|
||||
std::unique_ptr<AssetAssignmentManager> m_assetAssignmentManager;
|
||||
|
||||
+15
-15
@@ -156,7 +156,7 @@ bool FrequencyPlanningHandler::init()
|
||||
QVector<Database::AvmFrequencyPlanning> frequencyPlannings;
|
||||
if (!m_db->select(frequencyPlannings))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting frequency plannings from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting frequency plannings from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -169,11 +169,11 @@ bool FrequencyPlanningHandler::init()
|
||||
m_activePlannings.insert(exerciseId, currentDbData);
|
||||
|
||||
if (!m_dts->publish(ActiveFrequencyPlanning(exerciseId, currentDbData.frequencyPlanningId)))
|
||||
ERROR_LOG() << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId;
|
||||
ERROR_LOG(m_logger) << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId;
|
||||
};
|
||||
if (!m_db->select(cbAfp))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting AvmActiveFrequencyPlannings from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting AvmActiveFrequencyPlannings from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void FrequencyPlanningHandler::onModifyFrequencyPlanningRequest(const rti::core:
|
||||
{
|
||||
auto ret = request.id() > 0 ? handleModify(request) : handleCreate(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void FrequencyPlanningHandler::onRemoveFrequencyPlanningRequest(const rti::core:
|
||||
{
|
||||
auto ret = handleRemove(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ void FrequencyPlanningHandler::onModifyActiveFrequencyPlanningRequest(const rti:
|
||||
{
|
||||
auto ret = modifyActiveFrequencyPlanningRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyActiveFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ void FrequencyPlanningHandler::onRemoveActiveFrequencyPlanningRequest(const rti:
|
||||
{
|
||||
auto ret = removeActiveFrequencyPlanningRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->removeActiveFrequencyPlanningReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre
|
||||
status = m_db->insert(dbEntry);
|
||||
if (!status)
|
||||
{
|
||||
WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB";
|
||||
WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB";
|
||||
break;
|
||||
}
|
||||
dbEntries.push_back(dbEntry);
|
||||
@@ -307,7 +307,7 @@ Q_ASSERT(request.id() > 0);
|
||||
status = m_db->insert(dbEntry);
|
||||
if (!status)
|
||||
{
|
||||
WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB";
|
||||
WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB";
|
||||
break;
|
||||
}
|
||||
dbEntries.push_back(dbEntry);
|
||||
@@ -444,7 +444,7 @@ std::vector<Database::AvmFrequencyPlanningData> FrequencyPlanningHandler::insert
|
||||
|
||||
Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlanningRequest(const ModifyActiveFrequencyPlanningRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "ModifyActiveFrequencyPlanningRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "ModifyActiveFrequencyPlanningRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject reply = validateRequest(request);
|
||||
if (reply.error())
|
||||
@@ -480,7 +480,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlannin
|
||||
|
||||
Core::FunctionReplyObject FrequencyPlanningHandler::removeActiveFrequencyPlanningRequest(const RemoveActiveFrequencyPlanningRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "RemoveActiveFrequencyPlanningRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "RemoveActiveFrequencyPlanningRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject reply(request.exerciseId());
|
||||
|
||||
@@ -668,7 +668,7 @@ bool FrequencyPlanningHandler::collectAndPublish(const Database::AvmFrequencyPla
|
||||
bool status = m_db->selectByFrequencyPlanningId(dbEntries, planDb.id);
|
||||
if (!status)
|
||||
{
|
||||
ERROR_LOG() << "Error selecting AvmFrequencyPlanningData from db";
|
||||
ERROR_LOG(m_logger) << "Error selecting AvmFrequencyPlanningData from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ void FrequencyPlanningHandler::addPlan(const FrequencyPlanning &plan)
|
||||
|
||||
bool status = m_dts->publish(plan);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id());
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
@@ -706,7 +706,7 @@ void FrequencyPlanningHandler::updatePlan(const FrequencyPlanning &plan)
|
||||
|
||||
bool status = m_dts->publish(plan);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id());
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id());
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
@@ -720,7 +720,7 @@ void FrequencyPlanningHandler::removePlan(int32_t planId)
|
||||
|
||||
bool status = m_dts->removeFrequencyPlanningByKey(planId);
|
||||
if (!status)
|
||||
ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId);
|
||||
ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId);
|
||||
|
||||
emit planningChanged();
|
||||
}
|
||||
|
||||
+8
-9
@@ -16,26 +16,25 @@
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(db);
|
||||
}
|
||||
|
||||
bool FrequencySetHandler::init()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
QVector<Database::AvmFrequencySet> frequencySets;
|
||||
|
||||
// Don't use select() with callback here as the callback (body of for-loop below) would use the DB, too.
|
||||
if (!m_db->select(frequencySets))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting frequency sets from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting frequency sets from db";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "Found " << frequencySets.size() << " Frequency Sets";
|
||||
DEBUG_LOG(m_logger) << "Found " << frequencySets.size() << " Frequency Sets";
|
||||
|
||||
for (const Database::AvmFrequencySet ¤tfrequencySet : std::as_const(frequencySets))
|
||||
addFrequencySet(toDdsFrequencySet(currentfrequencySet));
|
||||
@@ -66,7 +65,7 @@ FrequencySet FrequencySetHandler::toDdsFrequencySet(const Database::AvmFrequency
|
||||
};
|
||||
m_db->selectByFrequencySetId(cb, result.id());
|
||||
|
||||
DEBUG_LOG() << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries";
|
||||
DEBUG_LOG(m_logger) << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries";
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -122,7 +121,7 @@ void FrequencySetHandler::addFrequencySet(const FrequencySet &frequencySet)
|
||||
m_frequencySetDatas.insert(frequencySet.id(), dataIds);
|
||||
|
||||
if (!m_dts->publish(frequencySet))
|
||||
ERROR_LOG() << "Error while publishing Frequency Set with id " << frequencySet.id();
|
||||
ERROR_LOG(m_logger) << "Error while publishing Frequency Set with id " << frequencySet.id();
|
||||
}
|
||||
|
||||
} // namespace AudioVideoManagement
|
||||
+5
-5
@@ -76,7 +76,7 @@ bool HandlerFrequencyPlanningStatus::init()
|
||||
// read all HandlerFrequencyPlanningStatus Data from database
|
||||
if (!m_db->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ bool HandlerFrequencyPlanningStatus::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_data.insert(ifs->getData().client(), ifs);
|
||||
@@ -101,10 +101,10 @@ bool HandlerFrequencyPlanningStatus::init()
|
||||
void HandlerFrequencyPlanningStatus::onModifyFrequencyPlanningStatusRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ModifyFrequencyPlanningStatusRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onModifyFrequencyPlanningStatusRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onModifyFrequencyPlanningStatusRequest: " << request;
|
||||
auto ret = m_data.contains(request.client()) ? frequencyPlanningStatusModifyRequest(request) : frequencyPlanningStatusCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyFrequencyPlanningStatusReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ
|
||||
int client = ifs->getData().client();
|
||||
ret = ifs->removeObject();
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
clients << client;
|
||||
}
|
||||
|
||||
+5
-5
@@ -222,10 +222,10 @@ QList<MenuStruct> HandlerMenuStruct::loadFromDb(bool &status)
|
||||
void HandlerMenuStruct::onModifyMenuStructRequest(const rti::core::SampleIdentity &cookie,
|
||||
const MenuStruct &request)
|
||||
{
|
||||
DEBUG_LOG() << "onModifyMenuStructRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onModifyMenuStructRequest: " << request;
|
||||
auto ret = request.id() > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyMenuStructReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS
|
||||
{
|
||||
ObjectMenuStruct *ifs = new ObjectMenuStruct(m_dts, m_db);
|
||||
|
||||
DEBUG_LOG() << "request.menuEntries.size() : " << request.menuEntries().size();
|
||||
DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries().size();
|
||||
Core::FunctionReplyObject ret = ifs->createFromDds(request);
|
||||
|
||||
if (ret.error())
|
||||
@@ -263,7 +263,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
|
||||
INFO_LOG() << "onRemoveMenuStructRequest id = " << request.id();
|
||||
INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id();
|
||||
|
||||
ObjectMenuStruct *ifs = m_objMap.value(request.id());
|
||||
if (ifs == nullptr)
|
||||
@@ -287,7 +287,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit
|
||||
void HandlerMenuStruct::onDbDeletedAvmMenuStruct(const QVariant &id_)
|
||||
{
|
||||
int id = id_.toInt();
|
||||
DEBUG_LOG() << "DB deleted AvmMenuStruct with id: " << id;
|
||||
DEBUG_LOG(m_logger) << "DB deleted AvmMenuStruct with id: " << id;
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
+33
-33
@@ -63,7 +63,7 @@ bool HandlerVideoReceiver::init()
|
||||
// read all VideoReceiver Data from database
|
||||
if (!m_db->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -76,13 +76,13 @@ bool HandlerVideoReceiver::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_videoReceiverObjMap.insert(ifs->getId(), ifs);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_videoReceiverObjMap.size() = " << m_videoReceiverObjMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_videoReceiverObjMap.size() = " << m_videoReceiverObjMap.size();
|
||||
|
||||
m_httpRequestTimer.setInterval(std::chrono::milliseconds(20000).count());
|
||||
m_httpRequestTimer.setSingleShot(false);
|
||||
@@ -99,10 +99,10 @@ bool HandlerVideoReceiver::init()
|
||||
void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const VideoReceiverModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onVideoReceiverModifyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onVideoReceiverModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->videoReceiverModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -110,10 +110,10 @@ void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleI
|
||||
void HandlerVideoReceiver::onVideoReceiverModifyActiveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const VideoReceiverModifyActiveRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onVideoReceiverModifyActiveRequest";
|
||||
DEBUG_LOG(m_logger) << "onVideoReceiverModifyActiveRequest";
|
||||
auto ret = videoReceiverModifyActiveRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
else
|
||||
// activate channel here
|
||||
activateChannel(request.id(), request.isActive());
|
||||
@@ -126,7 +126,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyAvsRequest(const rti::core::Samp
|
||||
{
|
||||
auto ret = videoReceiverModifyAvsRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->videoReceiverModifyAvsReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiv
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const VideoReceiverModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "videoReceiverModifyRequest";
|
||||
DEBUG_LOG(m_logger) << "videoReceiverModifyRequest";
|
||||
ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id());
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id());
|
||||
@@ -242,7 +242,7 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI
|
||||
ret = ifs->removeObject();
|
||||
|
||||
if (ret.error())
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
// delete ObjectVideoReceiver
|
||||
@@ -268,13 +268,13 @@ void HandlerVideoReceiver::onGetStatus()
|
||||
ObjectVideoReceiver *objectVideoReceiver = i.value();
|
||||
QString host = QString::fromStdString(objectVideoReceiver->getData().hostName()).toLower();
|
||||
|
||||
DEBUG_LOG() << " streamName=" << objectVideoReceiver->getData().streamName()
|
||||
DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName()
|
||||
<< " hostName=" << host
|
||||
<< " teamId=" << objectVideoReceiver->getData().teamId();
|
||||
if ((objectVideoReceiver->getData().teamId() == 1)
|
||||
&& (!m_receiver.contains(host)))
|
||||
{
|
||||
DEBUG_LOG() << " onSendHttpRequest host=" << host << " key=" << i.key()
|
||||
DEBUG_LOG(m_logger) << " onSendHttpRequest host=" << host << " key=" << i.key()
|
||||
<< " id=" << objectVideoReceiver->getData().id();
|
||||
m_receiver.insert(host, i.key());
|
||||
onSendHttpRequest(i.key());
|
||||
@@ -284,7 +284,7 @@ void HandlerVideoReceiver::onGetStatus()
|
||||
|
||||
void HandlerVideoReceiver::onSendHttpRequest(const int key)
|
||||
{
|
||||
INFO_LOG() << "onSendHttpRequest key=" << key;
|
||||
INFO_LOG(m_logger) << "onSendHttpRequest key=" << key;
|
||||
|
||||
//request = QStringLiteral("http://localhost/set_param?remuxBitrate=90.0");
|
||||
//request = QStringLiteral("http://localhost/status.json");
|
||||
@@ -297,7 +297,7 @@ void HandlerVideoReceiver::onSendHttpRequest(const int key)
|
||||
|
||||
void HandlerVideoReceiver::startRequest(const QUrl &requestedUrl)
|
||||
{
|
||||
INFO_LOG() << "startRequest:" << requestedUrl.toString();
|
||||
INFO_LOG(m_logger) << "startRequest:" << requestedUrl.toString();
|
||||
|
||||
m_httpRequestAborted = false;
|
||||
|
||||
@@ -317,22 +317,22 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
|
||||
const QByteArray replyData = reply->readAll();
|
||||
|
||||
INFO_LOG() << "Answer = " << replyData
|
||||
INFO_LOG(m_logger) << "Answer = " << replyData
|
||||
<< " size = " << replyData.size()
|
||||
<< " url=" << urlString
|
||||
<< " host=" << host;
|
||||
m_receiver.remove(host);
|
||||
if (reply->error())
|
||||
{
|
||||
ERROR_LOG() << "Cannot connect to VideoReceiver";
|
||||
ERROR_LOG() << "reply->error: " << reply->errorString();
|
||||
ERROR_LOG(m_logger) << "Cannot connect to VideoReceiver";
|
||||
ERROR_LOG(m_logger) << "reply->error: " << reply->errorString();
|
||||
reply->deleteLater();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Success
|
||||
INFO_LOG() << "Connected to VideoReceiver ";
|
||||
INFO_LOG(m_logger) << "Connected to VideoReceiver ";
|
||||
|
||||
// Keine Antwort vom Receiver
|
||||
if (replyData.size() == 0)
|
||||
@@ -366,10 +366,10 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
const QJsonObject jsonObject = doc.object();
|
||||
//QJsonDocument doc(jsonObject);
|
||||
//QStringList keyList = jsonObject.keys();
|
||||
//DEBUG_LOG() << "keyList.size()" << keyList.size() ;
|
||||
//DEBUG_LOG(m_logger) << "keyList.size()" << keyList.size() ;
|
||||
//for (int i = 0; i < keyList.size(); ++i)
|
||||
// DEBUG_LOG() << keyList.at(i).toLocal8Bit().constData() ;
|
||||
//DEBUG_LOG() << doc.toJson(QJsonDocument::Indented);
|
||||
// DEBUG_LOG(m_logger) << keyList.at(i).toLocal8Bit().constData() ;
|
||||
//DEBUG_LOG(m_logger) << doc.toJson(QJsonDocument::Indented);
|
||||
/////////////////////
|
||||
double snrA = 0;
|
||||
double snrB = 0;
|
||||
@@ -382,7 +382,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
int freqencyB = jsonObject[QStringLiteral("inputFrequency2")].toInt();
|
||||
// 0 = Off, 1 = Channel1, 2 = Channel2, 3 = Channel1 + Channel2
|
||||
int remuxInputMask = jsonObject[QStringLiteral("remuxInputMask")].toInt();
|
||||
INFO_LOG() << "lockstatusA = " << lockstatusA
|
||||
INFO_LOG(m_logger) << "lockstatusA = " << lockstatusA
|
||||
<< " lockstatusB = " << lockstatusB
|
||||
<< " freqencyA=" << freqencyA
|
||||
<< " freqencyB=" << freqencyB
|
||||
@@ -463,7 +463,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
double tmpLevel = ((-40 - powerLevelA) / 60) * 100;
|
||||
powerLevelA = 100.0 - tmpLevel;
|
||||
}
|
||||
DEBUG_LOG() << "Channel 1: snrA=" << snrA
|
||||
DEBUG_LOG(m_logger) << "Channel 1: snrA=" << snrA
|
||||
<< " powerLevelA " << powerLevelA;
|
||||
|
||||
// send Topic LTS_VideoReceiver
|
||||
@@ -531,7 +531,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
double tmpLevel = ((-40 - powerLevelB) / 60) * 100;
|
||||
powerLevelB = 100.0 - tmpLevel;
|
||||
}
|
||||
DEBUG_LOG() << "Channel 2: snrB=" << snrB
|
||||
DEBUG_LOG(m_logger) << "Channel 2: snrB=" << snrB
|
||||
<< " powerLevelB " << powerLevelB;
|
||||
// Der Key von Receiver2 folgt immer dem von Receiver 1
|
||||
updateObject(key + 1, powerLevelB, snrB, lockstatusB, freqencyB);
|
||||
@@ -545,7 +545,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply)
|
||||
{
|
||||
i.next();
|
||||
ObjectVideoReceiver *objectVideoReceiver = i.value();
|
||||
DEBUG_LOG() << "key=" << i.key()
|
||||
DEBUG_LOG(m_logger) << "key=" << i.key()
|
||||
<< " : value.Id=" << objectVideoReceiver->getId()
|
||||
<< " mse=" << objectVideoReceiver->getData().mainStructureElementId()
|
||||
<< " streamName=" << objectVideoReceiver->getData().streamName()
|
||||
@@ -589,7 +589,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
int active2 = 0;
|
||||
int active = 0;
|
||||
int id = 0;
|
||||
DEBUG_LOG() << "activateChannel channelId=" << channelId
|
||||
DEBUG_LOG(m_logger) << "activateChannel channelId=" << channelId
|
||||
<< " activate = " << activate
|
||||
<< " hostname = " << hostName
|
||||
<< " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId();
|
||||
@@ -598,7 +598,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
|
||||
if (!m_videoReceiverObjMap.contains(channelId))
|
||||
{
|
||||
ERROR_LOG() << "channelId " << channelId << " does not exist";
|
||||
ERROR_LOG(m_logger) << "channelId " << channelId << " does not exist";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
active1 = activate;
|
||||
if (!m_videoReceiverObjMap.contains(id + 1))
|
||||
{
|
||||
ERROR_LOG() << "channelId " << id + 1 << " does not exist";
|
||||
ERROR_LOG(m_logger) << "channelId " << id + 1 << " does not exist";
|
||||
return;
|
||||
}
|
||||
active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive();
|
||||
@@ -622,7 +622,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ
|
||||
active2 = activate;
|
||||
}
|
||||
active = active1 + active2 * 2;
|
||||
DEBUG_LOG() << "activateChannel hostname=" << hostName
|
||||
DEBUG_LOG(m_logger) << "activateChannel hostname=" << hostName
|
||||
<< " active1=" << active1
|
||||
<< " active2=" << active2
|
||||
<< " active=" << active;
|
||||
@@ -642,7 +642,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
|
||||
ObjectVideoReceiver *channel1 = m_videoReceiverObjMap.value(key);
|
||||
if (channel1 == nullptr )
|
||||
{
|
||||
ERROR_LOG() << "checkActiveState key=" << key
|
||||
ERROR_LOG(m_logger) << "checkActiveState key=" << key
|
||||
<< " remuxInputMask=" << remuxInputMask << " channel1 == nullptr";
|
||||
return;
|
||||
}
|
||||
@@ -651,7 +651,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
|
||||
ObjectVideoReceiver *channel2 = m_videoReceiverObjMap.value(key + 1);
|
||||
int channel2Active = channel2->getData().isActive();
|
||||
int active = channel1Active + channel2Active * 2;
|
||||
DEBUG_LOG() << "checkActiveState "
|
||||
DEBUG_LOG(m_logger) << "checkActiveState "
|
||||
<< " key=" << key
|
||||
<< " active=" << active
|
||||
<< " remuxInputMask=" << remuxInputMask
|
||||
@@ -663,7 +663,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
|
||||
{
|
||||
bool activate = channel1Active;
|
||||
activateChannel(key, activate);
|
||||
DEBUG_LOG() << "checkActiveState Send HTTP-Request activateChannel"
|
||||
DEBUG_LOG(m_logger) << "checkActiveState Send HTTP-Request activateChannel"
|
||||
<< " key=" << key
|
||||
<< " activate=" << activate;
|
||||
}
|
||||
@@ -672,7 +672,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM
|
||||
{
|
||||
bool activate = channel2Active;
|
||||
activateChannel(key + 1, activate);
|
||||
DEBUG_LOG() << "checkActiveState Send HTTP-Request activateChannel"
|
||||
DEBUG_LOG(m_logger) << "checkActiveState Send HTTP-Request activateChannel"
|
||||
<< " key=" << key + 1
|
||||
<< " activate=" << activate
|
||||
<< " channel2Active=" << channel2Active
|
||||
|
||||
+9
-9
@@ -37,7 +37,7 @@ public:
|
||||
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(videoTeam);
|
||||
|
||||
if (!m_db->insert(deviceConfig))
|
||||
ERROR_LOG() << "Error while inserting device config into database";
|
||||
ERROR_LOG(m_logger) << "Error while inserting device config into database";
|
||||
|
||||
m_cache.insert(videoTeam.id(), deviceConfig);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
deviceConfig.id = oldDeviceConfig.id;
|
||||
|
||||
if (!m_db->update(deviceConfig))
|
||||
ERROR_LOG() << "Error while updating device config";
|
||||
ERROR_LOG(m_logger) << "Error while updating device config";
|
||||
|
||||
m_cache[videoTeam.id()] = deviceConfig;
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
Q_ASSERT(found != m_cache.end());
|
||||
|
||||
if (!m_db->removeAvmDeviceConfig(found->id))
|
||||
ERROR_LOG() << "Error while removing device config";
|
||||
ERROR_LOG(m_logger) << "Error while removing device config";
|
||||
|
||||
m_cache.erase(found);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -137,7 +137,7 @@ bool HandlerVideoTeam::init()
|
||||
// read all VideoTeam Data from database
|
||||
if (!m_db->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ bool HandlerVideoTeam::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
m_videoTeamObjMap.insert(ifs->getId(), ifs);
|
||||
@@ -159,7 +159,7 @@ bool HandlerVideoTeam::init()
|
||||
m_deviceConfig->create(ddsData);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "m_VideoTeamObjMap.size() = " << m_videoTeamObjMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_VideoTeamObjMap.size() = " << m_videoTeamObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -176,10 +176,10 @@ QMap<int, VideoTeam> HandlerVideoTeam::videoTeams() const
|
||||
void HandlerVideoTeam::onVideoTeamModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const VideoTeamModifyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onVideoTeamModifyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onVideoTeamModifyRequest: " << request;
|
||||
auto ret = request.id() > 0 ? videoTeamModifyRequest(request) : videoTeamCreateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->videoTeamModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ Core::FunctionReplyObject HandlerVideoTeam::videoTeamModifyRequest(const VideoTe
|
||||
ObjectVideoTeam *ifs = m_videoTeamObjMap.value(request.id());
|
||||
if (ifs == nullptr)
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Team with id %1 not found")).arg(request.id());
|
||||
DEBUG_LOG() << "on Modify Request" << request.streamName() << " ID: " << request.name() << " exId " << request.exerciseId();
|
||||
DEBUG_LOG(m_logger) << "on Modify Request" << request.streamName() << " ID: " << request.name() << " exId " << request.exerciseId();
|
||||
|
||||
VideoTeam ddsData = convert(request, ifs->getData());
|
||||
if (needDeviceConfig(ddsData))
|
||||
|
||||
@@ -36,9 +36,8 @@
|
||||
|
||||
using namespace AudioVideoManagement;
|
||||
|
||||
MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
{}
|
||||
MainHandler::MainHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
MainHandler::~MainHandler() = default;
|
||||
|
||||
@@ -48,7 +47,7 @@ bool MainHandler::init(int domainId)
|
||||
m_dbHandler.reset(new DbHandler());
|
||||
if (!m_dbHandler->init(0, Settings::settings()))
|
||||
{
|
||||
ERROR_LOG() << "Initialisation dbHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_dbInterface = m_dbHandler->db();
|
||||
@@ -57,7 +56,7 @@ bool MainHandler::init(int domainId)
|
||||
m_ddsHandler.reset(new DdsHandler(domainId));
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation ddsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ bool MainHandler::init(int domainId)
|
||||
connect(m_videoTeamHandler.get(), &HandlerVideoTeam::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded);
|
||||
if (!m_videoTeamHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerVideoTeam failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerVideoTeam failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -90,7 +89,7 @@ bool MainHandler::init(int domainId)
|
||||
m_frequencyPlanningStatusHandler.reset(new HandlerFrequencyPlanningStatus(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get()));
|
||||
if (!m_frequencyPlanningStatusHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerFrequencyPlanningStatus failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerFrequencyPlanningStatus failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +107,7 @@ bool MainHandler::init(int domainId)
|
||||
connect(m_tvcHandler.get(), &TvcHandler::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded);
|
||||
if (!m_tvcHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation tvcHandler failed";
|
||||
ERROR_LOG(m_logger) << "Initialisation tvcHandler failed";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -116,7 +115,7 @@ bool MainHandler::init(int domainId)
|
||||
m_frequencySetHandler.reset(new FrequencySetHandler(m_ddsHandler->dts(), m_dbInterface.get()));
|
||||
if (!m_frequencySetHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation FrequencySetHandler failed";
|
||||
ERROR_LOG(m_logger) << "Initialisation FrequencySetHandler failed";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -130,14 +129,14 @@ bool MainHandler::init(int domainId)
|
||||
m_frequencyPlanningHandler->setCnrHandler(m_cnrHandler.get());
|
||||
if (!m_frequencyPlanningHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation FrequencyPlanningHandler failed";
|
||||
ERROR_LOG(m_logger) << "Initialisation FrequencyPlanningHandler failed";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_cnrHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation cnrHandler failed";
|
||||
ERROR_LOG(m_logger) << "Initialisation cnrHandler failed";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -145,7 +144,7 @@ bool MainHandler::init(int domainId)
|
||||
m_cnrTvcProfileHandler.reset(new CnrTvcProfileHandler(m_dbInterface.get(), m_ddsHandler->dts(), m_ddsHandler->fts(), m_cnrHandler.get(), m_tvcHandler.get()));
|
||||
if (!m_cnrTvcProfileHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation RadioCircuitsHandler failed";
|
||||
ERROR_LOG(m_logger) << "Initialisation RadioCircuitsHandler failed";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -156,7 +155,7 @@ bool MainHandler::init(int domainId)
|
||||
m_videoReceiverHandler.reset(new HandlerVideoReceiver(this, m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get()));
|
||||
if (!m_videoReceiverHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerVideoReceiver failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerVideoReceiver failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ bool MainHandler::init(int domainId)
|
||||
|
||||
if (!m_ddsHandler->enableDtcClients())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DTCs failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DTCs failed.";
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
CnrHandler *cnrHandler() { return m_cnrHandler.get(); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::unique_ptr<DdsHandler> m_ddsHandler;
|
||||
std::unique_ptr<DbHandler> m_dbHandler;
|
||||
std::shared_ptr<DatabaseInterface> m_dbInterface; //!< just to make sure we own a reference to it; we can then simply forward a plain pointer to our clients
|
||||
|
||||
+7
-8
@@ -13,10 +13,9 @@ namespace AudioVideoManagement
|
||||
{
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
ObjectFrequencyPlanningStatus::ObjectFrequencyPlanningStatus(Interface::Dts *dts,
|
||||
DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
@@ -62,7 +61,7 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::createObjectFromDDS(con
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database"));
|
||||
|
||||
m_data.id() = dbData.id;
|
||||
DEBUG_LOG() << "Data changed for VideoTeam Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << m_data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -82,7 +81,7 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::updateObject(const Freq
|
||||
if (!m_db->update(dbData))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating FrequencyPlanningStatus into database"));
|
||||
|
||||
DEBUG_LOG() << "Data changed for FrequencyPlanningStatus Id: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for FrequencyPlanningStatus Id: " << data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -104,10 +103,10 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::removeObject()
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
void ObjectFrequencyPlanningStatus::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id() << ") ..." << m_data.client() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id() << ") ..." << m_data.client() << ") ...";
|
||||
|
||||
if (!m_dts->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing ObjectFrequencyPlanningStatus to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing ObjectFrequencyPlanningStatus to dds";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
+10
-11
@@ -75,10 +75,9 @@ void checkHierarchy(const std::vector<AudioVideoManagement::AvMenuEntry> &entrie
|
||||
namespace AudioVideoManagement
|
||||
{
|
||||
|
||||
ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
Q_ASSERT(dts);
|
||||
Q_ASSERT(db);
|
||||
}
|
||||
@@ -127,10 +126,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove()
|
||||
{
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
INFO_LOG() << "menuEntries.size(): " << m_data.menuEntries().size();
|
||||
INFO_LOG(m_logger) << "menuEntries.size(): " << m_data.menuEntries().size();
|
||||
for (const AudioVideoManagement::AvMenuEntry &me : m_data.menuEntries())
|
||||
{
|
||||
INFO_LOG() << "Remove entries with id/parentId: " << me.id();
|
||||
INFO_LOG(m_logger) << "Remove entries with id/parentId: " << me.id();
|
||||
// no recursion needed, only 2 levels allowed
|
||||
if (me.isGroup())
|
||||
if (!m_db->removeAvmMenuStructByParentId(me.id()))
|
||||
@@ -151,10 +150,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove()
|
||||
void ObjectMenuStruct::onPublishData()
|
||||
{
|
||||
|
||||
INFO_LOG() << "Publish MenuStruct-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish MenuStruct-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_dts->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing MenuStruct-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing MenuStruct-data to dds";
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +197,7 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
|
||||
if (ret.error())
|
||||
return ret;
|
||||
|
||||
DEBUG_LOG() << "old entries: " << m_data;
|
||||
DEBUG_LOG(m_logger) << "old entries: " << m_data;
|
||||
for (const AvMenuEntry &me : oldEntries)
|
||||
{
|
||||
// new entries - ignore
|
||||
@@ -208,14 +207,14 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat
|
||||
auto found = std::find_if(newEntries.begin(), newEntries.end(), [&me] (const AvMenuEntry &newEntry) { return me.id() == newEntry.id(); });
|
||||
if (found == newEntries.end())
|
||||
{
|
||||
DEBUG_LOG() << "Menu Entry with id not found - was removed: " << me.id();
|
||||
DEBUG_LOG(m_logger) << "Menu Entry with id not found - was removed: " << me.id();
|
||||
m_db->removeAvmMenuStruct(me.id());
|
||||
}
|
||||
}
|
||||
|
||||
m_data.menuEntries(newEntries);
|
||||
HandlerMenuStruct::sortEntries(m_data);
|
||||
DEBUG_LOG() << "new entries: " << m_data;
|
||||
DEBUG_LOG(m_logger) << "new entries: " << m_data;
|
||||
|
||||
trans.commit();
|
||||
return Core::FunctionReplyObject(m_data.id());
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
long getId() const { return m_data.id(); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onPublishData();
|
||||
|
||||
Core::FunctionReplyObject insertUpdateDb(const MenuStruct &data);
|
||||
@@ -59,6 +60,7 @@ private:
|
||||
std::vector<AvMenuEntry> &contToAdd);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
Interface::Dts *m_dts;
|
||||
DatabaseInterface *m_db;
|
||||
MenuStruct m_data;
|
||||
|
||||
+8
-9
@@ -14,10 +14,9 @@ namespace AudioVideoManagement
|
||||
{
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
ObjectVideoReceiver::ObjectVideoReceiver(Interface::Dts *dts,
|
||||
DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
@@ -38,7 +37,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmVideoReceiver-data into database"));
|
||||
|
||||
m_data.id(dbData.id);
|
||||
DEBUG_LOG() << "New Id: " << m_data.id();
|
||||
DEBUG_LOG(m_logger) << "New Id: " << m_data.id();
|
||||
}
|
||||
|
||||
// Publish Data via DTS
|
||||
@@ -51,7 +50,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver
|
||||
Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver &data)
|
||||
{
|
||||
m_data = data;
|
||||
DEBUG_LOG() << "ObjectVideoReceiver::updateObject id=" << data.id()
|
||||
DEBUG_LOG(m_logger) << "ObjectVideoReceiver::updateObject id=" << data.id()
|
||||
<< " isActive=" << data.isActive()
|
||||
<< " hostName=" << data.hostName()
|
||||
<< " isLocked=" << data.isLocked();
|
||||
@@ -62,7 +61,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoReceiver2 into database"));
|
||||
|
||||
|
||||
DEBUG_LOG() << "Data changed for VideoReceiver Id: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for VideoReceiver Id: " << data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -85,10 +84,10 @@ Core::FunctionReplyObject ObjectVideoReceiver::removeObject()
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
void ObjectVideoReceiver::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_dts->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing MvsVideoReceiver-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing MvsVideoReceiver-data to dds";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
+6
-7
@@ -13,10 +13,9 @@ namespace AudioVideoManagement
|
||||
{
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
ObjectVideoTeam::ObjectVideoTeam(Interface::Dts *dts,
|
||||
DatabaseInterface *db)
|
||||
: m_dts(dts)
|
||||
, m_db(db)
|
||||
{
|
||||
DatabaseInterface *db) : m_dts(dts)
|
||||
, m_db(db),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
@@ -49,7 +48,7 @@ Core::FunctionReplyObject ObjectVideoTeam::updateObject(const VideoTeam &data)
|
||||
if (!m_db->update(dbData))
|
||||
return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database"));
|
||||
|
||||
DEBUG_LOG() << "Data changed for VideoTeam Id: " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << data.id();
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -59,10 +58,10 @@ Core::FunctionReplyObject ObjectVideoTeam::updateObject(const VideoTeam &data)
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
void ObjectVideoTeam::onPublishData()
|
||||
{
|
||||
INFO_LOG() << "Publish AvmVideoTeam-data to dds (" << m_data.id() << ") ...";
|
||||
INFO_LOG(m_logger) << "Publish AvmVideoTeam-data to dds (" << m_data.id() << ") ...";
|
||||
|
||||
if (!m_dts->publish(m_data))
|
||||
ERROR_LOG() << "Error publishing AvmVideoTeam-data to dds";
|
||||
ERROR_LOG(m_logger) << "Error publishing AvmVideoTeam-data to dds";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
Database::AvmDeviceConfig deviceConfig = toDeviceConfig(config);
|
||||
|
||||
if (!m_db->insert(deviceConfig))
|
||||
ERROR_LOG() << "Error while inserting device config into database";
|
||||
ERROR_LOG(m_logger) << "Error while inserting device config into database";
|
||||
|
||||
m_cache.insert(config.id(), deviceConfig);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
deviceConfig.id = oldDeviceConfig.id;
|
||||
|
||||
if (!m_db->update(deviceConfig))
|
||||
ERROR_LOG() << "Error while updating device config";
|
||||
ERROR_LOG(m_logger) << "Error while updating device config";
|
||||
|
||||
m_cache[config.id()] = deviceConfig;
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
Q_ASSERT(found != m_cache.end());
|
||||
|
||||
if (!m_db->removeAvmDeviceConfig(found->id))
|
||||
ERROR_LOG() << "Error while removing device config";
|
||||
ERROR_LOG(m_logger) << "Error while removing device config";
|
||||
|
||||
m_cache.erase(found);
|
||||
emit m_handler->avDbReloadNeeded();
|
||||
@@ -196,7 +196,7 @@ bool TvcHandler::init()
|
||||
|
||||
if (!m_db->select(m_channels))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting tetra channels from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting tetra channels from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ bool TvcHandler::init()
|
||||
|
||||
if (!m_db->select(tvcConfigs))
|
||||
{
|
||||
ERROR_LOG() << "Error while selecting TVC configs from db";
|
||||
ERROR_LOG(m_logger) << "Error while selecting TVC configs from db";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -232,23 +232,23 @@ const TvcConfig &TvcHandler::config(int32_t id) const
|
||||
void TvcHandler::onModifyTvcConfigRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ModifyTvcConfigRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onModifyTvcConfigRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onModifyTvcConfigRequest: " << request;
|
||||
Q_ASSERT(request.id() >= 0);
|
||||
auto ret = request.id() > 0 ? modifyTvcConfig(request) : createTvcConfig(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyTvcConfigReply(cookie, ret);
|
||||
}
|
||||
|
||||
void TvcHandler::onRemoveTvcConfigRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onRemoveTvcConfigRequest" << request;
|
||||
DEBUG_LOG(m_logger) << "onRemoveTvcConfigRequest" << request;
|
||||
|
||||
Core::FunctionReplyObject rep = removeTvcConfig(request);
|
||||
|
||||
if (rep.error())
|
||||
WARNING_LOG() << rep.translated();
|
||||
WARNING_LOG(m_logger) << rep.translated();
|
||||
|
||||
m_fts->removeTvcConfigReply(cookie, rep);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ void TvcHandler::onDbDeleteAvmTvcConfig(const QVariant &id)
|
||||
if (!m_cache.contains(configId))
|
||||
return; // the notification was a result of our own removal of the entry
|
||||
|
||||
DEBUG_LOG() << "DB deleted AvmTvcConfig with id: " << configId;
|
||||
DEBUG_LOG(m_logger) << "DB deleted AvmTvcConfig with id: " << configId;
|
||||
|
||||
removeTvcConfig(Core::RemoveElementRequest(configId));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ void VdComm::vdSetScript(const QString &scriptName, AvaStreamType typ, int fileS
|
||||
|
||||
static const QString cmd = QStringLiteral(R"(VDSetScript "%1" %2 %3 "%4" "%5" "%6")");
|
||||
TRACE_LOG(m_loggerIO) << "New Export Script: '" << cmd << "'";
|
||||
TRACE_LOG() << "New Export Script: '" << cmd << "'";
|
||||
TRACE_LOG(m_logger) << "New Export Script: '" << cmd << "'";
|
||||
|
||||
m_avSocket.send(cmd.arg(scriptName).arg(static_cast<int>(typ)).arg(QString::number(fileSplitting), streamList.join(QLatin1Char('\n')),
|
||||
exportedDirBaseName, absolutePath).toUtf8());
|
||||
@@ -137,7 +137,7 @@ void VdComm::parseResponse(const QByteArray &line)
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_LOG() << "Response not implemented: " << line;
|
||||
DEBUG_LOG(m_logger) << "Response not implemented: " << line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ void VdControl::keepAlive()
|
||||
void VdControl::onConnected()
|
||||
{
|
||||
m_connected = true;
|
||||
DEBUG_LOG() << "connected";
|
||||
DEBUG_LOG(m_logger) << "connected";
|
||||
}
|
||||
|
||||
void VdControl::onDisconnected()
|
||||
{
|
||||
m_connected = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
m_queue.flush();
|
||||
}
|
||||
|
||||
@@ -73,12 +73,12 @@ void VdControl::onTimeout()
|
||||
ICommand *cmd = m_queue.currentCommand();
|
||||
if (cmd->canTimeout())
|
||||
{
|
||||
INFO_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
INFO_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
m_queue.done();
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR_LOG() << "command timed out";
|
||||
ERROR_LOG(m_logger) << "command timed out";
|
||||
failed(cmd);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void VdControl::queue(ICommand *cmd, LtsUtils::IConnection *connection)
|
||||
|
||||
if (!m_connected)
|
||||
{
|
||||
DEBUG_LOG() << "not connected -> dropping command";
|
||||
DEBUG_LOG(m_logger) << "not connected -> dropping command";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void VdControl::done(AvaCommands::VdSetScript *cmd)
|
||||
|
||||
void VdControl::failed(ICommand *cmd)
|
||||
{
|
||||
ERROR_LOG() << "command '" << cmd->debug() << "' failed";
|
||||
ERROR_LOG(m_logger) << "command '" << cmd->debug() << "' failed";
|
||||
Q_ASSERT(cmd == m_queue.currentCommand());
|
||||
m_queue.flush();
|
||||
m_comm->forceDisconnect();
|
||||
|
||||
@@ -36,7 +36,7 @@ void VdSession::onConnected()
|
||||
m_established = true;
|
||||
if (m_keepAliveEnabled)
|
||||
m_keepAliveTimer.start();
|
||||
DEBUG_LOG() << "session established";
|
||||
DEBUG_LOG(m_logger) << "session established";
|
||||
emit sessionEstablished();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void VdSession::onDisconnected()
|
||||
{
|
||||
m_keepAliveTimer.stop();
|
||||
m_established = false;
|
||||
DEBUG_LOG() << "disconnected";
|
||||
DEBUG_LOG(m_logger) << "disconnected";
|
||||
emit disconnected();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user