Skip to content

Commit

Permalink
Make out-of-range values visible at the bottom of the plot
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Oct 3, 2023
1 parent 919a90a commit 1cd188d
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 1cd188d

Please sign in to comment.