2017-10-24 12:29:18 -04: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 //
|
|
|
|
// //
|
|
|
|
// 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 SDRGUI_DEVICE_DEVICEUISET_H_
|
|
|
|
#define SDRGUI_DEVICE_DEVICEUISET_H_
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QByteArray>
|
|
|
|
|
2018-03-03 14:23:38 -05:00
|
|
|
#include "util/export.h"
|
|
|
|
|
2017-10-24 12:29:18 -04:00
|
|
|
class SpectrumVis;
|
|
|
|
class GLSpectrum;
|
|
|
|
class GLSpectrumGUI;
|
|
|
|
class ChannelWindow;
|
|
|
|
class SamplingDeviceControl;
|
|
|
|
class DSPDeviceSourceEngine;
|
|
|
|
class DeviceSourceAPI;
|
|
|
|
class DSPDeviceSinkEngine;
|
|
|
|
class DeviceSinkAPI;
|
2017-10-29 19:02:28 -04:00
|
|
|
class ChannelMarker;
|
2017-10-31 19:18:10 -04:00
|
|
|
class PluginAPI;
|
2017-10-24 12:29:18 -04:00
|
|
|
|
2018-03-03 14:23:38 -05:00
|
|
|
class SDRGUI_API DeviceUISet
|
2017-10-24 12:29:18 -04:00
|
|
|
{
|
2018-02-27 13:26:52 -05:00
|
|
|
public:
|
2017-10-24 12:29:18 -04:00
|
|
|
SpectrumVis *m_spectrumVis;
|
|
|
|
GLSpectrum *m_spectrum;
|
|
|
|
GLSpectrumGUI *m_spectrumGUI;
|
|
|
|
ChannelWindow *m_channelWindow;
|
|
|
|
SamplingDeviceControl *m_samplingDeviceControl;
|
|
|
|
DSPDeviceSourceEngine *m_deviceSourceEngine;
|
|
|
|
DeviceSourceAPI *m_deviceSourceAPI;
|
|
|
|
DSPDeviceSinkEngine *m_deviceSinkEngine;
|
|
|
|
DeviceSinkAPI *m_deviceSinkAPI;
|
|
|
|
QByteArray m_mainWindowState;
|
|
|
|
|
2017-11-01 22:30:54 -04:00
|
|
|
DeviceUISet(int tabIndex, bool rxElseTx, QTimer& timer);
|
2017-10-24 12:29:18 -04:00
|
|
|
~DeviceUISet();
|
2017-10-29 19:02:28 -04:00
|
|
|
|
|
|
|
GLSpectrum *getSpectrum() { return m_spectrum; } //!< Direct spectrum getter
|
|
|
|
void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
|
|
|
|
void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window
|
2017-10-30 17:45:53 -04:00
|
|
|
|
2017-12-23 17:41:37 -05:00
|
|
|
int getNumberOfRxChannels() const { return m_rxChannelInstanceRegistrations.size(); }
|
|
|
|
int getNumberOfTxChannels() const { return m_txChannelInstanceRegistrations.size(); }
|
2017-10-31 17:37:57 -04:00
|
|
|
void registerRxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
|
|
|
|
void registerTxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
|
|
|
|
void removeRxChannelInstance(PluginInstanceGUI* pluginGUI);
|
|
|
|
void removeTxChannelInstance(PluginInstanceGUI* pluginGUI);
|
|
|
|
void freeRxChannels();
|
|
|
|
void freeTxChannels();
|
2017-12-23 17:41:37 -05:00
|
|
|
void deleteRxChannel(int channelIndex);
|
|
|
|
void deleteTxChannel(int channelIndex);
|
2017-10-31 17:37:57 -04:00
|
|
|
void loadRxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
|
|
|
|
void saveRxChannelSettings(Preset* preset);
|
|
|
|
void loadTxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
|
|
|
|
void saveTxChannelSettings(Preset* preset);
|
2017-10-30 17:45:53 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct ChannelInstanceRegistration
|
|
|
|
{
|
|
|
|
QString m_channelName;
|
|
|
|
PluginInstanceGUI* m_gui;
|
|
|
|
|
|
|
|
ChannelInstanceRegistration() :
|
|
|
|
m_channelName(),
|
|
|
|
m_gui(NULL)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
ChannelInstanceRegistration(const QString& channelName, PluginInstanceGUI* pluginGUI) :
|
|
|
|
m_channelName(channelName),
|
|
|
|
m_gui(pluginGUI)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
bool operator<(const ChannelInstanceRegistration& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations;
|
|
|
|
|
2017-10-31 17:37:57 -04:00
|
|
|
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations;
|
|
|
|
ChannelInstanceRegistrations m_txChannelInstanceRegistrations;
|
2017-11-01 15:06:33 -04:00
|
|
|
int m_deviceTabIndex;
|
2017-10-30 17:45:53 -04:00
|
|
|
|
2017-10-31 17:37:57 -04:00
|
|
|
void renameRxChannelInstances();
|
|
|
|
void renameTxChannelInstances();
|
2017-10-24 12:29:18 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SDRGUI_DEVICE_DEVICEUISET_H_ */
|