Fixed some settings bugs related to filtering
This commit is contained in:
parent
bf5570cacd
commit
c1a3975231
@ -4416,12 +4416,14 @@ bool MainWindow::decodeProcessQueue(qint32 *pSubmode){
|
|||||||
dec_data.params.nfSplit=m_wideGraph->Fmin();
|
dec_data.params.nfSplit=m_wideGraph->Fmin();
|
||||||
dec_data.params.nfb=m_wideGraph->Fmax();
|
dec_data.params.nfb=m_wideGraph->Fmax();
|
||||||
|
|
||||||
|
if(m_wideGraph->filterEnabled()){
|
||||||
int filter = max(0, m_wideGraph->filter());
|
int filter = max(0, m_wideGraph->filter());
|
||||||
if(filter){
|
if(filter){
|
||||||
int f = currentFreqOffset() + computeBandwidthForSubmode(submode)/2;
|
int f = currentFreqOffset() + computeBandwidthForSubmode(submode)/2;
|
||||||
dec_data.params.nfa=max(0, f - filter/2);
|
dec_data.params.nfa=max(0, f - filter/2);
|
||||||
dec_data.params.nfb=min(f + filter/2, 5000);
|
dec_data.params.nfb=min(f + filter/2, 5000);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if(m_mode=="FT8" and m_config.bHound() and !ui->cbRxAll->isChecked()) dec_data.params.nfb=1000;
|
//if(m_mode=="FT8" and m_config.bHound() and !ui->cbRxAll->isChecked()) dec_data.params.nfb=1000;
|
||||||
//if(m_mode=="FT8" and m_config.bFox()) dec_data.params.nfqso=200;
|
//if(m_mode=="FT8" and m_config.bFox()) dec_data.params.nfqso=200;
|
||||||
@ -7550,7 +7552,7 @@ void MainWindow::on_actionJS8_triggered()
|
|||||||
updateModeButtonText();
|
updateModeButtonText();
|
||||||
|
|
||||||
m_wideGraph->setSubMode(m_nSubMode);
|
m_wideGraph->setSubMode(m_nSubMode);
|
||||||
m_wideGraph->setFilterMinimum(computeBandwidthForSubmode(m_nSubMode));
|
m_wideGraph->setFilterMinimum(computeBandwidthForSubmode(m_nSubMode) + 2*rxThreshold(m_nSubMode));
|
||||||
|
|
||||||
bool bVHF=m_config.enable_VHF_features();
|
bool bVHF=m_config.enable_VHF_features();
|
||||||
enable_DXCC_entity (m_config.DXCC ());
|
enable_DXCC_entity (m_config.DXCC ());
|
||||||
|
12
plotter.cpp
12
plotter.cpp
@ -28,6 +28,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
|||||||
m_plot2dGain {0},
|
m_plot2dGain {0},
|
||||||
m_plot2dZero {0},
|
m_plot2dZero {0},
|
||||||
m_nSubMode {0},
|
m_nSubMode {0},
|
||||||
|
m_filterEnabled{false},
|
||||||
m_filterWidth {0},
|
m_filterWidth {0},
|
||||||
m_turbo {false},
|
m_turbo {false},
|
||||||
m_Running {false},
|
m_Running {false},
|
||||||
@ -123,7 +124,7 @@ void CPlotter::paintEvent(QPaintEvent *) // paint
|
|||||||
painter.drawPixmap(m_lastMouseX, 0, m_HoverOverlayPixmap);
|
painter.drawPixmap(m_lastMouseX, 0, m_HoverOverlayPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_filterWidth > 0){
|
if(m_filterEnabled && m_filterWidth > 0){
|
||||||
painter.drawPixmap(0, 0, m_FilterOverlayPixmap);
|
painter.drawPixmap(0, 0, m_FilterOverlayPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,7 +532,7 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
hoverPainter.drawText(fwidth + 5, m_h, QString("%1").arg(f));
|
hoverPainter.drawText(fwidth + 5, m_h, QString("%1").arg(f));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(m_filterWidth > 0){
|
if(m_filterEnabled && m_filterWidth > 0){
|
||||||
int filterStart=XfromFreq(m_rxFreq+bw/2-m_filterWidth/2);
|
int filterStart=XfromFreq(m_rxFreq+bw/2-m_filterWidth/2);
|
||||||
int filterEnd=XfromFreq(m_rxFreq+bw/2+m_filterWidth/2);
|
int filterEnd=XfromFreq(m_rxFreq+bw/2+m_filterWidth/2);
|
||||||
|
|
||||||
@ -551,7 +552,6 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
filterPainter.fillRect(0, 30, filterStart, m_h, blackMask);
|
filterPainter.fillRect(0, 30, filterStart, m_h, blackMask);
|
||||||
filterPainter.fillRect(filterEnd+1, 30, m_Size.width(), m_h, blackMask);
|
filterPainter.fillRect(filterEnd+1, 30, m_Size.width(), m_h, blackMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -822,6 +822,12 @@ void CPlotter::setFilter(int width)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlotter::setFilterEnabled(bool enabled){
|
||||||
|
m_filterEnabled=enabled;
|
||||||
|
DrawOverlay();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void CPlotter::setFlatten(bool b1, bool b2)
|
void CPlotter::setFlatten(bool b1, bool b2)
|
||||||
{
|
{
|
||||||
m_Flatten=0;
|
m_Flatten=0;
|
||||||
|
@ -83,6 +83,7 @@ public:
|
|||||||
void setRxBand(QString band);
|
void setRxBand(QString band);
|
||||||
void setTurbo(bool turbo);
|
void setTurbo(bool turbo);
|
||||||
void setFilter(int width);
|
void setFilter(int width);
|
||||||
|
void setFilterEnabled(bool enabled);
|
||||||
#if JS8_USE_REFSPEC
|
#if JS8_USE_REFSPEC
|
||||||
void setReference(bool b) {m_bReference = b;}
|
void setReference(bool b) {m_bReference = b;}
|
||||||
bool Reference() const {return m_bReference;}
|
bool Reference() const {return m_bReference;}
|
||||||
@ -152,6 +153,7 @@ private:
|
|||||||
QString m_rxBand;
|
QString m_rxBand;
|
||||||
QString m_redFile;
|
QString m_redFile;
|
||||||
|
|
||||||
|
bool m_filterEnabled;
|
||||||
int m_filterWidth;
|
int m_filterWidth;
|
||||||
bool m_turbo;
|
bool m_turbo;
|
||||||
bool m_Running;
|
bool m_Running;
|
||||||
|
@ -27,6 +27,9 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
|||||||
m_palettes_path {":/Palettes"},
|
m_palettes_path {":/Palettes"},
|
||||||
m_ntr0 {0},
|
m_ntr0 {0},
|
||||||
m_n {0},
|
m_n {0},
|
||||||
|
m_filterWidth {0},
|
||||||
|
m_filterWidthPrev {0},
|
||||||
|
m_filterEnabled {false},
|
||||||
m_bHaveTransmitted {false}
|
m_bHaveTransmitted {false}
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -111,7 +114,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
|||||||
ui->controls_widget->setVisible(!m_settings->value("HideControls", false).toBool());
|
ui->controls_widget->setVisible(!m_settings->value("HideControls", false).toBool());
|
||||||
ui->cbControls->setChecked(!m_settings->value("HideControls", false).toBool());
|
ui->cbControls->setChecked(!m_settings->value("HideControls", false).toBool());
|
||||||
|
|
||||||
setFilter(m_settings->value("FilterWidth", 0).toInt());
|
setFilter(m_settings->value("FilterWidth", 500).toInt());
|
||||||
setFilterEnabled(m_settings->value("FilterEnabled", false).toBool());
|
setFilterEnabled(m_settings->value("FilterEnabled", false).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,20 +330,25 @@ int WideGraph::Fmax() //Fmax
|
|||||||
|
|
||||||
int WideGraph::filter()
|
int WideGraph::filter()
|
||||||
{
|
{
|
||||||
return m_filterEnabled ? m_filterWidth : 0;
|
return std::max(0, std::min(m_filterWidth, 5000));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WideGraph::filterEnabled()
|
||||||
|
{
|
||||||
|
return m_filterEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::setFilter(int width){
|
void WideGraph::setFilter(int width){
|
||||||
if(width == m_filterWidth){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update the filter history
|
// update the filter history
|
||||||
m_filterWidthPrev = m_filterWidth;
|
m_filterWidthPrev = m_filterWidth;
|
||||||
m_filterWidth = width;
|
m_filterWidth = width;
|
||||||
|
|
||||||
// update the spinner UI
|
// update the spinner UI
|
||||||
|
bool blocked = ui->filterSpinBox->blockSignals(true);
|
||||||
|
{
|
||||||
ui->filterSpinBox->setValue(width);
|
ui->filterSpinBox->setValue(width);
|
||||||
|
}
|
||||||
|
ui->filterSpinBox->blockSignals(blocked);
|
||||||
|
|
||||||
// update the wide plot UI
|
// update the wide plot UI
|
||||||
ui->widePlot->setFilter(width);
|
ui->widePlot->setFilter(width);
|
||||||
@ -353,9 +361,18 @@ void WideGraph::setFilterMinimum(int width){
|
|||||||
void WideGraph::setFilterEnabled(bool enabled){
|
void WideGraph::setFilterEnabled(bool enabled){
|
||||||
m_filterEnabled = enabled;
|
m_filterEnabled = enabled;
|
||||||
|
|
||||||
// update the wide plot with the
|
// update the filter spinner
|
||||||
ui->widePlot->setFilter(enabled ? m_filterWidth : 0);
|
|
||||||
ui->filterSpinBox->setEnabled(enabled);
|
ui->filterSpinBox->setEnabled(enabled);
|
||||||
|
|
||||||
|
// update the checkbox ui
|
||||||
|
bool blocked = ui->filterCheckBox->blockSignals(true);
|
||||||
|
{
|
||||||
|
ui->filterCheckBox->setChecked(enabled);
|
||||||
|
}
|
||||||
|
ui->filterCheckBox->blockSignals(blocked);
|
||||||
|
|
||||||
|
// update the wideplot
|
||||||
|
ui->widePlot->setFilterEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WideGraph::fSpan()
|
int WideGraph::fSpan()
|
||||||
|
@ -34,6 +34,7 @@ public:
|
|||||||
int Fmin();
|
int Fmin();
|
||||||
int Fmax();
|
int Fmax();
|
||||||
int filter();
|
int filter();
|
||||||
|
bool filterEnabled();
|
||||||
void setFilter(int width);
|
void setFilter(int width);
|
||||||
void setFilterMinimum(int width);
|
void setFilterMinimum(int width);
|
||||||
void setFilterEnabled(bool enabled);
|
void setFilterEnabled(bool enabled);
|
||||||
|
Loading…
Reference in New Issue
Block a user