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

Method startCapture

App/Application.cpp:345–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344
345void
346Application::startCapture(void)
347{
348 auto iface = this->mediator->getProfile()->getInterface();
349
350#ifdef _WIN32
351 if (iface == SUSCAN_SOURCE_REMOTE_INTERFACE) {
352 (void) QMessageBox::critical(
353 this,
354 "SigDigger error",
355 "Remote analyzers are not supported in Windows operating systems.\n\n"
356 "This is not a SigDigger limitation, but a Windows one. Although "
357 "proposals to circumvent this issue exist, they are inherently "
358 "non-trivial and are not expected to be implemented any time soon.\n\n"
359 "If you are a developer and are curious about the nature of this "
360 "limitation (or even feel like helping me out addressing it), please "
361 "feel free to e-mail me at BatchDrake@gmail.com",
362 QMessageBox::Ok);
363 this->mediator->refreshUI();
364 return;
365 }
366#endif // _WIN32
367
368 try {
369 this->filterInstalled = false;
370
371 if (this->mediator->getState() == UIMediator::HALTED) {
372 Suscan::AnalyzerParams params = *this->mediator->getAnalyzerParams();
373 std::unique_ptr<Suscan::Analyzer> analyzer;
374 Suscan::Source::Config profile = *this->mediator->getProfile();
375
376 if (profile.getType() == SUSCAN_SOURCE_TYPE_SDR) {
377 if (profile.getDecimatedSampleRate() > SIGDIGGER_MAX_SAMPLE_RATE) {
378 unsigned decimate =
379 static_cast<unsigned>(
380 std::ceil(
381 profile.getSampleRate()
382 / static_cast<qreal>(SIGDIGGER_MAX_SAMPLE_RATE)));
383 unsigned proposed =
384 profile.getSampleRate() / decimate;
385 QMessageBox::StandardButton reply
386 = this->mediator->shouldReduceRate(
387 QString::fromStdString(profile.label()),
388 profile.getDecimatedSampleRate(),
389 proposed);
390
391 // TODO: Maybe ask for decimation?
392 if (reply == QMessageBox::Yes)
393 profile.setDecimation(decimate);
394 else if (reply == QMessageBox::Cancel) {
395 this->mediator->setState(UIMediator::HALTED);
396 return;
397 }
398 }
399 }
400
401 // Flush log messages from here
402 Suscan::Logger::getInstance()->flush();

Callers 3

onAnalyzerHaltedMethod · 0.95
onCaptureStartMethod · 0.95
onRecentSelectedMethod · 0.95

Calls 15

connectAnalyzerMethod · 0.95
getLogTextFunction · 0.85
getInterfaceMethod · 0.80
refreshUIMethod · 0.80
shouldReduceRateMethod · 0.80
labelMethod · 0.80
setDecimationMethod · 0.80
flushMethod · 0.80
getProfileMethod · 0.45
getStateMethod · 0.45
getAnalyzerParamsMethod · 0.45

Tested by

no test coverage detected