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:
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.
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.
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.
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 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:requests a BEGIN transition to the Active state. Readout program that are hooked into the state manager will use that to begin data taking.
can be clicked if you think something is wrong. It initiates a FAIL transition that drops the system back into the NotReady state. The boot manager will catch that transition and stop all programs.
If you click
to start the run, the control panel window will look like this:when clicked will request an END transition which will take the system back to the Ready state. State aware readout programs stop data taking when they observe that transition.
when clicked requests a FAIL transition to the NotReady state.
Once a run is ended, a new run can be started. The system can also be shutdown by clicking the
button at any time.