Skip to content

Commit

Permalink
better function name
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzawa-san committed Nov 19, 2024
1 parent f030bce commit b56d2db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/qtgui/plotter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit b56d2db

Please sign in to comment.