2015-10-03 23:28:11 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-06-21 06:46:47 -04:00
|
|
|
#ifndef INCLUDE_CHANNELANALYZERGUI_H
|
|
|
|
#define INCLUDE_CHANNELANALYZERGUI_H
|
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
#include <plugin/plugininstancegui.h>
|
2015-06-21 06:46:47 -04:00
|
|
|
#include "gui/rollupwidget.h"
|
2015-08-24 17:50:52 -04:00
|
|
|
#include "dsp/channelmarker.h"
|
2015-10-03 23:28:11 -04:00
|
|
|
#include "dsp/movingaverage.h"
|
2017-09-16 16:23:31 -04:00
|
|
|
#include "util/messagequeue.h"
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
class PluginAPI;
|
2017-10-30 19:07:55 -04:00
|
|
|
class DeviceUISet;
|
2017-11-08 19:03:05 -05:00
|
|
|
class BasebandSampleSink;
|
2015-06-21 06:46:47 -04:00
|
|
|
class ChannelAnalyzer;
|
2015-06-23 14:05:28 -04:00
|
|
|
class SpectrumScopeComboVis;
|
2015-06-21 06:46:47 -04:00
|
|
|
class SpectrumVis;
|
2015-06-21 22:16:27 -04:00
|
|
|
class ScopeVis;
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ChannelAnalyzerGUI;
|
|
|
|
}
|
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
class ChannelAnalyzerGUI : public RollupWidget, public PluginInstanceGUI {
|
2015-06-21 06:46:47 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-08 19:03:05 -05:00
|
|
|
static ChannelAnalyzerGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUIset, BasebandSampleSink *rxChannel);
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
2015-09-28 21:35:14 -04:00
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2017-09-16 16:23:31 -04:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual bool handleMessage(const Message& message);
|
2015-06-21 06:46:47 -04:00
|
|
|
|
2017-11-13 18:06:42 -05:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ChannelAnalyzerGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-30 19:07:55 -04:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-08-24 17:50:52 -04:00
|
|
|
ChannelMarker m_channelMarker;
|
2015-08-18 19:02:52 -04:00
|
|
|
bool m_doApplySettings;
|
2015-06-21 06:46:47 -04:00
|
|
|
int m_rate;
|
|
|
|
int m_spanLog2;
|
2015-10-03 23:28:11 -04:00
|
|
|
MovingAverage<Real> m_channelPowerDbAvg;
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
ChannelAnalyzer* m_channelAnalyzer;
|
2015-06-23 14:05:28 -04:00
|
|
|
SpectrumScopeComboVis* m_spectrumScopeComboVis;
|
2015-06-21 06:46:47 -04:00
|
|
|
SpectrumVis* m_spectrumVis;
|
2015-06-21 22:16:27 -04:00
|
|
|
ScopeVis* m_scopeVis;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-06-21 06:46:47 -04:00
|
|
|
|
2017-11-08 19:03:05 -05:00
|
|
|
explicit ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-08-18 19:02:52 -04:00
|
|
|
virtual ~ChannelAnalyzerGUI();
|
2015-06-21 06:46:47 -04:00
|
|
|
|
|
|
|
int getEffectiveLowCutoff(int lowCutoff);
|
|
|
|
bool setNewRate(int spanLog2);
|
2015-08-18 19:02:52 -04:00
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
2015-06-21 06:46:47 -04:00
|
|
|
void applySettings();
|
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2017-11-13 18:06:42 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(quint64 value);
|
|
|
|
void on_deltaMinus_toggled(bool minus);
|
|
|
|
void on_BW_valueChanged(int value);
|
|
|
|
void on_lowCut_valueChanged(int value);
|
|
|
|
void on_spanLog2_valueChanged(int value);
|
|
|
|
void on_ssb_toggled(bool checked);
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void handleInputMessages();
|
|
|
|
void tick();
|
2015-06-21 06:46:47 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_CHANNELANALYZERGUI_H
|