diff --git a/doc/img/AircraftFeature_atc_tab.png b/doc/img/AircraftFeature_atc_tab.png new file mode 100644 index 000000000..0e26de975 Binary files /dev/null and b/doc/img/AircraftFeature_atc_tab.png differ diff --git a/doc/img/AircraftFeature_chart.png b/doc/img/AircraftFeature_chart.png new file mode 100644 index 000000000..c1748f821 Binary files /dev/null and b/doc/img/AircraftFeature_chart.png differ diff --git a/doc/img/AircraftFeature_plugin.png b/doc/img/AircraftFeature_plugin.png new file mode 100644 index 000000000..784706a0a Binary files /dev/null and b/doc/img/AircraftFeature_plugin.png differ diff --git a/doc/img/AircraftFeature_settings.png b/doc/img/AircraftFeature_settings.png new file mode 100644 index 000000000..461c5c739 Binary files /dev/null and b/doc/img/AircraftFeature_settings.png differ diff --git a/plugins/feature/aircraft/aircraftgui.cpp b/plugins/feature/aircraft/aircraftgui.cpp index e5b41c26e..66b1a5b87 100644 --- a/plugins/feature/aircraft/aircraftgui.cpp +++ b/plugins/feature/aircraft/aircraftgui.cpp @@ -40,6 +40,9 @@ #include #include #include +#include +#include +#include #ifdef QT_TEXTTOSPEECH_FOUND #include #endif @@ -110,6 +113,32 @@ static void addColumnMenu(QTableView *view, int columns) }); } +// A width for a column that fits both the sample - the widest thing it is likely to show - +// and its own heading, whichever is wider. A column narrower than its title reads as +// truncated even when the data fits, and several numeric columns (Alt, Hdg, Spd) have +// headings wider than their values. +// A sorted column draws a sort arrow in its header, and the header lays that out BESIDE +// the text rather than over it - so a width that only just fits the text hid the text +// itself the moment the column was sorted on. The style knows how big the arrow is; +// asking it is better than picking a number that is wrong on another theme. +static int columnWidthFor(const QTableView *view, int column, const QString& sample) +{ + const QHeaderView *header = view->horizontalHeader(); + const int sortArrow = header->style()->pixelMetric(QStyle::PM_HeaderMarkSize, nullptr, header) + + 2 * header->style()->pixelMetric(QStyle::PM_HeaderMargin, nullptr, header); + const QString heading = view->model()->headerData(column, Qt::Horizontal).toString(); + const int text = std::max(view->fontMetrics().horizontalAdvance(sample), + header->fontMetrics().horizontalAdvance(heading)); + return text + 12 + sortArrow; +} + +// The widest a date and time gets in a given format: two digit day and month, and a time +// late in the day so a 12 hour locale shows two digit hours too +static QString dateTimeSample(const QString& format) +{ + return QDateTime(QDate(2026, 12, 28), QTime(23, 59, 59)).toString(format); +} + // Settings saved before that guard existed can still have everything hidden, so recover // rather than restoring a table the user cannot use static void showAllColumnsIfNoneVisible(QTableView *view, int *columnSizes, int columns, QMenu *menu) @@ -500,8 +529,10 @@ AircraftGUI::AircraftGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Featu ui->photo->setVisible(false); ui->flightDetails->setVisible(false); - // Charts + // Charts. Wheel events and double clicks reach the view's viewport, in the + // coordinates the plot area is in. plotChart(); + ui->chart->viewport()->installEventFilter(this); plotProfileChart(); // Reuse the ADS-B demodulator's control tower icon (its resources are @@ -824,61 +855,64 @@ void AircraftGUI::trackerStatistics(const AircraftStatistics& statistics) void AircraftGUI::setDefaultColumnWidths() { - - const QFontMetrics fm(font()); - // A sorted column draws a sort arrow in its header, and the header lays that out - // BESIDE the text rather than over it - so a width that only just fits the text hid - // the text itself the moment the column was sorted on. The style knows how big the - // arrow is; asking it is better than picking a number that is wrong on another theme. - QHeaderView *anyHeader = ui->flights->horizontalHeader(); - const int sortArrow = style()->pixelMetric(QStyle::PM_HeaderMarkSize, nullptr, anyHeader) - + 2 * style()->pixelMetric(QStyle::PM_HeaderMargin, nullptr, anyHeader); - auto width = [&fm, sortArrow](const char *sample) { - return fm.horizontalAdvance(sample) + 12 + sortArrow; + auto set = [](QTableView *view, int column, const QString& sample) { + view->setColumnWidth(column, columnWidthFor(view, column, sample)); }; - ui->aircraft->setColumnWidth(AircraftTableModel::COL_ICAO, width("ABCDEF")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_REG, width("G-ABCDEF")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_TYPE, width("B77W")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_FLIGHT, width("RYR33KQW")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_FLIGHT_NO, width("Flight No")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_AIRLINE, std::max(90, width("Airline name"))); + // What a QDateTime cell shows (the delegate's own short format), and what the message + // tables show, which add the seconds + const QString shownDateTime = dateTimeSample(QLocale().dateTimeFormat(QLocale::ShortFormat)); + const QString messageDateTime = dateTimeSample(QLocale().dateFormat(QLocale::ShortFormat) + " hh:mm:ss"); + // A callsign is at most 8 characters, and a station address no longer + const QString callsign = "RYR33KQW"; + const QString reg = "G-ABCDEF"; + // A protocol and frequency, the longest of which is a satellite L band one + const QString link = "Iridium 1626.104"; + const QString protocols = "ACARS 131.725; HFDL 10.081"; + + set(ui->aircraft, AircraftTableModel::COL_ICAO, "ABCDEF"); + set(ui->aircraft, AircraftTableModel::COL_REG, reg); + set(ui->aircraft, AircraftTableModel::COL_TYPE, "B77W"); + set(ui->aircraft, AircraftTableModel::COL_FLIGHT, callsign); + set(ui->aircraft, AircraftTableModel::COL_FLIGHT_NO, "BA1234"); + // A logo where one is known (the icon size is 85 wide), otherwise the name + ui->aircraft->setColumnWidth(AircraftTableModel::COL_AIRLINE, + std::max(90, columnWidthFor(ui->aircraft, AircraftTableModel::COL_AIRLINE, "Airline name"))); ui->aircraft->setColumnWidth(AircraftTableModel::COL_SIDEVIEW, 90); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_COUNTRY, 45); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LATITUDE, width("-90.00000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LONGITUDE, width("-180.00000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_DISTANCE, width("Dist (km)")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_ALTITUDE, width("40000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_HEADING, width("360")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_SPEED, width("500")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_MESSAGES, width("10000")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); - ui->aircraft->setColumnWidth(AircraftTableModel::COL_SELCAL, width("SELCAL")); + // A flag, so the heading is what sets the width + set(ui->aircraft, AircraftTableModel::COL_COUNTRY, ""); + set(ui->aircraft, AircraftTableModel::COL_LATITUDE, "-90.0000"); + set(ui->aircraft, AircraftTableModel::COL_LONGITUDE, "-180.0000"); + set(ui->aircraft, AircraftTableModel::COL_DISTANCE, "10000"); + set(ui->aircraft, AircraftTableModel::COL_ALTITUDE, "40000"); + set(ui->aircraft, AircraftTableModel::COL_HEADING, "360"); + set(ui->aircraft, AircraftTableModel::COL_SPEED, "500"); + set(ui->aircraft, AircraftTableModel::COL_PROTOCOLS, protocols); + set(ui->aircraft, AircraftTableModel::COL_MESSAGES, "10000"); + set(ui->aircraft, AircraftTableModel::COL_LAST_SEEN, shownDateTime); + set(ui->aircraft, AircraftTableModel::COL_SELCAL, "AB-CD"); // Every column, not just some: the ones left out took Qt's default and came out far - // wider than a tick or a time needs. Sized to the widest thing each actually shows, - // or to its own heading where that is wider - a column narrower than its title reads - // as truncated even when the data fits. - ui->flights->setColumnWidth(FlightTableModel::COL_FLIGHT, width("RYR33KQW")); - ui->flights->setColumnWidth(FlightTableModel::COL_FLIGHT_NO, width("Flight No")); - ui->flights->setColumnWidth(FlightTableModel::COL_REG, width("G-ABCDEF")); - ui->flights->setColumnWidth(FlightTableModel::COL_FROM, width("WWWW")); - ui->flights->setColumnWidth(FlightTableModel::COL_TO, width("WWWW")); - ui->flights->setColumnWidth(FlightTableModel::COL_DOCS, width("Docs")); + // wider than a tick or a time needs + set(ui->flights, FlightTableModel::COL_FLIGHT, callsign); + set(ui->flights, FlightTableModel::COL_FLIGHT_NO, "BA1234"); + set(ui->flights, FlightTableModel::COL_REG, reg); + set(ui->flights, FlightTableModel::COL_FROM, "WWWW"); + set(ui->flights, FlightTableModel::COL_TO, "WWWW"); + set(ui->flights, FlightTableModel::COL_DOCS, "99"); // A tick, so the heading is what sets the width - ui->flights->setColumnWidth(FlightTableModel::COL_LS, width("LS")); - ui->flights->setColumnWidth(FlightTableModel::COL_CL, width("CL")); - ui->flights->setColumnWidth(FlightTableModel::COL_FP, width("FP")); - // Shown as hh:mm, and the headings are shorter than that - ui->flights->setColumnWidth(FlightTableModel::COL_OUT, width("00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_OFF, width("00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_ON, width("00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_IN, width("00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_FIRST_SEEN, width("12/12/2026 12:00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_LAST_SEEN, width("12/12/2026 12:00:00")); - ui->flights->setColumnWidth(FlightTableModel::COL_PROTOCOLS, width("ACARS 131.725; HFDL 10.081")); - ui->flights->setColumnWidth(FlightTableModel::COL_ROUTE_SOURCE, width("Message <>DB")); + set(ui->flights, FlightTableModel::COL_LS, ""); + set(ui->flights, FlightTableModel::COL_CL, ""); + set(ui->flights, FlightTableModel::COL_FP, ""); + // Shown as hh:mm + set(ui->flights, FlightTableModel::COL_OUT, "00:00"); + set(ui->flights, FlightTableModel::COL_OFF, "00:00"); + set(ui->flights, FlightTableModel::COL_ON, "00:00"); + set(ui->flights, FlightTableModel::COL_IN, "00:00"); + set(ui->flights, FlightTableModel::COL_FIRST_SEEN, shownDateTime); + set(ui->flights, FlightTableModel::COL_LAST_SEEN, shownDateTime); + set(ui->flights, FlightTableModel::COL_PROTOCOLS, protocols); + set(ui->flights, FlightTableModel::COL_ROUTE_SOURCE, "Message <>DB"); // The archive views show the same columns, so give them the same widths for (auto pair : { qMakePair((QTableView *) ui->aircraft, (QTableView *) ui->oldAircraft), @@ -889,12 +923,28 @@ void AircraftGUI::setDefaultColumnWidths() } } - // These carry a date and a time to the second now. Left at the default width they - // wrapped onto two lines, which they were already close to doing without the seconds. - ui->documents->setColumnWidth(DOCUMENT_COL_TIME, width("29/08/2026 13:41:22")); - ui->atcMessages->setColumnWidth(ATC_COL_TIME, width("29/08/2026 13:41:22")); - // Wide enough for a protocol and an HF frequency, which is the longest it gets - ui->atcMessages->setColumnWidth(ATC_COL_PROTOCOL, width("HFDL 11384.000")); + // The message tables. Each stretches its last column - the title, report or message + // text, which is what the space is wanted for - so that is left out here. Left at + // Qt's default, the short columns took as much room as the text did. + for (QTableWidget *table : {ui->documents, ui->logons}) + { + set(table, DOCUMENT_COL_TIME, messageDateTime); + set(table, DOCUMENT_COL_FLIGHT, callsign); + set(table, DOCUMENT_COL_REG, reg); + } + set(ui->documents, DOCUMENT_COL_TYPE, "Departure clearance"); + set(ui->logons, DOCUMENT_COL_TYPE, "Logon"); + + set(ui->atcMessages, ATC_COL_TIME, messageDateTime); + set(ui->atcMessages, ATC_COL_PROTOCOL, link); + set(ui->atcMessages, ATC_COL_DIR, QString(QChar(0x2191))); + set(ui->atcMessages, ATC_COL_FROM, callsign); + set(ui->atcMessages, ATC_COL_TO, callsign); + + set(ui->weather, WEATHER_COL_TIME, shownDateTime); + set(ui->weather, WEATHER_COL_AIRPORT, "WWWW"); + set(ui->weather, WEATHER_COL_TYPE, "Weather"); + set(ui->weather, WEATHER_COL_VIA, callsign); } void AircraftGUI::displaySettings() @@ -1985,13 +2035,26 @@ void AircraftGUI::updateHistoryTables() "When the aircraft was last heard", "Messages received from this aircraft" }; + // QTableWidgetItem sorts on the display role, so the dates have to sort correctly as + // TEXT. This format does - year first, zero padded throughout - which is why it is + // used here rather than a friendlier local format. + const QString dateFormat = "yyyy-MM-dd hh:mm"; + // The widest each column is likely to hold, for its initial width + const QStringList flightSamples = { "RYR33KQW", "WWWW", "WWWW", + dateTimeSample(dateFormat), dateTimeSample(dateFormat), "10000" }; + const QStringList aircraftSamples = { "G-ABCDEF", "WWWW", "WWWW", + dateTimeSample(dateFormat), dateTimeSample(dateFormat), "10000" }; + auto prepare = [](QTableWidget *table, const QStringList& headings, - const QStringList& tips) + const QStringList& tips, const QStringList& samples) { if (table->columnCount() == 0) { table->setColumnCount(headings.size()); table->setHorizontalHeaderLabels(headings); + for (int col = 0; (col < samples.size()) && (col < table->columnCount()); col++) { + table->setColumnWidth(col, columnWidthFor(table, col, samples[col])); + } for (int col = 0; (col < tips.size()) && (col < table->columnCount()); col++) { if (QTableWidgetItem *header = table->horizontalHeaderItem(col)) { @@ -2014,18 +2077,13 @@ void AircraftGUI::updateHistoryTables() } }; - // QTableWidgetItem sorts on the display role, so the dates have to sort correctly as - // TEXT. This format does - year first, zero padded throughout - which is why it is - // used here rather than a friendlier local format. - const QString dateFormat = "yyyy-MM-dd hh:mm"; - // The tracker flushes every 300 ms and every flush that touches a flight rebuilds // these tables, so a selection the user has just made would be wiped within a frame // or two of making it. Remember it and put it back. const quint64 keepSelected = m_selectedFlightId; // Past Flights: everything this aircraft has operated - prepare(ui->pastFlights, flightHeadings, flightTips); + prepare(ui->pastFlights, flightHeadings, flightTips, flightSamples); if (m_selectedAircraftId != 0) { int row = 0; @@ -2069,7 +2127,7 @@ void AircraftGUI::updateHistoryTables() } // Past Aircraft: everything that has operated this flight number - prepare(ui->pastAircraft, aircraftHeadings, aircraftTips); + prepare(ui->pastAircraft, aircraftHeadings, aircraftTips, aircraftSamples); if (!m_selectedFlightNumber.isEmpty()) { int row = 0; @@ -2849,11 +2907,17 @@ void AircraftGUI::plotChart() m_chartXAxis = new QDateTimeAxis(); m_chartXAxis->setFormat("hh:mm:ss"); + // ADS-B runs at hundreds of messages a second where the other protocols manage a few, + // so on a shared axis every other series lay flat along the bottom. It, and the + // total it dominates, get an axis of their own on the right. m_chartYAxis = new QValueAxis(); m_chartYAxis->setTitleText("Msgs/s"); + m_chartADSBYAxis = new QValueAxis(); + m_chartADSBYAxis->setTitleText("ADS-B and total msgs/s"); m_chart->addAxis(m_chartXAxis, Qt::AlignBottom); m_chart->addAxis(m_chartYAxis, Qt::AlignLeft); + m_chart->addAxis(m_chartADSBYAxis, Qt::AlignRight); for (int i = 0; i < CHART_SERIES; i++) { @@ -2864,13 +2928,15 @@ void AircraftGUI::plotChart() ? AircraftTracker::protocolName(i) : QString("Total")); m_chart->addSeries(m_chartSeries[i]); m_chartSeries[i]->attachAxis(m_chartXAxis); - m_chartSeries[i]->attachAxis(m_chartYAxis); + m_chartSeries[i]->attachAxis(onADSBAxis(i) ? m_chartADSBYAxis : m_chartYAxis); } const QDateTime now = QDateTime::currentDateTime(); m_chartXAxis->setMin(now.addSecs(-60)); m_chartXAxis->setMax(now); m_chartYAxis->setRange(0.0, 10.0); + m_chartADSBYAxis->setRange(0.0, 10.0); + m_chartYZoomed = false; ui->chart->setChart(m_chart); @@ -2890,9 +2956,183 @@ void AircraftGUI::legendMarkerClicked() { marker->series()->setVisible(!marker->series()->isVisible()); marker->setVisible(true); + fitChartYAxes(); + } +} + +bool AircraftGUI::onADSBAxis(int series) +{ + return (series == AircraftReport::ADSB) || (series == AircraftReport::ProtocolCount); +} + +// Each axis fits what is plotted against it now, falling as well as rising. Only ever +// growing left one burst flattening the chart for as long as the feature ran. Every +// retained point counts, as the x axis normally starts at the oldest, and a series hidden +// from the legend does not. Once the user zooms the y axes they are left where they are. +void AircraftGUI::fitChartYAxes() +{ + if (m_chartYZoomed) { + return; + } + + qreal maxRate = 0.0; + qreal maxADSBRate = 0.0; + for (int i = 0; i < CHART_SERIES; i++) + { + if (m_chartSeries[i]->isVisible()) + { + qreal& max = onADSBAxis(i) ? maxADSBRate : maxRate; + for (int j = 0; j < m_chartSeries[i]->count(); j++) { + max = std::max(max, m_chartSeries[i]->at(j).y()); + } + } + } + m_chartYAxis->setRange(0.0, std::ceil(maxRate) + 1.0); + m_chartADSBYAxis->setRange(0.0, std::ceil(maxADSBRate) + 1.0); +} + +// Back to following the data: every retained point in view, the y axes fitted to them +void AircraftGUI::resetChartZoom() +{ + m_chartYZoomed = false; + fitChartYAxes(); + QLineSeries *series = m_chartSeries[0]; + if (series->count() > 1) + { + m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) series->at(0).x())); + m_chartXAxis->setMax(QDateTime::fromMSecsSinceEpoch((qint64) series->at(series->count() - 1).x())); + } +} + +// Scale the range [start, end] by a factor of two per wheel click, keeping the point at +// centre (0 to 1 along the range) where it is +static void scaleRange(qreal& start, qreal& end, qreal minRange, int delta, qreal centre) +{ + const qreal range = end - start; + const qreal factor = std::pow(2.0, delta / 120.0); + const qreal newRange = std::max(minRange, range / factor); + start = start + centre * (range - newRange); + end = start + newRange; +} + +// The same controls as the ADS-B demodulator's chart: the wheel zooms the time axis about +// the cursor, and with shift held the rate axes +void AircraftGUI::zoomChart(QWheelEvent *event) +{ + // Some platforms turn a shifted vertical wheel into a horizontal one + const int delta = (event->angleDelta().y() != 0) ? event->angleDelta().y() : event->angleDelta().x(); + const QPointF point = event->position(); + const QRectF plotArea = m_chart->plotArea(); + + if (delta == 0) { + return; + } + + if (event->modifiers() & Qt::ShiftModifier) + { + qreal y = (point.y() - plotArea.y()) / plotArea.height(); + y = 1.0 - std::min(1.0, std::max(0.0, y)); + + for (QValueAxis *axis : {m_chartYAxis, m_chartADSBYAxis}) + { + bool visible = false; + for (int i = 0; i < CHART_SERIES; i++) { + visible |= (onADSBAxis(i) == (axis == m_chartADSBYAxis)) && m_chartSeries[i]->isVisible(); + } + if (visible) + { + qreal min = axis->min(); + qreal max = axis->max(); + scaleRange(min, max, 0.1, delta, y); + axis->setRange(std::max(0.0, min), std::min(1e6, max)); + } + } + m_chartYZoomed = true; + } + else + { + QLineSeries *series = m_chartSeries[0]; + if (series->count() > 1) + { + qreal x = (point.x() - plotArea.x()) / plotArea.width(); + x = std::min(1.0, std::max(0.0, x)); + + qreal startMS = m_chartXAxis->min().toMSecsSinceEpoch(); + qreal endMS = m_chartXAxis->max().toMSecsSinceEpoch(); + // A sample comes every ten seconds, so a minute shows a handful + scaleRange(startMS, endMS, 60000.0, delta, x); + // Don't let the range exceed the data + startMS = std::max(series->at(0).x(), startMS); + endMS = std::min(series->at(series->count() - 1).x(), endMS); + m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) startMS)); + m_chartXAxis->setMax(QDateTime::fromMSecsSinceEpoch((qint64) endMS)); + } } } +bool AircraftGUI::eventFilter(QObject *obj, QEvent *event) +{ + if (m_chart && (obj == ui->chart->viewport())) + { + if (event->type() == QEvent::Wheel) + { + QWheelEvent *wheelEvent = static_cast(event); + zoomChart(wheelEvent); + wheelEvent->accept(); + return true; + } + else if (event->type() == QEvent::MouseButtonDblClick) + { + // Only in the plot area: a double click on the legend is two clicks there + QMouseEvent *mouseEvent = static_cast(event); + if ((mouseEvent->button() == Qt::LeftButton) && m_chart->plotArea().contains(mouseEvent->pos())) + { + resetChartZoom(); + return true; + } + } + } + return FeatureGUI::eventFilter(obj, event); +} + +// A pane shown again in the vertical splitter returns at the size it had when hidden, +// which is nothing if it was dragged shut. Give it a share of the splitter then, taken +// from the largest pane, or the button would seem to do nothing. +void AircraftGUI::showInSplitter(QWidget *widget) +{ + widget->setVisible(true); + // The splitter lays the pane out once the show reaches it + QTimer::singleShot(0, this, [this, widget]() { + QSplitter *splitter = ui->splitter; + const int index = splitter->indexOf(widget); + if ((index < 0) || !widget->isVisible()) { + return; + } + QList sizes = splitter->sizes(); + const int minimum = std::max(widget->minimumSizeHint().height(), 50); + if (sizes[index] >= minimum) { + return; + } + int total = 0; + int largest = -1; + for (int i = 0; i < sizes.size(); i++) + { + total += sizes[i]; + if ((i != index) && ((largest < 0) || (sizes[i] > sizes[largest]))) { + largest = i; + } + } + if (largest < 0) { + return; + } + const int wanted = std::max(minimum, total / 4); + const int take = std::min(wanted - sizes[index], sizes[largest] / 2); + sizes[index] += take; + sizes[largest] -= take; + splitter->setSizes(sizes); + }); +} + void AircraftGUI::trackerMessageRates(const QList& rates) { const QDateTime now = QDateTime::currentDateTime(); @@ -2904,11 +3144,15 @@ void AircraftGUI::trackerMessageRates(const QList& rates) pruneOrphanMessageRows(); } - // The axis fits what is plotted now, falling as well as rising. Only ever growing - // left one burst flattening the chart for as long as the feature ran. Every retained - // point is in view - the x axis starts at the oldest - and a series hidden from the - // legend does not count. - qreal maxRate = 0.0; + // The x axis follows the data at whichever ends it was showing: both when unzoomed, + // so every retained point stays in view, and only the newest when zoomed into the + // recent past, as the ADS-B demodulator's chart does + QLineSeries *first = m_chartSeries[0]; + const bool xAtMax = (first->count() == 0) + || ((qint64) first->at(first->count() - 1).x() == m_chartXAxis->max().toMSecsSinceEpoch()); + const bool xAtMin = (first->count() == 0) + || ((qint64) first->at(0).x() == m_chartXAxis->min().toMSecsSinceEpoch()); + for (int i = 0; (i < CHART_SERIES) && (i < rates.size()); i++) { m_chartSeries[i]->append(now.toMSecsSinceEpoch(), rates[i]); @@ -2916,20 +3160,13 @@ void AircraftGUI::trackerMessageRates(const QList& rates) if (m_chartSeries[i]->count() > 1000) { m_chartSeries[i]->removePoints(0, m_chartSeries[i]->count() - 1000); } - if (m_chartSeries[i]->isVisible()) - { - for (int j = 0; j < m_chartSeries[i]->count(); j++) { - maxRate = std::max(maxRate, m_chartSeries[i]->at(j).y()); - } - } } - const qreal yMax = std::ceil(maxRate) + 1.0; - if (m_chartYAxis->max() != yMax) { - m_chartYAxis->setMax(yMax); + fitChartYAxes(); + if (xAtMax) { + m_chartXAxis->setMax(now); } - m_chartXAxis->setMax(now); - if (m_chartSeries[0]->count() > 0) { - m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) m_chartSeries[0]->at(0).x())); + if (xAtMin && (first->count() > 0)) { + m_chartXAxis->setMin(QDateTime::fromMSecsSinceEpoch((qint64) first->at(0).x())); } } @@ -3140,7 +3377,11 @@ void AircraftGUI::statsContextMenu(const QPoint& pos) void AircraftGUI::on_stats_clicked(bool checked) { m_settings.m_displayStatistics = checked; - ui->statistics->setVisible(checked); + if (checked) { + showInSplitter(ui->statistics); + } else { + ui->statistics->setVisible(false); + } m_settingsKeys.append("displayStatistics"); applySettings(); } @@ -3157,13 +3398,18 @@ void AircraftGUI::chartContextMenu(const QPoint& pos) m_chartSeries[i]->clear(); } } + m_chartYZoomed = false; } } void AircraftGUI::on_displayChart_clicked(bool checked) { m_settings.m_displayChart = checked; - ui->chart->setVisible(checked); + if (checked) { + showInSplitter(ui->chart); + } else { + ui->chart->setVisible(false); + } m_settingsKeys.append("displayChart"); applySettings(); } diff --git a/plugins/feature/aircraft/aircraftgui.h b/plugins/feature/aircraft/aircraftgui.h index b689ff798..eecc888ee 100644 --- a/plugins/feature/aircraft/aircraftgui.h +++ b/plugins/feature/aircraft/aircraftgui.h @@ -146,8 +146,10 @@ private: static const int CHART_SERIES = AircraftReport::ProtocolCount + 1; QChart *m_chart = nullptr; QDateTimeAxis *m_chartXAxis = nullptr; - QValueAxis *m_chartYAxis = nullptr; + QValueAxis *m_chartYAxis = nullptr; // Every protocol but ADS-B + QValueAxis *m_chartADSBYAxis = nullptr; // ADS-B and the total, which it dominates QLineSeries *m_chartSeries[CHART_SERIES]; + bool m_chartYZoomed = false; // The y axes stop fitting the data once zoomed // Flight profile chart, from the tracker's profile snapshots QChart *m_profileChart = nullptr; @@ -167,6 +169,8 @@ private: explicit AircraftGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr); virtual ~AircraftGUI(); + bool eventFilter(QObject *obj, QEvent *event) override; + void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); @@ -206,6 +210,11 @@ private: void selectFlightById(quint64 flightId); void selectAircraft(quint64 aircraftId); void plotChart(); + static bool onADSBAxis(int series); + void fitChartYAxes(); + void resetChartZoom(); + void zoomChart(QWheelEvent *event); + void showInSplitter(QWidget *widget); void plotProfileChart(); void watchFlight(quint64 flightId, const QString& title); void updatePhoto(const QString& registration, quint32 icao); diff --git a/plugins/feature/aircraft/aircraftgui.ui b/plugins/feature/aircraft/aircraftgui.ui index cee2fa919..8914071cb 100644 --- a/plugins/feature/aircraft/aircraftgui.ui +++ b/plugins/feature/aircraft/aircraftgui.ui @@ -1144,7 +1144,7 @@ - Message rate per protocol. Click a legend entry to show/hide a series. + Message rate per protocol, with ADS-B and the total on the right hand axis. Click a legend entry to show/hide a series. Mouse wheel zooms the time axis, shift + wheel the rate axes; double click to reset. diff --git a/plugins/feature/aircraft/readme.md b/plugins/feature/aircraft/readme.md index 663466615..cfb99000d 100644 --- a/plugins/feature/aircraft/readme.md +++ b/plugins/feature/aircraft/readme.md @@ -7,7 +7,7 @@ aircraft list, and sends the combined aircraft to the [Map feature](../map/readm Sightings are received from the [ADS-B demodulator](../../channelrx/demodadsb/readme.md), the [ACARS demodulator](../../channelrx/demodacars/readme.md) (VHF ACARS, VDL Mode 2 -HFDL and Aero modes) and the [SELCAL demodulator](../../channelrx/demodselcal/readme.md), +HFDL, Aero and Iridium modes) and the [SELCAL demodulator](../../channelrx/demodselcal/readme.md), from any number of channels in any device set. Combining protocols matters because each sees a different slice of a flight: ADS-B gives @@ -46,15 +46,7 @@ The upper half of the window holds the traffic: ![Flights Table](../../../doc/img/AircraftFeature_flights_table.png) * **Weather** - METARs, TAFs, D-ATIS, TWIPs, NOTAMs, PIREPs and SIGMETs carried by ACARS. - They arrive through whichever aircraft asked for them but describe an **airport**, not - that aircraft, so they are kept for the session rather than against a flight. Selecting - a row shows the full report. - - The aircraft's half of the exchange is not listed. A request names the airports it - wants and the report type - `EGKK LFPO LFBD LFBO-SA` - and says nothing about the - weather, so only uplinks are kept where a message is recognised by its label alone. - A body that actually contains a METAR, TAF, SIGMET or PIREP is kept whichever way it - was going, since a PIREP is a downlink by definition + Selecting a row shows the full report. The lower half describes whatever is selected above: @@ -89,6 +81,8 @@ listed here too, with the frequency they were heard on as the source - see [SELCAL](#selcal) below. With nothing selected, the table shows the SELCAL calls that could not be attributed to an aircraft +![ATC Tab](../../../doc/img/AircraftFeature_atc_tab.png) +

