mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-09 10:12:25 -04:00
SSB modulator: use settings in GUI (3)
This commit is contained in:
parent
f3513f9d9a
commit
d2c7b6c26b
@ -620,12 +620,19 @@ bool SSBMod::handleMessage(const Message& cmd)
|
|||||||
m_config.m_playLoop = cfg.getPlayLoop();
|
m_config.m_playLoop = cfg.getPlayLoop();
|
||||||
m_config.m_agc = cfg.getAGC();
|
m_config.m_agc = cfg.getAGC();
|
||||||
|
|
||||||
m_config.m_agcTime = 48 * cfg.getAGCTime(); // ms
|
m_config.m_agcTime = cfg.getAGCTime(); // ms
|
||||||
m_config.m_agcOrder = cfg.getAGCOrder();
|
m_config.m_agcOrder = cfg.getAGCOrder();
|
||||||
m_config.m_agcThresholdEnable = cfg.getAGCThreshold() != -99;
|
m_config.m_agcThresholdEnable = cfg.getAGCThreshold() != -99;
|
||||||
m_config.m_agcThreshold = CalcDb::powerFromdB(cfg.getAGCThreshold()); // power dB
|
m_config.m_agcThreshold = CalcDb::powerFromdB(cfg.getAGCThreshold()); // power dB
|
||||||
m_config.m_agcThresholdGate = 48 * cfg.getAGCThresholdGate(); // ms
|
m_config.m_agcThresholdGate = cfg.getAGCThresholdGate(); // ms
|
||||||
m_config.m_agcThresholdDelay = 48 * cfg.getAGCThresholdDelay(); // ms
|
m_config.m_agcThresholdDelay = cfg.getAGCThresholdDelay(); // ms
|
||||||
|
|
||||||
|
// m_config.m_agcTime = 48 * cfg.getAGCTime(); // ms
|
||||||
|
// m_config.m_agcOrder = cfg.getAGCOrder();
|
||||||
|
// m_config.m_agcThresholdEnable = cfg.getAGCThreshold() != -99;
|
||||||
|
// m_config.m_agcThreshold = CalcDb::powerFromdB(cfg.getAGCThreshold()); // power dB
|
||||||
|
// m_config.m_agcThresholdGate = 48 * cfg.getAGCThresholdGate(); // ms
|
||||||
|
// m_config.m_agcThresholdDelay = 48 * cfg.getAGCThresholdDelay(); // ms
|
||||||
|
|
||||||
apply();
|
apply();
|
||||||
|
|
||||||
@ -644,6 +651,7 @@ bool SSBMod::handleMessage(const Message& cmd)
|
|||||||
<< " m_playLoop: " << m_config.m_playLoop
|
<< " m_playLoop: " << m_config.m_playLoop
|
||||||
<< " m_agc: " << m_config.m_agc
|
<< " m_agc: " << m_config.m_agc
|
||||||
<< " m_agcTime: " << m_config.m_agcTime
|
<< " m_agcTime: " << m_config.m_agcTime
|
||||||
|
<< " m_agcOrder: " << m_config.m_agcOrder
|
||||||
<< " m_agcThresholdEnable: " << m_config.m_agcThresholdEnable
|
<< " m_agcThresholdEnable: " << m_config.m_agcThresholdEnable
|
||||||
<< " m_agcThreshold: " << m_config.m_agcThreshold
|
<< " m_agcThreshold: " << m_config.m_agcThreshold
|
||||||
<< " m_agcThresholdGate: " << m_config.m_agcThresholdGate
|
<< " m_agcThresholdGate: " << m_config.m_agcThresholdGate
|
||||||
|
@ -84,8 +84,7 @@ void SSBModGUI::resetToDefaults()
|
|||||||
|
|
||||||
ui->BW->setValue(30);
|
ui->BW->setValue(30);
|
||||||
ui->lowCut->setValue(3);
|
ui->lowCut->setValue(3);
|
||||||
ui->spanLog2->setValue(3);
|
ui->spanLog2->setValue(m_settings.m_spanLog2);
|
||||||
m_spanLog2 = 3;
|
|
||||||
ui->toneFrequency->setValue(100);
|
ui->toneFrequency->setValue(100);
|
||||||
ui->deltaFrequency->setValue(0);
|
ui->deltaFrequency->setValue(0);
|
||||||
ui->audioBinaural->setChecked(false);
|
ui->audioBinaural->setChecked(false);
|
||||||
@ -228,7 +227,7 @@ bool SSBModGUI::handleMessage(const Message& message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSBModGUI::channelMarkerChanged()
|
void SSBModGUI::channelMarkerUpdate()
|
||||||
{
|
{
|
||||||
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
||||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress();
|
m_settings.m_udpAddress = m_channelMarker.getUDPAddress();
|
||||||
@ -295,7 +294,7 @@ void SSBModGUI::on_dsb_toggled(bool checked)
|
|||||||
on_lowCut_valueChanged(m_channelMarker.getLowCutoff()/100);
|
on_lowCut_valueChanged(m_channelMarker.getLowCutoff()/100);
|
||||||
}
|
}
|
||||||
|
|
||||||
setNewRate(m_spanLog2);
|
setNewRate(m_settings.m_spanLog2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSBModGUI::on_audioBinaural_toggled(bool checked)
|
void SSBModGUI::on_audioBinaural_toggled(bool checked)
|
||||||
@ -336,7 +335,7 @@ void SSBModGUI::on_BW_valueChanged(int value)
|
|||||||
|
|
||||||
m_settings.m_bandwidth = value * 100;
|
m_settings.m_bandwidth = value * 100;
|
||||||
on_lowCut_valueChanged(m_channelMarker.getLowCutoff()/100);
|
on_lowCut_valueChanged(m_channelMarker.getLowCutoff()/100);
|
||||||
setNewRate(m_spanLog2);
|
setNewRate(m_settings.m_spanLog2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSBModGUI::on_lowCut_valueChanged(int value)
|
void SSBModGUI::on_lowCut_valueChanged(int value)
|
||||||
@ -466,14 +465,14 @@ void SSBModGUI::on_agcOrder_valueChanged(int value){
|
|||||||
void SSBModGUI::on_agcTime_valueChanged(int value){
|
void SSBModGUI::on_agcTime_valueChanged(int value){
|
||||||
QString s = QString::number(m_agcTimeConstant[value], 'f', 0);
|
QString s = QString::number(m_agcTimeConstant[value], 'f', 0);
|
||||||
ui->agcTimeText->setText(s);
|
ui->agcTimeText->setText(s);
|
||||||
m_settings.m_agcTime = value * 48;
|
m_settings.m_agcTime = m_agcTimeConstant[value] * 48;
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSBModGUI::on_agcThreshold_valueChanged(int value)
|
void SSBModGUI::on_agcThreshold_valueChanged(int value)
|
||||||
{
|
{
|
||||||
displayAGCPowerThreshold(value);
|
displayAGCPowerThreshold(value);
|
||||||
m_settings.m_agcThreshold = value;
|
m_settings.m_agcThreshold = value; // dB
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,7 +488,7 @@ void SSBModGUI::on_agcThresholdDelay_valueChanged(int value)
|
|||||||
{
|
{
|
||||||
QString s = QString::number(value * 10, 'f', 0);
|
QString s = QString::number(value * 10, 'f', 0);
|
||||||
ui->agcThresholdDelayText->setText(s);
|
ui->agcThresholdDelayText->setText(s);
|
||||||
m_settings.m_agcThresholdDelay = value * 48;
|
m_settings.m_agcThresholdDelay = value * 480;
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,10 +532,16 @@ void SSBModGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rol
|
|||||||
|
|
||||||
void SSBModGUI::onMenuDoubleClicked()
|
void SSBModGUI::onMenuDoubleClicked()
|
||||||
{
|
{
|
||||||
if(!m_basicSettingsShown) {
|
if (!m_basicSettingsShown)
|
||||||
|
{
|
||||||
m_basicSettingsShown = true;
|
m_basicSettingsShown = true;
|
||||||
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this);
|
BasicChannelSettingsWidget* bcsw = new BasicChannelSettingsWidget(&m_channelMarker, this);
|
||||||
bcsw->show();
|
bcsw->show();
|
||||||
|
|
||||||
|
if (bcsw->getHasChanged())
|
||||||
|
{
|
||||||
|
channelMarkerUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,7 +554,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
|
|||||||
m_basicSettingsShown(false),
|
m_basicSettingsShown(false),
|
||||||
m_doApplySettings(true),
|
m_doApplySettings(true),
|
||||||
m_rate(6000),
|
m_rate(6000),
|
||||||
m_spanLog2(3),
|
|
||||||
m_channelPowerDbAvg(20,0),
|
m_channelPowerDbAvg(20,0),
|
||||||
m_recordLength(0),
|
m_recordLength(0),
|
||||||
m_recordSampleRate(48000),
|
m_recordSampleRate(48000),
|
||||||
@ -593,8 +597,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
|
|||||||
m_channelMarker.setCenterFrequency(0);
|
m_channelMarker.setCenterFrequency(0);
|
||||||
m_channelMarker.setVisible(true);
|
m_channelMarker.setVisible(true);
|
||||||
|
|
||||||
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);
|
||||||
m_deviceAPI->addRollupWidget(this);
|
m_deviceAPI->addRollupWidget(this);
|
||||||
@ -604,7 +606,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* pa
|
|||||||
|
|
||||||
displaySettings();
|
displaySettings();
|
||||||
applySettings();
|
applySettings();
|
||||||
setNewRate(m_spanLog2);
|
setNewRate(m_settings.m_spanLog2);
|
||||||
|
|
||||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||||
connect(m_ssbMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
|
connect(m_ssbMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
|
||||||
@ -629,7 +631,7 @@ bool SSBModGUI::setNewRate(int spanLog2)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_spanLog2 = spanLog2;
|
m_settings.m_spanLog2 = spanLog2;
|
||||||
m_rate = 48000 / (1<<spanLog2);
|
m_rate = 48000 / (1<<spanLog2);
|
||||||
|
|
||||||
if (ui->BW->value() < -m_rate/100)
|
if (ui->BW->value() < -m_rate/100)
|
||||||
@ -720,7 +722,7 @@ void SSBModGUI::applySettings()
|
|||||||
m_settings.m_lowCutoff,
|
m_settings.m_lowCutoff,
|
||||||
m_settings.m_toneFrequency,
|
m_settings.m_toneFrequency,
|
||||||
m_settings.m_volumeFactor,
|
m_settings.m_volumeFactor,
|
||||||
m_spanLog2,
|
m_settings.m_spanLog2,
|
||||||
m_settings.m_audioBinaural,
|
m_settings.m_audioBinaural,
|
||||||
m_settings.m_audioFlipChannels,
|
m_settings.m_audioFlipChannels,
|
||||||
m_settings.m_dsb,
|
m_settings.m_dsb,
|
||||||
@ -728,10 +730,10 @@ void SSBModGUI::applySettings()
|
|||||||
m_settings.m_playLoop,
|
m_settings.m_playLoop,
|
||||||
m_settings.m_agc,
|
m_settings.m_agc,
|
||||||
m_settings.m_agcOrder,
|
m_settings.m_agcOrder,
|
||||||
m_agcTimeConstant[ui->agcTime->value()], // TBD
|
m_settings.m_agcTime,
|
||||||
ui->agcThreshold->value(),
|
m_settings.m_agcThreshold,
|
||||||
ui->agcThresholdGate->value(),
|
m_settings.m_agcThresholdGate,
|
||||||
ui->agcThresholdDelay->value() * 10);
|
m_settings.m_agcThresholdDelay);
|
||||||
|
|
||||||
// m_ssbMod->configure(m_ssbMod->getInputMessageQueue(),
|
// m_ssbMod->configure(m_ssbMod->getInputMessageQueue(),
|
||||||
// ui->BW->value() * 100.0f,
|
// ui->BW->value() * 100.0f,
|
||||||
|
@ -59,7 +59,6 @@ public:
|
|||||||
static const QString m_channelID;
|
static const QString m_channelID;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void channelMarkerChanged();
|
|
||||||
void handleSourceMessages();
|
void handleSourceMessages();
|
||||||
|
|
||||||
void on_deltaFrequency_changed(qint64 value);
|
void on_deltaFrequency_changed(qint64 value);
|
||||||
@ -133,6 +132,7 @@ private:
|
|||||||
void displayAGCPowerThreshold(int value);
|
void displayAGCPowerThreshold(int value);
|
||||||
void updateWithStreamData();
|
void updateWithStreamData();
|
||||||
void updateWithStreamTime();
|
void updateWithStreamTime();
|
||||||
|
void channelMarkerUpdate();
|
||||||
|
|
||||||
void leaveEvent(QEvent*);
|
void leaveEvent(QEvent*);
|
||||||
void enterEvent(QEvent*);
|
void enterEvent(QEvent*);
|
||||||
|
@ -531,7 +531,7 @@
|
|||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>4</number>
|
<number>7</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
BasicChannelSettingsWidget::BasicChannelSettingsWidget(ChannelMarker* marker, QWidget* parent) :
|
BasicChannelSettingsWidget::BasicChannelSettingsWidget(ChannelMarker* marker, QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::BasicChannelSettingsWidget),
|
ui(new Ui::BasicChannelSettingsWidget),
|
||||||
m_channelMarker(marker)
|
m_channelMarker(marker),
|
||||||
|
m_hasChanged(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->title->setText(m_channelMarker->getTitle());
|
ui->title->setText(m_channelMarker->getTitle());
|
||||||
@ -24,6 +25,7 @@ BasicChannelSettingsWidget::~BasicChannelSettingsWidget()
|
|||||||
void BasicChannelSettingsWidget::on_title_textChanged(const QString& text)
|
void BasicChannelSettingsWidget::on_title_textChanged(const QString& text)
|
||||||
{
|
{
|
||||||
m_channelMarker->setTitle(text);
|
m_channelMarker->setTitle(text);
|
||||||
|
m_hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicChannelSettingsWidget::on_colorBtn_clicked()
|
void BasicChannelSettingsWidget::on_colorBtn_clicked()
|
||||||
@ -33,12 +35,14 @@ void BasicChannelSettingsWidget::on_colorBtn_clicked()
|
|||||||
if(c.isValid()) {
|
if(c.isValid()) {
|
||||||
m_channelMarker->setColor(c);
|
m_channelMarker->setColor(c);
|
||||||
paintColor();
|
paintColor();
|
||||||
|
m_hasChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicChannelSettingsWidget::on_address_textEdited(const QString& arg1)
|
void BasicChannelSettingsWidget::on_address_textEdited(const QString& arg1)
|
||||||
{
|
{
|
||||||
m_channelMarker->setUDPAddress(arg1);
|
m_channelMarker->setUDPAddress(arg1);
|
||||||
|
m_hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicChannelSettingsWidget::on_port_textEdited(const QString& arg1)
|
void BasicChannelSettingsWidget::on_port_textEdited(const QString& arg1)
|
||||||
@ -52,6 +56,7 @@ void BasicChannelSettingsWidget::on_port_textEdited(const QString& arg1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_channelMarker->setUDPReceivePort(udpPort);
|
m_channelMarker->setUDPReceivePort(udpPort);
|
||||||
|
m_hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicChannelSettingsWidget::paintColor()
|
void BasicChannelSettingsWidget::paintColor()
|
||||||
|
@ -17,6 +17,7 @@ public:
|
|||||||
explicit BasicChannelSettingsWidget(ChannelMarker* marker, QWidget* parent = NULL);
|
explicit BasicChannelSettingsWidget(ChannelMarker* marker, QWidget* parent = NULL);
|
||||||
~BasicChannelSettingsWidget();
|
~BasicChannelSettingsWidget();
|
||||||
void setUDPDialogVisible(bool visible);
|
void setUDPDialogVisible(bool visible);
|
||||||
|
bool getHasChanged() const { return m_hasChanged; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_title_textChanged(const QString& text);
|
void on_title_textChanged(const QString& text);
|
||||||
@ -27,6 +28,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::BasicChannelSettingsWidget* ui;
|
Ui::BasicChannelSettingsWidget* ui;
|
||||||
ChannelMarker* m_channelMarker;
|
ChannelMarker* m_channelMarker;
|
||||||
|
bool m_hasChanged;
|
||||||
|
|
||||||
void paintColor();
|
void paintColor();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user