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-03 13:55:00 -04:00
|
|
|
#include <plugin/plugininstanceui.h>
|
2015-11-18 21:27:37 -05:00
|
|
|
#include <QHostAddress>
|
|
|
|
#include "gui/rollupwidget.h"
|
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
#include "dsp/movingaverage.h"
|
|
|
|
|
2017-08-13 19:39:26 -04:00
|
|
|
#include "udpsrc.h"
|
2015-11-18 21:27:37 -05:00
|
|
|
|
|
|
|
class PluginAPI;
|
2016-10-10 19:17:55 -04:00
|
|
|
class DeviceSourceAPI;
|
2016-10-03 09:55:16 -04:00
|
|
|
class ThreadedBasebandSampleSink;
|
2016-10-02 15:52:39 -04:00
|
|
|
class DownChannelizer;
|
2015-11-18 21:27:37 -05:00
|
|
|
class UDPSrc;
|
|
|
|
class SpectrumVis;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class UDPSrcGUI;
|
|
|
|
}
|
|
|
|
|
2017-09-03 13:55:00 -04:00
|
|
|
class UDPSrcGUI : public RollupWidget, public PluginInstanceUI {
|
2015-11-18 21:27:37 -05:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-10-10 19:17:55 -04:00
|
|
|
static UDPSrcGUI* create(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI);
|
2015-11-18 21:27:37 -05:00
|
|
|
void destroy();
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
2016-05-16 13:37:53 -04:00
|
|
|
static const QString m_channelID;
|
|
|
|
|
2015-11-18 21:27:37 -05:00
|
|
|
private slots:
|
|
|
|
void channelMarkerChanged();
|
2017-05-17 18:05:08 -04:00
|
|
|
void on_deltaFrequency_changed(qint64 value);
|
2015-11-18 21:27:37 -05:00
|
|
|
void on_sampleFormat_currentIndexChanged(int index);
|
|
|
|
void on_sampleRate_textEdited(const QString& arg1);
|
|
|
|
void on_rfBandwidth_textEdited(const QString& arg1);
|
2015-12-01 20:28:31 -05:00
|
|
|
void on_udpAddress_textEdited(const QString& arg1);
|
2015-11-18 21:27:37 -05:00
|
|
|
void on_udpPort_textEdited(const QString& arg1);
|
2015-12-04 22:03:30 -05:00
|
|
|
void on_audioPort_textEdited(const QString& arg1);
|
2016-04-03 21:44:06 -04:00
|
|
|
void on_fmDeviation_textEdited(const QString& arg1);
|
2015-12-05 05:49:24 -05:00
|
|
|
void on_audioActive_toggled(bool active);
|
2015-12-05 06:23:55 -05:00
|
|
|
void on_audioStereo_toggled(bool stereo);
|
2015-11-18 21:27:37 -05:00
|
|
|
void on_applyBtn_clicked();
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
2017-08-25 06:12:46 -04:00
|
|
|
void onMenuDialogCalled(const QPoint& p);
|
2017-08-17 06:57:45 -04:00
|
|
|
void on_gain_valueChanged(int value);
|
2015-12-03 21:46:51 -05:00
|
|
|
void on_volume_valueChanged(int value);
|
2017-08-17 14:23:17 -04:00
|
|
|
void on_squelch_valueChanged(int value);
|
2017-08-18 18:12:56 -04:00
|
|
|
void on_squelchGate_valueChanged(int value);
|
2017-08-19 18:32:40 -04:00
|
|
|
void on_agc_toggled(bool agc);
|
2015-11-18 21:27:37 -05:00
|
|
|
void tick();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::UDPSrcGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
2016-10-10 19:17:55 -04:00
|
|
|
DeviceSourceAPI* m_deviceAPI;
|
2015-11-19 02:55:58 -05:00
|
|
|
UDPSrc* m_udpSrc;
|
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
|
|
|
|
UDPSrc::SampleFormat m_sampleFormat;
|
|
|
|
Real m_outputSampleRate;
|
|
|
|
Real m_rfBandwidth;
|
2016-04-03 21:44:06 -04:00
|
|
|
int m_fmDeviation;
|
2017-08-17 06:57:45 -04:00
|
|
|
Real m_gain;
|
2015-12-03 21:46:51 -05:00
|
|
|
bool m_audioActive;
|
2015-12-05 06:23:55 -05:00
|
|
|
bool m_audioStereo;
|
2015-12-03 21:46:51 -05:00
|
|
|
int m_volume;
|
2015-11-18 21:27:37 -05:00
|
|
|
bool m_doApplySettings;
|
|
|
|
|
|
|
|
// RF path
|
2016-10-03 09:55:16 -04:00
|
|
|
ThreadedBasebandSampleSink* m_threadedChannelizer;
|
2016-10-02 15:52:39 -04:00
|
|
|
DownChannelizer* m_channelizer;
|
2015-11-18 21:27:37 -05:00
|
|
|
SpectrumVis* m_spectrumVis;
|
|
|
|
|
2016-10-10 19:17:55 -04:00
|
|
|
explicit UDPSrcGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, 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();
|
2016-04-03 12:14:04 -04:00
|
|
|
|
|
|
|
void leaveEvent(QEvent*);
|
|
|
|
void enterEvent(QEvent*);
|
2015-11-18 21:27:37 -05:00
|
|
|
};
|
|
|
|
|
2015-11-19 02:55:58 -05:00
|
|
|
#endif // INCLUDE_UDPSRCGUI_H
|