Past Aircraft

Every airframe that has operated the selected **flight number**. @@ -116,95 +110,7 @@ carries only a code, and a code can be shared by several aircraft. An attributed call counts as a message from the aircraft: it adds "SELCAL" and the frequency to the aircraft's protocols and updates when it was last seen. It carries no position, so nothing moves on the Map. Every call, attributed or not, is listed in the ATC -tab. A call never creates an aircraft, and calls the feature cannot attribute are listed -against no aircraft. - -

Chart

- -The chart plots the message rate per protocol (and in total) over time. Click a legend -entry to show or hide a series. It is shown and hidden with the chart button, and -appears at the bottom of the splitter beneath the tables rather than in a tab, so the -rate can be watched at the same time as the traffic producing it. Right click the -button to clear the data. - -

Statistics

- -The statistics table can be shown and hidden with the statistic button. -Right click the button to reset the records. - -Every figure is given twice, side by side: for this session and for all time, each with -who set it and when. - -* **Maximum range**, one row per protocol - the furthest aircraft heard on ADS-B, ACARS, - VDL-2, HFDL and Aero. Per protocol rather than as one figure because the protocols are - not comparable: line of sight VHF, HF skywave and an L band satellite downlink have - nothing to do with one another, and a single "maximum range" would only ever show the - satellite -* **Fastest ground speed** and **Highest altitude**, with the aircraft that set each -* **Most aircraft at once** - the largest number heard within any 15 minute window -* **Aircraft heard** - how many different airframes -* **Total messages**, then one row per protocol giving that protocol's count and its - share of the total. The share is of that scope's own total, so a protocol that has been - quiet today shows its reduced share against its long run one rather than against nothing -* **Listening time** and **Messages per minute** - -![Statistics](../../../doc/img/AircraftFeature_statistics.png) - -

