LifeTwin Automatic GUI Generator
Automatic GUI Generator Example

Gui Internals
A file for creating a user interface to interact with a model’s parameters and visualize the graph based on the updated parameters.
- class gui.DoubleSlider(*args, **kargs)
Bases:
QSlider
A custom slider widget that emits a signal with double values. It allows setting minimum, maximum, and single step values as floats and returns the current value as a float.
- doubleValueChanged
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- emitDoubleValueChanged()
Emits the double value changed signal.
Calculates the double value based on the slider’s value and emits the double value changed signal.
- Returns:
None.
- setMaximum(value)
Sets the maximum value of the DoubleSlider.
- Args:
value (float): The maximum value to be set.
- Returns:
None.
- setMinimum(value)
Sets the minimum value of the DoubleSlider.
- Args:
value (float): The minimum value to be set.
- Returns:
None.
- setSingleStep(value)
Sets the single step value of the DoubleSlider.
- Args:
value (float): The single step value to be set.
- Returns:
None.
- setValue(value)
Sets the value of the DoubleSlider.
- Args:
value (float): The value to be set.
- Returns:
None.
- singleStep()
Returns the current single step value of the DoubleSlider as a float.
- Returns:
float: The current single step value of the DoubleSlider.
- value()
Returns the current value of the DoubleSlider as a float.
- Returns:
float: The current value of the DoubleSlider.
- class gui.InterfaceModel(model, start, variation)
Bases:
object
Initializes the InterfaceModel object with a model, starting parameters, and parameter variation. It creates a user interface for the model parameters and graph, and runs the interface for user interaction. The interface allows changing parameters and visualizing the graph based on the updated parameters.
- on_parameter_changed(param_id, new_value)
Handles the event when a parameter is changed.
- Args:
param_id: The ID of the parameter that has changed. new_value: The new value of the parameter.
- Returns:
None.
- run()
Runs the user interface for the model parameters and the graph.
- Returns:
None.
- update_graph()
Updates the graph with the current parameters and variation.
- Returns:
None.
- class gui.ParameterChangedSignal
Bases:
QObject
” A custom signal class that emits a signal with an integer and an object as parameters
- signal
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- gui.check_value_in_range(self, widget, minimum, maximum)
Checks if the value of the widget is within the specified range and displays a warning message if it is not.
- Args:
widget: The widget whose value needs to be checked. minimum: The minimum value of the range. maximum: The maximum value of the range.
- Returns:
None.