From 907e359390455e144b4bd92affdc7771eddb19b2 Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Thu, 26 Sep 2024 06:32:08 -0700 Subject: [PATCH] Kill of unused reference spectrum support --- CMakeLists.txt | 1 - WF.hpp | 3 +-- commons.h | 1 - mainwindow.cpp | 29 ----------------------------- mainwindow.h | 4 ---- mainwindow.ui | 22 ---------------------- plotter.cpp | 16 +--------------- widegraph.cpp | 8 -------- 8 files changed, 2 insertions(+), 82 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2756b898..ad063167 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -335,7 +335,6 @@ set (wsjt_FSRCS lib/plotsave.f90 lib/polyfit.f90 lib/prog_args.f90 - lib/refspectrum.f90 lib/savec2.f90 lib/sec_midn.f90 lib/sleep_msec.f90 diff --git a/WF.hpp b/WF.hpp index 76664cbf..3f82a68a 100644 --- a/WF.hpp +++ b/WF.hpp @@ -18,8 +18,7 @@ namespace WF { Current, Cumulative, - LinearAvg, - Reference + LinearAvg }; Q_ENUM_NS(Spectrum) // diff --git a/commons.h b/commons.h index fe5eda80..e3d68e57 100644 --- a/commons.h +++ b/commons.h @@ -6,7 +6,6 @@ #define RX_SAMPLE_RATE 12000 -#define JS8_USE_REFSPEC 0 // compute the signal refspec #define JS8_USE_IHSYM 0 // compute ihsym manually instead of from symspec #define JS8_RING_BUFFER 1 // use a ring buffer instead of clearing the decode frames #define JS8_SINGLE_DECODE 0 // single submode decode per instantiation of the decoder diff --git a/mainwindow.cpp b/mainwindow.cpp index 6f5277d2..feb724f4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -100,9 +100,6 @@ extern "C" { int savec2_(char* fname, int* TR_seconds, double* dial_freq, fortran_charlen_t); - void refspectrum_(short int d2[], bool* bclearrefspec, - bool* brefspec, bool* buseref, const char* c_fname, fortran_charlen_t); - void fix_contest_msg_(char* MyGrid, char* msg, fortran_charlen_t, fortran_charlen_t); void foxgen_(); @@ -318,8 +315,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_bTxTime {false}, m_bTransmittedEcho {false}, m_bDoubleClickAfterCQnnn {false}, - m_bRefSpec {false}, - m_bClearRefSpec {false}, m_bTrain {false}, m_QSOProgress {CALLING}, m_ihsym {0}, @@ -812,7 +807,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->mdiArea->addSubWindow(m_wideGraph.data(), Qt::Dialog | Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::Tool)->showMaximized(); m_isWideGraphMDI = true; ui->menuSave->setEnabled(false); - ui->menuTools->setEnabled(false); #if JS8_SAVE_AUDIO ui->menuSave->setEnabled(true); @@ -2476,18 +2470,6 @@ void MainWindow::dataSink(qint64 frames) //qDebug() << "k" << k << "k0" << k0 << "delta" << k-k0; -#if JS8_USE_REFSPEC - QString fname {QDir::toNativeSeparators(m_config.writeable_data_dir ().absoluteFilePath ("refspec.dat"))}; - QByteArray bafname = fname.toLatin1(); - const char *c_fname = bafname.data(); - int len=fname.length(); - - m_bUseRef=m_wideGraph->useRef(); - refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bClearRefSpec,&m_bRefSpec, - &m_bUseRef,c_fname,len); - m_bClearRefSpec=false; -#endif - // Get power, spectrum, and ihsym int trmin=m_TRperiod/60; int nsps=m_nsps; @@ -12193,17 +12175,6 @@ void MainWindow::setRig (Frequency f) } } -void MainWindow::on_actionMeasure_reference_spectrum_triggered() -{ - if(!m_monitoring) on_monitorButton_clicked (true); - m_bRefSpec=true; -} - -void MainWindow::on_actionErase_reference_spectrum_triggered() -{ - m_bClearRefSpec=true; -} - void MainWindow::freqCalStep() { if (m_frequency_list_fcal_iter == m_config.frequencies ()->end () diff --git a/mainwindow.h b/mainwindow.h index 9b96a193..aad1e6f7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -369,8 +369,6 @@ private slots: void tcpNetworkError (QString const&); void TxAgain(); void uploadResponse(QString response); - void on_actionMeasure_reference_spectrum_triggered(); - void on_actionErase_reference_spectrum_triggered(); void on_sbCQTxFreq_valueChanged(int n); void on_cbCQTx_toggled(bool b); void splash_done (); @@ -555,8 +553,6 @@ private: bool m_bTxTime; bool m_bTransmittedEcho; bool m_bDoubleClickAfterCQnnn; - bool m_bRefSpec; - bool m_bClearRefSpec; bool m_bTrain; bool m_bUseRef; bool m_bAltV; diff --git a/mainwindow.ui b/mainwindow.ui index d020e18b..feb1a743 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2420,14 +2420,6 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF &Configurations - - - Old Tools - - - - - &View @@ -2538,7 +2530,6 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF - @@ -2918,19 +2909,6 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF false - - - Measure reference spectrum - - - - - Erase reference spectrum - - - false - - Equalization tools ... diff --git a/plotter.cpp b/plotter.cpp index cabc4d1c..ec97c29c 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -128,7 +128,6 @@ void CPlotter::resizeEvent(QResizeEvent *) //resizeEvent() if (!size().isValid()) return; if ((m_Size != size()) || - // XXX (m_bReference != m_bReference0) || (m_Percent2DScreen != m_Percent2DScreen0)) { m_Size = size(); @@ -137,7 +136,6 @@ void CPlotter::resizeEvent(QResizeEvent *) //resizeEvent() m_h2 = m_Percent2DScreen * m_h / 100.0; if (m_h2 > m_h - 30) m_h2 = m_h - 30; - // XXX if (m_bReference ) m_h2 = m_h - 30; if (m_h2 < 1) m_h2 = 1; m_h1 = m_h - m_h2; @@ -209,9 +207,6 @@ void CPlotter::draw(float swide[], bool const bScroll) { - // XXX if(m_bReference != m_bReference0) resizeEvent(nullptr); - // XXX m_bReference0 = m_bReference; - // Move current data down one line (must do this before attaching a QPainter object) if(bScroll && !m_bReplot) @@ -303,24 +298,15 @@ CPlotter::draw(float swide[], case Spectrum::LinearAvg: y = 2.0 * gain2d * sum(spectra_.syellow, i) / m_binsPerPixel + m_plot2dZero; break; - case Spectrum::Reference: - y = spectra_.ref[static_cast(FreqfromX(i) / (12000.0f / 6912.0f) + 0.5f)] + m_plot2dZero; - break; } m_points[i].setX(i); m_points[i].setY(int(0.9 * m_h2 - y * m_h2 / 70.0)); } - // Line color based on what we're about here. Typically green, sometimes - // yellow or blue. - - if (m_spectrum == Spectrum::LinearAvg) { painter2D.setPen(Qt::yellow); } - else if(m_spectrum == Spectrum::Reference) { painter2D.setPen(Qt::blue); } - else { painter2D.setPen(Qt::green); } - // Draw the computed spectrum line. + painter2D.setPen(m_spectrum == Spectrum::LinearAvg ? Qt::yellow : Qt::green); painter2D.drawPolyline(m_points.data(), iz - 1); if (m_bReplot) return; diff --git a/widegraph.cpp b/widegraph.cpp index ba54b9e4..119e0ded 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -162,9 +162,6 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : if(ui->widePlot->spectrum() == WF::Spectrum::Current) ui->spec2dComboBox->setCurrentIndex(0); if(ui->widePlot->spectrum() == WF::Spectrum::Cumulative) ui->spec2dComboBox->setCurrentIndex(1); if(ui->widePlot->spectrum() == WF::Spectrum::LinearAvg) ui->spec2dComboBox->setCurrentIndex(2); -#if JS8_USE_REFSPEC - if(ui->widePlot->spectrum() == WF::Spectrum::Reference) ui->spec2dComboBox->setCurrentIndex(3); -#endif int nbpp=m_settings->value("BinsPerPixel", 2).toInt(); ui->widePlot->setBinsPerPixel(nbpp); ui->sbPercent2dPlot->setValue(m_Percent2DScreen); @@ -716,11 +713,6 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(const int index) ui->widePlot->setSpectrum(WF::Spectrum::LinearAvg); ui->smoSpinBox->setEnabled(true); break; -#if JS8_USE_REFSPEC - case 3: // Reference - ui->widePlot->setSpectrum(WF::Spectrum::Reference); - break; -#endif } replot(); }