From 1d6cd5b9fde8c7885d8e0b66c430dc95992a943d Mon Sep 17 00:00:00 2001 From: fredzo Date: Wed, 9 Oct 2024 19:42:08 +0200 Subject: [PATCH] Fixed end of download detection based on new AcquisitionStopped() helper method on Oscilloscope. Fixed looping on PollTrigger() when scope is in Run mode. --- src/ngscopeclient/InstrumentThread.cpp | 2 +- src/ngscopeclient/StreamBrowserDialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngscopeclient/InstrumentThread.cpp b/src/ngscopeclient/InstrumentThread.cpp index 90bc86c5..21072c83 100644 --- a/src/ngscopeclient/InstrumentThread.cpp +++ b/src/ngscopeclient/InstrumentThread.cpp @@ -92,7 +92,7 @@ void InstrumentThread(InstrumentThreadArgs args) { // Check for trigger state change auto stat = scope->PollTrigger(); session->GetInstrumentConnectionState(inst)->m_lastTriggerState = stat; - if(stat == Oscilloscope::TRIGGER_MODE_STOP) + if(stat == Oscilloscope::TRIGGER_MODE_STOP || stat == Oscilloscope::TRIGGER_MODE_RUN || stat == Oscilloscope::TRIGGER_MODE_TRIGGERED) { // Final state triggerUpToDate = true; } diff --git a/src/ngscopeclient/StreamBrowserDialog.cpp b/src/ngscopeclient/StreamBrowserDialog.cpp index f81cf2e4..88eeb104 100644 --- a/src/ngscopeclient/StreamBrowserDialog.cpp +++ b/src/ngscopeclient/StreamBrowserDialog.cpp @@ -359,7 +359,7 @@ bool StreamBrowserDialog::DoRender() { renderBadge(ImVec4(0.4, 0.4, 0.4, 1.0) /* XXX: pull color from prefs */, "disabled", "disa", NULL); } - else if (state && state->m_lastTriggerState != Oscilloscope::TRIGGER_MODE_STOP) + else if (state) { renderDownloadProgress(inst, chan); }