pyopticon._system._serial_widget module

class pyopticon._system._serial_widget.SerialWidget(parent_dashboard, polling_interval)

Bases: object

This widget is responsible for prompting all of the widgets to open serial connections, query them regularly, check them for responses, and closing the connections when needed. It also has the button to update the list of serial ports.

Parameters:

parent (pyopticon.dashboard.Dashboard) – The dashboard to which this widget will be added.

get_frame()

Get the tkinter frame on which this object is drawn.

Returns:

The widget’s tkinter frame

Return type:

tkinter.Frame

_toggle_serial_connected()

Toggle whether serial communications are active. Prompt all widgets to open or close serial connections. Grey out and change text on the appropriate GUI buttons while serial communications are active.

_update_widgets()

So long as serial communications are active, poll all widgets. Also check interlocks

_read_serial_ports()

Prompt every widget to read the lastest responses from its serial port and update its display accordingly.

_poll_interlocks()

Execute every interlock function that has been added to the dashboard.

_update_serial_ports()

Update the drop-down menu of available serial ports, accounting for any ports that have appeared/disappeared since this method was last called.