nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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. More...
 
typedef float signal_gain_type
 Defines the gain type. More...
 
typedef float signal_slope_type
 Defines the slope type. More...
 
typedef float signal_offset_type
 Defines the offset type. More...
 
typedef size_t size_type
 Defines sizes when dealing with channels. More...
 
typedef std::vector< std::string > channel_names_type
 A vector of channel names. More...
 

Public Member Functions

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

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

Static Public Attributes

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

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

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

A vector of channel names.

Defines the sample rate type.

Defines the gain type.

Defines the offset type.

Defines the slope type.

Defines sizes when dealing with channels.

Member Enumeration Documentation

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.

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

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

Default constructor.

Returns
New instance of a channel object
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
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

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
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
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.
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.
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.
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.
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.
const std::string & NDS::abi_0::channel::Name ( ) const
inline

Return the channel name.

Returns
The name as a string.
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)>"
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.
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.
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.
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.
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
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
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.
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_type NDS::abi_0::channel::data
private
DLL_EXPORT const channel_type NDS::abi_0::channel::DEFAULT_CHANNEL_MASK
static
DLL_EXPORT const data_type NDS::abi_0::channel::DEFAULT_DATA_MASK
static
Initial value:

The combinatino of all valid data types.

signal_gain_type NDS::abi_0::channel::gain
private
const channel::sample_rate_type NDS::abi_0::channel::MAX_SAMPLE_RATE = 1e12f
static

Largest sample rate possible.

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

Smallest sample rate possible.

std::string NDS::abi_0::channel::name
private
signal_offset_type NDS::abi_0::channel::offset
private
sample_rate_type NDS::abi_0::channel::sample_rate
private
signal_slope_type NDS::abi_0::channel::slope
private
channel_type NDS::abi_0::channel::type
private
std::string NDS::abi_0::channel::units
private

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