Keep the channel and samplerate display in sync with the capture mode - #130
Open
lindmeira wants to merge 3 commits into
Open
Keep the channel and samplerate display in sync with the capture mode#130lindmeira wants to merge 3 commits into
lindmeira wants to merge 3 commits into
Conversation
When a channel is enabled or disabled without the whole signal set changing, the vertical layout of the traces was not recomputed, so newly shown channels could end up rendered overlapping the previously visible ones. This happens for example when a samplerate change makes the driver switch capture modes and consequently enable or disable channels. Re-stack the trace tree items in signals_changed() and request a signal re-sync after the samplerate is changed so the layout is always recomputed. Signed-off-by: Lindolfo Meira <meiraa@gmail.com>
…he capture mode Toggling a channel can make the driver adjust the samplerate (clamping it down to the maximum the new channel count supports), but PulseView only re-read the samplerate when the user changed it directly, leaving the displayed value stale. Emit a channels_changed() signal from the channels popup after a toggle and refresh the samplerate selector from the device in that case. Signed-off-by: Lindolfo Meira <meiraa@gmail.com>
…ssion setups save_setup() stored the channel selection and view configuration but not the samplerate or the sample count limit, so on the next start the channel selection was restored while the samplerate fell back to the device default. Save both values and re-apply them on restore, then refresh the toolbar selectors and re-layout the view so the restored rate (which drives the driver's channel mode) is reflected correctly. Signed-off-by: Lindolfo Meira <meiraa@gmail.com>
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 series keeps the trace and samplerate display in PulseView consistent when the device's capture mode (channel count) changes, and persists the samplerate and sample count across sessions.
Devices whose channel count is tied to the samplerate (e.g. the SiPEED SLogic Combo8 logic analyzer, where 160MHz runs 2 channels, 80MHz runs 4 and 40MHz runs 8) change the set of enabled channels when the samplerate changes or when channels are toggled manually. PulseView did not re-layout the traces in that case, so newly shown channels could overlap the previously visible ones, and the samplerate display could go stale when a channel toggle made the driver clamp the samplerate. The samplerate and sample count were also not part of the saved session setup, so a session restored on the next start fell back to the device defaults.
Patch 1 re-stacks the trace tree when the signal set is re-synced and after a samplerate change, so the layout always reflects the enabled channels. Patch 2 emits a channels_changed() signal from the channels popup and refreshes the samplerate selector from the device, keeping the display in sync when toggling channels. Patch 3 saves and restores the samplerate and sample count limit together with the channel selection, and re-layouts the view after restoring.