Attempt to fix possible pick-spikes issue#18
Closed
JoeZiminski wants to merge 1 commit into
Closed
Conversation
Member
|
Thanks @JoeZiminski! The fix is correct. I rebased on main, used the public viewRange() API, and removed a stray debug line — opened as #28 with your original commit preserved so you're credited in the history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @oliche, when I tried the pick-spikes functionality, it worked well for CTRL+click but the auto-detect voltage was not working. For me at least, the calculated S_RANGE was very large, say (-15000, 15000) for 30kHz sampling. Typically the view window was around 0.33s, so the
out_of_time_rangewas always triggered astscale[0]was very negative.I proposed a fix in this PR, but I'm not 100% if its needed, I might just be doing something wrong. The fix creates the window to search for the voltage peak as a percentage of the current zoom (so, if the user is really zoomed it, a point is not detected outside of their view range). The percentages (5% of y, 2% of x) are arbitrary but felt okay when manually testing. I'm curious to know if you also had any issues with the pick spikes or if I'm mis-using it. Cheers!