1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-05-29 05:22:25 -04:00

UDPSink plugin: GUI fixes

This commit is contained in:
f4exb 2017-08-15 00:20:04 +02:00
parent 73d680c356
commit a89e34255b
3 changed files with 41 additions and 7 deletions

View File

@ -29,7 +29,7 @@
#include "ui_udpsrcgui.h" #include "ui_udpsrcgui.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "../../channelrx/udpsrc/udpsrc.h" #include "udpsrc.h"
const QString UDPSrcGUI::m_channelID = "sdrangel.channel.udpsrc"; const QString UDPSrcGUI::m_channelID = "sdrangel.channel.udpsrc";

View File

@ -91,6 +91,8 @@ QByteArray UDPSinkGUI::serialize() const
s.writeString(9, m_udpAddress); s.writeString(9, m_udpAddress);
s.writeS32(10, (qint32)m_volume); s.writeS32(10, (qint32)m_volume);
s.writeS32(11, m_fmDeviation); s.writeS32(11, m_fmDeviation);
s.writeU32(12, m_channelMarker.getColor().rgb());
s.writeString(13, m_channelMarker.getTitle());
return s.final(); return s.final();
} }
@ -109,6 +111,7 @@ bool UDPSinkGUI::deserialize(const QByteArray& data)
QByteArray bytetmp; QByteArray bytetmp;
QString strtmp; QString strtmp;
qint32 s32tmp; qint32 s32tmp;
quint32 u32tmp;
Real realtmp; Real realtmp;
blockApplySettings(true); blockApplySettings(true);
@ -118,6 +121,7 @@ bool UDPSinkGUI::deserialize(const QByteArray& data)
restoreState(bytetmp); restoreState(bytetmp);
d.readS32(2, &s32tmp, 0); d.readS32(2, &s32tmp, 0);
m_channelMarker.setCenterFrequency(s32tmp); m_channelMarker.setCenterFrequency(s32tmp);
d.readS32(3, &s32tmp, UDPSink::FormatS16LE); d.readS32(3, &s32tmp, UDPSink::FormatS16LE);
switch(s32tmp) { switch(s32tmp) {
case UDPSink::FormatS16LE: case UDPSink::FormatS16LE:
@ -165,6 +169,12 @@ bool UDPSinkGUI::deserialize(const QByteArray& data)
d.readS32(11, &s32tmp, 2500); d.readS32(11, &s32tmp, 2500);
ui->fmDeviation->setText(QString("%1").arg(s32tmp)); ui->fmDeviation->setText(QString("%1").arg(s32tmp));
d.readU32(12, &u32tmp, Qt::green);
m_channelMarker.setColor(u32tmp);
d.readString(13, &strtmp, "UDP Sample Sink");
m_channelMarker.setTitle(strtmp);
this->setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(false); blockApplySettings(false);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
@ -236,6 +246,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget*
m_channelMarker.setBandwidth(16000); m_channelMarker.setBandwidth(16000);
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
m_channelMarker.setColor(Qt::green); m_channelMarker.setColor(Qt::green);
m_channelMarker.setTitle("UDP Sample Sink");
m_channelMarker.setVisible(true); m_channelMarker.setVisible(true);
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
@ -244,6 +255,8 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget*
m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addChannelMarker(&m_channelMarker);
m_deviceAPI->addRollupWidget(this); m_deviceAPI->addRollupWidget(this);
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
applySettings(); applySettings();
connect(m_udpSink->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); connect(m_udpSink->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));

View File

@ -29,7 +29,13 @@
</font> </font>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>UDP Sample Source</string> <string>UDP Sample Sink</string>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="statusTip">
<string>UDP Sample Sink</string>
</property> </property>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="geometry"> <property name="geometry">
@ -113,6 +119,12 @@
<layout class="QHBoxLayout" name="ChannelPowerLayout"> <layout class="QHBoxLayout" name="ChannelPowerLayout">
<item> <item>
<widget class="QLabel" name="channelPower"> <widget class="QLabel" name="channelPower">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Channel power</string> <string>Channel power</string>
</property> </property>
@ -120,16 +132,25 @@
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="text"> <property name="text">
<string>0.0</string> <string>-100.0 dB</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="channelPowerUnits"> <spacer name="horizontalSpacer">
<property name="text"> <property name="orientation">
<string> dB</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="channelMute"> <widget class="QToolButton" name="channelMute">