nds2-client - ClientDeveloper  0.16.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
trench.c File Reference
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <io.h>
#include "daqc.h"
#include "trench.h"
#include "nds_os.h"
Include dependency graph for trench.c:

Functions

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

Function Documentation

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.
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.
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.
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.
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.
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.