catalight.catalight_GUI.MainWindow

class catalight.catalight_GUI.MainWindow(*args: Any, **kwargs: Any)

Bases: QMainWindow

Subclass QMainWindow to customize your application’s main window.

__init__()

Methods

__init__()

add_expt()

Create a new experiment object and add it to GUI.

change_label_color(label, new_color)

closeEvent(*args, **kwargs)

Redefines shutdown process for window to close equipment.

connect_manual_ctrl()

Connect Manual Control (signals/slots).

delete_expt()

Delete currently selected item from listWidget.

disconnect()

Run shutdown sequence then disconnect communications.

display_expt()

Update GUI display when new expt is selected in listWidget.

emergency_stop()

Cancel active threads, call self.shut_down().

init_design_tab()

Connect Experiment Design Tab Contents (signals/slots).

init_equipment()

Try to connect to each piece of equipment.

init_figs()

Initialize figure canvas.

init_manual_ctrl_tab()

Initialize Manual Control Tab.

init_study_tab()

Connect Study Overview Tab Contents (signals/slots).

manual_ctrl_eqpt()

Update setpoint of equipment.

normalOutputWritten(text)

Append console ouput to the QTextEdit.

open_peaksimple(path_name)

Use subprocess package to open peaksimple instance.

reset_eqpt()

Disconnects from equipment and attempts to reconnect.

select_cal_file()

Prompt user to select calibration file.

select_ctrl_file()

Prompt user to selector GC control file if gc is connected.

set_form_limits()

Update the limits of widgets within the GUI.

shut_down()

Run shutdown method on each connected piece of equipment.

start_study()

Loop through experiment objects, update, and call .run_experiment().

sum_spinboxes(spinboxes, qlabel)

Take list of spinboxes, get values, write sum to qlabel.

toggle_controls(value)

Toggle status of widgets in tabWidget.

update_eqpt_status()

Update the equipment live view.

update_expt()

Update Experiment object with GUI values.

update_ind_var(expt)

Update independent variable if applicable.

update_ind_var_grid()

Update widgets in independent variable grid.

update_plot([expt])

Update the plots in GUI when experiment is changed.

values_from_spinboxes(spinboxes)

Give list of spinboxes, return list of values.

add_expt()

Create a new experiment object and add it to GUI.

change_color_signal

update QLabel font color

alias of object

closeEvent(*args, **kwargs)

Redefines shutdown process for window to close equipment.

connect_manual_ctrl()

Connect Manual Control (signals/slots).

Connect buttons within manual control tab to corresponding functions. Also initialize a timer that calls update_eqpt_status(), updating both the manua_ctrl tab and live view

delete_expt()

Delete currently selected item from listWidget.

disconnect()

Run shutdown sequence then disconnect communications.

display_expt()

Update GUI display when new expt is selected in listWidget.

emergency_stop()

Cancel active threads, call self.shut_down().

init_design_tab()

Connect Experiment Design Tab Contents (signals/slots).

On first call, populates expt_type drop down on GUI. Insert possible gasses to combo boxes. Initializes widgets used for defining comp_sweep experiments.

init_equipment()

Try to connect to each piece of equipment.

Adjusts (object)_Status.setChecked if successful. If Exception is thrown, setChecked(0) and print Exception Calls set_form_limits() at end

init_figs()

Initialize figure canvas.

Creates figure objects, adds to gui, adds navigation bar

init_manual_ctrl_tab()

Initialize Manual Control Tab.

Blocks tabWidget updates, puts intial values in manual tab widgets. Insert possible gasses to combo boxes. The update process for live readings for both the manual and live view tabs is created/connected in the connect_manual_ctrl() method.

init_study_tab()

Connect Study Overview Tab Contents (signals/slots).

manual_ctrl_eqpt()

Update setpoint of equipment.

Updates the setpoint of all equipment based on the current manual control values entered in the GUI. This method is usually called from a worker thread as it takes a long time to complete and uses many MainWindow attributes. As such, this method emits several signals to trigger visual updates in the GUI.

Note

The visual updates need to be sent out as signals to not cause issues with updating the GUI outside the main thread!!

normalOutputWritten(text)

Append console ouput to the QTextEdit.

open_peaksimple(path_name)

Use subprocess package to open peaksimple instance.

Checks for running version of peaksimple first. Prints warning and returns if peaksimple is running. Using process.kill() doesn’t give expected results. Peaksimple API gives error when trying to reconnect if you don’t close the window manually. Still searching for solution.

Parameters:

path_name (str) – full path to PeakSimple executable

Returns:

process – returns a process object for peaksimple instance

Return type:

subprocess.process

progress_signal

triggered to update progress bar

alias of int

reset_eqpt()

Disconnects from equipment and attempts to reconnect.

select_cal_file()

Prompt user to select calibration file.

If gas system is connected, runs “set_calibration()” method on each mfc Adds ‘CalGas’ option to mfc gas type drop downs

select_ctrl_file()

Prompt user to selector GC control file if gc is connected.

set_form_limits()

Update the limits of widgets within the GUI.

Use this function to set widget min/max values. These can either be pulled from eqpt objects to have equipment specific limits, or hard coded. Alternativly, many limits are set using QtDesigner Users are encourage to edit this for specific equipment setups.

shut_down()

Run shutdown method on each connected piece of equipment.

start_study()

Loop through experiment objects, update, and call .run_experiment().

Takes experiment objects in listWidget, assigns eqpt, generates experiment name and save path, then call expt.run_experiment(). Shuts down at end.

sum_spinboxes(spinboxes, qlabel)

Take list of spinboxes, get values, write sum to qlabel.

Parameters:
  • spinboxes (list of PyQt5.QtWidgets.QSpinBoxes) – spinboxes to sum

  • qlabel (PyQt5.QtWidgets.QLabel) – qlabel to write to

Return type:

None.

toggle_controls(value)

Toggle status of widgets in tabWidget.

Parameters:

value (bool) – True disables all widgets in tabWidget (not emergency stop) False enables all

update_eqpt_status()

Update the equipment live view.

This function updates the live view of the equipment in both the manual control (1) and the live view (2) tabs

update_expt()

Update Experiment object with GUI values.

Populates the attributes of currently selected experiment with the values displayed in GUI. If valid independent variable is set, updates plot. Clears plot for invalid experiment.

update_ind_var(expt)

Update independent variable if applicable.

Checks for valid independent variable and updates the experiment object accordingly. Returns if invalid variable is supplied

Parameters:

expt (catalight.equipment.Experiment) – Experiment object containing the expt_type to be analyzed

update_ind_var_grid()

Update widgets in independent variable grid.

Chooses the correct widgets to display based on the experiment type currently selected in the GUI.

update_plot(expt=None)

Update the plots in GUI when experiment is changed.

Parameters:

expt (catalight.equipment.experiment_control.Experiment, optional) – Updates plot with contents of experiment if supplied. Scrubs plot if expt=None. The default is None.

values_from_spinboxes(spinboxes)

Give list of spinboxes, return list of values.

Parameters:

spinboxes (list) – list of spinboxes you’d like to get values from

Returns:

gas_comp – list of the values from the spinboxes supplied

Return type:

list