mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
DOA2: API implementation
This commit is contained in:
parent
1edf7a008d
commit
b48db22e84
@ -23,6 +23,7 @@
|
||||
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGWorkspaceInfo.h"
|
||||
#include "SWGChannelReport.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/hbfilterchainconverter.h"
|
||||
@ -46,7 +47,8 @@ DOA2::DOA2(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_guiMessageQueue(nullptr),
|
||||
m_frequencyOffset(0),
|
||||
m_deviceSampleRate(48000)
|
||||
m_deviceSampleRate(48000),
|
||||
m_deviceCenterFrequency(435000000)
|
||||
{
|
||||
setObjectName(m_channelId);
|
||||
|
||||
@ -136,6 +138,7 @@ void DOA2::applySettings(const DOA2Settings& settings, bool force)
|
||||
<< "m_antennaAz:" << settings.m_antennaAz
|
||||
<< "m_basebandDistance: " << settings.m_basebandDistance
|
||||
<< "m_squelchdB: " << settings.m_squelchdB
|
||||
<< "m_fftAveragingIndex: "<< settings.m_fftAveragingIndex
|
||||
<< "m_useReverseAPI: " << settings.m_useReverseAPI
|
||||
<< "m_reverseAPIAddress: " << settings.m_reverseAPIAddress
|
||||
<< "m_reverseAPIPort: " << settings.m_reverseAPIPort
|
||||
@ -173,6 +176,12 @@ void DOA2::applySettings(const DOA2Settings& settings, bool force)
|
||||
m_basebandSink->setMagThreshold(CalcDb::powerFromdB(settings.m_squelchdB));
|
||||
}
|
||||
|
||||
if ((m_settings.m_fftAveragingIndex != settings.m_fftAveragingIndex) || force)
|
||||
{
|
||||
reverseAPIKeys.append("m_fftAveragingIndex");
|
||||
m_basebandSink->setFFTAveraging(DOA2Settings::getAveragingValue(settings.m_fftAveragingIndex));
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2Decim != settings.m_log2Decim)
|
||||
|| (m_settings.m_filterChainHash != settings.m_filterChainHash) || force)
|
||||
{
|
||||
@ -237,6 +246,7 @@ bool DOA2::handleMessage(const Message& cmd)
|
||||
if (notif.getSourceOrSink()) // deals with source messages only
|
||||
{
|
||||
m_deviceSampleRate = notif.getSampleRate();
|
||||
m_deviceCenterFrequency = notif.getCenterFrequency();
|
||||
calculateFrequencyOffset(); // This is when device sample rate changes
|
||||
|
||||
// Notify baseband sink of input sample rate change
|
||||
@ -363,6 +373,17 @@ int DOA2::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int DOA2::webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage)
|
||||
{
|
||||
(void) errorMessage;
|
||||
response.setDoa2Report(new SWGSDRangel::SWGDOA2Report());
|
||||
response.getDoa2Report()->init();
|
||||
webapiFormatChannelReport(response);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void DOA2::webapiUpdateChannelSettings(
|
||||
DOA2Settings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
@ -384,6 +405,22 @@ void DOA2::webapiUpdateChannelSettings(
|
||||
validateFilterChainHash(settings);
|
||||
}
|
||||
|
||||
if (channelSettingsKeys.contains("phase")) {
|
||||
settings.m_phase = response.getDoa2Settings()->getPhase();
|
||||
}
|
||||
if (channelSettingsKeys.contains("antennaAz")) {
|
||||
settings.m_antennaAz = response.getDoa2Settings()->getAntennaAz();
|
||||
}
|
||||
if (channelSettingsKeys.contains("basebandDistance")) {
|
||||
settings.m_basebandDistance = response.getDoa2Settings()->getBasebandDistance();
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelchdB")) {
|
||||
settings.m_squelchdB = response.getDoa2Settings()->getSquelchdB();
|
||||
}
|
||||
if (channelSettingsKeys.contains("fftAveragingValue")) {
|
||||
settings.m_fftAveragingIndex = DOA2Settings::getAveragingIndex(response.getDoa2Settings()->getFftAveragingValue());
|
||||
}
|
||||
|
||||
if (channelSettingsKeys.contains("useReverseAPI")) {
|
||||
settings.m_useReverseAPI = response.getDoa2Settings()->getUseReverseApi() != 0;
|
||||
}
|
||||
@ -422,6 +459,11 @@ void DOA2::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response
|
||||
|
||||
response.getDoa2Settings()->setLog2Decim(settings.m_log2Decim);
|
||||
response.getDoa2Settings()->setFilterChainHash(settings.m_filterChainHash);
|
||||
response.getDoa2Settings()->setPhase(settings.m_phase);
|
||||
response.getDoa2Settings()->setAntennaAz(settings.m_antennaAz);
|
||||
response.getDoa2Settings()->setBasebandDistance(settings.m_basebandDistance);
|
||||
response.getDoa2Settings()->setSquelchdB(settings.m_squelchdB);
|
||||
response.getDoa2Settings()->setFftAveragingValue(DOA2Settings::getAveragingValue(settings.m_fftAveragingIndex));
|
||||
response.getDoa2Settings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
if (response.getDoa2Settings()->getReverseApiAddress()) {
|
||||
@ -477,6 +519,26 @@ void DOA2::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
{
|
||||
float phi = normalizeAngle(getPhi() * (180/M_PI), 180.0f);
|
||||
response.getDoa2Report()->setPhi(phi);
|
||||
|
||||
float hwl = 1.5e8 / (m_deviceCenterFrequency + m_frequencyOffset);
|
||||
float cosTheta = (getPhi() * hwl * 1000.0) / (M_PI * m_settings.m_basebandDistance);
|
||||
// float blindAngle = ((cosTheta < -1.0) || (cosTheta > 1.0) ? 0 : std::acos(hwl * 1000.0 / m_settings.m_basebandDistance)) * (180/M_PI);
|
||||
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
|
||||
qDebug("DOA2::webapiFormatChannelReport: phi: %f cosT: %f DOAngle: %f", getPhi(), cosTheta, doaAngle);
|
||||
float posAngle = normalizeAngle(m_settings.m_antennaAz - doaAngle, 360.0f); // DOA angles are trigonometric but displayed angles are clockwise
|
||||
float negAngle = normalizeAngle(m_settings.m_antennaAz + doaAngle, 360.0f);
|
||||
response.getDoa2Report()->setPosAz(posAngle);
|
||||
response.getDoa2Report()->setNegAz(negAngle);
|
||||
|
||||
response.getDoa2Report()->setFftSize(m_fftSize);
|
||||
int channelSampleRate = m_deviceSampleRate / (1<<m_settings.m_log2Decim);
|
||||
response.getDoa2Report()->setChannelSampleRate(channelSampleRate);
|
||||
}
|
||||
|
||||
void DOA2::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
@ -555,6 +617,21 @@ void DOA2::webapiFormatChannelSettings(
|
||||
if (channelSettingsKeys.contains("filterChainHash") || force) {
|
||||
swgDOA2Settings->setFilterChainHash(settings.m_filterChainHash);
|
||||
}
|
||||
if (channelSettingsKeys.contains("phase") || force) {
|
||||
swgDOA2Settings->setPhase(settings.m_phase);
|
||||
}
|
||||
if (channelSettingsKeys.contains("antennaAz") || force) {
|
||||
swgDOA2Settings->setAntennaAz(settings.m_antennaAz);
|
||||
}
|
||||
if (channelSettingsKeys.contains("basebandDistance") || force) {
|
||||
swgDOA2Settings->setBasebandDistance(settings.m_basebandDistance);
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelchdB") || force) {
|
||||
swgDOA2Settings->setSquelchdB(settings.m_squelchdB);
|
||||
}
|
||||
if (channelSettingsKeys.contains("fftAveragingValue") || force) {
|
||||
swgDOA2Settings->setFftAveragingValue(DOA2Settings::getAveragingValue(settings.m_fftAveragingIndex));
|
||||
}
|
||||
|
||||
if (settings.m_scopeGUI)
|
||||
{
|
||||
@ -598,3 +675,10 @@ void DOA2::networkManagerFinished(QNetworkReply *reply)
|
||||
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
float DOA2::normalizeAngle(float angle, float max)
|
||||
{
|
||||
if (angle < 0) { return max + angle; }
|
||||
if (angle > max) { return angle - max; }
|
||||
return angle;
|
||||
}
|
||||
|
@ -138,6 +138,10 @@ public:
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& query,
|
||||
QString& errorMessage);
|
||||
@ -168,12 +172,14 @@ private:
|
||||
|
||||
int64_t m_frequencyOffset;
|
||||
uint32_t m_deviceSampleRate;
|
||||
qint64 m_deviceCenterFrequency;
|
||||
int m_count0, m_count1;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
|
||||
void applySettings(const DOA2Settings& settings, bool force = false);
|
||||
static void validateFilterChainHash(DOA2Settings& settings);
|
||||
void calculateFrequencyOffset();
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DOA2Settings& settings, bool force);
|
||||
void sendChannelSettings(
|
||||
const QList<ObjectPipe*>& pipes,
|
||||
@ -187,6 +193,7 @@ private:
|
||||
const DOA2Settings& settings,
|
||||
bool force
|
||||
);
|
||||
static float normalizeAngle(float angle, float max);
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
|
@ -40,6 +40,8 @@ DOA2Baseband::DOA2Baseband(int fftSize) :
|
||||
m_wphSum(0.0f),
|
||||
m_phi(0.0f),
|
||||
m_magThreshold(0.0f),
|
||||
m_fftAvg(1),
|
||||
m_fftAvgCount(0),
|
||||
m_scopeSink(nullptr),
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
@ -257,6 +259,16 @@ void DOA2Baseband ::setBasebandSampleRate(unsigned int sampleRate)
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2Baseband::setFFTAveraging(int nbFFT)
|
||||
{
|
||||
qDebug("DOA2Baseband::setFFTAveraging: %d", nbFFT);
|
||||
m_fftAvg = nbFFT < 1 ? 1 : nbFFT;
|
||||
m_fftAvgCount = 0;
|
||||
m_magSum = 0;
|
||||
m_wphSum = 0;
|
||||
m_samplesCount = 0;
|
||||
}
|
||||
|
||||
void DOA2Baseband::processDOA(const std::vector<Complex>::iterator& begin, int nbSamples)
|
||||
{
|
||||
const std::vector<Complex>::iterator end = begin + nbSamples;
|
||||
@ -274,8 +286,13 @@ void DOA2Baseband::processDOA(const std::vector<Complex>::iterator& begin, int n
|
||||
|
||||
if (++m_samplesCount == m_fftSize)
|
||||
{
|
||||
if (m_wphSum != 0) {
|
||||
m_phi = m_wphSum / m_magSum;
|
||||
if (m_wphSum != 0)
|
||||
{
|
||||
if (++m_fftAvgCount == m_fftAvg)
|
||||
{
|
||||
m_phi = m_wphSum / m_magSum;
|
||||
m_fftAvgCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
m_magSum = 0;
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
void setBasebandSampleRate(unsigned int sampleRate);
|
||||
float getPhi() const { return m_phi; }
|
||||
void setMagThreshold(float threshold) { m_magThreshold = threshold * SDR_RX_SCALED * SDR_RX_SCALED; }
|
||||
void setFFTAveraging(int nbFFT);
|
||||
|
||||
private:
|
||||
void processFifo(const std::vector<SampleVector>& data, unsigned int ibegin, unsigned int iend);
|
||||
@ -122,11 +123,13 @@ private:
|
||||
DOA2Correlator m_correlator;
|
||||
DOA2Settings::CorrelationType m_correlationType;
|
||||
int m_fftSize;
|
||||
int m_samplesCount;
|
||||
float m_magSum;
|
||||
float m_wphSum;
|
||||
float m_phi;
|
||||
double m_magThreshold;
|
||||
int m_samplesCount; //!< Number of samples processed by DOA
|
||||
float m_magSum; //!< Squared magnitudes accumulator
|
||||
float m_wphSum; //!< Phase difference accumulator (averaging weighted by squared magnitude)
|
||||
float m_phi; //!< Resulting calculated phase difference
|
||||
double m_magThreshold; //!< Squared magnitude scaled threshold
|
||||
int m_fftAvg; //!< Average over a certain number of FFTs
|
||||
int m_fftAvgCount; //!< FFT averaging counter
|
||||
SampleMIFifo m_sampleMIFifo;
|
||||
std::vector<SampleVector::const_iterator> m_vbegin;
|
||||
int m_sizes[2];
|
||||
|
@ -42,6 +42,7 @@ DOA2Compass::DOA2Compass(QWidget *parent)
|
||||
m_azNeg = 0.0;
|
||||
m_azAnt = 0.0;
|
||||
m_blindAngle = 0.0;
|
||||
m_blindColor = QColor(48, 48, 48);
|
||||
}
|
||||
|
||||
DOA2Compass::~DOA2Compass()
|
||||
@ -90,7 +91,7 @@ void DOA2Compass::paintEvent(QPaintEvent *)
|
||||
// draw blind angle
|
||||
if (m_blindAngle != 0)
|
||||
{
|
||||
painter.setBrush(QColor(48, 48, 48));
|
||||
painter.setBrush(m_blindColor);
|
||||
painter.setPen(Qt::NoPen);
|
||||
painter.rotate(m_azAnt - 90);
|
||||
painter.drawPie(-m_size/2, -m_size/2, m_size, m_size, -m_blindAngle*16, m_blindAngle*32);
|
||||
|
@ -104,6 +104,16 @@ public:
|
||||
emit canvasReplot();
|
||||
}
|
||||
|
||||
///
|
||||
/// \brief Set blind scector color
|
||||
/// \param val - blind sector color
|
||||
///
|
||||
void setBlindColor(const QColor& color)
|
||||
{
|
||||
m_blindColor = color;
|
||||
emit canvasReplot();
|
||||
}
|
||||
|
||||
///
|
||||
/// \brief Draw legend in the center of the compass
|
||||
/// \param drawLegend - true to draw legend else false
|
||||
@ -151,6 +161,7 @@ protected:
|
||||
double m_azNeg; ///< reverse (-) azimuth (in degree)
|
||||
double m_azAnt; ///< antennas azimuth from 1 (connected to stream 0) to 2 (connected to stream 1)
|
||||
double m_blindAngle; //!< half the angle around antenna direction where DOA cannot be processed (when baseline distance exceeds half wavelength)
|
||||
QColor m_blindColor;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_DOA2COMPASS_H
|
||||
|
@ -80,6 +80,7 @@ bool DOA2GUI::handleMessage(const Message& message)
|
||||
m_centerFrequency = notif.getCenterFrequency();
|
||||
displayRateAndShift();
|
||||
updateAbsoluteCenterFrequency();
|
||||
setFFTAveragingToolitp();
|
||||
return true;
|
||||
}
|
||||
else if (DOA2::MsgConfigureDOA2::match(message))
|
||||
@ -205,6 +206,8 @@ void DOA2GUI::displaySettings()
|
||||
ui->baselineDistance->setValue(m_settings.m_basebandDistance);
|
||||
ui->squelch->setValue(m_settings.m_squelchdB);
|
||||
ui->squelchText->setText(tr("%1").arg(m_settings.m_squelchdB, 3));
|
||||
ui->fftAveraging->setCurrentIndex(m_settings.m_fftAveragingIndex);
|
||||
setFFTAveragingToolitp();
|
||||
getRollupContents()->restoreState(m_rollupState);
|
||||
updateAbsoluteCenterFrequency();
|
||||
blockApplySettings(false);
|
||||
@ -222,6 +225,35 @@ void DOA2GUI::displayRateAndShift()
|
||||
m_scopeVis->setLiveRate(channelSampleRate);
|
||||
}
|
||||
|
||||
void DOA2GUI::setFFTAveragingToolitp()
|
||||
{
|
||||
float channelSampleRate = ((float) m_sampleRate) / (1<<m_settings.m_log2Decim);
|
||||
float averagingTime = (DOA2::m_fftSize * DOA2Settings::getAveragingValue(m_settings.m_fftAveragingIndex)) /
|
||||
channelSampleRate;
|
||||
QString s;
|
||||
setNumberStr(averagingTime, 2, s);
|
||||
ui->fftAveraging->setToolTip(QString("Number of averaging FFTs (avg time: %1s)").arg(s));
|
||||
}
|
||||
|
||||
void DOA2GUI::setNumberStr(float v, int decimalPlaces, QString& s)
|
||||
{
|
||||
if (v < 1e-6) {
|
||||
s = tr("%1n").arg(v*1e9, 0, 'f', decimalPlaces);
|
||||
} else if (v < 1e-3) {
|
||||
s = tr("%1µ").arg(v*1e6, 0, 'f', decimalPlaces);
|
||||
} else if (v < 1.0) {
|
||||
s = tr("%1m").arg(v*1e3, 0, 'f', decimalPlaces);
|
||||
} else if (v < 1e3) {
|
||||
s = tr("%1").arg(v, 0, 'f', decimalPlaces);
|
||||
} else if (v < 1e6) {
|
||||
s = tr("%1k").arg(v*1e-3, 0, 'f', decimalPlaces);
|
||||
} else if (v < 1e9) {
|
||||
s = tr("%1M").arg(v*1e-6, 0, 'f', decimalPlaces);
|
||||
} else {
|
||||
s = tr("%1G").arg(v*1e-9, 0, 'f', decimalPlaces);
|
||||
}
|
||||
}
|
||||
|
||||
void DOA2GUI::leaveEvent(QEvent*)
|
||||
{
|
||||
m_channelMarker.setHighlighted(false);
|
||||
@ -345,6 +377,14 @@ void DOA2GUI::on_squelch_valueChanged(int value)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void DOA2GUI::on_fftAveraging_currentIndexChanged(int index)
|
||||
{
|
||||
qDebug("DOA2GUI::on_averaging_currentIndexChanged: %d", index);
|
||||
m_settings.m_fftAveragingIndex = index;
|
||||
applySettings();
|
||||
setFFTAveragingToolitp();
|
||||
}
|
||||
|
||||
void DOA2GUI::applyDecimation()
|
||||
{
|
||||
uint32_t maxHash = 1;
|
||||
@ -389,6 +429,7 @@ void DOA2GUI::makeUIConnections()
|
||||
QObject::connect(ui->antAz, QOverload<int>::of(&QSpinBox::valueChanged), this, &DOA2GUI::on_antAz_valueChanged);
|
||||
QObject::connect(ui->baselineDistance, QOverload<int>::of(&QSpinBox::valueChanged), this, &DOA2GUI::on_baselineDistance_valueChanged);
|
||||
QObject::connect(ui->squelch, &QDial::valueChanged, this, &DOA2GUI::on_squelch_valueChanged);
|
||||
QObject::connect(ui->fftAveraging, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DOA2GUI::on_fftAveraging_currentIndexChanged);
|
||||
}
|
||||
|
||||
void DOA2GUI::updateAbsoluteCenterFrequency()
|
||||
@ -402,11 +443,11 @@ void DOA2GUI::updateAbsoluteCenterFrequency()
|
||||
void DOA2GUI::updateDOA()
|
||||
{
|
||||
float cosTheta = (m_doa2->getPhi() * m_hwl * 1000.0) / (M_PI * m_settings.m_basebandDistance);
|
||||
float blindAngle = ((cosTheta < -1.0) || (cosTheta > 1.0) ? 0 : std::acos(m_hwl * 1000.0 / m_settings.m_basebandDistance)) * (180/M_PI);
|
||||
float blindAngle = (m_settings.m_basebandDistance > m_hwl * 1000.0) ? std::acos((m_hwl * 1000.0) / m_settings.m_basebandDistance) * (180/M_PI) : 0;
|
||||
ui->compass->setBlindAngle(blindAngle);
|
||||
float doaAngle = std::acos(cosTheta < -1.0 ? -1.0 : cosTheta > 1.0 ? 1.0 : cosTheta) * (180/M_PI);
|
||||
float posAngle = ui->antAz->value() - doaAngle; // DOA angles are trigonometric but displayed angles are clockwise
|
||||
float negAngle = ui->antAz->value() + doaAngle;
|
||||
ui->compass->setBlindAngle(blindAngle);
|
||||
ui->compass->setAzPos(posAngle);
|
||||
ui->compass->setAzNeg(negAngle);
|
||||
ui->posText->setText(tr("%1").arg(ui->compass->getAzPos(), 3, 'f', 0, QLatin1Char('0')));
|
||||
|
@ -85,6 +85,8 @@ private:
|
||||
void applyPosition();
|
||||
void displaySettings();
|
||||
void displayRateAndShift();
|
||||
void setFFTAveragingToolitp();
|
||||
static void setNumberStr(float v, int decimalPlaces, QString& s);
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void updateAbsoluteCenterFrequency();
|
||||
@ -102,6 +104,7 @@ private slots:
|
||||
void on_antAz_valueChanged(int value);
|
||||
void on_baselineDistance_valueChanged(int value);
|
||||
void on_squelch_valueChanged(int value);
|
||||
void on_fftAveraging_currentIndexChanged(int index);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void tick();
|
||||
|
@ -476,7 +476,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="posText">
|
||||
<property name="toolTip">
|
||||
<string>Port side arrival angle (degrees)</string>
|
||||
<string>Port side (positive) arrival angle (degrees)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>000</string>
|
||||
@ -506,7 +506,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="negText">
|
||||
<property name="toolTip">
|
||||
<string>Starboard side arrival angle (degrees)</string>
|
||||
<string>Starboard side (negative) arrival angle (degrees)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>000</string>
|
||||
@ -720,6 +720,140 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="spcLabel1_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="fftAveragingLabel">
|
||||
<property name="text">
|
||||
<string>FFT avg</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fftAveraging">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>45</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Number of averaging FFTs</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>50</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>100</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>200</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>500</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>5k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>20k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>50k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1e5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2e5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>5e5</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1M</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
|
@ -48,6 +48,7 @@ void DOA2Settings::resetToDefaults()
|
||||
m_antennaAz = 0;
|
||||
m_basebandDistance = 500;
|
||||
m_squelchdB = -50;
|
||||
m_fftAveragingIndex = 0;
|
||||
}
|
||||
|
||||
QByteArray DOA2Settings::serialize() const
|
||||
@ -71,6 +72,7 @@ QByteArray DOA2Settings::serialize() const
|
||||
s.writeS32(16, m_antennaAz);
|
||||
s.writeU32(17, m_basebandDistance);
|
||||
s.writeS32(18, m_squelchdB);
|
||||
s.writeS32(19, m_fftAveragingIndex);
|
||||
|
||||
if (m_scopeGUI) {
|
||||
s.writeBlob(21, m_scopeGUI->serialize());
|
||||
@ -132,6 +134,12 @@ bool DOA2Settings::deserialize(const QByteArray& data)
|
||||
d.readU32(17, &utmp, 500);
|
||||
m_basebandDistance = utmp == 0 ? 1 : utmp;
|
||||
d.readS32(18, &m_squelchdB, -50);
|
||||
d.readS32(19, &tmp, 0);
|
||||
m_fftAveragingIndex = tmp < 0 ?
|
||||
0 :
|
||||
tmp > 3*m_averagingMaxExponent + 3 ?
|
||||
3*m_averagingMaxExponent + 3:
|
||||
tmp;
|
||||
|
||||
if (m_scopeGUI)
|
||||
{
|
||||
@ -159,3 +167,56 @@ bool DOA2Settings::deserialize(const QByteArray& data)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int DOA2Settings::getAveragingValue(int averagingIndex)
|
||||
{
|
||||
if (averagingIndex <= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int v = averagingIndex - 1;
|
||||
int m = pow(10.0, v/3 > m_averagingMaxExponent ? m_averagingMaxExponent : v/3);
|
||||
int x = 1;
|
||||
|
||||
if (v % 3 == 0) {
|
||||
x = 2;
|
||||
} else if (v % 3 == 1) {
|
||||
x = 5;
|
||||
} else if (v % 3 == 2) {
|
||||
x = 10;
|
||||
}
|
||||
|
||||
return x * m;
|
||||
}
|
||||
|
||||
int DOA2Settings::getAveragingIndex(int averagingValue)
|
||||
{
|
||||
if (averagingValue <= 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int v = averagingValue;
|
||||
int j = 0;
|
||||
|
||||
for (int i = 0; i <= m_averagingMaxExponent; i++)
|
||||
{
|
||||
if (v < 20)
|
||||
{
|
||||
if (v < 2) {
|
||||
j = 0;
|
||||
} else if (v < 5) {
|
||||
j = 1;
|
||||
} else if (v < 10) {
|
||||
j = 2;
|
||||
} else {
|
||||
j = 3;
|
||||
}
|
||||
|
||||
return 3*i + j;
|
||||
}
|
||||
|
||||
v /= 10;
|
||||
}
|
||||
|
||||
return 3*m_averagingMaxExponent + 3;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ struct DOA2Settings
|
||||
int m_antennaAz;
|
||||
uint32_t m_basebandDistance; //!< in millimeters
|
||||
int m_squelchdB;
|
||||
int m_fftAveragingIndex;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
@ -61,6 +62,9 @@ struct DOA2Settings
|
||||
void setScopeGUI(Serializable *scopeGUI) { m_scopeGUI = scopeGUI; }
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
static int getAveragingValue(int averagingIndex);
|
||||
static int getAveragingIndex(int averagingValue);
|
||||
static const int m_averagingMaxExponent = 5; //!< Max 1M (10 * 10^5)
|
||||
};
|
||||
|
||||
#endif // INCLUDE_DOA2SETTINGS_H
|
||||
|
@ -3397,6 +3397,9 @@ margin-bottom: 20px;
|
||||
"DATVModReport" : {
|
||||
"$ref" : "#/definitions/DATVModReport"
|
||||
},
|
||||
"DOA2Report" : {
|
||||
"$ref" : "#/definitions/DOA2Report"
|
||||
},
|
||||
"DSDDemodReport" : {
|
||||
"$ref" : "#/definitions/DSDDemodReport"
|
||||
},
|
||||
@ -4525,6 +4528,31 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "DATVMod"
|
||||
};
|
||||
defs.DOA2Report = {
|
||||
"properties" : {
|
||||
"phi" : {
|
||||
"type" : "integer",
|
||||
"description" : "Raw phase difference in degrees from 0 to 180"
|
||||
},
|
||||
"posAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Calculated port side (positive) arrival angle in degrees from 0 to 180"
|
||||
},
|
||||
"negAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Calculated starboard side (negative) arrival angle in degrees from 0 to 180"
|
||||
},
|
||||
"fftSize" : {
|
||||
"type" : "integer",
|
||||
"description" : "Size of FFT used in correlation"
|
||||
},
|
||||
"channelSampleRate" : {
|
||||
"type" : "integer",
|
||||
"description" : "Channel sample rate (then used in FFT) in S/s"
|
||||
}
|
||||
},
|
||||
"description" : "DOA2"
|
||||
};
|
||||
defs.DOA2Settings = {
|
||||
"properties" : {
|
||||
@ -4544,6 +4572,26 @@ margin-bottom: 20px;
|
||||
"filterChainHash" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"phase" : {
|
||||
"type" : "integer",
|
||||
"description" : "Phase difference correction in degrees from -180 to +180"
|
||||
},
|
||||
"antennaAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Antennas azimuth from antenna 1 to antenna 2 in degrees from 0 to 359"
|
||||
},
|
||||
"basebandDistance" : {
|
||||
"type" : "integer",
|
||||
"description" : "Antennas baseline distance in millimeters from 1 to 99999"
|
||||
},
|
||||
"squelchdB" : {
|
||||
"type" : "integer",
|
||||
"description" : "Porcessing squared magnitude threshold (squelch) in dB from -140 t0 0"
|
||||
},
|
||||
"fftAveragingValue" : {
|
||||
"type" : "integer",
|
||||
"description" : "Number of FFTs to average over. Use 1, 2, 5 or 10 times 10^0 to 10^5 (1 to 1M)"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
@ -56109,7 +56157,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-05-27T09:54:03.529+02:00
|
||||
Generated 2022-05-28T12:29:36.569+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -33,6 +33,8 @@ ChannelReport:
|
||||
$ref: "/doc/swagger/include/DATVDemod.yaml#/DATVDemodReport"
|
||||
DATVModReport:
|
||||
$ref: "/doc/swagger/include/DATVMod.yaml#/DATVModReport"
|
||||
DOA2Report:
|
||||
$ref: "/doc/swagger/include/DOA2.yaml#/DOA2Report"
|
||||
DSDDemodReport:
|
||||
$ref: "/doc/swagger/include/DSDDemod.yaml#/DSDDemodReport"
|
||||
IEEE_802_15_4_ModReport:
|
||||
|
@ -12,6 +12,21 @@ DOA2Settings:
|
||||
type: integer
|
||||
filterChainHash:
|
||||
type: integer
|
||||
phase:
|
||||
type: integer
|
||||
description: Phase difference correction in degrees from -180 to +180
|
||||
antennaAz:
|
||||
type: integer
|
||||
description: Antennas azimuth from antenna 1 to antenna 2 in degrees from 0 to 359
|
||||
basebandDistance:
|
||||
type: integer
|
||||
description: Antennas baseline distance in millimeters from 1 to 99999
|
||||
squelchdB:
|
||||
type: integer
|
||||
description: Porcessing squared magnitude threshold (squelch) in dB from -140 t0 0
|
||||
fftAveragingValue:
|
||||
type: integer
|
||||
description: Number of FFTs to average over. Use 1, 2, 5 or 10 times 10^0 to 10^5 (1 to 1M)
|
||||
useReverseAPI:
|
||||
description: Synchronize with reverse API (1 for yes, 0 for no)
|
||||
type: integer
|
||||
@ -29,3 +44,22 @@ DOA2Settings:
|
||||
$ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker"
|
||||
rollupState:
|
||||
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
|
||||
|
||||
DOA2Report:
|
||||
description: DOA2
|
||||
properties:
|
||||
phi:
|
||||
type: integer
|
||||
description: Raw phase difference in degrees from 0 to 180
|
||||
posAz:
|
||||
type: integer
|
||||
description: Calculated port side (positive) arrival angle in degrees from 0 to 180
|
||||
negAz:
|
||||
type: integer
|
||||
description: Calculated starboard side (negative) arrival angle in degrees from 0 to 180
|
||||
fftSize:
|
||||
type: integer
|
||||
description: Size of FFT used in correlation
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
description: Channel sample rate (then used in FFT) in S/s
|
||||
|
@ -33,6 +33,8 @@ ChannelReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DATVDemod.yaml#/DATVDemodReport"
|
||||
DATVModReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DATVMod.yaml#/DATVModReport"
|
||||
DOA2Report:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DOA2.yaml#/DOA2Report"
|
||||
DSDDemodReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DSDDemod.yaml#/DSDDemodReport"
|
||||
IEEE_802_15_4_ModReport:
|
||||
|
@ -12,6 +12,21 @@ DOA2Settings:
|
||||
type: integer
|
||||
filterChainHash:
|
||||
type: integer
|
||||
phase:
|
||||
type: integer
|
||||
description: Phase difference correction in degrees from -180 to +180
|
||||
antennaAz:
|
||||
type: integer
|
||||
description: Antennas azimuth from antenna 1 to antenna 2 in degrees from 0 to 359
|
||||
basebandDistance:
|
||||
type: integer
|
||||
description: Antennas baseline distance in millimeters from 1 to 99999
|
||||
squelchdB:
|
||||
type: integer
|
||||
description: Porcessing squared magnitude threshold (squelch) in dB from -140 t0 0
|
||||
fftAveragingValue:
|
||||
type: integer
|
||||
description: Number of FFTs to average over. Use 1, 2, 5 or 10 times 10^0 to 10^5 (1 to 1M)
|
||||
useReverseAPI:
|
||||
description: Synchronize with reverse API (1 for yes, 0 for no)
|
||||
type: integer
|
||||
@ -29,3 +44,22 @@ DOA2Settings:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"
|
||||
rollupState:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
|
||||
|
||||
DOA2Report:
|
||||
description: DOA2
|
||||
properties:
|
||||
phi:
|
||||
type: integer
|
||||
description: Raw phase difference in degrees from 0 to 180
|
||||
posAz:
|
||||
type: integer
|
||||
description: Calculated port side (positive) arrival angle in degrees from 0 to 180
|
||||
negAz:
|
||||
type: integer
|
||||
description: Calculated starboard side (negative) arrival angle in degrees from 0 to 180
|
||||
fftSize:
|
||||
type: integer
|
||||
description: Size of FFT used in correlation
|
||||
channelSampleRate:
|
||||
type: integer
|
||||
description: Channel sample rate (then used in FFT) in S/s
|
||||
|
@ -3397,6 +3397,9 @@ margin-bottom: 20px;
|
||||
"DATVModReport" : {
|
||||
"$ref" : "#/definitions/DATVModReport"
|
||||
},
|
||||
"DOA2Report" : {
|
||||
"$ref" : "#/definitions/DOA2Report"
|
||||
},
|
||||
"DSDDemodReport" : {
|
||||
"$ref" : "#/definitions/DSDDemodReport"
|
||||
},
|
||||
@ -4525,6 +4528,31 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "DATVMod"
|
||||
};
|
||||
defs.DOA2Report = {
|
||||
"properties" : {
|
||||
"phi" : {
|
||||
"type" : "integer",
|
||||
"description" : "Raw phase difference in degrees from 0 to 180"
|
||||
},
|
||||
"posAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Calculated port side (positive) arrival angle in degrees from 0 to 180"
|
||||
},
|
||||
"negAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Calculated starboard side (negative) arrival angle in degrees from 0 to 180"
|
||||
},
|
||||
"fftSize" : {
|
||||
"type" : "integer",
|
||||
"description" : "Size of FFT used in correlation"
|
||||
},
|
||||
"channelSampleRate" : {
|
||||
"type" : "integer",
|
||||
"description" : "Channel sample rate (then used in FFT) in S/s"
|
||||
}
|
||||
},
|
||||
"description" : "DOA2"
|
||||
};
|
||||
defs.DOA2Settings = {
|
||||
"properties" : {
|
||||
@ -4544,6 +4572,26 @@ margin-bottom: 20px;
|
||||
"filterChainHash" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"phase" : {
|
||||
"type" : "integer",
|
||||
"description" : "Phase difference correction in degrees from -180 to +180"
|
||||
},
|
||||
"antennaAz" : {
|
||||
"type" : "integer",
|
||||
"description" : "Antennas azimuth from antenna 1 to antenna 2 in degrees from 0 to 359"
|
||||
},
|
||||
"basebandDistance" : {
|
||||
"type" : "integer",
|
||||
"description" : "Antennas baseline distance in millimeters from 1 to 99999"
|
||||
},
|
||||
"squelchdB" : {
|
||||
"type" : "integer",
|
||||
"description" : "Porcessing squared magnitude threshold (squelch) in dB from -140 t0 0"
|
||||
},
|
||||
"fftAveragingValue" : {
|
||||
"type" : "integer",
|
||||
"description" : "Number of FFTs to average over. Use 1, 2, 5 or 10 times 10^0 to 10^5 (1 to 1M)"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
@ -56109,7 +56157,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2022-05-27T09:54:03.529+02:00
|
||||
Generated 2022-05-28T12:29:36.569+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -54,6 +54,8 @@ SWGChannelReport::SWGChannelReport() {
|
||||
m_datv_demod_report_isSet = false;
|
||||
datv_mod_report = nullptr;
|
||||
m_datv_mod_report_isSet = false;
|
||||
doa2_report = nullptr;
|
||||
m_doa2_report_isSet = false;
|
||||
dsd_demod_report = nullptr;
|
||||
m_dsd_demod_report_isSet = false;
|
||||
ieee_802_15_4_mod_report = nullptr;
|
||||
@ -138,6 +140,8 @@ SWGChannelReport::init() {
|
||||
m_datv_demod_report_isSet = false;
|
||||
datv_mod_report = new SWGDATVModReport();
|
||||
m_datv_mod_report_isSet = false;
|
||||
doa2_report = new SWGDOA2Report();
|
||||
m_doa2_report_isSet = false;
|
||||
dsd_demod_report = new SWGDSDDemodReport();
|
||||
m_dsd_demod_report_isSet = false;
|
||||
ieee_802_15_4_mod_report = new SWGIEEE_802_15_4_ModReport();
|
||||
@ -229,6 +233,9 @@ SWGChannelReport::cleanup() {
|
||||
if(datv_mod_report != nullptr) {
|
||||
delete datv_mod_report;
|
||||
}
|
||||
if(doa2_report != nullptr) {
|
||||
delete doa2_report;
|
||||
}
|
||||
if(dsd_demod_report != nullptr) {
|
||||
delete dsd_demod_report;
|
||||
}
|
||||
@ -343,6 +350,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&datv_mod_report, pJson["DATVModReport"], "SWGDATVModReport", "SWGDATVModReport");
|
||||
|
||||
::SWGSDRangel::setValue(&doa2_report, pJson["DOA2Report"], "SWGDOA2Report", "SWGDOA2Report");
|
||||
|
||||
::SWGSDRangel::setValue(&dsd_demod_report, pJson["DSDDemodReport"], "SWGDSDDemodReport", "SWGDSDDemodReport");
|
||||
|
||||
::SWGSDRangel::setValue(&ieee_802_15_4_mod_report, pJson["IEEE_802_15_4_ModReport"], "SWGIEEE_802_15_4_ModReport", "SWGIEEE_802_15_4_ModReport");
|
||||
@ -448,6 +457,9 @@ SWGChannelReport::asJsonObject() {
|
||||
if((datv_mod_report != nullptr) && (datv_mod_report->isSet())){
|
||||
toJsonValue(QString("DATVModReport"), datv_mod_report, obj, QString("SWGDATVModReport"));
|
||||
}
|
||||
if((doa2_report != nullptr) && (doa2_report->isSet())){
|
||||
toJsonValue(QString("DOA2Report"), doa2_report, obj, QString("SWGDOA2Report"));
|
||||
}
|
||||
if((dsd_demod_report != nullptr) && (dsd_demod_report->isSet())){
|
||||
toJsonValue(QString("DSDDemodReport"), dsd_demod_report, obj, QString("SWGDSDDemodReport"));
|
||||
}
|
||||
@ -657,6 +669,16 @@ SWGChannelReport::setDatvModReport(SWGDATVModReport* datv_mod_report) {
|
||||
this->m_datv_mod_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGDOA2Report*
|
||||
SWGChannelReport::getDoa2Report() {
|
||||
return doa2_report;
|
||||
}
|
||||
void
|
||||
SWGChannelReport::setDoa2Report(SWGDOA2Report* doa2_report) {
|
||||
this->doa2_report = doa2_report;
|
||||
this->m_doa2_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGDSDDemodReport*
|
||||
SWGChannelReport::getDsdDemodReport() {
|
||||
return dsd_demod_report;
|
||||
@ -951,6 +973,9 @@ SWGChannelReport::isSet(){
|
||||
if(datv_mod_report && datv_mod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(doa2_report && doa2_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(dsd_demod_report && dsd_demod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "SWGChirpChatModReport.h"
|
||||
#include "SWGDATVDemodReport.h"
|
||||
#include "SWGDATVModReport.h"
|
||||
#include "SWGDOA2Report.h"
|
||||
#include "SWGDSDDemodReport.h"
|
||||
#include "SWGFileSinkReport.h"
|
||||
#include "SWGFileSourceReport.h"
|
||||
@ -117,6 +118,9 @@ public:
|
||||
SWGDATVModReport* getDatvModReport();
|
||||
void setDatvModReport(SWGDATVModReport* datv_mod_report);
|
||||
|
||||
SWGDOA2Report* getDoa2Report();
|
||||
void setDoa2Report(SWGDOA2Report* doa2_report);
|
||||
|
||||
SWGDSDDemodReport* getDsdDemodReport();
|
||||
void setDsdDemodReport(SWGDSDDemodReport* dsd_demod_report);
|
||||
|
||||
@ -235,6 +239,9 @@ private:
|
||||
SWGDATVModReport* datv_mod_report;
|
||||
bool m_datv_mod_report_isSet;
|
||||
|
||||
SWGDOA2Report* doa2_report;
|
||||
bool m_doa2_report_isSet;
|
||||
|
||||
SWGDSDDemodReport* dsd_demod_report;
|
||||
bool m_dsd_demod_report_isSet;
|
||||
|
||||
|
200
swagger/sdrangel/code/qt5/client/SWGDOA2Report.cpp
Normal file
200
swagger/sdrangel/code/qt5/client/SWGDOA2Report.cpp
Normal file
@ -0,0 +1,200 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
|
||||
*
|
||||
* OpenAPI spec version: 7.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "SWGDOA2Report.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDOA2Report::SWGDOA2Report(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDOA2Report::SWGDOA2Report() {
|
||||
phi = 0;
|
||||
m_phi_isSet = false;
|
||||
pos_az = 0;
|
||||
m_pos_az_isSet = false;
|
||||
neg_az = 0;
|
||||
m_neg_az_isSet = false;
|
||||
fft_size = 0;
|
||||
m_fft_size_isSet = false;
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
}
|
||||
|
||||
SWGDOA2Report::~SWGDOA2Report() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGDOA2Report::init() {
|
||||
phi = 0;
|
||||
m_phi_isSet = false;
|
||||
pos_az = 0;
|
||||
m_pos_az_isSet = false;
|
||||
neg_az = 0;
|
||||
m_neg_az_isSet = false;
|
||||
fft_size = 0;
|
||||
m_fft_size_isSet = false;
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGDOA2Report::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGDOA2Report*
|
||||
SWGDOA2Report::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGDOA2Report::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&phi, pJson["phi"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&pos_az, pJson["posAz"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&neg_az, pJson["negAz"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fft_size, pJson["fftSize"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGDOA2Report::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGDOA2Report::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_phi_isSet){
|
||||
obj->insert("phi", QJsonValue(phi));
|
||||
}
|
||||
if(m_pos_az_isSet){
|
||||
obj->insert("posAz", QJsonValue(pos_az));
|
||||
}
|
||||
if(m_neg_az_isSet){
|
||||
obj->insert("negAz", QJsonValue(neg_az));
|
||||
}
|
||||
if(m_fft_size_isSet){
|
||||
obj->insert("fftSize", QJsonValue(fft_size));
|
||||
}
|
||||
if(m_channel_sample_rate_isSet){
|
||||
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Report::getPhi() {
|
||||
return phi;
|
||||
}
|
||||
void
|
||||
SWGDOA2Report::setPhi(qint32 phi) {
|
||||
this->phi = phi;
|
||||
this->m_phi_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Report::getPosAz() {
|
||||
return pos_az;
|
||||
}
|
||||
void
|
||||
SWGDOA2Report::setPosAz(qint32 pos_az) {
|
||||
this->pos_az = pos_az;
|
||||
this->m_pos_az_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Report::getNegAz() {
|
||||
return neg_az;
|
||||
}
|
||||
void
|
||||
SWGDOA2Report::setNegAz(qint32 neg_az) {
|
||||
this->neg_az = neg_az;
|
||||
this->m_neg_az_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Report::getFftSize() {
|
||||
return fft_size;
|
||||
}
|
||||
void
|
||||
SWGDOA2Report::setFftSize(qint32 fft_size) {
|
||||
this->fft_size = fft_size;
|
||||
this->m_fft_size_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Report::getChannelSampleRate() {
|
||||
return channel_sample_rate;
|
||||
}
|
||||
void
|
||||
SWGDOA2Report::setChannelSampleRate(qint32 channel_sample_rate) {
|
||||
this->channel_sample_rate = channel_sample_rate;
|
||||
this->m_channel_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGDOA2Report::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_phi_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_pos_az_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_neg_az_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_fft_size_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_channel_sample_rate_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
82
swagger/sdrangel/code/qt5/client/SWGDOA2Report.h
Normal file
82
swagger/sdrangel/code/qt5/client/SWGDOA2Report.h
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* SDRangel
|
||||
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
|
||||
*
|
||||
* OpenAPI spec version: 7.0.0
|
||||
* Contact: f4exb06@gmail.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGDOA2Report.h
|
||||
*
|
||||
* DOA2
|
||||
*/
|
||||
|
||||
#ifndef SWGDOA2Report_H_
|
||||
#define SWGDOA2Report_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGDOA2Report: public SWGObject {
|
||||
public:
|
||||
SWGDOA2Report();
|
||||
SWGDOA2Report(QString* json);
|
||||
virtual ~SWGDOA2Report();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGDOA2Report* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getPhi();
|
||||
void setPhi(qint32 phi);
|
||||
|
||||
qint32 getPosAz();
|
||||
void setPosAz(qint32 pos_az);
|
||||
|
||||
qint32 getNegAz();
|
||||
void setNegAz(qint32 neg_az);
|
||||
|
||||
qint32 getFftSize();
|
||||
void setFftSize(qint32 fft_size);
|
||||
|
||||
qint32 getChannelSampleRate();
|
||||
void setChannelSampleRate(qint32 channel_sample_rate);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 phi;
|
||||
bool m_phi_isSet;
|
||||
|
||||
qint32 pos_az;
|
||||
bool m_pos_az_isSet;
|
||||
|
||||
qint32 neg_az;
|
||||
bool m_neg_az_isSet;
|
||||
|
||||
qint32 fft_size;
|
||||
bool m_fft_size_isSet;
|
||||
|
||||
qint32 channel_sample_rate;
|
||||
bool m_channel_sample_rate_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGDOA2Report_H_ */
|
@ -38,6 +38,16 @@ SWGDOA2Settings::SWGDOA2Settings() {
|
||||
m_log2_decim_isSet = false;
|
||||
filter_chain_hash = 0;
|
||||
m_filter_chain_hash_isSet = false;
|
||||
phase = 0;
|
||||
m_phase_isSet = false;
|
||||
antenna_az = 0;
|
||||
m_antenna_az_isSet = false;
|
||||
baseband_distance = 0;
|
||||
m_baseband_distance_isSet = false;
|
||||
squelchd_b = 0;
|
||||
m_squelchd_b_isSet = false;
|
||||
fft_averaging_value = 0;
|
||||
m_fft_averaging_value_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = nullptr;
|
||||
@ -72,6 +82,16 @@ SWGDOA2Settings::init() {
|
||||
m_log2_decim_isSet = false;
|
||||
filter_chain_hash = 0;
|
||||
m_filter_chain_hash_isSet = false;
|
||||
phase = 0;
|
||||
m_phase_isSet = false;
|
||||
antenna_az = 0;
|
||||
m_antenna_az_isSet = false;
|
||||
baseband_distance = 0;
|
||||
m_baseband_distance_isSet = false;
|
||||
squelchd_b = 0;
|
||||
m_squelchd_b_isSet = false;
|
||||
fft_averaging_value = 0;
|
||||
m_fft_averaging_value_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = new QString("");
|
||||
@ -100,6 +120,11 @@ SWGDOA2Settings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address;
|
||||
}
|
||||
@ -138,6 +163,16 @@ SWGDOA2Settings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&phase, pJson["phase"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&antenna_az, pJson["antennaAz"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&baseband_distance, pJson["basebandDistance"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&squelchd_b, pJson["squelchdB"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fft_averaging_value, pJson["fftAveragingValue"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
|
||||
@ -185,6 +220,21 @@ SWGDOA2Settings::asJsonObject() {
|
||||
if(m_filter_chain_hash_isSet){
|
||||
obj->insert("filterChainHash", QJsonValue(filter_chain_hash));
|
||||
}
|
||||
if(m_phase_isSet){
|
||||
obj->insert("phase", QJsonValue(phase));
|
||||
}
|
||||
if(m_antenna_az_isSet){
|
||||
obj->insert("antennaAz", QJsonValue(antenna_az));
|
||||
}
|
||||
if(m_baseband_distance_isSet){
|
||||
obj->insert("basebandDistance", QJsonValue(baseband_distance));
|
||||
}
|
||||
if(m_squelchd_b_isSet){
|
||||
obj->insert("squelchdB", QJsonValue(squelchd_b));
|
||||
}
|
||||
if(m_fft_averaging_value_isSet){
|
||||
obj->insert("fftAveragingValue", QJsonValue(fft_averaging_value));
|
||||
}
|
||||
if(m_use_reverse_api_isSet){
|
||||
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
|
||||
}
|
||||
@ -263,6 +313,56 @@ SWGDOA2Settings::setFilterChainHash(qint32 filter_chain_hash) {
|
||||
this->m_filter_chain_hash_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getPhase() {
|
||||
return phase;
|
||||
}
|
||||
void
|
||||
SWGDOA2Settings::setPhase(qint32 phase) {
|
||||
this->phase = phase;
|
||||
this->m_phase_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getAntennaAz() {
|
||||
return antenna_az;
|
||||
}
|
||||
void
|
||||
SWGDOA2Settings::setAntennaAz(qint32 antenna_az) {
|
||||
this->antenna_az = antenna_az;
|
||||
this->m_antenna_az_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getBasebandDistance() {
|
||||
return baseband_distance;
|
||||
}
|
||||
void
|
||||
SWGDOA2Settings::setBasebandDistance(qint32 baseband_distance) {
|
||||
this->baseband_distance = baseband_distance;
|
||||
this->m_baseband_distance_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getSquelchdB() {
|
||||
return squelchd_b;
|
||||
}
|
||||
void
|
||||
SWGDOA2Settings::setSquelchdB(qint32 squelchd_b) {
|
||||
this->squelchd_b = squelchd_b;
|
||||
this->m_squelchd_b_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getFftAveragingValue() {
|
||||
return fft_averaging_value;
|
||||
}
|
||||
void
|
||||
SWGDOA2Settings::setFftAveragingValue(qint32 fft_averaging_value) {
|
||||
this->fft_averaging_value = fft_averaging_value;
|
||||
this->m_fft_averaging_value_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDOA2Settings::getUseReverseApi() {
|
||||
return use_reverse_api;
|
||||
@ -363,6 +463,21 @@ SWGDOA2Settings::isSet(){
|
||||
if(m_filter_chain_hash_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_phase_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_antenna_az_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_baseband_distance_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_squelchd_b_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_fft_averaging_value_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_use_reverse_api_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -60,6 +60,21 @@ public:
|
||||
qint32 getFilterChainHash();
|
||||
void setFilterChainHash(qint32 filter_chain_hash);
|
||||
|
||||
qint32 getPhase();
|
||||
void setPhase(qint32 phase);
|
||||
|
||||
qint32 getAntennaAz();
|
||||
void setAntennaAz(qint32 antenna_az);
|
||||
|
||||
qint32 getBasebandDistance();
|
||||
void setBasebandDistance(qint32 baseband_distance);
|
||||
|
||||
qint32 getSquelchdB();
|
||||
void setSquelchdB(qint32 squelchd_b);
|
||||
|
||||
qint32 getFftAveragingValue();
|
||||
void setFftAveragingValue(qint32 fft_averaging_value);
|
||||
|
||||
qint32 getUseReverseApi();
|
||||
void setUseReverseApi(qint32 use_reverse_api);
|
||||
|
||||
@ -103,6 +118,21 @@ private:
|
||||
qint32 filter_chain_hash;
|
||||
bool m_filter_chain_hash_isSet;
|
||||
|
||||
qint32 phase;
|
||||
bool m_phase_isSet;
|
||||
|
||||
qint32 antenna_az;
|
||||
bool m_antenna_az_isSet;
|
||||
|
||||
qint32 baseband_distance;
|
||||
bool m_baseband_distance_isSet;
|
||||
|
||||
qint32 squelchd_b;
|
||||
bool m_squelchd_b_isSet;
|
||||
|
||||
qint32 fft_averaging_value;
|
||||
bool m_fft_averaging_value_isSet;
|
||||
|
||||
qint32 use_reverse_api;
|
||||
bool m_use_reverse_api_isSet;
|
||||
|
||||
|
@ -95,6 +95,7 @@
|
||||
#include "SWGDATVDemodSettings.h"
|
||||
#include "SWGDATVModReport.h"
|
||||
#include "SWGDATVModSettings.h"
|
||||
#include "SWGDOA2Report.h"
|
||||
#include "SWGDOA2Settings.h"
|
||||
#include "SWGDSDDemodReport.h"
|
||||
#include "SWGDSDDemodSettings.h"
|
||||
@ -739,6 +740,11 @@ namespace SWGSDRangel {
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGDOA2Report").compare(type) == 0) {
|
||||
SWGDOA2Report *obj = new SWGDOA2Report();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGDOA2Settings").compare(type) == 0) {
|
||||
SWGDOA2Settings *obj = new SWGDOA2Settings();
|
||||
obj->init();
|
||||
|
Loading…
Reference in New Issue
Block a user