ola logging now works.
Debug level
This commit is contained in:
parent
1dd20c9b05
commit
5612d10711
2 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,11 @@ olaThread::olaThread(QObject *parent)
|
||||||
Q_CHECK_PTR(m_clientWrapper);
|
Q_CHECK_PTR(m_clientWrapper);
|
||||||
if (!m_clientWrapper->Setup()) { qErrnoWarning("olaThread::olaStart| Failed Setup() in Client Wrapper"); }
|
if (!m_clientWrapper->Setup()) { qErrnoWarning("olaThread::olaStart| Failed Setup() in Client Wrapper"); }
|
||||||
m_client = m_clientWrapper->GetClient();
|
m_client = m_clientWrapper->GetClient();
|
||||||
ola::InitLogging(ola::OLA_LOG_INFO , ola::OLA_LOG_STDERR);
|
if (ola::InitLogging(ola::OLA_LOG_DEBUG , ola::OLA_LOG_STDERR)) {
|
||||||
|
qDebug() << "Ola logging debug working";
|
||||||
|
} else {
|
||||||
|
qWarning() << "Can not init ola logging";
|
||||||
|
}
|
||||||
m_client->SetDMXCallback(ola::NewCallback(this, &olaThread::NewDmx));
|
m_client->SetDMXCallback(ola::NewCallback(this, &olaThread::NewDmx));
|
||||||
m_clientWrapper->GetSelectServer()->RegisterRepeatingTimeout(4000, ola::NewCallback(this, &olaThread::CheckDataLoss));
|
m_clientWrapper->GetSelectServer()->RegisterRepeatingTimeout(4000, ola::NewCallback(this, &olaThread::CheckDataLoss));
|
||||||
// qDebug() << "Init olaThread";
|
// qDebug() << "Init olaThread";
|
||||||
|
@ -101,7 +105,7 @@ bool olaThread::CheckDataLoss() {
|
||||||
timersub(&now, &m_last_data, &diff);
|
timersub(&now, &m_last_data, &diff);
|
||||||
if (diff.tv_sec > 4 || (diff.tv_sec == 4 && diff.tv_usec > 4000000)) {
|
if (diff.tv_sec > 4 || (diff.tv_sec == 4 && diff.tv_usec > 4000000)) {
|
||||||
// loss of data
|
// loss of data
|
||||||
// qDebug()<< "olaThread| Can not read one or several universes";
|
qDebug()<< "olaThread| Can not read one or several universes";
|
||||||
emit toTerminal("olaThread: Can not read one universe");
|
emit toTerminal("olaThread: Can not read one universe");
|
||||||
// return false; // Retorna false para deshabilitar el callback
|
// return false; // Retorna false para deshabilitar el callback
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,4 +96,6 @@ signals:
|
||||||
void layerReceived(int i);
|
void layerReceived(int i);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
using namespace ola;
|
||||||
|
|
||||||
#endif // OLATHREAD_H
|
#endif // OLATHREAD_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue