ngscopeclient 0.1-dev+51fbda87c
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

Abstract base class for a node in the signal flow graph. More...

#include <FlowGraphNode.h>

Inheritance diagram for FlowGraphNode:
Inheritance graph
[legend]

Public Types

enum  DataLocation { LOC_CPU , LOC_GPU , LOC_DONTCARE }
 
typedef std::map< std::string, FilterParameterParameterMapType
 Short name for a map of strings to parameters.
 

Public Member Functions

void DetachInputs ()
 Disconnects all inputs from the node without releasing them. More...
 
size_t GetInputCount ()
 
std::string GetInputName (size_t i)
 
void SetInput (size_t i, StreamDescriptor stream, bool force=false)
 Connects a stream to the input of this node. More...
 
void SetInput (const std::string &name, StreamDescriptor stream, bool force=false)
 
virtual bool ValidateChannel (size_t i, StreamDescriptor stream)
 
StreamDescriptor GetInput (size_t i)
 Gets the descriptor for one of our inputs.
 
FilterParameterGetParameter (std::string s)
 
bool HasParameter (std::string s)
 Checks if we have a parameter with a given name. More...
 
ParameterMapType::iterator GetParamBegin ()
 Returns an iterator to the beginning of our parameter map.
 
ParameterMapType::iterator GetParamEnd ()
 Returns an iterator to the end of our parameter map.
 
size_t GetParamCount ()
 Returns the number of parameter we have.
 
virtual YAML::Node SerializeConfiguration (IDTable &table)
 Serializes this trigger's configuration to a YAML string. More...
 
virtual void LoadParameters (const YAML::Node &node, IDTable &table)
 Load configuration from a save file. More...
 
virtual void LoadInputs (const YAML::Node &node, IDTable &table)
 
bool IsDownstreamOf (std::set< FlowGraphNode * > nodes)
 Determines if this node is downstream of any of the specified other nodes. More...
 
virtual DataLocation GetInputLocation ()
 Gets the desired location of the nodes's input data. More...
 
virtual void Refresh ()
 Evaluates a filter graph node. More...
 
virtual void Refresh (vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue)
 
sigc::signal< void()> signal_parametersChanged ()
 
sigc::signal< void()> signal_inputsChanged ()
 

Protected Member Functions

virtual void OnInputChanged (size_t i)
 Called when a new input is connected to the node. More...
 
WaveformBaseGetInputWaveform (size_t i)
 Gets the waveform attached to the specified input. More...
 
SparseAnalogWaveformGetSparseAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
UniformAnalogWaveformGetUniformAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
SparseDigitalWaveformGetSparseDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
UniformDigitalWaveformGetUniformDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
SparseDigitalBusWaveformGetSparseDigitalBusInputWaveform (size_t i)
 Gets the digital bus waveform attached to the specified input.
 
void CreateInput (const std::string &name)
 Creates and names an input signal.
 
std::string GetInputDisplayName (size_t i)
 Gets the display name for one of our inputs. More...
 

Protected Attributes

std::vector< std::string > m_signalNames
 Names of signals we take as input.
 
std::vector< StreamDescriptorm_inputs
 The channel (if any) connected to each of our inputs.
 
ParameterMapType m_parameters
 
sigc::signal< void()> m_parametersChangedSignal
 Signal emitted when the set of parameters changes.
 
sigc::signal< void()> m_inputsChangedSignal
 Signal emitted when the set of inputs changes.
 

Detailed Description

Abstract base class for a node in the signal flow graph.

A FlowGraphNode has one or more channel inputs, zero or more configuration parameters.

Member Function Documentation

◆ DetachInputs()

void FlowGraphNode::DetachInputs ( )

Disconnects all inputs from the node without releasing them.

This function is intended for use in Oscilloscope::~Oscilloscope() only. Using it carelessly is likely to lead to memory leaks.

◆ GetInputDisplayName()

