From b56d2db743ffcc6d13dd2a3ba4a90e779768d03d Mon Sep 17 00:00:00 2001 From: James Yuzawa Date: Fri, 8 Nov 2024 18:23:29 -0500 Subject: [PATCH] better function name --- src/qtgui/plotter.cpp | 6 +++--- src/qtgui/plotter.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qtgui/plotter.cpp b/src/qtgui/plotter.cpp index 489e30ca1..388dc9c19 100644 --- a/src/qtgui/plotter.cpp +++ b/src/qtgui/plotter.cpp @@ -333,7 +333,7 @@ void CPlotter::mouseMoveEvent(QMouseEvent* event) QDateTime tt; tt.setMSecsSinceEpoch(ms); QString timeStr = tt.toString("yyyy.MM.dd hh:mm:ss.zzz"); - const qreal kHz = xFromWaterfallEntry(waterfallEntry, px) / 1.e3; + const qreal kHz = waterfallFreqFromX(waterfallEntry, px) / 1.e3; showToolTip(event, QString("%1\n%2 kHz").arg(timeStr).arg(kHz, 0, 'f', 3)); } else @@ -639,7 +639,7 @@ void CPlotter::mousePressEvent(QMouseEvent * event) { emit newCenterFrequency(waterfallEntry.m_CenterFreq + (m_DemodCenterFreq - m_CenterFreq)); } - m_DemodCenterFreq = roundFreq(xFromWaterfallEntry(waterfallEntry, px), m_ClickResolution); + m_DemodCenterFreq = roundFreq(waterfallFreqFromX(waterfallEntry, px), m_ClickResolution); bool invalidate = false; if (m_FftCenter != waterfallEntry.m_FftCenter) { @@ -2366,7 +2366,7 @@ WaterfallEntry CPlotter::getWaterfallEntry(int waterfallY) return m_WaterfallEntries[idx]; } -qint64 CPlotter::xFromWaterfallEntry(WaterfallEntry waterfallEntry, int x) { +qint64 CPlotter::waterfallFreqFromX(WaterfallEntry waterfallEntry, int x) { const qreal ratio = (qreal) x / (qreal) m_WaterfallImage.width(); const qint64 centerFrequency = waterfallEntry.m_CenterFreq + waterfallEntry.m_FftCenter; const qint64 frequencySpan = waterfallEntry.m_Span; diff --git a/src/qtgui/plotter.h b/src/qtgui/plotter.h index 783b6af85..dc1c4f398 100644 --- a/src/qtgui/plotter.h +++ b/src/qtgui/plotter.h @@ -237,7 +237,7 @@ public slots: void zoomStepX(float factor, int x); static qint64 roundFreq(qint64 freq, int resolution); WaterfallEntry getWaterfallEntry(int waterfallY); - qint64 xFromWaterfallEntry(WaterfallEntry waterfallEntry, int x); + qint64 waterfallFreqFromX(WaterfallEntry waterfallEntry, int x); void clampDemodParameters(); static QColor blend(QColor base, QColor over, int alpha255) {