Skip to content

MainBar: refresh sample rate list when channels popup closes - #115

Open
heeen wants to merge 1 commit into
sigrokproject:masterfrom
heeen:refresh-rates-on-channel-toggle
Open

MainBar: refresh sample rate list when channels popup closes#115
heeen wants to merge 1 commit into
sigrokproject:masterfrom
heeen:refresh-rates-on-channel-toggle

Conversation

@heeen

@heeen heeen commented Mar 4, 2026

Copy link
Copy Markdown

Summary

  • Connect channels popup closed() signal to on_config_changed() to refresh the sample rate dropdown after toggling channels

Problem

Some drivers change available sample rates based on enabled channel count (e.g. sipeed-slogic-analyzer: 200MHz@16ch, 400MHz@8ch, 800MHz@4ch). The sample rate dropdown was not refreshed after toggling channels, so users had to manually change the rate to trigger a re-query.

Fix

When the channels popup closes, call on_config_changed() which calls commit_sample_rate()update_sample_rate_selector(), refreshing the rate dropdown.

Test plan

  • Open PulseView with a device that has channel-dependent sample rates
  • Toggle channels in the channels popup
  • Close the popup and verify the sample rate dropdown updates immediately

Some drivers (e.g. sipeed-slogic-analyzer) change the available
sample rates based on which channels are enabled. Connect the
channels popup closed() signal to on_config_changed() so the
sample rate dropdown is refreshed after the user toggles channels.
@vk4tmz

vk4tmz commented Sep 1, 2026

Copy link
Copy Markdown

Tested this PR successfully with a Hantek 1008C driver whose available samplerates depend on the enabled-channel count.

Closing the Channels popup refreshes the list correctly:

  • CH1: 2.4 MSa/s and 800 kSa/s
  • CH1+CH2: 1.2 MSa/s and 400 kSa/s
  • 3–4 channels: 600 kSa/s and 200 kSa/s
  • 5–6 channels: 400 kSa/s and 133.333 kSa/s
  • 7–8 channels: 300 kSa/s and 100 kSa/s

I found one remaining case involving restored settings. If PulseView exits with CH1+CH2 enabled, after restarting both channels are restored but the samplerate list initially contains the CH1-only rates. Opening and closing the Channels popup refreshes it correctly.

It appears the initial samplerate list is queried before the saved channel-enable states are restored, while the closed() signal only covers interactive use of the popup. A deferred refresh after session restoration completes may also be needed.

Built successfully against PulseView master af021987 with Qt 5.15.13 and libsigrok 0.6.0-git.

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.

2 participants