From 53beb8a92d54ec606c536ac02e943c8271b60afb Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 30 Mar 2018 19:06:27 +0200 Subject: [PATCH] Removed UDP address and port from Channel marker --- plugins/channelrx/demodam/amdemodgui.cpp | 2 - plugins/channelrx/demodbfm/bfmdemodgui.cpp | 2 - plugins/channelrx/demoddsd/dsddemodgui.cpp | 4 -- plugins/channelrx/demodnfm/nfmdemodgui.cpp | 2 - plugins/channelrx/demodssb/ssbdemodgui.cpp | 2 - plugins/channelrx/demodwfm/wfmdemodgui.cpp | 2 - plugins/channelrx/udpsrc/udpsrcgui.cpp | 14 ---- plugins/channelrx/udpsrc/udpsrcgui.h | 1 - plugins/channeltx/modam/ammodgui.cpp | 2 - plugins/channeltx/modatv/atvmodgui.cpp | 2 - plugins/channeltx/modnfm/nfmmodgui.cpp | 2 - plugins/channeltx/modssb/ssbmodgui.cpp | 4 -- plugins/channeltx/modwfm/wfmmodgui.cpp | 2 - plugins/channeltx/udpsink/udpsinkgui.cpp | 4 -- sdrbase/dsp/channelmarker.cpp | 37 ---------- sdrbase/dsp/channelmarker.h | 12 ---- sdrgui/gui/basicchannelsettingsdialog.cpp | 23 ------ sdrgui/gui/basicchannelsettingsdialog.ui | 83 ---------------------- 18 files changed, 200 deletions(-) diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index beb3584e8..d9488350d 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -230,8 +230,6 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("AM Demodulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 395682b4f..6707b01dd 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -357,8 +357,6 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_channelMarker.setBandwidth(12500); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("Broadcast FM Demod"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index 4b282a557..b8c5e43ae 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -256,8 +256,6 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.exec(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); - m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), - m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_title = m_channelMarker.getTitle(); @@ -328,8 +326,6 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_channelMarker.setBandwidth(10000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("DSD Demodulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index ed0dc3a6e..753a222da 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -293,8 +293,6 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("NFM Demodulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index c5b9cf720..9a8ad9c3a 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -287,8 +287,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_channelMarker.setBandwidth(6000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("SSB Demodulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 7c13a613a..6f78a3ad9 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -190,8 +190,6 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_channelMarker.setBandwidth(WFMDemodSettings::getRFBW(4)); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("WFM Demodulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channelrx/udpsrc/udpsrcgui.cpp b/plugins/channelrx/udpsrc/udpsrcgui.cpp index d2f40764a..518b6cb17 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.cpp +++ b/plugins/channelrx/udpsrc/udpsrcgui.cpp @@ -171,9 +171,6 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_channelMarker.setBandwidth(16000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("UDP Sample Source"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); - m_channelMarker.setUDPReceivePort(9998); m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only @@ -221,7 +218,6 @@ void UDPSrcGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); - displayUDPAddress(); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); @@ -249,13 +245,6 @@ void UDPSrcGUI::displaySettings() ui->gainText->setText(tr("%1").arg(ui->gain->value()/10.0, 0, 'f', 1)); ui->glSpectrum->setSampleRate(m_settings.m_outputSampleRate); - - displayUDPAddress(); -} - -void UDPSrcGUI::displayUDPAddress() -{ - ui->addressText->setText(tr("%1:%2/%3").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()).arg(m_channelMarker.getUDPReceivePort())); } void UDPSrcGUI::setSampleFormatIndex(const UDPSrcSettings::SampleFormat& sampleFormat) @@ -552,14 +541,11 @@ void UDPSrcGUI::onMenuDialogCalled(const QPoint &p) m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); - m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), - m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_title = m_channelMarker.getTitle(); setWindowTitle(m_settings.m_title); setTitleColor(m_settings.m_rgbColor); - displayUDPAddress(); applySettingsImmediate(); } diff --git a/plugins/channelrx/udpsrc/udpsrcgui.h b/plugins/channelrx/udpsrc/udpsrcgui.h index abeac01d6..0ae8fec13 100644 --- a/plugins/channelrx/udpsrc/udpsrcgui.h +++ b/plugins/channelrx/udpsrc/udpsrcgui.h @@ -85,7 +85,6 @@ private: void applySettings(bool force = false); void applySettingsImmediate(bool force = false); void displaySettings(); - void displayUDPAddress(); void setSampleFormat(int index); void setSampleFormatIndex(const UDPSrcSettings::SampleFormat& sampleFormat); diff --git a/plugins/channeltx/modam/ammodgui.cpp b/plugins/channeltx/modam/ammodgui.cpp index 2ee194a90..6d8316f96 100644 --- a/plugins/channeltx/modam/ammodgui.cpp +++ b/plugins/channeltx/modam/ammodgui.cpp @@ -296,8 +296,6 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("AM Modulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index 61329486c..165f1d63a 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -616,8 +616,6 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("ATV Modulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 133adf2c7..7f48c49ac 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -334,8 +334,6 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_channelMarker.setBandwidth(12500); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("NFM Modulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index 6f2819034..847c77cd1 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -133,8 +133,6 @@ void SSBModGUI::channelMarkerChangedByCursor() void SSBModGUI::channelMarkerUpdate() { m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); - m_settings.m_udpAddress = m_channelMarker.getUDPAddress(); - m_settings.m_udpPort = m_channelMarker.getUDPReceivePort(); displaySettings(); applySettings(); } @@ -401,8 +399,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("SSB Modulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index aaf6d9ac6..c9a11c1c9 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -313,8 +313,6 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam m_channelMarker.setBandwidth(125000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("WFM Modulator"); - m_channelMarker.setUDPAddress("127.0.0.1"); - m_channelMarker.setUDPSendPort(9999); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only diff --git a/plugins/channeltx/udpsink/udpsinkgui.cpp b/plugins/channeltx/udpsink/udpsinkgui.cpp index f4741295b..dc8f8ab49 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.cpp +++ b/plugins/channeltx/udpsink/udpsinkgui.cpp @@ -194,8 +194,6 @@ void UDPSinkGUI::displaySettings() m_channelMarker.blockSignals(true); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setBandwidth(m_settings.m_rfBandwidth); - m_channelMarker.setUDPAddress(m_settings.m_udpAddress); - m_channelMarker.setUDPReceivePort(m_settings.m_udpPort); // activate signal on the last setting only m_channelMarker.blockSignals(false); m_channelMarker.setColor(m_settings.m_rgbColor); @@ -429,8 +427,6 @@ void UDPSinkGUI::onMenuDialogCalled(const QPoint &p) dialog.exec(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); - m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), - m_settings.m_udpPort = m_channelMarker.getUDPReceivePort(), m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); setWindowTitle(m_channelMarker.getTitle()); diff --git a/sdrbase/dsp/channelmarker.cpp b/sdrbase/dsp/channelmarker.cpp index 4900dcdaa..1b242caf2 100644 --- a/sdrbase/dsp/channelmarker.cpp +++ b/sdrbase/dsp/channelmarker.cpp @@ -37,14 +37,11 @@ ChannelMarker::ChannelMarker(QObject* parent) : m_highlighted(false), m_color(m_colorTable[m_nextColor]), m_movable(true), - m_udpReceivePort(9999), - m_udpSendPort(9998), m_fScaleDisplayType(FScaleDisplay_freq) { ++m_nextColor; if(m_colorTable[m_nextColor] == 0) m_nextColor = 0; - setUDPAddress("127.0.0.1"); } void ChannelMarker::emitChangedByAPI() @@ -118,36 +115,11 @@ void ChannelMarker::setColor(const QColor& color) emit changedByAPI(); } -void ChannelMarker::setUDPAddress(const QString& udpAddress) -{ - m_udpAddress = udpAddress; - m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort())); - m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort())); - emit changedByAPI(); -} - -void ChannelMarker::setUDPReceivePort(quint16 port) -{ - m_udpReceivePort = port; - m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort())); - emit changedByAPI(); -} - -void ChannelMarker::setUDPSendPort(quint16 port) -{ - m_udpSendPort = port; - m_displayAddressSend = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort())); - emit changedByAPI(); -} - void ChannelMarker::resetToDefaults() { setTitle("Channel"); setCenterFrequency(0); setColor(Qt::white); - setUDPAddress("127.0.0.1"); - setUDPSendPort(9999); - setUDPReceivePort(9999); setFrequencyScaleDisplayType(FScaleDisplay_freq); } @@ -157,9 +129,6 @@ QByteArray ChannelMarker::serialize() const s.writeS32(1, getCenterFrequency()); s.writeU32(2, getColor().rgb()); s.writeString(3, getTitle()); - s.writeString(4, getUDPAddress()); - s.writeU32(5, (quint32) getUDPReceivePort()); - s.writeU32(6, (quint32) getUDPSendPort()); s.writeS32(7, (int) getFrequencyScaleDisplayType()); return s.final(); } @@ -189,12 +158,6 @@ bool ChannelMarker::deserialize(const QByteArray& data) } d.readString(3, &strtmp, "Channel"); setTitle(strtmp); - d.readString(4, &strtmp, "127.0.0.1"); - setUDPAddress(strtmp); - d.readU32(5, &u32tmp, 9999); - setUDPReceivePort(u32tmp); - d.readU32(6, &u32tmp, 9999); - setUDPSendPort(u32tmp); d.readS32(7, &tmp, 0); if ((tmp >= 0) && (tmp < FScaleDisplay_none)) { setFrequencyScaleDisplayType((frequencyScaleDisplay_t) tmp); diff --git a/sdrbase/dsp/channelmarker.h b/sdrbase/dsp/channelmarker.h index a2981a01e..125a4cf58 100644 --- a/sdrbase/dsp/channelmarker.h +++ b/sdrbase/dsp/channelmarker.h @@ -66,15 +66,6 @@ public: void setMovable(bool movable) { m_movable = movable; } bool getMovable() const { return m_movable; } - void setUDPAddress(const QString& udpAddress); - const QString& getUDPAddress() const { return m_udpAddress; } - - void setUDPReceivePort(quint16 port); - quint16 getUDPReceivePort() const { return m_udpReceivePort; } - - void setUDPSendPort(quint16 port); - quint16 getUDPSendPort() const { return m_udpSendPort; } - void setFrequencyScaleDisplayType(frequencyScaleDisplay_t type) { m_fScaleDisplayType = type; } frequencyScaleDisplay_t getFrequencyScaleDisplayType() const { return m_fScaleDisplayType; } @@ -100,9 +91,6 @@ protected: bool m_highlighted; QColor m_color; bool m_movable; - QString m_udpAddress; - quint16 m_udpReceivePort; - quint16 m_udpSendPort; frequencyScaleDisplay_t m_fScaleDisplayType; void resetToDefaults(); diff --git a/sdrgui/gui/basicchannelsettingsdialog.cpp b/sdrgui/gui/basicchannelsettingsdialog.cpp index 9069cfa64..313cf3dc2 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.cpp +++ b/sdrgui/gui/basicchannelsettingsdialog.cpp @@ -14,9 +14,6 @@ BasicChannelSettingsDialog::BasicChannelSettingsDialog(ChannelMarker* marker, QW ui->setupUi(this); ui->title->setText(m_channelMarker->getTitle()); m_color = m_channelMarker->getColor(); - ui->udpAddress->setText(m_channelMarker->getUDPAddress()); - ui->udpPortReceive->setText(QString("%1").arg(m_channelMarker->getUDPReceivePort())); - ui->udpPortSend->setText(QString("%1").arg(m_channelMarker->getUDPSendPort())); ui->fScaleDisplayType->setCurrentIndex((int) m_channelMarker->getFrequencyScaleDisplayType()); paintColor(); } @@ -56,28 +53,8 @@ void BasicChannelSettingsDialog::accept() m_channelMarker->setColor(m_color); } - m_channelMarker->setUDPAddress(ui->udpAddress->text()); - - bool ok; - int udpPort = ui->udpPortReceive->text().toInt(&ok); - - if((!ok) || (udpPort < 1024) || (udpPort > 65535)) - { - udpPort = 9999; - } - - m_channelMarker->setUDPReceivePort(udpPort); - - udpPort = ui->udpPortSend->text().toInt(&ok); - - if((!ok) || (udpPort < 1024) || (udpPort > 65535)) - { - udpPort = 9999; - } - m_channelMarker->setFrequencyScaleDisplayType((ChannelMarker::frequencyScaleDisplay_t) ui->fScaleDisplayType->currentIndex()); m_channelMarker->blockSignals(false); - m_channelMarker->setUDPSendPort(udpPort); // activate signal on the last setting only m_hasChanged = true; QDialog::accept(); diff --git a/sdrgui/gui/basicchannelsettingsdialog.ui b/sdrgui/gui/basicchannelsettingsdialog.ui index dba382185..d2ccc0881 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.ui +++ b/sdrgui/gui/basicchannelsettingsdialog.ui @@ -89,16 +89,6 @@ Title - - - AdSnd - - - - - AdRcv - - @@ -116,79 +106,6 @@ - - - - - - Addr - - - - - - - UDP address - - - 000.000.000.000 - - - 127.0.0.1 - - - - - - - Recv - - - - - - - - 60 - 16777215 - - - - UDP port - - - 00000 - - - 9999 - - - - - - - Send - - - - - - - - 60 - 16777215 - - - - 00000 - - - 9998 - - - - -