Settings

- -The gear button opens the settings dialog. - -**Timeouts** - -* Archive after (mins) - how long without a report before an aircraft moves to the Old - Aircraft table and comes off the Map. -* Keep for (days) - how long archived aircraft and their flights are kept in the session - database before being discarded. Zero keeps them forever, at the cost of a database - that grows without limit -* ADS-B position for (mins) - how long an aircraft stays on the Map after its last ADS-B - position -* ACARS position for (mins) - the same for a position from ACARS, VDL-2, HFDL or Aero. - Two figures rather than one because the protocols report at wildly different rates: - ADS-B about once a second, where an oceanic position report can be the only one for - many minutes. - -**Session database** - the file the aircraft, flights and messages are saved in. - -**Receive aircraft data from** - which demodulators this feature accepts reports from. -Unticked ones are ignored. - -**Use airline callsigns in Map labels** - writes the flight on the Map the way it is -spoken on the radio rather than the way it is transmitted: SPEEDBIRD 123 instead of -BAW123, using the airline's radio callsign from the airline database. - -**Show the maximum range record on the Map** - keeps the aircraft that set the all time -maximum range record permanently on the Map, drawn at the position it was in when it set -it rather than wherever it is now. The -bubble names the aircraft, the distance, the protocol it was heard on and when. It is the -best record across all protocols, and it stays until the record is beaten, the records are -reset, or this is turned off. - -A record set before positions were kept alongside them has nowhere to be drawn, and in -that case nothing is drawn until the record is beaten. Not the furthest record that -*could* be placed: that would put a marker on the Map giving one distance while the -statistics table gave another. The log says so when it happens. - -**Favour airline livery over aircraft type (3D map)** - when no 3D model exists of the -right type in the right livery, prefer a similar aircraft in the correct livery over an -exact type in the wrong one. - -**Livery aircraft icons (2D map)** - display aircraft on the 2D map using icons showing -their airline's livery, instead of black icons. The icon follows the aircraft's matched -3D model, so this requires the 3D models to have been downloaded via the Map feature. -Aircraft without a matching model are displayed with a white version of the plain icon. - -

Notifications

- -The notifications dialog holds rules matched against each aircraft's ICAO address, -registration, flight or type with a regular expression. When an aircraft first matches -a rule, the rule's speech text is read aloud and/or its command is executed, with -${icao} ${reg} ${flight} ${type} ${protocol} substituted. Each rule fires at most once -per aircraft. +tab.

Session persistence

@@ -214,34 +120,11 @@ when the feature is next opened. Tracks and flight profiles are **not** read at startup - only how many points each flight has, which is what lets the save go on appending to them. The points themselves are -fetched a flight at a time, when something wants to draw or chart one. On a season's -worth of history that is nine million rows not read, and about nine seconds off the time -the feature takes to open. The first time an existing database is opened after this -change it builds two indexes, which takes a couple of seconds and grows the file by about -a fifth; after that it is a no-op. On restore, aircraft that have not been heard within +fetched a flight at a time, when something wants to draw or chart one. +On restore, aircraft that have not been heard within the removal timeout are pruned, while the document and ATC logs are restored in full; restored aircraft with positions reappear on the Map with their full tracks. -The all time figures are kept in that database too, and belong to it: a range is measured -from a particular antenna, so keeping a database per site gives that site its own records. -Like the aircraft count below they are never touched by clearing the aircraft or by the -retention period - they outlive the traffic they were measured from. - -They used to be kept in the preset instead, on the grounds that they describe the -receiving setup rather than the traffic. That was the wrong home: the database *is* the -per setup file, a preset gets copied to other machines where the ranges no longer mean -anything, and it left the records in one place and the airframe count that belongs beside -them in the other - so switching databases gave one database's count with another's -records. A preset written before the move still carries them, and they are imported into -the database once, the first time one is opened that has none of its own. - -The all time aircraft count is kept differently from the rest, because it cannot be a -running total: the -same airframe heard on two days has to count once, so it needs the set of which -airframes have been heard rather than a number. That set is a table in the database, and -it is the only thing there that is never pruned - so the count keeps growing after the -aircraft themselves have aged out. - Right clicking the statistics button offers to reset either half. Resetting the session starts it again from that moment without touching the all time figures. Resetting all time also clears the record of which airframes have been heard. @@ -265,14 +148,7 @@ Right clicking a cell in any of the tables offers, as they apply to that cell:

Map

-Aircraft with a position are sent to the Map feature, named by registration when known. - -When an Aircraft feature is present, the ADS-B demodulator stops sending -aircraft to the Map themselves. ADS-B sightings -pass through the demodulator's fully-built map item, so the 3D model, animations and -the complete aircraft state driving the Map's PFD display are preserved, with the -combined track and route information added. Without an Aircraft feature, the -ADS-B demodulator sends to the Map directly. +Aircraft with a position are sent to the [Map feature](../map/readme.md), named by registration when known. The map item carries: @@ -281,10 +157,7 @@ The map item carries: gaps, so a flight tracked on ADS-B and picked up again hours later on HFDL shows one continuous track, * A popup whose ICAO address, registration and flight number are **links**: clicking one - selects that aircraft or flight in this feature, which is usually the next question - someone looking at the Map has. They work on both the 2D and the 3D map, and appear - only where they can lead somewhere - an aircraft drawn by the ADS-B demodulator with no - Aircraft feature open gets plain text instead of a link that would do nothing, + selects that aircraft or flight in this feature. * A popup headed by a side view of the type in the operator's livery and the country flag, followed by registration, flight, aircraft type, departure/arrival airports and the route where messages have revealed them, and the @@ -292,10 +165,8 @@ The map item carries: The routes an aircraft has been given are drawn too, but only for the aircraft or flight **selected** in the tables - a filed flight plan and an oceanic clearance alike - as a -line through the waypoints with a marker at each one. Every oceanic flight in earshot -files a clearance, so drawing them all covered the Map in lines that had nothing to do -with what you were looking at. Selecting an aircraft draws the flight it is on now. A -flight +line through the waypoints with a marker at each one. +Selecting an aircraft draws the flight it is on now. A flight plan comes from an FPN message or a position report's route insert; a clearance from an oceanic clearance or its readback. Both are bookended with the departure and arrival airports so the line starts and finishes somewhere recognisable, and the route's popup @@ -305,101 +176,17 @@ flight level and Mach are. Routes are drawn in the Map's **Aircraft Routes** item group rather than the Aircraft one, so that their colour, labels and above all their minimum zoom can be set independently of the aircraft icons. An icon has to be decluttered away when the map is zoomed out, where a -route drawn across an ocean is exactly what you want to see at that zoom - one setting -could not do both. The group defaults to a minimum zoom of 0, so routes stay visible -however far out the map is zoomed. - -**A flight plan is assembled from the inserts that carry it.** An aircraft files the -departure end - runway, SID and the en route path - in one message and the arrival end - -STAR and approach - in another, so each part is taken from whichever message carried it -and the popup shows the whole plan in the order it is flown. The path is only replaced by -a message that has one, and only when it names at least as many waypoints that can be -placed - otherwise the insert carrying nothing but "ILS 19L" would erase the line drawn -from the one before it. An insert naming a different departure or arrival is a re-file -rather than another part, and replaces the plan outright. - -**A named SID or STAR is expanded into the fixes it flies through.** A plan names its -departure and arrival procedures rather than listing them - "runway 26L, LAM1Z departure" - -so the line used to leave the airport straight for the first en route fix, which is not -where the aircraft goes: a SID out of Gatwick turns through half a dozen fixes before it -joins the airway. Where the SID/STAR database holds the procedure, its fixes are drawn -between the aerodrome and the route, in the order they are flown. The procedure is looked -up against the plan's own departure or arrival airport, by ICAO code, and its type is -given as well as its name - the same name can be a departure at one airport and an -arrival at another, as LAM1Z is a SID at Gatwick and a STAR at Heathrow. A runway -qualifier is ignored, so LAM1Z and LAM1Z/26L both find it. - -A procedure fix names its procedure on the Map, and is drawn at the altitude the -procedure requires. A fix is named for the procedure it belongs to - KKE02, KKN43 - so on -its own it is an unexplained marker in the middle of nowhere; its popup now gives the SID -or STAR it came from. Where the procedure constrains the altitude, that is shown as the -plate reads it - "5000 ft" for a crossing altitude, "2000 ft or above" for a floor, -"5000 to 7000 ft" for a window - and the fix is drawn at that altitude rather than on the -ground, so a departure climbs on the 3D map instead of lying flat. - -The database gives every procedure fix a position, so they are never looked up by name - -which matters, because a procedure fix is named for its procedure (KKE02, KKN43) and is in -no en route waypoint database. A procedure usually ends on a fix the plan then names as -its first waypoint, and the two are collapsed into one. Coverage is partial: where the -procedure is not held, or the database has not been downloaded, the route is drawn exactly -as it was before. - -**A plan files a shorter name than the database holds, and both are matched.** An ARINC -424 procedure identifier is the significant fix, a validity digit and a route letter, and -it is limited to six characters - so a five letter fix is truncated to four and a plan -files ROXO1H where the procedure is really ROXOG1H. Both forms find it. The shortened -names are indexed only where they are unambiguous, which is checked rather than assumed: -an alias that shadowed a real procedure would draw the wrong route rather than none, which -is a worse failure than the one it fixes. On the current database all 1475 are -unambiguous. - -**A plan is assembled from any insert that carries part of it, not only one that carries -a path.** The arrival end of a plan names no waypoints at all - just the STAR and the -approach - so an insert carrying the STAR was being dropped whole, and the STAR never -reached the plan being assembled. That is the usual way a STAR arrives, so without this -most of them were never captured at all. A plan that has no path of its own is still -drawn when a procedure can be expanded into one. - -Plans stored before the runway, SID, STAR, approach and alternate were kept have those -parts recovered from the message that filed it, which is held with the plan. The text is -this application's own rendering, one "Label: value" a line, so it reads back reliably; -only a part that is empty is filled, so nothing a message actually filed is overwritten. -Once the flight is saved again the parts are stored properly. - -The database is downloaded from the **Map** feature's settings dialog, alongside the -airport, airspace, NAVAID and waypoint databases, and is picked up on the next route drawn -without needing a restart. It is a snapshot of one AIRAC cycle, and a procedure's name -carries its revision - a plan filing FRAN1M does not match a database holding FRANE1Z, -which is a different revision of the same departure, and nothing is drawn rather than a -route the aircraft is not flying. - -Each name is resolved against the airport, waypoint and navaid databases - four -characters is an airport, five a waypoint, three a VOR or NDB ident, and anything of the -form 58N030W an oceanic position, with the minutes optional on either half so that -5730N020W and 5730N02030W are read too - and any that cannot be resolved is dropped. -Where the message gave a waypoint's position itself, that is used in preference, which is -what places the fixes no database holds. Selecting another -aircraft or flight moves the lines to it; they are kept for an archived flight, so -selecting one still shows where the aircraft was going. +route drawn across an ocean is exactly what you want to see at that zoom. Selecting one of an aircraft's past flights draws that flight's track instead of the one -it is on now. Where the aircraft is still being heard the track is part of its own map -item; where it has been archived the aircraft is no longer on the Map at all, so the track -is drawn on its own, as a line named after the flight. Its popup gives the route, when the -flight was heard and how many points it has. The aircraft itself is deliberately not put -back: an icon at a position from hours ago would say it is still there, which a track of -where it went does not. - -Stale positions from stored performance log dumps (seen with HFDL) are ignored: a -position timestamped well before the newest known position for that aircraft does not -move it. +it is on now. Aircraft are removed from the table and the Map after a configurable number of minutes without a report.

