MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / snapToStep

Function snapToStep

src/gui/SpectrumWidget.cpp:5790–5795  ·  view source on GitHub ↗

Snap a frequency (MHz) to the nearest multiple of m_stepHz.

Source from the content-addressed store, hash-verified

5788
5789// Snap a frequency (MHz) to the nearest multiple of m_stepHz.
5790static 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
5797void SpectrumWidget::mousePressEvent(QMouseEvent* ev)
5798{

Callers 6

mousePressEventMethod · 0.85
driveVfoDragTuneMethod · 0.85
edgePanVelocityStepMethod · 0.85
mouseReleaseEventMethod · 0.85
mouseDoubleClickEventMethod · 0.85
wheelEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected