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.
Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
DeviceSet Class Reference

#include <deviceset.h>

+ Collaboration diagram for DeviceSet:

Classes

struct  ChannelInstanceRegistration
 

Public Member Functions

 DeviceSet (int tabIndex)
 
 ~DeviceSet ()
 
int getNumberOfRxChannels () const
 
int getNumberOfTxChannels () const
 
void addRxChannel (int selectedChannelIndex, PluginAPI *pluginAPI)
 
void addTxChannel (int selectedChannelIndex, PluginAPI *pluginAPI)
 
void deleteRxChannel (int channelIndex)
 
void deleteTxChannel (int channelIndex)
 
void registerRxChannelInstance (const QString &channelName, ChannelAPI *channelAPI)
 
void registerTxChannelInstance (const QString &channelName, ChannelAPI *channelAPI)
 
void removeRxChannelInstance (ChannelAPI *channelAPI)
 
void removeTxChannelInstance (ChannelAPI *channelAPI)
 
void freeRxChannels ()
 
void freeTxChannels ()
 
void loadRxChannelSettings (const Preset *preset, PluginAPI *pluginAPI)
 
void saveRxChannelSettings (Preset *preset)
 
void loadTxChannelSettings (const Preset *preset, PluginAPI *pluginAPI)
 
void saveTxChannelSettings (Preset *preset)
 

Public Attributes

DeviceAPIm_deviceAPI
 
DSPDeviceSourceEnginem_deviceSourceEngine
 
DSPDeviceSinkEnginem_deviceSinkEngine
 
DSPDeviceMIMOEnginem_deviceMIMOEngine
 

Private Types

typedef QList< ChannelInstanceRegistrationChannelInstanceRegistrations
 

Private Member Functions

void renameRxChannelInstances ()
 
void renameTxChannelInstances ()
 
bool compareRxChannelURIs (const QString &registerdChannelURI, const QString &xChannelURI)
 

Private Attributes

ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
 
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
 
int m_deviceTabIndex
 

Detailed Description

Definition at line 31 of file deviceset.h.

Member Typedef Documentation

◆ ChannelInstanceRegistrations

Definition at line 77 of file deviceset.h.

Constructor & Destructor Documentation

◆ DeviceSet()

DeviceSet::DeviceSet ( int  tabIndex)

Definition at line 51 of file deviceset.cpp.

References m_deviceAPI, m_deviceMIMOEngine, m_deviceSinkEngine, m_deviceSourceEngine, and m_deviceTabIndex.

52 {
53  m_deviceAPI = nullptr;
54  m_deviceSourceEngine = nullptr;
55  m_deviceSinkEngine = nullptr;
56  m_deviceMIMOEngine = nullptr;
57  m_deviceTabIndex = tabIndex;
58 }
int m_deviceTabIndex
Definition: deviceset.h:81
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceset.h:35
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
DSPDeviceMIMOEngine * m_deviceMIMOEngine
Definition: deviceset.h:37
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceset.h:36

◆ ~DeviceSet()

DeviceSet::~DeviceSet ( )

Definition at line 60 of file deviceset.cpp.

61 {
62 }

Member Function Documentation

◆ addRxChannel()

void DeviceSet::addRxChannel ( int  selectedChannelIndex,
PluginAPI pluginAPI 
)

Definition at line 142 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), ChannelAPI::getName(), PluginAPI::getRxChannelRegistrations(), m_deviceAPI, and m_rxChannelInstanceRegistrations.

Referenced by MainCore::addChannel(), and getNumberOfTxChannels().

143 {
144  PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getRxChannelRegistrations(); // Available channel plugins
145  ChannelAPI *rxChannel =(*channelRegistrations)[selectedChannelIndex].m_plugin->createRxChannelCS(m_deviceAPI);
146  ChannelInstanceRegistration reg = ChannelInstanceRegistration(rxChannel->getName(), rxChannel);
148  qDebug("DeviceSet::addRxChannel: %s", qPrintable(rxChannel->getName()));
149 }
virtual const QString & getName() const
Definition: channelapi.h:53
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
ChannelRegistrations * getRxChannelRegistrations()
Definition: pluginapi.cpp:14
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTxChannel()

void DeviceSet::addTxChannel ( int  selectedChannelIndex,
PluginAPI pluginAPI 
)