Interface

-![Aircraft feature plugin GUI](../../../doc/img/Aircraft_plugin.png) +![Aircraft feature plugin GUI](../../../doc/img/AircraftFeature_plugin.png)

1: Find column

@@ -415,28 +202,130 @@ Deletes all aircraft from the tables and removes them from the Map.

4: Notifications

-Opens the notifications dialog. See Notifications above. +Opens the notifications dialog. + +The notifications dialog holds rules matched against each aircraft's ICAO address, +registration, flight or type with a regular expression. When an aircraft first matches +a rule, the rule's speech text is read aloud and/or its command is executed, with +${icao} ${reg} ${flight} ${type} ${protocol} substituted. Each rule fires at most once +per aircraft.

5: ATC

When checked, aircraft labels on the Map show route, flight level, speed and type in -an ATC style, like the ADS-B demodulator's ATC button; when unchecked just the flight -number or registration is shown. +an ATC style; when unchecked just the flight number or registration is shown.

6: Statistics

-Shows and hides the statistics table, which appears in the splitter beside the aircraft -and flight tables. Right click to reset the session figures or the all time ones. +The statistics table can be shown and hidden with the statistic button. +Right click the button to reset the records. + +Every figure is given twice, side by side: for this session and for all time, each with +who set it and when. + +* **Maximum range**, one row per protocol - the furthest aircraft heard on ADS-B, ACARS, + VDL-2, HFDL and Aero. Per protocol rather than as one figure because the protocols are + not comparable: line of sight VHF, HF skywave and an L band satellite downlink have + nothing to do with one another, and a single "maximum range" would only ever show the + satellite +* **Fastest ground speed** and **Highest altitude**, with the aircraft that set each +* **Most aircraft at once** - the largest number heard within any 15 minute window +* **Aircraft heard** - how many different airframes +* **Total messages**, then one row per protocol giving that protocol's count and its + share of the total. The share is of that scope's own total, so a protocol that has been + quiet today shows its reduced share against its long run one rather than against nothing +* **Listening time** and **Messages per minute** + +![Statistics](../../../doc/img/AircraftFeature_statistics.png)

