MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / refreshAutoGains

Method refreshAutoGains

Default/Source/SourceWidget.cpp:683–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683void
684SourceWidget::refreshAutoGains(Suscan::Source::Config &config)
685{
686 std::string driver = config.getDevice().getDriver();
687 bool showFrame = false;
688
689 this->ui->autoGainCombo->clear();
690
691 if (this->autoGains.find(driver) != this->autoGains.end()) {
692 this->currAutoGainSet = &this->autoGains[driver];
693 this->currentAutoGain = nullptr;
694
695 if (this->currAutoGainSet->size() > 0
696 && config.getType() == SUSCAN_SOURCE_TYPE_SDR) {
697 for (auto p = this->currAutoGainSet->begin();
698 p != this->currAutoGainSet->end(); ++p)
699 this->ui->autoGainCombo->addItem(
700 QString::fromStdString(p->getName()));
701
702 if (this->ui->gainPresetCheck->isEnabled())
703 this->refreshCurrentAutoGain(driver);
704
705 showFrame = true;
706 }
707 } else {
708 this->currAutoGainSet = nullptr;
709 this->currentAutoGain = nullptr;
710 }
711
712 this->ui->autoGainFrame->setVisible(showFrame);
713}
714
715void
716SourceWidget::setCaptureSize(quint64 size)

Callers 1

setProfileMethod · 0.95

Calls 9

isEnabledMethod · 0.80
getDriverMethod · 0.45
clearMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
getTypeMethod · 0.45
beginMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected