Skip to content

Keep the channel and samplerate display in sync with the capture mode - #130

Open
lindmeira wants to merge 3 commits into
sigrokproject:masterfrom
lindmeira:master
Open

Keep the channel and samplerate display in sync with the capture mode#130
lindmeira wants to merge 3 commits into
sigrokproject:masterfrom
lindmeira:master

Conversation

@lindmeira

Copy link
Copy Markdown

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant