mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
PlutoSDR output: use settings in GUI
This commit is contained in:
parent
0b7f62866f
commit
13c8f2ea9e
@ -374,10 +374,11 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pare
|
||||
|
||||
ui->cwKeyerGUI->setBuddies(m_amMod->getInputMessageQueue(), m_amMod->getCWKeyer());
|
||||
|
||||
applySettings();
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
connect(m_amMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
|
||||
|
||||
displaySettings();
|
||||
applySettings(true);
|
||||
}
|
||||
|
||||
AMModGUI::~AMModGUI()
|
||||
@ -422,18 +423,17 @@ void AMModGUI::displaySettings()
|
||||
{
|
||||
blockApplySettings(true);
|
||||
|
||||
ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0);
|
||||
ui->rfBW->setValue(roundf(m_settings.m_rfBandwidth / 100.0));
|
||||
ui->rfBWText->setText(QString("%1 kHz").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1));
|
||||
|
||||
int modPercent = m_settings.m_modFactor * 100.0;
|
||||
int modPercent = roundf(m_settings.m_modFactor * 100.0);
|
||||
ui->modPercent->setValue(modPercent);
|
||||
ui->modPercentText->setText(QString("%1").arg(modPercent));
|
||||
|
||||
ui->toneFrequency->setValue(m_settings.m_toneFrequency / 10.0);
|
||||
ui->toneFrequency->setValue(roundf(m_settings.m_toneFrequency / 10.0));
|
||||
ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
|
||||
|
||||
int volume = m_settings.m_volumeFactor * 10.0;
|
||||
ui->volume->setValue(volume);
|
||||
ui->volume->setValue(roundf(m_settings.m_volumeFactor * 10.0));
|
||||
ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
|
||||
|
||||
ui->channelMute->setChecked(m_settings.m_channelMute);
|
||||
|
@ -48,11 +48,11 @@ QByteArray AMModSettings::serialize() const
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeS32(1, m_inputFrequencyOffset);
|
||||
s.writeS32(2, m_rfBandwidth / 100.0);
|
||||
s.writeS32(3, m_toneFrequency / 10.0);
|
||||
s.writeS32(4, m_modFactor * 100.0);
|
||||
s.writeReal(2, m_rfBandwidth);
|
||||
s.writeReal(3, m_toneFrequency);
|
||||
s.writeReal(4, m_modFactor);
|
||||
s.writeU32(5, m_rgbColor);
|
||||
s.writeS32(6, m_volumeFactor * 10.0);
|
||||
s.writeReal(6, m_volumeFactor);
|
||||
|
||||
if (m_cwKeyerGUI) {
|
||||
s.writeBlob(7, m_cwKeyerGUI->serialize());
|
||||
@ -82,15 +82,11 @@ bool AMModSettings::deserialize(const QByteArray& data)
|
||||
|
||||
d.readS32(1, &tmp, 0);
|
||||
m_inputFrequencyOffset = tmp;
|
||||
d.readS32(2, &tmp, 125);
|
||||
m_rfBandwidth = tmp * 100.0;
|
||||
d.readS32(3, &tmp, 100);
|
||||
m_toneFrequency = tmp * 10;
|
||||
d.readS32(4, &tmp, 20);
|
||||
m_modFactor = tmp / 100.0;
|
||||
d.readReal(2, &m_rfBandwidth, 12500.0);
|
||||
d.readReal(3, &m_toneFrequency, 1000.0);
|
||||
d.readReal(4, &m_modFactor, 0.2f);
|
||||
d.readU32(5, &m_rgbColor);
|
||||
d.readS32(6, &tmp, 10);
|
||||
m_volumeFactor = tmp / 10.0;
|
||||
d.readReal(6, &m_volumeFactor, 1.0);
|
||||
|
||||
if (m_cwKeyerGUI) {
|
||||
d.readBlob(7, &bytetmp);
|
||||
|
Loading…
Reference in New Issue
Block a user