1
0
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:
Jon Beniston
2025-01-20 10:54:21 +00:00
parent 83b36c6aab
commit f841eecab9
6 changed files with 72 additions and 1 deletions
+30
View File
@@ -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)
{