Definition at line 151 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), ChannelAPI::getName(), PluginAPI::getTxChannelRegistrations(), m_deviceAPI, and m_txChannelInstanceRegistrations.

Referenced by MainCore::addChannel(), and getNumberOfTxChannels().

152 {
153  PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getTxChannelRegistrations(); // Available channel plugins
154  ChannelAPI *txChannel = (*channelRegistrations)[selectedChannelIndex].m_plugin->createTxChannelCS(m_deviceAPI);
155  ChannelInstanceRegistration reg = ChannelInstanceRegistration(txChannel->getName(), txChannel);
157  qDebug("DeviceSet::addTxChannel: %s", qPrintable(txChannel->getName()));
158 }
virtual const QString & getName() const
Definition: channelapi.h:53
ChannelRegistrations * getTxChannelRegistrations()
Definition: pluginapi.cpp:34
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compareRxChannelURIs()

bool DeviceSet::compareRxChannelURIs ( const QString &  registerdChannelURI,
const QString &  xChannelURI 
)
private

Use this function to support possible older identifiers in presets

Definition at line 395 of file deviceset.cpp.

Referenced by loadRxChannelSettings().

396 {
397  if ((xChannelURI == "sdrangel.channel.chanalyzerng") || (xChannelURI == "sdrangel.channel.chanalyzer")) { // renamed ChanalyzerNG to Chanalyzer in 4.0.0
398  return registerdChannelURI == "sdrangel.channel.chanalyzer";
399  } else if ((xChannelURI == "de.maintech.sdrangelove.channel.am") || (xChannelURI == "sdrangel.channel.amdemod")) {
400  return registerdChannelURI == "sdrangel.channel.amdemod";
401  } else if ((xChannelURI == "de.maintech.sdrangelove.channel.nfm") || (xChannelURI == "sdrangel.channel.nfmdemod")) {
402  return registerdChannelURI == "sdrangel.channel.nfmdemod";
403  } else if ((xChannelURI == "de.maintech.sdrangelove.channel.ssb") || (xChannelURI == "sdrangel.channel.ssbdemod")) {
404  return registerdChannelURI == "sdrangel.channel.ssbdemod";
405  } else if ((xChannelURI == "de.maintech.sdrangelove.channel.wfm") || (xChannelURI == "sdrangel.channel.wfmdemod")) {
406  return registerdChannelURI == "sdrangel.channel.wfmdemod";
407  } else {
408  return registerdChannelURI == xChannelURI;
409  }
410 }
+ Here is the caller graph for this function:

◆ deleteRxChannel()

void DeviceSet::deleteRxChannel ( int  channelIndex)

Definition at line 122 of file deviceset.cpp.

References m_rxChannelInstanceRegistrations, and renameRxChannelInstances().

Referenced by MainCore::deleteChannel(), and getNumberOfTxChannels().

123 {
124  if (channelIndex < m_rxChannelInstanceRegistrations.count())
125  {
126  m_rxChannelInstanceRegistrations[channelIndex].m_channelSinkAPI->destroy();
127  m_rxChannelInstanceRegistrations.removeAt(channelIndex);
129  }
130 }
void renameRxChannelInstances()
Definition: deviceset.cpp:348
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteTxChannel()

void DeviceSet::deleteTxChannel ( int  channelIndex)

Definition at line 132 of file deviceset.cpp.

References m_txChannelInstanceRegistrations, and renameTxChannelInstances().

Referenced by MainCore::deleteChannel(), and getNumberOfTxChannels().

133 {
134  if (channelIndex < m_txChannelInstanceRegistrations.count())
135  {
136  m_txChannelInstanceRegistrations[channelIndex].m_channelSourceAPI->destroy();
137  m_txChannelInstanceRegistrations.removeAt(channelIndex);
139  }
140 }
void renameTxChannelInstances()
Definition: deviceset.cpp:356
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ freeRxChannels()

void DeviceSet::freeRxChannels ( )

Definition at line 104 of file deviceset.cpp.

References i, DeviceSet::ChannelInstanceRegistration::m_channelName, and m_rxChannelInstanceRegistrations.

Referenced by getNumberOfTxChannels().

