ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2020 Jon Beniston, M7RCE //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include <QFontDialog>
|
2024-09-17 04:47:45 -04:00
|
|
|
#ifdef QT_LOCATION_FOUND
|
2024-03-12 10:10:56 -04:00
|
|
|
#include <QGeoServiceProvider>
|
2024-09-17 04:47:45 -04:00
|
|
|
#endif
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include "adsbdemoddisplaydialog.h"
|
|
|
|
|
2022-02-04 11:57:45 -05:00
|
|
|
ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWidget* parent) :
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
QDialog(parent),
|
2022-02-04 11:57:45 -05:00
|
|
|
ui(new Ui::ADSBDemodDisplayDialog),
|
|
|
|
m_settings(settings),
|
|
|
|
m_fontName(settings->m_tableFontName),
|
|
|
|
m_fontSize(settings->m_tableFontSize)
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2024-03-12 10:10:56 -04:00
|
|
|
|
2024-09-17 04:47:45 -04:00
|
|
|
#ifdef QT_LOCATION_FOUND
|
2024-03-12 10:10:56 -04:00
|
|
|
QStringList mapProviders = QGeoServiceProvider::availableServiceProviders();
|
|
|
|
if (!mapProviders.contains("osm")) {
|
|
|
|
ui->mapProvider->removeItem(ui->mapProvider->findText("osm"));
|
|
|
|
}
|
|
|
|
if (!mapProviders.contains("mapboxgl")) {
|
|
|
|
ui->mapProvider->removeItem(ui->mapProvider->findText("mapboxgl"));
|
|
|
|
}
|
2024-09-17 04:47:45 -04:00
|
|
|
#else
|
|
|
|
QStringList mapProviders;
|
|
|
|
#endif
|
2024-03-12 10:10:56 -04:00
|
|
|
|
2022-02-04 11:57:45 -05:00
|
|
|
ui->timeout->setValue(settings->m_removeTimeout);
|
2023-02-16 07:20:31 -05:00
|
|
|
ui->aircraftMinZoom->setValue(settings->m_aircraftMinZoom);
|
2022-02-04 11:57:45 -05:00
|
|
|
ui->airportRange->setValue(settings->m_airportRange);
|
|
|
|
ui->airportSize->setCurrentIndex((int)settings->m_airportMinimumSize);
|
|
|
|
ui->heliports->setChecked(settings->m_displayHeliports);
|
|
|
|
ui->units->setCurrentIndex((int)settings->m_siUnits);
|
|
|
|
ui->displayStats->setChecked(settings->m_displayDemodStats);
|
|
|
|
ui->autoResizeTableColumns->setChecked(settings->m_autoResizeTableColumns);
|
2022-06-06 05:53:10 -04:00
|
|
|
ui->aviationstackAPIKey->setText(settings->m_aviationstackAPIKey);
|
|
|
|
ui->checkWXAPIKey->setText(settings->m_checkWXAPIKey);
|
2022-02-04 11:57:45 -05:00
|
|
|
for (const auto& airspace: settings->m_airspaces)
|
2021-11-12 11:51:23 -05:00
|
|
|
{
|
|
|
|
QList<QListWidgetItem *> items = ui->airspaces->findItems(airspace, Qt::MatchExactly);
|
|
|
|
for (const auto& item: items) {
|
|
|
|
item->setCheckState(Qt::Checked);
|
|
|
|
}
|
|
|
|
}
|
2022-02-04 11:57:45 -05:00
|
|
|
ui->airspaceRange->setValue(settings->m_airspaceRange);
|
2024-03-12 10:10:56 -04:00
|
|
|
int idx = ui->mapProvider->findText(settings->m_mapProvider);
|
|
|
|
if (idx != -1) {
|
|
|
|
ui->mapProvider->setCurrentText(settings->m_mapProvider);
|
|
|
|
}
|
2022-02-04 11:57:45 -05:00
|
|
|
ui->mapType->setCurrentIndex((int)settings->m_mapType);
|
|
|
|
ui->navAids->setChecked(settings->m_displayNavAids);
|
2023-10-26 11:31:37 -04:00
|
|
|
ui->atcCallsigns->setChecked(settings->m_atcCallsigns);
|
2022-02-04 11:57:45 -05:00
|
|
|
ui->photos->setChecked(settings->m_displayPhotos);
|
|
|
|
ui->verboseModelMatching->setChecked(settings->m_verboseModelMatching);
|
|
|
|
ui->airfieldElevation->setValue(settings->m_airfieldElevation);
|
2023-10-26 11:31:37 -04:00
|
|
|
ui->transitionAltitude->setValue(settings->m_transitionAlt);
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
ADSBDemodDisplayDialog::~ADSBDemodDisplayDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ADSBDemodDisplayDialog::accept()
|
|
|
|
{
|
2024-11-05 05:31:32 -05:00
|
|
|
if (m_settings->m_removeTimeout != ui->timeout->value())
|
|
|
|
{
|
|
|
|
m_settings->m_removeTimeout = ui->timeout->value();
|
|
|
|
m_settingsKeys.append("removeTimeout");
|
|
|
|
}
|
|
|
|
if (m_settings->m_aircraftMinZoom != ui->aircraftMinZoom->value())
|
|
|
|
{
|
|
|
|
m_settings->m_aircraftMinZoom = ui->aircraftMinZoom->value();
|
|
|
|
m_settingsKeys.append("aircraftMinZoom");
|
|
|
|
}
|
|
|
|
if (m_settings->m_airportRange != ui->airportRange->value())
|
|
|
|
{
|
|
|
|
m_settings->m_airportRange = ui->airportRange->value();
|
|
|
|
m_settingsKeys.append("airportRange");
|
|
|
|
}
|
|
|
|
if (m_settings->m_airportMinimumSize != (ADSBDemodSettings::AirportType)ui->airportSize->currentIndex())
|
|
|
|
{
|
|
|
|
m_settings->m_airportMinimumSize = (ADSBDemodSettings::AirportType)ui->airportSize->currentIndex();
|
|
|
|
m_settingsKeys.append("airportMinimumSize");
|
|
|
|
}
|
|
|
|
if (m_settings->m_displayHeliports != ui->heliports->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_displayHeliports = ui->heliports->isChecked();
|
|
|
|
m_settingsKeys.append("displayHeliports");
|
|
|
|
}
|
|
|
|
if (m_settings->m_siUnits != ui->units->currentIndex() == 0 ? false : true)
|
|
|
|
{
|
|
|
|
m_settings->m_siUnits = ui->units->currentIndex() == 0 ? false : true;
|
|
|
|
m_settingsKeys.append("siUnits");
|
|
|
|
}
|
|
|
|
if (m_settings->m_displayDemodStats != ui->displayStats->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_displayDemodStats = ui->displayStats->isChecked();
|
|
|
|
m_settingsKeys.append("displayDemodStats");
|
|
|
|
}
|
|
|
|
if (m_settings->m_autoResizeTableColumns != ui->autoResizeTableColumns->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_autoResizeTableColumns = ui->autoResizeTableColumns->isChecked();
|
|
|
|
m_settingsKeys.append("autoResizeTableColumns");
|
|
|
|
}
|
|
|
|
if (m_settings->m_aviationstackAPIKey != ui->aviationstackAPIKey->text())
|
|
|
|
{
|
|
|
|
m_settings->m_aviationstackAPIKey = ui->aviationstackAPIKey->text();
|
|
|
|
m_settingsKeys.append("aviationstackAPIKey");
|
|
|
|
}
|
|
|
|
if (m_settings->m_checkWXAPIKey != ui->checkWXAPIKey->text())
|
|
|
|
{
|
|
|
|
m_settings->m_checkWXAPIKey = ui->checkWXAPIKey->text();
|
|
|
|
m_settingsKeys.append("checkWXAPIKey");
|
|
|
|
}
|
|
|
|
QStringList airspaces;
|
2021-11-12 11:51:23 -05:00
|
|
|
for (int i = 0; i < ui->airspaces->count(); i++)
|
|
|
|
{
|
|
|
|
QListWidgetItem *item = ui->airspaces->item(i);
|
|
|
|
if (item->checkState() == Qt::Checked) {
|
2024-11-05 05:31:32 -05:00
|
|
|
airspaces.append(item->text());
|
2021-11-12 11:51:23 -05:00
|
|
|
}
|
|
|
|
}
|
2024-11-05 05:31:32 -05:00
|
|
|
if (m_settings->m_airspaces != airspaces)
|
|
|
|
{
|
|
|
|
m_settings->m_airspaces = airspaces;
|
|
|
|
m_settingsKeys.append("airspaces");
|
|
|
|
}
|
|
|
|
if (m_settings->m_airspaceRange != ui->airspaceRange->value())
|
|
|
|
{
|
|
|
|
m_settings->m_airspaceRange = ui->airspaceRange->value();
|
|
|
|
m_settingsKeys.append("airspaceRange");
|
|
|
|
}
|
|
|
|
if (m_settings->m_mapProvider != ui->mapProvider->currentText())
|
|
|
|
{
|
|
|
|
m_settings->m_mapProvider = ui->mapProvider->currentText();
|
|
|
|
m_settingsKeys.append("mapProvider");
|
|
|
|
}
|
|
|
|
if (m_settings->m_mapType != (ADSBDemodSettings::MapType)ui->mapType->currentIndex())
|
|
|
|
{
|
|
|
|
m_settings->m_mapType = (ADSBDemodSettings::MapType)ui->mapType->currentIndex();
|
|
|
|
m_settingsKeys.append("mapType");
|
|
|
|
}
|
|
|
|
if (m_settings->m_displayNavAids != ui->navAids->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_displayNavAids = ui->navAids->isChecked();
|
|
|
|
m_settingsKeys.append("displayNavAids");
|
|
|
|
}
|
|
|
|
if (m_settings->m_atcCallsigns != ui->atcCallsigns->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_atcCallsigns = ui->atcCallsigns->isChecked();
|
|
|
|
m_settingsKeys.append("atcCallsigns");
|
|
|
|
}
|
|
|
|
if (m_settings->m_displayPhotos != ui->photos->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_displayPhotos = ui->photos->isChecked();
|
|
|
|
m_settingsKeys.append("displayPhotos");
|
|
|
|
}
|
|
|
|
if (m_settings->m_verboseModelMatching != ui->verboseModelMatching->isChecked())
|
|
|
|
{
|
|
|
|
m_settings->m_verboseModelMatching = ui->verboseModelMatching->isChecked();
|
|
|
|
m_settingsKeys.append("verboseModelMatching");
|
|
|
|
}
|
|
|
|
if (m_settings->m_airfieldElevation != ui->airfieldElevation->value())
|
|
|
|
{
|
|
|
|
m_settings->m_airfieldElevation = ui->airfieldElevation->value();
|
|
|
|
m_settingsKeys.append("airfieldElevation");
|
|
|
|
}
|
|
|
|
if (m_settings->m_transitionAlt != ui->transitionAltitude->value())
|
|
|
|
{
|
|
|
|
m_settings->m_transitionAlt = ui->transitionAltitude->value();
|
|
|
|
m_settingsKeys.append("transitionAlt");
|
|
|
|
}
|
|
|
|
if (m_settings->m_tableFontName != m_fontName)
|
|
|
|
{
|
|
|
|
m_settings->m_tableFontName = m_fontName;
|
|
|
|
m_settingsKeys.append("tableFontName");
|
|
|
|
}
|
|
|
|
if (m_settings->m_tableFontSize != m_fontSize)
|
|
|
|
{
|
|
|
|
m_settings->m_tableFontSize = m_fontSize;
|
|
|
|
m_settingsKeys.append("tableFontSize");
|
|
|
|
}
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
QDialog::accept();
|
|
|
|
}
|
|
|
|
|
2020-11-14 05:13:32 -05:00
|
|
|
void ADSBDemodDisplayDialog::on_font_clicked()
|
ADS-B Demodulator updates.
Add OpenSky Network aircraft database support, for information about
aircraft model, owner, registration.
Add airline logos and country & military flags for display in the table.
Add OurAirports airport database support, to allow airports and ATC
frequencies to be displayed on the map.
Allow ATC frequency to be tuned by clicking on the map.
Add support for displaying flight paths on the map.
Allow columns in table to be rearranged and hidden.
Allow rows in table to be sorted by clicking on header.
Allow switching units from ft, kn, ft/min to m, kph, m/s
Allow aircraft timeout to be set by the user.
Allow font used for the table to be set by the user.
Add optional display of demodulator statistics.
Support multithreading in demodulator to reduce FIFO overflows.
Add support for demodulating all Mode-S frames and feeding them.
Add support for feeding in Beast hex format.
Allow option of correlating against full preamble or partial preamble.
Supporting highlighting of an aircraft in the table by selecting it on
the map.
Use difference of zeros and ones correlation, rather than absolute
threshold, to better account for varying conditions and make the
threshold easier to set.
Enable anti-aliasing for text on the map.
Improve CRC performance by 5x-10x.
Add HttpDownloadManager class to support downloading of files from the
web to disk.
2020-11-06 07:18:55 -05:00
|
|
|
{
|
|
|
|
bool ok;
|
|
|
|
QFont font = QFontDialog::getFont(&ok, QFont(m_fontName, m_fontSize), this);
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
m_fontName = font.family();
|
|
|
|
m_fontSize = font.pointSize();
|
|
|
|
}
|
|
|
|
}
|