Documentation
¶
Index ¶
- Constants
- Variables
- type ChannelData
- type Chunk
- type DAQmxFormatChangingScaler
- type DAQmxInputScaler
- type DAQmxRawDataIndex
- func (index *DAQmxRawDataIndex) CheckCompatibility(rawDataIndex RawDataIndex) error
- func (index *DAQmxRawDataIndex) GetArrayDimension() uint32
- func (index *DAQmxRawDataIndex) GetChunkSize() uint64
- func (index *DAQmxRawDataIndex) GetDataType() DataType
- func (index *DAQmxRawDataIndex) GetTotalSizeInBytes() uint64
- func (index *DAQmxRawDataIndex) PopulateScalers(scalers []Scaler)
- type DataType
- type DefaultRawDataIndex
- func (index *DefaultRawDataIndex) CheckCompatibility(rawDataIndex RawDataIndex) error
- func (index *DefaultRawDataIndex) GetArrayDimension() uint32
- func (index *DefaultRawDataIndex) GetChunkSize() uint64
- func (index *DefaultRawDataIndex) GetDataType() DataType
- func (index *DefaultRawDataIndex) GetTotalSizeInBytes() uint64
- func (index *DefaultRawDataIndex) PopulateScalers(scalers []Scaler)
- type File
- type InvalidPathError
- type LeadIn
- type LinearScaler
- type MetaData
- type Node
- type Object
- type ObjectPath
- type RawDataIndex
- type Scaler
- type ScalingStatus
- type Segment
- type SegmentType
- type TableOfContents
- func (toc TableOfContents) BigEndian() bool
- func (toc TableOfContents) DAQmxRawData() bool
- func (toc TableOfContents) InterleavedData() bool
- func (toc TableOfContents) MetaData() bool
- func (toc TableOfContents) NewObjList() bool
- func (toc TableOfContents) RawData() bool
- func (toc TableOfContents) ValueReader() *ValueReader
- type ValueReader
- func (vr *ValueReader) ReadBoolean(r io.Reader) (bool, error)
- func (vr *ValueReader) ReadComplexDoubleFloat(r io.Reader) (complex128, error)
- func (vr *ValueReader) ReadComplexSingleFloat(r io.Reader) (complex64, error)
- func (vr *ValueReader) ReadDAQmxDataType(r io.Reader) (DataType, error)
- func (vr *ValueReader) ReadDataType(r io.Reader) (DataType, error)
- func (vr *ValueReader) ReadDoubleFloat(r io.Reader) (float64, error)
- func (vr *ValueReader) ReadI8(r io.Reader) (int8, error)
- func (vr *ValueReader) ReadI16(r io.Reader) (int16, error)
- func (vr *ValueReader) ReadI32(r io.Reader) (int32, error)
- func (vr *ValueReader) ReadI64(r io.Reader) (int64, error)
- func (vr *ValueReader) ReadSingleFloat(r io.Reader) (float32, error)
- func (vr *ValueReader) ReadString(r io.Reader) (string, error)
- func (vr *ValueReader) ReadTimestamp(r io.Reader) (time.Time, error)
- func (vr *ValueReader) ReadU8(r io.Reader) (uint8, error)
- func (vr *ValueReader) ReadU16(r io.Reader) (uint16, error)
- func (vr *ValueReader) ReadU32(r io.Reader) (uint32, error)
- func (vr *ValueReader) ReadU64(r io.Reader) (uint64, error)
- func (vr *ValueReader) ReadValue(r io.Reader) (any, error)
- func (vr *ValueReader) ReadValueForDataType(r io.Reader, dataType DataType) (any, error)
- func (vr *ValueReader) ReadVoid(r io.Reader) (VoidType, error)
- type VoidType
- type WaveformAttributes
Constants ¶
View Source
const ( DataTypeVoid DataType = iota DataTypeI8 DataTypeI16 DataTypeI32 DataTypeI64 DataTypeU8 DataTypeU16 DataTypeU32 DataTypeU64 DataTypeSingleFloat DataTypeDoubleFloat DataTypeExtendedFloat DataTypeSingleFloatWithUnit = 0x19 DataTypeDoubleFloatWithUnit = 0x1A DataTypeExtendedFloatWithUnit = 0x1C DataTypeString = 0x20 DataTypeBoolean = 0x21 DataTypeTimestamp = 0x44 DataTypeFixedPoint = 0x4f DataTypeComplexSingleFloat = 0x08000c DataTypeComplexDoubleFloat = 0x10000d DataTypeDAQmxRawData = 0xffffffff )
View Source
const ( RawDataIndexTypeSameAsPreviousSegment = 0x00000000 RawDataIndexTypeNoRawData = 0xffffffff RawDataIndexTypeDAQmxFormatChangingScalerType = 0x00001269 RawDataIndexTypeDAQmxDigitalLineScalerType = 0x0000126a )
Variables ¶
View Source
var ( LittleEndianValueReader = NewValueReader(binary.LittleEndian) BigEndianValueReader = NewValueReader(binary.BigEndian) )
Functions ¶
This section is empty.
Types ¶
type ChannelData ¶
type ChannelData struct {
Path string
Node *Node
WaveformAttributes *WaveformAttributes
Samples []float64
}
type Chunk ¶
type Chunk struct {
FileOffset int64
Channels []ChannelData
}
type DAQmxFormatChangingScaler ¶
type DAQmxFormatChangingScaler struct {
// contains filtered or unexported fields
}
func ReadDAQmxFormatChangingScaler ¶
func ReadDAQmxFormatChangingScaler(r io.Reader, valueReader *ValueReader) (*DAQmxFormatChangingScaler, error)
func (*DAQmxFormatChangingScaler) ReadFromBuffer ¶
func (scaler *DAQmxFormatChangingScaler) ReadFromBuffer(vr *ValueReader, buffers [][]byte) (any, error)
func (*DAQmxFormatChangingScaler) Scale ¶
func (scaler *DAQmxFormatChangingScaler) Scale(v any) (float64, error)
func (*DAQmxFormatChangingScaler) ScaleId ¶
func (scaler *DAQmxFormatChangingScaler) ScaleId() uint32
type DAQmxInputScaler ¶
type DAQmxInputScaler interface {
Scaler
ReadFromBuffer(vr *ValueReader, buffers [][]byte) (any, error)
}
type DAQmxRawDataIndex ¶
type DAQmxRawDataIndex struct {
DataType DataType
ArrayDimension uint32
ChunkSize uint64
Scalers []Scaler
RawDataWidths []uint32
}
func ReadDAQmxRawDataIndex ¶
func ReadDAQmxRawDataIndex(r io.Reader, valueReader *ValueReader) (*DAQmxRawDataIndex, error)
func (*DAQmxRawDataIndex) CheckCompatibility ¶
func (index *DAQmxRawDataIndex) CheckCompatibility(rawDataIndex RawDataIndex) error
func (*DAQmxRawDataIndex) GetArrayDimension ¶
func (index *DAQmxRawDataIndex) GetArrayDimension() uint32
func (*DAQmxRawDataIndex) GetChunkSize ¶
func (index *DAQmxRawDataIndex) GetChunkSize() uint64
func (*DAQmxRawDataIndex) GetDataType ¶
func (index *DAQmxRawDataIndex) GetDataType() DataType
func (*DAQmxRawDataIndex) GetTotalSizeInBytes ¶
func (index *DAQmxRawDataIndex) GetTotalSizeInBytes() uint64
func (*DAQmxRawDataIndex) PopulateScalers ¶
func (index *DAQmxRawDataIndex) PopulateScalers(scalers []Scaler)
type DefaultRawDataIndex ¶
type DefaultRawDataIndex struct {
DataType DataType
ArrayDimension uint32
ChunkSize uint64
TotalSizeInBytes uint64
}
func ReadDefaultRawDataIndex ¶
func ReadDefaultRawDataIndex(r io.Reader, valueReader *ValueReader) (*DefaultRawDataIndex, error)
func (*DefaultRawDataIndex) CheckCompatibility ¶
func (index *DefaultRawDataIndex) CheckCompatibility(rawDataIndex RawDataIndex) error
func (*DefaultRawDataIndex) GetArrayDimension ¶
func (index *DefaultRawDataIndex) GetArrayDimension() uint32
func (*DefaultRawDataIndex) GetChunkSize ¶
func (index *DefaultRawDataIndex) GetChunkSize() uint64
func (*DefaultRawDataIndex) GetDataType ¶
func (index *DefaultRawDataIndex) GetDataType() DataType
func (*DefaultRawDataIndex) GetTotalSizeInBytes ¶
func (index *DefaultRawDataIndex) GetTotalSizeInBytes() uint64
func (*DefaultRawDataIndex) PopulateScalers ¶
func (index *DefaultRawDataIndex) PopulateScalers(scalers []Scaler)
type InvalidPathError ¶
func NewInvalidPathError ¶
func NewInvalidPathError(offset int, msg string, args ...any) *InvalidPathError
func NewInvalidPathErrorExpectingRune ¶
func NewInvalidPathErrorExpectingRune(offset int, c rune) *InvalidPathError
func (InvalidPathError) Error ¶
func (err InvalidPathError) Error() string
type LeadIn ¶
type LeadIn struct {
ToC TableOfContents
VersionNumber uint32
NextSegmentOffset uint64
RawDataOffset uint64
}
type LinearScaler ¶
type LinearScaler struct {
// contains filtered or unexported fields
}
func NewLinearScaler ¶
func NewLinearScaler(scaleId uint32, props map[string]any) (*LinearScaler, error)
func (*LinearScaler) ScaleId ¶
func (scaler *LinearScaler) ScaleId() uint32
type MetaData ¶
type MetaData struct {
// contains filtered or unexported fields
}
func NewMetaData ¶
func NewMetaData() *MetaData
func ReadMetaData ¶
func (*MetaData) GetObjectByPath ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) GetChildByName ¶
type Object ¶
type Object struct {
Path string
RawDataIndex RawDataIndex
Properties map[string]any
}
type ObjectPath ¶
func ObjectPathFromString ¶
func ObjectPathFromString(s string) (ObjectPath, error)
func (ObjectPath) IsChannel ¶
func (path ObjectPath) IsChannel() bool
func (ObjectPath) IsGroup ¶
func (path ObjectPath) IsGroup() bool
func (ObjectPath) IsRoot ¶
func (path ObjectPath) IsRoot() bool
func (ObjectPath) String ¶
func (path ObjectPath) String() string
type RawDataIndex ¶
type ScalingStatus ¶
type ScalingStatus string
const ( ScalingStatusUnscaled ScalingStatus = "unscaled" ScalingStatusScaled ScalingStatus = "scaled" )
type Segment ¶
type Segment struct {
Type SegmentType
LeadIn *LeadIn
MetaData *MetaData
Offset int64
}
type SegmentType ¶
type SegmentType string
const ( SegmentTypeTDSm SegmentType = "TDSm" SegmentTypeTDSh SegmentType = "TDSh" )
type TableOfContents ¶
type TableOfContents uint32
func (TableOfContents) BigEndian ¶
func (toc TableOfContents) BigEndian() bool
func (TableOfContents) DAQmxRawData ¶
func (toc TableOfContents) DAQmxRawData() bool
func (TableOfContents) InterleavedData ¶
func (toc TableOfContents) InterleavedData() bool
func (TableOfContents) MetaData ¶
func (toc TableOfContents) MetaData() bool
func (TableOfContents) NewObjList ¶
func (toc TableOfContents) NewObjList() bool
func (TableOfContents) RawData ¶
func (toc TableOfContents) RawData() bool
func (TableOfContents) ValueReader ¶
func (toc TableOfContents) ValueReader() *ValueReader
type ValueReader ¶
type ValueReader struct {
// contains filtered or unexported fields
}
func NewValueReader ¶
func NewValueReader(byteOrder binary.ByteOrder) *ValueReader
func (*ValueReader) ReadBoolean ¶
func (vr *ValueReader) ReadBoolean(r io.Reader) (bool, error)
func (*ValueReader) ReadComplexDoubleFloat ¶
func (vr *ValueReader) ReadComplexDoubleFloat(r io.Reader) (complex128, error)
func (*ValueReader) ReadComplexSingleFloat ¶
func (vr *ValueReader) ReadComplexSingleFloat(r io.Reader) (complex64, error)
func (*ValueReader) ReadDAQmxDataType ¶
func (vr *ValueReader) ReadDAQmxDataType(r io.Reader) (DataType, error)
ReadDAQmxDataType reads a DAQmx data type. See https://github.com/adamreeve/npTDMS/blob/207463192d9fe59af43a41a3b9dc93d522384941/nptdms/daqmx.py#L321-L334
func (*ValueReader) ReadDataType ¶
func (vr *ValueReader) ReadDataType(r io.Reader) (DataType, error)
func (*ValueReader) ReadDoubleFloat ¶
func (vr *ValueReader) ReadDoubleFloat(r io.Reader) (float64, error)
func (*ValueReader) ReadSingleFloat ¶
func (vr *ValueReader) ReadSingleFloat(r io.Reader) (float32, error)
func (*ValueReader) ReadString ¶
func (vr *ValueReader) ReadString(r io.Reader) (string, error)
func (*ValueReader) ReadTimestamp ¶
func (*ValueReader) ReadValueForDataType ¶
type WaveformAttributes ¶
type WaveformAttributes struct {
StartTime time.Time
StartOffset float64
Increment float64
Samples int
Unit string
UnitDescription string
}
func GetWaveformAttributes ¶
func GetWaveformAttributes(props map[string]any) (*WaveformAttributes, error)
func (WaveformAttributes) SampleRate ¶
func (waveformAttributes WaveformAttributes) SampleRate() float64
Source Files
¶
Click to show internal directories.
Click to hide internal directories.