Snap a frequency (MHz) to the nearest multiple of m_stepHz.
| 5788 | |
| 5789 | // Snap a frequency (MHz) to the nearest multiple of m_stepHz. |
| 5790 | static double snapToStep(double mhz, int stepHz) |
| 5791 | { |
| 5792 | if (stepHz <= 0) return mhz; |
| 5793 | const double stepMhz = stepHz / 1e6; |
| 5794 | return std::round(mhz / stepMhz) * stepMhz; |
| 5795 | } |
| 5796 | |
| 5797 | void SpectrumWidget::mousePressEvent(QMouseEvent* ev) |
| 5798 | { |
no outgoing calls
no test coverage detected