Skip to content

Commit

Permalink
Avoid resetting histogram, min & max unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Sep 30, 2023
1 parent ab32d5f commit 31072da
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ void CPlotter::mouseMoveEvent(QMouseEvent* event)
{
emit pandapterRangeChanged(m_PandMindB, m_PandMaxdB);

m_MaxHoldValid = false;
m_MinHoldValid = false;
m_histIIRValid = false;

m_Yzero = py;
Expand Down Expand Up @@ -482,9 +480,6 @@ void CPlotter::mouseMoveEvent(QMouseEvent* event)
m_ClickResolution );
emit newDemodFreq(m_DemodCenterFreq,
m_DemodCenterFreq - m_CenterFreq);
m_MaxHoldValid = false;
m_MinHoldValid = false;
m_histIIRValid = false;
updateOverlay();
}
else
Expand Down Expand Up @@ -955,8 +950,6 @@ void CPlotter::wheelEvent(QWheelEvent * event)
if (m_PandMindB < FFT_MIN_DB)
m_PandMindB = FFT_MIN_DB;

m_MaxHoldValid = false;
m_MinHoldValid = false;
m_histIIRValid = false;

emit pandapterRangeChanged(m_PandMindB, m_PandMaxdB);
Expand Down Expand Up @@ -1187,7 +1180,7 @@ void CPlotter::draw(bool newData)
&& tnow_ms >= tlast_plot_drawn_ms + PLOTTER_UPDATE_LIMIT_MS);

// Do not waste time with histogram calculations unless in this mode.
const bool doHistogram = (plotterVisible && m_PlotMode == PLOT_MODE_HISTOGRAM);
const bool doHistogram = (plotterVisible && m_PlotMode == PLOT_MODE_HISTOGRAM && newData);

// Use fewer histogram bins when statistics are sparse
const int histBinsDisplayed = std::min(
Expand Down Expand Up @@ -1900,8 +1893,6 @@ void CPlotter::setPandapterRange(float min, float max)

m_PandMindB = min;
m_PandMaxdB = max;
m_MaxHoldValid = false;
m_MinHoldValid = false;
m_histIIRValid = false;
updateOverlay();
}
Expand Down

0 comments on commit 31072da

Please sign in to comment.