1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

SDRdaemon plugin: Added buffer length in seconds to the GUI

This commit is contained in:
f4exb 2016-03-20 14:40:40 +01:00
parent b7a4c468fc
commit 3bebd05411
7 changed files with 33 additions and 0 deletions

View File

@ -49,6 +49,7 @@ SDRdaemonBuffer::SDRdaemonBuffer(uint32_t throttlems) :
m_lz4InBuffer(0),
m_lz4OutBuffer(0),
m_frameSize(0),
m_bufferLenSec(0.0),
m_nbLz4Decodes(0),
m_nbLz4SuccessfulDecodes(0),
m_nbLz4CRCOK(0),
@ -105,6 +106,7 @@ void SDRdaemonBuffer::updateBufferSize(uint32_t sampleRate)
{
m_rawSize = rawSize;
m_balCorrLimit = sampleRate / 50; // +/- 20 ms correction max per read
m_bufferLenSec = m_rawSize / (sampleRate * m_iqSampleSize);
if (m_rawBuffer) {
delete[] m_rawBuffer;

View File

@ -78,6 +78,7 @@ public:
float getCompressionRatio() const { return (m_frameSize > 0 ? (float) m_lz4InSize / (float) m_frameSize : 1.0); }
uint32_t getLz4DataCRCOK() const { return m_nbLastLz4CRCOK; }
uint32_t getLz4SuccessfulDecodes() const { return m_nbLastLz4SuccessfulDecodes; }
float getBufferLengthInSecs() const { return m_bufferLenSec; }
void setAutoFollowRate(bool autoFollowRate) { m_autoFollowRate = autoFollowRate; }
void setAutoCorrBuffer(bool autoCorrBuffer) { m_autoCorrBuffer = autoCorrBuffer; }
void setResetIndexes() { m_resetIndexes = true; }
@ -146,6 +147,7 @@ private:
uint8_t *m_lz4InBuffer; //!< Buffer for LZ4 compressed input
uint8_t *m_lz4OutBuffer; //!< Buffer for LZ4 uncompressed output
uint32_t m_frameSize; //!< Size in bytes of one uncompressed frame
float m_bufferLenSec; //!< Raw buffer length in seconds
uint32_t m_nbLz4Decodes;
uint32_t m_nbLz4SuccessfulDecodes;
uint32_t m_nbLz4CRCOK;

View File

@ -45,6 +45,7 @@ SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, QWidget* parent) :
m_compressionRatio(1.0),
m_nbLz4DataCRCOK(0),
m_nbLz4SuccessfulDecodes(0),
m_bufferLengthInSecs(0.0),
m_bufferGauge(-50),
m_samplesCount(0),
m_tickCount(0),
@ -233,6 +234,7 @@ bool SDRdaemonGui::handleMessage(const Message& message)
m_nbLz4DataCRCOK = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4DataCRCOK();
m_nbLz4SuccessfulDecodes = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4SuccessfulDecodes();
m_bufferLengthInSecs = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getBufferLengthInSecs();
m_bufferGauge = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getBufferGauge();
updateWithStreamTime();
@ -407,6 +409,9 @@ void SDRdaemonGui::updateWithStreamTime()
s = QString::number(m_nbLz4SuccessfulDecodes, 'f', 0);
ui->lz4DecodesOKText->setText(tr("%1").arg(s));
s = QString::number(m_bufferLengthInSecs, 'f', 1);
ui->bufferLenSecsText->setText(tr("%1").arg(s));
s = QString::number((m_bufferGauge < 0 ? -50 - m_bufferGauge : 50 - m_bufferGauge), 'f', 0);
ui->bufferRWBalanceText->setText(tr("%1").arg(s));

View File

@ -65,6 +65,7 @@ private:
float m_compressionRatio;
uint32_t m_nbLz4DataCRCOK;
uint32_t m_nbLz4SuccessfulDecodes;
float m_bufferLengthInSecs;
int32_t m_bufferGauge;
int m_samplesCount;

View File

@ -508,6 +508,22 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bufferLenSecsText">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>00.0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">

View File

@ -207,6 +207,7 @@ public:
uint32_t get_tv_usec() const { return m_tv_usec; }
bool getSyncLock() const { return m_syncLock; }
uint32_t getFrameSize() const { return m_frameSize; }
float getBufferLengthInSecs() const { return m_bufferLenSec; }
bool getLz4Compression() const { return m_lz4; }
float getLz4CompressionRatio() const { return m_compressionRatio; }
uint32_t getLz4DataCRCOK() const { return m_nbLz4CRCOK; }
@ -217,6 +218,7 @@ public:
uint32_t tv_usec,
bool syncLock,
uint32_t frameSize,
float bufferLenSec,
bool lz4,
float compressionRatio,
uint32_t nbLz4CRCOK,
@ -227,6 +229,7 @@ public:
tv_usec,
syncLock,
frameSize,
bufferLenSec,
lz4,
compressionRatio,
nbLz4CRCOK,
@ -239,6 +242,7 @@ public:
uint32_t m_tv_usec;
bool m_syncLock;
uint32_t m_frameSize;
float m_bufferLenSec;
bool m_lz4;
float m_compressionRatio;
uint32_t m_nbLz4CRCOK;
@ -249,6 +253,7 @@ public:
uint32_t tv_usec,
bool syncLock,
uint32_t frameSize,
float bufferLenSec,
bool lz4,
float compressionRatio,
uint32_t nbLz4CRCOK,
@ -259,6 +264,7 @@ public:
m_tv_usec(tv_usec),
m_syncLock(syncLock),
m_frameSize(frameSize),
m_bufferLenSec(bufferLenSec),
m_lz4(lz4),
m_compressionRatio(compressionRatio),
m_nbLz4CRCOK(nbLz4CRCOK),

View File

@ -244,6 +244,7 @@ void SDRdaemonUDPHandler::tick()
m_tv_usec,
m_sdrDaemonBuffer.isSyncLocked(),
m_sdrDaemonBuffer.getFrameSize(),
m_sdrDaemonBuffer.getBufferLengthInSecs(),
m_sdrDaemonBuffer.isLz4Compressed(),
m_sdrDaemonBuffer.getCompressionRatio(),
m_sdrDaemonBuffer.getLz4DataCRCOK(),