Fixed ordering of filter controls and logic around min filter

This commit is contained in:
Jordan Sherer 2019-12-23 14:08:39 -05:00
parent 98760a6d42
commit d28d556309
3 changed files with 57 additions and 48 deletions

View File

@ -4410,8 +4410,11 @@ bool MainWindow::decodeProcessQueue(qint32 *pSubmode){
dec_data.params.nfb=m_wideGraph->Fmax();
if(m_wideGraph->filterEnabled()){
dec_data.params.nfa=max(0, m_wideGraph->filterMinimum());
dec_data.params.nfb=min(m_wideGraph->filterMaximum(), 5000);
int low = max(0, m_wideGraph->filterMinimum());
int high = min(m_wideGraph->filterMaximum(), 5000);
dec_data.params.nfa=min(low, high);
dec_data.params.nfb=max(low, high);
}
//if(m_mode=="FT8" and m_config.bHound() and !ui->cbRxAll->isChecked()) dec_data.params.nfb=1000;
@ -7543,6 +7546,8 @@ void MainWindow::on_actionJS8_triggered()
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();

View File

@ -403,12 +403,10 @@ 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;
@ -740,11 +738,11 @@ void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
}
void WideGraph::on_filterMinSpinBox_valueChanged(int n){
setFilter(n, m_filterMaximum);
setFilter(n, std::max(m_filterMaximum, n));
}
void WideGraph::on_filterMaxSpinBox_valueChanged(int n){
setFilter(m_filterMinimum, n);
setFilter(std::min(m_filterMinimum, n), n);
}
void WideGraph::on_filterCenterSpinBox_valueChanged(int n){

View File

@ -172,7 +172,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-196</y>
<y>-195</y>
<width>267</width>
<height>402</height>
</rect>
@ -269,6 +269,53 @@
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="filterCenterSpinBox">
<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>Center: </string>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<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="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</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>2000</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="filterMinSpinBox">
<property name="enabled">
@ -325,47 +372,6 @@
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="filterCenterSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> Hz</string>
</property>
<property name="prefix">
<string>Center: </string>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<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>
</property>
</widget>
</item>
</layout>
</widget>
</item>