7: Chart

-Shows and hides the message rate chart, at the bottom of the splitter. Right click to -clear the data. +Shows and hides the message rate chart. Right click the button to clear the data. + +The chart plots the message rate per protocol (and in total) over time. ADS-B and the +total, which runs hundreds of times faster than the other protocols, are plotted against +the right hand axis; every other protocol against the left. Click a legend entry to show +or hide a series. + +The mouse wheel zooms the time axis in and out about +the cursor, and with shift held, the rate axes. Double click the plot to go back to +showing all the data, with the rate axes fitted to it. + +![Message rate chart](../../../doc/img/AircraftFeature_chart.png) + +

8: Coverage

+ +Check to display per protocol receiver coverage on the map, for this session. + +![Coverage](../../../doc/img/AircraftFeature_coverage.png) + +

9: Feed

+ +The Feed button forwards every ACARS message the ACARS demodulators decode on to +community aggregators, as acarsdec-style JSON - one object per UDP datagram, or a +newline-delimited stream over TCP. Right click it for the settings: a station identifier +sent with every message, and per-service enables with host, port and protocol. + +It lives here rather than in the ACARS demodulator because a receiver runs one of those +per band - VHF, VDL-2, HFDL - and the feed had to be filled in identically in each, +opening three sets of connections to the same aggregator under the same station identity. +The station is a property of the receiver, so it is set up once and every demodulator +feeds through it. + +Note that airframes.io assigns the protocol **per station type**: their VDL2 (vdlm2dec) +wizard says TCP 5555, while the ACARS (acarsdec) station type ingests **UDP on 5550** and +shows no protocol box at all. SDRangel emits acarsdec-format JSON, so create an +ACARS/acarsdec station for this feed. A TCP connection to 5550 is refused, which shows up +as a "feed not connected ... reconnecting, message dropped" loop in the log. + +Unlike the aircraft tables, the feed is not filtered by the per-demodulator enables in the +settings dialog: those say which demodulators contribute to what is tracked, and a +receiver may reasonably want to feed a band it does not track. + +