105 {
106  for(int i = 0; i < m_rxChannelInstanceRegistrations.count(); i++)
107  {
108  qDebug("DeviceSet::freeAll: destroying channel [%s]", qPrintable(m_rxChannelInstanceRegistrations[i].m_channelName));
109  m_rxChannelInstanceRegistrations[i].m_channelSinkAPI->destroy();
110  }
111 }
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ freeTxChannels()

void DeviceSet::freeTxChannels ( )

Definition at line 113 of file deviceset.cpp.

References i, DeviceSet::ChannelInstanceRegistration::m_channelName, and m_txChannelInstanceRegistrations.

Referenced by getNumberOfTxChannels().

114 {
115  for(int i = 0; i < m_txChannelInstanceRegistrations.count(); i++)
116  {
117  qDebug("DeviceSet::freeAll: destroying channel [%s]", qPrintable(m_txChannelInstanceRegistrations[i].m_channelName));
118  m_txChannelInstanceRegistrations[i].m_channelSourceAPI->destroy();
119  }
120 }
int32_t i
Definition: decimators.h:244
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the caller graph for this function:

◆ getNumberOfRxChannels()

int DeviceSet::getNumberOfRxChannels ( ) const
inline

Definition at line 42 of file deviceset.h.

References m_rxChannelInstanceRegistrations.

42 { return m_rxChannelInstanceRegistrations.size(); }
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79

◆ getNumberOfTxChannels()

int DeviceSet::getNumberOfTxChannels ( ) const
inline

◆ loadRxChannelSettings()

void DeviceSet::loadRxChannelSettings ( const Preset preset,
PluginAPI pluginAPI 
)

Definition at line 160 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), compareRxChannelURIs(), ChannelAPI::deserialize(), Preset::getChannelConfig(), Preset::getChannelCount(), Preset::getDescription(), Preset::getGroup(), PluginAPI::getRxChannelRegistrations(), i, Preset::isSourcePreset(), Preset::ChannelConfig::m_channelIdURI, DeviceSet::ChannelInstanceRegistration::m_channelName, DeviceSet::ChannelInstanceRegistration::m_channelSinkAPI, Preset::ChannelConfig::m_config, m_deviceAPI, m_rxChannelInstanceRegistrations, and renameRxChannelInstances().

Referenced by getNumberOfTxChannels(), and MainCore::loadPresetSettings().

