diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /widgets/widegraph.cpp | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'widgets/widegraph.cpp')
| -rw-r--r-- | widgets/widegraph.cpp | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp index 2bdef6bd..f33b570c 100644 --- a/widgets/widegraph.cpp +++ b/widgets/widegraph.cpp @@ -11,6 +11,7 @@ #include "Configuration.hpp" #include "MessageBox.hpp" #include "SettingsGroup.hpp" +#include "PerformanceTrace.hpp" #include "moc_widegraph.cpp" WideGraph::WideGraph(QSettings * settings, QWidget *parent) : @@ -23,6 +24,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : m_bHaveTransmitted {false}, m_user_defined {tr ("User Defined")} { + PerformanceTrace::Phase construction {"widegraph.construct"}; ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Wide Graph")); @@ -42,6 +44,9 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : connect(ui->widePlot, SIGNAL(setFreq1(int,int)),this, SLOT(setFreq2(int,int))); + connect(ui->widePlot, SIGNAL(jttyDecodeAgainAt(float)),this, + SLOT(wideJttyDecodeAgainAt(float))); + { //Restore user's settings SettingsGroup g {m_settings, "WideGraph"}; @@ -98,7 +103,6 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : m_waterfallPalette=m_settings->value("WaterfallPalette","Default").toString(); m_userPalette = WFPalette {m_settings->value("UserPalette").value<WFPalette::Colours> ()}; m_fMinPerBand = m_settings->value ("FminPerBand").toHash (); - setRxRange (); ui->controls_widget->setVisible(!m_settings->value("HideControls",false).toBool()); ui->cbControls->setChecked(!m_settings->value("HideControls",false).toBool()); } @@ -193,7 +197,7 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata, float for (int j=0; j<jz; j++) { float ss=0.0; float smax=0; - for (int k=0; k<nbpp; k++) { + for (int k=0; (k<nbpp && i<NSMAX-1); k++) { float sp=splot[i++]; ss += sp; smax=qMax(smax,sp); @@ -273,11 +277,9 @@ void WideGraph::wideFreezeDecode(int n) //wideFreez emit freezeDecode2(n); } -void WideGraph::setRxRange () +void WideGraph::wideJttyDecodeAgainAt(float secondsAgo) //wideJttyDecodeAgainAt { - ui->widePlot->setRxRange (Fmin ()); - ui->widePlot->DrawOverlay(); - ui->widePlot->update(); + emit jttyDecodeAgainAt2(secondsAgo); } int WideGraph::Fmin() //Fmin @@ -295,6 +297,17 @@ int WideGraph::fSpan() return ui->widePlot->fSpan (); } +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) +void WideGraph::setFrequencyScale(int startFrequency, int binsPerPixel, int plotWidth) +{ + ui->widePlot->setFixedWidth(plotWidth); + ui->widePlot->setStartFreq(startFrequency); + ui->widePlot->setBinsPerPixel(binsPerPixel); + ui->fStartSpinBox->setValue(startFrequency); + ui->bppSpinBox->setValue(binsPerPixel); +} +#endif + void WideGraph::setPeriod(double trperiod, int nsps) //SetPeriod { m_TRperiod=trperiod; @@ -365,7 +378,6 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(int index) 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 @@ -392,7 +404,6 @@ void WideGraph::setRxBand (QString const& band) ui->fSplitSpinBox->setEnabled (m_mode.startsWith("FST4")); } ui->widePlot->setRxBand(band); - setRxRange (); } @@ -497,9 +508,31 @@ bool WideGraph::useRef() //Flatten return m_bRef; } +void WideGraph::setReferenceSpectrumAvailable(bool available) +{ + if(!available) { + m_bRef=false; + ui->cbRef->setChecked(false); + ui->widePlot->setFlatten(m_bFlatten,m_bRef); + } + ui->cbRef->setEnabled(available); +} + +void WideGraph::clearReferenceSpectrum(bool reference_spectrum_available) +{ + m_bRef=false; + ui->cbRef->setChecked(false); + ui->widePlot->setFlatten(m_bFlatten,m_bRef); + setReferenceSpectrumAvailable(reference_spectrum_available); + m_n=0; +} + void WideGraph::replot() { - if(ui->widePlot->scaleOK()) ui->widePlot->replot(); + if(ui->widePlot->scaleOK()) { + ui->widePlot->replot(); + ui->widePlot->draw(m_swide,false,false); + } } void WideGraph::on_gainSlider_valueChanged(int value) //Gain |