10: Settings

-

8: Settings

+Click to open the settings dialog. -Opens the settings dialog - timeouts, the session database, which demodulators to accept -reports from, and the Map options. See Settings above. +![Clearance](../../../doc/img/AircraftFeature_settings.png) + +**Timeouts** + +* Archive after (mins) - how long without a report before an aircraft moves to the Old + Aircraft table and comes off the Map. +* Keep for (days) - how long archived aircraft and their flights are kept in the session + database before being discarded. Zero keeps them forever, at the cost of a database + that grows without limit +* ADS-B position for (mins) - how long an aircraft stays on the Map after its last ADS-B + position +* ACARS position for (mins) - the same for a position from ACARS, VDL-2, HFDL, Aero or Iridium. + Two figures rather than one because the protocols report at wildly different rates: + ADS-B about once a second, where an oceanic position report can be the only one for + many minutes. + +**Session database** - the file the aircraft, flights and messages are saved in. + +**Receive aircraft data from** - which demodulators this feature accepts reports from. +Unticked ones are ignored. + +**Use airline callsigns in Map labels** - writes the flight on the Map the way it is +spoken on the radio rather than the way it is transmitted: SPEEDBIRD 123 instead of +BAW123, using the airline's radio callsign from the airline database. + +**Show the maximum range record on the Map** - keeps the aircraft that set the all time +maximum range record permanently on the Map, drawn at the position it was in when it set +it rather than wherever it is now. The +bubble names the aircraft, the distance, the protocol it was heard on and when. It is the +best record across all protocols, and it stays until the record is beaten, the records are +reset, or this is turned off. + +**Favour airline livery over aircraft type (3D map)** - when no 3D model exists of the +right type in the right livery, prefer a similar aircraft in the correct livery over an +exact type in the wrong one. + +**Livery aircraft icons (2D map)** - display aircraft on the 2D map using icons showing +their airline's livery, instead of black icons. The icon follows the aircraft's matched +3D model, so this requires the 3D models to have been downloaded via the Map feature. +Aircraft without a matching model are displayed with a white version of the plain icon.

Aircraft table

@@ -454,19 +343,17 @@ The table shows one row per aircraft: * Country - Flag of the country of registration * Lat, Lon - Latest position in degrees * Dist (km) - Great circle distance from the receiver to the aircraft. Measured from - the position of the **device the report arrived on** when that device knows where it + the position of the device the report arrived on when that device knows where it is - a remote SDR reports the position of the server, not of you - and from Preferences > My Position otherwise. So the figure always means "from the antenna - that heard it", which matters when receiving from somewhere other than where you are + that heard it" * Alt (ft) - Altitude in feet * Hdg - Heading or track in degrees * Spd (kn) - Speed in knots * Protocols - Every protocol and frequency the **airframe** has been received on (e.g. "ACARS 131.725; HFDL 5.720"), over every flight it has made and for as long as it is kept. The Flights table has a column of the same name holding the same thing for - a single flight, and that is the one the Map shows - an airframe heard on HFDL over - the Atlantic last month is not being heard on HFDL now, so naming it beside the - aircraft on the Map would be wrong. + a single flight, and that is the one the Map shows * Msgs - Number of messages received * Last seen - Time of the last report * SELCAL - The aircraft's SELCAL code: the one it was heard called on, otherwise what the @@ -483,18 +370,15 @@ flights that have finished: the column always says what the aircraft is being called * Flight No - The IATA form, as ACARS carries it (e.g. BY07BD). The two are the same flight: an airline has a three letter ICAO designator and a two character IATA one, so - TUI Airways is TOM and BY, and 7BD is 07BD without the leading zero. They are matched - on the flight number alone - safe, because a match is only ever looked for within one - airframe - and either cell's tooltip lists every name the flight is known by + TUI Airways is TOM and BY, and 7BD is 07BD without the leading zero * Reg - Registration of the airframe that flew it * From, To - Departure and arrival airports * Out, Off, On, In - The four OOOI times: off the gate, airborne, landed, on the gate * First seen, Last seen - When the flight was first and last heard * LS, OC, FP - A tick where the flight has produced a loadsheet, an oceanic clearance or - a flight plan. Blank where it has not, rather than a cross: a column of crosses is as - loud as a column of ticks, which makes the ticks harder to pick out + a flight plan * Docs - Number of documents collected -* Protocols - Protocols and frequencies **this flight** has been heard on. The Aircraft +* Protocols - Protocols and frequencies this flight has been heard on. The Aircraft table's column of the same name is the airframe's, over every flight it has made Columns in either table can be reordered by dragging, hidden via the right-click header @@ -522,29 +406,6 @@ Where several flights have carried that number, the most recently heard is chose

Attribution

-## Feeding aggregators - -The **Feed** button forwards every ACARS message the ACARS demodulators decode on to -community aggregators, as acarsdec-style JSON - one object per UDP datagram, or a -newline-delimited stream over TCP. Right click it for the settings: a station identifier -sent with every message, and per-service enables with host, port and protocol. - -It lives here rather than in the ACARS demodulator because a receiver runs one of those -per band - VHF, VDL-2, HFDL - and the feed had to be filled in identically in each, -opening three sets of connections to the same aggregator under the same station identity. -The station is a property of the receiver, so it is set up once and every demodulator -feeds through it. - -Note that airframes.io assigns the protocol **per station type**: their VDL2 (vdlm2dec) -wizard says TCP 5555, while the ACARS (acarsdec) station type ingests **UDP on 5550** and -shows no protocol box at all. SDRangel emits acarsdec-format JSON, so create an -ACARS/acarsdec station for this feed. A TCP connection to 5550 is refused, which shows up -as a "feed not connected ... reconnecting, message dropped" loop in the log. - -Unlike the aircraft tables, the feed is not filtered by the per-demodulator enables in the -settings dialog: those say which demodulators contribute to what is tracked, and a -receiver may reasonably want to feed a band it does not track. - Aircraft and route data from the [OpenSky Network](https://opensky-network.org/). Aircraft photographs from [PlaneSpotters](https://www.planespotters.net/).