class Dacc : public DaccIn

LIGO Sandbox data access class.

Inheritance:


Public Methods

Dacc(void)
Default (Null) constructor
explicit Dacc(const char* Source, const Time& start=Time(0))
Construct and connect to source
explicit Dacc(Freader* reader)
Construct using an already allocated frame reader
~Dacc(void)
Destructor
void setBuffer(int N)
Set the DaccIn Buffer count.
void setDebug(int N)
Set the debug flag.
void setNoWait(bool now=true)
Set the noWait flag.
void setStride(float Dt)
Define the default Stride.
void addChannel(const char* Name, int Decimate=0, TSeries **TSptr=0)
Add a channel to the request list.
void rmChannel(const char* Name)
Remove a channel from the request list.
int flush(Interval Stride=Interval(0.0))
Skip data.
int fillData(Interval Stride=Interval(0.0), bool start=true)
Fill the requested TSeries.
void zeroChans(Interval Dt)
Reset channel TSeries.
int fillChans(Interval Offset, Interval Dt)
Fill the requested TSeries from a single frame.
int seek(Time STime=Time(0.0))
Skip to the specified time.
int synch(void)
Synchronize the current frame buffer.
Time getCurrentTime(void) const
Get the Current time.
int getDebug(void)
Get the debug flag.
Time getFillTime(void) const
Get the Start time.
Interval getOffset(void) const
Get the current offset into the frame.
Interval getStride(void) const
Get the stride interval.
bool isChannelRead(const char* Name) const
Test if channel was requested.
ostream& list(ostream& out) const
List requested channels.
const TSeries* refData(const char* name) const
Get a pointer to the data.

Inherited from DaccIn:

Public Methods

void addFile(const char* File)
void close(void)
int open(void)
void endFrame(void)
int nextFrame(void)
Interval getDt(void) const
const char* getFile(void) const
const FrameH* getFrame(void) const
string getFrameID(void)
Time getTime(void) const
bool haveFrame(void) const
bool isOnline(void) const
ostream& listFiles(ostream& out) const
bool waitData(bool test_only=false) const
const FrameCPP::AdcData* findAdc(const std::string& name) const
const FrameCPP::AdcData* nextAdc(const std::string& name) const

Documentation

Dacc methods are used to access individual data channels from frames. By decoupling the data access from the frame structure, Dacc relieves the Sandbox user from writing frame catination code, etc. The input data are unpacked by Dacc into the TSeries objects.
Dacc(void)
Default (Null) constructor

explicit Dacc(const char* Source, const Time& start=Time(0))
Construct and connect to source

explicit Dacc(Freader* reader)
Construct using an already allocated frame reader

~Dacc(void)
Destructor

void setBuffer(int N)
Set the DaccIn Buffer count.

void setDebug(int N)
If the debug flag is set, explanatory messages will be printed when an error is encountered.

void setNoWait(bool now=true)
Set the noWait flag as specified. If noWait is set, the DaccIn methods that may result in waiting for data to arrive in an online partition fillData

void setStride(float Dt)
The default stride is used if a time interval is not specified when fillData() is invoked.

void addChannel(const char* Name, int Decimate=0, TSeries **TSptr=0)
The specified channel is added to the list of channels to be processed by fillData. A channel may be included in the list only once. Subsequent calls to addChannel will replace the original request. TSptr is used by the calling program to access the data. If the pointer address is NULL or not specified, an internal pointer is allocated, and the channel is accessed exclusively with the refData method. The TSeries is then created and destroyed under Dacc control. If the pointer address is specified a non-zero pointer indicates a pre-allocated TSeries. If the pointer is NULL no TSeries is pre-allocated and the TSeries will be created when fillData is invoked. Note that if the TSeries is not preallocated, the TSeries data vector will have the same data type as the channel data (usually short). Decimate gives the number of samples to be averaged together before they are entered into the TSeries. If Decimate <= 0, it is set to 1. If no TSeries is passed to fillData and the Decimation > 1, a float data vector is allocated.
Parameters:
Name - Name of channel to collect data from.
Decimate - Decimation factor.
TSptr - Address of TSeries pointer.

void rmChannel(const char* Name)
The named channel is removed from the request list.

int flush(Interval Stride=Interval(0.0))
The data pointer for the frame currently in memory is incremented past the specified time. If the interval is not specified, negative or zero, the rest of the data in the current frame are skipped. If a discontinuity in the frame times is found, flush stops skipping at the start of the new data segment.
Returns:
Non-zero if an end of file is found.
Parameters:
Stride - Time interval to be skipped.

int fillData(Interval Stride=Interval(0.0), bool start=true)
Data from channels specified by addChannel() are copied to TSeries objects.
Returns:
0 Successful completion
-1 Frame start not contiguous to previous data
-2 Sample rate isn't compatible with previous data.
-3 Requested data not found in current frame
-4 Error reading frame
-5 Frame data are not self-consistent.
-6 TSeries is not allocated.
-7 Unsupported data type
-8 Signal received while reading
Parameters:
Stride - Time interval to be read in.
start - Start a stride.

void zeroChans(Interval Dt)
Zero all TSeries in the channel list. Allocate sufficient memory to hold the given sample time.
Parameters:
Dt - Time interval to be used in allocating memory.

int fillChans(Interval Offset, Interval Dt)
Fill the requested TSeries from a single frame.
Returns:
0 Successful completion
-1 Frame start not contiguous to previous data
-2 Sample rate isn't compatible with previous data.
-3 Requested data not found in current frame
-4 Error reading frame
-5 Frame data are not self-consistent.
-6 TSeries is not allocated.
-7 Unsupported data type
Parameters:
Offset - Offset of start of data from start of fram.
Dt - Time interval to be read in.

int seek(Time STime=Time(0.0))
Frames are read from the specified input file(s) until one containing the specified time is found.
Returns:
Zero if open was successful.

int synch(void)
The frame that will provide the data for the next read operation is read into memory.
Returns:
Zero if successful or -1 if unable to read in a frame.

Time getCurrentTime(void) const
Returns the current data collection time.

int getDebug(void)
Returns the level of debug information that was requested.
Returns:
Debug print level.

Time getFillTime(void) const
Returns the time at which data collection is to start.

Interval getOffset(void) const
Returns an offset of the current point in the frame.

Interval getStride(void) const
Returns the time interval over which data are collected.

bool isChannelRead(const char* Name) const
Test to see is the names channel has been requested..
Returns:
True if the specified channel has been requested.
Parameters:
Name - Channel name to be tested.

ostream& list(ostream& out) const
A formatted list of requested channels, their decimation factors, and latest time copied is printed to the specified output stream.

const TSeries* refData(const char* name) const
Returns a pointer to the last TSeries filled for the named channel.


This class has no child classes.
Author:
John G. Zweizig
Version:
1.6; Last modified June 15, 2001

alphabetic index hierarchy of classes


generated by doc++