Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CompositeMonitorPoint< C > Class Template Reference

#include <composite_monitor_point.h>

Inheritance diagram for CompositeMonitorPoint< C >:

MonitorPoint List of all members.

Detailed Description

template<class C>
class CompositeMonitorPoint< C >

A MonitorPoint whose value is derived from other MonitorPoints.

The value is determined by a custom calculator class which must be implemented to suit each type of calculation. The calculator class is passed as a template parameter when a CompositeMonitorPoint is instantiated.

Author:
Simon Hoyle
Date:
Sept 2005
Version:
1.0

Definition at line 26 of file composite_monitor_point.h.

Public Types

enum  { NONE, DATASET, GPIB }
typedef double(* LinearFunc )(double)

Public Member Functions

void add (LinearFunc l)
 CompositeMonitorPoint (const char *name, C *calc)
 Constructor.
CommsDevicegetCommsDev ()
const char * getFormat ()
const char * getFormattedVal ()
float getFval ()
virtual const char * getID ()
int getInterval ()
int getIval ()
float getLowerLimit ()
const char * getMaxTime ()
float getMaxVal ()
const char * getMinTime ()
float getMinVal ()
int getPrimaryAddress ()
int getRefNum ()
CommsDevice::State getState ()
 Overrides base class method.
int getStatus ()
const char * getTimestamp ()
const char * getUnits ()
float getUpperLimit ()
bool hasExceededLowerLimit ()
bool hasExceededUpperLimit ()
virtual bool hasID (const char *id)
void init (Dataset::Op_t dsOp, Dataset::Cat_t dsCat, int dsAddr, int ptAddr, char *format, int interval, bool enabled, char *desc)
int init (const char *dbLine)
void init (char *format, int interval, bool enabled, char *desc)
 Initialiser.
int initComms ()
 Overrides base class method.
bool isEnabled ()
void prependID (const char *str)
int read (float *val)
 Reads the CompositeMonitorPoint.
int read (int *val)
 Overrides base class method.
const char * read (const char *id)
 Reads the CompositeMonitorPoint.
const char * read ()
 Reads the CompositeMonitorPoint.
void setDebug (bool onOff)
 Enables/disables printing of debug statements for a single object.
void setEnabled (bool onOff)
void setLimits (float lower, float upper)
void setOffset (float offset)
void setScale (float scale)

Static Public Member Functions

static void setDebugAll (bool onOff)
 A method to enable/disable printing of debug statements for a single object.

Protected Member Functions

void checkLimits (float fval)
int parseDbLine (const char *dbLine)
void printDbParams ()

Protected Attributes

int commDevType
CommsDevicecommsDev
DbParams dbp
float fval
int ival
LinearFunc lineariser
bool lowerLimitReached
int mask
char maxTime [15]
float maxVal
char minTime [15]
float minVal
int primaryAddr
 A method to enable/disable printing of debug statements for the class.
time_t readTime
char response [120]
int secondaryAddr
char timestamp [15]
bool upperLimitReached
char valStr [30]


Constructor & Destructor Documentation

template<class C>
CompositeMonitorPoint< C >::CompositeMonitorPoint const char *  name,
C *  calc
[inline]
 

Constructor.

Parameters:
name A short identifier.
calc A custom calculator.

Definition at line 39 of file composite_monitor_point.h.


Member Function Documentation

template<class C>
CommsDevice::State CompositeMonitorPoint< C >::getState  )  [inline, virtual]
 

Overrides base class method.

Returns:
Always ONLINE as a CompositeMonitorPoint has no CommsDevice.

Reimplemented from MonitorPoint.

Definition at line 138 of file composite_monitor_point.h.

template<class C>
void CompositeMonitorPoint< C >::init char *  format,
int  interval,
bool  enabled,
char *  desc
[inline]
 

Initialiser.

Must be called before other methods.

Parameters:
format A format string to apply to the value when printed.
interval The monitor interval in seconds.
enabled Flag to enable/disable automatic read every interval.
desc A short sentence description of the CompositeMonitorPoint.

Definition at line 50 of file composite_monitor_point.h.

References MonitorPoint::commDevType, MonitorPoint::dbp, and MonitorPoint::printDbParams().

template<class C>
int CompositeMonitorPoint< C >::initComms  )  [inline, virtual]
 

Overrides base class method.

Method is a no-op in this class as there is no CommsDevice.

Reimplemented from MonitorPoint.

Definition at line 72 of file composite_monitor_point.h.

template<class C>
int CompositeMonitorPoint< C >::read float *  val  )  [inline, virtual]
 

Reads the CompositeMonitorPoint.

Parameters:
val Output parameter for the CompositeMonitorPoint value.
Returns:
Zero for success or a negative error code from the calculator.

Reimplemented from MonitorPoint.

Definition at line 127 of file composite_monitor_point.h.

References MonitorPoint::fval.

template<class C>
int CompositeMonitorPoint< C >::read int *  val  )  [inline, virtual]
 

Overrides base class method.

Method is a no-op in this class as CompositeMonitorPoint values are analog.

Returns:
Always zero.

Reimplemented from MonitorPoint.

Definition at line 120 of file composite_monitor_point.h.

template<class C>
const char* CompositeMonitorPoint< C >::read const char *  id  )  [inline, virtual]
 

Reads the CompositeMonitorPoint.

Parameters:
id A short identifier. Must match the name supplied to the constructor.
Returns:
A string in a format suitable for transmission by a CmdServer.

Reimplemented from MonitorPoint.

Definition at line 92 of file composite_monitor_point.h.

References MonitorPoint::dbp, MonitorPoint::fval, MonitorPoint::hasID(), MonitorPoint::response, MonitorPoint::timestamp, and MonitorPoint::valStr.

template<class C>
const char* CompositeMonitorPoint< C >::read  )  [inline, virtual]
 

Reads the CompositeMonitorPoint.

Returns:
A string in a format suitable for transmission by a DumpServer.

Reimplemented from MonitorPoint.

Definition at line 78 of file composite_monitor_point.h.

References MonitorPoint::dbp, MonitorPoint::fval, MonitorPoint::response, and MonitorPoint::timestamp.


The documentation for this class was generated from the following file:
Generated on Mon Apr 30 13:32:42 2007 for Parkes M & C - PKMC C++ library API by  doxygen 1.4.4