nitypes.waveform.DigitalWaveformSignal

class nitypes.waveform.DigitalWaveformSignal(owner: nitypes.waveform.DigitalWaveform[nitypes.waveform.typing.TDigitalState], signal_index: SupportsIndex, column_index: SupportsIndex | None = None)

Bases: Generic[nitypes.waveform.typing.TDigitalState]

A signal of a digital waveform.

To construct this object, use the DigitalWaveform.signals property and index the returned collection, e.g. waveform.signals[0] or waveform.signals["Dev1/port0/line0"].

Parameters:
__slots__ = ['_owner', '_signal_index', '_column_index', '__weakref__']
property owner: nitypes.waveform.DigitalWaveform[nitypes.waveform.typing.TDigitalState]

The waveform that owns this signal.

Return type:

nitypes.waveform.DigitalWaveform[nitypes.waveform.typing.TDigitalState]

property signal_index: int

The signal’s position in the DigitalWaveform.signals collection (0-based).

Return type:

int

property column_index: int

The signal’s position in the DigitalWaveform.data array’s second dimension (0-based).

This index is used to access the signal’s data within the waveform’s data array: waveform.data[:, column_index].

Note: The column_index is reversed compared to the signal_index. column_index 0 (the leftmost column) corresponds to the highest signal_index and highest line number. The highest column_index (the rightmost column) corresponds to signal_index 0 and line 0. This matches industry conventions where line 0 is the LSB and appears as the rightmost bit.

Return type:

int

property data: numpy.typing.NDArray[nitypes.waveform.typing.TDigitalState]

The signal data, indexed by sample.

Return type:

numpy.typing.NDArray[nitypes.waveform.typing.TDigitalState]

property name: str

The signal name.

Return type:

str

__eq__(value: object, /) bool

Return self==value.

Parameters:

value (object)

Return type:

bool

__reduce__() tuple[Any, Ellipsis]

Return object state for pickling.

Return type:

tuple[Any, Ellipsis]

__repr__() str

Return repr(self).

Return type:

str