nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
NDS::abi_0::channel Class Reference

Represents a LIGO data channel. More...

#include <nds.hh>

Inheritance diagram for NDS::abi_0::channel:
Inheritance graph
[legend]
Collaboration diagram for NDS::abi_0::channel:
Collaboration graph
[legend]

Classes

class  hash_type
 The hash_type represents a channel hash. The channel hash is an hash of the NDS2 channel list. It can be used by appliations to determine if a channel list has changed. More...
 

Public Types

enum  channel_type {
  CHANNEL_TYPE_UNKNOWN = 0 , CHANNEL_TYPE_ONLINE = ( 1 << 0 ) , CHANNEL_TYPE_RAW = ( 1 << 1 ) , CHANNEL_TYPE_RDS = ( 1 << 2 ) ,
  CHANNEL_TYPE_STREND = ( 1 << 3 ) , CHANNEL_TYPE_MTREND = ( 1 << 4 ) , CHANNEL_TYPE_TEST_POINT = ( 1 << 5 ) , CHANNEL_TYPE_STATIC = ( 1 << 6 )
}
 
enum  data_type {
  DATA_TYPE_UNKNOWN = 0 , DATA_TYPE_INT16 = ( 1 << 0 ) , DATA_TYPE_INT32 = ( 1 << 1 ) , DATA_TYPE_INT64 = ( 1 << 2 ) ,
  DATA_TYPE_FLOAT32 = ( 1 << 3 ) , DATA_TYPE_FLOAT64 = ( 1 << 4 ) , DATA_TYPE_COMPLEX32 , DATA_TYPE_UINT32 = ( 1 << 6 )
}
 Defines the internal data representation. More...
 
typedef double sample_rate_type
 Defines the sample rate type.
 
typedef float signal_gain_type
 Defines the gain type.
 
typedef float signal_slope_type
 Defines the slope type.
 
typedef float signal_offset_type
 Defines the offset type.
 
typedef size_t size_type
 Defines sizes when dealing with channels.
 
typedef std::vector< std::string > channel_names_type
 A vector of channel names.
 

Public Member Functions

DLL_EXPORT channel ()
 Default constructor.
 
DLL_EXPORT channel (const channel &Source)
 Copy constructor.
 
DLL_EXPORT channel (const std::string &Name, channel_type Type, data_type DataType, sample_rate_type SampleRate, signal_gain_type Gain, signal_slope_type Slope, signal_offset_type Offset, std::string Units)
 Create a channel object.
 
DLL_EXPORT const std::string & Name () const
 Return the channel name.
 
DLL_EXPORT std::string NameLong () const
 Return the name with additional information.
 
DLL_EXPORT channel_type Type () const
 Return the type of the channel.
 
DLL_EXPORT data_type DataType () const
 Return the data type of the channel.
 
DLL_EXPORT size_type DataTypeSize () const
 Return the size in bytes of an individual sample from the channel.
 
DLL_EXPORT sample_rate_type SampleRate () const
 Return the sample rate of the channel.
 
DLL_EXPORT signal_gain_type Gain () const
 Return the gain of the channel.
 
DLL_EXPORT signal_slope_type Slope () const
 Return the slope of the channel.
 
DLL_EXPORT signal_offset_type Offset () const
 Return the offset of the channel.
 
DLL_EXPORT const std::string & Units () const
 Return the units of this channel.
 
DLL_EXPORT void swap (channel &Source)
 Swap this channel with another.
 

Static Public Member Functions

static DLL_EXPORT channel_type convert_daq_chantype (int ChanType)
 Convert from the legacy daqd channel types to a channel_type enum.
 
static DLL_EXPORT data_type convert_daq_datatype (int DataType)
 Convert from the legacy daqd data types to a data_type enum.
 
static DLL_EXPORT const std::string & ToString (channel_type ChannelType)
 Return a string representatino of the given channel_type.
 
static DLL_EXPORT const std::string & ToString (data_type DataType)
 Return a string representatino of the given data_type.
 
static DLL_EXPORT bool IsSecondTrend (const std::string &Name)
 Check the channel name to see if it is a second trend.
 
static DLL_EXPORT bool IsMinuteTrend (const std::string &Name)
 Check the channel name to see if it is a minute trend.
 

Static Public Attributes

static DLL_EXPORT const channel_type DEFAULT_CHANNEL_MASK
 The combination of all valid channel types.
 
static DLL_EXPORT const data_type DEFAULT_DATA_MASK
 The combinatino of all valid data types.
 
static DLL_EXPORT const sample_rate_type MIN_SAMPLE_RATE = 0.0f
 Smallest sample rate possible.
 
static DLL_EXPORT const sample_rate_type MAX_SAMPLE_RATE = 1e12f
 Largest sample rate possible.
 

Private Attributes

std::string name
 
channel_type type
 
data_type data
 
sample_rate_type sample_rate
 
signal_gain_type gain
 
signal_slope_type slope
 
signal_offset_type offset
 
std::string units
 

Detailed Description

Represents a LIGO data channel.

A channel encasulates the meta data of LIGO data. It has a name and parameters.

Member Typedef Documentation

◆ channel_names_type

typedef std::vector< std::string > NDS::abi_0::channel::channel_names_type

A vector of channel names.

◆ sample_rate_type

Defines the sample rate type.

◆ signal_gain_type

Defines the gain type.

◆ signal_offset_type

Defines the offset type.

◆ signal_slope_type

Defines the slope type.

◆ size_type

Defines sizes when dealing with channels.

Member Enumeration Documentation

◆ channel_type

The available channel types

Enumerator
CHANNEL_TYPE_UNKNOWN 

Unknown.

CHANNEL_TYPE_ONLINE 

Online channel.

CHANNEL_TYPE_RAW 

Raw channel.

CHANNEL_TYPE_RDS 

Reduced data set.

CHANNEL_TYPE_STREND 

Second trend.

CHANNEL_TYPE_MTREND 

Minute trend.

CHANNEL_TYPE_TEST_POINT 

Test point data.

CHANNEL_TYPE_STATIC 

Static data.

◆ data_type

Defines the internal data representation.

Enumerator
DATA_TYPE_UNKNOWN 

Unkown.

DATA_TYPE_INT16 

16 bit signed integer

DATA_TYPE_INT32 

32 bit signed integer

DATA_TYPE_INT64 

64 bit signed integer

DATA_TYPE_FLOAT32 

32 bit float value

DATA_TYPE_FLOAT64 

64 bit float value

DATA_TYPE_COMPLEX32 

Complex value, two 32 bit floats.

DATA_TYPE_UINT32 

32 bit unsigned integer value

Constructor & Destructor Documentation

◆ channel() [1/3]

NDS::abi_0::channel::channel ( )

Default constructor.

Returns
New instance of a channel object

◆ channel() [2/3]

NDS::abi_0::channel::channel ( const channel Source)
default

Copy constructor.

Parameters
[in]SourceThe object to be copied
Returns
New instance of a channel object

◆ channel() [3/3]

NDS::abi_0::channel::channel ( const std::string &  Name,
channel_type  Type,
data_type  DataType,
sample_rate_type  SampleRate,
signal_gain_type  Gain,
signal_slope_type  Slope,
signal_offset_type  Offset,
std::string  Units 
)

Create a channel object.

The channel object represents a stream a LIGO data.

Parameters
[in]NameThe name of the channel as a string.
[in]TypeThe channel type (RAW, ONLINE, ...).
[in]DataTypeThe data_type that of the channel.
[in]SampleRateRate that the channel was recorded at.
[in]GainGain of the channel.
[in]SlopeSlope of the channel.
[in]OffsetOffset of the channel.
[in]UnitsUnits of the channel as a string.
Returns
New instance of a channel object

Member Function Documentation

◆ convert_daq_chantype()

channel::channel_type NDS::abi_0::channel::convert_daq_chantype ( int  ChanType)
static

Convert from the legacy daqd channel types to a channel_type enum.

Parameters
[in]ChanTypeThe daqd channel type value
Returns
The corresponding channel_type enum

◆ convert_daq_datatype()

channel::data_type NDS::abi_0::channel::convert_daq_datatype ( int  DataType)
static

Convert from the legacy daqd data types to a data_type enum.

Parameters
[in]DataTypeThe daqd data type value
Returns
The corresponding data_type enum

◆ DataType()

channel::data_type NDS::abi_0::channel::DataType ( ) const
inline

Return the data type of the channel.

Returns
A data_type representing the data type of the channel.

◆ DataTypeSize()

channel::size_type NDS::abi_0::channel::DataTypeSize ( ) const
inline

Return the size in bytes of an individual sample from the channel.

Returns
A size_type value giving the size of an individual sample of this channel.

◆ Gain()

channel::signal_gain_type NDS::abi_0::channel::Gain ( ) const
inline

Return the gain of the channel.

Returns
The gain as a signal_gain_type.

◆ IsMinuteTrend()

bool NDS::abi_0::channel::IsMinuteTrend ( const std::string &  Name)
inlinestatic

Check the channel name to see if it is a minute trend.

Parameters
[in]NameA channel name, as a string.
Returns
true if Name ends in ",m-trend", else false.

◆ IsSecondTrend()

bool NDS::abi_0::channel::IsSecondTrend ( const std::string &  Name)
inlinestatic

Check the channel name to see if it is a second trend.

Parameters
[in]NameA channel name, as a string.
Returns
true if Name ends in ",s-trend", else false.

◆ Name()