string FlowGraphNode::GetInputDisplayName ( size_t  i)
protected

Gets the display name for one of our inputs.

This includes the stream name iff the input comes from a multi-stream source.

◆ GetInputLocation()

FlowGraphNode::DataLocation FlowGraphNode::GetInputLocation ( )
virtual

Gets the desired location of the nodes's input data.

The default implementation returns CPU.

Returns
LOC_CPU: if the filter assumes input waveforms are readable from the CPU LOC_GPU: if the filter assumes input waveforms are readable from the GPU LOC_DONTCARE: if the filter manages its own input memory, or can work with either CPU or GPU input

Reimplemented in AddFilter, AverageFilter, BusHeatmapFilter, CouplerDeEmbedFilter, DeEmbedFilter, ExponentialMovingAverageFilter, FFTFilter, FIRFilter, JitterSpectrumFilter, MaximumFilter, MinimumFilter, RISFilter, SpectrogramFilter, SubtractFilter, and UpsampleFilter.

◆ GetInputWaveform()

WaveformBase * FlowGraphNode::GetInputWaveform ( size_t  i)
inlineprotected

Gets the waveform attached to the specified input.

This function is safe to call on a NULL input and will return NULL in that case.

This function is safe to call on a null input and will return null in that case.

Parameters
iInput index
Returns
Data from the channel if applicable, null if no data or no input connected

◆ HasParameter()

bool FlowGraphNode::HasParameter ( std::string  s)
inline

Checks if we have a parameter with a given name.

Parameters
sName of the parameter
Returns
True if found, false if not found

◆ IsDownstreamOf()

bool FlowGraphNode::IsDownstreamOf ( std::set< FlowGraphNode * >  nodes)

Determines if this node is downstream of any of the specified other nodes.

Returns true if any of this node's inputs, or their inputs, etc. eventually chain back to an element in the set.

◆ LoadParameters()

void FlowGraphNode::LoadParameters ( const YAML::Node &  node,
IDTable table 
)
virtual

Load configuration from a save file.

Reimplemented in Filter, IBISDriverFilter, and ScalarStairstepFilter.

◆ OnInputChanged()

void FlowGraphNode::OnInputChanged ( size_t  i)
protectedvirtual

Called when a new input is connected to the node.

The default implementation does nothing, but some special cases may find this hook useful.

For example, instrument channels may make hardware changes as soon as a new input is connected.

Reimplemented in BufferedSwitchMatrixInputChannel, BufferedSwitchMatrixIOChannel, and BufferedSwitchMatrixOutputChannel.

◆ Refresh()

void FlowGraphNode::Refresh ( )
virtual

Evaluates a filter graph node.

This version does not support using Vulkan acceleration and should be considered deprecated. It will be removed in the indefinite future once all filters have been converted to the new API.

