From 614021f9a0de7ce76dc1208fadba33dfd3cf0643 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 24 Aug 2017 02:26:47 +0200 Subject: [PATCH] Added send port to UDP parameters --- debian/changelog | 8 +++++ plugins/channelrx/demoddsd/dsddemodgui.cpp | 7 +++-- plugins/channelrx/demoddsd/dsddemodplugin.cpp | 2 +- plugins/channeltx/udpsink/udpsinkplugin.cpp | 2 +- sdrbase/dsp/channelmarker.cpp | 13 +++++++-- sdrbase/dsp/channelmarker.h | 10 +++++-- sdrbase/gui/basicchannelsettingsdialog.cpp | 16 ++++++++-- sdrbase/gui/basicchannelsettingsdialog.ui | 29 +++++++++++++++++-- sdrbase/gui/basicchannelsettingswidget.cpp | 4 +-- sdrbase/mainwindow.cpp | 4 +-- 10 files changed, 75 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index 45be1261a..7ecdd6d83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +sdrangel (3.6.1-1) unstable; urgency=medium + + * Basic channel settings dialog with title+color update and UDP parameters + * Applied to UDPSink, DSDDemod + * DSD demod: added possibility to send AF via UDP + + -- Edouard Griffiths, F4EXB Thu, 31 Aug 2017 23:14:18 +0200 + sdrangel (3.6.0-1) unstable; urgency=medium * UDPSink Tx plugin: new diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index 6f2d9a10e..ae8bba27a 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -112,7 +112,8 @@ QByteArray DSDDemodGUI::serialize() const s.writeBool(16, m_tdmaStereo); s.writeString(17, m_channelMarker.getTitle()); s.writeString(18, m_channelMarker.getUDPAddress()); - s.writeU32(19, (quint32) m_channelMarker.getUDPPort()); + s.writeU32(19, (quint32) m_channelMarker.getUDPReceivePort()); + s.writeU32(20, (quint32) m_channelMarker.getUDPSendPort()); return s.final(); } @@ -171,7 +172,9 @@ bool DSDDemodGUI::deserialize(const QByteArray& data) d.readString(18, &strtmp, "127.0.0.1"); m_channelMarker.setUDPAddress(strtmp); d.readU32(19, &u32tmp, 9999); - m_channelMarker.setUDPPort(u32tmp); + m_channelMarker.setUDPReceivePort(u32tmp); + d.readU32(20, &u32tmp, 9999); + m_channelMarker.setUDPSendPort(u32tmp); blockApplySettings(false); m_channelMarker.blockSignals(false); diff --git a/plugins/channelrx/demoddsd/dsddemodplugin.cpp b/plugins/channelrx/demoddsd/dsddemodplugin.cpp index f41e2223b..eaf2e126f 100644 --- a/plugins/channelrx/demoddsd/dsddemodplugin.cpp +++ b/plugins/channelrx/demoddsd/dsddemodplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { QString("DSD Demodulator"), - QString("3.5.0"), + QString("3.6.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/udpsink/udpsinkplugin.cpp b/plugins/channeltx/udpsink/udpsinkplugin.cpp index 2162b1ed3..d78a87d07 100644 --- a/plugins/channeltx/udpsink/udpsinkplugin.cpp +++ b/plugins/channeltx/udpsink/udpsinkplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = { QString("UDP Channel Sink"), - QString("3.6.0"), + QString("3.6.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/sdrbase/dsp/channelmarker.cpp b/sdrbase/dsp/channelmarker.cpp index c2d15b5b5..557916b45 100644 --- a/sdrbase/dsp/channelmarker.cpp +++ b/sdrbase/dsp/channelmarker.cpp @@ -37,7 +37,8 @@ ChannelMarker::ChannelMarker(QObject* parent) : m_color(m_colorTable[m_nextColor]), m_movable(true), m_udpAddress("127.0.0.1"), - m_udpPort(9999) + m_udpReceivePort(9999), + m_udpSendPort(9998) { ++m_nextColor; if(m_colorTable[m_nextColor] == 0) @@ -104,8 +105,14 @@ void ChannelMarker::setUDPAddress(const QString& udpAddress) emit changed(); } -void ChannelMarker::setUDPPort(quint16 port) +void ChannelMarker::setUDPReceivePort(quint16 port) { - m_udpPort = port; + m_udpReceivePort = port; + emit changed(); +} + +void ChannelMarker::setUDPSendPort(quint16 port) +{ + m_udpSendPort = port; emit changed(); } diff --git a/sdrbase/dsp/channelmarker.h b/sdrbase/dsp/channelmarker.h index 9a7035d36..7b0be334d 100644 --- a/sdrbase/dsp/channelmarker.h +++ b/sdrbase/dsp/channelmarker.h @@ -53,8 +53,11 @@ public: void setUDPAddress(const QString& udpAddress); const QString& getUDPAddress() const { return m_udpAddress; } - void setUDPPort(quint16 port); - quint16 getUDPPort() const { return m_udpPort; } + void setUDPReceivePort(quint16 port); + quint16 getUDPReceivePort() const { return m_udpReceivePort; } + + void setUDPSendPort(quint16 port); + quint16 getUDPSendPort() const { return m_udpSendPort; } protected: @@ -72,7 +75,8 @@ protected: QColor m_color; bool m_movable; QString m_udpAddress; - quint16 m_udpPort; + quint16 m_udpReceivePort; + quint16 m_udpSendPort; signals: void changed(); diff --git a/sdrbase/gui/basicchannelsettingsdialog.cpp b/sdrbase/gui/basicchannelsettingsdialog.cpp index c44573abd..9741096b5 100644 --- a/sdrbase/gui/basicchannelsettingsdialog.cpp +++ b/sdrbase/gui/basicchannelsettingsdialog.cpp @@ -14,7 +14,8 @@ BasicChannelSettingsDialog::BasicChannelSettingsDialog(ChannelMarker* marker, QW ui->title->setText(m_channelMarker->getTitle()); m_color = m_channelMarker->getColor(); ui->udpAddress->setText(m_channelMarker->getUDPAddress()); - ui->udpPort->setText(QString("%1").arg(m_channelMarker->getUDPPort())); + ui->udpPortReceive->setText(QString("%1").arg(m_channelMarker->getUDPReceivePort())); + ui->udpPortSend->setText(QString("%1").arg(m_channelMarker->getUDPSendPort())); paintColor(); } @@ -55,14 +56,23 @@ void BasicChannelSettingsDialog::accept() m_channelMarker->setUDPAddress(ui->udpAddress->text()); bool ok; - int udpPort = ui->udpPort->text().toInt(&ok); + int udpPort = ui->udpPortReceive->text().toInt(&ok); if((!ok) || (udpPort < 1024) || (udpPort > 65535)) { udpPort = 9999; } - m_channelMarker->setUDPPort(udpPort); + m_channelMarker->setUDPReceivePort(udpPort); + + udpPort = ui->udpPortSend->text().toInt(&ok); + + if((!ok) || (udpPort < 1024) || (udpPort > 65535)) + { + udpPort = 9999; + } + + m_channelMarker->setUDPSendPort(udpPort); QDialog::accept(); } diff --git a/sdrbase/gui/basicchannelsettingsdialog.ui b/sdrbase/gui/basicchannelsettingsdialog.ui index 2384acc91..1e5f5f524 100644 --- a/sdrbase/gui/basicchannelsettingsdialog.ui +++ b/sdrbase/gui/basicchannelsettingsdialog.ui @@ -95,14 +95,14 @@ - + - Port + Recv - + 60 @@ -120,6 +120,29 @@ + + + + Send + + + + + + + + 60 + 16777215 + + + + 00000 + + + 9998 + + + diff --git a/sdrbase/gui/basicchannelsettingswidget.cpp b/sdrbase/gui/basicchannelsettingswidget.cpp index ae4e30f86..9ca44fbcb 100644 --- a/sdrbase/gui/basicchannelsettingswidget.cpp +++ b/sdrbase/gui/basicchannelsettingswidget.cpp @@ -12,7 +12,7 @@ BasicChannelSettingsWidget::BasicChannelSettingsWidget(ChannelMarker* marker, QW ui->setupUi(this); ui->title->setText(m_channelMarker->getTitle()); ui->address->setText(m_channelMarker->getUDPAddress()); - ui->port->setText(QString("%1").arg(m_channelMarker->getUDPPort())); + ui->port->setText(QString("%1").arg(m_channelMarker->getUDPReceivePort())); paintColor(); } @@ -51,7 +51,7 @@ void BasicChannelSettingsWidget::on_port_textEdited(const QString& arg1) udpPort = 9999; } - m_channelMarker->setUDPPort(udpPort); + m_channelMarker->setUDPReceivePort(udpPort); } void BasicChannelSettingsWidget::paintColor() diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index 0f08cb21d..60bb855bf 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -455,9 +455,9 @@ void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); #if QT_VERSION >= 0x050400 - m_showSystemWidget = new QLabel("SDRangel v3.6.0 " + qtVersionStr + QSysInfo::prettyProductName(), this); + m_showSystemWidget = new QLabel("SDRangel v3.6.1 " + qtVersionStr + QSysInfo::prettyProductName(), this); #else - m_showSystemWidget = new QLabel("SDRangel v3.6.0 " + qtVersionStr, this); + m_showSystemWidget = new QLabel("SDRangel v3.6.1 " + qtVersionStr, this); #endif statusBar()->addPermanentWidget(m_showSystemWidget);