-
Notifications
You must be signed in to change notification settings - Fork 543
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
Avoid resetting histogram, min & max unnecessarily #1290
Conversation
m_MaxHoldValid = false; | ||
m_MinHoldValid = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset max/min hold data when dragging the Y axis.
m_MaxHoldValid = false; | ||
m_MinHoldValid = false; | ||
m_histIIRValid = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset anything when adjusting the demod frequency.
m_MaxHoldValid = false; | ||
m_MinHoldValid = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset max/min when zooming the Y axis.
src/qtgui/plotter.cpp
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Processing the histogram after an overlay update causes the IIR data to be blown away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At low frame rates, this make the histogram chase the avg line while panning. I think that's ok, since it also cuts down on processing, since the histogram isn't constantly redrawn during panning. Either way is fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that was unintended. I was trying to prevent the IIR from being reset when the demod frequency was changed. I'll remove this change and have a look to see whether there's a better way to accomplish that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's not that the IIR is reset, just that one IIR averaging step executes each time updateOverlay
is called, so the IIR rapidly decays even though no new data has arrived.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some other events that also trigger updateOverlay
and cause IIR decay:
- filter cutoff adjustment
- changing demod type
- setting A/B markers
- enabling/disabling the band plan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the condition to (!m_histIIRValid || newData)
seems to do the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
m_MaxHoldValid = false; | ||
m_MinHoldValid = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to reset max/min when dragging the Plot dB / WF dB sliders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see any bad effects from removing those invalidations.
src/qtgui/plotter.cpp
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At low frame rates, this make the histogram chase the avg line while panning. I think that's ok, since it also cuts down on processing, since the histogram isn't constantly redrawn during panning. Either way is fine with me.
31072da
to
253460c
Compare
Partially addresses #1282.