Reimplemented in Filter, ImportFilter, ACCoupleFilter, ACRMSMeasurement, ADL5205Decoder, AreaMeasurement, AutocorrelationFilter, BandwidthMeasurement, BaseMeasurement, BurstWidthMeasurement, CANBitmaskFilter, CANDecoder, ClipFilter, ClockRecoveryFilter, CurrentShuntFilter, DCDMeasurement, DDJMeasurement, DDR1Decoder, DDR3Decoder, DeskewFilter, DownconvertFilter, DownsampleFilter, DPAuxChannelDecoder, DPhyDataDecoder, DPhyEscapeModeDecoder, DPhyHSClockRecoveryFilter, DPhySymbolDecoder, DramClockFilter, DramRefreshActivateMeasurement, DramRowColumnLatencyMeasurement, DSIFrameDecoder, DSIPacketDecoder, DutyCycleMeasurement, DVIDecoder, EmphasisFilter, EmphasisRemovalFilter, EnvelopeFilter, ESPIDecoder, Ethernet1000BaseXDecoder, Ethernet100BaseTXDecoder, Ethernet10BaseTDecoder, Ethernet10GBaseRDecoder, Ethernet64b66bDecoder, EthernetAutonegotiationDecoder, EthernetAutonegotiationPageDecoder, EthernetBaseXAutonegotiationDecoder, EthernetGMIIDecoder, EthernetRGMIIDecoder, EthernetRMIIDecoder, EthernetSGMIIDecoder, ExportFilter, EyeBitRateMeasurement, EyeHeightMeasurement, EyeJitterMeasurement, EyePeriodMeasurement, EyeWidthMeasurement, FallMeasurement, FrequencyMeasurement, FSKDecoder, FullWidthHalfMax, GlitchRemovalFilter, GroupDelayFilter, HistogramFilter, HorizontalBathtub, HyperRAMDecoder, I2CDecoder, I2CEepromDecoder, I2CRegisterDecoder, IBISDriverFilter, IBM8b10bDecoder, InvertFilter, IPv4Decoder, IQSquelchFilter, ISIMeasurement, J1939AnalogDecoder, J1939BitmaskDecoder, J1939PDUDecoder, J1939SourceMatchFilter, J1939TransportDecoder, JitterFilter, JtagDecoder, MagnitudeFilter, MDIODecoder, MemoryFilter, MilStd1553Decoder, MovingAverageFilter, MultiplyFilter, NCOFilter, NoiseFilter, OneWireDecoder, OvershootMeasurement, PAM4DemodulatorFilter, ParallelBus, PCIe128b130bDecoder, PCIeDataLinkDecoder, PCIeGen2LogicalDecoder, PCIeGen3LogicalDecoder, PCIeLinkTrainingDecoder, PCIeTransportDecoder, PeakHoldFilter, PeriodMeasurement, PhaseMeasurement, PhaseNonlinearityFilter, PkPkMeasurement, PRBSCheckerFilter, PRBSGeneratorFilter, PulseWidthMeasurement, QSGMIIDecoder, QSPIDecoder, QuadratureDecoder, ReferencePlaneExtensionFilter, RiseMeasurement, RjBUjFilter, RMSMeasurement, SawtoothGeneratorFilter, SDCmdDecoder, SDDataDecoder, SetupHoldMeasurement, SNRFilter, SParameterCascadeFilter, SParameterDeEmbedFilter, SPIDecoder, SPIFlashDecoder, SquelchFilter, StepGeneratorFilter, SWDDecoder, SWDMemAPDecoder, TachometerFilter, TappedDelayLineFilter, TCPDecoder, TDRFilter, ThresholdFilter, TIEMeasurement, TimeOutsideLevelMeasurement, TMDSDecoder, ToneGeneratorFilter, TopMeasurement, TouchstoneImportFilter, TwoPortShuntThroughFilter, UartClockRecoveryFilter, UARTDecoder, UndershootMeasurement, UnwrappedPhaseFilter, USB2ActivityDecoder, USB2PacketDecoder, USB2PCSDecoder, USB2PMADecoder, VectorFrequencyFilter, VectorPhaseFilter, VerticalBathtub, VICPDecoder, WaveformGenerationFilter, WindowedAutocorrelationFilter, and WindowFilter.

◆ SerializeConfiguration()

YAML::Node FlowGraphNode::SerializeConfiguration ( IDTable table)
virtual

Serializes this trigger's configuration to a YAML string.

Returns
YAML block with this trigger's configuration

Reimplemented in Filter, and Trigger.

◆ SetInput()

void FlowGraphNode::SetInput ( size_t  i,
StreamDescriptor  stream,
bool  force = false 
)

Connects a stream to the input of this node.

Parameters
iIndex of the input port to connect
streamInput data stream
forceForcibly connect this stream without checking to make sure it's the right type. Should only be set true by by Filter::LoadInputs() or in similar specialized situations.

The documentation for this class was generated from the following files: