ngscopeclient 0.1-dev+51fbda87c
Files | Classes | Functions
Collaboration diagram for Data model:

Files

file  CANChannel.cpp
 Implementation of CANChannel, CANSymbol, and CANWaveform.
 
file  CANChannel.h
 Declaration of CANChannel, CANSymbol, and CANWaveform.
 
file  ConstellationWaveform.cpp
 Implementation of ConstellationWaveform.
 
file  ConstellationWaveform.h
 Declaration of ConstellationWaveform.
 
file  DensityFunctionWaveform.cpp
 Implementation of DensityFunctionWaveform.
 
file  DensityFunctionWaveform.h
 Declaration of DensityFunctionWaveform.
 
file  EyeMask.cpp
 Implementation of EyeMask.
 
file  EyeMask.h
 Declaration of EyeMask, EyeMaskPoint, and EyeMaskPolygon.
 
file  EyeWaveform.cpp
 Implementation of EyeWaveform.
 
file  EyeWaveform.h
 Declaration of EyeWaveform.
 
file  FunctionGeneratorChannel.cpp
 Implementation of FunctionGeneratorChannel.
 
file  FunctionGeneratorChannel.h
 Declaration of FunctionGeneratorChannel.
 
file  LoadChannel.cpp
 Implementation of LoadChannel.
 
file  LoadChannel.h
 Declaration of LoadChannel.
 
file  MultimeterChannel.cpp
 Declaration of MultimeterChannel.
 
file  MultimeterChannel.h
 Declaration of MultimeterChannel.
 
file  SParameterChannel.h
 Declaration of SParameterChannel.
 
file  Unit.cpp
 Implementation of Unit.
 
file  Unit.h
 Declaration of Unit.
 
file  Waveform.cpp
 Implementation of WaveformBase.
 
file  Waveform.h
 Declaration of WaveformBase, SparseWaveformBase, UniformWaveformBase.
 
file  WaveformPool.h
 Declaration of WaveformPool.
 

Classes

class  CANSymbol
 A single symbol within a CAN bus protocol decode. More...
 
class  CANWaveform
 A waveform containing CAN bus packets. More...
 
class  ConstellationWaveform
 A constellation diagram. More...
 
class  DensityFunctionWaveform
 Base class for waveforms such as eye patterns, spectrograms, and waterfalls which are conceptually a 2D bitmap. More...
 
class  EyeMaskPoint
 A single point within an EyeMaskPolygon. More...
 
class  EyeMaskPolygon
 A single polygon within an EyeMask. More...
 
class  EyeMask
 A mask used for checking eye patterns. More...
 
class  EyeWaveform
 An eye-pattern waveform. More...
 
class  FunctionGeneratorChannel
 A single channel of a function generator. More...
 
class  LoadChannel
 A single channel of an active load. More...
 
class  MultimeterChannel
 A single channel of a multimeter. More...
 
class  SParameterChannel
 An OscilloscopeChannel containing S-parameter data in dB/degrees format. More...
 
class  Unit
 A unit of measurement, plus conversion to pretty-printed output. More...
 
class  WaveformBase
 Base class for all Waveform specializations. More...
 
class  SparseWaveformBase
 Base class for waveforms with nonuniform sample rate. More...
 
class  UniformWaveformBase
 Base class for waveforms with data sampled at uniform intervals. More...
 
class  UniformWaveform< S >
 A waveform sampled at uniform intervals. More...
 
class  SparseWaveform< S >
 A waveform sampled at irregular intervals. More...
 
class  WaveformPool
 Thread safe memory pool for reusing Waveform objects. More...
 
class  SpectrogramWaveform
 Waveform object for a spectrogram. More...
 

Functions

template<class T >
int64_t GetOffsetScaled (T *wfm, size_t i)
 Returns the offset of a sample from the start of the waveform, in X axis units. More...
 
template<class T >
int64_t GetDurationScaled (T *wfm, size_t i)
 Returns the duration of a sample, in X axis units. More...
 
template<class T >
size_t BinarySearchForGequal (T *buf, size_t len, T value)
 Look for a value greater than or equal to "value" in buf and return the index.
 
size_t GetIndexNearestAtOrBeforeTimestamp (WaveformBase *wfm, int64_t time_fs, bool &out_of_bounds)
 Find the index of the sample in a (possibly sparse) waveform that COULD include the time time_fs. More...
 
std::optional< float > GetValueAtTime (WaveformBase *waveform, int64_t time_fs, bool zero_hold_behavior)
 Gets the value of our channel at the specified timestamp (absolute, not waveform ticks) and interpolates if possible.
 
std::optional< bool > GetDigitalValueAtTime (WaveformBase *waveform, int64_t time_fs)
 Gets the value of our channel at the specified timestamp (absolute, not waveform ticks).
 
std::optional< std::string > GetProtocolValueAtTime (WaveformBase *waveform, int64_t time_fs)
 Gets the value of our channel at the specified timestamp (absolute, not waveform ticks).
 

Detailed Description

Function Documentation

◆ GetDurationScaled()

template<class T >
int64_t GetDurationScaled ( T *  wfm,
size_t  i 
)

Returns the duration of a sample, in X axis units.

You should use this function to determine the final displayed duration of a sample.

Parameters
wfmThe source waveform
iSample index

◆ GetIndexNearestAtOrBeforeTimestamp()

size_t GetIndexNearestAtOrBeforeTimestamp ( WaveformBase wfm,
int64_t  time_fs,
bool &  out_of_bounds 
)

Find the index of the sample in a (possibly sparse) waveform that COULD include the time time_fs.

It is NOT GUARANTEED TO if the waveform is not continuous. Results are clamped to 0 and wfm->size(), setting out_of_bounds if that happened. To be sure that the returned index refers to a sample that includes time_fs, check that GetOffsetScaled(swaveform, index) + GetDurationScaled(swaveform, index) < time_fs

◆ GetOffsetScaled()

template<class T >
int64_t GetOffsetScaled ( T *  wfm,
size_t  i 
)

Returns the offset of a sample from the start of the waveform, in X axis units.

You should use this function to determine the final displayed timestamp of a sample.

Parameters
wfmThe source waveform
iSample index