Added filter width parameter. Added filter center right click option.
This commit is contained in:
parent
8800befef8
commit
98760a6d42
@ -7541,7 +7541,9 @@ void MainWindow::on_actionJS8_triggered()
|
||||
updateModeButtonText();
|
||||
|
||||
m_wideGraph->setSubMode(m_nSubMode);
|
||||
#if JS8_ENFORCE_MINIMUM_FILTER_BANDWIDTH
|
||||
m_wideGraph->setFilterMinimumBandwidth(computeBandwidthForSubmode(m_nSubMode) + 2*rxThreshold(m_nSubMode));
|
||||
#endif
|
||||
|
||||
bool bVHF=m_config.enable_VHF_features();
|
||||
enable_DXCC_entity (m_config.DXCC ());
|
||||
|
@ -85,6 +85,12 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
||||
ui->filterCheckBox->setChecked(true);
|
||||
});
|
||||
|
||||
auto centerAction = menu->addAction(QString("Set Filter &Center to %1 Hz").arg(f));
|
||||
connect(centerAction, &QAction::triggered, this, [this, f](){
|
||||
ui->filterCenterSpinBox->setValue(f);
|
||||
ui->filterCheckBox->setChecked(true);
|
||||
});
|
||||
|
||||
auto maxAction = menu->addAction(QString("Set Filter Ma&ximum to %1 Hz").arg(f));
|
||||
connect(maxAction, &QAction::triggered, this, [this, f](){
|
||||
ui->filterMaxSpinBox->setValue(f);
|
||||
@ -397,10 +403,12 @@ void WideGraph::setFilter(int a, int b){
|
||||
int low = std::min(a, b);
|
||||
int high = std::max(a, b);
|
||||
|
||||
#if JS8_ENFORCE_MINIMUM_FILTER_BANDWIDTH
|
||||
// ensure minimum filter width
|
||||
if(high-low < m_filterMinWidth){
|
||||
high = low + m_filterMinWidth;
|
||||
}
|
||||
#endif
|
||||
|
||||
int width = high - low;
|
||||
int center = low + width / 2;
|
||||
@ -430,6 +438,12 @@ void WideGraph::setFilter(int a, int b){
|
||||
}
|
||||
ui->filterCenterSpinBox->blockSignals(blocked);
|
||||
|
||||
blocked = ui->filterWidthSpinBox->blockSignals(true);
|
||||
{
|
||||
ui->filterWidthSpinBox->setValue(width);
|
||||
}
|
||||
ui->filterWidthSpinBox->blockSignals(blocked);
|
||||
|
||||
// update the wide plot UI
|
||||
ui->widePlot->setFilterCenter(center);
|
||||
ui->widePlot->setFilterWidth(width);
|
||||
@ -447,6 +461,7 @@ void WideGraph::setFilterEnabled(bool enabled){
|
||||
ui->filterMinSpinBox->setEnabled(enabled);
|
||||
ui->filterMaxSpinBox->setEnabled(enabled);
|
||||
ui->filterCenterSpinBox->setEnabled(enabled);
|
||||
ui->filterWidthSpinBox->setEnabled(enabled);
|
||||
|
||||
// update the checkbox ui
|
||||
bool blocked = ui->filterCheckBox->blockSignals(true);
|
||||
@ -737,6 +752,10 @@ void WideGraph::on_filterCenterSpinBox_valueChanged(int n){
|
||||
setFilter(m_filterMinimum + delta, m_filterMaximum + delta);
|
||||
}
|
||||
|
||||
void WideGraph::on_filterWidthSpinBox_valueChanged(int n){
|
||||
setFilter(m_filterCenter - n/2, m_filterCenter - n/2 + n);
|
||||
}
|
||||
|
||||
void WideGraph::on_filterCheckBox_toggled(bool b){
|
||||
setFilterEnabled(b);
|
||||
}
|
||||
|
@ -100,6 +100,7 @@ private slots:
|
||||
void on_filterMinSpinBox_valueChanged(int n);
|
||||
void on_filterMaxSpinBox_valueChanged(int n);
|
||||
void on_filterCenterSpinBox_valueChanged(int n);
|
||||
void on_filterWidthSpinBox_valueChanged(int n);
|
||||
void on_filterCheckBox_toggled(bool b);
|
||||
void on_filterOpacitySpinBox_valueChanged(int n);
|
||||
|
||||
|
31
widegraph.ui
31
widegraph.ui
@ -172,9 +172,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-196</y>
|
||||
<width>267</width>
|
||||
<height>370</height>
|
||||
<height>402</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
@ -293,7 +293,7 @@
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>500</number>
|
||||
@ -318,7 +318,7 @@
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2500</number>
|
||||
@ -340,7 +340,26 @@
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1500</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="filterWidthSpinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> Hz</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Width: </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1000</number>
|
||||
@ -395,7 +414,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-517</y>
|
||||
<y>0</y>
|
||||
<width>267</width>
|
||||
<height>691</height>
|
||||
</rect>
|
||||
|
Loading…
Reference in New Issue
Block a user