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

SDRdaemon plugin: report frame soze in UI. Reorganized UI

This commit is contained in:
f4exb 2016-02-23 18:09:20 +01:00
parent 6b368f10b6
commit 16c3e3e72f
6 changed files with 167 additions and 138 deletions

View File

@ -72,6 +72,7 @@ public:
void updateBlockCounts(uint32_t nbBytesReceived);
bool isSync() const { return m_sync; }
bool isSyncLocked() const { return m_syncLock; }
uint32_t getFrameSize() const { return m_frameSize; }
static const int m_udpPayloadSize;
static const int m_sampleSize;

View File

@ -200,6 +200,7 @@ bool SDRdaemonGui::handleMessage(const Message& message)
m_startingTimeStamp.tv_sec = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).get_tv_sec();
m_startingTimeStamp.tv_usec = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).get_tv_usec();
m_syncLocked = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getSyncLock();
m_frameSize = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getFrameSize();
updateWithStreamTime();
return true;
}
@ -308,6 +309,9 @@ void SDRdaemonGui::updateWithStreamTime()
} else {
ui->streamLocked->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
}
QString s = QString::number(m_frameSize / 1024.0, 'f', 0);
ui->frameSizeText->setText(tr("%1").arg(s));
}
void SDRdaemonGui::tick()

View File

@ -60,6 +60,7 @@ private:
quint64 m_centerFrequency;
struct timeval m_startingTimeStamp;
bool m_syncLocked;
uint32_t m_frameSize;
int m_samplesCount;
std::size_t m_tickCount;

View File

@ -2,19 +2,11 @@
<ui version="4.0">
<class>SDRdaemonGui</class>
<widget class="QWidget" name="SDRdaemonGui">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>207</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="minimumSize">
<size>
<width>360</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
@ -104,87 +96,43 @@
</layout>
</item>
<item>
<widget class="Line" name="line_freq_2">
<widget class="Line" name="line_address">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="rateTimeLayout">
<layout class="QHBoxLayout" name="gridLayout_corr">
<item>
<widget class="QLabel" name="sampleRateStreamText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
<widget class="QLabel" name="label">
<property name="text">
<string>Auto Corr</string>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="dcOffset">
<property name="toolTip">
<string>Nominal sample rate from stream data (kS/s)</string>
<string>DC Offset auto correction</string>
</property>
<property name="text">
<string>00000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>DC</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="sampleRateLine1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sampleRateText">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<widget class="ButtonSwitch" name="iqImbalance">
<property name="toolTip">
<string>Actual sample rate (kS/s)</string>
<string>IQ Imbalance auto correction</string>
</property>
<property name="text">
<string>0000.000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>IQ</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="sampleRateLine2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="skewRateText">
<property name="minimumSize">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sample rate skew from stream nominal rate (%)</string>
</property>
<property name="text">
<string>-00.00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -196,13 +144,6 @@
</property>
</spacer>
</item>
<item>
<widget class="Line" name="absTimeLine">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="absTimeText">
<property name="enabled">
@ -219,14 +160,14 @@
</layout>
</item>
<item>
<widget class="Line" name="line_rateTime">
<widget class="Line" name="line_freq_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="statusLayout">
<layout class="QHBoxLayout" name="streamLayout">
<item>
<widget class="QToolButton" name="streamLocked">
<property name="enabled">
@ -264,12 +205,114 @@
</widget>
</item>
<item>
<widget class="Line" name="lineLocked">
<widget class="Line" name="lineStream1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sampleRateStreamText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Nominal sample rate from stream data (kS/s)</string>
</property>
<property name="text">
<string>00000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="sampleRateText">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Actual sample rate (kS/s)</string>
</property>
<property name="text">
<string>0000.000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="skewRateText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Sample rate skew from stream nominal rate (%)</string>
</property>
<property name="text">
<string>-00.00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineStream4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_rateTime">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="lz4Layout">
<item>
<widget class="QToolButton" name="toolButton">
<property name="enabled">
@ -291,7 +334,7 @@
<widget class="QLabel" name="compressionRatioText">
<property name="minimumSize">
<size>
<width>40</width>
<width>50</width>
<height>0</height>
</size>
</property>
@ -306,6 +349,13 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineLz41">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dataCRCOKText">
<property name="minimumSize">
@ -325,6 +375,13 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineLz42">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lz4DecodesOKText">
<property name="minimumSize">
@ -345,58 +402,14 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<widget class="Line" name="lineLz43">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_address">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="gridLayout_corr">
<item>
<widget class="QLabel" name="corrLabel">
<property name="text">
<string>Auto corr</string>
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="dcOffset">
<property name="toolTip">
<string>DC Offset auto correction</string>
</property>
<property name="text">
<string>DC Offset</string>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="iqImbalance">
<property name="toolTip">
<string>IQ Imbalance auto correction</string>
</property>
<property name="text">
<string>IQ Imbalance</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -433,7 +446,7 @@
</property>
<property name="minimumSize">
<size>
<width>120</width>
<width>150</width>
<height>0</height>
</size>
</property>
@ -457,10 +470,10 @@
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<property name="maximumSize">
<size>
<width>50</width>
<height>0</height>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
@ -469,6 +482,9 @@
<property name="text">
<string>9090</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>

View File

@ -169,28 +169,34 @@ public:
uint32_t get_tv_sec() const { return m_tv_sec; }
uint32_t get_tv_usec() const { return m_tv_usec; }
bool getSyncLock() const { return m_syncLock; }
uint32_t getFrameSize() const { return m_frameSize; }
static MsgReportSDRdaemonStreamTiming* create(uint32_t tv_sec,
uint32_t tv_usec,
bool syncLock)
bool syncLock,
uint32_t frameSize)
{
return new MsgReportSDRdaemonStreamTiming(tv_sec,
tv_usec,
syncLock);
syncLock,
frameSize);
}
protected:
uint32_t m_tv_sec;
uint32_t m_tv_usec;
bool m_syncLock;
uint32_t m_frameSize;
MsgReportSDRdaemonStreamTiming(uint32_t tv_sec,
uint32_t tv_usec,
bool syncLock) :
bool syncLock,
uint32_t frameSize) :
Message(),
m_tv_sec(tv_sec),
m_tv_usec(tv_usec),
m_syncLock(syncLock)
m_syncLock(syncLock),
m_frameSize(frameSize)
{ }
};

View File

@ -209,7 +209,8 @@ void SDRdaemonUDPHandler::tick()
SDRdaemonInput::MsgReportSDRdaemonStreamTiming *report = SDRdaemonInput::MsgReportSDRdaemonStreamTiming::create(
m_tv_sec,
m_tv_usec,
m_sdrDaemonBuffer.isSyncLocked());
m_sdrDaemonBuffer.isSyncLocked(),
m_sdrDaemonBuffer.getFrameSize());
m_outputMessageQueueToGUI->push(report);
}
}