Skip to content

Commit 3827ff8

Browse files
authored
Merge pull request f4exb#2525 from srcejon/adbs_notification_arr
ADS-B: Add departure and arrival notifications.
2 parents b935db0 + 8d54c7e commit 3827ff8

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

plugins/channelrx/demodadsb/adsbdemodgui.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5080,7 +5080,10 @@ void ADSBDemodGUI::checkDynamicNotification(Aircraft *aircraft)
50805080
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_CATEGORY)
50815081
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STATUS)
50825082
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_SQUAWK)
5083-
)
5083+
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_DEP)
5084+
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_ARR)
5085+
|| (m_settings.m_notificationSettings[i]->m_matchColumn == ADSB_COL_STOPS)
5086+
)
50845087
{
50855088
QString match;
50865089
switch (m_settings.m_notificationSettings[i]->m_matchColumn)
@@ -5106,6 +5109,15 @@ void ADSBDemodGUI::checkDynamicNotification(Aircraft *aircraft)
51065109
case ADSB_COL_SQUAWK:
51075110
match = aircraft->m_squawkItem->data(Qt::DisplayRole).toString();
51085111
break;
5112+
case ADSB_COL_DEP:
5113+
match = aircraft->m_depItem->data(Qt::DisplayRole).toString();
5114+
break;
5115+
case ADSB_COL_ARR:
5116+
match = aircraft->m_arrItem->data(Qt::DisplayRole).toString();
5117+
break;
5118+
case ADSB_COL_STOPS:
5119+
match = aircraft->m_stopsItem->data(Qt::DisplayRole).toString();
5120+
break;
51095121
default:
51105122
break;
51115123
}

plugins/channelrx/demodadsb/adsbdemodnotificationdialog.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ std::vector<int> ADSBDemodNotificationDialog::m_columnMap = {
2828
ADSB_COL_ICAO, ADSB_COL_CALLSIGN, ADSB_COL_MODEL, ADSB_COL_TYPE,
2929
ADSB_COL_ALTITUDE, ADSB_COL_GROUND_SPEED, ADSB_COL_RANGE,
3030
ADSB_COL_CATEGORY, ADSB_COL_STATUS, ADSB_COL_SQUAWK,
31-
ADSB_COL_REGISTRATION, ADSB_COL_MANUFACTURER, ADSB_COL_OWNER, ADSB_COL_OPERATOR_ICAO
31+
ADSB_COL_REGISTRATION, ADSB_COL_MANUFACTURER, ADSB_COL_OWNER, ADSB_COL_OPERATOR_ICAO,
32+
ADSB_COL_ARR, ADSB_COL_DEP, ADSB_COL_STOPS
3233
};
3334

3435
ADSBDemodNotificationDialog::ADSBDemodNotificationDialog(ADSBDemodSettings *settings,
@@ -75,8 +76,8 @@ void ADSBDemodNotificationDialog::resizeTable()
7576
ADSBDemodSettings::NotificationSettings dummy;
7677
dummy.m_matchColumn = ADSB_COL_MANUFACTURER;
7778
dummy.m_regExp = "No emergency and some";
78-
dummy.m_speech = "${aircraft} ${reg} has entered your airspace";
79-
dummy.m_command = "/usr/home/sdrangel/myscript ${aircraft} ${reg}";
79+
dummy.m_speech = "${type} ${reg} has entered your airspace";
80+
dummy.m_command = "/usr/home/sdrangel/myscript ${type} ${reg}";
8081
dummy.m_autoTarget = false;
8182
addRow(&dummy);
8283
ui->table->resizeColumnsToContents();
@@ -128,6 +129,9 @@ void ADSBDemodNotificationDialog::addRow(ADSBDemodSettings::NotificationSettings
128129
match->addItem("Manufacturer");
129130
match->addItem("Owner");
130131
match->addItem("Operator");
132+
match->addItem("Arr");
133+
match->addItem("Dep");
134+
match->addItem("Stops");
131135

132136
QTableWidgetItem *regExpItem = new QTableWidgetItem();
133137
QTableWidgetItem *speechItem = new QTableWidgetItem();
@@ -146,12 +150,13 @@ void ADSBDemodNotificationDialog::addRow(ADSBDemodSettings::NotificationSettings
146150
regExpItem->setData(Qt::DisplayRole, settings->m_regExp);
147151
speechItem->setData(Qt::DisplayRole, settings->m_speech);
148152
commandItem->setData(Qt::DisplayRole, settings->m_command);
153+
autoTarget->setChecked(settings->m_autoTarget);
149154
}
150155
else
151156
{
152-
match->setCurrentIndex(2);
157+
match->setCurrentIndex(2);
153158
regExpItem->setData(Qt::DisplayRole, ".*");
154-
speechItem->setData(Qt::DisplayRole, "${aircraft} detected");
159+
speechItem->setData(Qt::DisplayRole, "${type} detected");
155160
}
156161

157162
ui->table->setSortingEnabled(false);

0 commit comments

Comments
 (0)