10.5 Flash Memory 10.7 Testing
API Reference Manual  /  10 Python API  / 

10.6 System Panel

The System Panel API is a set of Python functions and classes that is used to create system panels. Further documentation can be found in the Model Builder User's Guide, chapter Creating a System Panel.

The API section covers the generic API for the system panel infrastructure and a couple of helper functions; the Widget Types section describes the specifics of each type of widget that can be included in a panel.

API

Standard Widgets Colors

NAME
standard color names
NAMESPACE
systempanel.widgets
DESCRIPTION
The standard widgets colors are used for creating LED widgets with different colors.
SYNOPSIS
systempanel.widgets.BLUE
systempanel.widgets.GREEN
systempanel.widgets.PURPLE
systempanel.widgets.RED
systempanel.widgets.WHITE
systempanel.widgets.YELLOW
    

SEE ALSO
systempanel.widgets.Led

systempanel.SystemPanel

NAME
SystemPanel — Base class for system panel components
DESCRIPTION
A base class for system panels. A system panel class should inherit from this and set the 'layout' class variable to describe the contents of the panel.

systempanel.SystemPanelException

NAME
SystemPanelException — System panel error
DESCRIPTION
Exception thrown for various errors in the system_panel module

Widget Types

systempanel.widgets.BitfieldImageOutput

NAME
BitfieldImageOutput — Multiple two-state image outputs driven by a single integer state
SYNOPSIS
BitfieldImageOutput(obj_name, contents)

DESCRIPTION
An output consisting of multiple two-state images, driven by a single integer state. such that each two-state image is driven by a single bit in the integer. Useful e.g. when creating 7-segment displays.

The contents parameter is a list of tuples (mask, x, y, [off_filename, on_filename]), where the integer mask is a power of two, x and y are integer offsets, and off_filename and on_filename are file names given on the same form as in the Image class. The off_filename image is shown at the given offset whenever the bit indicated by mask is 0; on_filename is shown otherwise.

systempanel.widgets.BitmapButton

NAME
BitmapButton — A bitmap-based button
SYNOPSIS
BitmapButton(obj_name, off_bitmap, on_bitmap)

DESCRIPTION
A bitmap-based button. Similar to the standard Button class, but can be put inside a Canvas, and the appearance is based on custom images. The bitmap parameters are filenames of the same type as in the Image class.

systempanel.widgets.BitmapLed

NAME
BitmapLed — A bitmap-based LED
SYNOPSIS
BitmapLed(obj_name, off_bitmap, on_bitmap)

DESCRIPTION
A bitmap-based LED. Same as the standard Led class, but can be put inside a Canvas, and custom images can be supplied. The bitmap constructor parameters are file names of the same type as in the Image class.

systempanel.widgets.BitmapToggleButton

NAME
BitmapToggleButton — A bitmap-based toggle button
SYNOPSIS
BitmapToggleButton(obj_name, off_bitmap, on_bitmap)

DESCRIPTION
A bitmap-based toggle button. Similar to the standard ToggleButton class, but can be put inside a Canvas, and the appearance is based on custom images. The bitmap parameters are file names of the same type as in the Image class.

systempanel.widgets.Button

NAME
Button — A standard button
SYNOPSIS
Button(obj_name, label)

DESCRIPTION
A button, that can be pressed. The button state is propagated using the signal interface, and can be raised or lowered. Raising and lowering the signal is frontend specific.

systempanel.widgets.Canvas

NAME
Canvas — A canvas (i.e bitmap container)
SYNOPSIS
Canvas(contents)

DESCRIPTION
A canvas for painting bitmap-based widgets. A canvas contains multiple bitmap-based widgets, each drawn at a specified offset. The contents parameter is a list of elements on the form (x, y, widget). Here x and y are integers, and widget is an instance of one of Image, BitmapLed, BitmapButton, BitmapToggleButton, MultiImageOutput, Canvas, or a subclass thereof. The items are rendered in the same order as they appear in the list; this means that if any widgets overlap, the last one will be drawn on top.

