Download - CDF Run Control Implementation Elliott McCrory BD/Proton Source/Linac & CDF September 18, 2001
18 September 2001Elliott McCrory2
Talk Overview
Overview Major OO Components
– Some class diagrams Key Elements:
– Classes– Interfaces– Listeners
Transition & TransitionStateMachine Scripting Performance
18 September 2001Elliott McCrory3
Overview of Run Control
RC and most of its components are implemented in Java
– OO?? Platform: FRH Linux
– Began with SGI Irix Swing-based GUI JDBC SmartSockets communications Heavily threaded
State Manager
SmartSockets Server(s)
Consumer
Error Handler
State Manager State Manager
Error Handler Error Handler
RunSet (Configuration) Database
OnlineData
VME n VME n+1 VME n+2 Level 2 Level 3VME n+3
Consumer
18 September 2001Elliott McCrory5
Major Components of RC
RunSet editor for client configuration Error handler for expert system control Data consumers VxWorks coordination General state machine logic
– Discussed here
Scripting interface for calibrations
18 September 2001Elliott McCrory6
GUI
Active State
Available Transition
Status of RC
Tevatron Status
Unavailable Transition
Top-Level Class View
GUI.class
rcBase.class
Shell.class
Jpython Scripting Classes
daqStateManager.class GenericCalibStateManager.class QIECalibStateManager.class
RunSet.class RunSetEditor.class PartitionSelector.class
RunTypeSelector.classConsumerEditor.class VxConfig.class
ErrorHandler.class
RC State Machine/Manager
FSM.class
Transition.class
daqStateManager.class GenericCalibStateManager.class
TransitionStateMachine.class
State.class
QIECalibStateManager.class
messenger.class
readoutConfig.class
ConfigMess.class
StateManager.class
18 September 2001Elliott McCrory9
Key Concepts
Modularism, abstraction, inheritance/polymorphism, data hiding, Mom & apple pie– Some “Design Patterns”
Isolation of GUI from FSM – Control flows “down”; GUI information flows “up”
through listeners and interfaces
18 September 2001Elliott McCrory10
Key Classes
FSM– Generalized finite state
machine StateManager
– CDF RC specific State Transition TransitionStateMachine DebugLevel
– Handles diagnostic printout
messenger– Singelton Design Pattern– Handles messaging to clients
ConfigMess– Abstract: all clients use this
class for their configuration messages
ConfigMessageFactory– Factory Design Pattern– Returns a ConfigMess
readoutConfig– Handles reception of replies
from clients
18 September 2001Elliott McCrory11
Key Interfaces
RCAction– Command Design Pattern– Perform an action when entering a state– public boolean execute()
RCCondition– public boolean isMet() to leave a state– public boolean isViolated() when an error is
encountered– public void reset()
18 September 2001Elliott McCrory12
Key Listeners
GUI Enabling– StateChangeListener– TransitionChangeListener– FsmStatusListener
Global information management– StateEventListener
18 September 2001Elliott McCrory13
Implementation of Transitions
Specifications say: Sequence RCAction’s– e.g., you must configure all clients (“ColdStart”)
before configuring Level 3
Implemented as a FSM TransitionStateMachine extends Transition
and “Has A” FSM
18 September 2001Elliott McCrory14
Transition Sub State Machine
Sx = sub state ESx = Error State Ax = Action upon
entering State Cx = Condition for
leaving State
18 September 2001Elliott McCrory15
Scripting
Used for calibrations– Desire to change one or two parameters in a client crate’s
configuration message over ~10 calibration iterations
Initially implemented in Jpython– Basic JPython class extends Java class Shell– Generally requires “isinstance()” JPython operator to find
configuration message for crate being calibrated
Being abandoned for all-Java solution– Benefits of scripting (easy changes) not strong enough to
outweigh drawbacks (new language).
18 September 2001Elliott McCrory16
Performance
Startup of rc.GUI: about 1 minute Java VM: 10’s of MB Run-time performance: no issue Knowledgeable and/or relevant programmers:
3 to 10