Skip to content

Commit

Permalink
InstrumentThread: fixed bug where we falsely assume instruments deriv…
Browse files Browse the repository at this point in the history
…ing from FunctionGenerator actually have a FunctionGeneratorState
  • Loading branch information
azonenberg committed Nov 13, 2024
1 parent 6679fd7 commit fd987b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ngscopeclient/InstrumentThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<psu->GetChannelCount(); i++)
Expand All @@ -142,7 +142,7 @@ void InstrumentThread(InstrumentThreadArgs args)

psustate->m_firstUpdateDone = true;
}
if(load)
if(load && loadstate)
{
for(size_t i=0; i<load->GetChannelCount(); i++)
{
Expand All @@ -155,7 +155,7 @@ void InstrumentThread(InstrumentThreadArgs args)
}
loadstate->m_firstUpdateDone = true;
}
if(meter)
if(meter && meterstate)
{
auto chan = dynamic_cast<MultimeterChannel*>(meter->GetChannel(meter->GetCurrentMeterChannel()));
if(chan)
Expand All @@ -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; i<bert->GetChannelCount(); i++)
Expand Down Expand Up @@ -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; i<awg->GetChannelCount(); i++)
Expand All @@ -233,7 +233,7 @@ void InstrumentThread(InstrumentThreadArgs args)

awgstate->m_needsUpdate[i] = false;
}

}
}

Expand Down

0 comments on commit fd987b4

Please sign in to comment.