Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make out-of-range values visible at the bottom of the plot #1299

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1545,10 +1545,10 @@ void CPlotter::draw(bool newData)
const qreal ixPlot = (qreal)ix;
const qreal yMaxD = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMaxBuf[ix])),
(float)plotHeight), 0.0f);
(float)plotHeight - 1.0f), 0.0f);
const qreal yAvgD = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftAvgBuf[ix])),
(float)plotHeight), 0.0f);
(float)plotHeight - 1.0f), 0.0f);

if (m_PlotMode == PLOT_MODE_HISTOGRAM)
{
Expand Down Expand Up @@ -1617,7 +1617,7 @@ void CPlotter::draw(bool newData)
const qreal ixPlot = (qreal)ix;
const qreal yMaxHoldD = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMaxHoldBuf[ix])),
(float)plotHeight), 0.0f);
(float)plotHeight - 1.0f), 0.0f);
maxLineBuf[i] = QPointF(ixPlot, yMaxHoldD);
}
// NOT scaling to DPR due to performance
Expand All @@ -1637,7 +1637,7 @@ void CPlotter::draw(bool newData)
const qreal ixPlot = (qreal)ix;
const qreal yMinHoldD = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(m_fftMinHoldBuf[ix])),
(float)plotHeight), 0.0f);
(float)plotHeight - 1.0f), 0.0f);
maxLineBuf[i] = QPointF(ixPlot, yMinHoldD);
}
// NOT scaling to DPR due to performance
Expand Down Expand Up @@ -1687,7 +1687,7 @@ void CPlotter::draw(bool newData)
{
const qreal y = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(vi)),
(float)plotHeight - 0.0f), 0.0f);
(float)plotHeight - 1.0f), 0.0f);
m_Peaks[ix] = y;
}
}
Expand All @@ -1711,7 +1711,7 @@ void CPlotter::draw(bool newData)
{
const qreal y = (qreal)std::max(std::min(
panddBGainFactor * (m_PandMaxdB - 10.0f * log10f(vi)),
(float)plotHeight - 0.0f), 0.0f);
(float)plotHeight - 1.0f), 0.0f);

// Show the wider peak only if there is no very close narrow peak
bool found = false;
Expand Down