1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05: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 "mainwindow.h"
#include "../../channelrx/udpsrc/udpsrc.h"
#include "udpsrc.h"
const QString UDPSrcGUI::m_channelID = "sdrangel.channel.udpsrc";

View File

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

View File

@ -29,7 +29,13 @@
</font>
</property>
<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>
<widget class="QWidget" name="widget" native="true">
<property name="geometry">
@ -113,6 +119,12 @@
<layout class="QHBoxLayout" name="ChannelPowerLayout">
<item>
<widget class="QLabel" name="channelPower">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Channel power</string>
</property>
@ -120,16 +132,25 @@
<enum>Qt::LeftToRight</enum>
</property>
<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>
</widget>
</item>
<item>
<widget class="QLabel" name="channelPowerUnits">
<property name="text">
<string> dB</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="channelMute">