1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-08 00:44:48 -04:00

Plot SID paths on map.

This commit is contained in:
srcejon
2024-04-04 21:41:07 +01:00
parent 35603a8c25
commit 535f5c5e8f
12 changed files with 331 additions and 5 deletions
+29
View File
@@ -1156,6 +1156,35 @@ bool ChannelWebAPIUtils::getDeviceReportList(unsigned int deviceIndex, const QSt
return false;
}
bool ChannelWebAPIUtils::getDevicePosition(unsigned int deviceIndex, QGeoCoordinate& position)
{
SWGSDRangel::SWGDeviceReport deviceReport;
if (getDeviceReport(deviceIndex, deviceReport))
{
QJsonObject *jsonObj = deviceReport.asJsonObject();
double latitude, longitude, altitude;
if (WebAPIUtils::getSubObjectDouble(*jsonObj, "latitude", latitude)
&& WebAPIUtils::getSubObjectDouble(*jsonObj, "longitude", longitude)
&& WebAPIUtils::getSubObjectDouble(*jsonObj, "altitude", altitude))
{
position.setLatitude(latitude);
position.setLongitude(longitude);
position.setAltitude(altitude);
// Done
return true;
}
else
{
//qWarning("ChannelWebAPIUtils::getDevicePosition: no latitude/longitude/altitude in device report");
return false;
}
}
return false;
}
bool ChannelWebAPIUtils::runFeature(unsigned int featureSetIndex, unsigned int featureIndex)
{
SWGSDRangel::SWGDeviceState runResponse;