2015-12-06 13:47:55 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2015 F4EXB //
|
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// 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-11-19 02:55:58 -05:00
|
|
|
#ifndef INCLUDE_UDPSRCGUI_H
|
|
|
|
#define INCLUDE_UDPSRCGUI_H
|
2015-11-18 21:27:37 -05:00
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
#include <plugin/plugininstancegui.h>
|
2015-11-18 21:27:37 -05:00
|
|
|
#include <QHostAddress>
|
|
|
|
#include "gui/rollupwidget.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
2017-09-16 16:23:31 -04:00
|
|
|
#include "util/messagequeue.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
|
2017-08-13 19:39:26 -04:00
|
|
|
#include "udpsrc.h"
|
2017-10-05 02:17:49 -04:00
|
|
|
#include "udpsrcsettings.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
class PluginAPI;
|
2017-10-31 03:24:05 -04:00
|
|
|
class DeviceUISet;
|
2015-11-18 21:27:37 -05:00
|
|
|
class UDPSrc;
|
|
|
|
class SpectrumVis;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class UDPSrcGUI;
|
|
|
|
}
|
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
class UDPSrcGUI : public RollupWidget, public PluginInstanceGUI {
|
2015-11-18 21:27:37 -05:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-08 19:03:05 -05:00
|
|
|
static UDPSrcGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
|
|
|
|
|
|
|
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-11-18 21:27:37 -05:00
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
2017-11-14 02:35:18 -05:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 16:58:35 -05:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::UDPSrcGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 03:24:05 -04:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-11-19 02:55:58 -05:00
|
|
|
UDPSrc* m_udpSrc;
|
2017-10-05 02:17:49 -04:00
|
|
|
UDPSrcSettings m_settings;
|
2015-11-18 21:27:37 -05:00
|
|
|
ChannelMarker m_channelMarker;
|
2017-08-17 06:57:45 -04:00
|
|
|
MovingAverage<double> m_channelPowerAvg;
|
2017-08-17 14:23:17 -04:00
|
|
|
MovingAverage<double> m_inPowerAvg;
|
2017-08-17 06:57:45 -04:00
|
|
|
uint32_t m_tickCount;
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
// settings
|
|
|
|
bool m_doApplySettings;
|
2017-10-06 23:44:43 -04:00
|
|
|
bool m_rfBandwidthChanged;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
// RF path
|
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
2017-11-08 19:03:05 -05:00
|
|
|
explicit UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-11-18 21:27:37 -05:00
|
|
|
virtual ~UDPSrcGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
2017-08-18 18:12:56 -04:00
|
|
|
void applySettings(bool force = false);
|
|
|
|
void applySettingsImmediate(bool force = false);
|
2017-08-17 06:57:45 -04:00
|
|
|
void displaySettings();
|
2017-10-06 23:44:43 -04:00
|
|
|
void setSampleFormat(int index);
|
|
|
|
void setSampleFormatIndex(const UDPSrcSettings::SampleFormat& sampleFormat);
|
2016-04-03 12:14:04 -04:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2017-11-14 02:35:18 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
|
|
|
void on_sampleFormat_currentIndexChanged(int index);
|
|
|
|
void on_sampleRate_textEdited(const QString& arg1);
|
|
|
|
void on_rfBandwidth_textEdited(const QString& arg1);
|
|
|
|
void on_fmDeviation_textEdited(const QString& arg1);
|
|
|
|
void on_audioActive_toggled(bool active);
|
|
|
|
void on_audioStereo_toggled(bool stereo);
|
|
|
|
void on_applyBtn_clicked();
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
|
|
|
void on_gain_valueChanged(int value);
|
|
|
|
void on_volume_valueChanged(int value);
|
|
|
|
void on_squelch_valueChanged(int value);
|
|
|
|
void on_squelchGate_valueChanged(int value);
|
|
|
|
void on_agc_toggled(bool agc);
|
|
|
|
void tick();
|
2015-11-18 21:27:37 -05:00
|
|
|
};
|
|
|
|
|
2015-11-19 02:55:58 -05:00
|
|
|
#endif // INCLUDE_UDPSRCGUI_H
|