1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

Demod GUI corrections

This commit is contained in:
f4exb 2017-10-12 01:21:30 +02:00
parent aa0eea3ba8
commit 8c2483a850
15 changed files with 198 additions and 179 deletions

View File

@ -81,7 +81,6 @@ QByteArray AMDemodGUI::serialize() const
bool AMDemodGUI::deserialize(const QByteArray& data) bool AMDemodGUI::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) { if(m_settings.deserialize(data)) {
updateChannelMarker();
displaySettings(); displaySettings();
applySettings(true); applySettings(true);
return true; return true;
@ -98,7 +97,7 @@ bool AMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
void AMDemodGUI::channelMarkerChanged() void AMDemodGUI::channelMarkerChanged()
{ {
this->setWindowTitle(m_channelMarker.getTitle()); setWindowTitle(m_channelMarker.getTitle());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
@ -245,12 +244,20 @@ void AMDemodGUI::applySettings(bool force)
void AMDemodGUI::displaySettings() void AMDemodGUI::displaySettings()
{ {
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true); blockApplySettings(true);
int displayValue = m_settings.m_rfBandwidth/100.0; int displayValue = m_settings.m_rfBandwidth/100.0;
ui->rfBW->setValue(displayValue); ui->rfBW->setValue(displayValue);
ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1)); ui->rfBWText->setText(QString("%1 kHz").arg(displayValue / 10.0, 0, 'f', 1));
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
ui->volume->setValue(m_settings.m_volume * 10.0); ui->volume->setValue(m_settings.m_volume * 10.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1)); ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
@ -262,14 +269,6 @@ void AMDemodGUI::displaySettings()
ui->bandpassEnable->setChecked(m_settings.m_bandpassEnable); ui->bandpassEnable->setChecked(m_settings.m_bandpassEnable);
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP); ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
blockApplySettings(false); blockApplySettings(false);
} }
@ -278,16 +277,6 @@ void AMDemodGUI::displayUDPAddress()
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort())); ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
} }
void AMDemodGUI::updateChannelMarker()
{
m_channelMarker.blockSignals(true);
//m_channelMarker.deserialize(m_settings.m_channelMarkerBytes);
this->setWindowTitle(m_channelMarker.getTitle());
m_channelMarker.blockSignals(false);
}
void AMDemodGUI::leaveEvent(QEvent*) void AMDemodGUI::leaveEvent(QEvent*)
{ {
blockApplySettings(true); blockApplySettings(true);

View File

@ -74,7 +74,6 @@ private:
void applySettings(bool force = false); void applySettings(bool force = false);
void displaySettings(); void displaySettings();
void displayUDPAddress(); void displayUDPAddress();
void updateChannelMarker();
void leaveEvent(QEvent*); void leaveEvent(QEvent*);
void enterEvent(QEvent*); void enterEvent(QEvent*);

View File

@ -14,6 +14,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include <QColor>
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include "settings/serializable.h" #include "settings/serializable.h"
@ -38,6 +40,7 @@ void AMDemodSettings::resetToDefaults()
m_copyAudioToUDP = false; m_copyAudioToUDP = false;
m_udpAddress = "127.0.0.1"; m_udpAddress = "127.0.0.1";
m_udpPort = 9999; m_udpPort = 9999;
m_rgbColor = QColor(255, 255, 0).rgb();
} }
QByteArray AMDemodSettings::serialize() const QByteArray AMDemodSettings::serialize() const

View File

