Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+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
|
||||
|
||||
Reference in new issue
Block a user