mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
REST API: implemented GUI code for /sdrangel/deviceset/{deviceSetIndex}/spectrum/settings (GET) and /sdrangel/deviceset/{deviceSetIndex}/spectrum/server (GET)
This commit is contained in:
@@ -1415,6 +1415,46 @@ int WebAPIAdapterGUI::devicesetFocusPatch(
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetSpectrumSettingsGet(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGGLSpectrum& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
const DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
return deviceSet->webapiSpectrumSettingsGet(response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetSpectrumServerGet(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGSpectrumServer& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
const DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
deviceSet->webapiSpectrumServerGet(response, *error.getMessage());
|
||||
|
||||
return 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetDevicePut(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGDeviceListItem& query,
|
||||
|
||||
Reference in New Issue
Block a user