1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 21:01:45 -05:00

Merge pull request #949 from srcejon/fix_948_basic_settings

Add SatelliteTracker to webapirequestmapper to partially fix #948
This commit is contained in:
Edouard Griffiths 2021-07-02 17:44:15 +02:00 committed by GitHub
commit c3c770050b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -197,3 +197,13 @@ SatNogs satellite database https://db.satnogs.org/
Satellite two-line elements (TLEs) are from Celestrak https://celestrak.com/ Satellite two-line elements (TLEs) are from Celestrak https://celestrak.com/
Icons are by Freepik from Flaticon https://www.flaticon.com/ Icons are by Freepik from Flaticon https://www.flaticon.com/
<h2>API</h2>
Full details of the API can be found in the Swagger documentation. Here is a quick example of how to set the satellites to track:
curl -X PATCH "http://127.0.0.1:8091/sdrangel/featureset/0/feature/0/settings" -d '{"featureType": "SatelliteTracker", "SatelliteTrackerSettings": { "satellites": [ "NOAA 15", "NOAA 19" ] }}'
And how to set the target:
curl -X PATCH "http://127.0.0.1:8091/sdrangel/featureset/0/feature/0/settings" -d '{"featureType": "SatelliteTracker", "SatelliteTrackerSettings": { "target": "NOAA 15" }}'

View File

@ -4465,6 +4465,11 @@ bool WebAPIRequestMapper::getFeatureSettings(
featureSettings->setPerTesterSettings(new SWGSDRangel::SWGPERTesterSettings()); featureSettings->setPerTesterSettings(new SWGSDRangel::SWGPERTesterSettings());
featureSettings->getPerTesterSettings()->fromJsonObject(settingsJsonObject); featureSettings->getPerTesterSettings()->fromJsonObject(settingsJsonObject);
} }
else if (featureSettingsKey == "SatelliteTrackerSettings")
{
featureSettings->setSatelliteTrackerSettings(new SWGSDRangel::SWGSatelliteTrackerSettings());
featureSettings->getSatelliteTrackerSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "SimplePTTSettings") else if (featureSettingsKey == "SimplePTTSettings")
{ {
featureSettings->setSimplePttSettings(new SWGSDRangel::SWGSimplePTTSettings()); featureSettings->setSimplePttSettings(new SWGSDRangel::SWGSimplePTTSettings());
@ -4723,6 +4728,7 @@ void WebAPIRequestMapper::resetFeatureSettings(SWGSDRangel::SWGFeatureSettings&
featureSettings.setGs232ControllerSettings(nullptr); featureSettings.setGs232ControllerSettings(nullptr);
featureSettings.setMapSettings(nullptr); featureSettings.setMapSettings(nullptr);
featureSettings.setPerTesterSettings(nullptr); featureSettings.setPerTesterSettings(nullptr);
featureSettings.setSatelliteTrackerSettings(nullptr);
featureSettings.setSimplePttSettings(nullptr); featureSettings.setSimplePttSettings(nullptr);
featureSettings.setStarTrackerSettings(nullptr); featureSettings.setStarTrackerSettings(nullptr);
featureSettings.setRigCtlServerSettings(nullptr); featureSettings.setRigCtlServerSettings(nullptr);

View File

@ -265,6 +265,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = {
{"GS232Controller", "GS232ControllerSettings"}, {"GS232Controller", "GS232ControllerSettings"},
{"Map", "MapSettings"}, {"Map", "MapSettings"},
{"PERTester", "PERTesterSettings"}, {"PERTester", "PERTesterSettings"},
{"SatelliteTracker", "SatelliteTrackerSettings"},
{"SimplePTT", "SimplePTTSettings"}, {"SimplePTT", "SimplePTTSettings"},
{"StarTracker", "StarTrackerSettings"}, {"StarTracker", "StarTrackerSettings"},
{"RigCtlServer", "RigCtlServerSettings"} {"RigCtlServer", "RigCtlServerSettings"}
@ -282,6 +283,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
{"sdrangel.feature.gs232controller", "GS232ControllerSettings"}, {"sdrangel.feature.gs232controller", "GS232ControllerSettings"},
{"sdrangel.feature.map", "MapSettings"}, {"sdrangel.feature.map", "MapSettings"},
{"sdrangel.feature.pertester", "PERTesterSettings"}, {"sdrangel.feature.pertester", "PERTesterSettings"},
{"sdrangel.feature.satellitetracker", "SatelliteTrackerSettings"},
{"sdrangel.feature.simpleptt", "SimplePTTSettings"}, {"sdrangel.feature.simpleptt", "SimplePTTSettings"},
{"sdrangel.feature.startracker", "StarTrackerSettings"}, {"sdrangel.feature.startracker", "StarTrackerSettings"},
{"sdrangel.feature.rigctlserver", "RigCtlServerSettings"} {"sdrangel.feature.rigctlserver", "RigCtlServerSettings"}