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.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.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.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": )¶