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

Method setViewRange

Panoramic/Scanner.cpp:449–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449void
450Scanner::setViewRange(SUFREQ freqMin, SUFREQ freqMax, bool noHop)
451{
452 SUFREQ searchMin, searchMax;
453
454 if (fs == 0)
455 return;
456
457 if (freqMin > freqMax) {
458 SUFREQ tmp = freqMin;
459 freqMin = freqMax;
460 freqMax = tmp;
461 }
462
463 if (!noHop) {
464 searchMin = freqMin - fs / 2;
465 searchMax = freqMax + fs / 2;
466 } else {
467 searchMin = searchMax = .5 * (freqMin + freqMax);
468 freqMin = searchMin - fs / 2;
469 freqMax = searchMax + fs / 2;
470 }
471
472 if (searchMin < this->freqMin)
473 searchMin = this->freqMin;
474
475 if (searchMax > this->freqMax)
476 searchMax = this->freqMax;
477
478 // Scanner in zoom mode, copy this view back to mainView
479 try {
480 // Limits adjusted.
481 if (std::fabs(this->getSpectrumView().freqMin - freqMin) > 1 ||
482 std::fabs(this->getSpectrumView().freqMax - freqMax) > 1) {
483 SpectrumView &previous = this->getSpectrumView();
484 this->flip();
485 this->getSpectrumView().setRange(freqMin, freqMax);
486 this->getSpectrumView().feed(previous);
487 }
488
489 this->analyzer->setHopRange(searchMin, searchMax);
490 } catch (Suscan::Exception const &) {
491 // Invalid limits, warn?
492 }
493}
494
495void
496Scanner::setRttMs(unsigned int rtt)

Callers 1

Calls 4

flipMethod · 0.95
setRangeMethod · 0.80
setHopRangeMethod · 0.80
feedMethod · 0.45

Tested by

no test coverage detected