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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user