19 #include <QNetworkReply> 42 m_deviceAPI(deviceAPI),
47 m_deviceAPI->setNbSinkStreams(1);
49 initGainSettings(m_settings);
50 initTunableElementsSettings(m_settings);
51 initStreamArgSettings(m_settings);
52 initDeviceArgSettings(m_settings);
54 m_networkManager =
new QNetworkAccessManager();
55 connect(m_networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(networkManagerFinished(QNetworkReply*)));
82 qDebug(
"SoapySDROutput::openDevice: look in Tx buddies");
87 if (deviceSoapySDRShared == 0)
89 qCritical(
"SoapySDROutput::openDevice: the sink buddy shared pointer is null");
93 SoapySDR::Device *device = deviceSoapySDRShared->
m_device;
97 qCritical(
"SoapySDROutput::openDevice: cannot get device pointer from Tx buddy");
107 qDebug(
"SoapySDROutput::openDevice: look in Rx buddies");
112 if (deviceSoapySDRShared == 0)
114 qCritical(
"SoapySDROutput::openDevice: the source buddy shared pointer is null");
118 SoapySDR::Device *device = deviceSoapySDRShared->
m_device;
122 qCritical(
"SoapySDROutput::openDevice: cannot get device pointer from Rx buddy");
132 qDebug(
"SoapySDROutput::openDevice: open device here");
138 qCritical(
"SoapySDROutput::openDevice: cannot open SoapySDR device");
185 SoapySDR::RangeList rangeList = freqSettings.
m_ranges;
187 if (rangeList.size() > 0)
189 SoapySDR::Range range = rangeList[0];
190 min = range.minimum();
191 max = range.maximum();
311 }
else if (it.type == SoapySDR::ArgInfo::INT) {
313 }
else if (it.type == SoapySDR::ArgInfo::FLOAT) {
315 }
else if (it.type == SoapySDR::ArgInfo::STRING) {
329 }
else if (it.type == SoapySDR::ArgInfo::INT) {
331 }
else if (it.type == SoapySDR::ArgInfo::FLOAT) {
333 }
else if (it.type == SoapySDR::ArgInfo::STRING) {
370 std::vector<DeviceAPI*>::const_iterator it = sinkBuddies.begin();
372 for (; it != sinkBuddies.end(); ++it)
378 soapySDROutputThread = buddySink->
getThread();
380 if (soapySDROutputThread) {
386 return soapySDROutputThread;
397 std::vector<DeviceAPI*>::const_iterator it = sinkBuddies.begin();
399 for (; it != sinkBuddies.end(); ++it)
448 qDebug(
"SoapySDROutput::start: no device object");
454 bool needsStart =
false;
456 if (soapySDROutputThread)
458 qDebug(
"SoapySDROutput::start: thread is already allocated");
460 int nbOriginalChannels = soapySDROutputThread->
getNbChannels();
462 if (requestedChannel+1 > nbOriginalChannels)
464 qDebug(
"SoapySDROutput::start: expand channels. Re-allocate thread and take ownership");
467 unsigned int *log2Interps =
new unsigned int[nbOriginalChannels];
469 for (
int i = 0;
i < nbOriginalChannels;
i++)
471 fifos[
i] = soapySDROutputThread->
getFifo(
i);
476 delete soapySDROutputThread;
480 for (
int i = 0;
i < nbOriginalChannels;
i++)
482 soapySDROutputThread->
setFifo(
i, fifos[
i]);
488 std::vector<DeviceAPI*>::const_iterator it = sinkBuddies.begin();
490 for (; it != sinkBuddies.end(); ++it) {
494 delete[] log2Interps;
501 qDebug(
"SoapySDROutput::start: keep buddy thread");
506 qDebug(
"SoapySDROutput::start: allocate thread and take ownership");
517 qDebug(
"SoapySDROutput::start: (re)sart buddy thread");
522 qDebug(
"SoapySDROutput::start: started");
552 if (soapySDROutputThread == 0) {
556 int nbOriginalChannels = soapySDROutputThread->
getNbChannels();
558 if (nbOriginalChannels == 1)
560 qDebug(
"SoapySDROutput::stop: SO mode. Just stop and delete the thread");
562 delete soapySDROutputThread;
567 std::vector<DeviceAPI*>::const_iterator it = sinkBuddies.begin();
569 for (; it != sinkBuddies.end(); ++it) {
573 else if (requestedChannel == nbOriginalChannels - 1)
575 qDebug(
"SoapySDROutput::stop: MO mode. Reduce by deleting and re-creating the thread");
578 unsigned int *log2Interps =
new unsigned int[nbOriginalChannels-1];
579 int highestActiveChannelIndex = -1;
581 for (
int i = 0;
i < nbOriginalChannels-1;
i++)
583 fifos[
i] = soapySDROutputThread->
getFifo(
i);
585 if ((soapySDROutputThread->
getFifo(
i) != 0) && (
i > highestActiveChannelIndex)) {
586 highestActiveChannelIndex =
i;
592 delete soapySDROutputThread;
595 if (highestActiveChannelIndex >= 0)
600 for (
int i = 0;
i < nbOriginalChannels-1;
i++)
602 soapySDROutputThread->
setFifo(
i, fifos[
i]);
608 qDebug(
"SoapySDROutput::stop: do not re-create thread as there are no more FIFOs active");
613 std::vector<DeviceAPI*>::const_iterator it = sinkBuddies.begin();
615 for (; it != sinkBuddies.end(); ++it) {
619 if (highestActiveChannelIndex >= 0)
621 qDebug(
"SoapySDROutput::stop: restarting the thread");
625 delete[] log2Interps;
630 qDebug(
"SoapySDROutput::stop: MO mode. Not changing MO configuration. Just remove FIFO reference");
631 soapySDROutputThread->
setFifo(requestedChannel, 0);
699 qint64 df = ((qint64)freq_hz * loPpmTenths) / 10000000LL;
704 dev->setFrequency(SOAPY_SDR_TX,
708 qDebug(
"SoapySDROutput::setDeviceCenterFrequency: setFrequency(%llu)", freq_hz);
711 catch (
const std::exception &ex)
713 qCritical(
"SoapySDROutput::applySettings: could not set frequency: %llu: %s", freq_hz, ex.what());
726 settings.
m_globalGain = round(dev->getGain(SOAPY_SDR_TX, requestedChannel));
729 settings.
m_individualGains[name] = dev->getGain(SOAPY_SDR_TX, requestedChannel, name.toStdString());
732 catch (
const std::exception &ex)
734 qCritical(
"SoapySDROutput::updateGains: caught exception: %s", ex.what());
747 settings.
m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_TX, requestedChannel, name.toStdString());
750 catch (
const std::exception &ex)
752 qCritical(
"SoapySDROutput::updateTunableElements: caught exception: %s", ex.what());
761 qDebug() <<
"SoapySDROutput::handleMessage: MsgConfigureSoapySDROutput";
764 qDebug(
"SoapySDROutput::handleMessage: MsgConfigureSoapySDROutput config error");
772 qDebug() <<
"SoapySDROutput::handleMessage: MsgStartStop: " << (cmd.
getStartStop() ?
"start" :
"stop");
828 auto nvalue = deviceArgSettings.find(oname);
833 qDebug(
"SoapySDROutput::handleMessage: MsgReportDeviceArgsChange: device argument %s set to %s",
834 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
856 bool forwardChangeOwnDSP =
false;
857 bool forwardChangeToBuddies =
false;
858 bool globalGainChanged =
false;
859 bool individualGainsChanged =
false;
860 bool deviceArgsChanged =
false;
861 QList<QString> reverseAPIKeys;
868 xlatedDeviceCenterFrequency = xlatedDeviceCenterFrequency < 0 ? 0 : xlatedDeviceCenterFrequency;
876 if (soapySDROutputThread)
878 fifo = soapySDROutputThread->
getFifo(requestedChannel);
879 soapySDROutputThread->
setFifo(requestedChannel, 0);
904 reverseAPIKeys.append(
"devSampleRate");
905 forwardChangeOwnDSP =
true;
906 forwardChangeToBuddies =
true;
912 dev->setSampleRate(SOAPY_SDR_TX, requestedChannel, settings.
m_devSampleRate);
913 qDebug() <<
"SoapySDROutput::applySettings: setSampleRate OK: " << settings.
m_devSampleRate;
917 bool wasRunning = outputThread->
isRunning();
926 catch (
const std::exception &ex)
928 qCritical(
"SoapySDROutput::applySettings: could not set sample rate: %d: %s",
936 reverseAPIKeys.append(
"log2Interp");
937 forwardChangeOwnDSP =
true;
939 if (outputThread != 0)
942 qDebug() <<
"SoapySDROutput::applySettings: set decimation to " << (1<<settings.
m_log2Interp);
947 reverseAPIKeys.append(
"centerFrequency");
950 reverseAPIKeys.append(
"transverterMode");
953 reverseAPIKeys.append(
"transverterDeltaFrequency");
956 reverseAPIKeys.append(
"LOppmTenths");
966 forwardChangeOwnDSP =
true;
967 forwardChangeToBuddies =
true;
976 reverseAPIKeys.append(
"antenna");
982 dev->setAntenna(SOAPY_SDR_TX, requestedChannel, settings.
m_antenna.toStdString());
983 qDebug(
"SoapySDROutput::applySettings: set antenna to %s", settings.
m_antenna.toStdString().c_str());
985 catch (
const std::exception &ex)
987 qCritical(
"SoapySDROutput::applySettings: cannot set antenna to %s: %s",
988 settings.
m_antenna.toStdString().c_str(), ex.what());
995 reverseAPIKeys.append(
"bandwidth");
996 forwardChangeToBuddies =
true;
1002 dev->setBandwidth(SOAPY_SDR_TX, requestedChannel, settings.
m_bandwidth);
1003 qDebug(
"SoapySDROutput::applySettings: bandwidth set to %u", settings.
m_bandwidth);
1005 catch (
const std::exception &ex)
1007 qCritical(
"SoapySDROutput::applySettings: cannot set bandwidth to %u: %s",
1023 dev->setFrequency(SOAPY_SDR_TX, requestedChannel, oname.toStdString(), *nvalue);
1024 qDebug(
"SoapySDROutput::applySettings: tunable element %s frequency set to %lf",
1025 oname.toStdString().c_str(), *nvalue);
1027 catch (
const std::exception &ex)
1029 qCritical(
"SoapySDROutput::applySettings: cannot set tunable element %s to %lf: %s",
1030 oname.toStdString().c_str(), *nvalue, ex.what());
1040 reverseAPIKeys.append(
"globalGain");
1046 dev->setGain(SOAPY_SDR_TX, requestedChannel, settings.
m_globalGain);
1047 qDebug(
"SoapySDROutput::applySettings: set global gain to %d", settings.
m_globalGain);
1048 globalGainChanged =
true;
1050 catch (
const std::exception &ex)
1052 qCritical(
"SoapySDROutput::applySettings: cannot set global gain to %d: %s",
1068 dev->setGain(SOAPY_SDR_TX, requestedChannel, oname.toStdString(), *nvalue);
1069 qDebug(
"SoapySDROutput::applySettings: individual gain %s set to %lf",
1070 oname.toStdString().c_str(), *nvalue);
1071 individualGainsChanged =
true;
1073 catch (
const std::exception &ex)
1075 qCritical(
"SoapySDROutput::applySettings: cannot set individual gain %s to %lf: %s",
1076 oname.toStdString().c_str(), *nvalue, ex.what());
1086 reverseAPIKeys.append(
"autoGain");
1092 dev->setGainMode(SOAPY_SDR_TX, requestedChannel, settings.
m_autoGain);
1093 qDebug(
"SoapySDROutput::applySettings: %s AGC", settings.
m_autoGain ?
"set" :
"unset");
1095 catch (
const std::exception &ex)
1097 qCritical(
"SoapySDROutput::applySettings: cannot %s AGC", settings.
m_autoGain ?
"set" :
"unset");
1104 reverseAPIKeys.append(
"autoDCCorrection");
1111 qDebug(
"SoapySDROutput::applySettings: %s DC auto correction", settings.
m_autoDCCorrection ?
"set" :
"unset");
1113 catch (
const std::exception &ex)
1115 qCritical(
"SoapySDROutput::applySettings: cannot %s DC auto correction", settings.
m_autoDCCorrection ?
"set" :
"unset");
1122 reverseAPIKeys.append(
"dcCorrection");
1128 dev->setDCOffset(SOAPY_SDR_TX, requestedChannel, settings.
m_dcCorrection);
1129 qDebug(
"SoapySDROutput::applySettings: DC offset correction set to (%lf, %lf)", settings.
m_dcCorrection.real(), settings.
m_dcCorrection.imag());
1131 catch (
const std::exception &ex)
1133 qCritical(
"SoapySDROutput::applySettings: cannot set DC offset correction to (%lf, %lf)", settings.
m_dcCorrection.real(), settings.
m_dcCorrection.imag());
1140 reverseAPIKeys.append(
"iqCorrection");
1146 dev->setIQBalance(SOAPY_SDR_TX, requestedChannel, settings.
m_iqCorrection);
1147 qDebug(
"SoapySDROutput::applySettings: IQ balance correction set to (%lf, %lf)", settings.
m_iqCorrection.real(), settings.
m_iqCorrection.imag());
1149 catch (
const std::exception &ex)
1151 qCritical(
"SoapySDROutput::applySettings: cannot set IQ balance correction to (%lf, %lf)", settings.
m_iqCorrection.real(), settings.
m_iqCorrection.imag());
1166 dev->writeSetting(SOAPY_SDR_TX, requestedChannel, oname.toStdString(), nvalue->toString().toStdString());
1167 qDebug(
"SoapySDROutput::applySettings: stream argument %s set to %s",
1168 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
1170 catch (
const std::exception &ex)
1172 qCritical(
"SoapySDROutput::applySettings: cannot set stream argument %s to %s: %s",
1173 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
1191 dev->writeSetting(oname.toStdString(), nvalue->toString().toStdString());
1192 qDebug(
"SoapySDROutput::applySettings: device argument %s set to %s",
1193 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
1195 catch (
const std::exception &ex)
1197 qCritical(
"SoapySDRInput::applySettings: cannot set device argument %s to %s: %s",
1198 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
1203 deviceArgsChanged =
true;
1207 if (forwardChangeOwnDSP)
1214 if (forwardChangeToBuddies)
1220 for (
const auto &itSource : sourceBuddies)
1228 itSource->getSamplingDeviceInputMessageQueue()->push(report);
1231 for (
const auto &itSink : sinkBuddies)
1239 itSink->getSamplingDeviceInputMessageQueue()->push(report);
1243 if (deviceArgsChanged)
1249 for (
const auto &itSource : sourceBuddies)
1253 itSource->getSamplingDeviceInputMessageQueue()->push(report);
1256 for (
const auto &itSink : sinkBuddies)
1260 itSink->getSamplingDeviceInputMessageQueue()->push(report);
1271 if (fullUpdate || force) {
1273 }
else if (reverseAPIKeys.size() != 0) {
1280 if (globalGainChanged || individualGainsChanged)
1293 qDebug() <<
"SoapySDROutput::applySettings: " 1302 <<
" force: " << force;
1307 qDebug(
"SoapySDROutput::applySettings: m_individualGains[%s]: %lf", doubleIt.key().toStdString().c_str(), doubleIt.value());
1313 qDebug(
"SoapySDROutput::applySettings: m_tunableElements[%s]: %lf", doubleIt.key().toStdString().c_str(), doubleIt.value());
1320 qDebug(
"SoapySDROutput::applySettings: m_deviceArgSettings[%s] (type %d): %s",
1321 varIt.key().toStdString().c_str(),
1322 (int) varIt.value().type(),
1323 varIt.value().toString().toStdString().c_str());
1330 qDebug(
"SoapySDROutput::applySettings: m_streamArgSettings[%s] (type %d): %s",
1331 varIt.key().toStdString().c_str(),
1332 (int) varIt.value().type(),
1333 varIt.value().toString().toStdString().c_str());
1341 QString& errorMessage)
1343 (void) errorMessage;
1352 const QStringList& deviceSettingsKeys,
1354 QString& errorMessage)
1356 (void) errorMessage;
1359 if (deviceSettingsKeys.contains(
"centerFrequency")) {
1362 if (deviceSettingsKeys.contains(
"LOppmTenths")) {
1365 if (deviceSettingsKeys.contains(
"devSampleRate")) {
1368 if (deviceSettingsKeys.contains(
"bandwidth")) {
1371 if (deviceSettingsKeys.contains(
"log2Interp")) {
1374 if (deviceSettingsKeys.contains(
"transverterDeltaFrequency")) {
1377 if (deviceSettingsKeys.contains(
"transverterMode")) {
1380 if (deviceSettingsKeys.contains(
"antenna")) {
1384 if (deviceSettingsKeys.contains(
"tunableElements"))
1388 for (
const auto &itArg : *tunableElements)
1390 QMap<QString, double>::iterator itSettings = settings.
m_tunableElements.find(*(itArg->getKey()));
1395 itSettings.value() = v.toDouble();
1400 if (deviceSettingsKeys.contains(
"globalGain")) {
1404 if (deviceSettingsKeys.contains(
"individualGains"))
1408 for (
const auto &itArg : *individualGains)
1410 QMap<QString, double>::iterator itSettings = settings.
m_individualGains.find(*(itArg->getKey()));
1415 itSettings.value() = v.toDouble();
1420 if (deviceSettingsKeys.contains(
"autoGain")) {
1423 if (deviceSettingsKeys.contains(
"autoDCCorrection")) {
1426 if (deviceSettingsKeys.contains(
"autoIQCorrection")) {
1429 if (deviceSettingsKeys.contains(
"dcCorrection"))
1434 if (deviceSettingsKeys.contains(
"iqCorrection"))
1440 if (deviceSettingsKeys.contains(
"streamArgSettings"))
1444 for (
const auto itArg : *streamArgSettings)
1446 QMap<QString, QVariant>::iterator itSettings = settings.
m_streamArgSettings.find(*itArg->getKey());
1454 if (deviceSettingsKeys.contains(
"deviceArgSettings"))
1458 for (
const auto itArg : *deviceArgSettings)
1460 QMap<QString, QVariant>::iterator itSettings = settings.
m_deviceArgSettings.find(*itArg->getKey());
1468 if (deviceSettingsKeys.contains(
"useReverseAPI")) {
1471 if (deviceSettingsKeys.contains(
"reverseAPIAddress")) {
1474 if (deviceSettingsKeys.contains(
"reverseAPIPort")) {
1477 if (deviceSettingsKeys.contains(
"reverseAPIDeviceIndex")) {
1496 (void) errorMessage;
1505 QString& errorMessage)
1507 (void) errorMessage;
1515 QString& errorMessage)
1517 (void) errorMessage;
1675 for (
const auto itAntenna : channelSettings->
m_antennas) {
1710 for (
const auto itRange : itFreq.m_ranges)
1751 return QVariant((
int) (atoi(argValue->
getValueString()->toStdString().c_str())));
1753 return QVariant((
double) (atof(argValue->
getValueString()->toStdString().c_str())));
1761 if (v.type() == QVariant::Bool)
1766 else if (v.type() == QVariant::Int)
1771 else if (v.type() == QVariant::Double)
1785 argInfo->
setKey(
new QString(arg.key.c_str()));
1789 }
else if (arg.type == SoapySDR::ArgInfo::INT) {
1791 }
else if (arg.type == SoapySDR::ArgInfo::FLOAT) {
1798 argInfo->
setName(
new QString(arg.name.c_str()));
1800 argInfo->
setUnits(
new QString(arg.units.c_str()));
1802 if ((arg.range.minimum() != 0.0) || (arg.range.maximum() != 0.0))
1811 for (
const auto itOpt : arg.options) {
1817 for (
const auto itOpt : arg.optionNames) {
1834 if (deviceSettingsKeys.contains(
"centerFrequency") || force) {
1837 if (deviceSettingsKeys.contains(
"LOppmTenths") || force) {
1840 if (deviceSettingsKeys.contains(
"devSampleRate") || force) {
1843 if (deviceSettingsKeys.contains(
"bandwidth") || force) {
1846 if (deviceSettingsKeys.contains(
"log2Interp") || force) {
1849 if (deviceSettingsKeys.contains(
"transverterDeltaFrequency") || force) {
1852 if (deviceSettingsKeys.contains(
"transverterMode") || force) {
1855 if (deviceSettingsKeys.contains(
"antenna") || force) {
1858 if (deviceSettingsKeys.contains(
"globalGain") || force) {
1861 if (deviceSettingsKeys.contains(
"autoGain") || force) {
1864 if (deviceSettingsKeys.contains(
"autoDCCorrection") || force) {
1867 if (deviceSettingsKeys.contains(
"autoIQCorrection") || force) {
1870 if (deviceSettingsKeys.contains(
"dcCorrection") || force)
1876 if (deviceSettingsKeys.contains(
"iqCorrection") || force)
1883 QString deviceSettingsURL = QString(
"http://%1:%2/sdrangel/deviceset/%3/device/settings")
1888 m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader,
"application/json");
1890 QBuffer *buffer=
new QBuffer();
1891 buffer->open((QBuffer::ReadWrite));
1892 buffer->write(swgDeviceSettings->
asJson().toUtf8());
1898 delete swgDeviceSettings;
1908 QString deviceSettingsURL = QString(
"http://%1:%2/sdrangel/deviceset/%3/device/run")
1913 m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader,
"application/json");
1915 QBuffer *buffer=
new QBuffer();
1916 buffer->open((QBuffer::ReadWrite));
1917 buffer->write(swgDeviceSettings->
asJson().toUtf8());
1926 delete swgDeviceSettings;
1931 QNetworkReply::NetworkError replyError = reply->error();
1935 qWarning() <<
"SoapySDROutput::networkManagerFinished:" 1936 <<
" error(" << (int) replyError
1937 <<
"): " << replyError
1938 <<
": " << reply->errorString();
1942 QString answer = reply->readAll();
1944 qDebug(
"SoapySDROutput::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
void setAutoIqCorrection(qint32 auto_iq_correction)
bool startDeviceEngine()
Start the device engine corresponding to the stream type.
void setHasFrequencyCorrectionValue(qint32 has_frequency_correction_value)
static const int m_sampleFifoMinSize32
static const int m_sampleFifoMinSize
QList< SWGArgValue * > * getTunableElements()
int m_channel
allocated channel (-1 if none)
QMap< QString, double > m_tunableElements
SWGComplex * getIqCorrection()
void push(Message *message, bool emitSignal=true)
Push message onto queue.
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
void stopDeviceEngine()
Stop the device engine corresponding to the stream type.
QList< QString * > * getValueOptions()
QList< QString * > * getOptionNames()
void setName(QString *name)
void setAutoDcCorrection(qint32 auto_dc_correction)
qint32 getUseReverseApi()
unsigned int getLog2Interpolation(unsigned int channel) const
void setAutoGain(qint32 auto_gain)
SWGComplex * getDcCorrection()
virtual const QString & getDeviceDescription() const
virtual ~SoapySDROutput()
const std::vector< DeviceAPI * > & getSinkBuddies() const
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
static MsgReportDeviceArgsChange * create(const QMap< QString, QVariant > &deviceArgSettings)
void setValueOptions(QList< QString *> *value_options)
std::string getTxChannelMainTunableElementName(uint32_t index)
virtual QString asJson() override
static DeviceSoapySDR & instance()
MessageQueue * getDeviceEngineInputMessageQueue()
Device engine message queue.
void initStreamArgSettings(SoapySDROutputSettings &settings)
void setFrequencySettingsArgs(QList< SWGArgInfo *> *frequency_settings_args)
SoapySDR::ArgInfoList m_frequencySettingsArgs
common tuning parameters
const QMap< QString, QVariant > & getDeviceArgSettings() const
void setDevSampleRate(qint32 dev_sample_rate)
void setHasAgc(qint32 has_agc)
SoapySDROutputThread * getThread()
bool hasIQCorrectionValue()
void getGlobalGainRange(int &min, int &max)
void setSoapySdrOutputSettings(SWGSoapySDROutputSettings *soapy_sdr_output_settings)
uint32_t getDeviceItemIndex() const
QList< SWGArgValue * > * getStreamArgSettings()
const SoapySDR::RangeList & getBandwidthRanges()
void closeSoapySdr(SoapySDR::Device *device)
QByteArray serialize() const
QNetworkRequest m_networkRequest
static MsgReportBuddyChange * create(uint64_t centerFrequency, int LOppmTenths, int fcPos, int devSampleRate, bool rxElseTx)
void setTunableElements(QList< SWGArgValue *> *tunable_elements)
bool m_hasFrequencyCorrectionValue
Frequency correction value flag.
void updateGains(SoapySDR::Device *dev, int requestedChannel, SoapySDROutputSettings &settings)
void setRange(SWGRangeFloat *range)
qint32 getAutoIqCorrection()
QList< SWGSoapySDRGainSetting * > * getGainSettings()
SWGSoapySDROutputSettings * getSoapySdrOutputSettings()
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
bool m_hasDCOffsetValue
DC offset value flag.
qint32 getAutoDcCorrection()
bool initDeviceEngine()
Init the device engine corresponding to the stream type.
virtual int getSampleRate() const
Sample rate exposed by the sink.
void setDeviceSettingsArgs(QList< SWGArgInfo *> *device_settings_args)
void setIndividualGains(QList< SWGArgValue *> *individual_gains)
const QString & getHardwareUserArguments() const
bool m_hasDCAutoCorrection
DC offset auto correction flag.
QList< SWGArgInfo * > * getStreamSettingsArgs()
void initDeviceArgSettings(SoapySDROutputSettings &settings)
void setSampleRate(unsigned int sampleRate)
void setAntenna(QString *antenna)
void setStreamSettingsArgs(QList< SWGArgInfo *> *stream_settings_args)
const std::vector< DeviceSoapySDRParams::FrequencySetting > & getTunableElements()
std::vector< FrequencySetting > m_frequencySettings
tunable elements settings
void setSoapySdrOutputReport(SWGSoapySDRReport *soapy_sdr_output_report)
bool hasDCAutoCorrection()
void setOriginatorIndex(qint32 originator_index)
const SoapySDR::RangeList & getRateRanges()
QMap< QString, QVariant > m_streamArgSettings
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings &response, const SoapySDROutputSettings &settings)
QString m_deviceDescription
MessageQueue m_inputMessageQueue
Input queue to the sink.
void setIqCorrection(SWGComplex *iq_correction)
unsigned int getNbChannels() const
void setValueString(QString *value_string)
void setValueString(QString *value_string)
void setValueType(QString *value_type)
QString * getValueString()
void setGainRange(SWGRangeFloat *gain_range)
QVariant webapiVariantFromArgValue(SWGSDRangel::SWGArgValue *argValue)
int getDeviceSetIndex() const
SoapySDR::RangeList m_ranges
List of ranges of the tunable element.
qint32 getTransverterMode()
void setHasDcAutoCorrection(qint32 has_dc_auto_correction)
QList< SWGArgInfo * > * getDeviceSettingsArgs()
void * getBuddySharedPtr() const
void setBandwidth(qint32 bandwidth)
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
virtual void setCenterFrequency(qint64 centerFrequency)
void setRatesRanges(QList< SWGRangeFloat *> *rates_ranges)
qint32 getReverseApiPort()
uint16_t m_reverseAPIDeviceIndex
void setGainSettings(QList< SWGSoapySDRGainSetting *> *gain_settings)
std::vector< std::string > m_antennas
Antenna ports names.
DeviceSoapySDRParams * m_deviceParams
void setUseReverseApi(qint32 use_reverse_api)
QMap< QString, double > m_individualGains
SoapySDR::RangeList m_ratesRanges
list of ranges of sample rates
void setBuddySharedPtr(void *ptr)
void updateTunableElements(SoapySDR::Device *dev, int requestedChannel, SoapySDROutputSettings &settings)
const SoapySDR::ArgInfoList & getDeviceArgInfoList()
void setBandwidthsRanges(QList< SWGRangeFloat *> *bandwidths_ranges)
void setKey(QString *key)
void setDcCorrection(SWGComplex *dc_correction)
void webapiReverseSendSettings(QList< QString > &deviceSettingsKeys, const SoapySDROutputSettings &settings, bool force)
const SoapySDR::ArgInfoList & getDeviceArgs() const
void getFrequencyRange(uint64_t &min, uint64_t &max)
QList< SWGArgInfo * > * getFrequencySettingsArgs()
static bool match(const Message *message)
SWGSoapySDRReport * getSoapySdrOutputReport()
QList< SWGRangeFloat * > * getBandwidthsRanges()
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport &response)
SoapySDR::Device * m_device
virtual void init()
initializations to be done when all collaborating objects are created and possibly connected ...
void initGainSettings(SoapySDROutputSettings &settings)
void webapiFormatArgInfo(const SoapySDR::ArgInfo &arg, SWGSDRangel::SWGArgInfo *argInfo)
bool getStartStop() const
std::complex< double > m_iqCorrection
void setTransverterMode(qint32 transverter_mode)
qint64 m_transverterDeltaFrequency
static const float m_sampleFifoLengthInSeconds
SWGRangeFloat * getRange()
SoapySDROutputSettings m_settings
void setFifo(unsigned int channel, SampleSourceFifo *sampleFifo)
bool applySettings(const SoapySDROutputSettings &settings, bool force=false)
SoapySDR::RangeList m_bandwidthsRanges
list of ranges of bandwidths
uint16_t m_reverseAPIPort
const std::vector< DeviceSoapySDRParams::GainSetting > & getIndividualGainsRanges()
void setUnits(QString *units)
void setValueType(QString *value_type)
QList< SWGSoapySDRFrequencySetting * > * getFrequencySettings()
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
virtual bool deserialize(const QByteArray &data)
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
void setReverseApiAddress(QString *reverse_api_address)
void getDeviceEngineStateStr(QString &state)
void resize(uint32_t size)
void setFrequencySettings(QList< SWGSoapySDRFrequencySetting *> *frequency_settings)
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
const std::vector< std::string > & getAntennas()
SWGRangeFloat * getGainRange()
void setReverseApiPort(qint32 reverse_api_port)
const ChannelSettings * getTxChannelSettings(uint32_t index)
quint64 m_centerFrequency
SoapySDR::Device * openSoapySDR(uint32_t sequence, const QString &hardwareUserArguments)
void setDescription(QString *description)
void networkManagerFinished(QNetworkReply *reply)
void setCenterFrequency(qint64 center_frequency)
void setHasIqBalanceValue(qint32 has_iq_balance_value)
qint32 getReverseApiDeviceIndex()
void setDeviceArgSettings(QList< SWGArgValue *> *device_arg_settings)
QString m_reverseAPIAddress
SoapySDROutputThread * findThread()
std::complex< double > m_dcCorrection
QList< SWGArgValue * > * getIndividualGains()
QList< SWGArgValue * > * getDeviceArgSettings()
virtual QByteArray serialize() const
SampleSourceFifo m_sampleSourceFifo
const std::vector< DeviceAPI * > & getSourceBuddies() const
qint64 getTransverterDeltaFrequency()
void initTunableElementsSettings(SoapySDROutputSettings &settings)
void setStreamArgSettings(QList< SWGArgValue *> *stream_arg_settings)
std::vector< GainSetting > m_gainSettings
gain elements settings
DeviceSoapySDRShared m_deviceShared
void setOptionNames(QList< QString *> *option_names)
virtual bool handleMessage(const Message &message)
const SoapySDR::ArgInfoList & getStreamArgInfoList()
static MsgStartStop * create(bool startStop)
void webapiFormatArgValue(const QVariant &v, SWGSDRangel::SWGArgValue *argValue)
QList< QString * > * getAntennas()
qint64 getCenterFrequency()
SoapySDR::ArgInfoList m_streamSettingsArgs
common stream parameters
QList< SWGRangeFloat * > * getRatesRanges()
SampleSourceFifo * getFifo(unsigned int channel)
virtual quint64 getCenterFrequency() const
Center frequency exposed by the sink.
MessageQueue * getMessageQueueToGUI()
void setLog2Interp(qint32 log2_interp)
bool deserialize(const QByteArray &data)
uint32_t getSamplingDeviceSequence() const
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
void setDirection(qint32 direction)
bool hasDCCorrectionValue()
bool m_hasIQBalanceValue
IQ correction value flag.
qint32 getDevSampleRate()
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
QNetworkAccessManager * m_networkManager
void setThread(SoapySDROutputThread *thread)
void setAntennas(QList< QString *> *antennas)
void setLog2Interpolation(unsigned int channel, unsigned int log2_interp)
QMap< QString, QVariant > m_deviceArgSettings
static MsgReportGainChange * create(const SoapySDROutputSettings &settings, bool globalGain, bool individualGains)
bool setDeviceCenterFrequency(SoapySDR::Device *dev, int requestedChannel, quint64 freq_hz, int loPpmTenths)
T max(const T &x, const T &y)
void setHasDcOffsetValue(qint32 has_dc_offset_value)
void setDeviceHwType(QString *device_hw_type)
void setLOppmTenths(qint32 l_oppm_tenths)
void setGlobalGain(qint32 global_gain)
SoapySDR::Range m_gainRange
Global gain range.
SoapySDROutputThread * m_thread
T min(const T &x, const T &y)
void webapiReverseSendStartStop(bool start)
unsigned __int64 uint64_t
QString * getReverseApiAddress()