mirror of https://github.com/f4exb/sdrangel.git
SDRdaemon plugin: report LZ4 compression ratio
This commit is contained in:
parent
23750b10f6
commit
e5f2a49835
|
@ -74,6 +74,7 @@ public:
|
||||||
bool isSyncLocked() const { return m_syncLock; }
|
bool isSyncLocked() const { return m_syncLock; }
|
||||||
uint32_t getFrameSize() const { return m_frameSize; }
|
uint32_t getFrameSize() const { return m_frameSize; }
|
||||||
bool isLz4Compressed() const { return m_lz4; }
|
bool isLz4Compressed() const { return m_lz4; }
|
||||||
|
float getCompressionRatio() const { return (m_frameSize ? (float) m_lz4InSize / (float) m_frameSize : 1.0); }
|
||||||
|
|
||||||
static const int m_udpPayloadSize;
|
static const int m_udpPayloadSize;
|
||||||
static const int m_sampleSize;
|
static const int m_sampleSize;
|
||||||
|
|
|
@ -202,6 +202,7 @@ bool SDRdaemonGui::handleMessage(const Message& message)
|
||||||
m_syncLocked = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getSyncLock();
|
m_syncLocked = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getSyncLock();
|
||||||
m_frameSize = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getFrameSize();
|
m_frameSize = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getFrameSize();
|
||||||
m_lz4 = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4Compression();
|
m_lz4 = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4Compression();
|
||||||
|
m_compressionRatio = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4Compression();
|
||||||
updateWithStreamTime();
|
updateWithStreamTime();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -319,6 +320,9 @@ void SDRdaemonGui::updateWithStreamTime()
|
||||||
} else {
|
} else {
|
||||||
ui->lz4Compressed->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
ui->lz4Compressed->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s = QString::number(m_compressionRatio, 'f', 2);
|
||||||
|
ui->compressionRatioText->setText(tr("%1").arg(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRdaemonGui::tick()
|
void SDRdaemonGui::tick()
|
||||||
|
|
|
@ -62,6 +62,7 @@ private:
|
||||||
bool m_syncLocked;
|
bool m_syncLocked;
|
||||||
uint32_t m_frameSize;
|
uint32_t m_frameSize;
|
||||||
bool m_lz4;
|
bool m_lz4;
|
||||||
|
float m_compressionRatio;
|
||||||
|
|
||||||
int m_samplesCount;
|
int m_samplesCount;
|
||||||
std::size_t m_tickCount;
|
std::size_t m_tickCount;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<widget class="QWidget" name="SDRdaemonGui">
|
<widget class="QWidget" name="SDRdaemonGui">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>360</width>
|
<width>340</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>50</width>
|
<width>80</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -176,13 +176,15 @@ public:
|
||||||
uint32_t tv_usec,
|
uint32_t tv_usec,
|
||||||
bool syncLock,
|
bool syncLock,
|
||||||
uint32_t frameSize,
|
uint32_t frameSize,
|
||||||
bool lz4)
|
bool lz4,
|
||||||
|
float compressionRatio)
|
||||||
{
|
{
|
||||||
return new MsgReportSDRdaemonStreamTiming(tv_sec,
|
return new MsgReportSDRdaemonStreamTiming(tv_sec,
|
||||||
tv_usec,
|
tv_usec,
|
||||||
syncLock,
|
syncLock,
|
||||||
frameSize,
|
frameSize,
|
||||||
lz4);
|
lz4,
|
||||||
|
compressionRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -191,18 +193,21 @@ public:
|
||||||
bool m_syncLock;
|
bool m_syncLock;
|
||||||
uint32_t m_frameSize;
|
uint32_t m_frameSize;
|
||||||
bool m_lz4;
|
bool m_lz4;
|
||||||
|
float m_compressionRatio;
|
||||||
|
|
||||||
MsgReportSDRdaemonStreamTiming(uint32_t tv_sec,
|
MsgReportSDRdaemonStreamTiming(uint32_t tv_sec,
|
||||||
uint32_t tv_usec,
|
uint32_t tv_usec,
|
||||||
bool syncLock,
|
bool syncLock,
|
||||||
uint32_t frameSize,
|
uint32_t frameSize,
|
||||||
bool lz4) :
|
bool lz4,
|
||||||
|
float compressionRatio) :
|
||||||
Message(),
|
Message(),
|
||||||
m_tv_sec(tv_sec),
|
m_tv_sec(tv_sec),
|
||||||
m_tv_usec(tv_usec),
|
m_tv_usec(tv_usec),
|
||||||
m_syncLock(syncLock),
|
m_syncLock(syncLock),
|
||||||
m_frameSize(frameSize),
|
m_frameSize(frameSize),
|
||||||
m_lz4(lz4)
|
m_lz4(lz4),
|
||||||
|
m_compressionRatio(compressionRatio)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,8 @@ void SDRdaemonUDPHandler::tick()
|
||||||
m_tv_usec,
|
m_tv_usec,
|
||||||
m_sdrDaemonBuffer.isSyncLocked(),
|
m_sdrDaemonBuffer.isSyncLocked(),
|
||||||
m_sdrDaemonBuffer.getFrameSize(),
|
m_sdrDaemonBuffer.getFrameSize(),
|
||||||
m_sdrDaemonBuffer.isLz4Compressed());
|
m_sdrDaemonBuffer.isLz4Compressed(),
|
||||||
|
m_sdrDaemonBuffer.getCompressionRatio());
|
||||||
m_outputMessageQueueToGUI->push(report);
|
m_outputMessageQueueToGUI->push(report);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue