SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <testsourceinput.h>
Classes | |
class | MsgConfigureTestSource |
class | MsgFileRecord |
class | MsgStartStop |
Public Member Functions | |
TestSourceInput (DeviceAPI *deviceAPI) | |
virtual | ~TestSourceInput () |
virtual void | destroy () |
virtual void | init () |
initializations to be done when all collaborating objects are created and possibly connected More... | |
virtual bool | start () |
virtual void | stop () |
virtual QByteArray | serialize () const |
virtual bool | deserialize (const QByteArray &data) |
virtual void | setMessageQueueToGUI (MessageQueue *queue) |
virtual const QString & | getDeviceDescription () const |
virtual int | getSampleRate () const |
Sample rate exposed by the source. More... | |
virtual void | setSampleRate (int sampleRate) |
For when the source sample rate is set externally. More... | |
virtual quint64 | getCenterFrequency () const |
Center frequency exposed by the source. More... | |
virtual void | setCenterFrequency (qint64 centerFrequency) |
virtual bool | handleMessage (const Message &message) |
virtual int | webapiSettingsGet (SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage) |
virtual int | webapiSettingsPutPatch (bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage) |
virtual int | webapiRunGet (SWGSDRangel::SWGDeviceState &response, QString &errorMessage) |
virtual int | webapiRun (bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage) |
Public Member Functions inherited from DeviceSampleSource | |
DeviceSampleSource () | |
virtual | ~DeviceSampleSource () |
virtual int | webapiReportGet (SWGSDRangel::SWGDeviceReport &response, QString &errorMessage) |
MessageQueue * | getInputMessageQueue () |
MessageQueue * | getMessageQueueToGUI () |
SampleSinkFifo * | getSampleFifo () |
Private Slots | |
void | networkManagerFinished (QNetworkReply *reply) |
Private Member Functions | |
bool | applySettings (const TestSourceSettings &settings, bool force) |
void | webapiFormatDeviceSettings (SWGSDRangel::SWGDeviceSettings &response, const TestSourceSettings &settings) |
void | webapiReverseSendSettings (QList< QString > &deviceSettingsKeys, const TestSourceSettings &settings, bool force) |
void | webapiReverseSendStartStop (bool start) |
Private Attributes | |
DeviceAPI * | m_deviceAPI |
FileRecord * | m_fileSink |
File sink to record device I/Q output. More... | |
QMutex | m_mutex |
TestSourceSettings | m_settings |
TestSourceThread * | m_testSourceThread |
QString | m_deviceDescription |
bool | m_running |
const QTimer & | m_masterTimer |
QNetworkAccessManager * | m_networkManager |
QNetworkRequest | m_networkRequest |
Additional Inherited Members | |
Public Types inherited from DeviceSampleSource | |
enum | fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER } |
enum | FrequencyShiftScheme { FSHIFT_STD = 0, FSHIFT_TXSYNC } |
Static Public Member Functions inherited from DeviceSampleSource | |
static qint64 | calculateDeviceCenterFrequency (quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false) |
static qint64 | calculateCenterFrequency (quint64 deviceCenterFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false) |
static qint32 | calculateFrequencyShift (int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme) |
Protected Slots inherited from DeviceSampleSource | |
void | handleInputMessages () |
Protected Attributes inherited from DeviceSampleSource | |
SampleSinkFifo | m_sampleFifo |
MessageQueue | m_inputMessageQueue |
Input queue to the source. More... | |
MessageQueue * | m_guiMessageQueue |
Input message queue to the GUI. More... | |
Definition at line 35 of file testsourceinput.h.
TestSourceInput::TestSourceInput | ( | DeviceAPI * | deviceAPI | ) |
Definition at line 41 of file testsourceinput.cpp.
References arg().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
virtual |
Definition at line 61 of file testsourceinput.cpp.
References m_deviceAPI, m_fileSink, m_networkManager, m_running, networkManagerFinished(), DeviceAPI::removeAncillarySink(), and stop().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
private |
Definition at line 240 of file testsourceinput.cpp.
References TestSourceSettings::AutoCorrDC, TestSourceSettings::AutoCorrDCAndIQ, TestSourceSettings::AutoCorrNone, DeviceSampleSource::calculateDeviceCenterFrequency(), DeviceSampleSource::calculateFrequencyShift(), DeviceAPI::configureCorrections(), DeviceSampleSource::FSHIFT_STD, DeviceAPI::getDeviceEngineInputMessageQueue(), FileRecord::handleMessage(), TestSourceSettings::m_amModulation, TestSourceSettings::m_amplitudeBits, TestSourceSettings::m_autoCorrOptions, TestSourceSettings::m_centerFrequency, TestSourceSettings::m_dcFactor, m_deviceAPI, TestSourceSettings::m_fcPos, m_fileSink, TestSourceSettings::m_fmDeviation, TestSourceSettings::m_frequencyShift, TestSourceSettings::m_iFactor, TestSourceSettings::m_log2Decim, TestSourceSettings::m_modulation, TestSourceSettings::m_modulationTone, TestSourceSettings::m_phaseImbalance, TestSourceSettings::m_qFactor, TestSourceSettings::m_reverseAPIAddress, TestSourceSettings::m_reverseAPIDeviceIndex, TestSourceSettings::m_reverseAPIPort, TestSourceSettings::m_sampleRate, TestSourceSettings::m_sampleSizeIndex, m_settings, m_testSourceThread, TestSourceSettings::m_useReverseAPI, TestSourceSettings::ModulationPattern0, TestSourceSettings::ModulationPattern1, TestSourceSettings::ModulationPattern2, MessageQueue::push(), TestSourceThread::setAMModulation(), TestSourceThread::setAmplitudeBits(), TestSourceThread::setBitSize(), TestSourceThread::setDCFactor(), TestSourceThread::setFcPos(), TestSourceThread::setFMDeviation(), TestSourceThread::setFrequencyShift(), TestSourceThread::setIFactor(), TestSourceThread::setLog2Decimation(), TestSourceThread::setModulation(), TestSourceThread::setPattern0(), TestSourceThread::setPattern1(), TestSourceThread::setPattern2(), TestSourceThread::setPhaseImbalance(), TestSourceThread::setQFactor(), TestSourceThread::setSamplerate(), TestSourceThread::setToneFrequency(), and webapiReverseSendSettings().
Referenced by handleMessage(), init(), and start().
|
virtual |
Implements DeviceSampleSource.
Definition at line 121 of file testsourceinput.cpp.
References TestSourceInput::MsgConfigureTestSource::create(), TestSourceSettings::deserialize(), DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, MessageQueue::push(), and TestSourceSettings::resetToDefaults().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 74 of file testsourceinput.cpp.
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
virtual |
Center frequency exposed by the source.
Implements DeviceSampleSource.
Definition at line 153 of file testsourceinput.cpp.
References TestSourceSettings::m_centerFrequency, and m_settings.
Referenced by setSampleRate().
|
virtual |
Implements DeviceSampleSource.
Definition at line 143 of file testsourceinput.cpp.
References m_deviceDescription.
Referenced by setMessageQueueToGUI().
|
virtual |
Sample rate exposed by the source.
Implements DeviceSampleSource.
Definition at line 148 of file testsourceinput.cpp.
References TestSourceSettings::m_log2Decim, TestSourceSettings::m_sampleRate, and m_settings.
Referenced by setMessageQueueToGUI().
|
virtual |
Implements DeviceSampleSource.
Definition at line 173 of file testsourceinput.cpp.
References applySettings(), FileRecord::genUniqueFileName(), DeviceAPI::getDeviceUID(), TestSourceInput::MsgConfigureTestSource::getForce(), TestSourceInput::MsgConfigureTestSource::getSettings(), TestSourceInput::MsgFileRecord::getStartStop(), TestSourceInput::MsgStartStop::getStartStop(), DeviceAPI::initDeviceEngine(), m_deviceAPI, TestSourceSettings::m_fileRecordName, m_fileSink, m_settings, TestSourceSettings::m_useReverseAPI, Message::match(), FileRecord::setFileName(), DeviceAPI::startDeviceEngine(), FileRecord::startRecording(), DeviceAPI::stopDeviceEngine(), FileRecord::stopRecording(), and webapiReverseSendStartStop().
Referenced by setSampleRate().
|
virtual |
initializations to be done when all collaborating objects are created and possibly connected
Implements DeviceSampleSource.
Definition at line 79 of file testsourceinput.cpp.
References applySettings(), and m_settings.
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
privateslot |
Definition at line 734 of file testsourceinput.cpp.
Referenced by ~TestSourceInput().
|
virtual |
Implements DeviceSampleSource.
Definition at line 116 of file testsourceinput.cpp.
References m_settings, and TestSourceSettings::serialize().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 158 of file testsourceinput.cpp.
References TestSourceInput::MsgConfigureTestSource::create(), TestSourceSettings::m_centerFrequency, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, and MessageQueue::push().
Referenced by setSampleRate().
|
inlinevirtual |
Implements DeviceSampleSource.
Definition at line 110 of file testsourceinput.h.
References getDeviceDescription(), getSampleRate(), and DeviceSampleSource::m_guiMessageQueue.
|
inlinevirtual |
For when the source sample rate is set externally.
Implements DeviceSampleSource.
Definition at line 113 of file testsourceinput.h.
References getCenterFrequency(), handleMessage(), setCenterFrequency(), webapiRun(), webapiRunGet(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
virtual |
Implements DeviceSampleSource.
Definition at line 84 of file testsourceinput.cpp.
References applySettings(), m_mutex, m_running, DeviceSampleSource::m_sampleFifo, TestSourceSettings::m_sampleRate, m_settings, m_testSourceThread, TestSourceThread::setSamplerate(), TestSourceThread::startStop(), and stop().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 102 of file testsourceinput.cpp.
References m_mutex, m_running, m_testSourceThread, and TestSourceThread::startStop().
Referenced by TestSourceInput::MsgStartStop::MsgStartStop(), start(), and ~TestSourceInput().
|
private |
Definition at line 586 of file testsourceinput.cpp.
References SWGSDRangel::SWGTestSourceSettings::getFileRecordName(), SWGSDRangel::SWGTestSourceSettings::getReverseApiAddress(), SWGSDRangel::SWGDeviceSettings::getTestSourceSettings(), TestSourceSettings::m_amModulation, TestSourceSettings::m_amplitudeBits, TestSourceSettings::m_autoCorrOptions, TestSourceSettings::m_centerFrequency, TestSourceSettings::m_dcFactor, TestSourceSettings::m_fcPos, TestSourceSettings::m_fileRecordName, TestSourceSettings::m_fmDeviation, TestSourceSettings::m_frequencyShift, TestSourceSettings::m_iFactor, TestSourceSettings::m_log2Decim, TestSourceSettings::m_modulation, TestSourceSettings::m_modulationTone, TestSourceSettings::m_phaseImbalance, TestSourceSettings::m_qFactor, TestSourceSettings::m_reverseAPIAddress, TestSourceSettings::m_reverseAPIDeviceIndex, TestSourceSettings::m_reverseAPIPort, TestSourceSettings::m_sampleRate, TestSourceSettings::m_sampleSizeIndex, TestSourceSettings::m_useReverseAPI, SWGSDRangel::SWGTestSourceSettings::setAmModulation(), SWGSDRangel::SWGTestSourceSettings::setAmplitudeBits(), SWGSDRangel::SWGTestSourceSettings::setAutoCorrOptions(), SWGSDRangel::SWGTestSourceSettings::setCenterFrequency(), SWGSDRangel::SWGTestSourceSettings::setDcFactor(), SWGSDRangel::SWGTestSourceSettings::setFcPos(), SWGSDRangel::SWGTestSourceSettings::setFileRecordName(), SWGSDRangel::SWGTestSourceSettings::setFmDeviation(), SWGSDRangel::SWGTestSourceSettings::setFrequencyShift(), SWGSDRangel::SWGTestSourceSettings::setIFactor(), SWGSDRangel::SWGTestSourceSettings::setLog2Decim(), SWGSDRangel::SWGTestSourceSettings::setModulation(), SWGSDRangel::SWGTestSourceSettings::setModulationTone(), SWGSDRangel::SWGTestSourceSettings::setPhaseImbalance(), SWGSDRangel::SWGTestSourceSettings::setQFactor(), SWGSDRangel::SWGTestSourceSettings::setReverseApiAddress(), SWGSDRangel::SWGTestSourceSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGTestSourceSettings::setReverseApiPort(), SWGSDRangel::SWGTestSourceSettings::setSampleRate(), SWGSDRangel::SWGTestSourceSettings::setSampleSizeIndex(), and SWGSDRangel::SWGTestSourceSettings::setUseReverseApi().
Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 623 of file testsourceinput.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), SWGSDRangel::SWGDeviceSettings::getTestSourceSettings(), TestSourceSettings::m_amModulation, TestSourceSettings::m_amplitudeBits, TestSourceSettings::m_centerFrequency, TestSourceSettings::m_dcFactor, m_deviceAPI, TestSourceSettings::m_fcPos, TestSourceSettings::m_fileRecordName, TestSourceSettings::m_fmDeviation, TestSourceSettings::m_frequencyShift, TestSourceSettings::m_iFactor, TestSourceSettings::m_log2Decim, TestSourceSettings::m_modulation, TestSourceSettings::m_modulationTone, m_networkManager, m_networkRequest, TestSourceSettings::m_phaseImbalance, TestSourceSettings::m_qFactor, TestSourceSettings::m_reverseAPIAddress, TestSourceSettings::m_reverseAPIDeviceIndex, TestSourceSettings::m_reverseAPIPort, TestSourceSettings::m_sampleRate, TestSourceSettings::m_sampleSizeIndex, SWGSDRangel::SWGTestSourceSettings::setAmModulation(), SWGSDRangel::SWGTestSourceSettings::setAmplitudeBits(), SWGSDRangel::SWGTestSourceSettings::setAutoCorrOptions(), SWGSDRangel::SWGTestSourceSettings::setCenterFrequency(), SWGSDRangel::SWGTestSourceSettings::setDcFactor(), SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), SWGSDRangel::SWGTestSourceSettings::setFcPos(), SWGSDRangel::SWGTestSourceSettings::setFileRecordName(), SWGSDRangel::SWGTestSourceSettings::setFmDeviation(), SWGSDRangel::SWGTestSourceSettings::setFrequencyShift(), SWGSDRangel::SWGTestSourceSettings::setIFactor(), SWGSDRangel::SWGTestSourceSettings::setLog2Decim(), SWGSDRangel::SWGTestSourceSettings::setModulation(), SWGSDRangel::SWGTestSourceSettings::setModulationTone(), SWGSDRangel::SWGDeviceSettings::setOriginatorIndex(), SWGSDRangel::SWGTestSourceSettings::setPhaseImbalance(), SWGSDRangel::SWGTestSourceSettings::setQFactor(), SWGSDRangel::SWGTestSourceSettings::setSampleRate(), SWGSDRangel::SWGTestSourceSettings::setSampleSizeIndex(), and SWGSDRangel::SWGDeviceSettings::setTestSourceSettings().
Referenced by applySettings().
|
private |
Definition at line 706 of file testsourceinput.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), m_deviceAPI, m_networkManager, m_networkRequest, TestSourceSettings::m_reverseAPIAddress, TestSourceSettings::m_reverseAPIDeviceIndex, TestSourceSettings::m_reverseAPIPort, m_settings, SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), and SWGSDRangel::SWGDeviceSettings::setOriginatorIndex().
Referenced by handleMessage().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 462 of file testsourceinput.cpp.
References TestSourceInput::MsgStartStop::create(), DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), m_deviceAPI, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, and MessageQueue::push().
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 453 of file testsourceinput.cpp.
References DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), and m_deviceAPI.
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 481 of file testsourceinput.cpp.
References SWGSDRangel::SWGDeviceSettings::getTestSourceSettings(), SWGSDRangel::SWGTestSourceSettings::init(), m_settings, SWGSDRangel::SWGDeviceSettings::setTestSourceSettings(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 492 of file testsourceinput.cpp.
References TestSourceSettings::AutoCorrLast, TestSourceInput::MsgConfigureTestSource::create(), SWGSDRangel::SWGTestSourceSettings::getAmModulation(), SWGSDRangel::SWGTestSourceSettings::getAmplitudeBits(), SWGSDRangel::SWGTestSourceSettings::getAutoCorrOptions(), SWGSDRangel::SWGTestSourceSettings::getCenterFrequency(), SWGSDRangel::SWGTestSourceSettings::getDcFactor(), SWGSDRangel::SWGTestSourceSettings::getFcPos(), SWGSDRangel::SWGTestSourceSettings::getFileRecordName(), SWGSDRangel::SWGTestSourceSettings::getFmDeviation(), SWGSDRangel::SWGTestSourceSettings::getFrequencyShift(), SWGSDRangel::SWGTestSourceSettings::getIFactor(), SWGSDRangel::SWGTestSourceSettings::getLog2Decim(), SWGSDRangel::SWGTestSourceSettings::getModulation(), SWGSDRangel::SWGTestSourceSettings::getModulationTone(), SWGSDRangel::SWGTestSourceSettings::getPhaseImbalance(), SWGSDRangel::SWGTestSourceSettings::getQFactor(), SWGSDRangel::SWGTestSourceSettings::getReverseApiAddress(), SWGSDRangel::SWGTestSourceSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGTestSourceSettings::getReverseApiPort(), SWGSDRangel::SWGTestSourceSettings::getSampleRate(), SWGSDRangel::SWGTestSourceSettings::getSampleSizeIndex(), SWGSDRangel::SWGDeviceSettings::getTestSourceSettings(), SWGSDRangel::SWGTestSourceSettings::getUseReverseApi(), TestSourceSettings::m_amModulation, TestSourceSettings::m_amplitudeBits, TestSourceSettings::m_centerFrequency, TestSourceSettings::m_dcFactor, TestSourceSettings::m_fcPos, TestSourceSettings::m_fileRecordName, TestSourceSettings::m_fmDeviation, TestSourceSettings::m_frequencyShift, DeviceSampleSource::m_guiMessageQueue, TestSourceSettings::m_iFactor, DeviceSampleSource::m_inputMessageQueue, TestSourceSettings::m_log2Decim, TestSourceSettings::m_modulation, TestSourceSettings::m_modulationTone, TestSourceSettings::m_phaseImbalance, TestSourceSettings::m_qFactor, TestSourceSettings::m_reverseAPIAddress, TestSourceSettings::m_reverseAPIDeviceIndex, TestSourceSettings::m_reverseAPIPort, TestSourceSettings::m_sampleRate, TestSourceSettings::m_sampleSizeIndex, m_settings, TestSourceSettings::m_useReverseAPI, TestSourceSettings::ModulationLast, MessageQueue::push(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
private |
Definition at line 139 of file testsourceinput.h.
Referenced by applySettings(), handleMessage(), webapiReverseSendSettings(), webapiReverseSendStartStop(), webapiRun(), webapiRunGet(), and ~TestSourceInput().
|
private |
Definition at line 144 of file testsourceinput.h.
Referenced by getDeviceDescription().
|
private |
File sink to record device I/Q output.
Definition at line 140 of file testsourceinput.h.
Referenced by applySettings(), handleMessage(), and ~TestSourceInput().
|
private |
Definition at line 146 of file testsourceinput.h.
|
private |
Definition at line 141 of file testsourceinput.h.
|
private |
Definition at line 147 of file testsourceinput.h.
Referenced by webapiReverseSendSettings(), webapiReverseSendStartStop(), and ~TestSourceInput().
|
private |
Definition at line 148 of file testsourceinput.h.
Referenced by webapiReverseSendSettings(), and webapiReverseSendStartStop().
|
private |
Definition at line 145 of file testsourceinput.h.
Referenced by start(), stop(), and ~TestSourceInput().
|
private |
Definition at line 142 of file testsourceinput.h.
Referenced by applySettings(), deserialize(), getCenterFrequency(), getSampleRate(), handleMessage(), init(), serialize(), setCenterFrequency(), start(), webapiReverseSendStartStop(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 143 of file testsourceinput.h.
Referenced by applySettings(), start(), and stop().