1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

ADSB demod: added auto target checkbox for matching aircraft in notifications table. API: more settings and report data

This commit is contained in:
f4exb 2021-11-07 19:38:46 +01:00
parent e2923696b4
commit f5276e8c3e
21 changed files with 461 additions and 26 deletions

View File

@ -12,7 +12,7 @@ sdrangel (6.17.3-1) unstable; urgency=medium
* Add Logging to .csv file for some plugins. Issue #1035. PR #1038
* Remote sink: fixed socket deletion. Issue #1034
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sat, 05 Nov 2021 18:05:33 +0100
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sat, 06 Nov 2021 20:15:07 +0100
sdrangel (6.17.2-1) unstable; urgency=medium

2
debian/changelog vendored
View File

@ -12,7 +12,7 @@ sdrangel (6.17.3-1) unstable; urgency=medium
* Add Logging to .csv file for some plugins. Issue #1035. PR #1038
* Remote sink: fixed socket deletion. Issue #1034
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sat, 05 Nov 2021 18:05:33 +0100
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sat, 06 Nov 2021 20:15:07 +0100
sdrangel (6.17.2-1) unstable; urgency=medium

View File

@ -185,6 +185,18 @@ void ADSBDemod::applySettings(const ADSBDemodSettings& settings, bool force)
if ((settings.m_samplesPerBit != m_settings.m_samplesPerBit) || force) {
reverseAPIKeys.append("samplesPerBit");
}
if ((settings.m_correlateFullPreamble != m_settings.m_correlateFullPreamble) || force) {
reverseAPIKeys.append("correlateFullPreamble");
}
if ((settings.m_demodModeS != m_settings.m_demodModeS) || force) {
reverseAPIKeys.append("demodModeS");
}
if ((settings.m_interpolatorPhaseSteps != m_settings.m_interpolatorPhaseSteps) || force) {
reverseAPIKeys.append("interpolatorPhaseSteps");
}
if ((settings.m_interpolatorTapsPerPhase != m_settings.m_interpolatorTapsPerPhase) || force) {
reverseAPIKeys.append("interpolatorTapsPerPhase");
}
if ((settings.m_removeTimeout != m_settings.m_removeTimeout) || force) {
reverseAPIKeys.append("removeTimeout");
}
@ -197,6 +209,9 @@ void ADSBDemod::applySettings(const ADSBDemodSettings& settings, bool force)
if ((settings.m_feedPort != m_settings.m_feedPort) || force) {
reverseAPIKeys.append("beastPort");
}
if ((settings.m_feedFormat != m_settings.m_feedFormat) || force) {
reverseAPIKeys.append("feedFormat");
}
if ((settings.m_logFilename != m_settings.m_logFilename) || force) {
reverseAPIKeys.append("logFilename");
}
@ -315,6 +330,18 @@ void ADSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("samplesPerBit")) {
settings.m_samplesPerBit = response.getAdsbDemodSettings()->getSamplesPerBit();
}
if (channelSettingsKeys.contains("correlateFullPreamble")) {
settings.m_correlateFullPreamble = response.getAdsbDemodSettings()->getCorrelateFullPreamble() != 0;
}
if (channelSettingsKeys.contains("demodModeS")) {
settings.m_demodModeS = response.getAdsbDemodSettings()->getDemodModeS() != 0;
}
if (channelSettingsKeys.contains("interpolatorPhaseSteps")) {
settings.m_interpolatorPhaseSteps = response.getAdsbDemodSettings()->getInterpolatorPhaseSteps();
}
if (channelSettingsKeys.contains("interpolatorTapsPerPhase")) {
settings.m_interpolatorTapsPerPhase = response.getAdsbDemodSettings()->getInterpolatorTapsPerPhase();
}
if (channelSettingsKeys.contains("removeTimeout")) {
settings.m_removeTimeout = response.getAdsbDemodSettings()->getRemoveTimeout();
}
@ -327,6 +354,9 @@ void ADSBDemod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("beastPort")) {
settings.m_feedPort = response.getAdsbDemodSettings()->getBeastPort();
}
if (channelSettingsKeys.contains("feedFormat")) {
settings.m_feedFormat = (ADSBDemodSettings::FeedFormat) response.getAdsbDemodSettings()->getFeedFormat();
}
if (channelSettingsKeys.contains("logFilename")) {
settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename();
}
@ -376,10 +406,15 @@ void ADSBDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getAdsbDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getAdsbDemodSettings()->setCorrelationThreshold(settings.m_correlationThreshold);
response.getAdsbDemodSettings()->setSamplesPerBit(settings.m_samplesPerBit);
response.getAdsbDemodSettings()->setCorrelateFullPreamble(settings.m_correlateFullPreamble ? 1 : 0);
response.getAdsbDemodSettings()->setDemodModeS(settings.m_demodModeS ? 1 : 0);
response.getAdsbDemodSettings()->setInterpolatorPhaseSteps(settings.m_interpolatorPhaseSteps);
response.getAdsbDemodSettings()->setInterpolatorTapsPerPhase(settings.m_interpolatorTapsPerPhase);
response.getAdsbDemodSettings()->setRemoveTimeout(settings.m_removeTimeout);
response.getAdsbDemodSettings()->setBeastEnabled(settings.m_feedEnabled ? 1 : 0);
response.getAdsbDemodSettings()->setBeastHost(new QString(settings.m_feedHost));
response.getAdsbDemodSettings()->setBeastPort(settings.m_feedPort);
response.getAdsbDemodSettings()->setFeedFormat((int) settings.m_feedFormat);
response.getAdsbDemodSettings()->setRgbColor(settings.m_rgbColor);
response.getAdsbDemodSettings()->setLogFilename(new QString(settings.m_logFilename));
response.getAdsbDemodSettings()->setLogEnabled(settings.m_logEnabled);
@ -412,10 +447,13 @@ void ADSBDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons
response.getAdsbDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getAdsbDemodReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
if (m_targetAzElValid)
{
response.getAdsbDemodReport()->setTargetName(new QString(m_targetName));
response.getAdsbDemodReport()->setTargetAzimuth(m_targetAzimuth);
response.getAdsbDemodReport()->setTargetElevation(m_targetElevation);
response.getAdsbDemodReport()->setTargetRange(m_targetRange);
}
}
@ -443,6 +481,18 @@ void ADSBDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, c
if (channelSettingsKeys.contains("samplesPerBit") || force) {
swgADSBDemodSettings->setSamplesPerBit(settings.m_samplesPerBit);
}
if (channelSettingsKeys.contains("correlateFullPreamble") || force) {
swgADSBDemodSettings->setCorrelateFullPreamble(settings.m_correlateFullPreamble ? 1 : 0);
}
if (channelSettingsKeys.contains("demodModeS") || force) {
swgADSBDemodSettings->setDemodModeS(settings.m_demodModeS ? 1 : 0);
}
if (channelSettingsKeys.contains("interpolatorPhaseSteps") || force) {
swgADSBDemodSettings->setInterpolatorPhaseSteps(settings.m_interpolatorPhaseSteps);
}
if (channelSettingsKeys.contains("interpolatorTapsPerPhase") || force) {
swgADSBDemodSettings->setInterpolatorTapsPerPhase(settings.m_interpolatorTapsPerPhase);
}
if (channelSettingsKeys.contains("removeTimeout") || force) {
swgADSBDemodSettings->setRemoveTimeout(settings.m_removeTimeout);
}
@ -455,6 +505,9 @@ void ADSBDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, c
if (channelSettingsKeys.contains("beastPort") || force) {
swgADSBDemodSettings->setBeastPort(settings.m_feedPort);
}
if (channelSettingsKeys.contains("feedFormat") || force) {
swgADSBDemodSettings->setFeedFormat((int) settings.m_feedFormat);
}
if (channelSettingsKeys.contains("logFilename") || force) {
swgADSBDemodSettings->setLogFilename(new QString(settings.m_logFilename));
}
@ -512,15 +565,18 @@ void ADSBDemod::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void ADSBDemod::setTarget(const QString& name, float targetAzimuth, float targetElevation)
void ADSBDemod::setTarget(const QString& name, float targetAzimuth, float targetElevation, float targetRange)
{
m_targetAzimuth = targetAzimuth;
m_targetElevation = targetElevation;
m_targetRange = targetRange;
m_targetName = name;
m_targetAzElValid = true;
// Send to Rotator Controllers
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(this, "target");
if (mapMessageQueues)
{
QList<MessageQueue*>::iterator it = mapMessageQueues->begin();

View File

@ -119,7 +119,7 @@ public:
m_basebandSink->setMessageQueueToGUI(queue);
}
void setTarget(const QString& name, float targetAzimuth, float targetElevation);
void setTarget(const QString& name, float targetAzimuth, float targetElevation, float targetRange);
void clearTarget() { m_targetAzElValid = false; }
uint32_t getNumberOfDeviceStreams() const;
@ -138,6 +138,8 @@ private:
bool m_targetAzElValid;
float m_targetAzimuth;
float m_targetElevation;
float m_targetRange;
QString m_targetName;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;

View File

@ -438,7 +438,7 @@ bool AirportModel::setData(const QModelIndex &index, const QVariant& value, int
else if (idx == m_airports[row]->m_frequencies.size())
{
// Set airport as target
m_gui->target(m_airports[row]->m_name, m_azimuth[row], m_elevation[row]);
m_gui->target(m_airports[row]->m_name, m_azimuth[row], m_elevation[row], m_range[row]);
emit dataChanged(index, index);
}
return true;
@ -473,7 +473,7 @@ void ADSBDemodGUI::updatePosition(Aircraft *aircraft)
aircraft->m_rangeItem->setText(QString::number(aircraft->m_range/1000.0, 'f', 1));
aircraft->m_azElItem->setText(QString("%1/%2").arg(std::round(aircraft->m_azimuth)).arg(std::round(aircraft->m_elevation)));
if (aircraft == m_trackAircraft)
m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation);
m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation, aircraft->m_range);
// Send to Map feature
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes();
@ -1230,12 +1230,17 @@ void ADSBDemodGUI::checkStaticNotification(Aircraft *aircraft)
if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch())
{
highlightAircraft(aircraft);
if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) {
speechNotification(aircraft, m_settings.m_notificationSettings[i]->m_speech);
}
if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) {
commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command);
}
if (m_settings.m_notificationSettings[i]->m_autoTarget) {
targetAircraft(aircraft);
}
aircraft->m_notified = true;
}
}
@ -1292,12 +1297,17 @@ void ADSBDemodGUI::checkDynamicNotification(Aircraft *aircraft)
if (m_settings.m_notificationSettings[i]->m_regularExpression.match(match).hasMatch())
{
highlightAircraft(aircraft);
if (!m_settings.m_notificationSettings[i]->m_speech.isEmpty()) {
speechNotification(aircraft, m_settings.m_notificationSettings[i]->m_speech);
}
if (!m_settings.m_notificationSettings[i]->m_command.isEmpty()) {
commandNotification(aircraft, m_settings.m_notificationSettings[i]->m_command);
}
if (m_settings.m_notificationSettings[i]->m_autoTarget) {
targetAircraft(aircraft);
}
aircraft->m_notified = true;
}
}
@ -1951,7 +1961,7 @@ void ADSBDemodGUI::updateAirports()
}
// Set a static target, such as an airport
void ADSBDemodGUI::target(const QString& name, float az, float el)
void ADSBDemodGUI::target(const QString& name, float az, float el, float range)
{
if (m_trackAircraft)
{
@ -1960,7 +1970,7 @@ void ADSBDemodGUI::target(const QString& name, float az, float el)
m_aircraftModel.aircraftUpdated(m_trackAircraft);
m_trackAircraft = nullptr;
}
m_adsbDemod->setTarget(name, az, el);
m_adsbDemod->setTarget(name, az, el, range);
}
void ADSBDemodGUI::targetAircraft(Aircraft *aircraft)
@ -1976,7 +1986,7 @@ void ADSBDemodGUI::targetAircraft(Aircraft *aircraft)
// Track this aircraft
m_trackAircraft = aircraft;
if (aircraft->m_positionValid)
m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation);
m_adsbDemod->setTarget(aircraft->targetName(), aircraft->m_azimuth, aircraft->m_elevation, aircraft->m_range);
// Change colour of new target
aircraft->m_isTarget = true;
m_aircraftModel.aircraftUpdated(aircraft);

