Customized min and max filter positions
This commit is contained in:
parent
726c145187
commit
649910302c
@ -4417,12 +4417,8 @@ bool MainWindow::decodeProcessQueue(qint32 *pSubmode){
|
|||||||
dec_data.params.nfb=m_wideGraph->Fmax();
|
dec_data.params.nfb=m_wideGraph->Fmax();
|
||||||
|
|
||||||
if(m_wideGraph->filterEnabled()){
|
if(m_wideGraph->filterEnabled()){
|
||||||
int filter = max(0, m_wideGraph->filter());
|
dec_data.params.nfa=max(0, m_wideGraph->filterMinimum());
|
||||||
if(filter){
|
dec_data.params.nfb=min(m_wideGraph->filterMaximum(), 5000);
|
||||||
int f = currentFreqOffset() + computeBandwidthForSubmode(submode)/2;
|
|
||||||
dec_data.params.nfa=max(0, f - filter/2);
|
|
||||||
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;
|
||||||
@ -7552,7 +7548,7 @@ void MainWindow::on_actionJS8_triggered()
|
|||||||
updateModeButtonText();
|
updateModeButtonText();
|
||||||
|
|
||||||
m_wideGraph->setSubMode(m_nSubMode);
|
m_wideGraph->setSubMode(m_nSubMode);
|
||||||
m_wideGraph->setFilterMinimum(computeBandwidthForSubmode(m_nSubMode) + 2*rxThreshold(m_nSubMode));
|
m_wideGraph->setFilterMinimumBandwidth(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 ());
|
||||||
|
14
plotter.cpp
14
plotter.cpp
@ -29,6 +29,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor
|
|||||||
m_plot2dZero {0},
|
m_plot2dZero {0},
|
||||||
m_nSubMode {0},
|
m_nSubMode {0},
|
||||||
m_filterEnabled{false},
|
m_filterEnabled{false},
|
||||||
|
m_filterCenter {0},
|
||||||
m_filterWidth {0},
|
m_filterWidth {0},
|
||||||
m_turbo {false},
|
m_turbo {false},
|
||||||
m_Running {false},
|
m_Running {false},
|
||||||
@ -533,8 +534,9 @@ void CPlotter::DrawOverlay() //DrawOverlay()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(m_filterEnabled && m_filterWidth > 0){
|
if(m_filterEnabled && m_filterWidth > 0){
|
||||||
int filterStart=XfromFreq(m_rxFreq+bw/2-m_filterWidth/2);
|
int center = m_filterCenter; // m_rxFreq+bw/2;
|
||||||
int filterEnd=XfromFreq(m_rxFreq+bw/2+m_filterWidth/2);
|
int filterStart=XfromFreq(center-m_filterWidth/2);
|
||||||
|
int filterEnd=XfromFreq(center+m_filterWidth/2);
|
||||||
|
|
||||||
// TODO: make sure filter is visible before painting...
|
// TODO: make sure filter is visible before painting...
|
||||||
|
|
||||||
@ -815,7 +817,13 @@ void CPlotter::setTurbo(bool turbo)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlotter::setFilter(int width)
|
void CPlotter::setFilterCenter(int center){
|
||||||
|
m_filterCenter=center;
|
||||||
|
DrawOverlay();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlotter::setFilterWidth(int width)
|
||||||
{
|
{
|
||||||
m_filterWidth=width;
|
m_filterWidth=width;
|
||||||
DrawOverlay();
|
DrawOverlay();
|
||||||
|
@ -82,7 +82,8 @@ public:
|
|||||||
void setTol(int n);
|
void setTol(int n);
|
||||||
void setRxBand(QString band);
|
void setRxBand(QString band);
|
||||||
void setTurbo(bool turbo);
|
void setTurbo(bool turbo);
|
||||||
void setFilter(int width);
|
void setFilterCenter(int center);
|
||||||
|
void setFilterWidth(int width);
|
||||||
void setFilterEnabled(bool enabled);
|
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;}
|
||||||
@ -154,6 +155,7 @@ private:
|
|||||||
QString m_redFile;
|
QString m_redFile;
|
||||||
|
|
||||||
bool m_filterEnabled;
|
bool m_filterEnabled;
|
||||||
|
int m_filterCenter;
|
||||||
int m_filterWidth;
|
int m_filterWidth;
|
||||||
bool m_turbo;
|
bool m_turbo;
|
||||||
bool m_Running;
|
bool m_Running;
|
||||||
|
@ -27,8 +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_filterMinWidth {0},
|
||||||
m_filterWidthPrev {0},
|
m_filterMinimum {0},
|
||||||
|
m_filterMaximum {5000},
|
||||||
m_filterEnabled {false},
|
m_filterEnabled {false},
|
||||||
m_bHaveTransmitted {false}
|
m_bHaveTransmitted {false}
|
||||||
{
|
{
|
||||||
@ -44,10 +45,11 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
|||||||
if(e->key() != Qt::Key_Escape){
|
if(e->key() != Qt::Key_Escape){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setFilter(0);
|
setFilter(0, 5000);
|
||||||
if(pProcessed) *pProcessed=true;
|
if(pProcessed) *pProcessed=true;
|
||||||
});
|
});
|
||||||
ui->filterSpinBox->installEventFilter(filterEscapeEater);
|
ui->filterMinSpinBox->installEventFilter(filterEscapeEater);
|
||||||
|
ui->filterMaxSpinBox->installEventFilter(filterEscapeEater);
|
||||||
|
|
||||||
ui->widePlot->setCursor(Qt::CrossCursor);
|
ui->widePlot->setCursor(Qt::CrossCursor);
|
||||||
ui->widePlot->setMaximumHeight(800);
|
ui->widePlot->setMaximumHeight(800);
|
||||||
@ -114,7 +116,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", 500).toInt());
|
setFilter(m_settings->value("FilterMinimum", 500).toInt(), m_settings->value("FilterMaximum", 2500).toInt());
|
||||||
setFilterEnabled(m_settings->value("FilterEnabled", false).toBool());
|
setFilterEnabled(m_settings->value("FilterEnabled", false).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +174,8 @@ void WideGraph::saveSettings() //saveS
|
|||||||
m_settings->setValue ("HideControls", ui->controls_widget->isHidden ());
|
m_settings->setValue ("HideControls", ui->controls_widget->isHidden ());
|
||||||
m_settings->setValue ("FminPerBand", m_fMinPerBand);
|
m_settings->setValue ("FminPerBand", m_fMinPerBand);
|
||||||
m_settings->setValue ("CenterOffset", ui->centerSpinBox->value());
|
m_settings->setValue ("CenterOffset", ui->centerSpinBox->value());
|
||||||
m_settings->setValue ("FilterWidth", m_filterWidth);
|
m_settings->setValue ("FilterMinimum", m_filterMinimum);
|
||||||
|
m_settings->setValue ("FilterMaximum", m_filterMaximum);
|
||||||
m_settings->setValue ("FilterEnabled", m_filterEnabled);
|
m_settings->setValue ("FilterEnabled", m_filterEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,9 +331,14 @@ int WideGraph::Fmax() //Fmax
|
|||||||
return std::min(5000,ui->widePlot->Fmax());
|
return std::min(5000,ui->widePlot->Fmax());
|
||||||
}
|
}
|
||||||
|
|
||||||
int WideGraph::filter()
|
int WideGraph::filterMinimum()
|
||||||
{
|
{
|
||||||
return std::max(0, std::min(m_filterWidth, 5000));
|
return std::max(0, m_filterMinimum);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WideGraph::filterMaximum()
|
||||||
|
{
|
||||||
|
return std::min(m_filterMaximum, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WideGraph::filterEnabled()
|
bool WideGraph::filterEnabled()
|
||||||
@ -338,31 +346,50 @@ bool WideGraph::filterEnabled()
|
|||||||
return m_filterEnabled;
|
return m_filterEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::setFilter(int width){
|
void WideGraph::setFilter(int a, int b){
|
||||||
|
int low = std::min(a, b);
|
||||||
|
int high = std::max(a, b);
|
||||||
|
|
||||||
|
// ensure minimum filter width
|
||||||
|
if(high-low < m_filterMinWidth){
|
||||||
|
high = low + m_filterMinWidth;
|
||||||
|
}
|
||||||
|
|
||||||
// update the filter history
|
// update the filter history
|
||||||
m_filterWidthPrev = m_filterWidth;
|
m_filterMinimum = low;
|
||||||
m_filterWidth = width;
|
m_filterMaximum = high;
|
||||||
|
|
||||||
// update the spinner UI
|
// update the spinner UI
|
||||||
bool blocked = ui->filterSpinBox->blockSignals(true);
|
bool blocked = false;
|
||||||
|
blocked = ui->filterMinSpinBox->blockSignals(true);
|
||||||
{
|
{
|
||||||
ui->filterSpinBox->setValue(width);
|
ui->filterMinSpinBox->setValue(low);
|
||||||
}
|
}
|
||||||
ui->filterSpinBox->blockSignals(blocked);
|
ui->filterMinSpinBox->blockSignals(blocked);
|
||||||
|
|
||||||
|
blocked = ui->filterMaxSpinBox->blockSignals(true);
|
||||||
|
{
|
||||||
|
ui->filterMaxSpinBox->setValue(high);
|
||||||
|
}
|
||||||
|
ui->filterMaxSpinBox->blockSignals(blocked);
|
||||||
|
|
||||||
// update the wide plot UI
|
// update the wide plot UI
|
||||||
ui->widePlot->setFilter(width);
|
int width = high - low;
|
||||||
|
ui->widePlot->setFilterCenter(low + width/2);
|
||||||
|
ui->widePlot->setFilterWidth(high - low);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::setFilterMinimum(int width){
|
void WideGraph::setFilterMinimumBandwidth(int width){
|
||||||
ui->filterSpinBox->setMinimum(width);
|
m_filterMinWidth = width;
|
||||||
|
setFilter(m_filterMinimum, std::max(m_filterMinimum+width, m_filterMaximum));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::setFilterEnabled(bool enabled){
|
void WideGraph::setFilterEnabled(bool enabled){
|
||||||
m_filterEnabled = enabled;
|
m_filterEnabled = enabled;
|
||||||
|
|
||||||
// update the filter spinner
|
// update the filter spinner
|
||||||
ui->filterSpinBox->setEnabled(enabled);
|
ui->filterMinSpinBox->setEnabled(enabled);
|
||||||
|
ui->filterMaxSpinBox->setEnabled(enabled);
|
||||||
|
|
||||||
// update the checkbox ui
|
// update the checkbox ui
|
||||||
bool blocked = ui->filterCheckBox->blockSignals(true);
|
bool blocked = ui->filterCheckBox->blockSignals(true);
|
||||||
@ -397,7 +424,6 @@ void WideGraph::setTxFreq(int n) //setTxFreq
|
|||||||
void WideGraph::setMode(QString mode) //setMode
|
void WideGraph::setMode(QString mode) //setMode
|
||||||
{
|
{
|
||||||
m_mode=mode;
|
m_mode=mode;
|
||||||
ui->fSplitSpinBox->setEnabled(m_mode=="JT9+JT65");
|
|
||||||
ui->widePlot->setMode(mode);
|
ui->widePlot->setMode(mode);
|
||||||
ui->widePlot->DrawOverlay();
|
ui->widePlot->DrawOverlay();
|
||||||
ui->widePlot->update();
|
ui->widePlot->update();
|
||||||
@ -440,12 +466,6 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(const QString &arg1)
|
|||||||
replot();
|
replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::on_fSplitSpinBox_valueChanged(int n) //fSplit
|
|
||||||
{
|
|
||||||
if (m_rxBand != "60m") m_fMinPerBand[m_rxBand] = n;
|
|
||||||
setRxRange ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WideGraph::setFreq2(int rxFreq, int txFreq) //setFreq2
|
void WideGraph::setFreq2(int rxFreq, int txFreq) //setFreq2
|
||||||
{
|
{
|
||||||
emit setFreq3(rxFreq,txFreq);
|
emit setFreq3(rxFreq,txFreq);
|
||||||
@ -468,16 +488,6 @@ bool WideGraph::controlsVisible(){
|
|||||||
void WideGraph::setRxBand (QString const& band)
|
void WideGraph::setRxBand (QString const& band)
|
||||||
{
|
{
|
||||||
m_rxBand = band;
|
m_rxBand = band;
|
||||||
if ("60m" == m_rxBand)
|
|
||||||
{
|
|
||||||
ui->fSplitSpinBox->setEnabled (false);
|
|
||||||
ui->fSplitSpinBox->setValue (0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->fSplitSpinBox->setValue (m_fMinPerBand.value (band, 2500).toUInt ());
|
|
||||||
ui->fSplitSpinBox->setEnabled (m_mode=="JT9+JT65");
|
|
||||||
}
|
|
||||||
ui->widePlot->setRxBand(band);
|
ui->widePlot->setRxBand(band);
|
||||||
setRxRange ();
|
setRxRange ();
|
||||||
}
|
}
|
||||||
@ -634,8 +644,12 @@ void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
|
|||||||
ui->widePlot->SetPercent2DScreen(n);
|
ui->widePlot->SetPercent2DScreen(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::on_filterSpinBox_valueChanged(int n){
|
void WideGraph::on_filterMinSpinBox_valueChanged(int n){
|
||||||
setFilter(n);
|
setFilter(n, m_filterMaximum);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WideGraph::on_filterMaxSpinBox_valueChanged(int n){
|
||||||
|
setFilter(m_filterMinimum, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WideGraph::on_filterCheckBox_toggled(bool b){
|
void WideGraph::on_filterCheckBox_toggled(bool b){
|
||||||
|
16
widegraph.h
16
widegraph.h
@ -33,10 +33,11 @@ public:
|
|||||||
int nStartFreq();
|
int nStartFreq();
|
||||||
int Fmin();
|
int Fmin();
|
||||||
int Fmax();
|
int Fmax();
|
||||||
int filter();
|
int filterMinimum();
|
||||||
|
int filterMaximum();
|
||||||
bool filterEnabled();
|
bool filterEnabled();
|
||||||
void setFilter(int width);
|
void setFilter(int a, int b);
|
||||||
void setFilterMinimum(int width);
|
void setFilterMinimumBandwidth(int width);
|
||||||
void setFilterEnabled(bool enabled);
|
void setFilterEnabled(bool enabled);
|
||||||
int fSpan();
|
int fSpan();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
@ -81,7 +82,6 @@ private slots:
|
|||||||
void on_waterfallAvgSpinBox_valueChanged(int arg1);
|
void on_waterfallAvgSpinBox_valueChanged(int arg1);
|
||||||
void on_bppSpinBox_valueChanged(int arg1);
|
void on_bppSpinBox_valueChanged(int arg1);
|
||||||
void on_spec2dComboBox_currentIndexChanged(const QString &arg1);
|
void on_spec2dComboBox_currentIndexChanged(const QString &arg1);
|
||||||
void on_fSplitSpinBox_valueChanged(int n);
|
|
||||||
void on_fStartSpinBox_valueChanged(int n);
|
void on_fStartSpinBox_valueChanged(int n);
|
||||||
void on_paletteComboBox_activated(const QString &palette);
|
void on_paletteComboBox_activated(const QString &palette);
|
||||||
void on_cbFlatten_toggled(bool b);
|
void on_cbFlatten_toggled(bool b);
|
||||||
@ -94,7 +94,8 @@ private slots:
|
|||||||
void on_zero2dSlider_valueChanged(int value);
|
void on_zero2dSlider_valueChanged(int value);
|
||||||
void on_smoSpinBox_valueChanged(int n);
|
void on_smoSpinBox_valueChanged(int n);
|
||||||
void on_sbPercent2dPlot_valueChanged(int n);
|
void on_sbPercent2dPlot_valueChanged(int n);
|
||||||
void on_filterSpinBox_valueChanged(int n);
|
void on_filterMinSpinBox_valueChanged(int n);
|
||||||
|
void on_filterMaxSpinBox_valueChanged(int n);
|
||||||
void on_filterCheckBox_toggled(bool b);
|
void on_filterCheckBox_toggled(bool b);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -111,8 +112,9 @@ private:
|
|||||||
|
|
||||||
bool m_filterEnabled;
|
bool m_filterEnabled;
|
||||||
|
|
||||||
qint32 m_filterWidth;
|
qint32 m_filterMinWidth;
|
||||||
qint32 m_filterWidthPrev;
|
qint32 m_filterMinimum;
|
||||||
|
qint32 m_filterMaximum;
|
||||||
qint32 m_waterfallAvg;
|
qint32 m_waterfallAvg;
|
||||||
qint32 m_TRperiod;
|
qint32 m_TRperiod;
|
||||||
qint32 m_nsps;
|
qint32 m_nsps;
|
||||||
|
1118
widegraph.ui
1118
widegraph.ui
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user