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

DSD demod: added possibility to enable/disable the symbol PLL

This commit is contained in:
f4exb 2017-05-07 10:23:37 +02:00
parent 5c8b7fd606
commit 0e70c84f45
7 changed files with 58 additions and 18 deletions

View File

@ -69,6 +69,7 @@ public:
void setMyPoint(float lat, float lon) { m_decoder.setMyPoint(lat, lon); }
void setAudioGain(float gain) { m_decoder.setAudioGain(gain); }
void setBaudRate(int baudRate);
void setSymbolPLLLock(bool pllLock) { m_decoder.setSymbolPLLLock(pllLock); }
private:
DSDcc::DSDDecoder m_decoder;

View File

@ -95,7 +95,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
bool syncOrConstellation,
bool slot1On,
bool slot2On,
bool tdmaStereo)
bool tdmaStereo,
bool pllLock)
{
Message* cmd = MsgConfigureDSDDemod::create(rfBandwidth,
demodGain,
@ -109,7 +110,8 @@ void DSDDemod::configure(MessageQueue* messageQueue,
syncOrConstellation,
slot1On,
slot2On,
tdmaStereo);
tdmaStereo,
pllLock);
messageQueue->push(cmd);
}
@ -363,6 +365,7 @@ bool DSDDemod::handleMessage(const Message& cmd)
m_config.m_slot1On = cfg.getSlot1On();
m_config.m_slot2On = cfg.getSlot2On();
m_config.m_tdmaStereo = cfg.getTDMAStereo();
m_config.m_pllLock = cfg.getPLLLock();
apply();
@ -378,7 +381,8 @@ bool DSDDemod::handleMessage(const Message& cmd)
<< " m_syncOrConstellation: " << m_config.m_syncOrConstellation
<< " m_slot1On: " << m_config.m_slot1On
<< " m_slot2On: " << m_config.m_slot2On
<< " m_tdmaStereo: " << m_config.m_tdmaStereo;
<< " m_tdmaStereo: " << m_config.m_tdmaStereo
<< " m_pllLock: " << m_config.m_pllLock;
return true;
}
@ -451,6 +455,11 @@ void DSDDemod::apply()
m_dsdDecoder.setTDMAStereo(m_config.m_tdmaStereo);
}
if (m_config.m_pllLock != m_running.m_pllLock)
{
m_dsdDecoder.setSymbolPLLLock(m_config.m_pllLock);
}
m_running.m_inputSampleRate = m_config.m_inputSampleRate;
m_running.m_inputFrequencyOffset = m_config.m_inputFrequencyOffset;
m_running.m_rfBandwidth = m_config.m_rfBandwidth;
@ -467,4 +476,5 @@ void DSDDemod::apply()
m_running.m_slot1On = m_config.m_slot1On;
m_running.m_slot2On = m_config.m_slot2On;
m_running.m_tdmaStereo = m_config.m_tdmaStereo;
m_running.m_pllLock = m_config.m_pllLock;
}

View File

