mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 05:41:56 -05:00
Merge branch 'mimo' into dev
This commit is contained in:
commit
bdc68ba4df
@ -36,6 +36,7 @@
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/threadedbasebandsamplesink.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/devicesamplemimo.h"
|
||||
#include "dsp/fftfilt.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/db.h"
|
||||
@ -375,7 +376,7 @@ bool AMDemod::handleMessage(const Message& cmd)
|
||||
|
||||
void AMDemod::applyAudioSampleRate(int sampleRate)
|
||||
{
|
||||
qDebug("AMDemod::applyAudioSampleRate: %d", sampleRate);
|
||||
qDebug("AMDemod::applyAudioSampleRate: sampleRate: %d m_inputSampleRate: %d", sampleRate, m_inputSampleRate);
|
||||
|
||||
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
|
||||
sampleRate, m_settings.m_inputFrequencyOffset);
|
||||
@ -410,7 +411,8 @@ void AMDemod::applyChannelSettings(int inputSampleRate, int inputFrequencyOffset
|
||||
{
|
||||
qDebug() << "AMDemod::applyChannelSettings:"
|
||||
<< " inputSampleRate: " << inputSampleRate
|
||||
<< " inputFrequencyOffset: " << inputFrequencyOffset;
|
||||
<< " inputFrequencyOffset: " << inputFrequencyOffset
|
||||
<< " m_audioSampleRate: " << m_audioSampleRate;
|
||||
|
||||
if ((m_inputFrequencyOffset != inputFrequencyOffset) ||
|
||||
(m_inputSampleRate != inputSampleRate) || force)
|
||||
@ -529,7 +531,18 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
|
||||
reverseAPIKeys.append("volume");
|
||||
}
|
||||
|
||||
if ((m_settings.m_streamIndex != settings.m_streamIndex) || force) {
|
||||
if (m_settings.m_streamIndex != settings.m_streamIndex)
|
||||
{
|
||||
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
|
||||
{
|
||||
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
|
||||
m_deviceAPI->removeChannelSink(m_threadedChannelizer, m_settings.m_streamIndex);
|
||||
m_deviceAPI->addChannelSink(m_threadedChannelizer, settings.m_streamIndex);
|
||||
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
|
||||
// apply stream sample rate to itself
|
||||
applyChannelSettings(m_deviceAPI->getSampleMIMO()->getSourceSampleRate(settings.m_streamIndex), m_inputFrequencyOffset);
|
||||
}
|
||||
|
||||
reverseAPIKeys.append("streamIndex");
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,8 @@ void AMDemodGUI::onMenuDialogCalled(const QPoint &p)
|
||||
dialog.exec();
|
||||
|
||||
m_settings.m_streamIndex = dialog.getSelectedStreamIndex();
|
||||
m_channelMarker.setStreamIndex(m_settings.m_streamIndex);
|
||||
displayStreamIndex();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,7 @@ LocalSourceGUI::LocalSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("Local Source");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -342,6 +342,7 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl
|
||||
m_channelMarker.setBandwidth(5000);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("AM Modulator");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -678,6 +678,7 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_channelMarker.setBandwidth(5000);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("ATV Modulator");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -375,6 +375,7 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
|
||||
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.setVisible(true);
|
||||
|
||||
m_deviceUISet->registerTxChannelInstance(FreeDVMod::m_channelIdURI, this);
|
||||
|
@ -370,6 +370,7 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_channelMarker.setBandwidth(12500);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("NFM Modulator");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -455,6 +455,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_channelMarker.setSidebands(ChannelMarker::usb);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("SSB Modulator");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true);
|
||||
|
||||
|
@ -360,6 +360,7 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
|
||||
m_channelMarker.setBandwidth(125000);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("WFM Modulator");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -184,6 +184,7 @@ RemoteSourceGUI::RemoteSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet,
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle("Remote source");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -159,6 +159,7 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor);
|
||||
m_channelMarker.setTitle("UDP Sample Sink");
|
||||
m_channelMarker.setSourceOrSinkStream(false);
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setVisible(true); // activate signal on the last setting only
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGTestMISettings.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
@ -44,15 +45,14 @@ MESSAGE_CLASS_DEFINITION(TestMI::MsgStartStop, Message)
|
||||
TestMI::TestMI(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_testSourceThread(0),
|
||||
m_deviceDescription(),
|
||||
m_running(false),
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->setNbSourceStreams(1);
|
||||
m_deviceAPI->addSourceStream(); // Add a new source stream data set in the engine
|
||||
m_deviceAPI->addAncillarySink(m_fileSink);
|
||||
m_deviceAPI->setNbSourceStreams(2);
|
||||
m_deviceAPI->addSourceStream(true); // Add a new source stream data set in the engine - asynchronous handling of FIFOs
|
||||
m_deviceAPI->addSourceStream(true); // Add a new source stream data set in the engine - asynchronous handling of FIFOs
|
||||
m_sampleSinkFifos.push_back(SampleSinkFifo(96000 * 4));
|
||||
m_sampleSinkFifos.push_back(SampleSinkFifo(96000 * 4));
|
||||
m_networkManager = new QNetworkAccessManager();
|
||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
|
||||
@ -67,9 +67,17 @@ TestMI::~TestMI()
|
||||
stop();
|
||||
}
|
||||
|
||||
m_deviceAPI->removeAncillarySink(m_fileSink);
|
||||
std::vector<FileRecord*>::iterator it = m_fileSinks.begin();
|
||||
int istream = 0;
|
||||
|
||||
for (; it != m_fileSinks.end(); ++it, istream++)
|
||||
{
|
||||
m_deviceAPI->removeAncillarySink(*it, istream);
|
||||
delete *it;
|
||||
}
|
||||
|
||||
m_deviceAPI->removeLastSourceStream(); // Remove the last source stream data set in the engine
|
||||
m_deviceAPI->removeLastSourceStream(); // Remove the last source stream data set in the engine
|
||||
delete m_fileSink;
|
||||
}
|
||||
|
||||
void TestMI::destroy()
|
||||
@ -79,18 +87,30 @@ void TestMI::destroy()
|
||||
|
||||
void TestMI::init()
|
||||
{
|
||||
m_fileSinks.push_back(new FileRecord(QString("test_0_%1.sdriq").arg(m_deviceAPI->getDeviceUID())));
|
||||
m_fileSinks.push_back(new FileRecord(QString("test_1_%1.sdriq").arg(m_deviceAPI->getDeviceUID())));
|
||||
m_deviceAPI->addAncillarySink(m_fileSinks[0], 0);
|
||||
m_deviceAPI->addAncillarySink(m_fileSinks[1], 1);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
bool TestMI::start()
|
||||
{
|
||||
qDebug("TestMI::start");
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if (m_running) stop();
|
||||
if (m_running) {
|
||||
stop();
|
||||
}
|
||||
|
||||
m_testSourceThread = new TestMIThread(&m_sampleSinkFifos[0]);
|
||||
m_testSourceThread->setSamplerate(m_settings.m_sampleRate);
|
||||
m_testSourceThread->startStop(true);
|
||||
m_testSourceThreads.push_back(new TestMIThread(&m_sampleSinkFifos[0], 0));
|
||||
m_testSourceThreads.back()->setSamplerate(m_settings.m_streams[0].m_sampleRate);
|
||||
m_testSourceThreads.back()->startStop(true);
|
||||
|
||||
m_testSourceThreads.push_back(new TestMIThread(&m_sampleSinkFifos[1], 1));
|
||||
m_testSourceThreads.back()->setSamplerate(m_settings.m_streams[1].m_sampleRate);
|
||||
m_testSourceThreads.back()->startStop(true);
|
||||
|
||||
mutexLocker.unlock();
|
||||
|
||||
@ -102,15 +122,18 @@ bool TestMI::start()
|
||||
|
||||
void TestMI::stop()
|
||||
{
|
||||
qDebug("TestMI::stop");
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if (m_testSourceThread != 0)
|
||||
{
|
||||
m_testSourceThread->startStop(false);
|
||||
m_testSourceThread->deleteLater();
|
||||
m_testSourceThread = 0;
|
||||
}
|
||||
std::vector<TestMIThread*>::iterator it = m_testSourceThreads.begin();
|
||||
|
||||
for (; it != m_testSourceThreads.end(); ++it)
|
||||
{
|
||||
(*it)->startStop(false);
|
||||
(*it)->deleteLater();
|
||||
}
|
||||
|
||||
m_testSourceThreads.clear();
|
||||
m_running = false;
|
||||
}
|
||||
|
||||
@ -148,29 +171,38 @@ const QString& TestMI::getDeviceDescription() const
|
||||
|
||||
int TestMI::getSourceSampleRate(int index) const
|
||||
{
|
||||
(void) index;
|
||||
return m_settings.m_sampleRate/(1<<m_settings.m_log2Decim);
|
||||
if (index < (int) m_settings.m_streams.size()) {
|
||||
return m_settings.m_streams[index].m_sampleRate/(1<<m_settings.m_streams[index].m_log2Decim);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
quint64 TestMI::getSourceCenterFrequency(int index) const
|
||||
{
|
||||
(void) index;
|
||||
return m_settings.m_centerFrequency;
|
||||
if (index < (int) m_settings.m_streams.size()) {
|
||||
return m_settings.m_streams[index].m_centerFrequency;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TestMI::setSourceCenterFrequency(qint64 centerFrequency, int index)
|
||||
{
|
||||
(void) index;
|
||||
TestMISettings settings = m_settings;
|
||||
settings.m_centerFrequency = centerFrequency;
|
||||
TestMISettings settings = m_settings; // note: calls copy constructor
|
||||
|
||||
MsgConfigureTestSource* message = MsgConfigureTestSource::create(settings, false);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue)
|
||||
if (index < (int) settings.m_streams.size())
|
||||
{
|
||||
MsgConfigureTestSource* messageToGUI = MsgConfigureTestSource::create(settings, false);
|
||||
m_guiMessageQueue->push(messageToGUI);
|
||||
settings.m_streams[index].m_centerFrequency = centerFrequency;
|
||||
|
||||
MsgConfigureTestSource* message = MsgConfigureTestSource::create(settings, false);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue)
|
||||
{
|
||||
MsgConfigureTestSource* messageToGUI = MsgConfigureTestSource::create(settings, false);
|
||||
m_guiMessageQueue->push(messageToGUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,20 +226,21 @@ bool TestMI::handleMessage(const Message& message)
|
||||
{
|
||||
MsgFileRecord& conf = (MsgFileRecord&) message;
|
||||
qDebug() << "TestMI::handleMessage: MsgFileRecord: " << conf.getStartStop();
|
||||
int istream = conf.getStreamIndex();
|
||||
|
||||
if (conf.getStartStop())
|
||||
{
|
||||
if (m_settings.m_fileRecordName.size() != 0) {
|
||||
m_fileSink->setFileName(m_settings.m_fileRecordName);
|
||||
m_fileSinks[istream]->setFileName(m_settings.m_fileRecordName + "_0.sdriq");
|
||||
} else {
|
||||
m_fileSink->genUniqueFileName(m_deviceAPI->getDeviceUID());
|
||||
m_fileSinks[istream]->genUniqueFileName(m_deviceAPI->getDeviceUID(), istream);
|
||||
}
|
||||
|
||||
m_fileSink->startRecording();
|
||||
m_fileSinks[istream]->startRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fileSink->stopRecording();
|
||||
m_fileSinks[istream]->stopRecording();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -243,204 +276,238 @@ bool TestMI::handleMessage(const Message& message)
|
||||
|
||||
bool TestMI::applySettings(const TestMISettings& settings, bool force)
|
||||
{
|
||||
QList<QString> reverseAPIKeys;
|
||||
DeviceSettingsKeys deviceSettingsKeys;
|
||||
|
||||
if ((m_settings.m_autoCorrOptions != settings.m_autoCorrOptions) || force)
|
||||
qDebug() << "TestMI::applySettings: common: "
|
||||
<< " m_fileRecordName: " << settings.m_fileRecordName
|
||||
<< " m_useReverseAPI: " << settings.m_useReverseAPI
|
||||
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
|
||||
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort
|
||||
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex;
|
||||
|
||||
for (unsigned int istream = 0; (istream < m_settings.m_streams.size()) && (istream < settings.m_streams.size()); istream++)
|
||||
{
|
||||
reverseAPIKeys.append("autoCorrOptions");
|
||||
qDebug() << "TestMI::applySettings: stream #" << istream << ": "
|
||||
<< " m_centerFrequency: " << settings.m_streams[istream].m_centerFrequency
|
||||
<< " m_frequencyShift: " << settings.m_streams[istream].m_frequencyShift
|
||||
<< " m_sampleRate: " << settings.m_streams[istream].m_sampleRate
|
||||
<< " m_log2Decim: " << settings.m_streams[istream].m_log2Decim
|
||||
<< " m_fcPos: " << settings.m_streams[istream].m_fcPos
|
||||
<< " m_amplitudeBits: " << settings.m_streams[istream].m_amplitudeBits
|
||||
<< " m_sampleSizeIndex: " << settings.m_streams[istream].m_sampleSizeIndex
|
||||
<< " m_autoCorrOptions: " << settings.m_streams[istream].m_autoCorrOptions
|
||||
<< " m_dcFactor: " << settings.m_streams[istream].m_dcFactor
|
||||
<< " m_iFactor: " << settings.m_streams[istream].m_iFactor
|
||||
<< " m_qFactor: " << settings.m_streams[istream].m_qFactor
|
||||
<< " m_phaseImbalance: " << settings.m_streams[istream].m_phaseImbalance
|
||||
<< " m_modulation: " << settings.m_streams[istream].m_modulation
|
||||
<< " m_amModulation: " << settings.m_streams[istream].m_amModulation
|
||||
<< " m_fmDeviation: " << settings.m_streams[istream].m_fmDeviation
|
||||
<< " m_modulationTone: " << settings.m_streams[istream].m_modulationTone;
|
||||
|
||||
switch(settings.m_autoCorrOptions)
|
||||
deviceSettingsKeys.m_streamsSettingsKeys.push_back(QList<QString>());
|
||||
QList<QString>& reverseAPIKeys = deviceSettingsKeys.m_streamsSettingsKeys.back();
|
||||
|
||||
if ((m_settings.m_streams[istream].m_autoCorrOptions != settings.m_streams[istream].m_autoCorrOptions) || force)
|
||||
{
|
||||
case TestMISettings::AutoCorrDC:
|
||||
m_deviceAPI->configureCorrections(true, false);
|
||||
break;
|
||||
case TestMISettings::AutoCorrDCAndIQ:
|
||||
m_deviceAPI->configureCorrections(true, true);
|
||||
break;
|
||||
case TestMISettings::AutoCorrNone:
|
||||
default:
|
||||
m_deviceAPI->configureCorrections(false, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
reverseAPIKeys.append("autoCorrOptions");
|
||||
|
||||
if ((m_settings.m_sampleRate != settings.m_sampleRate) || force)
|
||||
{
|
||||
reverseAPIKeys.append("sampleRate");
|
||||
|
||||
if (m_testSourceThread != 0)
|
||||
{
|
||||
m_testSourceThread->setSamplerate(settings.m_sampleRate);
|
||||
qDebug("TestMI::applySettings: sample rate set to %d", settings.m_sampleRate);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2Decim != settings.m_log2Decim) || force)
|
||||
{
|
||||
reverseAPIKeys.append("log2Decim");
|
||||
|
||||
if (m_testSourceThread != 0)
|
||||
{
|
||||
m_testSourceThread->setLog2Decimation(settings.m_log2Decim);
|
||||
qDebug() << "TestMI::applySettings: set decimation to " << (1<<settings.m_log2Decim);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_fcPos != settings.m_fcPos)
|
||||
|| (m_settings.m_frequencyShift != settings.m_frequencyShift)
|
||||
|| (m_settings.m_sampleRate != settings.m_sampleRate)
|
||||
|| (m_settings.m_log2Decim != settings.m_log2Decim) || force)
|
||||
{
|
||||
reverseAPIKeys.append("centerFrequency");
|
||||
reverseAPIKeys.append("fcPos");
|
||||
reverseAPIKeys.append("frequencyShift");
|
||||
|
||||
qint64 deviceCenterFrequency = DeviceSampleSource::calculateDeviceCenterFrequency(
|
||||
settings.m_centerFrequency,
|
||||
0, // no transverter mode
|
||||
settings.m_log2Decim,
|
||||
(DeviceSampleSource::fcPos_t) settings.m_fcPos,
|
||||
settings.m_sampleRate,
|
||||
DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD,
|
||||
false);
|
||||
|
||||
int frequencyShift = settings.m_frequencyShift;
|
||||
quint32 devSampleRate = settings.m_sampleRate;
|
||||
|
||||
if (settings.m_log2Decim != 0)
|
||||
{
|
||||
frequencyShift += DeviceSampleSource::calculateFrequencyShift(
|
||||
settings.m_log2Decim,
|
||||
(DeviceSampleSource::fcPos_t) settings.m_fcPos,
|
||||
settings.m_sampleRate,
|
||||
DeviceSampleSource::FSHIFT_STD);
|
||||
}
|
||||
|
||||
if (m_testSourceThread != 0)
|
||||
{
|
||||
m_testSourceThread->setFcPos((int) settings.m_fcPos);
|
||||
m_testSourceThread->setFrequencyShift(frequencyShift);
|
||||
qDebug() << "TestMI::applySettings:"
|
||||
<< " center freq: " << settings.m_centerFrequency << " Hz"
|
||||
<< " device center freq: " << deviceCenterFrequency << " Hz"
|
||||
<< " device sample rate: " << devSampleRate << "Hz"
|
||||
<< " Actual sample rate: " << devSampleRate/(1<<m_settings.m_log2Decim) << "Hz"
|
||||
<< " f shift: " << settings.m_frequencyShift;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_amplitudeBits != settings.m_amplitudeBits) || force)
|
||||
{
|
||||
reverseAPIKeys.append("amplitudeBits");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setAmplitudeBits(settings.m_amplitudeBits);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_dcFactor != settings.m_dcFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("dcFactor");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setDCFactor(settings.m_dcFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_iFactor != settings.m_iFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("iFactor");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setIFactor(settings.m_iFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_qFactor != settings.m_qFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("qFactor");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setQFactor(settings.m_qFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_phaseImbalance != settings.m_phaseImbalance) || force)
|
||||
{
|
||||
reverseAPIKeys.append("phaseImbalance");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setPhaseImbalance(settings.m_phaseImbalance);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_sampleSizeIndex != settings.m_sampleSizeIndex) || force)
|
||||
{
|
||||
reverseAPIKeys.append("sampleSizeIndex");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setBitSize(settings.m_sampleSizeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_sampleRate != settings.m_sampleRate)
|
||||
|| (m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_log2Decim != settings.m_log2Decim)
|
||||
|| (m_settings.m_fcPos != settings.m_fcPos) || force)
|
||||
{
|
||||
int sampleRate = settings.m_sampleRate/(1<<settings.m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, settings.m_centerFrequency);
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
DSPDeviceMIMOEngine::SignalNotification *engineNotif = new DSPDeviceMIMOEngine::SignalNotification(
|
||||
sampleRate, settings.m_centerFrequency, true, 0);
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(engineNotif);
|
||||
}
|
||||
|
||||
if ((m_settings.m_modulationTone != settings.m_modulationTone) || force)
|
||||
{
|
||||
reverseAPIKeys.append("modulationTone");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setToneFrequency(settings.m_modulationTone * 10);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_modulation != settings.m_modulation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("modulation");
|
||||
|
||||
if (m_testSourceThread != 0)
|
||||
{
|
||||
m_testSourceThread->setModulation(settings.m_modulation);
|
||||
|
||||
if (settings.m_modulation == TestMISettings::ModulationPattern0) {
|
||||
m_testSourceThread->setPattern0();
|
||||
} else if (settings.m_modulation == TestMISettings::ModulationPattern1) {
|
||||
m_testSourceThread->setPattern1();
|
||||
} else if (settings.m_modulation == TestMISettings::ModulationPattern2) {
|
||||
m_testSourceThread->setPattern2();
|
||||
switch(settings.m_streams[istream].m_autoCorrOptions)
|
||||
{
|
||||
case TestMIStreamSettings::AutoCorrDC:
|
||||
m_deviceAPI->configureCorrections(true, false, istream);
|
||||
break;
|
||||
case TestMIStreamSettings::AutoCorrDCAndIQ:
|
||||
m_deviceAPI->configureCorrections(true, true, istream);
|
||||
break;
|
||||
case TestMIStreamSettings::AutoCorrNone:
|
||||
default:
|
||||
m_deviceAPI->configureCorrections(false, false, istream);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_amModulation != settings.m_amModulation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("amModulation");
|
||||
if ((m_settings.m_streams[istream].m_sampleRate != settings.m_streams[istream].m_sampleRate) || force)
|
||||
{
|
||||
reverseAPIKeys.append("sampleRate");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setAMModulation(settings.m_amModulation / 100.0f);
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream]))
|
||||
{
|
||||
m_testSourceThreads[istream]->setSamplerate(settings.m_streams[istream].m_sampleRate);
|
||||
qDebug("TestMI::applySettings: thread on stream: %u sample rate set to %d",
|
||||
istream, settings.m_streams[istream].m_sampleRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_fmDeviation != settings.m_fmDeviation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("fmDeviation");
|
||||
if ((m_settings.m_streams[istream].m_log2Decim != settings.m_streams[istream].m_log2Decim) || force)
|
||||
{
|
||||
reverseAPIKeys.append("log2Decim");
|
||||
|
||||
if (m_testSourceThread != 0) {
|
||||
m_testSourceThread->setFMDeviation(settings.m_fmDeviation * 100.0f);
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream]))
|
||||
{
|
||||
m_testSourceThreads[istream]->setLog2Decimation(settings.m_streams[istream].m_log2Decim);
|
||||
qDebug("TestMI::applySettings: thread on stream: %u set decimation to %d",
|
||||
istream, (1<<settings.m_streams[istream].m_log2Decim));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_centerFrequency != settings.m_streams[istream].m_centerFrequency)
|
||||
|| (m_settings.m_streams[istream].m_fcPos != settings.m_streams[istream].m_fcPos)
|
||||
|| (m_settings.m_streams[istream].m_frequencyShift != settings.m_streams[istream].m_frequencyShift)
|
||||
|| (m_settings.m_streams[istream].m_sampleRate != settings.m_streams[istream].m_sampleRate)
|
||||
|| (m_settings.m_streams[istream].m_log2Decim != settings.m_streams[istream].m_log2Decim) || force)
|
||||
{
|
||||
reverseAPIKeys.append("centerFrequency");
|
||||
reverseAPIKeys.append("fcPos");
|
||||
reverseAPIKeys.append("frequencyShift");
|
||||
|
||||
qint64 deviceCenterFrequency = DeviceSampleSource::calculateDeviceCenterFrequency(
|
||||
settings.m_streams[istream].m_centerFrequency,
|
||||
0, // no transverter mode
|
||||
settings.m_streams[istream].m_log2Decim,
|
||||
(DeviceSampleSource::fcPos_t) settings.m_streams[istream].m_fcPos,
|
||||
settings.m_streams[istream].m_sampleRate,
|
||||
DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD,
|
||||
false);
|
||||
|
||||
int frequencyShift = settings.m_streams[istream].m_frequencyShift;
|
||||
quint32 devSampleRate = settings.m_streams[istream].m_sampleRate;
|
||||
|
||||
if (settings.m_streams[istream].m_log2Decim != 0)
|
||||
{
|
||||
frequencyShift += DeviceSampleSource::calculateFrequencyShift(
|
||||
settings.m_streams[istream].m_log2Decim,
|
||||
(DeviceSampleSource::fcPos_t) settings.m_streams[istream].m_fcPos,
|
||||
settings.m_streams[istream].m_sampleRate,
|
||||
DeviceSampleSource::FSHIFT_STD);
|
||||
}
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream]))
|
||||
{
|
||||
m_testSourceThreads[istream]->setFcPos((int) settings.m_streams[istream].m_fcPos);
|
||||
m_testSourceThreads[istream]->setFrequencyShift(frequencyShift);
|
||||
qDebug() << "TestMI::applySettings:"
|
||||
<< " thread on istream: " << istream
|
||||
<< " center freq: " << settings.m_streams[istream].m_centerFrequency << " Hz"
|
||||
<< " device center freq: " << deviceCenterFrequency << " Hz"
|
||||
<< " device sample rate: " << devSampleRate << "Hz"
|
||||
<< " Actual sample rate: " << devSampleRate/(1<<m_settings.m_streams[istream].m_log2Decim) << "Hz"
|
||||
<< " f shift: " << settings.m_streams[istream].m_frequencyShift;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_amplitudeBits != settings.m_streams[istream].m_amplitudeBits) || force)
|
||||
{
|
||||
reverseAPIKeys.append("amplitudeBits");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setAmplitudeBits(settings.m_streams[istream].m_amplitudeBits);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_dcFactor != settings.m_streams[istream].m_dcFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("dcFactor");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setDCFactor(settings.m_streams[istream].m_dcFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_iFactor != settings.m_streams[istream].m_iFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("iFactor");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setIFactor(settings.m_streams[istream].m_iFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_qFactor != settings.m_streams[istream].m_qFactor) || force)
|
||||
{
|
||||
reverseAPIKeys.append("qFactor");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setQFactor(settings.m_streams[istream].m_qFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_phaseImbalance != settings.m_streams[istream].m_phaseImbalance) || force)
|
||||
{
|
||||
reverseAPIKeys.append("phaseImbalance");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setPhaseImbalance(settings.m_streams[istream].m_phaseImbalance);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_sampleSizeIndex != settings.m_streams[istream].m_sampleSizeIndex) || force)
|
||||
{
|
||||
reverseAPIKeys.append("sampleSizeIndex");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setBitSize(settings.m_streams[istream].m_sampleSizeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_sampleRate != settings.m_streams[istream].m_sampleRate)
|
||||
|| (m_settings.m_streams[istream].m_centerFrequency != settings.m_streams[istream].m_centerFrequency)
|
||||
|| (m_settings.m_streams[istream].m_log2Decim != settings.m_streams[istream].m_log2Decim)
|
||||
|| (m_settings.m_streams[istream].m_fcPos != settings.m_streams[istream].m_fcPos) || force)
|
||||
{
|
||||
int sampleRate = settings.m_streams[istream].m_sampleRate/(1<<settings.m_streams[istream].m_log2Decim);
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, settings.m_streams[istream].m_centerFrequency);
|
||||
m_fileSinks[istream]->handleMessage(*notif); // forward to file sink
|
||||
DSPDeviceMIMOEngine::SignalNotification *engineNotif = new DSPDeviceMIMOEngine::SignalNotification(
|
||||
sampleRate, settings.m_streams[istream].m_centerFrequency, true, istream);
|
||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(engineNotif);
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_modulationTone != settings.m_streams[istream].m_modulationTone) || force)
|
||||
{
|
||||
reverseAPIKeys.append("modulationTone");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setToneFrequency(settings.m_streams[istream].m_modulationTone * 10);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_modulation != settings.m_streams[istream].m_modulation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("modulation");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream]))
|
||||
{
|
||||
m_testSourceThreads[istream]->setModulation(settings.m_streams[istream].m_modulation);
|
||||
|
||||
if (settings.m_streams[istream].m_modulation == TestMIStreamSettings::ModulationPattern0) {
|
||||
m_testSourceThreads[istream]->setPattern0();
|
||||
} else if (settings.m_streams[istream].m_modulation == TestMIStreamSettings::ModulationPattern1) {
|
||||
m_testSourceThreads[istream]->setPattern1();
|
||||
} else if (settings.m_streams[istream].m_modulation == TestMIStreamSettings::ModulationPattern2) {
|
||||
m_testSourceThreads[istream]->setPattern2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_amModulation != settings.m_streams[istream].m_amModulation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("amModulation");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setAMModulation(settings.m_streams[istream].m_amModulation / 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_streams[istream].m_fmDeviation != settings.m_streams[istream].m_fmDeviation) || force)
|
||||
{
|
||||
reverseAPIKeys.append("fmDeviation");
|
||||
|
||||
if ((istream < m_testSourceThreads.size()) && (m_testSourceThreads[istream])) {
|
||||
m_testSourceThreads[istream]->setFMDeviation(settings.m_streams[istream].m_fmDeviation * 100.0f);
|
||||
}
|
||||
}
|
||||
} // for each stream index
|
||||
|
||||
if (settings.m_useReverseAPI)
|
||||
{
|
||||
@ -449,7 +516,7 @@ bool TestMI::applySettings(const TestMISettings& settings, bool force)
|
||||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
|
||||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
|
||||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex);
|
||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
||||
webapiReverseSendSettings(deviceSettingsKeys, settings, fullUpdate || force);
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
@ -504,62 +571,75 @@ int TestMI::webapiSettingsPutPatch(
|
||||
(void) errorMessage;
|
||||
TestMISettings settings = m_settings;
|
||||
|
||||
if (deviceSettingsKeys.contains("centerFrequency")) {
|
||||
settings.m_centerFrequency = response.getTestMiSettings()->getCenterFrequency();
|
||||
if (deviceSettingsKeys.contains("streams"))
|
||||
{
|
||||
QList<SWGSDRangel::SWGTestMiStreamSettings*> *streamsSettings = response.getTestMiSettings()->getStreams();
|
||||
QList<SWGSDRangel::SWGTestMiStreamSettings*>::const_iterator it = streamsSettings->begin();
|
||||
|
||||
for (; it != streamsSettings->end(); ++it)
|
||||
{
|
||||
int istream = (*it)->getStreamIndex();
|
||||
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].centerFrequency").arg(istream))) {
|
||||
settings.m_streams[istream].m_centerFrequency = (*it)->getCenterFrequency();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].frequencyShift").arg(istream))) {
|
||||
settings.m_streams[istream].m_frequencyShift = (*it)->getFrequencyShift();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].sampleRate").arg(istream))) {
|
||||
settings.m_streams[istream].m_sampleRate = (*it)->getSampleRate();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].log2Decim").arg(istream))) {
|
||||
settings.m_streams[istream].m_log2Decim = (*it)->getLog2Decim();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].fcPos").arg(istream))) {
|
||||
int fcPos = (*it)->getFcPos();
|
||||
fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos;
|
||||
settings.m_streams[istream].m_fcPos = (TestMIStreamSettings::fcPos_t) fcPos;
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].sampleSizeIndex").arg(istream))) {
|
||||
int sampleSizeIndex = (*it)->getSampleSizeIndex();
|
||||
sampleSizeIndex = sampleSizeIndex < 0 ? 0 : sampleSizeIndex > 1 ? 2 : sampleSizeIndex;
|
||||
settings.m_streams[istream].m_sampleSizeIndex = sampleSizeIndex;
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].amplitudeBits").arg(istream))) {
|
||||
settings.m_streams[istream].m_amplitudeBits = (*it)->getAmplitudeBits();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].autoCorrOptions").arg(istream))) {
|
||||
int autoCorrOptions = (*it)->getAutoCorrOptions();
|
||||
autoCorrOptions = autoCorrOptions < 0 ? 0 : autoCorrOptions >= TestMIStreamSettings::AutoCorrLast ? TestMIStreamSettings::AutoCorrLast-1 : autoCorrOptions;
|
||||
settings.m_streams[istream].m_sampleSizeIndex = (TestMIStreamSettings::AutoCorrOptions) autoCorrOptions;
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].modulation").arg(istream))) {
|
||||
int modulation = (*it)->getModulation();
|
||||
modulation = modulation < 0 ? 0 : modulation >= TestMIStreamSettings::ModulationLast ? TestMIStreamSettings::ModulationLast-1 : modulation;
|
||||
settings.m_streams[istream].m_modulation = (TestMIStreamSettings::Modulation) modulation;
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].modulationTone").arg(istream))) {
|
||||
settings.m_streams[istream].m_modulationTone = (*it)->getModulationTone();
|
||||
}
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].amModulation").arg(istream))) {
|
||||
settings.m_streams[istream].m_amModulation = (*it)->getAmModulation();
|
||||
};
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].fmDeviation").arg(istream))) {
|
||||
settings.m_streams[istream].m_fmDeviation = (*it)->getFmDeviation();
|
||||
};
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].dcFactor").arg(istream))) {
|
||||
settings.m_streams[istream].m_dcFactor = (*it)->getDcFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].iFactor").arg(istream))) {
|
||||
settings.m_streams[istream].m_iFactor = (*it)->getIFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].qFactor").arg(istream))) {
|
||||
settings.m_streams[istream].m_qFactor = (*it)->getQFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains(tr("streams[%1].phaseImbalance").arg(istream))) {
|
||||
settings.m_streams[istream].m_phaseImbalance = (*it)->getPhaseImbalance();
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
if (deviceSettingsKeys.contains("frequencyShift")) {
|
||||
settings.m_frequencyShift = response.getTestMiSettings()->getFrequencyShift();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("sampleRate")) {
|
||||
settings.m_sampleRate = response.getTestMiSettings()->getSampleRate();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("log2Decim")) {
|
||||
settings.m_log2Decim = response.getTestMiSettings()->getLog2Decim();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fcPos")) {
|
||||
int fcPos = response.getTestMiSettings()->getFcPos();
|
||||
fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos;
|
||||
settings.m_fcPos = (TestMISettings::fcPos_t) fcPos;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("sampleSizeIndex")) {
|
||||
int sampleSizeIndex = response.getTestMiSettings()->getSampleSizeIndex();
|
||||
sampleSizeIndex = sampleSizeIndex < 0 ? 0 : sampleSizeIndex > 1 ? 2 : sampleSizeIndex;
|
||||
settings.m_sampleSizeIndex = sampleSizeIndex;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("amplitudeBits")) {
|
||||
settings.m_amplitudeBits = response.getTestMiSettings()->getAmplitudeBits();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("autoCorrOptions")) {
|
||||
int autoCorrOptions = response.getTestMiSettings()->getAutoCorrOptions();
|
||||
autoCorrOptions = autoCorrOptions < 0 ? 0 : autoCorrOptions >= TestMISettings::AutoCorrLast ? TestMISettings::AutoCorrLast-1 : autoCorrOptions;
|
||||
settings.m_sampleSizeIndex = (TestMISettings::AutoCorrOptions) autoCorrOptions;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("modulation")) {
|
||||
int modulation = response.getTestMiSettings()->getModulation();
|
||||
modulation = modulation < 0 ? 0 : modulation >= TestMISettings::ModulationLast ? TestMISettings::ModulationLast-1 : modulation;
|
||||
settings.m_modulation = (TestMISettings::Modulation) modulation;
|
||||
}
|
||||
if (deviceSettingsKeys.contains("modulationTone")) {
|
||||
settings.m_modulationTone = response.getTestMiSettings()->getModulationTone();
|
||||
}
|
||||
if (deviceSettingsKeys.contains("amModulation")) {
|
||||
settings.m_amModulation = response.getTestMiSettings()->getAmModulation();
|
||||
};
|
||||
if (deviceSettingsKeys.contains("fmDeviation")) {
|
||||
settings.m_fmDeviation = response.getTestMiSettings()->getFmDeviation();
|
||||
};
|
||||
if (deviceSettingsKeys.contains("dcFactor")) {
|
||||
settings.m_dcFactor = response.getTestMiSettings()->getDcFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains("iFactor")) {
|
||||
settings.m_iFactor = response.getTestMiSettings()->getIFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains("qFactor")) {
|
||||
settings.m_qFactor = response.getTestMiSettings()->getQFactor();
|
||||
};
|
||||
if (deviceSettingsKeys.contains("phaseImbalance")) {
|
||||
settings.m_phaseImbalance = response.getTestMiSettings()->getPhaseImbalance();
|
||||
};
|
||||
|
||||
if (deviceSettingsKeys.contains("fileRecordName")) {
|
||||
settings.m_fileRecordName = *response.getTestMiSettings()->getFileRecordName();
|
||||
}
|
||||
@ -591,22 +671,32 @@ int TestMI::webapiSettingsPutPatch(
|
||||
|
||||
void TestMI::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const TestMISettings& settings)
|
||||
{
|
||||
response.getTestMiSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
response.getTestMiSettings()->setFrequencyShift(settings.m_frequencyShift);
|
||||
response.getTestMiSettings()->setSampleRate(settings.m_sampleRate);
|
||||
response.getTestMiSettings()->setLog2Decim(settings.m_log2Decim);
|
||||
response.getTestMiSettings()->setFcPos((int) settings.m_fcPos);
|
||||
response.getTestMiSettings()->setSampleSizeIndex((int) settings.m_sampleSizeIndex);
|
||||
response.getTestMiSettings()->setAmplitudeBits(settings.m_amplitudeBits);
|
||||
response.getTestMiSettings()->setAutoCorrOptions((int) settings.m_autoCorrOptions);
|
||||
response.getTestMiSettings()->setModulation((int) settings.m_modulation);
|
||||
response.getTestMiSettings()->setModulationTone(settings.m_modulationTone);
|
||||
response.getTestMiSettings()->setAmModulation(settings.m_amModulation);
|
||||
response.getTestMiSettings()->setFmDeviation(settings.m_fmDeviation);
|
||||
response.getTestMiSettings()->setDcFactor(settings.m_dcFactor);
|
||||
response.getTestMiSettings()->setIFactor(settings.m_iFactor);
|
||||
response.getTestMiSettings()->setQFactor(settings.m_qFactor);
|
||||
response.getTestMiSettings()->setPhaseImbalance(settings.m_phaseImbalance);
|
||||
std::vector<TestMIStreamSettings>::const_iterator it = settings.m_streams.begin();
|
||||
int istream = 0;
|
||||
|
||||
for (; it != settings.m_streams.end(); ++it, istream++)
|
||||
{
|
||||
QList<SWGSDRangel::SWGTestMiStreamSettings*> *streams = response.getTestMiSettings()->getStreams();
|
||||
streams->append(new SWGSDRangel::SWGTestMiStreamSettings);
|
||||
streams->back()->init();
|
||||
streams->back()->setStreamIndex(istream);
|
||||
streams->back()->setCenterFrequency(it->m_centerFrequency);
|
||||
streams->back()->setFrequencyShift(it->m_frequencyShift);
|
||||
streams->back()->setSampleRate(it->m_sampleRate);
|
||||
streams->back()->setLog2Decim(it->m_log2Decim);
|
||||
streams->back()->setFcPos((int) it->m_fcPos);
|
||||
streams->back()->setSampleSizeIndex((int) it->m_sampleSizeIndex);
|
||||
streams->back()->setAmplitudeBits(it->m_amplitudeBits);
|
||||
streams->back()->setAutoCorrOptions((int) it->m_autoCorrOptions);
|
||||
streams->back()->setModulation((int) it->m_modulation);
|
||||
streams->back()->setModulationTone(it->m_modulationTone);
|
||||
streams->back()->setAmModulation(it->m_amModulation);
|
||||
streams->back()->setFmDeviation(it->m_fmDeviation);
|
||||
streams->back()->setDcFactor(it->m_dcFactor);
|
||||
streams->back()->setIFactor(it->m_iFactor);
|
||||
streams->back()->setQFactor(it->m_qFactor);
|
||||
streams->back()->setPhaseImbalance(it->m_phaseImbalance);
|
||||
}
|
||||
|
||||
if (response.getTestMiSettings()->getFileRecordName()) {
|
||||
*response.getTestMiSettings()->getFileRecordName() = settings.m_fileRecordName;
|
||||
@ -626,7 +716,7 @@ void TestMI::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response
|
||||
response.getTestMiSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex);
|
||||
}
|
||||
|
||||
void TestMI::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const TestMISettings& settings, bool force)
|
||||
void TestMI::webapiReverseSendSettings(const DeviceSettingsKeys& deviceSettingsKeys, const TestMISettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||
swgDeviceSettings->setDirection(0); // single Rx
|
||||
@ -637,55 +727,71 @@ void TestMI::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const
|
||||
|
||||
// transfer data that has been modified. When force is on transfer all data except reverse API data
|
||||
|
||||
if (deviceSettingsKeys.contains("centerFrequency") || force) {
|
||||
swgTestMISettings->setCenterFrequency(settings.m_centerFrequency);
|
||||
QList<QList<QString>>::const_iterator it = deviceSettingsKeys.m_streamsSettingsKeys.begin();
|
||||
int istream = 0;
|
||||
|
||||
for (; it != deviceSettingsKeys.m_streamsSettingsKeys.end(); ++it, istream++)
|
||||
{
|
||||
if ((it->size() > 0) || force)
|
||||
{
|
||||
QList<SWGSDRangel::SWGTestMiStreamSettings*> *streams = swgTestMISettings->getStreams();
|
||||
streams->append(new SWGSDRangel::SWGTestMiStreamSettings);
|
||||
streams->back()->init();
|
||||
streams->back()->setStreamIndex(istream);
|
||||
const QList<QString>& streamSettingsKeys = *it;
|
||||
|
||||
if (streamSettingsKeys.contains("centerFrequency") || force) {
|
||||
streams->back()->setCenterFrequency(settings.m_streams[istream].m_centerFrequency);
|
||||
}
|
||||
if (streamSettingsKeys.contains("frequencyShift") || force) {
|
||||
streams->back()->setFrequencyShift(settings.m_streams[istream].m_frequencyShift);
|
||||
}
|
||||
if (streamSettingsKeys.contains("sampleRate") || force) {
|
||||
streams->back()->setSampleRate(settings.m_streams[istream].m_sampleRate);
|
||||
}
|
||||
if (streamSettingsKeys.contains("log2Decim") || force) {
|
||||
streams->back()->setLog2Decim(settings.m_streams[istream].m_log2Decim);
|
||||
}
|
||||
if (streamSettingsKeys.contains("fcPos") || force) {
|
||||
streams->back()->setFcPos((int) settings.m_streams[istream].m_fcPos);
|
||||
}
|
||||
if (streamSettingsKeys.contains("sampleSizeIndex") || force) {
|
||||
streams->back()->setSampleSizeIndex(settings.m_streams[istream].m_sampleSizeIndex);
|
||||
}
|
||||
if (streamSettingsKeys.contains("amplitudeBits") || force) {
|
||||
streams->back()->setAmplitudeBits(settings.m_streams[istream].m_amplitudeBits);
|
||||
}
|
||||
if (streamSettingsKeys.contains("autoCorrOptions") || force) {
|
||||
streams->back()->setAutoCorrOptions((int) settings.m_streams[istream].m_sampleSizeIndex);
|
||||
}
|
||||
if (streamSettingsKeys.contains("modulation") || force) {
|
||||
streams->back()->setModulation((int) settings.m_streams[istream].m_modulation);
|
||||
}
|
||||
if (streamSettingsKeys.contains("modulationTone")) {
|
||||
streams->back()->setModulationTone(settings.m_streams[istream].m_modulationTone);
|
||||
}
|
||||
if (streamSettingsKeys.contains("amModulation") || force) {
|
||||
streams->back()->setAmModulation(settings.m_streams[istream].m_amModulation);
|
||||
};
|
||||
if (streamSettingsKeys.contains("fmDeviation") || force) {
|
||||
streams->back()->setFmDeviation(settings.m_streams[istream].m_fmDeviation);
|
||||
};
|
||||
if (streamSettingsKeys.contains("dcFactor") || force) {
|
||||
streams->back()->setDcFactor(settings.m_streams[istream].m_dcFactor);
|
||||
};
|
||||
if (streamSettingsKeys.contains("iFactor") || force) {
|
||||
streams->back()->setIFactor(settings.m_streams[istream].m_iFactor);
|
||||
};
|
||||
if (streamSettingsKeys.contains("qFactor") || force) {
|
||||
streams->back()->setQFactor(settings.m_streams[istream].m_qFactor);
|
||||
};
|
||||
if (streamSettingsKeys.contains("phaseImbalance") || force) {
|
||||
streams->back()->setPhaseImbalance(settings.m_streams[istream].m_phaseImbalance);
|
||||
};
|
||||
}
|
||||
}
|
||||
if (deviceSettingsKeys.contains("frequencyShift") || force) {
|
||||
swgTestMISettings->setFrequencyShift(settings.m_frequencyShift);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("sampleRate") || force) {
|
||||
swgTestMISettings->setSampleRate(settings.m_sampleRate);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("log2Decim") || force) {
|
||||
swgTestMISettings->setLog2Decim(settings.m_log2Decim);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("fcPos") || force) {
|
||||
swgTestMISettings->setFcPos((int) settings.m_fcPos);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("sampleSizeIndex") || force) {
|
||||
swgTestMISettings->setSampleSizeIndex(settings.m_sampleSizeIndex);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("amplitudeBits") || force) {
|
||||
swgTestMISettings->setAmplitudeBits(settings.m_amplitudeBits);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("autoCorrOptions") || force) {
|
||||
swgTestMISettings->setAutoCorrOptions((int) settings.m_sampleSizeIndex);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("modulation") || force) {
|
||||
swgTestMISettings->setModulation((int) settings.m_modulation);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("modulationTone")) {
|
||||
swgTestMISettings->setModulationTone(settings.m_modulationTone);
|
||||
}
|
||||
if (deviceSettingsKeys.contains("amModulation") || force) {
|
||||
swgTestMISettings->setAmModulation(settings.m_amModulation);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("fmDeviation") || force) {
|
||||
swgTestMISettings->setFmDeviation(settings.m_fmDeviation);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("dcFactor") || force) {
|
||||
swgTestMISettings->setDcFactor(settings.m_dcFactor);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("iFactor") || force) {
|
||||
swgTestMISettings->setIFactor(settings.m_iFactor);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("qFactor") || force) {
|
||||
swgTestMISettings->setQFactor(settings.m_qFactor);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("phaseImbalance") || force) {
|
||||
swgTestMISettings->setPhaseImbalance(settings.m_phaseImbalance);
|
||||
};
|
||||
if (deviceSettingsKeys.contains("fileRecordName") || force) {
|
||||
|
||||
if (deviceSettingsKeys.m_commonSettingsKeys.contains("fileRecordName") || force) {
|
||||
swgTestMISettings->setFileRecordName(new QString(settings.m_fileRecordName));
|
||||
}
|
||||
|
||||
@ -700,8 +806,6 @@ void TestMI::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const
|
||||
buffer->open((QBuffer::ReadWrite));
|
||||
buffer->write(swgDeviceSettings->asJson().toUtf8());
|
||||
buffer->seek(0);
|
||||
// qDebug("TestMI::webapiReverseSendSettings: %s", channelSettingsURL.toStdString().c_str());
|
||||
// qDebug("TestMI::webapiReverseSendSettings: query:\n%s", swgDeviceSettings->asJson().toStdString().c_str());
|
||||
|
||||
// Always use PATCH to avoid passing reverse API settings
|
||||
m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
|
||||
@ -752,3 +856,12 @@ void TestMI::networkManagerFinished(QNetworkReply *reply)
|
||||
answer.chop(1); // remove last \n
|
||||
qDebug("TestMI::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
|
||||
}
|
||||
|
||||
bool TestMI::isRecording(unsigned int istream) const
|
||||
{
|
||||
if (istream < m_fileSinks.size()) {
|
||||
return m_fileSinks[istream]->isRecording();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -63,17 +63,20 @@ public:
|
||||
|
||||
public:
|
||||
bool getStartStop() const { return m_startStop; }
|
||||
int getStreamIndex() const { return m_streamIndex; }
|
||||
|
||||
static MsgFileRecord* create(bool startStop) {
|
||||
return new MsgFileRecord(startStop);
|
||||
static MsgFileRecord* create(bool startStop, int streamIndex) {
|
||||
return new MsgFileRecord(startStop, streamIndex);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_startStop;
|
||||
int m_streamIndex;
|
||||
|
||||
MsgFileRecord(bool startStop) :
|
||||
MsgFileRecord(bool startStop, int streamIndex) :
|
||||
Message(),
|
||||
m_startStop(startStop)
|
||||
m_startStop(startStop),
|
||||
m_streamIndex(streamIndex)
|
||||
{ }
|
||||
};
|
||||
|
||||
@ -141,12 +144,20 @@ public:
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
|
||||
bool isRecording(unsigned int istream) const;
|
||||
|
||||
private:
|
||||
struct DeviceSettingsKeys
|
||||
{
|
||||
QList<QString> m_commonSettingsKeys;
|
||||
QList<QList<QString>> m_streamsSettingsKeys;
|
||||
};
|
||||
|
||||
DeviceAPI *m_deviceAPI;
|
||||
FileRecord *m_fileSink; //!< File sink to record device I/Q output
|
||||
std::vector<FileRecord *> m_fileSinks; //!< File sinks to record device I/Q output
|
||||
QMutex m_mutex;
|
||||
TestMISettings m_settings;
|
||||
TestMIThread* m_testSourceThread;
|
||||
std::vector<TestMIThread*> m_testSourceThreads;
|
||||
QString m_deviceDescription;
|
||||
bool m_running;
|
||||
const QTimer& m_masterTimer;
|
||||
@ -155,7 +166,7 @@ private:
|
||||
|
||||
bool applySettings(const TestMISettings& settings, bool force);
|
||||
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const TestMISettings& settings);
|
||||
void webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const TestMISettings& settings, bool force);
|
||||
void webapiReverseSendSettings(const DeviceSettingsKeys& deviceSettingsKeys, const TestMISettings& settings, bool force);
|
||||
void webapiReverseSendStartStop(bool start);
|
||||
|
||||
private slots:
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// 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 //
|
||||
@ -52,8 +52,15 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
{
|
||||
qDebug("TestMIGui::TestMIGui");
|
||||
m_sampleMIMO = m_deviceUISet->m_deviceAPI->getSampleMIMO();
|
||||
m_streamIndex = 0;
|
||||
m_deviceCenterFrequencies.push_back(m_settings.m_streams[0].m_centerFrequency);
|
||||
m_deviceCenterFrequencies.push_back(m_settings.m_streams[1].m_centerFrequency);
|
||||
m_deviceSampleRates.push_back(m_settings.m_streams[0].m_sampleRate / (1<<m_settings.m_streams[0].m_log2Decim));
|
||||
m_deviceSampleRates.push_back(m_settings.m_streams[1].m_sampleRate / (1<<m_settings.m_streams[1].m_log2Decim));
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->spectrumSource->addItem("0");
|
||||
ui->spectrumSource->addItem("1");
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->centerFrequency->setValueRange(7, 0, 9999999);
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
@ -104,12 +111,12 @@ void TestMIGui::resetToDefaults()
|
||||
|
||||
qint64 TestMIGui::getCenterFrequency() const
|
||||
{
|
||||
return m_settings.m_centerFrequency;
|
||||
return m_settings.m_streams[m_streamIndex].m_centerFrequency;
|
||||
}
|
||||
|
||||
void TestMIGui::setCenterFrequency(qint64 centerFrequency)
|
||||
{
|
||||
m_settings.m_centerFrequency = centerFrequency;
|
||||
m_settings.m_streams[m_streamIndex].m_centerFrequency = centerFrequency;
|
||||
displaySettings();
|
||||
sendSettings();
|
||||
}
|
||||
@ -141,25 +148,68 @@ void TestMIGui::on_startStop_toggled(bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void TestMIGui::on_streamIndex_currentIndexChanged(int index)
|
||||
{
|
||||
if (ui->streamLock->isChecked())
|
||||
{
|
||||
m_spectrumStreamIndex = index;
|
||||
m_deviceUISet->m_spectrum->setDisplayedStream(true, index);
|
||||
m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, m_spectrumStreamIndex);
|
||||
ui->spectrumSource->blockSignals(true);
|
||||
ui->spectrumSource->setCurrentIndex(index);
|
||||
ui->spectrumSource->blockSignals(false);
|
||||
}
|
||||
|
||||
m_streamIndex = index;
|
||||
updateFileRecordStatus();
|
||||
updateSampleRateAndFrequency();
|
||||
displaySettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_spectrumSource_currentIndexChanged(int index)
|
||||
{
|
||||
m_spectrumStreamIndex = index;
|
||||
m_deviceUISet->m_spectrum->setDisplayedStream(true, index);
|
||||
m_deviceUISet->m_deviceAPI->setSpectrumSinkInput(true, m_spectrumStreamIndex);
|
||||
updateSampleRateAndFrequency();
|
||||
|
||||
if (ui->streamLock->isChecked())
|
||||
{
|
||||
ui->streamIndex->blockSignals(true);
|
||||
ui->streamIndex->setCurrentIndex(index);
|
||||
ui->streamIndex->blockSignals(false);
|
||||
m_streamIndex = index;
|
||||
updateFileRecordStatus();
|
||||
displaySettings();
|
||||
}
|
||||
}
|
||||
|
||||
void TestMIGui::on_streamLock_toggled(bool checked)
|
||||
{
|
||||
if (checked && (ui->streamIndex->currentIndex() != ui->spectrumSource->currentIndex())) {
|
||||
ui->spectrumSource->setCurrentIndex(ui->streamIndex->currentIndex());
|
||||
}
|
||||
}
|
||||
|
||||
void TestMIGui::on_centerFrequency_changed(quint64 value)
|
||||
{
|
||||
m_settings.m_centerFrequency = value * 1000;
|
||||
m_settings.m_streams[m_streamIndex].m_centerFrequency = value * 1000;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_autoCorr_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index < 0) || (index > TestMISettings::AutoCorrLast)) {
|
||||
if ((index < 0) || (index > TestMIStreamSettings::AutoCorrLast)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_autoCorrOptions = (TestMISettings::AutoCorrOptions) index;
|
||||
m_settings.m_streams[m_streamIndex].m_autoCorrOptions = (TestMIStreamSettings::AutoCorrOptions) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_frequencyShift_changed(qint64 value)
|
||||
{
|
||||
m_settings.m_frequencyShift = value;
|
||||
m_settings.m_streams[m_streamIndex].m_frequencyShift = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -169,7 +219,7 @@ void TestMIGui::on_decimation_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_log2Decim = index;
|
||||
m_settings.m_streams[m_streamIndex].m_log2Decim = index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -179,15 +229,15 @@ void TestMIGui::on_fcPos_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_fcPos = (TestMISettings::fcPos_t) index;
|
||||
m_settings.m_streams[m_streamIndex].m_fcPos = (TestMIStreamSettings::fcPos_t) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_sampleRate_changed(quint64 value)
|
||||
{
|
||||
updateFrequencyShiftLimit();
|
||||
m_settings.m_frequencyShift = ui->frequencyShift->getValueNew();
|
||||
m_settings.m_sampleRate = value;
|
||||
m_settings.m_streams[m_streamIndex].m_frequencyShift = ui->frequencyShift->getValueNew();
|
||||
m_settings.m_streams[m_streamIndex].m_sampleRate = value;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -200,8 +250,8 @@ void TestMIGui::on_sampleSize_currentIndexChanged(int index)
|
||||
updateAmpCoarseLimit();
|
||||
updateAmpFineLimit();
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_sampleSizeIndex = index;
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_sampleSizeIndex = index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -210,7 +260,7 @@ void TestMIGui::on_amplitudeCoarse_valueChanged(int value)
|
||||
(void) value;
|
||||
updateAmpFineLimit();
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -218,66 +268,66 @@ void TestMIGui::on_amplitudeFine_valueChanged(int value)
|
||||
{
|
||||
(void) value;
|
||||
displayAmplitude();
|
||||
m_settings.m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
m_settings.m_streams[m_streamIndex].m_amplitudeBits = ui->amplitudeCoarse->value() * 100 + ui->amplitudeFine->value();
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_modulation_currentIndexChanged(int index)
|
||||
{
|
||||
if ((index < 0) || (index > TestMISettings::ModulationLast)) {
|
||||
if ((index < 0) || (index > TestMIStreamSettings::ModulationLast)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_settings.m_modulation = (TestMISettings::Modulation) index;
|
||||
m_settings.m_streams[m_streamIndex].m_modulation = (TestMIStreamSettings::Modulation) index;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_modulationFrequency_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_modulationTone = value;
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_modulationTone / 100.0, 0, 'f', 2));
|
||||
m_settings.m_streams[m_streamIndex].m_modulationTone = value;
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_amModulation_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_amModulation = value;
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_amModulation));
|
||||
m_settings.m_streams[m_streamIndex].m_amModulation = value;
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_fmDeviation_valueChanged(int value)
|
||||
{
|
||||
m_settings.m_fmDeviation = value;
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
m_settings.m_streams[m_streamIndex].m_fmDeviation = value;
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_dcBias_valueChanged(int value)
|
||||
{
|
||||
ui->dcBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_dcFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_dcFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_iBias_valueChanged(int value)
|
||||
{
|
||||
ui->iBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_iFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_iFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_qBias_valueChanged(int value)
|
||||
{
|
||||
ui->qBiasText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_qFactor = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_qFactor = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void TestMIGui::on_phaseImbalance_valueChanged(int value)
|
||||
{
|
||||
ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(value)));
|
||||
m_settings.m_phaseImbalance = value / 100.0f;
|
||||
m_settings.m_streams[m_streamIndex].m_phaseImbalance = value / 100.0f;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -289,7 +339,7 @@ void TestMIGui::on_record_toggled(bool checked)
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
TestMI::MsgFileRecord* message = TestMI::MsgFileRecord::create(checked);
|
||||
TestMI::MsgFileRecord* message = TestMI::MsgFileRecord::create(checked, m_streamIndex);
|
||||
m_sampleMIMO->getInputMessageQueue()->push(message);
|
||||
}
|
||||
|
||||
@ -365,8 +415,18 @@ void TestMIGui::updateAmpFineLimit()
|
||||
|
||||
void TestMIGui::updateFrequencyShiftLimit()
|
||||
{
|
||||
int sampleRate = ui->sampleRate->getValueNew();
|
||||
qint64 sampleRate = ui->sampleRate->getValueNew();
|
||||
ui->frequencyShift->setValueRange(false, 7, -sampleRate, sampleRate);
|
||||
ui->frequencyShift->setValue(m_settings.m_streams[m_streamIndex].m_frequencyShift);
|
||||
}
|
||||
|
||||
void TestMIGui::updateFileRecordStatus()
|
||||
{
|
||||
if (((TestMI*) m_sampleMIMO)->isRecording(m_streamIndex)) {
|
||||
ui->record->setStyleSheet("QToolButton { background-color : red; }");
|
||||
} else {
|
||||
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
}
|
||||
|
||||
void TestMIGui::displaySettings()
|
||||
@ -374,40 +434,41 @@ void TestMIGui::displaySettings()
|
||||
blockApplySettings(true);
|
||||
ui->sampleSize->blockSignals(true);
|
||||
|
||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||
ui->decimation->setCurrentIndex(m_settings.m_log2Decim);
|
||||
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
|
||||
ui->sampleRate->setValue(m_settings.m_sampleRate);
|
||||
ui->streamIndex->setCurrentIndex(m_streamIndex);
|
||||
ui->centerFrequency->setValue(m_settings.m_streams[m_streamIndex].m_centerFrequency / 1000);
|
||||
ui->decimation->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_log2Decim);
|
||||
ui->fcPos->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_fcPos);
|
||||
ui->sampleRate->setValue(m_settings.m_streams[m_streamIndex].m_sampleRate);
|
||||
updateFrequencyShiftLimit();
|
||||
ui->frequencyShift->setValue(m_settings.m_frequencyShift);
|
||||
ui->sampleSize->setCurrentIndex(m_settings.m_sampleSizeIndex);
|
||||
ui->frequencyShift->setValue(m_settings.m_streams[m_streamIndex].m_frequencyShift);
|
||||
ui->sampleSize->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_sampleSizeIndex);
|
||||
updateAmpCoarseLimit();
|
||||
int amplitudeBits = m_settings.m_amplitudeBits;
|
||||
int amplitudeBits = m_settings.m_streams[m_streamIndex].m_amplitudeBits;
|
||||
ui->amplitudeCoarse->setValue(amplitudeBits/100);
|
||||
updateAmpFineLimit();
|
||||
ui->amplitudeFine->setValue(amplitudeBits%100);
|
||||
displayAmplitude();
|
||||
int dcBiasPercent = roundf(m_settings.m_dcFactor * 100.0f);
|
||||
int dcBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_dcFactor * 100.0f);
|
||||
ui->dcBias->setValue((int) dcBiasPercent);
|
||||
ui->dcBiasText->setText(QString(tr("%1 %").arg(dcBiasPercent)));
|
||||
int iBiasPercent = roundf(m_settings.m_iFactor * 100.0f);
|
||||
int iBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_iFactor * 100.0f);
|
||||
ui->iBias->setValue((int) iBiasPercent);
|
||||
ui->iBiasText->setText(QString(tr("%1 %").arg(iBiasPercent)));
|
||||
int qBiasPercent = roundf(m_settings.m_qFactor * 100.0f);
|
||||
int qBiasPercent = roundf(m_settings.m_streams[m_streamIndex].m_qFactor * 100.0f);
|
||||
ui->qBias->setValue((int) qBiasPercent);
|
||||
ui->qBiasText->setText(QString(tr("%1 %").arg(qBiasPercent)));
|
||||
int phaseImbalancePercent = roundf(m_settings.m_phaseImbalance * 100.0f);
|
||||
int phaseImbalancePercent = roundf(m_settings.m_streams[m_streamIndex].m_phaseImbalance * 100.0f);
|
||||
ui->phaseImbalance->setValue((int) phaseImbalancePercent);
|
||||
ui->phaseImbalanceText->setText(QString(tr("%1 %").arg(phaseImbalancePercent)));
|
||||
ui->autoCorr->setCurrentIndex(m_settings.m_autoCorrOptions);
|
||||
ui->autoCorr->setCurrentIndex(m_settings.m_streams[m_streamIndex].m_autoCorrOptions);
|
||||
ui->sampleSize->blockSignals(false);
|
||||
ui->modulation->setCurrentIndex((int) m_settings.m_modulation);
|
||||
ui->modulationFrequency->setValue(m_settings.m_modulationTone);
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_modulationTone / 100.0, 0, 'f', 2));
|
||||
ui->amModulation->setValue(m_settings.m_amModulation);
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_amModulation));
|
||||
ui->fmDeviation->setValue(m_settings.m_fmDeviation);
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
ui->modulation->setCurrentIndex((int) m_settings.m_streams[m_streamIndex].m_modulation);
|
||||
ui->modulationFrequency->setValue(m_settings.m_streams[m_streamIndex].m_modulationTone);
|
||||
ui->modulationFrequencyText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_modulationTone / 100.0, 0, 'f', 2));
|
||||
ui->amModulation->setValue(m_settings.m_streams[m_streamIndex].m_amModulation);
|
||||
ui->amModulationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_amModulation));
|
||||
ui->fmDeviation->setValue(m_settings.m_streams[m_streamIndex].m_fmDeviation);
|
||||
ui->fmDeviationText->setText(QString("%1").arg(m_settings.m_streams[m_streamIndex].m_fmDeviation / 10.0, 0, 'f', 1));
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
@ -493,10 +554,14 @@ void TestMIGui::handleInputMessages()
|
||||
if (DSPDeviceMIMOEngine::SignalNotification::match(*message))
|
||||
{
|
||||
DSPDeviceMIMOEngine::SignalNotification* notif = (DSPDeviceMIMOEngine::SignalNotification*) message;
|
||||
m_deviceSampleRate = notif->getSampleRate();
|
||||
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||
int istream = notif->getIndex();
|
||||
bool sourceOrSink = notif->getSourceOrSink();
|
||||
m_deviceSampleRates[istream] = notif->getSampleRate();
|
||||
m_deviceCenterFrequencies[istream] = notif->getCenterFrequency();
|
||||
// Do not consider multiple sources at this time
|
||||
qDebug("TestMIGui::handleInputMessages: DSPDeviceMIMOEngine::SignalNotification: SampleRate:%d, CenterFrequency:%llu",
|
||||
qDebug("TestMIGui::handleInputMessages: DSPDeviceMIMOEngine::SignalNotification: %s stream: %d SampleRate:%d, CenterFrequency:%llu",
|
||||
sourceOrSink ? "source" : "sink",
|
||||
istream,
|
||||
notif->getSampleRate(),
|
||||
notif->getCenterFrequency());
|
||||
updateSampleRateAndFrequency();
|
||||
@ -515,9 +580,9 @@ void TestMIGui::handleInputMessages()
|
||||
|
||||
void TestMIGui::updateSampleRateAndFrequency()
|
||||
{
|
||||
m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate);
|
||||
m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000));
|
||||
m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRates[m_spectrumStreamIndex]);
|
||||
m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequencies[m_spectrumStreamIndex]);
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float) m_deviceSampleRates[m_streamIndex] / 1000));
|
||||
}
|
||||
|
||||
void TestMIGui::openDeviceSettingsDialog(const QPoint& p)
|
||||
|
@ -57,14 +57,16 @@ private:
|
||||
|
||||
DeviceUISet* m_deviceUISet;
|
||||
TestMISettings m_settings;
|
||||
int m_streamIndex; //!< Current stream index being dealt with
|
||||
int m_spectrumStreamIndex; //!< Index of the stream displayed on main spectrum
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
bool m_doApplySettings;
|
||||
bool m_forceSettings;
|
||||
DeviceSampleMIMO* m_sampleMIMO;
|
||||
std::size_t m_tickCount;
|
||||
int m_deviceSampleRate;
|
||||
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
||||
std::vector<int> m_deviceSampleRates;
|
||||
std::vector<quint64> m_deviceCenterFrequencies; //!< Center frequency in device
|
||||
int m_lastEngineState;
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
@ -76,10 +78,14 @@ private:
|
||||
void updateAmpCoarseLimit();
|
||||
void updateAmpFineLimit();
|
||||
void updateFrequencyShiftLimit();
|
||||
void updateFileRecordStatus();
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
void on_startStop_toggled(bool checked);
|
||||
void on_streamIndex_currentIndexChanged(int index);
|
||||
void on_spectrumSource_currentIndexChanged(int index);
|
||||
void on_streamLock_toggled(bool checked);
|
||||
void on_centerFrequency_changed(quint64 value);
|
||||
void on_autoCorr_currentIndexChanged(int index);
|
||||
void on_frequencyShift_changed(qint64 value);
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>TestMIGui</class>
|
||||
<widget class="QWidget" name="TestSourceGui">
|
||||
<widget class="QWidget" name="TestMIGui">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -50,6 +50,98 @@
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="streamLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Stream</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="streamIndex">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Stream index</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="spectrumSourceLabel">
|
||||
<property name="text">
|
||||
<string>Spectrum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="spectrumSource">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Select stream for main spectrum source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="streamLock">
|
||||
<property name="toolTip">
|
||||
<string>Lock spectrum display to stream selection</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>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<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>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_freq">
|
||||
<property name="topMargin">
|
||||
@ -181,13 +273,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="autoCorrectionsLayout">
|
||||
<item>
|
||||
|
@ -19,12 +19,12 @@
|
||||
#include "util/simpleserializer.h"
|
||||
#include "testmisettings.h"
|
||||
|
||||
TestMISettings::TestMISettings()
|
||||
TestMIStreamSettings::TestMIStreamSettings()
|
||||
{
|
||||
resetToDefaults();
|
||||
}
|
||||
|
||||
void TestMISettings::resetToDefaults()
|
||||
void TestMIStreamSettings::resetToDefaults()
|
||||
{
|
||||
m_centerFrequency = 435000*1000;
|
||||
m_frequencyShift = 0;
|
||||
@ -42,36 +42,64 @@ void TestMISettings::resetToDefaults()
|
||||
m_iFactor = 0.0f;
|
||||
m_qFactor = 0.0f;
|
||||
m_phaseImbalance = 0.0f;
|
||||
}
|
||||
|
||||
TestMISettings::TestMISettings()
|
||||
{
|
||||
m_fileRecordName = "";
|
||||
m_useReverseAPI = false;
|
||||
m_reverseAPIAddress = "127.0.0.1";
|
||||
m_reverseAPIPort = 8888;
|
||||
m_reverseAPIDeviceIndex = 0;
|
||||
m_streams.push_back(TestMIStreamSettings());
|
||||
m_streams.push_back(TestMIStreamSettings());
|
||||
}
|
||||
|
||||
TestMISettings::TestMISettings(const TestMISettings& other) :
|
||||
m_streams(other.m_streams)
|
||||
{
|
||||
m_fileRecordName = other.m_fileRecordName;
|
||||
m_useReverseAPI = other.m_useReverseAPI;
|
||||
m_reverseAPIAddress = other.m_reverseAPIAddress;
|
||||
m_reverseAPIPort = other.m_reverseAPIPort;
|
||||
m_reverseAPIDeviceIndex = other.m_reverseAPIDeviceIndex;
|
||||
}
|
||||
|
||||
void TestMISettings::resetToDefaults()
|
||||
{
|
||||
for (unsigned int i = 0; i < m_streams.size(); i++) {
|
||||
m_streams[i].resetToDefaults();
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray TestMISettings::serialize() const
|
||||
{
|
||||
SimpleSerializer s(1);
|
||||
|
||||
s.writeS32(2, m_frequencyShift);
|
||||
s.writeU32(3, m_sampleRate);
|
||||
s.writeU32(4, m_log2Decim);
|
||||
s.writeS32(5, (int) m_fcPos);
|
||||
s.writeU32(6, m_sampleSizeIndex);
|
||||
s.writeS32(7, m_amplitudeBits);
|
||||
s.writeS32(8, (int) m_autoCorrOptions);
|
||||
s.writeFloat(10, m_dcFactor);
|
||||
s.writeFloat(11, m_iFactor);
|
||||
s.writeFloat(12, m_qFactor);
|
||||
s.writeFloat(13, m_phaseImbalance);
|
||||
s.writeS32(14, (int) m_modulation);
|
||||
s.writeS32(15, m_modulationTone);
|
||||
s.writeS32(16, m_amModulation);
|
||||
s.writeS32(17, m_fmDeviation);
|
||||
s.writeBool(18, m_useReverseAPI);
|
||||
s.writeString(19, m_reverseAPIAddress);
|
||||
s.writeU32(20, m_reverseAPIPort);
|
||||
s.writeU32(21, m_reverseAPIDeviceIndex);
|
||||
s.writeBool(1, m_useReverseAPI);
|
||||
s.writeString(2, m_reverseAPIAddress);
|
||||
s.writeU32(3, m_reverseAPIPort);
|
||||
s.writeU32(4, m_reverseAPIDeviceIndex);
|
||||
|
||||
for (unsigned int i = 0; i < m_streams.size(); i++)
|
||||
{
|
||||
s.writeS32(10 + 30*i, m_streams[i].m_frequencyShift);
|
||||
s.writeU32(11 + 30*i, m_streams[i].m_sampleRate);
|
||||
s.writeU32(12 + 30*i, m_streams[i].m_log2Decim);
|
||||
s.writeS32(13 + 30*i, (int) m_streams[i].m_fcPos);
|
||||
s.writeU32(14 + 30*i, m_streams[i].m_sampleSizeIndex);
|
||||
s.writeS32(15 + 30*i, m_streams[i].m_amplitudeBits);
|
||||
s.writeS32(16 + 30*i, (int) m_streams[i].m_autoCorrOptions);
|
||||
s.writeFloat(17 + 30*i, m_streams[i].m_dcFactor);
|
||||
s.writeFloat(18 + 30*i, m_streams[i].m_iFactor);
|
||||
s.writeFloat(19 + 30*i, m_streams[i].m_qFactor);
|
||||
s.writeFloat(20 + 30*i, m_streams[i].m_phaseImbalance);
|
||||
s.writeS32(21 + 30*i, (int) m_streams[i].m_modulation);
|
||||
s.writeS32(22 + 30*i, m_streams[i].m_modulationTone);
|
||||
s.writeS32(23 + 30*i, m_streams[i].m_amModulation);
|
||||
s.writeS32(24 + 30*i, m_streams[i].m_fmDeviation);
|
||||
}
|
||||
|
||||
return s.final();
|
||||
}
|
||||
|
||||
@ -90,40 +118,9 @@ bool TestMISettings::deserialize(const QByteArray& data)
|
||||
int intval;
|
||||
uint32_t utmp;
|
||||
|
||||
d.readS32(2, &m_frequencyShift, 0);
|
||||
d.readU32(3, &m_sampleRate, 768*1000);
|
||||
d.readU32(4, &m_log2Decim, 4);
|
||||
d.readS32(5, &intval, 0);
|
||||
m_fcPos = (fcPos_t) intval;
|
||||
d.readU32(6, &m_sampleSizeIndex, 0);
|
||||
d.readS32(7, &m_amplitudeBits, 128);
|
||||
d.readS32(8, &intval, 0);
|
||||
|
||||
if (intval < 0 || intval > (int) AutoCorrLast) {
|
||||
m_autoCorrOptions = AutoCorrNone;
|
||||
} else {
|
||||
m_autoCorrOptions = (AutoCorrOptions) intval;
|
||||
}
|
||||
|
||||
d.readFloat(10, &m_dcFactor, 0.0f);
|
||||
d.readFloat(11, &m_iFactor, 0.0f);
|
||||
d.readFloat(12, &m_qFactor, 0.0f);
|
||||
d.readFloat(13, &m_phaseImbalance, 0.0f);
|
||||
d.readS32(14, &intval, 0);
|
||||
|
||||
if (intval < 0 || intval > (int) ModulationLast) {
|
||||
m_modulation = ModulationNone;
|
||||
} else {
|
||||
m_modulation = (Modulation) intval;
|
||||
}
|
||||
|
||||
d.readS32(15, &m_modulationTone, 44);
|
||||
d.readS32(16, &m_amModulation, 50);
|
||||
d.readS32(17, &m_fmDeviation, 50);
|
||||
|
||||
d.readBool(18, &m_useReverseAPI, false);
|
||||
d.readString(19, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(20, &utmp, 0);
|
||||
d.readBool(1, &m_useReverseAPI, false);
|
||||
d.readString(2, &m_reverseAPIAddress, "127.0.0.1");
|
||||
d.readU32(3, &utmp, 0);
|
||||
|
||||
if ((utmp > 1023) && (utmp < 65535)) {
|
||||
m_reverseAPIPort = utmp;
|
||||
@ -131,9 +128,43 @@ bool TestMISettings::deserialize(const QByteArray& data)
|
||||
m_reverseAPIPort = 8888;
|
||||
}
|
||||
|
||||
d.readU32(21, &utmp, 0);
|
||||
d.readU32(4, &utmp, 0);
|
||||
m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
|
||||
|
||||
for (unsigned int i = 0; i < m_streams.size(); i++)
|
||||
{
|
||||
d.readS32(10 + 30*i, &m_streams[i].m_frequencyShift, 0);
|
||||
d.readU32(11 + 30*i, &m_streams[i].m_sampleRate, 768*1000);
|
||||
d.readU32(12 + 30*i, &m_streams[i].m_log2Decim, 4);
|
||||
d.readS32(13 + 30*i, &intval, 0);
|
||||
m_streams[i].m_fcPos = (TestMIStreamSettings::fcPos_t) intval;
|
||||
d.readU32(14 + 30*i, &m_streams[i].m_sampleSizeIndex, 0);
|
||||
d.readS32(15 + 30*i, &m_streams[i].m_amplitudeBits, 128);
|
||||
d.readS32(16 + 30*i, &intval, 0);
|
||||
|
||||
if (intval < 0 || intval > (int) TestMIStreamSettings::AutoCorrLast) {
|
||||
m_streams[i].m_autoCorrOptions = TestMIStreamSettings::AutoCorrNone;
|
||||
} else {
|
||||
m_streams[i].m_autoCorrOptions = (TestMIStreamSettings::AutoCorrOptions) intval;
|
||||
}
|
||||
|
||||
d.readFloat(17 + 30*i, &m_streams[i].m_dcFactor, 0.0f);
|
||||
d.readFloat(18 + 30*i, &m_streams[i].m_iFactor, 0.0f);
|
||||
d.readFloat(19 + 30*i, &m_streams[i].m_qFactor, 0.0f);
|
||||
d.readFloat(20 + 30*i, &m_streams[i].m_phaseImbalance, 0.0f);
|
||||
d.readS32(21 + 30*i, &intval, 0);
|
||||
|
||||
if (intval < 0 || intval > (int) TestMIStreamSettings::ModulationLast) {
|
||||
m_streams[i].m_modulation = TestMIStreamSettings::ModulationNone;
|
||||
} else {
|
||||
m_streams[i].m_modulation = (TestMIStreamSettings::Modulation) intval;
|
||||
}
|
||||
|
||||
d.readS32(22 + 30*i, &m_streams[i].m_modulationTone, 44);
|
||||
d.readS32(23 + 30*i, &m_streams[i].m_amModulation, 50);
|
||||
d.readS32(24 + 30*i, &m_streams[i].m_fmDeviation, 50);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
struct TestMISettings {
|
||||
struct TestMIStreamSettings {
|
||||
typedef enum {
|
||||
FC_POS_INFRA = 0,
|
||||
FC_POS_SUPRA,
|
||||
@ -60,20 +60,25 @@ struct TestMISettings {
|
||||
float m_iFactor; //!< -1.0 < x < 1.0
|
||||
float m_qFactor; //!< -1.0 < x < 1.0
|
||||
float m_phaseImbalance; //!< -1.0 < x < 1.0
|
||||
|
||||
TestMIStreamSettings();
|
||||
void resetToDefaults();
|
||||
};
|
||||
|
||||
struct TestMISettings {
|
||||
QString m_fileRecordName;
|
||||
bool m_useReverseAPI;
|
||||
QString m_reverseAPIAddress;
|
||||
uint16_t m_reverseAPIPort;
|
||||
uint16_t m_reverseAPIDeviceIndex;
|
||||
std::vector<TestMIStreamSettings> m_streams;
|
||||
|
||||
TestMISettings();
|
||||
TestMISettings(const TestMISettings& other);
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _TESTMI_TESTMISETTINGS_H_ */
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(TestMIThread::MsgStartStop, Message)
|
||||
|
||||
TestMIThread::TestMIThread(SampleSinkFifo* sampleFifo, QObject* parent) :
|
||||
TestMIThread::TestMIThread(SampleSinkFifo* sampleFifo, int streamIndex, QObject* parent) :
|
||||
QThread(parent),
|
||||
m_running(false),
|
||||
m_buf(0),
|
||||
@ -36,9 +36,10 @@ TestMIThread::TestMIThread(SampleSinkFifo* sampleFifo, QObject* parent) :
|
||||
m_chunksize(0),
|
||||
m_convertBuffer(TESTMI_BLOCKSIZE),
|
||||
m_sampleFifo(sampleFifo),
|
||||
m_streamIndex(streamIndex),
|
||||
m_frequencyShift(0),
|
||||
m_toneFrequency(440),
|
||||
m_modulation(TestMISettings::ModulationNone),
|
||||
m_modulation(TestMIStreamSettings::ModulationNone),
|
||||
m_amModulation(0.5f),
|
||||
m_fmDeviationUnit(0.0f),
|
||||
m_fmPhasor(0.0f),
|
||||
@ -176,7 +177,7 @@ void TestMIThread::setToneFrequency(int toneFrequency)
|
||||
m_toneNco.setFreq(toneFrequency, m_samplerate);
|
||||
}
|
||||
|
||||
void TestMIThread::setModulation(TestMISettings::Modulation modulation)
|
||||
void TestMIThread::setModulation(TestMIStreamSettings::Modulation modulation)
|
||||
{
|
||||
m_modulation = modulation;
|
||||
}
|
||||
@ -247,7 +248,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
{
|
||||
switch (m_modulation)
|
||||
{
|
||||
case TestMISettings::ModulationAM:
|
||||
case TestMIStreamSettings::ModulationAM:
|
||||
{
|
||||
Complex c = m_nco.nextIQ();
|
||||
Real t, re, im;
|
||||
@ -259,7 +260,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
m_buf[i++] = (int16_t) (im * (float) m_amplitudeBitsQ);
|
||||
}
|
||||
break;
|
||||
case TestMISettings::ModulationFM:
|
||||
case TestMIStreamSettings::ModulationFM:
|
||||
{
|
||||
Complex c = m_nco.nextIQ();
|
||||
Real t, re, im;
|
||||
@ -272,7 +273,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
m_buf[i++] = (int16_t) (im * (float) m_amplitudeBitsQ);
|
||||
}
|
||||
break;
|
||||
case TestMISettings::ModulationPattern0: // binary pattern
|
||||
case TestMIStreamSettings::ModulationPattern0: // binary pattern
|
||||
{
|
||||
if (m_pulseSampleCount < m_pulseWidth) // sync pattern: 0
|
||||
{
|
||||
@ -314,7 +315,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TestMISettings::ModulationPattern1: // sawtooth pattern
|
||||
case TestMIStreamSettings::ModulationPattern1: // sawtooth pattern
|
||||
{
|
||||
Real re, im;
|
||||
re = (float) (m_pulseWidth - m_pulseSampleCount) / (float) m_pulseWidth;
|
||||
@ -329,7 +330,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TestMISettings::ModulationPattern2: // 50% duty cycle square pattern
|
||||
case TestMIStreamSettings::ModulationPattern2: // 50% duty cycle square pattern
|
||||
{
|
||||
if (m_pulseSampleCount < m_pulseWidth) // 1
|
||||
{
|
||||
@ -347,7 +348,7 @@ void TestMIThread::generate(quint32 chunksize)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TestMISettings::ModulationNone:
|
||||
case TestMIStreamSettings::ModulationNone:
|
||||
default:
|
||||
{
|
||||
Complex c = m_nco.nextIQ(m_phaseImbalance);
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
{ }
|
||||
};
|
||||
|
||||
TestMIThread(SampleSinkFifo* sampleFifo, QObject* parent = 0);
|
||||
TestMIThread(SampleSinkFifo* sampleFifo, int streamIndex, QObject* parent = 0);
|
||||
~TestMIThread();
|
||||
|
||||
void startStop(bool start);
|
||||
@ -73,7 +73,7 @@ public:
|
||||
void setPhaseImbalance(float phaseImbalance);
|
||||
void setFrequencyShift(int shift);
|
||||
void setToneFrequency(int toneFrequency);
|
||||
void setModulation(TestMISettings::Modulation modulation);
|
||||
void setModulation(TestMIStreamSettings::Modulation modulation);
|
||||
void setAMModulation(float amModulation);
|
||||
void setFMDeviation(float deviation);
|
||||
void setPattern0();
|
||||
@ -90,11 +90,12 @@ private:
|
||||
quint32 m_chunksize;
|
||||
SampleVector m_convertBuffer;
|
||||
SampleSinkFifo* m_sampleFifo;
|
||||
int m_streamIndex;
|
||||
NCOF m_nco;
|
||||
NCOF m_toneNco;
|
||||
int m_frequencyShift;
|
||||
int m_toneFrequency;
|
||||
TestMISettings::Modulation m_modulation;
|
||||
TestMIStreamSettings::Modulation m_modulation;
|
||||
float m_amModulation;
|
||||
float m_fmDeviationUnit;
|
||||
float m_fmPhasor;
|
||||
|
@ -58,10 +58,10 @@ DeviceAPI::~DeviceAPI()
|
||||
{
|
||||
}
|
||||
|
||||
void DeviceAPI::addSourceStream()
|
||||
void DeviceAPI::addSourceStream(bool connect)
|
||||
{
|
||||
if (m_deviceMIMOEngine) {
|
||||
m_deviceMIMOEngine->addSourceStream();
|
||||
m_deviceMIMOEngine->addSourceStream(connect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,10 +72,10 @@ void DeviceAPI::removeLastSourceStream()
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceAPI::addSinkStream()
|
||||
void DeviceAPI::addSinkStream(bool connect)
|
||||
{
|
||||
if (m_deviceMIMOEngine) {
|
||||
m_deviceMIMOEngine->addSinkStream();
|
||||
m_deviceMIMOEngine->addSinkStream(connect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,21 +86,25 @@ void DeviceAPI::removeLastSinkStream()
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceAPI::addAncillarySink(BasebandSampleSink *sink)
|
||||
void DeviceAPI::addAncillarySink(BasebandSampleSink *sink, unsigned int index)
|
||||
{
|
||||
if (m_deviceSourceEngine) {
|
||||
m_deviceSourceEngine->addSink(sink);
|
||||
} else if (m_deviceSinkEngine) {
|
||||
m_deviceSinkEngine->addSpectrumSink(sink);
|
||||
} else if (m_deviceMIMOEngine) {
|
||||
m_deviceMIMOEngine->addAncillarySink(sink, index);
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceAPI::removeAncillarySink(BasebandSampleSink* sink)
|
||||
void DeviceAPI::removeAncillarySink(BasebandSampleSink* sink, unsigned int index)
|
||||
{
|
||||
if (m_deviceSourceEngine) {
|
||||
m_deviceSourceEngine->removeSink(sink);
|
||||
} else if (m_deviceSinkEngine) {
|
||||
m_deviceSinkEngine->removeSpectrumSink(sink);
|
||||
} else if (m_deviceMIMOEngine) {
|
||||
m_deviceMIMOEngine->removeAncillarySink(sink, index);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,6 +130,8 @@ void DeviceAPI::removeChannelSink(ThreadedBasebandSampleSink* sink, int streamIn
|
||||
|
||||
if (m_deviceSourceEngine) {
|
||||
m_deviceSourceEngine->removeThreadedSink(sink);
|
||||
} else if (m_deviceMIMOEngine) {
|
||||
m_deviceMIMOEngine->removeChannelSink(sink, streamIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,13 +67,13 @@ public:
|
||||
~DeviceAPI();
|
||||
|
||||
// MIMO Engine baseband / channel lists management
|
||||
void addSourceStream();
|
||||
void addSourceStream(bool connect);
|
||||
void removeLastSourceStream();
|
||||
void addSinkStream();
|
||||
void addSinkStream(bool connect);
|
||||
void removeLastSinkStream();
|
||||
|
||||
void addAncillarySink(BasebandSampleSink* sink); //!< Adds a sink to receive full baseband and that is not a channel (e.g. spectrum)
|
||||
void removeAncillarySink(BasebandSampleSink* sink); //!< Removes it
|
||||
void addAncillarySink(BasebandSampleSink* sink, unsigned int index = 0); //!< Adds a sink to receive full baseband and that is not a channel (e.g. spectrum)
|
||||
void removeAncillarySink(BasebandSampleSink* sink, unsigned int index = 0); //!< Removes it
|
||||
void setSpectrumSinkInput(bool sourceElseSink = true, unsigned int index = 0); //!< Used in the MIMO case to select which stream is used as input to main spectrum
|
||||
|
||||
void addChannelSink(ThreadedBasebandSampleSink* sink, int streamIndex = 0); //!< Add a channel sink (Rx)
|
||||
|
@ -37,7 +37,9 @@ ChannelMarker::ChannelMarker(QObject* parent) :
|
||||
m_highlighted(false),
|
||||
m_color(m_colorTable[m_nextColor]),
|
||||
m_movable(true),
|
||||
m_fScaleDisplayType(FScaleDisplay_freq)
|
||||
m_fScaleDisplayType(FScaleDisplay_freq),
|
||||
m_sourceOrSinkStream(true),
|
||||
m_streamIndex(0)
|
||||
{
|
||||
++m_nextColor;
|
||||
if(m_colorTable[m_nextColor] == 0)
|
||||
|
@ -72,6 +72,11 @@ public:
|
||||
const QString& getDisplayAddressSend() const { return m_displayAddressSend; }
|
||||
const QString& getDisplayAddressReceive() const { return m_displayAddressReceive; }
|
||||
|
||||
void setSourceOrSinkStream(bool sourceOrSinkStream) { m_sourceOrSinkStream = sourceOrSinkStream; }
|
||||
bool getSourceOrSinkStream() const { return m_sourceOrSinkStream; }
|
||||
void setStreamIndex(int streamIndex) { m_streamIndex = streamIndex; }
|
||||
int getStreamIndex() const { return m_streamIndex; }
|
||||
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
|
||||
@ -92,6 +97,8 @@ protected:
|
||||
QColor m_color;
|
||||
bool m_movable;
|
||||
frequencyScaleDisplay_t m_fScaleDisplayType;
|
||||
bool m_sourceOrSinkStream;
|
||||
int m_streamIndex;
|
||||
|
||||
void resetToDefaults();
|
||||
|
||||
|
@ -122,10 +122,10 @@ void DSPDeviceMIMOEngine::setMIMOSequence(int sequence)
|
||||
m_sampleMIMOSequence = sequence;
|
||||
}
|
||||
|
||||
void DSPDeviceMIMOEngine::addSourceStream()
|
||||
void DSPDeviceMIMOEngine::addSourceStream(bool connect)
|
||||
{
|
||||
qDebug("DSPDeviceMIMOEngine::addSourceStream");
|
||||
AddSourceStream cmd;
|
||||
AddSourceStream cmd(connect);
|
||||
m_syncMessenger.sendWait(cmd);
|
||||
}
|
||||
|
||||
@ -136,10 +136,10 @@ void DSPDeviceMIMOEngine::removeLastSourceStream()
|
||||
m_syncMessenger.sendWait(cmd);
|
||||
}
|
||||
|
||||
void DSPDeviceMIMOEngine::addSinkStream()
|
||||
void DSPDeviceMIMOEngine::addSinkStream(bool connect)
|
||||
{
|
||||
qDebug("DSPDeviceMIMOEngine::addSinkStream");
|
||||
AddSinkStream cmd;
|
||||
AddSinkStream cmd(connect);
|
||||
m_syncMessenger.sendWait(cmd);
|
||||
}
|
||||
|
||||
@ -335,6 +335,87 @@ void DSPDeviceMIMOEngine::work(int nbWriteSamples)
|
||||
// TODO: sinks
|
||||
}
|
||||
|
||||
void DSPDeviceMIMOEngine::workSampleSink(unsigned int sinkIndex)
|
||||
{
|
||||
if (m_state != StRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
SampleSinkFifo* sampleFifo = m_deviceSampleMIMO->getSampleSinkFifo(sinkIndex);
|
||||
int samplesDone = 0;
|
||||
bool positiveOnly = false;
|
||||
|
||||
while ((sampleFifo->fill() > 0) && (m_inputMessageQueue.size() == 0) && (samplesDone < m_deviceSampleMIMO->getSourceSampleRate(sinkIndex)))
|
||||
{
|
||||
SampleVector::iterator part1begin;
|
||||
SampleVector::iterator part1end;
|
||||
SampleVector::iterator part2begin;
|
||||
SampleVector::iterator part2end;
|
||||
|
||||
std::size_t count = sampleFifo->readBegin(sampleFifo->fill(), &part1begin, &part1end, &part2begin, &part2end);
|
||||
|
||||
// first part of FIFO data
|
||||
if (part1begin != part1end)
|
||||
{
|
||||
// DC and IQ corrections
|
||||
if (m_sourcesCorrections[sinkIndex].m_dcOffsetCorrection) {
|
||||
iqCorrections(part1begin, part1end, sinkIndex, m_sourcesCorrections[sinkIndex].m_iqImbalanceCorrection);
|
||||
}
|
||||
|
||||
// feed data to direct sinks
|
||||
if (sinkIndex < m_basebandSampleSinks.size())
|
||||
{
|
||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[sinkIndex].begin(); it != m_basebandSampleSinks[sinkIndex].end(); ++it) {
|
||||
(*it)->feed(part1begin, part1end, positiveOnly);
|
||||
}
|
||||
}
|
||||
|
||||
// possibly feed data to spectrum sink
|
||||
if ((m_spectrumSink) && (m_spectrumInputSourceElseSink) && (sinkIndex == m_spectrumInputIndex)) {
|
||||
m_spectrumSink->feed(part1begin, part1end, positiveOnly);
|
||||
}
|
||||
|
||||
// feed data to threaded sinks
|
||||
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks[sinkIndex].begin(); it != m_threadedBasebandSampleSinks[sinkIndex].end(); ++it)
|
||||
{
|
||||
(*it)->feed(part1begin, part1end, positiveOnly);
|
||||
}
|
||||
}
|
||||
|
||||
// second part of FIFO data (used when block wraps around)
|
||||
if(part2begin != part2end)
|
||||
{
|
||||
// DC and IQ corrections
|
||||
if (m_sourcesCorrections[sinkIndex].m_dcOffsetCorrection) {
|
||||
iqCorrections(part2begin, part2end, sinkIndex, m_sourcesCorrections[sinkIndex].m_iqImbalanceCorrection);
|
||||
}
|
||||
|
||||
// feed data to direct sinks
|
||||
if (sinkIndex < m_basebandSampleSinks.size())
|
||||
{
|
||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[sinkIndex].begin(); it != m_basebandSampleSinks[sinkIndex].end(); ++it) {
|
||||
(*it)->feed(part2begin, part2end, positiveOnly);
|
||||
}
|
||||
}
|
||||
|
||||
// possibly feed data to spectrum sink
|
||||
if ((m_spectrumSink) && (m_spectrumInputSourceElseSink) && (sinkIndex == m_spectrumInputIndex)) {
|
||||
m_spectrumSink->feed(part2begin, part2end, positiveOnly);
|
||||
}
|
||||
|
||||
// feed data to threaded sinks
|
||||
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks[sinkIndex].begin(); it != m_threadedBasebandSampleSinks[sinkIndex].end(); ++it)
|
||||
{
|
||||
(*it)->feed(part2begin, part2end, positiveOnly);
|
||||
}
|
||||
}
|
||||
|
||||
// adjust FIFO pointers
|
||||
sampleFifo->readCommit((unsigned int) count);
|
||||
samplesDone += count;
|
||||
}
|
||||
}
|
||||
|
||||
// notStarted -> idle -> init -> running -+
|
||||
// ^ |
|
||||
// +-----------------------+
|
||||
@ -544,7 +625,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoError(const QString& errorMe
|
||||
|
||||
void DSPDeviceMIMOEngine::handleData()
|
||||
{
|
||||
if(m_state == StRunning)
|
||||
if (m_state == StRunning)
|
||||
{
|
||||
work(0); // TODO: implement Tx side
|
||||
}
|
||||
@ -554,14 +635,38 @@ void DSPDeviceMIMOEngine::handleSetMIMO(DeviceSampleMIMO* mimo)
|
||||
{
|
||||
m_deviceSampleMIMO = mimo;
|
||||
|
||||
if (mimo && (mimo->getNbSinkFifos() > 0))
|
||||
if (mimo)
|
||||
{
|
||||
// if there is at least one Rx then the first Rx drives the FIFOs
|
||||
qDebug("DSPDeviceMIMOEngine::handleSetMIMO: set %s", qPrintable(mimo->getDeviceDescription()));
|
||||
connect(m_deviceSampleMIMO->getSampleSinkFifo(0), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
||||
if ((m_sampleSinkConnectionIndexes.size() == 1) && (m_sampleSourceConnectionIndexes.size() == 0)) // true MIMO (synchronous FIFOs)
|
||||
{
|
||||
qDebug("DSPDeviceMIMOEngine::handleSetMIMO: synchronous set %s", qPrintable(mimo->getDeviceDescription()));
|
||||
// connect(m_deviceSampleMIMO->getSampleSinkFifo(m_sampleSinkConnectionIndexes[0]), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
||||
QObject::connect(
|
||||
m_deviceSampleMIMO->getSampleSinkFifo(m_sampleSinkConnectionIndexes[0]),
|
||||
&SampleSinkFifo::dataReady,
|
||||
this,
|
||||
[=](){ this->handleData(); }, // lambda function is not strictly needed here
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
}
|
||||
else if (m_sampleSinkConnectionIndexes.size() != 0) // asynchronous FIFOs
|
||||
{
|
||||
for (unsigned int isink = 0; isink < m_sampleSinkConnectionIndexes.size(); isink++)
|
||||
{
|
||||
qDebug("DSPDeviceMIMOEngine::handleSetMIMO: asynchronous sources set %s channel %u",
|
||||
qPrintable(mimo->getDeviceDescription()), isink);
|
||||
QObject::connect(
|
||||
m_deviceSampleMIMO->getSampleSinkFifo(m_sampleSinkConnectionIndexes[isink]),
|
||||
&SampleSinkFifo::dataReady,
|
||||
this,
|
||||
[=](){ this->workSampleSink(isink); },
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: only Tx
|
||||
// TODO: Tx
|
||||
}
|
||||
|
||||
void DSPDeviceMIMOEngine::handleSynchronousMessages()
|
||||
@ -601,8 +706,13 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
|
||||
else if (AddSourceStream::match(*message))
|
||||
{
|
||||
m_basebandSampleSinks.push_back(BasebandSampleSinks());
|
||||
int currentIndex = m_threadedBasebandSampleSinks.size();
|
||||
m_threadedBasebandSampleSinks.push_back(ThreadedBasebandSampleSinks());
|
||||
m_sourcesCorrections.push_back(SourceCorrection());
|
||||
|
||||
if (((AddSourceStream *) message)->getConnect()) {
|
||||
m_sampleSinkConnectionIndexes.push_back(currentIndex);
|
||||
}
|
||||
}
|
||||
else if (RemoveLastSourceStream::match(*message))
|
||||
{
|
||||
@ -611,7 +721,12 @@ void DSPDeviceMIMOEngine::handleSynchronousMessages()
|
||||
}
|
||||
else if (AddSinkStream::match(*message))
|
||||
{
|
||||
int currentIndex = m_threadedBasebandSampleSources.size();
|
||||
m_threadedBasebandSampleSources.push_back(ThreadedBasebandSampleSources());
|
||||
|
||||
if (((AddSinkStream *) message)->getConnect()) {
|
||||
m_sampleSourceConnectionIndexes.push_back(currentIndex);
|
||||
}
|
||||
}
|
||||
else if (RemoveLastSinkStream::match(*message))
|
||||
{
|
||||
@ -839,7 +954,6 @@ void DSPDeviceMIMOEngine::handleInputMessages()
|
||||
<< " sampleRate: " << sampleRate
|
||||
<< " centerFrequency: " << centerFrequency;
|
||||
|
||||
|
||||
if (sourceElseSink)
|
||||
{
|
||||
if ((istream < m_deviceSampleMIMO->getNbSourceStreams()))
|
||||
@ -875,6 +989,7 @@ void DSPDeviceMIMOEngine::handleInputMessages()
|
||||
guiMessageQueue->push(rep);
|
||||
}
|
||||
|
||||
// forward changes to spectrum sink if currently active
|
||||
if (m_spectrumSink && m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
||||
{
|
||||
DSPSignalNotification spectrumNotif(sampleRate, centerFrequency);
|
||||
@ -907,6 +1022,7 @@ void DSPDeviceMIMOEngine::handleInputMessages()
|
||||
guiMessageQueue->push(rep);
|
||||
}
|
||||
|
||||
// forward changes to spectrum sink if currently active
|
||||
if (m_spectrumSink && !m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
||||
{
|
||||
DSPSignalNotification spectrumNotif(sampleRate, centerFrequency);
|
||||
@ -938,3 +1054,92 @@ void DSPDeviceMIMOEngine::handleForwardToSpectrumSink(int nbSamples)
|
||||
m_spectrumSink->feed(readUntil - nbSamples, readUntil, false);
|
||||
}
|
||||
}
|
||||
|
||||
void DSPDeviceMIMOEngine::iqCorrections(SampleVector::iterator begin, SampleVector::iterator end, int isource, bool imbalanceCorrection)
|
||||
{
|
||||
for(SampleVector::iterator it = begin; it < end; it++)
|
||||
{
|
||||
m_sourcesCorrections[isource].m_iBeta(it->real());
|
||||
m_sourcesCorrections[isource].m_qBeta(it->imag());
|
||||
|
||||
if (imbalanceCorrection)
|
||||
{
|
||||
#if IMBALANCE_INT
|
||||
// acquisition
|
||||
int64_t xi = (it->m_real - (int32_t) m_sourcesCorrections[isource].m_iBeta) << 5;
|
||||
int64_t xq = (it->m_imag - (int32_t) m_sourcesCorrections[isource].m_qBeta) << 5;
|
||||
|
||||
// phase imbalance
|
||||
m_sourcesCorrections[isource].m_avgII((xi*xi)>>28); // <I", I">
|
||||
m_sourcesCorrections[isource].m_avgIQ((xi*xq)>>28); // <I", Q">
|
||||
|
||||
if ((int64_t) m_sourcesCorrections[isource].m_avgII != 0)
|
||||
{
|
||||
int64_t phi = (((int64_t) m_sourcesCorrections[isource].m_avgIQ)<<28) / (int64_t) m_sourcesCorrections[isource].m_avgII;
|
||||
m_sourcesCorrections[isource].m_avgPhi(phi);
|
||||
}
|
||||
|
||||
int64_t corrPhi = (((int64_t) m_sourcesCorrections[isource].m_avgPhi) * xq) >> 28; //(m_avgPhi.asDouble()/16777216.0) * ((double) xq);
|
||||
|
||||
int64_t yi = xi - corrPhi;
|
||||
int64_t yq = xq;
|
||||
|
||||
// amplitude I/Q imbalance
|
||||
m_sourcesCorrections[isource].m_avgII2((yi*yi)>>28); // <I, I>
|
||||
m_sourcesCorrections[isource].m_avgQQ2((yq*yq)>>28); // <Q, Q>
|
||||
|
||||
if ((int64_t) m_sourcesCorrections[isource].m_avgQQ2 != 0)
|
||||
{
|
||||
int64_t a = (((int64_t) m_sourcesCorrections[isource].m_avgII2)<<28) / (int64_t) m_sourcesCorrections[isource].m_avgQQ2;
|
||||
Fixed<int64_t, 28> fA(Fixed<int64_t, 28>::internal(), a);
|
||||
Fixed<int64_t, 28> sqrtA = sqrt((Fixed<int64_t, 28>) fA);
|
||||
m_sourcesCorrections[isource].m_avgAmp(sqrtA.as_internal());
|
||||
}
|
||||
|
||||
int64_t zq = (((int64_t) m_sourcesCorrections[isource].m_avgAmp) * yq) >> 28;
|
||||
|
||||
it->m_real = yi >> 5;
|
||||
it->m_imag = zq >> 5;
|
||||
|
||||
#else
|
||||
// DC correction and conversion
|
||||
float xi = (it->m_real - (int32_t) m_sourcesCorrections[isource].m_iBeta) / SDR_RX_SCALEF;
|
||||
float xq = (it->m_imag - (int32_t) m_sourcesCorrections[isource].m_qBeta) / SDR_RX_SCALEF;
|
||||
|
||||
// phase imbalance
|
||||
m_sourcesCorrections[isource].m_avgII(xi*xi); // <I", I">
|
||||
m_sourcesCorrections[isource].m_avgIQ(xi*xq); // <I", Q">
|
||||
|
||||
|
||||
if (m_sourcesCorrections[isource].m_avgII.asDouble() != 0) {
|
||||
m_sourcesCorrections[isource].m_avgPhi(m_sourcesCorrections[isource].m_avgIQ.asDouble()/m_sourcesCorrections[isource].m_avgII.asDouble());
|
||||
}
|
||||
|
||||
float& yi = xi; // the in phase remains the reference
|
||||
float yq = xq - m_sourcesCorrections[isource].m_avgPhi.asDouble()*xi;
|
||||
|
||||
// amplitude I/Q imbalance
|
||||
m_sourcesCorrections[isource].m_avgII2(yi*yi); // <I, I>
|
||||
m_sourcesCorrections[isource].m_avgQQ2(yq*yq); // <Q, Q>
|
||||
|
||||
if (m_sourcesCorrections[isource].m_avgQQ2.asDouble() != 0) {
|
||||
m_sourcesCorrections[isource].m_avgAmp(sqrt(m_sourcesCorrections[isource].m_avgII2.asDouble() / m_sourcesCorrections[isource].m_avgQQ2.asDouble()));
|
||||
}
|
||||
|
||||
// final correction
|
||||
float& zi = yi; // the in phase remains the reference
|
||||
float zq = m_sourcesCorrections[isource].m_avgAmp.asDouble() * yq;
|
||||
|
||||
// convert and store
|
||||
it->m_real = zi * SDR_RX_SCALEF;
|
||||
it->m_imag = zq * SDR_RX_SCALEF;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// DC correction only
|
||||
it->m_real -= (int32_t) m_sourcesCorrections[isource].m_iBeta;
|
||||
it->m_imag -= (int32_t) m_sourcesCorrections[isource].m_qBeta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,11 @@ public:
|
||||
|
||||
class AddSourceStream : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
public:
|
||||
AddSourceStream(bool connect) : Message(), m_connect(connect) { }
|
||||
bool getConnect() const { return m_connect; }
|
||||
private:
|
||||
bool m_connect;
|
||||
};
|
||||
|
||||
class RemoveLastSourceStream : public Message {
|
||||
@ -70,6 +75,11 @@ public:
|
||||
|
||||
class AddSinkStream : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
public:
|
||||
AddSinkStream(bool connect) : Message(), m_connect(connect) { }
|
||||
bool getConnect() const { return m_connect; }
|
||||
private:
|
||||
bool m_connect;
|
||||
};
|
||||
|
||||
class RemoveLastSinkStream : public Message {
|
||||
@ -266,9 +276,9 @@ public:
|
||||
void setMIMOSequence(int sequence); //!< Set the sample MIMO sequence in type
|
||||
uint getUID() const { return m_uid; }
|
||||
|
||||
void addSourceStream();
|
||||
void addSourceStream(bool connect);
|
||||
void removeLastSourceStream();
|
||||
void addSinkStream();
|
||||
void addSinkStream(bool connect);
|
||||
void removeLastSinkStream();
|
||||
|
||||
void addChannelSource(ThreadedBasebandSampleSource* source, int index = 0); //!< Add a channel source that will run on its own thread
|
||||
@ -358,9 +368,11 @@ private:
|
||||
|
||||
typedef std::list<ThreadedBasebandSampleSink*> ThreadedBasebandSampleSinks;
|
||||
std::vector<ThreadedBasebandSampleSinks> m_threadedBasebandSampleSinks; //!< channel sample sinks on their own thread (per input stream)
|
||||
std::vector<int> m_sampleSinkConnectionIndexes;
|
||||
|
||||
typedef std::list<ThreadedBasebandSampleSource*> ThreadedBasebandSampleSources;
|
||||
std::vector<ThreadedBasebandSampleSources> m_threadedBasebandSampleSources; //!< channel sample sources on their own threads (per output stream)
|
||||
std::vector<int> m_sampleSourceConnectionIndexes;
|
||||
|
||||
std::vector<SourceCorrection> m_sourcesCorrections;
|
||||
|
||||
@ -377,9 +389,11 @@ private:
|
||||
State gotoError(const QString& errorMsg); //!< Go to an error state
|
||||
|
||||
void handleSetMIMO(DeviceSampleMIMO* mimo); //!< Manage MIMO device setting
|
||||
void iqCorrections(SampleVector::iterator begin, SampleVector::iterator end, int isource, bool imbalanceCorrection);
|
||||
|
||||
private slots:
|
||||
void handleData(); //!< Handle data when samples have to be processed
|
||||
void workSampleSink(unsigned int sinkIndex);
|
||||
void handleSynchronousMessages(); //!< Handle synchronous messages with the thread
|
||||
void handleInputMessages(); //!< Handle input message queue
|
||||
void handleForwardToSpectrumSink(int nbSamples);
|
||||
|
@ -64,9 +64,13 @@ void FileRecord::setFileName(const QString& filename)
|
||||
}
|
||||
}
|
||||
|
||||
void FileRecord::genUniqueFileName(uint deviceUID)
|
||||
void FileRecord::genUniqueFileName(uint deviceUID, int istream)
|
||||
{
|
||||
setFileName(QString("rec%1_%2.sdriq").arg(deviceUID).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz")));
|
||||
if (istream < 0) {
|
||||
setFileName(QString("rec%1_%2.sdriq").arg(deviceUID).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz")));
|
||||
} else {
|
||||
setFileName(QString("rec%1_%2_%3.sdriq").arg(deviceUID).arg(istream).arg(QDateTime::currentDateTimeUtc().toString("yyyy-MM-ddTHH_mm_ss_zzz")));
|
||||
}
|
||||
}
|
||||
|
||||
void FileRecord::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
quint64 getByteCount() const { return m_byteCount; }
|
||||
|
||||
void setFileName(const QString& filename);
|
||||
void genUniqueFileName(uint deviceUID);
|
||||
void genUniqueFileName(uint deviceUID, int istream = -1);
|
||||
|
||||
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
|
||||
virtual void start();
|
||||
@ -58,6 +58,7 @@ public:
|
||||
virtual bool handleMessage(const Message& message);
|
||||
void startRecording();
|
||||
void stopRecording();
|
||||
bool isRecording() const { return m_recordOn; }
|
||||
static bool readHeader(std::ifstream& samplefile, Header& header); //!< returns true if CRC checksum is correct else false
|
||||
static void writeHeader(std::ofstream& samplefile, Header& header);
|
||||
|
||||
|
@ -5216,6 +5216,38 @@ margin-bottom: 20px;
|
||||
};
|
||||
defs.TestMISettings = {
|
||||
"properties" : {
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"streams" : {
|
||||
"type" : "array",
|
||||
"description" : "Settings for each of the streams",
|
||||
"items" : {
|
||||
"$ref" : "#/definitions/TestMiStreamSettings"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description" : "TestMISettings"
|
||||
};
|
||||
defs.TestMiStreamSettings = {
|
||||
"properties" : {
|
||||
"streamIndex" : {
|
||||
"type" : "integer",
|
||||
"description" : "Index of the stream to which the settings apply"
|
||||
},
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "uint64"
|
||||
@ -5268,25 +5300,9 @@ margin-bottom: 20px;
|
||||
"phaseImbalance" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
},
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "TestSourceMI"
|
||||
"description" : "TestMiStreamSettings"
|
||||
};
|
||||
defs.TestSourceSettings = {
|
||||
"properties" : {
|
||||
@ -25084,7 +25100,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2019-05-20T16:12:41.467+02:00
|
||||
Generated 2019-05-25T21:27:31.978+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,43 +1,6 @@
|
||||
TestMISettings:
|
||||
description: TestSourceMI
|
||||
description: TestMISettings
|
||||
properties:
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: uint64
|
||||
frequencyShift:
|
||||
type: integer
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
fcPos:
|
||||
type: integer
|
||||
sampleSizeIndex:
|
||||
type: integer
|
||||
amplitudeBits:
|
||||
type: integer
|
||||
autoCorrOptions:
|
||||
type: integer
|
||||
modulation:
|
||||
type: integer
|
||||
modulationTone:
|
||||
type: integer
|
||||
amModulation:
|
||||
type: integer
|
||||
fmDeviation:
|
||||
type: integer
|
||||
dcFactor:
|
||||
type: number
|
||||
format: float
|
||||
iFactor:
|
||||
type: number
|
||||
format: float
|
||||
qFactor:
|
||||
type: number
|
||||
format: float
|
||||
phaseImbalance:
|
||||
type: number
|
||||
format: float
|
||||
fileRecordName:
|
||||
type: string
|
||||
useReverseAPI:
|
||||
@ -49,3 +12,53 @@ TestMISettings:
|
||||
type: integer
|
||||
reverseAPIDeviceIndex:
|
||||
type: integer
|
||||
streams:
|
||||
description: Settings for each of the streams
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/TestMiStreamSettings"
|
||||
|
||||
definitions:
|
||||
TestMiStreamSettings:
|
||||
description: TestMiStreamSettings
|
||||
properties:
|
||||
streamIndex:
|
||||
description: Index of the stream to which the settings apply
|
||||
type: integer
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: uint64
|
||||
frequencyShift:
|
||||
type: integer
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
fcPos:
|
||||
type: integer
|
||||
sampleSizeIndex:
|
||||
type: integer
|
||||
amplitudeBits:
|
||||
type: integer
|
||||
autoCorrOptions:
|
||||
type: integer
|
||||
modulation:
|
||||
type: integer
|
||||
modulationTone:
|
||||
type: integer
|
||||
amModulation:
|
||||
type: integer
|
||||
fmDeviation:
|
||||
type: integer
|
||||
dcFactor:
|
||||
type: number
|
||||
format: float
|
||||
iFactor:
|
||||
type: number
|
||||
format: float
|
||||
qFactor:
|
||||
type: number
|
||||
format: float
|
||||
phaseImbalance:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -2096,6 +2096,27 @@ bool WebAPIRequestMapper::validateDeviceSettings(
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ((*deviceHwType == "TestMI") && (deviceSettings.getDirection() == 2))
|
||||
{
|
||||
if (jsonObject.contains("TestMISettings") && jsonObject["TestMISettings"].isObject())
|
||||
{
|
||||
QJsonObject testMISettingsJsonObject = jsonObject["TestMISettings"].toObject();
|
||||
deviceSettingsKeys = testMISettingsJsonObject.keys();
|
||||
|
||||
if (deviceSettingsKeys.contains("streams") && testMISettingsJsonObject["streams"].isArray())
|
||||
{
|
||||
appendSettingsArrayKeys(testMISettingsJsonObject, "streams", deviceSettingsKeys);
|
||||
}
|
||||
|
||||
deviceSettings.setTestMiSettings(new SWGSDRangel::SWGTestMISettings());
|
||||
deviceSettings.getTestMiSettings()->fromJsonObject(testMISettingsJsonObject);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ((*deviceHwType == "XTRX") && (deviceSettings.getDirection() == 0))
|
||||
{
|
||||
if (jsonObject.contains("xtrxInputSettings") && jsonObject["xtrxInputSettings"].isObject())
|
||||
@ -2601,6 +2622,30 @@ void WebAPIRequestMapper::appendSettingsSubKeys(
|
||||
}
|
||||
}
|
||||
|
||||
void WebAPIRequestMapper::appendSettingsArrayKeys(
|
||||
const QJsonObject& parentSettingsJsonObject,
|
||||
const QString& parentKey,
|
||||
QStringList& keyList)
|
||||
{
|
||||
QJsonArray streams = parentSettingsJsonObject[parentKey].toArray();
|
||||
|
||||
for (int istream = 0; istream < streams.count(); istream++)
|
||||
{
|
||||
QJsonValue v = streams.takeAt(istream);
|
||||
|
||||
if (v.isObject())
|
||||
{
|
||||
QJsonObject streamSettingsJsonObject = v.toObject();
|
||||
QStringList streamSettingsKeys = streamSettingsJsonObject.keys();
|
||||
|
||||
for (int i = 0; i < streamSettingsKeys.size(); i++) {
|
||||
keyList.append(tr("streams[%1].%2").arg(istream).arg(streamSettingsKeys[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WebAPIRequestMapper::resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings)
|
||||
{
|
||||
deviceSettings.cleanup();
|
||||
|
@ -92,6 +92,11 @@ private:
|
||||
const QString& parentKey,
|
||||
QStringList& keyList);
|
||||
|
||||
void appendSettingsArrayKeys(
|
||||
const QJsonObject& parentSettingsJsonObject,
|
||||
const QString& parentKey,
|
||||
QStringList& keyList);
|
||||
|
||||
bool parseJsonBody(QString& jsonStr, QJsonObject& jsonObject, qtwebapp::HttpResponse& response);
|
||||
|
||||
void resetDeviceSettings(SWGSDRangel::SWGDeviceSettings& deviceSettings);
|
||||
|
@ -64,6 +64,8 @@ GLSpectrum::GLSpectrum(QWidget* parent) :
|
||||
m_histogram(0),
|
||||
m_displayHistogram(true),
|
||||
m_displayChanged(false),
|
||||
m_displaySourceOrSink(true),
|
||||
m_displayStreamIndex(0),
|
||||
m_matrixLoc(0),
|
||||
m_colorLoc(0),
|
||||
m_messageQueueToGUI(0)
|
||||
@ -605,7 +607,10 @@ void GLSpectrum::paintGL()
|
||||
for (int i = 0; i < m_channelMarkerStates.size(); ++i)
|
||||
{
|
||||
ChannelMarkerState* dv = m_channelMarkerStates[i];
|
||||
if (dv->m_channelMarker->getVisible())
|
||||
|
||||
if (dv->m_channelMarker->getVisible()
|
||||
&& (dv->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (dv->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
{
|
||||
GLfloat q3[] {
|
||||
@ -693,7 +698,10 @@ void GLSpectrum::paintGL()
|
||||
for(int i = 0; i < m_channelMarkerStates.size(); ++i)
|
||||
{
|
||||
ChannelMarkerState* dv = m_channelMarkerStates[i];
|
||||
if(dv->m_channelMarker->getVisible())
|
||||
|
||||
if (dv->m_channelMarker->getVisible()
|
||||
&& (dv->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (dv->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
{
|
||||
GLfloat q3[] {
|
||||
@ -784,7 +792,9 @@ void GLSpectrum::paintGL()
|
||||
ChannelMarkerState* dv = m_channelMarkerStates[i];
|
||||
|
||||
// frequency scale channel overlay
|
||||
if(dv->m_channelMarker->getVisible())
|
||||
if (dv->m_channelMarker->getVisible()
|
||||
&& (dv->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (dv->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
{
|
||||
GLfloat q3[] {
|
||||
@ -1506,7 +1516,10 @@ void GLSpectrum::applyChanges()
|
||||
// Frequency overlay on highlighted marker
|
||||
for(int i = 0; i < m_channelMarkerStates.size(); ++i) {
|
||||
ChannelMarkerState* dv = m_channelMarkerStates[i];
|
||||
if (dv->m_channelMarker->getHighlighted())
|
||||
|
||||
if (dv->m_channelMarker->getVisible()
|
||||
&& (dv->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (dv->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
qreal xc;
|
||||
int shift;
|
||||
@ -1651,7 +1664,9 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
Real freq = m_frequencyScale.getValueFromPos(event->x() - m_leftMarginPixmap.width() - 1) - m_centerFrequency;
|
||||
|
||||
if (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable())
|
||||
if (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable()
|
||||
&& (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
m_channelMarkerStates[m_cursorChannel]->m_channelMarker->setCenterFrequencyByCursor(freq);
|
||||
channelMarkerChanged();
|
||||
@ -1662,6 +1677,12 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
for (int i = 0; i < m_channelMarkerStates.size(); ++i)
|
||||
{
|
||||
if ((m_channelMarkerStates[i]->m_channelMarker->getSourceOrSinkStream() != m_displaySourceOrSink)
|
||||
|| (m_channelMarkerStates[i]->m_channelMarker->getStreamIndex() != m_displayStreamIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_channelMarkerStates[i]->m_rect.contains(event->pos()))
|
||||
{
|
||||
if (m_cursorState == CSNormal)
|
||||
@ -1721,7 +1742,9 @@ void GLSpectrum::mousePressEvent(QMouseEvent* event)
|
||||
m_cursorChannel = 0;
|
||||
Real freq = m_frequencyScale.getValueFromPos(event->x() - m_leftMarginPixmap.width() - 1) - m_centerFrequency;
|
||||
|
||||
if(m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable())
|
||||
if (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getMovable()
|
||||
&& (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getSourceOrSinkStream() == m_displaySourceOrSink)
|
||||
&& (m_channelMarkerStates[m_cursorChannel]->m_channelMarker->getStreamIndex() == m_displayStreamIndex))
|
||||
{
|
||||
m_channelMarkerStates[m_cursorChannel]->m_channelMarker->setCenterFrequencyByCursor(freq);
|
||||
channelMarkerChanged();
|
||||
@ -1756,6 +1779,12 @@ void GLSpectrum::wheelEvent(QWheelEvent *event)
|
||||
|
||||
for (int i = 0; i < m_channelMarkerStates.size(); ++i)
|
||||
{
|
||||
if ((m_channelMarkerStates[i]->m_channelMarker->getSourceOrSinkStream() != m_displaySourceOrSink)
|
||||
|| (m_channelMarkerStates[i]->m_channelMarker->getStreamIndex() != m_displayStreamIndex))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_channelMarkerStates[i]->m_rect.contains(event->pos()))
|
||||
{
|
||||
int freq = m_channelMarkerStates[i]->m_channelMarker->getCenterFrequency();
|
||||
|
@ -96,6 +96,12 @@ public:
|
||||
void setWaterfallShare(Real waterfallShare);
|
||||
void connectTimer(const QTimer& timer);
|
||||
|
||||
void setDisplayedStream(bool sourceOrSink, int streamIndex)
|
||||
{
|
||||
m_displaySourceOrSink = sourceOrSink;
|
||||
m_displayStreamIndex = streamIndex;
|
||||
}
|
||||
|
||||
private:
|
||||
struct ChannelMarkerState {
|
||||
ChannelMarker* m_channelMarker;
|
||||
@ -180,8 +186,9 @@ private:
|
||||
QMatrix4x4 m_glHistogramSpectrumMatrix;
|
||||
QMatrix4x4 m_glHistogramBoxMatrix;
|
||||
bool m_displayHistogram;
|
||||
|
||||
bool m_displayChanged;
|
||||
bool m_displaySourceOrSink;
|
||||
int m_displayStreamIndex;
|
||||
|
||||
GLShaderSimple m_glShaderSimple;
|
||||
GLShaderTextured m_glShaderLeftScale;
|
||||
|
@ -356,6 +356,7 @@ void MainWindow::addSinkDevice()
|
||||
connect(m_deviceUIs.back()->m_samplingDeviceControl->getAddChannelButton(), SIGNAL(clicked(bool)), this, SLOT(channelAddClicked(bool)));
|
||||
|
||||
dspDeviceSinkEngine->addSpectrumSink(m_deviceUIs.back()->m_spectrumVis);
|
||||
m_deviceUIs.back()->m_spectrum->setDisplayedStream(false, 0);
|
||||
ui->tabSpectra->addTab(m_deviceUIs.back()->m_spectrum, tabNameCStr);
|
||||
ui->tabSpectraGUI->addTab(m_deviceUIs.back()->m_spectrumGUI, tabNameCStr);
|
||||
ui->tabChannels->addTab(m_deviceUIs.back()->m_channelWindow, tabNameCStr);
|
||||
@ -1831,7 +1832,7 @@ void MainWindow::sampleMIMOChanged()
|
||||
deviceUI->m_deviceAPI->setSamplingDevicePluginInterface(
|
||||
DeviceEnumerator::instance()->getMIMOPluginInterface(deviceUI->m_samplingDeviceControl->getSelectedDeviceIndex()));
|
||||
|
||||
// constructs new GUI and output object
|
||||
// constructs new GUI and MIMO object
|
||||
DeviceSampleMIMO *mimo = deviceUI->m_deviceAPI->getPluginInterface()->createSampleMIMOPluginInstance(
|
||||
deviceUI->m_deviceAPI->getSamplingDeviceId(), deviceUI->m_deviceAPI);
|
||||
deviceUI->m_deviceAPI->setSampleMIMO(mimo);
|
||||
|
@ -1,43 +1,6 @@
|
||||
TestMISettings:
|
||||
description: TestSourceMI
|
||||
description: TestMISettings
|
||||
properties:
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: uint64
|
||||
frequencyShift:
|
||||
type: integer
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
fcPos:
|
||||
type: integer
|
||||
sampleSizeIndex:
|
||||
type: integer
|
||||
amplitudeBits:
|
||||
type: integer
|
||||
autoCorrOptions:
|
||||
type: integer
|
||||
modulation:
|
||||
type: integer
|
||||
modulationTone:
|
||||
type: integer
|
||||
amModulation:
|
||||
type: integer
|
||||
fmDeviation:
|
||||
type: integer
|
||||
dcFactor:
|
||||
type: number
|
||||
format: float
|
||||
iFactor:
|
||||
type: number
|
||||
format: float
|
||||
qFactor:
|
||||
type: number
|
||||
format: float
|
||||
phaseImbalance:
|
||||
type: number
|
||||
format: float
|
||||
fileRecordName:
|
||||
type: string
|
||||
useReverseAPI:
|
||||
@ -49,3 +12,53 @@ TestMISettings:
|
||||
type: integer
|
||||
reverseAPIDeviceIndex:
|
||||
type: integer
|
||||
streams:
|
||||
description: Settings for each of the streams
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/TestMiStreamSettings"
|
||||
|
||||
definitions:
|
||||
TestMiStreamSettings:
|
||||
description: TestMiStreamSettings
|
||||
properties:
|
||||
streamIndex:
|
||||
description: Index of the stream to which the settings apply
|
||||
type: integer
|
||||
centerFrequency:
|
||||
type: integer
|
||||
format: uint64
|
||||
frequencyShift:
|
||||
type: integer
|
||||
sampleRate:
|
||||
type: integer
|
||||
log2Decim:
|
||||
type: integer
|
||||
fcPos:
|
||||
type: integer
|
||||
sampleSizeIndex:
|
||||
type: integer
|
||||
amplitudeBits:
|
||||
type: integer
|
||||
autoCorrOptions:
|
||||
type: integer
|
||||
modulation:
|
||||
type: integer
|
||||
modulationTone:
|
||||
type: integer
|
||||
amModulation:
|
||||
type: integer
|
||||
fmDeviation:
|
||||
type: integer
|
||||
dcFactor:
|
||||
type: number
|
||||
format: float
|
||||
iFactor:
|
||||
type: number
|
||||
format: float
|
||||
qFactor:
|
||||
type: number
|
||||
format: float
|
||||
phaseImbalance:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -5216,6 +5216,38 @@ margin-bottom: 20px;
|
||||
};
|
||||
defs.TestMISettings = {
|
||||
"properties" : {
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"streams" : {
|
||||
"type" : "array",
|
||||
"description" : "Settings for each of the streams",
|
||||
"items" : {
|
||||
"$ref" : "#/definitions/TestMiStreamSettings"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description" : "TestMISettings"
|
||||
};
|
||||
defs.TestMiStreamSettings = {
|
||||
"properties" : {
|
||||
"streamIndex" : {
|
||||
"type" : "integer",
|
||||
"description" : "Index of the stream to which the settings apply"
|
||||
},
|
||||
"centerFrequency" : {
|
||||
"type" : "integer",
|
||||
"format" : "uint64"
|
||||
@ -5268,25 +5300,9 @@ margin-bottom: 20px;
|
||||
"phaseImbalance" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
},
|
||||
"fileRecordName" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"useReverseAPI" : {
|
||||
"type" : "integer",
|
||||
"description" : "Synchronize with reverse API (1 for yes, 0 for no)"
|
||||
},
|
||||
"reverseAPIAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"reverseAPIPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"reverseAPIDeviceIndex" : {
|
||||
"type" : "integer"
|
||||
}
|
||||
},
|
||||
"description" : "TestSourceMI"
|
||||
"description" : "TestMiStreamSettings"
|
||||
};
|
||||
defs.TestSourceSettings = {
|
||||
"properties" : {
|
||||
@ -25084,7 +25100,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2019-05-20T16:12:41.467+02:00
|
||||
Generated 2019-05-25T21:27:31.978+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -133,6 +133,7 @@
|
||||
#include "SWGSoapySDRReport.h"
|
||||
#include "SWGSuccessResponse.h"
|
||||
#include "SWGTestMISettings.h"
|
||||
#include "SWGTestMiStreamSettings.h"
|
||||
#include "SWGTestSourceSettings.h"
|
||||
#include "SWGUDPSinkReport.h"
|
||||
#include "SWGUDPSinkSettings.h"
|
||||
@ -507,6 +508,9 @@ namespace SWGSDRangel {
|
||||
if(QString("SWGTestMISettings").compare(type) == 0) {
|
||||
return new SWGTestMISettings();
|
||||
}
|
||||
if(QString("SWGTestMiStreamSettings").compare(type) == 0) {
|
||||
return new SWGTestMiStreamSettings();
|
||||
}
|
||||
if(QString("SWGTestSourceSettings").compare(type) == 0) {
|
||||
return new SWGTestSourceSettings();
|
||||
}
|
||||
|
@ -28,38 +28,6 @@ SWGTestMISettings::SWGTestMISettings(QString* json) {
|
||||
}
|
||||
|
||||
SWGTestMISettings::SWGTestMISettings() {
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
frequency_shift = 0;
|
||||
m_frequency_shift_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
sample_size_index = 0;
|
||||
m_sample_size_index_isSet = false;
|
||||
amplitude_bits = 0;
|
||||
m_amplitude_bits_isSet = false;
|
||||
auto_corr_options = 0;
|
||||
m_auto_corr_options_isSet = false;
|
||||
modulation = 0;
|
||||
m_modulation_isSet = false;
|
||||
modulation_tone = 0;
|
||||
m_modulation_tone_isSet = false;
|
||||
am_modulation = 0;
|
||||
m_am_modulation_isSet = false;
|
||||
fm_deviation = 0;
|
||||
m_fm_deviation_isSet = false;
|
||||
dc_factor = 0.0f;
|
||||
m_dc_factor_isSet = false;
|
||||
i_factor = 0.0f;
|
||||
m_i_factor_isSet = false;
|
||||
q_factor = 0.0f;
|
||||
m_q_factor_isSet = false;
|
||||
phase_imbalance = 0.0f;
|
||||
m_phase_imbalance_isSet = false;
|
||||
file_record_name = nullptr;
|
||||
m_file_record_name_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
@ -70,6 +38,8 @@ SWGTestMISettings::SWGTestMISettings() {
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
streams = nullptr;
|
||||
m_streams_isSet = false;
|
||||
}
|
||||
|
||||
SWGTestMISettings::~SWGTestMISettings() {
|
||||
@ -78,38 +48,6 @@ SWGTestMISettings::~SWGTestMISettings() {
|
||||
|
||||
void
|
||||
SWGTestMISettings::init() {
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
frequency_shift = 0;
|
||||
m_frequency_shift_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
sample_size_index = 0;
|
||||
m_sample_size_index_isSet = false;
|
||||
amplitude_bits = 0;
|
||||
m_amplitude_bits_isSet = false;
|
||||
auto_corr_options = 0;
|
||||
m_auto_corr_options_isSet = false;
|
||||
modulation = 0;
|
||||
m_modulation_isSet = false;
|
||||
modulation_tone = 0;
|
||||
m_modulation_tone_isSet = false;
|
||||
am_modulation = 0;
|
||||
m_am_modulation_isSet = false;
|
||||
fm_deviation = 0;
|
||||
m_fm_deviation_isSet = false;
|
||||
dc_factor = 0.0f;
|
||||
m_dc_factor_isSet = false;
|
||||
i_factor = 0.0f;
|
||||
m_i_factor_isSet = false;
|
||||
q_factor = 0.0f;
|
||||
m_q_factor_isSet = false;
|
||||
phase_imbalance = 0.0f;
|
||||
m_phase_imbalance_isSet = false;
|
||||
file_record_name = new QString("");
|
||||
m_file_record_name_isSet = false;
|
||||
use_reverse_api = 0;
|
||||
@ -120,26 +58,12 @@ SWGTestMISettings::init() {
|
||||
m_reverse_api_port_isSet = false;
|
||||
reverse_api_device_index = 0;
|
||||
m_reverse_api_device_index_isSet = false;
|
||||
streams = new QList<SWGTestMiStreamSettings*>();
|
||||
m_streams_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGTestMISettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(file_record_name != nullptr) {
|
||||
delete file_record_name;
|
||||
}
|
||||
@ -149,6 +73,13 @@ SWGTestMISettings::cleanup() {
|
||||
}
|
||||
|
||||
|
||||
if(streams != nullptr) {
|
||||
auto arr = streams;
|
||||
for(auto o: *arr) {
|
||||
delete o;
|
||||
}
|
||||
delete streams;
|
||||
}
|
||||
}
|
||||
|
||||
SWGTestMISettings*
|
||||
@ -162,38 +93,6 @@ SWGTestMISettings::fromJson(QString &json) {
|
||||
|
||||
void
|
||||
SWGTestMISettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&frequency_shift, pJson["frequencyShift"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&sample_size_index, pJson["sampleSizeIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&litude_bits, pJson["amplitudeBits"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&auto_corr_options, pJson["autoCorrOptions"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modulation, pJson["modulation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modulation_tone, pJson["modulationTone"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&am_modulation, pJson["amModulation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fm_deviation, pJson["fmDeviation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&dc_factor, pJson["dcFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&i_factor, pJson["iFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&q_factor, pJson["qFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&phase_imbalance, pJson["phaseImbalance"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
|
||||
@ -204,6 +103,8 @@ SWGTestMISettings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", "");
|
||||
|
||||
|
||||
::SWGSDRangel::setValue(&streams, pJson["streams"], "QList", "SWGTestMiStreamSettings");
|
||||
}
|
||||
|
||||
QString
|
||||
@ -220,54 +121,6 @@ SWGTestMISettings::asJson ()
|
||||
QJsonObject*
|
||||
SWGTestMISettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_center_frequency_isSet){
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_frequency_shift_isSet){
|
||||
obj->insert("frequencyShift", QJsonValue(frequency_shift));
|
||||
}
|
||||
if(m_sample_rate_isSet){
|
||||
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||
}
|
||||
if(m_log2_decim_isSet){
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
}
|
||||
if(m_fc_pos_isSet){
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
}
|
||||
if(m_sample_size_index_isSet){
|
||||
obj->insert("sampleSizeIndex", QJsonValue(sample_size_index));
|
||||
}
|
||||
if(m_amplitude_bits_isSet){
|
||||
obj->insert("amplitudeBits", QJsonValue(amplitude_bits));
|
||||
}
|
||||
if(m_auto_corr_options_isSet){
|
||||
obj->insert("autoCorrOptions", QJsonValue(auto_corr_options));
|
||||
}
|
||||
if(m_modulation_isSet){
|
||||
obj->insert("modulation", QJsonValue(modulation));
|
||||
}
|
||||
if(m_modulation_tone_isSet){
|
||||
obj->insert("modulationTone", QJsonValue(modulation_tone));
|
||||
}
|
||||
if(m_am_modulation_isSet){
|
||||
obj->insert("amModulation", QJsonValue(am_modulation));
|
||||
}
|
||||
if(m_fm_deviation_isSet){
|
||||
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
}
|
||||
if(m_dc_factor_isSet){
|
||||
obj->insert("dcFactor", QJsonValue(dc_factor));
|
||||
}
|
||||
if(m_i_factor_isSet){
|
||||
obj->insert("iFactor", QJsonValue(i_factor));
|
||||
}
|
||||
if(m_q_factor_isSet){
|
||||
obj->insert("qFactor", QJsonValue(q_factor));
|
||||
}
|
||||
if(m_phase_imbalance_isSet){
|
||||
obj->insert("phaseImbalance", QJsonValue(phase_imbalance));
|
||||
}
|
||||
if(file_record_name != nullptr && *file_record_name != QString("")){
|
||||
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
|
||||
}
|
||||
@ -283,170 +136,13 @@ SWGTestMISettings::asJsonObject() {
|
||||
if(m_reverse_api_device_index_isSet){
|
||||
obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index));
|
||||
}
|
||||
if(streams->size() > 0){
|
||||
toJsonArray((QList<void*>*)streams, obj, "streams", "SWGTestMiStreamSettings");
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getCenterFrequency() {
|
||||
return center_frequency;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setCenterFrequency(qint32 center_frequency) {
|
||||
this->center_frequency = center_frequency;
|
||||
this->m_center_frequency_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getFrequencyShift() {
|
||||
return frequency_shift;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setFrequencyShift(qint32 frequency_shift) {
|
||||
this->frequency_shift = frequency_shift;
|
||||
this->m_frequency_shift_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getSampleRate() {
|
||||
return sample_rate;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setSampleRate(qint32 sample_rate) {
|
||||
this->sample_rate = sample_rate;
|
||||
this->m_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getLog2Decim() {
|
||||
return log2_decim;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setLog2Decim(qint32 log2_decim) {
|
||||
this->log2_decim = log2_decim;
|
||||
this->m_log2_decim_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getFcPos() {
|
||||
return fc_pos;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setFcPos(qint32 fc_pos) {
|
||||
this->fc_pos = fc_pos;
|
||||
this->m_fc_pos_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getSampleSizeIndex() {
|
||||
return sample_size_index;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setSampleSizeIndex(qint32 sample_size_index) {
|
||||
this->sample_size_index = sample_size_index;
|
||||
this->m_sample_size_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getAmplitudeBits() {
|
||||
return amplitude_bits;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setAmplitudeBits(qint32 amplitude_bits) {
|
||||
this->amplitude_bits = amplitude_bits;
|
||||
this->m_amplitude_bits_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getAutoCorrOptions() {
|
||||
return auto_corr_options;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setAutoCorrOptions(qint32 auto_corr_options) {
|
||||
this->auto_corr_options = auto_corr_options;
|
||||
this->m_auto_corr_options_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getModulation() {
|
||||
return modulation;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setModulation(qint32 modulation) {
|
||||
this->modulation = modulation;
|
||||
this->m_modulation_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getModulationTone() {
|
||||
return modulation_tone;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setModulationTone(qint32 modulation_tone) {
|
||||
this->modulation_tone = modulation_tone;
|
||||
this->m_modulation_tone_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getAmModulation() {
|
||||
return am_modulation;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setAmModulation(qint32 am_modulation) {
|
||||
this->am_modulation = am_modulation;
|
||||
this->m_am_modulation_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMISettings::getFmDeviation() {
|
||||
return fm_deviation;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setFmDeviation(qint32 fm_deviation) {
|
||||
this->fm_deviation = fm_deviation;
|
||||
this->m_fm_deviation_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMISettings::getDcFactor() {
|
||||
return dc_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setDcFactor(float dc_factor) {
|
||||
this->dc_factor = dc_factor;
|
||||
this->m_dc_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMISettings::getIFactor() {
|
||||
return i_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setIFactor(float i_factor) {
|
||||
this->i_factor = i_factor;
|
||||
this->m_i_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMISettings::getQFactor() {
|
||||
return q_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setQFactor(float q_factor) {
|
||||
this->q_factor = q_factor;
|
||||
this->m_q_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMISettings::getPhaseImbalance() {
|
||||
return phase_imbalance;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setPhaseImbalance(float phase_imbalance) {
|
||||
this->phase_imbalance = phase_imbalance;
|
||||
this->m_phase_imbalance_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGTestMISettings::getFileRecordName() {
|
||||
return file_record_name;
|
||||
@ -497,32 +193,27 @@ SWGTestMISettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) {
|
||||
this->m_reverse_api_device_index_isSet = true;
|
||||
}
|
||||
|
||||
QList<SWGTestMiStreamSettings*>*
|
||||
SWGTestMISettings::getStreams() {
|
||||
return streams;
|
||||
}
|
||||
void
|
||||
SWGTestMISettings::setStreams(QList<SWGTestMiStreamSettings*>* streams) {
|
||||
this->streams = streams;
|
||||
this->m_streams_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGTestMISettings::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_frequency_shift_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_sample_size_index_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_amplitude_bits_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_auto_corr_options_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_modulation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_modulation_tone_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_am_modulation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_fm_deviation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_dc_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_i_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_q_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_phase_imbalance_isSet){ isObjectUpdated = true; break;}
|
||||
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;}
|
||||
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;}
|
||||
if(streams->size() > 0){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
/*
|
||||
* SWGTestMISettings.h
|
||||
*
|
||||
* TestSourceMI
|
||||
* TestMISettings
|
||||
*/
|
||||
|
||||
#ifndef SWGTestMISettings_H_
|
||||
@ -22,6 +22,8 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGTestMiStreamSettings.h"
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include "SWGObject.h"
|
||||
@ -42,54 +44,6 @@ public:
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGTestMISettings* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getCenterFrequency();
|
||||
void setCenterFrequency(qint32 center_frequency);
|
||||
|
||||
qint32 getFrequencyShift();
|
||||
void setFrequencyShift(qint32 frequency_shift);
|
||||
|
||||
qint32 getSampleRate();
|
||||
void setSampleRate(qint32 sample_rate);
|
||||
|
||||
qint32 getLog2Decim();
|
||||
void setLog2Decim(qint32 log2_decim);
|
||||
|
||||
qint32 getFcPos();
|
||||
void setFcPos(qint32 fc_pos);
|
||||
|
||||
qint32 getSampleSizeIndex();
|
||||
void setSampleSizeIndex(qint32 sample_size_index);
|
||||
|
||||
qint32 getAmplitudeBits();
|
||||
void setAmplitudeBits(qint32 amplitude_bits);
|
||||
|
||||
qint32 getAutoCorrOptions();
|
||||
void setAutoCorrOptions(qint32 auto_corr_options);
|
||||
|
||||
qint32 getModulation();
|
||||
void setModulation(qint32 modulation);
|
||||
|
||||
qint32 getModulationTone();
|
||||
void setModulationTone(qint32 modulation_tone);
|
||||
|
||||
qint32 getAmModulation();
|
||||
void setAmModulation(qint32 am_modulation);
|
||||
|
||||
qint32 getFmDeviation();
|
||||
void setFmDeviation(qint32 fm_deviation);
|
||||
|
||||
float getDcFactor();
|
||||
void setDcFactor(float dc_factor);
|
||||
|
||||
float getIFactor();
|
||||
void setIFactor(float i_factor);
|
||||
|
||||
float getQFactor();
|
||||
void setQFactor(float q_factor);
|
||||
|
||||
float getPhaseImbalance();
|
||||
void setPhaseImbalance(float phase_imbalance);
|
||||
|
||||
QString* getFileRecordName();
|
||||
void setFileRecordName(QString* file_record_name);
|
||||
|
||||
@ -105,58 +59,13 @@ public:
|
||||
qint32 getReverseApiDeviceIndex();
|
||||
void setReverseApiDeviceIndex(qint32 reverse_api_device_index);
|
||||
|
||||
QList<SWGTestMiStreamSettings*>* getStreams();
|
||||
void setStreams(QList<SWGTestMiStreamSettings*>* streams);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 center_frequency;
|
||||
bool m_center_frequency_isSet;
|
||||
|
||||
qint32 frequency_shift;
|
||||
bool m_frequency_shift_isSet;
|
||||
|
||||
qint32 sample_rate;
|
||||
bool m_sample_rate_isSet;
|
||||
|
||||
qint32 log2_decim;
|
||||
bool m_log2_decim_isSet;
|
||||
|
||||
qint32 fc_pos;
|
||||
bool m_fc_pos_isSet;
|
||||
|
||||
qint32 sample_size_index;
|
||||
bool m_sample_size_index_isSet;
|
||||
|
||||
qint32 amplitude_bits;
|
||||
bool m_amplitude_bits_isSet;
|
||||
|
||||
qint32 auto_corr_options;
|
||||
bool m_auto_corr_options_isSet;
|
||||
|
||||
qint32 modulation;
|
||||
bool m_modulation_isSet;
|
||||
|
||||
qint32 modulation_tone;
|
||||
bool m_modulation_tone_isSet;
|
||||
|
||||
qint32 am_modulation;
|
||||
bool m_am_modulation_isSet;
|
||||
|
||||
qint32 fm_deviation;
|
||||
bool m_fm_deviation_isSet;
|
||||
|
||||
float dc_factor;
|
||||
bool m_dc_factor_isSet;
|
||||
|
||||
float i_factor;
|
||||
bool m_i_factor_isSet;
|
||||
|
||||
float q_factor;
|
||||
bool m_q_factor_isSet;
|
||||
|
||||
float phase_imbalance;
|
||||
bool m_phase_imbalance_isSet;
|
||||
|
||||
QString* file_record_name;
|
||||
bool m_file_record_name_isSet;
|
||||
|
||||
@ -172,6 +81,9 @@ private:
|
||||
qint32 reverse_api_device_index;
|
||||
bool m_reverse_api_device_index_isSet;
|
||||
|
||||
QList<SWGTestMiStreamSettings*>* streams;
|
||||
bool m_streams_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
442
swagger/sdrangel/code/qt5/client/SWGTestMiStreamSettings.cpp
Normal file
442
swagger/sdrangel/code/qt5/client/SWGTestMiStreamSettings.cpp
Normal file
@ -0,0 +1,442 @@
|
||||
/**
|
||||
* 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: 4.8.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 "SWGTestMiStreamSettings.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGTestMiStreamSettings::SWGTestMiStreamSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGTestMiStreamSettings::SWGTestMiStreamSettings() {
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
frequency_shift = 0;
|
||||
m_frequency_shift_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
sample_size_index = 0;
|
||||
m_sample_size_index_isSet = false;
|
||||
amplitude_bits = 0;
|
||||
m_amplitude_bits_isSet = false;
|
||||
auto_corr_options = 0;
|
||||
m_auto_corr_options_isSet = false;
|
||||
modulation = 0;
|
||||
m_modulation_isSet = false;
|
||||
modulation_tone = 0;
|
||||
m_modulation_tone_isSet = false;
|
||||
am_modulation = 0;
|
||||
m_am_modulation_isSet = false;
|
||||
fm_deviation = 0;
|
||||
m_fm_deviation_isSet = false;
|
||||
dc_factor = 0.0f;
|
||||
m_dc_factor_isSet = false;
|
||||
i_factor = 0.0f;
|
||||
m_i_factor_isSet = false;
|
||||
q_factor = 0.0f;
|
||||
m_q_factor_isSet = false;
|
||||
phase_imbalance = 0.0f;
|
||||
m_phase_imbalance_isSet = false;
|
||||
}
|
||||
|
||||
SWGTestMiStreamSettings::~SWGTestMiStreamSettings() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGTestMiStreamSettings::init() {
|
||||
stream_index = 0;
|
||||
m_stream_index_isSet = false;
|
||||
center_frequency = 0;
|
||||
m_center_frequency_isSet = false;
|
||||
frequency_shift = 0;
|
||||
m_frequency_shift_isSet = false;
|
||||
sample_rate = 0;
|
||||
m_sample_rate_isSet = false;
|
||||
log2_decim = 0;
|
||||
m_log2_decim_isSet = false;
|
||||
fc_pos = 0;
|
||||
m_fc_pos_isSet = false;
|
||||
sample_size_index = 0;
|
||||
m_sample_size_index_isSet = false;
|
||||
amplitude_bits = 0;
|
||||
m_amplitude_bits_isSet = false;
|
||||
auto_corr_options = 0;
|
||||
m_auto_corr_options_isSet = false;
|
||||
modulation = 0;
|
||||
m_modulation_isSet = false;
|
||||
modulation_tone = 0;
|
||||
m_modulation_tone_isSet = false;
|
||||
am_modulation = 0;
|
||||
m_am_modulation_isSet = false;
|
||||
fm_deviation = 0;
|
||||
m_fm_deviation_isSet = false;
|
||||
dc_factor = 0.0f;
|
||||
m_dc_factor_isSet = false;
|
||||
i_factor = 0.0f;
|
||||
m_i_factor_isSet = false;
|
||||
q_factor = 0.0f;
|
||||
m_q_factor_isSet = false;
|
||||
phase_imbalance = 0.0f;
|
||||
m_phase_imbalance_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGTestMiStreamSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGTestMiStreamSettings*
|
||||
SWGTestMiStreamSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGTestMiStreamSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&frequency_shift, pJson["frequencyShift"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&sample_size_index, pJson["sampleSizeIndex"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&litude_bits, pJson["amplitudeBits"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&auto_corr_options, pJson["autoCorrOptions"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modulation, pJson["modulation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modulation_tone, pJson["modulationTone"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&am_modulation, pJson["amModulation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&fm_deviation, pJson["fmDeviation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&dc_factor, pJson["dcFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&i_factor, pJson["iFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&q_factor, pJson["qFactor"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&phase_imbalance, pJson["phaseImbalance"], "float", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGTestMiStreamSettings::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGTestMiStreamSettings::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_stream_index_isSet){
|
||||
obj->insert("streamIndex", QJsonValue(stream_index));
|
||||
}
|
||||
if(m_center_frequency_isSet){
|
||||
obj->insert("centerFrequency", QJsonValue(center_frequency));
|
||||
}
|
||||
if(m_frequency_shift_isSet){
|
||||
obj->insert("frequencyShift", QJsonValue(frequency_shift));
|
||||
}
|
||||
if(m_sample_rate_isSet){
|
||||
obj->insert("sampleRate", QJsonValue(sample_rate));
|
||||
}
|
||||
if(m_log2_decim_isSet){
|
||||
obj->insert("log2Decim", QJsonValue(log2_decim));
|
||||
}
|
||||
if(m_fc_pos_isSet){
|
||||
obj->insert("fcPos", QJsonValue(fc_pos));
|
||||
}
|
||||
if(m_sample_size_index_isSet){
|
||||
obj->insert("sampleSizeIndex", QJsonValue(sample_size_index));
|
||||
}
|
||||
if(m_amplitude_bits_isSet){
|
||||
obj->insert("amplitudeBits", QJsonValue(amplitude_bits));
|
||||
}
|
||||
if(m_auto_corr_options_isSet){
|
||||
obj->insert("autoCorrOptions", QJsonValue(auto_corr_options));
|
||||
}
|
||||
if(m_modulation_isSet){
|
||||
obj->insert("modulation", QJsonValue(modulation));
|
||||
}
|
||||
if(m_modulation_tone_isSet){
|
||||
obj->insert("modulationTone", QJsonValue(modulation_tone));
|
||||
}
|
||||
if(m_am_modulation_isSet){
|
||||
obj->insert("amModulation", QJsonValue(am_modulation));
|
||||
}
|
||||
if(m_fm_deviation_isSet){
|
||||
obj->insert("fmDeviation", QJsonValue(fm_deviation));
|
||||
}
|
||||
if(m_dc_factor_isSet){
|
||||
obj->insert("dcFactor", QJsonValue(dc_factor));
|
||||
}
|
||||
if(m_i_factor_isSet){
|
||||
obj->insert("iFactor", QJsonValue(i_factor));
|
||||
}
|
||||
if(m_q_factor_isSet){
|
||||
obj->insert("qFactor", QJsonValue(q_factor));
|
||||
}
|
||||
if(m_phase_imbalance_isSet){
|
||||
obj->insert("phaseImbalance", QJsonValue(phase_imbalance));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getStreamIndex() {
|
||||
return stream_index;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setStreamIndex(qint32 stream_index) {
|
||||
this->stream_index = stream_index;
|
||||
this->m_stream_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getCenterFrequency() {
|
||||
return center_frequency;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setCenterFrequency(qint32 center_frequency) {
|
||||
this->center_frequency = center_frequency;
|
||||
this->m_center_frequency_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getFrequencyShift() {
|
||||
return frequency_shift;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setFrequencyShift(qint32 frequency_shift) {
|
||||
this->frequency_shift = frequency_shift;
|
||||
this->m_frequency_shift_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getSampleRate() {
|
||||
return sample_rate;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setSampleRate(qint32 sample_rate) {
|
||||
this->sample_rate = sample_rate;
|
||||
this->m_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getLog2Decim() {
|
||||
return log2_decim;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setLog2Decim(qint32 log2_decim) {
|
||||
this->log2_decim = log2_decim;
|
||||
this->m_log2_decim_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getFcPos() {
|
||||
return fc_pos;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setFcPos(qint32 fc_pos) {
|
||||
this->fc_pos = fc_pos;
|
||||
this->m_fc_pos_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getSampleSizeIndex() {
|
||||
return sample_size_index;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setSampleSizeIndex(qint32 sample_size_index) {
|
||||
this->sample_size_index = sample_size_index;
|
||||
this->m_sample_size_index_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getAmplitudeBits() {
|
||||
return amplitude_bits;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setAmplitudeBits(qint32 amplitude_bits) {
|
||||
this->amplitude_bits = amplitude_bits;
|
||||
this->m_amplitude_bits_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getAutoCorrOptions() {
|
||||
return auto_corr_options;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setAutoCorrOptions(qint32 auto_corr_options) {
|
||||
this->auto_corr_options = auto_corr_options;
|
||||
this->m_auto_corr_options_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getModulation() {
|
||||
return modulation;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setModulation(qint32 modulation) {
|
||||
this->modulation = modulation;
|
||||
this->m_modulation_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getModulationTone() {
|
||||
return modulation_tone;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setModulationTone(qint32 modulation_tone) {
|
||||
this->modulation_tone = modulation_tone;
|
||||
this->m_modulation_tone_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getAmModulation() {
|
||||
return am_modulation;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setAmModulation(qint32 am_modulation) {
|
||||
this->am_modulation = am_modulation;
|
||||
this->m_am_modulation_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGTestMiStreamSettings::getFmDeviation() {
|
||||
return fm_deviation;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setFmDeviation(qint32 fm_deviation) {
|
||||
this->fm_deviation = fm_deviation;
|
||||
this->m_fm_deviation_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMiStreamSettings::getDcFactor() {
|
||||
return dc_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setDcFactor(float dc_factor) {
|
||||
this->dc_factor = dc_factor;
|
||||
this->m_dc_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMiStreamSettings::getIFactor() {
|
||||
return i_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setIFactor(float i_factor) {
|
||||
this->i_factor = i_factor;
|
||||
this->m_i_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMiStreamSettings::getQFactor() {
|
||||
return q_factor;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setQFactor(float q_factor) {
|
||||
this->q_factor = q_factor;
|
||||
this->m_q_factor_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGTestMiStreamSettings::getPhaseImbalance() {
|
||||
return phase_imbalance;
|
||||
}
|
||||
void
|
||||
SWGTestMiStreamSettings::setPhaseImbalance(float phase_imbalance) {
|
||||
this->phase_imbalance = phase_imbalance;
|
||||
this->m_phase_imbalance_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGTestMiStreamSettings::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_stream_index_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_frequency_shift_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_sample_rate_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_log2_decim_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_fc_pos_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_sample_size_index_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_amplitude_bits_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_auto_corr_options_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_modulation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_modulation_tone_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_am_modulation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_fm_deviation_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_dc_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_i_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_q_factor_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_phase_imbalance_isSet){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
154
swagger/sdrangel/code/qt5/client/SWGTestMiStreamSettings.h
Normal file
154
swagger/sdrangel/code/qt5/client/SWGTestMiStreamSettings.h
Normal file
@ -0,0 +1,154 @@
|
||||
/**
|
||||
* 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: 4.8.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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGTestMiStreamSettings.h
|
||||
*
|
||||
* TestMiStreamSettings
|
||||
*/
|
||||
|
||||
#ifndef SWGTestMiStreamSettings_H_
|
||||
#define SWGTestMiStreamSettings_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGTestMiStreamSettings: public SWGObject {
|
||||
public:
|
||||
SWGTestMiStreamSettings();
|
||||
SWGTestMiStreamSettings(QString* json);
|
||||
virtual ~SWGTestMiStreamSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGTestMiStreamSettings* fromJson(QString &jsonString) override;
|
||||
|
||||
qint32 getStreamIndex();
|
||||
void setStreamIndex(qint32 stream_index);
|
||||
|
||||
qint32 getCenterFrequency();
|
||||
void setCenterFrequency(qint32 center_frequency);
|
||||
|
||||
qint32 getFrequencyShift();
|
||||
void setFrequencyShift(qint32 frequency_shift);
|
||||
|
||||
qint32 getSampleRate();
|
||||
void setSampleRate(qint32 sample_rate);
|
||||
|
||||
qint32 getLog2Decim();
|
||||
void setLog2Decim(qint32 log2_decim);
|
||||
|
||||
qint32 getFcPos();
|
||||
void setFcPos(qint32 fc_pos);
|
||||
|
||||
qint32 getSampleSizeIndex();
|
||||
void setSampleSizeIndex(qint32 sample_size_index);
|
||||
|
||||
qint32 getAmplitudeBits();
|
||||
void setAmplitudeBits(qint32 amplitude_bits);
|
||||
|
||||
qint32 getAutoCorrOptions();
|
||||
void setAutoCorrOptions(qint32 auto_corr_options);
|
||||
|
||||
qint32 getModulation();
|
||||
void setModulation(qint32 modulation);
|
||||
|
||||
qint32 getModulationTone();
|
||||
void setModulationTone(qint32 modulation_tone);
|
||||
|
||||
qint32 getAmModulation();
|
||||
void setAmModulation(qint32 am_modulation);
|
||||
|
||||
qint32 getFmDeviation();
|
||||
void setFmDeviation(qint32 fm_deviation);
|
||||
|
||||
float getDcFactor();
|
||||
void setDcFactor(float dc_factor);
|
||||
|
||||
float getIFactor();
|
||||
void setIFactor(float i_factor);
|
||||
|
||||
float getQFactor();
|
||||
void setQFactor(float q_factor);
|
||||
|
||||
float getPhaseImbalance();
|
||||
void setPhaseImbalance(float phase_imbalance);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint32 stream_index;
|
||||
bool m_stream_index_isSet;
|
||||
|
||||
qint32 center_frequency;
|
||||
bool m_center_frequency_isSet;
|
||||
|
||||
qint32 frequency_shift;
|
||||
bool m_frequency_shift_isSet;
|
||||
|
||||
qint32 sample_rate;
|
||||
bool m_sample_rate_isSet;
|
||||
|
||||
qint32 log2_decim;
|
||||
bool m_log2_decim_isSet;
|
||||
|
||||
qint32 fc_pos;
|
||||
bool m_fc_pos_isSet;
|
||||
|
||||
qint32 sample_size_index;
|
||||
bool m_sample_size_index_isSet;
|
||||
|
||||
qint32 amplitude_bits;
|
||||
bool m_amplitude_bits_isSet;
|
||||
|
||||
qint32 auto_corr_options;
|
||||
bool m_auto_corr_options_isSet;
|
||||
|
||||
qint32 modulation;
|
||||
bool m_modulation_isSet;
|
||||
|
||||
qint32 modulation_tone;
|
||||
bool m_modulation_tone_isSet;
|
||||
|
||||
qint32 am_modulation;
|
||||
bool m_am_modulation_isSet;
|
||||
|
||||
qint32 fm_deviation;
|
||||
bool m_fm_deviation_isSet;
|
||||
|
||||
float dc_factor;
|
||||
bool m_dc_factor_isSet;
|
||||
|
||||
float i_factor;
|
||||
bool m_i_factor_isSet;
|
||||
|
||||
float q_factor;
|
||||
bool m_q_factor_isSet;
|
||||
|
||||
float phase_imbalance;
|
||||
bool m_phase_imbalance_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGTestMiStreamSettings_H_ */
|
Loading…
Reference in New Issue
Block a user