@ -98,7 +98,6 @@ QByteArray BFMDemodGUI::serialize() const
bool BFMDemodGUI::deserialize(const QByteArray& data) bool BFMDemodGUI::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) { if(m_settings.deserialize(data)) {
updateChannelMarker();
displaySettings(); displaySettings();
applySettings(true); applySettings(true);
return true; return true;
@ -141,7 +140,7 @@ void BFMDemodGUI::handleInputMessages()
void BFMDemodGUI::channelMarkerChanged() void BFMDemodGUI::channelMarkerChanged()
{ {
this->setWindowTitle(m_channelMarker.getTitle()); setWindowTitle(m_channelMarker.getTitle());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
@ -390,13 +389,6 @@ void BFMDemodGUI::displayUDPAddress()
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort())); ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
} }
void BFMDemodGUI::updateChannelMarker()
{
m_channelMarker.blockSignals(true);
this->setWindowTitle(m_channelMarker.getTitle());
m_channelMarker.blockSignals(false);
}
void BFMDemodGUI::blockApplySettings(bool block) void BFMDemodGUI::blockApplySettings(bool block)
{ {
m_doApplySettings = !block; m_doApplySettings = !block;
@ -422,9 +414,15 @@ void BFMDemodGUI::applySettings(bool force)
void BFMDemodGUI::displaySettings() void BFMDemodGUI::displaySettings()
{ {
blockApplySettings(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset); setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->rfBW->setValue(BFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth)); ui->rfBW->setValue(BFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth));
ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0)); ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0));
@ -445,14 +443,6 @@ void BFMDemodGUI::displaySettings()
ui->rds->setChecked(m_settings.m_rdsActive); ui->rds->setChecked(m_settings.m_rdsActive);
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP); ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
blockApplySettings(false); blockApplySettings(false);
} }

View File

@ -104,7 +104,6 @@ private:
void applySettings(bool force = false); void applySettings(bool force = false);
void displaySettings(); void displaySettings();
void displayUDPAddress(); void displayUDPAddress();
void updateChannelMarker();
void rdsUpdate(bool force); void rdsUpdate(bool force);
void rdsUpdateFixedFields(); void rdsUpdateFixedFields();

View File

