| 1503 | } |
| 1504 | |
| 1505 | void |
| 1506 | TimeWindow::onTaskDone(void) |
| 1507 | { |
| 1508 | this->ui->taskStateLabel->setText("Done."); |
| 1509 | this->ui->taskProgressBar->setValue(0); |
| 1510 | |
| 1511 | if (this->taskController.getName() == "guessCarrier") { |
| 1512 | const CarrierDetector *cd = |
| 1513 | static_cast<const CarrierDetector *>(this->taskController.getTask()); |
| 1514 | SUFLOAT relFreq = SU_ANG2NORM_FREQ(cd->getPeak()); |
| 1515 | const SUCOMPLEX *orig = nullptr; |
| 1516 | SUCOMPLEX *dest = nullptr; |
| 1517 | SUSCOUNT len = 0; |
| 1518 | |
| 1519 | this->getTransformRegion( |
| 1520 | orig, |
| 1521 | dest, |
| 1522 | len, |
| 1523 | this->ui->afcSelCheck->isChecked()); |
| 1524 | |
| 1525 | // Some UI feedback |
| 1526 | this->ui->syncFreqSpin->setValue(SU_NORM2ABS_FREQ(this->fs, relFreq)); |
| 1527 | |
| 1528 | // Translate |
| 1529 | CarrierXlator *cx = new CarrierXlator(orig, dest, len, relFreq, 0); |
| 1530 | |
| 1531 | // Launch carrier translator |
| 1532 | this->taskController.process("xlateCarrier", cx); |
| 1533 | } else if (this->taskController.getName() == "xlateCarrier") { |
| 1534 | this->setDisplayData(&this->processedData, true); |
| 1535 | this->notifyTaskRunning(false); |
| 1536 | } else if (this->taskController.getName() == "triggerHistogram") { |
| 1537 | this->histogramDialog->show(); |
| 1538 | this->notifyTaskRunning(false); |
| 1539 | } else if (this->taskController.getName() == "triggerSampler") { |
| 1540 | this->samplerDialog->show(); |
| 1541 | this->notifyTaskRunning(false); |
| 1542 | } else if (this->taskController.getName() == "computeDoppler") { |
| 1543 | SUFLOAT lambda = static_cast<SUFLOAT>(299792458. / this->ui->refFreqSpin->value()); |
| 1544 | // Oh my god. Please provide something better than this |
| 1545 | DopplerCalculator *dc = |
| 1546 | (DopplerCalculator *) this->taskController.getTask(); |
| 1547 | std::vector<SUCOMPLEX> spectrum = std::move(dc->takeSpectrum()); |
| 1548 | |
| 1549 | // If the selected wave was captured at a sample rate fs, |
| 1550 | // then the RBW is fs / data.size() |
| 1551 | // Therefore delta V is RBW * lambda |
| 1552 | |
| 1553 | this->notifyTaskRunning(false); |
| 1554 | |
| 1555 | this->dopplerDialog->setVelocityStep(this->fs / spectrum.size() * lambda); |
| 1556 | this->dopplerDialog->setSigmaV(static_cast<qreal>(dc->getSigma())); |
| 1557 | this->dopplerDialog->setCenterFreq(this->ui->refFreqSpin->value()); |
| 1558 | this->dopplerDialog->setDominantVelocity(static_cast<qreal>(dc->getPeak())); |
| 1559 | this->dopplerDialog->giveSpectrum(std::move(spectrum)); |
| 1560 | this->dopplerDialog->setMax(dc->getMax()); |
| 1561 | this->dopplerDialog->show(); |
| 1562 | } else { |
nothing calls this directly
no test coverage detected