View File

@ -383,6 +383,7 @@ public:
m_showFreq.append(false);
m_azimuth.append(az);
m_elevation.append(el);
m_range.append(distance);
endInsertRows();
}
@ -397,6 +398,7 @@ public:
m_showFreq.removeAt(row);
m_azimuth.removeAt(row);
m_elevation.removeAt(row);
m_range.removeAt(row);
endRemoveRows();
}
}
@ -411,6 +413,7 @@ public:
m_showFreq.clear();
m_azimuth.clear();
m_elevation.clear();
m_range.clear();
endRemoveRows();
}
}
@ -478,6 +481,7 @@ private:
QList<bool> m_showFreq;
QList<float> m_azimuth;
QList<float> m_elevation;
QList<float> m_range;
};
class ADSBDemodGUI : public ChannelGUI {
@ -493,7 +497,7 @@ public:
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
void highlightAircraft(Aircraft *aircraft);
void targetAircraft(Aircraft *aircraft);
void target(const QString& name, float az, float el);
void target(const QString& name, float az, float el, float range);
bool setFrequency(float frequency);
bool useSIUints() { return m_settings.m_siUnits; }

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>435</width>
<width>604</width>
<height>1046</height>
</rect>
</property>
@ -36,13 +36,13 @@
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<width>600</width>
<height>141</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<width>600</width>
<height>0</height>
</size>
</property>
@ -225,7 +225,7 @@
<number>100000</number>
</property>
<property name="pageStep">
<number>1000000</number>
<number>100000</number>
</property>
<property name="value">
<number>2300000</number>
@ -283,7 +283,7 @@
<number>1</number>
</property>
<property name="value">
<number>16</number>
<number>4</number>
</property>
</widget>
</item>
@ -296,7 +296,10 @@
</size>
</property>
<property name="text">
<string>12</string>
<string>4</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@ -332,7 +335,7 @@
<widget class="QLabel" name="tapsPerPhaseText">
<property name="minimumSize">
<size>
<width>16</width>
<width>20</width>
<height>0</height>
</size>
</property>
@ -734,7 +737,7 @@
<rect>
<x>0</x>
<y>140</y>
<width>431</width>
<width>600</width>
<height>291</height>
</rect>
</property>
@ -744,6 +747,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>ADS-B Data</string>
</property>
@ -1046,7 +1055,7 @@
<rect>
<x>10</x>
<y>450</y>
<width>421</width>
<width>600</width>
<height>581</height>
</rect>
</property>
@ -1056,6 +1065,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Map</string>
</property>

View File

@ -63,6 +63,7 @@ void ADSBDemodNotificationDialog::accept()
notificationSettings->m_regExp = ui->table->item(i, NOTIFICATION_COL_REG_EXP)->data(Qt::DisplayRole).toString().trimmed();
notificationSettings->m_speech = ui->table->item(i, NOTIFICATION_COL_SPEECH)->data(Qt::DisplayRole).toString().trimmed();
notificationSettings->m_command = ui->table->item(i, NOTIFICATION_COL_COMMAND)->data(Qt::DisplayRole).toString().trimmed();
notificationSettings->m_autoTarget = ((QCheckBox *) ui->table->cellWidget(i, NOTIFICATION_COL_AUTOTARGET))->isChecked();
notificationSettings->updateRegularExpression();
m_settings->m_notificationSettings.append(notificationSettings);
}
@ -76,6 +77,7 @@ void ADSBDemodNotificationDialog::resizeTable()
dummy.m_regExp = "No emergency and some";
dummy.m_speech = "${aircraft} ${reg} has entered your airspace";
dummy.m_command = "/usr/home/sdrangel/myscript ${aircraft} ${reg}";
dummy.m_autoTarget = false;
addRow(&dummy);
ui->table->resizeColumnsToContents();
ui->table->selectRow(0);
@ -103,6 +105,8 @@ void ADSBDemodNotificationDialog::on_remove_clicked()
void ADSBDemodNotificationDialog::addRow(ADSBDemodSettings::NotificationSettings *settings)
{
QComboBox *match = new QComboBox();
QCheckBox *autoTarget = new QCheckBox();
autoTarget->setChecked(false);
QWidget *matchWidget = new QWidget();
QHBoxLayout *pLayout = new QHBoxLayout(matchWidget);
pLayout->addWidget(match);
@ -156,6 +160,7 @@ void ADSBDemodNotificationDialog::addRow(ADSBDemodSettings::NotificationSettings
ui->table->setItem(row, NOTIFICATION_COL_REG_EXP, regExpItem);
ui->table->setItem(row, NOTIFICATION_COL_SPEECH, speechItem);
ui->table->setItem(row, NOTIFICATION_COL_COMMAND, commandItem);
ui->table->setCellWidget(row, NOTIFICATION_COL_AUTOTARGET, autoTarget);
ui->table->setSortingEnabled(true);
}

View File

@ -47,7 +47,8 @@ private:
NOTIFICATION_COL_MATCH,
NOTIFICATION_COL_REG_EXP,
NOTIFICATION_COL_SPEECH,
NOTIFICATION_COL_COMMAND
NOTIFICATION_COL_COMMAND,
NOTIFICATION_COL_AUTOTARGET
};
static std::vector<int> m_columnMap;

