#24: States and their Colors ============================ Traffic Control Lights ********************** Most control systems provide many essential information in an abstract property, the so-called **state**. This hardware and software state property aims to describe at best the actual configuration of a device or system for the operator. For example: - Did a hardware operation encounter an error? - Is a device able to perform an action, e.g. can a motor move? - Is currently an operation in progress, e.g. a camera is acquiring? - ... .. figure:: images/states_overview.png :align: center :alt: Karabo states :figclass: align-center Karabo states and their families In the overview above the existing main state families in Karabo are shown. With a lot of effort Karabo tries to follow a few principles: - The `ERROR` state is mostly reserved for hardware errors. (`RED`) - The `UNKNOWN` state describes mostly a missing hardware connection (software error) (`ORANGE`) - The `CHANGING` state describes the undergoing change of a hardware state. Hence, it is often used as mediator between two states (`BLUE`) - The `RUNNING` state describes an ongoing operation, e.g. a camera is acquiring (`LIGHT BLUE`). - The `DISABLED` state describes the situation when a device cannot be operated under the circumstances. This may be an interlock. - The `ACTIVE` state family describes a state in which operation is enabled (see note on valves below). - The `PASSIVE` state and its derivatives describes a state in which operation is not enabled. The state color description follows further: - The **X-ray beam is on sample** policy leads to having **shutters** and **valves** having a green state when the beam is passing. The graphical user interface representation offers two widgets. The *Generic Lamp* and the *State color field*. .. figure:: images/blue_states.png :align: center :alt: Karabo states :figclass: align-center The `state color field` widget and the `generic lamp` widget Although the state colors were chosen with color vision deficiency in mind, sometimes it is difficult to differentiate without a reference. A clearer way to display a state information is using the state color field widget, which offers the option to `display the state string `_.