@ -54,7 +54,8 @@ public:
bool syncOrConstellation,
bool slot1On,
bool slot2On,
bool tdmaStereo);
bool tdmaStereo,
bool pllLock);
void configureMyPosition(MessageQueue* messageQueue, float myLatitude, float myLongitude);
@ -123,6 +124,7 @@ private:
bool getSlot1On() const { return m_slot1On; }
bool getSlot2On() const { return m_slot2On; }
bool getTDMAStereo() const { return m_tdmaStereo; }
bool getPLLLock() const { return m_pllLock; }
static MsgConfigureDSDDemod* create(int rfBandwidth,
int demodGain,
@ -136,7 +138,8 @@ private:
bool syncOrConstellation,
bool slot1On,
bool slot2On,
bool tdmaStereo)
bool tdmaStereo,
bool pllLock)
{
return new MsgConfigureDSDDemod(rfBandwidth,
demodGain,
@ -150,7 +153,8 @@ private:
syncOrConstellation,
slot1On,
slot2On,
tdmaStereo);
tdmaStereo,
pllLock);
}
private:
@ -167,6 +171,7 @@ private:
bool m_slot1On;
bool m_slot2On;
bool m_tdmaStereo;
bool m_pllLock;
MsgConfigureDSDDemod(int rfBandwidth,
int demodGain,
@ -180,7 +185,8 @@ private:
bool syncOrConstellation,
bool slot1On,
bool slot2On,
bool tdmaStereo) :
bool tdmaStereo,
bool pllLock) :
Message(),
m_rfBandwidth(rfBandwidth),
m_demodGain(demodGain),
@ -194,7 +200,8 @@ private:
m_syncOrConstellation(syncOrConstellation),
m_slot1On(slot1On),
m_slot2On(slot2On),
m_tdmaStereo(tdmaStereo)
m_tdmaStereo(tdmaStereo),
m_pllLock(pllLock)
{ }
};
@ -226,6 +233,7 @@ private:
bool m_slot1On;
bool m_slot2On;
bool m_tdmaStereo;
bool m_pllLock;
Config() :
m_inputSampleRate(-1),
@ -243,7 +251,8 @@ private:
m_syncOrConstellation(false),
m_slot1On(false),
m_slot2On(false),
m_tdmaStereo(false)
m_tdmaStereo(false),
m_pllLock(true)
{ }
};

View File

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "../../channelrx/demoddsd/dsddemodgui.h"
#include "dsddemodgui.h"
#include <device/devicesourceapi.h>
#include <dsp/downchannelizer.h>
@ -23,7 +23,7 @@
#include <QMainWindow>
#include <QDebug>
#include "../../../sdrbase/dsp/threadedbasebandsamplesink.h"
#include "dsp/threadedbasebandsamplesink.h"
#include "ui_dsddemodgui.h"
#include "dsp/scopevis.h"
#include "gui/glscope.h"
@ -34,7 +34,7 @@
#include "dsp/dspengine.h"
#include "mainwindow.h"
#include "../../channelrx/demoddsd/dsddemod.h"
#include "dsddemod.h"
const QString DSDDemodGUI::m_channelID = "sdrangel.channel.dsddemod";
@ -86,6 +86,7 @@ void DSDDemodGUI::resetToDefaults()
ui->squelchGate->setValue(5);
ui->squelch->setValue(-40);
ui->deltaFrequency->setValue(0);
ui->symbolPLLLock->setChecked(true);
blockApplySettings(false);
applySettings();
@ -283,6 +284,16 @@ void DSDDemodGUI::on_audioMute_toggled(bool checked)
applySettings();
}
void DSDDemodGUI::on_symbolPLLLock_toggled(bool checked)
{
if (checked) {
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
} else {
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(53,53,53); }");
}
applySettings();
}
void DSDDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{
/*
@ -425,7 +436,8 @@ void DSDDemodGUI::applySettings()
m_syncOrConstellation,
m_slot1On,
m_slot2On,
m_tdmaStereo);
m_tdmaStereo,
ui->symbolPLLLock->isChecked());
}
}
@ -663,10 +675,10 @@ void DSDDemodGUI::tick()
ui->formatStatusText->setStyleSheet("QLabel { background:rgb(37,53,39); }"); // turn on background
}
if (m_squelchOpen && m_dsdDemod->getDecoder().getSymbolPLLLocked()) {
if (m_squelchOpen && ui->symbolPLLLock->isChecked() && m_dsdDemod->getDecoder().getSymbolPLLLocked()) {
ui->symbolPLLLock->setStyleSheet("QToolButton { background-color : green; }");
} else {
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(53,53,53); }");
ui->symbolPLLLock->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
}
m_tickCount = 0;

View File

@ -74,6 +74,7 @@ private slots:
void on_squelchGate_valueChanged(int value);
void on_squelch_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_symbolPLLLock_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked();
void tick();

View File

@ -225,17 +225,24 @@
<item>
<widget class="QToolButton" name="symbolPLLLock">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="toolTip">
<string>Symbol PLL lock indicator (green: locked)</string>
<string>Symbol PLL toggle (green: PLL locked)</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/locked.png</normaloff>:/locked.png</iconset>
<normaloff>:/unlocked.png</normaloff>
<normalon>:/locked.png</normalon>:/unlocked.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 354 B