2016-11-12 20:59:31 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2016 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 //
|
2019-04-11 00:57:41 -04:00
|
|
|
// (at your option) any later version. //
|
2016-11-12 20:59:31 -05:00
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_
|
|
|
|
#define PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_
|
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
#include <plugin/plugininstancegui.h>
|
2016-11-12 20:59:31 -05:00
|
|
|
#include <QTimer>
|
2017-09-03 11:26:32 -04:00
|
|
|
#include <QWidget>
|
2016-11-15 12:58:17 -05:00
|
|
|
#include <vector>
|
2017-09-16 16:23:31 -04:00
|
|
|
|
|
|
|
#include "util/messagequeue.h"
|
|
|
|
|
2016-11-12 20:59:31 -05:00
|
|
|
#include "sdrplayinput.h"
|
|
|
|
#include "sdrplaysettings.h"
|
|
|
|
|
2017-10-29 19:02:28 -04:00
|
|
|
class DeviceUISet;
|
2016-11-12 20:59:31 -05:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class SDRPlayGui;
|
|
|
|
}
|
|
|
|
|
2017-09-25 18:22:08 -04:00
|
|
|
class SDRPlayGui : public QWidget, public PluginInstanceGUI {
|
2016-11-12 20:59:31 -05:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-10-29 19:45:23 -04:00
|
|
|
explicit SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
2016-11-12 20:59:31 -05:00
|
|
|
virtual ~SDRPlayGui();
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2016-11-12 20:59:31 -05:00
|
|
|
|
|
|
|
void setName(const QString& name);
|
|
|
|
QString getName() const;
|
|
|
|
|
|
|
|
virtual void resetToDefaults();
|
|
|
|
virtual qint64 getCenterFrequency() const;
|
|
|
|
virtual void setCenterFrequency(qint64 centerFrequency);
|
|
|
|
virtual QByteArray serialize() const;
|
|
|
|
virtual bool deserialize(const QByteArray& data);
|
2017-09-16 16:23:31 -04:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2016-11-12 20:59:31 -05:00
|
|
|
virtual bool handleMessage(const Message& message);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::SDRPlayGui* ui;
|
|
|
|
|
2017-10-29 19:02:28 -04:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2017-12-13 18:19:59 -05:00
|
|
|
bool m_doApplySettings;
|
2017-10-14 01:02:21 -04:00
|
|
|
bool m_forceSettings;
|
2016-11-12 20:59:31 -05:00
|
|
|
SDRPlaySettings m_settings;
|
|
|
|
QTimer m_updateTimer;
|
|
|
|
QTimer m_statusTimer;
|
|
|
|
DeviceSampleSource* m_sampleSource;
|
|
|
|
int m_sampleRate;
|
|
|
|
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
|
|
|
int m_lastEngineState;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2016-11-12 20:59:31 -05:00
|
|
|
|
2017-12-13 18:19:59 -05:00
|
|
|
void blockApplySettings(bool block) { m_doApplySettings = !block; }
|
2016-11-12 20:59:31 -05:00
|
|
|
void displaySettings();
|
|
|
|
void sendSettings();
|
2016-11-13 18:38:43 -05:00
|
|
|
void updateSampleRateAndFrequency();
|
2016-11-12 20:59:31 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateHardware();
|
2016-11-13 18:38:43 -05:00
|
|
|
void updateStatus();
|
2017-09-16 18:06:09 -04:00
|
|
|
void handleInputMessages();
|
2016-11-12 20:59:31 -05:00
|
|
|
void on_centerFrequency_changed(quint64 value);
|
|
|
|
void on_ppm_valueChanged(int value);
|
|
|
|
void on_dcOffset_toggled(bool checked);
|
|
|
|
void on_iqImbalance_toggled(bool checked);
|
2016-11-13 18:38:43 -05:00
|
|
|
void on_fBand_currentIndexChanged(int index);
|
2016-11-12 20:59:31 -05:00
|
|
|
void on_bandwidth_currentIndexChanged(int index);
|
|
|
|
void on_samplerate_currentIndexChanged(int index);
|
2016-11-15 20:38:21 -05:00
|
|
|
void on_ifFrequency_currentIndexChanged(int index);
|
2016-11-12 20:59:31 -05:00
|
|
|
void on_decim_currentIndexChanged(int index);
|
|
|
|
void on_fcPos_currentIndexChanged(int index);
|
2016-11-17 12:35:17 -05:00
|
|
|
void on_gainTunerOn_toggled(bool checked);
|
|
|
|
void on_gainTuner_valueChanged(int value);
|
|
|
|
void on_gainManualOn_toggled(bool checked);
|
|
|
|
void on_gainLNA_toggled(bool checked);
|
|
|
|
void on_gainMixer_toggled(bool checked);
|
|
|
|
void on_gainBaseband_valueChanged(int value);
|
2016-11-13 20:24:44 -05:00
|
|
|
void on_startStop_toggled(bool checked);
|
|
|
|
void on_record_toggled(bool checked);
|
2018-12-26 11:35:55 -05:00
|
|
|
void openDeviceSettingsDialog(const QPoint& p);
|
2020-04-01 17:17:26 -04:00
|
|
|
void openFileRecordDialog(const QPoint& p);
|
2016-11-12 20:59:31 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* PLUGINS_SAMPLESOURCE_SDRPLAY_SDRPLAYGUI_H_ */
|