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.
deviceset.h
Go to the documentation of this file.
1 // Copyright (C) 2017 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 SDRSRV_DEVICE_DEVICESET_H_
19 #define SDRSRV_DEVICE_DEVICESET_H_
20 
21 #include <QTimer>
22 
23 class DeviceAPI;
27 class PluginAPI;
28 class ChannelAPI;
29 class Preset;
30 
31 class DeviceSet
32 {
33 public:
38 
39  DeviceSet(int tabIndex);
40  ~DeviceSet();
41 
44  void addRxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
45  void addTxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
46  void deleteRxChannel(int channelIndex);
47  void deleteTxChannel(int channelIndex);
48  void registerRxChannelInstance(const QString& channelName, ChannelAPI* channelAPI);
49  void registerTxChannelInstance(const QString& channelName, ChannelAPI* channelAPI);
50  void removeRxChannelInstance(ChannelAPI* channelAPI);
51  void removeTxChannelInstance(ChannelAPI* channelAPI);
52  void freeRxChannels();
53  void freeTxChannels();
54  void loadRxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
55  void saveRxChannelSettings(Preset* preset);
56  void loadTxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
57  void saveTxChannelSettings(Preset* preset);
58 
59 private:
61  {
62  QString m_channelName;
65 
67  m_channelName(),
68  m_channelSinkAPI(nullptr),
69  m_channelSourceAPI(nullptr)
70  { }
71 
72  ChannelInstanceRegistration(const QString& channelName, ChannelAPI* channelAPI);
73 
74  bool operator<(const ChannelInstanceRegistration& other) const;
75  };
76 
77  typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations;
78 
79  ChannelInstanceRegistrations m_rxChannelInstanceRegistrations;
80  ChannelInstanceRegistrations m_txChannelInstanceRegistrations;
82 
86  bool compareRxChannelURIs(const QString& registerdChannelURI, const QString& xChannelURI);
87 };
88 
89 #endif /* SDRSRV_DEVICE_DEVICESET_H_ */
DeviceSet(int tabIndex)
Definition: deviceset.cpp:51
void renameRxChannelInstances()
Definition: deviceset.cpp:348
void loadTxChannelSettings(const Preset *preset, PluginAPI *pluginAPI)
Definition: deviceset.cpp:256
void removeTxChannelInstance(ChannelAPI *channelAPI)
Definition: deviceset.cpp:90
int m_deviceTabIndex
Definition: deviceset.h:81
bool operator<(const ChannelInstanceRegistration &other) const
Definition: deviceset.cpp:365
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceset.h:35
int getNumberOfTxChannels() const
Definition: deviceset.h:43
void removeRxChannelInstance(ChannelAPI *channelAPI)
Definition: deviceset.cpp:76
void freeTxChannels()
Definition: deviceset.cpp:113
void renameTxChannelInstances()
Definition: deviceset.cpp:356
void loadRxChannelSettings(const Preset *preset, PluginAPI *pluginAPI)
Definition: deviceset.cpp:160
void addRxChannel(int selectedChannelIndex, PluginAPI *pluginAPI)
Definition: deviceset.cpp:142
void saveRxChannelSettings(Preset *preset)
Definition: deviceset.cpp:238
bool compareRxChannelURIs(const QString &registerdChannelURI, const QString &xChannelURI)
Definition: deviceset.cpp:395
Definition: preset.h:28
void registerRxChannelInstance(const QString &channelName, ChannelAPI *channelAPI)
Definition: deviceset.cpp:64
QList< ChannelInstanceRegistration > ChannelInstanceRegistrations
Definition: deviceset.h:77
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
void deleteRxChannel(int channelIndex)
Definition: deviceset.cpp:122
void saveTxChannelSettings(Preset *preset)
Definition: deviceset.cpp:330
DSPDeviceMIMOEngine * m_deviceMIMOEngine
Definition: deviceset.h:37
void registerTxChannelInstance(const QString &channelName, ChannelAPI *channelAPI)
Definition: deviceset.cpp:70
int getNumberOfRxChannels() const
Definition: deviceset.h:42
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
void freeRxChannels()
Definition: deviceset.cpp:104
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceset.h:36
void deleteTxChannel(int channelIndex)
Definition: deviceset.cpp:132
void addTxChannel(int selectedChannelIndex, PluginAPI *pluginAPI)
Definition: deviceset.cpp:151