nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Enumerations | Functions
trench.h File Reference
#include "channel.h"
#include "sys/types.h"
Include dependency graph for trench.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  trench_struct
 NDS2 trend channel specification. More...
 

Enumerations

enum  trench_type {
  trch_base, trch_mean, trch_rms, trch_min,
  trch_max, trch_n
}
 

Functions

DLL_EXPORT int trench_cmp_base (struct trench_struct *t, const char *s)
 Compare string to channel base name. More...
 
DLL_EXPORT void trench_destroy (struct trench_struct *t)
 Release parsed data storage. More...
 
DLL_EXPORT daq_data_t trench_dtype (struct trench_struct *t, daq_data_t rawtype)
 
DLL_EXPORT void trench_infer_chan_info (struct trench_struct *t, enum chantype ctype, double rate, daq_data_t rawtype)
 
DLL_EXPORT void trench_init (struct trench_struct *t)
 
DLL_EXPORT void trench_parse (struct trench_struct *tch, const char *str)
 Parse a channel name. More...
 

Enumeration Type Documentation

Trend sub-channel types.

Enumerator
trch_base 
trch_mean 
trch_rms 
trch_min 
trch_max 
trch_n 

Function Documentation

DLL_EXPORT int trench_cmp_base ( struct trench_struct t,
const char *  s 
)

Compare string to channel base name.

Compare the base string of a parsed channel name to the specified string. If the parsed channel name is a simple (non-trend) channel, the argument string is compared o the full channel name. If the parsed channel name has a sub-channel suffix (i.e the channel is a trend), the argument string is compared to the base channel name.

Parameters
tParsed channel name structure pointer.
sPointer to comparison string..
Returns
An integer greater, equal or less than zer depending on whether th parsed base string is greater, equal or less than s.
DLL_EXPORT void trench_destroy ( struct trench_struct t)

Release parsed data storage.

Release internal storage for a parsed channel name.

Parameters
tParsed channel name structure pointer.
DLL_EXPORT daq_data_t trench_dtype ( struct trench_struct t,
daq_data_t  rawtype 
)

Infer the data type from the the channel type and sub-channel ID.

Parameters
tParsed channel name structure pointer.
rawtypeData type of raw channel.
Returns
Inferred data type.
DLL_EXPORT void trench_infer_chan_info ( struct trench_struct t,
enum chantype  ctype,
double  rate,
daq_data_t  rawtype 
)

Infer channel information from the (parsed) channel name and the specified channel type, rate and data type.

Parameters
tParsed channel name structure pointer.
ctypeDefault channel type.
rateRaw data type.
rawtypeData type of raw channel.
DLL_EXPORT void trench_init ( struct trench_struct t)

Initialize the trench structure. THe name string is set to NULL, the channel and data types are set to unkown, the channel sub-type field is set to trch_base and the rate is set to zero.

Parameters
tParsed channel name structure pointer.
DLL_EXPORT void trench_parse ( struct trench_struct tch,
const char *  str 
)

Parse a channel name.

Parse a channel specifier.

Parameters
tchParsed channel name structure pointer.
strString to be parsed.