In file diagtest.h:

class diagtest : public testenvironment

Abstract class for diagnostics tests.

Inheritance:


Public Methods

static double measurementTime (double duration, double cycles, double f, bool roundup = true)
Calculate measurement time.
static double adjustForSampling (double t, double dt)
Adjust for sampling.
static tainsec_t fineAdjustForSampling (tainsec_t t, double dt)
Fine adjust for sampling.
explicit diagtest (const string& Name)
Default constructor.
virtual ~diagtest ()
Destructor.
virtual diagtest* self () const
Diagnostics test object creation function.
virtual string name () const
Name of diagnostics test class.
virtual bool init (diagStorage& Storage, const cmdnotify& Notify, rtddManager& RTDDMgr, excitationManager& EnvExc, excitationManager& TestExc, int KeepTraces, bool rtMode = true)
Initialization method.
virtual void setStep (int Step, int resindex)
Set step method.
virtual int getResultNumber ()
Get next result index method.
virtual bool begin (std::ostringstream& errmsg)
Startup method.
virtual bool end (std::ostringstream& errmsg)
Cleanup method.
virtual bool setup (std::ostringstream& errmsg, tainsec_t starttime, syncpointer& sync)
Setup method.
virtual bool readEnvironment ()
Read environment.

Protected Fields

mutable recursivemutex mux
Mutex to protect test iterator
string myname
Name of test
cmdnotify notify
Command notification object
diagStorage* storage
Pointer to diagnostic storage object
rtddManager* rtddMgr
Pointer to test point management object
excitationManager* testExc
Pointer to excitation manager for test channels
bool RTmode
Real-time mode
int step
test iteration step
int rindex
first index to be used for saving results
int rnumber
number of result records saved
int keepTraces
keep the original time traces?

Inherited from testenvironment:

Public Classes

class environment
int num
array index of Env[]
bool active
active flag
string channel
channel name
string waveform
string describing waveform
std::vector <float> points
points of arbitrary waveform
double wait
settling time
environment()
Default constructor
environment(const environment& env)
Copy constructor

Public Fields

typedef std::vector <environment> environmentlist

Public Methods

virtual void setEnvironmentExcitationManager( excitationManager* excmgr)
virtual bool subscribeEnvironment(std::ostringstream& errmsg)
virtual double waitEnvironment() const
virtual bool startEnvrionment(tainsec_t starttime = 0, tainsec_t timeout = -1)
virtual bool stopEnvrionment(tainsec_t timeout = -1)
virtual bool clearEnvrionment(tainsec_t timeout = -1)

Protected Fields

mutable recursivemutex envmux
excitationManager* envexc
environmentlist envlist

Documentation

This abstract class implements the basic functionality of a diagnostics test. Every diagnostics test class must be derived from this one. It implements abstract methods to query the name, get the excitation channels, get the measurement time intervals and the analysis algorithms.

The public interface of this object is multi-thread safe.

static double measurementTime(double duration, double cycles, double f, bool roundup = true)
Calculates the measurement time for a periodic function. This function returns the minimum of duration and cycles/f. A negative duration or cycle count is ignored. Optionally, the measurement time can be rounded up to the next cycle count.
Returns:
measurement time or <0 on error
Parameters:
duration - duration in sec
cyclces - number of cycles
f - frequency of periodic function
roundup - if true round up to the next cycle

static double adjustForSampling(double t, double dt)
Assuming dt specifies the sampling period of interest, this funciton returns a time interval which is rounded up to the next integer multiple of the sampling period.
Returns:
rounded time or <0 on error
Parameters:
t - time in sec
dt - sampling period in sec

static tainsec_t fineAdjustForSampling(tainsec_t t, double dt)
Assuming dt specifies the sampling period of interest, this funciton returns a GPS time value which is rounded up to the next integer multiple of the sampling period.
Returns:
rounded GPS time or <0 on error
Parameters:
t - time in GPS nsec
dt - sampling period in sec

explicit diagtest(const string& Name)
Constructs an abstract diagnostics object by setting the reference pointer to the storage object.
Returns:
void

virtual ~diagtest()
Destructs the abstract diagnostics object.
Returns:
void

virtual diagtest* self() const
A pure virtual function which returns a new diagnostics test object of the same type as the current one. Must be overwritten by descendent objects. This function together with the name function is used by the diagnostics test pointer object to automatically create a diagnostics test object from a storage object.
Returns:
new diagnotsics test object

virtual string name() const
A function which returns a unique name describing the type of diagnostics test represented by this object.
Returns:
name of diagnotsics test class

virtual bool init(diagStorage& Storage, const cmdnotify& Notify, rtddManager& RTDDMgr, excitationManager& EnvExc, excitationManager& TestExc, int KeepTraces, bool rtMode = true)
Initializes the test. Sets the storage pointer, the command notification object and the excitation manager pointers for the environment and the test signals; calls the begin function.
Returns:
true if successful
Parameters:
Storage - diagnostics storage object
Notify - command notification object
EnvExc - excitation manager for environment
TestExc - excitation manager for test signals
KeepTraces - do we keep the original time traces
rtMode - Real-time mode if true (old data otherwise)

virtual void setStep(int Step, int resindex)
Sets the test iteration step.
Parameters:
Step - new test iteration step
resindex - first index to be used for result

virtual int getResultNumber()
Gets the next free index into the result array. This function only returns a valid value after calls to setStep and setup have been completed.
Returns:
next free index

virtual bool begin(std::ostringstream& errmsg)
Begin of test. This function should be overwritten by descendents for initialization (read parameters from storage object and subscribe to channels).
Returns:
true if successful
Parameters:
errmsg - error message stream

virtual bool end(std::ostringstream& errmsg)
End of test. This function should be overwritten by descendents for clean up (unsubscribe channels).
Returns:
true if successful
Parameters:
errmsg - error message stream

virtual bool setup(std::ostringstream& errmsg, tainsec_t starttime, syncpointer& sync)
Sets up the test. This function should be overwritten by descendents set excitation and measurement channels. This funciton may adjust the start time if necessary. In general starting a test later is always supported, whereas starting it earlier might not be possible.
Returns:
true if successful
Parameters:
errmsg - error message stream
starttime - start time of test
sync - synchronization point (return)

virtual bool readEnvironment()
A function which reads the enviroment of a test. Implements only a dummy; must be overwritten by descendents in order to implement a real environment.
Returns:
true if successful

mutable recursivemutex mux
Mutex to protect test iterator

string myname
Name of test

cmdnotify notify
Command notification object

diagStorage* storage
Pointer to diagnostic storage object

rtddManager* rtddMgr
Pointer to test point management object

excitationManager* testExc
Pointer to excitation manager for test channels

bool RTmode
Real-time mode

int step
test iteration step

int rindex
first index to be used for saving results

int rnumber
number of result records saved

int keepTraces
keep the original time traces?


Direct child classes:
stdtest
Author:
DS, November 98
See Also:
Diagnostics Management

alphabetic index hierarchy of classes


Please send questions and comments to sigg_d@ligo-wa.caltech.edu


generated by doc++