Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d82f14a74b14
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2a7a303d4b41
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 3, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    makenowjust Hiroya Fujinami
    Copy the full SHA
    c93326e View commit details
  2. Merge pull request #136 from tomverbeure/siglent_toQueue

    Add captured waveforms to m_pendingWaveforms when in toQueue mode.
    azonenberg authored Jun 3, 2020
    Copy the full SHA
    2a7a303 View commit details
Showing with 25 additions and 3 deletions.
  1. +25 −3 scopehal/SiglentSCPIOscilloscope.cpp
28 changes: 25 additions & 3 deletions scopehal/SiglentSCPIOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -147,7 +147,6 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)

double start = GetTime();


//Read the wavedesc for every enabled channel
vector<struct SiglentWaveformDesc_t*> wavedescs;
bool enabled[4] = {false};
@@ -171,14 +170,16 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
// grab the actual waveforms

//TODO: WFSU in outer loop and WF in inner loop
map<int, vector<WaveformBase*> > pending_waveforms;
unsigned int num_sequences = 1;
for(unsigned int chanNr=0; chanNr<m_analogChannelCount; chanNr++)
{
//If the channel is invisible, don't waste time capturing data
struct SiglentWaveformDesc_t *wavedesc = wavedescs[chanNr];
if(!enabled[chanNr] || string(wavedesc->DescName).empty())
{
m_channels[chanNr]->SetData(NULL);
if (!toQueue)
m_channels[chanNr]->SetData(NULL);
continue;
}

@@ -292,8 +293,29 @@ bool SiglentSCPIOscilloscope::AcquireData(bool toQueue)
}

//Done, update the data
m_channels[chanNr]->SetData(cap);
if (!toQueue)
m_channels[chanNr]->SetData(cap);
else
pending_waveforms[chanNr].push_back(cap);
}

m_pendingWaveformsMutex.lock();
size_t num_pending = 0;

if (toQueue)
num_pending++;

for(size_t i = 0; i < num_pending; ++i)
{
SequenceSet s;
for(size_t j = 0; j < m_analogChannelCount; j++)
{
if(enabled[j])
s[m_channels[j]] = pending_waveforms[j][i];
}
m_pendingWaveforms.push_back(s);
}
m_pendingWaveformsMutex.unlock();

double dt = GetTime() - start;
LogTrace("Waveform download took %.3f ms\n", dt * 1000);