LED indicator

A status LED: green/red/cyan color schemes, radial gradients and lit/unlit appearances.

Overview

LedIndicator (quatm/GUI/widgets/qled.py) is an LED indicator button whose lit/unlit appearance can be toggled: a two-layer circular shell with a gradient centre, using highlighted colors when checked (lit) and dark colors when unchecked (dark). It is commonly used to show device connection status, experiment run status and the execution feedback of loop items.

Color modes

MethodDescription
set_green()Green scheme: bright green when checked, dark green when unchecked; usually indicates normal/ready
set_red()Red scheme: bright red when checked, dark red when unchecked; usually indicates an error/warning
set_cyan()Cyan scheme: used by looper condition items while they wait for data

The lit/unlit (checked) state is controlled with setChecked(True/False); the onColor1/onColor2 and offColor1/offColor2 properties customise the primary/secondary colors of the on and off states.

Usage

from quatm.GUI.widgets.qled import LedIndicator

led = LedIndicator(parent=parent)
led.set_green()      # device ready
led.setChecked(True) # switch on
# ...
led.set_red()        # device fault