2020-10-27 16:22:10 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
|
|
// 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 <QTime>
|
|
|
|
#include <QDebug>
|
|
|
|
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
#include "util/profiler.h"
|
|
|
|
|
2020-10-27 16:22:10 +00:00
|
|
|
#include "adsbdemodsink.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 12:18:55 +00:00
|
|
|
#include "adsbdemodsinkworker.h"
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
#include "adsbdemod.h"
|
2020-10-27 16:22:10 +00:00
|
|
|
#include "adsb.h"
|
|
|
|
|
|
|
|
ADSBDemodSink::ADSBDemodSink() :
|
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 12:18:55 +00:00
|
|
|
m_channelSampleRate(6000000),
|
|
|
|
m_channelFrequencyOffset(0),
|
|
|
|
m_sampleBuffer{nullptr, nullptr, nullptr},
|
|
|
|
m_worker(this),
|
|
|
|
m_writeBuffer(0),
|
|
|
|
m_writeIdx(0),
|
|
|
|
m_magsq(0.0f),
|
|
|
|
m_magsqSum(0.0f),
|
|
|
|
m_magsqPeak(0.0f),
|
|
|
|
m_magsqCount(0),
|
|
|
|
m_messageQueueToGUI(nullptr)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
2024-11-05 10:31:32 +00:00
|
|
|
applySettings(m_settings, QStringList(), true);
|
2020-10-27 16:22:10 +00:00
|
|
|
applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true);
|
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 12:18:55 +00:00
|
|
|
for (int i = 0; i < m_buffers; i++)
|
|
|
|
m_bufferWrite[i].release(1);
|
|
|
|
m_bufferWrite[m_writeBuffer].acquire();
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ADSBDemodSink::~ADSBDemodSink()
|
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
for (int i = 0; i < m_buffers; i++)
|
2021-04-28 15:37:18 +01:00
|
|
|
delete[] m_sampleBuffer[i];
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ADSBDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
|
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
// Start timing how long we are in this function
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
PROFILER_START();
|
2020-10-27 16:22:10 +00:00
|
|
|
|
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 12:18:55 +00:00
|
|
|
// Optimise for common case, where no resampling or frequency offset
|
|
|
|
if ((m_interpolatorDistance == 1.0f) && (m_channelFrequencyOffset == 0))
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
/*
|
|
|
|
// SampleVector is vector of qint32 or qint16
|
|
|
|
// Use integer mul to save one FP conversion and it has lower latency
|
|
|
|
qint64 r = (qint64)it->real();
|
|
|
|
qint64 i = (qint64)it->imag();
|
|
|
|
qint64 magsqRaw = r*r + i*i;
|
|
|
|
Real magsq = (Real)((double)magsqRaw / (SDR_RX_SCALED*SDR_RX_SCALED));
|
|
|
|
processOneSample(magsq);
|
|
|
|
*/
|
|
|
|
Complex c(it->real(), it->imag());
|
|
|
|
Real magsq = complexMagSq(c);
|
|
|
|
processOneSample(magsq);
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
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 12:18:55 +00:00
|
|
|
}
|
2020-11-12 13:25:49 +00:00
|
|
|
else if (m_interpolatorDistance == 1.0f) // just apply offset
|
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 12:18:55 +00:00
|
|
|
{
|
|
|
|
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
Complex c(it->real(), it->imag());
|
|
|
|
c *= m_nco.nextIQ();
|
2020-11-12 13:25:49 +00:00
|
|
|
processOneSample(complexMagSq(c));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (m_interpolatorDistance < 1.0f) // interpolate
|
|
|
|
{
|
|
|
|
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
|
|
|
{
|
|
|
|
Complex c(it->real(), it->imag());
|
|
|
|
Complex ci;
|
|
|
|
c *= m_nco.nextIQ();
|
|
|
|
while (!m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci))
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
2020-11-12 13:25:49 +00:00
|
|
|
processOneSample(complexMagSq(ci));
|
|
|
|
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
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 12:18:55 +00:00
|
|
|
}
|
2020-11-12 13:25:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else // decimate
|
|
|
|
{
|
|
|
|
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
|
|
|
{
|
|
|
|
Complex c(it->real(), it->imag());
|
|
|
|
Complex ci;
|
|
|
|
c *= m_nco.nextIQ();
|
|
|
|
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
|
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 12:18:55 +00:00
|
|
|
{
|
2020-11-12 13:25:49 +00:00
|
|
|
processOneSample(complexMagSq(ci));
|
|
|
|
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 12:18:55 +00:00
|
|
|
// Calculate number of seconds in this function
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
PROFILER_STOP("ADSB feed");
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
|
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 12:18:55 +00:00
|
|
|
void ADSBDemodSink::processOneSample(Real magsq)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
|
|
|
m_magsqSum += magsq;
|
|
|
|
if (magsq > m_magsqPeak)
|
|
|
|
m_magsqPeak = magsq;
|
|
|
|
m_magsqCount++;
|
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 12:18:55 +00:00
|
|
|
m_sampleBuffer[m_writeBuffer][m_writeIdx] = magsq;
|
|
|
|
m_writeIdx++;
|
2022-02-04 16:57:45 +00:00
|
|
|
if (!m_bufferDateTimeValid[m_writeBuffer])
|
|
|
|
{
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
QDateTime dateTime = QDateTime::currentDateTime();
|
|
|
|
if (m_minFirstSampleDateTime.isValid() && (dateTime < m_minFirstSampleDateTime)) {
|
|
|
|
dateTime = m_minFirstSampleDateTime;
|
|
|
|
}
|
|
|
|
m_bufferFirstSampleDateTime[m_writeBuffer] = dateTime;
|
2022-02-04 16:57:45 +00:00
|
|
|
m_bufferDateTimeValid[m_writeBuffer] = true;
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
|
|
|
|
// Make sure timestamps from different buffers are in order, even if we receive samples faster than real time
|
|
|
|
const qint64 samplesPerSecondMSec = ADS_B_BITS_PER_SECOND * m_settings.m_samplesPerBit / 1000;
|
|
|
|
const qint64 offsetMSec = m_bufferSize / samplesPerSecondMSec;
|
|
|
|
m_minFirstSampleDateTime = dateTime.addMSecs(offsetMSec);
|
2022-02-04 16:57:45 +00:00
|
|
|
}
|
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 12:18:55 +00:00
|
|
|
if (m_writeIdx >= m_bufferSize)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
m_bufferRead[m_writeBuffer].release();
|
2020-10-27 16:22:10 +00:00
|
|
|
|
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 12:18:55 +00:00
|
|
|
m_writeBuffer++;
|
|
|
|
if (m_writeBuffer >= m_buffers)
|
|
|
|
m_writeBuffer = 0;
|
2020-10-30 14:27:00 +01:00
|
|
|
|
2020-11-06 22:33:16 +00:00
|
|
|
if (m_worker.isRunning())
|
|
|
|
m_bufferWrite[m_writeBuffer].acquire();
|
2020-10-30 14:27:00 +01:00
|
|
|
|
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 12:18:55 +00:00
|
|
|
m_writeIdx = m_samplesPerFrame - 1; // Leave space for copying samples from previous buffer
|
2022-02-04 16:57:45 +00:00
|
|
|
|
|
|
|
m_bufferDateTimeValid[m_writeBuffer] = false;
|
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 12:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-27 16:22:10 +00:00
|
|
|
|
2020-11-06 22:33:16 +00:00
|
|
|
void ADSBDemodSink::startWorker()
|
|
|
|
{
|
|
|
|
qDebug() << "ADSBDemodSink::startWorker";
|
|
|
|
if (!m_worker.isRunning())
|
|
|
|
m_worker.start();
|
|
|
|
}
|
|
|
|
|
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 12:18:55 +00:00
|
|
|
void ADSBDemodSink::stopWorker()
|
|
|
|
{
|
|
|
|
if (m_worker.isRunning())
|
|
|
|
{
|
|
|
|
qDebug() << "ADSBDemodSink::stopWorker: Stopping worker";
|
|
|
|
m_worker.requestInterruption();
|
|
|
|
// Worker may be blocked waiting for a buffer
|
|
|
|
for (int i = 0; i < m_buffers; i++)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
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 12:18:55 +00:00
|
|
|
if (m_bufferRead[i].available() == 0)
|
|
|
|
m_bufferRead[i].release(1);
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
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 12:18:55 +00:00
|
|
|
m_worker.wait();
|
2020-11-06 22:33:16 +00:00
|
|
|
// If this is called from ADSBDemod, we need to also
|
2024-07-10 22:59:13 +02:00
|
|
|
// make sure baseband sink thread isn't blocked in processOneSample
|
2020-11-06 22:33:16 +00:00
|
|
|
for (int i = 0; i < m_buffers; i++)
|
|
|
|
{
|
|
|
|
if (m_bufferWrite[i].available() == 0)
|
|
|
|
m_bufferWrite[i].release(1);
|
|
|
|
}
|
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 12:18:55 +00:00
|
|
|
qDebug() << "ADSBDemodSink::stopWorker: Worker stopped";
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ADSBDemodSink::init(int samplesPerBit)
|
|
|
|
{
|
2020-11-06 22:33:16 +00:00
|
|
|
bool restart = m_worker.isRunning();
|
|
|
|
if (restart)
|
|
|
|
{
|
|
|
|
// Stop worker as we're going to delete the buffers
|
|
|
|
stopWorker();
|
|
|
|
}
|
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 12:18:55 +00:00
|
|
|
// Reset state of semaphores
|
|
|
|
for (int i = 0; i < m_buffers; i++)
|
|
|
|
{
|
|
|
|
m_bufferWrite[i].acquire(m_bufferWrite[i].available());
|
|
|
|
m_bufferWrite[i].release(1);
|
|
|
|
m_bufferRead[i].acquire(m_bufferRead[i].available());
|
|
|
|
}
|
|
|
|
m_writeBuffer = 0;
|
|
|
|
m_bufferWrite[m_writeBuffer].acquire();
|
|
|
|
|
|
|
|
for (int i = 0; i < m_buffers; i++)
|
|
|
|
{
|
|
|
|
if (m_sampleBuffer[i])
|
2021-04-28 15:37:18 +01:00
|
|
|
delete[] m_sampleBuffer[i];
|
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 12:18:55 +00:00
|
|
|
}
|
2020-10-27 16:22:10 +00:00
|
|
|
|
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 12:18:55 +00:00
|
|
|
m_samplesPerFrame = samplesPerBit*(ADS_B_PREAMBLE_BITS+ADS_B_ES_BITS);
|
2020-10-27 16:22:10 +00:00
|
|
|
m_samplesPerChip = samplesPerBit/ADS_B_CHIPS_PER_BIT;
|
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 12:18:55 +00:00
|
|
|
m_writeIdx = m_samplesPerFrame - 1; // Leave space for copying samples from previous buffer
|
2022-02-04 16:57:45 +00:00
|
|
|
m_bufferDateTimeValid[m_writeBuffer] = false;
|
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 12:18:55 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < m_buffers; i++)
|
|
|
|
m_sampleBuffer[i] = new Real[m_bufferSize];
|
2020-10-27 16:22:10 +00:00
|
|
|
|
2020-11-06 22:33:16 +00:00
|
|
|
if (restart)
|
|
|
|
startWorker();
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ADSBDemodSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force)
|
|
|
|
{
|
|
|
|
qDebug() << "ADSBDemodSink::applyChannelSettings:"
|
|
|
|
<< " channelSampleRate: " << channelSampleRate
|
|
|
|
<< " channelFrequencyOffset: " << channelFrequencyOffset;
|
|
|
|
|
2022-03-08 00:57:07 +01:00
|
|
|
if (channelSampleRate == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-10-27 16:22:10 +00:00
|
|
|
if ((channelFrequencyOffset != m_channelFrequencyOffset) ||
|
|
|
|
(channelSampleRate != m_channelSampleRate) || force)
|
|
|
|
{
|
|
|
|
m_nco.setFreq(-channelFrequencyOffset, channelSampleRate);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((channelSampleRate != m_channelSampleRate) || force)
|
|
|
|
{
|
2020-11-12 13:25:49 +00:00
|
|
|
m_interpolator.create(m_settings.m_interpolatorPhaseSteps, channelSampleRate, m_settings.m_rfBandwidth / 2.2, m_settings.m_interpolatorTapsPerPhase);
|
2020-10-27 16:22:10 +00:00
|
|
|
m_interpolatorDistanceRemain = 0;
|
|
|
|
m_interpolatorDistance = (Real) channelSampleRate / (Real) (ADS_B_BITS_PER_SECOND * m_settings.m_samplesPerBit);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_channelSampleRate = channelSampleRate;
|
|
|
|
m_channelFrequencyOffset = channelFrequencyOffset;
|
|
|
|
}
|
|
|
|
|
2024-11-05 10:31:32 +00:00
|
|
|
void ADSBDemodSink::applySettings(const ADSBDemodSettings& settings, const QStringList& settingsKeys, bool force)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
|
|
|
qDebug() << "ADSBDemodSink::applySettings:"
|
|
|
|
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
|
|
|
|
<< " m_rfBandwidth: " << settings.m_rfBandwidth
|
|
|
|
<< " m_correlationThreshold: " << settings.m_correlationThreshold
|
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 12:18:55 +00:00
|
|
|
<< " m_demodModeS: " << settings.m_demodModeS
|
2020-10-27 16:22:10 +00:00
|
|
|
<< " m_samplesPerBit: " << settings.m_samplesPerBit
|
|
|
|
<< " force: " << force;
|
|
|
|
|
2024-11-05 10:31:32 +00:00
|
|
|
if ((settingsKeys.contains("rfBandwidth") && (settings.m_rfBandwidth != m_settings.m_rfBandwidth))
|
|
|
|
|| (settingsKeys.contains("samplesPerBit") && (settings.m_samplesPerBit != m_settings.m_samplesPerBit))
|
|
|
|
|| (settingsKeys.contains("interpolatorPhaseSteps") && (settings.m_interpolatorPhaseSteps != m_settings.m_interpolatorPhaseSteps))
|
|
|
|
|| (settingsKeys.contains("interpolatorTapsPerPhase") && (settings.m_interpolatorTapsPerPhase != m_settings.m_interpolatorTapsPerPhase))
|
2020-11-12 13:25:49 +00:00
|
|
|
|| force)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
2020-11-12 13:25:49 +00:00
|
|
|
m_interpolator.create(m_settings.m_interpolatorPhaseSteps, m_channelSampleRate, settings.m_rfBandwidth / 2.2, m_settings.m_interpolatorTapsPerPhase);
|
2020-10-27 16:22:10 +00:00
|
|
|
m_interpolatorDistanceRemain = 0;
|
2024-11-05 10:31:32 +00:00
|
|
|
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) (ADS_B_BITS_PER_SECOND * settings.m_samplesPerBit);
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
2020-10-30 14:27:00 +01:00
|
|
|
|
2024-11-05 10:31:32 +00:00
|
|
|
if ((settingsKeys.contains("samplesPerBit") && (settings.m_samplesPerBit != m_settings.m_samplesPerBit)) || force)
|
2020-10-27 16:22:10 +00:00
|
|
|
{
|
|
|
|
init(settings.m_samplesPerBit);
|
|
|
|
}
|
|
|
|
|
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 12:18:55 +00:00
|
|
|
// Forward to worker
|
|
|
|
ADSBDemodSinkWorker::MsgConfigureADSBDemodSinkWorker *msg = ADSBDemodSinkWorker::MsgConfigureADSBDemodSinkWorker::create(
|
2024-11-05 10:31:32 +00:00
|
|
|
settings, settingsKeys, force);
|
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 12:18:55 +00:00
|
|
|
m_worker.getInputMessageQueue()->push(msg);
|
2020-10-30 14:27:00 +01:00
|
|
|
|
2024-11-05 10:31:32 +00:00
|
|
|
if (force) {
|
|
|
|
m_settings = settings;
|
|
|
|
} else {
|
|
|
|
m_settings.applySettings(settingsKeys, settings);
|
|
|
|
}
|
2020-10-27 16:22:10 +00:00
|
|
|
}
|
Add additional demod stats.
Add analysis of Mode S frames in order to help filter out false positives.
Remove Boost. Use Profiler instead.
Fix crash if interrrupted before run.
Decode full preamble for Mode S frames.
Add support for additional Mode S downlink formats.
Allow demod stats to be reset.
Add timestamps for buffers, to ensure ordering of frames.
Add additional data columns (Aircraft Type, Sideview, Track, Interrogator Code, TCAS, ACAS, RA, Max speed, Version, Length, Width, ADS-B/Mode S frame counts, radius, NACp, NACv, GVA, NIC, SIL, Stops).
Add PCE (Preamble Chip Errors) settings for Mode S demod.
Remove correlate full preamable setting.
Send aircraft state to Map feature for display on PFD.
Add support for airline route database.
Use combined aircraft database from sdrangel.org rather than OSN database.
Add stats table, with demod stats and breakdown of frame types received..
Add button to delete all aircraft from table.
Add display of interrogator code coverage.
Remove airport elevation setting as now calculated dynamically.
Add QNH setting.
Add coverage map.
Add chart of frame rate and aircraft count.
Add table/map orientation setting.
Add display of aircraft position uncertainty.
Add coloured flight paths with several palettes.
Add setting to favour airline livery over aircraft type in 3D model matching.
Only use 4 engine map icon for aircraft with 4 engines.
Add specialised aircraft map icons (Eurofighter, Spitfire, F35, A400M, Apache, Chinook, Glider)
Display aircraft route in labels.
Better validate local/global aircraft positions.
Add support for tc==31, aircraft operational status frames.
Add decoding of Mode S df 0, 11, 16 frames.
Add decoding of BDS 0,5 0,8, 0,9.
2025-06-04 18:05:10 +01:00
|
|
|
|
|
|
|
void ADSBDemodSink::resetStats()
|
|
|
|
{
|
|
|
|
ADSBDemod::MsgResetStats* msg = ADSBDemod::MsgResetStats::create();
|
|
|
|
m_worker.getInputMessageQueue()->push(msg);
|
|
|
|
}
|