src.GUI.UI.widgets package

Submodules

src.GUI.UI.widgets.check_box_ui module

class src.GUI.UI.widgets.check_box_ui.CheckBox(parent: QWidget)

Bases: QCheckBox

configure(name: str = '', text: str = '', posX: int = 0, posY: int = 0, width: int = 100, height: int = 28, bg: str = 'transparent', fg: str = '#070F0A', checked_color: str = '#EE4539', unchecked_color: str = '#C9C1CA', font: str = 'YU Gothic UI', font_size: int = 8, font_bold: bool = False)

Configures the checkbox with the specified properties. :param text: The text to display on the checkbox. :type text: str :param posX: The x-coordinate of the checkbox’s position. :type posX: int :param posY: The y-coordinate of the checkbox’s position. :type posY: int :param width: The width of the checkbox. :type width: int :param height: The height of the checkbox. :type height: int :param font: The font family to use for the text. :type font: str :param font_size: The font size to use for the text. :type font_size: int :param font_bold: Whether the text should be bold. :type font_bold: bool

set_callback(callback, *args, **kwargs)

Assign a callback function to the button. :param callback: The function to be called when the button is clicked. :type callback: function

staticMetaObject = PySide6.QtCore.QMetaObject("CheckBox" inherits "QCheckBox": )

src.GUI.UI.widgets.console_output_ui module

class src.GUI.UI.widgets.console_output_ui.ConsoleOutput(parent: QWidget)

Bases: QTextEdit

clear_console()
configure(name: str = '', width: int = 500, height: int = 300, bg: str = '#FFFFFF', fg: str = '#070F0A', font: str = 'YU Gothic UI', font_size: int = 10, font_bold: bool = False)
log(message: str)
staticMetaObject = PySide6.QtCore.QMetaObject("ConsoleOutput" inherits "QTextEdit": )

src.GUI.UI.widgets.dropdown_menu module

class src.GUI.UI.widgets.dropdown_menu.DropdownMenu(parent: QWidget)

Bases: QComboBox

configure(name: str = '', items: list = [], posX: int = 0, posY: int = 0, width: int = 100, height: int = 22, bg: str = '#C9C1CA', fg: str = '#070F0A', bg_selection: str = '#070F0A', border: int = 2, border_radius: int = 11, padding: int = 15, font: str = 'YU Gothic UI', font_size: int = 10, font_bold: bool = False)

Configures the dropdown menu with the specified properties. :param items: The list of items to display in the dropdown menu. :type items: list :param posX: The x-coordinate of the dropdown menu’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the dropdown menu’s position. Defaults to 0. :type posY: int :param width: The width of the dropdown menu. Defaults to 100. :type width: int :param height: The height of the dropdown menu. Defaults to 25. :type height: int :param bg: The background color of the dropdown menu. Defaults to UI_LIGHT_GRAY. :type bg: str :param fg: The foreground (text) color of the dropdown menu. Defaults to UI_BLACK. :type fg: str :param bg_selection: The background color of the selected item in the dropdown menu. Defaults to UI_GRAY. :type bg_selection: str :param font: The font family of the dropdown menu. Defaults to “Lato”. :type font: str :param font_size: The font size of the dropdown menu. Defaults to 10. :type font_size: int :param font_bold: Whether the font should be bold. Defaults to False. :type font_bold: bool

get_selected_item() str

Get the currently selected item in the dropdown menu. :returns: The currently selected item. :rtype: float

set_callback(callback, *args, **kwargs)

Assign a callback function to the button. :param callback: The function to be called when the button is clicked. :type callback: function

set_enabled(enabled: bool)
set_index(index: int)

Set the index of the selected item in the dropdown menu. :param index: The index of the item to select. :type index: int

staticMetaObject = PySide6.QtCore.QMetaObject("DropdownMenu" inherits "QComboBox": )
update_items(items: list)

Update the items in the dropdown menu. :param items: The list of items to display in the dropdown menu. :type items: list

class src.GUI.UI.widgets.dropdown_menu.FixedHeightDelegate(height, parent=None)

Bases: QStyledItemDelegate

sizeHint(self, option: PySide6.QtWidgets.QStyleOptionViewItem, index: PySide6.QtCore.QModelIndex | PySide6.QtCore.QPersistentModelIndex, /) PySide6.QtCore.QSize
staticMetaObject = PySide6.QtCore.QMetaObject("FixedHeightDelegate" inherits "QStyledItemDelegate": )

src.GUI.UI.widgets.label_ui module

class src.GUI.UI.widgets.label_ui.Label(parent: QWidget)

Bases: QLabel

configure(name: str = '', text: str = 'EmptyLabel', posX: int = 0, posY: int = 0, width: int = 100, height: int = 25, bg: str = 'transparent', fg: str = '#070F0A', border_radius: int = 4, border_color: str = 'transparent', border: int = 0, font: str = 'YU Gothic UI', font_size: int = 8, font_bold: bool = False, alignment: ~PySide6.QtCore.Qt.AlignmentFlag = <AlignmentFlag.AlignCenter: 132>)

Configures the label with the specified properties. :param text: The text to display on the label. Defaults to “EmptyLabel”. :type text: str :param posX: The x-coordinate of the label’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the label’s position. Defaults to 0. :type posY: int :param width: The width of the label. Defaults to 100. :type width: int :param height: The height of the label. Defaults to 25. :type height: int :param bg: The background color of the label. Defaults to UI_LIGHT_GRAY. :type bg: str :param fg: The foreground (text) color of the label. Defaults to UI_BLACK. :type fg: str :param font: The font family of the label. Defaults to “Lato”. :type font: str :param font_size: The font size of the label. Defaults to 10. :type font_size: int :param font_bold: The font weight of the label. Defaults to False. :type font_bold: bool :param alignment: The alignment of the text in the label. Defaults to AlignCenter. :type alignment: Qt.AlignmentFlag

get_value()
set_text(text)
set_text_color(color: str)
staticMetaObject = PySide6.QtCore.QMetaObject("Label" inherits "QLabel": )

src.GUI.UI.widgets.menu_button_ui module

class src.GUI.UI.widgets.menu_button_ui.MenuButton(parent=None)

Bases: QPushButton

configure(name: str = '', text: str = 'Menu Button', icon_path: str = '', bg: str = '#3E403F', fg: str = '#FFFFFF', font: str = 'Lato', font_size: int = 12, font_bold: bool = False, width: int = 150, height: int = 22, padding: int = 0)
staticMetaObject = PySide6.QtCore.QMetaObject("MenuButton" inherits "QPushButton": )

src.GUI.UI.widgets.operator_button_ui module

class src.GUI.UI.widgets.operator_button_ui.OperatorButton(parent: QWidget, *args, **kwargs)

Bases: QPushButton

configure(operator: str = '?', bg: str = '#C9C1CA', fg: str = '#070F0A', checked_bg: str = '#EE4539', checked_fg: str = '#FFFFFF', posX: int = 0, posY: int = 0, width: int = 25, height: int = 25, border_radius: int = 6, padding: int = 0, font: str = 'Lato', font_size: int = 10, font_bold: bool = False)

Configures the operator button with the specified properties. :param operator: The operator string. Should be a value from ui_operators. Defaults to UI_NOOP. :type operator: str :param bg: The background color of the button in its default state. Defaults to UI_LIGHT_GRAY. :type bg: str :param fg: The foreground (text) color of the button in its default state. Defaults to UI_BLACK. :type fg: str :param checked_bg: The background color of the button when it is checked. Defaults to UI_ORANGE. :type checked_bg: str :param checked_fg: The foreground (text) color of the button when it is checked. Defaults to UI_BLACK. :type checked_fg: str :param posX: The x-coordinate of the button’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the button’s position. Defaults to 0. :type posY: int :param width: The width of the button. Defaults to 100. :type width: int :param height: The height of the button. Defaults to 25. :type height: int

set_callback(callback)

Assign a callback function to the button. :param callback: The function to be called when the button is clicked. :type callback: function

set_enabled(enabled: bool)
staticMetaObject = PySide6.QtCore.QMetaObject("OperatorButton" inherits "QPushButton": )
src.GUI.UI.widgets.operator_button_ui.icon_map = {'<': 'less.svg', '>': 'more.svg'}

Button class definition and configuration methods.