@ -322,17 +322,16 @@ void DSDDemodGUI::displayUDPAddress()
void DSDDemodGUI::displaySettings() void DSDDemodGUI::displaySettings()
{ {
blockApplySettings(true);
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
this->setWindowTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
@ -542,7 +541,7 @@ void DSDDemodGUI::formatStatusText()
void DSDDemodGUI::channelMarkerChanged() void DSDDemodGUI::channelMarkerChanged()
{ {
this->setWindowTitle(m_channelMarker.getTitle()); setWindowTitle(m_channelMarker.getTitle());
displayUDPAddress(); displayUDPAddress();
applySettings(); applySettings();
} }

View File

@ -196,12 +196,7 @@ void LoRaDemodGUI::applySettings(bool force)
void LoRaDemodGUI::displaySettings() void LoRaDemodGUI::displaySettings()
{ {
blockApplySettings(true);
int thisBW = LoRaDemodSettings::bandwidths[m_settings.m_bandwidthIndex]; int thisBW = LoRaDemodSettings::bandwidths[m_settings.m_bandwidthIndex];
ui->BWText->setText(QString("%1 Hz").arg(thisBW));
ui->BW->setValue(m_settings.m_bandwidthIndex);
m_channelMarker.setBandwidth(thisBW);
blockApplySettings(false);
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setBandwidth(thisBW); m_channelMarker.setBandwidth(thisBW);
@ -209,4 +204,9 @@ void LoRaDemodGUI::displaySettings()
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
blockApplySettings(true);
ui->BWText->setText(QString("%1 Hz").arg(thisBW));
ui->BW->setValue(m_settings.m_bandwidthIndex);
blockApplySettings(false);
} }

View File

@ -51,103 +51,103 @@ void NFMDemodGUI::setCenterFrequency(qint64 centerFrequency)
void NFMDemodGUI::resetToDefaults() void NFMDemodGUI::resetToDefaults()
{ {
blockApplySettings(true); m_settings.resetToDefaults();
displaySettings();
ui->rfBW->setCurrentIndex(4); applySettings();
ui->afBW->setValue(3);
ui->volume->setValue(20);
ui->squelchGate->setValue(5);
ui->squelch->setValue(-40);
ui->deltaFrequency->setValue(0);
ui->ctcssOn->setChecked(false);
ui->audioMute->setChecked(false);
blockApplySettings(false);
applySettings();
} }
QByteArray NFMDemodGUI::serialize() const QByteArray NFMDemodGUI::serialize() const
{ {
SimpleSerializer s(1); return m_settings.serialize();
s.writeS32(1, m_channelMarker.getCenterFrequency()); // SimpleSerializer s(1);
s.writeS32(2, ui->rfBW->currentIndex()); // s.writeS32(1, m_channelMarker.getCenterFrequency());
s.writeS32(3, ui->afBW->value()); // s.writeS32(2, ui->rfBW->currentIndex());
s.writeS32(4, ui->volume->value()); // s.writeS32(3, ui->afBW->value());
s.writeS32(5, ui->squelch->value()); // s.writeS32(4, ui->volume->value());
s.writeU32(7, m_channelMarker.getColor().rgb()); // s.writeS32(5, ui->squelch->value());
s.writeS32(8, ui->ctcss->currentIndex()); // s.writeU32(7, m_channelMarker.getColor().rgb());
s.writeBool(9, ui->ctcssOn->isChecked()); // s.writeS32(8, ui->ctcss->currentIndex());
s.writeBool(10, ui->audioMute->isChecked()); // s.writeBool(9, ui->ctcssOn->isChecked());
s.writeS32(11, ui->squelchGate->value()); // s.writeBool(10, ui->audioMute->isChecked());
s.writeBool(12, ui->deltaSquelch->isChecked()); // s.writeS32(11, ui->squelchGate->value());
s.writeBlob(13, m_channelMarker.serialize()); // s.writeBool(12, ui->deltaSquelch->isChecked());
return s.final(); // s.writeBlob(13, m_channelMarker.serialize());
// return s.final();
} }
bool NFMDemodGUI::deserialize(const QByteArray& data) bool NFMDemodGUI::deserialize(const QByteArray& data)
{ {
SimpleDeserializer d(data); if(m_settings.deserialize(data)) {
displaySettings();
applySettings(true);
return true;
} else {
resetToDefaults();
return false;
}
if (!d.isValid()) // SimpleDeserializer d(data);
{ //
resetToDefaults(); // if (!d.isValid())
return false; // {
} // resetToDefaults();
// return false;
if (d.getVersion() == 1) // }
{ //
QByteArray bytetmp; // if (d.getVersion() == 1)
quint32 u32tmp; // {
qint32 tmp; // QByteArray bytetmp;
bool boolTmp; // quint32 u32tmp;
// qint32 tmp;
blockApplySettings(true); // bool boolTmp;
m_channelMarker.blockSignals(true); //
// blockApplySettings(true);
d.readBlob(13, &bytetmp); // m_channelMarker.blockSignals(true);
m_channelMarker.deserialize(bytetmp); //
// d.readBlob(13, &bytetmp);
d.readS32(1, &tmp, 0); // m_channelMarker.deserialize(bytetmp);
m_channelMarker.setCenterFrequency(tmp); //
d.readS32(2, &tmp, 4); // d.readS32(1, &tmp, 0);
ui->rfBW->setCurrentIndex(tmp); // m_channelMarker.setCenterFrequency(tmp);
d.readS32(3, &tmp, 3); // d.readS32(2, &tmp, 4);
ui->afBW->setValue(tmp); // ui->rfBW->setCurrentIndex(tmp);
d.readS32(4, &tmp, 20); // d.readS32(3, &tmp, 3);
ui->volume->setValue(tmp); // ui->afBW->setValue(tmp);
d.readS32(5, &tmp, -40); // d.readS32(4, &tmp, 20);
ui->squelch->setValue(tmp); // ui->volume->setValue(tmp);
// d.readS32(5, &tmp, -40);
if(d.readU32(7, &u32tmp)) // ui->squelch->setValue(tmp);
{ //
m_channelMarker.setColor(u32tmp); // if(d.readU32(7, &u32tmp))
} // {
// m_channelMarker.setColor(u32tmp);
d.readS32(8, &tmp, 0); // }
ui->ctcss->setCurrentIndex(tmp); //
d.readBool(9, &boolTmp, false); // d.readS32(8, &tmp, 0);
ui->ctcssOn->setChecked(boolTmp); // ui->ctcss->setCurrentIndex(tmp);
d.readBool(10, &boolTmp, false); // d.readBool(9, &boolTmp, false);
ui->audioMute->setChecked(boolTmp); // ui->ctcssOn->setChecked(boolTmp);
d.readS32(11, &tmp, 5); // d.readBool(10, &boolTmp, false);
ui->squelchGate->setValue(tmp); // ui->audioMute->setChecked(boolTmp);
d.readBool(12, &boolTmp, false); // d.readS32(11, &tmp, 5);
ui->deltaSquelch->setChecked(boolTmp); // ui->squelchGate->setValue(tmp);
// d.readBool(12, &boolTmp, false);
this->setWindowTitle(m_channelMarker.getTitle()); // ui->deltaSquelch->setChecked(boolTmp);
displayUDPAddress(); //
// this->setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(false); // displayUDPAddress();
m_channelMarker.blockSignals(false); //
// blockApplySettings(false);
applySettings(true); // m_channelMarker.blockSignals(false);
return true; //
} // applySettings(true);
else // return true;
{ // }
resetToDefaults(); // else
return false; // {
} // resetToDefaults();
// return false;
// }
} }
bool NFMDemodGUI::handleMessage(const Message& message __attribute__((unused))) bool NFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
@ -178,7 +178,7 @@ void NFMDemodGUI::handleInputMessages()
void NFMDemodGUI::channelMarkerChanged() void NFMDemodGUI::channelMarkerChanged()
{ {
this->setWindowTitle(m_channelMarker.getTitle()); setWindowTitle(m_channelMarker.getTitle());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
@ -348,15 +348,15 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
//m_channelMarker = new ChannelMarker(this); //m_channelMarker = new ChannelMarker(this);
m_channelMarker.setColor(Qt::red); // m_channelMarker.setColor(Qt::red);
m_channelMarker.setBandwidth(12500); // m_channelMarker.setBandwidth(12500);
m_channelMarker.setCenterFrequency(0); // m_channelMarker.setCenterFrequency(0);
m_channelMarker.setVisible(true); m_channelMarker.setVisible(true);
m_channelMarker.setTitle("NFM Demodulator"); m_channelMarker.setTitle("NFM Demodulator");
m_channelMarker.setUDPAddress("127.0.0.1"); // m_channelMarker.setUDPAddress("127.0.0.1");
m_channelMarker.setUDPSendPort(9999); // m_channelMarker.setUDPSendPort(9999);
m_channelMarker.setVisible(true); // setTitleColor(m_channelMarker.getColor());
setTitleColor(m_channelMarker.getColor()); m_settings.setChannelMarker(&m_channelMarker);
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
@ -369,6 +369,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
displaySettings();
applySettings(true); applySettings(true);
} }
@ -399,6 +400,55 @@ void NFMDemodGUI::applySettings(bool force)
} }
} }
void NFMDemodGUI::displaySettings()
{
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->rfBW->setCurrentIndex(NFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth));
ui->afBWText->setText(QString("%1 k").arg(m_settings.m_afBandwidth / 1000.0));
ui->afBW->setValue(m_settings.m_afBandwidth / 1000.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
ui->volume->setValue(m_settings.m_volume * 10.0);
ui->squelchGateText->setText(QString("%1").arg(m_settings.m_squelchGate * 10.0f, 0, 'f', 0));
ui->squelchGate->setValue(m_settings.m_squelchGate);
ui->deltaSquelch->setChecked(m_settings.m_deltaSquelch);
ui->squelch->setValue(m_settings.m_squelch * 10.0);
if (m_settings.m_deltaSquelch)
{
ui->squelchText->setText(QString("%1").arg((-m_settings.m_squelch) / 10.0, 0, 'f', 1));
ui->squelchText->setToolTip(tr("Squelch AF balance threshold (%)"));
ui->squelch->setToolTip(tr("Squelch AF balance threshold (%)"));
}
else
{
ui->squelchText->setText(QString("%1").arg(m_settings.m_squelch / 10.0, 0, 'f', 1));
ui->squelchText->setToolTip(tr("Squelch power threshold (dB)"));
ui->squelch->setToolTip(tr("Squelch AF balance threshold (%)"));
}
ui->ctcssOn->setChecked(m_settings.m_ctcssOn);
ui->audioMute->setChecked(m_settings.m_audioMute);
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex);
blockApplySettings(false);
}
void NFMDemodGUI::displayUDPAddress() void NFMDemodGUI::displayUDPAddress()
{ {
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort())); ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));

