Chapter 25. The state manager control panel

The state manager control panel connects to the state manager. See The state manager for information about the state manager. For the manpage on the control panel see cpanel

The state manager provides a display that describes the current system state as well as providing a context sensitive set of buttons that allow you to request all legal state transitions for the current state. Since the control panel gets state and transition publications, you can start more than one panel and all panels will continue to be consistent regardless of which panel initiates transitions.

The control panel (cpanel) needs to have a set of environment definitions made to run correctly. To get those definitions made, source the daqsetup.bash script from the top level directory of the NSCLDAQ installation tree.

cpanel determines how to connect to the state manager by following the procedure below:

  1. If the --state_uri and --transition-uri are both defined, they are used as the URI's for the state/transition publication port and the transition request port respectively.

  2. If the above conditions are not satisified, and the --host, --state-service and --transition-service options are all defined, the port manager is used to obtain the ports so that the appropriate URI's can be constructed.

  3. If the previous condition is not satisfied, cpanel will attempt to obtain the values of the environment variables: TRANSITION_SUBSCRIPTION_URI and TRANSITION_REQUEST_URI and use them as the state/transtion publication and transition request port URI's respectively. Note that if cpanel is run from the boot manager, the boot manager will have defined these environment variables. Note as well, that at least one control panel must not be run from the boot manager because the system has to be booted somehow.

  4. If the previous condition is not satisfied, cpanel will attempt to connect to the user's state manager in localhost using the state manager's default service names to look up the ports needed.

Typically, in addition to the state manager, you will want the boot manager running prior to asking the state manager to make state transitions. Let's look at a typical sequence of bringing up the experiment (booting it), starting and stopping data taking and then shutting down the experiment. We're going to assum you've just started the state and boot managers so that the system is in the NotReady state.

The figure below shows what cpanel looks like when it is started:

At the right side of its window, the control panel will always display the current state. The buttons appropriate to that state will be at the left side of the window. The Boot button will request that the state manager take a BOOT transition to the Booting state. From there the boot manager will take over, create rings and processes and initiate a transition to the Ready state.

The figure below shows what cpanel looks like when the system is in the Ready state.

There are now two buttons:

If you click Begin to start the run, the control panel window will look like this:

Once a run is ended, a new run can be started. The system can also be shutdown by clicking the Fail button at any time.