src.GUI.UI.widgets.plotwidget_ui module

class src.GUI.UI.widgets.plotwidget_ui.CustomAxisItem(orientation, *args, **kwargs)

Bases: AxisItem

staticMetaObject = PySide6.QtCore.QMetaObject("CustomAxisItem" inherits "AxisItem": )
tickStrings(values, scale, spacing)

Customize the tick labels to apply the correct scale.

updateLabel(min_val, max_val, label: str = 'Time', unit: str = 's')

Update the axis label based on the range of values.

class src.GUI.UI.widgets.plotwidget_ui.Graph(parent: QWidget | QMainWindow)

Bases: PlotWidget

clear_plot()
configure(name: str = '', labeltext: str = 'Graph', bg: str = '#FFFFFF', fg: str = '#070F0A', border: str = '#C9C1CA', posX: int = 0, posY: int = 0, width: int = 140, height: int = 28, border_radius: int = 8, padding: int = 0, font: str = 'YU Gothic UI', font_size: int = 8, font_bold: bool = False, x_label: str = 'Time', x_unit: str = 's')

Configures the graph with the specified properties. :param labeltext: The text to display on the graph. Defaults to “Graph”. :type labeltext: str :param bg: The background color of the graph in its default state. Defaults to transparent. :type bg: str :param fg: The foreground (text) color of the graph in its default state. Defaults to UI_BLACK. :type fg: str :param posX: The x-coordinate of the graph. Defaults to 0. :type posX: int :param posY: The y-coordinate of the graph. Defaults to 0. :type posY: int :param width: The width of the graph. Defaults to 140. :type width: int :param height: The height of the graph. Defaults to 25. :type height: int :param border_radius: The radius of the border of the graph. Defaults to 4. :type border_radius: int :param border: The color of the border of the graph. Defaults to UI_GRAY. :type border: str :param padding: The padding of the graph. Defaults to 0. :type padding: int :param font: The font of the text displayed on the graph. Defaults to “Lato”. :type font: str :param font_size: The size of the font of the text displayed on the graph. Defaults to 10. :type font_size: int :param font_bold: Whether the font of the text displayed on the graph should be bold. Defaults to False. :type font_bold: bool

drawRectangleSignal
draw_rectangle(x: float, width: float, color: str)

Thread-safe draw method. If called from a non-GUI thread, it emits a signal to have the update performed in the main thread.

set_axis_labels(x_label: str = 'Time', x_unit: str = 's', y_label: str = '', y_unit: str = '')
set_range(plot_range: int | float)
staticMetaObject = PySide6.QtCore.QMetaObject("Graph" inherits "PlotWidget": Methods:   #53 type=Signal, signature=updatePlotSignal(PyObject,bool,bool), parameters=PyObject, bool, bool   #54 type=Signal, signature=drawRectangleSignal(double,double,QString), parameters=double, double, QString )
unsafe_draw_rectangle(x: float, width: float, color: str)

Draws a rectangle at the specified x-position with the given width and color.

Parameters:
  • x (float) – X-coordinate where the rectangle starts.

  • width (float) – Width of the rectangle.

  • color (str) – Color of the rectangle.

unsafe_update_plot(data: list[Plot], toggle_legend: bool = True, autorange: bool = False)
updatePlotSignal
update_plot(data: list[Plot], toggle_legend: bool = True, autorange: bool = False)

Thread-safe update method. If called from a non-GUI thread, it emits a signal to have the update performed in the main thread.

src.GUI.UI.widgets.push_button_ui module

class src.GUI.UI.widgets.push_button_ui.PushButton(parent: QWidget, *args, **kwargs)

Bases: QPushButton

change_color(bg: str, fg: str)
configure(name: str = '', text: str = 'PushButton', icon_path: str = '', bg: str = '#C9C1CA', fg: str = '#070F0A', checked_bg: str = '#EE4539', checked_fg: str = '#FFFFFF', border: int = 0, border_color: str = 'transparent', posX: int = 0, posY: int = 0, width: int = 100, height: int = 28, border_radius: int = 14, padding: int = 0, font: str = 'YU Gothic UI', font_size: int = 8, font_bold: bool = False)

Configures the button with the specified properties. :param text: The text to display on the button. Defaults to “PushButton”. :type text: str :param bg: The background color of the button in its default state. Defaults to UI_LIGHT_GRAY. :type bg: str :param fg: The foreground (text) color of the button in its default state. Defaults to UI_BLACK. :type fg: str :param checked_bg: The background color of the button when it is checked. Defaults to UI_ORANGE. :type checked_bg: str :param checked_fg: The foreground (text) color of the button when it is checked. Defaults to UI_BLACK. :type checked_fg: str :param posX: The x-coordinate of the button’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the button’s position. Defaults to 0. :type posY: int :param width: The width of the button. Defaults to 100. :type width: int :param height: The height of the button. Defaults to 25. :type height: int

get_name()
num = 34
set_callback(callback, *args, **kwargs)

Assign a callback function to the button. :param callback: The function to be called when the button is clicked. :type callback: function

set_enabled(enabled: bool)
staticMetaObject = PySide6.QtCore.QMetaObject("PushButton" inherits "QPushButton": )
src.GUI.UI.widgets.push_button_ui.logger = <Logger FLC (WARNING)>

Button class definition and configuration methods.

src.GUI.UI.widgets.signal_light_ui module

class src.GUI.UI.widgets.signal_light_ui.SignalLight(parent: QWidget, port_number: int, *args, **kwargs)

Bases: QRadioButton

configure(name: str = '', text: str = 'SignalLight', fg: str = '#070F0A', posX: int = 0, posY: int = 0, width: int = 100, height: int = 28, unchecked_color: str = 'transparent', checked_color: str = '#EE4539', font: str = 'YU Gothic UI', font_size: int = 8, font_bold: bool = True, tooltip: str = '')

Configures the radio button with the specified properties. :param text: The text to display on the radio button. Defaults to “SignalLight”. :type text: str :param posX: The x-coordinate of the radio button’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the radio button’s position. Defaults to 0. :type posY: int :param width: The width of the radio button. Defaults to 100. :type width: int :param height: The height of the radio button. Defaults to 30. :type height: int

get_name() str
get_port_number() int
get_state() bool
set_state(state: bool)
set_text(text: str)
staticMetaObject = PySide6.QtCore.QMetaObject("SignalLight" inherits "QRadioButton": )

src.GUI.UI.widgets.tab_view_ui module

class src.GUI.UI.widgets.tab_view_ui.TabView(parent: QWidget)

Bases: QTabWidget

add_tab(widget: QWidget, title: str = 'Tab', override_width: int = 0, override_height: int = 0)
close_tab(index)
configure(width: int = 650, height: int = 40, tabwidth: int = 75, tabheight: int = 35, bg: str = '#FFFFFF', bg_selected: str = '#EE4539', bg_unselected: str = '#C9C1CA', fg_selected: str = '#070F0A', fg_unselected: str = '#070F0A', font: str = 'YU Gothic UI', font_size: int = 10, top_radius: int = 8, bottom_radius: int = 0, tabs_closable: bool = False)

Configures the tab view with the specified properties. :param width: The width of the tab view. Defaults to 650. :type width: int :param height: The height of the tab view. Defaults to 40. :type height: int :param tabwidth: The width of the tabs. Defaults to 60. :type tabwidth: int :param tabheight: The height of the tabs. Defaults to 35. :type tabheight: int :param bg: The background color of the tab view. Defaults to UI_WHITE. :type bg: str :param bg_selected: The background color of the selected tab. Defaults to UI_ORANGE. :type bg_selected: str :param bg_unselected: The background color of the unselected tabs. Defaults to UI_LIGHT_GRAY. :type bg_unselected: str :param fg_selected: The text color of the selected tab. Defaults to UI_BLACK. :type fg_selected: str :param fg_unselected: The text color of the unselected tabs. Defaults to UI_BLACK. :type fg_unselected: str :param tabs_closable: Whether the tabs should be closable. Defaults to False. :type tabs_closable: bool

reconfigure_size(width: int, height: int)

Reconfigure the tab view size dynamically

staticMetaObject = PySide6.QtCore.QMetaObject("TabView" inherits "QTabWidget": )

src.GUI.UI.widgets.text_entry_ui module

class src.GUI.UI.widgets.text_entry_ui.TextEntry(parent=None)

Bases: QLineEdit

configure(name: str = '', default_value: str = 'Enter Text', unit: str = '', posX: int = 0, posY: int = 0, width: int = 70, height: int = 22, bg: str = '#FFFFFF', fg: str = '#070F0A', border: int = 2, border_color: str = '#C9C1CA', border_radius: int = 5, font: str = 'YU Gothic UI', font_size: int = 10, font_bold: bool = False, edit_enabled: bool = True, numerical: bool = True, set_min: float = 0, set_max: float = 10000000000)

Configures the text entry with the specified properties. :param default_value: The default text to display in the text entry. Defaults to “Enter Text”. :type default_value: str :param posX: The x-coordinate of the text entry’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the text entry’s position. Defaults to 0. :type posY: int :param edit_enabled: Whether the text entry should be editable. Defaults to True. :type edit_enabled: bool :param numerical: Whether the text entry should only accept numerical (float) input. Defaults to True. :type numerical: bool :param width: The width of the text entry. Defaults to 100. :type width: int :param height: The height of the text entry. Defaults to 25. :type height: int :param font: The font family to use for the text entry. Defaults to “Lato”. :type font: str :param font_size: The font size to use for the text entry. Defaults to 10. :type font_size: int :param font_bold: Whether the text should be bold. Defaults to False. :type font_bold: bool :param set_min: The minimum value that the text entry can accept. Defaults to 0. :type set_min: int :param set_max: The maximum value that the text entry can accept. Defaults to 10. :type set_max: int

get_amplification()
get_value()
set_amplification(amp: float)
set_border_color(color: str)
set_max(value: float)
set_min(value: float)
set_unit_prefix(prefix: str)
set_value(value: float = 0.0, text: str = '', powermeter: bool = False)
staticMetaObject = PySide6.QtCore.QMetaObject("TextEntry" inherits "QLineEdit": )

src.GUI.UI.widgets.toggle_button_ui module

class src.GUI.UI.widgets.toggle_button_ui.ToggleButton(parent: QWidget, port_number: int = -1, *args, **kwargs)

Bases: QPushButton

configure(name: str = '', text: str = 'ToggleButton', bg: str = '#C9C1CA', fg: str = '#070F0A', active_bg: str = '#EE4539', active_fg: str = '#FFFFFF', posX: int = 0, posY: int = 0, width: int = 100, height: int = 28, border_radius: int = 14, padding: int = 0, font: str = 'YU Gothic UI', font_size: int = 10, font_bold: bool = False, limit_len=True, tooltip: str = '')

Configures the button with the specified properties. :param text: The text to display on the button. Defaults to “ToggleButton”. :type text: str :param bg: The background color of the button in its default state. Defaults to UI_LIGHT_GRAY. :type bg: str :param fg: The foreground (text) color of the button in its default state. Defaults to UI_BLACK. :type fg: str :param active_bg: The background color of the button when it is checked. Defaults to UI_ORANGE. :type active_bg: str :param active_fg: The foreground (text) color of the button when it is checked. Defaults to UI_BLACK. :type active_fg: str :param posX: The x-coordinate of the button’s position. Defaults to 0. :type posX: int :param posY: The y-coordinate of the button’s position. Defaults to 0. :type posY: int :param width: The width of the button. Defaults to 100. :type width: int :param height: The height of the button. Defaults to 25. :type height: int

get_name() str

Get the name of the button. :returns: The name of the button. :rtype: str

get_port_number() int

Get the port number of the button. :returns: The port number of the button. :rtype: int

get_state() bool

Get the state of the button. :returns: The state of the button. :rtype: bool

num = 4
set_callback(callback, *args, **kwargs)

Assign a callback function to the button. :param callback: The function to be called when the button is clicked. :type callback: function

set_checked(state: bool, *args, **kwargs)
set_inverted(inverted: bool)

Set the inverted state of the button. :param inverted: If True, the button will be inverted. :type inverted: bool

staticMetaObject = PySide6.QtCore.QMetaObject("ToggleButton" inherits "QPushButton": )
src.GUI.UI.widgets.toggle_button_ui.logger = <Logger FLC (WARNING)>

Button class definition and configuration methods.

Module contents