1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-24 00:35:14 +03:00

DebugOutput buffer increased and overflow message only printed once.

This commit is contained in:
Damjan Adamic 2017-02-16 10:21:18 +01:00
parent aecd7d15f1
commit 0e97d30363
2 changed files with 8 additions and 3 deletions

View file

@ -32,7 +32,7 @@
extern AppData g; // ensure what "g" means
DebugOutput * traceCallbackInstance = 0;
const int DebugOutput::m_dataBufferMaxSize = 100; // lines of text (this is not the display buffer)
const int DebugOutput::m_dataBufferMaxSize = 500; // lines of text (this is not the display buffer)
const int DebugOutput::m_dataPrintFreqDefault = 10; // ms
const quint16 DebugOutput::m_savedViewStateVersion = 1;
@ -53,7 +53,8 @@ DebugOutput::DebugOutput(QWidget * parent, SimulatorInterface *simulator):
m_radioProfileId(g.sessionId()),
m_dataPrintFreq(m_dataPrintFreqDefault),
m_running(false),
m_filterExclude(true)
m_filterExclude(true),
overflowReported(false)
{
ui->setupUi(this);
@ -178,7 +179,10 @@ void DebugOutput::traceCallback(const char * text)
m_dataBuffer.append(text);
if (m_dataBuffer.size() > m_dataBufferMaxSize) {
m_dataBuffer.removeFirst();
qDebug() << __FILE__ << __LINE__ << "Line buffer overflow! size >" << m_dataBufferMaxSize;
if (!overflowReported) {
overflowReported = true;
qDebug() << __FILE__ << __LINE__ << "Line buffer overflow! size >" << m_dataBufferMaxSize;
}
}
m_mtxDataBuffer.unlock();
}