161 {
162  if (preset->isSourcePreset())
163  {
164  qDebug("DeviceSet::loadChannelSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
165 
166  // Available channel plugins
167  PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getRxChannelRegistrations();
168 
169  // copy currently open channels and clear list
172 
173  qDebug("DeviceSet::loadChannelSettings: %d channel(s) in preset", preset->getChannelCount());
174 
175  for (int i = 0; i < preset->getChannelCount(); i++)
176  {
177  const Preset::ChannelConfig& channelConfig = preset->getChannelConfig(i);
178  ChannelInstanceRegistration reg;
179 
180  // if we have one instance available already, use it
181 
182  for (int i = 0; i < openChannels.count(); i++)
183  {
184  qDebug("DeviceSet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI));
185 
186  //if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
187  if (compareRxChannelURIs(openChannels[i].m_channelName, channelConfig.m_channelIdURI))
188  {
189  qDebug("DeviceSet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
190  reg = openChannels.takeAt(i);
192  break;
193  }
194  }
195 
196  // if we haven't one already, create one
197 
198  if (reg.m_channelSinkAPI == 0)
199  {
200  for (int i = 0; i < channelRegistrations->count(); i++)
201  {
202  //if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
203  if (compareRxChannelURIs((*channelRegistrations)[i].m_channelIdURI, channelConfig.m_channelIdURI))
204  {
205  qDebug("DeviceSet::loadChannelSettings: creating new channel [%s] from config [%s]",
206  qPrintable((*channelRegistrations)[i].m_channelIdURI),
207  qPrintable(channelConfig.m_channelIdURI));
208  ChannelAPI *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannelCS(m_deviceAPI);
209  reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannel);
211  break;
212  }
213  }
214  }
215 
216  if (reg.m_channelSinkAPI != 0)
217  {
218  qDebug("DeviceSet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channelIdURI));
219  reg.m_channelSinkAPI->deserialize(channelConfig.m_config);
220  }
221  }
222 
223  // everything, that is still "available" is not needed anymore
224  for (int i = 0; i < openChannels.count(); i++)
225  {
226  qDebug("DeviceSet::loadChannelSettings: destroying spare channel [%s]", qPrintable(openChannels[i].m_channelName));
227  openChannels[i].m_channelSinkAPI->destroy();
228  }
229 
231  }
232  else
233  {
234  qDebug("DeviceSet::loadChannelSettings: Loading preset [%s | %s] not a source preset", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
235  }
236 }
int getChannelCount() const
Definition: preset.h:86
void renameRxChannelInstances()
Definition: deviceset.cpp:348
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
const ChannelConfig & getChannelConfig(int index) const
Definition: preset.h:87
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
QString m_channelIdURI
Channel type ID in URI form.
Definition: preset.h:31
bool isSourcePreset() const
Definition: preset.h:66
ChannelRegistrations * getRxChannelRegistrations()
Definition: pluginapi.cpp:14
bool compareRxChannelURIs(const QString &registerdChannelURI, const QString &xChannelURI)
Definition: deviceset.cpp:395
int32_t i
Definition: decimators.h:244
QList< ChannelInstanceRegistration > ChannelInstanceRegistrations
Definition: deviceset.h:77
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
QByteArray m_config
Definition: preset.h:33
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTxChannelSettings()

void DeviceSet::loadTxChannelSettings ( const Preset preset,
PluginAPI pluginAPI 
)

Definition at line 256 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), ChannelAPI::deserialize(), Preset::getChannelConfig(), Preset::getChannelCount(), Preset::getDescription(), Preset::getGroup(), PluginAPI::getTxChannelRegistrations(), i, Preset::isSourcePreset(), Preset::ChannelConfig::m_channelIdURI, DeviceSet::ChannelInstanceRegistration::m_channelName, DeviceSet::ChannelInstanceRegistration::m_channelSourceAPI, Preset::ChannelConfig::m_config, m_deviceAPI, m_txChannelInstanceRegistrations, and renameTxChannelInstances().

Referenced by getNumberOfTxChannels(), and MainCore::loadPresetSettings().

257 {
258  if (preset->isSourcePreset())
259  {
260  qDebug("DeviceSet::loadChannelSettings: Loading preset [%s | %s] not a sink preset", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
261  }
262  else
263  {
264  qDebug("DeviceSet::loadChannelSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription()));
265 
266  // Available channel plugins
267  PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getTxChannelRegistrations();
268 
269  // copy currently open channels and clear list
272 
273  qDebug("DeviceSet::loadChannelSettings: %d channel(s) in preset", preset->getChannelCount());
274 
275  for(int i = 0; i < preset->getChannelCount(); i++)
276  {
277  const Preset::ChannelConfig& channelConfig = preset->getChannelConfig(i);
278  ChannelInstanceRegistration reg;
279 
280  // if we have one instance available already, use it
281 
282  for(int i = 0; i < openChannels.count(); i++)
283  {
284  qDebug("DeviceSet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI));
285 
286  if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
287  {
288  qDebug("DeviceSet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
289  reg = openChannels.takeAt(i);
291  break;
292  }
293  }
294 
295  // if we haven't one already, create one
296 
297  if(reg.m_channelSourceAPI == 0)
298  {
299  for(int i = 0; i < channelRegistrations->count(); i++)
300  {
301  if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
302  {
303  qDebug("DeviceSet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
304  ChannelAPI *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannelCS(m_deviceAPI);
305  reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, txChannel);
307  break;
308  }
309  }
310  }
311 
312  if(reg.m_channelSourceAPI != 0)
313  {
314  qDebug("DeviceSet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channelIdURI));
315  reg.m_channelSourceAPI->deserialize(channelConfig.m_config);
316  }
317  }
318 
319  // everything, that is still "available" is not needed anymore
320  for(int i = 0; i < openChannels.count(); i++)
321  {
322  qDebug("DeviceSet::loadChannelSettings: destroying spare channel [%s]", qPrintable(openChannels[i].m_channelName));
323  openChannels[i].m_channelSourceAPI->destroy();
324  }
325 
327  }
328 }
int getChannelCount() const
Definition: preset.h:86
ChannelRegistrations * getTxChannelRegistrations()
Definition: pluginapi.cpp:34
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
const ChannelConfig & getChannelConfig(int index) const
Definition: preset.h:87
QString m_channelIdURI
Channel type ID in URI form.
Definition: preset.h:31
bool isSourcePreset() const
Definition: preset.h:66
void renameTxChannelInstances()
Definition: deviceset.cpp:356
int32_t i
Definition: decimators.h:244
QList< ChannelInstanceRegistration > ChannelInstanceRegistrations
Definition: deviceset.h:77
DeviceAPI * m_deviceAPI
Definition: deviceset.h:34
QByteArray m_config
Definition: preset.h:33
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerRxChannelInstance()

void DeviceSet::registerRxChannelInstance ( const QString &  channelName,
ChannelAPI channelAPI 
)

Definition at line 64 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), m_rxChannelInstanceRegistrations, and renameRxChannelInstances().

Referenced by getNumberOfTxChannels().

65 {
66  m_rxChannelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI));
68 }
void renameRxChannelInstances()
Definition: deviceset.cpp:348
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerTxChannelInstance()

void DeviceSet::registerTxChannelInstance ( const QString &  channelName,
ChannelAPI channelAPI 
)

Definition at line 70 of file deviceset.cpp.

References DeviceSet::ChannelInstanceRegistration::ChannelInstanceRegistration(), m_txChannelInstanceRegistrations, and renameTxChannelInstances().

Referenced by getNumberOfTxChannels().

71 {
72  m_txChannelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI));
74 }
void renameTxChannelInstances()
Definition: deviceset.cpp:356
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeRxChannelInstance()

void DeviceSet::removeRxChannelInstance ( ChannelAPI channelAPI)

Definition at line 76 of file deviceset.cpp.

References m_rxChannelInstanceRegistrations, and renameRxChannelInstances().

Referenced by getNumberOfTxChannels().

77 {
78  for(ChannelInstanceRegistrations::iterator it = m_rxChannelInstanceRegistrations.begin(); it != m_rxChannelInstanceRegistrations.end(); ++it)
79  {
80  if(it->m_channelSinkAPI == channelAPI)
81  {
83  break;
84  }
85  }
86 
88 }
void renameRxChannelInstances()
Definition: deviceset.cpp:348
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTxChannelInstance()

void DeviceSet::removeTxChannelInstance ( ChannelAPI channelAPI)

Definition at line 90 of file deviceset.cpp.

References m_txChannelInstanceRegistrations, and renameTxChannelInstances().

Referenced by getNumberOfTxChannels().

91 {
92  for(ChannelInstanceRegistrations::iterator it = m_txChannelInstanceRegistrations.begin(); it != m_txChannelInstanceRegistrations.end(); ++it)
93  {
94  if(it->m_channelSourceAPI == channelAPI)
95  {
97  break;
98  }
99  }
100 
102 }
void renameTxChannelInstances()
Definition: deviceset.cpp:356
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renameRxChannelInstances()

void DeviceSet::renameRxChannelInstances ( )
private

Definition at line 348 of file deviceset.cpp.

References arg(), i, DeviceSet::ChannelInstanceRegistration::m_channelName, and m_rxChannelInstanceRegistrations.

Referenced by deleteRxChannel(), loadRxChannelSettings(), registerRxChannelInstance(), and removeRxChannelInstance().

349 {
350  for(int i = 0; i < m_rxChannelInstanceRegistrations.count(); i++)
351  {
352  m_rxChannelInstanceRegistrations[i].m_channelSinkAPI->setName(QString("%1:%2").arg(m_rxChannelInstanceRegistrations[i].m_channelName).arg(i));
353  }
354 }
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int32_t i
Definition: decimators.h:244
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renameTxChannelInstances()

void DeviceSet::renameTxChannelInstances ( )
private

Definition at line 356 of file deviceset.cpp.

References arg(), i, DeviceSet::ChannelInstanceRegistration::m_channelName, and m_txChannelInstanceRegistrations.

Referenced by deleteTxChannel(), loadTxChannelSettings(), registerTxChannelInstance(), and removeTxChannelInstance().

357 {
358  for(int i = 0; i < m_txChannelInstanceRegistrations.count(); i++)
359  {
360  m_txChannelInstanceRegistrations[i].m_channelSourceAPI->setName(QString("%1:%2").arg(m_txChannelInstanceRegistrations[i].m_channelName).arg(i));
361  }
362 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int32_t i
Definition: decimators.h:244
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveRxChannelSettings()

void DeviceSet::saveRxChannelSettings ( Preset preset)

Definition at line 238 of file deviceset.cpp.

References Preset::addChannel(), i, Preset::isSourcePreset(), DeviceSet::ChannelInstanceRegistration::m_channelName, DeviceSet::ChannelInstanceRegistration::m_channelSinkAPI, m_rxChannelInstanceRegistrations, and ChannelAPI::serialize().

Referenced by getNumberOfTxChannels(), and MainCore::savePresetSettings().

239 {
240  if (preset->isSourcePreset())
241  {
242  qSort(m_rxChannelInstanceRegistrations.begin(), m_rxChannelInstanceRegistrations.end()); // sort by increasing delta frequency and type
243 
244  for(int i = 0; i < m_rxChannelInstanceRegistrations.count(); i++)
245  {
246  qDebug("DeviceSet::saveChannelSettings: channel [%s] saved", qPrintable(m_rxChannelInstanceRegistrations[i].m_channelName));
247  preset->addChannel(m_rxChannelInstanceRegistrations[i].m_channelName, m_rxChannelInstanceRegistrations[i].m_channelSinkAPI->serialize());
248  }
249  }
250  else
251  {
252  qDebug("DeviceSet::saveChannelSettings: not a source preset");
253  }
254 }
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations
Definition: deviceset.h:79
bool isSourcePreset() const
Definition: preset.h:66
void addChannel(const QString &channel, const QByteArray &config)
Definition: preset.h:85
int32_t i
Definition: decimators.h:244
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTxChannelSettings()

void DeviceSet::saveTxChannelSettings ( Preset preset)

Definition at line 330 of file deviceset.cpp.

References Preset::addChannel(), i, Preset::isSourcePreset(), DeviceSet::ChannelInstanceRegistration::m_channelName, DeviceSet::ChannelInstanceRegistration::m_channelSourceAPI, m_txChannelInstanceRegistrations, and ChannelAPI::serialize().

Referenced by getNumberOfTxChannels(), and MainCore::savePresetSettings().

331 {
332  if (preset->isSourcePreset())
333  {
334  qDebug("DeviceSet::saveChannelSettings: not a sink preset");
335  }
336  else
337  {
338  qSort(m_txChannelInstanceRegistrations.begin(), m_txChannelInstanceRegistrations.end()); // sort by increasing delta frequency and type
339 
340  for(int i = 0; i < m_txChannelInstanceRegistrations.count(); i++)
341  {
342  qDebug("DeviceSet::saveChannelSettings: channel [%s] saved", qPrintable(m_txChannelInstanceRegistrations[i].m_channelName));
343  preset->addChannel(m_txChannelInstanceRegistrations[i].m_channelName, m_txChannelInstanceRegistrations[i].m_channelSourceAPI->serialize());
344  }
345  }
346 }
bool isSourcePreset() const
Definition: preset.h:66
void addChannel(const QString &channel, const QByteArray &config)
Definition: preset.h:85
int32_t i
Definition: decimators.h:244
ChannelInstanceRegistrations m_txChannelInstanceRegistrations
Definition: deviceset.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceAPI

DeviceAPI* DeviceSet::m_deviceAPI

◆ m_deviceMIMOEngine

DSPDeviceMIMOEngine* DeviceSet::m_deviceMIMOEngine

Definition at line 37 of file deviceset.h.

Referenced by DeviceSet().

◆ m_deviceSinkEngine

DSPDeviceSinkEngine* DeviceSet::m_deviceSinkEngine

◆ m_deviceSourceEngine

DSPDeviceSourceEngine* DeviceSet::m_deviceSourceEngine

◆ m_deviceTabIndex

int DeviceSet::m_deviceTabIndex
private

Definition at line 81 of file deviceset.h.

Referenced by DeviceSet().

◆ m_rxChannelInstanceRegistrations

ChannelInstanceRegistrations DeviceSet::m_rxChannelInstanceRegistrations
private

◆ m_txChannelInstanceRegistrations

ChannelInstanceRegistrations DeviceSet::m_txChannelInstanceRegistrations
private

The documentation for this class was generated from the following files: