Browse Source
Fix TX scaling bug that was costing 10dB of output power at max gain. Improve performance on Windows to reduce overruns at high sample rates. Add underrun stats. Display temperature. Improve error handling. Move setting device settings off GUI thread. For #1522chirpmodem-v8.0.0
64 changed files with 10731 additions and 841 deletions
@ -0,0 +1,115 @@
@@ -0,0 +1,115 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 <QStringList> |
||||
|
||||
#include "deviceusrpstreamstats.h" |
||||
|
||||
DeviceUSRPStreamStats::DeviceUSRPStreamStats() : |
||||
m_running(false), |
||||
m_started(false), |
||||
m_lastCount(0), |
||||
m_offset(0), |
||||
m_runTimeMs(0) |
||||
{ |
||||
} |
||||
|
||||
void DeviceUSRPStreamStats::update(bool running, quint32 count) |
||||
{ |
||||
if (running && !m_running) |
||||
{ |
||||
// Stream started - reset statistics
|
||||
m_started = true; |
||||
m_lastCount = 0; |
||||
m_offset = 0; |
||||
m_runTimer.start(); |
||||
m_runTimeMs = 0; |
||||
m_lastEventTime = QDateTime(); |
||||
m_history.clear(); |
||||
} |
||||
else if (!running && m_running) |
||||
{ |
||||
// Stream stopped - keep statistics from last run
|
||||
m_runTimeMs = m_runTimer.elapsed(); |
||||
} |
||||
|
||||
m_running = running; |
||||
|
||||
if (!running) { |
||||
return; |
||||
} |
||||
|
||||
if (count < m_lastCount) |
||||
{ |
||||
// Streaming thread was restarted, which resets its count
|
||||
m_offset += m_lastCount; |
||||
|
||||
if (count > 0) { // Events since restart
|
||||
m_lastEventTime = QDateTime::currentDateTime(); |
||||
} |
||||
} |
||||
else if (count > m_lastCount) |
||||
{ |
||||
m_lastEventTime = QDateTime::currentDateTime(); |
||||
} |
||||
|
||||
m_lastCount = count; |
||||
|
||||
// Keep history for last minute, so we can count recent events
|
||||
qint64 now = m_runTimer.elapsed(); |
||||
m_history.push_back({now, getCount()}); |
||||
|
||||
while ((m_history.size() > 1) && (now - m_history.front().first > m_historyMs)) { |
||||
m_history.pop_front(); |
||||
} |
||||
} |
||||
|
||||
QString DeviceUSRPStreamStats::getToolTip(const QString& description, const QString& eventName) const |
||||
{ |
||||
QStringList lines; |
||||
|
||||
lines.append(description); |
||||
|
||||
if (!m_started) { |
||||
return lines.join("\n"); |
||||
} |
||||
|
||||
quint64 count = getCount(); |
||||
qint64 runTimeMs = m_running ? m_runTimer.elapsed() : m_runTimeMs; |
||||
|
||||
lines.append(""); |
||||
lines.append(QString("%1%2: %3").arg(eventName).arg(m_running ? "" : " (last run)").arg(count)); |
||||
|
||||
if (runTimeMs >= 1000) |
||||
{ |
||||
double perMinute = count / (runTimeMs / 60000.0); |
||||
lines.append(QString("Average: %1 per minute").arg(QString::number(perMinute, 'f', 1))); |
||||
} |
||||
|
||||
if (m_running && !m_history.empty()) { |
||||
lines.append(QString("Last minute: %1").arg(count - m_history.front().second)); |
||||
} |
||||
|
||||
if (m_lastEventTime.isValid()) |
||||
{ |
||||
qint64 secsAgo = m_lastEventTime.secsTo(QDateTime::currentDateTime()); |
||||
lines.append(QString("Last: %1 (%2 s ago)").arg(m_lastEventTime.toString("hh:mm:ss")).arg(secsAgo)); |
||||
} |
||||
|
||||
return lines.join("\n"); |
||||
} |
||||
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 DEVICES_USRP_DEVICEUSRPSTREAMSTATS_H_ |
||||
#define DEVICES_USRP_DEVICEUSRPSTREAMSTATS_H_ |
||||
|
||||
#include <deque> |
||||
#include <utility> |
||||
|
||||
#include <QString> |
||||
#include <QDateTime> |
||||
#include <QElapsedTimer> |
||||
|
||||
#include "export.h" |
||||
|
||||
/**
|
||||
* Statistics for stream events (E.g. overruns, underruns, timeouts or dropped packets), |
||||
* calculated from the event counts that are periodically reported by the streaming threads. |
||||
* |
||||
* The streaming threads reset their counts whenever they are restarted, which can happen |
||||
* while the stream is running (E.g. when paused while a buddy creates its stream), |
||||
* so counts are accumulated, and only reset when the stream is started. |
||||
*/ |
||||
class DEVICES_API DeviceUSRPStreamStats |
||||
{ |
||||
public: |
||||
DeviceUSRPStreamStats(); |
||||
|
||||
//! Update with latest report. count is the event count reported by the streaming thread.
|
||||
void update(bool running, quint32 count); |
||||
//! Total number of events since the stream was started
|
||||
quint64 getCount() const { return m_offset + m_lastCount; } |
||||
//! Get tooltip, with statistics appended to description. eventName is plural (E.g. "Overruns")
|
||||
QString getToolTip(const QString& description, const QString& eventName) const; |
||||
|
||||
private: |
||||
bool m_running; |
||||
bool m_started; //!< Stream has been started at least once
|
||||
quint32 m_lastCount; //!< Last count reported by streaming thread
|
||||
quint64 m_offset; //!< Accumulated count from before the streaming thread's count was reset
|
||||
QElapsedTimer m_runTimer; //!< Time since stream was started
|
||||
qint64 m_runTimeMs; //!< Run time when stopped
|
||||
QDateTime m_lastEventTime; |
||||
std::deque<std::pair<qint64, quint64>> m_history; //!< (run time ms, total count) for last minute
|
||||
|
||||
static const qint64 m_historyMs = 60000; |
||||
}; |
||||
|
||||
#endif // DEVICES_USRP_DEVICEUSRPSTREAMSTATS_H_
|
||||
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
project(usrpmimo) |
||||
|
||||
set(usrpmimo_SOURCES |
||||
usrpmimo.cpp |
||||
usrpmimoplugin.cpp |
||||
usrpmimosettings.cpp |
||||
usrpmimowebapiadapter.cpp |
||||
usrpmimoworker.cpp |
||||
usrpmithread.cpp |
||||
usrpmothread.cpp |
||||
) |
||||
|
||||
set(usrpmimo_HEADERS |
||||
usrpmimo.h |
||||
usrpmimoplugin.h |
||||
usrpmimosettings.h |
||||
usrpmimowebapiadapter.h |
||||
usrpmimoworker.h |
||||
usrpmithread.h |
||||
usrpmothread.h |
||||
) |
||||
|
||||
include_directories( |
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client |
||||
${CMAKE_SOURCE_DIR}/devices |
||||
${UHD_INCLUDE_DIR} |
||||
${Boost_INCLUDE_DIRS} |
||||
) |
||||
|
||||
if(NOT SERVER_MODE) |
||||
set(usrpmimo_SOURCES |
||||
${usrpmimo_SOURCES} |
||||
usrpmimogui.cpp |
||||
usrpmimogui.ui |
||||
) |
||||
set(usrpmimo_HEADERS |
||||
${usrpmimo_HEADERS} |
||||
usrpmimogui.h |
||||
) |
||||
|
||||
set(TARGET_NAME ${PLUGINS_PREFIX}mimousrp) |
||||
set(TARGET_LIB "Qt::Widgets") |
||||
set(TARGET_LIB_GUI "sdrgui") |
||||
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) |
||||
else() |
||||
set(TARGET_NAME ${PLUGINSSRV_PREFIX}mimousrpsrv) |
||||
set(TARGET_LIB "") |
||||
set(TARGET_LIB_GUI "") |
||||
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) |
||||
endif() |
||||
|
||||
if(NOT Qt6_FOUND) |
||||
add_library(${TARGET_NAME} ${usrpmimo_SOURCES}) |
||||
else() |
||||
qt_add_plugin(${TARGET_NAME} CLASS_NAME USRPMIMOPlugin) |
||||
target_sources(${TARGET_NAME} PRIVATE ${usrpmimo_SOURCES}) |
||||
endif() |
||||
|
||||
if(NOT BUILD_SHARED_LIBS) |
||||
set_property(GLOBAL APPEND PROPERTY STATIC_PLUGINS_PROPERTY ${TARGET_NAME}) |
||||
endif() |
||||
|
||||
if(UHD_EXTERNAL) |
||||
add_dependencies(${TARGET_NAME} uhd) |
||||
endif() |
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE |
||||
Qt::Core |
||||
${TARGET_LIB} |
||||
sdrbase |
||||
${TARGET_LIB_GUI} |
||||
swagger |
||||
${UHD_LIBRARIES} |
||||
usrpdevice |
||||
) |
||||
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) |
||||
|
||||
# Install debug symbols |
||||
if (WIN32) |
||||
install(FILES $<TARGET_PROPERTY:${TARGET_NAME},RUNTIME_OUTPUT_DIRECTORY>/${TARGET_NAME}stripped.pdb CONFIGURATIONS Release DESTINATION ${INSTALL_FOLDER} RENAME ${TARGET_NAME}.pdb ) |
||||
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} ) |
||||
endif() |
||||
@ -0,0 +1,113 @@
@@ -0,0 +1,113 @@
|
||||
<h1>USRP MIMO plugin</h1> |
||||
|
||||
<h2>Introduction</h2> |
||||
|
||||
This MIMO plugin sends and receives multiple streams of I/Q samples to and from a [USRP device](https://www.ettus.com/product-category/usrp-bus-series/) that has more than one Rx or Tx channel, such as the B210, X310 or N320. |
||||
|
||||
Up to two Rx and two Tx channels are supported. On devices with more channels (E.g. N310), the first two channels are used. |
||||
|
||||
The Rx channels are received using a single UHD stream and the Tx channels are transmitted using a single UHD stream, |
||||
so that samples for each channel are time aligned, which is required for applications such as direction finding and beamforming. |
||||
|
||||
The Rx and Tx sides can be started and stopped independently. |
||||
|
||||
The center frequency is common to both channels on each side (Rx and Tx), as is required for coherent operation. |
||||
On devices where the two channels share an LO (E.g. B210), this is also a hardware requirement. |
||||
The sample rate is common to Rx and Tx. |
||||
|
||||
Settings are applied to the device in a separate thread, so that settings that take a long time to apply |
||||
(E.g. sample rate, clock source and bandwidth) do not block the GUI. |
||||
|
||||
<h2>Interface</h2> |
||||
|
||||
The top and bottom bars of the device window are described [here](../../../sdrgui/device/readme.md) |
||||
|
||||
 |
||||
|
||||
<h3>1: Stream selection</h3> |
||||
|
||||
Selects which side (Rx or Tx) and which channel (0 or 1) the settings below apply to. |
||||
Settings common to both channels of a side (E.g. center frequency, LO offset, bandwidth, decimation or interpolation) |
||||
are shown for the selected side. Settings that are per channel (gain, gain mode and antenna) are shown for the selected channel. |
||||
|
||||
<h3>2: Spectrum source</h3> |
||||
|
||||
Selects which side (Rx or Tx) and which channel is displayed in the main spectrum. |
||||
|
||||
<h3>3: Rx and Tx start/stop</h3> |
||||
|
||||
Starts or stops the Rx or Tx side. The button color indicates the state: |
||||
|
||||
- Grey: device is not running |
||||
- Blue: device is idle |
||||
- Green: device is running |
||||
- Red: device is in error |
||||
|
||||
<h3>4: Baseband sample rate</h3> |
||||
|
||||
This is the baseband sample rate of the selected side, after software decimation or interpolation. |
||||
|
||||
<h3>5: Center frequency</h3> |
||||
|
||||
This is the center frequency in kHz of the selected side. It is common to both channels. |
||||
|
||||
<h3>6: LO offset</h3> |
||||
|
||||
The LO of the selected side is offset from the center frequency by this amount (in kHz), and the digital NCOs in the device are used to |
||||
compensate. This can be used to move the DC spike and LO leakage away from the center of the band. It should be less than half of the sample rate. |
||||
|
||||
<h3>7: Clock source</h3> |
||||
|
||||
Selects the reference clock source for the device (E.g. internal, external or gpsdo). If the selected clock is not detected, the device |
||||
falls back to the internal clock, and this is shown here. |
||||
|
||||
<h3>8: DC offset and IQ imbalance correction</h3> |
||||
|
||||
Enables automatic DC offset and IQ imbalance correction in the device, for both Rx channels. These are not available for Tx. |
||||
|
||||
<h3>9: Analog low pass filter bandwidth</h3> |
||||
|
||||
Sets the bandwidth of the analog low pass filter, in kHz, for both channels of the selected side. |
||||
|
||||
<h3>10: Transverter mode</h3> |
||||
|
||||
Opens the transverter dialog for the selected side. See the [transverter dialog](../../../sdrgui/gui/transverterdialog.md) documentation for details. |
||||
|
||||
<h3>11: Sample rate</h3> |
||||
|
||||
This is the device to host (SR) or baseband (BB) sample rate in samples per second. The button on the left switches between the two modes. |
||||
The device to host sample rate is common to the Rx and Tx sides. |
||||
|
||||
<h3>12: Master clock rate</h3> |
||||
|
||||
This is the sample rate between the FPGA and RFIC, as calculated by UHD from the requested sample rate. It is common to Rx and Tx. |
||||
|
||||
<h3>13: Software decimation or interpolation factor</h3> |
||||
|
||||
This is the software decimation (Rx) or interpolation (Tx) factor applied to the samples of the selected side, to obtain the baseband sample rate. |
||||
|
||||
<h3>14: Gain</h3> |
||||
|
||||
The gain lock button, when engaged, applies gain settings to both channels of the selected side. |
||||
|
||||
The gain mode (Rx only) selects between automatic gain control and manual gain. The slider sets the gain in dB, when manual gain is selected. |
||||
|
||||
<h3>15: Antenna</h3> |
||||
|
||||
Selects the antenna for the selected channel. |
||||
|
||||
<h3>16: Board temperature</h3> |
||||
|
||||
This is the temperature of the board in degrees C, for devices that have a temperature sensor (E.g. the AD9361 on the B210). |
||||
|
||||
<h3>17: Stream status indicators</h3> |
||||
|
||||
These show the status of the stream for the selected side: |
||||
|
||||
- Stream: turns green when the stream is running |
||||
- **O**/**U**: turns red if the Rx stream experiences overruns or the Tx stream experiences underruns |
||||
- **T**/**D**: turns red if the Rx stream experiences timeouts or the Tx stream drops packets |
||||
|
||||
The indicators are reset when the side is restarted. |
||||
|
||||
Hovering over an indicator shows statistics for the current (or last) run: the total number of events, the average number per minute, the number in the last minute and the time of the last event. |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,274 @@
@@ -0,0 +1,274 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMO_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMO_H_ |
||||
|
||||
#include <stdint.h> |
||||
|
||||
#include <QString> |
||||
#include <QStringList> |
||||
#include <QByteArray> |
||||
#include <QNetworkRequest> |
||||
#include <QMutex> |
||||
#include <QRecursiveMutex> |
||||
|
||||
#include <uhd/usrp/multi_usrp.hpp> |
||||
|
||||
#include "dsp/devicesamplemimo.h" |
||||
#include "usrpmimosettings.h" |
||||
|
||||
class QNetworkAccessManager; |
||||
class QNetworkReply; |
||||
class QThread; |
||||
class DeviceAPI; |
||||
class USRPMIThread; |
||||
class USRPMOThread; |
||||
class USRPMIMOWorker; |
||||
struct DeviceUSRPParams; |
||||
|
||||
class USRPMIMO : public DeviceSampleMIMO { |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
class MsgConfigureUSRPMIMO : public Message { |
||||
MESSAGE_CLASS_DECLARATION |
||||
|
||||
public: |
||||
const USRPMIMOSettings& getSettings() const { return m_settings; } |
||||
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; } |
||||
bool getForce() const { return m_force; } |
||||
|
||||
static MsgConfigureUSRPMIMO* create(const USRPMIMOSettings& settings, const QList<QString>& settingsKeys, bool force) { |
||||
return new MsgConfigureUSRPMIMO(settings, settingsKeys, force); |
||||
} |
||||
|
||||
private: |
||||
USRPMIMOSettings m_settings; |
||||
QList<QString> m_settingsKeys; |
||||
bool m_force; |
||||
|
||||
MsgConfigureUSRPMIMO(const USRPMIMOSettings& settings, const QList<QString>& settingsKeys, bool force) : |
||||
Message(), |
||||
m_settings(settings), |
||||
m_settingsKeys(settingsKeys), |
||||
m_force(force) |
||||
{ } |
||||
}; |
||||
|
||||
class MsgStartStop : public Message { |
||||
MESSAGE_CLASS_DECLARATION |
||||
|
||||
public: |
||||
bool getStartStop() const { return m_startStop; } |
||||
bool getRxElseTx() const { return m_rxElseTx; } |
||||
|
||||
static MsgStartStop* create(bool startStop, bool rxElseTx) { |
||||
return new MsgStartStop(startStop, rxElseTx); |
||||
} |
||||
|
||||
protected: |
||||
bool m_startStop; |
||||
bool m_rxElseTx; |
||||
|
||||
MsgStartStop(bool startStop, bool rxElseTx) : |
||||
Message(), |
||||
m_startStop(startStop), |
||||
m_rxElseTx(rxElseTx) |
||||
{ } |
||||
}; |
||||
|
||||
class MsgGetStreamInfo : public Message { |
||||
MESSAGE_CLASS_DECLARATION |
||||
|
||||
public: |
||||
static MsgGetStreamInfo* create() { |
||||
return new MsgGetStreamInfo(); |
||||
} |
||||
|
||||
private: |
||||
MsgGetStreamInfo() : |
||||
Message() |
||||
{ } |
||||
}; |
||||
|
||||
class MsgReportStreamInfo : public Message { |
||||
MESSAGE_CLASS_DECLARATION |
||||
|
||||
public: |
||||
bool getRxElseTx() const { return m_rxElseTx; } |
||||
bool getSuccess() const { return m_success; } |
||||
bool getActive() const { return m_active; } |
||||
quint32 getOverUnderRuns() const { return m_overUnderRuns; } |
||||
quint32 getTimeoutsDropped() const { return m_timeoutsDropped; } |
||||
|
||||
static MsgReportStreamInfo* create(bool rxElseTx, bool success, bool active, quint32 overUnderRuns, quint32 timeoutsDropped) { |
||||
return new MsgReportStreamInfo(rxElseTx, success, active, overUnderRuns, timeoutsDropped); |
||||
} |
||||
|
||||
private: |
||||
bool m_rxElseTx; |
||||
bool m_success; |
||||
bool m_active; |
||||
quint32 m_overUnderRuns; //!< Rx overruns or Tx underruns
|
||||
quint32 m_timeoutsDropped; //!< Rx timeouts or Tx dropped packets
|
||||
|
||||
MsgReportStreamInfo(bool rxElseTx, bool success, bool active, quint32 overUnderRuns, quint32 timeoutsDropped) : |
||||
Message(), |
||||
m_rxElseTx(rxElseTx), |
||||
m_success(success), |
||||
m_active(active), |
||||
m_overUnderRuns(overUnderRuns), |
||||
m_timeoutsDropped(timeoutsDropped) |
||||
{ } |
||||
}; |
||||
|
||||
class MsgGetDeviceInfo : public Message { |
||||
MESSAGE_CLASS_DECLARATION |
||||
|
||||
public: |
||||
static MsgGetDeviceInfo* create() { |
||||
return new MsgGetDeviceInfo(); |
||||
} |
||||
|
||||
private: |
||||
MsgGetDeviceInfo() : |
||||
Message() |
||||
{ } |
||||
}; |
||||
|
||||
USRPMIMO(DeviceAPI *deviceAPI); |
||||
virtual ~USRPMIMO(); |
||||
virtual void destroy(); |
||||
|
||||
virtual void init(); |
||||
virtual bool startRx(); |
||||
virtual void stopRx(); |
||||
virtual bool startTx(); |
||||
virtual void stopTx(); |
||||
|
||||
virtual QByteArray serialize() const; |
||||
virtual bool deserialize(const QByteArray& data); |
||||
|
||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } |
||||
virtual const QString& getDeviceDescription() const; |
||||
|
||||
virtual int getSourceSampleRate(int index) const; |
||||
virtual void setSourceSampleRate(int sampleRate, int index) { (void) sampleRate; (void) index; } |
||||
virtual quint64 getSourceCenterFrequency(int index) const; |
||||
virtual void setSourceCenterFrequency(qint64 centerFrequency, int index); |
||||
|
||||
virtual int getSinkSampleRate(int index) const; |
||||
virtual void setSinkSampleRate(int sampleRate, int index) { (void) sampleRate; (void) index; } |
||||
virtual quint64 getSinkCenterFrequency(int index) const; |
||||
virtual void setSinkCenterFrequency(qint64 centerFrequency, int index); |
||||
|
||||
virtual quint64 getMIMOCenterFrequency() const { return getSourceCenterFrequency(0); } |
||||
virtual unsigned int getMIMOSampleRate() const { return getSourceSampleRate(0); } |
||||
|
||||
virtual bool handleMessage(const Message& message); |
||||
|
||||
virtual int webapiSettingsGet( |
||||
SWGSDRangel::SWGDeviceSettings& response, |
||||
QString& errorMessage); |
||||
|
||||
virtual int webapiSettingsPutPatch( |
||||
bool force, |
||||
const QStringList& deviceSettingsKeys, |
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage); |
||||
|
||||
virtual int webapiReportGet( |
||||
SWGSDRangel::SWGDeviceReport& response, |
||||
QString& errorMessage); |
||||
|
||||
virtual int webapiRunGet( |
||||
int subsystemIndex, |
||||
SWGSDRangel::SWGDeviceState& response, |
||||
QString& errorMessage); |
||||
|
||||
virtual int webapiRun( |
||||
bool run, |
||||
int subsystemIndex, |
||||
SWGSDRangel::SWGDeviceState& response, |
||||
QString& errorMessage); |
||||
|
||||
static void webapiFormatDeviceSettings( |
||||
SWGSDRangel::SWGDeviceSettings& response, |
||||
const USRPMIMOSettings& settings); |
||||
|
||||
static void webapiUpdateDeviceSettings( |
||||
USRPMIMOSettings& settings, |
||||
const QStringList& deviceSettingsKeys, |
||||
SWGSDRangel::SWGDeviceSettings& response); |
||||
|
||||
int getNbRxChannels() const { return m_nbRx; } |
||||
int getNbTxChannels() const { return m_nbTx; } |
||||
void getRxLORange(float& minF, float& maxF) const; |
||||
void getTxLORange(float& minF, float& maxF) const; |
||||
void getSRRange(float& minF, float& maxF) const; |
||||
void getRxLPRange(float& minF, float& maxF) const; |
||||
void getTxLPRange(float& minF, float& maxF) const; |
||||
void getRxGainRange(float& minF, float& maxF) const; |
||||
void getTxGainRange(float& minF, float& maxF) const; |
||||
QStringList getRxAntennas() const; |
||||
QStringList getTxAntennas() const; |
||||
QStringList getClockSources() const; |
||||
|
||||
bool getRxRunning() const { return m_runningRx; } |
||||
bool getTxRunning() const { return m_runningTx; } |
||||
|
||||
private: |
||||
DeviceAPI *m_deviceAPI; |
||||
QMutex m_mutex; //!< Serialises start and stop
|
||||
QMutex m_threadMutex; //!< Protects thread pointers, for access from other threads
|
||||
QRecursiveMutex m_settingsMutex; //!< Protects m_settings, which is written in GUI thread and read in device engine thread in start
|
||||
USRPMIMOSettings m_settings; |
||||
USRPMIThread* m_sourceThread; |
||||
USRPMOThread* m_sinkThread; |
||||
QString m_deviceDescription; |
||||
bool m_runningRx; |
||||
bool m_runningTx; |
||||
QNetworkAccessManager *m_networkManager; |
||||
QNetworkRequest m_networkRequest; |
||||
|
||||
DeviceUSRPParams *m_deviceParams; |
||||
int m_nbRx; //!< Number of Rx channels used
|
||||
int m_nbTx; //!< Number of Tx channels used
|
||||
uhd::rx_streamer::sptr m_rxStream; |
||||
uhd::tx_streamer::sptr m_txStream; |
||||
QThread *m_workerThread; |
||||
USRPMIMOWorker *m_worker; |
||||
|
||||
bool openDevice(); |
||||
void closeDevice(); |
||||
|
||||
bool applySettings(const USRPMIMOSettings& settings, const QList<QString>& settingsKeys, bool force); |
||||
static unsigned int getSampleMOFifoSize(const USRPMIMOSettings& settings); |
||||
void resizeSampleMOFifo(); |
||||
void forwardChangeRxDSP(); |
||||
void forwardChangeTxDSP(); |
||||
void webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const USRPMIMOSettings& settings, bool force); |
||||
void webapiReverseSendStartStop(bool rxElseTx, bool start); |
||||
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response); |
||||
|
||||
private slots: |
||||
void networkManagerFinished(QNetworkReply *reply); |
||||
}; |
||||
|
||||
#endif // PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMO_H_
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,131 @@
@@ -0,0 +1,131 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 _USRPMIMO_USRPMIMOGUI_H_ |
||||
#define _USRPMIMO_USRPMIMOGUI_H_ |
||||
|
||||
#include <QTimer> |
||||
#include <QWidget> |
||||
|
||||
#include "util/messagequeue.h" |
||||
#include "usrp/deviceusrpstreamstats.h" |
||||
#include "device/devicegui.h" |
||||
|
||||
#include "usrpmimosettings.h" |
||||
|
||||
class QComboBox; |
||||
class DeviceUISet; |
||||
class USRPMIMO; |
||||
|
||||
namespace Ui { |
||||
class USRPMIMOGUI; |
||||
} |
||||
|
||||
class USRPMIMOGUI : public DeviceGUI { |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit USRPMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent = nullptr); |
||||
virtual ~USRPMIMOGUI(); |
||||
virtual void destroy(); |
||||
|
||||
void resetToDefaults(); |
||||
QByteArray serialize() const; |
||||
bool deserialize(const QByteArray& data); |
||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } |
||||
|
||||
private: |
||||
struct StreamStatus { |
||||
bool m_success; |
||||
bool m_active; |
||||
quint32 m_overUnderRuns; |
||||
quint32 m_timeoutsDropped; |
||||
}; |
||||
|
||||
Ui::USRPMIMOGUI* ui; |
||||
|
||||
USRPMIMOSettings m_settings; |
||||
QList<QString> m_settingsKeys; |
||||
bool m_rxElseTx; //!< Which side is being dealt with
|
||||
int m_streamIndex; //!< Current stream index being dealt with
|
||||
bool m_spectrumRxElseTx; |
||||
int m_spectrumStreamIndex; //!< Index of the stream displayed on main spectrum
|
||||
bool m_gainLock; //!< Lock Rx or Tx channel gains (set channel gains to gain of channel 0 when engaged)
|
||||
QTimer m_updateTimer; |
||||
QTimer m_statusTimer; |
||||
bool m_doApplySettings; |
||||
bool m_forceSettings; |
||||
USRPMIMO* m_sampleMIMO; |
||||
int m_rxBasebandSampleRate; |
||||
int m_txBasebandSampleRate; |
||||
quint64 m_rxDeviceCenterFrequency; //!< Center frequency in Rx device
|
||||
quint64 m_txDeviceCenterFrequency; //!< Center frequency in Tx device
|
||||
int m_lastRxEngineState; |
||||
int m_lastTxEngineState; |
||||
MessageQueue m_inputMessageQueue; |
||||
bool m_sampleRateMode; |
||||
int m_statusCounter; |
||||
int m_deviceStatusCounter; |
||||
StreamStatus m_streamStatus[2]; //!< Rx and Tx
|
||||
DeviceUSRPStreamStats m_overUnderRunStats[2]; //!< Rx overruns and Tx underruns
|
||||
DeviceUSRPStreamStats m_timeoutDroppedStats[2]; //!< Rx timeouts and Tx dropped packets
|
||||
|
||||
void blockApplySettings(bool block) { m_doApplySettings = !block; } |
||||
void displaySettings(); |
||||
void displaySampleRate(); |
||||
void displayMasterClockRate(); |
||||
void displayGain(); |
||||
void displayAntennas(); |
||||
void displayStreamStatus(); |
||||
void updateStreamIndexItems(QComboBox *comboBox, bool rxElseTx); |
||||
void sendSettings(); |
||||
void updateSampleRateAndFrequency(); |
||||
void updateFrequencyLimits(); |
||||
void setCenterFrequencySetting(uint64_t kHzValue); |
||||
void setGain(int gain); |
||||
bool handleMessage(const Message& message); |
||||
void makeUIConnections(); |
||||
|
||||
private slots: |
||||
void handleInputMessages(); |
||||
void updateHardware(); |
||||
void updateStatus(); |
||||
void on_streamSide_currentIndexChanged(int index); |
||||
void on_streamIndex_currentIndexChanged(int index); |
||||
void on_spectrumSide_currentIndexChanged(int index); |
||||
void on_spectrumIndex_currentIndexChanged(int index); |
||||
void on_startStopRx_toggled(bool checked); |
||||
void on_startStopTx_toggled(bool checked); |
||||
void on_centerFrequency_changed(quint64 value); |
||||
void on_loOffset_changed(qint64 value); |
||||
void on_clockSource_currentIndexChanged(int index); |
||||
void on_dcOffset_toggled(bool checked); |
||||
void on_iqImbalance_toggled(bool checked); |
||||
void on_bandwidth_changed(quint64 value); |
||||
void on_transverter_clicked(); |
||||
void on_sampleRateMode_toggled(bool checked); |
||||
void on_sampleRate_changed(quint64 value); |
||||
void on_decim_currentIndexChanged(int index); |
||||
void on_gainLock_toggled(bool checked); |
||||
void on_gainMode_currentIndexChanged(int index); |
||||
void on_gain_valueChanged(int value); |
||||
void on_antenna_currentIndexChanged(int index); |
||||
void openDeviceSettingsDialog(const QPoint& p); |
||||
}; |
||||
|
||||
#endif // _USRPMIMO_USRPMIMOGUI_H_
|
||||
@ -0,0 +1,952 @@
@@ -0,0 +1,952 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>USRPMIMOGUI</class> |
||||
<widget class="QWidget" name="USRPMIMOGUI"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>370</width> |
||||
<height>240</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>370</width> |
||||
<height>240</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>390</width> |
||||
<height>252</height> |
||||
</size> |
||||
</property> |
||||
<property name="font"> |
||||
<font> |
||||
<family>Liberation Sans</family> |
||||
<pointsize>9</pointsize> |
||||
</font> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>USRP MIMO</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="streamLayout"> |
||||
<property name="topMargin"> |
||||
<number>6</number> |
||||
</property> |
||||
<item> |
||||
<widget class="QLabel" name="streamLabel"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>16777215</width> |
||||
<height>22</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap resource="../../../sdrgui/resources/res.qrc">:/antenna.png</pixmap> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="streamSide"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>45</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Select Rx or Tx settings</string> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Rx</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Tx</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="streamIndex"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>35</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Select stream index to which settings apply</string> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>0</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>1</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="spectrumLabel"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>16777215</width> |
||||
<height>22</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap resource="../../../sdrgui/resources/res.qrc">:/dsb.png</pixmap> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="spectrumSide"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>45</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>45</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Select Rx or Tx spectrum</string> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Rx</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Tx</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="spectrumIndex"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>35</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Select which stream index to display spectrum</string> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>0</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>1</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="Line" name="line"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Vertical</enum> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="startStopRxLabel"> |
||||
<property name="text"> |
||||
<string>Rx</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="ButtonSwitch" name="startStopRx"> |
||||
<property name="toolTip"> |
||||
<string>start/stop acquisition (Rx)</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="startStopTxLabel"> |
||||
<property name="text"> |
||||
<string>Tx</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="ButtonSwitch" name="startStopTx"> |
||||
<property name="toolTip"> |
||||
<string>start/stop generation (Tx)</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> |
||||
<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> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="horizontalLayout_freq"> |
||||
<property name="topMargin"> |
||||
<number>4</number> |
||||
</property> |
||||
<item> |
||||
<layout class="QVBoxLayout" name="deviceUILayout"> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="deviceButtonsLayout"/> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="deviceRateLayout"> |
||||
<item> |
||||
<widget class="QLabel" name="deviceRateText"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>50</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>I/Q sample rate kS/s</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>00000k</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<spacer name="freqLeftSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>0</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item> |
||||
<widget class="ValueDial" name="centerFrequency" 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>16</pointsize> |
||||
</font> |
||||
</property> |
||||
<property name="cursor"> |
||||
<cursorShape>PointingHandCursor</cursorShape> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::StrongFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Tuner center frequency in kHz</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="freqUnits"> |
||||
<property name="text"> |
||||
<string> kHz</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="freqRightlSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>0</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="loOffsetLayout"> |
||||
<item> |
||||
<widget class="QLabel" name="loOffsetLabel"> |
||||
<property name="text"> |
||||
<string>LO</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="ValueDialZ" name="loOffset" 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> |
||||
<bold>false</bold> |
||||
</font> |
||||
</property> |
||||
<property name="cursor"> |
||||
<cursorShape>PointingHandCursor</cursorShape> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>LO offset (kHz). The LO is offset from the center frequency by this amount and a digital NCO is used to compensate</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="loOffsetUnits"> |
||||
<property name="text"> |
||||
<string>kHz</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="loOffsetSpacer"> |
||||
<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="clockSourceLabel"> |
||||
<property name="text"> |
||||
<string>Clk</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="clockSource"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>70</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Clock source (common to Rx and Tx)</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QGridLayout" name="gridLayout_corr"> |
||||
<item row="0" column="2"> |
||||
<widget class="ButtonSwitch" name="iqImbalance"> |
||||
<property name="toolTip"> |
||||
<string>Automatic IQ imbalance correction (Rx)</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>IQ</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="1"> |
||||
<widget class="ButtonSwitch" name="dcOffset"> |
||||
<property name="toolTip"> |
||||
<string>Automatic DC offset removal (Rx)</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>DC</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="3"> |
||||
<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 row="0" column="0"> |
||||
<widget class="QLabel" name="corrLabel"> |
||||
<property name="text"> |
||||
<string>Auto</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="6"> |
||||
<widget class="QLabel" name="bandwidthUnit"> |
||||
<property name="text"> |
||||
<string>kHz</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="4"> |
||||
<widget class="QLabel" name="bandwidthLabel"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="text"> |
||||
<string>BW </string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="5"> |
||||
<widget class="ValueDial" name="bandwidth" 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="toolTip"> |
||||
<string>RF bandwidth</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="7"> |
||||
<widget class="TransverterButton" name="transverter"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>24</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Transverter frequency translation dialog</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>X</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<widget class="Line" name="line_freq"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="sampleRateLayout"> |
||||
<property name="topMargin"> |
||||
<number>2</number> |
||||
</property> |
||||
<property name="bottomMargin"> |
||||
<number>2</number> |
||||
</property> |
||||
<item> |
||||
<widget class="QToolButton" name="sampleRateMode"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Toggle between device to host (SR) and base band (BB) sample rate input</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>SR</string> |
||||
</property> |
||||
<property name="checkable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="checked"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="ValueDial" name="sampleRate" 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="toolTip"> |
||||
<string>Device sample rate</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="samplerateUnit"> |
||||
<property name="text"> |
||||
<string>S/s</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="horizontalSpacer_5"> |
||||
<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="masterClockRateLabel"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>54</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Master clock rate (sample rate between FPGA and RFIC) (S/s)</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>-</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label_decim"> |
||||
<property name="text"> |
||||
<string>Dec</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="decim"> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>50</width> |
||||
<height>16777215</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Decimation factor</string> |
||||
</property> |
||||
<property name="currentIndex"> |
||||
<number>0</number> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>1</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>2</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>4</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>8</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>16</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>32</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>64</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QGridLayout" name="gridLayout_decim" columnstretch="0,0,0,0,0,0"> |
||||
<property name="spacing"> |
||||
<number>3</number> |
||||
</property> |
||||
<item row="0" column="3"> |
||||
<widget class="QSlider" name="gain"> |
||||
<property name="toolTip"> |
||||
<string>Gain value</string> |
||||
</property> |
||||
<property name="pageStep"> |
||||
<number>1</number> |
||||
</property> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="2"> |
||||
<widget class="QComboBox" name="gainMode"> |
||||
<property name="toolTip"> |
||||
<string>Automatic or manual gain control</string> |
||||
</property> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Auto</string> |
||||
</property> |
||||
</item> |
||||
<item> |
||||
<property name="text"> |
||||
<string>Manual</string> |
||||
</property> |
||||
</item> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="0"> |
||||
<widget class="QLabel" name="gainLabel"> |
||||
<property name="text"> |
||||
<string>Gain</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="4"> |
||||
<widget class="QLabel" name="gainText"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>45</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string>000 dB</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="1"> |
||||
<widget class="QToolButton" name="gainLock"> |
||||
<property name="toolTip"> |
||||
<string>Lock both channels gain</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="icon"> |
||||
<iconset resource="../../../sdrgui/resources/res.qrc"> |
||||
<normaloff>:/unlocked.png</normaloff> |
||||
<normalon>:/locked.png</normalon>:/unlocked.png</iconset> |
||||
</property> |
||||
<property name="checkable"> |
||||
<bool>true</bool> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="antennaLayout"> |
||||
<item> |
||||
<widget class="QLabel" name="antennaLabel"> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap resource="../../../sdrgui/resources/res.qrc">:/antenna.png</pixmap> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QComboBox" name="antenna"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>80</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Antenna</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="antennaSpacer"> |
||||
<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="temperatureText"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Board temperature (degrees C)</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>-</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="streamStatusLabel"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>24</height> |
||||
</size> |
||||
</property> |
||||
<property name="maximumSize"> |
||||
<size> |
||||
<width>24</width> |
||||
<height>24</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Green when stream is active (Rx or Tx as selected)</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="pixmap"> |
||||
<pixmap resource="../../../sdrgui/resources/res.qrc">:/stream.png</pixmap> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="overrunLabel"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>12</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Red if Rx overruns or Tx underruns occurred. Cleared when restarting</string> |
||||
</property> |
||||
<property name="styleSheet"> |
||||
<string notr="true">background:rgb(79,79,79);</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>O</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="timeoutLabel"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>12</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Red if Rx timeouts or Tx dropped packets occurred. Cleared when restarting</string> |
||||
</property> |
||||
<property name="styleSheet"> |
||||
<string notr="true">background:rgb(79,79,79);</string> |
||||
</property> |
||||
<property name="text"> |
||||
<string>T</string> |
||||
</property> |
||||
<property name="alignment"> |
||||
<set>Qt::AlignCenter</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<customwidgets> |
||||
<customwidget> |
||||
<class>ValueDialZ</class> |
||||
<extends>QWidget</extends> |
||||
<header>gui/valuedialz.h</header> |
||||
<container>1</container> |
||||
</customwidget> |
||||
<customwidget> |
||||
<class>ValueDial</class> |
||||
<extends>QWidget</extends> |
||||
<header>gui/valuedial.h</header> |
||||
<container>1</container> |
||||
</customwidget> |
||||
<customwidget> |
||||
<class>ButtonSwitch</class> |
||||
<extends>QToolButton</extends> |
||||
<header>gui/buttonswitch.h</header> |
||||
</customwidget> |
||||
<customwidget> |
||||
<class>TransverterButton</class> |
||||
<extends>QPushButton</extends> |
||||
<header>gui/transverterbutton.h</header> |
||||
</customwidget> |
||||
</customwidgets> |
||||
<resources> |
||||
<include location="../../../sdrgui/resources/res.qrc"/> |
||||
</resources> |
||||
<connections/> |
||||
</ui> |
||||
@ -0,0 +1,143 @@
@@ -0,0 +1,143 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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" |
||||
#include "usrp/deviceusrp.h" |
||||
|
||||
#ifndef SERVER_MODE |
||||
#include "usrpmimogui.h" |
||||
#endif |
||||
#include "usrpmimo.h" |
||||
#include "usrpmimoplugin.h" |
||||
#include "usrpmimowebapiadapter.h" |
||||
|
||||
const PluginDescriptor USRPMIMOPlugin::m_pluginDescriptor = { |
||||
QStringLiteral("USRP"), |
||||
QStringLiteral("USRP MIMO"), |
||||
QStringLiteral("7.28.0"), |
||||
QStringLiteral("(c) Jon Beniston, M7RCE"), |
||||
QStringLiteral("https://github.com/f4exb/sdrangel"), |
||||
true, |
||||
QStringLiteral("https://github.com/f4exb/sdrangel") |
||||
}; |
||||
|
||||
static constexpr const char* const m_hardwareID = "USRP"; |
||||
static constexpr const char* const m_deviceTypeID = USRPMIMO_DEVICE_TYPE_ID; |
||||
|
||||
USRPMIMOPlugin::USRPMIMOPlugin(QObject* parent) : |
||||
QObject(parent) |
||||
{ |
||||
} |
||||
|
||||
const PluginDescriptor& USRPMIMOPlugin::getPluginDescriptor() const |
||||
{ |
||||
return m_pluginDescriptor; |
||||
} |
||||
|
||||
void USRPMIMOPlugin::initPlugin(PluginAPI* pluginAPI) |
||||
{ |
||||
pluginAPI->registerSampleMIMO(m_deviceTypeID, this); |
||||
} |
||||
|
||||
void USRPMIMOPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices) |
||||
{ |
||||
if (listedHwIds.contains(m_hardwareID)) { // check if it was done
|
||||
return; |
||||
} |
||||
|
||||
DeviceUSRP::enumOriginDevices(m_hardwareID, originDevices); |
||||
listedHwIds.append(m_hardwareID); |
||||
} |
||||
|
||||
PluginInterface::SamplingDevices USRPMIMOPlugin::enumSampleMIMO(const OriginDevices& originDevices) |
||||
{ |
||||
SamplingDevices result; |
||||
|
||||
for (OriginDevices::const_iterator it = originDevices.begin(); it != originDevices.end(); ++it) |
||||
{ |
||||
// Only offer MIMO for devices with more than one Rx or Tx channel
|
||||
if ((it->hardwareId == m_hardwareID) && ((it->nbRxStreams > 1) || (it->nbTxStreams > 1))) |
||||
{ |
||||
QString displayedName = it->displayableName; |
||||
displayedName.replace(QString(":$1]"), QString("]")); |
||||
result.append(SamplingDevice( |
||||
displayedName, |
||||
m_hardwareID, |
||||
m_deviceTypeID, |
||||
it->serial, |
||||
it->sequence, |
||||
PluginInterface::SamplingDevice::PhysicalDevice, |
||||
PluginInterface::SamplingDevice::StreamMIMO, |
||||
1, |
||||
0 |
||||
)); |
||||
} |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
#ifdef SERVER_MODE |
||||
DeviceGUI* USRPMIMOPlugin::createSampleMIMOPluginInstanceGUI( |
||||
const QString& sourceId, |
||||
QWidget **widget, |
||||
DeviceUISet *deviceUISet) |
||||
{ |
||||
(void) sourceId; |
||||
(void) widget; |
||||
(void) deviceUISet; |
||||
return nullptr; |
||||
} |
||||
#else |
||||
DeviceGUI* USRPMIMOPlugin::createSampleMIMOPluginInstanceGUI( |
||||
const QString& sourceId, |
||||
QWidget **widget, |
||||
DeviceUISet *deviceUISet) |
||||
{ |
||||
if (sourceId == m_deviceTypeID) |
||||
{ |
||||
USRPMIMOGUI* gui = new USRPMIMOGUI(deviceUISet); |
||||
*widget = gui; |
||||
return gui; |
||||
} |
||||
else |
||||
{ |
||||
return nullptr; |
||||
} |
||||
} |
||||
#endif |
||||
|
||||
DeviceSampleMIMO *USRPMIMOPlugin::createSampleMIMOPluginInstance(const QString& mimoId, DeviceAPI *deviceAPI) |
||||
{ |
||||
if (mimoId == m_deviceTypeID) |
||||
{ |
||||
USRPMIMO* mimo = new USRPMIMO(deviceAPI); |
||||
return mimo; |
||||
} |
||||
else |
||||
{ |
||||
return nullptr; |
||||
} |
||||
} |
||||
|
||||
DeviceWebAPIAdapter *USRPMIMOPlugin::createDeviceWebAPIAdapter() const |
||||
{ |
||||
return new USRPMIMOWebAPIAdapter(); |
||||
} |
||||
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 _USRPMIMO_USRPMIMOPLUGIN_H |
||||
#define _USRPMIMO_USRPMIMOPLUGIN_H |
||||
|
||||
#include <QObject> |
||||
#include "plugin/plugininterface.h" |
||||
|
||||
class PluginAPI; |
||||
|
||||
#define USRPMIMO_DEVICE_TYPE_ID "sdrangel.samplemimo.usrpmimo" |
||||
|
||||
class USRPMIMOPlugin : public QObject, public PluginInterface { |
||||
Q_OBJECT |
||||
Q_INTERFACES(PluginInterface) |
||||
Q_PLUGIN_METADATA(IID USRPMIMO_DEVICE_TYPE_ID) |
||||
|
||||
public: |
||||
explicit USRPMIMOPlugin(QObject* parent = nullptr); |
||||
|
||||
const PluginDescriptor& getPluginDescriptor() const; |
||||
void initPlugin(PluginAPI* pluginAPI); |
||||
|
||||
virtual void enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices); |
||||
virtual SamplingDevices enumSampleMIMO(const OriginDevices& originDevices); |
||||
|
||||
virtual DeviceGUI* createSampleMIMOPluginInstanceGUI( |
||||
const QString& sourceId, |
||||
QWidget **widget, |
||||
DeviceUISet *deviceUISet); |
||||
virtual DeviceSampleMIMO* createSampleMIMOPluginInstance(const QString& sourceId, DeviceAPI *deviceAPI); |
||||
virtual DeviceWebAPIAdapter* createDeviceWebAPIAdapter() const; |
||||
|
||||
private: |
||||
static const PluginDescriptor m_pluginDescriptor; |
||||
}; |
||||
|
||||
#endif // _USRPMIMO_USRPMIMOPLUGIN_H
|
||||
@ -0,0 +1,396 @@
@@ -0,0 +1,396 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 <sstream> |
||||
|
||||
#include <QtGlobal> |
||||
|
||||
#include "util/simpleserializer.h" |
||||
#include "usrpmimosettings.h" |
||||
|
||||
USRPMIMOSettings::USRPMIMOSettings() |
||||
{ |
||||
resetToDefaults(); |
||||
} |
||||
|
||||
void USRPMIMOSettings::resetToDefaults() |
||||
{ |
||||
m_title = "USRP"; |
||||
m_masterClockRate = -1; |
||||
m_devSampleRate = 3000000; |
||||
m_clockSource = "internal"; |
||||
m_gpioDir = 0; |
||||
m_gpioPins = 0; |
||||
m_rxCenterFrequency = 435000*1000; |
||||
m_rxLOOffset = 0; |
||||
m_log2SoftDecim = 0; |
||||
m_rxLpfBW = 10e6f; |
||||
m_dcBlock = false; |
||||
m_iqCorrection = false; |
||||
m_rxTransverterMode = false; |
||||
m_rxTransverterDeltaFrequency = 0; |
||||
m_rx0GainMode = GAIN_AUTO; |
||||
m_rx0Gain = 50; |
||||
m_rx0AntennaPath = "RX2"; |
||||
m_rx1GainMode = GAIN_AUTO; |
||||
m_rx1Gain = 50; |
||||
m_rx1AntennaPath = "RX2"; |
||||
m_txCenterFrequency = 435000*1000; |
||||
m_txLOOffset = 0; |
||||
m_log2SoftInterp = 0; |
||||
m_txLpfBW = 10e6f; |
||||
m_txTransverterMode = false; |
||||
m_txTransverterDeltaFrequency = 0; |
||||
m_tx0Gain = 50; |
||||
m_tx0AntennaPath = "TX/RX"; |
||||
m_tx1Gain = 50; |
||||
m_tx1AntennaPath = "TX/RX"; |
||||
m_useReverseAPI = false; |
||||
m_reverseAPIAddress = "127.0.0.1"; |
||||
m_reverseAPIPort = 8888; |
||||
m_reverseAPIDeviceIndex = 0; |
||||
} |
||||
|
||||
QByteArray USRPMIMOSettings::serialize() const |
||||
{ |
||||
SimpleSerializer s(1); |
||||
|
||||
s.writeString(1, m_title); |
||||
s.writeS32(2, m_devSampleRate); |
||||
s.writeString(3, m_clockSource); |
||||
s.writeU32(4, m_gpioDir); |
||||
s.writeU32(5, m_gpioPins); |
||||
s.writeU64(6, m_rxCenterFrequency); |
||||
s.writeS32(7, m_rxLOOffset); |
||||
s.writeU32(8, m_log2SoftDecim); |
||||
s.writeFloat(9, m_rxLpfBW); |
||||
s.writeBool(10, m_dcBlock); |
||||
s.writeBool(11, m_iqCorrection); |
||||
s.writeBool(12, m_rxTransverterMode); |
||||
s.writeS64(13, m_rxTransverterDeltaFrequency); |
||||
s.writeS32(14, (int) m_rx0GainMode); |
||||
s.writeU32(15, m_rx0Gain); |
||||
s.writeString(16, m_rx0AntennaPath); |
||||
s.writeS32(17, (int) m_rx1GainMode); |
||||
s.writeU32(18, m_rx1Gain); |
||||
s.writeString(19, m_rx1AntennaPath); |
||||
s.writeU64(20, m_txCenterFrequency); |
||||
s.writeS32(21, m_txLOOffset); |
||||
s.writeU32(22, m_log2SoftInterp); |
||||
s.writeFloat(23, m_txLpfBW); |
||||
s.writeBool(24, m_txTransverterMode); |
||||
s.writeS64(25, m_txTransverterDeltaFrequency); |
||||
s.writeU32(26, m_tx0Gain); |
||||
s.writeString(27, m_tx0AntennaPath); |
||||
s.writeU32(28, m_tx1Gain); |
||||
s.writeString(29, m_tx1AntennaPath); |
||||
s.writeBool(30, m_useReverseAPI); |
||||
s.writeString(31, m_reverseAPIAddress); |
||||
s.writeU32(32, m_reverseAPIPort); |
||||
s.writeU32(33, m_reverseAPIDeviceIndex); |
||||
|
||||
return s.final(); |
||||
} |
||||
|
||||
bool USRPMIMOSettings::deserialize(const QByteArray& data) |
||||
{ |
||||
SimpleDeserializer d(data); |
||||
|
||||
if (!d.isValid()) |
||||
{ |
||||
resetToDefaults(); |
||||
return false; |
||||
} |
||||
|
||||
if (d.getVersion() == 1) |
||||
{ |
||||
int intval; |
||||
uint32_t uintval; |
||||
|
||||
d.readString(1, &m_title, "USRP"); |
||||
d.readS32(2, &m_devSampleRate, 3000000); |
||||
d.readString(3, &m_clockSource, "internal"); |
||||
d.readU32(4, &uintval, 0); |
||||
m_gpioDir = uintval & 0xFF; |
||||
d.readU32(5, &uintval, 0); |
||||
m_gpioPins = uintval & 0xFF; |
||||
d.readU64(6, &m_rxCenterFrequency, 435000*1000); |
||||
d.readS32(7, &m_rxLOOffset, 0); |
||||
d.readU32(8, &m_log2SoftDecim, 0); |
||||
m_log2SoftDecim = m_log2SoftDecim > 6 ? 6 : m_log2SoftDecim; |
||||
d.readFloat(9, &m_rxLpfBW, 10e6f); |
||||
d.readBool(10, &m_dcBlock, false); |
||||
d.readBool(11, &m_iqCorrection, false); |
||||
d.readBool(12, &m_rxTransverterMode, false); |
||||
d.readS64(13, &m_rxTransverterDeltaFrequency, 0); |
||||
d.readS32(14, &intval, (int) GAIN_AUTO); |
||||
m_rx0GainMode = intval == 0 ? GAIN_AUTO : GAIN_MANUAL; |
||||
d.readU32(15, &m_rx0Gain, 50); |
||||
d.readString(16, &m_rx0AntennaPath, "RX2"); |
||||
d.readS32(17, &intval, (int) GAIN_AUTO); |
||||
m_rx1GainMode = intval == 0 ? GAIN_AUTO : GAIN_MANUAL; |
||||
d.readU32(18, &m_rx1Gain, 50); |
||||
d.readString(19, &m_rx1AntennaPath, "RX2"); |
||||
d.readU64(20, &m_txCenterFrequency, 435000*1000); |
||||
d.readS32(21, &m_txLOOffset, 0); |
||||
d.readU32(22, &m_log2SoftInterp, 0); |
||||
m_log2SoftInterp = m_log2SoftInterp > 6 ? 6 : m_log2SoftInterp; |
||||
d.readFloat(23, &m_txLpfBW, 10e6f); |
||||
d.readBool(24, &m_txTransverterMode, false); |
||||
d.readS64(25, &m_txTransverterDeltaFrequency, 0); |
||||
d.readU32(26, &m_tx0Gain, 50); |
||||
d.readString(27, &m_tx0AntennaPath, "TX/RX"); |
||||
d.readU32(28, &m_tx1Gain, 50); |
||||
d.readString(29, &m_tx1AntennaPath, "TX/RX"); |
||||
d.readBool(30, &m_useReverseAPI, false); |
||||
d.readString(31, &m_reverseAPIAddress, "127.0.0.1"); |
||||
d.readU32(32, &uintval, 0); |
||||
|
||||
if ((uintval > 1023) && (uintval < 65535)) { |
||||
m_reverseAPIPort = uintval; |
||||
} else { |
||||
m_reverseAPIPort = 8888; |
||||
} |
||||
|
||||
d.readU32(33, &uintval, 0); |
||||
m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval; |
||||
|
||||
return true; |
||||
} |
||||
else |
||||
{ |
||||
resetToDefaults(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
void USRPMIMOSettings::applySettings(const QStringList& settingsKeys, const USRPMIMOSettings& settings) |
||||
{ |
||||
if (settingsKeys.contains("masterClockRate")) { |
||||
m_masterClockRate = settings.m_masterClockRate; |
||||
} |
||||
if (settingsKeys.contains("title")) { |
||||
m_title = settings.m_title; |
||||
} |
||||
if (settingsKeys.contains("devSampleRate")) { |
||||
m_devSampleRate = settings.m_devSampleRate; |
||||
} |
||||
if (settingsKeys.contains("clockSource")) { |
||||
m_clockSource = settings.m_clockSource; |
||||
} |
||||
if (settingsKeys.contains("gpioDir")) { |
||||
m_gpioDir = settings.m_gpioDir; |
||||
} |
||||
if (settingsKeys.contains("gpioPins")) { |
||||
m_gpioPins = settings.m_gpioPins; |
||||
} |
||||
if (settingsKeys.contains("rxCenterFrequency")) { |
||||
m_rxCenterFrequency = settings.m_rxCenterFrequency; |
||||
} |
||||
if (settingsKeys.contains("rxLOOffset")) { |
||||
m_rxLOOffset = settings.m_rxLOOffset; |
||||
} |
||||
if (settingsKeys.contains("log2SoftDecim")) { |
||||
m_log2SoftDecim = settings.m_log2SoftDecim; |
||||
} |
||||
if (settingsKeys.contains("rxLpfBW")) { |
||||
m_rxLpfBW = settings.m_rxLpfBW; |
||||
} |
||||
if (settingsKeys.contains("dcBlock")) { |
||||
m_dcBlock = settings.m_dcBlock; |
||||
} |
||||
if (settingsKeys.contains("iqCorrection")) { |
||||
m_iqCorrection = settings.m_iqCorrection; |
||||
} |
||||
if (settingsKeys.contains("rxTransverterMode")) { |
||||
m_rxTransverterMode = settings.m_rxTransverterMode; |
||||
} |
||||
if (settingsKeys.contains("rxTransverterDeltaFrequency")) { |
||||
m_rxTransverterDeltaFrequency = settings.m_rxTransverterDeltaFrequency; |
||||
} |
||||
if (settingsKeys.contains("rx0GainMode")) { |
||||
m_rx0GainMode = settings.m_rx0GainMode; |
||||
} |
||||
if (settingsKeys.contains("rx0Gain")) { |
||||
m_rx0Gain = settings.m_rx0Gain; |
||||
} |
||||
if (settingsKeys.contains("rx0AntennaPath")) { |
||||
m_rx0AntennaPath = settings.m_rx0AntennaPath; |
||||
} |
||||
if (settingsKeys.contains("rx1GainMode")) { |
||||
m_rx1GainMode = settings.m_rx1GainMode; |
||||
} |
||||
if (settingsKeys.contains("rx1Gain")) { |
||||
m_rx1Gain = settings.m_rx1Gain; |
||||
} |
||||
if (settingsKeys.contains("rx1AntennaPath")) { |
||||
m_rx1AntennaPath = settings.m_rx1AntennaPath; |
||||
} |
||||
if (settingsKeys.contains("txCenterFrequency")) { |
||||
m_txCenterFrequency = settings.m_txCenterFrequency; |
||||
} |
||||
if (settingsKeys.contains("txLOOffset")) { |
||||
m_txLOOffset = settings.m_txLOOffset; |
||||
} |
||||
if (settingsKeys.contains("log2SoftInterp")) { |
||||
m_log2SoftInterp = settings.m_log2SoftInterp; |
||||
} |
||||
if (settingsKeys.contains("txLpfBW")) { |
||||
m_txLpfBW = settings.m_txLpfBW; |
||||
} |
||||
if (settingsKeys.contains("txTransverterMode")) { |
||||
m_txTransverterMode = settings.m_txTransverterMode; |
||||
} |
||||
if (settingsKeys.contains("txTransverterDeltaFrequency")) { |
||||
m_txTransverterDeltaFrequency = settings.m_txTransverterDeltaFrequency; |
||||
} |
||||
if (settingsKeys.contains("tx0Gain")) { |
||||
m_tx0Gain = settings.m_tx0Gain; |
||||
} |
||||
if (settingsKeys.contains("tx0AntennaPath")) { |
||||
m_tx0AntennaPath = settings.m_tx0AntennaPath; |
||||
} |
||||
if (settingsKeys.contains("tx1Gain")) { |
||||
m_tx1Gain = settings.m_tx1Gain; |
||||
} |
||||
if (settingsKeys.contains("tx1AntennaPath")) { |
||||
m_tx1AntennaPath = settings.m_tx1AntennaPath; |
||||
} |
||||
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; |
||||
} |
||||
} |
||||
|
||||
QString USRPMIMOSettings::getDebugString(const QStringList& settingsKeys, bool force) const |
||||
{ |
||||
std::ostringstream ostr; |
||||
|
||||
if (settingsKeys.contains("masterClockRate") || force) { |
||||
ostr << " m_masterClockRate: " << m_masterClockRate; |
||||
} |
||||
if (settingsKeys.contains("title") || force) { |
||||
ostr << " m_title: " << m_title.toStdString(); |
||||
} |
||||
if (settingsKeys.contains("devSampleRate") || force) { |
||||
ostr << " m_devSampleRate: " << m_devSampleRate; |
||||
} |
||||
if (settingsKeys.contains("clockSource") || force) { |
||||
ostr << " m_clockSource: " << m_clockSource.toStdString(); |
||||
} |
||||
if (settingsKeys.contains("gpioDir") || force) { |
||||
ostr << " m_gpioDir: " << (int) m_gpioDir; |
||||
} |
||||
if (settingsKeys.contains("gpioPins") || force) { |
||||
ostr << " m_gpioPins: " << (int) m_gpioPins; |
||||
} |
||||
if (settingsKeys.contains("rxCenterFrequency") || force) { |
||||
ostr << " m_rxCenterFrequency: " << m_rxCenterFrequency; |
||||
} |
||||
if (settingsKeys.contains("rxLOOffset") || force) { |
||||
ostr << " m_rxLOOffset: " << m_rxLOOffset; |
||||
} |
||||
if (settingsKeys.contains("log2SoftDecim") || force) { |
||||
ostr << " m_log2SoftDecim: " << m_log2SoftDecim; |
||||
} |
||||
if (settingsKeys.contains("rxLpfBW") || force) { |
||||
ostr << " m_rxLpfBW: " << m_rxLpfBW; |
||||
} |
||||
if (settingsKeys.contains("dcBlock") || force) { |
||||
ostr << " m_dcBlock: " << m_dcBlock; |
||||
} |
||||
if (settingsKeys.contains("iqCorrection") || force) { |
||||
ostr << " m_iqCorrection: " << m_iqCorrection; |
||||
} |
||||
if (settingsKeys.contains("rxTransverterMode") || force) { |
||||
ostr << " m_rxTransverterMode: " << m_rxTransverterMode; |
||||
} |
||||
if (settingsKeys.contains("rxTransverterDeltaFrequency") || force) { |
||||
ostr << " m_rxTransverterDeltaFrequency: " << m_rxTransverterDeltaFrequency; |
||||
} |
||||
if (settingsKeys.contains("rx0GainMode") || force) { |
||||
ostr << " m_rx0GainMode: " << m_rx0GainMode; |
||||
} |
||||
if (settingsKeys.contains("rx0Gain") || force) { |
||||
ostr << " m_rx0Gain: " << m_rx0Gain; |
||||
} |
||||
if (settingsKeys.contains("rx0AntennaPath") || force) { |
||||
ostr << " m_rx0AntennaPath: " << m_rx0AntennaPath.toStdString(); |
||||
} |
||||
if (settingsKeys.contains("rx1GainMode") || force) { |
||||
ostr << " m_rx1GainMode: " << m_rx1GainMode; |
||||
} |
||||
if (settingsKeys.contains("rx1Gain") || force) { |
||||
ostr << " m_rx1Gain: " << m_rx1Gain; |
||||
} |
||||
if (settingsKeys.contains("rx1AntennaPath") || force) { |
||||
ostr << " m_rx1AntennaPath: " << m_rx1AntennaPath.toStdString(); |
||||
} |
||||
if (settingsKeys.contains("txCenterFrequency") || force) { |
||||
ostr << " m_txCenterFrequency: " << m_txCenterFrequency; |
||||
} |
||||
if (settingsKeys.contains("txLOOffset") || force) { |
||||
ostr << " m_txLOOffset: " << m_txLOOffset; |
||||
} |
||||
if (settingsKeys.contains("log2SoftInterp") || force) { |
||||
ostr << " m_log2SoftInterp: " << m_log2SoftInterp; |
||||
} |
||||
if (settingsKeys.contains("txLpfBW") || force) { |
||||
ostr << " m_txLpfBW: " << m_txLpfBW; |
||||
} |
||||
if (settingsKeys.contains("txTransverterMode") || force) { |
||||
ostr << " m_txTransverterMode: " << m_txTransverterMode; |
||||
} |
||||
if (settingsKeys.contains("txTransverterDeltaFrequency") || force) { |
||||
ostr << " m_txTransverterDeltaFrequency: " << m_txTransverterDeltaFrequency; |
||||
} |
||||
if (settingsKeys.contains("tx0Gain") || force) { |
||||
ostr << " m_tx0Gain: " << m_tx0Gain; |
||||
} |
||||
if (settingsKeys.contains("tx0AntennaPath") || force) { |
||||
ostr << " m_tx0AntennaPath: " << m_tx0AntennaPath.toStdString(); |
||||
} |
||||
if (settingsKeys.contains("tx1Gain") || force) { |
||||
ostr << " m_tx1Gain: " << m_tx1Gain; |
||||
} |
||||
if (settingsKeys.contains("tx1AntennaPath") || force) { |
||||
ostr << " m_tx1AntennaPath: " << m_tx1AntennaPath.toStdString(); |
||||
} |
||||
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; |
||||
} |
||||
|
||||
return QString(ostr.str().c_str()); |
||||
} |
||||
@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOSETTINGS_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOSETTINGS_H_ |
||||
|
||||
#include <stdint.h> |
||||
|
||||
#include <QtGlobal> |
||||
#include <QString> |
||||
|
||||
struct USRPMIMOSettings |
||||
{ |
||||
typedef enum { |
||||
GAIN_AUTO, |
||||
GAIN_MANUAL |
||||
} GainMode; |
||||
|
||||
QString m_title; |
||||
int m_masterClockRate; //!< Read-only, reported by device (-1 if unknown)
|
||||
int m_devSampleRate; |
||||
QString m_clockSource; |
||||
uint8_t m_gpioDir; |
||||
uint8_t m_gpioPins; |
||||
quint64 m_rxCenterFrequency; |
||||
int m_rxLOOffset; |
||||
quint32 m_log2SoftDecim; |
||||
float m_rxLpfBW; |
||||
bool m_dcBlock; |
||||
bool m_iqCorrection; |
||||
bool m_rxTransverterMode; |
||||
qint64 m_rxTransverterDeltaFrequency; |
||||
GainMode m_rx0GainMode; |
||||
quint32 m_rx0Gain; |
||||
QString m_rx0AntennaPath; |
||||
GainMode m_rx1GainMode; |
||||
quint32 m_rx1Gain; |
||||
QString m_rx1AntennaPath; |
||||
quint64 m_txCenterFrequency; |
||||
int m_txLOOffset; |
||||
quint32 m_log2SoftInterp; |
||||
float m_txLpfBW; |
||||
bool m_txTransverterMode; |
||||
qint64 m_txTransverterDeltaFrequency; |
||||
quint32 m_tx0Gain; |
||||
QString m_tx0AntennaPath; |
||||
quint32 m_tx1Gain; |
||||
QString m_tx1AntennaPath; |
||||
|
||||
bool m_useReverseAPI; |
||||
QString m_reverseAPIAddress; |
||||
uint16_t m_reverseAPIPort; |
||||
uint16_t m_reverseAPIDeviceIndex; |
||||
|
||||
USRPMIMOSettings(); |
||||
void resetToDefaults(); |
||||
QByteArray serialize() const; |
||||
bool deserialize(const QByteArray& data); |
||||
void applySettings(const QStringList& settingsKeys, const USRPMIMOSettings& settings); |
||||
QString getDebugString(const QStringList& settingsKeys, bool force=false) const; |
||||
}; |
||||
|
||||
#endif /* PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOSETTINGS_H_ */ |
||||
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 "SWGDeviceSettings.h" |
||||
#include "SWGUSRPMIMOSettings.h" |
||||
#include "usrpmimo.h" |
||||
#include "usrpmimowebapiadapter.h" |
||||
|
||||
USRPMIMOWebAPIAdapter::USRPMIMOWebAPIAdapter() |
||||
{} |
||||
|
||||
USRPMIMOWebAPIAdapter::~USRPMIMOWebAPIAdapter() |
||||
{} |
||||
|
||||
int USRPMIMOWebAPIAdapter::webapiSettingsGet( |
||||
SWGSDRangel::SWGDeviceSettings& response, |
||||
QString& errorMessage) |
||||
{ |
||||
(void) errorMessage; |
||||
response.setUsrpMimoSettings(new SWGSDRangel::SWGUSRPMIMOSettings()); |
||||
response.getUsrpMimoSettings()->init(); |
||||
USRPMIMO::webapiFormatDeviceSettings(response, m_settings); |
||||
return 200; |
||||
} |
||||
|
||||
int USRPMIMOWebAPIAdapter::webapiSettingsPutPatch( |
||||
bool force, |
||||
const QStringList& deviceSettingsKeys, |
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage) |
||||
{ |
||||
(void) force; // no action
|
||||
(void) errorMessage; |
||||
USRPMIMO::webapiUpdateDeviceSettings(m_settings, deviceSettingsKeys, response); |
||||
return 200; |
||||
} |
||||
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWEBAPIADAPTER_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWEBAPIADAPTER_H_ |
||||
|
||||
#include "device/devicewebapiadapter.h" |
||||
#include "usrpmimosettings.h" |
||||
|
||||
class USRPMIMOWebAPIAdapter : public DeviceWebAPIAdapter |
||||
{ |
||||
public: |
||||
USRPMIMOWebAPIAdapter(); |
||||
virtual ~USRPMIMOWebAPIAdapter(); |
||||
|
||||
virtual QByteArray serialize() { return m_settings.serialize(); } |
||||
virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } |
||||
|
||||
virtual int webapiSettingsGet( |
||||
SWGSDRangel::SWGDeviceSettings& response, |
||||
QString& errorMessage); |
||||
|
||||
virtual int webapiSettingsPutPatch( |
||||
bool force, |
||||
const QStringList& deviceSettingsKeys, |
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage); |
||||
|
||||
private: |
||||
USRPMIMOSettings m_settings; |
||||
}; |
||||
|
||||
#endif // PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWEBAPIADAPTER_H_
|
||||
@ -0,0 +1,407 @@
@@ -0,0 +1,407 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 <algorithm> |
||||
#include <functional> |
||||
|
||||
#include <QDebug> |
||||
|
||||
#include <uhd/usrp/multi_usrp.hpp> |
||||
#include <uhd/types/tune_request.hpp> |
||||
|
||||
#include "usrp/deviceusrp.h" |
||||
#include "usrp/deviceusrpparam.h" |
||||
#include "usrp/deviceusrpshared.h" |
||||
|
||||
#include "usrpmimo.h" |
||||
#include "usrpmimoworker.h" |
||||
|
||||
USRPMIMOWorker::USRPMIMOWorker(DeviceUSRPParams *deviceParams, int nbRx, int nbTx, MessageQueue *reportQueue) : |
||||
m_deviceParams(deviceParams), |
||||
m_nbRx(nbRx), |
||||
m_nbTx(nbTx), |
||||
m_reportQueue(reportQueue) |
||||
{ |
||||
// Executes in the thread this object has been moved to
|
||||
connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &USRPMIMOWorker::handleInputMessages); |
||||
} |
||||
|
||||
void USRPMIMOWorker::handleInputMessages() |
||||
{ |
||||
Message* message; |
||||
|
||||
// Merge consecutive configuration messages, so we only apply the latest settings.
|
||||
// This avoids a backlog of slow device calls (E.g. when a slider is dragged)
|
||||
bool pendingConfig = false; |
||||
USRPMIMOSettings settings; |
||||
QList<QString> settingsKeys; |
||||
bool force = false; |
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr) |
||||
{ |
||||
if (USRPMIMO::MsgConfigureUSRPMIMO::match(*message)) |
||||
{ |
||||
const USRPMIMO::MsgConfigureUSRPMIMO& conf = (const USRPMIMO::MsgConfigureUSRPMIMO&) *message; |
||||
|
||||
if (conf.getForce() || !pendingConfig) |
||||
{ |
||||
settings = conf.getSettings(); |
||||
settingsKeys = conf.getSettingsKeys(); |
||||
force = force || conf.getForce(); |
||||
} |
||||
else |
||||
{ |
||||
settings.applySettings(conf.getSettingsKeys(), conf.getSettings()); |
||||
for (const auto& key : conf.getSettingsKeys()) |
||||
{ |
||||
if (!settingsKeys.contains(key)) { |
||||
settingsKeys.append(key); |
||||
} |
||||
} |
||||
} |
||||
pendingConfig = true; |
||||
} |
||||
else |
||||
{ |
||||
qDebug("%s: unhandled message: %s", Q_FUNC_INFO, message->getIdentifier()); |
||||
} |
||||
|
||||
delete message; |
||||
} |
||||
|
||||
if (pendingConfig) { |
||||
applyDeviceSettings(m_deviceParams, m_nbRx, m_nbTx, settings, settingsKeys, force, true, true, true, true, m_reportQueue); |
||||
} |
||||
} |
||||
|
||||
// Apply settings to the device and send what was actually set to reportQueue.
|
||||
// applyCommon - apply settings common to Rx and Tx (clock source and GPIO)
|
||||
// applyRx/applyTx - apply Rx/Tx settings
|
||||
// applyBandwidth - apply LPF bandwidths. These shouldn't be set to a narrow bandwidth before the stream is created.
|
||||
void USRPMIMOWorker::applyDeviceSettings( |
||||
DeviceUSRPParams *deviceParams, |
||||
int nbRx, |
||||
int nbTx, |
||||
const USRPMIMOSettings& settings, |
||||
const QList<QString>& settingsKeys, |
||||
bool force, |
||||
bool applyCommon, |
||||
bool applyRx, |
||||
bool applyTx, |
||||
bool applyBandwidth, |
||||
MessageQueue *reportQueue) |
||||
{ |
||||
uhd::usrp::multi_usrp::sptr device = deviceParams ? deviceParams->getDevice() : nullptr; |
||||
|
||||
if (!device) { |
||||
return; |
||||
} |
||||
|
||||
QMutexLocker mutexLocker(&deviceParams->m_mutex); |
||||
|
||||
bool reapplyRx = false; |
||||
bool reapplyTx = false; |
||||
bool checkRates = false; |
||||
bool checkClockSource = false; |
||||
|
||||
const quint32 rxGain[2] = {settings.m_rx0Gain, settings.m_rx1Gain}; |
||||
const USRPMIMOSettings::GainMode rxGainMode[2] = {settings.m_rx0GainMode, settings.m_rx1GainMode}; |
||||
const QString rxAntenna[2] = {settings.m_rx0AntennaPath, settings.m_rx1AntennaPath}; |
||||
const quint32 txGain[2] = {settings.m_tx0Gain, settings.m_tx1Gain}; |
||||
const QString txAntenna[2] = {settings.m_tx0AntennaPath, settings.m_tx1AntennaPath}; |
||||
|
||||
// Apply each setting separately, so a failure (E.g. an antenna name not supported by the
|
||||
// daughterboard) doesn't prevent other settings from being applied
|
||||
auto apply = [](const char *what, const std::function<void()>& func) { |
||||
try { |
||||
func(); |
||||
} catch (std::exception &e) { |
||||
qWarning() << "USRPMIMOWorker::applyDeviceSettings: failed to set" << what << ":" << e.what(); |
||||
} |
||||
}; |
||||
|
||||
auto setRxGain = [&](int channel) { |
||||
if (rxGainMode[channel] == USRPMIMOSettings::GAIN_AUTO) |
||||
{ |
||||
try { |
||||
device->set_rx_agc(true, channel); |
||||
} catch (uhd::not_implemented_error &e) { |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: AGC not implemented on this radio. Please set to manual."; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
try { |
||||
device->set_rx_agc(false, channel); |
||||
} catch (uhd::not_implemented_error &e) { |
||||
// Ignore
|
||||
} |
||||
device->set_rx_gain(rxGain[channel], channel); |
||||
} |
||||
}; |
||||
|
||||
// Common settings
|
||||
|
||||
if (applyCommon && (settingsKeys.contains("clockSource") || force)) |
||||
{ |
||||
try |
||||
{ |
||||
device->set_clock_source(settings.m_clockSource.toStdString(), 0); |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: clock set to " << settings.m_clockSource; |
||||
} |
||||
catch (std::exception &e) |
||||
{ |
||||
// An exception will be thrown if the clock is not detected
|
||||
qCritical() << "USRPMIMOWorker::applyDeviceSettings: could not set clock " << settings.m_clockSource; |
||||
// So, default back to internal
|
||||
apply("clock source to internal", [&]() { device->set_clock_source("internal", 0); }); |
||||
} |
||||
// Report actual clock source, in case requested clock couldn't be set
|
||||
checkClockSource = true; |
||||
reapplyRx = true; |
||||
reapplyTx = true; |
||||
} |
||||
|
||||
const std::string gpioBank = "FP0"; // Front Panel GPIO
|
||||
|
||||
if (applyCommon && (settingsKeys.contains("gpioDir") || settingsKeys.contains("gpioPins") || force)) |
||||
{ |
||||
apply("GPIO", [&]() { |
||||
std::vector<std::string> banks = device->get_gpio_banks(0); |
||||
|
||||
if (std::find(banks.begin(), banks.end(), gpioBank) != banks.end()) |
||||
{ |
||||
device->set_gpio_attr(gpioBank, "CTRL", ~settings.m_gpioDir, 0xff); // 0 for GPIO, 1 for ATR
|
||||
device->set_gpio_attr(gpioBank, "DDR", settings.m_gpioDir, 0xff); // 0 for input, 1 for output
|
||||
device->set_gpio_attr(gpioBank, "OUT", settings.m_gpioPins, 0xff); |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: set GPIO dir to" << settings.m_gpioDir << "pins to" << settings.m_gpioPins; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// All channels use the same sample rate, so set a master clock rate suitable for it first,
|
||||
// otherwise UHD may not be able to change it automatically (See DeviceUSRP::setMasterClockRateForSampleRate)
|
||||
bool reenableAutoMasterClockRate = false; |
||||
|
||||
if ((settingsKeys.contains("devSampleRate") || force) && ((applyRx && (nbRx > 0)) || (applyTx && (nbTx > 0)))) |
||||
{ |
||||
apply("master clock rate", [&]() { |
||||
reenableAutoMasterClockRate = DeviceUSRP::setMasterClockRateForSampleRate(device, settings.m_devSampleRate, std::max(nbRx, nbTx)); |
||||
}); |
||||
} |
||||
|
||||
// Rx settings
|
||||
|
||||
if (applyRx && (nbRx > 0)) |
||||
{ |
||||
if (settingsKeys.contains("devSampleRate") || force) |
||||
{ |
||||
apply("Rx sample rate", [&]() { |
||||
for (int channel = 0; channel < nbRx; channel++) { |
||||
device->set_rx_rate(settings.m_devSampleRate, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Rx sample rate set to %d", settings.m_devSampleRate); |
||||
}); |
||||
checkRates = true; |
||||
reapplyRx = true; |
||||
} |
||||
|
||||
if (settingsKeys.contains("rxCenterFrequency") |
||||
|| settingsKeys.contains("rxLOOffset") |
||||
|| settingsKeys.contains("rxTransverterMode") |
||||
|| settingsKeys.contains("rxTransverterDeltaFrequency") |
||||
|| force) |
||||
{ |
||||
apply("Rx frequency", [&]() { |
||||
qint64 deviceCenterFrequency = settings.m_rxCenterFrequency; |
||||
deviceCenterFrequency -= settings.m_rxTransverterMode ? settings.m_rxTransverterDeltaFrequency : 0; |
||||
deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency; |
||||
uhd::tune_request_t tuneRequest = settings.m_rxLOOffset != 0 |
||||
? uhd::tune_request_t(deviceCenterFrequency, settings.m_rxLOOffset) |
||||
: uhd::tune_request_t(deviceCenterFrequency); |
||||
|
||||
for (int channel = 0; channel < nbRx; channel++) { |
||||
device->set_rx_freq(tuneRequest, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Rx frequency set to %lld with LO offset %d", deviceCenterFrequency, settings.m_rxLOOffset); |
||||
}); |
||||
} |
||||
|
||||
if (settingsKeys.contains("dcBlock") || force) |
||||
{ |
||||
apply("Rx DC offset correction", [&]() { |
||||
for (int channel = 0; channel < nbRx; channel++) { |
||||
device->set_rx_dc_offset(settings.m_dcBlock, channel); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
if (settingsKeys.contains("iqCorrection") || force) |
||||
{ |
||||
apply("Rx IQ correction", [&]() { |
||||
for (int channel = 0; channel < nbRx; channel++) { |
||||
device->set_rx_iq_balance(settings.m_iqCorrection, channel); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
for (int channel = 0; channel < nbRx; channel++) |
||||
{ |
||||
QString prefix = QString("rx%1").arg(channel); |
||||
|
||||
if (settingsKeys.contains(prefix + "GainMode") || settingsKeys.contains(prefix + "Gain") || force) { |
||||
apply("Rx gain", [&]() { setRxGain(channel); }); |
||||
} |
||||
|
||||
if (settingsKeys.contains(prefix + "AntennaPath") || force) { |
||||
apply("Rx antenna", [&]() { device->set_rx_antenna(rxAntenna[channel].toStdString(), channel); }); |
||||
} |
||||
} |
||||
|
||||
if (applyBandwidth && (settingsKeys.contains("rxLpfBW") || force)) |
||||
{ |
||||
apply("Rx LPF bandwidth", [&]() { |
||||
for (int channel = 0; channel < nbRx; channel++) { |
||||
device->set_rx_bandwidth(settings.m_rxLpfBW, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Rx LPF BW set to %f", settings.m_rxLpfBW); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
// Tx settings
|
||||
|
||||
if (applyTx && (nbTx > 0)) |
||||
{ |
||||
if (settingsKeys.contains("devSampleRate") || force) |
||||
{ |
||||
apply("Tx sample rate", [&]() { |
||||
for (int channel = 0; channel < nbTx; channel++) { |
||||
device->set_tx_rate(settings.m_devSampleRate, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Tx sample rate set to %d", settings.m_devSampleRate); |
||||
}); |
||||
checkRates = true; |
||||
reapplyTx = true; |
||||
} |
||||
|
||||
if (settingsKeys.contains("txCenterFrequency") |
||||
|| settingsKeys.contains("txLOOffset") |
||||
|| settingsKeys.contains("txTransverterMode") |
||||
|| settingsKeys.contains("txTransverterDeltaFrequency") |
||||
|| force) |
||||
{ |
||||
apply("Tx frequency", [&]() { |
||||
qint64 deviceCenterFrequency = settings.m_txCenterFrequency; |
||||
deviceCenterFrequency -= settings.m_txTransverterMode ? settings.m_txTransverterDeltaFrequency : 0; |
||||
deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency; |
||||
uhd::tune_request_t tuneRequest = settings.m_txLOOffset != 0 |
||||
? uhd::tune_request_t(deviceCenterFrequency, settings.m_txLOOffset) |
||||
: uhd::tune_request_t(deviceCenterFrequency); |
||||
|
||||
for (int channel = 0; channel < nbTx; channel++) { |
||||
device->set_tx_freq(tuneRequest, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Tx frequency set to %lld with LO offset %d", deviceCenterFrequency, settings.m_txLOOffset); |
||||
}); |
||||
} |
||||
|
||||
for (int channel = 0; channel < nbTx; channel++) |
||||
{ |
||||
QString prefix = QString("tx%1").arg(channel); |
||||
|
||||
if (settingsKeys.contains(prefix + "Gain") || force) { |
||||
apply("Tx gain", [&]() { device->set_tx_gain(txGain[channel], channel); }); |
||||
} |
||||
|
||||
if (settingsKeys.contains(prefix + "AntennaPath") || force) { |
||||
apply("Tx antenna", [&]() { device->set_tx_antenna(txAntenna[channel].toStdString(), channel); }); |
||||
} |
||||
} |
||||
|
||||
if (applyBandwidth && (settingsKeys.contains("txLpfBW") || force)) |
||||
{ |
||||
apply("Tx LPF bandwidth", [&]() { |
||||
for (int channel = 0; channel < nbTx; channel++) { |
||||
device->set_tx_bandwidth(settings.m_txLpfBW, channel); |
||||
} |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: Tx LPF BW set to %f", settings.m_txLpfBW); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
if (reenableAutoMasterClockRate) { |
||||
apply("automatic master clock rate", [&]() { DeviceUSRP::enableAutoMasterClockRate(device); }); |
||||
} |
||||
|
||||
// Need to re-set bandwidth and AGC after changing sample rate or clock source
|
||||
|
||||
if (applyBandwidth && applyRx && reapplyRx) |
||||
{ |
||||
for (int channel = 0; channel < nbRx; channel++) |
||||
{ |
||||
apply("Rx LPF bandwidth", [&]() { device->set_rx_bandwidth(settings.m_rxLpfBW, channel); }); |
||||
apply("Rx gain", [&]() { setRxGain(channel); }); |
||||
} |
||||
} |
||||
|
||||
if (applyBandwidth && applyTx && reapplyTx) |
||||
{ |
||||
for (int channel = 0; channel < nbTx; channel++) { |
||||
apply("Tx LPF bandwidth", [&]() { device->set_tx_bandwidth(settings.m_txLpfBW, channel); }); |
||||
} |
||||
} |
||||
|
||||
// Report what was actually set, so USRPMIMO can update its settings and the GUI
|
||||
double sampleRate = 0.0; |
||||
double masterClockRate = 0.0; |
||||
QString clockSource; |
||||
|
||||
if (checkRates) |
||||
{ |
||||
try |
||||
{ |
||||
sampleRate = DeviceUSRP::getSampleRate(device, nbRx > 0, 0); |
||||
masterClockRate = device->get_master_clock_rate(); |
||||
qDebug("USRPMIMOWorker::applyDeviceSettings: actual sample rate %f master_clock_rate %f", sampleRate, masterClockRate); |
||||
} |
||||
catch (std::exception &e) |
||||
{ |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: could not get sample rate: " << e.what(); |
||||
checkRates = false; |
||||
} |
||||
} |
||||
|
||||
if (checkClockSource) |
||||
{ |
||||
try |
||||
{ |
||||
clockSource = QString::fromStdString(device->get_clock_source(0)); |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: clock source is " << clockSource; |
||||
} |
||||
catch (std::exception &e) |
||||
{ |
||||
qDebug() << "USRPMIMOWorker::applyDeviceSettings: could not get clock source: " << e.what(); |
||||
checkClockSource = false; |
||||
} |
||||
} |
||||
|
||||
if ((checkRates || checkClockSource) && reportQueue) { |
||||
reportQueue->push(DeviceUSRPShared::MsgReportDeviceSettings::create(checkRates, sampleRate, masterClockRate, checkClockSource, clockSource, false)); |
||||
} |
||||
} |
||||
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWORKER_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWORKER_H_ |
||||
|
||||
#include <QObject> |
||||
|
||||
#include "util/messagequeue.h" |
||||
#include "usrpmimosettings.h" |
||||
|
||||
struct DeviceUSRPParams; |
||||
|
||||
/**
|
||||
* Applies settings to the device in its own thread, as some settings (E.g. sample rate, |
||||
* clock source and bandwidth) can take a long time to set, which would otherwise block the GUI. |
||||
* Values actually set are reported via DeviceUSRPShared::MsgReportDeviceSettings. |
||||
*/ |
||||
class USRPMIMOWorker : public QObject |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
USRPMIMOWorker(DeviceUSRPParams *deviceParams, int nbRx, int nbTx, MessageQueue *reportQueue); |
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } |
||||
|
||||
static void applyDeviceSettings( |
||||
DeviceUSRPParams *deviceParams, |
||||
int nbRx, |
||||
int nbTx, |
||||
const USRPMIMOSettings& settings, |
||||
const QList<QString>& settingsKeys, |
||||
bool force, |
||||
bool applyCommon, |
||||
bool applyRx, |
||||
bool applyTx, |
||||
bool applyBandwidth, |
||||
MessageQueue *reportQueue); |
||||
|
||||
private: |
||||
DeviceUSRPParams *m_deviceParams; |
||||
int m_nbRx; |
||||
int m_nbTx; |
||||
MessageQueue *m_reportQueue; //!< Where to send MsgReportDeviceSettings (USRPMIMO's input queue)
|
||||
MessageQueue m_inputMessageQueue; //!< Settings to apply to the device
|
||||
|
||||
private slots: |
||||
void handleInputMessages(); |
||||
}; |
||||
|
||||
#endif // PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMIMOWORKER_H_
|
||||
@ -0,0 +1,282 @@
@@ -0,0 +1,282 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 <algorithm> |
||||
|
||||
#include <QDebug> |
||||
|
||||
#include <uhd/types/stream_cmd.hpp> |
||||
#include <uhd/types/metadata.hpp> |
||||
|
||||
#include "dsp/samplemififo.h" |
||||
#include "usrp/deviceusrp.h" |
||||
|
||||
#include "usrpmithread.h" |
||||
|
||||
USRPMIThread::USRPMIThread(uhd::usrp::multi_usrp::sptr device, uhd::rx_streamer::sptr stream, size_t bufSamples, |
||||
int nbChannels, SampleMIFifo *sampleFifo, QObject* parent) : |
||||
QThread(parent), |
||||
m_running(false), |
||||
m_started(false), |
||||
m_runStarted(false), |
||||
m_packets(0), |
||||
m_overflows(0), |
||||
m_timeouts(0), |
||||
m_device(device), |
||||
m_stream(stream), |
||||
m_bufSamples(bufSamples), |
||||
m_nbChannels(std::min(nbChannels, m_maxChannels)), |
||||
m_sampleFifo(sampleFifo), |
||||
m_log2Decim(0) |
||||
{ |
||||
setObjectName("USRPMI"); |
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) |
||||
{ |
||||
// *2 as samples are I+Q
|
||||
m_buf.push_back(std::vector<qint16>(2 * m_bufSamples, 0)); |
||||
m_convertBuffer[channel].resize(m_bufSamples, Sample{0, 0}); |
||||
} |
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) { |
||||
m_bufPtrs.push_back(m_buf[channel].data()); |
||||
} |
||||
} |
||||
|
||||
USRPMIThread::~USRPMIThread() |
||||
{ |
||||
stopWork(); |
||||
} |
||||
|
||||
void USRPMIThread::issueStreamCmd(bool start) |
||||
{ |
||||
uhd::stream_cmd_t streamCmd(start ? uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS : uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); |
||||
streamCmd.num_samps = 0; |
||||
|
||||
if (start && (m_nbChannels > 1)) |
||||
{ |
||||
// Channels in a multi-channel stream need to be started at the same time, so they are aligned
|
||||
streamCmd.stream_now = false; |
||||
streamCmd.time_spec = m_device->get_time_now() + uhd::time_spec_t(0.05); |
||||
} |
||||
else |
||||
{ |
||||
streamCmd.stream_now = true; |
||||
} |
||||
|
||||
m_stream->issue_stream_cmd(streamCmd); |
||||
qDebug() << "USRPMIThread::issueStreamCmd:" << (start ? "start" : "stop"); |
||||
} |
||||
|
||||
void USRPMIThread::startWork() |
||||
{ |
||||
if (m_started) { |
||||
return; |
||||
} |
||||
|
||||
m_packets = 0; |
||||
m_overflows = 0; |
||||
m_timeouts = 0; |
||||
|
||||
try |
||||
{ |
||||
issueStreamCmd(true); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qWarning() << "USRPMIThread::startWork: exception: " << e.what(); |
||||
} |
||||
|
||||
// Wait for run() to start. Use a separate flag to m_running, as run() may exit immediately on error
|
||||
m_runStarted = false; |
||||
m_started = true; |
||||
m_startWaitMutex.lock(); |
||||
start(); |
||||
|
||||
while (!m_runStarted) { |
||||
m_startWaiter.wait(&m_startWaitMutex, 100); |
||||
} |
||||
|
||||
m_startWaitMutex.unlock(); |
||||
} |
||||
|
||||
void USRPMIThread::stopWork() |
||||
{ |
||||
if (!m_started) { |
||||
return; |
||||
} |
||||
|
||||
m_started = false; |
||||
m_running = false; |
||||
wait(); |
||||
|
||||
try |
||||
{ |
||||
issueStreamCmd(false); |
||||
flush(); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qWarning() << "USRPMIThread::stopWork: exception: " << e.what(); |
||||
} |
||||
} |
||||
|
||||
// Clear out any data left in the stream, otherwise we'll get an
|
||||
// exception 'recv buffer smaller than vrt packet offset' when restarting
|
||||
void USRPMIThread::flush() |
||||
{ |
||||
uhd::rx_metadata_t md; |
||||
const int maxFlushes = 1000; // In case device has been disconnected
|
||||
|
||||
md.end_of_burst = false; |
||||
md.error_code = uhd::rx_metadata_t::ERROR_CODE_NONE; |
||||
|
||||
for (int i = 0; (i < maxFlushes) && !md.end_of_burst && (md.error_code != uhd::rx_metadata_t::ERROR_CODE_TIMEOUT); i++) |
||||
{ |
||||
try |
||||
{ |
||||
md.reset(); |
||||
m_stream->recv(m_bufPtrs, m_bufSamples, md); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qDebug() << "USRPMIThread::flush: exception: " << e.what(); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
void USRPMIThread::run() |
||||
{ |
||||
uhd::rx_metadata_t md; |
||||
// First samples won't arrive until the timed start
|
||||
double timeout = 1.0; |
||||
|
||||
// Higher priority, so streaming isn't delayed by other threads
|
||||
DeviceUSRP::setStreamingThreadPriority(); |
||||
|
||||
m_running = true; |
||||
m_runStarted = true; |
||||
m_startWaiter.wakeAll(); |
||||
|
||||
try |
||||
{ |
||||
while (m_running) |
||||
{ |
||||
md.reset(); |
||||
const size_t samplesReceived = m_stream->recv(m_bufPtrs, m_bufSamples, md, timeout); |
||||
timeout = DeviceUSRP::m_streamTimeout; |
||||
|
||||
m_packets++; |
||||
|
||||
if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) |
||||
{ |
||||
qDebug("USRPMIThread::run: timeout - restarting"); |
||||
m_timeouts++; |
||||
issueStreamCmd(false); |
||||
issueStreamCmd(true); |
||||
timeout = 1.0; |
||||
} |
||||
else if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_OVERFLOW) |
||||
{ |
||||
m_overflows++; |
||||
} |
||||
else if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_ALIGNMENT) |
||||
{ |
||||
// Channels lose alignment when the device is reconfigured while streaming
|
||||
// (E.g. sample rate or clock source change, which resets the AD9361 on B2xx).
|
||||
// UHD can't recover from this itself, so restart with a timed start to realign them
|
||||
qDebug("USRPMIThread::run: multi-channel alignment failed - restarting"); |
||||
issueStreamCmd(false); |
||||
flush(); |
||||
issueStreamCmd(true); |
||||
timeout = 1.0; |
||||
continue; |
||||
} |
||||
else if (md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) |
||||
{ |
||||
qDebug() << "USRPMIThread::run: error: " << QString::fromStdString(md.strerror()); |
||||
} |
||||
|
||||
if (samplesReceived > 0) |
||||
{ |
||||
std::vector<SampleVector::const_iterator> vbegin; |
||||
int length = 0; |
||||
// Read once, as it can be changed from another thread, and the same value must be used for all channels
|
||||
const unsigned int log2Decim = m_log2Decim; |
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) |
||||
{ |
||||
int channelLength = channelCallback(m_buf[channel].data(), 2 * samplesReceived, channel, log2Decim); |
||||
length = channel == 0 ? channelLength : std::min(length, channelLength); |
||||
vbegin.push_back(m_convertBuffer[channel].begin()); |
||||
} |
||||
|
||||
m_sampleFifo->writeSync(vbegin, length); |
||||
} |
||||
} |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qWarning() << "USRPMIThread::run: exception: " << e.what(); |
||||
} |
||||
|
||||
m_running = false; |
||||
} |
||||
|
||||
// Decimate according to specified log2 (ex: log2=4 => decim=16). len is number of I and Q values
|
||||
int USRPMIThread::channelCallback(const qint16* buf, qint32 len, int channel, unsigned int log2Decim) |
||||
{ |
||||
SampleVector::iterator it = m_convertBuffer[channel].begin(); |
||||
|
||||
switch (log2Decim) |
||||
{ |
||||
case 0: |
||||
m_decimators[channel].decimate1(&it, buf, len); |
||||
break; |
||||
case 1: |
||||
m_decimators[channel].decimate2_cen(&it, buf, len); |
||||
break; |
||||
case 2: |
||||
m_decimators[channel].decimate4_cen(&it, buf, len); |
||||
break; |
||||
case 3: |
||||
m_decimators[channel].decimate8_cen(&it, buf, len); |
||||
break; |
||||
case 4: |
||||
m_decimators[channel].decimate16_cen(&it, buf, len); |
||||
break; |
||||
case 5: |
||||
m_decimators[channel].decimate32_cen(&it, buf, len); |
||||
break; |
||||
case 6: |
||||
m_decimators[channel].decimate64_cen(&it, buf, len); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
|
||||
return it - m_convertBuffer[channel].begin(); |
||||
} |
||||
|
||||
void USRPMIThread::getStreamStatus(bool& active, quint32& overflows, quint32& timeouts) |
||||
{ |
||||
active = m_packets > 0; |
||||
overflows = m_overflows; |
||||
timeouts = m_timeouts; |
||||
} |
||||
@ -0,0 +1,84 @@
@@ -0,0 +1,84 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMITHREAD_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMITHREAD_H_ |
||||
|
||||
#include <atomic> |
||||
#include <vector> |
||||
|
||||
#include <QThread> |
||||
#include <QMutex> |
||||
#include <QWaitCondition> |
||||
|
||||
#include <uhd/usrp/multi_usrp.hpp> |
||||
|
||||
#include "dsp/decimators.h" |
||||
|
||||
class SampleMIFifo; |
||||
|
||||
/**
|
||||
* Receives samples from all Rx channels of the device, using a single multi-channel |
||||
* stream, so samples from each channel are time aligned. |
||||
*/ |
||||
class USRPMIThread : public QThread { |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
static constexpr int m_maxChannels = 2; |
||||
|
||||
USRPMIThread(uhd::usrp::multi_usrp::sptr device, uhd::rx_streamer::sptr stream, size_t bufSamples, |
||||
int nbChannels, SampleMIFifo *sampleFifo, QObject* parent = nullptr); |
||||
~USRPMIThread(); |
||||
|
||||
void startWork(); |
||||
void stopWork(); |
||||
bool isRunning() const { return m_started; } |
||||
void setLog2Decimation(unsigned int log2Decim) { m_log2Decim = log2Decim; } |
||||
void getStreamStatus(bool& active, quint32& overflows, quint32& timeouts); |
||||
|
||||
private: |
||||
QMutex m_startWaitMutex; |
||||
QWaitCondition m_startWaiter; |
||||
std::atomic<bool> m_running; //!< Set while run() loop should continue
|
||||
std::atomic<bool> m_started; //!< Set from startWork() to stopWork()
|
||||
std::atomic<bool> m_runStarted; //!< Set when run() has started
|
||||
|
||||
std::atomic<quint64> m_packets; |
||||
std::atomic<quint32> m_overflows; |
||||
std::atomic<quint32> m_timeouts; |
||||
|
||||
uhd::usrp::multi_usrp::sptr m_device; |
||||
uhd::rx_streamer::sptr m_stream; |
||||
size_t m_bufSamples; |
||||
int m_nbChannels; |
||||
std::vector<std::vector<qint16>> m_buf; //!< Per channel buffers of interleaved I/Q
|
||||
std::vector<void *> m_bufPtrs; |
||||
SampleVector m_convertBuffer[m_maxChannels]; |
||||
SampleMIFifo *m_sampleFifo; |
||||
std::atomic<unsigned int> m_log2Decim; |
||||
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16, true> m_decimators[m_maxChannels]; |
||||
|
||||
void run(); |
||||
void issueStreamCmd(bool start); |
||||
void flush(); |
||||
int channelCallback(const qint16* buf, qint32 len, int channel, unsigned int log2Decim); |
||||
}; |
||||
|
||||
#endif // PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMITHREAD_H_
|
||||
@ -0,0 +1,321 @@
@@ -0,0 +1,321 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 <algorithm> |
||||
|
||||
#include <QDebug> |
||||
|
||||
#include <uhd/types/metadata.hpp> |
||||
|
||||
#include "dsp/samplemofifo.h" |
||||
#include "usrp/deviceusrpshared.h" |
||||
#include "usrp/deviceusrp.h" |
||||
|
||||
#include "usrpmothread.h" |
||||
|
||||
USRPMOThread::USRPMOThread(uhd::usrp::multi_usrp::sptr device, uhd::tx_streamer::sptr stream, size_t bufSamples, |
||||
int nbChannels, SampleMOFifo *sampleFifo, QObject* parent) : |
||||
QThread(parent), |
||||
m_running(false), |
||||
m_packets(0), |
||||
m_underflows(0), |
||||
m_droppedPackets(0), |
||||
m_device(device), |
||||
m_stream(stream), |
||||
m_bufSamples(bufSamples), |
||||
m_nbChannels(std::min(nbChannels, m_maxChannels)), |
||||
m_sampleFifo(sampleFifo), |
||||
m_log2Interp(0), |
||||
m_detached(false) |
||||
{ |
||||
setObjectName("USRPMO"); |
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) { |
||||
// *2 as samples are I+Q
|
||||
m_buf.push_back(std::vector<qint16>(2 * m_bufSamples, 0)); |
||||
} |
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) { |
||||
m_bufPtrs.push_back(m_buf[channel].data()); |
||||
} |
||||
|
||||
// Executes in the thread this object was created in (the device engine thread), not in run()
|
||||
connect(&m_inputMessageQueue, &MessageQueue::messageEnqueued, this, &USRPMOThread::handleInputMessages); |
||||
} |
||||
|
||||
USRPMOThread::~USRPMOThread() |
||||
{ |
||||
stopWork(); |
||||
} |
||||
|
||||
void USRPMOThread::startWork() |
||||
{ |
||||
if (m_running || !m_stream) { |
||||
return; |
||||
} |
||||
|
||||
m_packets = 0; |
||||
m_underflows = 0; |
||||
m_droppedPackets = 0; |
||||
|
||||
m_startWaitMutex.lock(); |
||||
start(); |
||||
|
||||
while (!m_running) { |
||||
m_startWaiter.wait(&m_startWaitMutex, 100); |
||||
} |
||||
|
||||
m_startWaitMutex.unlock(); |
||||
} |
||||
|
||||
void USRPMOThread::stopWork() |
||||
{ |
||||
if (!m_running) { |
||||
return; |
||||
} |
||||
|
||||
m_running = false; |
||||
wait(); |
||||
|
||||
try |
||||
{ |
||||
// Get message indicating underflow, so it doesn't appear if we restart
|
||||
uhd::async_metadata_t md; |
||||
m_stream->recv_async_msg(md); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qDebug() << "USRPMOThread::stopWork: exception: " << e.what(); |
||||
} |
||||
} |
||||
|
||||
// Release references to stream and device, so they're destroyed when the device is closed,
|
||||
// even if this object is deleted later. Thread must be stopped.
|
||||
void USRPMOThread::releaseStream() |
||||
{ |
||||
m_stream = nullptr; |
||||
m_device = nullptr; |
||||
} |
||||
|
||||
// Stop handling requests, waiting for any request being handled to complete.
|
||||
// Used when stopping from a thread other than the device engine thread (E.g. when USRPMIMO is being destroyed)
|
||||
void USRPMOThread::detach() |
||||
{ |
||||
QMutexLocker mutexLocker(&m_configMutex); |
||||
m_detached = true; |
||||
} |
||||
|
||||
void USRPMOThread::handleInputMessages() |
||||
{ |
||||
QMutexLocker mutexLocker(&m_configMutex); |
||||
Message* message; |
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != nullptr) |
||||
{ |
||||
if (!m_detached) |
||||
{ |
||||
if (DeviceUSRPShared::MsgResizeSampleFifo::match(*message)) { |
||||
resizeSampleFifo(((const DeviceUSRPShared::MsgResizeSampleFifo&) *message).getSize()); |
||||
} else { |
||||
qDebug("%s: unhandled message: %s", Q_FUNC_INFO, message->getIdentifier()); |
||||
} |
||||
} |
||||
|
||||
delete message; |
||||
} |
||||
} |
||||
|
||||
// Resize the sample FIFO. This executes in the device engine thread, which writes to the FIFO,
|
||||
// so the only other thread that accesses it is the streaming thread, which is paused while it is resized.
|
||||
void USRPMOThread::resizeSampleFifo(unsigned int size) |
||||
{ |
||||
bool wasRunning = m_running; |
||||
|
||||
if (wasRunning) { |
||||
stopWork(); |
||||
} |
||||
|
||||
m_sampleFifo->resize(size); |
||||
qDebug("USRPMOThread::resizeSampleFifo: %u", size); |
||||
|
||||
if (wasRunning) { |
||||
startWork(); |
||||
} |
||||
} |
||||
|
||||
void USRPMOThread::run() |
||||
{ |
||||
uhd::tx_metadata_t md; |
||||
md.end_of_burst = false; |
||||
|
||||
// Higher priority, so streaming isn't delayed by other threads
|
||||
DeviceUSRP::setStreamingThreadPriority(); |
||||
|
||||
if (m_nbChannels > 1) |
||||
{ |
||||
// Channels in a multi-channel stream need to be started at the same time, so they are aligned
|
||||
try |
||||
{ |
||||
md.start_of_burst = true; |
||||
md.has_time_spec = true; |
||||
md.time_spec = m_device->get_time_now() + uhd::time_spec_t(0.05); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qWarning() << "USRPMOThread::run: could not get time: " << e.what(); |
||||
md.start_of_burst = false; |
||||
md.has_time_spec = false; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
md.start_of_burst = false; |
||||
md.has_time_spec = false; |
||||
} |
||||
|
||||
m_running = true; |
||||
m_startWaiter.wakeAll(); |
||||
|
||||
while (m_running) |
||||
{ |
||||
unsigned int writtenSamples = callback(); |
||||
|
||||
try |
||||
{ |
||||
// First packet may not be sent until its time, so allow for that in timeout
|
||||
const size_t sentSamples = m_stream->send(m_bufPtrs, writtenSamples, md, md.has_time_spec ? 1.0 : DeviceUSRP::m_streamTimeout); |
||||
m_packets++; |
||||
|
||||
if (sentSamples != writtenSamples) { |
||||
qDebug("USRPMOThread::run: sent %zu/%u samples", sentSamples, writtenSamples); |
||||
} |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qDebug() << "USRPMOThread::run: exception: " << e.what(); |
||||
} |
||||
|
||||
md.start_of_burst = false; |
||||
md.has_time_spec = false; |
||||
} |
||||
|
||||
// End the burst, so the stream can be restarted cleanly
|
||||
try |
||||
{ |
||||
md.end_of_burst = true; |
||||
m_stream->send(m_bufPtrs, 0, md); |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qDebug() << "USRPMOThread::run: exception sending end of burst: " << e.what(); |
||||
} |
||||
|
||||
m_running = false; |
||||
} |
||||
|
||||
// Read and interpolate samples for all channels.
|
||||
// Returns number of samples written to each channel buffer, which may be less than the buffer size,
|
||||
// when the buffer size is not divisible by the interpolation factor.
|
||||
unsigned int USRPMOThread::callback() |
||||
{ |
||||
// Read once, as it can be changed from another thread, and the same value must be used for the whole buffer
|
||||
const unsigned int log2Interp = m_log2Interp; |
||||
const unsigned int interpolationFactor = 1U << log2Interp; |
||||
unsigned int iPart1Begin, iPart1End, iPart2Begin, iPart2End; |
||||
|
||||
m_sampleFifo->readSync(m_bufSamples / interpolationFactor, iPart1Begin, iPart1End, iPart2Begin, iPart2End); |
||||
|
||||
if (iPart1Begin != iPart1End) { |
||||
callbackPart(iPart1Begin, iPart1End - iPart1Begin, 0, log2Interp); |
||||
} |
||||
|
||||
if (iPart2Begin != iPart2End) { |
||||
callbackPart(iPart2Begin, iPart2End - iPart2Begin, (iPart1End - iPart1Begin) * interpolationFactor, log2Interp); |
||||
} |
||||
|
||||
return ((iPart1End - iPart1Begin) + (iPart2End - iPart2Begin)) * interpolationFactor; |
||||
} |
||||
|
||||
// Interpolate nSamples from FIFO starting at iBegin, into each channel buffer, starting at sample offset
|
||||
void USRPMOThread::callbackPart(unsigned int iBegin, unsigned int nSamples, unsigned int offset, unsigned int log2Interp) |
||||
{ |
||||
const int len = 2 * nSamples * (1 << log2Interp); // Number of I and Q values output
|
||||
|
||||
for (int channel = 0; channel < m_nbChannels; channel++) |
||||
{ |
||||
SampleVector::iterator begin = m_sampleFifo->getData(channel).begin() + iBegin; |
||||
qint16 *buf = &m_buf[channel][2 * offset]; |
||||
|
||||
switch (log2Interp) |
||||
{ |
||||
case 0: |
||||
m_interpolators[channel].interpolate1(&begin, buf, len); |
||||
break; |
||||
case 1: |
||||
m_interpolators[channel].interpolate2_cen(&begin, buf, len); |
||||
break; |
||||
case 2: |
||||
m_interpolators[channel].interpolate4_cen(&begin, buf, len); |
||||
break; |
||||
case 3: |
||||
m_interpolators[channel].interpolate8_cen(&begin, buf, len); |
||||
break; |
||||
case 4: |
||||
m_interpolators[channel].interpolate16_cen(&begin, buf, len); |
||||
break; |
||||
case 5: |
||||
m_interpolators[channel].interpolate32_cen(&begin, buf, len); |
||||
break; |
||||
case 6: |
||||
m_interpolators[channel].interpolate64_cen(&begin, buf, len); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// Called from GUI thread
|
||||
void USRPMOThread::getStreamStatus(bool& active, quint32& underflows, quint32& droppedPackets) |
||||
{ |
||||
uhd::async_metadata_t md; |
||||
|
||||
// Don't wait for messages (default timeout is 0.1s), and drain all pending messages
|
||||
try |
||||
{ |
||||
while (m_stream && m_stream->recv_async_msg(md, 0.0)) |
||||
{ |
||||
if ((md.event_code & uhd::async_metadata_t::EVENT_CODE_UNDERFLOW) |
||||
|| (md.event_code & uhd::async_metadata_t::EVENT_CODE_UNDERFLOW_IN_PACKET)) { |
||||
m_underflows++; |
||||
} |
||||
if ((md.event_code & uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR) |
||||
|| (md.event_code & uhd::async_metadata_t::EVENT_CODE_SEQ_ERROR_IN_BURST)) { |
||||
m_droppedPackets++; |
||||
} |
||||
} |
||||
} |
||||
catch (std::exception& e) |
||||
{ |
||||
qDebug() << "USRPMOThread::getStreamStatus: exception: " << e.what(); |
||||
} |
||||
|
||||
active = m_packets > 0; |
||||
underflows = m_underflows; |
||||
droppedPackets = m_droppedPackets; |
||||
} |
||||
@ -0,0 +1,97 @@
@@ -0,0 +1,97 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2026 Jon Beniston, M7RCE <jon@beniston.com> //
|
||||
// Some code by AI //
|
||||
// //
|
||||
// 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 PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMOTHREAD_H_ |
||||
#define PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMOTHREAD_H_ |
||||
|
||||
#include <atomic> |
||||
#include <vector> |
||||
|
||||
#include <QThread> |
||||
#include <QMutex> |
||||
#include <QWaitCondition> |
||||
|
||||
#include <uhd/usrp/multi_usrp.hpp> |
||||
|
||||
#include "dsp/interpolators.h" |
||||
#include "util/messagequeue.h" |
||||
|
||||
class SampleMOFifo; |
||||
|
||||
/**
|
||||
* Sends samples to all Tx channels of the device, using a single multi-channel |
||||
* stream, so samples for each channel are time aligned. |
||||
* |
||||
* As this object is created in USRPMIMO::startTx(), which is called from the device engine thread, |
||||
* its slots execute in the device engine thread, which is where samples are written to the FIFO. |
||||
* This allows the FIFO to be resized safely (See MsgResizeSampleFifo). |
||||
*/ |
||||
class USRPMOThread : public QThread { |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
static constexpr int m_maxChannels = 2; |
||||
|
||||
USRPMOThread(uhd::usrp::multi_usrp::sptr device, uhd::tx_streamer::sptr stream, size_t bufSamples, |
||||
int nbChannels, SampleMOFifo *sampleFifo, QObject* parent = nullptr); |
||||
~USRPMOThread(); |
||||
|
||||
void startWork(); |
||||
void stopWork(); |
||||
bool isRunning() const { return m_running; } |
||||
void setLog2Interpolation(unsigned int log2Interp) { m_log2Interp = log2Interp; } |
||||
void getStreamStatus(bool& active, quint32& underflows, quint32& droppedPackets); |
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } |
||||
void detach(); |
||||
void releaseStream(); |
||||
|
||||
private: |
||||
QMutex m_startWaitMutex; |
||||
QWaitCondition m_startWaiter; |
||||
std::atomic<bool> m_running; |
||||
|
||||
std::atomic<quint64> m_packets; |
||||
quint32 m_underflows; |
||||
quint32 m_droppedPackets; |
||||
|
||||
uhd::usrp::multi_usrp::sptr m_device; |
||||
uhd::tx_streamer::sptr m_stream; |
||||
size_t m_bufSamples; |
||||
int m_nbChannels; |
||||
std::vector<std::vector<qint16>> m_buf; //!< Per channel buffers of interleaved I/Q
|
||||
std::vector<const void *> m_bufPtrs; |
||||
SampleMOFifo *m_sampleFifo; |
||||
std::atomic<unsigned int> m_log2Interp; |
||||
|
||||
//!< UHD's sc16 format is 16-bit, converted by UHD to device wire format (E.g. 12-bit for B2xx)
|
||||
Interpolators<qint16, SDR_TX_SAMP_SZ, 16> m_interpolators[m_maxChannels]; |
||||
|
||||
MessageQueue m_inputMessageQueue; //!< Requests to execute in device engine thread
|
||||
QMutex m_configMutex; //!< Held while handling requests, so detach() can wait for them to complete
|
||||
bool m_detached; //!< When set, no longer handle requests
|
||||
|
||||
void run(); |
||||
unsigned int callback(); |
||||
void callbackPart(unsigned int iBegin, unsigned int nSamples, unsigned int offset, unsigned int log2Interp); |
||||
void resizeSampleFifo(unsigned int size); |
||||
|
||||
private slots: |
||||
void handleInputMessages(); |
||||
}; |
||||
|
||||
#endif // PLUGINS_SAMPLEMIMO_USRPMIMO_USRPMOTHREAD_H_
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,292 @@
@@ -0,0 +1,292 @@
|
||||
/**
|
||||
* 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 "SWGUSRPMIMOReport.h" |
||||
|
||||
#include "SWGHelpers.h" |
||||
|
||||
#include <QJsonDocument> |
||||
#include <QJsonArray> |
||||
#include <QObject> |
||||
#include <QDebug> |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
SWGUSRPMIMOReport::SWGUSRPMIMOReport(QString* json) { |
||||
init(); |
||||
this->fromJson(*json); |
||||
} |
||||
|
||||
SWGUSRPMIMOReport::SWGUSRPMIMOReport() { |
||||
success = 0; |
||||
m_success_isSet = false; |
||||
rx_stream_active = 0; |
||||
m_rx_stream_active_isSet = false; |
||||
rx_overrun_count = 0; |
||||
m_rx_overrun_count_isSet = false; |
||||
rx_timeout_count = 0; |
||||
m_rx_timeout_count_isSet = false; |
||||
tx_stream_active = 0; |
||||
m_tx_stream_active_isSet = false; |
||||
tx_underrun_count = 0; |
||||
m_tx_underrun_count_isSet = false; |
||||
tx_dropped_packets_count = 0; |
||||
m_tx_dropped_packets_count_isSet = false; |
||||
master_clock_rate = 0; |
||||
m_master_clock_rate_isSet = false; |
||||
temperature = 0.0f; |
||||
m_temperature_isSet = false; |
||||
} |
||||
|
||||
SWGUSRPMIMOReport::~SWGUSRPMIMOReport() { |
||||
this->cleanup(); |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOReport::init() { |
||||
success = 0; |
||||
m_success_isSet = false; |
||||
rx_stream_active = 0; |
||||
m_rx_stream_active_isSet = false; |
||||
rx_overrun_count = 0; |
||||
m_rx_overrun_count_isSet = false; |
||||
rx_timeout_count = 0; |
||||
m_rx_timeout_count_isSet = false; |
||||
tx_stream_active = 0; |
||||
m_tx_stream_active_isSet = false; |
||||
tx_underrun_count = 0; |
||||
m_tx_underrun_count_isSet = false; |
||||
tx_dropped_packets_count = 0; |
||||
m_tx_dropped_packets_count_isSet = false; |
||||
master_clock_rate = 0; |
||||
m_master_clock_rate_isSet = false; |
||||
temperature = 0.0f; |
||||
m_temperature_isSet = false; |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOReport::cleanup() { |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
SWGUSRPMIMOReport* |
||||
SWGUSRPMIMOReport::fromJson(QString &json) { |
||||
QByteArray array (json.toStdString().c_str()); |
||||
QJsonDocument doc = QJsonDocument::fromJson(array); |
||||
QJsonObject jsonObject = doc.object(); |
||||
this->fromJsonObject(jsonObject); |
||||
return this; |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOReport::fromJsonObject(QJsonObject &pJson) { |
||||
::SWGSDRangel::setValue(&success, pJson["success"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_stream_active, pJson["rxStreamActive"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_overrun_count, pJson["rxOverrunCount"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_timeout_count, pJson["rxTimeoutCount"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_stream_active, pJson["txStreamActive"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_underrun_count, pJson["txUnderrunCount"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_dropped_packets_count, pJson["txDroppedPacketsCount"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&master_clock_rate, pJson["masterClockRate"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&temperature, pJson["temperature"], "float", ""); |
||||
|
||||
} |
||||
|
||||
QString |
||||
SWGUSRPMIMOReport::asJson () |
||||
{ |
||||
QJsonObject* obj = this->asJsonObject(); |
||||
|
||||
QJsonDocument doc(*obj); |
||||
QByteArray bytes = doc.toJson(); |
||||
delete obj; |
||||
return QString(bytes); |
||||
} |
||||
|
||||
QJsonObject* |
||||
SWGUSRPMIMOReport::asJsonObject() { |
||||
QJsonObject* obj = new QJsonObject(); |
||||
if(m_success_isSet){ |
||||
obj->insert("success", QJsonValue(success)); |
||||
} |
||||
if(m_rx_stream_active_isSet){ |
||||
obj->insert("rxStreamActive", QJsonValue(rx_stream_active)); |
||||
} |
||||
if(m_rx_overrun_count_isSet){ |
||||
obj->insert("rxOverrunCount", QJsonValue(rx_overrun_count)); |
||||
} |
||||
if(m_rx_timeout_count_isSet){ |
||||
obj->insert("rxTimeoutCount", QJsonValue(rx_timeout_count)); |
||||
} |
||||
if(m_tx_stream_active_isSet){ |
||||
obj->insert("txStreamActive", QJsonValue(tx_stream_active)); |
||||
} |
||||
if(m_tx_underrun_count_isSet){ |
||||
obj->insert("txUnderrunCount", QJsonValue(tx_underrun_count)); |
||||
} |
||||
if(m_tx_dropped_packets_count_isSet){ |
||||
obj->insert("txDroppedPacketsCount", QJsonValue(tx_dropped_packets_count)); |
||||
} |
||||
if(m_master_clock_rate_isSet){ |
||||
obj->insert("masterClockRate", QJsonValue(master_clock_rate)); |
||||
} |
||||
if(m_temperature_isSet){ |
||||
obj->insert("temperature", QJsonValue(temperature)); |
||||
} |
||||
|
||||
return obj; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getSuccess() { |
||||
return success; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setSuccess(qint32 success) { |
||||
this->success = success; |
||||
this->m_success_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getRxStreamActive() { |
||||
return rx_stream_active; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setRxStreamActive(qint32 rx_stream_active) { |
||||
this->rx_stream_active = rx_stream_active; |
||||
this->m_rx_stream_active_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getRxOverrunCount() { |
||||
return rx_overrun_count; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setRxOverrunCount(qint32 rx_overrun_count) { |
||||
this->rx_overrun_count = rx_overrun_count; |
||||
this->m_rx_overrun_count_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getRxTimeoutCount() { |
||||
return rx_timeout_count; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setRxTimeoutCount(qint32 rx_timeout_count) { |
||||
this->rx_timeout_count = rx_timeout_count; |
||||
this->m_rx_timeout_count_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getTxStreamActive() { |
||||
return tx_stream_active; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setTxStreamActive(qint32 tx_stream_active) { |
||||
this->tx_stream_active = tx_stream_active; |
||||
this->m_tx_stream_active_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getTxUnderrunCount() { |
||||
return tx_underrun_count; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setTxUnderrunCount(qint32 tx_underrun_count) { |
||||
this->tx_underrun_count = tx_underrun_count; |
||||
this->m_tx_underrun_count_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getTxDroppedPacketsCount() { |
||||
return tx_dropped_packets_count; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setTxDroppedPacketsCount(qint32 tx_dropped_packets_count) { |
||||
this->tx_dropped_packets_count = tx_dropped_packets_count; |
||||
this->m_tx_dropped_packets_count_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOReport::getMasterClockRate() { |
||||
return master_clock_rate; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setMasterClockRate(qint32 master_clock_rate) { |
||||
this->master_clock_rate = master_clock_rate; |
||||
this->m_master_clock_rate_isSet = true; |
||||
} |
||||
|
||||
float |
||||
SWGUSRPMIMOReport::getTemperature() { |
||||
return temperature; |
||||
} |
||||
void |
||||
SWGUSRPMIMOReport::setTemperature(float temperature) { |
||||
this->temperature = temperature; |
||||
this->m_temperature_isSet = true; |
||||
} |
||||
|
||||
|
||||
bool |
||||
SWGUSRPMIMOReport::isSet(){ |
||||
bool isObjectUpdated = false; |
||||
do{ |
||||
if(m_success_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_stream_active_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_overrun_count_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_timeout_count_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_stream_active_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_underrun_count_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_dropped_packets_count_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_master_clock_rate_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_temperature_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
}while(false); |
||||
return isObjectUpdated; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,106 @@
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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. |
||||
*/ |
||||
|
||||
/*
|
||||
* SWGUSRPMIMOReport.h |
||||
* |
||||
* USRP |
||||
*/ |
||||
|
||||
#ifndef SWGUSRPMIMOReport_H_ |
||||
#define SWGUSRPMIMOReport_H_ |
||||
|
||||
#include <QJsonObject> |
||||
|
||||
|
||||
|
||||
#include "SWGObject.h" |
||||
#include "export.h" |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
class SWG_API SWGUSRPMIMOReport: public SWGObject { |
||||
public: |
||||
SWGUSRPMIMOReport(); |
||||
SWGUSRPMIMOReport(QString* json); |
||||
virtual ~SWGUSRPMIMOReport(); |
||||
void init(); |
||||
void cleanup(); |
||||
|
||||
virtual QString asJson () override; |
||||
virtual QJsonObject* asJsonObject() override; |
||||
virtual void fromJsonObject(QJsonObject &json) override; |
||||
virtual SWGUSRPMIMOReport* fromJson(QString &jsonString) override; |
||||
|
||||
qint32 getSuccess(); |
||||
void setSuccess(qint32 success); |
||||
|
||||
qint32 getRxStreamActive(); |
||||
void setRxStreamActive(qint32 rx_stream_active); |
||||
|
||||
qint32 getRxOverrunCount(); |
||||
void setRxOverrunCount(qint32 rx_overrun_count); |
||||
|
||||
qint32 getRxTimeoutCount(); |
||||
void setRxTimeoutCount(qint32 rx_timeout_count); |
||||
|
||||
qint32 getTxStreamActive(); |
||||
void setTxStreamActive(qint32 tx_stream_active); |
||||
|
||||
qint32 getTxUnderrunCount(); |
||||
void setTxUnderrunCount(qint32 tx_underrun_count); |
||||
|
||||
qint32 getTxDroppedPacketsCount(); |
||||
void setTxDroppedPacketsCount(qint32 tx_dropped_packets_count); |
||||
|
||||
qint32 getMasterClockRate(); |
||||
void setMasterClockRate(qint32 master_clock_rate); |
||||
|
||||
float getTemperature(); |
||||
void setTemperature(float temperature); |
||||
|
||||
|
||||
virtual bool isSet() override; |
||||
|
||||
private: |
||||
qint32 success; |
||||
bool m_success_isSet; |
||||
|
||||
qint32 rx_stream_active; |
||||
bool m_rx_stream_active_isSet; |
||||
|
||||
qint32 rx_overrun_count; |
||||
bool m_rx_overrun_count_isSet; |
||||
|
||||
qint32 rx_timeout_count; |
||||
bool m_rx_timeout_count_isSet; |
||||
|
||||
qint32 tx_stream_active; |
||||
bool m_tx_stream_active_isSet; |
||||
|
||||
qint32 tx_underrun_count; |
||||
bool m_tx_underrun_count_isSet; |
||||
|
||||
qint32 tx_dropped_packets_count; |
||||
bool m_tx_dropped_packets_count_isSet; |
||||
|
||||
qint32 master_clock_rate; |
||||
bool m_master_clock_rate_isSet; |
||||
|
||||
float temperature; |
||||
bool m_temperature_isSet; |
||||
|
||||
}; |
||||
|
||||
} |
||||
|
||||
#endif /* SWGUSRPMIMOReport_H_ */ |
||||
@ -0,0 +1,858 @@
@@ -0,0 +1,858 @@
|
||||
/**
|
||||
* 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 "SWGUSRPMIMOSettings.h" |
||||
|
||||
#include "SWGHelpers.h" |
||||
|
||||
#include <QJsonDocument> |
||||
#include <QJsonArray> |
||||
#include <QObject> |
||||
#include <QDebug> |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
SWGUSRPMIMOSettings::SWGUSRPMIMOSettings(QString* json) { |
||||
init(); |
||||
this->fromJson(*json); |
||||
} |
||||
|
||||
SWGUSRPMIMOSettings::SWGUSRPMIMOSettings() { |
||||
title = nullptr; |
||||
m_title_isSet = false; |
||||
dev_sample_rate = 0; |
||||
m_dev_sample_rate_isSet = false; |
||||
clock_source = nullptr; |
||||
m_clock_source_isSet = false; |
||||
gpio_dir = 0; |
||||
m_gpio_dir_isSet = false; |
||||
gpio_pins = 0; |
||||
m_gpio_pins_isSet = false; |
||||
rx_center_frequency = 0L; |
||||
m_rx_center_frequency_isSet = false; |
||||
rx_lo_offset = 0; |
||||
m_rx_lo_offset_isSet = false; |
||||
log2_soft_decim = 0; |
||||
m_log2_soft_decim_isSet = false; |
||||
rx_lpf_bw = 0; |
||||
m_rx_lpf_bw_isSet = false; |
||||
dc_block = 0; |
||||
m_dc_block_isSet = false; |
||||
iq_correction = 0; |
||||
m_iq_correction_isSet = false; |
||||
rx_transverter_mode = 0; |
||||
m_rx_transverter_mode_isSet = false; |
||||
rx_transverter_delta_frequency = 0L; |
||||
m_rx_transverter_delta_frequency_isSet = false; |
||||
rx0_gain_mode = 0; |
||||
m_rx0_gain_mode_isSet = false; |
||||
rx0_gain = 0; |
||||
m_rx0_gain_isSet = false; |
||||
rx0_antenna_path = nullptr; |
||||
m_rx0_antenna_path_isSet = false; |
||||
rx1_gain_mode = 0; |
||||
m_rx1_gain_mode_isSet = false; |
||||
rx1_gain = 0; |
||||
m_rx1_gain_isSet = false; |
||||
rx1_antenna_path = nullptr; |
||||
m_rx1_antenna_path_isSet = false; |
||||
tx_center_frequency = 0L; |
||||
m_tx_center_frequency_isSet = false; |
||||
tx_lo_offset = 0; |
||||
m_tx_lo_offset_isSet = false; |
||||
log2_soft_interp = 0; |
||||
m_log2_soft_interp_isSet = false; |
||||
tx_lpf_bw = 0; |
||||
m_tx_lpf_bw_isSet = false; |
||||
tx_transverter_mode = 0; |
||||
m_tx_transverter_mode_isSet = false; |
||||
tx_transverter_delta_frequency = 0L; |
||||
m_tx_transverter_delta_frequency_isSet = false; |
||||
tx0_gain = 0; |
||||
m_tx0_gain_isSet = false; |
||||
tx0_antenna_path = nullptr; |
||||
m_tx0_antenna_path_isSet = false; |
||||
tx1_gain = 0; |
||||
m_tx1_gain_isSet = false; |
||||
tx1_antenna_path = nullptr; |
||||
m_tx1_antenna_path_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; |
||||
} |
||||
|
||||
SWGUSRPMIMOSettings::~SWGUSRPMIMOSettings() { |
||||
this->cleanup(); |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOSettings::init() { |
||||
title = new QString(""); |
||||
m_title_isSet = false; |
||||
dev_sample_rate = 0; |
||||
m_dev_sample_rate_isSet = false; |
||||
clock_source = new QString(""); |
||||
m_clock_source_isSet = false; |
||||
gpio_dir = 0; |
||||
m_gpio_dir_isSet = false; |
||||
gpio_pins = 0; |
||||
m_gpio_pins_isSet = false; |
||||
rx_center_frequency = 0L; |
||||
m_rx_center_frequency_isSet = false; |
||||
rx_lo_offset = 0; |
||||
m_rx_lo_offset_isSet = false; |
||||
log2_soft_decim = 0; |
||||
m_log2_soft_decim_isSet = false; |
||||
rx_lpf_bw = 0; |
||||
m_rx_lpf_bw_isSet = false; |
||||
dc_block = 0; |
||||
m_dc_block_isSet = false; |
||||
iq_correction = 0; |
||||
m_iq_correction_isSet = false; |
||||
rx_transverter_mode = 0; |
||||
m_rx_transverter_mode_isSet = false; |
||||
rx_transverter_delta_frequency = 0L; |
||||
m_rx_transverter_delta_frequency_isSet = false; |
||||
rx0_gain_mode = 0; |
||||
m_rx0_gain_mode_isSet = false; |
||||
rx0_gain = 0; |
||||
m_rx0_gain_isSet = false; |
||||
rx0_antenna_path = new QString(""); |
||||
m_rx0_antenna_path_isSet = false; |
||||
rx1_gain_mode = 0; |
||||
m_rx1_gain_mode_isSet = false; |
||||
rx1_gain = 0; |
||||
m_rx1_gain_isSet = false; |
||||
rx1_antenna_path = new QString(""); |
||||
m_rx1_antenna_path_isSet = false; |
||||
tx_center_frequency = 0L; |
||||
m_tx_center_frequency_isSet = false; |
||||
tx_lo_offset = 0; |
||||
m_tx_lo_offset_isSet = false; |
||||
log2_soft_interp = 0; |
||||
m_log2_soft_interp_isSet = false; |
||||
tx_lpf_bw = 0; |
||||
m_tx_lpf_bw_isSet = false; |
||||
tx_transverter_mode = 0; |
||||
m_tx_transverter_mode_isSet = false; |
||||
tx_transverter_delta_frequency = 0L; |
||||
m_tx_transverter_delta_frequency_isSet = false; |
||||
tx0_gain = 0; |
||||
m_tx0_gain_isSet = false; |
||||
tx0_antenna_path = new QString(""); |
||||
m_tx0_antenna_path_isSet = false; |
||||
tx1_gain = 0; |
||||
m_tx1_gain_isSet = false; |
||||
tx1_antenna_path = new QString(""); |
||||
m_tx1_antenna_path_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; |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOSettings::cleanup() { |
||||
if(title != nullptr) {
|
||||
delete title; |
||||
} |
||||
|
||||
if(clock_source != nullptr) {
|
||||
delete clock_source; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(rx0_antenna_path != nullptr) {
|
||||
delete rx0_antenna_path; |
||||
} |
||||
|
||||
|
||||
if(rx1_antenna_path != nullptr) {
|
||||
delete rx1_antenna_path; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(tx0_antenna_path != nullptr) {
|
||||
delete tx0_antenna_path; |
||||
} |
||||
|
||||
if(tx1_antenna_path != nullptr) {
|
||||
delete tx1_antenna_path; |
||||
} |
||||
|
||||
if(reverse_api_address != nullptr) {
|
||||
delete reverse_api_address; |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
SWGUSRPMIMOSettings* |
||||
SWGUSRPMIMOSettings::fromJson(QString &json) { |
||||
QByteArray array (json.toStdString().c_str()); |
||||
QJsonDocument doc = QJsonDocument::fromJson(array); |
||||
QJsonObject jsonObject = doc.object(); |
||||
this->fromJsonObject(jsonObject); |
||||
return this; |
||||
} |
||||
|
||||
void |
||||
SWGUSRPMIMOSettings::fromJsonObject(QJsonObject &pJson) { |
||||
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); |
||||
|
||||
::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&clock_source, pJson["clockSource"], "QString", "QString"); |
||||
|
||||
::SWGSDRangel::setValue(&gpio_dir, pJson["gpioDir"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&gpio_pins, pJson["gpioPins"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_center_frequency, pJson["rxCenterFrequency"], "qint64", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_lo_offset, pJson["rxLOOffset"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&log2_soft_decim, pJson["log2SoftDecim"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_lpf_bw, pJson["rxLpfBW"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_transverter_mode, pJson["rxTransverterMode"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx_transverter_delta_frequency, pJson["rxTransverterDeltaFrequency"], "qint64", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx0_gain_mode, pJson["rx0GainMode"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx0_gain, pJson["rx0Gain"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx0_antenna_path, pJson["rx0AntennaPath"], "QString", "QString"); |
||||
|
||||
::SWGSDRangel::setValue(&rx1_gain_mode, pJson["rx1GainMode"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx1_gain, pJson["rx1Gain"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&rx1_antenna_path, pJson["rx1AntennaPath"], "QString", "QString"); |
||||
|
||||
::SWGSDRangel::setValue(&tx_center_frequency, pJson["txCenterFrequency"], "qint64", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_lo_offset, pJson["txLOOffset"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&log2_soft_interp, pJson["log2SoftInterp"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_lpf_bw, pJson["txLpfBW"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_transverter_mode, pJson["txTransverterMode"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx_transverter_delta_frequency, pJson["txTransverterDeltaFrequency"], "qint64", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx0_gain, pJson["tx0Gain"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx0_antenna_path, pJson["tx0AntennaPath"], "QString", "QString"); |
||||
|
||||
::SWGSDRangel::setValue(&tx1_gain, pJson["tx1Gain"], "qint32", ""); |
||||
|
||||
::SWGSDRangel::setValue(&tx1_antenna_path, pJson["tx1AntennaPath"], "QString", "QString"); |
||||
|
||||
::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", ""); |
||||
|
||||
} |
||||
|
||||
QString |
||||
SWGUSRPMIMOSettings::asJson () |
||||
{ |
||||
QJsonObject* obj = this->asJsonObject(); |
||||
|
||||
QJsonDocument doc(*obj); |
||||
QByteArray bytes = doc.toJson(); |
||||
delete obj; |
||||
return QString(bytes); |
||||
} |
||||
|
||||
QJsonObject* |
||||
SWGUSRPMIMOSettings::asJsonObject() { |
||||
QJsonObject* obj = new QJsonObject(); |
||||
if(title != nullptr && *title != QString("")){ |
||||
toJsonValue(QString("title"), title, obj, QString("QString")); |
||||
} |
||||
if(m_dev_sample_rate_isSet){ |
||||
obj->insert("devSampleRate", QJsonValue(dev_sample_rate)); |
||||
} |
||||
if(clock_source != nullptr && *clock_source != QString("")){ |
||||
toJsonValue(QString("clockSource"), clock_source, obj, QString("QString")); |
||||
} |
||||
if(m_gpio_dir_isSet){ |
||||
obj->insert("gpioDir", QJsonValue(gpio_dir)); |
||||
} |
||||
if(m_gpio_pins_isSet){ |
||||
obj->insert("gpioPins", QJsonValue(gpio_pins)); |
||||
} |
||||
if(m_rx_center_frequency_isSet){ |
||||
obj->insert("rxCenterFrequency", QJsonValue(rx_center_frequency)); |
||||
} |
||||
if(m_rx_lo_offset_isSet){ |
||||
obj->insert("rxLOOffset", QJsonValue(rx_lo_offset)); |
||||
} |
||||
if(m_log2_soft_decim_isSet){ |
||||
obj->insert("log2SoftDecim", QJsonValue(log2_soft_decim)); |
||||
} |
||||
if(m_rx_lpf_bw_isSet){ |
||||
obj->insert("rxLpfBW", QJsonValue(rx_lpf_bw)); |
||||
} |
||||
if(m_dc_block_isSet){ |
||||
obj->insert("dcBlock", QJsonValue(dc_block)); |
||||
} |
||||
if(m_iq_correction_isSet){ |
||||
obj->insert("iqCorrection", QJsonValue(iq_correction)); |
||||
} |
||||
if(m_rx_transverter_mode_isSet){ |
||||
obj->insert("rxTransverterMode", QJsonValue(rx_transverter_mode)); |
||||
} |
||||
if(m_rx_transverter_delta_frequency_isSet){ |
||||
obj->insert("rxTransverterDeltaFrequency", QJsonValue(rx_transverter_delta_frequency)); |
||||
} |
||||
if(m_rx0_gain_mode_isSet){ |
||||
obj->insert("rx0GainMode", QJsonValue(rx0_gain_mode)); |
||||
} |
||||
if(m_rx0_gain_isSet){ |
||||
obj->insert("rx0Gain", QJsonValue(rx0_gain)); |
||||
} |
||||
if(rx0_antenna_path != nullptr && *rx0_antenna_path != QString("")){ |
||||
toJsonValue(QString("rx0AntennaPath"), rx0_antenna_path, obj, QString("QString")); |
||||
} |
||||
if(m_rx1_gain_mode_isSet){ |
||||
obj->insert("rx1GainMode", QJsonValue(rx1_gain_mode)); |
||||
} |
||||
if(m_rx1_gain_isSet){ |
||||
obj->insert("rx1Gain", QJsonValue(rx1_gain)); |
||||
} |
||||
if(rx1_antenna_path != nullptr && *rx1_antenna_path != QString("")){ |
||||
toJsonValue(QString("rx1AntennaPath"), rx1_antenna_path, obj, QString("QString")); |
||||
} |
||||
if(m_tx_center_frequency_isSet){ |
||||
obj->insert("txCenterFrequency", QJsonValue(tx_center_frequency)); |
||||
} |
||||
if(m_tx_lo_offset_isSet){ |
||||
obj->insert("txLOOffset", QJsonValue(tx_lo_offset)); |
||||
} |
||||
if(m_log2_soft_interp_isSet){ |
||||
obj->insert("log2SoftInterp", QJsonValue(log2_soft_interp)); |
||||
} |
||||
if(m_tx_lpf_bw_isSet){ |
||||
obj->insert("txLpfBW", QJsonValue(tx_lpf_bw)); |
||||
} |
||||
if(m_tx_transverter_mode_isSet){ |
||||
obj->insert("txTransverterMode", QJsonValue(tx_transverter_mode)); |
||||
} |
||||
if(m_tx_transverter_delta_frequency_isSet){ |
||||
obj->insert("txTransverterDeltaFrequency", QJsonValue(tx_transverter_delta_frequency)); |
||||
} |
||||
if(m_tx0_gain_isSet){ |
||||
obj->insert("tx0Gain", QJsonValue(tx0_gain)); |
||||
} |
||||
if(tx0_antenna_path != nullptr && *tx0_antenna_path != QString("")){ |
||||
toJsonValue(QString("tx0AntennaPath"), tx0_antenna_path, obj, QString("QString")); |
||||
} |
||||
if(m_tx1_gain_isSet){ |
||||
obj->insert("tx1Gain", QJsonValue(tx1_gain)); |
||||
} |
||||
if(tx1_antenna_path != nullptr && *tx1_antenna_path != QString("")){ |
||||
toJsonValue(QString("tx1AntennaPath"), tx1_antenna_path, obj, QString("QString")); |
||||
} |
||||
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)); |
||||
} |
||||
|
||||
return obj; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getTitle() { |
||||
return title; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTitle(QString* title) { |
||||
this->title = title; |
||||
this->m_title_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getDevSampleRate() { |
||||
return dev_sample_rate; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setDevSampleRate(qint32 dev_sample_rate) { |
||||
this->dev_sample_rate = dev_sample_rate; |
||||
this->m_dev_sample_rate_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getClockSource() { |
||||
return clock_source; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setClockSource(QString* clock_source) { |
||||
this->clock_source = clock_source; |
||||
this->m_clock_source_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getGpioDir() { |
||||
return gpio_dir; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setGpioDir(qint32 gpio_dir) { |
||||
this->gpio_dir = gpio_dir; |
||||
this->m_gpio_dir_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getGpioPins() { |
||||
return gpio_pins; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setGpioPins(qint32 gpio_pins) { |
||||
this->gpio_pins = gpio_pins; |
||||
this->m_gpio_pins_isSet = true; |
||||
} |
||||
|
||||
qint64 |
||||
SWGUSRPMIMOSettings::getRxCenterFrequency() { |
||||
return rx_center_frequency; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRxCenterFrequency(qint64 rx_center_frequency) { |
||||
this->rx_center_frequency = rx_center_frequency; |
||||
this->m_rx_center_frequency_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRxLoOffset() { |
||||
return rx_lo_offset; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRxLoOffset(qint32 rx_lo_offset) { |
||||
this->rx_lo_offset = rx_lo_offset; |
||||
this->m_rx_lo_offset_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getLog2SoftDecim() { |
||||
return log2_soft_decim; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setLog2SoftDecim(qint32 log2_soft_decim) { |
||||
this->log2_soft_decim = log2_soft_decim; |
||||
this->m_log2_soft_decim_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRxLpfBw() { |
||||
return rx_lpf_bw; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRxLpfBw(qint32 rx_lpf_bw) { |
||||
this->rx_lpf_bw = rx_lpf_bw; |
||||
this->m_rx_lpf_bw_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getDcBlock() { |
||||
return dc_block; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setDcBlock(qint32 dc_block) { |
||||
this->dc_block = dc_block; |
||||
this->m_dc_block_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getIqCorrection() { |
||||
return iq_correction; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setIqCorrection(qint32 iq_correction) { |
||||
this->iq_correction = iq_correction; |
||||
this->m_iq_correction_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRxTransverterMode() { |
||||
return rx_transverter_mode; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRxTransverterMode(qint32 rx_transverter_mode) { |
||||
this->rx_transverter_mode = rx_transverter_mode; |
||||
this->m_rx_transverter_mode_isSet = true; |
||||
} |
||||
|
||||
qint64 |
||||
SWGUSRPMIMOSettings::getRxTransverterDeltaFrequency() { |
||||
return rx_transverter_delta_frequency; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRxTransverterDeltaFrequency(qint64 rx_transverter_delta_frequency) { |
||||
this->rx_transverter_delta_frequency = rx_transverter_delta_frequency; |
||||
this->m_rx_transverter_delta_frequency_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRx0GainMode() { |
||||
return rx0_gain_mode; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx0GainMode(qint32 rx0_gain_mode) { |
||||
this->rx0_gain_mode = rx0_gain_mode; |
||||
this->m_rx0_gain_mode_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRx0Gain() { |
||||
return rx0_gain; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx0Gain(qint32 rx0_gain) { |
||||
this->rx0_gain = rx0_gain; |
||||
this->m_rx0_gain_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getRx0AntennaPath() { |
||||
return rx0_antenna_path; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx0AntennaPath(QString* rx0_antenna_path) { |
||||
this->rx0_antenna_path = rx0_antenna_path; |
||||
this->m_rx0_antenna_path_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRx1GainMode() { |
||||
return rx1_gain_mode; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx1GainMode(qint32 rx1_gain_mode) { |
||||
this->rx1_gain_mode = rx1_gain_mode; |
||||
this->m_rx1_gain_mode_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getRx1Gain() { |
||||
return rx1_gain; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx1Gain(qint32 rx1_gain) { |
||||
this->rx1_gain = rx1_gain; |
||||
this->m_rx1_gain_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getRx1AntennaPath() { |
||||
return rx1_antenna_path; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setRx1AntennaPath(QString* rx1_antenna_path) { |
||||
this->rx1_antenna_path = rx1_antenna_path; |
||||
this->m_rx1_antenna_path_isSet = true; |
||||
} |
||||
|
||||
qint64 |
||||
SWGUSRPMIMOSettings::getTxCenterFrequency() { |
||||
return tx_center_frequency; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTxCenterFrequency(qint64 tx_center_frequency) { |
||||
this->tx_center_frequency = tx_center_frequency; |
||||
this->m_tx_center_frequency_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getTxLoOffset() { |
||||
return tx_lo_offset; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTxLoOffset(qint32 tx_lo_offset) { |
||||
this->tx_lo_offset = tx_lo_offset; |
||||
this->m_tx_lo_offset_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getLog2SoftInterp() { |
||||
return log2_soft_interp; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setLog2SoftInterp(qint32 log2_soft_interp) { |
||||
this->log2_soft_interp = log2_soft_interp; |
||||
this->m_log2_soft_interp_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getTxLpfBw() { |
||||
return tx_lpf_bw; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTxLpfBw(qint32 tx_lpf_bw) { |
||||
this->tx_lpf_bw = tx_lpf_bw; |
||||
this->m_tx_lpf_bw_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getTxTransverterMode() { |
||||
return tx_transverter_mode; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTxTransverterMode(qint32 tx_transverter_mode) { |
||||
this->tx_transverter_mode = tx_transverter_mode; |
||||
this->m_tx_transverter_mode_isSet = true; |
||||
} |
||||
|
||||
qint64 |
||||
SWGUSRPMIMOSettings::getTxTransverterDeltaFrequency() { |
||||
return tx_transverter_delta_frequency; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTxTransverterDeltaFrequency(qint64 tx_transverter_delta_frequency) { |
||||
this->tx_transverter_delta_frequency = tx_transverter_delta_frequency; |
||||
this->m_tx_transverter_delta_frequency_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getTx0Gain() { |
||||
return tx0_gain; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTx0Gain(qint32 tx0_gain) { |
||||
this->tx0_gain = tx0_gain; |
||||
this->m_tx0_gain_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getTx0AntennaPath() { |
||||
return tx0_antenna_path; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTx0AntennaPath(QString* tx0_antenna_path) { |
||||
this->tx0_antenna_path = tx0_antenna_path; |
||||
this->m_tx0_antenna_path_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getTx1Gain() { |
||||
return tx1_gain; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTx1Gain(qint32 tx1_gain) { |
||||
this->tx1_gain = tx1_gain; |
||||
this->m_tx1_gain_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getTx1AntennaPath() { |
||||
return tx1_antenna_path; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setTx1AntennaPath(QString* tx1_antenna_path) { |
||||
this->tx1_antenna_path = tx1_antenna_path; |
||||
this->m_tx1_antenna_path_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getUseReverseApi() { |
||||
return use_reverse_api; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setUseReverseApi(qint32 use_reverse_api) { |
||||
this->use_reverse_api = use_reverse_api; |
||||
this->m_use_reverse_api_isSet = true; |
||||
} |
||||
|
||||
QString* |
||||
SWGUSRPMIMOSettings::getReverseApiAddress() { |
||||
return reverse_api_address; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setReverseApiAddress(QString* reverse_api_address) { |
||||
this->reverse_api_address = reverse_api_address; |
||||
this->m_reverse_api_address_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getReverseApiPort() { |
||||
return reverse_api_port; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setReverseApiPort(qint32 reverse_api_port) { |
||||
this->reverse_api_port = reverse_api_port; |
||||
this->m_reverse_api_port_isSet = true; |
||||
} |
||||
|
||||
qint32 |
||||
SWGUSRPMIMOSettings::getReverseApiDeviceIndex() { |
||||
return reverse_api_device_index; |
||||
} |
||||
void |
||||
SWGUSRPMIMOSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) { |
||||
this->reverse_api_device_index = reverse_api_device_index; |
||||
this->m_reverse_api_device_index_isSet = true; |
||||
} |
||||
|
||||
|
||||
bool |
||||
SWGUSRPMIMOSettings::isSet(){ |
||||
bool isObjectUpdated = false; |
||||
do{ |
||||
if(title && *title != QString("")){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_dev_sample_rate_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(clock_source && *clock_source != QString("")){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_gpio_dir_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_gpio_pins_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_center_frequency_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_lo_offset_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_log2_soft_decim_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_lpf_bw_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_dc_block_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_iq_correction_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_transverter_mode_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx_transverter_delta_frequency_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx0_gain_mode_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx0_gain_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(rx0_antenna_path && *rx0_antenna_path != QString("")){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx1_gain_mode_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_rx1_gain_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(rx1_antenna_path && *rx1_antenna_path != QString("")){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_center_frequency_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_lo_offset_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_log2_soft_interp_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_lpf_bw_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_transverter_mode_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx_transverter_delta_frequency_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx0_gain_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(tx0_antenna_path && *tx0_antenna_path != QString("")){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(m_tx1_gain_isSet){ |
||||
isObjectUpdated = true; break; |
||||
} |
||||
if(tx1_antenna_path && *tx1_antenna_path != QString("")){ |
||||
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; |
||||
} |
||||
}while(false); |
||||
return isObjectUpdated; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,251 @@
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
* 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. |
||||
*/ |
||||
|
||||
/*
|
||||
* SWGUSRPMIMOSettings.h |
||||
* |
||||
* USRP |
||||
*/ |
||||
|
||||
#ifndef SWGUSRPMIMOSettings_H_ |
||||
#define SWGUSRPMIMOSettings_H_ |
||||
|
||||
#include <QJsonObject> |
||||
|
||||
|
||||
#include <QString> |
||||
|
||||
#include "SWGObject.h" |
||||
#include "export.h" |
||||
|
||||
namespace SWGSDRangel { |
||||
|
||||
class SWG_API SWGUSRPMIMOSettings: public SWGObject { |
||||
public: |
||||
SWGUSRPMIMOSettings(); |
||||
SWGUSRPMIMOSettings(QString* json); |
||||
virtual ~SWGUSRPMIMOSettings(); |
||||
void init(); |
||||
void cleanup(); |
||||
|
||||
virtual QString asJson () override; |
||||
virtual QJsonObject* asJsonObject() override; |
||||
virtual void fromJsonObject(QJsonObject &json) override; |
||||
virtual SWGUSRPMIMOSettings* fromJson(QString &jsonString) override; |
||||
|
||||
QString* getTitle(); |
||||
void setTitle(QString* title); |
||||
|
||||
qint32 getDevSampleRate(); |
||||
void setDevSampleRate(qint32 dev_sample_rate); |
||||
|
||||
QString* getClockSource(); |
||||
void setClockSource(QString* clock_source); |
||||
|
||||
qint32 getGpioDir(); |
||||
void setGpioDir(qint32 gpio_dir); |
||||
|
||||
qint32 getGpioPins(); |
||||
void setGpioPins(qint32 gpio_pins); |
||||
|
||||
qint64 getRxCenterFrequency(); |
||||
void setRxCenterFrequency(qint64 rx_center_frequency); |
||||
|
||||
qint32 getRxLoOffset(); |
||||
void setRxLoOffset(qint32 rx_lo_offset); |
||||
|
||||
qint32 getLog2SoftDecim(); |
||||
void setLog2SoftDecim(qint32 log2_soft_decim); |
||||
|
||||
qint32 getRxLpfBw(); |
||||
void setRxLpfBw(qint32 rx_lpf_bw); |
||||
|
||||
qint32 getDcBlock(); |
||||
void setDcBlock(qint32 dc_block); |
||||
|
||||
qint32 getIqCorrection(); |
||||
void setIqCorrection(qint32 iq_correction); |
||||
|
||||
qint32 getRxTransverterMode(); |
||||
void setRxTransverterMode(qint32 rx_transverter_mode); |
||||
|
||||
qint64 getRxTransverterDeltaFrequency(); |
||||
void setRxTransverterDeltaFrequency(qint64 rx_transverter_delta_frequency); |
||||
|
||||
qint32 getRx0GainMode(); |
||||
void setRx0GainMode(qint32 rx0_gain_mode); |
||||
|
||||
qint32 getRx0Gain(); |
||||
void setRx0Gain(qint32 rx0_gain); |
||||
|
||||
QString* getRx0AntennaPath(); |
||||
void setRx0AntennaPath(QString* rx0_antenna_path); |
||||
|
||||
qint32 getRx1GainMode(); |
||||
void setRx1GainMode(qint32 rx1_gain_mode); |
||||
|
||||
qint32 getRx1Gain(); |
||||
void setRx1Gain(qint32 rx1_gain); |
||||
|
||||
QString* getRx1AntennaPath(); |
||||
void setRx1AntennaPath(QString* rx1_antenna_path); |
||||
|
||||
qint64 getTxCenterFrequency(); |
||||
void setTxCenterFrequency(qint64 tx_center_frequency); |
||||
|
||||
qint32 getTxLoOffset(); |
||||
void setTxLoOffset(qint32 tx_lo_offset); |
||||
|
||||
qint32 getLog2SoftInterp(); |
||||
void setLog2SoftInterp(qint32 log2_soft_interp); |
||||
|
||||
qint32 getTxLpfBw(); |
||||
void setTxLpfBw(qint32 tx_lpf_bw); |
||||
|
||||
qint32 getTxTransverterMode(); |
||||
void setTxTransverterMode(qint32 tx_transverter_mode); |
||||
|
||||
qint64 getTxTransverterDeltaFrequency(); |
||||
void setTxTransverterDeltaFrequency(qint64 tx_transverter_delta_frequency); |
||||
|
||||
qint32 getTx0Gain(); |
||||
void setTx0Gain(qint32 tx0_gain); |
||||
|
||||
QString* getTx0AntennaPath(); |
||||
void setTx0AntennaPath(QString* tx0_antenna_path); |
||||
|
||||
qint32 getTx1Gain(); |
||||
void setTx1Gain(qint32 tx1_gain); |
||||
|
||||
QString* getTx1AntennaPath(); |
||||
void setTx1AntennaPath(QString* tx1_antenna_path); |
||||
|
||||
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); |
||||
|
||||
|
||||
virtual bool isSet() override; |
||||
|
||||
private: |
||||
QString* title; |
||||
bool m_title_isSet; |
||||
|
||||
qint32 dev_sample_rate; |
||||
bool m_dev_sample_rate_isSet; |
||||
|
||||
QString* clock_source; |
||||
bool m_clock_source_isSet; |
||||
|
||||
qint32 gpio_dir; |
||||
bool m_gpio_dir_isSet; |
||||
|
||||
qint32 gpio_pins; |
||||
bool m_gpio_pins_isSet; |
||||
|
||||
qint64 rx_center_frequency; |
||||
bool m_rx_center_frequency_isSet; |
||||
|
||||
qint32 rx_lo_offset; |
||||
bool m_rx_lo_offset_isSet; |
||||
|
||||
qint32 log2_soft_decim; |
||||
bool m_log2_soft_decim_isSet; |
||||
|
||||
qint32 rx_lpf_bw; |
||||
bool m_rx_lpf_bw_isSet; |
||||
|
||||
qint32 dc_block; |
||||
bool m_dc_block_isSet; |
||||
|
||||
qint32 iq_correction; |
||||
bool m_iq_correction_isSet; |
||||
|
||||
qint32 rx_transverter_mode; |
||||
bool m_rx_transverter_mode_isSet; |
||||
|
||||
qint64 rx_transverter_delta_frequency; |
||||
bool m_rx_transverter_delta_frequency_isSet; |
||||
|
||||
qint32 rx0_gain_mode; |
||||
bool m_rx0_gain_mode_isSet; |
||||
|
||||
qint32 rx0_gain; |
||||
bool m_rx0_gain_isSet; |
||||
|
||||
QString* rx0_antenna_path; |
||||
bool m_rx0_antenna_path_isSet; |
||||
|
||||
qint32 rx1_gain_mode; |
||||
bool m_rx1_gain_mode_isSet; |
||||
|
||||
qint32 rx1_gain; |
||||
bool m_rx1_gain_isSet; |
||||
|
||||
QString* rx1_antenna_path; |
||||
bool m_rx1_antenna_path_isSet; |
||||
|
||||
qint64 tx_center_frequency; |
||||
bool m_tx_center_frequency_isSet; |
||||
|
||||
qint32 tx_lo_offset; |
||||
bool m_tx_lo_offset_isSet; |
||||
|
||||
qint32 log2_soft_interp; |
||||
bool m_log2_soft_interp_isSet; |
||||
|
||||
qint32 tx_lpf_bw; |
||||
bool m_tx_lpf_bw_isSet; |
||||
|
||||
qint32 tx_transverter_mode; |
||||
bool m_tx_transverter_mode_isSet; |
||||
|
||||
qint64 tx_transverter_delta_frequency; |
||||
bool m_tx_transverter_delta_frequency_isSet; |
||||
|
||||
qint32 tx0_gain; |
||||
bool m_tx0_gain_isSet; |
||||
|
||||
QString* tx0_antenna_path; |
||||
bool m_tx0_antenna_path_isSet; |
||||
|
||||
qint32 tx1_gain; |
||||
bool m_tx1_gain_isSet; |
||||
|
||||
QString* tx1_antenna_path; |
||||
bool m_tx1_antenna_path_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; |
||||
|
||||
}; |
||||
|
||||
} |
||||
|
||||
#endif /* SWGUSRPMIMOSettings_H_ */ |
||||
Loading…
Reference in new issue