2015-12-06 18:47:55 +00: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 07:55:58 +00:00
|
|
|
#ifndef INCLUDE_UDPSRCGUI_H
|
|
|
|
#define INCLUDE_UDPSRCGUI_H
|
2015-11-19 02:27:37 +00:00
|
|
|
|
2017-09-25 22:22:08 +00:00
|
|
|
#include <plugin/plugininstancegui.h>
|
2015-11-19 02:27:37 +00:00
|
|
|
#include <QHostAddress>
|
|
|
|
#include "gui/rollupwidget.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
2017-09-16 20:23:31 +00:00
|
|
|
#include "util/messagequeue.h"
|
2015-11-19 02:27:37 +00:00
|
|
|
|
2017-08-13 23:39:26 +00:00
|
|
|
#include "udpsrc.h"
|
2017-10-05 06:17:49 +00:00
|
|
|
#include "udpsrcsettings.h"
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
class PluginAPI;
|
2017-10-31 07:24:05 +00:00
|
|
|
class DeviceUISet;
|
2015-11-19 02:27:37 +00:00
|
|
|
class UDPSrc;
|
|
|
|
class SpectrumVis;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class UDPSrcGUI;
|
|
|
|
}
|
|
|
|
|
2017-09-25 22:22:08 +00:00
|
|
|
class UDPSrcGUI : public RollupWidget, public PluginInstanceGUI {
|
2015-11-19 02:27:37 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-09 00:03:05 +00:00
|
|
|
static UDPSrcGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
2017-09-16 08:45:08 +00:00
|
|
|
virtual void destroy();
|
2015-11-19 02:27:37 +00: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 20:23:31 +00:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2015-11-19 02:27:37 +00:00
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
2017-11-14 07:35:18 +00:00
|
|
|
public slots:
|
|
|
|
void channelMarkerChangedByCursor();
|
2017-11-14 21:58:35 +00:00
|
|
|
void channelMarkerHighlightedByCursor();
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::UDPSrcGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2017-10-31 07:24:05 +00:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2015-11-19 07:55:58 +00:00
|
|
|
UDPSrc* m_udpSrc;
|
2017-10-05 06:17:49 +00:00
|
|
|
UDPSrcSettings m_settings;
|
2015-11-19 02:27:37 +00:00
|
|
|
ChannelMarker m_channelMarker;
|
2017-08-17 10:57:45 +00:00
|
|
|
MovingAverage<double> m_channelPowerAvg;
|
2017-08-17 18:23:17 +00:00
|
|
|
MovingAverage<double> m_inPowerAvg;
|
2017-08-17 10:57:45 +00:00
|
|
|
uint32_t m_tickCount;
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
// settings
|
|
|
|
bool m_doApplySettings;
|
2017-10-07 03:44:43 +00:00
|
|
|
bool m_rfBandwidthChanged;
|
2017-09-16 20:23:31 +00:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-11-19 02:27:37 +00:00
|
|
|
|
|
|
|
// RF path
|
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
2017-11-09 00:03:05 +00:00
|
|
|
explicit UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
2015-11-19 02:27:37 +00:00
|
|
|
virtual ~UDPSrcGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
2017-08-18 22:12:56 +00:00
|
|
|
void applySettings(bool force = false);
|
|
|
|
void applySettingsImmediate(bool force = false);
|
2017-08-17 10:57:45 +00:00
|
|
|
void displaySettings();
|
2017-10-07 03:44:43 +00:00
|
|
|
void setSampleFormat(int index);
|
|
|
|
void setSampleFormatIndex(const UDPSrcSettings::SampleFormat& sampleFormat);
|
2016-04-03 16:14:04 +00:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2017-11-14 07:35:18 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
|
|
|
void on_sampleFormat_currentIndexChanged(int index);
|
2018-04-19 21:03:21 +00:00
|
|
|
void on_outputUDPAddress_editingFinished();
|
|
|
|
void on_outputUDPPort_editingFinished();
|
|
|
|
void on_inputUDPAudioPort_editingFinished();
|
2017-11-14 07:35:18 +00:00
|
|
|
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-19 02:27:37 +00:00
|
|
|
};
|
|
|
|
|
2015-11-19 07:55:58 +00:00
|
|
|
#endif // INCLUDE_UDPSRCGUI_H
|