1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-17 05:57:51 -04:00

DSD demodulator: implemented now channel marker settings with UDP parameters

This commit is contained in:
f4exb 2017-08-23 23:44:12 +02:00
parent 7d4eddbeac
commit 0c0bf2e094
3 changed files with 39 additions and 10 deletions

View File

@ -110,6 +110,9 @@ QByteArray DSDDemodGUI::serialize() const
s.writeBool(14, m_slot1On); s.writeBool(14, m_slot1On);
s.writeBool(15, m_slot2On); s.writeBool(15, m_slot2On);
s.writeBool(16, m_tdmaStereo); s.writeBool(16, m_tdmaStereo);
s.writeString(17, m_channelMarker.getTitle());
s.writeString(18, m_channelMarker.getUDPAddress());
s.writeU32(19, (quint32) m_channelMarker.getUDPPort());
return s.final(); return s.final();
} }
@ -126,6 +129,7 @@ bool DSDDemodGUI::deserialize(const QByteArray& data)
if (d.getVersion() == 1) if (d.getVersion() == 1)
{ {
QByteArray bytetmp; QByteArray bytetmp;
QString strtmp;
quint32 u32tmp; quint32 u32tmp;
qint32 tmp; qint32 tmp;
@ -161,6 +165,13 @@ bool DSDDemodGUI::deserialize(const QByteArray& data)
d.readBool(14, &m_slot1On, false); d.readBool(14, &m_slot1On, false);
d.readBool(15, &m_slot2On, false); d.readBool(15, &m_slot2On, false);
d.readBool(16, &m_tdmaStereo, false); d.readBool(16, &m_tdmaStereo, false);
d.readString(17, &strtmp, "DSD Demodulator");
m_channelMarker.setTitle(strtmp);
this->setWindowTitle(m_channelMarker.getTitle());
d.readString(18, &strtmp, "127.0.0.1");
m_channelMarker.setUDPAddress(strtmp);
d.readU32(19, &u32tmp, 9999);
m_channelMarker.setUDPPort(u32tmp);
blockApplySettings(false); blockApplySettings(false);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
@ -181,11 +192,6 @@ bool DSDDemodGUI::handleMessage(const Message& message __attribute__((unused)))
return false; return false;
} }
void DSDDemodGUI::viewChanged()
{
applySettings();
}
void DSDDemodGUI::on_deltaFrequency_changed(qint64 value) void DSDDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
m_channelMarker.setCenterFrequency(value); m_channelMarker.setCenterFrequency(value);
@ -288,8 +294,15 @@ void DSDDemodGUI::onMenuDoubleClicked()
if (!m_basicSettingsShown) if (!m_basicSettingsShown)
{ {
m_basicSettingsShown = true; m_basicSettingsShown = true;
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this); m_bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this);
bcsw->show(); m_bcsw->show();
}
else
{
m_basicSettingsShown = false;
m_bcsw->hide();
delete m_bcsw;
m_bcsw = 0;
} }
} }
@ -308,7 +321,8 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_slot2On(false), m_slot2On(false),
m_tdmaStereo(false), m_tdmaStereo(false),
m_squelchOpen(false), m_squelchOpen(false),
m_tickCount(0) m_tickCount(0),
m_bcsw(0)
{ {
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
@ -344,7 +358,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
m_channelMarker.setVisible(true); m_channelMarker.setVisible(true);
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->registerChannelInstance(m_channelID, this);
m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addChannelMarker(&m_channelMarker);
@ -358,6 +372,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
DSDDemodGUI::~DSDDemodGUI() DSDDemodGUI::~DSDDemodGUI()
{ {
if (m_bcsw) delete m_bcsw;
m_deviceAPI->removeChannelInstance(this); m_deviceAPI->removeChannelInstance(this);
m_deviceAPI->removeThreadedSink(m_threadedChannelizer); m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
delete m_threadedChannelizer; delete m_threadedChannelizer;
@ -580,6 +595,13 @@ void DSDDemodGUI::formatStatusText()
m_formatStatusText[82] = '\0'; // guard m_formatStatusText[82] = '\0'; // guard
} }
void DSDDemodGUI::channelMarkerChanged()
{
this->setWindowTitle(m_channelMarker.getTitle());
applySettings();
}
void DSDDemodGUI::tick() void DSDDemodGUI::tick()
{ {
double magsqAvg, magsqPeak; double magsqAvg, magsqPeak;

View File

@ -18,6 +18,8 @@
#ifndef INCLUDE_DSDDEMODGUI_H #ifndef INCLUDE_DSDDEMODGUI_H
#define INCLUDE_DSDDEMODGUI_H #define INCLUDE_DSDDEMODGUI_H
#include <QMenu>
#include "gui/rollupwidget.h" #include "gui/rollupwidget.h"
#include "plugin/plugingui.h" #include "plugin/plugingui.h"
#include "dsp/dsptypes.h" #include "dsp/dsptypes.h"
@ -26,6 +28,7 @@
class PluginAPI; class PluginAPI;
class DeviceSourceAPI; class DeviceSourceAPI;
class BasicChannelSettingsWidget;
class ThreadedBasebandSampleSink; class ThreadedBasebandSampleSink;
class DownChannelizer; class DownChannelizer;
@ -57,8 +60,8 @@ public:
static const QString m_channelID; static const QString m_channelID;
private slots: private slots:
void viewChanged();
void formatStatusText(); void formatStatusText();
void channelMarkerChanged();
void on_deltaFrequency_changed(qint64 value); void on_deltaFrequency_changed(qint64 value);
void on_rfBW_valueChanged(int index); void on_rfBW_valueChanged(int index);
void on_demodGain_valueChanged(int value); void on_demodGain_valueChanged(int value);
@ -114,6 +117,7 @@ private:
float m_myLatitude; float m_myLatitude;
float m_myLongitude; float m_myLongitude;
BasicChannelSettingsWidget *m_bcsw;
explicit DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~DSDDemodGUI(); virtual ~DSDDemodGUI();

View File

@ -31,6 +31,9 @@
<property name="windowTitle"> <property name="windowTitle">
<string>DSD Demodulator</string> <string>DSD Demodulator</string>
</property> </property>
<property name="statusTip">
<string>DSD Demodulator</string>
</property>
<widget class="QWidget" name="settingsContainer" native="true"> <widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry"> <property name="geometry">
<rect> <rect>