mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-13 20:01:46 -05:00
Renamed Channel Analyzer NG to Channel Analyzer (1)
This commit is contained in:
parent
766e6aac1c
commit
f8c7763fc7
@ -1,17 +1,17 @@
|
||||
project(chanalyzerng)
|
||||
|
||||
set(chanalyzerng_SOURCES
|
||||
chanalyzerng.cpp
|
||||
chanalyzernggui.cpp
|
||||
chanalyzerngplugin.cpp
|
||||
chanalyzerngsettings.cpp
|
||||
chanalyzer.cpp
|
||||
chanalyzergui.cpp
|
||||
chanalyzerplugin.cpp
|
||||
chanalyzersettings.cpp
|
||||
)
|
||||
|
||||
set(chanalyzerng_HEADERS
|
||||
chanalyzerng.h
|
||||
chanalyzernggui.h
|
||||
chanalyzerngplugin.h
|
||||
chanalyzerngsettings.h
|
||||
chanalyzer.h
|
||||
chanalyzergui.h
|
||||
chanalyzerplugin.h
|
||||
chanalyzersettings.h
|
||||
)
|
||||
|
||||
set(chanalyzerng_FORMS
|
||||
|
@ -14,8 +14,6 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "chanalyzerng.h"
|
||||
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
#include <stdio.h>
|
||||
@ -24,16 +22,17 @@
|
||||
#include "audio/audiooutput.h"
|
||||
#include "dsp/threadedbasebandsamplesink.h"
|
||||
#include "dsp/downchannelizer.h"
|
||||
#include "chanalyzer.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelAnalyzer, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelAnalyzerOld, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelAnalyzer, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelAnalyzerOld, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelizer, Message)
|
||||
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgReportChannelSampleRateChanged, Message)
|
||||
|
||||
const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzer";
|
||||
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzer";
|
||||
const QString ChannelAnalyzer::m_channelIdURI = "sdrangel.channel.chanalyzer";
|
||||
const QString ChannelAnalyzer::m_channelId = "ChannelAnalyzer";
|
||||
|
||||
ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
|
||||
ChannelAnalyzer::ChannelAnalyzer(DeviceSourceAPI *deviceAPI) :
|
||||
ChannelSinkAPI(m_channelIdURI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_sampleSink(0),
|
||||
@ -65,7 +64,7 @@ ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
|
||||
m_deviceAPI->addChannelAPI(this);
|
||||
}
|
||||
|
||||
ChannelAnalyzerNG::~ChannelAnalyzerNG()
|
||||
ChannelAnalyzer::~ChannelAnalyzer()
|
||||
{
|
||||
m_deviceAPI->removeChannelAPI(this);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
@ -76,7 +75,7 @@ ChannelAnalyzerNG::~ChannelAnalyzerNG()
|
||||
delete RRCFilter;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::configure(MessageQueue* messageQueue,
|
||||
void ChannelAnalyzer::configure(MessageQueue* messageQueue,
|
||||
int channelSampleRate,
|
||||
Real Bandwidth,
|
||||
Real LowCutoff,
|
||||
@ -90,7 +89,7 @@ void ChannelAnalyzerNG::configure(MessageQueue* messageQueue,
|
||||
messageQueue->push(cmd);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly __attribute__((unused)))
|
||||
void ChannelAnalyzer::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly __attribute__((unused)))
|
||||
{
|
||||
fftfilt::cmplx *sideband = 0;
|
||||
Complex ci;
|
||||
@ -126,7 +125,7 @@ void ChannelAnalyzerNG::feed(const SampleVector::const_iterator& begin, const Sa
|
||||
m_settingsMutex.unlock();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::processOneSample(Complex& c, fftfilt::cmplx *sideband)
|
||||
void ChannelAnalyzer::processOneSample(Complex& c, fftfilt::cmplx *sideband)
|
||||
{
|
||||
int n_out;
|
||||
int decim = 1<<m_settings.m_spanLog2;
|
||||
@ -181,16 +180,16 @@ void ChannelAnalyzerNG::processOneSample(Complex& c, fftfilt::cmplx *sideband)
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::start()
|
||||
void ChannelAnalyzer::start()
|
||||
{
|
||||
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::stop()
|
||||
void ChannelAnalyzer::stop()
|
||||
{
|
||||
}
|
||||
|
||||
bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
||||
bool ChannelAnalyzer::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (DownChannelizer::MsgChannelizerNotification::match(cmd))
|
||||
{
|
||||
@ -244,7 +243,7 @@ bool ChannelAnalyzerNG::handleMessage(const Message& cmd)
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force)
|
||||
void ChannelAnalyzer::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force)
|
||||
{
|
||||
qDebug() << "ChannelAnalyzerNG::applyChannelSettings:"
|
||||
<< " inputSampleRate: " << inputSampleRate
|
||||
@ -278,7 +277,7 @@ void ChannelAnalyzerNG::applyChannelSettings(int inputSampleRate, int inputFrequ
|
||||
m_inputFrequencyOffset = inputFrequencyOffset;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::setFilters(int sampleRate, float bandwidth, float lowCutoff)
|
||||
void ChannelAnalyzer::setFilters(int sampleRate, float bandwidth, float lowCutoff)
|
||||
{
|
||||
qDebug("ChannelAnalyzerNG::setFilters: sampleRate: %d bandwidth: %f lowCutoff: %f",
|
||||
sampleRate, bandwidth, lowCutoff);
|
||||
@ -305,7 +304,7 @@ void ChannelAnalyzerNG::setFilters(int sampleRate, float bandwidth, float lowCut
|
||||
RRCFilter->create_rrc_filter(bandwidth / sampleRate, m_settings.m_rrcRolloff / 100.0);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNG::applySettings(const ChannelAnalyzerNGSettings& settings, bool force)
|
||||
void ChannelAnalyzer::applySettings(const ChannelAnalyzerSettings& settings, bool force)
|
||||
{
|
||||
qDebug() << "ChannelAnalyzerNG::applySettings:"
|
||||
<< " m_downSample: " << settings.m_downSample
|
@ -31,7 +31,7 @@
|
||||
#include "audio/audiofifo.h"
|
||||
#include "util/message.h"
|
||||
|
||||
#include "chanalyzerngsettings.h"
|
||||
#include "chanalyzersettings.h"
|
||||
|
||||
#define ssbFftLen 1024
|
||||
|
||||
@ -39,25 +39,25 @@ class DeviceSourceAPI;
|
||||
class ThreadedBasebandSampleSink;
|
||||
class DownChannelizer;
|
||||
|
||||
class ChannelAnalyzerNG : public BasebandSampleSink, public ChannelSinkAPI {
|
||||
class ChannelAnalyzer : public BasebandSampleSink, public ChannelSinkAPI {
|
||||
public:
|
||||
class MsgConfigureChannelAnalyzer : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const ChannelAnalyzerNGSettings& getSettings() const { return m_settings; }
|
||||
const ChannelAnalyzerSettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureChannelAnalyzer* create(const ChannelAnalyzerNGSettings& settings, bool force)
|
||||
static MsgConfigureChannelAnalyzer* create(const ChannelAnalyzerSettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureChannelAnalyzer(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
ChannelAnalyzerNGSettings m_settings;
|
||||
ChannelAnalyzerSettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureChannelAnalyzer(const ChannelAnalyzerNGSettings& settings, bool force) :
|
||||
MsgConfigureChannelAnalyzer(const ChannelAnalyzerSettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
@ -169,8 +169,8 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~ChannelAnalyzerNG();
|
||||
ChannelAnalyzer(DeviceSourceAPI *deviceAPI);
|
||||
virtual ~ChannelAnalyzer();
|
||||
virtual void destroy() { delete this; }
|
||||
void setSampleSink(BasebandSampleSink* sampleSink) { m_sampleSink = sampleSink; }
|
||||
|
||||
@ -212,7 +212,7 @@ private:
|
||||
DeviceSourceAPI *m_deviceAPI;
|
||||
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
||||
DownChannelizer* m_channelizer;
|
||||
ChannelAnalyzerNGSettings m_settings;
|
||||
ChannelAnalyzerSettings m_settings;
|
||||
|
||||
int m_inputSampleRate;
|
||||
int m_inputFrequencyOffset;
|
||||
@ -240,7 +240,7 @@ private:
|
||||
|
||||
// void apply(bool force = false);
|
||||
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
|
||||
void applySettings(const ChannelAnalyzerNGSettings& settings, bool force = false);
|
||||
void applySettings(const ChannelAnalyzerSettings& settings, bool force = false);
|
||||
void setFilters(int sampleRate, float bandwidth, float lowCutoff);
|
||||
void processOneSample(Complex& c, fftfilt::cmplx *sideband);
|
||||
|
||||
@ -248,7 +248,7 @@ private:
|
||||
{
|
||||
switch (m_settings.m_inputType)
|
||||
{
|
||||
case ChannelAnalyzerNGSettings::InputPLL:
|
||||
case ChannelAnalyzerSettings::InputPLL:
|
||||
{
|
||||
if (m_settings.m_ssb & !m_usb) { // invert spectrum for LSB
|
||||
m_sampleBuffer.push_back(Sample(pll.imag()*SDR_RX_SCALEF, pll.real()*SDR_RX_SCALEF));
|
||||
@ -257,7 +257,7 @@ private:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ChannelAnalyzerNGSettings::InputAutoCorr:
|
||||
case ChannelAnalyzerSettings::InputAutoCorr:
|
||||
{
|
||||
std::complex<float> a = m_corr->run(s/(SDR_RX_SCALEF/768.0f), 0);
|
||||
|
||||
@ -268,7 +268,7 @@ private:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ChannelAnalyzerNGSettings::InputSignal:
|
||||
case ChannelAnalyzerSettings::InputSignal:
|
||||
default:
|
||||
{
|
||||
if (m_settings.m_ssb & !m_usb) { // invert spectrum for LSB
|
@ -14,8 +14,6 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "chanalyzernggui.h"
|
||||
|
||||
#include <device/devicesourceapi.h>
|
||||
#include "device/deviceuiset.h"
|
||||
#include <dsp/downchannelizer.h>
|
||||
@ -36,47 +34,48 @@
|
||||
#include "dsp/dspengine.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "chanalyzerng.h"
|
||||
#include "chanalyzer.h"
|
||||
#include "chanalyzergui.h"
|
||||
|
||||
ChannelAnalyzerNGGUI* ChannelAnalyzerNGGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
||||
ChannelAnalyzerGUI* ChannelAnalyzerGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
||||
{
|
||||
ChannelAnalyzerNGGUI* gui = new ChannelAnalyzerNGGUI(pluginAPI, deviceUISet, rxChannel);
|
||||
ChannelAnalyzerGUI* gui = new ChannelAnalyzerGUI(pluginAPI, deviceUISet, rxChannel);
|
||||
return gui;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::destroy()
|
||||
void ChannelAnalyzerGUI::destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::setName(const QString& name)
|
||||
void ChannelAnalyzerGUI::setName(const QString& name)
|
||||
{
|
||||
setObjectName(name);
|
||||
}
|
||||
|
||||
QString ChannelAnalyzerNGGUI::getName() const
|
||||
QString ChannelAnalyzerGUI::getName() const
|
||||
{
|
||||
return objectName();
|
||||
}
|
||||
|
||||
qint64 ChannelAnalyzerNGGUI::getCenterFrequency() const
|
||||
qint64 ChannelAnalyzerGUI::getCenterFrequency() const
|
||||
{
|
||||
return m_channelMarker.getCenterFrequency();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::setCenterFrequency(qint64 centerFrequency)
|
||||
void ChannelAnalyzerGUI::setCenterFrequency(qint64 centerFrequency)
|
||||
{
|
||||
m_channelMarker.setCenterFrequency(centerFrequency);
|
||||
m_settings.m_frequency = m_channelMarker.getCenterFrequency();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::resetToDefaults()
|
||||
void ChannelAnalyzerGUI::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::displaySettings()
|
||||
void ChannelAnalyzerGUI::displaySettings()
|
||||
{
|
||||
m_channelMarker.blockSignals(true);
|
||||
m_channelMarker.setCenterFrequency(m_settings.m_frequency);
|
||||
@ -127,7 +126,7 @@ void ChannelAnalyzerNGGUI::displaySettings()
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::displayPLLSettings()
|
||||
void ChannelAnalyzerGUI::displayPLLSettings()
|
||||
{
|
||||
if (m_settings.m_fll)
|
||||
{
|
||||
@ -143,7 +142,7 @@ void ChannelAnalyzerNGGUI::displayPLLSettings()
|
||||
ui->pll->setChecked(m_settings.m_pll);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::setSpectrumDisplay()
|
||||
void ChannelAnalyzerGUI::setSpectrumDisplay()
|
||||
{
|
||||
qDebug("ChannelAnalyzerNGGUI::setSpectrumDisplay: m_rate: %d", m_rate);
|
||||
if (m_settings.m_ssb)
|
||||
@ -162,12 +161,12 @@ void ChannelAnalyzerNGGUI::setSpectrumDisplay()
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray ChannelAnalyzerNGGUI::serialize() const
|
||||
QByteArray ChannelAnalyzerGUI::serialize() const
|
||||
{
|
||||
return m_settings.serialize();
|
||||
}
|
||||
|
||||
bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
||||
bool ChannelAnalyzerGUI::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data))
|
||||
{
|
||||
@ -184,9 +183,9 @@ bool ChannelAnalyzerNGGUI::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
bool ChannelAnalyzerNGGUI::handleMessage(const Message& message)
|
||||
bool ChannelAnalyzerGUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (ChannelAnalyzerNG::MsgReportChannelSampleRateChanged::match(message))
|
||||
if (ChannelAnalyzer::MsgReportChannelSampleRateChanged::match(message))
|
||||
{
|
||||
qDebug() << "ChannelAnalyzerNGGUI::handleMessage: MsgReportChannelSampleRateChanged";
|
||||
ui->channelSampleRate->setValueRange(7, 2000U, m_channelAnalyzer->getInputSampleRate());
|
||||
@ -199,7 +198,7 @@ bool ChannelAnalyzerNGGUI::handleMessage(const Message& message)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::handleInputMessages()
|
||||
void ChannelAnalyzerGUI::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
@ -214,18 +213,18 @@ void ChannelAnalyzerNGGUI::handleInputMessages()
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::channelMarkerChangedByCursor()
|
||||
void ChannelAnalyzerGUI::channelMarkerChangedByCursor()
|
||||
{
|
||||
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::channelMarkerHighlightedByCursor()
|
||||
void ChannelAnalyzerGUI::channelMarkerHighlightedByCursor()
|
||||
{
|
||||
setHighlighted(m_channelMarker.getHighlighted());
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::tick()
|
||||
void ChannelAnalyzerGUI::tick()
|
||||
{
|
||||
double powDb = CalcDb::dbPower(m_channelAnalyzer->getMagSq());
|
||||
m_channelPowerDbAvg(powDb);
|
||||
@ -244,14 +243,14 @@ void ChannelAnalyzerNGGUI::tick()
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_channelSampleRate_changed(quint64 value)
|
||||
void ChannelAnalyzerGUI::on_channelSampleRate_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_downSampleRate = value;
|
||||
setNewFinalRate();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_pll_toggled(bool checked)
|
||||
void ChannelAnalyzerGUI::on_pll_toggled(bool checked)
|
||||
{
|
||||
if (!checked) {
|
||||
ui->pll->setToolTip(tr("PLL lock"));
|
||||
@ -261,7 +260,7 @@ void ChannelAnalyzerNGGUI::on_pll_toggled(bool checked)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_pllPskOrder_currentIndexChanged(int index)
|
||||
void ChannelAnalyzerGUI::on_pllPskOrder_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < 5) {
|
||||
m_settings.m_pllPskOrder = (1<<index);
|
||||
@ -271,14 +270,14 @@ void ChannelAnalyzerNGGUI::on_pllPskOrder_currentIndexChanged(int index)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_useRationalDownsampler_toggled(bool checked)
|
||||
void ChannelAnalyzerGUI::on_useRationalDownsampler_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_downSample = checked;
|
||||
setNewFinalRate();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
int ChannelAnalyzerNGGUI::getRequestedChannelSampleRate()
|
||||
int ChannelAnalyzerGUI::getRequestedChannelSampleRate()
|
||||
{
|
||||
if (ui->useRationalDownsampler->isChecked()) {
|
||||
return ui->channelSampleRate->getValueNew();
|
||||
@ -287,26 +286,26 @@ int ChannelAnalyzerNGGUI::getRequestedChannelSampleRate()
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_signalSelect_currentIndexChanged(int index)
|
||||
void ChannelAnalyzerGUI::on_signalSelect_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_inputType = (ChannelAnalyzerNGSettings::InputType) index;
|
||||
m_settings.m_inputType = (ChannelAnalyzerSettings::InputType) index;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_deltaFrequency_changed(qint64 value)
|
||||
void ChannelAnalyzerGUI::on_deltaFrequency_changed(qint64 value)
|
||||
{
|
||||
m_channelMarker.setCenterFrequency(value);
|
||||
m_settings.m_frequency = m_channelMarker.getCenterFrequency();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_rrcFilter_toggled(bool checked)
|
||||
void ChannelAnalyzerGUI::on_rrcFilter_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_rrc = checked;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_rrcRolloff_valueChanged(int value)
|
||||
void ChannelAnalyzerGUI::on_rrcRolloff_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_rrcRolloff = value;
|
||||
QString rolloffStr = QString::number(value/100.0, 'f', 2);
|
||||
@ -314,7 +313,7 @@ void ChannelAnalyzerNGGUI::on_rrcRolloff_valueChanged(int value)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_BW_valueChanged(int value __attribute__((unused)))
|
||||
void ChannelAnalyzerGUI::on_BW_valueChanged(int value __attribute__((unused)))
|
||||
{
|
||||
setFiltersUIBoundaries();
|
||||
m_settings.m_bandwidth = ui->BW->value() * 100;
|
||||
@ -322,7 +321,7 @@ void ChannelAnalyzerNGGUI::on_BW_valueChanged(int value __attribute__((unused)))
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_lowCut_valueChanged(int value __attribute__((unused)))
|
||||
void ChannelAnalyzerGUI::on_lowCut_valueChanged(int value __attribute__((unused)))
|
||||
{
|
||||
setFiltersUIBoundaries();
|
||||
m_settings.m_bandwidth = ui->BW->value() * 100;
|
||||
@ -330,7 +329,7 @@ void ChannelAnalyzerNGGUI::on_lowCut_valueChanged(int value __attribute__((unuse
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_spanLog2_currentIndexChanged(int index)
|
||||
void ChannelAnalyzerGUI::on_spanLog2_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index < 0) || (index > 6)) {
|
||||
return;
|
||||
@ -341,7 +340,7 @@ void ChannelAnalyzerNGGUI::on_spanLog2_currentIndexChanged(int index)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::on_ssb_toggled(bool checked)
|
||||
void ChannelAnalyzerGUI::on_ssb_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_ssb = checked;
|
||||
if (checked) {
|
||||
@ -353,11 +352,11 @@ void ChannelAnalyzerNGGUI::on_ssb_toggled(bool checked)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
|
||||
void ChannelAnalyzerGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::onMenuDialogCalled(const QPoint& p)
|
||||
void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p)
|
||||
{
|
||||
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
|
||||
dialog.move(p);
|
||||
@ -373,7 +372,7 @@ void ChannelAnalyzerNGGUI::onMenuDialogCalled(const QPoint& p)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
|
||||
ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::ChannelAnalyzerNGGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
@ -390,7 +389,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum);
|
||||
m_scopeVis = new ScopeVisNG(ui->glScope);
|
||||
m_spectrumScopeComboVis = new SpectrumScopeNGComboVis(m_spectrumVis, m_scopeVis);
|
||||
m_channelAnalyzer = (ChannelAnalyzerNG*) rxChannel; //new ChannelAnalyzerNG(m_deviceUISet->m_deviceSourceAPI);
|
||||
m_channelAnalyzer = (ChannelAnalyzer*) rxChannel; //new ChannelAnalyzerNG(m_deviceUISet->m_deviceSourceAPI);
|
||||
m_channelAnalyzer->setSampleSink(m_spectrumScopeComboVis);
|
||||
m_channelAnalyzer->setMessageQueueToGUI(getInputMessageQueue());
|
||||
|
||||
@ -422,7 +421,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
setTitleColor(m_channelMarker.getColor());
|
||||
|
||||
m_deviceUISet->registerRxChannelInstance(ChannelAnalyzerNG::m_channelIdURI, this);
|
||||
m_deviceUISet->registerRxChannelInstance(ChannelAnalyzer::m_channelIdURI, this);
|
||||
m_deviceUISet->addChannelMarker(&m_channelMarker);
|
||||
m_deviceUISet->addRollupWidget(this);
|
||||
|
||||
@ -441,7 +440,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
|
||||
applySettings(true);
|
||||
}
|
||||
|
||||
ChannelAnalyzerNGGUI::~ChannelAnalyzerNGGUI()
|
||||
ChannelAnalyzerGUI::~ChannelAnalyzerGUI()
|
||||
{
|
||||
m_deviceUISet->removeRxChannelInstance(this);
|
||||
delete m_channelAnalyzer; // TODO: check this: when the GUI closes it has to delete the demodulator
|
||||
@ -451,7 +450,7 @@ ChannelAnalyzerNGGUI::~ChannelAnalyzerNGGUI()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::setNewFinalRate()
|
||||
void ChannelAnalyzerGUI::setNewFinalRate()
|
||||
{
|
||||
m_rate = getRequestedChannelSampleRate() / (1<<m_settings.m_spanLog2);
|
||||
if (m_rate == 0) {
|
||||
@ -468,7 +467,7 @@ void ChannelAnalyzerNGGUI::setNewFinalRate()
|
||||
m_scopeVis->setSampleRate(m_rate);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::setFiltersUIBoundaries()
|
||||
void ChannelAnalyzerGUI::setFiltersUIBoundaries()
|
||||
{
|
||||
bool dsb = !ui->ssb->isChecked();
|
||||
int bw = ui->BW->value();
|
||||
@ -526,39 +525,39 @@ void ChannelAnalyzerNGGUI::setFiltersUIBoundaries()
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::blockApplySettings(bool block)
|
||||
void ChannelAnalyzerGUI::blockApplySettings(bool block)
|
||||
{
|
||||
ui->glScope->blockSignals(block);
|
||||
ui->glSpectrum->blockSignals(block);
|
||||
m_doApplySettings = !block;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::applySettings(bool force)
|
||||
void ChannelAnalyzerGUI::applySettings(bool force)
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
int sampleRate = getRequestedChannelSampleRate();
|
||||
|
||||
ChannelAnalyzerNG::MsgConfigureChannelizer *msgChannelizer =
|
||||
ChannelAnalyzerNG::MsgConfigureChannelizer::create(sampleRate, m_channelMarker.getCenterFrequency());
|
||||
ChannelAnalyzer::MsgConfigureChannelizer *msgChannelizer =
|
||||
ChannelAnalyzer::MsgConfigureChannelizer::create(sampleRate, m_channelMarker.getCenterFrequency());
|
||||
m_channelAnalyzer->getInputMessageQueue()->push(msgChannelizer);
|
||||
|
||||
ChannelAnalyzerNG::MsgConfigureChannelizer *msg =
|
||||
ChannelAnalyzerNG::MsgConfigureChannelizer::create(sampleRate, m_channelMarker.getCenterFrequency());
|
||||
ChannelAnalyzer::MsgConfigureChannelizer *msg =
|
||||
ChannelAnalyzer::MsgConfigureChannelizer::create(sampleRate, m_channelMarker.getCenterFrequency());
|
||||
m_channelAnalyzer->getInputMessageQueue()->push(msg);
|
||||
|
||||
ChannelAnalyzerNG::MsgConfigureChannelAnalyzer* message =
|
||||
ChannelAnalyzerNG::MsgConfigureChannelAnalyzer::create( m_settings, force);
|
||||
ChannelAnalyzer::MsgConfigureChannelAnalyzer* message =
|
||||
ChannelAnalyzer::MsgConfigureChannelAnalyzer::create( m_settings, force);
|
||||
m_channelAnalyzer->getInputMessageQueue()->push(message);
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::leaveEvent(QEvent*)
|
||||
void ChannelAnalyzerGUI::leaveEvent(QEvent*)
|
||||
{
|
||||
m_channelMarker.setHighlighted(false);
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGGUI::enterEvent(QEvent*)
|
||||
void ChannelAnalyzerGUI::enterEvent(QEvent*)
|
||||
{
|
||||
m_channelMarker.setHighlighted(true);
|
||||
}
|
@ -24,12 +24,12 @@
|
||||
#include "util/movingaverage.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
#include "chanalyzerngsettings.h"
|
||||
#include "chanalyzersettings.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSink;
|
||||
class ChannelAnalyzerNG;
|
||||
class ChannelAnalyzer;
|
||||
class SpectrumScopeNGComboVis;
|
||||
class SpectrumVis;
|
||||
class ScopeVisNG;
|
||||
@ -38,11 +38,11 @@ namespace Ui {
|
||||
class ChannelAnalyzerNGGUI;
|
||||
}
|
||||
|
||||
class ChannelAnalyzerNGGUI : public RollupWidget, public PluginInstanceGUI {
|
||||
class ChannelAnalyzerGUI : public RollupWidget, public PluginInstanceGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static ChannelAnalyzerNGGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
||||
static ChannelAnalyzerGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
||||
virtual void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -65,19 +65,19 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceUISet* m_deviceUISet;
|
||||
ChannelMarker m_channelMarker;
|
||||
ChannelAnalyzerNGSettings m_settings;
|
||||
ChannelAnalyzerSettings m_settings;
|
||||
bool m_doApplySettings;
|
||||
int m_rate; //!< sample rate after final in-channel decimation (spanlog2)
|
||||
MovingAverageUtil<Real, double, 40> m_channelPowerDbAvg;
|
||||
|
||||
ChannelAnalyzerNG* m_channelAnalyzer;
|
||||
ChannelAnalyzer* m_channelAnalyzer;
|
||||
SpectrumScopeNGComboVis* m_spectrumScopeComboVis;
|
||||
SpectrumVis* m_spectrumVis;
|
||||
ScopeVisNG* m_scopeVis;
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
explicit ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
||||
virtual ~ChannelAnalyzerNGGUI();
|
||||
explicit ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
||||
virtual ~ChannelAnalyzerGUI();
|
||||
|
||||
int getRequestedChannelSampleRate();
|
||||
void setNewFinalRate(); //!< set sample rate after final in-channel decimation
|
@ -17,11 +17,11 @@
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "chanalyzerngplugin.h"
|
||||
#include "chanalyzernggui.h"
|
||||
#include "chanalyzerng.h"
|
||||
#include "chanalyzer.h"
|
||||
#include "chanalyzerplugin.h"
|
||||
#include "chanalyzergui.h"
|
||||
|
||||
const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = {
|
||||
const PluginDescriptor ChannelAnalyzerPlugin::m_pluginDescriptor = {
|
||||
QString("Channel Analyzer"),
|
||||
QString("4.0.0"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
@ -30,37 +30,37 @@ const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = {
|
||||
QString("https://github.com/f4exb/sdrangel")
|
||||
};
|
||||
|
||||
ChannelAnalyzerNGPlugin::ChannelAnalyzerNGPlugin(QObject* parent) :
|
||||
ChannelAnalyzerPlugin::ChannelAnalyzerPlugin(QObject* parent) :
|
||||
QObject(parent),
|
||||
m_pluginAPI(0)
|
||||
{
|
||||
}
|
||||
|
||||
const PluginDescriptor& ChannelAnalyzerNGPlugin::getPluginDescriptor() const
|
||||
const PluginDescriptor& ChannelAnalyzerPlugin::getPluginDescriptor() const
|
||||
{
|
||||
return m_pluginDescriptor;
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
void ChannelAnalyzerPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
m_pluginAPI = pluginAPI;
|
||||
|
||||
// register demodulator
|
||||
m_pluginAPI->registerRxChannel(ChannelAnalyzerNG::m_channelIdURI, ChannelAnalyzerNG::m_channelId, this);
|
||||
m_pluginAPI->registerRxChannel(ChannelAnalyzer::m_channelIdURI, ChannelAnalyzer::m_channelId, this);
|
||||
}
|
||||
|
||||
PluginInstanceGUI* ChannelAnalyzerNGPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
||||
PluginInstanceGUI* ChannelAnalyzerPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
|
||||
{
|
||||
return ChannelAnalyzerNGGUI::create(m_pluginAPI, deviceUISet, rxChannel);
|
||||
return ChannelAnalyzerGUI::create(m_pluginAPI, deviceUISet, rxChannel);
|
||||
}
|
||||
|
||||
BasebandSampleSink* ChannelAnalyzerNGPlugin::createRxChannelBS(DeviceSourceAPI *deviceAPI)
|
||||
BasebandSampleSink* ChannelAnalyzerPlugin::createRxChannelBS(DeviceSourceAPI *deviceAPI)
|
||||
{
|
||||
return new ChannelAnalyzerNG(deviceAPI);
|
||||
return new ChannelAnalyzer(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSinkAPI* ChannelAnalyzerNGPlugin::createRxChannelCS(DeviceSourceAPI *deviceAPI)
|
||||
ChannelSinkAPI* ChannelAnalyzerPlugin::createRxChannelCS(DeviceSourceAPI *deviceAPI)
|
||||
{
|
||||
return new ChannelAnalyzerNG(deviceAPI);
|
||||
return new ChannelAnalyzer(deviceAPI);
|
||||
}
|
||||
|
@ -24,13 +24,13 @@
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSink;
|
||||
|
||||
class ChannelAnalyzerNGPlugin : public QObject, PluginInterface {
|
||||
class ChannelAnalyzerPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID "sdrangel.channel.chanalyzerng")
|
||||
|
||||
public:
|
||||
explicit ChannelAnalyzerNGPlugin(QObject* parent = NULL);
|
||||
explicit ChannelAnalyzerPlugin(QObject* parent = NULL);
|
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
@ -19,9 +19,10 @@
|
||||
#include "dsp/dspengine.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "settings/serializable.h"
|
||||
#include "chanalyzerngsettings.h"
|
||||
|
||||
ChannelAnalyzerNGSettings::ChannelAnalyzerNGSettings() :
|
||||
#include "chanalyzersettings.h"
|
||||
|
||||
ChannelAnalyzerSettings::ChannelAnalyzerSettings() :
|
||||
m_channelMarker(0),
|
||||
m_spectrumGUI(0),
|
||||
m_scopeGUI(0)
|
||||
@ -29,7 +30,7 @@ ChannelAnalyzerNGSettings::ChannelAnalyzerNGSettings() :
|
||||
resetToDefaults();
|
||||
}
|
||||
|
||||
void ChannelAnalyzerNGSettings::resetToDefaults()
|
||||
void ChannelAnalyzerSettings::resetToDefaults()
|
||||
{
|
||||
m_frequency = 0;
|
||||
m_downSample = false;
|
||||
@ -48,7 +49,7 @@ void ChannelAnalyzerNGSettings::resetToDefaults()
|
||||
m_title = "Channel Analyzer";
|
||||
}
|
||||
|
||||
QByteArray ChannelAnalyzerNGSettings::serialize() const
|
||||
QByteArray ChannelAnalyzerSettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
@ -73,7 +74,7 @@ QByteArray ChannelAnalyzerNGSettings::serialize() const
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool ChannelAnalyzerNGSettings::deserialize(const QByteArray& data)
|
||||
bool ChannelAnalyzerSettings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
@ -14,14 +14,14 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERNGSETTINGS_H_
|
||||
#define PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERNGSETTINGS_H_
|
||||
#ifndef PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERSETTINGS_H_
|
||||
#define PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERSETTINGS_H_
|
||||
|
||||
#include <QByteArray>
|
||||
|
||||
class Serializable;
|
||||
|
||||
struct ChannelAnalyzerNGSettings
|
||||
struct ChannelAnalyzerSettings
|
||||
{
|
||||
enum InputType
|
||||
{
|
||||
@ -49,7 +49,7 @@ struct ChannelAnalyzerNGSettings
|
||||
Serializable *m_spectrumGUI;
|
||||
Serializable *m_scopeGUI;
|
||||
|
||||
ChannelAnalyzerNGSettings();
|
||||
ChannelAnalyzerSettings();
|
||||
void resetToDefaults();
|
||||
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
|
||||
void setSpectrumGUI(Serializable *spectrumGUI) { m_spectrumGUI = spectrumGUI; }
|
||||
@ -60,4 +60,4 @@ struct ChannelAnalyzerNGSettings
|
||||
|
||||
|
||||
|
||||
#endif /* PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERNGSETTINGS_H_ */
|
||||
#endif /* PLUGINS_CHANNELRX_CHANALYZERNG_CHANALYZERSETTINGS_H_ */
|
Loading…
Reference in New Issue
Block a user