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.

_toggle_setpoint()[source]

Toolbar action; Allows to change the temperature difference setpoint

setup_status_bar() → None[source]

Sets up a status bar displaying sponsor layouts and tips for hovered over widgets.

setup_tool_bar() → None[source]

Adds a toolbar to the main window and defines a set of actions for it.

Widgets

class GUI.CustomWidgets.Widgets.FancyPointCounter(setup, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QLCDNumber

Custom version of the QLCDNumber.

property value
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.FramedWidget

The 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

_update_progress() → None[source]

Update the progressbar to show the current remaining time. If the recording interval has passed the process is stopped.

reset() → None[source]

Reset the competition widget upon reloading it.

class GUI.CustomWidgets.Widgets.StatusWidget(setup, *args, **kwargs)[source]

Bases: GUI.CustomWidgets.BaseWidgets.FramedWidget

The StatusWidget displays the current temperatures, flow and temperature difference measured.

_update_lcds() → None[source]

Updates the displayed values.

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.PlotWidget

The 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

add_signals(signals: list) → None[source]

Add a list of signals to the plot.

Parameters

signals (list) – List of LivePlotSignals

reset_plot_layout() → None[source]

Allows to reset the plot layout to the original view

update_plot_data()[source]

Handles the updating of a LivePLotWidget.

class GUI.CustomWidgets.LivePlots.LivePlotWidgetCompetition(setup: setup.Setup, title, ylabel, ylims, *args, **kwargs)[source]

Bases: GUI.CustomWidgets.LivePlots.LivePlotWidget

Specialized LivePLotWidget allowing only two signals and adding color between the two corresponding lines. Used to visualize the integral of the control error.

add_signals(reference_signal, actual_signal)[source]

Add a list of signals to the plot.

Parameters

signals (list) – List of LivePlotSignals

update_plot_data()[source]

Handles the updating of a LivePLotWidget.

class GUI.CustomWidgets.LivePlots.PlotWidgetFactory(setup)[source]

Bases: object

The PlotWidgetFactory defines a simple interface for creating instances of previously defined LivePlotWidgets.