From fd987b4c6f7d1a57871c4265270b5d308cea4f72 Mon Sep 17 00:00:00 2001 From: Andrew Zonenberg Date: Tue, 12 Nov 2024 18:38:28 -0800 Subject: [PATCH] InstrumentThread: fixed bug where we falsely assume instruments deriving from FunctionGenerator actually have a FunctionGeneratorState --- src/ngscopeclient/InstrumentThread.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ngscopeclient/InstrumentThread.cpp b/src/ngscopeclient/InstrumentThread.cpp index 653e3318..cd68d878 100644 --- a/src/ngscopeclient/InstrumentThread.cpp +++ b/src/ngscopeclient/InstrumentThread.cpp @@ -118,7 +118,7 @@ void InstrumentThread(InstrumentThreadArgs args) inst->AcquireData(); //Populate scalar channel and do other instrument-specific processing - if(psu) + if(psu && psustate) { //Poll status for(size_t i=0; iGetChannelCount(); i++) @@ -142,7 +142,7 @@ void InstrumentThread(InstrumentThreadArgs args) psustate->m_firstUpdateDone = true; } - if(load) + if(load && loadstate) { for(size_t i=0; iGetChannelCount(); i++) { @@ -155,7 +155,7 @@ void InstrumentThread(InstrumentThreadArgs args) } loadstate->m_firstUpdateDone = true; } - if(meter) + if(meter && meterstate) { auto chan = dynamic_cast(meter->GetChannel(meter->GetCurrentMeterChannel())); if(chan) @@ -176,7 +176,7 @@ void InstrumentThread(InstrumentThreadArgs args) session->MarkChannelDirty(chan); } } - if(bert) + if(bert && bertstate) { //Check if we have any pending acquisition requests for(size_t i=0; iGetChannelCount(); i++) @@ -211,7 +211,7 @@ void InstrumentThread(InstrumentThreadArgs args) bertstate->m_firstUpdateDone = true; } // Read and cache FunctionGenerator settings - if(awg) + if(awg && awgstate) { //Read status for channels that need it for(size_t i=0; iGetChannelCount(); i++) @@ -233,7 +233,7 @@ void InstrumentThread(InstrumentThreadArgs args) awgstate->m_needsUpdate[i] = false; } - + } }