Bugfix: Signal min/max in UI#120
Open
ramonfelder wants to merge 3 commits into
Open
Conversation
The UI is currently not informed when samples are cleared. As a result, every new acquisition starts with the min/max range from the previous acquisition. During an acquisition, the range can only increase and never decrease. This leads to incorrect SI prefixes being used for signal values when the values of a new acquisition are orders of magnitude smaller than those of any previous acquisition. Because autoranging also sets the min and max values, the issue only becomes noticable when autoranging is disabled. Since the min_max_changed signal can only increase the signal range, it cannot be used to reset the range. Therefore, a different signal is required. This change uses the existing samples_cleared signal for that purpose. With this commit, SignalBase emits a samples_cleared signal every time an acquisition is started, without any additional condition. The UI uses this event to reset the min an max values in AnalogSignal.
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.
This PR fixes the initialization and resetting of
signal_min_andsignal_max_values inAnalogSignal.Those values are used to determine the SI prefix when a value is displayed. Without this fix,
signal_min_and/orsignal_max_sometimes start with high values, leading to signal readings like e.g.0.000 GV, or withNaN, leading to readings like e.g.7384926150847261938450274 yV.The PR also resets
signal_min_andsignal_max_whenever a new acquisition is started.Because autoranging also sets
signal_min_andsignal_max_, the issue only becomes noticable when autoranging is disabled.