1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 18:15:45 -05:00

SDRdaemonFEC plugin: improve stats on GUI

This commit is contained in:
Edouard Griffiths 2016-07-27 18:49:17 +02:00
parent 286ea81470
commit aa68c907fa
7 changed files with 108 additions and 32 deletions

View File

@ -33,6 +33,7 @@ SDRdaemonFECBuffer::SDRdaemonFECBuffer(uint32_t throttlems) :
m_decoderIndexHead(nbDecoderSlots/2),
m_curNbBlocks(0),
m_minNbBlocks(256),
m_minOriginalBlocks(128),
m_curNbRecovery(0),
m_maxNbRecovery(0),
m_framesDecoded(true),
@ -89,8 +90,10 @@ void SDRdaemonFECBuffer::initDecodeSlot(int slotIndex)
// collect stats before voiding the slot
m_curNbBlocks = m_decoderSlots[slotIndex].m_blockCount;
m_curOriginalBlocks = m_decoderSlots[slotIndex].m_originalCount;
m_curNbRecovery = m_decoderSlots[slotIndex].m_recoveryCount;
m_avgNbBlocks(m_curNbBlocks);
m_avgOrigBlocks(m_curOriginalBlocks);
m_avgNbRecovery(m_curNbRecovery);
m_framesDecoded = m_framesDecoded && m_decoderSlots[slotIndex].m_decoded;
@ -98,6 +101,10 @@ void SDRdaemonFECBuffer::initDecodeSlot(int slotIndex)
m_minNbBlocks = m_curNbBlocks;
}
if (m_curOriginalBlocks < m_minOriginalBlocks) {
m_minOriginalBlocks = m_curOriginalBlocks;
}
if (m_curNbRecovery > m_maxNbRecovery) {
m_maxNbRecovery = m_curNbRecovery;
}

View File

@ -100,8 +100,10 @@ public:
// stats
int getCurNbBlocks() const { return m_curNbBlocks; }
int getCurOriginalBlocks() const { return m_curOriginalBlocks; }
int getCurNbRecovery() const { return m_curNbRecovery; }
float getAvgNbBlocks() const { return m_avgNbBlocks; }
float getAvgOriginalBlocks() const { return m_avgOrigBlocks; }
float getAvgNbRecovery() const { return m_avgNbRecovery; }
int getMinNbBlocks()
@ -111,6 +113,13 @@ public:
return minNbBlocks;
}
int getMinOriginalBlocks()
{
int minOriginalBlocks = m_minOriginalBlocks;
m_minOriginalBlocks = 128;
return minOriginalBlocks;
}
int getMaxNbRecovery()
{
int maxNbRecovery = m_maxNbRecovery;
@ -183,9 +192,12 @@ private:
int m_frameHead; //!< index of the current head frame sent
int m_curNbBlocks; //!< (stats) instantaneous number of blocks received
int m_minNbBlocks; //!< (stats) minimum number of blocks received since last poll
int m_curOriginalBlocks; //!< (stats) instantanous number of original blocks received
int m_minOriginalBlocks; //!< (stats) minimum number of original blocks received since last poll
int m_curNbRecovery; //!< (stats) instantaneous number of recovery blocks used
int m_maxNbRecovery; //!< (stats) maximum number of recovery blocks used since last poll
MovingAverage<int, int, 10> m_avgNbBlocks; //!< (stats) average number of blocks received
MovingAverage<int, int, 10> m_avgOrigBlocks; //!< (stats) average number of original blocks received
MovingAverage<int, int, 10> m_avgNbRecovery; //!< (stats) average number of recovery blocks used
bool m_framesDecoded; //!< [stats] true if all frames were decoded since last poll
int m_readIndex; //!< current byte read index in frames buffer

View File

@ -291,8 +291,10 @@ bool SDRdaemonFECGui::handleMessage(const Message& message)
m_bufferLengthInSecs = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getBufferLengthInSecs();
m_bufferGauge = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getBufferGauge();
m_minNbBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMinNbBlocks();
m_maxNbRecovery = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getmAXNbRecovery();
m_minNbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMinNbOriginalBlocks();
m_maxNbRecovery = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getMaxNbRecovery();
m_avgNbBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbBlocks();
m_avgNbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbOriginalBlocks();
m_avgNbRecovery = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getAvgNbRecovery();
m_nbOriginalBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getNbOriginalBlocksPerFrame();
m_nbFECBlocks = ((SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming&)message).getNbFECBlocksPerFrame();
@ -625,8 +627,11 @@ void SDRdaemonFECGui::updateWithStreamTime()
s = QString::number(m_avgNbBlocks, 'f', 1);
ui->avgNbBlocksText->setText(tr("%1").arg(s));
s = QString::number(m_minNbOriginalBlocks, 'f', 0);
ui->minNbOriginalText->setText(tr("%1").arg(s));
s = QString::number(m_maxNbRecovery, 'f', 0);
ui->curNbRecoveryText->setText(tr("%1").arg(s));
ui->maxNbRecoveryText->setText(tr("%1").arg(s));
s = QString::number(m_avgNbRecovery, 'f', 1);
ui->avgNbRecoveryText->setText(tr("%1").arg(s));
@ -672,4 +677,3 @@ void SDRdaemonFECGui::tick()
m_sampleSource->getInputMessageQueue()->push(message);
}
}

