SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
deviceuiset.h
Go to the documentation of this file.
1 // Copyright (C) 2016 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef SDRGUI_DEVICE_DEVICEUISET_H_
19 #define SDRGUI_DEVICE_DEVICEUISET_H_
20 
21 #include <QTimer>
22 #include <QByteArray>
23 
24 #include "export.h"
25 
26 class SpectrumVis;
27 class GLSpectrum;
28 class GLSpectrumGUI;
29 class ChannelWindow;
31 class DeviceAPI;
35 class ChannelMarker;
36 class PluginAPI;
37 class PluginInstanceGUI;
38 class Preset;
39 
41 {
42 public:
52  QByteArray m_mainWindowState;
53 
54  DeviceUISet(int tabIndex, int deviceType, QTimer& timer);
55  ~DeviceUISet();
56 
57  GLSpectrum *getSpectrum() { return m_spectrum; }
58  void addChannelMarker(ChannelMarker* channelMarker);
59  void addRollupWidget(QWidget *widget);
60 
61  int getNumberOfRxChannels() const { return m_rxChannelInstanceRegistrations.size(); }
62  int getNumberOfTxChannels() const { return m_txChannelInstanceRegistrations.size(); }
63  void registerRxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
64  void registerTxChannelInstance(const QString& channelName, PluginInstanceGUI* pluginGUI);
65  void removeRxChannelInstance(PluginInstanceGUI* pluginGUI);
66  void removeTxChannelInstance(PluginInstanceGUI* pluginGUI);
67  void freeRxChannels();
68  void freeTxChannels();
69  void deleteRxChannel(int channelIndex);
70  void deleteTxChannel(int channelIndex);
71  void loadRxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
72  void saveRxChannelSettings(Preset* preset);
73  void loadTxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
74  void saveTxChannelSettings(Preset* preset);
75 
76  // These are the number of channel types available for selection
77  void setNumberOfAvailableRxChannels(int number) { m_nbAvailableRxChannels = number; }
78  void setNumberOfAvailableTxChannels(int number) { m_nbAvailableTxChannels = number; }
79  void setNumberOfAvailableMIMOChannels(int number) { m_nbAvailableMIMOChannels = number; }
80  int getNumberOfAvailableRxChannels() const { return m_nbAvailableRxChannels; }
81  int getNumberOfAvailableTxChannels() const { return m_nbAvailableTxChannels; }
82  int getNumberOfAvailableMIMOChannels() const { return m_nbAvailableMIMOChannels; }
83 
84 private:
86  {
87  QString m_channelName;
89 
91  m_channelName(),
92  m_gui(nullptr)
93  { }
94 
95  ChannelInstanceRegistration(const QString& channelName, PluginInstanceGUI* pluginGUI) :
96  m_channelName(channelName),
97  m_gui(pluginGUI)
98  { }
99 
100  bool operator<(const ChannelInstanceRegistration& other) const;
101  };
102 
103  typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations;
104 
105  ChannelInstanceRegistrations m_rxChannelInstanceRegistrations;
106  ChannelInstanceRegistrations m_txChannelInstanceRegistrations;
111 
112  void renameRxChannelInstances();
113  void renameTxChannelInstances();
115  bool compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI);
116 };
117 
118 
119 
120 
121 #endif /* SDRGUI_DEVICE_DEVICEUISET_H_ */
int m_nbAvailableRxChannels
Number of Rx channels available for selection.
Definition: deviceuiset.h:108
GLSpectrumGUI * m_spectrumGUI
Definition: deviceuiset.h:45
void setNumberOfAvailableMIMOChannels(int number)
Definition: deviceuiset.h:79
GLSpectrum * m_spectrum
Definition: deviceuiset.h:44
void setNumberOfAvailableRxChannels(int number)
Definition: deviceuiset.h:77
QList< ChannelInstanceRegistration > ChannelInstanceRegistrations
Definition: deviceuiset.h:103
int getNumberOfTxChannels() const
Definition: deviceuiset.h:62
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceuiset.h:106
int m_deviceTabIndex
Definition: deviceuiset.h:107
int getNumberOfAvailableRxChannels() const
Definition: deviceuiset.h:80
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
ChannelInstanceRegistration(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.h:95
GLSpectrum * getSpectrum()
Direct spectrum getter.
Definition: deviceuiset.h:57
#define SDRGUI_API
Definition: export.h:52
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
int getNumberOfRxChannels() const
Definition: deviceuiset.h:61
SamplingDeviceControl * m_samplingDeviceControl
Definition: deviceuiset.h:47
Definition: preset.h:28
ChannelWindow * m_channelWindow
Definition: deviceuiset.h:46
int getNumberOfAvailableMIMOChannels() const
Definition: deviceuiset.h:82
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceuiset.h:105
int m_nbAvailableTxChannels
Number of Tx channels available for selection.
Definition: deviceuiset.h:109
int m_nbAvailableMIMOChannels
Number of MIMO channels available for selection.
Definition: deviceuiset.h:110
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
QByteArray m_mainWindowState
Definition: deviceuiset.h:52
bool operator<(double a, Fixed< IntType, IntBits > const &b)
Definition: fixed.h:1785
SpectrumVis * m_spectrumVis
Definition: deviceuiset.h:43
void setNumberOfAvailableTxChannels(int number)
Definition: deviceuiset.h:78
int getNumberOfAvailableTxChannels() const
Definition: deviceuiset.h:81
DSPDeviceMIMOEngine * m_deviceMIMOEngine
Definition: deviceuiset.h:51