|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
FourMS.MechanismBase
FourMS.Mechanism
public class Mechanism
This class models a mechanism in a 4MS. On initialisation the data relating to the messages that may be sent and received by the 4MS are read from the ICS database. This class must ensure that all units to be sent backwards and forwards between the 4MS module are converted between logical and engineering units. It is also responsible for setting up the CORBA interfaced subactions which can be used to control the mechanisms through which the 4MS is controlled.
Finally, the status information coming back for the mechanism will be written to a machine state monitor called the ParameterNoticeBoard from where it can be accessed by 3rd party applications.
Field Summary | |
---|---|
private java.util.Hashtable<java.lang.String,SubAction> |
AssociatedSubActions
This is the valid list of subactions associated with this mechanism which may be executed upon the 4MS microprocessor currently attached to the port Server. |
iRawParameterTransformation |
EngineeringUnitConverter
A converter which can be used to perform transformations on raw values before they are sent to the noticeboard. |
private FourMSMessageHandler |
ER412MessageHandler
This will be used in order to send messages to the 4MS microprocessor (or the simulator) |
private org.omg.CosNaming.NamingContextExt |
MechanismNameServiceContext
A reference to the context in the COS naming service which is to hold the details of the subactions |
private static java.util.Timer |
MechanismTimer
This is a timer object which will be used for scheduling action updates on the part of the simulation mechanisms |
private org.omg.CORBA.ORB |
Orb
ORB used by the class |
private iParameterNoticeBoard.ParameterNoticeBoardSupplier |
ParameterNoticeBoard
This is reference to the remote proxy CORBA object which will be used to access the parameter noticeboard so that we may store status information that comes back from the 4MS |
private org.omg.CosNaming.NamingContextExt |
RootNamingServiceContext
The CORBA name service |
Constructor Summary | |
---|---|
Mechanism(java.sql.Connection DBConnection,
java.lang.String InstrumentName,
java.lang.String MechanismName,
MessageHandler SysLogMessageHandler,
FourMSParameterConverter ER412ParameterConverter,
org.omg.CORBA.ORB Orb,
org.omg.PortableServer.POA Poa,
org.omg.CosNaming.NamingContextExt ControllerNameServiceContext,
FourMSMessageHandler ER412MessageHandler)
This is the constructor for this class |
Method Summary | |
---|---|
private boolean |
createParametersInNoticeBoard()
Create parameters in the notice board which are associated with the status information which is returned by the 4MS controller for this mechanism. |
boolean |
createSubactions(org.omg.CORBA.ORB Orb,
org.omg.PortableServer.POA Poa)
Each mechanism has optionally associated one or more subactions. |
int |
getMessageParameterCount(java.lang.String MsgType)
This method returns the number of expected parameters for this message type. |
void |
messageReceivedCB(java.lang.String IncomingMessage,
FourMSMessage IncomingMessageStructure)
This method is a callback and this classes contractual obligation of the i4MSMessageListenerInterface. |
private boolean |
resolveParameterNoticeBoard()
This method will be used to resolve a reference to the parameter notice board. |
void |
run()
This is this classes obligation to implement the timer interface Any classes that want to inherit from this class and want to use timers should override this method |
void |
updateMechanismStateImage(java.util.List ConvertedMessageParameters,
java.util.List UnconvertedMessageParameters,
FourMSDBSchemaDerivedClasses.OM_FourMSMessage MessageStructureDetails)
This method will be used to update the "noticeboard" so that the full status of the mechanisms are available to other systems in the WHT OCS. |
Methods inherited from class FourMS.MechanismBase |
---|
buildFourMSMessage, getCurrentCommandError, getCurrentMechanismError, getMechanismError, getMechanismName, interpret4MSMessage, setEncoderPosition |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public iRawParameterTransformation EngineeringUnitConverter
private iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
private org.omg.CORBA.ORB Orb
private org.omg.CosNaming.NamingContextExt RootNamingServiceContext
private static final java.util.Timer MechanismTimer
private java.util.Hashtable<java.lang.String,SubAction> AssociatedSubActions
private FourMSMessageHandler ER412MessageHandler
private org.omg.CosNaming.NamingContextExt MechanismNameServiceContext
Constructor Detail |
---|
public Mechanism(java.sql.Connection DBConnection, java.lang.String InstrumentName, java.lang.String MechanismName, MessageHandler SysLogMessageHandler, FourMSParameterConverter ER412ParameterConverter, org.omg.CORBA.ORB Orb, org.omg.PortableServer.POA Poa, org.omg.CosNaming.NamingContextExt ControllerNameServiceContext, FourMSMessageHandler ER412MessageHandler)
DBConnection
- This is a pre-establish connection to the
WHTOCS database which will be used to extract the mechanism
data from the WHT OCSInstrumentName
- This is the name of the instrument which
this mechanism is associated withMechanismName
- This is the name of the mechanismSysLogMessageHandler
- This a syslog error reporting
object which will be used for reporting errors and the likeER412ParameterConverter
- This will be used in the
conversion of parameters between engineering and logical unitsOrb
- This is a reference to an ORBPoa
- This a reference to the root POAControllerNameServiceContext
- This is a reference to the COS naming service so that the
method can add a context for this mechanism within the controller context in the COS naming serviceER412MessageHandler
- Method Detail |
---|
public void updateMechanismStateImage(java.util.List ConvertedMessageParameters, java.util.List UnconvertedMessageParameters, FourMSDBSchemaDerivedClasses.OM_FourMSMessage MessageStructureDetails)
ConvertedMessageParameters
- This contains the values associated with the fields in the
incoming status message which needs to be put into the
parameter noticeboard which have been converted from
engineering units to logical units
UnconvertedMessageParameters
- This contains the values associated with the fields in the
incoming status message which needs to be put into the
parameter noticeboard which are in the raw engineering format
MessageStructureDetails
- This will contain the details of the status message(s) that
have just been received for this mechanism and for which the
values of the status should be put into the parameter
noticeboardpublic void messageReceivedCB(java.lang.String IncomingMessage, FourMSMessage IncomingMessageStructure)
messageReceivedCB
in interface i4MSMessageListenerInterface
IncomingMessage
- This is the string which contains the message incoming from the 4MSIncomingMessageStructure
- This is a structure which contains the components of the messagepublic void run()
MechanismBase
run
in interface java.lang.Runnable
run
in class MechanismBase
public int getMessageParameterCount(java.lang.String MsgType) throws MessageTypeNotFoundException
MsgType
- This is the message type for which we want to know the number of parameters associated.
MessageTypeNotFoundException
MessageTypeNotFoundException
public boolean createSubactions(org.omg.CORBA.ORB Orb, org.omg.PortableServer.POA Poa)
Orb
- This is a reference to an ORBPoa
- This a reference to the root POA
private boolean resolveParameterNoticeBoard()
private boolean createParametersInNoticeBoard()
If the parameter is flagged as Unused then it will not be added to the parameter noticeboard
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |