mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Add --start option to start all devices and features. For #2359.
This commit is contained in:
@@ -20,12 +20,42 @@
|
||||
#include "SWGFeatureActions.h"
|
||||
#include "SWGMapActions.h"
|
||||
#include "SWGPERTesterActions.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "maincore.h"
|
||||
#include "feature/featureset.h"
|
||||
#include "feature/feature.h"
|
||||
#include "featurewebapiutils.h"
|
||||
|
||||
// Start feature
|
||||
bool FeatureWebAPIUtils::run(int featureSetIndex, int featureIndex)
|
||||
{
|
||||
Feature *feature = FeatureWebAPIUtils::getFeature(featureSetIndex, featureIndex, "");
|
||||
if (feature != nullptr)
|
||||
{
|
||||
SWGSDRangel::SWGDeviceState runResponse;
|
||||
QString errorResponse;
|
||||
int httpRC;
|
||||
|
||||
runResponse.setState(new QString());
|
||||
httpRC = feature->webapiRun(true, runResponse, errorResponse);
|
||||
|
||||
if (httpRC/100 != 2)
|
||||
{
|
||||
qWarning("FeatureWebAPIUtils::run: run error %d: %s",
|
||||
httpRC, qPrintable(errorResponse));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning("FeatureWebAPIUtils::run: no feature F%d:%d", featureSetIndex, featureIndex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Find the specified target on the map
|
||||
bool FeatureWebAPIUtils::mapFind(const QString& target, int featureSetIndex, int featureIndex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user