SDRdaemonSinkGui::SDRdaemonSinkGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::SDRdaemonSinkGui), m_deviceUISet(deviceUISet), m_settings(), m_deviceSampleSink(0), m_deviceCenterFrequency(0), m_samplesCount(0), m_tickCount(0), m_nbSinceLastFlowCheck(0), m_lastEngineState(DSPDeviceSinkEngine::StNotStarted), m_doApplySettings(true), m_forceSettings(true) { m_countUnrecoverable = 0; m_countRecovered = 0; m_lastCountUnrecoverable = 0; m_lastCountRecovered = 0; m_lastSampleCount = 0; m_resetCounts = true; m_paletteGreenText.setColor(QPalette::WindowText, Qt::green); m_paletteRedText.setColor(QPalette::WindowText, Qt::red); m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white); ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(7, 0, pow(10,7)); ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->sampleRate->setValueRange(7, 32000U, 9000000U); ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); connect(&(m_deviceUISet->m_deviceSinkAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); m_deviceSampleSink = (SDRdaemonSinkOutput*) m_deviceUISet->m_deviceSinkAPI->getSampleSink(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_time.start(); displayEventCounts(); displayEventTimer(); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); displaySettings(); sendSettings(); }
//DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceSourceAPI *objDeviceAPI, QWidget* objParent) : DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* objParent) : RollupWidget(objParent), ui(new Ui::DATVDemodGUI), m_objPluginAPI(objPluginAPI), m_deviceUISet(deviceUISet), m_objChannelMarker(this), m_blnBasicSettingsShown(false), m_blnDoApplySettings(true) { ui->setupUi(this); ui->screenTV->setColor(true); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); m_objDATVDemod = (DATVDemod*) rxChannel; m_objDATVDemod->setMessageQueueToGUI(getInputMessageQueue()); m_objDATVDemod->SetTVScreen(ui->screenTV); connect(m_objDATVDemod->SetVideoRender(ui->screenTV_2),&DATVideostream::onDataPackets,this,&DATVDemodGUI::on_StreamDataAvailable); connect(ui->screenTV_2,&DATVideoRender::onMetaDataChanged,this,&DATVDemodGUI::on_StreamMetaDataChanged); m_intPreviousDecodedData=0; m_intLastDecodedData=0; m_intLastSpeed=0; m_intReadyDecodedData=0; m_blnButtonPlayClicked=false; m_objTimer.setInterval(1000); connect(&m_objTimer, SIGNAL(timeout()), this, SLOT(tick())); m_objTimer.start(); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->rfBandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow)); ui->rfBandwidth->setValueRange(true, 7, 0, 9999999); m_objChannelMarker.blockSignals(true); m_objChannelMarker.setColor(Qt::magenta); m_objChannelMarker.setBandwidth(6000000); m_objChannelMarker.setCenterFrequency(0); m_objChannelMarker.blockSignals(false); m_objChannelMarker.setVisible(true); connect(&m_objChannelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(&m_objChannelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); m_deviceUISet->registerRxChannelInstance(DATVDemod::m_channelIdURI, this); m_deviceUISet->addChannelMarker(&m_objChannelMarker); m_deviceUISet->addRollupWidget(this); ui->pushButton_3->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); resetToDefaults(); // does applySettings() }
LimeSDROutputGUI::LimeSDROutputGUI(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::LimeSDROutputGUI), m_deviceUISet(deviceUISet), m_settings(), m_sampleRate(0), m_lastEngineState(DSPDeviceSinkEngine::StNotStarted), m_doApplySettings(true), m_forceSettings(true), m_statusCounter(0), m_deviceStatusCounter(0) { m_limeSDROutput = (LimeSDROutput*) m_deviceUISet->m_deviceSinkAPI->getSampleSink(); ui->setupUi(this); float minF, maxF; m_limeSDROutput->getLORange(minF, maxF); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(7, ((uint32_t) minF)/1000, ((uint32_t) maxF)/1000); // frequency dial is in kHz m_limeSDROutput->getSRRange(minF, maxF); ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF); m_limeSDROutput->getLPRange(minF, maxF); ui->lpf->setColorMapper(ColorMapper(ColorMapper::GrayYellow)); ui->lpf->setValueRange(6, (minF/1000)+1, maxF/1000); ui->lpFIR->setColorMapper(ColorMapper(ColorMapper::GrayYellow)); ui->lpFIR->setValueRange(5, 1U, 56000U); ui->ncoFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->channelNumberText->setText(tr("#%1").arg(m_limeSDROutput->getChannelIndex())); ui->hwInterpLabel->setText(QString::fromUtf8("H\u2191")); ui->swInterpLabel->setText(QString::fromUtf8("S\u2191")); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); displaySettings(); char recFileNameCStr[30]; sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceUISet->m_deviceSinkAPI->getDeviceUID()); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); sendSettings(); }
AirspyGui::AirspyGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::AirspyGui), m_deviceUISet(deviceUISet), m_doApplySettings(true), m_forceSettings(true), m_settings(), m_sampleSource(0), m_lastEngineState(DSPDeviceSourceEngine::StNotStarted) { m_sampleSource = (AirspyInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource(); ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); updateFrequencyLimits(); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); displaySettings(); m_rates = ((AirspyInput*) m_sampleSource)->getSampleRates(); displaySampleRates(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); sendSettings(); }
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::SDRdaemonSourceGui), m_deviceUISet(deviceUISet), m_settings(), m_sampleSource(0), m_acquisition(false), m_streamSampleRate(0), m_streamCenterFrequency(0), m_lastEngineState(DSPDeviceSourceEngine::StNotStarted), m_framesDecodingStatus(0), m_bufferLengthInSecs(0.0), m_bufferGauge(-50), m_nbOriginalBlocks(128), m_nbFECBlocks(0), m_sampleBits(16), // assume 16 bits to start with m_sampleBytes(2), m_samplesCount(0), m_tickCount(0), m_addressEdited(false), m_dataPortEdited(false), m_countUnrecoverable(0), m_countRecovered(0), m_doApplySettings(true), m_forceSettings(true), m_txDelay(0.0) { m_paletteGreenText.setColor(QPalette::WindowText, Qt::green); m_paletteWhiteText.setColor(QPalette::WindowText, Qt::white); m_startingTimeStampms = 0; ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(7, 0, 9999999U); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); displaySettings(); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); m_sampleSource = (SDRdaemonSourceInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); m_eventsTime.start(); displayEventCounts(); displayEventTimer(); m_forceSettings = true; sendSettings(); }
DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) : RollupWidget(parent), ui(new Ui::DSDDemodGUI), m_pluginAPI(pluginAPI), m_deviceAPI(deviceAPI), m_channelMarker(this), m_basicSettingsShown(false), m_doApplySettings(true), m_signalFormat(signalFormatNone), m_enableCosineFiltering(false), m_syncOrConstellation(false), m_slot1On(false), m_slot2On(false), m_tdmaStereo(false), m_squelchOpen(false), m_channelPowerDbAvg(20,0), m_tickCount(0) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked())); m_scopeVis = new ScopeVis(ui->glScope); m_dsdDemod = new DSDDemod(m_scopeVis); m_dsdDemod->registerGUI(this); ui->glScope->setSampleRate(48000); m_scopeVis->setSampleRate(48000); ui->glScope->connectTimer(m_pluginAPI->getMainWindow()->getMasterTimer()); connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); m_channelizer = new DownChannelizer(m_dsdDemod); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setColor(Qt::cyan); m_channelMarker.setBandwidth(10000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); updateMyPosition(); applySettings(); }
AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : RollupWidget(parent), ui(new Ui::AMDemodGUI), m_pluginAPI(pluginAPI), m_deviceUISet(deviceUISet), m_channelMarker(this), m_doApplySettings(true), m_squelchOpen(false), m_samUSB(true), m_tickCount(0) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); m_amDemod = reinterpret_cast<AMDemod*>(rxChannel); //new AMDemod(m_deviceUISet->m_deviceSourceAPI); m_amDemod->setMessageQueueToGUI(getInputMessageQueue()); connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute); connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect())); CRightClickEnabler *samSidebandRightClickEnabler = new CRightClickEnabler(ui->ssb); connect(samSidebandRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(samSSBSelect())); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); m_channelMarker.blockSignals(true); m_channelMarker.setColor(Qt::yellow); m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("AM Demodulator"); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only setTitleColor(m_channelMarker.getColor()); m_settings.setChannelMarker(&m_channelMarker); m_deviceUISet->registerRxChannelInstance(AMDemod::m_channelIdURI, this); m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::Off); m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::On); m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::Off); m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::On); displaySettings(); applySettings(true); }
TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) : RollupWidget(parent), ui(new Ui::TCPSrcGUI), m_pluginAPI(pluginAPI), m_deviceAPI(deviceAPI), m_tcpSrc(0), m_channelMarker(this), m_channelPowerDbAvg(40,0), m_basicSettingsShown(false), m_doApplySettings(true) { ui->setupUi(this); ui->connectedClientsBox->hide(); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked())); setAttribute(Qt::WA_DeleteOnClose, true); m_spectrumVis = new SpectrumVis(ui->glSpectrum); m_tcpSrc = new TCPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); m_channelizer = new DownChannelizer(m_tcpSrc); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->deltaFrequency->setValueRange(7, 0U, 9999999U); ui->glSpectrum->setCenterFrequency(0); ui->glSpectrum->setSampleRate(ui->sampleRate->text().toInt()); ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); m_spectrumVis->configure(m_spectrumVis->getInputMessageQueue(), 64, 10, FFTWindow::BlackmanHarris); ui->glSpectrum->connectTimer(m_pluginAPI->getMainWindow()->getMasterTimer()); connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setBandwidth(16000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setColor(Qt::green); m_channelMarker.setVisible(true); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged())); m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); applySettings(); }
Bladerf1OutputGui::Bladerf1OutputGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::Bladerf1OutputGui), m_deviceUISet(deviceUISet), m_doApplySettings(true), m_forceSettings(true), m_settings(), m_deviceSampleSink(NULL), m_sampleRate(0), m_lastEngineState(DSPDeviceSinkEngine::StNotStarted) { m_deviceSampleSink = (Bladerf1Output*) m_deviceUISet->m_deviceSinkAPI->getSampleSink(); ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000); ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->sampleRate->setValueRange(8, BLADERF_SAMPLERATE_MIN, BLADERF_SAMPLERATE_REC_MAX); ui->bandwidth->clear(); for (unsigned int i = 0; i < BladerfBandwidths::getNbBandwidths(); i++) { ui->bandwidth->addItem(QString::number(BladerfBandwidths::getBandwidth(i))); } connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); displaySettings(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); }
FileSinkGui::FileSinkGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::FileSinkGui), m_deviceUISet(deviceUISet), m_doApplySettings(true), m_forceSettings(true), m_settings(), m_fileName("./test.sdriq"), m_deviceSampleSink(0), m_sampleRate(0), m_generation(false), m_startingTimeStamp(0), m_samplesCount(0), m_tickCount(0), m_lastEngineState(DSPDeviceSinkEngine::StNotStarted) { ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(7, 0, pow(10,7)); ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->sampleRate->setValueRange(7, 32000U, 9000000U); ui->fileNameText->setText(m_fileName); connect(&(m_deviceUISet->m_deviceSinkAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); displaySettings(); m_deviceSampleSink = (FileSinkOutput*) m_deviceUISet->m_deviceSinkAPI->getSampleSink(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); }
BladerfGui::BladerfGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : QWidget(parent), ui(new Ui::BladerfGui), m_deviceAPI(deviceAPI), m_settings(), m_sampleSource(NULL), m_sampleRate(0), m_lastEngineState((DSPDeviceSourceEngine::State)-1) { ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000); ui->samplerate->clear(); for (int i = 0; i < BladerfSampleRates::getNbRates(); i++) { ui->samplerate->addItem(QString::number(BladerfSampleRates::getRate(i))); } ui->bandwidth->clear(); for (int i = 0; i < BladerfBandwidths::getNbBandwidths(); i++) { ui->bandwidth->addItem(QString::number(BladerfBandwidths::getBandwidth(i))); } connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); displaySettings(); m_sampleSource = new BladerfInput(m_deviceAPI); m_deviceAPI->setSource(m_sampleSource); char recFileNameCStr[30]; sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID()); m_fileSink = new FileRecord(std::string(recFileNameCStr)); m_deviceAPI->addSink(m_fileSink); connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection); }
AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) : RollupWidget(parent), ui(new Ui::AMDemodGUI), m_pluginAPI(pluginAPI), m_deviceAPI(deviceAPI), m_channelMarker(this), m_basicSettingsShown(false), m_doApplySettings(true), m_squelchOpen(false) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(menuDoubleClickEvent()), this, SLOT(onMenuDoubleClicked())); m_amDemod = new AMDemod(); m_channelizer = new DownChannelizer(m_amDemod); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); //m_pluginAPI->addThreadedSink(m_threadedChannelizer); m_deviceAPI->addThreadedSink(m_threadedChannelizer); connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setColor(Qt::yellow); m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setVisible(true); connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged())); m_deviceAPI->registerChannelInstance(m_channelID, this); m_deviceAPI->addChannelMarker(&m_channelMarker); m_deviceAPI->addRollupWidget(this); applySettings(); }
SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) : QWidget(parent), ui(new Ui::SoapySDRInputGui), m_deviceUISet(deviceUISet), m_forceSettings(true), m_doApplySettings(true), m_sampleSource(0), m_sampleRate(0), m_deviceCenterFrequency(0), m_lastEngineState(DSPDeviceSourceEngine::StNotStarted), m_antennas(0), m_sampleRateGUI(0), m_bandwidthGUI(0), m_gainSliderGUI(0), m_autoGain(0), m_dcCorrectionGUI(0), m_iqCorrectionGUI(0), m_autoDCCorrection(0), m_autoIQCorrection(0) { m_sampleSource = (SoapySDRInput*) m_deviceUISet->m_deviceSourceAPI->getSampleSource(); ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); uint64_t f_min, f_max; m_sampleSource->getFrequencyRange(f_min, f_max); ui->centerFrequency->setValueRange(7, f_min/1000, f_max/1000); createCorrectionsControl(); createAntennasControl(m_sampleSource->getAntennas()); createRangesControl(&m_sampleRateGUI, m_sampleSource->getRateRanges(), "SR", "S/s"); createRangesControl(&m_bandwidthGUI, m_sampleSource->getBandwidthRanges(), "BW", "Hz"); createTunableElementsControl(m_sampleSource->getTunableElements()); createGlobalGainControl(); createIndividualGainsControl(m_sampleSource->getIndividualGainsRanges()); createArgumentsControl(m_sampleSource->getDeviceArgInfoList(), true); createArgumentsControl(m_sampleSource->getStreamArgInfoList(), false); m_sampleSource->initGainSettings(m_settings); m_sampleSource->initTunableElementsSettings(m_settings); m_sampleSource->initStreamArgSettings(m_settings); m_sampleSource->initDeviceArgSettings(m_settings); if (m_sampleRateGUI) { connect(m_sampleRateGUI, SIGNAL(valueChanged(double)), this, SLOT(sampleRateChanged(double))); } if (m_bandwidthGUI) { connect(m_bandwidthGUI, SIGNAL(valueChanged(double)), this, SLOT(bandwidthChanged(double))); } connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); CRightClickEnabler *startStopRightClickEnabler = new CRightClickEnabler(ui->startStop); connect(startStopRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); displaySettings(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); sendSettings(); }
SDRdaemonGui::SDRdaemonGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : QWidget(parent), ui(new Ui::SDRdaemonGui), m_deviceAPI(deviceAPI), m_sampleSource(NULL), m_acquisition(false), m_lastEngineState((DSPDeviceSourceEngine::State)-1), m_sampleRate(0), m_sampleRateStream(0), m_centerFrequency(0), m_syncLocked(false), m_frameSize(0), m_lz4(false), m_compressionRatio(1.0), m_nbLz4DataCRCOK(0), m_nbLz4SuccessfulDecodes(0), m_bufferLengthInSecs(0.0), m_bufferGauge(-50), m_samplesCount(0), m_tickCount(0), m_address("127.0.0.1"), m_dataPort(9090), m_controlPort(9091), m_addressEdited(false), m_dataPortEdited(false), m_initSendConfiguration(false), m_dcBlock(false), m_iqCorrection(false), m_autoFollowRate(false) { m_sender = nn_socket(AF_SP, NN_PAIR); assert(m_sender != -1); int millis = 500; int rc = nn_setsockopt (m_sender, NN_SOL_SOCKET, NN_SNDTIMEO, &millis, sizeof (millis)); assert (rc == 0); m_startingTimeStamp.tv_sec = 0; m_startingTimeStamp.tv_usec = 0; ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->centerFrequency->setValueRange(7, 0, pow(10,7)); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); m_statusTimer.start(500); connect(&(deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); m_sampleSource = new SDRdaemonInput(deviceAPI->getMainWindow()->getMasterTimer(), m_deviceAPI); connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); m_deviceAPI->setSource(m_sampleSource); displaySettings(); ui->applyButton->setEnabled(false); ui->sendButton->setEnabled(false); char recFileNameCStr[30]; sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID()); m_fileSink = new FileRecord(std::string(recFileNameCStr)); m_deviceAPI->addSink(m_fileSink); connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection); }
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : RollupWidget(parent), ui(new Ui::NFMDemodGUI), m_pluginAPI(pluginAPI), m_deviceUISet(deviceUISet), m_channelMarker(this), m_basicSettingsShown(false), m_doApplySettings(true), m_squelchOpen(false), m_tickCount(0) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); m_nfmDemod = reinterpret_cast<NFMDemod*>(rxChannel); //new NFMDemod(m_deviceUISet->m_deviceSourceAPI); m_nfmDemod->setMessageQueueToGUI(getInputMessageQueue()); connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute); connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect())); blockApplySettings(true); ui->rfBW->clear(); for (int i = 0; i < NFMDemodSettings::m_nbRfBW; i++) { ui->rfBW->addItem(QString("%1").arg(NFMDemodSettings::getRFBW(i) / 1000.0, 0, 'f', 2)); } int ctcss_nbTones; const Real *ctcss_tones = m_nfmDemod->getCtcssToneSet(ctcss_nbTones); ui->ctcss->addItem("--"); for (int i=0; i<ctcss_nbTones; i++) { ui->ctcss->addItem(QString("%1").arg(ctcss_tones[i])); } blockApplySettings(false); ui->audioMute->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); // squelch closed ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue); m_channelMarker.blockSignals(true); m_channelMarker.setColor(Qt::red); m_channelMarker.setBandwidth(5000); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("NFM Demodulator"); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only m_settings.setChannelMarker(&m_channelMarker); m_deviceUISet->registerRxChannelInstance(NFMDemod::m_channelIdURI, this); m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); QChar delta = QChar(0x94, 0x03); ui->deltaSquelch->setText(delta); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); displaySettings(); applySettings(true); }
ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : RollupWidget(parent), ui(new Ui::ChannelAnalyzerGUI), m_pluginAPI(pluginAPI), m_deviceUISet(deviceUISet), m_channelMarker(this), m_doApplySettings(true), m_rate(48000) { ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); m_spectrumVis = new SpectrumVis(SDR_RX_SCALEF, ui->glSpectrum); m_scopeVis = new ScopeVis(ui->glScope); m_spectrumScopeComboVis = new SpectrumScopeComboVis(m_spectrumVis, m_scopeVis); m_channelAnalyzer = (ChannelAnalyzer*) rxChannel; //new ChannelAnalyzer(m_deviceUISet->m_deviceSourceAPI); m_channelAnalyzer->setSampleSink(m_spectrumScopeComboVis); m_channelAnalyzer->setMessageQueueToGUI(getInputMessageQueue()); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999); ui->channelSampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->channelSampleRate->setValueRange(7, 0.501*m_rate, m_rate); ui->glSpectrum->setCenterFrequency(m_rate/2); ui->glSpectrum->setSampleRate(m_rate); ui->glSpectrum->setDisplayWaterfall(true); ui->glSpectrum->setDisplayMaxHold(true); ui->glSpectrum->setSsbSpectrum(false); ui->glSpectrum->setLsbDisplay(false); ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer()); ui->glScope->connectTimer(MainWindow::getInstance()->getMasterTimer()); connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); m_channelMarker.blockSignals(true); m_channelMarker.setColor(Qt::gray); m_channelMarker.setBandwidth(m_rate); m_channelMarker.setSidebands(ChannelMarker::usb); m_channelMarker.setCenterFrequency(0); m_channelMarker.setTitle("Channel Analyzer"); m_channelMarker.blockSignals(false); m_channelMarker.setVisible(true); // activate signal on the last setting only setTitleColor(m_channelMarker.getColor()); m_deviceUISet->registerRxChannelInstance(ChannelAnalyzer::m_channelIdURI, this); m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addRollupWidget(this); ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope); m_settings.setChannelMarker(&m_channelMarker); m_settings.setSpectrumGUI(ui->spectrumGUI); m_settings.setScopeGUI(ui->scopeGUI); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); displaySettings(); applySettings(true); }