nds2-client - ClientUser
0.16.8
|
Represents a LIGO data channel. More...
#include <nds.hh>
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. 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. | |
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. | |
Represents a LIGO data channel.
A channel encasulates the meta data of LIGO data. It has a name and parameters.
The available channel types
Defines the internal data representation.
NDS::abi_0::channel::channel | ( | ) |
Default constructor.
|
default |
Copy constructor.
[in] | Source | The object to be copied |
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.
[in] | Name | The name of the channel as a string. |
[in] | Type | The channel type (RAW, ONLINE, ...). |
[in] | DataType | The data_type that of the channel. |
[in] | SampleRate | Rate that the channel was recorded at. |
[in] | Gain | Gain of the channel. |
[in] | Slope | Slope of the channel. |
[in] | Offset | Offset of the channel. |
[in] | Units | Units of the channel as a string. |
|
static |
Convert from the legacy daqd channel types to a channel_type enum.
[in] | ChanType | The daqd channel type value |
|
static |
Convert from the legacy daqd data types to a data_type enum.
[in] | DataType | The daqd data type value |
|
inline |
Return the data type of the channel.
|
inline |
Return the size in bytes of an individual sample from the channel.
|
inline |
Return the gain of the channel.
|
inlinestatic |
Check the channel name to see if it is a minute trend.
[in] | Name | A channel name, as a string. |
|
inlinestatic |
Check the channel name to see if it is a second trend.
[in] | Name | A channel name, as a string. |
|
inline |
Return the channel name.
std::string NDS::abi_0::channel::NameLong | ( | ) | const |
Return the name with additional information.
|
inline |
Return the offset of the channel.
|
inline |
Return the sample rate of the channel.
|
inline |
Return the slope of the channel.
void NDS::abi_0::channel::swap | ( | channel & | Source | ) |
Swap this channel with another.
Switches all values of this channel with the input channel Source.
[in,out] | Source | A channel to swap values with. |
|
static |
Return a string representatino of the given channel_type.
[in] | ChannelType | Input channel type |
|
static |
Return a string representatino of the given data_type.
[in] | DataType | Input data type |
|
inline |
Return the type of the channel.
|
inline |
Return the units of this channel.