mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-22 16:08:39 -05:00
Merge pull request #1852 from srcejon/freq_scanner
Frequency Scanner plugin
This commit is contained in:
commit
036a89f4a3
@ -92,6 +92,7 @@ option(ENABLE_CHANNELRX_DEMODRTTY "Enable channelrx demodrtty plugin" ON)
|
||||
option(ENABLE_CHANNELRX_DEMODILS "Enable channelrx demodils plugin" ON)
|
||||
option(ENABLE_CHANNELRX_DEMODDSC "Enable channelrx demoddsc plugin" ON)
|
||||
option(ENABLE_CHANNELRX_HEATMAP "Enable channelrx heatmap plugin" ON)
|
||||
option(ENABLE_CHANNELRX_FREQSCANNER "Enable channelrx freqscanner plugin" ON)
|
||||
|
||||
# Channel Tx enablers
|
||||
option(ENABLE_CHANNELTX "Enable channeltx plugins" ON)
|
||||
|
BIN
doc/img/FreqScanner_plugin.png
Normal file
BIN
doc/img/FreqScanner_plugin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@ -1,5 +1,9 @@
|
||||
project(demod)
|
||||
|
||||
if (ENABLE_CHANNELRX_FREQSCANNER)
|
||||
add_subdirectory(freqscanner)
|
||||
endif()
|
||||
|
||||
if (ENABLE_CHANNELRX_DEMODADSB AND Qt${QT_DEFAULT_MAJOR_VERSION}Quick_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}QuickWidgets_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}Positioning_FOUND AND Qt${QT_DEFAULT_MAJOR_VERSION}TextToSpeech_FOUND)
|
||||
add_subdirectory(demodadsb)
|
||||
# add_subdirectory(demodvormc)
|
||||
|
66
plugins/channelrx/freqscanner/CMakeLists.txt
Normal file
66
plugins/channelrx/freqscanner/CMakeLists.txt
Normal file
@ -0,0 +1,66 @@
|
||||
project(freqscanner)
|
||||
|
||||
set(freqscanner_SOURCES
|
||||
freqscanner.cpp
|
||||
freqscannersettings.cpp
|
||||
freqscannerbaseband.cpp
|
||||
freqscannersink.cpp
|
||||
freqscannerplugin.cpp
|
||||
freqscannerwebapiadapter.cpp
|
||||
)
|
||||
|
||||
set(freqscanner_HEADERS
|
||||
freqscanner.h
|
||||
freqscannersettings.h
|
||||
freqscannerbaseband.h
|
||||
freqscannersink.h
|
||||
freqscannerplugin.h
|
||||
freqscannerwebapiadapter.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
)
|
||||
|
||||
if(NOT SERVER_MODE)
|
||||
set(freqscanner_SOURCES
|
||||
${freqscanner_SOURCES}
|
||||
freqscannergui.cpp
|
||||
freqscannergui.ui
|
||||
freqscanneraddrangedialog.cpp
|
||||
freqscanneraddrangedialog.ui
|
||||
)
|
||||
set(freqscanner_HEADERS
|
||||
${freqscanner_HEADERS}
|
||||
freqscannergui.h
|
||||
freqscanneraddrangedialog.h
|
||||
)
|
||||
|
||||
set(TARGET_NAME freqscanner)
|
||||
set(TARGET_LIB "Qt::Widgets")
|
||||
set(TARGET_LIB_GUI "sdrgui")
|
||||
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
|
||||
else()
|
||||
set(TARGET_NAME freqscannersrv)
|
||||
set(TARGET_LIB "")
|
||||
set(TARGET_LIB_GUI "")
|
||||
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
|
||||
endif()
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
${freqscanner_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
Qt::Core
|
||||
${TARGET_LIB}
|
||||
sdrbase
|
||||
${TARGET_LIB_GUI}
|
||||
)
|
||||
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})
|
||||
|
||||
# Install debug symbols
|
||||
if (WIN32)
|
||||
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} )
|
||||
endif()
|
1067
plugins/channelrx/freqscanner/freqscanner.cpp
Normal file
1067
plugins/channelrx/freqscanner/freqscanner.cpp
Normal file
File diff suppressed because it is too large
Load Diff
420
plugins/channelrx/freqscanner/freqscanner.h
Normal file
420
plugins/channelrx/freqscanner/freqscanner.h
Normal file
@ -0,0 +1,420 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015-2018 Edouard Griffiths, F4EXB. //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNER_H
|
||||
#define INCLUDE_FREQSCANNER_H
|
||||
|
||||
#include <QNetworkRequest>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
|
||||
#include "dsp/basebandsamplesink.h"
|
||||
#include "channel/channelapi.h"
|
||||
#include "util/message.h"
|
||||
|
||||
#include "freqscannerbaseband.h"
|
||||
#include "freqscannersettings.h"
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
class QThread;
|
||||
class DeviceAPI;
|
||||
|
||||
class FreqScanner : public BasebandSampleSink, public ChannelAPI {
|
||||
public:
|
||||
class MsgConfigureFreqScanner : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const FreqScannerSettings& getSettings() const { return m_settings; }
|
||||
const QStringList& getSettingsKeys() const { return m_settingsKeys; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureFreqScanner* create(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force)
|
||||
{
|
||||
return new MsgConfigureFreqScanner(settings, settingsKeys, force);
|
||||
}
|
||||
|
||||
private:
|
||||
FreqScannerSettings m_settings;
|
||||
QStringList m_settingsKeys;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureFreqScanner(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force) :
|
||||
Message(),
|
||||
m_settings(settings),
|
||||
m_settingsKeys(settingsKeys),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
class MsgReportChannels : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
QList<FreqScannerSettings::AvailableChannel>& getChannels() { return m_channels; }
|
||||
|
||||
static MsgReportChannels* create() {
|
||||
return new MsgReportChannels();
|
||||
}
|
||||
|
||||
private:
|
||||
QList<FreqScannerSettings::AvailableChannel> m_channels;
|
||||
|
||||
MsgReportChannels() :
|
||||
Message()
|
||||
{}
|
||||
};
|
||||
|
||||
class MsgStartScan : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgStartScan* create()
|
||||
{
|
||||
return new MsgStartScan();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgStartScan() :
|
||||
Message()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgStopScan : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgStopScan* create()
|
||||
{
|
||||
return new MsgStopScan();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgStopScan() :
|
||||
Message()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgScanComplete : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgScanComplete* create()
|
||||
{
|
||||
return new MsgScanComplete();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgScanComplete() :
|
||||
Message()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgScanResult : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
struct ScanResult {
|
||||
qint64 m_frequency;
|
||||
float m_power;
|
||||
};
|
||||
|
||||
const QDateTime& getFFTStartTime() { return m_fftStartTime; }
|
||||
QList<ScanResult>& getScanResults() { return m_scanResults; }
|
||||
|
||||
static MsgScanResult* create(const QDateTime& fftStartTime) {
|
||||
return new MsgScanResult(fftStartTime);
|
||||
}
|
||||
|
||||
private:
|
||||
QDateTime m_fftStartTime;
|
||||
QList<ScanResult> m_scanResults;
|
||||
|
||||
MsgScanResult(const QDateTime& fftStartTime) :
|
||||
Message(),
|
||||
m_fftStartTime(fftStartTime)
|
||||
{}
|
||||
};
|
||||
|
||||
class MsgStatus : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
const QString& getText() const { return m_text; }
|
||||
|
||||
static MsgStatus* create(const QString& text)
|
||||
{
|
||||
return new MsgStatus(text);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
QString m_text;
|
||||
|
||||
MsgStatus(const QString& text) :
|
||||
Message(),
|
||||
m_text(text)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgReportActiveFrequency : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
qint64 getCenterFrequency() const { return m_centerFrequency; }
|
||||
|
||||
static MsgReportActiveFrequency* create(qint64 centerFrequency)
|
||||
{
|
||||
return new MsgReportActiveFrequency(centerFrequency);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
qint64 m_centerFrequency;
|
||||
|
||||
MsgReportActiveFrequency(qint64 centerFrequency) :
|
||||
Message(),
|
||||
m_centerFrequency(centerFrequency)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgReportActivePower : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
float getPower() const { return m_power; }
|
||||
|
||||
static MsgReportActivePower* create(float power)
|
||||
{
|
||||
return new MsgReportActivePower(power);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Real m_power;
|
||||
|
||||
MsgReportActivePower(float power) :
|
||||
Message(),
|
||||
m_power(power)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgReportScanning : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
static MsgReportScanning* create()
|
||||
{
|
||||
return new MsgReportScanning();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
MsgReportScanning() :
|
||||
Message()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class MsgReportScanRange : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
|
||||
qint64 getCenterFrequency() const { return m_centerFrequency; }
|
||||
int getTotalBandwidth() const { return m_totalBandwidth; }
|
||||
int getFftSize() const { return m_fftSize; }
|
||||
|
||||
static MsgReportScanRange* create(qint64 centerFrequency, int totalBandwidth, int fftSize)
|
||||
{
|
||||
return new MsgReportScanRange(centerFrequency, totalBandwidth, fftSize);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
qint64 m_centerFrequency;
|
||||
int m_totalBandwidth;
|
||||
int m_fftSize;
|
||||
|
||||
MsgReportScanRange(qint64 centerFrequency, int totalBandwidth, int fftSize) :
|
||||
Message(),
|
||||
m_centerFrequency(centerFrequency),
|
||||
m_totalBandwidth(totalBandwidth),
|
||||
m_fftSize(fftSize)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
FreqScanner(DeviceAPI *deviceAPI);
|
||||
virtual ~FreqScanner();
|
||||
virtual void destroy() { delete this; }
|
||||
virtual void setDeviceAPI(DeviceAPI *deviceAPI);
|
||||
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
|
||||
|
||||
using BasebandSampleSink::feed;
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
|
||||
virtual void start();
|
||||
virtual void stop();
|
||||
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
|
||||
virtual QString getSinkName() { return objectName(); }
|
||||
|
||||
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||
virtual QString getIdentifier() const { return objectName(); }
|
||||
virtual const QString& getURI() const { return getName(); }
|
||||
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||
virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||
virtual void setCenterFrequency(qint64 frequency);
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
|
||||
virtual int getNbSinkStreams() const { return 1; }
|
||||
virtual int getNbSourceStreams() const { return 0; }
|
||||
|
||||
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
|
||||
{
|
||||
(void) streamIndex;
|
||||
(void) sinkElseSource;
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiWorkspaceGet(
|
||||
SWGSDRangel::SWGWorkspaceInfo& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
const FreqScannerSettings& settings);
|
||||
|
||||
static void webapiUpdateChannelSettings(
|
||||
FreqScannerSettings& settings,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response);
|
||||
|
||||
void setMessageQueueToGUI(MessageQueue* queue) override {
|
||||
ChannelAPI::setMessageQueueToGUI(queue);
|
||||
m_basebandSink->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
||||
uint32_t getNumberOfDeviceStreams() const;
|
||||
|
||||
void calcScannerSampleRate(int channelBW, int basebandSampleRate, int& scannerSampleRate, int& fftSize, int& binsPerChannel);
|
||||
|
||||
static const char * const m_channelIdURI;
|
||||
static const char * const m_channelId;
|
||||
|
||||
private:
|
||||
DeviceAPI *m_deviceAPI;
|
||||
QThread *m_thread;
|
||||
FreqScannerBaseband* m_basebandSink;
|
||||
QRecursiveMutex m_mutex;
|
||||
bool m_running;
|
||||
FreqScannerSettings m_settings;
|
||||
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
|
||||
qint64 m_centerFrequency;
|
||||
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
QHash<ChannelAPI*, FreqScannerSettings::AvailableChannel> m_availableChannels;
|
||||
|
||||
int m_scanDeviceSetIndex;
|
||||
int m_scanChannelIndex;
|
||||
qint64 m_activeFrequency;
|
||||
QDateTime m_minFFTStartTime;
|
||||
int m_scannerSampleRate;
|
||||
bool m_stepping;
|
||||
qint64 m_stepStartFrequency;
|
||||
qint64 m_stepStopFrequency;
|
||||
QList<MsgScanResult::ScanResult> m_scanResults;
|
||||
|
||||
enum State {
|
||||
IDLE,
|
||||
START_SCAN,
|
||||
SCAN_FOR_MAX_POWER,
|
||||
WAIT_FOR_END_TX,
|
||||
WAIT_FOR_RETRANSMISSION
|
||||
} m_state;
|
||||
|
||||
QTimer m_timeoutTimer;
|
||||
|
||||
virtual bool handleMessage(const Message& cmd);
|
||||
void applySettings(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force = false);
|
||||
void webapiReverseSendSettings(const QStringList& channelSettingsKeys, const FreqScannerSettings& settings, bool force);
|
||||
void webapiFormatChannelSettings(
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
|
||||
const FreqScannerSettings& settings,
|
||||
bool force
|
||||
);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
|
||||
void scanAvailableChannels();
|
||||
void notifyUpdateChannels();
|
||||
void startScan();
|
||||
void stopScan();
|
||||
void initScan();
|
||||
void processScanResults(const QDateTime& fftStartTime, const QList<MsgScanResult::ScanResult>& results);
|
||||
void setDeviceCenterFrequency(qint64 frequency);
|
||||
|
||||
private slots:
|
||||
void networkManagerFinished(QNetworkReply *reply);
|
||||
void handleIndexInDeviceSetChanged(int index);
|
||||
void handleChannelAdded(int deviceSetIndex, ChannelAPI* channel);
|
||||
void handleChannelRemoved(int deviceSetIndex, ChannelAPI* channel);
|
||||
void timeout();
|
||||
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNER_H
|
||||
|
136
plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp
Normal file
136
plugins/channelrx/freqscanner/freqscanneraddrangedialog.cpp
Normal file
@ -0,0 +1,136 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "freqscanneraddrangedialog.h"
|
||||
#include "ui_freqscanneraddrangedialog.h"
|
||||
|
||||
FreqScannerAddRangeDialog::FreqScannerAddRangeDialog(int step, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::FreqScannerAddRangeDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->start->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->start->setValueRange(false, 11, 0, 99999999999);
|
||||
ui->stop->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->stop->setValueRange(false, 11, 0, 99999999999);
|
||||
|
||||
on_preset_currentTextChanged("Airband");
|
||||
|
||||
//ui->step->setCurrentText(QString::number(step));
|
||||
}
|
||||
|
||||
FreqScannerAddRangeDialog::~FreqScannerAddRangeDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void FreqScannerAddRangeDialog::accept()
|
||||
{
|
||||
if (ui->preset->currentText() == "Digital Selective Calling")
|
||||
{
|
||||
// From ITU M.541
|
||||
static const QList<qint64> dscFreqs = {
|
||||
2177000, 2189500,
|
||||
4208000, 4208500, 4209000,
|
||||
6312500, 6313000,
|
||||
8415000, 8415500, 8416000,
|
||||
12577500, 12578000, 12578500,
|
||||
16805000, 16805500, 16806000, 18898500, 18899000, 18899500,
|
||||
22374500, 22375000, 22375500,
|
||||
25208500, 25209000, 25209500
|
||||
};
|
||||
m_frequencies.append(dscFreqs);
|
||||
}
|
||||
else if (ui->preset->currentText() == "DAB")
|
||||
{
|
||||
static const QList<qint64> dabFreqs = {
|
||||
174928000, 176640000, 178352000, 180064000,
|
||||
181936000, 183648000, 185360000, 187072000,
|
||||
188928000, 190640000, 192352000, 194064000,
|
||||
195936000, 197648000, 199360000, 201072000,
|
||||
202928000, 204640000, 206352000, 208064000,
|
||||
209936000, 211648000, 213360000, 215072000,
|
||||
216928000, 218640000, 220352000, 222064000,
|
||||
223936000, 225648000, 227360000, 229072000,
|
||||
230784000, 232496000, 234208000, 235776000,
|
||||
237448000, 239200000
|
||||
};
|
||||
m_frequencies.append(dabFreqs);
|
||||
}
|
||||
else
|
||||
{
|
||||
qint64 start = ui->start->getValue();
|
||||
qint64 stop = ui->stop->getValue();
|
||||
int step = ui->step->currentText().toInt();
|
||||
|
||||
if ((start <= stop) && (step > 0))
|
||||
{
|
||||
if (step == 8333)
|
||||
{
|
||||
double fstep = 8333 + 1.0/3.0; // float will give incorrect results
|
||||
for (double f = start; f <= stop; f += fstep) {
|
||||
m_frequencies.append(std::round(f));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (qint64 f = start; f <= stop; f += step) {
|
||||
m_frequencies.append(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void FreqScannerAddRangeDialog::on_preset_currentTextChanged(const QString& text)
|
||||
{
|
||||
bool enableManAdjust = true;
|
||||
if (text == "Airband")
|
||||
{
|
||||
ui->start->setValue(118000000);
|
||||
ui->stop->setValue(137000000);
|
||||
ui->step->setCurrentText("25000");
|
||||
}
|
||||
else if (text == "Broadcast FM")
|
||||
{
|
||||
ui->start->setValue(87500000);
|
||||
ui->stop->setValue(108000000);
|
||||
ui->step->setCurrentText("100000");
|
||||
}
|
||||
else if (text == "DAB")
|
||||
{
|
||||
enableManAdjust = false;
|
||||
}
|
||||
else if (text == "Marine")
|
||||
{
|
||||
ui->start->setValue(156000000);
|
||||
ui->stop->setValue(162150000);
|
||||
ui->step->setCurrentText("25000");
|
||||
}
|
||||
else if (text == "Digital Selective Calling")
|
||||
{
|
||||
enableManAdjust = false;
|
||||
}
|
||||
ui->start->setEnabled(enableManAdjust);
|
||||
ui->stop->setEnabled(enableManAdjust);
|
||||
ui->step->setEnabled(enableManAdjust);
|
||||
}
|
43
plugins/channelrx/freqscanner/freqscanneraddrangedialog.h
Normal file
43
plugins/channelrx/freqscanner/freqscanneraddrangedialog.h
Normal file
@ -0,0 +1,43 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERADDRANGEDIALOG_H
|
||||
#define INCLUDE_FREQSCANNERADDRANGEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class FreqScannerAddRangeDialog;
|
||||
}
|
||||
|
||||
class FreqScannerAddRangeDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FreqScannerAddRangeDialog(int step, QWidget* parent = nullptr);
|
||||
~FreqScannerAddRangeDialog();
|
||||
|
||||
QList<qint64> m_frequencies;
|
||||
|
||||
private slots:
|
||||
void accept();
|
||||
void on_preset_currentTextChanged(const QString& text);
|
||||
|
||||
private:
|
||||
Ui::FreqScannerAddRangeDialog *ui;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNERADDRANGEDIALOG_H
|
266
plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui
Normal file
266
plugins/channelrx/freqscanner/freqscanneraddrangedialog.ui
Normal file
@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FreqScannerAddRangeDialog</class>
|
||||
<widget class="QDialog" name="FreqScannerAddRangeDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>385</width>
|
||||
<height>190</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Add Range</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Add Frequency Range</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="stepLabel">
|
||||
<property name="text">
|
||||
<string>Step</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="startUnits">
|
||||
<property name="text">
|
||||
<string>Hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="ValueDialZ" name="start" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Start frequency in Hertz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QLabel" name="stepUnits">
|
||||
<property name="text">
|
||||
<string>Hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="stopUnits">
|
||||
<property name="text">
|
||||
<string>Hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="stopLabel">
|
||||
<property name="text">
|
||||
<string>Stop Frequency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="startLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start Frequency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="step">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>25000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8333</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>100000</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="ValueDialZ" name="stop" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Stop frequency in Hertz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="preset">
|
||||
<property name="toolTip">
|
||||
<string>Select a preset range of frequencies</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Airband</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Broadcast FM</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>DAB</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Digital Selective Calling</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Marine</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="presetLabel">
|
||||
<property name="text">
|
||||
<string>Preset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ValueDialZ</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/valuedialz.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||
<include location="../demodapt/icons.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>FreqScannerAddRangeDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>FreqScannerAddRangeDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
204
plugins/channelrx/freqscanner/freqscannerbaseband.cpp
Normal file
204
plugins/channelrx/freqscanner/freqscannerbaseband.cpp
Normal file
@ -0,0 +1,204 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/downchannelizer.h"
|
||||
|
||||
#include "freqscannerbaseband.h"
|
||||
#include "freqscanner.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(FreqScannerBaseband::MsgConfigureFreqScannerBaseband, Message)
|
||||
|
||||
FreqScannerBaseband::FreqScannerBaseband(FreqScanner *freqScanner) :
|
||||
m_freqScanner(freqScanner),
|
||||
m_sink(freqScanner),
|
||||
m_messageQueueToGUI(nullptr)
|
||||
{
|
||||
qDebug("FreqScannerBaseband::FreqScannerBaseband");
|
||||
|
||||
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
|
||||
|
||||
QObject::connect(
|
||||
&m_sampleFifo,
|
||||
&SampleSinkFifo::dataReady,
|
||||
this,
|
||||
&FreqScannerBaseband::handleData,
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
|
||||
m_channelizer = new DownChannelizer(&m_sink);
|
||||
m_channelSampleRate = 0;
|
||||
m_scannerSampleRate = 0;
|
||||
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
|
||||
}
|
||||
|
||||
FreqScannerBaseband::~FreqScannerBaseband()
|
||||
{
|
||||
m_inputMessageQueue.clear();
|
||||
delete m_channelizer;
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::reset()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
m_inputMessageQueue.clear();
|
||||
m_sampleFifo.reset();
|
||||
m_channelSampleRate = 0;
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::setChannel(ChannelAPI *channel)
|
||||
{
|
||||
m_sink.setChannel(channel);
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
|
||||
{
|
||||
m_sampleFifo.write(begin, end);
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::handleData()
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0))
|
||||
{
|
||||
SampleVector::iterator part1begin;
|
||||
SampleVector::iterator part1end;
|
||||
SampleVector::iterator part2begin;
|
||||
SampleVector::iterator part2end;
|
||||
|
||||
std::size_t count = m_sampleFifo.readBegin(m_sampleFifo.fill(), &part1begin, &part1end, &part2begin, &part2end);
|
||||
|
||||
// first part of FIFO data
|
||||
if (part1begin != part1end) {
|
||||
m_channelizer->feed(part1begin, part1end);
|
||||
}
|
||||
|
||||
// second part of FIFO data (used when block wraps around)
|
||||
if (part2begin != part2end) {
|
||||
m_channelizer->feed(part2begin, part2end);
|
||||
}
|
||||
|
||||
m_sampleFifo.readCommit((unsigned int) count);
|
||||
}
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::handleInputMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr)
|
||||
{
|
||||
if (handleMessage(*message)) {
|
||||
delete message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool FreqScannerBaseband::handleMessage(const Message& cmd)
|
||||
{
|
||||
if (MsgConfigureFreqScannerBaseband::match(cmd))
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
MsgConfigureFreqScannerBaseband& cfg = (MsgConfigureFreqScannerBaseband&) cmd;
|
||||
qDebug() << "FreqScannerBaseband::handleMessage: MsgConfigureFreqScannerBaseband";
|
||||
|
||||
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce());
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (DSPSignalNotification::match(cmd))
|
||||
{
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
|
||||
qDebug() << "FreqScannerBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate();
|
||||
setBasebandSampleRate(notif.getSampleRate());
|
||||
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate()));
|
||||
if (m_channelSampleRate != m_channelizer->getChannelSampleRate()) {
|
||||
m_channelSampleRate = m_channelizer->getChannelSampleRate();
|
||||
}
|
||||
m_sink.setCenterFrequency(notif.getCenterFrequency());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::applySettings(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force)
|
||||
{
|
||||
if (settingsKeys.contains("channelBandwidth") || settingsKeys.contains("inputFrequencyOffset") || force)
|
||||
{
|
||||
int basebandSampleRate = m_channelizer->getBasebandSampleRate();
|
||||
if ((basebandSampleRate != 0) && (settings.m_channelBandwidth != 0)) {
|
||||
calcScannerSampleRate(basebandSampleRate, settings.m_channelBandwidth, settings.m_inputFrequencyOffset);
|
||||
}
|
||||
}
|
||||
|
||||
m_sink.applySettings(settings, settingsKeys, force);
|
||||
|
||||
if (force) {
|
||||
m_settings = settings;
|
||||
} else {
|
||||
m_settings.applySettings(settingsKeys, settings);
|
||||
}
|
||||
}
|
||||
|
||||
int FreqScannerBaseband::getChannelSampleRate() const
|
||||
{
|
||||
return m_channelizer->getChannelSampleRate();
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::setBasebandSampleRate(int sampleRate)
|
||||
{
|
||||
m_channelizer->setBasebandSampleRate(sampleRate);
|
||||
if ((sampleRate != 0) && (m_settings.m_channelBandwidth != 0)) {
|
||||
calcScannerSampleRate(sampleRate, m_settings.m_channelBandwidth, m_settings.m_inputFrequencyOffset);
|
||||
}
|
||||
}
|
||||
|
||||
void FreqScannerBaseband::calcScannerSampleRate(int basebandSampleRate, float rfBandwidth, int inputFrequencyOffset)
|
||||
{
|
||||
int fftSize;
|
||||
int binsPerChannel;
|
||||
|
||||
m_freqScanner->calcScannerSampleRate(rfBandwidth, basebandSampleRate, m_scannerSampleRate, fftSize, binsPerChannel);
|
||||
|
||||
m_channelizer->setChannelization(m_scannerSampleRate, inputFrequencyOffset);
|
||||
m_channelSampleRate = m_channelizer->getChannelSampleRate();
|
||||
m_sink.applyChannelSettings(m_channelSampleRate, m_channelizer->getChannelFrequencyOffset(), m_scannerSampleRate, fftSize, binsPerChannel);
|
||||
qDebug() << "FreqScannerBaseband::calcScannerSampleRate"
|
||||
<< "basebandSampleRate:" << basebandSampleRate
|
||||
<< "channelSampleRate:" << m_channelSampleRate
|
||||
<< "scannerSampleRate:" << m_scannerSampleRate
|
||||
<< "rfBandwidth:" << rfBandwidth
|
||||
<< "fftSize:" << fftSize
|
||||
<< "binsPerChannel:" << binsPerChannel;
|
||||
|
||||
if (getMessageQueueToGUI())
|
||||
{
|
||||
FreqScanner::MsgReportScanRange* msg = FreqScanner::MsgReportScanRange::create(inputFrequencyOffset, m_scannerSampleRate, fftSize);
|
||||
getMessageQueueToGUI()->push(msg);
|
||||
}
|
||||
}
|
99
plugins/channelrx/freqscanner/freqscannerbaseband.h
Normal file
99
plugins/channelrx/freqscanner/freqscannerbaseband.h
Normal file
@ -0,0 +1,99 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERBASEBAND_H
|
||||
#define INCLUDE_FREQSCANNERBASEBAND_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QRecursiveMutex>
|
||||
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "util/message.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
#include "freqscannersink.h"
|
||||
|
||||
class DownChannelizer;
|
||||
class ChannelAPI;
|
||||
class FreqScanner;
|
||||
|
||||
class FreqScannerBaseband : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
class MsgConfigureFreqScannerBaseband : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const FreqScannerSettings& getSettings() const { return m_settings; }
|
||||
const QStringList& getSettingsKeys() const { return m_settingsKeys; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureFreqScannerBaseband* create(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force)
|
||||
{
|
||||
return new MsgConfigureFreqScannerBaseband(settings, settingsKeys, force);
|
||||
}
|
||||
|
||||
private:
|
||||
FreqScannerSettings m_settings;
|
||||
QStringList m_settingsKeys;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureFreqScannerBaseband(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force) :
|
||||
Message(),
|
||||
m_settings(settings),
|
||||
m_settingsKeys(settingsKeys),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
FreqScannerBaseband(FreqScanner *freqScanner);
|
||||
~FreqScannerBaseband();
|
||||
void reset();
|
||||
void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
|
||||
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_sink.setMessageQueueToChannel(messageQueue); }
|
||||
void setMessageQueueToGUI(MessageQueue* messageQueue) { m_messageQueueToGUI = messageQueue; }
|
||||
void setBasebandSampleRate(int sampleRate);
|
||||
int getChannelSampleRate() const;
|
||||
void setChannel(ChannelAPI *channel);
|
||||
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
|
||||
|
||||
private:
|
||||
FreqScanner *m_freqScanner;
|
||||
SampleSinkFifo m_sampleFifo;
|
||||
DownChannelizer *m_channelizer;
|
||||
int m_channelSampleRate;
|
||||
int m_scannerSampleRate;
|
||||
FreqScannerSink m_sink;
|
||||
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
|
||||
MessageQueue *m_messageQueueToGUI;
|
||||
FreqScannerSettings m_settings;
|
||||
QRecursiveMutex m_mutex;
|
||||
|
||||
bool handleMessage(const Message& cmd);
|
||||
void applySettings(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force = false);
|
||||
void calcScannerSampleRate(int basebandSampleRate, float rfBandwidth, int inputFrequencyOffset);
|
||||
MessageQueue* getMessageQueueToGUI() { return m_messageQueueToGUI; }
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void handleData(); //!< Handle data when samples have to be processed
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNERBASEBAND_H
|
1013
plugins/channelrx/freqscanner/freqscannergui.cpp
Normal file
1013
plugins/channelrx/freqscanner/freqscannergui.cpp
Normal file
File diff suppressed because it is too large
Load Diff
146
plugins/channelrx/freqscanner/freqscannergui.h
Normal file
146
plugins/channelrx/freqscanner/freqscannergui.h
Normal file
@ -0,0 +1,146 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERGUI_H
|
||||
#define INCLUDE_FREQSCANNERGUI_H
|
||||
|
||||
#include "channel/channelgui.h"
|
||||
#include "dsp/channelmarker.h"
|
||||
#include "util/messagequeue.h"
|
||||
#include "settings/rollupstate.h"
|
||||
#include "freqscanner.h"
|
||||
#include "freqscannersettings.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSink;
|
||||
class FreqScanner;
|
||||
class FreqScannerGUI;
|
||||
class QMenu;
|
||||
|
||||
namespace Ui {
|
||||
class FreqScannerGUI;
|
||||
}
|
||||
class FreqScannerGUI;
|
||||
|
||||
class FreqScannerGUI : public ChannelGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static FreqScannerGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
|
||||
virtual void destroy();
|
||||
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; };
|
||||
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; };
|
||||
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; };
|
||||
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; };
|
||||
virtual QString getTitle() const { return m_settings.m_title; };
|
||||
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; };
|
||||
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; }
|
||||
virtual bool getHidden() const { return m_settings.m_hidden; }
|
||||
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; }
|
||||
virtual int getStreamIndex() const { return m_settings.m_streamIndex; }
|
||||
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; }
|
||||
|
||||
public slots:
|
||||
void channelMarkerChangedByCursor();
|
||||
void channelMarkerHighlightedByCursor();
|
||||
|
||||
private:
|
||||
Ui::FreqScannerGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceUISet* m_deviceUISet;
|
||||
ChannelMarker m_channelMarker;
|
||||
RollupState m_rollupState;
|
||||
FreqScannerSettings m_settings;
|
||||
qint64 m_deviceCenterFrequency;
|
||||
bool m_doApplySettings;
|
||||
|
||||
FreqScanner* m_freqScanner;
|
||||
int m_basebandSampleRate;
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
QMenu *m_menu;
|
||||
|
||||
explicit FreqScannerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
|
||||
virtual ~FreqScannerGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
void applySetting(const QString& settingsKey);
|
||||
void applySettings(const QStringList& settingsKeys, bool force = false);
|
||||
void applyAllSettings();
|
||||
void displaySettings();
|
||||
bool handleMessage(const Message& message);
|
||||
void makeUIConnections();
|
||||
void updateAbsoluteCenterFrequency();
|
||||
void addRow(qint64 frequency, bool enabled, const QString& notes = "");
|
||||
void updateAnnotation(int row);
|
||||
void updateAnnotations();
|
||||
void updateChannelsList(const QList<FreqScannerSettings::AvailableChannel>& channels);
|
||||
void setAllEnabled(bool enable);
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(EnterEventType*);
|
||||
|
||||
void resizeTable();
|
||||
QAction* createCheckableItem(QString& text, int idx, bool checked);
|
||||
|
||||
enum Col {
|
||||
COL_FREQUENCY,
|
||||
COL_ANNOTATION,
|
||||
COL_ENABLE,
|
||||
COL_POWER,
|
||||
COL_ACTIVE_COUNT,
|
||||
COL_NOTES
|
||||
};
|
||||
|
||||
private slots:
|
||||
void on_channels_currentIndexChanged(int index);
|
||||
void on_deltaFrequency_changed(qint64 value);
|
||||
void on_channelBandwidth_changed(qint64 index);
|
||||
void on_scanTime_valueChanged(int value);
|
||||
void on_retransmitTime_valueChanged(int value);
|
||||
void on_tuneTime_valueChanged(int value);
|
||||
void on_thresh_valueChanged(int value);
|
||||
void on_priority_currentIndexChanged(int index);
|
||||
void on_measurement_currentIndexChanged(int index);
|
||||
void on_mode_currentIndexChanged(int index);
|
||||
void on_table_cellChanged(int row, int column);
|
||||
void table_customContextMenuRequested(QPoint pos);
|
||||
void table_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex);
|
||||
void table_sectionResized(int logicalIndex, int oldSize, int newSize);
|
||||
void columnSelectMenu(QPoint pos);
|
||||
void columnSelectMenuChecked(bool checked = false);
|
||||
void on_startStop_clicked(bool checked = false);
|
||||
void on_addSingle_clicked();
|
||||
void on_addRange_clicked();
|
||||
void on_remove_clicked();
|
||||
void on_removeInactive_clicked();
|
||||
void on_up_clicked();
|
||||
void on_down_clicked();
|
||||
void on_clearActiveCount_clicked();
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void handleInputMessages();
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNERGUI_H
|
806
plugins/channelrx/freqscanner/freqscannergui.ui
Normal file
806
plugins/channelrx/freqscanner/freqscannergui.ui
Normal file
@ -0,0 +1,806 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FreqScannerGUI</class>
|
||||
<widget class="RollupContents" name="FreqScannerGUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>419</width>
|
||||
<height>431</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Sans</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frequency Scanner</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="settingsContainer" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>411</width>
|
||||
<height>411</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="powLayout">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="channelsLabel">
|
||||
<property name="text">
|
||||
<string>Channel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="channels">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Channel to tune</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="deltaFrequencyLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Df</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ValueDialZ" name="deltaFrequency" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Minimum demod shift frequency from center in Hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="deltaUnits">
|
||||
<property name="text">
|
||||
<string>Hz </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="channelPowerLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="channelPower">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>30</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Active frequency power </string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="channelPowerUnits">
|
||||
<property name="text">
|
||||
<string> dB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="powerLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="threshLabel">
|
||||
<property name="text">
|
||||
<string>TH</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="thresh">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Power threshold in dB</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1000</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="threshText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-100.0 dB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tuneTimeLabel">
|
||||
<property name="text">
|
||||
<string>t<sub>Δf</sub></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="tuneTime">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Time in milliseconds to wait before starting measurement after changing frequency</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tuneTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>54</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1000 ms</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="scanTimeLabel">
|
||||
<property name="text">
|
||||
<string>t<sub>S</sub></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="scanTime">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Scan power measurement time in seconds</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="scanTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10.0 s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="retransmitTimeLabel">
|
||||
<property name="text">
|
||||
<string>t<sub>RTX</sub></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="retransmitTime">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Time in seconds to wait for frequency to become active again, before restarting scan</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="retransmitTimeText">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10.0 s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="phySettingsLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="rfBWLabel">
|
||||
<property name="text">
|
||||
<string>Ch BW</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ValueDialZ" name="channelBandwidth" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Channel bandwidth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="rfBWUnits">
|
||||
<property name="text">
|
||||
<string>Hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="priorityLabel">
|
||||
<property name="text">
|
||||
<string>Pri</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="priority">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>85</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Prioritisation. Select frequency with highest power or first in table.</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Max Power</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Table Order</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="measurementLabel">
|
||||
<property name="text">
|
||||
<string>Meas</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="measurement">
|
||||
<property name="toolTip">
|
||||
<string>Whether the power measurement is the peak power within the channel or total channel power</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Peak</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Total</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="filterLine">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="toolbarLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="mode">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Run mode</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Single</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Continuous</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Scan-only</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ButtonSwitch" name="startStop">
|
||||
<property name="toolTip">
|
||||
<string>Start/stop frequency scanning</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||
<normaloff>:/play.png</normaloff>
|
||||
<normalon>:/stop.png</normalon>:/play.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="status">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="table">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Freq (Hz)</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Center frequency in Hertz of the channel</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Annotation</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Whether the channel is enabled</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Power (dB)</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Channel power in decibels during the previous scan</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Active Count</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Count of the number of times the channel is active when scanned</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Notes</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>User notes about this frequency</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="addSingle">
|
||||
<property name="toolTip">
|
||||
<string>Add a single frequency</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="addRange">
|
||||
<property name="toolTip">
|
||||
<string>Add a range of frequencies</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add Range</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="remove">
|
||||
<property name="toolTip">
|
||||
<string>Remove selected items</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="removeInactive">
|
||||
<property name="toolTip">
|
||||
<string>Remove rows with Active Count of 0</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove Inactive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="up">
|
||||
<property name="toolTip">
|
||||
<string>Move selected rows up</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||
<normaloff>:/arrow_up.png</normaloff>:/arrow_up.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="down">
|
||||
<property name="toolTip">
|
||||
<string>Move selected rows down</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||
<normaloff>:/arrow_down.png</normaloff>:/arrow_down.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="clearActiveCount">
|
||||
<property name="toolTip">
|
||||
<string>Clear Active Count in all rows</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../sdrgui/resources/res.qrc">
|
||||
<normaloff>:/bin.png</normaloff>:/bin.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ButtonSwitch</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header>gui/buttonswitch.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RollupContents</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/rollupcontents.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ValueDialZ</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>gui/valuedialz.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>deltaFrequency</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../../sdrgui/resources/res.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
93
plugins/channelrx/freqscanner/freqscannerplugin.cpp
Normal file
93
plugins/channelrx/freqscanner/freqscannerplugin.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QtPlugin>
|
||||
#include "plugin/pluginapi.h"
|
||||
|
||||
#ifndef SERVER_MODE
|
||||
#include "freqscannergui.h"
|
||||
#endif
|
||||
#include "freqscanner.h"
|
||||
#include "freqscannerwebapiadapter.h"
|
||||
#include "freqscannerplugin.h"
|
||||
|
||||
const PluginDescriptor FreqScannerPlugin::m_pluginDescriptor = {
|
||||
FreqScanner::m_channelId,
|
||||
QStringLiteral("Frequency Scanner"),
|
||||
QStringLiteral("7.17.0"),
|
||||
QStringLiteral("(c) Jon Beniston, M7RCE"),
|
||||
QStringLiteral("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
QStringLiteral("https://github.com/f4exb/sdrangel")
|
||||
};
|
||||
|
||||
FreqScannerPlugin::FreqScannerPlugin(QObject* parent) :
|
||||
QObject(parent),
|
||||
m_pluginAPI(0)
|
||||
{
|
||||
}
|
||||
|
||||
const PluginDescriptor& FreqScannerPlugin::getPluginDescriptor() const
|
||||
{
|
||||
return m_pluginDescriptor;
|
||||
}
|
||||
|
||||
void FreqScannerPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
m_pluginAPI = pluginAPI;
|
||||
|
||||
m_pluginAPI->registerRxChannel(FreqScanner::m_channelIdURI, FreqScanner::m_channelId, this);
|
||||
}
|
||||
|
||||
void FreqScannerPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const
|
||||
{
|
||||
if (bs || cs)
|
||||
{
|
||||
FreqScanner *instance = new FreqScanner(deviceAPI);
|
||||
|
||||
if (bs) {
|
||||
*bs = instance;
|
||||
}
|
||||
|
||||
if (cs) {
|
||||
*cs = instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SERVER_MODE
|
||||
ChannelGUI* FreqScannerPlugin::createRxChannelGUI(
|
||||
DeviceUISet *deviceUISet,
|
||||
BasebandSampleSink *rxChannel) const
|
||||
{
|
||||
(void) deviceUISet;
|
||||
(void) rxChannel;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
ChannelGUI* FreqScannerPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const
|
||||
{
|
||||
return FreqScannerGUI::create(m_pluginAPI, deviceUISet, rxChannel);
|
||||
}
|
||||
#endif
|
||||
|
||||
ChannelWebAPIAdapter* FreqScannerPlugin::createChannelWebAPIAdapter() const
|
||||
{
|
||||
return new FreqScannerWebAPIAdapter();
|
||||
}
|
||||
|
50
plugins/channelrx/freqscanner/freqscannerplugin.h
Normal file
50
plugins/channelrx/freqscanner/freqscannerplugin.h
Normal file
@ -0,0 +1,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERPLUGIN_H
|
||||
#define INCLUDE_FREQSCANNERPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceUISet;
|
||||
class BasebandSampleSink;
|
||||
|
||||
class FreqScannerPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
Q_PLUGIN_METADATA(IID "sdrangel.channel.freqscanner")
|
||||
|
||||
public:
|
||||
explicit FreqScannerPlugin(QObject* parent = NULL);
|
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual void createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const;
|
||||
virtual ChannelGUI* createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const;
|
||||
virtual ChannelWebAPIAdapter* createChannelWebAPIAdapter() const;
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
PluginAPI* m_pluginAPI;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNERPLUGIN_H
|
||||
|
368
plugins/channelrx/freqscanner/freqscannersettings.cpp
Normal file
368
plugins/channelrx/freqscanner/freqscannersettings.cpp
Normal file
@ -0,0 +1,368 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2015 Edouard Griffiths, F4EXB. //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QColor>
|
||||
|
||||
#include "util/simpleserializer.h"
|
||||
#include "settings/serializable.h"
|
||||
#include "freqscannersettings.h"
|
||||
|
||||
FreqScannerSettings::FreqScannerSettings() :
|
||||
m_channelMarker(nullptr),
|
||||
m_rollupState(nullptr)
|
||||
{
|
||||
for (int i = 0; i < FREQSCANNER_COLUMNS; i++)
|
||||
{
|
||||
m_columnIndexes.append(i);
|
||||
m_columnSizes.append(-1);
|
||||
}
|
||||
resetToDefaults();
|
||||
}
|
||||
|
||||
void FreqScannerSettings::resetToDefaults()
|
||||
{
|
||||
m_inputFrequencyOffset = 0;
|
||||
m_channelBandwidth = 25000;
|
||||
m_channelFrequencyOffset = 25000;
|
||||
m_threshold = -60.0f;
|
||||
m_channel = "";
|
||||
m_scanTime = 0.1f;
|
||||
m_retransmitTime = 2.0f;
|
||||
m_tuneTime = 100;
|
||||
m_priority = MAX_POWER;
|
||||
m_measurement = PEAK;
|
||||
m_mode = CONTINUOUS;
|
||||
|
||||
for (int i = 0; i < FREQSCANNER_COLUMNS; i++)
|
||||
{
|
||||
m_columnIndexes[i] = i;
|
||||
m_columnSizes[i] = -1; // Autosize
|
||||
}
|
||||
|
||||
m_rgbColor = QColor(0, 205, 200).rgb();
|
||||
m_title = "Frequency Scanner";
|
||||
m_streamIndex = 0;
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_reverseAPIChannelIndex = 0;
|
||||
m_workspaceIndex = 0;
|
||||
m_hidden = false;
|
||||
}
|
||||
|
||||
QByteArray FreqScannerSettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeS32(1, m_inputFrequencyOffset);
|
||||
s.writeS32(2, m_channelBandwidth);
|
||||
s.writeS32(3, m_channelFrequencyOffset);
|
||||
s.writeFloat(4, m_threshold);
|
||||
s.writeList(5, m_notes);
|
||||
s.writeList(6, m_enabled);
|
||||
s.writeList(7, m_frequencies);
|
||||
s.writeString(8, m_channel);
|
||||
s.writeFloat(9, m_scanTime);
|
||||
s.writeFloat(10, m_retransmitTime);
|
||||
s.writeS32(11, m_tuneTime);
|
||||
s.writeS32(12, (int)m_priority);
|
||||
s.writeS32(13, (int)m_measurement);
|
||||
s.writeS32(14, (int)m_mode);
|
||||
|
||||
s.writeList(20, m_columnIndexes);
|
||||
s.writeList(21, m_columnSizes);
|
||||
|
||||
s.writeU32(40, m_rgbColor);
|
||||
s.writeString(41, m_title);
|
||||
if (m_channelMarker) {
|
||||
s.writeBlob(42, m_channelMarker->serialize());
|
||||
}
|
||||
s.writeS32(44, m_streamIndex);
|
||||
s.writeBool(45, m_useReverseAPI);
|
||||
s.writeString(46, m_reverseAPIAddress);
|
||||
s.writeU32(47, m_reverseAPIPort);
|
||||
s.writeU32(48, m_reverseAPIDeviceIndex);
|
||||
s.writeU32(49, m_reverseAPIChannelIndex);
|
||||
if (m_rollupState) {
|
||||
s.writeBlob(52, m_rollupState->serialize());
|
||||
}
|
||||
s.writeS32(53, m_workspaceIndex);
|
||||
s.writeBlob(54, m_geometryBytes);
|
||||
s.writeBool(55, m_hidden);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
|
||||
bool FreqScannerSettings::deserialize(const QByteArray& data)
|
||||
{
|
||||
SimpleDeserializer d(data);
|
||||
|
||||
if(!d.isValid())
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(d.getVersion() == 1)
|
||||
{
|
||||
QByteArray bytetmp;
|
||||
uint32_t utmp;
|
||||
QString strtmp;
|
||||
|
||||
d.readS32(1, &m_inputFrequencyOffset, 0);
|
||||
d.readS32(2, &m_channelBandwidth, 25000);
|
||||
d.readS32(3, &m_channelFrequencyOffset, 25000);
|
||||
d.readFloat(4, &m_threshold, -60.0f);
|
||||
d.readList(5, &m_notes);
|
||||
d.readList(6, &m_enabled);
|
||||
d.readList(7, &m_frequencies);
|
||||
d.readString(8, &m_channel);
|
||||
while (m_notes.size() < m_frequencies.size()) {
|
||||
m_notes.append("");
|
||||
}
|
||||
while (m_enabled.size() < m_frequencies.size()) {
|
||||
m_enabled.append(true);
|
||||
}
|
||||
d.readFloat(9, &m_scanTime, 0.1f);
|
||||
d.readFloat(10, &m_retransmitTime, 2.0f);
|
||||
d.readS32(11, &m_tuneTime, 100);
|
||||
d.readS32(12, (int*)&m_priority, (int)MAX_POWER);
|
||||
d.readS32(13, (int*)&m_measurement, (int)PEAK);
|
||||
d.readS32(14, (int*)&m_mode, (int)CONTINUOUS);
|
||||
|
||||
d.readList(20, &m_columnIndexes);
|
||||
d.readList(21, &m_columnSizes);
|
||||
|
||||
d.readU32(40, &m_rgbColor, QColor(0, 205, 200).rgb());
|
||||
d.readString(41, &m_title, "Frequency Scanner");
|
||||
if (m_channelMarker)
|
||||
{
|
||||
d.readBlob(42, &bytetmp);
|
||||
m_channelMarker->deserialize(bytetmp);
|
||||
}
|
||||
d.readS32(44, &m_streamIndex, 0);
|
||||
d.readBool(45, &m_useReverseAPI, false);
|
||||
d.readString(46, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(47, &utmp, 0);
|
||||
if ((utmp > 1023) && (utmp < 65535)) {
|
||||
m_reverseAPIPort = utmp;
|
||||
} else {
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
d.readU32(48, &utmp, 0);
|
||||
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
|
||||
d.readU32(49, &utmp, 0);
|
||||
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
|
||||
if (m_rollupState)
|
||||
{
|
||||
d.readBlob(52, &bytetmp);
|
||||
m_rollupState->deserialize(bytetmp);
|
||||
}
|
||||
d.readS32(53, &m_workspaceIndex, 0);
|
||||
d.readBlob(54, &m_geometryBytes);
|
||||
d.readBool(55, &m_hidden, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
resetToDefaults();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void FreqScannerSettings::applySettings(const QStringList& settingsKeys, const FreqScannerSettings& settings)
|
||||
{
|
||||
if (settingsKeys.contains("inputFrequencyOffset")) {
|
||||
m_inputFrequencyOffset = settings.m_inputFrequencyOffset;
|
||||
}
|
||||
if (settingsKeys.contains("channelBandwidth")) {
|
||||
m_channelBandwidth = settings.m_channelBandwidth;
|
||||
}
|
||||
if (settingsKeys.contains("channelFrequencyOffset")) {
|
||||
m_channelFrequencyOffset = settings.m_channelFrequencyOffset;
|
||||
}
|
||||
if (settingsKeys.contains("threshold")) {
|
||||
m_threshold = settings.m_threshold;
|
||||
}
|
||||
if (settingsKeys.contains("frequencies")) {
|
||||
m_frequencies = settings.m_frequencies;
|
||||
}
|
||||
if (settingsKeys.contains("enabled")) {
|
||||
m_enabled = settings.m_enabled;
|
||||
}
|
||||
if (settingsKeys.contains("notes")) {
|
||||
m_notes = settings.m_notes;
|
||||
}
|
||||
if (settingsKeys.contains("channel")) {
|
||||
m_channel = settings.m_channel;
|
||||
}
|
||||
if (settingsKeys.contains("scanTime")) {
|
||||
m_scanTime = settings.m_scanTime;
|
||||
}
|
||||
if (settingsKeys.contains("retransmitTime")) {
|
||||
m_retransmitTime = settings.m_retransmitTime;
|
||||
}
|
||||
if (settingsKeys.contains("tuneTime")) {
|
||||
m_tuneTime = settings.m_tuneTime;
|
||||
}
|
||||
if (settingsKeys.contains("priority")) {
|
||||
m_priority = settings.m_priority;
|
||||
}
|
||||
if (settingsKeys.contains("measurement")) {
|
||||
m_measurement = settings.m_measurement;
|
||||
}
|
||||
if (settingsKeys.contains("mode")) {
|
||||
m_mode = settings.m_mode;
|
||||
}
|
||||
if (settingsKeys.contains("columnIndexes")) {
|
||||
m_columnIndexes = settings.m_columnIndexes;
|
||||
}
|
||||
if (settingsKeys.contains("columnSizes")) {
|
||||
m_columnSizes = settings.m_columnSizes;
|
||||
}
|
||||
if (settingsKeys.contains("rgbColor")) {
|
||||
m_rgbColor = settings.m_rgbColor;
|
||||
}
|
||||
if (settingsKeys.contains("title")) {
|
||||
m_title = settings.m_title;
|
||||
}
|
||||
if (settingsKeys.contains("streamIndex")) {
|
||||
m_streamIndex = settings.m_streamIndex;
|
||||
}
|
||||
if (settingsKeys.contains("useReverseAPI")) {
|
||||
m_useReverseAPI = settings.m_useReverseAPI;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIAddress")) {
|
||||
m_reverseAPIAddress = settings.m_reverseAPIAddress;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIPort")) {
|
||||
m_reverseAPIPort = settings.m_reverseAPIPort;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
m_reverseAPIDeviceIndex = settings.m_reverseAPIDeviceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIChannelIndex")) {
|
||||
m_reverseAPIChannelIndex = settings.m_reverseAPIChannelIndex;
|
||||
}
|
||||
if (settingsKeys.contains("workspaceIndex")) {
|
||||
m_workspaceIndex = settings.m_workspaceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("hidden")) {
|
||||
m_hidden = settings.m_hidden;
|
||||
}
|
||||
}
|
||||
|
||||
QString FreqScannerSettings::getDebugString(const QStringList& settingsKeys, bool force) const
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
|
||||
if (settingsKeys.contains("inputFrequencyOffset") || force) {
|
||||
ostr << " m_inputFrequencyOffset: " << m_inputFrequencyOffset;
|
||||
}
|
||||
if (settingsKeys.contains("channelBandwidth") || force) {
|
||||
ostr << " m_channelBandwidth: " << m_channelBandwidth;
|
||||
}
|
||||
if (settingsKeys.contains("channelFrequencyOffset") || force) {
|
||||
ostr << " m_channelFrequencyOffset: " << m_channelFrequencyOffset;
|
||||
}
|
||||
if (settingsKeys.contains("threshold") || force) {
|
||||
ostr << " m_threshold: " << m_threshold;
|
||||
}
|
||||
if (settingsKeys.contains("frequencies") || force)
|
||||
{
|
||||
QStringList s;
|
||||
for (auto f : m_frequencies) {
|
||||
s.append(QString::number(f));
|
||||
}
|
||||
ostr << " m_frequencies: " << s.join(",").toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("enabled") || force)
|
||||
{
|
||||
// Don't display
|
||||
/*QStringList s;
|
||||
for (auto e : m_enabled) {
|
||||
s.append(e ? "true" : "false");
|
||||
}
|
||||
ostr << " m_enabled: " << s.join(",").toStdString();*/
|
||||
}
|
||||
if (settingsKeys.contains("notes") || force) {
|
||||
// Don't display
|
||||
//ostr << " m_notes: " << m_notes.join(",").toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("channel") || force) {
|
||||
ostr << " m_channel: " << m_channel.toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("scanTime") || force) {
|
||||
ostr << " m_scanTime: " << m_scanTime;
|
||||
}
|
||||
if (settingsKeys.contains("retransmitTime") || force) {
|
||||
ostr << " m_retransmitTime: " << m_retransmitTime;
|
||||
}
|
||||
if (settingsKeys.contains("tuneTime") || force) {
|
||||
ostr << " m_tuneTime: " << m_tuneTime;
|
||||
}
|
||||
if (settingsKeys.contains("priority") || force) {
|
||||
ostr << " m_priority: " << m_priority;
|
||||
}
|
||||
if (settingsKeys.contains("measurement") || force) {
|
||||
ostr << " m_measurement: " << m_measurement;
|
||||
}
|
||||
if (settingsKeys.contains("mode") || force) {
|
||||
ostr << " m_mode: " << m_mode;
|
||||
}
|
||||
if (settingsKeys.contains("columnIndexes") || force) {
|
||||
// Don't display
|
||||
}
|
||||
if (settingsKeys.contains("columnSizes") || force) {
|
||||
// Don't display
|
||||
}
|
||||
if (settingsKeys.contains("rgbColor") || force) {
|
||||
ostr << " m_rgbColor: " << m_rgbColor;
|
||||
}
|
||||
if (settingsKeys.contains("title") || force) {
|
||||
ostr << " m_title: " << m_title.toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("streamIndex") || force) {
|
||||
ostr << " m_streamIndex: " << m_streamIndex;
|
||||
}
|
||||
if (settingsKeys.contains("useReverseAPI") || force) {
|
||||
ostr << " m_useReverseAPI: " << m_useReverseAPI;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIAddress") || force) {
|
||||
ostr << " m_reverseAPIAddress: " << m_reverseAPIAddress.toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIPort") || force) {
|
||||
ostr << " m_reverseAPIPort: " << m_reverseAPIPort;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIDeviceIndex") || force) {
|
||||
ostr << " m_reverseAPIDeviceIndex: " << m_reverseAPIDeviceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIChannelIndex") || force) {
|
||||
ostr << " m_reverseAPIChannelIndex: " << m_reverseAPIChannelIndex;
|
||||
}
|
||||
if (settingsKeys.contains("workspaceIndex") || force) {
|
||||
ostr << " m_workspaceIndex: " << m_workspaceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("hidden") || force) {
|
||||
ostr << " m_hidden: " << m_hidden;
|
||||
}
|
||||
|
||||
return QString(ostr.str().c_str());
|
||||
}
|
95
plugins/channelrx/freqscanner/freqscannersettings.h
Normal file
95
plugins/channelrx/freqscanner/freqscannersettings.h
Normal file
@ -0,0 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERSETTINGS_H
|
||||
#define INCLUDE_FREQSCANNERSETTINGS_H
|
||||
|
||||
#include <QByteArray>
|
||||
|
||||
class Serializable;
|
||||
class ChannelAPI;
|
||||
|
||||
// Number of columns in the table
|
||||
#define FREQSCANNER_COLUMNS 6
|
||||
|
||||
struct FreqScannerSettings
|
||||
{
|
||||
struct AvailableChannel
|
||||
{
|
||||
int m_deviceSetIndex;
|
||||
int m_channelIndex;
|
||||
|
||||
AvailableChannel() = default;
|
||||
AvailableChannel(const AvailableChannel&) = default;
|
||||
AvailableChannel& operator=(const AvailableChannel&) = default;
|
||||
};
|
||||
|
||||
qint32 m_inputFrequencyOffset; //!< Not modifable in GUI
|
||||
qint32 m_channelBandwidth; //!< Channel bandwidth
|
||||
qint32 m_channelFrequencyOffset;//!< Minium DC offset of tuned channel
|
||||
Real m_threshold; //!< Power threshold in dB
|
||||
QList<qint64> m_frequencies; //!< Frequencies to scan
|
||||
QList<bool> m_enabled; //!< Whether corresponding frequency is enabled
|
||||
QList<QString> m_notes; //!< User editable notes about this frequency
|
||||
QString m_channel; //!< Channel (E.g: R1:4) to tune to active frequency
|
||||
float m_scanTime; //!< In seconds
|
||||
float m_retransmitTime; //!< In seconds
|
||||
int m_tuneTime; //!< In milliseconds
|
||||
enum Priority {
|
||||
MAX_POWER,
|
||||
TABLE_ORDER
|
||||
} m_priority; //!< Which frequency has priority when multiple frequencies are above threshold
|
||||
enum Measurement {
|
||||
PEAK,
|
||||
TOTAL
|
||||
} m_measurement; //!< How power is measured
|
||||
enum Mode {
|
||||
SINGLE,
|
||||
CONTINUOUS,
|
||||
SCAN_ONLY
|
||||
} m_mode; //!< Whether to run a single or many scans
|
||||
|
||||
QList<int> m_columnIndexes;//!< How the columns are ordered in the table
|
||||
QList<int> m_columnSizes; //!< Size of the coumns in the table
|
||||
|
||||
quint32 m_rgbColor;
|
||||
QString m_title;
|
||||
Serializable *m_channelMarker;
|
||||
int m_streamIndex; //!< MIMO channel. Not relevant when connected to SI (single Rx).
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
uint16_t m_reverseAPIChannelIndex;
|
||||
|
||||
Serializable *m_rollupState;
|
||||
int m_workspaceIndex;
|
||||
QByteArray m_geometryBytes;
|
||||
bool m_hidden;
|
||||
|
||||
FreqScannerSettings();
|
||||
void resetToDefaults();
|
||||
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
|
||||
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
void applySettings(const QStringList& settingsKeys, const FreqScannerSettings& settings);
|
||||
QString getDebugString(const QStringList& settingsKeys, bool force = false) const;
|
||||
};
|
||||
|
||||
#endif /* INCLUDE_FREQSCANNERSETTINGS_H */
|
255
plugins/channelrx/freqscanner/freqscannersink.cpp
Normal file
255
plugins/channelrx/freqscanner/freqscannersink.cpp
Normal file
@ -0,0 +1,255 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <complex.h>
|
||||
|
||||
#include "dsp/dspengine.h"
|
||||
#include "util/db.h"
|
||||
|
||||
#include "freqscanner.h"
|
||||
#include "freqscannersink.h"
|
||||
|
||||
FreqScannerSink::FreqScannerSink(FreqScanner *ilsDemod) :
|
||||
m_freqScanner(ilsDemod),
|
||||
m_channel(nullptr),
|
||||
m_channelSampleRate(48000),
|
||||
m_channelFrequencyOffset(0),
|
||||
m_scannerSampleRate(33320),
|
||||
m_centerFrequency(0),
|
||||
m_messageQueueToChannel(nullptr),
|
||||
m_fftSequence(-1),
|
||||
m_fft(nullptr),
|
||||
m_fftCounter(0),
|
||||
m_fftSize(1024),
|
||||
m_binsPerChannel(16),
|
||||
m_averageCount(0)
|
||||
{
|
||||
applySettings(m_settings, QStringList(), true);
|
||||
applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, 16, 4, true);
|
||||
}
|
||||
|
||||
FreqScannerSink::~FreqScannerSink()
|
||||
{
|
||||
}
|
||||
|
||||
void FreqScannerSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
|
||||
{
|
||||
Complex ci;
|
||||
|
||||
for (SampleVector::const_iterator it = begin; it != end; ++it)
|
||||
{
|
||||
Complex c(it->real(), it->imag());
|
||||
c *= m_nco.nextIQ();
|
||||
|
||||
if (m_interpolatorDistance < 1.0f) // interpolate
|
||||
{
|
||||
while (!m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci))
|
||||
{
|
||||
processOneSample(ci);
|
||||
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
||||
}
|
||||
}
|
||||
else // decimate (and filter)
|
||||
{
|
||||
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
|
||||
{
|
||||
processOneSample(ci);
|
||||
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FreqScannerSink::processOneSample(Complex &ci)
|
||||
{
|
||||
ci /= SDR_RX_SCALEF;
|
||||
|
||||
m_fft->in()[m_fftCounter] = ci;
|
||||
m_fftCounter++;
|
||||
if (m_fftCounter == m_fftSize)
|
||||
{
|
||||
// Apply windowing function
|
||||
m_fftWindow.apply(m_fft->in());
|
||||
|
||||
// Perform FFT
|
||||
m_fft->transform();
|
||||
|
||||
// Reorder (so negative frequencies are first) and average
|
||||
int halfSize = m_fftSize / 2;
|
||||
for (int i = 0; i < halfSize; i++) {
|
||||
m_fftAverage.storeAndGetAvg(m_magSq[i], magSq(i + halfSize), i);
|
||||
}
|
||||
for (int i = 0; i < halfSize; i++) {
|
||||
m_fftAverage.storeAndGetAvg(m_magSq[i + halfSize], magSq(i), i + halfSize);
|
||||
}
|
||||
|
||||
if (m_fftAverage.nextAverage())
|
||||
{
|
||||
// Send results to channel
|
||||
if (getMessageQueueToChannel() && (m_settings.m_channelBandwidth != 0) && (m_binsPerChannel != 0))
|
||||
{
|
||||
FreqScanner::MsgScanResult* msg = FreqScanner::MsgScanResult::create(m_fftStartTime);
|
||||
QList<FreqScanner::MsgScanResult::ScanResult>& results = msg->getScanResults();
|
||||
|
||||
for (int i = 0; i < m_settings.m_frequencies.size(); i++)
|
||||
{
|
||||
if (m_settings.m_enabled[i])
|
||||
{
|
||||
qint64 frequency = m_settings.m_frequencies[i];
|
||||
qint64 startFrequency = m_centerFrequency - m_scannerSampleRate / 2;
|
||||
qint64 diff = frequency - startFrequency;
|
||||
float binBW = m_scannerSampleRate / (float)m_fftSize;
|
||||
|
||||
// Ignore results in uppper and lower 12.5%, as there may be aliasing here from half-band filters
|
||||
if ((diff < m_scannerSampleRate * 0.875f) && (diff >= m_scannerSampleRate * 0.125f))
|
||||
{
|
||||
int bin = std::round(diff / binBW);
|
||||
|
||||
// Calculate power at that frequency
|
||||
Real power;
|
||||
if (m_settings.m_measurement == FreqScannerSettings::PEAK) {
|
||||
power = peakPower(bin);
|
||||
} else {
|
||||
power = totalPower(bin);
|
||||
}
|
||||
//qDebug() << "startFrequency:" << startFrequency << "m_scannerSampleRate:" << m_scannerSampleRate << "m_centerFrequency:" << m_centerFrequency << "frequency" << frequency << "bin" << bin << "power" << power;
|
||||
FreqScanner::MsgScanResult::ScanResult result = {frequency, power};
|
||||
results.append(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
getMessageQueueToChannel()->push(msg);
|
||||
}
|
||||
m_averageCount = 0;
|
||||
m_fftStartTime = QDateTime::currentDateTime();
|
||||
}
|
||||
m_fftCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate total power in a channel containing the specified bin (i.e. sums adjacent bins in the same channel)
|
||||
Real FreqScannerSink::totalPower(int bin) const
|
||||
{
|
||||
// Skip bin between halfway between channels
|
||||
// Then skip first and last bins, to avoid spectral leakage (particularly at DC)
|
||||
int startBin = bin - m_binsPerChannel / 2 + 1 + 1;
|
||||
Real magSqSum = 0.0f;
|
||||
for (int i = 0; i < m_binsPerChannel - 2 - 1; i++) {
|
||||
int idx = startBin + i;
|
||||
if ((idx < 0) || (idx >= m_fftSize)) {
|
||||
continue;
|
||||
}
|
||||
magSqSum += m_magSq[idx];
|
||||
}
|
||||
Real db = CalcDb::dbPower(magSqSum);
|
||||
return db;
|
||||
}
|
||||
|
||||
// Calculate peak power in a channel containing the specified bin
|
||||
Real FreqScannerSink::peakPower(int bin) const
|
||||
{
|
||||
// Skip bin between halfway between channels
|
||||
// Then skip first and last bins, to avoid spectral leakage (particularly at DC)
|
||||
int startBin = bin - m_binsPerChannel/2 + 1 + 1;
|
||||
Real maxMagSq = std::numeric_limits<Real>::min();
|
||||
for (int i = 0; i < m_binsPerChannel - 2 - 1; i++)
|
||||
{
|
||||
int idx = startBin + i;
|
||||
if ((idx < 0) || (idx >= m_fftSize)) {
|
||||
continue;
|
||||
}
|
||||
//qDebug() << "idx:" << idx << "power:" << CalcDb::dbPower(m_magSq[idx]);
|
||||
maxMagSq = std::max(maxMagSq, m_magSq[idx]);
|
||||
}
|
||||
Real db = CalcDb::dbPower(maxMagSq);
|
||||
return db;
|
||||
}
|
||||
|
||||
Real FreqScannerSink::magSq(int bin) const
|
||||
{
|
||||
Complex c = m_fft->out()[bin];
|
||||
Real v = c.real() * c.real() + c.imag() * c.imag();
|
||||
Real magsq = v / (m_fftSize * m_fftSize);
|
||||
return magsq;
|
||||
}
|
||||
|
||||
void FreqScannerSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, int scannerSampleRate, int fftSize, int binsPerChannel, bool force)
|
||||
{
|
||||
qDebug() << "FreqScannerSink::applyChannelSettings:"
|
||||
<< " channelSampleRate: " << channelSampleRate
|
||||
<< " channelFrequencyOffset: " << channelFrequencyOffset
|
||||
<< " scannerSampleRate: " << scannerSampleRate
|
||||
<< " fftSize: " << fftSize
|
||||
<< " binsPerChannel: " << binsPerChannel;
|
||||
|
||||
if ((m_channelFrequencyOffset != channelFrequencyOffset) ||
|
||||
(m_channelSampleRate != channelSampleRate) || force)
|
||||
{
|
||||
m_nco.setFreq(-channelFrequencyOffset, channelSampleRate);
|
||||
}
|
||||
|
||||
if ((m_channelSampleRate != channelSampleRate) || (m_scannerSampleRate != scannerSampleRate) || force)
|
||||
{
|
||||
m_interpolator.create(16, channelSampleRate, scannerSampleRate / 2.2); // Filter potential aliasing resulting from half-band filters
|
||||
m_interpolatorDistance = (Real) channelSampleRate / (Real)scannerSampleRate;
|
||||
m_interpolatorDistanceRemain = m_interpolatorDistance;
|
||||
}
|
||||
|
||||
if ((m_fftSize != fftSize) || force)
|
||||
{
|
||||
FFTFactory* fftFactory = DSPEngine::instance()->getFFTFactory();
|
||||
if (m_fftSequence >= 0) {
|
||||
fftFactory->releaseEngine(fftSize, false, m_fftSequence);
|
||||
}
|
||||
m_fftSequence = fftFactory->getEngine(fftSize, false, &m_fft);
|
||||
m_fftCounter = 0;
|
||||
m_fftStartTime = QDateTime::currentDateTime();
|
||||
m_fftWindow.create(FFTWindow::Hanning, fftSize);
|
||||
|
||||
int averages = m_settings.m_scanTime * scannerSampleRate / 2 / fftSize;
|
||||
m_fftAverage.resize(fftSize, averages);
|
||||
m_magSq.resize(fftSize);
|
||||
}
|
||||
|
||||
m_channelSampleRate = channelSampleRate;
|
||||
m_channelFrequencyOffset = channelFrequencyOffset;
|
||||
m_scannerSampleRate = scannerSampleRate;
|
||||
m_fftSize = fftSize;
|
||||
m_binsPerChannel = binsPerChannel;
|
||||
}
|
||||
|
||||
void FreqScannerSink::applySettings(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force)
|
||||
{
|
||||
qDebug() << "FreqScannerSink::applySettings:"
|
||||
<< settings.getDebugString(settingsKeys, force)
|
||||
<< " force: " << force;
|
||||
|
||||
if (settingsKeys.contains("scanTime") || force)
|
||||
{
|
||||
int averages = settings.m_scanTime * m_scannerSampleRate / 2 / m_fftSize;
|
||||
m_fftAverage.resize(m_fftSize, averages);
|
||||
}
|
||||
|
||||
if (force) {
|
||||
m_settings = settings;
|
||||
} else {
|
||||
m_settings.applySettings(settingsKeys, settings);
|
||||
}
|
||||
}
|
86
plugins/channelrx/freqscanner/freqscannersink.h
Normal file
86
plugins/channelrx/freqscanner/freqscannersink.h
Normal file
@ -0,0 +1,86 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNERSINK_H
|
||||
#define INCLUDE_FREQSCANNERSINK_H
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include "dsp/channelsamplesink.h"
|
||||
#include "dsp/nco.h"
|
||||
#include "dsp/interpolator.h"
|
||||
#include "dsp/fftfactory.h"
|
||||
#include "dsp/fftengine.h"
|
||||
#include "dsp/fftwindow.h"
|
||||
#include "util/fixedaverage2d.h"
|
||||
#include "util/messagequeue.h"
|
||||
|
||||
#include "freqscannersettings.h"
|
||||
|
||||
class ChannelAPI;
|
||||
class FreqScanner;
|
||||
|
||||
class FreqScannerSink : public ChannelSampleSink {
|
||||
public:
|
||||
FreqScannerSink(FreqScanner *packetDemod);
|
||||
~FreqScannerSink();
|
||||
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
|
||||
|
||||
void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, int scannerSampleRate, int fftSize, int binsPerChannel, bool force = false);
|
||||
void applySettings(const FreqScannerSettings& settings, const QStringList& settingsKeys, bool force = false);
|
||||
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; }
|
||||
void setChannel(ChannelAPI *channel) { m_channel = channel; }
|
||||
void setCenterFrequency(qint64 centerFrequency) { m_centerFrequency = centerFrequency; }
|
||||
|
||||
private:
|
||||
|
||||
FreqScanner *m_freqScanner;
|
||||
FreqScannerSettings m_settings;
|
||||
ChannelAPI *m_channel;
|
||||
int m_channelSampleRate;
|
||||
int m_channelFrequencyOffset;
|
||||
int m_scannerSampleRate; // Sample rate scanner runs at
|
||||
qint64 m_centerFrequency;
|
||||
|
||||
NCO m_nco;
|
||||
Interpolator m_interpolator;
|
||||
Real m_interpolatorDistance;
|
||||
Real m_interpolatorDistanceRemain;
|
||||
|
||||
MessageQueue *m_messageQueueToChannel;
|
||||
|
||||
int m_fftSequence;
|
||||
FFTEngine *m_fft;
|
||||
int m_fftCounter;
|
||||
FFTWindow m_fftWindow;
|
||||
int m_fftSize;
|
||||
int m_binsPerChannel;
|
||||
QDateTime m_fftStartTime;
|
||||
FixedAverage2D<Real> m_fftAverage; // magSq average
|
||||
QVector<Real> m_magSq;
|
||||
int m_averageCount;
|
||||
|
||||
void processOneSample(Complex &ci);
|
||||
MessageQueue *getMessageQueueToChannel() { return m_messageQueueToChannel; }
|
||||
Real totalPower(int bin) const;
|
||||
Real peakPower(int bin) const;
|
||||
Real magSq(int bin) const;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNERSINK_H
|
52
plugins/channelrx/freqscanner/freqscannerwebapiadapter.cpp
Normal file
52
plugins/channelrx/freqscanner/freqscannerwebapiadapter.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "freqscanner.h"
|
||||
#include "freqscannerwebapiadapter.h"
|
||||
|
||||
FreqScannerWebAPIAdapter::FreqScannerWebAPIAdapter()
|
||||
{}
|
||||
|
||||
FreqScannerWebAPIAdapter::~FreqScannerWebAPIAdapter()
|
||||
{}
|
||||
|
||||
int FreqScannerWebAPIAdapter::webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage)
|
||||
{
|
||||
(void) errorMessage;
|
||||
response.setFreqScannerSettings(new SWGSDRangel::SWGFreqScannerSettings());
|
||||
response.getFreqScannerSettings()->init();
|
||||
FreqScanner::webapiFormatChannelSettings(response, m_settings);
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
||||
int FreqScannerWebAPIAdapter::webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage)
|
||||
{
|
||||
(void) force;
|
||||
(void) errorMessage;
|
||||
FreqScanner::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
|
||||
|
||||
return 200;
|
||||
}
|
50
plugins/channelrx/freqscanner/freqscannerwebapiadapter.h
Normal file
50
plugins/channelrx/freqscanner/freqscannerwebapiadapter.h
Normal file
@ -0,0 +1,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
|
||||
// Copyright (C) 2023 Jon Beniston, M7RCE //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDE_FREQSCANNER_WEBAPIADAPTER_H
|
||||
#define INCLUDE_FREQSCANNER_WEBAPIADAPTER_H
|
||||
|
||||
#include "channel/channelwebapiadapter.h"
|
||||
#include "freqscannersettings.h"
|
||||
|
||||
/**
|
||||
* Standalone API adapter only for the settings
|
||||
*/
|
||||
class FreqScannerWebAPIAdapter : public ChannelWebAPIAdapter {
|
||||
public:
|
||||
FreqScannerWebAPIAdapter();
|
||||
virtual ~FreqScannerWebAPIAdapter();
|
||||
|
||||
virtual QByteArray serialize() const { return m_settings.serialize(); }
|
||||
virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); }
|
||||
|
||||
virtual int webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
private:
|
||||
FreqScannerSettings m_settings;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_FREQSCANNER_WEBAPIADAPTER_H
|
138
plugins/channelrx/freqscanner/readme.md
Normal file
138
plugins/channelrx/freqscanner/readme.md
Normal file
@ -0,0 +1,138 @@
|
||||
<h1>Frequency Scanner Plugin</h1>
|
||||
|
||||
<h2>Introduction</h2>
|
||||
|
||||
This plugin can be used to scan a range of frequencies looking for a transmission and then tune another channel (such as an AM or DSD Demod) to that frequency.
|
||||
|
||||
[Tutorial Video](https://www.youtube.com/watch?v=IpKP3t4Bmmg)
|
||||
|
||||
<h2>Interface</h2>
|
||||
|
||||
The top and bottom bars of the channel window are described [here](../../../sdrgui/channel/readme.md)
|
||||
|
||||
![Frequency Scanner plugin GUI](../../../doc/img/FreqScanner_plugin.png)
|
||||
|
||||
<h3>1: Channel</h3>
|
||||
|
||||
Specifies the channel (such as an AM, NFM or DSD Demod), by device set and channel index, that should be tuned to the active frequency.
|
||||
|
||||
<h3>2: Minimum frequency shift from center frequency of reception for channel</h3>
|
||||
|
||||
Use the wheels of keyboard to adjust the minimim frequency shift in Hz from the center frequency of reception for the channel (1).
|
||||
|
||||
This setting is typically used to avoid having the channel (1) centered at DC, which can be problematic for some demodulators used with SDRs with a DC spike.
|
||||
|
||||
<h3>3: Active frequency power</h3>
|
||||
|
||||
Average power in dB relative to a +/- 1.0 amplitude signal received for the active frequency. This is set to '-' while scanning.
|
||||
|
||||
<h3>4: TH - Threshold</h3>
|
||||
|
||||
Power threshold in dB that determines whether a frequency is active or not.
|
||||
|
||||
<h3>5: t_delta_f - Tune time</h3>
|
||||
|
||||
Specifies the time in milliseconds that the Frequency Scanner should wait after adjusting the device center frequency, before starting a measurement.
|
||||
This time should take in to account PLL settle time and the device to host transfer latency, so that the measurement only starts when IQ data
|
||||
that corresponds to the set frequency is being recieved.
|
||||
|
||||
<h3>6: t_s - Scan time</h3>
|
||||
|
||||
Specifies the time in seconds that the Frequency Scanner will average its power measurement over.
|
||||
|
||||
<h3>7: t_rtx - Retransmission Time</h3>
|
||||
|
||||
Specifies the time in seconds that the Frequency Scanner will wait after the power on the active frequency falls below the threshold, before restarting
|
||||
scanning. This enables the channel to remain tuned to a single frequency while there is a temporary break in transmission.
|
||||
|
||||
<h3>8: Ch BW - Channel Bandwidth</h3>
|
||||
|
||||
This specifies the bandwidth of the channels to be scanned.
|
||||
|
||||
<h3>9: Pri - Priority</h3>
|
||||
|
||||
Specifies which frequency will be chosen as the active frequency, when multiple frequencies exceed the threshold (4):
|
||||
|
||||
- Max power: The frequency with the highest power will be chosen
|
||||
- Table order: The frequency first in the frequency table (14) will be chosen.
|
||||
|
||||
<h3>10: Meas - Power Measurement</h3>
|
||||
|
||||
Specifies how power is measured. In both cases, a FFT is used.
|
||||
FFT size is typically the same as used for the Main Spectrum, but may be increased to ensure at least 8 bins cover the channel bandwidth (8).
|
||||
The first and last bins are excluded from the measurement (to reduce spectral leakage from adjacent channels):
|
||||
|
||||
- Peak: Power is the highest value in all of the bins, averaged over the scan time (6).
|
||||
- Total: Power is the sum of power in all of the bins, averaged over the scan time (6).
|
||||
|
||||
Peak can be used when you wish to set the threshold roughly according to the level displayed in the Main Spectrum.
|
||||
Total is potentially more useful for wideband signals, that are close to the noise floor.
|
||||
|
||||
<h3>11: Run Mode</h3>
|
||||
|
||||
Specifies the run mode:
|
||||
|
||||
- Single: All frequencies are scanned once. Channel (1) is tuned to the active frequency at the end of the scan. The scan does not repeat.
|
||||
- Continuous: All frequencies scanned, with channel (1) being tuned to active frequency at the end of the scan. Scan repeats once the power on the active frequency falls below the threshold (4) for longer than the retransmission time (7).
|
||||
- Scan only: All frequencies are scanned repeatedly. The channel will not be tuned. This mode is just for counting how often frequencies are active, which can be seen in the Active Count column in the frequency table (14).
|
||||
|
||||
<h3>12: Start/Stop Scanning</h3>
|
||||
|
||||
Press this button to start or stop scanning.
|
||||
|
||||
<h3>13: Status Text</h3>
|
||||
|
||||
Displays the current status of the Frequency Scanner.
|
||||
|
||||
- "Scanning": When scanning for active frequencies.
|
||||
- Frequency and annotation for active frequency.
|
||||
|
||||
<h3>14: Frequency Table</h3>
|
||||
|
||||
The frequency table contains the list of frequencies to be scanned, along with results of a scan. The columns are:
|
||||
|
||||
- Freq (Hz): Specifies the channel center frequencies to be scanned. Values should be entered in Hertz.
|
||||
- Annotation: An annotation (description) for the frequency, that is obtained from the closest matching [annotation marker](../../../sdrgui/gui/spectrummarkers.md) in the Main Spectrum.
|
||||
- Enable: Determines whether the frequency will be scanned. This can be used to temporaily disable frequencies you aren't interested in.
|
||||
- Power (dB): Displays the measured power in decibels from the last scan. The cell will have a green background if the power was above the threshold (4).
|
||||
- Active Count: Displays the number of scans in which the power for this frequency was above the threshold (4). This allows you to see which frequencies are commonly in use.
|
||||
- Notes: Available for user-entry of notes/information about this frequency.
|
||||
|
||||
When an active frequency is found after a scan, the corresponding row in the table will be selected.
|
||||
|
||||
Right clicking on a cell will display a popup menu:
|
||||
|
||||
- Copy contents of cell to clipboard.
|
||||
- Enable all rows.
|
||||
- Disable all rows.
|
||||
- Remove selected rows.
|
||||
- Tune selected channel (1) to the frequency in the row clicked on.
|
||||
|
||||
<h3>15: Add</h3>
|
||||
|
||||
Press to add a single row to the frequency table (14).
|
||||
|
||||
<h3>16: Add Range</h3>
|
||||
|
||||
Press to add a range of frequencies to the frequency table (14). A dialog is displayed with start and stop frequencies, as well as a step value.
|
||||
The step value should typically be an integer multiple of the channel bandwidth (8).
|
||||
|
||||
<h3>17: Remove</h3>
|
||||
|
||||
Removes the selected rows from the frequency table (14). Press Ctrl-A to select all rows.
|
||||
|
||||
<h3>18: Remove Inactive</h3>
|
||||
|
||||
Removes all rows with Active Count of 0.
|
||||
|
||||
<h3>19: Up</h3>
|
||||
|
||||
Moves the selected rows up the frequency table (14).
|
||||
|
||||
<h3>20: Down</h3>
|
||||
|
||||
Moves the selected rows the the frequency table (14).
|
||||
|
||||
<h3>21: Clear Active Count</h3>
|
||||
|
||||
Press to reset the value in the Active Count column to 0 for all rows.
|
@ -667,6 +667,8 @@ NoiseFigureGUI::NoiseFigureGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
|
||||
ui->results->setItemDelegateForColumn(RESULTS_COL_ENR, new DecimalDelegate(2));
|
||||
ui->results->setItemDelegateForColumn(RESULTS_COL_FLOOR, new DecimalDelegate(1));
|
||||
|
||||
ui->startStop->setStyleSheet(QString("QToolButton{ background-color: blue; } QToolButton:checked{ background-color: green; }"));
|
||||
|
||||
displaySettings();
|
||||
makeUIConnections();
|
||||
applySettings(true);
|
||||
|
@ -937,6 +937,47 @@ bool ChannelWebAPIUtils::setFrequencyOffset(unsigned int deviceIndex, int channe
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChannelWebAPIUtils::setAudioMute(unsigned int deviceIndex, int channelIndex, bool mute)
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings channelSettingsResponse;
|
||||
QString errorResponse;
|
||||
int httpRC;
|
||||
QJsonObject* jsonObj;
|
||||
|
||||
ChannelAPI* channel = MainCore::instance()->getChannel(deviceIndex, channelIndex);
|
||||
if (channel != nullptr)
|
||||
{
|
||||
httpRC = channel->webapiSettingsGet(channelSettingsResponse, errorResponse);
|
||||
if (httpRC / 100 != 2)
|
||||
{
|
||||
qWarning("ChannelWebAPIUtils::setAudioMute: get channel settings error %d: %s",
|
||||
httpRC, qPrintable(errorResponse));
|
||||
return false;
|
||||
}
|
||||
|
||||
jsonObj = channelSettingsResponse.asJsonObject();
|
||||
|
||||
if (WebAPIUtils::setSubObjectInt(*jsonObj, "audioMute", (int)mute))
|
||||
{
|
||||
QStringList keys;
|
||||
keys.append("audioMute");
|
||||
channelSettingsResponse.init();
|
||||
channelSettingsResponse.fromJsonObject(*jsonObj);
|
||||
httpRC = channel->webapiSettingsPutPatch(false, keys, channelSettingsResponse, errorResponse);
|
||||
if (httpRC / 100 != 2)
|
||||
{
|
||||
qWarning("ChannelWebAPIUtils::setAudioMute: patch channel settings error %d: %s",
|
||||
httpRC, qPrintable(errorResponse));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Start or stop all file sinks in a given device set
|
||||
bool ChannelWebAPIUtils::startStopFileSinks(unsigned int deviceIndex, bool start)
|
||||
{
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
static bool stop(unsigned int deviceIndex, int subsystemIndex=0);
|
||||
static bool getFrequencyOffset(unsigned int deviceIndex, int channelIndex, int& offset);
|
||||
static bool setFrequencyOffset(unsigned int deviceIndex, int channelIndex, int offset);
|
||||
static bool setAudioMute(unsigned int deviceIndex, int channelIndex, bool mute);
|
||||
static bool startStopFileSinks(unsigned int deviceIndex, bool start);
|
||||
static bool satelliteAOS(const QString name, bool northToSouthPass, const QString &tle, QDateTime dateTime);
|
||||
static bool satelliteLOS(const QString name);
|
||||
|
@ -4523,6 +4523,11 @@ bool WebAPIRequestMapper::getChannelSettings(
|
||||
channelSettings->setFreeDvModSettings(new SWGSDRangel::SWGFreeDVModSettings());
|
||||
channelSettings->getFreeDvModSettings()->fromJsonObject(settingsJsonObject);
|
||||
}
|
||||
else if (channelSettingsKey == "FreqScannerSettings")
|
||||
{
|
||||
channelSettings->setFreqScannerSettings(new SWGSDRangel::SWGFreqScannerSettings());
|
||||
channelSettings->getFreqScannerSettings()->fromJsonObject(settingsJsonObject);
|
||||
}
|
||||
else if (channelSettingsKey == "FreqTrackerSettings")
|
||||
{
|
||||
channelSettings->setFreqTrackerSettings(new SWGSDRangel::SWGFreqTrackerSettings());
|
||||
@ -5442,6 +5447,8 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
|
||||
channelSettings.setDatvModSettings(nullptr);
|
||||
channelSettings.setDabDemodSettings(nullptr);
|
||||
channelSettings.setDsdDemodSettings(nullptr);
|
||||
channelSettings.setFreqScannerSettings(nullptr);
|
||||
channelSettings.setFreqTrackerSettings(nullptr);
|
||||
channelSettings.setHeatMapSettings(nullptr);
|
||||
channelSettings.setIeee802154ModSettings(nullptr);
|
||||
channelSettings.setIlsDemodSettings(nullptr);
|
||||
@ -5484,6 +5491,8 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan
|
||||
channelReport.setBfmDemodReport(nullptr);
|
||||
channelReport.setDatvModReport(nullptr);
|
||||
channelReport.setDsdDemodReport(nullptr);
|
||||
channelReport.setFreqScannerReport(nullptr);
|
||||
channelReport.setFreqTrackerReport(nullptr);
|
||||
channelReport.setHeatMapReport(nullptr);
|
||||
channelReport.setIlsDemodReport(nullptr);
|
||||
channelReport.setNavtexDemodReport(nullptr);
|
||||
|
@ -47,6 +47,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = {
|
||||
{"sdrangel.channeltx.filesource", "FileSourceSettings"},
|
||||
{"sdrangel.channel.freedvdemod", "FreeDVDemodSettings"},
|
||||
{"sdrangel.channeltx.freedvmod", "FreeDVModSettings"},
|
||||
{"sdrangel.channel.freqscanner", "FreqScannerSettings"},
|
||||
{"sdrangel.channel.freqtracker", "FreqTrackerSettings"},
|
||||
{"sdrangel.channel.heatmap", "HeatMapSettings"},
|
||||
{"sdrangel.channel.ilsdemod", "ILSDemodSettings"},
|
||||
@ -168,6 +169,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = {
|
||||
{"FileSource", "FileSourceSettings"},
|
||||
{"FreeDVDemod", "FreeDVDemodSettings"},
|
||||
{"FreeDVMod", "FreeDVModSettings"},
|
||||
{"FreqScanner", "FreqScannerSettings"},
|
||||
{"FreqTracker", "FreqTrackerSettings"},
|
||||
{"HeatMap", "HeatMapSettings"},
|
||||
{"IEEE_802_15_4_Mod", "IEEE_802_15_4_ModSettings"},
|
||||
|
@ -79,18 +79,18 @@ void DialogPositioner::positionDialog(QWidget *dialog)
|
||||
|
||||
// Position so fully on screen
|
||||
QRect desktop = dialog->screen()->availableGeometry();
|
||||
QSize size = dialog->size();
|
||||
QRect geometry = dialog->frameGeometry();
|
||||
QPoint pos = dialog->pos();
|
||||
|
||||
bool move = false;
|
||||
if (pos.x() + size.width() > desktop.width())
|
||||
if (pos.x() + geometry.width() > desktop.width())
|
||||
{
|
||||
pos.setX(desktop.width() - size.width());
|
||||
pos.setX(desktop.width() - geometry.width());
|
||||
move = true;
|
||||
}
|
||||
if (pos.y() + size.height() > desktop.height())
|
||||
if (pos.y() + geometry.height() > desktop.height())
|
||||
{
|
||||
pos.setY(desktop.height() - size.height());
|
||||
pos.setY(desktop.height() - geometry.height());
|
||||
move = true;
|
||||
}
|
||||
if (move) {
|
||||
|
@ -15,9 +15,11 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "frequencydelegate.h"
|
||||
|
||||
FrequencyDelegate::FrequencyDelegate(QString units, int precision, bool group) :
|
||||
FrequencyDelegate::FrequencyDelegate(const QString& units, int precision, bool group) :
|
||||
m_units(units),
|
||||
m_precision(precision),
|
||||
m_group(group)
|
||||
@ -30,29 +32,111 @@ QString FrequencyDelegate::displayText(const QVariant &value, const QLocale &loc
|
||||
qlonglong v = value.toLongLong(&ok);
|
||||
if (ok)
|
||||
{
|
||||
double d;
|
||||
if (m_units == "GHz") {
|
||||
d = v / 1000000000.0;
|
||||
} else if (m_units == "MHz") {
|
||||
d = v / 1000000.0;
|
||||
} else if (m_units == "kHz") {
|
||||
d = v / 1000.0;
|
||||
} else {
|
||||
d = v;
|
||||
}
|
||||
|
||||
QLocale l(locale);
|
||||
if (m_group) {
|
||||
l.setNumberOptions(l.numberOptions() & ~QLocale::OmitGroupSeparator);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
l.setNumberOptions(l.numberOptions() | QLocale::OmitGroupSeparator);
|
||||
}
|
||||
QString s = l.toString(d, 'f', m_precision);
|
||||
|
||||
return QString("%1 %2").arg(s).arg(m_units);
|
||||
if (m_units == "Auto")
|
||||
{
|
||||
if (v == 0)
|
||||
{
|
||||
return "0 Hz";
|
||||
}
|
||||
else
|
||||
{
|
||||
QString s = QString::number(v);
|
||||
int scale = 1;
|
||||
while (s.endsWith("000"))
|
||||
{
|
||||
s.chop(3);
|
||||
scale *= 1000;
|
||||
}
|
||||
v /= scale;
|
||||
double d = v;
|
||||
if ((abs(v) >= 1000) && (m_precision >= 3))
|
||||
{
|
||||
scale *= 1000;
|
||||
d /= 1000.0;
|
||||
}
|
||||
QString units;
|
||||
if (scale == 1) {
|
||||
units = "Hz";
|
||||
} else if (scale == 1000) {
|
||||
units = "kHz";
|
||||
} else if (scale == 1000000) {
|
||||
units = "MHz";
|
||||
} else if (scale == 1000000000) {
|
||||
units = "GHz";
|
||||
}
|
||||
if (scale == 1) {
|
||||
s = l.toString(d, 'f', 0);
|
||||
} else {
|
||||
s = l.toString(d, 'f', m_precision);
|
||||
}
|
||||
|
||||
return QString("%1 %2").arg(s).arg(units);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
double d;
|
||||
if (m_units == "GHz") {
|
||||
d = v / 1000000000.0;
|
||||
}
|
||||
else if (m_units == "MHz") {
|
||||
d = v / 1000000.0;
|
||||
}
|
||||
else if (m_units == "kHz") {
|
||||
d = v / 1000.0;
|
||||
}
|
||||
else {
|
||||
d = v;
|
||||
}
|
||||
|
||||
|
||||
QString s = l.toString(d, 'f', m_precision);
|
||||
|
||||
return QString("%1 %2").arg(s).arg(m_units);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return value.toString();
|
||||
}
|
||||
}
|
||||
|
||||
QWidget* FrequencyDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
(void) option;
|
||||
(void) index;
|
||||
|
||||
QLineEdit* editor = new QLineEdit(parent);
|
||||
QIntValidator* validator = new QIntValidator();
|
||||
validator->setBottom(0);
|
||||
editor->setValidator(validator);
|
||||
return editor;
|
||||
}
|
||||
|
||||
void FrequencyDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
|
||||
{
|
||||
QString value = index.model()->data(index, Qt::EditRole).toString();
|
||||
QLineEdit* line = static_cast<QLineEdit*>(editor);
|
||||
line->setText(value);
|
||||
}
|
||||
|
||||
void FrequencyDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
|
||||
{
|
||||
QLineEdit* line = static_cast<QLineEdit*>(editor);
|
||||
QString value = line->text();
|
||||
model->setData(index, value);
|
||||
}
|
||||
|
||||
void FrequencyDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
{
|
||||
(void) index;
|
||||
editor->setGeometry(option.rect);
|
||||
}
|
||||
|
@ -26,8 +26,14 @@
|
||||
class SDRGUI_API FrequencyDelegate : public QStyledItemDelegate {
|
||||
|
||||
public:
|
||||
FrequencyDelegate(QString units = "kHz", int precision=1, bool group=true);
|
||||
virtual QString displayText(const QVariant &value, const QLocale &locale) const override;
|
||||
FrequencyDelegate(const QString& units = "kHz", int precision=1, bool group=true);
|
||||
QString displayText(const QVariant &value, const QLocale &locale) const override;
|
||||
|
||||
protected:
|
||||
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
|
||||
void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||
|
||||
private:
|
||||
QString m_units;
|
||||
|
@ -3599,6 +3599,8 @@ void GLSpectrumView::updateWaterfallMarkers()
|
||||
|
||||
void GLSpectrumView::updateAnnotationMarkers()
|
||||
{
|
||||
emit updateAnnotations(); // Notify other plugins we have updated annotations
|
||||
|
||||
if (!(m_markersDisplay & SpectrumSettings::MarkersDisplayAnnotations)) {
|
||||
return;
|
||||
}
|
||||
|
@ -535,6 +535,9 @@ private slots:
|
||||
signals:
|
||||
// Emitted when user tries to scroll to frequency currently out of range
|
||||
void requestCenterFrequency(qint64 frequency);
|
||||
// Emitted when annotations are changed
|
||||
void updateAnnotations();
|
||||
|
||||
};
|
||||
|
||||
#endif // INCLUDE_GLSPECTRUMVIEW_H
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <QStandardPaths>
|
||||
#include <QColorDialog>
|
||||
#include <QFileDialog>
|
||||
#include <QDebug>
|
||||
|
||||
#include "gui/dialpopup.h"
|
||||
#include "util/db.h"
|
||||
@ -772,15 +773,22 @@ void SpectrumMarkersDialog::on_aMarkersImport_clicked()
|
||||
|
||||
while (CSV::readRow(in, &cols))
|
||||
{
|
||||
m_annotationMarkers.push_back(SpectrumAnnotationMarker());
|
||||
m_annotationMarkers.back().m_startFrequency = cols[startCol].toLongLong();
|
||||
m_annotationMarkers.back().m_bandwidth = cols[widthCol].toUInt();
|
||||
m_annotationMarkers.back().m_text = cols[textCol];
|
||||
m_annotationMarkers.back().m_show = (SpectrumAnnotationMarker::ShowState) cols[showCol].toInt();
|
||||
int r = cols[redCol].toInt();
|
||||
int g = cols[greenCol].toInt();
|
||||
int b = cols[blueCol].toInt();
|
||||
m_annotationMarkers.back().m_markerColor = QColor(r, g, b);
|
||||
if (cols.size() >= 7)
|
||||
{
|
||||
m_annotationMarkers.push_back(SpectrumAnnotationMarker());
|
||||
m_annotationMarkers.back().m_startFrequency = cols[startCol].toLongLong();
|
||||
m_annotationMarkers.back().m_bandwidth = cols[widthCol].toUInt();
|
||||
m_annotationMarkers.back().m_text = cols[textCol];
|
||||
m_annotationMarkers.back().m_show = (SpectrumAnnotationMarker::ShowState) cols[showCol].toInt();
|
||||
int r = cols[redCol].toInt();
|
||||
int g = cols[greenCol].toInt();
|
||||
int b = cols[blueCol].toInt();
|
||||
m_annotationMarkers.back().m_markerColor = QColor(r, g, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "SpectrumMarkersDialog::on_aMarkersImport_clicked: Missing data in " << cols;
|
||||
}
|
||||
}
|
||||
|
||||
m_annotationMarkerIndex = 0;
|
||||
|
@ -49,6 +49,8 @@ ChannelReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreeDVDemod.yaml#/FreeDVDemodReport"
|
||||
FreeDVModReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreeDVMod.yaml#/FreeDVModReport"
|
||||
FreqScannerReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerReport"
|
||||
FreqTrackerReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqTracker.yaml#/FreqTrackerReport"
|
||||
FT8DemodReport:
|
||||
|
@ -63,6 +63,8 @@ ChannelSettings:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreeDVDemod.yaml#/FreeDVDemodSettings"
|
||||
FreeDVModSettings:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreeDVMod.yaml#/FreeDVModSettings"
|
||||
FreqScannerSettings:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerSettings"
|
||||
FreqTrackerSettings:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/FreqTracker.yaml#/FreqTrackerSettings"
|
||||
FT8DemodSettings:
|
||||
|
70
swagger/sdrangel/api/swagger/include/FreqScanner.yaml
Normal file
70
swagger/sdrangel/api/swagger/include/FreqScanner.yaml
Normal file
@ -0,0 +1,70 @@
|
||||
FreqScannerSettings:
|
||||
description: FreqScanner
|
||||
properties:
|
||||
channelBandwidth:
|
||||
description: channel RF bandwidth in Hz
|
||||
type: integer
|
||||
channelFrequencyOffset:
|
||||
description: channel center frequency shift from baseband center in Hz
|
||||
type: integer
|
||||
threshold:
|
||||
type: number
|
||||
format: float
|
||||
m_frequencies:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
format: int64
|
||||
m_enabled:
|
||||
type: array
|
||||
items:
|
||||
type: integer
|
||||
m_notes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
channel:
|
||||
type: string
|
||||
scanTime:
|
||||
type: number
|
||||
format: float
|
||||
retransmitTime:
|
||||
type: number
|
||||
format: float
|
||||
tuneTime:
|
||||
type: number
|
||||
format: float
|
||||
priority:
|
||||
type: integer
|
||||
measurement:
|
||||
type: integer
|
||||
mode:
|
||||
type: integer
|
||||
rgbColor:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
streamIndex:
|
||||
description: MIMO channel. Not relevant when connected to SI (single Rx).
|
||||
type: integer
|
||||
useReverseAPI:
|
||||
description: Synchronize with reverse API (1 for yes, 0 for no)
|
||||
type: integer
|
||||
reverseAPIAddress:
|
||||
type: string
|
||||
reverseAPIPort:
|
||||
type: integer
|
||||
reverseAPIDeviceIndex:
|
||||
type: integer
|
||||
reverseAPIChannelIndex:
|
||||
type: integer
|
||||
channelMarker:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker"
|
||||
rollupState:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
|
||||
|
||||
FreqScannerReport:
|
||||
description: FreqScanner
|
||||
properties:
|
||||
channelSampleRate:
|
||||
type: integer
|
@ -70,6 +70,8 @@ SWGChannelReport::SWGChannelReport() {
|
||||
m_free_dv_demod_report_isSet = false;
|
||||
free_dv_mod_report = nullptr;
|
||||
m_free_dv_mod_report_isSet = false;
|
||||
freq_scanner_report = nullptr;
|
||||
m_freq_scanner_report_isSet = false;
|
||||
freq_tracker_report = nullptr;
|
||||
m_freq_tracker_report_isSet = false;
|
||||
ft8_demod_report = nullptr;
|
||||
@ -176,6 +178,8 @@ SWGChannelReport::init() {
|
||||
m_free_dv_demod_report_isSet = false;
|
||||
free_dv_mod_report = new SWGFreeDVModReport();
|
||||
m_free_dv_mod_report_isSet = false;
|
||||
freq_scanner_report = new SWGFreqScannerReport();
|
||||
m_freq_scanner_report_isSet = false;
|
||||
freq_tracker_report = new SWGFreqTrackerReport();
|
||||
m_freq_tracker_report_isSet = false;
|
||||
ft8_demod_report = new SWGFT8DemodReport();
|
||||
@ -297,6 +301,9 @@ SWGChannelReport::cleanup() {
|
||||
if(free_dv_mod_report != nullptr) {
|
||||
delete free_dv_mod_report;
|
||||
}
|
||||
if(freq_scanner_report != nullptr) {
|
||||
delete freq_scanner_report;
|
||||
}
|
||||
if(freq_tracker_report != nullptr) {
|
||||
delete freq_tracker_report;
|
||||
}
|
||||
@ -436,6 +443,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&free_dv_mod_report, pJson["FreeDVModReport"], "SWGFreeDVModReport", "SWGFreeDVModReport");
|
||||
|
||||
::SWGSDRangel::setValue(&freq_scanner_report, pJson["FreqScannerReport"], "SWGFreqScannerReport", "SWGFreqScannerReport");
|
||||
|
||||
::SWGSDRangel::setValue(&freq_tracker_report, pJson["FreqTrackerReport"], "SWGFreqTrackerReport", "SWGFreqTrackerReport");
|
||||
|
||||
::SWGSDRangel::setValue(&ft8_demod_report, pJson["FT8DemodReport"], "SWGFT8DemodReport", "SWGFT8DemodReport");
|
||||
@ -571,6 +580,9 @@ SWGChannelReport::asJsonObject() {
|
||||
if((free_dv_mod_report != nullptr) && (free_dv_mod_report->isSet())){
|
||||
toJsonValue(QString("FreeDVModReport"), free_dv_mod_report, obj, QString("SWGFreeDVModReport"));
|
||||
}
|
||||
if((freq_scanner_report != nullptr) && (freq_scanner_report->isSet())){
|
||||
toJsonValue(QString("FreqScannerReport"), freq_scanner_report, obj, QString("SWGFreqScannerReport"));
|
||||
}
|
||||
if((freq_tracker_report != nullptr) && (freq_tracker_report->isSet())){
|
||||
toJsonValue(QString("FreqTrackerReport"), freq_tracker_report, obj, QString("SWGFreqTrackerReport"));
|
||||
}
|
||||
@ -869,6 +881,16 @@ SWGChannelReport::setFreeDvModReport(SWGFreeDVModReport* free_dv_mod_report) {
|
||||
this->m_free_dv_mod_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGFreqScannerReport*
|
||||
SWGChannelReport::getFreqScannerReport() {
|
||||
return freq_scanner_report;
|
||||
}
|
||||
void
|
||||
SWGChannelReport::setFreqScannerReport(SWGFreqScannerReport* freq_scanner_report) {
|
||||
this->freq_scanner_report = freq_scanner_report;
|
||||
this->m_freq_scanner_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGFreqTrackerReport*
|
||||
SWGChannelReport::getFreqTrackerReport() {
|
||||
return freq_tracker_report;
|
||||
@ -1217,6 +1239,9 @@ SWGChannelReport::isSet(){
|
||||
if(free_dv_mod_report && free_dv_mod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(freq_scanner_report && freq_scanner_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(freq_tracker_report && freq_tracker_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "SWGFileSourceReport.h"
|
||||
#include "SWGFreeDVDemodReport.h"
|
||||
#include "SWGFreeDVModReport.h"
|
||||
#include "SWGFreqScannerReport.h"
|
||||
#include "SWGFreqTrackerReport.h"
|
||||
#include "SWGHeatMapReport.h"
|
||||
#include "SWGIEEE_802_15_4_ModReport.h"
|
||||
@ -152,6 +153,9 @@ public:
|
||||
SWGFreeDVModReport* getFreeDvModReport();
|
||||
void setFreeDvModReport(SWGFreeDVModReport* free_dv_mod_report);
|
||||
|
||||
SWGFreqScannerReport* getFreqScannerReport();
|
||||
void setFreqScannerReport(SWGFreqScannerReport* freq_scanner_report);
|
||||
|
||||
SWGFreqTrackerReport* getFreqTrackerReport();
|
||||
void setFreqTrackerReport(SWGFreqTrackerReport* freq_tracker_report);
|
||||
|
||||
@ -303,6 +307,9 @@ private:
|
||||
SWGFreeDVModReport* free_dv_mod_report;
|
||||
bool m_free_dv_mod_report_isSet;
|
||||
|
||||
SWGFreqScannerReport* freq_scanner_report;
|
||||
bool m_freq_scanner_report_isSet;
|
||||
|
||||
SWGFreqTrackerReport* freq_tracker_report;
|
||||
bool m_freq_tracker_report_isSet;
|
||||
|
||||
|
@ -82,6 +82,8 @@ SWGChannelSettings::SWGChannelSettings() {
|
||||
m_free_dv_demod_settings_isSet = false;
|
||||
free_dv_mod_settings = nullptr;
|
||||
m_free_dv_mod_settings_isSet = false;
|
||||
freq_scanner_settings = nullptr;
|
||||
m_freq_scanner_settings_isSet = false;
|
||||
freq_tracker_settings = nullptr;
|
||||
m_freq_tracker_settings_isSet = false;
|
||||
ft8_demod_settings = nullptr;
|
||||
@ -212,6 +214,8 @@ SWGChannelSettings::init() {
|
||||
m_free_dv_demod_settings_isSet = false;
|
||||
free_dv_mod_settings = new SWGFreeDVModSettings();
|
||||
m_free_dv_mod_settings_isSet = false;
|
||||
freq_scanner_settings = new SWGFreqScannerSettings();
|
||||
m_freq_scanner_settings_isSet = false;
|
||||
freq_tracker_settings = new SWGFreqTrackerSettings();
|
||||
m_freq_tracker_settings_isSet = false;
|
||||
ft8_demod_settings = new SWGFT8DemodSettings();
|
||||
@ -359,6 +363,9 @@ SWGChannelSettings::cleanup() {
|
||||
if(free_dv_mod_settings != nullptr) {
|
||||
delete free_dv_mod_settings;
|
||||
}
|
||||
if(freq_scanner_settings != nullptr) {
|
||||
delete freq_scanner_settings;
|
||||
}
|
||||
if(freq_tracker_settings != nullptr) {
|
||||
delete freq_tracker_settings;
|
||||
}
|
||||
@ -528,6 +535,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&free_dv_mod_settings, pJson["FreeDVModSettings"], "SWGFreeDVModSettings", "SWGFreeDVModSettings");
|
||||
|
||||
::SWGSDRangel::setValue(&freq_scanner_settings, pJson["FreqScannerSettings"], "SWGFreqScannerSettings", "SWGFreqScannerSettings");
|
||||
|
||||
::SWGSDRangel::setValue(&freq_tracker_settings, pJson["FreqTrackerSettings"], "SWGFreqTrackerSettings", "SWGFreqTrackerSettings");
|
||||
|
||||
::SWGSDRangel::setValue(&ft8_demod_settings, pJson["FT8DemodSettings"], "SWGFT8DemodSettings", "SWGFT8DemodSettings");
|
||||
@ -693,6 +702,9 @@ SWGChannelSettings::asJsonObject() {
|
||||
if((free_dv_mod_settings != nullptr) && (free_dv_mod_settings->isSet())){
|
||||
toJsonValue(QString("FreeDVModSettings"), free_dv_mod_settings, obj, QString("SWGFreeDVModSettings"));
|
||||
}
|
||||
if((freq_scanner_settings != nullptr) && (freq_scanner_settings->isSet())){
|
||||
toJsonValue(QString("FreqScannerSettings"), freq_scanner_settings, obj, QString("SWGFreqScannerSettings"));
|
||||
}
|
||||
if((freq_tracker_settings != nullptr) && (freq_tracker_settings->isSet())){
|
||||
toJsonValue(QString("FreqTrackerSettings"), freq_tracker_settings, obj, QString("SWGFreqTrackerSettings"));
|
||||
}
|
||||
@ -1069,6 +1081,16 @@ SWGChannelSettings::setFreeDvModSettings(SWGFreeDVModSettings* free_dv_mod_setti
|
||||
this->m_free_dv_mod_settings_isSet = true;
|
||||
}
|
||||
|
||||
SWGFreqScannerSettings*
|
||||
SWGChannelSettings::getFreqScannerSettings() {
|
||||
return freq_scanner_settings;
|
||||
}
|
||||
void
|
||||
SWGChannelSettings::setFreqScannerSettings(SWGFreqScannerSettings* freq_scanner_settings) {
|
||||
this->freq_scanner_settings = freq_scanner_settings;
|
||||
this->m_freq_scanner_settings_isSet = true;
|
||||
}
|
||||
|
||||
SWGFreqTrackerSettings*
|
||||
SWGChannelSettings::getFreqTrackerSettings() {
|
||||
return freq_tracker_settings;
|
||||
@ -1495,6 +1517,9 @@ SWGChannelSettings::isSet(){
|
||||
if(free_dv_mod_settings && free_dv_mod_settings->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(freq_scanner_settings && freq_scanner_settings->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(freq_tracker_settings && freq_tracker_settings->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "SWGFileSourceSettings.h"
|
||||
#include "SWGFreeDVDemodSettings.h"
|
||||
#include "SWGFreeDVModSettings.h"
|
||||
#include "SWGFreqScannerSettings.h"
|
||||
#include "SWGFreqTrackerSettings.h"
|
||||
#include "SWGHeatMapSettings.h"
|
||||
#include "SWGIEEE_802_15_4_ModSettings.h"
|
||||
@ -180,6 +181,9 @@ public:
|
||||
SWGFreeDVModSettings* getFreeDvModSettings();
|
||||
void setFreeDvModSettings(SWGFreeDVModSettings* free_dv_mod_settings);
|
||||
|
||||
SWGFreqScannerSettings* getFreqScannerSettings();
|
||||
void setFreqScannerSettings(SWGFreqScannerSettings* freq_scanner_settings);
|
||||
|
||||
SWGFreqTrackerSettings* getFreqTrackerSettings();
|
||||
void setFreqTrackerSettings(SWGFreqTrackerSettings* freq_tracker_settings);
|
||||
|
||||
@ -367,6 +371,9 @@ private:
|
||||
SWGFreeDVModSettings* free_dv_mod_settings;
|
||||
bool m_free_dv_mod_settings_isSet;
|
||||
|
||||
SWGFreqScannerSettings* freq_scanner_settings;
|
||||
bool m_freq_scanner_settings_isSet;
|
||||
|
||||
SWGFreqTrackerSettings* freq_tracker_settings;
|
||||
bool m_freq_tracker_settings_isSet;
|
||||
|
||||
|
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerReport.cpp
Normal file
108
swagger/sdrangel/code/qt5/client/SWGFreqScannerReport.cpp
Normal file
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* 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 "SWGFreqScannerReport.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGFreqScannerReport::SWGFreqScannerReport(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGFreqScannerReport::SWGFreqScannerReport() {
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
}
|
||||
|
||||
SWGFreqScannerReport::~SWGFreqScannerReport() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerReport::init() {
|
||||
channel_sample_rate = 0;
|
||||
m_channel_sample_rate_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerReport::cleanup() {
|
||||
|
||||
}
|
||||
|
||||
SWGFreqScannerReport*
|
||||
SWGFreqScannerReport::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerReport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGFreqScannerReport::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGFreqScannerReport::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_channel_sample_rate_isSet){
|
||||
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerReport::getChannelSampleRate() {
|
||||
return channel_sample_rate;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerReport::setChannelSampleRate(qint32 channel_sample_rate) {
|
||||
this->channel_sample_rate = channel_sample_rate;
|
||||
this->m_channel_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGFreqScannerReport::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_channel_sample_rate_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerReport.h
Normal file
58
swagger/sdrangel/code/qt5/client/SWGFreqScannerReport.h
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGFreqScannerReport.h
|
||||
*
|
||||
* FreqScanner
|
||||
*/
|
||||
|
||||
#ifndef SWGFreqScannerReport_H_
|
||||
#define SWGFreqScannerReport_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGFreqScannerReport: public SWGObject {
|
||||
public:
|
||||
SWGFreqScannerReport();
|
||||
SWGFreqScannerReport(QString* json);
|
||||
virtual ~SWGFreqScannerReport();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGFreqScannerReport* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getChannelSampleRate();
|
||||
void setChannelSampleRate(qint32 channel_sample_rate);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 channel_sample_rate;
|
||||
bool m_channel_sample_rate_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGFreqScannerReport_H_ */
|
636
swagger/sdrangel/code/qt5/client/SWGFreqScannerSettings.cpp
Normal file
636
swagger/sdrangel/code/qt5/client/SWGFreqScannerSettings.cpp
Normal file
@ -0,0 +1,636 @@
|
||||
/**
|
||||
* 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 "SWGFreqScannerSettings.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGFreqScannerSettings::SWGFreqScannerSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGFreqScannerSettings::SWGFreqScannerSettings() {
|
||||
channel_bandwidth = 0;
|
||||
m_channel_bandwidth_isSet = false;
|
||||
channel_frequency_offset = 0;
|
||||
m_channel_frequency_offset_isSet = false;
|
||||
threshold = 0.0f;
|
||||
m_threshold_isSet = false;
|
||||
m_frequencies = new QList<qint64>();
|
||||
m_m_frequencies_isSet = false;
|
||||
m_enabled = new QList<qint32>();
|
||||
m_m_enabled_isSet = false;
|
||||
m_notes = nullptr;
|
||||
m_m_notes_isSet = false;
|
||||
channel = nullptr;
|
||||
m_channel_isSet = false;
|
||||
scan_time = 0.0f;
|
||||
m_scan_time_isSet = false;
|
||||
retransmit_time = 0.0f;
|
||||
m_retransmit_time_isSet = false;
|
||||
tune_time = 0.0f;
|
||||
m_tune_time_isSet = false;
|
||||
priority = 0;
|
||||
m_priority_isSet = false;
|
||||
measurement = 0;
|
||||
m_measurement_isSet = false;
|
||||
mode = 0;
|
||||
m_mode_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = nullptr;
|
||||
m_reverse_api_address_isSet = false;
|
||||
reverse_api_port = 0;
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
reverse_api_channel_index = 0;
|
||||
m_reverse_api_channel_index_isSet = false;
|
||||
channel_marker = nullptr;
|
||||
m_channel_marker_isSet = false;
|
||||
rollup_state = nullptr;
|
||||
m_rollup_state_isSet = false;
|
||||
}
|
||||
|
||||
SWGFreqScannerSettings::~SWGFreqScannerSettings() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerSettings::init() {
|
||||
channel_bandwidth = 0;
|
||||
m_channel_bandwidth_isSet = false;
|
||||
channel_frequency_offset = 0;
|
||||
m_channel_frequency_offset_isSet = false;
|
||||
threshold = 0.0f;
|
||||
m_threshold_isSet = false;
|
||||
m_frequencies = new QList<qint64>();
|
||||
m_m_frequencies_isSet = false;
|
||||
m_enabled = new QList<qint32>();
|
||||
m_m_enabled_isSet = false;
|
||||
m_notes = new QList<QString*>();
|
||||
m_m_notes_isSet = false;
|
||||
channel = new QString("");
|
||||
m_channel_isSet = false;
|
||||
scan_time = 0.0f;
|
||||
m_scan_time_isSet = false;
|
||||
retransmit_time = 0.0f;
|
||||
m_retransmit_time_isSet = false;
|
||||
tune_time = 0.0f;
|
||||
m_tune_time_isSet = false;
|
||||
priority = 0;
|
||||
m_priority_isSet = false;
|
||||
measurement = 0;
|
||||
m_measurement_isSet = false;
|
||||
mode = 0;
|
||||
m_mode_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = new QString("");
|
||||
m_title_isSet = false;
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
m_use_reverse_api_isSet = false;
|
||||
reverse_api_address = new QString("");
|
||||
m_reverse_api_address_isSet = false;
|
||||
reverse_api_port = 0;
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
reverse_api_channel_index = 0;
|
||||
m_reverse_api_channel_index_isSet = false;
|
||||
channel_marker = new SWGChannelMarker();
|
||||
m_channel_marker_isSet = false;
|
||||
rollup_state = new SWGRollupState();
|
||||
m_rollup_state_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(m_notes != nullptr) {
|
||||
auto arr = m_notes;
|
||||
for(auto o: *arr) {
|
||||
delete o;
|
||||
}
|
||||
delete m_notes;
|
||||
}
|
||||
if(channel != nullptr) {
|
||||
delete channel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(title != nullptr) {
|
||||
delete title;
|
||||
}
|
||||
|
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(channel_marker != nullptr) {
|
||||
delete channel_marker;
|
||||
}
|
||||
if(rollup_state != nullptr) {
|
||||
delete rollup_state;
|
||||
}
|
||||
}
|
||||
|
||||
SWGFreqScannerSettings*
|
||||
SWGFreqScannerSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGFreqScannerSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_bandwidth, pJson["channelBandwidth"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&channel_frequency_offset, pJson["channelFrequencyOffset"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&threshold, pJson["threshold"], "float", "");
|
||||
|
||||
|
||||
::SWGSDRangel::setValue(&m_frequencies, pJson["m_frequencies"], "QList", "qint64");
|
||||
|
||||
::SWGSDRangel::setValue(&m_enabled, pJson["m_enabled"], "QList", "qint32");
|
||||
|
||||
::SWGSDRangel::setValue(&m_notes, pJson["m_notes"], "QList", "QString");
|
||||
::SWGSDRangel::setValue(&channel, pJson["channel"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&scan_time, pJson["scanTime"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&retransmit_time, pJson["retransmitTime"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&tune_time, pJson["tuneTime"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&priority, pJson["priority"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&measurement, pJson["measurement"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&mode, pJson["mode"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&channel_marker, pJson["channelMarker"], "SWGChannelMarker", "SWGChannelMarker");
|
||||
|
||||
::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGFreqScannerSettings::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGFreqScannerSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_channel_bandwidth_isSet){
|
||||
obj->insert("channelBandwidth", QJsonValue(channel_bandwidth));
|
||||
}
|
||||
if(m_channel_frequency_offset_isSet){
|
||||
obj->insert("channelFrequencyOffset", QJsonValue(channel_frequency_offset));
|
||||
}
|
||||
if(m_threshold_isSet){
|
||||
obj->insert("threshold", QJsonValue(threshold));
|
||||
}
|
||||
if(m_frequencies && m_frequencies->size() > 0){
|
||||
toJsonArray((QList<void*>*)m_frequencies, obj, "m_frequencies", "");
|
||||
}
|
||||
if(m_enabled && m_enabled->size() > 0){
|
||||
toJsonArray((QList<void*>*)m_enabled, obj, "m_enabled", "");
|
||||
}
|
||||
if(m_notes && m_notes->size() > 0){
|
||||
toJsonArray((QList<void*>*)m_notes, obj, "m_notes", "QString");
|
||||
}
|
||||
if(channel != nullptr && *channel != QString("")){
|
||||
toJsonValue(QString("channel"), channel, obj, QString("QString"));
|
||||
}
|
||||
if(m_scan_time_isSet){
|
||||
obj->insert("scanTime", QJsonValue(scan_time));
|
||||
}
|
||||
if(m_retransmit_time_isSet){
|
||||
obj->insert("retransmitTime", QJsonValue(retransmit_time));
|
||||
}
|
||||
if(m_tune_time_isSet){
|
||||
obj->insert("tuneTime", QJsonValue(tune_time));
|
||||
}
|
||||
if(m_priority_isSet){
|
||||
obj->insert("priority", QJsonValue(priority));
|
||||
}
|
||||
if(m_measurement_isSet){
|
||||
obj->insert("measurement", QJsonValue(measurement));
|
||||
}
|
||||
if(m_mode_isSet){
|
||||
obj->insert("mode", QJsonValue(mode));
|
||||
}
|
||||
if(m_rgb_color_isSet){
|
||||
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||
}
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
}
|
||||
if(m_stream_index_isSet){
|
||||
obj->insert("streamIndex", QJsonValue(stream_index));
|
||||
}
|
||||
if(m_use_reverse_api_isSet){
|
||||
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
|
||||
}
|
||||
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
|
||||
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_reverse_api_port_isSet){
|
||||
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
|
||||
}
|
||||
if(m_reverse_api_device_index_isSet){
|
||||
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
|
||||
}
|
||||
if(m_reverse_api_channel_index_isSet){
|
||||
obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index));
|
||||
}
|
||||
if((channel_marker != nullptr) && (channel_marker->isSet())){
|
||||
toJsonValue(QString("channelMarker"), channel_marker, obj, QString("SWGChannelMarker"));
|
||||
}
|
||||
if((rollup_state != nullptr) && (rollup_state->isSet())){
|
||||
toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState"));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getChannelBandwidth() {
|
||||
return channel_bandwidth;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setChannelBandwidth(qint32 channel_bandwidth) {
|
||||
this->channel_bandwidth = channel_bandwidth;
|
||||
this->m_channel_bandwidth_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getChannelFrequencyOffset() {
|
||||
return channel_frequency_offset;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setChannelFrequencyOffset(qint32 channel_frequency_offset) {
|
||||
this->channel_frequency_offset = channel_frequency_offset;
|
||||
this->m_channel_frequency_offset_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGFreqScannerSettings::getThreshold() {
|
||||
return threshold;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setThreshold(float threshold) {
|
||||
this->threshold = threshold;
|
||||
this->m_threshold_isSet = true;
|
||||
}
|
||||
|
||||
QList<qint64>*
|
||||
SWGFreqScannerSettings::getMFrequencies() {
|
||||
return m_frequencies;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setMFrequencies(QList<qint64>* m_frequencies) {
|
||||
this->m_frequencies = m_frequencies;
|
||||
this->m_m_frequencies_isSet = true;
|
||||
}
|
||||
|
||||
QList<qint32>*
|
||||
SWGFreqScannerSettings::getMEnabled() {
|
||||
return m_enabled;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setMEnabled(QList<qint32>* m_enabled) {
|
||||
this->m_enabled = m_enabled;
|
||||
this->m_m_enabled_isSet = true;
|
||||
}
|
||||
|
||||
QList<QString*>*
|
||||
SWGFreqScannerSettings::getMNotes() {
|
||||
return m_notes;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setMNotes(QList<QString*>* m_notes) {
|
||||
this->m_notes = m_notes;
|
||||
this->m_m_notes_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGFreqScannerSettings::getChannel() {
|
||||
return channel;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setChannel(QString* channel) {
|
||||
this->channel = channel;
|
||||
this->m_channel_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGFreqScannerSettings::getScanTime() {
|
||||
return scan_time;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setScanTime(float scan_time) {
|
||||
this->scan_time = scan_time;
|
||||
this->m_scan_time_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGFreqScannerSettings::getRetransmitTime() {
|
||||
return retransmit_time;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setRetransmitTime(float retransmit_time) {
|
||||
this->retransmit_time = retransmit_time;
|
||||
this->m_retransmit_time_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGFreqScannerSettings::getTuneTime() {
|
||||
return tune_time;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setTuneTime(float tune_time) {
|
||||
this->tune_time = tune_time;
|
||||
this->m_tune_time_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getPriority() {
|
||||
return priority;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setPriority(qint32 priority) {
|
||||
this->priority = priority;
|
||||
this->m_priority_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getMeasurement() {
|
||||
return measurement;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setMeasurement(qint32 measurement) {
|
||||
this->measurement = measurement;
|
||||
this->m_measurement_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getMode() {
|
||||
return mode;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setMode(qint32 mode) {
|
||||
this->mode = mode;
|
||||
this->m_mode_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getRgbColor() {
|
||||
return rgb_color;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setRgbColor(qint32 rgb_color) {
|
||||
this->rgb_color = rgb_color;
|
||||
this->m_rgb_color_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGFreqScannerSettings::getTitle() {
|
||||
return title;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setTitle(QString* title) {
|
||||
this->title = title;
|
||||
this->m_title_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getStreamIndex() {
|
||||
return stream_index;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setStreamIndex(qint32 stream_index) {
|
||||
this->stream_index = stream_index;
|
||||
this->m_stream_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getUseReverseApi() {
|
||||
return use_reverse_api;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setUseReverseApi(qint32 use_reverse_api) {
|
||||
this->use_reverse_api = use_reverse_api;
|
||||
this->m_use_reverse_api_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGFreqScannerSettings::getReverseApiAddress() {
|
||||
return reverse_api_address;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setReverseApiAddress(QString* reverse_api_address) {
|
||||
this->reverse_api_address = reverse_api_address;
|
||||
this->m_reverse_api_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getReverseApiPort() {
|
||||
return reverse_api_port;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setReverseApiPort(qint32 reverse_api_port) {
|
||||
this->reverse_api_port = reverse_api_port;
|
||||
this->m_reverse_api_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getReverseApiDeviceIndex() {
|
||||
return reverse_api_device_index;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
|
||||
this->reverse_api_device_index = reverse_api_device_index;
|
||||
this->m_reverse_api_device_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGFreqScannerSettings::getReverseApiChannelIndex() {
|
||||
return reverse_api_channel_index;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) {
|
||||
this->reverse_api_channel_index = reverse_api_channel_index;
|
||||
this->m_reverse_api_channel_index_isSet = true;
|
||||
}
|
||||
|
||||
SWGChannelMarker*
|
||||
SWGFreqScannerSettings::getChannelMarker() {
|
||||
return channel_marker;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setChannelMarker(SWGChannelMarker* channel_marker) {
|
||||
this->channel_marker = channel_marker;
|
||||
this->m_channel_marker_isSet = true;
|
||||
}
|
||||
|
||||
SWGRollupState*
|
||||
SWGFreqScannerSettings::getRollupState() {
|
||||
return rollup_state;
|
||||
}
|
||||
void
|
||||
SWGFreqScannerSettings::setRollupState(SWGRollupState* rollup_state) {
|
||||
this->rollup_state = rollup_state;
|
||||
this->m_rollup_state_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGFreqScannerSettings::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_channel_bandwidth_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_channel_frequency_offset_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_threshold_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_m_frequencies_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_frequencies && (m_frequencies->size() > 0)){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_m_enabled_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_enabled && (m_enabled->size() > 0)){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_notes && (m_notes->size() > 0)){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(channel && *channel != QString("")){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_scan_time_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_retransmit_time_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_tune_time_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_priority_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_measurement_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_mode_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_rgb_color_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(title && *title != QString("")){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_stream_index_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_use_reverse_api_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(reverse_api_address && *reverse_api_address != QString("")){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_reverse_api_port_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_reverse_api_device_index_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_reverse_api_channel_index_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(channel_marker && channel_marker->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(rollup_state && rollup_state->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
194
swagger/sdrangel/code/qt5/client/SWGFreqScannerSettings.h
Normal file
194
swagger/sdrangel/code/qt5/client/SWGFreqScannerSettings.h
Normal file
@ -0,0 +1,194 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGFreqScannerSettings.h
|
||||
*
|
||||
* FreqScanner
|
||||
*/
|
||||
|
||||
#ifndef SWGFreqScannerSettings_H_
|
||||
#define SWGFreqScannerSettings_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGChannelMarker.h"
|
||||
#include "SWGRollupState.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGFreqScannerSettings: public SWGObject {
|
||||
public:
|
||||
SWGFreqScannerSettings();
|
||||
SWGFreqScannerSettings(QString* json);
|
||||
virtual ~SWGFreqScannerSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGFreqScannerSettings* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getChannelBandwidth();
|
||||
void setChannelBandwidth(qint32 channel_bandwidth);
|
||||
|
||||
qint32 getChannelFrequencyOffset();
|
||||
void setChannelFrequencyOffset(qint32 channel_frequency_offset);
|
||||
|
||||
float getThreshold();
|
||||
void setThreshold(float threshold);
|
||||
|
||||
QList<qint64>* getMFrequencies();
|
||||
void setMFrequencies(QList<qint64>* m_frequencies);
|
||||
|
||||
QList<qint32>* getMEnabled();
|
||||
void setMEnabled(QList<qint32>* m_enabled);
|
||||
|
||||
QList<QString*>* getMNotes();
|
||||
void setMNotes(QList<QString*>* m_notes);
|
||||
|
||||
QString* getChannel();
|
||||
void setChannel(QString* channel);
|
||||
|
||||
float getScanTime();
|
||||
void setScanTime(float scan_time);
|
||||
|
||||
float getRetransmitTime();
|
||||
void setRetransmitTime(float retransmit_time);
|
||||
|
||||
float getTuneTime();
|
||||
void setTuneTime(float tune_time);
|
||||
|
||||
qint32 getPriority();
|
||||
void setPriority(qint32 priority);
|
||||
|
||||
qint32 getMeasurement();
|
||||
void setMeasurement(qint32 measurement);
|
||||
|
||||
qint32 getMode();
|
||||
void setMode(qint32 mode);
|
||||
|
||||
qint32 getRgbColor();
|
||||
void setRgbColor(qint32 rgb_color);
|
||||
|
||||
QString* getTitle();
|
||||
void setTitle(QString* title);
|
||||
|
||||
qint32 getStreamIndex();
|
||||
void setStreamIndex(qint32 stream_index);
|
||||
|
||||
qint32 getUseReverseApi();
|
||||
void setUseReverseApi(qint32 use_reverse_api);
|
||||
|
||||
QString* getReverseApiAddress();
|
||||
void setReverseApiAddress(QString* reverse_api_address);
|
||||
|
||||
qint32 getReverseApiPort();
|
||||
void setReverseApiPort(qint32 reverse_api_port);
|
||||
|
||||
qint32 getReverseApiDeviceIndex();
|
||||
void setReverseApiDeviceIndex(qint32 reverse_api_device_index);
|
||||
|
||||
qint32 getReverseApiChannelIndex();
|
||||
void setReverseApiChannelIndex(qint32 reverse_api_channel_index);
|
||||
|
||||
SWGChannelMarker* getChannelMarker();
|
||||
void setChannelMarker(SWGChannelMarker* channel_marker);
|
||||
|
||||
SWGRollupState* getRollupState();
|
||||
void setRollupState(SWGRollupState* rollup_state);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 channel_bandwidth;
|
||||
bool m_channel_bandwidth_isSet;
|
||||
|
||||
qint32 channel_frequency_offset;
|
||||
bool m_channel_frequency_offset_isSet;
|
||||
|
||||
float threshold;
|
||||
bool m_threshold_isSet;
|
||||
|
||||
QList<qint64>* m_frequencies;
|
||||
bool m_m_frequencies_isSet;
|
||||
|
||||
QList<qint32>* m_enabled;
|
||||
bool m_m_enabled_isSet;
|
||||
|
||||
QList<QString*>* m_notes;
|
||||
bool m_m_notes_isSet;
|
||||
|
||||
QString* channel;
|
||||
bool m_channel_isSet;
|
||||
|
||||
float scan_time;
|
||||
bool m_scan_time_isSet;
|
||||
|
||||
float retransmit_time;
|
||||
bool m_retransmit_time_isSet;
|
||||
|
||||
float tune_time;
|
||||
bool m_tune_time_isSet;
|
||||
|
||||
qint32 priority;
|
||||
bool m_priority_isSet;
|
||||
|
||||
qint32 measurement;
|
||||
bool m_measurement_isSet;
|
||||
|
||||
qint32 mode;
|
||||
bool m_mode_isSet;
|
||||
|
||||
qint32 rgb_color;
|
||||
bool m_rgb_color_isSet;
|
||||
|
||||
QString* title;
|
||||
bool m_title_isSet;
|
||||
|
||||
qint32 stream_index;
|
||||
bool m_stream_index_isSet;
|
||||
|
||||
qint32 use_reverse_api;
|
||||
bool m_use_reverse_api_isSet;
|
||||
|
||||
QString* reverse_api_address;
|
||||
bool m_reverse_api_address_isSet;
|
||||
|
||||
qint32 reverse_api_port;
|
||||
bool m_reverse_api_port_isSet;
|
||||
|
||||
qint32 reverse_api_device_index;
|
||||
bool m_reverse_api_device_index_isSet;
|
||||
|
||||
qint32 reverse_api_channel_index;
|
||||
bool m_reverse_api_channel_index_isSet;
|
||||
|
||||
SWGChannelMarker* channel_marker;
|
||||
bool m_channel_marker_isSet;
|
||||
|
||||
SWGRollupState* rollup_state;
|
||||
bool m_rollup_state_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGFreqScannerSettings_H_ */
|
@ -151,6 +151,8 @@
|
||||
#include "SWGFreeDVDemodSettings.h"
|
||||
#include "SWGFreeDVModReport.h"
|
||||
#include "SWGFreeDVModSettings.h"
|
||||
#include "SWGFreqScannerReport.h"
|
||||
#include "SWGFreqScannerSettings.h"
|
||||
#include "SWGFreqTrackerReport.h"
|
||||
#include "SWGFreqTrackerSettings.h"
|
||||
#include "SWGFrequency.h"
|
||||
@ -1055,6 +1057,16 @@ namespace SWGSDRangel {
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqScannerReport").compare(type) == 0) {
|
||||
SWGFreqScannerReport *obj = new SWGFreqScannerReport();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqScannerSettings").compare(type) == 0) {
|
||||
SWGFreqScannerSettings *obj = new SWGFreqScannerSettings();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGFreqTrackerReport").compare(type) == 0) {
|
||||
SWGFreqTrackerReport *obj = new SWGFreqTrackerReport();
|
||||
obj->init();
|
||||
|
Loading…
Reference in New Issue
Block a user