170 likes | 267 Views
CDF Run Control Implementation. Elliott McCrory BD/Proton Source/Linac & CDF September 18, 2001. Talk Overview. Overview Major OO Components Some class diagrams Key Elements: Classes Interfaces Listeners Transition & TransitionStateMachine Scripting Performance.
E N D
CDF Run Control Implementation Elliott McCrory BD/Proton Source/Linac & CDF September 18, 2001
Talk Overview • Overview • Major OO Components • Some class diagrams • Key Elements: • Classes • Interfaces • Listeners • Transition & TransitionStateMachine • Scripting • Performance Elliott McCrory
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 Elliott McCrory
RunSet (Configuration) Database Error Handler Error Handler Error Handler State Manager State Manager State Manager Consumer Consumer SmartSockets Server(s) OnlineData VME n VME n+3 Level 3 VME n+1 VME n+2 Level 2
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 Elliott McCrory
GUI Active State Available Transition Unavailable Transition Status of RC Tevatron Status Elliott McCrory
Top-Level Class View rcBase.class daqStateManager.class GenericCalibStateManager.class QIECalibStateManager.class GUI.class Shell.class Jpython Scripting Classes RunSet.class RunSetEditor.class PartitionSelector.class ErrorHandler.class ConsumerEditor.class VxConfig.class RunTypeSelector.class
RC State Machine/Manager FSM.class State.class messenger.class Transition.class ConfigMess.class StateManager.class readoutConfig.class TransitionStateMachine.class daqStateManager.class GenericCalibStateManager.class QIECalibStateManager.class
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 Elliott McCrory
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 Key Classes Elliott McCrory
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() Elliott McCrory
Key Listeners • GUI Enabling • StateChangeListener • TransitionChangeListener • FsmStatusListener • Global information management • StateEventListener Elliott McCrory
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 Elliott McCrory
Sx = sub state ESx = Error State Ax = Action upon entering State Cx = Condition for leaving State Transition Sub State Machine Elliott McCrory
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). Elliott McCrory
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 Elliott McCrory
Summary • Java implementation of CDF Run Control • Swing GUI • Some OO techniques • Calibration scripts in JPython, moving to Java calibration programs Elliott McCrory