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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_OURAIRPORTSDB_H
|
|
|
|
#define INCLUDE_OURAIRPORTSDB_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QHash>
|
|
|
|
#include <QList>
|
|
|
|
#include <QDebug>
|
2021-11-29 05:18:22 -05:00
|
|
|
#include <QLocale>
|
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
|
|
|
|
2020-11-06 11:42:25 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2021-11-04 08:33:43 -04:00
|
|
|
#include "util/csv.h"
|
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 "adsbdemodsettings.h"
|
|
|
|
|
2021-11-12 11:51:23 -05:00
|
|
|
#define AIRPORTS_URL "https://davidmegginson.github.io/ourairports-data/airports.csv"
|
|
|
|
#define AIRPORT_FREQUENCIES_URL "https://davidmegginson.github.io/ourairports-data/airport-frequencies.csv"
|
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
|
|
|
|
|
|
|
struct AirportInformation {
|
|
|
|
|
|
|
|
struct FrequencyInformation {
|
|
|
|
QString m_type;
|
|
|
|
QString m_description;
|
|
|
|
float m_frequency; // In MHz
|
|
|
|
};
|
|
|
|
|
|
|
|
int m_id;
|
|
|
|
QString m_ident;
|
|
|
|
ADSBDemodSettings::AirportType m_type;
|
|
|
|
QString m_name;
|
|
|
|
float m_latitude;
|
|
|
|
float m_longitude;
|
|
|
|
float m_elevation;
|
|
|
|
QVector<FrequencyInformation *> m_frequencies;
|
|
|
|
|
2021-11-03 13:24:22 -04:00
|
|
|
~AirportInformation()
|
2021-11-03 13:19:21 -04:00
|
|
|
{
|
|
|
|
qDeleteAll(m_frequencies);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
static QString trimQuotes(const QString s)
|
|
|
|
{
|
|
|
|
if (s.startsWith('\"') && s.endsWith('\"'))
|
|
|
|
return s.mid(1, s.size() - 2);
|
|
|
|
else
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read OurAirport's airport CSV file
|
2020-11-06 11:42:25 -05:00
|
|
|
// See comments for readOSNDB
|
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
|
|
|
static QHash<int, AirportInformation *> *readAirportsDB(const QString &filename)
|
|
|
|
{
|
|
|
|
int cnt = 0;
|
2020-11-06 11:42:25 -05:00
|
|
|
QHash<int, AirportInformation *> *airportInfo = nullptr;
|
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
|
|
|
|
|
|
|
// Column numbers used for the data as of 2020/10/28
|
|
|
|
int idCol = 0;
|
|
|
|
int identCol = 1;
|
|
|
|
int typeCol = 2;
|
|
|
|
int nameCol = 3;
|
|
|
|
int latitudeCol = 4;
|
|
|
|
int longitudeCol = 5;
|
|
|
|
int elevationCol = 6;
|
|
|
|
|
|
|
|
qDebug() << "AirportInformation::readAirportsDB: " << filename;
|
|
|
|
|
2020-11-06 11:42:25 -05:00
|
|
|
FILE *file;
|
|
|
|
QByteArray utfFilename = filename.toUtf8();
|
2021-11-29 05:18:22 -05:00
|
|
|
QLocale cLocale(QLocale::C);
|
2020-11-06 11:42:25 -05:00
|
|
|
if ((file = fopen(utfFilename.constData(), "r")) != NULL)
|
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
|
|
|
{
|
2020-11-06 11:42:25 -05:00
|
|
|
char row[2048];
|
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
|
|
|
|
2020-11-06 11:42:25 -05:00
|
|
|
if (fgets(row, sizeof(row), file))
|
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
|
|
|
{
|
2020-11-06 11:42:25 -05:00
|
|
|
airportInfo = new QHash<int, AirportInformation *>();
|
|
|
|
airportInfo->reserve(70000);
|
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
|
|
|
|
2020-11-06 11:42:25 -05:00
|
|
|
// Read header
|
|
|
|
int idx = 0;
|
|
|
|
char *p = strtok(row, ",");
|
|
|
|
while (p != NULL)
|
|
|
|
{
|
|
|
|
if (!strcmp(p, "id"))
|
|
|
|
idCol = idx;
|
|
|
|
else if (!strcmp(p, "ident"))
|
|
|
|
identCol = idx;
|
|
|
|
else if (!strcmp(p, "type"))
|
|
|
|
typeCol = idx;
|
|
|
|
else if (!strcmp(p, "name"))
|
|
|
|
nameCol = idx;
|
|
|
|
else if (!strcmp(p, "latitude_deg"))
|
|
|
|
latitudeCol = idx;
|
|
|
|
else if (!strcmp(p, "longitude_deg"))
|
|
|
|
longitudeCol = idx;
|
|
|
|
else if (!strcmp(p, "elevation_ft"))
|
|
|
|
elevationCol = idx;
|
|
|
|
p = strtok(NULL, ",");
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
// Read data
|
|
|
|
while (fgets(row, sizeof(row), file))
|
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
|
|
|
{
|
2020-11-06 11:42:25 -05:00
|
|
|
int id = 0;
|
|
|
|
char *idString = NULL;
|
|
|
|
char *ident = NULL;
|
|
|
|
size_t identLen = 0;
|
|
|
|
char *type = NULL;
|
|
|
|
size_t typeLen = 0;
|
|
|
|
char *name = NULL;
|
|
|
|
size_t nameLen = 0;
|
|
|
|
float latitude = 0.0f;
|
|
|
|
char *latitudeString = NULL;
|
|
|
|
size_t latitudeLen = 0;
|
|
|
|
float longitude = 0.0f;
|
|
|
|
char *longitudeString = NULL;
|
|
|
|
size_t longitudeLen = 0;
|
|
|
|
float elevation = 0.0f;
|
|
|
|
char *elevationString = NULL;
|
|
|
|
size_t elevationLen = 0;
|
|
|
|
|
|
|
|
p = strtok(row, ",");
|
|
|
|
idx = 0;
|
|
|
|
while (p != NULL)
|
|
|
|
{
|
|
|
|
// Read strings, stripping quotes
|
|
|
|
if (idx == idCol)
|
|
|
|
{
|
|
|
|
idString = p;
|
|
|
|
idString[strlen(idString)] = '\0';
|
|
|
|
id = strtol(idString, NULL, 10);
|
|
|
|
}
|
|
|
|
else if (idx == identCol)
|
|
|
|
{
|
|
|
|
ident = p+1;
|
|
|
|
identLen = strlen(ident)-1;
|
|
|
|
ident[identLen] = '\0';
|
|
|
|
}
|
|
|
|
else if (idx == typeCol)
|
|
|
|
{
|
|
|
|
type = p+1;
|
|
|
|
typeLen = strlen(type)-1;
|
|
|
|
type[typeLen] = '\0';
|
|
|
|
}
|
|
|
|
else if (idx == nameCol)
|
|
|
|
{
|
|
|
|
name = p+1;
|
|
|
|
nameLen = strlen(name)-1;
|
|
|
|
name[nameLen] = '\0';
|
|
|
|
}
|
|
|
|
else if (idx == latitudeCol)
|
|
|
|
{
|
|
|
|
latitudeString = p;
|
|
|
|
latitudeLen = strlen(latitudeString)-1;
|
|
|
|
latitudeString[latitudeLen] = '\0';
|
2021-11-29 05:18:22 -05:00
|
|
|
latitude = cLocale.toFloat(latitudeString);
|
2020-11-06 11:42:25 -05:00
|
|
|
}
|
|
|
|
else if (idx == longitudeCol)
|
|
|
|
{
|
|
|
|
longitudeString = p;
|
|
|
|
longitudeLen = strlen(longitudeString)-1;
|
|
|
|
longitudeString[longitudeLen] = '\0';
|
2021-11-29 05:18:22 -05:00
|
|
|
longitude = cLocale.toFloat(longitudeString);
|
2020-11-06 11:42:25 -05:00
|
|
|
}
|
|
|
|
else if (idx == elevationCol)
|
|
|
|
{
|
|
|
|
elevationString = p;
|
|
|
|
elevationLen = strlen(elevationString)-1;
|
|
|
|
elevationString[elevationLen] = '\0';
|
2021-11-29 05:18:22 -05:00
|
|
|
elevation = cLocale.toFloat(elevationString);
|
2020-11-06 11:42:25 -05:00
|
|
|
}
|
|
|
|
p = strtok(NULL, ",");
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Only create the entry if we have some interesting data
|
|
|
|
if (((latitude != 0.0f) || (longitude != 0.0f)) && (type && strcmp(type, "closed")))
|
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
|
|
|
{
|
|
|
|
AirportInformation *airport = new AirportInformation();
|
|
|
|
airport->m_id = id;
|
2020-11-06 11:42:25 -05:00
|
|
|
airport->m_ident = QString(ident);
|
|
|
|
if (!strcmp(type, "small_airport"))
|
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
|
|
|
airport->m_type = ADSBDemodSettings::AirportType::Small;
|
2020-11-06 11:42:25 -05:00
|
|
|
else if (!strcmp(type, "medium_airport"))
|
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
|
|
|
airport->m_type = ADSBDemodSettings::AirportType::Medium;
|
2020-11-06 11:42:25 -05:00
|
|
|
else if (!strcmp(type, "large_airport"))
|
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
|
|
|
airport->m_type = ADSBDemodSettings::AirportType::Large;
|
2020-11-06 11:42:25 -05:00
|
|
|
else if (!strcmp(type, "heliport"))
|
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
|
|
|
airport->m_type = ADSBDemodSettings::AirportType::Heliport;
|
2020-11-06 11:42:25 -05:00
|
|
|
airport->m_name = QString(name);
|
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
|
|
|
airport->m_latitude = latitude;
|
|
|
|
airport->m_longitude = longitude;
|
|
|
|
airport->m_elevation = elevation;
|
|
|
|
airportInfo->insert(id, airport);
|
|
|
|
cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-06 11:42:25 -05:00
|
|
|
fclose(file);
|
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
|
|
|
}
|
|
|
|
else
|
2020-11-06 11:42:25 -05:00
|
|
|
qDebug() << "AirportInformation::readAirportsDB: Failed to open " << filename;
|
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
|
|
|
|
2020-11-06 11:42:25 -05:00
|
|
|
qDebug() << "AirportInformation::readAirportsDB: Read " << cnt << " airports";
|
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
|
|
|
|
|
|
|
return airportInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read OurAirport's airport frequencies CSV file
|
|
|
|
static bool readFrequenciesDB(const QString &filename, QHash<int, AirportInformation *> *airportInfo)
|
|
|
|
{
|
|
|
|
int cnt = 0;
|
|
|
|
|
|
|
|
// Column numbers used for the data as of 2020/10/28
|
|
|
|
int airportRefCol = 1;
|
|
|
|
int typeCol = 3;
|
|
|
|
int descriptionCol = 4;
|
|
|
|
int frequencyCol = 5;
|
|
|
|
|
|
|
|
qDebug() << "AirportInformation::readFrequenciesDB: " << filename;
|
|
|
|
|
|
|
|
QFile file(filename);
|
|
|
|
if (file.open(QIODevice::ReadOnly))
|
|
|
|
{
|
|
|
|
QList<QByteArray> colNames;
|
|
|
|
int idx;
|
|
|
|
|
|
|
|
// Read header
|
|
|
|
if (!file.atEnd())
|
|
|
|
{
|
|
|
|
QByteArray row = file.readLine().trimmed();
|
|
|
|
colNames = row.split(',');
|
|
|
|
// Work out which columns the data is in, based on the headers
|
|
|
|
idx = colNames.indexOf("airport_ref");
|
|
|
|
if (idx >= 0)
|
|
|
|
airportRefCol = idx;
|
|
|
|
idx = colNames.indexOf("type");
|
|
|
|
if (idx >= 0)
|
|
|
|
typeCol = idx;
|
|
|
|
idx = colNames.indexOf("descrption");
|
|
|
|
if (idx >= 0)
|
|
|
|
descriptionCol = idx;
|
|
|
|
idx = colNames.indexOf("frequency_mhz");
|
|
|
|
if (idx >= 0)
|
|
|
|
frequencyCol = idx;
|
|
|
|
}
|
|
|
|
// Read data
|
|
|
|
while (!file.atEnd())
|
|
|
|
{
|
|
|
|
QByteArray row = file.readLine();
|
|
|
|
QList<QByteArray> cols = row.split(',');
|
|
|
|
|
|
|
|
bool ok = false;
|
|
|
|
int airportRef = cols[airportRefCol].toInt(&ok, 10);
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
if (airportInfo->contains(airportRef))
|
|
|
|
{
|
|
|
|
QString type = trimQuotes(cols[typeCol]);
|
|
|
|
QString description = trimQuotes(cols[descriptionCol]);
|
|
|
|
float frequency = cols[frequencyCol].toFloat();
|
|
|
|
|
|
|
|
FrequencyInformation *frequencyInfo = new FrequencyInformation();
|
|
|
|
frequencyInfo->m_type = type;
|
|
|
|
frequencyInfo->m_description = description;
|
|
|
|
frequencyInfo->m_frequency = frequency;
|
|
|
|
airportInfo->value(airportRef)->m_frequencies.append(frequencyInfo);
|
|
|
|
cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
file.close();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
qDebug() << "Failed to open " << filename << " " << file.errorString();
|
|
|
|
|
|
|
|
qDebug() << "AirportInformation::readFrequenciesDB: - read " << cnt << " airports";
|
|
|
|
|
|
|
|
return airportInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|