Filter center, width, and min. Much easier to use. No cumbersome jumping around.
This commit is contained in:
parent
26766283c3
commit
ef8c2a5725
@ -7544,11 +7544,7 @@ 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));
|
||||
#else
|
||||
m_wideGraph->setFilterMinimumBandwidth(1);
|
||||
#endif
|
||||
|
||||
bool bVHF=m_config.enable_VHF_features();
|
||||
enable_DXCC_entity (m_config.DXCC ());
|
||||
|
@ -52,7 +52,6 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
||||
if(pProcessed) *pProcessed=true;
|
||||
});
|
||||
ui->filterMinSpinBox->installEventFilter(filterEscapeEater);
|
||||
ui->filterMaxSpinBox->installEventFilter(filterEscapeEater);
|
||||
|
||||
ui->widePlot->setCursor(Qt::CrossCursor);
|
||||
ui->widePlot->setMaximumWidth(MAX_SCREENSIZE);
|
||||
@ -79,22 +78,27 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
||||
});
|
||||
}
|
||||
|
||||
auto minAction = menu->addAction(QString("Set Filter &Minimum to %1 Hz").arg(f));
|
||||
connect(minAction, &QAction::triggered, this, [this, f](){
|
||||
ui->filterMinSpinBox->setValue(f);
|
||||
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);
|
||||
ui->filterCheckBox->setChecked(true);
|
||||
auto widthMenu = menu->addMenu("Set Filter &Width to...");
|
||||
auto widths = QList<int>{ 25, 50, 75, 100, 250, 500, 750, 1000, 1500, 2000 };
|
||||
foreach(auto width, widths){
|
||||
if(width < m_filterMinWidth){ continue; }
|
||||
auto widthAction = widthMenu->addAction(QString("%1 Hz").arg(width));
|
||||
connect(widthAction, &QAction::triggered, this, [this, width](){
|
||||
ui->filterWidthSpinBox->setValue(width);
|
||||
ui->filterCheckBox->setChecked(true);
|
||||
});
|
||||
}
|
||||
|
||||
auto minAction = menu->addAction(QString("Set Filter &Minimum to %1 Hz").arg(f));
|
||||
connect(minAction, &QAction::triggered, this, [this, f](){
|
||||
ui->filterMinSpinBox->setValue(f);
|
||||
ui->filterCheckBox->setChecked(true);
|
||||
});
|
||||
|
||||
menu->popup(ui->widePlot->mapToGlobal(pos));
|
||||
@ -424,12 +428,6 @@ void WideGraph::setFilter(int a, int b){
|
||||
}
|
||||
ui->filterMinSpinBox->blockSignals(blocked);
|
||||
|
||||
blocked = ui->filterMaxSpinBox->blockSignals(true);
|
||||
{
|
||||
ui->filterMaxSpinBox->setValue(high);
|
||||
}
|
||||
ui->filterMaxSpinBox->blockSignals(blocked);
|
||||
|
||||
blocked = ui->filterCenterSpinBox->blockSignals(true);
|
||||
{
|
||||
ui->filterCenterSpinBox->setValue(center);
|
||||
@ -449,6 +447,7 @@ void WideGraph::setFilter(int a, int b){
|
||||
|
||||
void WideGraph::setFilterMinimumBandwidth(int width){
|
||||
m_filterMinWidth = width;
|
||||
ui->filterWidthSpinBox->setMinimum(width);
|
||||
setFilter(m_filterMinimum, std::max(m_filterMinimum+width, m_filterMaximum));
|
||||
}
|
||||
|
||||
@ -457,7 +456,6 @@ void WideGraph::setFilterEnabled(bool enabled){
|
||||
|
||||
// update the filter spinner
|
||||
ui->filterMinSpinBox->setEnabled(enabled);
|
||||
ui->filterMaxSpinBox->setEnabled(enabled);
|
||||
ui->filterCenterSpinBox->setEnabled(enabled);
|
||||
ui->filterWidthSpinBox->setEnabled(enabled);
|
||||
|
||||
@ -738,11 +736,8 @@ void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
|
||||
}
|
||||
|
||||
void WideGraph::on_filterMinSpinBox_valueChanged(int n){
|
||||
setFilter(n, std::max(m_filterMaximum, n));
|
||||
}
|
||||
|
||||
void WideGraph::on_filterMaxSpinBox_valueChanged(int n){
|
||||
setFilter(std::min(m_filterMinimum, n), n);
|
||||
int delta = n - m_filterMinimum;
|
||||
setFilter(m_filterMinimum + delta, m_filterMaximum + delta);
|
||||
}
|
||||
|
||||
void WideGraph::on_filterCenterSpinBox_valueChanged(int n){
|
||||
|
@ -98,7 +98,6 @@ private slots:
|
||||
void on_smoSpinBox_valueChanged(int n);
|
||||
void on_sbPercent2dPlot_valueChanged(int n);
|
||||
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);
|
||||
|
29
widegraph.ui
29
widegraph.ui
@ -178,9 +178,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-196</y>
|
||||
<width>267</width>
|
||||
<height>402</height>
|
||||
<height>370</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
@ -353,31 +353,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="filterMaxSpinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> Hz</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string>Max: </string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>5000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2500</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user