GUI¶
The structure of the graphical user interface can be described as follows: The outermost layer is within the main file, which deploys the Qt application and loads the main window.
The main window then controls the different experiment pages GUI.ExperimentPages.ExperimentPage, one for
each experimentation step, with a stacked layout and manages the switching between those pages. The pages are built up
from a series of widgets as defined in sections Widgets and Live Plots.
Main Window¶
-
class
GUI.MainWindow.MainWindow(setup: setup.Setup, *args, **kwargs)[source]¶ Defines the main window of the application.
- Parameters
setup (Setup) – Instance of Setup to allow access to sensors and actuators.
-
_calibrate_temperature() → None[source]¶ Toolbar action; Allows to set the current delta T to zero by saving the current temperature difference and subtracting it from the second temperature measurement.
-
_change_competition_mode() → None[source]¶ Toolbar action; Allows to set the current view to competition mode.
-
_go_to_next_view() → None[source]¶ Toolbar action; Switches to the next view in the main layout stack.
-
_go_to_previous_view() → None[source]¶ Toolbar action; Switches to the previous view in the main layout stack.
-
_reset_plots() → None[source]¶ Toolbar action; Allows to reset all visible plots to their original view.
-
_reset_temperature_calibration() → None[source]¶ Toolbar action; Allows to reset the calibration temperature difference to zero.
-
_reverse_temperature_sensors() → None[source]¶ Menu action; Allows to switch the order of the temperature sensors if the hardware setup is the wrong way around.
-
_save_measurement_buffer()[source]¶ Toolbar aciton; Allows to save the measurement buffer as a Matlab .mat file.
-
_start_recording() → None[source]¶ Toolbar action; Allows to restart recording measurements. Clears the buffer.
-
_stop_recording() → None[source]¶ Toolbar action; Allows to stop recording measurements and thus freeze the plots. :return:
-
_toggle_massflow(state=None) → None[source]¶ Toolbar action; Allows to turn the massflow output on or off
- Parameters
state (bool) – Set True to turn the output state to on, or False vice versa.
-
_toggle_output(state=None) → None[source]¶ Toolbar action; Allows to turn the pwm output on or off.
- Parameters
state (bool) – Set True to turn the output state to on, or False vice versa.
Widgets¶
-
class
GUI.CustomWidgets.Widgets.FancyPointCounter(setup, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QLCDNumberCustom version of the QLCDNumber.
-
property
value¶
-
property
-
class
GUI.CustomWidgets.Widgets.CompetitionWidget(setup: setup.Setup, start_recording_action: Callable, stop_recording_action: Callable, enable_output_action: Callable, *args, **kwargs)[source]¶ Bases:
GUI.CustomWidgets.BaseWidgets.FramedWidgetThe CompetitionWidget allows to start a recording of the current performance and displays the number of points reached.
-
_update_process_values(running_time_s) → None[source]¶ Container function for updates that are specific to the inheriting widgets
-
Live Plots¶
-
class
GUI.CustomWidgets.LivePlots.LivePlotSignal(name: str, identifier: str, color: str, width=1)[source]¶ A LivePlotSignal stores all the information needed to identify and plot a single signal.
- Parameters
name (str) – Name of the signal, to be displayed on the legend of the plot the signal is shown on
identifier (str) – Identifier of the signal, used to retrieve the signal from the measurement buffer of the setup
color (str) – Color of the plotted line used to instantiate the corresponding pen
width (float) – Width of the plotted line used to instantiate the corresponding pen
Note
Selecting integer values for the width parameter results in smoother plots.
-
class
GUI.CustomWidgets.LivePlots.LivePlotWidget(setup: setup.Setup, title: str, ylabel: str, ylims: Tuple, *args, **kwargs)[source]¶ Bases:
pyqtgraph.widgets.PlotWidget.PlotWidgetThe LivePlotWidget makes use of pyqtgraph to allow plotting a number of signals. It automatically updates.
- Parameters
setup (Setup) – Instance of the current setup to allow access to the measurement buffer
title (str) – Title of the plot
ylabel (str) – Label of the y-axis
ylims (Tuple) – Limits of the y-axis
-
class
GUI.CustomWidgets.LivePlots.LivePlotWidgetCompetition(setup: setup.Setup, title, ylabel, ylims, *args, **kwargs)[source]¶ Bases:
GUI.CustomWidgets.LivePlots.LivePlotWidgetSpecialized LivePLotWidget allowing only two signals and adding color between the two corresponding lines. Used to visualize the integral of the control error.