View File

@ -66,6 +66,11 @@
<string>Command/script to execute when a match is made</string>
</property>
</column>
<column>
<property name="text">
<string>Auto target</string>
</property>
</column>
</widget>
</item>
<item row="5" column="0">

View File

@ -231,6 +231,7 @@ QDataStream& operator<<(QDataStream& out, const ADSBDemodSettings::NotificationS
out << settings->m_regExp;
out << settings->m_speech;
out << settings->m_command;
out << settings->m_autoTarget;
return out;
}
@ -241,6 +242,7 @@ QDataStream& operator>>(QDataStream& in, ADSBDemodSettings::NotificationSettings
in >> settings->m_regExp;
in >> settings->m_speech;
in >> settings->m_command;
in >> settings->m_autoTarget;
settings->updateRegularExpression();
return in;
}

View File

@ -75,6 +75,7 @@ struct ADSBDemodSettings
QString m_speech;
QString m_command;
QRegularExpression m_regularExpression;
bool m_autoTarget;
NotificationSettings();
void updateRegularExpression();

View File

@ -92,6 +92,8 @@ When clicked, opens the Notifications Dialog, which allows speech notifications
For example, you might want an audible notification when a particularly interesting aircraft is nearby or when an aircraft declares an emergency.
By running a program such as [cmail](https://www.inveigle.net/cmail/download), e-mail notifications can be sent.
Also you can set the target aircraft to the matching aircraft automatically by checking the box in the "Auto target" column.
Here are a few examples:
![Notifications Dialog](../../../doc/img/ADSBDemod_plugin_notifications.png)
@ -138,7 +140,7 @@ In the Speech and Command strings, variables can be used to substitute in data f
* ${speed}
* ${heading}
* ${range}
- ${azel}
* ${azel}
* ${category}
* ${status}
* ${squawk}
@ -146,7 +148,7 @@ In the Speech and Command strings, variables can be used to substitute in data f
* ${manufacturer}
* ${owner}
* ${operator}
- ${rssi}
* ${rssi}
* ${flightstatus}
* ${departure}
* ${arrival}

View File

@ -706,6 +706,9 @@ margin-bottom: 20px;
"channelSampleRate" : {
"type" : "integer"
},
"targetName" : {
"type" : "string"
},
"targetAzimuth" : {
"type" : "number",
"format" : "float"
@ -713,6 +716,10 @@ margin-bottom: 20px;
"targetElevation" : {
"type" : "number",
"format" : "float"
},
"targetRange" : {
"type" : "number",
"format" : "float"
}
},
"description" : "ADSBDemod"
@ -736,11 +743,29 @@ margin-bottom: 20px;
"samplesPerBit" : {
"type" : "integer"
},
"correlateFullPreamble" : {
"type" : "integer",
"description" : "Correlate on part or full preamble\n * 0 - part\n * 1 - full\n"
},
"demodModeS" : {
"type" : "integer",
"description" : "Demodulate all mode S frames or just ADS-B\n * 0 - just ADS-B\n * 1 - All mode S\n"
},
"interpolatorPhaseSteps" : {
"type" : "integer",
"description" : "Number of phase steps in channel interpolator"
},
"interpolatorTapsPerPhase" : {
"type" : "number",
"format" : "float",
"description" : "Number of taps per phase in channel interpolator"
},
"removeTimeout" : {
"type" : "integer"
},
"beastEnabled" : {
"type" : "integer"
"type" : "integer",
"description" : "Send data to beast server\n * 0 - Do not send data\n * 1 - Send data\n"
},
"beastHost" : {
"type" : "string"
@ -748,6 +773,10 @@ margin-bottom: 20px;
"beastPort" : {
"type" : "integer"
},
"feedFormat" : {
"type" : "integer",
"description" : "Format of sent data\n * 0 - Beast binary\n * 1 - Beast index\n"
},
"logFilename" : {
"type" : "string"
},
@ -51248,7 +51277,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2021-11-04T19:20:44.212+01:00
Generated 2021-11-07T12:25:19.263+01:00
</div>
</div>
</div>

View File

@ -14,14 +14,43 @@ ADSBDemodSettings:
format: float
samplesPerBit:
type: integer
correlateFullPreamble:
type: integer
description: >
Correlate on part or full preamble
* 0 - part
* 1 - full
demodModeS:
type: integer
description: >
Demodulate all mode S frames or just ADS-B
* 0 - just ADS-B
* 1 - All mode S
interpolatorPhaseSteps:
type: integer
description: Number of phase steps in channel interpolator
interpolatorTapsPerPhase:
type: number
format: float
description: Number of taps per phase in channel interpolator
removeTimeout:
type: integer
beastEnabled:
type: integer
description: >
Send data to beast server
* 0 - Do not send data
* 1 - Send data
beastHost:
type: string
beastPort:
type: integer
feedFormat:
type: integer
description: >
Format of sent data
* 0 - Beast binary
* 1 - Beast index
logFilename:
type: string
logEnabled:
@ -54,9 +83,14 @@ ADSBDemodReport:
format: float
channelSampleRate:
type: integer
targetName:
type: string
targetAzimuth:
type: number
format: float
targetElevation:
type: number
format: float
targetRange:
type: number
format: float

View File

@ -14,14 +14,43 @@ ADSBDemodSettings:
format: float
samplesPerBit:
type: integer
correlateFullPreamble:
type: integer
description: >
Correlate on part or full preamble
* 0 - part
* 1 - full
demodModeS:
type: integer
description: >
Demodulate all mode S frames or just ADS-B
* 0 - just ADS-B
* 1 - All mode S
interpolatorPhaseSteps:
type: integer
description: Number of phase steps in channel interpolator
interpolatorTapsPerPhase:
type: number
format: float
description: Number of taps per phase in channel interpolator
removeTimeout:
type: integer
beastEnabled:
type: integer
description: >
Send data to beast server
* 0 - Do not send data
* 1 - Send data
beastHost:
type: string
beastPort:
type: integer
feedFormat:
type: integer
description: >
Format of sent data
* 0 - Beast binary
* 1 - Beast index
logFilename:
type: string
logEnabled:
@ -54,9 +83,14 @@ ADSBDemodReport:
format: float
channelSampleRate:
type: integer
targetName:
type: string
targetAzimuth:
type: number
format: float
targetElevation:
type: number
format: float
targetRange:
type: number
format: float

View File

@ -706,6 +706,9 @@ margin-bottom: 20px;
"channelSampleRate" : {
"type" : "integer"
},
"targetName" : {
"type" : "string"
},
"targetAzimuth" : {
"type" : "number",
"format" : "float"
@ -713,6 +716,10 @@ margin-bottom: 20px;
"targetElevation" : {
"type" : "number",
"format" : "float"
},
"targetRange" : {
"type" : "number",
"format" : "float"
}
},
"description" : "ADSBDemod"
@ -736,11 +743,29 @@ margin-bottom: 20px;
"samplesPerBit" : {
"type" : "integer"
},
"correlateFullPreamble" : {
"type" : "integer",
"description" : "Correlate on part or full preamble\n * 0 - part\n * 1 - full\n"
},
"demodModeS" : {
"type" : "integer",
"description" : "Demodulate all mode S frames or just ADS-B\n * 0 - just ADS-B\n * 1 - All mode S\n"
},
"interpolatorPhaseSteps" : {
"type" : "integer",
"description" : "Number of phase steps in channel interpolator"
},
"interpolatorTapsPerPhase" : {
"type" : "number",
"format" : "float",
"description" : "Number of taps per phase in channel interpolator"
},
"removeTimeout" : {
"type" : "integer"
},
"beastEnabled" : {
"type" : "integer"
"type" : "integer",
"description" : "Send data to beast server\n * 0 - Do not send data\n * 1 - Send data\n"
},
"beastHost" : {
"type" : "string"
@ -748,6 +773,10 @@ margin-bottom: 20px;
"beastPort" : {
"type" : "integer"
},
"feedFormat" : {
"type" : "integer",
"description" : "Format of sent data\n * 0 - Beast binary\n * 1 - Beast index\n"
},
"logFilename" : {
"type" : "string"
},
@ -51248,7 +51277,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2021-11-04T19:20:44.212+01:00
Generated 2021-11-07T12:25:19.263+01:00
</div>
</div>
</div>

View File

@ -32,10 +32,14 @@ SWGADSBDemodReport::SWGADSBDemodReport() {
m_channel_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
target_name = nullptr;
m_target_name_isSet = false;
target_azimuth = 0.0f;
m_target_azimuth_isSet = false;
target_elevation = 0.0f;
m_target_elevation_isSet = false;
target_range = 0.0f;
m_target_range_isSet = false;
}
SWGADSBDemodReport::~SWGADSBDemodReport() {
@ -48,16 +52,24 @@ SWGADSBDemodReport::init() {
m_channel_power_db_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
target_name = new QString("");
m_target_name_isSet = false;
target_azimuth = 0.0f;
m_target_azimuth_isSet = false;
target_elevation = 0.0f;
m_target_elevation_isSet = false;
target_range = 0.0f;
m_target_range_isSet = false;
}
void
SWGADSBDemodReport::cleanup() {
if(target_name != nullptr) {
delete target_name;
}
}
@ -77,10 +89,14 @@ SWGADSBDemodReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&target_name, pJson["targetName"], "QString", "QString");
::SWGSDRangel::setValue(&target_azimuth, pJson["targetAzimuth"], "float", "");
::SWGSDRangel::setValue(&target_elevation, pJson["targetElevation"], "float", "");
::SWGSDRangel::setValue(&target_range, pJson["targetRange"], "float", "");
}
QString
@ -103,12 +119,18 @@ SWGADSBDemodReport::asJsonObject() {
if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
}
if(target_name != nullptr && *target_name != QString("")){
toJsonValue(QString("targetName"), target_name, obj, QString("QString"));
}
if(m_target_azimuth_isSet){
obj->insert("targetAzimuth", QJsonValue(target_azimuth));
}
if(m_target_elevation_isSet){
obj->insert("targetElevation", QJsonValue(target_elevation));
}
if(m_target_range_isSet){
obj->insert("targetRange", QJsonValue(target_range));
}
return obj;
}
@ -133,6 +155,16 @@ SWGADSBDemodReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->m_channel_sample_rate_isSet = true;
}
QString*
SWGADSBDemodReport::getTargetName() {
return target_name;
}
void
SWGADSBDemodReport::setTargetName(QString* target_name) {
this->target_name = target_name;
this->m_target_name_isSet = true;
}
float
SWGADSBDemodReport::getTargetAzimuth() {
return target_azimuth;
@ -153,6 +185,16 @@ SWGADSBDemodReport::setTargetElevation(float target_elevation) {
this->m_target_elevation_isSet = true;
}
float
SWGADSBDemodReport::getTargetRange() {
return target_range;
}
void
SWGADSBDemodReport::setTargetRange(float target_range) {
this->target_range = target_range;
this->m_target_range_isSet = true;
}
bool
SWGADSBDemodReport::isSet(){
@ -164,12 +206,18 @@ SWGADSBDemodReport::isSet(){
if(m_channel_sample_rate_isSet){
isObjectUpdated = true; break;
}
if(target_name && *target_name != QString("")){
isObjectUpdated = true; break;
}
if(m_target_azimuth_isSet){
isObjectUpdated = true; break;
}
if(m_target_elevation_isSet){
isObjectUpdated = true; break;
}
if(m_target_range_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,7 @@
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
@ -47,12 +48,18 @@ public:
qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate);
QString* getTargetName();
void setTargetName(QString* target_name);
float getTargetAzimuth();
void setTargetAzimuth(float target_azimuth);
float getTargetElevation();
void setTargetElevation(float target_elevation);
float getTargetRange();
void setTargetRange(float target_range);
virtual bool isSet() override;
@ -63,12 +70,18 @@ private:
qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet;
QString* target_name;
bool m_target_name_isSet;
float target_azimuth;
bool m_target_azimuth_isSet;
float target_elevation;
bool m_target_elevation_isSet;
float target_range;
bool m_target_range_isSet;
};
}

View File

@ -36,6 +36,14 @@ SWGADSBDemodSettings::SWGADSBDemodSettings() {
m_correlation_threshold_isSet = false;
samples_per_bit = 0;
m_samples_per_bit_isSet = false;
correlate_full_preamble = 0;
m_correlate_full_preamble_isSet = false;
demod_mode_s = 0;
m_demod_mode_s_isSet = false;
interpolator_phase_steps = 0;
m_interpolator_phase_steps_isSet = false;
interpolator_taps_per_phase = 0.0f;
m_interpolator_taps_per_phase_isSet = false;
remove_timeout = 0;
m_remove_timeout_isSet = false;
beast_enabled = 0;
@ -44,6 +52,8 @@ SWGADSBDemodSettings::SWGADSBDemodSettings() {
m_beast_host_isSet = false;
beast_port = 0;
m_beast_port_isSet = false;
feed_format = 0;
m_feed_format_isSet = false;
log_filename = nullptr;
m_log_filename_isSet = false;
log_enabled = 0;
@ -80,6 +90,14 @@ SWGADSBDemodSettings::init() {
m_correlation_threshold_isSet = false;
samples_per_bit = 0;
m_samples_per_bit_isSet = false;
correlate_full_preamble = 0;
m_correlate_full_preamble_isSet = false;
demod_mode_s = 0;
m_demod_mode_s_isSet = false;
interpolator_phase_steps = 0;
m_interpolator_phase_steps_isSet = false;
interpolator_taps_per_phase = 0.0f;
m_interpolator_taps_per_phase_isSet = false;
remove_timeout = 0;
m_remove_timeout_isSet = false;
beast_enabled = 0;
@ -88,6 +106,8 @@ SWGADSBDemodSettings::init() {
m_beast_host_isSet = false;
beast_port = 0;
m_beast_port_isSet = false;
feed_format = 0;
m_feed_format_isSet = false;
log_filename = new QString("");
m_log_filename_isSet = false;
log_enabled = 0;
@ -118,10 +138,15 @@ SWGADSBDemodSettings::cleanup() {
if(beast_host != nullptr) {
delete beast_host;
}
if(log_filename != nullptr) {
delete log_filename;
}
@ -159,6 +184,14 @@ SWGADSBDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&samples_per_bit, pJson["samplesPerBit"], "qint32", "");
::SWGSDRangel::setValue(&correlate_full_preamble, pJson["correlateFullPreamble"], "qint32", "");
::SWGSDRangel::setValue(&demod_mode_s, pJson["demodModeS"], "qint32", "");
::SWGSDRangel::setValue(&interpolator_phase_steps, pJson["interpolatorPhaseSteps"], "qint32", "");
::SWGSDRangel::setValue(&interpolator_taps_per_phase, pJson["interpolatorTapsPerPhase"], "float", "");
::SWGSDRangel::setValue(&remove_timeout, pJson["removeTimeout"], "qint32", "");
::SWGSDRangel::setValue(&beast_enabled, pJson["beastEnabled"], "qint32", "");
@ -167,6 +200,8 @@ SWGADSBDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&beast_port, pJson["beastPort"], "qint32", "");
::SWGSDRangel::setValue(&feed_format, pJson["feedFormat"], "qint32", "");
::SWGSDRangel::setValue(&log_filename, pJson["logFilename"], "QString", "QString");
::SWGSDRangel::setValue(&log_enabled, pJson["logEnabled"], "qint32", "");
@ -215,6 +250,18 @@ SWGADSBDemodSettings::asJsonObject() {
if(m_samples_per_bit_isSet){
obj->insert("samplesPerBit", QJsonValue(samples_per_bit));
}
if(m_correlate_full_preamble_isSet){
obj->insert("correlateFullPreamble", QJsonValue(correlate_full_preamble));
}
if(m_demod_mode_s_isSet){
obj->insert("demodModeS", QJsonValue(demod_mode_s));
}
if(m_interpolator_phase_steps_isSet){
obj->insert("interpolatorPhaseSteps", QJsonValue(interpolator_phase_steps));
}
if(m_interpolator_taps_per_phase_isSet){
obj->insert("interpolatorTapsPerPhase", QJsonValue(interpolator_taps_per_phase));
}
if(m_remove_timeout_isSet){
obj->insert("removeTimeout", QJsonValue(remove_timeout));
}
@ -227,6 +274,9 @@ SWGADSBDemodSettings::asJsonObject() {
if(m_beast_port_isSet){
obj->insert("beastPort", QJsonValue(beast_port));
}
if(m_feed_format_isSet){
obj->insert("feedFormat", QJsonValue(feed_format));
}
if(log_filename != nullptr && *log_filename != QString("")){
toJsonValue(QString("logFilename"), log_filename, obj, QString("QString"));
}
@ -301,6 +351,46 @@ SWGADSBDemodSettings::setSamplesPerBit(qint32 samples_per_bit) {
this->m_samples_per_bit_isSet = true;
}
qint32
SWGADSBDemodSettings::getCorrelateFullPreamble() {
return correlate_full_preamble;
}
void
SWGADSBDemodSettings::setCorrelateFullPreamble(qint32 correlate_full_preamble) {
this->correlate_full_preamble = correlate_full_preamble;
this->m_correlate_full_preamble_isSet = true;
}
qint32
SWGADSBDemodSettings::getDemodModeS() {
return demod_mode_s;
}
void
SWGADSBDemodSettings::setDemodModeS(qint32 demod_mode_s) {
this->demod_mode_s = demod_mode_s;
this->m_demod_mode_s_isSet = true;
}
qint32
SWGADSBDemodSettings::getInterpolatorPhaseSteps() {
return interpolator_phase_steps;
}
void
SWGADSBDemodSettings::setInterpolatorPhaseSteps(qint32 interpolator_phase_steps) {
this->interpolator_phase_steps = interpolator_phase_steps;
this->m_interpolator_phase_steps_isSet = true;
}
float
SWGADSBDemodSettings::getInterpolatorTapsPerPhase() {
return interpolator_taps_per_phase;
}
void
SWGADSBDemodSettings::setInterpolatorTapsPerPhase(float interpolator_taps_per_phase) {
this->interpolator_taps_per_phase = interpolator_taps_per_phase;
this->m_interpolator_taps_per_phase_isSet = true;
}
qint32
SWGADSBDemodSettings::getRemoveTimeout() {
return remove_timeout;
@ -341,6 +431,16 @@ SWGADSBDemodSettings::setBeastPort(qint32 beast_port) {
this->m_beast_port_isSet = true;
}
qint32
SWGADSBDemodSettings::getFeedFormat() {
return feed_format;
}
void
SWGADSBDemodSettings::setFeedFormat(qint32 feed_format) {
this->feed_format = feed_format;
this->m_feed_format_isSet = true;
}
QString*
SWGADSBDemodSettings::getLogFilename() {
return log_filename;
@ -458,6 +558,18 @@ SWGADSBDemodSettings::isSet(){
if(m_samples_per_bit_isSet){
isObjectUpdated = true; break;
}
if(m_correlate_full_preamble_isSet){
isObjectUpdated = true; break;
}
if(m_demod_mode_s_isSet){
isObjectUpdated = true; break;
}
if(m_interpolator_phase_steps_isSet){
isObjectUpdated = true; break;
}
if(m_interpolator_taps_per_phase_isSet){
isObjectUpdated = true; break;
}
if(m_remove_timeout_isSet){
isObjectUpdated = true; break;
}
@ -470,6 +582,9 @@ SWGADSBDemodSettings::isSet(){
if(m_beast_port_isSet){
isObjectUpdated = true; break;
}
if(m_feed_format_isSet){
isObjectUpdated = true; break;
}
if(log_filename && *log_filename != QString("")){
isObjectUpdated = true; break;
}

View File

@ -54,6 +54,18 @@ public:
qint32 getSamplesPerBit();
void setSamplesPerBit(qint32 samples_per_bit);
qint32 getCorrelateFullPreamble();
void setCorrelateFullPreamble(qint32 correlate_full_preamble);
qint32 getDemodModeS();
void setDemodModeS(qint32 demod_mode_s);
qint32 getInterpolatorPhaseSteps();
void setInterpolatorPhaseSteps(qint32 interpolator_phase_steps);
float getInterpolatorTapsPerPhase();
void setInterpolatorTapsPerPhase(float interpolator_taps_per_phase);
qint32 getRemoveTimeout();
void setRemoveTimeout(qint32 remove_timeout);
@ -66,6 +78,9 @@ public:
qint32 getBeastPort();
void setBeastPort(qint32 beast_port);
qint32 getFeedFormat();
void setFeedFormat(qint32 feed_format);
QString* getLogFilename();
void setLogFilename(QString* log_filename);
@ -112,6 +127,18 @@ private:
qint32 samples_per_bit;
bool m_samples_per_bit_isSet;
qint32 correlate_full_preamble;
bool m_correlate_full_preamble_isSet;
qint32 demod_mode_s;
bool m_demod_mode_s_isSet;
qint32 interpolator_phase_steps;
bool m_interpolator_phase_steps_isSet;
float interpolator_taps_per_phase;
bool m_interpolator_taps_per_phase_isSet;
qint32 remove_timeout;
bool m_remove_timeout_isSet;
@ -124,6 +151,9 @@ private:
qint32 beast_port;
bool m_beast_port_isSet;
qint32 feed_format;
bool m_feed_format_isSet;
QString* log_filename;
bool m_log_filename_isSet;