trkwsPOS_READ_LIST

Section: Devices and Network Interfaces (4)
Updated: 2012-04-23 10:11
Index Return to man pages list
 

NAME

trkwsPOS_READ_LIST - Support class for axes position in LCU db image

 

SYNOPSIS


#include "trkwsPOS_READ_LIST.h"

trkwsPOS_READ_LIST myList(dbPoint,obj,procedure);

 

PARENT CLASS


  public fndOBJECT
  public eccsERROR_CLASS

 

DESCRIPTION


This is a support class used by trkwsPOS_CALC(4) in order to handle new
position events coming from the database image of axis LCUs
This class handle:
   - Attaching and detaching of the callback for handling the "new position" event.
     The LCU image is linked via the scan system to the LCU point containing
     information about axis' position.
     Whenever a new value is written in the LCU, the workstation image is updated.
     An event is attached at construction time to the "timestamp" attribute of the
     LCU image, so that whenever a new value is received, the defined callback
     is executed.
   - Reading values for position from the database and storing them in a circular
     buffer.
     The ReadPosition() method, performs an atomic (multiple read) read of timestamp,
     position and row encoder position from the LCU image and saves these value in the
     next available entry of an internal circualr buffer.
   - Access to the circular buffer.
     The values stored in the circular buffer can be accessed by index via the Select()
     method or for a timestamp to be matched via the Match() method.

Access to data is base on the concept of "selected entry".
The position, encoder position and time stamp for last ring buffer entry selected
by calling ReadPosition(), Match() or Select() are available via the access methods
Position(), PosEncoder() and TimeStamp().

 

PUBLIC METHODS


  trkwsPOS_READ_LIST(const dbSYMADDRESS dbPoint,
           fndOBJECT *obj,
           const evhCB_METHOD procedure);
  virtual ~trkwsPOS_READ_LIST();
     Constructor and destructor.
     The constructor attach the event to the attribute of the dbPoint
     database address defined in trkwsDefines.h as trkwsAXIS_TIMESTAMP_ATTRNAME
     It is assumed that dbPoint is an instance of the dbl class trkwsTRACK_AXIS.
     It also build the list of attributes to be read when ReadPosition() is called.
     Using a dbMultiRead() warranties that consistent values are read.

  ccsCOMPL_STAT     ReadPosition();
     Calls dbMultiRead to atomically read timestamp, position and encoder position
     from the database and stores them on the next entry in the circular buffer.
     Returns FAILURE is the values cannot be read.

  ccsCOMPL_STAT     Match(vltDOUBLE timeStamp, vltDOUBLE maxDifference=0);
     Searches the circular buffer for an entry matching the given time stamp.
     If maxDifference != 0, two values are considered matching is their
     difference is lower than this value.
     If no match exist, returns FAILURE and set the selected values to 0.

  ccsCOMPL_STAT     Select(vltINT32 offset);
     Select from the circular buffer an entry with the given offset (see
     trkwsRING_BUFFER(4) for details).
     If no match exist, returns FAILURE and set the selected values to 0.

  trkwsRING_BUFFER &RingBuffer();
     Returns a reference to the ring buffer.

  evtEVENT         &Evt();
     Returns a reference to the event object

  const char *DbPoint();
     Returns  base point for the LCU image

  vltDOUBLE         Position();
  vltDOUBLE         PosEncoder();
  vltDOUBLE         TimeStamp();
     Return position, encoder position or time stamp for the currently selected
     entry in the ring buffer.

 

PRIVATE DATA MEMBERS


  dbSYMADDRESS     dbPoint;       Base point for the LCU image
  trkwsRING_BUFFER ringBuffer;    The ring buffer (20 entries)
  evtEVENT         evt;           The event handling object

  dbLISTID         listId;        Identifier for CCS multi read list
  vltDOUBLE        position;      Position of the selected entry
  vltDOUBLE        posEncoder;    Encoder position of the selected entry
  vltDOUBLE        timeStamp;     Time stamp of the selected entry

  fndOBJECT          *obj;        Owner object of the callback procedure
  const evhCB_METHOD  procedure;  Callback procedure to execute on event

 

SEE ALSO


trkwsPOS_CALC(4) trkwsRING_BUFFER(4)



 

Index

NAME
SYNOPSIS
PARENT CLASS
DESCRIPTION
PUBLIC METHODS
PRIVATE DATA MEMBERS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 10:11:26 GMT, April 23, 2012