1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Added send port to UDP parameters

This commit is contained in:
f4exb 2017-08-24 02:26:47 +02:00
parent 01eed29a6f
commit 614021f9a0
10 changed files with 75 additions and 20 deletions

8
debian/changelog vendored
View File

@ -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 <f4exb06@gmail.com> Thu, 31 Aug 2017 23:14:18 +0200
sdrangel (3.6.0-1) unstable; urgency=medium
* UDPSink Tx plugin: new

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -95,14 +95,14 @@
</widget>
</item>
<item>
<widget class="QLabel" name="udpPortLabel">
<widget class="QLabel" name="udpPortReceiveLabel">
<property name="text">
<string>Port</string>
<string>Recv</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="udpPort">
<widget class="QLineEdit" name="udpPortReceive">
<property name="maximumSize">
<size>
<width>60</width>
@ -120,6 +120,29 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="udpPortSendLabel">
<property name="text">
<string>Send</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="udpPortSend">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="inputMask">
<string>00000</string>
</property>
<property name="text">
<string>9998</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@ -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()

View File

@ -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);