const std::string & NDS::abi_0::channel::Name ( ) const
inline

Return the channel name.

Returns
The name as a string.

◆ NameLong()

std::string NDS::abi_0::channel::NameLong ( ) const

Return the name with additional information.

Returns
The name, rate, type, and data type as a string.
Remarks
Returns a string such as "<name (sample rate, type, data type)>"

◆ Offset()

channel::signal_offset_type NDS::abi_0::channel::Offset ( ) const
inline

Return the offset of the channel.

Returns
The offset as a signal_offset_type.

◆ SampleRate()

channel::sample_rate_type NDS::abi_0::channel::SampleRate ( ) const
inline

Return the sample rate of the channel.

Returns
The sample rate as a sample_rate_type.

◆ Slope()

channel::signal_slope_type NDS::abi_0::channel::Slope ( ) const
inline

Return the slope of the channel.

Returns
The slope as a signal_slope_type.

◆ swap()

void NDS::abi_0::channel::swap ( channel Source)

Swap this channel with another.

Switches all values of this channel with the input channel Source.

Parameters
[in,out]SourceA channel to swap values with.

◆ ToString() [1/2]

const std::string & NDS::abi_0::channel::ToString ( channel_type  ChannelType)
static

Return a string representatino of the given channel_type.

Parameters
[in]ChannelTypeInput channel type
Returns
A string representing ChannelType

◆ ToString() [2/2]

const std::string & NDS::abi_0::channel::ToString ( data_type  DataType)
static

Return a string representatino of the given data_type.

Parameters
[in]DataTypeInput data type
Returns
A string representing DataType

◆ Type()

channel::channel_type NDS::abi_0::channel::Type ( ) const
inline

Return the type of the channel.

Returns
Returns a channel_type representing the channel type.

◆ Units()

const std::string & NDS::abi_0::channel::Units ( ) const
inline

Return the units of this channel.

Returns
The units as a string.

Member Data Documentation

◆ data

data_type NDS::abi_0::channel::data
private

◆ DEFAULT_CHANNEL_MASK

DLL_EXPORT const channel_type NDS::abi_0::channel::DEFAULT_CHANNEL_MASK
static
Initial value:
=
channel_type
Definition nds_channel.hh:39
@ CHANNEL_TYPE_STATIC
Static data.
Definition nds_channel.hh:47
@ CHANNEL_TYPE_MTREND
Minute trend.
Definition nds_channel.hh:45
@ CHANNEL_TYPE_TEST_POINT
Test point data.
Definition nds_channel.hh:46
@ CHANNEL_TYPE_RDS
Reduced data set.
Definition nds_channel.hh:43
@ CHANNEL_TYPE_STREND
Second trend.
Definition nds_channel.hh:44
@ CHANNEL_TYPE_ONLINE
Online channel.
Definition nds_channel.hh:41
@ CHANNEL_TYPE_RAW
Raw channel.
Definition nds_channel.hh:42

The combination of all valid channel types.

◆ DEFAULT_DATA_MASK

DLL_EXPORT const data_type NDS::abi_0::channel::DEFAULT_DATA_MASK
static
Initial value:
= ( data_type )(
data_type
Defines the internal data representation.
Definition nds_channel.hh:53
@ DATA_TYPE_INT32
32 bit signed integer
Definition nds_channel.hh:56
@ DATA_TYPE_COMPLEX32
Complex value, two 32 bit floats.
Definition nds_channel.hh:60
@ DATA_TYPE_FLOAT64
64 bit float value
Definition nds_channel.hh:59
@ DATA_TYPE_UINT32
32 bit unsigned integer value
Definition nds_channel.hh:62
@ DATA_TYPE_INT16
16 bit signed integer
Definition nds_channel.hh:55
@ DATA_TYPE_FLOAT32
32 bit float value
Definition nds_channel.hh:58
@ DATA_TYPE_INT64
64 bit signed integer
Definition nds_channel.hh:57

The combinatino of all valid data types.

◆ gain

signal_gain_type NDS::abi_0::channel::gain
private

◆ MAX_SAMPLE_RATE

const channel::sample_rate_type NDS::abi_0::channel::MAX_SAMPLE_RATE = 1e12f
static

Largest sample rate possible.

◆ MIN_SAMPLE_RATE

const channel::sample_rate_type NDS::abi_0::channel::MIN_SAMPLE_RATE = 0.0f
static

Smallest sample rate possible.

◆ name

std::string NDS::abi_0::channel::name
private

◆ offset

signal_offset_type NDS::abi_0::channel::offset
private

◆ sample_rate

sample_rate_type NDS::abi_0::channel::sample_rate
private

◆ slope

signal_slope_type NDS::abi_0::channel::slope
private

◆ type

channel_type NDS::abi_0::channel::type
private

◆ units

std::string NDS::abi_0::channel::units
private

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