Keep unsupported channel 1 UI hidden

Move the channel 1 visibility gate to shared scope and skip channel 1 signal refresh while its UI is disabled, keeping the temporary restriction consistent across UI updates.
This commit is contained in:
Mark.lin
2026-09-01 17:10:25 +08:00
parent bfc598ed4d
commit 29444470db
+5 -1
View File
@@ -26,6 +26,8 @@
namespace namespace
{ {
constexpr bool kChannel1UiVisible = false;
QString logFilePrefix() QString logFilePrefix()
{ {
#if GVFG_INTERNAL_DIAGNOSTICS #if GVFG_INTERNAL_DIAGNOSTICS
@@ -690,6 +692,9 @@ void MainWindow::updateSignalStatus(bool queryHardware)
#endif #endif
for (int channelIndex = GVFG_CHANNEL_0; channelIndex <= GVFG_CHANNEL_1; ++channelIndex) for (int channelIndex = GVFG_CHANNEL_0; channelIndex <= GVFG_CHANNEL_1; ++channelIndex)
{ {
if (channelIndex == GVFG_CHANNEL_1 && !kChannel1UiVisible)
continue;
ChannelRuntime &channel = channels_[channelIndex]; ChannelRuntime &channel = channels_[channelIndex];
if (!channel.opened) if (!channel.opened)
{ {
@@ -829,7 +834,6 @@ void MainWindow::updateSignalStatus(bool queryHardware)
void MainWindow::updateUiState() void MainWindow::updateUiState()
{ {
constexpr bool kChannel1UiVisible = false;
const bool deviceOpen = handle_ != nullptr; const bool deviceOpen = handle_ != nullptr;
const bool ch0Running = channels_[0].running.load(std::memory_order_acquire); const bool ch0Running = channels_[0].running.load(std::memory_order_acquire);
const bool ch1Running = channels_[1].running.load(std::memory_order_acquire); const bool ch1Running = channels_[1].running.load(std::memory_order_acquire);