View File

@ -77,6 +77,7 @@ private:
void blockApplySettings(bool block); void blockApplySettings(bool block);
void applySettings(bool force = false); void applySettings(bool force = false);
void displaySettings();
void displayUDPAddress(); void displayUDPAddress();
void leaveEvent(QEvent*); void leaveEvent(QEvent*);

View File

@ -51,6 +51,9 @@ void NFMDemodSettings::resetToDefaults()
m_audioMute = false; m_audioMute = false;
m_ctcssIndex = 0; m_ctcssIndex = 0;
m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate(); m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate();
m_copyAudioToUDP = false;
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
m_rgbColor = QColor(255, 0, 0).rgb(); m_rgbColor = QColor(255, 0, 0).rgb();
} }

View File

@ -65,7 +65,6 @@ bool SSBDemodGUI::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) if(m_settings.deserialize(data))
{ {
updateChannelMarker();
displaySettings(); displaySettings();
applySettings(true); // will have true applySettings(true); // will have true
return true; return true;
@ -452,8 +451,6 @@ void SSBDemodGUI::displaySettings()
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth * 2); m_channelMarker.setBandwidth(m_settings.m_rfBandwidth * 2);
m_channelMarker.setLowCutoff(m_settings.m_lowCutoff); m_channelMarker.setLowCutoff(m_settings.m_lowCutoff);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
@ -469,6 +466,8 @@ void SSBDemodGUI::displaySettings()
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true); blockApplySettings(true);
ui->agc->setChecked(m_settings.m_agc); ui->agc->setChecked(m_settings.m_agc);
@ -517,16 +516,6 @@ void SSBDemodGUI::displayUDPAddress()
//TODO: ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort())); //TODO: ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
} }
void SSBDemodGUI::updateChannelMarker()
{
m_channelMarker.blockSignals(true);
//m_channelMarker.deserialize(m_settings.m_channelMarkerBytes);
this->setWindowTitle(m_channelMarker.getTitle());
m_channelMarker.blockSignals(false);
}
void SSBDemodGUI::displayAGCPowerThreshold(int value) void SSBDemodGUI::displayAGCPowerThreshold(int value)
{ {
if (value == -99) if (value == -99)

View File

@ -90,7 +90,6 @@ private:
void applySettings(bool force = false); void applySettings(bool force = false);
void displaySettings(); void displaySettings();
void displayUDPAddress(); void displayUDPAddress();
void updateChannelMarker();
void displayAGCPowerThreshold(int value); void displayAGCPowerThreshold(int value);

View File

@ -87,7 +87,7 @@ bool WFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
void WFMDemodGUI::channelMarkerChanged() void WFMDemodGUI::channelMarkerChanged()
{ {
this->setWindowTitle(m_channelMarker.getTitle()); setWindowTitle(m_channelMarker.getTitle());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
@ -232,9 +232,15 @@ void WFMDemodGUI::applySettings(bool force)
void WFMDemodGUI::displaySettings() void WFMDemodGUI::displaySettings()
{ {
blockApplySettings(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset); setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
ui->rfBW->setCurrentIndex(WFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth)); ui->rfBW->setCurrentIndex(WFMDemodSettings::getRFBWIndex(m_settings.m_rfBandwidth));
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth); m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
@ -248,14 +254,6 @@ void WFMDemodGUI::displaySettings()
ui->squelch->setValue(m_settings.m_squelch); ui->squelch->setValue(m_settings.m_squelch);
ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch)); ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch));
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false);
blockApplySettings(false); blockApplySettings(false);
} }

