diff --git a/scopehal/DSLabsOscilloscope.cpp b/scopehal/DSLabsOscilloscope.cpp index 7e8e57ba..ce86c406 100644 --- a/scopehal/DSLabsOscilloscope.cpp +++ b/scopehal/DSLabsOscilloscope.cpp @@ -316,6 +316,10 @@ bool DSLabsOscilloscope::AcquireData() scale *= GetChannelAttenuation(chnum); offset *= GetChannelAttenuation(chnum); + bool clipping; + if(!m_transport->ReadRawData(sizeof(clipping), (uint8_t*)&clipping)) + return false; + //TODO: stream timestamp from the server if(!m_transport->ReadRawData(memdepth * sizeof(int8_t), (uint8_t*)buf)) @@ -328,6 +332,9 @@ bool DSLabsOscilloscope::AcquireData() cap->m_startTimestamp = time(NULL); cap->m_densePacked = true; cap->m_startFemtoseconds = fs; + if (clipping) + cap->m_flags |= WaveformBase::WAVEFORM_CLIPPING; + cap->Resize(memdepth); awfms.push_back(cap); scales.push_back(scale); diff --git a/scopehal/Waveform.h b/scopehal/Waveform.h index 3d4be5eb..06d1506a 100644 --- a/scopehal/Waveform.h +++ b/scopehal/Waveform.h @@ -85,6 +85,7 @@ class WaveformBase , m_startFemtoseconds(0) , m_triggerPhase(0) , m_densePacked(false) + , m_flags(0) {} //empty virtual destructor in case any derived classes need one @@ -127,6 +128,17 @@ class WaveformBase */ bool m_densePacked; + /** + @brief Flags that apply to this waveform. Bitfield. + + WAVEFORM_CLIPPING: Scope indicated that this waveform is clipped. + */ + uint8_t m_flags; + + enum { + WAVEFORM_CLIPPING = 1 + }; + ///@brief Start timestamps of each sample std::vector< EmptyConstructorWrapper,