19 #include <QNetworkReply> 45 m_deviceAPI(deviceAPI),
52 initGainSettings(m_settings);
53 initTunableElementsSettings(m_settings);
54 initStreamArgSettings(m_settings);
55 initDeviceArgSettings(m_settings);
57 m_fileSink =
new FileRecord(QString(
"test_%1.sdriq").
arg(m_deviceAPI->getDeviceUID()));
58 m_deviceAPI->setNbSourceStreams(1);
59 m_deviceAPI->addAncillarySink(m_fileSink);
61 m_networkManager =
new QNetworkAccessManager();
62 connect(m_networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(networkManagerFinished(QNetworkReply*)));
89 qCritical(
"SoapySDRInput::openDevice: could not allocate SampleFifo");
94 qDebug(
"SoapySDRInput::openDevice: allocated SampleFifo");
100 qDebug(
"SoapySDRInput::openDevice: look in Rx buddies");
105 if (deviceSoapySDRShared == 0)
107 qCritical(
"SoapySDRInput::openDevice: the source buddy shared pointer is null");
111 SoapySDR::Device *device = deviceSoapySDRShared->
m_device;
115 qCritical(
"SoapySDRInput::openDevice: cannot get device pointer from Rx buddy");
125 qDebug(
"SoapySDRInput::openDevice: look in Tx buddies");
130 if (deviceSoapySDRShared == 0)
132 qCritical(
"SoapySDRInput::openDevice: the sink buddy shared pointer is null");
136 SoapySDR::Device *device = deviceSoapySDRShared->
m_device;
140 qCritical(
"SoapySDRInput::openDevice: cannot get device pointer from Tx buddy");
150 qDebug(
"SoapySDRInput::openDevice: open device here");
156 qCritical(
"BladeRF2Input::openDevice: cannot open BladeRF2 device");
205 SoapySDR::RangeList rangeList = freqSettings.
m_ranges;
207 if (rangeList.size() > 0)
209 SoapySDR::Range range = rangeList[0];
210 min = range.minimum();
211 max = range.maximum();
268 const std::vector<std::string>& antennaList =
getAntennas();
269 std::vector<std::string>::const_iterator it = std::find(antennaList.begin(), antennaList.end(), antenna);
271 if (it == antennaList.end()) {
274 return it - antennaList.begin();
343 }
else if (it.type == SoapySDR::ArgInfo::INT) {
345 }
else if (it.type == SoapySDR::ArgInfo::FLOAT) {
347 }
else if (it.type == SoapySDR::ArgInfo::STRING) {
361 }
else if (it.type == SoapySDR::ArgInfo::INT) {
363 }
else if (it.type == SoapySDR::ArgInfo::FLOAT) {
365 }
else if (it.type == SoapySDR::ArgInfo::STRING) {
402 std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
404 for (; it != sourceBuddies.end(); ++it)
410 soapySDRInputThread = buddySource->
getThread();
412 if (soapySDRInputThread) {
418 return soapySDRInputThread;
429 std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
431 for (; it != sourceBuddies.end(); ++it)
481 qDebug(
"SoapySDRInput::start: no device object");
487 bool needsStart =
false;
489 if (soapySDRInputThread)
491 qDebug(
"SoapySDRInput::start: thread is already allocated");
493 int nbOriginalChannels = soapySDRInputThread->
getNbChannels();
495 if (requestedChannel+1 > nbOriginalChannels)
497 qDebug(
"SoapySDRInput::start: expand channels. Re-allocate thread and take ownership");
500 unsigned int *log2Decims =
new unsigned int[nbOriginalChannels];
501 int *fcPoss =
new int[nbOriginalChannels];
503 for (
int i = 0;
i < nbOriginalChannels;
i++)
505 fifos[
i] = soapySDRInputThread->
getFifo(
i);
511 delete soapySDRInputThread;
515 for (
int i = 0;
i < nbOriginalChannels;
i++)
517 soapySDRInputThread->
setFifo(
i, fifos[
i]);
519 soapySDRInputThread->
setFcPos(i, fcPoss[i]);
524 std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
526 for (; it != sourceBuddies.end(); ++it) {
538 qDebug(
"SoapySDRInput::start: keep buddy thread");
543 qDebug(
"SoapySDRInput::start: allocate thread and take ownership");
555 qDebug(
"SoapySDRInput::start: (re)sart buddy thread");
560 qDebug(
"SoapySDRInput::start: started");
594 if (soapySDRInputThread == 0) {
598 int nbOriginalChannels = soapySDRInputThread->
getNbChannels();
600 if (nbOriginalChannels == 1)
602 qDebug(
"SoapySDRInput::stop: SI mode. Just stop and delete the thread");
604 delete soapySDRInputThread;
609 std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
611 for (; it != sourceBuddies.end(); ++it) {
615 else if (requestedChannel == nbOriginalChannels - 1)
617 qDebug(
"SoapySDRInput::stop: MI mode. Reduce by deleting and re-creating the thread");
620 unsigned int *log2Decims =
new unsigned int[nbOriginalChannels-1];
621 int *fcPoss =
new int[nbOriginalChannels-1];
622 int highestActiveChannelIndex = -1;
624 for (
int i = 0;
i < nbOriginalChannels-1;
i++)
626 fifos[
i] = soapySDRInputThread->
getFifo(
i);
628 if ((soapySDRInputThread->
getFifo(
i) != 0) && (
i > highestActiveChannelIndex)) {
629 highestActiveChannelIndex =
i;
636 delete soapySDRInputThread;
639 if (highestActiveChannelIndex >= 0)
644 for (
int i = 0;
i < highestActiveChannelIndex;
i++)
646 soapySDRInputThread->
setFifo(
i, fifos[
i]);
648 soapySDRInputThread->
setFcPos(i, fcPoss[i]);
653 qDebug(
"SoapySDRInput::stop: do not re-create thread as there are no more FIFOs active");
658 std::vector<DeviceAPI*>::const_iterator it = sourceBuddies.begin();
660 for (; it != sourceBuddies.end(); ++it) {
664 if (highestActiveChannelIndex >= 0)
666 qDebug(
"SoapySDRInput::stop: restarting the thread");
676 qDebug(
"SoapySDRInput::stop: MI mode. Not changing MI configuration. Just remove FIFO reference");
677 soapySDRInputThread->
setFifo(requestedChannel, 0);
728 qint64 df = ((qint64)freq_hz * loPpmTenths) / 10000000LL;
733 dev->setFrequency(SOAPY_SDR_RX,
737 qDebug(
"SoapySDRInput::setDeviceCenterFrequency: setFrequency(%llu)", freq_hz);
740 catch (
const std::exception &ex)
742 qCritical(
"SoapySDRInput::applySettings: could not set frequency: %llu: %s", freq_hz, ex.what());
755 settings.
m_globalGain = round(dev->getGain(SOAPY_SDR_RX, requestedChannel));
758 settings.
m_individualGains[name] = dev->getGain(SOAPY_SDR_RX, requestedChannel, name.toStdString());
761 catch (
const std::exception &ex)
763 qCritical(
"SoapySDRInput::updateGains: caught exception: %s", ex.what());
776 settings.
m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_RX, requestedChannel, name.toStdString());
779 catch (
const std::exception &ex)
781 qCritical(
"SoapySDRInput::updateTunableElements: caught exception: %s", ex.what());
790 qDebug() <<
"SoapySDRInput::handleMessage: MsgConfigureSoapySDRInput";
793 qDebug(
"SoapySDRInput::handleMessage: MsgConfigureSoapySDRInput config error");
801 qDebug() <<
"SoapySDRInput::handleMessage: MsgFileRecord: " << conf.
getStartStop();
823 qDebug() <<
"SoapySDRInput::handleMessage: MsgStartStop: " << (cmd.
getStartStop() ?
"start" :
"stop");
864 inputThread->setFcPos(requestedChannel, (
int) settings.
m_fcPos);
885 auto nvalue = deviceArgSettings.find(oname);
890 qDebug(
"SoapySDRInput::handleMessage: MsgReportDeviceArgsChange: device argument %s set to %s",
891 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
913 bool forwardChangeOwnDSP =
false;
914 bool forwardChangeToBuddies =
false;
915 bool globalGainChanged =
false;
916 bool individualGainsChanged =
false;
917 bool deviceArgsChanged =
false;
918 QList<QString> reverseAPIKeys;
925 xlatedDeviceCenterFrequency = xlatedDeviceCenterFrequency < 0 ? 0 : xlatedDeviceCenterFrequency;
928 reverseAPIKeys.append(
"softDCCorrection");
931 reverseAPIKeys.append(
"softIQCorrection");
942 reverseAPIKeys.append(
"devSampleRate");
943 forwardChangeOwnDSP =
true;
944 forwardChangeToBuddies =
true;
950 dev->setSampleRate(SOAPY_SDR_RX, requestedChannel, settings.
m_devSampleRate);
951 qDebug() <<
"SoapySDRInput::applySettings: setSampleRate OK: " << settings.
m_devSampleRate;
955 bool wasRunning = inputThread->
isRunning();
964 catch (
const std::exception &ex)
966 qCritical(
"SoapySDRInput::applySettings: could not set sample rate: %d: %s",
974 reverseAPIKeys.append(
"fcPos");
976 if (inputThread != 0)
979 qDebug() <<
"SoapySDRInput::applySettings: set fc pos (enum) to " << (int) settings.
m_fcPos;
985 reverseAPIKeys.append(
"log2Decim");
986 forwardChangeOwnDSP =
true;
989 if (inputThread != 0)
992 qDebug() <<
"SoapySDRInput::applySettings: set decimation to " << (1<<settings.
m_log2Decim);
997 reverseAPIKeys.append(
"centerFrequency");
1000 reverseAPIKeys.append(
"transverterMode");
1003 reverseAPIKeys.append(
"transverterDeltaFrequency");
1006 reverseAPIKeys.append(
"LOppmTenths");
1018 xlatedDeviceCenterFrequency,
1023 DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD,
1026 forwardChangeOwnDSP =
true;
1027 forwardChangeToBuddies =
true;
1036 reverseAPIKeys.append(
"antenna");
1042 dev->setAntenna(SOAPY_SDR_RX, requestedChannel, settings.
m_antenna.toStdString());
1043 qDebug(
"SoapySDRInput::applySettings: set antenna to %s", settings.
m_antenna.toStdString().c_str());
1045 catch (
const std::exception &ex)
1047 qCritical(
"SoapySDRInput::applySettings: cannot set antenna to %s: %s",
1048 settings.
m_antenna.toStdString().c_str(), ex.what());
1055 reverseAPIKeys.append(
"bandwidth");
1056 forwardChangeToBuddies =
true;
1062 dev->setBandwidth(SOAPY_SDR_RX, requestedChannel, settings.
m_bandwidth);
1063 qDebug(
"SoapySDRInput::applySettings: bandwidth set to %u", settings.
m_bandwidth);
1065 catch (
const std::exception &ex)
1067 qCritical(
"SoapySDRInput::applySettings: cannot set bandwidth to %u: %s",
1083 dev->setFrequency(SOAPY_SDR_RX, requestedChannel, oname.toStdString(), *nvalue);
1084 qDebug(
"SoapySDRInput::applySettings: tunable element %s frequency set to %lf",
1085 oname.toStdString().c_str(), *nvalue);
1087 catch (
const std::exception &ex)
1089 qCritical(
"SoapySDRInput::applySettings: cannot set tunable element %s to %lf: %s",
1090 oname.toStdString().c_str(), *nvalue, ex.what());
1100 reverseAPIKeys.append(
"globalGain");
1106 dev->setGain(SOAPY_SDR_RX, requestedChannel, settings.
m_globalGain);
1107 qDebug(
"SoapySDRInput::applySettings: set global gain to %d", settings.
m_globalGain);
1108 globalGainChanged =
true;
1110 catch (
const std::exception &ex)
1112 qCritical(
"SoapySDRInput::applySettings: cannot set global gain to %d: %s",
1128 dev->setGain(SOAPY_SDR_RX, requestedChannel, oname.toStdString(), *nvalue);
1129 qDebug(
"SoapySDRInput::applySettings: individual gain %s set to %lf",
1130 oname.toStdString().c_str(), *nvalue);
1131 individualGainsChanged =
true;
1133 catch (
const std::exception &ex)
1135 qCritical(
"SoapySDRInput::applySettings: cannot set individual gain %s to %lf: %s",
1136 oname.toStdString().c_str(), *nvalue, ex.what());
1146 reverseAPIKeys.append(
"autoGain");
1152 dev->setGainMode(SOAPY_SDR_RX, requestedChannel, settings.
m_autoGain);
1153 qDebug(
"SoapySDRInput::applySettings: %s AGC", settings.
m_autoGain ?
"set" :
"unset");
1155 catch (
const std::exception &ex)
1157 qCritical(
"SoapySDRInput::applySettings: cannot %s AGC", settings.
m_autoGain ?
"set" :
"unset");
1164 reverseAPIKeys.append(
"autoDCCorrection");
1171 qDebug(
"SoapySDRInput::applySettings: %s DC auto correction", settings.
m_autoDCCorrection ?
"set" :
"unset");
1173 catch (
const std::exception &ex)
1175 qCritical(
"SoapySDRInput::applySettings: cannot %s DC auto correction", settings.
m_autoDCCorrection ?
"set" :
"unset");
1182 reverseAPIKeys.append(
"dcCorrection");
1188 dev->setDCOffset(SOAPY_SDR_RX, requestedChannel, settings.
m_dcCorrection);
1189 qDebug(
"SoapySDRInput::applySettings: DC offset correction set to (%lf, %lf)", settings.
m_dcCorrection.real(), settings.
m_dcCorrection.imag());
1191 catch (
const std::exception &ex)
1193 qCritical(
"SoapySDRInput::applySettings: cannot set DC offset correction to (%lf, %lf)", settings.
m_dcCorrection.real(), settings.
m_dcCorrection.imag());
1200 reverseAPIKeys.append(
"iqCorrection");
1206 dev->setIQBalance(SOAPY_SDR_RX, requestedChannel, settings.
m_iqCorrection);
1207 qDebug(
"SoapySDRInput::applySettings: IQ balance correction set to (%lf, %lf)", settings.
m_iqCorrection.real(), settings.
m_iqCorrection.imag());
1209 catch (
const std::exception &ex)
1211 qCritical(
"SoapySDRInput::applySettings: cannot set IQ balance correction to (%lf, %lf)", settings.
m_iqCorrection.real(), settings.
m_iqCorrection.imag());
1226 dev->writeSetting(SOAPY_SDR_RX, requestedChannel, oname.toStdString(), nvalue->toString().toStdString());
1227 qDebug(
"SoapySDRInput::applySettings: stream argument %s set to %s",
1228 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
1230 catch (
const std::exception &ex)
1232 qCritical(
"SoapySDRInput::applySettings: cannot set stream argument %s to %s: %s",
1233 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
1251 dev->writeSetting(oname.toStdString(), nvalue->toString().toStdString());
1252 qDebug(
"SoapySDRInput::applySettings: device argument %s set to %s",
1253 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
1255 catch (
const std::exception &ex)
1257 qCritical(
"SoapySDRInput::applySettings: cannot set device argument %s to %s: %s",
1258 oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
1263 deviceArgsChanged =
true;
1267 if (forwardChangeOwnDSP)
1275 if (forwardChangeToBuddies)
1281 for (
const auto &itSource : sourceBuddies)
1289 itSource->getSamplingDeviceInputMessageQueue()->push(report);
1292 for (
const auto &itSink : sinkBuddies)
1300 itSink->getSamplingDeviceInputMessageQueue()->push(report);
1304 if (deviceArgsChanged)
1310 for (
const auto &itSource : sourceBuddies)
1314 itSource->getSamplingDeviceInputMessageQueue()->push(report);
1317 for (
const auto &itSink : sinkBuddies)
1321 itSink->getSamplingDeviceInputMessageQueue()->push(report);
1332 if (fullUpdate || force) {
1334 }
else if (reverseAPIKeys.size() != 0) {
1341 if (globalGainChanged || individualGainsChanged)
1354 qDebug() <<
"SoapySDRInput::applySettings: " 1367 <<
" force: " << force;
1372 qDebug(
"SoapySDRInput::applySettings: m_individualGains[%s]: %lf", doubleIt.key().toStdString().c_str(), doubleIt.value());
1378 qDebug(
"SoapySDRInput::applySettings: m_tunableElements[%s]: %lf", doubleIt.key().toStdString().c_str(), doubleIt.value());
1385 qDebug(
"SoapySDRInput::applySettings: m_deviceArgSettings[%s] (type %d): %s",
1386 varIt.key().toStdString().c_str(),
1387 (int) varIt.value().type(),
1388 varIt.value().toString().toStdString().c_str());
1395 qDebug(
"SoapySDRInput::applySettings: m_streamArgSettings[%s] (type %d): %s",
1396 varIt.key().toStdString().c_str(),
1397 (int) varIt.value().type(),
1398 varIt.value().toString().toStdString().c_str());
1406 QString& errorMessage)
1408 (void) errorMessage;
1417 const QStringList& deviceSettingsKeys,
1419 QString& errorMessage)
1421 (void) errorMessage;
1424 if (deviceSettingsKeys.contains(
"centerFrequency")) {
1427 if (deviceSettingsKeys.contains(
"LOppmTenths")) {
1430 if (deviceSettingsKeys.contains(
"devSampleRate")) {
1433 if (deviceSettingsKeys.contains(
"bandwidth")) {
1436 if (deviceSettingsKeys.contains(
"log2Decim")) {
1439 if (deviceSettingsKeys.contains(
"fcPos")) {
1442 if (deviceSettingsKeys.contains(
"softDCCorrection")) {
1445 if (deviceSettingsKeys.contains(
"softIQCorrection")) {
1448 if (deviceSettingsKeys.contains(
"transverterDeltaFrequency")) {
1451 if (deviceSettingsKeys.contains(
"transverterMode")) {
1454 if (deviceSettingsKeys.contains(
"fileRecordName")) {
1457 if (deviceSettingsKeys.contains(
"antenna")) {
1461 if (deviceSettingsKeys.contains(
"tunableElements"))
1465 for (
const auto &itArg : *tunableElements)
1467 QMap<QString, double>::iterator itSettings = settings.
m_tunableElements.find(*(itArg->getKey()));
1472 itSettings.value() = v.toDouble();
1477 if (deviceSettingsKeys.contains(
"globalGain")) {
1481 if (deviceSettingsKeys.contains(
"individualGains"))
1485 for (
const auto &itArg : *individualGains)
1487 QMap<QString, double>::iterator itSettings = settings.
m_individualGains.find(*(itArg->getKey()));
1492 itSettings.value() = v.toDouble();
1497 if (deviceSettingsKeys.contains(
"autoGain")) {
1500 if (deviceSettingsKeys.contains(
"autoDCCorrection")) {
1503 if (deviceSettingsKeys.contains(
"autoIQCorrection")) {
1506 if (deviceSettingsKeys.contains(
"dcCorrection"))
1511 if (deviceSettingsKeys.contains(
"iqCorrection"))
1517 if (deviceSettingsKeys.contains(
"streamArgSettings"))
1521 for (
const auto itArg : *streamArgSettings)
1523 QMap<QString, QVariant>::iterator itSettings = settings.
m_streamArgSettings.find(*itArg->getKey());
1531 if (deviceSettingsKeys.contains(
"deviceArgSettings"))
1535 for (
const auto itArg : *deviceArgSettings)
1537 QMap<QString, QVariant>::iterator itSettings = settings.
m_deviceArgSettings.find(*itArg->getKey());
1545 if (deviceSettingsKeys.contains(
"useReverseAPI")) {
1548 if (deviceSettingsKeys.contains(
"reverseAPIAddress")) {
1551 if (deviceSettingsKeys.contains(
"reverseAPIPort")) {
1554 if (deviceSettingsKeys.contains(
"reverseAPIDeviceIndex")) {
1573 (void) errorMessage;
1582 QString& errorMessage)
1584 (void) errorMessage;
1592 QString& errorMessage)
1594 (void) errorMessage;
1761 for (
const auto itAntenna : channelSettings->
m_antennas) {
1796 for (
const auto itRange : itFreq.m_ranges)
1837 return QVariant((
int) (atoi(argValue->
getValueString()->toStdString().c_str())));
1839 return QVariant((
double) (atof(argValue->
getValueString()->toStdString().c_str())));
1847 if (v.type() == QVariant::Bool)
1852 else if (v.type() == QVariant::Int)
1857 else if (v.type() == QVariant::Double)
1871 argInfo->
setKey(
new QString(arg.key.c_str()));
1875 }
else if (arg.type == SoapySDR::ArgInfo::INT) {
1877 }
else if (arg.type == SoapySDR::ArgInfo::FLOAT) {
1884 argInfo->
setName(
new QString(arg.name.c_str()));
1886 argInfo->
setUnits(
new QString(arg.units.c_str()));
1888 if ((arg.range.minimum() != 0.0) || (arg.range.maximum() != 0.0))
1897 for (
const auto itOpt : arg.options) {
1903 for (
const auto itOpt : arg.optionNames) {
1920 if (deviceSettingsKeys.contains(
"centerFrequency") || force) {
1923 if (deviceSettingsKeys.contains(
"LOppmTenths") || force) {
1926 if (deviceSettingsKeys.contains(
"devSampleRate") || force) {
1929 if (deviceSettingsKeys.contains(
"bandwidth") || force) {
1932 if (deviceSettingsKeys.contains(
"log2Decim") || force) {
1935 if (deviceSettingsKeys.contains(
"fcPos") || force) {
1938 if (deviceSettingsKeys.contains(
"softDCCorrection") || force) {
1941 if (deviceSettingsKeys.contains(
"softIQCorrection") || force) {
1944 if (deviceSettingsKeys.contains(
"transverterDeltaFrequency") || force) {
1947 if (deviceSettingsKeys.contains(
"transverterMode") || force) {
1950 if (deviceSettingsKeys.contains(
"fileRecordName") || force) {
1953 if (deviceSettingsKeys.contains(
"antenna") || force) {
1956 if (deviceSettingsKeys.contains(
"globalGain") || force) {
1959 if (deviceSettingsKeys.contains(
"autoGain") || force) {
1962 if (deviceSettingsKeys.contains(
"autoDCCorrection") || force) {
1965 if (deviceSettingsKeys.contains(
"autoIQCorrection") || force) {
1968 if (deviceSettingsKeys.contains(
"dcCorrection") || force)
1974 if (deviceSettingsKeys.contains(
"iqCorrection") || force)
1981 QString deviceSettingsURL = QString(
"http://%1:%2/sdrangel/deviceset/%3/device/settings")
1986 m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader,
"application/json");
1988 QBuffer *buffer=
new QBuffer();
1989 buffer->open((QBuffer::ReadWrite));
1990 buffer->write(swgDeviceSettings->
asJson().toUtf8());
1996 delete swgDeviceSettings;
2006 QString deviceSettingsURL = QString(
"http://%1:%2/sdrangel/deviceset/%3/device/run")
2011 m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader,
"application/json");
2013 QBuffer *buffer=
new QBuffer();
2014 buffer->open((QBuffer::ReadWrite));
2015 buffer->write(swgDeviceSettings->
asJson().toUtf8());
2024 delete swgDeviceSettings;
2029 QNetworkReply::NetworkError replyError = reply->error();
2033 qWarning() <<
"SoapySDRInput::networkManagerFinished:" 2034 <<
" error(" << (int) replyError
2035 <<
"): " << replyError
2036 <<
": " << reply->errorString();
2040 QString answer = reply->readAll();
2042 qDebug(
"SoapySDRInput::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
bool startDeviceEngine()
Start the device engine corresponding to the stream type.
void setHasFrequencyCorrectionValue(qint32 has_frequency_correction_value)
int m_channel
allocated channel (-1 if none)
void setSoapySdrInputReport(SWGSoapySDRReport *soapy_sdr_input_report)
static qint64 calculateDeviceCenterFrequency(quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void stopDeviceEngine()
Stop the device engine corresponding to the stream type.
QList< QString * > * getValueOptions()
QList< QString * > * getOptionNames()
void setName(QString *name)
void setFileName(const QString &filename)
uint getDeviceUID() const
Return the current device engine unique ID.
const std::vector< DeviceAPI * > & getSinkBuddies() const
static MsgReportDeviceArgsChange * create(const QMap< QString, QVariant > &deviceArgSettings)
MessageQueue m_inputMessageQueue
Input queue to the source.
void setValueOptions(QList< QString *> *value_options)
virtual QString asJson() override
static DeviceSoapySDR & instance()
MessageQueue * getDeviceEngineInputMessageQueue()
Device engine message queue.
void setFrequencySettingsArgs(QList< SWGArgInfo *> *frequency_settings_args)
SoapySDR::ArgInfoList m_frequencySettingsArgs
common tuning parameters
const QMap< QString, QVariant > & getDeviceArgSettings() const
std::string getRxChannelMainTunableElementName(uint32_t index)
void setHasAgc(qint32 has_agc)
uint32_t getDeviceItemIndex() const
void closeSoapySdr(SoapySDR::Device *device)
static MsgReportBuddyChange * create(uint64_t centerFrequency, int LOppmTenths, int fcPos, int devSampleRate, bool rxElseTx)
bool m_hasFrequencyCorrectionValue
Frequency correction value flag.
void setRange(SWGRangeFloat *range)
QList< SWGSoapySDRGainSetting * > * getGainSettings()
bool m_hasDCOffsetValue
DC offset value flag.
bool initDeviceEngine()
Init the device engine corresponding to the stream type.
void setDeviceSettingsArgs(QList< SWGArgInfo *> *device_settings_args)
const QString & getHardwareUserArguments() const
bool m_hasDCAutoCorrection
DC offset auto correction flag.
QList< SWGArgInfo * > * getStreamSettingsArgs()
void setStreamSettingsArgs(QList< SWGArgInfo *> *stream_settings_args)
std::vector< FrequencySetting > m_frequencySettings
tunable elements settings
void setOriginatorIndex(qint32 originator_index)
SampleSinkFifo m_sampleFifo
MessageQueue * getMessageQueueToGUI()
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
virtual bool handleMessage(const Message &message)
Processing of a message. Returns true if message has actually been processed.
const ChannelSettings * getRxChannelSettings(uint32_t index)
void setValueString(QString *value_string)
void setValueString(QString *value_string)
void setValueType(QString *value_type)
QString * getValueString()
void setGainRange(SWGRangeFloat *gain_range)
int getDeviceSetIndex() const
SoapySDR::RangeList m_ranges
List of ranges of the tunable element.
void setHasDcAutoCorrection(qint32 has_dc_auto_correction)
QList< SWGArgInfo * > * getDeviceSettingsArgs()
void * getBuddySharedPtr() const
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
void genUniqueFileName(uint deviceUID, int istream=-1)
void setRatesRanges(QList< SWGRangeFloat *> *rates_ranges)
void setGainSettings(QList< SWGSoapySDRGainSetting *> *gain_settings)
std::vector< std::string > m_antennas
Antenna ports names.
DeviceSoapySDRParams * m_deviceParams
SoapySDR::RangeList m_ratesRanges
list of ranges of sample rates
void setBuddySharedPtr(void *ptr)
void setBandwidthsRanges(QList< SWGRangeFloat *> *bandwidths_ranges)
void setKey(QString *key)
const SoapySDR::ArgInfoList & getDeviceArgs() const
QList< SWGArgInfo * > * getFrequencySettingsArgs()
static bool match(const Message *message)
QList< SWGRangeFloat * > * getBandwidthsRanges()
SoapySDR::Device * m_device
void removeAncillarySink(BasebandSampleSink *sink, unsigned int index=0)
Removes it.
SWGRangeFloat * getRange()
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
SoapySDR::RangeList m_bandwidthsRanges
list of ranges of bandwidths
void setUnits(QString *units)
void setValueType(QString *value_type)
QList< SWGSoapySDRFrequencySetting * > * getFrequencySettings()
void getDeviceEngineStateStr(QString &state)
void setFrequencySettings(QList< SWGSoapySDRFrequencySetting *> *frequency_settings)
SWGRangeFloat * getGainRange()
SoapySDR::Device * openSoapySDR(uint32_t sequence, const QString &hardwareUserArguments)
void setDescription(QString *description)
void setHasIqBalanceValue(qint32 has_iq_balance_value)
const std::vector< DeviceAPI * > & getSourceBuddies() const
std::vector< GainSetting > m_gainSettings
gain elements settings
void setOptionNames(QList< QString *> *option_names)
SWGSoapySDRReport * getSoapySdrInputReport()
QList< QString * > * getAntennas()
SoapySDR::ArgInfoList m_streamSettingsArgs
common stream parameters
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection, int streamIndex=0)
Configure current device engine DSP corrections (Rx)
QList< SWGRangeFloat * > * getRatesRanges()
void setSoapySdrInputSettings(SWGSoapySDRInputSettings *soapy_sdr_input_settings)
uint32_t getSamplingDeviceSequence() const
void setDirection(qint32 direction)
const QByteArray & final()
bool m_hasIQBalanceValue
IQ correction value flag.
void setAntennas(QList< QString *> *antennas)
T max(const T &x, const T &y)
void setHasDcOffsetValue(qint32 has_dc_offset_value)
void setDeviceHwType(QString *device_hw_type)
SoapySDR::Range m_gainRange
Global gain range.
SWGSoapySDRInputSettings * getSoapySdrInputSettings()
T min(const T &x, const T &y)
unsigned __int64 uint64_t