mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-19 06:41:47 -05:00
SDRdaemon plugin: reactivate address setting in GUI. Put in place a stram locked status.
This commit is contained in:
parent
48d858ce5d
commit
2d018f7968
@ -27,6 +27,7 @@ const int SDRdaemonBuffer::m_iqSampleSize = 2 * m_sampleSize;
|
|||||||
SDRdaemonBuffer::SDRdaemonBuffer(uint32_t rateDivider) :
|
SDRdaemonBuffer::SDRdaemonBuffer(uint32_t rateDivider) :
|
||||||
m_rateDivider(rateDivider),
|
m_rateDivider(rateDivider),
|
||||||
m_sync(false),
|
m_sync(false),
|
||||||
|
m_syncLock(false),
|
||||||
m_lz4(false),
|
m_lz4(false),
|
||||||
m_inCount(0),
|
m_inCount(0),
|
||||||
m_lz4InBuffer(0),
|
m_lz4InBuffer(0),
|
||||||
@ -74,6 +75,18 @@ bool SDRdaemonBuffer::readMeta(char *array, uint32_t length)
|
|||||||
|
|
||||||
if (m_crc64.calculate_crc((uint8_t *)array, sizeof(MetaData) - 8) == metaData->m_crc)
|
if (m_crc64.calculate_crc((uint8_t *)array, sizeof(MetaData) - 8) == metaData->m_crc)
|
||||||
{
|
{
|
||||||
|
// sync condition:
|
||||||
|
if (m_currentMeta.m_blockSize > 0)
|
||||||
|
{
|
||||||
|
uint32_t nbBlocks = m_currentMeta.m_nbBytes / m_currentMeta.m_blockSize;
|
||||||
|
m_syncLock = nbBlocks + (m_lz4 ? 2 : 1) == m_nbBlocks;
|
||||||
|
//qDebug("SDRdaemonBuffer::readMeta: m_nbBlocks: %d:%d %s", nbBlocks, m_nbBlocks, (m_syncLock ? "locked" : "unlocked"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_syncLock = false;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy((void *) &m_dataCRC, (const void *) &array[sizeof(MetaData)], 8);
|
memcpy((void *) &m_dataCRC, (const void *) &array[sizeof(MetaData)], 8);
|
||||||
m_nbBlocks = 0;
|
m_nbBlocks = 0;
|
||||||
m_inCount = 0;
|
m_inCount = 0;
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
const MetaData& getCurrentMeta() const { return m_currentMeta; }
|
const MetaData& getCurrentMeta() const { return m_currentMeta; }
|
||||||
void updateBlockCounts(uint32_t nbBytesReceived);
|
void updateBlockCounts(uint32_t nbBytesReceived);
|
||||||
bool isSync() const { return m_sync; }
|
bool isSync() const { return m_sync; }
|
||||||
|
bool isSyncLocked() const { return m_syncLock; }
|
||||||
|
|
||||||
static const int m_udpPayloadSize;
|
static const int m_udpPayloadSize;
|
||||||
static const int m_sampleSize;
|
static const int m_sampleSize;
|
||||||
@ -83,7 +84,8 @@ private:
|
|||||||
void printMeta(MetaData *metaData);
|
void printMeta(MetaData *metaData);
|
||||||
|
|
||||||
uint32_t m_rateDivider; //!< Number of times per seconds the samples are fetched
|
uint32_t m_rateDivider; //!< Number of times per seconds the samples are fetched
|
||||||
bool m_sync; //!< Meta data acquired (Stream synchronized)
|
bool m_sync; //!< Meta data acquired
|
||||||
|
bool m_syncLock; //!< Meta data expected (Stream synchronized)
|
||||||
bool m_lz4; //!< Stream is compressed with LZ4
|
bool m_lz4; //!< Stream is compressed with LZ4
|
||||||
MetaData m_currentMeta; //!< Stored current meta data
|
MetaData m_currentMeta; //!< Stored current meta data
|
||||||
CRC64 m_crc64; //!< CRC64 calculator
|
CRC64 m_crc64; //!< CRC64 calculator
|
||||||
|
@ -235,7 +235,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="address">
|
<widget class="QLineEdit" name="address">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -261,7 +261,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="port">
|
<widget class="QLineEdit" name="port">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -280,7 +280,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="applyButton">
|
<widget class="QPushButton" name="applyButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -289,7 +289,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>OK</string>
|
<string>Set</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user