Skip to content

Commit

Permalink
Merge pull request #1861 from srcejon/freq_scanner
Browse files Browse the repository at this point in the history
ADSB updates
  • Loading branch information
f4exb authored Oct 28, 2023
2 parents 1d3c366 + 1f055dd commit 9a3e6c6
Show file tree
Hide file tree
Showing 48 changed files with 7,794 additions and 530 deletions.
Binary file modified doc/img/ADSBDemod_plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/ADSBDemod_plugin_displaysettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions plugins/channelrx/demodadsb/adsbdemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "adsbdemodworker.h"

MESSAGE_CLASS_DEFINITION(ADSBDemod::MsgConfigureADSBDemod, Message)
MESSAGE_CLASS_DEFINITION(ADSBDemod::MsgAircraftReport, Message)

const char* const ADSBDemod::m_channelIdURI = "sdrangel.channel.adsbdemod";
const char* const ADSBDemod::m_channelId = "ADSBDemod";
Expand Down Expand Up @@ -186,6 +187,12 @@ bool ADSBDemod::handleMessage(const Message& cmd)

return true;
}
else if (MsgAircraftReport::match(cmd))
{
MsgAircraftReport& msg = (MsgAircraftReport&) cmd;
m_aircraftReport = msg.getReport();
return true;
}
else
{
return false;
Expand Down Expand Up @@ -636,6 +643,19 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons
response.getAdsbDemodReport()->setTargetElevation(m_targetElevation);
response.getAdsbDemodReport()->setTargetRange(m_targetRange);
}

QList<SWGSDRangel::SWGADSBDemodAircraftState *> *list = response.getAdsbDemodReport()->getAircraftState();
for (const auto& report : m_aircraftReport)
{
SWGSDRangel::SWGADSBDemodAircraftState *aircraftState = new SWGSDRangel::SWGADSBDemodAircraftState();
//aircraftState->setIcao(new QString(report.m_icao));
aircraftState->setCallsign(new QString(report.m_callsign));
aircraftState->setLatitude(report.m_latitude);
aircraftState->setLongitude(report.m_longitude);
aircraftState->setAltitude(report.m_altitude);
aircraftState->setGroundSpeed(report.m_groundSpeed);
list->append(aircraftState);
}
}

void ADSBDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ADSBDemodSettings& settings, bool force)
Expand Down
30 changes: 30 additions & 0 deletions plugins/channelrx/demodadsb/adsbdemod.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,35 @@ class ADSBDemod : public BasebandSampleSink, public ChannelAPI {
{ }
};

class MsgAircraftReport : public Message {
MESSAGE_CLASS_DECLARATION

public:

struct AircraftReport {
QString m_icao;
QString m_callsign;
float m_latitude;
float m_longitude;
int m_altitude;
int m_groundSpeed;
};

QList<AircraftReport>& getReport() { return m_report; }

static MsgAircraftReport* create()
{
return new MsgAircraftReport();
}

private:
QList<AircraftReport> m_report;

MsgAircraftReport() :
Message()
{ }
};

ADSBDemod(DeviceAPI *deviceAPI);
virtual ~ADSBDemod();
virtual void destroy() { delete this; }
Expand Down Expand Up @@ -148,6 +177,7 @@ class ADSBDemod : public BasebandSampleSink, public ChannelAPI {
float m_targetElevation;
float m_targetRange;
QString m_targetName;
QList<MsgAircraftReport::AircraftReport> m_aircraftReport;

QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
Expand Down
4 changes: 4 additions & 0 deletions plugins/channelrx/demodadsb/adsbdemoddisplaydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWid
ui->mapProvider->setCurrentText(settings->m_mapProvider);
ui->mapType->setCurrentIndex((int)settings->m_mapType);
ui->navAids->setChecked(settings->m_displayNavAids);
ui->atcCallsigns->setChecked(settings->m_atcCallsigns);
ui->photos->setChecked(settings->m_displayPhotos);
ui->verboseModelMatching->setChecked(settings->m_verboseModelMatching);
ui->airfieldElevation->setValue(settings->m_airfieldElevation);
ui->transitionAltitude->setValue(settings->m_transitionAlt);
}

ADSBDemodDisplayDialog::~ADSBDemodDisplayDialog()
Expand Down Expand Up @@ -83,9 +85,11 @@ void ADSBDemodDisplayDialog::accept()
m_settings->m_mapProvider = ui->mapProvider->currentText();
m_settings->m_mapType = (ADSBDemodSettings::MapType)ui->mapType->currentIndex();
m_settings->m_displayNavAids = ui->navAids->isChecked();
m_settings->m_atcCallsigns = ui->atcCallsigns->isChecked();
m_settings->m_displayPhotos = ui->photos->isChecked();
m_settings->m_verboseModelMatching = ui->verboseModelMatching->isChecked();
m_settings->m_airfieldElevation = ui->airfieldElevation->value();
m_settings->m_transitionAlt = ui->transitionAltitude->value();
m_settings->m_tableFontName = m_fontName;
m_settings->m_tableFontSize = m_fontSize;
QDialog::accept();
Expand Down
Loading

0 comments on commit 9a3e6c6

Please sign in to comment.