View File

@ -300,12 +300,12 @@ void TCPSrcGUI::displaySettings()
{ {
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0)); ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0));
setSampleFormatIndex(m_settings.m_sampleFormat); setSampleFormatIndex(m_settings.m_sampleFormat);

View File

@ -101,10 +101,10 @@ void UDPSrcGUI::channelMarkerChanged()
{ {
//m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); //m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
//m_settings.m_rfBandwidth = m_channelMarker.getBandwidth(); //m_settings.m_rfBandwidth = m_channelMarker.getBandwidth();
setWindowTitle(m_channelMarker.getTitle());
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
this->setWindowTitle(m_channelMarker.getTitle());
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
displayUDPAddress(); displayUDPAddress();
applySettings(); applySettings();
@ -213,12 +213,12 @@ void UDPSrcGUI::displaySettings()
{ {
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setUDPAddress(m_settings.m_udpAddress);
m_channelMarker.setUDPSendPort(m_settings.m_udpPort);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);
setTitleColor(m_settings.m_rgbColor); setTitleColor(m_settings.m_rgbColor);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
setWindowTitle(m_channelMarker.getTitle());
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0)); ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0));
setSampleFormatIndex(m_settings.m_sampleFormat); setSampleFormatIndex(m_settings.m_sampleFormat);