OCSEPICS
Class StatusVariable

java.lang.Object
  extended by java.util.TimerTask
      extended by OCSEPICS.StatusVariable
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ProcessVariable

public class StatusVariable
extends java.util.TimerTask

This is a base class which will be inherited by all status variables which are to be included in the observing system and passed around.

Version:
1.0
Author:
Craige Bevil

Field Summary
protected  OCSCORBAHelper OCSCorba
          An instance of the OCS CORBA helper which will be used to facilitate CORBA related activities
protected  FourMS.FourMSParameterConverter ParameterConvertor
          This will be used by the PV class to convert between engineering and logical units.
protected  iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
          This is a reference to the parameter noticeboard so that the PV may update it when there is an event on the monitored PV.
protected  java.lang.String StatusVariableName
          This is the name which is associated with the status item.
protected  MessageHandler SyslogMessageHandler
          This will be used for reporting information to the syslog
protected  java.lang.String UnitConversionMethod
          This will be used to convert incoming and outgoing values which are to be read and written to the PV between logical units and engineering units.
 
Constructor Summary
StatusVariable()
           
StatusVariable(OCSCORBAHelper OCSCorba, MessageHandler SyslogMessageHandler, FourMS.FourMSParameterConverter ParameterConvertor)
          The constructor for the class
 
Method Summary
 void finalize()
           
 void run()
          This is the run method which is the obligation of the TimerTask interface.
protected  ing.status.StatusItemValue updateParameterNoticeboard(java.lang.String[] NBParameterNames, int StatusErrorCode, java.lang.String StatusErrorMessage)
          Will be used to be update the logical and engineering unit in the noticeboard when there is an error.
protected  ing.status.StatusItemValue updateParameterNoticeboard(java.lang.String NoticeboardItemName, org.omg.CORBA.Any StatusValue)
          Update the parameter noticeboard with the value of the status item.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

StatusVariableName

protected java.lang.String StatusVariableName
This is the name which is associated with the status item. This could be anything from the name of the status item in the noticeboard to the name of a PV.


OCSCorba

protected OCSCORBAHelper OCSCorba
An instance of the OCS CORBA helper which will be used to facilitate CORBA related activities


SyslogMessageHandler

protected MessageHandler SyslogMessageHandler
This will be used for reporting information to the syslog


ParameterNoticeBoard

protected iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
This is a reference to the parameter noticeboard so that the PV may update it when there is an event on the monitored PV.


UnitConversionMethod

protected java.lang.String UnitConversionMethod
This will be used to convert incoming and outgoing values which are to be read and written to the PV between logical units and engineering units.


ParameterConvertor

protected FourMS.FourMSParameterConverter ParameterConvertor
This will be used by the PV class to convert between engineering and logical units. The conversion is data-driven by the contents of the WHT ICS database which determines for a given PV which conversion is to be used to convert it.

Constructor Detail

StatusVariable

public StatusVariable(OCSCORBAHelper OCSCorba,
                      MessageHandler SyslogMessageHandler,
                      FourMS.FourMSParameterConverter ParameterConvertor)
               throws java.lang.Exception
The constructor for the class

Parameters:
OCSCorba - This is an instance of a CORBA helper class
SyslogMessageHandler - Will be used to report errors into the syslog
ParameterConvertor - Will be used to convert status between logical and engineering units
Throws:
java.lang.Exception - Should not all of the input parameters be none null

StatusVariable

public StatusVariable()
Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

updateParameterNoticeboard

protected ing.status.StatusItemValue updateParameterNoticeboard(java.lang.String[] NBParameterNames,
                                                                int StatusErrorCode,
                                                                java.lang.String StatusErrorMessage)
                                                         throws UnableToUpdateNoticeboardException
Will be used to be update the logical and engineering unit in the noticeboard when there is an error. We update both status items with the same information.

Parameters:
NBParameterNames - An arry of the noticeboard items names which will be updated
StatusErrorCode - This is the error code which is associated with the status value
StatusErrorMessage - This is the message which is associated with the status item.
Returns:
StatusItemValue The error status value which was wrote to the noticeboard
Throws:
UnableToUpdateNoticeboardException - When we are unable to update the noticeboard.

updateParameterNoticeboard

protected ing.status.StatusItemValue updateParameterNoticeboard(java.lang.String NoticeboardItemName,
                                                                org.omg.CORBA.Any StatusValue)
                                                         throws UnableToUpdateNoticeboardException
Update the parameter noticeboard with the value of the status item. The method will assemble a CORBA Any which is to be written into the noticeboard in the form of the standard IDL status type StatusItem.

Parameters:
NoticeboardItemName - This is the nmae of the item which is to be written into the noticeboard.
StatusValue - This is the value associated with the status which is to be written into the noticeboard.
Returns:
StatusItemValues This is an array of the status items which were wrote into the noticeboard.
Throws:
UnableToUpdateNoticeboardException - When we cannot write the status values into the noticeboard.

run

public void run()
This is the run method which is the obligation of the TimerTask interface. The superclass needs to override this

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask