| 335 | } |
| 336 | |
| 337 | void |
| 338 | SourceWidget::applySourceInfo(Suscan::AnalyzerSourceInfo const &info) |
| 339 | { |
| 340 | std::vector<Suscan::Source::GainDescription> gains; |
| 341 | DeviceGain *gain = nullptr; |
| 342 | bool oldBlocking; |
| 343 | |
| 344 | oldBlocking = this->setBlockingSignals(true); |
| 345 | |
| 346 | // There are 5 source settings that are overriden by the UI configuration |
| 347 | // |
| 348 | // 1. Gain presets |
| 349 | // 2. Throttle |
| 350 | // 3. DC Removal |
| 351 | // 4. IQ Reversal |
| 352 | // 5. AGC |
| 353 | // |
| 354 | // These settings are set once the first source info is received, and |
| 355 | // refresh the UI in subsequent receptions. |
| 356 | |
| 357 | this->setSampleRate(SCAST(unsigned, info.getSampleRate())); |
| 358 | |
| 359 | if (info.getMeasuredSampleRate() > 0) |
| 360 | this->setProcessRate(SCAST(unsigned, info.getMeasuredSampleRate())); |
| 361 | |
| 362 | if (!this->haveSourceInfo) { |
| 363 | m_sourceInfo = Suscan::AnalyzerSourceInfo(info); |
| 364 | this->haveSourceInfo = true; |
| 365 | |
| 366 | // First source info! Set delayed analyzer options (this ones are |
| 367 | // not bound to an analyzer) |
| 368 | |
| 369 | this->setDelayedAnalyzerOptions(); |
| 370 | } else { |
| 371 | bool throttleEnabled = !sufeq( |
| 372 | info.getEffectiveSampleRate(), |
| 373 | info.getSampleRate(), |
| 374 | 0); // Integer quantities |
| 375 | |
| 376 | this->ui->throttleCheck->setChecked(throttleEnabled); |
| 377 | |
| 378 | this->setDCRemove(info.getDCRemove()); |
| 379 | this->setIQReverse(info.getIQReverse()); |
| 380 | this->setAGCEnabled(info.getAGC()); |
| 381 | } |
| 382 | |
| 383 | |
| 384 | this->setBandwidth(info.getBandwidth()); |
| 385 | this->setPPM(info.getPPM()); |
| 386 | |
| 387 | // Populate antennas |
| 388 | this->populateAntennaCombo(info); |
| 389 | |
| 390 | // What if SoapySDR lies? We consider the case in which the antenna is |
| 391 | // not reported in the antenna list |
| 392 | this->selectAntenna(info.getAntenna()); |
| 393 | |
| 394 | if (!this->tryApplyGains(info)) { |
no test coverage detected