mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
Web API: implemented /sdrangel/deviceset/{deviceSetIndex}/focus PATCH
This commit is contained in:
@@ -92,6 +92,14 @@ int WebAPIAdapterGUI::instanceSummary(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::instanceDelete(
|
||||
SWGSDRangel::SWGInstanceSummaryResponse& response __attribute__((unused)),
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
*error.getMessage() = QString("Not supported in GUI instance");
|
||||
return 400;
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::instanceDevices(
|
||||
bool tx,
|
||||
SWGSDRangel::SWGInstanceDevicesResponse& response,
|
||||
@@ -614,6 +622,30 @@ int WebAPIAdapterGUI::devicesetGet(
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetFocusPatch(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGSuccessResponse& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
MainWindow::MsgDeviceSetFocus *msg = MainWindow::MsgDeviceSetFocus::create(deviceSetIndex);
|
||||
m_mainWindow.m_inputMessageQueue.push(msg);
|
||||
|
||||
response.init();
|
||||
*response.getMessage() = QString("Message to focus on device set (MsgDeviceSetFocus) was submitted successfully");
|
||||
|
||||
return 202;
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user