nexxT.filters.GenericReader module
This module provides a generic reader which can be inherited to use new data formats inside nexxT.
- class nexxT.filters.GenericReader.GenericReader(env)[source]
Bases:
FilterGeneric harddisk reader which can be used as base class for implementing readers for custom file formats. To create a new input file reader, inherit from this class and reimplement getNameFilter(…) and openFile(…). openFile(…) shall return an instance of an implementation of the interface GenericReaderFile.
See
nexxT.filters.hdf5.Hdf5Readerfor an example.- __init__(env)[source]
Filter Constructor.
- Parameters:
dynInPortsSupported – Flag whether this filter supports dynamic input ports
dynOutPortsSupported – Flag whether this filter supports dynamic output ports
environment – FilterEnvironment instance which shall be passed through from the filter constructor.
- currentTimestampChanged
- getNameFilter()[source]
Returns the name filter associated with the input files.
- Returns:
a list of strings, e.g. [”.h5”, “.hdf5”]
- openFile(filename)[source]
Opens the given file and return an instance of GenericReaderFile.
- Returns:
an instance of GenericReaderFile
- playbackPaused
- playbackStarted
- seekTime(timestamp)[source]
slot called to go to the specified time
- Parameters:
timestamp – a timestamp in nanosecond resolution
- Returns:
- sequenceOpened
- setSequence(filename)[source]
slot called to set the sequence file name
- Parameters:
filename – a string instance
- Returns:
- setTimeFactor(factor)[source]
slot called to set the time factor
- Parameters:
factor – a float
- Returns:
- staticMetaObject = PySide6.QtCore.QMetaObject("GenericReader" inherits "Filter": Methods: #4 type=Signal, signature=playbackStarted() #5 type=Signal, signature=playbackPaused() #6 type=Signal, signature=sequenceOpened(QString,qlonglong,qlonglong,QVariantList), parameters=QString, qlonglong, qlonglong, QVariantList #7 type=Signal, signature=currentTimestampChanged(qlonglong), parameters=qlonglong #8 type=Signal, signature=timeRatioChanged(double), parameters=double )
- stepBackward(stream)[source]
slot called to step one frame in stream backward
- Parameters:
stream – a string instance or None (all streams are selected)
- Returns:
- stepForward(stream)[source]
slot called to step one frame in stream forward
- Parameters:
stream – a string instance or None (all streams are selected)
- Returns:
- timeRatioChanged
- class nexxT.filters.GenericReader.GenericReaderFile[source]
Bases:
objectInterface for adaptations of new file formats.
For supporting new file formats, inherit from this class and overwrite all of the methods listed here. The constructor of the inherited class usually takes a filename argument. Inherit also from GenericReader to provide a new Filter class and overwrite the methods getNameFilter and openFile, which returns an instance of the GenericReaderFile implementation.
See
nexxT.filters.hdf5.Hdf5FileandnexxT.filters.hdf5.Hdf5Readerfor an example.- getNumberOfSamples(stream)[source]
Returns the number of samples in the given stream
- Parameters:
stream – the name of the stream as a string
- Returns:
the number of samples in the stream
- getRcvTimestamp(stream, streamIdx)[source]
Returns the recevie timestamp of the given (stream, streamIdx) sample. The default implementation uses readSample(…). It may be replaced by a more efficient implementation.
- Parameters:
stream – the name of the stream as a string
streamIdx – the stream index as an integer
- Returns:
the timestamp as an integer (see also getTimestampResolution)