1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-24 19:14:15 -04:00

SSB demod: reworked AGC to handle the threshold gate properly

This commit is contained in:
f4exb
2019-06-09 09:25:18 +02:00
parent 2cefa0ed69
commit fb0ec4a680
7 changed files with 60 additions and 57 deletions
+17 -6
View File
@@ -202,9 +202,10 @@ void SSBDemodGUI::on_agcPowerThreshold_valueChanged(int value)
void SSBDemodGUI::on_agcThresholdGate_valueChanged(int value)
{
QString s = QString::number(value, 'f', 0);
int agcThresholdGate = value < 20 ? value : ((value - 20) * 10) + 20;
QString s = QString::number(agcThresholdGate, 'f', 0);
ui->agcThresholdGateText->setText(s);
m_settings.m_agcThresholdGate = value;
m_settings.m_agcThresholdGate = agcThresholdGate;
applySettings();
}
@@ -565,10 +566,7 @@ void SSBDemodGUI::displaySettings()
ui->agcPowerThreshold->setValue(m_settings.m_agcPowerThreshold);
displayAGCPowerThreshold(ui->agcPowerThreshold->value());
ui->agcThresholdGate->setValue(m_settings.m_agcThresholdGate);
s = QString::number(ui->agcThresholdGate->value(), 'f', 0);
ui->agcThresholdGateText->setText(s);
displayAGCThresholdGate(m_settings.m_agcThresholdGate);
blockApplySettings(false);
}
@@ -586,6 +584,19 @@ void SSBDemodGUI::displayAGCPowerThreshold(int value)
}
}
void SSBDemodGUI::displayAGCThresholdGate(int value)
{
QString s = QString::number(value, 'f', 0);
ui->agcThresholdGateText->setText(s);
int dialValue = value;
if (value > 20) {
dialValue = ((value - 20) / 10) + 20;
}
ui->agcThresholdGate->setValue(dialValue);
}
void SSBDemodGUI::leaveEvent(QEvent*)
{
m_channelMarker.setHighlighted(false);