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 //
|
2019-04-11 08:43:33 -04:00
|
|
|
// (at your option) any later version. //
|
2017-10-24 12:29:18 -04: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 SDRGUI_DEVICE_DEVICEUISET_H_
|
|
|
|
#define SDRGUI_DEVICE_DEVICEUISET_H_
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QByteArray>
|
|
|
|
|
2018-03-20 08:49:21 -04:00
|
|
|
#include "export.h"
|
2018-03-03 14:23:38 -05:00
|
|
|
|
2017-10-24 12:29:18 -04:00
|
|
|
class SpectrumVis;
|
|
|
|
class GLSpectrum;
|
|
|
|
class GLSpectrumGUI;
|
|
|
|
class ChannelWindow;
|
|
|
|
class SamplingDeviceControl;
|
2019-05-08 16:11:53 -04:00
|
|
|
class DeviceAPI;
|
2019-05-16 12:39:13 -04:00
|
|
|
class DSPDeviceSourceEngine;
|
2017-10-24 12:29:18 -04:00
|
|
|
class DSPDeviceSinkEngine;
|
2019-05-16 12:39:13 -04:00
|
|
|
class DSPDeviceMIMOEngine;
|
2017-10-29 19:02:28 -04:00
|
|
|
class ChannelMarker;
|
2017-10-31 19:18:10 -04:00
|
|
|
class PluginAPI;
|
2019-05-09 06:10:27 -04:00
|
|
|
class PluginInstanceGUI;
|
|
|
|
class Preset;
|
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;
|
2019-05-08 16:11:53 -04:00
|
|
|
DeviceAPI *m_deviceAPI;
|
2019-05-16 12:39:13 -04:00
|
|
|
DSPDeviceSourceEngine *m_deviceSourceEngine;
|
2017-10-24 12:29:18 -04:00
|
|
|
DSPDeviceSinkEngine *m_deviceSinkEngine;
|
2019-05-16 12:39:13 -04:00
|
|
|
DSPDeviceMIMOEngine *m_deviceMIMOEngine;
|
2017-10-24 12:29:18 -04:00
|
|
|
QByteArray m_mainWindowState;
|
|
|
|
|
2019-05-16 12:39:13 -04:00
|
|
|
DeviceUISet(int tabIndex, int deviceType, 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
|
|
|
|
2019-09-07 18:44:56 -04:00
|
|
|
int getNumberOfChannels() const { return m_channelInstanceRegistrations.size(); }
|
2017-10-31 17:37:57 -04:00
|
|
|
void registerRxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
|
|
|
|
void registerTxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
|
2019-09-07 18:44:56 -04:00
|
|
|
void registerChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
|
2017-10-31 17:37:57 -04:00
|
|
|
void removeRxChannelInstance(PluginInstanceGUI* pluginGUI);
|
|
|
|
void removeTxChannelInstance(PluginInstanceGUI* pluginGUI);
|
2019-09-07 18:44:56 -04:00
|
|
|
void removeChannelInstance(PluginInstanceGUI* pluginGUI);
|
|
|
|
void freeChannels();
|
|
|
|
void deleteChannel(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);
|
2019-09-13 07:40:31 -04:00
|
|
|
void loadMIMOChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
|
|
|
|
void saveMIMOChannelSettings(Preset* preset);
|
2017-10-30 17:45:53 -04:00
|
|
|
|
2019-05-18 09:40:00 -04:00
|
|
|
// These are the number of channel types available for selection
|
|
|
|
void setNumberOfAvailableRxChannels(int number) { m_nbAvailableRxChannels = number; }
|
|
|
|
void setNumberOfAvailableTxChannels(int number) { m_nbAvailableTxChannels = number; }
|
|
|
|
void setNumberOfAvailableMIMOChannels(int number) { m_nbAvailableMIMOChannels = number; }
|
|
|
|
int getNumberOfAvailableRxChannels() const { return m_nbAvailableRxChannels; }
|
|
|
|
int getNumberOfAvailableTxChannels() const { return m_nbAvailableTxChannels; }
|
|
|
|
int getNumberOfAvailableMIMOChannels() const { return m_nbAvailableMIMOChannels; }
|
|
|
|
|
2017-10-30 17:45:53 -04:00
|
|
|
private:
|
|
|
|
struct ChannelInstanceRegistration
|
|
|
|
{
|
|
|
|
QString m_channelName;
|
|
|
|
PluginInstanceGUI* m_gui;
|
2019-09-07 18:44:56 -04:00
|
|
|
int m_channelType;
|
2017-10-30 17:45:53 -04:00
|
|
|
|
|
|
|
ChannelInstanceRegistration() :
|
|
|
|
m_channelName(),
|
2019-09-07 18:44:56 -04:00
|
|
|
m_gui(nullptr),
|
|
|
|
m_channelType(0)
|
2017-10-30 17:45:53 -04:00
|
|
|
{ }
|
|
|
|
|
2019-09-07 18:44:56 -04:00
|
|
|
ChannelInstanceRegistration(const QString& channelName, PluginInstanceGUI* pluginGUI, int channelType) :
|
2017-10-30 17:45:53 -04:00
|
|
|
m_channelName(channelName),
|
2019-09-07 18:44:56 -04:00
|
|
|
m_gui(pluginGUI),
|
|
|
|
m_channelType(channelType)
|
2017-10-30 17:45:53 -04:00
|
|
|
{ }
|
|
|
|
|
|
|
|
bool operator<(const ChannelInstanceRegistration& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations;
|
|
|
|
|
2019-09-07 18:44:56 -04:00
|
|
|
// ChannelInstanceRegistrations m_rxChannelInstanceRegistrations;
|
|
|
|
// ChannelInstanceRegistrations m_txChannelInstanceRegistrations;
|
|
|
|
ChannelInstanceRegistrations m_channelInstanceRegistrations;
|
2017-11-01 15:06:33 -04:00
|
|
|
int m_deviceTabIndex;
|
2019-05-18 09:40:00 -04:00
|
|
|
int m_nbAvailableRxChannels; //!< Number of Rx channels available for selection
|
|
|
|
int m_nbAvailableTxChannels; //!< Number of Tx channels available for selection
|
|
|
|
int m_nbAvailableMIMOChannels; //!< Number of MIMO channels available for selection
|
2017-10-30 17:45:53 -04:00
|
|
|
|
2019-09-07 18:44:56 -04:00
|
|
|
void renameChannelInstances();
|
2017-10-24 12:29:18 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SDRGUI_DEVICE_DEVICEUISET_H_ */
|