1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-20 06:38:36 -04:00

KiwiSDR: Add position of device to web API report.

This commit is contained in:
srcejon
2024-04-04 16:15:41 +01:00
parent 879ce0e17b
commit 35603a8c25
4 changed files with 81 additions and 1 deletions
+17 -1
View File
@@ -49,7 +49,10 @@ KiwiSDRInput::KiwiSDRInput(DeviceAPI *deviceAPI) :
m_kiwiSDRWorkerThread(nullptr),
m_deviceDescription("KiwiSDR"),
m_running(false),
m_masterTimer(deviceAPI->getMasterTimer())
m_masterTimer(deviceAPI->getMasterTimer()),
m_latitude(std::numeric_limits<float>::quiet_NaN()),
m_longitude(std::numeric_limits<float>::quiet_NaN()),
m_altitude(std::numeric_limits<float>::quiet_NaN())
{
m_sampleFifo.setLabel(m_deviceDescription);
m_deviceAPI->setNbSourceStreams(1);
@@ -237,6 +240,16 @@ bool KiwiSDRInput::handleMessage(const Message& message)
return true;
}
else if (KiwiSDRWorker::MsgReportPosition::match(message))
{
KiwiSDRWorker::MsgReportPosition& report = (KiwiSDRWorker::MsgReportPosition&) message;
m_latitude = report.getLatitude();
m_longitude = report.getLongitude();
m_altitude = report.getAltitude();
return true;
}
else if (MsgStartStop::match(message))
{
MsgStartStop& cmd = (MsgStartStop&) message;
@@ -455,6 +468,9 @@ void KiwiSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re
void KiwiSDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
{
response.getKiwiSdrReport()->setStatus(getStatus());
response.getKiwiSdrReport()->setLatitude(m_latitude);
response.getKiwiSdrReport()->setLongitude(m_longitude);
response.getKiwiSdrReport()->setAltitude(m_altitude);
}
void KiwiSDRInput::webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const KiwiSDRSettings& settings, bool force)