| 681 | } |
| 682 | |
| 683 | void |
| 684 | SourceWidget::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 | |
| 715 | void |
| 716 | SourceWidget::setCaptureSize(quint64 size) |
no test coverage detected