systempanel.widgets.Column

NAME
Column — A one-dimensional widget container
SYNOPSIS
Column(contents)

DESCRIPTION
A container for normal (non bitmap-based) widgets. The Column container is a special case of Grid container; the contained widgets are laid out vertically.

systempanel.widgets.Empty

NAME
Empty — An empty widget
SYNOPSIS
Empty()

DESCRIPTION
An empty widget, used to fill containers for layout purposes.

systempanel.widgets.Grid

NAME
Grid — A two-dimensional widget container
SYNOPSIS
Grid(contents, columns)

DESCRIPTION
A two-dimensional widget container. Containers are used to group other widgets, and enforce a specific layout scheme. The contents constructor parameter is a list of widget objects; it can contain any other widget except for bitmap-based ones. Widgets are laid out from left to right, top to bottom. Use the Empty class to fill empty cells. The number of rows in a Grid container is implicitly defined by the length of the contents list and the number of columns specified when creating the container. See also the Column and Row containers, which are convenience classes for the one-dimensional cases. Containers can contain other containers.

systempanel.widgets.Image

NAME
Image — An image
SYNOPSIS
Image(filename)

DESCRIPTION
An image, that can be put inside a Canvas class. Currently the only supported file format is PNG, but with full support for transparency. See Canvas class for more information.

systempanel.widgets.Label

NAME
Label — An label
SYNOPSIS
Label(label)

DESCRIPTION
A label, used to present static text.

systempanel.widgets.LabeledBox

NAME
LabeledBox — A container with a label and box drawn around it
SYNOPSIS
LabeledBox(label, container)

DESCRIPTION
A single-element container with a text label and a box drawn around it. The single widget given by the container parameter can be of any widget type, but it is typically of a container type.

systempanel.widgets.Led

NAME
Led — A standard LED
SYNOPSIS
Led(obj_name, color=None)

DESCRIPTION
A LED, which can be on or off. Driven by the signal interface. The parameter color specifies the color of the LED, all supported colors are described in Standard Widgets Colors. The look-and-feel of the LED is frontend specific.
SEE ALSO
Standard Widgets Colors

systempanel.widgets.MultiImageOutput

NAME
MultiImageOutput — A bitmap-based output that toggles between multiple images
SYNOPSIS
MultiImageOutput(obj_name, images)

DESCRIPTION
An output that toggles between multiple custom images. This can be used, among other things, for multi-coloured LEDs or seven-segment display elements. The images parameter is a list of paths to image filenames, each one given on the same form as in the Image class. Numeric input to the panel object via the uint64_state interface is used as a 0-based index in the image list.

systempanel.widgets.NumberInput

NAME
NumberInput — An input text field for integer numbers
SYNOPSIS
NumberInput(obj_name)

DESCRIPTION
An input text field for integer numbers, provided by the panel user. The value is propagated to the model using the uint64_state interface.

systempanel.widgets.NumberOutput

NAME
NumberOutput — An output text field for integer numbers
SYNOPSIS
NumberOutput(obj_name)

DESCRIPTION
An output text field for integer numbers, presenting integer state from the model. Driven by the uint64_state interface.

systempanel.widgets.Row

NAME
Row — A one-dimensional widget container
SYNOPSIS
Row(contents)

DESCRIPTION
A container for normal (non bitmap-based) widgets. The Row container is a special case of Grid container; the contained widgets are laid out horizontally.

systempanel.widgets.ToggleButton

NAME
ToggleButton — A toggle button
SYNOPSIS
ToggleButton(obj_name, label)

DESCRIPTION
A toggle button, that can be pressed or released. The button state is propagated using the signal interface. When button is pressed, signal is raised. When button is released, signal is lowered. The button must have a label indicating its purpose.

10.5 Flash Memory 10.7 Testing