From 168e811051316aa925271f0da0d28e119b68ae01 Mon Sep 17 00:00:00 2001 From: manjaro Date: Sat, 20 Mar 2021 21:53:56 +0000 Subject: [PATCH] delete unused interfaces --- specwidget.cpp | 114 ++----------------------------------------------- specwidget.h | 44 +------------------ 2 files changed, 4 insertions(+), 154 deletions(-) diff --git a/specwidget.cpp b/specwidget.cpp index 18ce446..f04ac29 100644 --- a/specwidget.cpp +++ b/specwidget.cpp @@ -39,14 +39,7 @@ specWidget::specWidget(QWidget *parent) : //连接 //connect (ui->plotter,&CPlotter::newDemodFreq,ui->freqCtrl,&CFreqCtrl::setFrequency); - connect (ui->plotter,&CPlotter::newCenterFreq,this, &specWidget::evt_newCenterFreq); - connect (ui->plotter,&CPlotter::newDemodFreq,this, &specWidget::evt_newDemodFreq); connect (ui->plotter,&CPlotter::newDemodFreq,this, &specWidget::slot_newDemodFreq); - connect (ui->plotter,&CPlotter::newLowCutFreq,this, &specWidget::evt_newLowCutFreq); - connect (ui->plotter,&CPlotter::newHighCutFreq,this, &specWidget::evt_newHighCutFreq); - connect (ui->plotter,&CPlotter::newFilterFreq,this, &specWidget::evt_newFilterFreq); - connect (ui->plotter,&CPlotter::pandapterRangeChanged,this, &specWidget::evt_pandapterRangeChanged); - connect (ui->plotter,&CPlotter::newZoomLevel,this, &specWidget::evt_newZoomLevel); connect (ui->freqCtrl,&CFreqCtrl::newFrequency,this, &specWidget::setCenterFreq); connect (watcher,&stdout_watcher::evt_stdata,this,&specWidget::slot_msg,Qt::QueuedConnection); loadSettings(); @@ -83,44 +76,6 @@ void specWidget::slot_msg(QByteArray s, bool bStdErr) QString::fromUtf8(s)); } -void specWidget::setNewFftData(const double * rfftData, int size) -{ - ui->plotter->setNewFftData(rfftData,size); -} -void specWidget::setNewFftDataWf(const double * rfftData, const double * rwfData, int size) -{ - ui->plotter->setNewFftData(rfftData,rwfData,size); -} -void specWidget::setMaxPixmapSize(int w, int h) -{ - ui->plotter->setMaxPixmapSize(QSize(w,h)); -} -void specWidget::setRunningState(bool running) -{ - ui->plotter->setRunningState(running); -} -void specWidget::setClickResolution(int clickres) -{ - ui->plotter->setClickResolution(clickres); -} -void specWidget::setFilterClickResolution(int clickres) -{ - ui->plotter->setFilterClickResolution(clickres); -} -void specWidget::setFilterBoxEnabled(bool enabled) -{ - ui->plotter->setFilterBoxEnabled(enabled); -} -void specWidget::setCenterLineEnabled(bool enabled) -{ - ui->plotter->setCenterLineEnabled(enabled); -} -void specWidget::setTooltipsEnabled(bool enabled){ - ui->plotter->setTooltipsEnabled(enabled); -} -void specWidget::setBookmarksEnabled(bool enabled){ - ui->plotter->setBookmarksEnabled(enabled); -} void specWidget::setCenterFreq(quint64 f){ if (f<=0) return; @@ -130,75 +85,12 @@ void specWidget::setCenterFreq(quint64 f){ ui->doubleSpinBox_center->setValue(ui->freqCtrl->getFrequency()/1e6); //ui->plotter->setCenterFreq(f); } -void specWidget::setFreqUnits(qint32 unit){ - ui->plotter->setFreqUnits(unit); -} -void specWidget::setDemodCenterFreq(quint64 f){ - ui->plotter->setDemodCenterFreq(f); -} -void specWidget::setFilterOffset(qint64 freq_hz){ - ui->plotter->setFilterOffset(freq_hz); -} -qint64 specWidget::getFilterOffset(void){ - return ui->plotter->getFilterOffset(); -} -int specWidget::getFilterBw(){ - return ui->plotter->getFilterBw(); -} -void specWidget::setHiLowCutFrequencies(int LowCut, int HiCut){ - ui->plotter->setHiLowCutFrequencies(LowCut,HiCut); -} -void specWidget::getHiLowCutFrequencies(int *LowCut, int *HiCut){ - ui->plotter->getHiLowCutFrequencies(LowCut,HiCut); -} -void specWidget::setDemodRanges(int FLowCmin, int FLowCmax, int FHiCmin, int FHiCmax, bool symetric){ - ui->plotter->setDemodRanges(FLowCmin, FLowCmax, FHiCmin, FHiCmax, symetric); -} -void specWidget::setSpanFreq(quint32 s){ - ui->plotter->setSpanFreq(s); -} -void specWidget::setMaxBandiwdth(int m){ - ui->plotter->setMaxBandiwdth(m); -} -void specWidget::setHdivDelta(int delta){ - ui->plotter->setHdivDelta(delta); -} -void specWidget::setVdivDelta(int delta){ - ui->plotter->setVdivDelta(delta); -} -void specWidget::setFreqDigits(int digits){ - ui->plotter->setFreqDigits(digits); -} + void specWidget::setSampleRate(double rate){ rate = set_rx_rate(rate); set_tx_rate(rate); ui->plotter->setSampleRate(rate); } -double specWidget::getSampleRate(void){ - return ui->plotter->getSampleRate(); -} -void specWidget::setFftCenterFreq(qint64 f){ - ui->plotter->setFftCenterFreq(f); -} -int specWidget::getNearestPeak(QPoint pt){ - return ui->plotter->getNearestPeak(pt); -} -void specWidget::setWaterfallSpan(quint64 span_ms){ - ui->plotter->setWaterfallSpan(span_ms); -} -quint64 specWidget::getWfTimeRes(void){ - return ui->plotter->getWfTimeRes(); -} -void specWidget::setFftRate(int rate_hz){ - ui->plotter->setFftRate(rate_hz); -} -void specWidget::clearWaterfall(void){ - return ui->plotter->clearWaterfall(); -} -bool specWidget::saveWaterfall(const QString & filename) -{ - return ui->plotter->saveWaterfall(filename); -} void specWidget::on_pushButton_reset_clicked() { @@ -362,7 +254,7 @@ void specWidget::resetProgram() return; int updateIntelv = 1000.0 /ui->spinBox_fftUpdate->value() + .5; //开始 - setSampleRate(getSampleRate()); + setSampleRate(ui->plotter->getSampleRate()); initRx(); initTx(); m_nTimerID = startTimer(updateIntelv); @@ -620,7 +512,7 @@ void specWidget::appendWavComplex(const double (* pWav)[2], const int count, dou m_dFFTAmp[(i+m_nFFTSize/2) % m_nFFTSize] = 5 * log (m_pFFTOut[i][0] * m_pFFTOut[i][0] + m_pFFTOut[i][1] * m_pFFTOut[i][1])/log(10) - minus + m_dManuAdd; } - setNewFftData(m_dFFTAmp.data(),m_nFFTSize); + ui->plotter->setNewFftData(m_dFFTAmp.data(),m_nFFTSize); } diff --git a/specwidget.h b/specwidget.h index a6052fe..8e15a5c 100644 --- a/specwidget.h +++ b/specwidget.h @@ -43,61 +43,19 @@ namespace Ui { class specWidget : public QWidget, public uhd_device { Q_OBJECT - Q_PROPERTY(qint64 sampleRate READ getSampleRate WRITE setSampleRate); - public: explicit specWidget(QWidget *parent = nullptr); ~specWidget(); void setSampleRate(double rate); - double getSampleRate(void); protected: void timerEvent(QTimerEvent * e) override; -signals: - void evt_newCenterFreq(qint64 f); - void evt_newDemodFreq(qint64 freq, qint64 delta); /* delta is the offset from the center */ - void evt_newLowCutFreq(int f); - void evt_newHighCutFreq(int f); - void evt_newFilterFreq(int low, int high); /* substitute for NewLow / NewHigh */ - void evt_pandapterRangeChanged(double min, double max); - void evt_newZoomLevel(double level); - void evt_newCtrlFreq(qint64); public slots: void slot_newDemodFreq(qint64 freq, qint64 delta); /* delta is the offset from the center */ void slot_msg(QByteArray , bool); public: void appendWavComplex(const double (* pWav)[2], const int count, double voltage_ref = 16384); public: - void setNewFftData(const double * rfftData, int size); - void setNewFftDataWf(const double * rfftData, const double * rwfData, int size); - void setMaxPixmapSize(int w, int h); - void setRunningState(bool running); - void setClickResolution(int clickres); - void setFilterClickResolution(int clickres); - void setFilterBoxEnabled(bool enabled); - void setCenterLineEnabled(bool enabled); - void setTooltipsEnabled(bool enabled); - void setBookmarksEnabled(bool enabled); - void setCenterFreq(quint64 f); - void setFreqUnits(qint32 unit); - void setDemodCenterFreq(quint64 f); - void setFilterOffset(qint64 freq_hz); - qint64 getFilterOffset(void); - int getFilterBw(); - void setHiLowCutFrequencies(int LowCut, int HiCut); - void getHiLowCutFrequencies(int *LowCut, int *HiCut); - void setDemodRanges(int FLowCmin, int FLowCmax, int FHiCmin, int FHiCmax, bool symetric); - void setSpanFreq(quint32 s); - void setMaxBandiwdth(int m); - void setHdivDelta(int delta); - void setVdivDelta(int delta); - void setFreqDigits(int digits); - void setFftCenterFreq(qint64 f); - int getNearestPeak(QPoint pt); - void setWaterfallSpan(quint64 span_ms); - quint64 getWfTimeRes(void); - void setFftRate(int rate_hz); - void clearWaterfall(void); - bool saveWaterfall(const QString & filename); + void setCenterFreq(quint64 f); private slots: void on_pushButton_reset_clicked(); void on_comboBox_fftSize_activated(int index); -- GitLab