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

#include <webapiadaptergui.h>

+ Inheritance diagram for WebAPIAdapterGUI:
+ Collaboration diagram for WebAPIAdapterGUI:

Public Member Functions

 WebAPIAdapterGUI (MainWindow &mainWindow)
 
virtual ~WebAPIAdapterGUI ()
 
virtual int instanceSummary (SWGSDRangel::SWGInstanceSummaryResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDelete (SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceConfigGet (SWGSDRangel::SWGInstanceConfigResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDevices (int direction, SWGSDRangel::SWGInstanceDevicesResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceChannels (int direction, SWGSDRangel::SWGInstanceChannelsResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceLoggingGet (SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceLoggingPut (SWGSDRangel::SWGLoggingInfo &query, SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioGet (SWGSDRangel::SWGAudioDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioInputPatch (SWGSDRangel::SWGAudioInputDevice &response, const QStringList &audioInputKeys, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioOutputPatch (SWGSDRangel::SWGAudioOutputDevice &response, const QStringList &audioOutputKeys, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioInputDelete (SWGSDRangel::SWGAudioInputDevice &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioOutputDelete (SWGSDRangel::SWGAudioOutputDevice &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioInputCleanupPatch (SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAudioOutputCleanupPatch (SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceLocationGet (SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceLocationPut (SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDVSerialGet (SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDVSerialPatch (bool dvserial, SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAMBESerialGet (SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAMBEDevicesGet (SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAMBEDevicesPut (SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAMBEDevicesPatch (SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceAMBEDevicesDelete (SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetsGet (SWGSDRangel::SWGPresets &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetPatch (SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetPut (SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetPost (SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetDelete (SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDeviceSetsGet (SWGSDRangel::SWGDeviceSetList &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDeviceSetPost (int direction, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instanceDeviceSetDelete (SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetGet (int deviceSetIndex, SWGSDRangel::SWGDeviceSet &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetFocusPatch (int deviceSetIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDevicePut (int deviceSetIndex, SWGSDRangel::SWGDeviceListItem &query, SWGSDRangel::SWGDeviceListItem &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceSettingsGet (int deviceSetIndex, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceSettingsPutPatch (int deviceSetIndex, bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceRunGet (int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceRunPost (int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceRunDelete (int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetDeviceReportGet (int deviceSetIndex, SWGSDRangel::SWGDeviceReport &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelsReportGet (int deviceSetIndex, SWGSDRangel::SWGChannelsDetail &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelPost (int deviceSetIndex, SWGSDRangel::SWGChannelSettings &query, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelDelete (int deviceSetIndex, int channelIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelSettingsGet (int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelSettingsPutPatch (int deviceSetIndex, int channelIndex, bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int devicesetChannelReportGet (int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelReport &response, SWGSDRangel::SWGErrorResponse &error)
 
- Public Member Functions inherited from WebAPIAdapterInterface
virtual ~WebAPIAdapterInterface ()
 
virtual int instancePresetFilePut (SWGSDRangel::SWGPresetImport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 
virtual int instancePresetFilePost (SWGSDRangel::SWGPresetExport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
 

Private Member Functions

void getDeviceSetList (SWGSDRangel::SWGDeviceSetList *deviceSetList)
 
void getDeviceSet (SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet *deviceUISet, int deviceUISetIndex)
 
void getChannelsDetail (SWGSDRangel::SWGChannelsDetail *channelsDetail, const DeviceUISet *deviceUISet)
 

Static Private Member Functions

static QtMsgType getMsgTypeFromString (const QString &msgTypeString)
 
static void getMsgTypeString (const QtMsgType &msgType, QString &level)
 

Private Attributes

MainWindowm_mainWindow
 

Additional Inherited Members

- Static Public Attributes inherited from WebAPIAdapterInterface
static QString instanceSummaryURL = "/sdrangel"
 
static QString instanceConfigURL = "/sdrangel/config"
 
static QString instanceDevicesURL = "/sdrangel/devices"
 
static QString instanceChannelsURL = "/sdrangel/channels"
 
static QString instanceLoggingURL = "/sdrangel/logging"
 
static QString instanceAudioURL = "/sdrangel/audio"
 
static QString instanceAudioInputParametersURL = "/sdrangel/audio/input/parameters"
 
static QString instanceAudioOutputParametersURL = "/sdrangel/audio/output/parameters"
 
static QString instanceAudioInputCleanupURL = "/sdrangel/audio/input/cleanup"
 
static QString instanceAudioOutputCleanupURL = "/sdrangel/audio/output/cleanup"
 
static QString instanceLocationURL = "/sdrangel/location"
 
static QString instanceAMBESerialURL = "/sdrangel/ambe/serial"
 
static QString instanceAMBEDevicesURL = "/sdrangel/ambe/devices"
 
static QString instancePresetsURL = "/sdrangel/presets"
 
static QString instancePresetURL = "/sdrangel/preset"
 
static QString instancePresetFileURL = "/sdrangel/preset/file"
 
static QString instanceDeviceSetsURL = "/sdrangel/devicesets"
 
static QString instanceDeviceSetURL = "/sdrangel/deviceset"
 
static std::regex devicesetURLRe
 
static std::regex devicesetFocusURLRe
 
static std::regex devicesetDeviceURLRe
 
static std::regex devicesetDeviceSettingsURLRe
 
static std::regex devicesetDeviceRunURLRe
 
static std::regex devicesetDeviceReportURLRe
 
static std::regex devicesetChannelURLRe
 
static std::regex devicesetChannelIndexURLRe
 
static std::regex devicesetChannelSettingsURLRe
 
static std::regex devicesetChannelReportURLRe
 
static std::regex devicesetChannelsReportURLRe
 

Detailed Description

Definition at line 30 of file webapiadaptergui.h.

Constructor & Destructor Documentation

◆ WebAPIAdapterGUI()

WebAPIAdapterGUI::WebAPIAdapterGUI ( MainWindow mainWindow)

Definition at line 67 of file webapiadaptergui.cpp.

67  :
68  m_mainWindow(mainWindow)
69 {
70 }
MainWindow & m_mainWindow

◆ ~WebAPIAdapterGUI()

WebAPIAdapterGUI::~WebAPIAdapterGUI ( )
virtual

Definition at line 72 of file webapiadaptergui.cpp.

73 {
74 }

Member Function Documentation

◆ devicesetChannelDelete()

int WebAPIAdapterGUI::devicesetChannelDelete ( int  deviceSetIndex,
int  channelIndex,
SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex} (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1582 of file webapiadaptergui.cpp.

References MainWindow::MsgDeleteChannel::create(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGSuccessResponse::init(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, and MessageQueue::push().

1587 {
1588  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1589  {
1590  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1591 
1592  if (deviceSet->m_deviceSourceEngine) // Rx
1593  {
1594  if (channelIndex < deviceSet->getNumberOfRxChannels())
1595  {
1596  MainWindow::MsgDeleteChannel *msg = MainWindow::MsgDeleteChannel::create(deviceSetIndex, channelIndex, false);
1598 
1599  response.init();
1600  *response.getMessage() = QString("Message to delete a channel (MsgDeleteChannel) was submitted successfully");
1601 
1602  return 202;
1603  }
1604  else
1605  {
1606  error.init();
1607  *error.getMessage() = QString("There is no channel at index %1. There are %2 Rx channels")
1608  .arg(channelIndex)
1609  .arg(channelIndex < deviceSet->getNumberOfRxChannels());
1610  return 400;
1611  }
1612  }
1613  else if (deviceSet->m_deviceSinkEngine) // Tx
1614  {
1615  if (channelIndex < deviceSet->getNumberOfTxChannels())
1616  {
1617  MainWindow::MsgDeleteChannel *msg = MainWindow::MsgDeleteChannel::create(deviceSetIndex, channelIndex, true);
1619 
1620  response.init();
1621  *response.getMessage() = QString("Message to delete a channel (MsgDeleteChannel) was submitted successfully");
1622 
1623  return 202;
1624  }
1625  else
1626  {
1627  error.init();
1628  *error.getMessage() = QString("There is no channel at index %1. There are %2 Tx channels")
1629  .arg(channelIndex)
1630  .arg(channelIndex < deviceSet->getNumberOfRxChannels());
1631  return 400;
1632  }
1633  }
1634  else
1635  {
1636  error.init();
1637  *error.getMessage() = QString("DeviceSet error");
1638  return 500;
1639  }
1640  }
1641  else
1642  {
1643  error.init();
1644  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1645  return 404;
1646  }
1647 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
static MsgDeleteChannel * create(int deviceSetIndex, int channelIndex, bool tx)
Definition: mainwindow.h:254
+ Here is the call graph for this function:

◆ devicesetChannelPost()

int WebAPIAdapterGUI::devicesetChannelPost ( int  deviceSetIndex,
SWGSDRangel::SWGChannelSettings query,
SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{deviceSetIndex}/channel (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1485 of file webapiadaptergui.cpp.

References MainWindow::MsgAddChannel::create(), SWGSDRangel::SWGChannelSettings::getChannelType(), SWGSDRangel::SWGChannelSettings::getDirection(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::getMessage(), PluginManager::getRxChannelRegistrations(), PluginManager::getTxChannelRegistrations(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGSuccessResponse::init(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, MainWindow::m_pluginManager, and MessageQueue::push().

1490 {
1491  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1492  {
1493  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1494 
1495  if (query.getDirection() == 0) // Single Rx
1496  {
1497  if (deviceSet->m_deviceSourceEngine == 0)
1498  {
1499  error.init();
1500  *error.getMessage() = QString("Device set at %1 is not a receive device set").arg(deviceSetIndex);
1501  return 400;
1502  }
1503 
1505  int nbRegistrations = channelRegistrations->size();
1506  int index = 0;
1507  for (; index < nbRegistrations; index++)
1508  {
1509  if (channelRegistrations->at(index).m_channelId == *query.getChannelType()) {
1510  break;
1511  }
1512  }
1513 
1514  if (index < nbRegistrations)
1515  {
1516  MainWindow::MsgAddChannel *msg = MainWindow::MsgAddChannel::create(deviceSetIndex, index, false);
1518 
1519  response.init();
1520  *response.getMessage() = QString("Message to add a channel (MsgAddChannel) was submitted successfully");
1521 
1522  return 202;
1523  }
1524  else
1525  {
1526  error.init();
1527  *error.getMessage() = QString("There is no receive channel with id %1").arg(*query.getChannelType());
1528  return 404;
1529  }
1530  }
1531  else if (query.getDirection() == 1) // single Tx
1532  {
1533  if (deviceSet->m_deviceSinkEngine == 0)
1534  {
1535  error.init();
1536  *error.getMessage() = QString("Device set at %1 is not a transmit device set").arg(deviceSetIndex);
1537  return 400;
1538  }
1539 
1541  int nbRegistrations = channelRegistrations->size();
1542  int index = 0;
1543  for (; index < nbRegistrations; index++)
1544  {
1545  if (channelRegistrations->at(index).m_channelId == *query.getChannelType()) {
1546  break;
1547  }
1548  }
1549 
1550  if (index < nbRegistrations)
1551  {
1552  MainWindow::MsgAddChannel *msg = MainWindow::MsgAddChannel::create(deviceSetIndex, index, true);
1554 
1555  response.init();
1556  *response.getMessage() = QString("Message to add a channel (MsgAddChannel) was submitted successfully");
1557 
1558  return 202;
1559  }
1560  else
1561  {
1562  error.init();
1563  *error.getMessage() = QString("There is no transmit channel with id %1").arg(*query.getChannelType());
1564  return 404;
1565  }
1566  }
1567  else
1568  {
1569  error.init();
1570  *error.getMessage() = QString("This type of device is not implemented yet");
1571  return 400;
1572  }
1573  }
1574  else
1575  {
1576  error.init();
1577  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1578  return 404;
1579  }
1580 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
PluginAPI::ChannelRegistrations * getRxChannelRegistrations()
Definition: pluginmanager.h:74
MainWindow & m_mainWindow
PluginAPI::ChannelRegistrations * getTxChannelRegistrations()
Definition: pluginmanager.h:75
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
static MsgAddChannel * create(int deviceSetIndex, int channelRegistrationIndex, bool tx)
Definition: mainwindow.h:228
PluginManager * m_pluginManager
Definition: mainwindow.h:313
+ Here is the call graph for this function:

◆ devicesetChannelReportGet()

int WebAPIAdapterGUI::devicesetChannelReportGet ( int  deviceSetIndex,
int  channelIndex,
SWGSDRangel::SWGChannelReport response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1709 of file webapiadaptergui.cpp.

References DeviceAPI::getChanelSinkAPIAt(), DeviceAPI::getChanelSourceAPIAt(), SWGSDRangel::SWGChannelReport::getChannelType(), ChannelAPI::getIdentifier(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, SWGSDRangel::SWGChannelReport::setChannelType(), SWGSDRangel::SWGChannelReport::setDirection(), and ChannelAPI::webapiReportGet().

1714 {
1715  error.init();
1716 
1717  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1718  {
1719  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1720 
1721  if (deviceSet->m_deviceSourceEngine) // Single Rx
1722  {
1723  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
1724 
1725  if (channelAPI == 0)
1726  {
1727  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1728  return 404;
1729  }
1730  else
1731  {
1732  response.setChannelType(new QString());
1733  channelAPI->getIdentifier(*response.getChannelType());
1734  response.setDirection(0);
1735  return channelAPI->webapiReportGet(response, *error.getMessage());
1736  }
1737  }
1738  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1739  {
1740  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
1741 
1742  if (channelAPI == 0)
1743  {
1744  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1745  return 404;
1746  }
1747  else
1748  {
1749  response.setChannelType(new QString());
1750  channelAPI->getIdentifier(*response.getChannelType());
1751  response.setDirection(1);
1752  return channelAPI->webapiReportGet(response, *error.getMessage());
1753  }
1754  }
1755  else
1756  {
1757  *error.getMessage() = QString("DeviceSet error");
1758  return 500;
1759  }
1760  }
1761  else
1762  {
1763  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1764  return 404;
1765  }
1766 }
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:445
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
virtual void getIdentifier(QString &id)=0
MainWindow & m_mainWindow
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
Definition: channelapi.h:79
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
void setChannelType(QString *channel_type)
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:463
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
void setDirection(qint32 direction)
+ Here is the call graph for this function:

◆ devicesetChannelSettingsGet()

int WebAPIAdapterGUI::devicesetChannelSettingsGet ( int  deviceSetIndex,
int  channelIndex,
SWGSDRangel::SWGChannelSettings response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1649 of file webapiadaptergui.cpp.

References DeviceAPI::getChanelSinkAPIAt(), DeviceAPI::getChanelSourceAPIAt(), SWGSDRangel::SWGChannelSettings::getChannelType(), ChannelAPI::getIdentifier(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, SWGSDRangel::SWGChannelSettings::setChannelType(), SWGSDRangel::SWGChannelSettings::setDirection(), and ChannelAPI::webapiSettingsGet().

1654 {
1655  error.init();
1656 
1657  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1658  {
1659  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1660 
1661  if (deviceSet->m_deviceSourceEngine) // Single Rx
1662  {
1663  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
1664 
1665  if (channelAPI == 0)
1666  {
1667  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1668  return 404;
1669  }
1670  else
1671  {
1672  response.setChannelType(new QString());
1673  channelAPI->getIdentifier(*response.getChannelType());
1674  response.setDirection(0);
1675  return channelAPI->webapiSettingsGet(response, *error.getMessage());
1676  }
1677  }
1678  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1679  {
1680  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
1681 
1682  if (channelAPI == 0)
1683  {
1684  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1685  return 404;
1686  }
1687  else
1688  {
1689  response.setChannelType(new QString());
1690  channelAPI->getIdentifier(*response.getChannelType());
1691  response.setDirection(1);
1692  return channelAPI->webapiSettingsGet(response, *error.getMessage());
1693  }
1694  }
1695  else
1696  {
1697  *error.getMessage() = QString("DeviceSet error");
1698  return 500;
1699  }
1700  }
1701  else
1702  {
1703  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1704  return 404;
1705  }
1706 }
virtual int webapiSettingsGet(SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: channelapi.h:59
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:445
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
virtual void getIdentifier(QString &id)=0
MainWindow & m_mainWindow
void setChannelType(QString *channel_type)
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:463
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
+ Here is the call graph for this function:

◆ devicesetChannelSettingsPutPatch()

int WebAPIAdapterGUI::devicesetChannelSettingsPutPatch ( int  deviceSetIndex,
int  channelIndex,
bool  force,
const QStringList &  channelSettingsKeys,
SWGSDRangel::SWGChannelSettings response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/settings (PUT, PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1768 of file webapiadaptergui.cpp.

References arg(), DeviceAPI::getChanelSinkAPIAt(), DeviceAPI::getChanelSourceAPIAt(), SWGSDRangel::SWGChannelSettings::getChannelType(), ChannelAPI::getIdentifier(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, and ChannelAPI::webapiSettingsPutPatch().

1775 {
1776  error.init();
1777 
1778  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1779  {
1780  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1781 
1782  if (deviceSet->m_deviceSourceEngine) // Single Rx
1783  {
1784  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSinkAPIAt(channelIndex);
1785 
1786  if (channelAPI == 0)
1787  {
1788  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1789  return 404;
1790  }
1791  else
1792  {
1793  QString channelType;
1794  channelAPI->getIdentifier(channelType);
1795 
1796  if (channelType == *response.getChannelType())
1797  {
1798  return channelAPI->webapiSettingsPutPatch(force, channelSettingsKeys, response, *error.getMessage());
1799  }
1800  else
1801  {
1802  *error.getMessage() = QString("There is no channel type %1 at index %2. Found %3.")
1803  .arg(*response.getChannelType())
1804  .arg(channelIndex)
1805  .arg(channelType);
1806  return 404;
1807  }
1808  }
1809  }
1810  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1811  {
1812  ChannelAPI *channelAPI = deviceSet->m_deviceAPI->getChanelSourceAPIAt(channelIndex);
1813 
1814  if (channelAPI == 0)
1815  {
1816  *error.getMessage() = QString("There is no channel with index %1").arg(channelIndex);
1817  return 404;
1818  }
1819  else
1820  {
1821  QString channelType;
1822  channelAPI->getIdentifier(channelType);
1823 
1824  if (channelType == *response.getChannelType())
1825  {
1826  return channelAPI->webapiSettingsPutPatch(force, channelSettingsKeys, response, *error.getMessage());
1827  }
1828  else
1829  {
1830  *error.getMessage() = QString("There is no channel type %1 at index %2. Found %3.")
1831  .arg(*response.getChannelType())
1832  .arg(channelIndex)
1833  .arg(channelType);
1834  return 404;
1835  }
1836  }
1837  }
1838  else
1839  {
1840  *error.getMessage() = QString("DeviceSet error");
1841  return 500;
1842  }
1843  }
1844  else
1845  {
1846  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1847  return 404;
1848  }
1849 
1850 }
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:445
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
virtual void getIdentifier(QString &id)=0
MainWindow & m_mainWindow
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
virtual int webapiSettingsPutPatch(bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: channelapi.h:67
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:463
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
+ Here is the call graph for this function:

◆ devicesetChannelsReportGet()

int WebAPIAdapterGUI::devicesetChannelsReportGet ( int  deviceSetIndex,
SWGSDRangel::SWGChannelsDetail response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/channels/report (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1464 of file webapiadaptergui.cpp.

References getChannelsDetail(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_deviceUIs, and m_mainWindow.

1468 {
1469  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1470  {
1471  const DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1472  getChannelsDetail(&response, deviceSet);
1473 
1474  return 200;
1475  }
1476  else
1477  {
1478  error.init();
1479  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1480 
1481  return 404;
1482  }
1483 }
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
void getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channelsDetail, const DeviceUISet *deviceUISet)
+ Here is the call graph for this function:

◆ devicesetDevicePut()

int WebAPIAdapterGUI::devicesetDevicePut ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceListItem query,
SWGSDRangel::SWGDeviceListItem response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1113 of file webapiadaptergui.cpp.

References MainWindow::MsgSetDevice::create(), PluginInterface::SamplingDevice::deviceItemIndex, PluginInterface::SamplingDevice::deviceNbItems, PluginInterface::SamplingDevice::displayedName, SWGSDRangel::SWGDeviceListItem::getDeviceStreamIndex(), SWGSDRangel::SWGDeviceListItem::getDirection(), SWGSDRangel::SWGDeviceListItem::getDisplayedName(), SWGSDRangel::SWGDeviceListItem::getHwType(), SWGSDRangel::SWGErrorResponse::getMessage(), DeviceEnumerator::getNbRxSamplingDevices(), DeviceEnumerator::getNbTxSamplingDevices(), DeviceEnumerator::getRxSamplingDevice(), SWGSDRangel::SWGDeviceListItem::getSequence(), SWGSDRangel::SWGDeviceListItem::getSerial(), DeviceEnumerator::getTxSamplingDevice(), PluginInterface::SamplingDevice::hardwareId, i, SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGDeviceListItem::init(), DeviceEnumerator::instance(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, MessageQueue::push(), PluginInterface::SamplingDevice::sequence, PluginInterface::SamplingDevice::serial, SWGSDRangel::SWGDeviceListItem::setDeviceNbStreams(), SWGSDRangel::SWGDeviceListItem::setDeviceSetIndex(), SWGSDRangel::SWGDeviceListItem::setDeviceStreamIndex(), SWGSDRangel::SWGDeviceListItem::setDirection(), SWGSDRangel::SWGDeviceListItem::setIndex(), and SWGSDRangel::SWGDeviceListItem::setSequence().

1118 {
1119  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1120  {
1121  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1122 
1123  if ((query.getDirection() != 1) && (deviceSet->m_deviceSinkEngine))
1124  {
1125  error.init();
1126  *error.getMessage() = QString("Device type and device set type (Tx) mismatch");
1127  return 404;
1128  }
1129 
1130  if ((query.getDirection() != 0) && (deviceSet->m_deviceSourceEngine))
1131  {
1132  error.init();
1133  *error.getMessage() = QString("Device type and device set type (Rx) mismatch");
1134  return 404;
1135  }
1136 
1137  int nbSamplingDevices;
1138 
1139  if (query.getDirection() == 0) {
1140  nbSamplingDevices = DeviceEnumerator::instance()->getNbRxSamplingDevices();
1141  } else if (query.getDirection() == 1) {
1142  nbSamplingDevices = DeviceEnumerator::instance()->getNbTxSamplingDevices();
1143  } else {
1144  nbSamplingDevices = 0; // TODO: not implemented yet
1145  }
1146 
1147 
1148  for (int i = 0; i < nbSamplingDevices; i++)
1149  {
1150  int tx;
1151  const PluginInterface::SamplingDevice *samplingDevice;
1152 
1153  if (query.getDirection() == 0)
1154  {
1155  tx = 0;
1156  samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(i);
1157  }
1158  else if (query.getDirection() == 1)
1159  {
1160  tx = 1;
1161  samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(i);
1162  }
1163  else
1164  {
1165  continue; // TODO: any device (2) not supported yet
1166  }
1167 
1168  if (query.getDisplayedName() && (*query.getDisplayedName() != samplingDevice->displayedName)) {
1169  continue;
1170  }
1171 
1172  if (query.getHwType() && (*query.getHwType() != samplingDevice->hardwareId)) {
1173  continue;
1174  }
1175 
1176  if ((query.getSequence() >= 0) && (query.getSequence() != samplingDevice->sequence)) {
1177  continue;
1178  }
1179 
1180  if (query.getSerial() && (*query.getSerial() != samplingDevice->serial)) {
1181  continue;
1182  }
1183 
1184  if ((query.getDeviceStreamIndex() >= 0) && (query.getDeviceStreamIndex() != samplingDevice->deviceItemIndex)) {
1185  continue;
1186  }
1187 
1190 
1191  response.init();
1192  *response.getDisplayedName() = samplingDevice->displayedName;
1193  *response.getHwType() = samplingDevice->hardwareId;
1194  *response.getSerial() = samplingDevice->serial;
1195  response.setSequence(samplingDevice->sequence);
1196  response.setDirection(tx);
1197  response.setDeviceNbStreams(samplingDevice->deviceNbItems);
1198  response.setDeviceStreamIndex(samplingDevice->deviceItemIndex);
1199  response.setDeviceSetIndex(deviceSetIndex);
1200  response.setIndex(i);
1201 
1202  return 202;
1203  }
1204 
1205  error.init();
1206  *error.getMessage() = QString("Device not found");
1207  return 404;
1208  }
1209  else
1210  {
1211  error.init();
1212  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1213  return 404;
1214  }
1215 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void setDeviceStreamIndex(qint32 device_stream_index)
int sequence
The device sequence. >0 when more than one device of the same type is connected.
void push(Message *message, bool emitSignal=true)
Push message onto queue.
QString displayedName
The human readable name.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
void setDeviceSetIndex(qint32 device_set_index)
QString hardwareId
The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
static MsgSetDevice * create(int deviceSetIndex, int deviceIndex, bool tx)
Definition: mainwindow.h:202
MainWindow & m_mainWindow
void setDirection(qint32 direction)
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
int deviceNbItems
Number of items (or streams) in the device. >1 for composite devices.
int32_t i
Definition: decimators.h:244
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
void setDeviceNbStreams(qint32 device_nb_streams)
QString serial
The device serial number defined by the vendor or a fake one (SDRplay)
int getNbRxSamplingDevices() const
const PluginInterface::SamplingDevice * getTxSamplingDevice(int deviceIndex) const
const PluginInterface::SamplingDevice * getRxSamplingDevice(int deviceIndex) const
static DeviceEnumerator * instance()
int deviceItemIndex
For composite devices this is the Rx or Tx stream index. -1 if not initialized.
int getNbTxSamplingDevices() const
+ Here is the call graph for this function:

◆ devicesetDeviceReportGet()

int WebAPIAdapterGUI::devicesetDeviceReportGet ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceReport response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/report (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1426 of file webapiadaptergui.cpp.

References DeviceAPI::getHardwareId(), SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, SWGSDRangel::SWGDeviceReport::setDeviceHwType(), SWGSDRangel::SWGDeviceReport::setDirection(), DeviceSampleSink::webapiReportGet(), and DeviceSampleSource::webapiReportGet().

1430 {
1431  error.init();
1432 
1433  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1434  {
1435  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1436 
1437  if (deviceSet->m_deviceSourceEngine) // Single Rx
1438  {
1439  response.setDeviceHwType(new QString(deviceSet->m_deviceAPI->getHardwareId()));
1440  response.setDirection(0);
1441  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1442  return source->webapiReportGet(response, *error.getMessage());
1443  }
1444  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1445  {
1446  response.setDeviceHwType(new QString(deviceSet->m_deviceAPI->getHardwareId()));
1447  response.setDirection(1);
1448  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1449  return sink->webapiReportGet(response, *error.getMessage());
1450  }
1451  else
1452  {
1453  *error.getMessage() = QString("DeviceSet error");
1454  return 500;
1455  }
1456  }
1457  else
1458  {
1459  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1460  return 404;
1461  }
1462 }
void setDeviceHwType(QString *device_hw_type)
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
void setDirection(qint32 direction)
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
const QString & getHardwareId() const
Definition: deviceapi.h:119
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
+ Here is the call graph for this function:

◆ devicesetDeviceRunDelete()

int WebAPIAdapterGUI::devicesetDeviceRunDelete ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceState response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/run (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1389 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGDeviceState::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, DeviceSampleSink::webapiRun(), and DeviceSampleSource::webapiRun().

1393 {
1394  error.init();
1395 
1396  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1397  {
1398  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1399 
1400  if (deviceSet->m_deviceSourceEngine) // Rx
1401  {
1402  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1403  response.init();
1404  return source->webapiRun(false, response, *error.getMessage());
1405  }
1406  else if (deviceSet->m_deviceSinkEngine) // Tx
1407  {
1408  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1409  response.init();
1410  return sink->webapiRun(false, response, *error.getMessage());
1411  }
1412  else
1413  {
1414  *error.getMessage() = QString("DeviceSet error");
1415  return 500;
1416  }
1417  }
1418  else
1419  {
1420  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1421  return 404;
1422  }
1423 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
+ Here is the call graph for this function:

◆ devicesetDeviceRunGet()

int WebAPIAdapterGUI::devicesetDeviceRunGet ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceState response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/run (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1317 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGDeviceState::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, DeviceSampleSink::webapiRunGet(), and DeviceSampleSource::webapiRunGet().

1321 {
1322  error.init();
1323 
1324  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1325  {
1326  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1327 
1328  if (deviceSet->m_deviceSourceEngine) // Rx
1329  {
1330  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1331  response.init();
1332  return source->webapiRunGet(response, *error.getMessage());
1333  }
1334  else if (deviceSet->m_deviceSinkEngine) // Tx
1335  {
1336  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1337  response.init();
1338  return sink->webapiRunGet(response, *error.getMessage());
1339  }
1340  else
1341  {
1342  *error.getMessage() = QString("DeviceSet error");
1343  return 500;
1344  }
1345  }
1346  else
1347  {
1348  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1349  return 404;
1350  }
1351 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
+ Here is the call graph for this function:

◆ devicesetDeviceRunPost()

int WebAPIAdapterGUI::devicesetDeviceRunPost ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceState response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/run (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1353 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGDeviceState::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, DeviceSampleSink::webapiRun(), and DeviceSampleSource::webapiRun().

1357 {
1358  error.init();
1359 
1360  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1361  {
1362  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1363 
1364  if (deviceSet->m_deviceSourceEngine) // Rx
1365  {
1366  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1367  response.init();
1368  return source->webapiRun(true, response, *error.getMessage());
1369  }
1370  else if (deviceSet->m_deviceSinkEngine) // Tx
1371  {
1372  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1373  response.init();
1374  return sink->webapiRun(true, response, *error.getMessage());
1375  }
1376  else
1377  {
1378  *error.getMessage() = QString("DeviceSet error");
1379  return 500;
1380  }
1381  }
1382  else
1383  {
1384  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1385  return 404;
1386  }
1387 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
+ Here is the call graph for this function:

◆ devicesetDeviceSettingsGet()

int WebAPIAdapterGUI::devicesetDeviceSettingsGet ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceSettings response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/settings (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1217 of file webapiadaptergui.cpp.

References DeviceAPI::getHardwareId(), SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), DeviceSampleSink::webapiSettingsGet(), and DeviceSampleSource::webapiSettingsGet().

1221 {
1222  error.init();
1223 
1224  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1225  {
1226  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1227 
1228  if (deviceSet->m_deviceSourceEngine) // Single Rx
1229  {
1230  response.setDeviceHwType(new QString(deviceSet->m_deviceAPI->getHardwareId()));
1231  response.setDirection(0);
1232  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1233  return source->webapiSettingsGet(response, *error.getMessage());
1234  }
1235  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1236  {
1237  response.setDeviceHwType(new QString(deviceSet->m_deviceAPI->getHardwareId()));
1238  response.setDirection(1);
1239  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1240  return sink->webapiSettingsGet(response, *error.getMessage());
1241  }
1242  else
1243  {
1244  *error.getMessage() = QString("DeviceSet error");
1245  return 500;
1246  }
1247  }
1248  else
1249  {
1250  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1251  return 404;
1252  }
1253 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
const QString & getHardwareId() const
Definition: deviceapi.h:119
void setDirection(qint32 direction)
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
void setDeviceHwType(QString *device_hw_type)
+ Here is the call graph for this function:

◆ devicesetDeviceSettingsPutPatch()

int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch ( int  deviceSetIndex,
bool  force,
const QStringList &  channelSettingsKeys,
SWGSDRangel::SWGDeviceSettings response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/device/settings (PUT, PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1255 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGDeviceSettings::getDeviceHwType(), SWGSDRangel::SWGDeviceSettings::getDirection(), DeviceAPI::getHardwareId(), SWGSDRangel::SWGErrorResponse::getMessage(), DeviceAPI::getSampleSink(), DeviceAPI::getSampleSource(), SWGSDRangel::SWGErrorResponse::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, m_mainWindow, DeviceSampleSink::webapiSettingsPutPatch(), and DeviceSampleSource::webapiSettingsPutPatch().

1261 {
1262  error.init();
1263 
1264  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1265  {
1266  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1267 
1268  if (deviceSet->m_deviceSourceEngine) // Single Rx
1269  {
1270  if (response.getDirection() != 0)
1271  {
1272  *error.getMessage() = QString("Single Rx device found but other type of device requested");
1273  return 400;
1274  }
1275  if (deviceSet->m_deviceAPI->getHardwareId() != *response.getDeviceHwType())
1276  {
1277  *error.getMessage() = QString("Device mismatch. Found %1 input").arg(deviceSet->m_deviceAPI->getHardwareId());
1278  return 400;
1279  }
1280  else
1281  {
1282  DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();
1283  return source->webapiSettingsPutPatch(force, deviceSettingsKeys, response, *error.getMessage());
1284  }
1285  }
1286  else if (deviceSet->m_deviceSinkEngine) // Single Tx
1287  {
1288  if (response.getDirection() != 1)
1289  {
1290  *error.getMessage() = QString("Single Tx device found but other type of device requested");
1291  return 400;
1292  }
1293  else if (deviceSet->m_deviceAPI->getHardwareId() != *response.getDeviceHwType())
1294  {
1295  *error.getMessage() = QString("Device mismatch. Found %1 output").arg(deviceSet->m_deviceAPI->getHardwareId());
1296  return 400;
1297  }
1298  else
1299  {
1300  DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink();
1301  return sink->webapiSettingsPutPatch(force, deviceSettingsKeys, response, *error.getMessage());
1302  }
1303  }
1304  else
1305  {
1306  *error.getMessage() = QString("DeviceSet error");
1307  return 500;
1308  }
1309  }
1310  else
1311  {
1312  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1313  return 404;
1314  }
1315 }
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
Definition: deviceapi.cpp:213
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
Definition: deviceapi.cpp:222
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
const QString & getHardwareId() const
Definition: deviceapi.h:119
+ Here is the call graph for this function:

◆ devicesetFocusPatch()

int WebAPIAdapterGUI::devicesetFocusPatch ( int  deviceSetIndex,
SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex}/focus (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1089 of file webapiadaptergui.cpp.

References MainWindow::MsgDeviceSetFocus::create(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGSuccessResponse::init(), MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, and MessageQueue::push().

1093 {
1094  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1095  {
1098 
1099  response.init();
1100  *response.getMessage() = QString("Message to focus on device set (MsgDeviceSetFocus) was submitted successfully");
1101 
1102  return 202;
1103  }
1104  else
1105  {
1106  error.init();
1107  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1108 
1109  return 404;
1110  }
1111 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
static MsgDeviceSetFocus * create(int deviceSetIndex)
Definition: mainwindow.h:290
+ Here is the call graph for this function:

◆ devicesetGet()

int WebAPIAdapterGUI::devicesetGet ( int  deviceSetIndex,
SWGSDRangel::SWGDeviceSet response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset/{devicesetIndex} (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1068 of file webapiadaptergui.cpp.

References getDeviceSet(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_deviceUIs, and m_mainWindow.

1072 {
1073  if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
1074  {
1075  const DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
1076  getDeviceSet(&response, deviceSet, deviceSetIndex);
1077 
1078  return 200;
1079  }
1080  else
1081  {
1082  error.init();
1083  *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
1084 
1085  return 404;
1086  }
1087  }
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
void getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet *deviceUISet, int deviceUISetIndex)
+ Here is the call graph for this function:

◆ getChannelsDetail()

void WebAPIAdapterGUI::getChannelsDetail ( SWGSDRangel::SWGChannelsDetail channelsDetail,
const DeviceUISet deviceUISet 
)
private

Definition at line 1944 of file webapiadaptergui.cpp.

References ChannelAPI::getCenterFrequency(), DeviceAPI::getChanelSinkAPIAt(), DeviceAPI::getChanelSourceAPIAt(), SWGSDRangel::SWGChannelsDetail::getChannelcount(), SWGSDRangel::SWGChannelsDetail::getChannels(), ChannelAPI::getIdentifier(), ChannelAPI::getIndexInDeviceSet(), DeviceAPI::getNbSinkChannels(), DeviceAPI::getNbSourceChannels(), ChannelAPI::getTitle(), ChannelAPI::getUID(), i, SWGSDRangel::SWGChannelsDetail::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, SWGSDRangel::SWGChannelsDetail::setChannelcount(), and ChannelAPI::webapiReportGet().

Referenced by devicesetChannelsReportGet().

1945 {
1946  channelsDetail->init();
1947  SWGSDRangel::SWGChannelReport *channelReport;
1948  QString channelReportError;
1949 
1950  if (deviceUISet->m_deviceSinkEngine) // Tx data
1951  {
1952  channelsDetail->setChannelcount(deviceUISet->m_deviceAPI->getNbSourceChannels());
1953  QList<SWGSDRangel::SWGChannel*> *channels = channelsDetail->getChannels();
1954 
1955  for (int i = 0; i < channelsDetail->getChannelcount(); i++)
1956  {
1957  channels->append(new SWGSDRangel::SWGChannel);
1958  channels->back()->init();
1959  ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i);
1960  channels->back()->setDeltaFrequency(channel->getCenterFrequency());
1961  channels->back()->setIndex(channel->getIndexInDeviceSet());
1962  channels->back()->setUid(channel->getUID());
1963  channel->getIdentifier(*channels->back()->getId());
1964  channel->getTitle(*channels->back()->getTitle());
1965 
1966  channelReport = new SWGSDRangel::SWGChannelReport();
1967 
1968  if (channel->webapiReportGet(*channelReport, channelReportError) != 501) {
1969  channels->back()->setReport(channelReport);
1970  } else {
1971  delete channelReport;
1972  }
1973  }
1974  }
1975 
1976  if (deviceUISet->m_deviceSourceEngine) // Rx data
1977  {
1978  channelsDetail->setChannelcount(deviceUISet->m_deviceAPI->getNbSinkChannels());
1979  QList<SWGSDRangel::SWGChannel*> *channels = channelsDetail->getChannels();
1980 
1981  for (int i = 0; i < channelsDetail->getChannelcount(); i++)
1982  {
1983  channels->append(new SWGSDRangel::SWGChannel);
1984  channels->back()->init();
1985  ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i);
1986  channels->back()->setDeltaFrequency(channel->getCenterFrequency());
1987  channels->back()->setIndex(channel->getIndexInDeviceSet());
1988  channels->back()->setUid(channel->getUID());
1989  channel->getIdentifier(*channels->back()->getId());
1990  channel->getTitle(*channels->back()->getTitle());
1991 
1992  channelReport = new SWGSDRangel::SWGChannelReport();
1993 
1994  if (channel->webapiReportGet(*channelReport, channelReportError) != 501) {
1995  channels->back()->setReport(channelReport);
1996  } else {
1997  delete channelReport;
1998  }
1999  }
2000  }
2001 }
QList< SWGChannel * > * getChannels()
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:445
virtual void getIdentifier(QString &id)=0
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
Definition: channelapi.h:79
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
void setChannelcount(qint32 channelcount)
virtual qint64 getCenterFrequency() const =0
Applies to a default stream.
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
uint64_t getUID() const
Definition: channelapi.h:93
int32_t i
Definition: decimators.h:244
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:463
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
virtual void getTitle(QString &title)=0
int getNbSourceChannels() const
Definition: deviceapi.h:143
int getIndexInDeviceSet() const
Definition: channelapi.h:87
int getNbSinkChannels() const
Definition: deviceapi.h:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeviceSet()

void WebAPIAdapterGUI::getDeviceSet ( SWGSDRangel::SWGDeviceSet deviceSet,
const DeviceUISet deviceUISet,
int  deviceUISetIndex 
)
private

Definition at line 1872 of file webapiadaptergui.cpp.

References ChannelAPI::getCenterFrequency(), DeviceSampleSink::getCenterFrequency(), DeviceSampleSource::getCenterFrequency(), DeviceAPI::getChanelSinkAPIAt(), DeviceAPI::getChanelSourceAPIAt(), SWGSDRangel::SWGDeviceSet::getChannelcount(), SWGSDRangel::SWGDeviceSet::getChannels(), DeviceAPI::getDeviceEngineStateStr(), DeviceAPI::getDeviceItemIndex(), DeviceAPI::getDeviceNbItems(), DeviceAPI::getHardwareId(), SWGSDRangel::SWGSamplingDevice::getHwType(), ChannelAPI::getIdentifier(), ChannelAPI::getIndexInDeviceSet(), DeviceAPI::getNbSinkChannels(), DeviceAPI::getNbSourceChannels(), DeviceSampleSink::getSampleRate(), DeviceSampleSource::getSampleRate(), SWGSDRangel::SWGDeviceSet::getSamplingDevice(), DeviceAPI::getSamplingDeviceSequence(), DeviceAPI::getSamplingDeviceSerial(), SWGSDRangel::SWGSamplingDevice::getSerial(), DSPDeviceSinkEngine::getSink(), DSPDeviceSourceEngine::getSource(), SWGSDRangel::SWGSamplingDevice::getState(), ChannelAPI::getTitle(), ChannelAPI::getUID(), i, SWGSDRangel::SWGSamplingDevice::init(), SWGSDRangel::SWGDeviceSet::init(), DeviceUISet::m_deviceAPI, DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, SWGSDRangel::SWGSamplingDevice::setBandwidth(), SWGSDRangel::SWGSamplingDevice::setCenterFrequency(), SWGSDRangel::SWGDeviceSet::setChannelcount(), SWGSDRangel::SWGSamplingDevice::setDeviceNbStreams(), SWGSDRangel::SWGSamplingDevice::setDeviceStreamIndex(), SWGSDRangel::SWGSamplingDevice::setDirection(), SWGSDRangel::SWGSamplingDevice::setIndex(), and SWGSDRangel::SWGSamplingDevice::setSequence().

Referenced by devicesetGet(), and getDeviceSetList().

1873 {
1874  deviceSet->init();
1875  SWGSDRangel::SWGSamplingDevice *samplingDevice = deviceSet->getSamplingDevice();
1876  samplingDevice->init();
1877  samplingDevice->setIndex(deviceUISetIndex);
1878 
1879  if (deviceUISet->m_deviceSinkEngine) // Single Tx data
1880  {
1881  samplingDevice->setDirection(1);
1882  *samplingDevice->getHwType() = deviceUISet->m_deviceAPI->getHardwareId();
1883  *samplingDevice->getSerial() = deviceUISet->m_deviceAPI->getSamplingDeviceSerial();
1884  samplingDevice->setSequence(deviceUISet->m_deviceAPI->getSamplingDeviceSequence());
1885  samplingDevice->setDeviceNbStreams(deviceUISet->m_deviceAPI->getDeviceNbItems());
1886  samplingDevice->setDeviceStreamIndex(deviceUISet->m_deviceAPI->getDeviceItemIndex());
1887  deviceUISet->m_deviceAPI->getDeviceEngineStateStr(*samplingDevice->getState());
1888  DeviceSampleSink *sampleSink = deviceUISet->m_deviceSinkEngine->getSink();
1889 
1890  if (sampleSink) {
1891  samplingDevice->setCenterFrequency(sampleSink->getCenterFrequency());
1892  samplingDevice->setBandwidth(sampleSink->getSampleRate());
1893  }
1894 
1895  deviceSet->setChannelcount(deviceUISet->m_deviceAPI->getNbSourceChannels());
1896  QList<SWGSDRangel::SWGChannel*> *channels = deviceSet->getChannels();
1897 
1898  for (int i = 0; i < deviceSet->getChannelcount(); i++)
1899  {
1900  channels->append(new SWGSDRangel::SWGChannel);
1901  channels->back()->init();
1902  ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSourceAPIAt(i);
1903  channels->back()->setDeltaFrequency(channel->getCenterFrequency());
1904  channels->back()->setIndex(channel->getIndexInDeviceSet());
1905  channels->back()->setUid(channel->getUID());
1906  channel->getIdentifier(*channels->back()->getId());
1907  channel->getTitle(*channels->back()->getTitle());
1908  }
1909  }
1910 
1911  if (deviceUISet->m_deviceSourceEngine) // Rx data
1912  {
1913  samplingDevice->setDirection(0);
1914  *samplingDevice->getHwType() = deviceUISet->m_deviceAPI->getHardwareId();
1915  *samplingDevice->getSerial() = deviceUISet->m_deviceAPI->getSamplingDeviceSerial();
1916  samplingDevice->setSequence(deviceUISet->m_deviceAPI->getSamplingDeviceSequence());
1917  samplingDevice->setDeviceNbStreams(deviceUISet->m_deviceAPI->getDeviceNbItems());
1918  samplingDevice->setDeviceStreamIndex(deviceUISet->m_deviceAPI->getDeviceItemIndex());
1919  deviceUISet->m_deviceAPI->getDeviceEngineStateStr(*samplingDevice->getState());
1920  DeviceSampleSource *sampleSource = deviceUISet->m_deviceSourceEngine->getSource();
1921 
1922  if (sampleSource) {
1923  samplingDevice->setCenterFrequency(sampleSource->getCenterFrequency());
1924  samplingDevice->setBandwidth(sampleSource->getSampleRate());
1925  }
1926 
1927  deviceSet->setChannelcount(deviceUISet->m_deviceAPI->getNbSinkChannels());
1928  QList<SWGSDRangel::SWGChannel*> *channels = deviceSet->getChannels();
1929 
1930  for (int i = 0; i < deviceSet->getChannelcount(); i++)
1931  {
1932  channels->append(new SWGSDRangel::SWGChannel);
1933  channels->back()->init();
1934  ChannelAPI *channel = deviceUISet->m_deviceAPI->getChanelSinkAPIAt(i);
1935  channels->back()->setDeltaFrequency(channel->getCenterFrequency());
1936  channels->back()->setIndex(channel->getIndexInDeviceSet());
1937  channels->back()->setUid(channel->getUID());
1938  channel->getIdentifier(*channels->back()->getId());
1939  channel->getTitle(*channels->back()->getTitle());
1940  }
1941  }
1942 }
DeviceSampleSink * getSink()
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:445
virtual void getIdentifier(QString &id)=0
DeviceSampleSource * getSource()
uint32_t getDeviceItemIndex() const
Definition: deviceapi.h:129
uint32_t getDeviceNbItems() const
Definition: deviceapi.h:128
void setCenterFrequency(qint64 center_frequency)
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
virtual qint64 getCenterFrequency() const =0
Applies to a default stream.
virtual int getSampleRate() const =0
Sample rate exposed by the source.
QList< SWGChannel * > * getChannels()
SWGSamplingDevice * getSamplingDevice()
DeviceAPI * m_deviceAPI
Definition: deviceuiset.h:48
uint64_t getUID() const
Definition: channelapi.h:93
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the sink.
void setChannelcount(qint32 channelcount)
void setDirection(qint32 direction)
int32_t i
Definition: decimators.h:244
void setDeviceStreamIndex(qint32 device_stream_index)
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
Definition: deviceapi.cpp:463
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
void setDeviceNbStreams(qint32 device_nb_streams)
void getDeviceEngineStateStr(QString &state)
Definition: deviceapi.cpp:389
virtual void getTitle(QString &title)=0
const QString & getSamplingDeviceSerial() const
Definition: deviceapi.h:121
const QString & getHardwareId() const
Definition: deviceapi.h:119
int getNbSourceChannels() const
Definition: deviceapi.h:143
virtual int getSampleRate() const =0
Sample rate exposed by the sink.
int getIndexInDeviceSet() const
Definition: channelapi.h:87
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the source.
void setBandwidth(qint32 bandwidth)
uint32_t getSamplingDeviceSequence() const
Definition: deviceapi.h:123
int getNbSinkChannels() const
Definition: deviceapi.h:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeviceSetList()

void WebAPIAdapterGUI::getDeviceSetList ( SWGSDRangel::SWGDeviceSetList deviceSetList)
private

Definition at line 1852 of file webapiadaptergui.cpp.

References getDeviceSet(), SWGSDRangel::SWGDeviceSetList::getDeviceSets(), i, SWGSDRangel::SWGDeviceSetList::init(), MainWindow::m_deviceUIs, m_mainWindow, SWGSDRangel::SWGDeviceSetList::setDevicesetcount(), SWGSDRangel::SWGDeviceSetList::setDevicesetfocus(), and MainWindow::ui.

Referenced by instanceDeviceSetsGet(), and instanceSummary().

1853 {
1854  deviceSetList->init();
1855  deviceSetList->setDevicesetcount((int) m_mainWindow.m_deviceUIs.size());
1856 
1857  if (m_mainWindow.m_deviceUIs.size() > 0) {
1858  deviceSetList->setDevicesetfocus(m_mainWindow.ui->tabInputsView->currentIndex());
1859  }
1860 
1861  std::vector<DeviceUISet*>::const_iterator it = m_mainWindow.m_deviceUIs.begin();
1862 
1863  for (int i = 0; it != m_mainWindow.m_deviceUIs.end(); ++it, i++)
1864  {
1865  QList<SWGSDRangel::SWGDeviceSet*> *deviceSets = deviceSetList->getDeviceSets();
1866  deviceSets->append(new SWGSDRangel::SWGDeviceSet());
1867 
1868  getDeviceSet(deviceSets->back(), *it, i);
1869  }
1870 }
Ui::MainWindow * ui
Definition: mainwindow.h:305
QList< SWGDeviceSet * > * getDeviceSets()
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
void getDeviceSet(SWGSDRangel::SWGDeviceSet *deviceSet, const DeviceUISet *deviceUISet, int deviceUISetIndex)
int32_t i
Definition: decimators.h:244
void setDevicesetcount(qint32 devicesetcount)
void setDevicesetfocus(qint32 devicesetfocus)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMsgTypeFromString()

QtMsgType WebAPIAdapterGUI::getMsgTypeFromString ( const QString &  msgTypeString)
staticprivate

Definition at line 2003 of file webapiadaptergui.cpp.

Referenced by instanceLoggingPut().

2004 {
2005  if (msgTypeString == "debug") {
2006  return QtDebugMsg;
2007  } else if (msgTypeString == "info") {
2008  return QtInfoMsg;
2009  } else if (msgTypeString == "warning") {
2010  return QtWarningMsg;
2011  } else if (msgTypeString == "error") {
2012  return QtCriticalMsg;
2013  } else {
2014  return QtDebugMsg;
2015  }
2016 }
+ Here is the caller graph for this function:

◆ getMsgTypeString()

void WebAPIAdapterGUI::getMsgTypeString ( const QtMsgType &  msgType,
QString &  level 
)
staticprivate

Definition at line 2018 of file webapiadaptergui.cpp.

Referenced by instanceLoggingPut().

2019 {
2020  switch (msgType)
2021  {
2022  case QtDebugMsg:
2023  levelStr = "debug";
2024  break;
2025  case QtInfoMsg:
2026  levelStr = "info";
2027  break;
2028  case QtWarningMsg:
2029  levelStr = "warning";
2030  break;
2031  case QtCriticalMsg:
2032  case QtFatalMsg:
2033  levelStr = "error";
2034  break;
2035  default:
2036  levelStr = "debug";
2037  break;
2038  }
2039 }
+ Here is the caller graph for this function:

◆ instanceAMBEDevicesDelete()

int WebAPIAdapterGUI::instanceAMBEDevicesDelete ( SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/ambe/devices (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 712 of file webapiadaptergui.cpp.

References DSPEngine::getAMBEEngine(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::init(), MainWindow::m_dspEngine, m_mainWindow, and AMBEEngine::releaseAll().

715 {
716  (void) error;
718 
719  response.init();
720  *response.getMessage() = QString("All AMBE devices released");
721 
722  return 200;
723 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
AMBEEngine * getAMBEEngine()
Definition: dspengine.h:56
void releaseAll()
Definition: ambeengine.cpp:261
+ Here is the call graph for this function:

◆ instanceAMBEDevicesGet()

int WebAPIAdapterGUI::instanceAMBEDevicesGet ( SWGSDRangel::SWGAMBEDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/ambe/devices (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 686 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGAMBEDevices::getAmbeDevices(), DSPEngine::getDVSerialNames(), SWGSDRangel::SWGAMBEDevices::init(), MainWindow::m_dspEngine, m_mainWindow, and SWGSDRangel::SWGAMBEDevices::setNbDevices().

Referenced by instanceAMBEDevicesPatch(), and instanceAMBEDevicesPut().

689 {
690  (void) error;
691  response.init();
692 
693  std::vector<std::string> deviceNames;
695  response.setNbDevices((int) deviceNames.size());
696  QList<SWGSDRangel::SWGAMBEDevice*> *deviceNamesList = response.getAmbeDevices();
697 
698  std::vector<std::string>::iterator it = deviceNames.begin();
699 
700  while (it != deviceNames.end())
701  {
702  deviceNamesList->append(new SWGSDRangel::SWGAMBEDevice);
703  deviceNamesList->back()->init();
704  *deviceNamesList->back()->getDeviceRef() = QString::fromStdString(*it);
705  deviceNamesList->back()->setDelete(0);
706  ++it;
707  }
708 
709  return 200;
710 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
void getDVSerialNames(std::vector< std::string > &deviceNames)
Definition: dspengine.cpp:166
void setNbDevices(qint32 nb_devices)
QList< SWGAMBEDevice * > * getAmbeDevices()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ instanceAMBEDevicesPatch()

int WebAPIAdapterGUI::instanceAMBEDevicesPatch ( SWGSDRangel::SWGAMBEDevices query,
SWGSDRangel::SWGAMBEDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/ambe/devices (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 742 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGAMBEDevices::getAmbeDevices(), DSPEngine::getAMBEEngine(), instanceAMBEDevicesGet(), MainWindow::m_dspEngine, m_mainWindow, AMBEEngine::registerController(), and AMBEEngine::releaseController().

746 {
747  QList<SWGSDRangel::SWGAMBEDevice *> *ambeList = query.getAmbeDevices();
748 
749  for (QList<SWGSDRangel::SWGAMBEDevice *>::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it)
750  {
751  if ((*it)->getDelete()) {
752  m_mainWindow.m_dspEngine->getAMBEEngine()->releaseController((*it)->getDeviceRef()->toStdString());
753  } else {
754  m_mainWindow.m_dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString());
755  }
756  }
757 
758  instanceAMBEDevicesGet(response, error);
759  return 200;
760 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
virtual int instanceAMBEDevicesGet(SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
MainWindow & m_mainWindow
bool registerController(const std::string &deviceRef)
create a new controller for the device in reference
Definition: ambeengine.cpp:214
AMBEEngine * getAMBEEngine()
Definition: dspengine.h:56
QList< SWGAMBEDevice * > * getAmbeDevices()
void releaseController(const std::string &deviceRef)
release controller resources for the device in reference
Definition: ambeengine.cpp:239
+ Here is the call graph for this function:

◆ instanceAMBEDevicesPut()

int WebAPIAdapterGUI::instanceAMBEDevicesPut ( SWGSDRangel::SWGAMBEDevices query,
SWGSDRangel::SWGAMBEDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/ambe/devices (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 725 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGAMBEDevices::getAmbeDevices(), DSPEngine::getAMBEEngine(), instanceAMBEDevicesGet(), MainWindow::m_dspEngine, m_mainWindow, AMBEEngine::registerController(), and AMBEEngine::releaseAll().

729 {
731 
732  QList<SWGSDRangel::SWGAMBEDevice *> *ambeList = query.getAmbeDevices();
733 
734  for (QList<SWGSDRangel::SWGAMBEDevice *>::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) {
735  m_mainWindow.m_dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString());
736  }
737 
738  instanceAMBEDevicesGet(response, error);
739  return 200;
740 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
virtual int instanceAMBEDevicesGet(SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
MainWindow & m_mainWindow
bool registerController(const std::string &deviceRef)
create a new controller for the device in reference
Definition: ambeengine.cpp:214
AMBEEngine * getAMBEEngine()
Definition: dspengine.h:56
void releaseAll()
Definition: ambeengine.cpp:261
QList< SWGAMBEDevice * > * getAmbeDevices()
+ Here is the call graph for this function:

◆ instanceAMBESerialGet()

int WebAPIAdapterGUI::instanceAMBESerialGet ( SWGSDRangel::SWGDVSerialDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/ambe/serial (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 655 of file webapiadaptergui.cpp.

References DSPEngine::getAMBEEngine(), SWGSDRangel::SWGDVSerialDevices::getDvSerialDevices(), SWGSDRangel::SWGDVSerialDevices::init(), MainWindow::m_dspEngine, m_mainWindow, AMBEEngine::scan(), and SWGSDRangel::SWGDVSerialDevices::setNbDevices().

658 {
659  (void) error;
660  response.init();
661 
662  std::vector<std::string> deviceNames;
663  std::vector<QString> qDeviceNames;
664  m_mainWindow.m_dspEngine->getAMBEEngine()->scan(qDeviceNames);
665 
666  for (std::vector<QString>::const_iterator it = qDeviceNames.begin(); it != qDeviceNames.end(); ++it) {
667  deviceNames.push_back(it->toStdString());
668  }
669 
670  response.setNbDevices((int) deviceNames.size());
671  QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
672 
673  std::vector<std::string>::iterator it = deviceNames.begin();
674 
675  while (it != deviceNames.end())
676  {
677  deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
678  deviceNamesList->back()->init();
679  *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
680  ++it;
681  }
682 
683  return 200;
684 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
void scan(std::vector< QString > &ambeDevices)
Definition: ambeengine.cpp:191
AMBEEngine * getAMBEEngine()
Definition: dspengine.h:56
QList< SWGDVSerialDevice * > * getDvSerialDevices()
void setNbDevices(qint32 nb_devices)
+ Here is the call graph for this function:

◆ instanceAudioGet()

int WebAPIAdapterGUI::instanceAudioGet ( SWGSDRangel::SWGAudioDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 293 of file webapiadaptergui.cpp.

References AudioDeviceManager::OutputDeviceInfo::copyToUDP, DSPEngine::getAudioDeviceManager(), AudioDeviceManager::getInputDeviceInfo(), SWGSDRangel::SWGAudioDevices::getInputDevices(), AudioDeviceManager::getInputDevices(), AudioDeviceManager::getOutputDeviceInfo(), SWGSDRangel::SWGAudioDevices::getOutputDevices(), AudioDeviceManager::getOutputDevices(), i, SWGSDRangel::SWGAudioDevices::init(), AudioDeviceManager::m_defaultDeviceName, MainWindow::m_dspEngine, m_mainWindow, AudioDeviceManager::InputDeviceInfo::resetToDefaults(), AudioDeviceManager::OutputDeviceInfo::resetToDefaults(), AudioDeviceManager::InputDeviceInfo::sampleRate, AudioDeviceManager::OutputDeviceInfo::sampleRate, SWGSDRangel::SWGAudioDevices::setNbInputDevices(), SWGSDRangel::SWGAudioDevices::setNbOutputDevices(), AudioDeviceManager::OutputDeviceInfo::udpAddress, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, AudioDeviceManager::OutputDeviceInfo::udpPort, AudioDeviceManager::OutputDeviceInfo::udpUseRTP, and AudioDeviceManager::InputDeviceInfo::volume.

296 {
297  (void) error;
298  const QList<QAudioDeviceInfo>& audioInputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDevices();
299  const QList<QAudioDeviceInfo>& audioOutputDevices = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDevices();
300  int nbInputDevices = audioInputDevices.size();
301  int nbOutputDevices = audioOutputDevices.size();
302 
303  response.init();
304  response.setNbInputDevices(nbInputDevices);
305  response.setNbOutputDevices(nbOutputDevices);
306  QList<SWGSDRangel::SWGAudioInputDevice*> *inputDevices = response.getInputDevices();
307  QList<SWGSDRangel::SWGAudioOutputDevice*> *outputDevices = response.getOutputDevices();
308  AudioDeviceManager::InputDeviceInfo inputDeviceInfo;
309  AudioDeviceManager::OutputDeviceInfo outputDeviceInfo;
310 
311  // system default input device
312  inputDevices->append(new SWGSDRangel::SWGAudioInputDevice);
313  inputDevices->back()->init();
315  *inputDevices->back()->getName() = AudioDeviceManager::m_defaultDeviceName;
316  inputDevices->back()->setIndex(-1);
317  inputDevices->back()->setSampleRate(inputDeviceInfo.sampleRate);
318  inputDevices->back()->setIsSystemDefault(0);
319  inputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
320  inputDevices->back()->setVolume(inputDeviceInfo.volume);
321 
322  // real input devices
323  for (int i = 0; i < nbInputDevices; i++)
324  {
325  inputDevices->append(new SWGSDRangel::SWGAudioInputDevice);
326  inputDevices->back()->init();
327  inputDeviceInfo.resetToDefaults();
328  found = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceInfo(audioInputDevices.at(i).deviceName(), inputDeviceInfo);
329  *inputDevices->back()->getName() = audioInputDevices.at(i).deviceName();
330  inputDevices->back()->setIndex(i);
331  inputDevices->back()->setSampleRate(inputDeviceInfo.sampleRate);
332  inputDevices->back()->setIsSystemDefault(audioInputDevices.at(i).deviceName() == QAudioDeviceInfo::defaultInputDevice().deviceName() ? 1 : 0);
333  inputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
334  inputDevices->back()->setVolume(inputDeviceInfo.volume);
335  }
336 
337  // system default output device
338  outputDevices->append(new SWGSDRangel::SWGAudioOutputDevice);
339  outputDevices->back()->init();
341  *outputDevices->back()->getName() = AudioDeviceManager::m_defaultDeviceName;
342  outputDevices->back()->setIndex(-1);
343  outputDevices->back()->setSampleRate(outputDeviceInfo.sampleRate);
344  inputDevices->back()->setIsSystemDefault(0);
345  outputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
346  outputDevices->back()->setCopyToUdp(outputDeviceInfo.copyToUDP ? 1 : 0);
347  outputDevices->back()->setUdpUsesRtp(outputDeviceInfo.udpUseRTP ? 1 : 0);
348  outputDevices->back()->setUdpChannelMode((int) outputDeviceInfo.udpChannelMode);
349  outputDevices->back()->setUdpChannelCodec((int) outputDeviceInfo.udpChannelCodec);
350  outputDevices->back()->setUdpDecimationFactor((int) outputDeviceInfo.udpDecimationFactor);
351  *outputDevices->back()->getUdpAddress() = outputDeviceInfo.udpAddress;
352  outputDevices->back()->setUdpPort(outputDeviceInfo.udpPort);
353 
354  // real output devices
355  for (int i = 0; i < nbOutputDevices; i++)
356  {
357  outputDevices->append(new SWGSDRangel::SWGAudioOutputDevice);
358  outputDevices->back()->init();
359  outputDeviceInfo.resetToDefaults();
360  found = m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceInfo(audioOutputDevices.at(i).deviceName(), outputDeviceInfo);
361  *outputDevices->back()->getName() = audioOutputDevices.at(i).deviceName();
362  outputDevices->back()->setIndex(i);
363  outputDevices->back()->setSampleRate(outputDeviceInfo.sampleRate);
364  outputDevices->back()->setIsSystemDefault(audioOutputDevices.at(i).deviceName() == QAudioDeviceInfo::defaultOutputDevice().deviceName() ? 1 : 0);
365  outputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
366  outputDevices->back()->setCopyToUdp(outputDeviceInfo.copyToUDP ? 1 : 0);
367  outputDevices->back()->setUdpUsesRtp(outputDeviceInfo.udpUseRTP ? 1 : 0);
368  outputDevices->back()->setUdpChannelMode((int) outputDeviceInfo.udpChannelMode);
369  outputDevices->back()->setUdpChannelCodec((int) outputDeviceInfo.udpChannelCodec);
370  outputDevices->back()->setUdpDecimationFactor((int) outputDeviceInfo.udpDecimationFactor);
371  *outputDevices->back()->getUdpAddress() = outputDeviceInfo.udpAddress;
372  outputDevices->back()->setUdpPort(outputDeviceInfo.udpPort);
373  }
374 
375  return 200;
376 }
static const QString m_defaultDeviceName
const QList< QAudioDeviceInfo > & getInputDevices() const
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
void setNbOutputDevices(qint32 nb_output_devices)
QList< SWGAudioInputDevice * > * getInputDevices()
AudioOutput::UDPChannelCodec udpChannelCodec
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
int32_t i
Definition: decimators.h:244
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
void setNbInputDevices(qint32 nb_input_devices)
const QList< QAudioDeviceInfo > & getOutputDevices() const
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
AudioOutput::UDPChannelMode udpChannelMode
QList< SWGAudioOutputDevice * > * getOutputDevices()
+ Here is the call graph for this function:

◆ instanceAudioInputCleanupPatch()

int WebAPIAdapterGUI::instanceAudioInputCleanupPatch ( SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/input/cleanup (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 537 of file webapiadaptergui.cpp.

References DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::init(), AudioDeviceManager::inputInfosCleanup(), MainWindow::m_dspEngine, and m_mainWindow.

540 {
541  (void) error;
543 
544  response.init();
545  *response.getMessage() = QString("Unregistered parameters for devices not in list of available input devices for this instance");
546 
547  return 200;
548 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
void inputInfosCleanup()
Remove input info from map for input devices not present.
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
+ Here is the call graph for this function:

◆ instanceAudioInputDelete()

int WebAPIAdapterGUI::instanceAudioInputDelete ( SWGSDRangel::SWGAudioInputDevice response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/input/parameters (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 477 of file webapiadaptergui.cpp.

References DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGAudioInputDevice::getIndex(), AudioDeviceManager::getInputDeviceInfo(), AudioDeviceManager::getInputDeviceName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_dspEngine, m_mainWindow, AudioDeviceManager::InputDeviceInfo::sampleRate, SWGSDRangel::SWGAudioInputDevice::setSampleRate(), SWGSDRangel::SWGAudioInputDevice::setVolume(), AudioDeviceManager::unsetInputDeviceInfo(), and AudioDeviceManager::InputDeviceInfo::volume.

480 {
481  AudioDeviceManager::InputDeviceInfo inputDeviceInfo;
482  QString deviceName;
483  int deviceIndex = response.getIndex();
484 
485  if (!m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceName(deviceIndex, deviceName))
486  {
487  error.init();
488  *error.getMessage() = QString("There is no audio input device at index %1").arg(deviceIndex);
489  return 404;
490  }
491 
493  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceInfo(deviceName, inputDeviceInfo);
494 
495  response.setSampleRate(inputDeviceInfo.sampleRate);
496  response.setVolume(inputDeviceInfo.volume);
497 
498  return 200;
499 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
bool getInputDeviceName(int inputDeviceIndex, QString &deviceName) const
void setSampleRate(qint32 sample_rate)
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
void unsetInputDeviceInfo(int inputDeviceIndex)
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
+ Here is the call graph for this function:

◆ instanceAudioInputPatch()

int WebAPIAdapterGUI::instanceAudioInputPatch ( SWGSDRangel::SWGAudioInputDevice response,
const QStringList &  audioInputKeys,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/input/parameters (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 378 of file webapiadaptergui.cpp.

References DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGAudioInputDevice::getIndex(), AudioDeviceManager::getInputDeviceInfo(), AudioDeviceManager::getInputDeviceName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGAudioInputDevice::getSampleRate(), SWGSDRangel::SWGAudioInputDevice::getVolume(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_dspEngine, m_mainWindow, AudioDeviceManager::InputDeviceInfo::sampleRate, AudioDeviceManager::setInputDeviceInfo(), SWGSDRangel::SWGAudioInputDevice::setSampleRate(), SWGSDRangel::SWGAudioInputDevice::setVolume(), and AudioDeviceManager::InputDeviceInfo::volume.

382 {
383  // TODO
384  AudioDeviceManager::InputDeviceInfo inputDeviceInfo;
385  QString deviceName;
386  int deviceIndex = response.getIndex();
387 
388  if (!m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceName(deviceIndex, deviceName))
389  {
390  error.init();
391  *error.getMessage() = QString("There is no audio input device at index %1").arg(deviceIndex);
392  return 404;
393  }
394 
395  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceInfo(deviceName, inputDeviceInfo);
396 
397  if (audioInputKeys.contains("sampleRate")) {
398  inputDeviceInfo.sampleRate = response.getSampleRate();
399  }
400  if (audioInputKeys.contains("volume")) {
401  inputDeviceInfo.volume = response.getVolume();
402  }
403 
404  m_mainWindow.m_dspEngine->getAudioDeviceManager()->setInputDeviceInfo(deviceIndex, inputDeviceInfo);
405  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getInputDeviceInfo(deviceName, inputDeviceInfo);
406 
407  response.setSampleRate(inputDeviceInfo.sampleRate);
408  response.setVolume(inputDeviceInfo.volume);
409 
410  return 200;
411 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
bool getInputDeviceName(int inputDeviceIndex, QString &deviceName) const
void setSampleRate(qint32 sample_rate)
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
void setInputDeviceInfo(int inputDeviceIndex, const InputDeviceInfo &deviceInfo)
+ Here is the call graph for this function:

◆ instanceAudioOutputCleanupPatch()

int WebAPIAdapterGUI::instanceAudioOutputCleanupPatch ( SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/output/cleanup (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 550 of file webapiadaptergui.cpp.

References DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::init(), MainWindow::m_dspEngine, m_mainWindow, and AudioDeviceManager::outputInfosCleanup().

553 {
554  (void) error;
556 
557  response.init();
558  *response.getMessage() = QString("Unregistered parameters for devices not in list of available output devices for this instance");
559 
560  return 200;
561 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
void outputInfosCleanup()
Remove output info from map for output devices not present.
MainWindow & m_mainWindow
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
+ Here is the call graph for this function:

◆ instanceAudioOutputDelete()

int WebAPIAdapterGUI::instanceAudioOutputDelete ( SWGSDRangel::SWGAudioOutputDevice response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/output/paramaters (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 501 of file webapiadaptergui.cpp.

References AudioDeviceManager::OutputDeviceInfo::copyToUDP, DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGAudioOutputDevice::getIndex(), SWGSDRangel::SWGErrorResponse::getMessage(), AudioDeviceManager::getOutputDeviceInfo(), AudioDeviceManager::getOutputDeviceName(), SWGSDRangel::SWGAudioOutputDevice::getUdpAddress(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_dspEngine, m_mainWindow, AudioDeviceManager::OutputDeviceInfo::sampleRate, SWGSDRangel::SWGAudioOutputDevice::setCopyToUdp(), SWGSDRangel::SWGAudioOutputDevice::setSampleRate(), SWGSDRangel::SWGAudioOutputDevice::setUdpAddress(), SWGSDRangel::SWGAudioOutputDevice::setUdpChannelCodec(), SWGSDRangel::SWGAudioOutputDevice::setUdpChannelMode(), SWGSDRangel::SWGAudioOutputDevice::setUdpDecimationFactor(), SWGSDRangel::SWGAudioOutputDevice::setUdpPort(), SWGSDRangel::SWGAudioOutputDevice::setUdpUsesRtp(), AudioDeviceManager::OutputDeviceInfo::udpAddress, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, AudioDeviceManager::OutputDeviceInfo::udpPort, AudioDeviceManager::OutputDeviceInfo::udpUseRTP, and AudioDeviceManager::unsetInputDeviceInfo().

504 {
505  AudioDeviceManager::OutputDeviceInfo outputDeviceInfo;
506  QString deviceName;
507  int deviceIndex = response.getIndex();
508 
509  if (!m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceName(deviceIndex, deviceName))
510  {
511  error.init();
512  *error.getMessage() = QString("There is no audio output device at index %1").arg(deviceIndex);
513  return 404;
514  }
515 
517  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceInfo(deviceName, outputDeviceInfo);
518 
519  response.setSampleRate(outputDeviceInfo.sampleRate);
520  response.setCopyToUdp(outputDeviceInfo.copyToUDP == 0 ? 0 : 1);
521  response.setUdpUsesRtp(outputDeviceInfo.udpUseRTP == 0 ? 0 : 1);
522  response.setUdpChannelMode(outputDeviceInfo.udpChannelMode);
523  response.setUdpChannelCodec(outputDeviceInfo.udpChannelCodec);
524  response.setUdpDecimationFactor(outputDeviceInfo.udpDecimationFactor);
525 
526  if (response.getUdpAddress()) {
527  *response.getUdpAddress() = outputDeviceInfo.udpAddress;
528  } else {
529  response.setUdpAddress(new QString(outputDeviceInfo.udpAddress));
530  }
531 
532  response.setUdpPort(outputDeviceInfo.udpPort % (1<<16));
533 
534  return 200;
535 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
AudioOutput::UDPChannelCodec udpChannelCodec
void setUdpAddress(QString *udp_address)
void setUdpDecimationFactor(qint32 udp_decimation_factor)
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
bool getOutputDeviceName(int outputDeviceIndex, QString &deviceName) const
void unsetInputDeviceInfo(int inputDeviceIndex)
void setUdpChannelCodec(qint32 udp_channel_codec)
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
AudioOutput::UDPChannelMode udpChannelMode
void setUdpUsesRtp(qint32 udp_uses_rtp)
void setUdpChannelMode(qint32 udp_channel_mode)
+ Here is the call graph for this function:

◆ instanceAudioOutputPatch()

int WebAPIAdapterGUI::instanceAudioOutputPatch ( SWGSDRangel::SWGAudioOutputDevice response,
const QStringList &  audioOutputKeys,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/audio/output/parameters (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 413 of file webapiadaptergui.cpp.

References AudioDeviceManager::OutputDeviceInfo::copyToUDP, DSPEngine::getAudioDeviceManager(), SWGSDRangel::SWGAudioOutputDevice::getCopyToUdp(), SWGSDRangel::SWGAudioOutputDevice::getIndex(), SWGSDRangel::SWGErrorResponse::getMessage(), AudioDeviceManager::getOutputDeviceInfo(), AudioDeviceManager::getOutputDeviceName(), SWGSDRangel::SWGAudioOutputDevice::getSampleRate(), SWGSDRangel::SWGAudioOutputDevice::getUdpAddress(), SWGSDRangel::SWGAudioOutputDevice::getUdpChannelCodec(), SWGSDRangel::SWGAudioOutputDevice::getUdpChannelMode(), SWGSDRangel::SWGAudioOutputDevice::getUdpDecimationFactor(), SWGSDRangel::SWGAudioOutputDevice::getUdpPort(), SWGSDRangel::SWGAudioOutputDevice::getUdpUsesRtp(), SWGSDRangel::SWGErrorResponse::init(), MainWindow::m_dspEngine, m_mainWindow, AudioDeviceManager::OutputDeviceInfo::sampleRate, SWGSDRangel::SWGAudioOutputDevice::setCopyToUdp(), AudioDeviceManager::setOutputDeviceInfo(), SWGSDRangel::SWGAudioOutputDevice::setSampleRate(), SWGSDRangel::SWGAudioOutputDevice::setUdpAddress(), SWGSDRangel::SWGAudioOutputDevice::setUdpChannelCodec(), SWGSDRangel::SWGAudioOutputDevice::setUdpChannelMode(), SWGSDRangel::SWGAudioOutputDevice::setUdpDecimationFactor(), SWGSDRangel::SWGAudioOutputDevice::setUdpPort(), SWGSDRangel::SWGAudioOutputDevice::setUdpUsesRtp(), AudioDeviceManager::OutputDeviceInfo::udpAddress, AudioDeviceManager::OutputDeviceInfo::udpChannelCodec, AudioDeviceManager::OutputDeviceInfo::udpChannelMode, AudioDeviceManager::OutputDeviceInfo::udpDecimationFactor, AudioDeviceManager::OutputDeviceInfo::udpPort, and AudioDeviceManager::OutputDeviceInfo::udpUseRTP.

417 {
418  AudioDeviceManager::OutputDeviceInfo outputDeviceInfo;
419  QString deviceName;
420  int deviceIndex = response.getIndex();
421 
422  if (!m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceName(deviceIndex, deviceName))
423  {
424  error.init();
425  *error.getMessage() = QString("There is no audio output device at index %1").arg(deviceIndex);
426  return 404;
427  }
428 
429  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceInfo(deviceName, outputDeviceInfo);
430 
431  if (audioOutputKeys.contains("sampleRate")) {
432  outputDeviceInfo.sampleRate = response.getSampleRate();
433  }
434  if (audioOutputKeys.contains("copyToUDP")) {
435  outputDeviceInfo.copyToUDP = response.getCopyToUdp() == 0 ? 0 : 1;
436  }
437  if (audioOutputKeys.contains("udpUsesRTP")) {
438  outputDeviceInfo.udpUseRTP = response.getUdpUsesRtp() == 0 ? 0 : 1;
439  }
440  if (audioOutputKeys.contains("udpChannelMode")) {
441  outputDeviceInfo.udpChannelMode = static_cast<AudioOutput::UDPChannelMode>(response.getUdpChannelMode());
442  }
443  if (audioOutputKeys.contains("udpChannelCodec")) {
444  outputDeviceInfo.udpChannelCodec = static_cast<AudioOutput::UDPChannelCodec>(response.getUdpChannelCodec());
445  }
446  if (audioOutputKeys.contains("udpDecimatiobFactor")) {
447  outputDeviceInfo.udpDecimationFactor = response.getUdpDecimationFactor();
448  }
449  if (audioOutputKeys.contains("udpAddress")) {
450  outputDeviceInfo.udpAddress = *response.getUdpAddress();
451  }
452  if (audioOutputKeys.contains("udpPort")) {
453  outputDeviceInfo.udpPort = response.getUdpPort() % (1<<16);
454  }
455 
456  m_mainWindow.m_dspEngine->getAudioDeviceManager()->setOutputDeviceInfo(deviceIndex, outputDeviceInfo);
457  m_mainWindow.m_dspEngine->getAudioDeviceManager()->getOutputDeviceInfo(deviceName, outputDeviceInfo);
458 
459  response.setSampleRate(outputDeviceInfo.sampleRate);
460  response.setCopyToUdp(outputDeviceInfo.copyToUDP == 0 ? 0 : 1);
461  response.setUdpUsesRtp(outputDeviceInfo.udpUseRTP == 0 ? 0 : 1);
462  response.setUdpChannelMode(outputDeviceInfo.udpChannelMode);
463  response.setUdpChannelCodec(outputDeviceInfo.udpChannelCodec);
464  response.setUdpDecimationFactor(outputDeviceInfo.udpDecimationFactor);
465 
466  if (response.getUdpAddress()) {
467  *response.getUdpAddress() = outputDeviceInfo.udpAddress;
468  } else {
469  response.setUdpAddress(new QString(outputDeviceInfo.udpAddress));
470  }
471 
472  response.setUdpPort(outputDeviceInfo.udpPort % (1<<16));
473 
474  return 200;
475 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
AudioOutput::UDPChannelCodec udpChannelCodec
void setUdpAddress(QString *udp_address)
void setOutputDeviceInfo(int outputDeviceIndex, const OutputDeviceInfo &deviceInfo)
void setUdpDecimationFactor(qint32 udp_decimation_factor)
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
bool getOutputDeviceName(int outputDeviceIndex, QString &deviceName) const
void setUdpChannelCodec(qint32 udp_channel_codec)
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
AudioOutput::UDPChannelMode udpChannelMode
void setUdpUsesRtp(qint32 udp_uses_rtp)
void setUdpChannelMode(qint32 udp_channel_mode)
+ Here is the call graph for this function:

◆ instanceChannels()

int WebAPIAdapterGUI::instanceChannels ( int  direction,
SWGSDRangel::SWGInstanceChannelsResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/channels (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 190 of file webapiadaptergui.cpp.

References PluginDescriptor::displayedName, SWGSDRangel::SWGInstanceChannelsResponse::getChannels(), PluginInterface::getPluginDescriptor(), PluginManager::getRxChannelRegistrations(), PluginManager::getTxChannelRegistrations(), i, SWGSDRangel::SWGInstanceChannelsResponse::init(), m_mainWindow, MainWindow::m_pluginManager, SWGSDRangel::SWGInstanceChannelsResponse::setChannelcount(), and PluginDescriptor::version.

194 {
195  (void) error;
196  response.init();
197  PluginAPI::ChannelRegistrations *channelRegistrations;
198  int nbChannelDevices;
199 
200  if (direction == 0) // Single sink (Rx) channel
201  {
202  channelRegistrations = m_mainWindow.m_pluginManager->getRxChannelRegistrations();
203  nbChannelDevices = channelRegistrations->size();
204  }
205  else if (direction == 1) // Single source (Tx) channel
206  {
207  channelRegistrations = m_mainWindow.m_pluginManager->getTxChannelRegistrations();
208  nbChannelDevices = channelRegistrations->size();
209  }
210  else // not supported
211  {
212  channelRegistrations = nullptr;
213  nbChannelDevices = 0;
214  }
215 
216  response.setChannelcount(nbChannelDevices);
217  QList<SWGSDRangel::SWGChannelListItem*> *channels = response.getChannels();
218 
219  for (int i = 0; i < nbChannelDevices; i++)
220  {
221  channels->append(new SWGSDRangel::SWGChannelListItem);
222  channels->back()->init();
223  PluginInterface *channelInterface = channelRegistrations->at(i).m_plugin;
224  const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
225  *channels->back()->getVersion() = pluginDescriptor.version;
226  *channels->back()->getName() = pluginDescriptor.displayedName;
227  channels->back()->setDirection(direction);
228  *channels->back()->getIdUri() = channelRegistrations->at(i).m_channelIdURI;
229  *channels->back()->getId() = channelRegistrations->at(i).m_channelId;
230  channels->back()->setIndex(i);
231  }
232 
233  return 200;
234 }
const QString version
QList< ChannelRegistration > ChannelRegistrations
Definition: pluginapi.h:44
const QString displayedName
PluginAPI::ChannelRegistrations * getRxChannelRegistrations()
Definition: pluginmanager.h:74
MainWindow & m_mainWindow
virtual const PluginDescriptor & getPluginDescriptor() const =0
PluginAPI::ChannelRegistrations * getTxChannelRegistrations()
Definition: pluginmanager.h:75
int32_t i
Definition: decimators.h:244
PluginManager * m_pluginManager
Definition: mainwindow.h:313
+ Here is the call graph for this function:

◆ instanceConfigGet()

int WebAPIAdapterGUI::instanceConfigGet ( SWGSDRangel::SWGInstanceConfigResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/config (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceSummary returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 119 of file webapiadaptergui.cpp.

References MainWindow::getMainSettings(), MainSettings::getPreferences(), SWGSDRangel::SWGInstanceConfigResponse::getPreferences(), MainSettings::getPreset(), MainSettings::getPresetCount(), SWGSDRangel::SWGInstanceConfigResponse::getPresets(), SWGSDRangel::SWGInstanceConfigResponse::getWorkingPreset(), MainSettings::getWorkingPresetConst(), i, SWGSDRangel::SWGInstanceConfigResponse::init(), m_mainWindow, MainWindow::m_settings, WebAPIAdapterBase::webapiFormatPreferences(), and WebAPIAdapterBase::webapiFormatPreset().

122 {
123  response.init();
124  SWGSDRangel::SWGPreferences *preferences = response.getPreferences();
126  SWGSDRangel::SWGPreset *workingPreset = response.getWorkingPreset();
128 
129  int nbPresets = m_mainWindow.m_settings.getPresetCount();
130  QList<SWGSDRangel::SWGPreset*> *swgPresets = response.getPresets();
131 
132  for (int i = 0; i < nbPresets; i++)
133  {
134  const Preset *preset = m_mainWindow.m_settings.getPreset(i);
135  swgPresets->append(new SWGSDRangel::SWGPreset);
136  WebAPIAdapterBase::webapiFormatPreset(swgPresets->back(), *preset);
137  }
138 
139  return 200;
140 }
MainWindow & m_mainWindow
const MainSettings & getMainSettings() const
Definition: mainwindow.h:83
int getPresetCount() const
Definition: mainsettings.h:30
Definition: preset.h:28
int32_t i
Definition: decimators.h:244
static void webapiFormatPreferences(SWGSDRangel::SWGPreferences *apiPreferences, const Preferences &preferences)
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
const Preferences & getPreferences() const
Definition: mainsettings.h:26
static void webapiFormatPreset(SWGSDRangel::SWGPreset *apiPreset, const Preset &preset)
const Preset & getWorkingPresetConst() const
Definition: mainsettings.h:46
+ Here is the call graph for this function:

◆ instanceDelete()

int WebAPIAdapterGUI::instanceDelete ( SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceSummary returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 110 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGErrorResponse::getMessage().

113 {
114  (void) response;
115  *error.getMessage() = QString("Not supported in GUI instance");
116  return 400;
117 }
+ Here is the call graph for this function:

◆ instanceDevices()

int WebAPIAdapterGUI::instanceDevices ( int  direction,
SWGSDRangel::SWGInstanceDevicesResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/devices (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceDevices returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 142 of file webapiadaptergui.cpp.

References PluginInterface::SamplingDevice::claimed, PluginInterface::SamplingDevice::deviceNbItems, PluginInterface::SamplingDevice::displayedName, SWGSDRangel::SWGInstanceDevicesResponse::getDevices(), DeviceEnumerator::getNbRxSamplingDevices(), DeviceEnumerator::getNbTxSamplingDevices(), DeviceEnumerator::getRxSamplingDevice(), DeviceEnumerator::getTxSamplingDevice(), PluginInterface::SamplingDevice::hardwareId, i, SWGSDRangel::SWGInstanceDevicesResponse::init(), DeviceEnumerator::instance(), PluginInterface::SamplingDevice::sequence, PluginInterface::SamplingDevice::serial, SWGSDRangel::SWGInstanceDevicesResponse::setDevicecount(), and PluginInterface::SamplingDevice::streamType.

146 {
147  (void) error;
148  response.init();
149 
150  int nbSamplingDevices;
151 
152  if (direction == 0) { // Single Rx stream device
153  nbSamplingDevices = DeviceEnumerator::instance()->getNbRxSamplingDevices();
154  } else if (direction == 1) { // Single Tx stream device
155  nbSamplingDevices = DeviceEnumerator::instance()->getNbTxSamplingDevices();
156  } else { // not supported
157  nbSamplingDevices = 0;
158  }
159 
160  response.setDevicecount(nbSamplingDevices);
161  QList<SWGSDRangel::SWGDeviceListItem*> *devices = response.getDevices();
162 
163  for (int i = 0; i < nbSamplingDevices; i++)
164  {
165  const PluginInterface::SamplingDevice *samplingDevice = nullptr;
166 
167  if (direction == 0) {
168  samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(i);
169  } else if (direction == 1) {
170  samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(i);
171  } else {
172  continue;
173  }
174 
175  devices->append(new SWGSDRangel::SWGDeviceListItem);
176  devices->back()->init();
177  *devices->back()->getDisplayedName() = samplingDevice->displayedName;
178  *devices->back()->getHwType() = samplingDevice->hardwareId;
179  *devices->back()->getSerial() = samplingDevice->serial;
180  devices->back()->setSequence(samplingDevice->sequence);
181  devices->back()->setDirection((int) samplingDevice->streamType);
182  devices->back()->setDeviceNbStreams(samplingDevice->deviceNbItems);
183  devices->back()->setDeviceSetIndex(samplingDevice->claimed);
184  devices->back()->setIndex(i);
185  }
186 
187  return 200;
188 }
int sequence
The device sequence. >0 when more than one device of the same type is connected.
QString displayedName
The human readable name.
QString hardwareId
The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
int deviceNbItems
Number of items (or streams) in the device. >1 for composite devices.
int32_t i
Definition: decimators.h:244
int claimed
This is the device set index if claimed else -1.
QString serial
The device serial number defined by the vendor or a fake one (SDRplay)
int getNbRxSamplingDevices() const
const PluginInterface::SamplingDevice * getTxSamplingDevice(int deviceIndex) const
const PluginInterface::SamplingDevice * getRxSamplingDevice(int deviceIndex) const
StreamType streamType
This is the type of stream supported.
static DeviceEnumerator * instance()
int getNbTxSamplingDevices() const
+ Here is the call graph for this function:

◆ instanceDeviceSetDelete()

int WebAPIAdapterGUI::instanceDeviceSetDelete ( SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1045 of file webapiadaptergui.cpp.

References MainWindow::MsgRemoveLastDeviceSet::create(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGSuccessResponse::init(), MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, and MessageQueue::push().

1048 {
1049  if (m_mainWindow.m_deviceUIs.size() > 1)
1050  {
1053 
1054  response.init();
1055  *response.getMessage() = QString("Message to remove last device set (MsgRemoveLastDeviceSet) was submitted successfully");
1056 
1057  return 202;
1058  }
1059  else
1060  {
1061  error.init();
1062  *error.getMessage() = "No more device sets to be removed";
1063 
1064  return 404;
1065  }
1066 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
MainWindow & m_mainWindow
static MsgRemoveLastDeviceSet * create()
Definition: mainwindow.h:183
+ Here is the call graph for this function:

◆ instanceDeviceSetPost()

int WebAPIAdapterGUI::instanceDeviceSetPost ( int  direction,
SWGSDRangel::SWGSuccessResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/deviceset (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1030 of file webapiadaptergui.cpp.

References MainWindow::MsgAddDeviceSet::create(), SWGSDRangel::SWGSuccessResponse::getMessage(), SWGSDRangel::SWGSuccessResponse::init(), MainWindow::m_inputMessageQueue, m_mainWindow, and MessageQueue::push().

1034 {
1035  (void) error;
1038 
1039  response.init();
1040  *response.getMessage() = QString("Message to add a new device set (MsgAddDeviceSet) was submitted successfully");
1041 
1042  return 202;
1043 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MainWindow & m_mainWindow
static MsgAddDeviceSet * create(int direction)
Definition: mainwindow.h:165
+ Here is the call graph for this function:

◆ instanceDeviceSetsGet()

int WebAPIAdapterGUI::instanceDeviceSetsGet ( SWGSDRangel::SWGDeviceSetList response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/devicesets (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 1021 of file webapiadaptergui.cpp.

References getDeviceSetList().

1024 {
1025  (void) error;
1026  getDeviceSetList(&response);
1027  return 200;
1028 }
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList *deviceSetList)
+ Here is the call graph for this function:

◆ instanceDVSerialGet()

int WebAPIAdapterGUI::instanceDVSerialGet ( SWGSDRangel::SWGDVSerialDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Definition at line 595 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGDVSerialDevices::getDvSerialDevices(), DSPEngine::getDVSerialNames(), SWGSDRangel::SWGDVSerialDevices::init(), MainWindow::m_dspEngine, m_mainWindow, and SWGSDRangel::SWGDVSerialDevices::setNbDevices().

598 {
599  (void) error;
600  response.init();
601 
602  std::vector<std::string> deviceNames;
604  response.setNbDevices((int) deviceNames.size());
605  QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
606 
607  std::vector<std::string>::iterator it = deviceNames.begin();
608 
609  while (it != deviceNames.end())
610  {
611  deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
612  deviceNamesList->back()->init();
613  *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
614  ++it;
615  }
616 
617  return 200;
618 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
MainWindow & m_mainWindow
void getDVSerialNames(std::vector< std::string > &deviceNames)
Definition: dspengine.cpp:166
QList< SWGDVSerialDevice * > * getDvSerialDevices()
void setNbDevices(qint32 nb_devices)
+ Here is the call graph for this function:

◆ instanceDVSerialPatch()

int WebAPIAdapterGUI::instanceDVSerialPatch ( bool  dvserial,
SWGSDRangel::SWGDVSerialDevices response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Definition at line 620 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGDVSerialDevices::getDvSerialDevices(), DSPEngine::getDVSerialNames(), SWGSDRangel::SWGDVSerialDevices::init(), MainWindow::m_dspEngine, m_mainWindow, DSPEngine::setDVSerialSupport(), SWGSDRangel::SWGDVSerialDevices::setNbDevices(), and MainWindow::ui.

624 {
625  (void) error;
627  m_mainWindow.ui->action_DV_Serial->setChecked(dvserial);
628  response.init();
629 
630  if (dvserial)
631  {
632  std::vector<std::string> deviceNames;
634  response.setNbDevices((int) deviceNames.size());
635  QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
636 
637  std::vector<std::string>::iterator it = deviceNames.begin();
638 
639  while (it != deviceNames.end())
640  {
641  deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
642  deviceNamesList->back()->init();
643  *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
644  ++it;
645  }
646  }
647  else
648  {
649  response.setNbDevices(0);
650  }
651 
652  return 200;
653 }
DSPEngine * m_dspEngine
Definition: mainwindow.h:312
Ui::MainWindow * ui
Definition: mainwindow.h:305
MainWindow & m_mainWindow
void getDVSerialNames(std::vector< std::string > &deviceNames)
Definition: dspengine.cpp:166
QList< SWGDVSerialDevice * > * getDvSerialDevices()
void setNbDevices(qint32 nb_devices)
void setDVSerialSupport(bool support)
Definition: dspengine.cpp:163
+ Here is the call graph for this function:

◆ instanceLocationGet()

int WebAPIAdapterGUI::instanceLocationGet ( SWGSDRangel::SWGLocationInformation response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/location (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 563 of file webapiadaptergui.cpp.

References MainSettings::getLatitude(), MainSettings::getLongitude(), SWGSDRangel::SWGLocationInformation::init(), m_mainWindow, MainWindow::m_settings, SWGSDRangel::SWGLocationInformation::setLatitude(), and SWGSDRangel::SWGLocationInformation::setLongitude().

566 {
567  (void) error;
568  response.init();
571 
572  return 200;
573 }
float getLatitude() const
Definition: mainsettings.h:55
MainWindow & m_mainWindow
float getLongitude() const
Definition: mainsettings.h:56
MainSettings m_settings
Definition: mainwindow.h:307
+ Here is the call graph for this function:

◆ instanceLocationPut()

int WebAPIAdapterGUI::instanceLocationPut ( SWGSDRangel::SWGLocationInformation response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/location (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 575 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGLocationInformation::getLatitude(), MainSettings::getLatitude(), SWGSDRangel::SWGLocationInformation::getLongitude(), MainSettings::getLongitude(), m_mainWindow, MainWindow::m_settings, SWGSDRangel::SWGLocationInformation::setLatitude(), MainSettings::setLatitude(), SWGSDRangel::SWGLocationInformation::setLongitude(), and MainSettings::setLongitude().

578 {
579  (void) error;
580  float latitude = response.getLatitude();
581  float longitude = response.getLongitude();
582 
583  latitude = latitude < -90.0 ? -90.0 : latitude > 90.0 ? 90.0 : latitude;
584  longitude = longitude < -180.0 ? -180.0 : longitude > 180.0 ? 180.0 : longitude;
585 
588 
591 
592  return 200;
593 }
float getLatitude() const
Definition: mainsettings.h:55
MainWindow & m_mainWindow
void setLongitude(float longitude)
Definition: mainsettings.h:54
float getLongitude() const
Definition: mainsettings.h:56
MainSettings m_settings
Definition: mainwindow.h:307
void setLatitude(float latitude)
Definition: mainsettings.h:53
+ Here is the call graph for this function:

◆ instanceLoggingGet()

int WebAPIAdapterGUI::instanceLoggingGet ( SWGSDRangel::SWGLoggingInfo response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/logging (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 236 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGLoggingInfo::getConsoleLevel(), qtwebapp::LoggerWithFile::getConsoleMinMessageLevelStr(), SWGSDRangel::SWGLoggingInfo::getDumpToFile(), SWGSDRangel::SWGLoggingInfo::getFileLevel(), qtwebapp::LoggerWithFile::getFileMinMessageLevelStr(), SWGSDRangel::SWGLoggingInfo::getFileName(), qtwebapp::LoggerWithFile::getLogFileName(), qtwebapp::LoggerWithFile::getUseFileLogger(), SWGSDRangel::SWGLoggingInfo::init(), MainWindow::m_logger, m_mainWindow, and SWGSDRangel::SWGLoggingInfo::setDumpToFile().

239 {
240  (void) error;
241  response.init();
243 
244  if (response.getDumpToFile()) {
247  }
248 
250 
251  return 200;
252 }
bool getUseFileLogger() const
MainWindow & m_mainWindow
qtwebapp::LoggerWithFile * m_logger
Definition: mainwindow.h:328
void getFileMinMessageLevelStr(QString &levelStr)
void getConsoleMinMessageLevelStr(QString &levelStr)
void getLogFileName(QString &fileName)
void setDumpToFile(qint32 dump_to_file)
+ Here is the call graph for this function:

◆ instanceLoggingPut()

int WebAPIAdapterGUI::instanceLoggingPut ( SWGSDRangel::SWGLoggingInfo query,
SWGSDRangel::SWGLoggingInfo response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/logging (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 254 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGLoggingInfo::getConsoleLevel(), MainSettings::getConsoleMinLogLevel(), SWGSDRangel::SWGLoggingInfo::getDumpToFile(), SWGSDRangel::SWGLoggingInfo::getFileLevel(), MainSettings::getFileMinLogLevel(), SWGSDRangel::SWGLoggingInfo::getFileName(), MainSettings::getLogFileName(), getMsgTypeFromString(), getMsgTypeString(), MainSettings::getUseLogFile(), SWGSDRangel::SWGLoggingInfo::init(), m_mainWindow, MainWindow::m_settings, MainSettings::setConsoleMinLogLevel(), SWGSDRangel::SWGLoggingInfo::setDumpToFile(), MainSettings::setFileMinLogLevel(), MainSettings::setLogFileName(), MainWindow::setLoggingOptions(), and MainSettings::setUseLogFile().

258 {
259  (void) error;
260  // response input is the query actually
261  bool dumpToFile = (query.getDumpToFile() != 0);
262  QString* consoleLevel = query.getConsoleLevel();
263  QString* fileLevel = query.getFileLevel();
264  QString* fileName = query.getFileName();
265 
266  // perform actions
267  if (consoleLevel) {
269  }
270 
271  if (fileLevel) {
273  }
274 
276 
277  if (fileName) {
279  }
280 
282 
283  // build response
284  response.init();
289 
290  return 200;
291 }
const QString & getLogFileName() const
Definition: mainsettings.h:65
void setLoggingOptions()
bool getUseLogFile() const
Definition: mainsettings.h:64
MainWindow & m_mainWindow
void setConsoleMinLogLevel(const QtMsgType &minLogLevel)
Definition: mainsettings.h:58
QtMsgType getFileMinLogLevel() const
Definition: mainsettings.h:63
void setFileMinLogLevel(const QtMsgType &minLogLevel)
Definition: mainsettings.h:59
void setUseLogFile(bool useLogFile)
Definition: mainsettings.h:60
MainSettings m_settings
Definition: mainwindow.h:307
static void getMsgTypeString(const QtMsgType &msgType, QString &level)
static QtMsgType getMsgTypeFromString(const QString &msgTypeString)
QtMsgType getConsoleMinLogLevel() const
Definition: mainsettings.h:62
void setLogFileName(const QString &value)
Definition: mainsettings.h:61
void setDumpToFile(qint32 dump_to_file)
+ Here is the call graph for this function:

◆ instancePresetDelete()

int WebAPIAdapterGUI::instancePresetDelete ( SWGSDRangel::SWGPresetIdentifier response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/preset (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 991 of file webapiadaptergui.cpp.

References arg(), MainWindow::MsgDeletePreset::create(), SWGSDRangel::SWGPresetIdentifier::getCenterFrequency(), Preset::getCenterFrequency(), Preset::getDescription(), Preset::getGroup(), SWGSDRangel::SWGPresetIdentifier::getGroupName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGPresetIdentifier::getName(), MainSettings::getPreset(), SWGSDRangel::SWGPresetIdentifier::getType(), Preset::isSourcePreset(), MainWindow::m_inputMessageQueue, m_mainWindow, MainWindow::m_settings, MessageQueue::push(), and SWGSDRangel::SWGPresetIdentifier::setCenterFrequency().

994 {
995  const Preset *selectedPreset = m_mainWindow.m_settings.getPreset(*response.getGroupName(),
996  response.getCenterFrequency(),
997  *response.getName(),
998  *response.getType());
999 
1000  if (selectedPreset == 0)
1001  {
1002  *error.getMessage() = QString("There is no preset [%1, %2, %3 %4]")
1003  .arg(*response.getGroupName())
1004  .arg(response.getCenterFrequency())
1005  .arg(*response.getName())
1006  .arg(*response.getType());
1007  return 404;
1008  }
1009 
1010  response.setCenterFrequency(selectedPreset->getCenterFrequency());
1011  *response.getGroupName() = selectedPreset->getGroup();
1012  *response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
1013  *response.getName() = selectedPreset->getDescription();
1014 
1015  MainWindow::MsgDeletePreset *msg = MainWindow::MsgDeletePreset::create(const_cast<Preset*>(selectedPreset));
1017 
1018  return 202;
1019 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
quint64 getCenterFrequency() const
Definition: preset.h:76
MainWindow & m_mainWindow
bool isSourcePreset() const
Definition: preset.h:66
static MsgDeletePreset * create(const Preset *preset)
Definition: mainwindow.h:145
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Definition: preset.h:28
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
void setCenterFrequency(qint64 center_frequency)
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:

◆ instancePresetPatch()

int WebAPIAdapterGUI::instancePresetPatch ( SWGSDRangel::SWGPresetTransfer query,
SWGSDRangel::SWGPresetIdentifier response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/preset (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 808 of file webapiadaptergui.cpp.

References arg(), MainWindow::MsgLoadPreset::create(), SWGSDRangel::SWGPresetIdentifier::getCenterFrequency(), Preset::getCenterFrequency(), Preset::getDescription(), SWGSDRangel::SWGPresetTransfer::getDeviceSetIndex(), Preset::getGroup(), SWGSDRangel::SWGPresetIdentifier::getGroupName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGPresetIdentifier::getName(), MainSettings::getPreset(), SWGSDRangel::SWGPresetTransfer::getPreset(), SWGSDRangel::SWGPresetIdentifier::getType(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGPresetIdentifier::init(), Preset::isSourcePreset(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, MainWindow::m_settings, MessageQueue::push(), and SWGSDRangel::SWGPresetIdentifier::setCenterFrequency().

812 {
813  int deviceSetIndex = query.getDeviceSetIndex();
814  SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
815  int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
816 
817  if (deviceSetIndex >= nbDeviceSets)
818  {
819  error.init();
820  *error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
821  return 404;
822  }
823 
824  const Preset *selectedPreset = m_mainWindow.m_settings.getPreset(*presetIdentifier->getGroupName(),
825  presetIdentifier->getCenterFrequency(),
826  *presetIdentifier->getName(),
827  *presetIdentifier->getType());
828 
829  if (selectedPreset == 0)
830  {
831  error.init();
832  *error.getMessage() = QString("There is no preset [%1, %2, %3 %4]")
833  .arg(*presetIdentifier->getGroupName())
834  .arg(presetIdentifier->getCenterFrequency())
835  .arg(*presetIdentifier->getName())
836  .arg(*presetIdentifier->getType());
837  return 404;
838  }
839 
840  DeviceUISet *deviceUI = m_mainWindow.m_deviceUIs[deviceSetIndex];
841 
842  if (deviceUI->m_deviceSourceEngine && !selectedPreset->isSourcePreset())
843  {
844  error.init();
845  *error.getMessage() = QString("Preset type (T) and device set type (Rx) mismatch");
846  return 404;
847  }
848 
849  if (deviceUI->m_deviceSinkEngine && selectedPreset->isSourcePreset())
850  {
851  error.init();
852  *error.getMessage() = QString("Preset type (R) and device set type (Tx) mismatch");
853  return 404;
854  }
855 
856  MainWindow::MsgLoadPreset *msg = MainWindow::MsgLoadPreset::create(selectedPreset, deviceSetIndex);
858 
859  response.init();
860  response.setCenterFrequency(selectedPreset->getCenterFrequency());
861  *response.getGroupName() = selectedPreset->getGroup();
862  *response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
863  *response.getName() = selectedPreset->getDescription();
864 
865  return 202;
866 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
static MsgLoadPreset * create(const Preset *preset, int deviceSetIndex)
Definition: mainwindow.h:97
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
quint64 getCenterFrequency() const
Definition: preset.h:76
MainWindow & m_mainWindow
bool isSourcePreset() const
Definition: preset.h:66
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
SWGPresetIdentifier * getPreset()
Definition: preset.h:28
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
void setCenterFrequency(qint64 center_frequency)
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:

◆ instancePresetPost()

int WebAPIAdapterGUI::instancePresetPost ( SWGSDRangel::SWGPresetTransfer query,
SWGSDRangel::SWGPresetIdentifier response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/preset (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 930 of file webapiadaptergui.cpp.

References arg(), MainWindow::MsgSavePreset::create(), DeviceSampleSink::getCenterFrequency(), DeviceSampleSource::getCenterFrequency(), Preset::getCenterFrequency(), Preset::getDescription(), SWGSDRangel::SWGPresetTransfer::getDeviceSetIndex(), Preset::getGroup(), SWGSDRangel::SWGPresetIdentifier::getGroupName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGPresetIdentifier::getName(), MainSettings::getPreset(), SWGSDRangel::SWGPresetTransfer::getPreset(), DSPDeviceSinkEngine::getSink(), DSPDeviceSourceEngine::getSource(), SWGSDRangel::SWGPresetIdentifier::getType(), SWGSDRangel::SWGPresetIdentifier::init(), SWGSDRangel::SWGErrorResponse::init(), Preset::isSourcePreset(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, MainWindow::m_settings, MainSettings::newPreset(), MessageQueue::push(), and SWGSDRangel::SWGPresetIdentifier::setCenterFrequency().

934 {
935  int deviceSetIndex = query.getDeviceSetIndex();
936  SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
937  int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
938 
939  if (deviceSetIndex >= nbDeviceSets)
940  {
941  error.init();
942  *error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
943  return 404;
944  }
945 
946  DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
947  int deviceCenterFrequency = 0;
948 
949  if (deviceSet->m_deviceSourceEngine) { // Rx
950  deviceCenterFrequency = deviceSet->m_deviceSourceEngine->getSource()->getCenterFrequency();
951  } else if (deviceSet->m_deviceSinkEngine) { // Tx
952  deviceCenterFrequency = deviceSet->m_deviceSinkEngine->getSink()->getCenterFrequency();
953  } else {
954  error.init();
955  *error.getMessage() = QString("Device set error");
956  return 500;
957  }
958 
959  const Preset *selectedPreset = m_mainWindow.m_settings.getPreset(*presetIdentifier->getGroupName(),
960  deviceCenterFrequency,
961  *presetIdentifier->getName(),
962  *presetIdentifier->getType());
963 
964  if (selectedPreset == 0) // save on a new preset
965  {
966  selectedPreset = m_mainWindow.m_settings.newPreset(*presetIdentifier->getGroupName(), *presetIdentifier->getName());
967  }
968  else
969  {
970  error.init();
971  *error.getMessage() = QString("Preset already exists [%1, %2, %3 %4]")
972  .arg(*presetIdentifier->getGroupName())
973  .arg(deviceCenterFrequency)
974  .arg(*presetIdentifier->getName())
975  .arg(*presetIdentifier->getType());
976  return 409;
977  }
978 
979  MainWindow::MsgSavePreset *msg = MainWindow::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, true);
981 
982  response.init();
983  response.setCenterFrequency(selectedPreset->getCenterFrequency());
984  *response.getGroupName() = selectedPreset->getGroup();
985  *response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
986  *response.getName() = selectedPreset->getDescription();
987 
988  return 202;
989 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
DeviceSampleSink * getSink()
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
quint64 getCenterFrequency() const
Definition: preset.h:76
DeviceSampleSource * getSource()
MainWindow & m_mainWindow
bool isSourcePreset() const
Definition: preset.h:66
Preset * newPreset(const QString &group, const QString &description)
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
SWGPresetIdentifier * getPreset()
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the sink.
Definition: preset.h:28
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
void setCenterFrequency(qint64 center_frequency)
static MsgSavePreset * create(Preset *preset, int deviceSetIndex, bool newPreset)
Definition: mainwindow.h:121
const QString & getDescription() const
Definition: preset.h:74
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the source.
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:

◆ instancePresetPut()

int WebAPIAdapterGUI::instancePresetPut ( SWGSDRangel::SWGPresetTransfer query,
SWGSDRangel::SWGPresetIdentifier response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/preset (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 868 of file webapiadaptergui.cpp.

References arg(), MainWindow::MsgSavePreset::create(), SWGSDRangel::SWGPresetIdentifier::getCenterFrequency(), Preset::getCenterFrequency(), Preset::getDescription(), SWGSDRangel::SWGPresetTransfer::getDeviceSetIndex(), Preset::getGroup(), SWGSDRangel::SWGPresetIdentifier::getGroupName(), SWGSDRangel::SWGErrorResponse::getMessage(), SWGSDRangel::SWGPresetIdentifier::getName(), MainSettings::getPreset(), SWGSDRangel::SWGPresetTransfer::getPreset(), SWGSDRangel::SWGPresetIdentifier::getType(), SWGSDRangel::SWGErrorResponse::init(), SWGSDRangel::SWGPresetIdentifier::init(), Preset::isSourcePreset(), DeviceUISet::m_deviceSinkEngine, DeviceUISet::m_deviceSourceEngine, MainWindow::m_deviceUIs, MainWindow::m_inputMessageQueue, m_mainWindow, MainWindow::m_settings, MessageQueue::push(), and SWGSDRangel::SWGPresetIdentifier::setCenterFrequency().

872 {
873  int deviceSetIndex = query.getDeviceSetIndex();
874  SWGSDRangel::SWGPresetIdentifier *presetIdentifier = query.getPreset();
875  int nbDeviceSets = m_mainWindow.m_deviceUIs.size();
876 
877  if (deviceSetIndex >= nbDeviceSets)
878  {
879  error.init();
880  *error.getMessage() = QString("There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
881  return 404;
882  }
883 
884  const Preset *selectedPreset = m_mainWindow.m_settings.getPreset(*presetIdentifier->getGroupName(),
885  presetIdentifier->getCenterFrequency(),
886  *presetIdentifier->getName(),
887  *presetIdentifier->getType());
888 
889  if (selectedPreset == 0)
890  {
891  error.init();
892  *error.getMessage() = QString("There is no preset [%1, %2, %3 %4]")
893  .arg(*presetIdentifier->getGroupName())
894  .arg(presetIdentifier->getCenterFrequency())
895  .arg(*presetIdentifier->getName())
896  .arg(*presetIdentifier->getType());
897  return 404;
898  }
899  else // update existing preset
900  {
901  DeviceUISet *deviceUI = m_mainWindow.m_deviceUIs[deviceSetIndex];
902 
903  if (deviceUI->m_deviceSourceEngine && !selectedPreset->isSourcePreset())
904  {
905  error.init();
906  *error.getMessage() = QString("Preset type (T) and device set type (Rx) mismatch");
907  return 404;
908  }
909 
910  if (deviceUI->m_deviceSinkEngine && selectedPreset->isSourcePreset())
911  {
912  error.init();
913  *error.getMessage() = QString("Preset type (R) and device set type (Tx) mismatch");
914  return 404;
915  }
916  }
917 
918  MainWindow::MsgSavePreset *msg = MainWindow::MsgSavePreset::create(const_cast<Preset*>(selectedPreset), deviceSetIndex, false);
920 
921  response.init();
922  response.setCenterFrequency(selectedPreset->getCenterFrequency());
923  *response.getGroupName() = selectedPreset->getGroup();
924  *response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
925  *response.getName() = selectedPreset->getDescription();
926 
927  return 202;
928 }
MessageQueue m_inputMessageQueue
Definition: mainwindow.h:306
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::vector< DeviceUISet * > m_deviceUIs
Definition: mainwindow.h:308
quint64 getCenterFrequency() const
Definition: preset.h:76
MainWindow & m_mainWindow
bool isSourcePreset() const
Definition: preset.h:66
DSPDeviceSourceEngine * m_deviceSourceEngine
Definition: deviceuiset.h:49
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
SWGPresetIdentifier * getPreset()
Definition: preset.h:28
DSPDeviceSinkEngine * m_deviceSinkEngine
Definition: deviceuiset.h:50
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
void setCenterFrequency(qint64 center_frequency)
static MsgSavePreset * create(Preset *preset, int deviceSetIndex, bool newPreset)
Definition: mainwindow.h:121
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:

◆ instancePresetsGet()

int WebAPIAdapterGUI::instancePresetsGet ( SWGSDRangel::SWGPresets response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel/presets (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 762 of file webapiadaptergui.cpp.

References Preset::getCenterFrequency(), Preset::getDescription(), Preset::getGroup(), SWGSDRangel::SWGPresets::getGroups(), MainSettings::getPreset(), MainSettings::getPresetCount(), i, SWGSDRangel::SWGPresets::init(), Preset::isSourcePreset(), m_mainWindow, MainWindow::m_settings, and SWGSDRangel::SWGPresets::setNbGroups().

765 {
766  (void) error;
767  int nbPresets = m_mainWindow.m_settings.getPresetCount();
768  int nbGroups = 0;
769  int nbPresetsThisGroup = 0;
770  QString groupName;
771  response.init();
772  QList<SWGSDRangel::SWGPresetGroup*> *groups = response.getGroups();
773  QList<SWGSDRangel::SWGPresetItem*> *swgPresets = 0;
774  int i = 0;
775 
776  // Presets are sorted by group first
777 
778  for (; i < nbPresets; i++)
779  {
780  const Preset *preset = m_mainWindow.m_settings.getPreset(i);
781 
782  if ((i == 0) || (groupName != preset->getGroup())) // new group
783  {
784  if (i > 0) { groups->back()->setNbPresets(nbPresetsThisGroup); }
785  groups->append(new SWGSDRangel::SWGPresetGroup);
786  groups->back()->init();
787  groupName = preset->getGroup();
788  *groups->back()->getGroupName() = groupName;
789  swgPresets = groups->back()->getPresets();
790  nbGroups++;
791  nbPresetsThisGroup = 0;
792  }
793 
794  swgPresets->append(new SWGSDRangel::SWGPresetItem);
795  swgPresets->back()->init();
796  swgPresets->back()->setCenterFrequency(preset->getCenterFrequency());
797  *swgPresets->back()->getType() = preset->isSourcePreset() ? "R" : "T";
798  *swgPresets->back()->getName() = preset->getDescription();
799  nbPresetsThisGroup++;
800  }
801 
802  if (i > 0) { groups->back()->setNbPresets(nbPresetsThisGroup); }
803  response.setNbGroups(nbGroups);
804 
805  return 200;
806 }
quint64 getCenterFrequency() const
Definition: preset.h:76
MainWindow & m_mainWindow
bool isSourcePreset() const
Definition: preset.h:66
QList< SWGPresetGroup * > * getGroups()
Definition: SWGPresets.cpp:113
int getPresetCount() const
Definition: mainsettings.h:30
Definition: preset.h:28
int32_t i
Definition: decimators.h:244
void setNbGroups(qint32 nb_groups)
Definition: SWGPresets.cpp:107
const Preset * getPreset(int index) const
Definition: mainsettings.h:31
MainSettings m_settings
Definition: mainwindow.h:307
const QString & getDescription() const
Definition: preset.h:74
const QString & getGroup() const
Definition: preset.h:72
+ Here is the call graph for this function:

◆ instanceSummary()

int WebAPIAdapterGUI::instanceSummary ( SWGSDRangel::SWGInstanceSummaryResponse response,
SWGSDRangel::SWGErrorResponse error 
)
virtual

Handler of /sdrangel (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceSummary returns the Http status code (default 501: not implemented)

Reimplemented from WebAPIAdapterInterface.

Definition at line 76 of file webapiadaptergui.cpp.

References SWGSDRangel::SWGInstanceSummaryResponse::getAppname(), SWGSDRangel::SWGInstanceSummaryResponse::getArchitecture(), SWGSDRangel::SWGLoggingInfo::getConsoleLevel(), qtwebapp::LoggerWithFile::getConsoleMinMessageLevelStr(), SWGSDRangel::SWGInstanceSummaryResponse::getDevicesetlist(), getDeviceSetList(), SWGSDRangel::SWGLoggingInfo::getDumpToFile(), SWGSDRangel::SWGLoggingInfo::getFileLevel(), qtwebapp::LoggerWithFile::getFileMinMessageLevelStr(), SWGSDRangel::SWGLoggingInfo::getFileName(), qtwebapp::LoggerWithFile::getLogFileName(), SWGSDRangel::SWGInstanceSummaryResponse::getLogging(), SWGSDRangel::SWGInstanceSummaryResponse::getOs(), SWGSDRangel::SWGInstanceSummaryResponse::getQtVersion(), qtwebapp::LoggerWithFile::getUseFileLogger(), SWGSDRangel::SWGInstanceSummaryResponse::getVersion(), SWGSDRangel::SWGLoggingInfo::init(), SWGSDRangel::SWGInstanceSummaryResponse::init(), MainWindow::m_logger, m_mainWindow, SDR_RX_SAMP_SZ, SDR_TX_SAMP_SZ, SWGSDRangel::SWGInstanceSummaryResponse::setDspRxBits(), SWGSDRangel::SWGInstanceSummaryResponse::setDspTxBits(), SWGSDRangel::SWGLoggingInfo::setDumpToFile(), and SWGSDRangel::SWGInstanceSummaryResponse::setPid().

79 {
80  (void) error;
81  response.init();
82  *response.getAppname() = qApp->applicationName();
83  *response.getVersion() = qApp->applicationVersion();
84  *response.getQtVersion() = QString(QT_VERSION_STR);
85  response.setDspRxBits(SDR_RX_SAMP_SZ);
86  response.setDspTxBits(SDR_TX_SAMP_SZ);
87  response.setPid(qApp->applicationPid());
88 #if QT_VERSION >= 0x050400
89  *response.getArchitecture() = QString(QSysInfo::currentCpuArchitecture());
90  *response.getOs() = QString(QSysInfo::prettyProductName());
91 #endif
92 
93  SWGSDRangel::SWGLoggingInfo *logging = response.getLogging();
94  logging->init();
96 
97  if (logging->getDumpToFile()) {
100  }
101 
103 
104  SWGSDRangel::SWGDeviceSetList *deviceSetList = response.getDevicesetlist();
105  getDeviceSetList(deviceSetList);
106 
107  return 200;
108 }
bool getUseFileLogger() const
MainWindow & m_mainWindow
qtwebapp::LoggerWithFile * m_logger
Definition: mainwindow.h:328
#define SDR_RX_SAMP_SZ
Definition: dsptypes.h:32
#define SDR_TX_SAMP_SZ
Definition: dsptypes.h:38
void getFileMinMessageLevelStr(QString &levelStr)
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList *deviceSetList)
void getConsoleMinMessageLevelStr(QString &levelStr)
void getLogFileName(QString &fileName)
void setDumpToFile(qint32 dump_to_file)
+ Here is the call graph for this function:

Member Data Documentation

◆ m_mainWindow

MainWindow& WebAPIAdapterGUI::m_mainWindow
private

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