View File

@ -68,8 +68,10 @@ private:
float m_bufferLengthInSecs;
int32_t m_bufferGauge;
int m_minNbBlocks;
int m_minNbOriginalBlocks;
int m_maxNbRecovery;
float m_avgNbBlocks;
float m_avgNbOriginalBlocks;
float m_avgNbRecovery;
int m_nbOriginalBlocks;
int m_nbFECBlocks;

View File

@ -29,7 +29,16 @@
<property name="spacing">
<number>3</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
@ -339,13 +348,6 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="avgNbBlocksText">
<property name="minimumSize">
@ -373,7 +375,33 @@
</widget>
</item>
<item>
<widget class="QLabel" name="curNbRecoveryText">
<widget class="QLabel" name="minNbOriginalText">
<property name="minimumSize">
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Minimum number of original blocks retrieved per frame</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="maxNbRecoveryText">
<property name="minimumSize">
<size>
<width>24</width>
@ -391,13 +419,6 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="avgNbRecoveryText">
<property name="minimumSize">
@ -906,6 +927,23 @@
</customwidgets>
<resources>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
<include location="../../../sdrbase/resources/res.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -170,8 +170,10 @@ public:
float getBufferLengthInSecs() const { return m_bufferLenSec; }
int32_t getBufferGauge() const { return m_bufferGauge; }
int getMinNbBlocks() const { return m_minNbBlocks; }
int getmAXNbRecovery() const { return m_maxNbRecovery; }
int getMinNbOriginalBlocks() const { return m_minNbOriginalBlocks; }
int getMaxNbRecovery() const { return m_maxNbRecovery; }
float getAvgNbBlocks() const { return m_avgNbBlocks; }
float getAvgNbOriginalBlocks() const { return m_avgNbOriginalBlocks; }
float getAvgNbRecovery() const { return m_avgNbRecovery; }
int getNbOriginalBlocksPerFrame() const { return m_nbOriginalBlocksPerFrame; }
int getNbFECBlocksPerFrame() const { return m_nbFECBlocksPerFrame; }
@ -181,9 +183,11 @@ public:
float bufferLenSec,
int32_t bufferGauge,
int framesDecodingStatus,
int curNbBlocks,
int curNbRecovery,
int minNbBlocks,
int minNbOriginalBlocks,
int maxNbRecovery,
float avgNbBlocks,
float avgNbOriginalBlocks,
float avgNbRecovery,
int nbOriginalBlocksPerFrame,
int nbFECBlocksPerFrame)
@ -193,9 +197,11 @@ public:
bufferLenSec,
bufferGauge,
framesDecodingStatus,
curNbBlocks,
curNbRecovery,
minNbBlocks,
minNbOriginalBlocks,
maxNbRecovery,
avgNbBlocks,
avgNbOriginalBlocks,
avgNbRecovery,
nbOriginalBlocksPerFrame,
nbFECBlocksPerFrame);
@ -208,8 +214,10 @@ public:
float m_bufferLenSec;
int32_t m_bufferGauge;
int m_minNbBlocks;
int m_minNbOriginalBlocks;
int m_maxNbRecovery;
float m_avgNbBlocks;
float m_avgNbOriginalBlocks;
float m_avgNbRecovery;
int m_nbOriginalBlocksPerFrame;
int m_nbFECBlocksPerFrame;
@ -219,9 +227,11 @@ public:
float bufferLenSec,
int32_t bufferGauge,
int framesDecodingStatus,
int curNbBlocks,
int curNbRecovery,
int minNbBlocks,
int minNbOriginalBlocks,
int maxNbRecovery,
float avgNbBlocks,
float avgNbOriginalBlocks,
float avgNbRecovery,
int nbOriginalBlocksPerFrame,
int nbFECBlocksPerFrame) :
@ -231,9 +241,11 @@ public:
m_framesDecodingStatus(framesDecodingStatus),
m_bufferLenSec(bufferLenSec),
m_bufferGauge(bufferGauge),
m_minNbBlocks(curNbBlocks),
m_maxNbRecovery(curNbRecovery),
m_minNbBlocks(minNbBlocks),
m_minNbOriginalBlocks(minNbOriginalBlocks),
m_maxNbRecovery(maxNbRecovery),
m_avgNbBlocks(avgNbBlocks),
m_avgNbOriginalBlocks(avgNbOriginalBlocks),
m_avgNbRecovery(avgNbRecovery),
m_nbOriginalBlocksPerFrame(nbOriginalBlocksPerFrame),
m_nbFECBlocksPerFrame(nbFECBlocksPerFrame)

View File

@ -224,12 +224,13 @@ void SDRdaemonFECUDPHandler::tick()
else
{
int framesDecodingStatus;
int minNbBlocks = m_sdrDaemonBuffer.getMinNbBlocks();
int minNbBlocks = m_sdrDaemonBuffer.getMinNbBlocks();
int minNbOriginalBlocks = m_sdrDaemonBuffer.getMinOriginalBlocks();
int nbOriginalBlocks = m_sdrDaemonBuffer.getCurrentMeta().m_nbOriginalBlocks;
int nbFECblocks = m_sdrDaemonBuffer.getCurrentMeta().m_nbFECBlocks;
m_tickCount = 0;
framesDecodingStatus = (minNbBlocks < nbOriginalBlocks ? 0 : (minNbBlocks < nbOriginalBlocks + nbFECblocks ? 1 : 2));
framesDecodingStatus = (minNbOriginalBlocks == nbOriginalBlocks ? 2 : (minNbOriginalBlocks < nbOriginalBlocks - nbFECblocks ? 0 : 1));
SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming *report = SDRdaemonFECInput::MsgReportSDRdaemonFECStreamTiming::create(
m_tv_sec,
@ -238,13 +239,13 @@ void SDRdaemonFECUDPHandler::tick()
m_sdrDaemonBuffer.getBufferGauge(),
framesDecodingStatus,
minNbBlocks,
minNbOriginalBlocks,
m_sdrDaemonBuffer.getMaxNbRecovery(),
m_sdrDaemonBuffer.getAvgNbBlocks(),
m_sdrDaemonBuffer.getAvgOriginalBlocks(),
m_sdrDaemonBuffer.getAvgNbRecovery(),
nbOriginalBlocks,
nbFECblocks);
m_outputMessageQueueToGUI->push(report);
}
}