mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-23 00:18:37 -05:00
Demod GUI corrections
This commit is contained in:
parent
aa0eea3ba8
commit
8c2483a850
@ -81,7 +81,6 @@ QByteArray AMDemodGUI::serialize() const
|
||||
bool AMDemodGUI::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
updateChannelMarker();
|
||||
displaySettings();
|
||||
applySettings(true);
|
||||
return true;
|
||||
@ -98,7 +97,7 @@ bool AMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
|
||||
|
||||
void AMDemodGUI::channelMarkerChanged()
|
||||
{
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
||||
@ -245,12 +244,20 @@ void AMDemodGUI::applySettings(bool force)
|
||||
|
||||
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);
|
||||
|
||||
int displayValue = m_settings.m_rfBandwidth/100.0;
|
||||
ui->rfBW->setValue(displayValue);
|
||||
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->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->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);
|
||||
}
|
||||
|
||||
@ -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()));
|
||||
}
|
||||
|
||||
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*)
|
||||
{
|
||||
blockApplySettings(true);
|
||||
|
@ -74,7 +74,6 @@ private:
|
||||
void applySettings(bool force = false);
|
||||
void displaySettings();
|
||||
void displayUDPAddress();
|
||||
void updateChannelMarker();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(QEvent*);
|
||||
|
@ -14,6 +14,8 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QColor>
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "settings/serializable.h"
|
||||
@ -38,6 +40,7 @@ void AMDemodSettings::resetToDefaults()
|
||||
m_copyAudioToUDP = false;
|
||||
m_udpAddress = "127.0.0.1";
|
||||
m_udpPort = 9999;
|
||||
m_rgbColor = QColor(255, 255, 0).rgb();
|
||||
}
|
||||
|
||||
QByteArray AMDemodSettings::serialize() const
|
||||
|
@ -98,7 +98,6 @@ QByteArray BFMDemodGUI::serialize() const
|
||||
bool BFMDemodGUI::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
updateChannelMarker();
|
||||
displaySettings();
|
||||
applySettings(true);
|
||||
return true;
|
||||
@ -141,7 +140,7 @@ void BFMDemodGUI::handleInputMessages()
|
||||
|
||||
void BFMDemodGUI::channelMarkerChanged()
|
||||
{
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||
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()));
|
||||
}
|
||||
|
||||
void BFMDemodGUI::updateChannelMarker()
|
||||
{
|
||||
m_channelMarker.blockSignals(true);
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
m_channelMarker.blockSignals(false);
|
||||
}
|
||||
|
||||
void BFMDemodGUI::blockApplySettings(bool block)
|
||||
{
|
||||
m_doApplySettings = !block;
|
||||
@ -422,9 +414,15 @@ void BFMDemodGUI::applySettings(bool force)
|
||||
|
||||
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->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->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);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,6 @@ private:
|
||||
void applySettings(bool force = false);
|
||||
void displaySettings();
|
||||
void displayUDPAddress();
|
||||
void updateChannelMarker();
|
||||
void rdsUpdate(bool force);
|
||||
void rdsUpdateFixedFields();
|
||||
|
||||
|
@ -322,17 +322,16 @@ void DSDDemodGUI::displayUDPAddress()
|
||||
|
||||
void DSDDemodGUI::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
|
||||
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);
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setTitleColor(m_settings.m_rgbColor);
|
||||
m_channelMarker.blockSignals(false);
|
||||
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
|
||||
blockApplySettings(true);
|
||||
|
||||
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
||||
|
||||
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
|
||||
@ -542,7 +541,7 @@ void DSDDemodGUI::formatStatusText()
|
||||
|
||||
void DSDDemodGUI::channelMarkerChanged()
|
||||
{
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
displayUDPAddress();
|
||||
applySettings();
|
||||
}
|
||||
|
@ -196,12 +196,7 @@ void LoRaDemodGUI::applySettings(bool force)
|
||||
|
||||
void LoRaDemodGUI::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
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.setBandwidth(thisBW);
|
||||
@ -209,4 +204,9 @@ void LoRaDemodGUI::displaySettings()
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor);
|
||||
setTitleColor(m_settings.m_rgbColor);
|
||||
m_channelMarker.blockSignals(false);
|
||||
|
||||
blockApplySettings(true);
|
||||
ui->BWText->setText(QString("%1 Hz").arg(thisBW));
|
||||
ui->BW->setValue(m_settings.m_bandwidthIndex);
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
@ -51,103 +51,103 @@ void NFMDemodGUI::setCenterFrequency(qint64 centerFrequency)
|
||||
|
||||
void NFMDemodGUI::resetToDefaults()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
|
||||
ui->rfBW->setCurrentIndex(4);
|
||||
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();
|
||||
m_settings.resetToDefaults();
|
||||
displaySettings();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
QByteArray NFMDemodGUI::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
s.writeS32(1, m_channelMarker.getCenterFrequency());
|
||||
s.writeS32(2, ui->rfBW->currentIndex());
|
||||
s.writeS32(3, ui->afBW->value());
|
||||
s.writeS32(4, ui->volume->value());
|
||||
s.writeS32(5, ui->squelch->value());
|
||||
s.writeU32(7, m_channelMarker.getColor().rgb());
|
||||
s.writeS32(8, ui->ctcss->currentIndex());
|
||||
s.writeBool(9, ui->ctcssOn->isChecked());
|
||||
s.writeBool(10, ui->audioMute->isChecked());
|
||||
s.writeS32(11, ui->squelchGate->value());
|
||||
s.writeBool(12, ui->deltaSquelch->isChecked());
|
||||
s.writeBlob(13, m_channelMarker.serialize());
|
||||
return s.final();
|
||||
return m_settings.serialize();
|
||||
// SimpleSerializer s(1);
|
||||
// s.writeS32(1, m_channelMarker.getCenterFrequency());
|
||||
// s.writeS32(2, ui->rfBW->currentIndex());
|
||||
// s.writeS32(3, ui->afBW->value());
|
||||
// s.writeS32(4, ui->volume->value());
|
||||
// s.writeS32(5, ui->squelch->value());
|
||||
// s.writeU32(7, m_channelMarker.getColor().rgb());
|
||||
// s.writeS32(8, ui->ctcss->currentIndex());
|
||||
// s.writeBool(9, ui->ctcssOn->isChecked());
|
||||
// s.writeBool(10, ui->audioMute->isChecked());
|
||||
// s.writeS32(11, ui->squelchGate->value());
|
||||
// s.writeBool(12, ui->deltaSquelch->isChecked());
|
||||
// s.writeBlob(13, m_channelMarker.serialize());
|
||||
// return s.final();
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (d.getVersion() == 1)
|
||||
{
|
||||
QByteArray bytetmp;
|
||||
quint32 u32tmp;
|
||||
qint32 tmp;
|
||||
bool boolTmp;
|
||||
|
||||
blockApplySettings(true);
|
||||
m_channelMarker.blockSignals(true);
|
||||
|
||||
d.readBlob(13, &bytetmp);
|
||||
m_channelMarker.deserialize(bytetmp);
|
||||
|
||||
d.readS32(1, &tmp, 0);
|
||||
m_channelMarker.setCenterFrequency(tmp);
|
||||
d.readS32(2, &tmp, 4);
|
||||
ui->rfBW->setCurrentIndex(tmp);
|
||||
d.readS32(3, &tmp, 3);
|
||||
ui->afBW->setValue(tmp);
|
||||
d.readS32(4, &tmp, 20);
|
||||
ui->volume->setValue(tmp);
|
||||
d.readS32(5, &tmp, -40);
|
||||
ui->squelch->setValue(tmp);
|
||||
|
||||
if(d.readU32(7, &u32tmp))
|
||||
{
|
||||
m_channelMarker.setColor(u32tmp);
|
||||
}
|
||||
|
||||
d.readS32(8, &tmp, 0);
|
||||
ui->ctcss->setCurrentIndex(tmp);
|
||||
d.readBool(9, &boolTmp, false);
|
||||
ui->ctcssOn->setChecked(boolTmp);
|
||||
d.readBool(10, &boolTmp, false);
|
||||
ui->audioMute->setChecked(boolTmp);
|
||||
d.readS32(11, &tmp, 5);
|
||||
ui->squelchGate->setValue(tmp);
|
||||
d.readBool(12, &boolTmp, false);
|
||||
ui->deltaSquelch->setChecked(boolTmp);
|
||||
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
displayUDPAddress();
|
||||
|
||||
blockApplySettings(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
|
||||
applySettings(true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
// SimpleDeserializer d(data);
|
||||
//
|
||||
// if (!d.isValid())
|
||||
// {
|
||||
// resetToDefaults();
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// if (d.getVersion() == 1)
|
||||
// {
|
||||
// QByteArray bytetmp;
|
||||
// quint32 u32tmp;
|
||||
// qint32 tmp;
|
||||
// bool boolTmp;
|
||||
//
|
||||
// blockApplySettings(true);
|
||||
// m_channelMarker.blockSignals(true);
|
||||
//
|
||||
// d.readBlob(13, &bytetmp);
|
||||
// m_channelMarker.deserialize(bytetmp);
|
||||
//
|
||||
// d.readS32(1, &tmp, 0);
|
||||
// m_channelMarker.setCenterFrequency(tmp);
|
||||
// d.readS32(2, &tmp, 4);
|
||||
// ui->rfBW->setCurrentIndex(tmp);
|
||||
// d.readS32(3, &tmp, 3);
|
||||
// ui->afBW->setValue(tmp);
|
||||
// d.readS32(4, &tmp, 20);
|
||||
// ui->volume->setValue(tmp);
|
||||
// d.readS32(5, &tmp, -40);
|
||||
// ui->squelch->setValue(tmp);
|
||||
//
|
||||
// if(d.readU32(7, &u32tmp))
|
||||
// {
|
||||
// m_channelMarker.setColor(u32tmp);
|
||||
// }
|
||||
//
|
||||
// d.readS32(8, &tmp, 0);
|
||||
// ui->ctcss->setCurrentIndex(tmp);
|
||||
// d.readBool(9, &boolTmp, false);
|
||||
// ui->ctcssOn->setChecked(boolTmp);
|
||||
// d.readBool(10, &boolTmp, false);
|
||||
// ui->audioMute->setChecked(boolTmp);
|
||||
// d.readS32(11, &tmp, 5);
|
||||
// ui->squelchGate->setValue(tmp);
|
||||
// d.readBool(12, &boolTmp, false);
|
||||
// ui->deltaSquelch->setChecked(boolTmp);
|
||||
//
|
||||
// this->setWindowTitle(m_channelMarker.getTitle());
|
||||
// displayUDPAddress();
|
||||
//
|
||||
// blockApplySettings(false);
|
||||
// m_channelMarker.blockSignals(false);
|
||||
//
|
||||
// applySettings(true);
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// resetToDefaults();
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
bool NFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
|
||||
@ -178,7 +178,7 @@ void NFMDemodGUI::handleInputMessages()
|
||||
|
||||
void NFMDemodGUI::channelMarkerChanged()
|
||||
{
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
||||
@ -348,15 +348,15 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidg
|
||||
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
|
||||
|
||||
//m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker.setColor(Qt::red);
|
||||
m_channelMarker.setBandwidth(12500);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
// m_channelMarker.setColor(Qt::red);
|
||||
// m_channelMarker.setBandwidth(12500);
|
||||
// m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
m_channelMarker.setTitle("NFM Demodulator");
|
||||
m_channelMarker.setUDPAddress("127.0.0.1");
|
||||
m_channelMarker.setUDPSendPort(9999);
|
||||
m_channelMarker.setVisible(true);
|
||||
setTitleColor(m_channelMarker.getColor());
|
||||
// m_channelMarker.setUDPAddress("127.0.0.1");
|
||||
// m_channelMarker.setUDPSendPort(9999);
|
||||
// setTitleColor(m_channelMarker.getColor());
|
||||
m_settings.setChannelMarker(&m_channelMarker);
|
||||
|
||||
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()));
|
||||
|
||||
displaySettings();
|
||||
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()
|
||||
{
|
||||
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_channelMarker.getUDPAddress()).arg(m_channelMarker.getUDPSendPort()));
|
||||
|
@ -77,6 +77,7 @@ private:
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySettings(bool force = false);
|
||||
void displaySettings();
|
||||
void displayUDPAddress();
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
|
@ -51,6 +51,9 @@ void NFMDemodSettings::resetToDefaults()
|
||||
m_audioMute = false;
|
||||
m_ctcssIndex = 0;
|
||||
m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate();
|
||||
m_copyAudioToUDP = false;
|
||||
m_udpAddress = "127.0.0.1";
|
||||
m_udpPort = 9999;
|
||||
m_rgbColor = QColor(255, 0, 0).rgb();
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,6 @@ bool SSBDemodGUI::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data))
|
||||
{
|
||||
updateChannelMarker();
|
||||
displaySettings();
|
||||
applySettings(true); // will have true
|
||||
return true;
|
||||
@ -452,8 +451,6 @@ void SSBDemodGUI::displaySettings()
|
||||
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
||||
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth * 2);
|
||||
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);
|
||||
setTitleColor(m_settings.m_rgbColor);
|
||||
|
||||
@ -469,6 +466,8 @@ void SSBDemodGUI::displaySettings()
|
||||
|
||||
m_channelMarker.blockSignals(false);
|
||||
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
|
||||
blockApplySettings(true);
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (value == -99)
|
||||
|
@ -90,7 +90,6 @@ private:
|
||||
void applySettings(bool force = false);
|
||||
void displaySettings();
|
||||
void displayUDPAddress();
|
||||
void updateChannelMarker();
|
||||
|
||||
void displayAGCPowerThreshold(int value);
|
||||
|
||||
|
@ -87,7 +87,7 @@ bool WFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
|
||||
|
||||
void WFMDemodGUI::channelMarkerChanged()
|
||||
{
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
||||
@ -232,9 +232,15 @@ void WFMDemodGUI::applySettings(bool force)
|
||||
|
||||
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));
|
||||
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth);
|
||||
@ -248,14 +254,6 @@ void WFMDemodGUI::displaySettings()
|
||||
ui->squelch->setValue(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);
|
||||
}
|
||||
|
||||
|
@ -300,12 +300,12 @@ void TCPSrcGUI::displaySettings()
|
||||
{
|
||||
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);
|
||||
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
|
||||
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
||||
ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0));
|
||||
setSampleFormatIndex(m_settings.m_sampleFormat);
|
||||
|
@ -101,10 +101,10 @@ void UDPSrcGUI::channelMarkerChanged()
|
||||
{
|
||||
//m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
|
||||
//m_settings.m_rfBandwidth = m_channelMarker.getBandwidth();
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
||||
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
||||
this->setWindowTitle(m_channelMarker.getTitle());
|
||||
setTitleColor(m_settings.m_rgbColor);
|
||||
displayUDPAddress();
|
||||
applySettings();
|
||||
@ -213,12 +213,12 @@ void UDPSrcGUI::displaySettings()
|
||||
{
|
||||
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);
|
||||
|
||||
setWindowTitle(m_channelMarker.getTitle());
|
||||
|
||||
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
||||
ui->sampleRate->setText(QString("%1").arg(m_settings.m_outputSampleRate, 0));
|
||||
setSampleFormatIndex(m_settings.m_sampleFormat);
|
||||
|
Loading…
Reference in New Issue
Block a user