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: 83d8c130ae15
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dfb0d283d07f
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jun 11, 2020

  1. Copy the full SHA
    dfb0d28 View commit details
Showing with 22 additions and 5 deletions.
  1. +6 −5 scopehal/LeCroyOscilloscope.cpp
  2. +15 −0 scopehal/Oscilloscope.cpp
  3. +1 −0 scopehal/Oscilloscope.h
11 changes: 6 additions & 5 deletions scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -1574,15 +1574,16 @@ void LeCroyOscilloscope::StartSingleTrigger()

void LeCroyOscilloscope::Stop()
{
lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand("TRIG_MODE STOP");
{
lock_guard<recursive_mutex> lock(m_mutex);
m_transport->SendCommand("TRIG_MODE STOP");
}

m_triggerArmed = false;
m_triggerOneShot = true;

//Clear out any pending data (the user doesn't want it, and we don't want stale stuff hanging around)
m_pendingWaveformsMutex.lock();
m_pendingWaveforms.clear();
m_pendingWaveformsMutex.unlock();
ClearPendingWaveforms();
}

size_t LeCroyOscilloscope::GetTriggerChannelIndex()
15 changes: 15 additions & 0 deletions scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -152,6 +152,21 @@ bool Oscilloscope::HasPendingWaveforms()
return (m_pendingWaveforms.size() != 0);
}

/**
@brief Discard any pending waveforms that haven't yet been processed
*/
void Oscilloscope::ClearPendingWaveforms()
{
lock_guard<mutex> lock(m_pendingWaveformsMutex);
while(!m_pendingWaveforms.empty())
{
SequenceSet set = *m_pendingWaveforms.begin();
for(auto it : set)
delete it.second;
m_pendingWaveforms.pop_front();
}
}

/**
@brief Just like PollTrigger(), but checks the fifo instead
*/
1 change: 1 addition & 0 deletions scopehal/Oscilloscope.h
Original file line number Diff line number Diff line change
@@ -491,6 +491,7 @@ class Oscilloscope : public virtual Instrument

public:
bool HasPendingWaveforms();
void ClearPendingWaveforms();
size_t GetPendingWaveformCount();
virtual Oscilloscope::TriggerMode PollTriggerFifo();
virtual bool AcquireDataFifo();