| 1712 | } |
| 1713 | |
| 1714 | void |
| 1715 | TimeWindow::onTriggerSampler(void) |
| 1716 | { |
| 1717 | if (!this->ui->realWaveform->isComplete()) |
| 1718 | return; |
| 1719 | |
| 1720 | SamplingProperties props; |
| 1721 | SUCOMPLEX dataMin = 2 * this->ui->realWaveform->getDataRMS(); |
| 1722 | SUCOMPLEX dataMax = 2 * this->ui->realWaveform->getDataRMS(); |
| 1723 | SUFLOAT maxAmp; |
| 1724 | |
| 1725 | this->populateSamplingProperties(props); |
| 1726 | |
| 1727 | if (props.length == 0) { |
| 1728 | QMessageBox::warning( |
| 1729 | this, |
| 1730 | "Start sampling", |
| 1731 | "Cannot perform sampling: nothing to sample"); |
| 1732 | return; |
| 1733 | } |
| 1734 | |
| 1735 | if (props.rate < props.fs / SCAST(qreal, props.length)) { |
| 1736 | this->ui->baudSpin->setFocus(); |
| 1737 | QMessageBox::warning( |
| 1738 | this, |
| 1739 | "Start sampling", |
| 1740 | "Cannot perform sampling: symbol rate is too small (or zero)"); |
| 1741 | return; |
| 1742 | } |
| 1743 | |
| 1744 | if (props.sync == ZERO_CROSSING) { |
| 1745 | maxAmp = 1; |
| 1746 | } else { |
| 1747 | maxAmp = |
| 1748 | SU_MAX( |
| 1749 | SU_MAX( |
| 1750 | SU_C_REAL(dataMin), |
| 1751 | SU_C_IMAG(dataMin)), |
| 1752 | SU_MAX( |
| 1753 | SU_C_REAL(dataMax), |
| 1754 | SU_C_IMAG(dataMax))); |
| 1755 | } |
| 1756 | |
| 1757 | if (maxAmp < 0) |
| 1758 | maxAmp = 0; |
| 1759 | |
| 1760 | this->samplerDialog->reset(); |
| 1761 | this->samplerDialog->setAmplitudeLimits(0, maxAmp); |
| 1762 | this->samplerDialog->setProperties(props); |
| 1763 | |
| 1764 | this->startSampling(); |
| 1765 | } |
| 1766 | |
| 1767 | void |
| 1768 | TimeWindow::onResample(void) |
nothing calls this directly
no test coverage detected