pyccapt.control.gui package
Submodules
pyccapt.control.gui.gui_baking module
- class pyccapt.control.gui.gui_baking.BakingWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetInitialize the BakingWindow class.
- Parameters:
gui_baking – An instance of the GUI baking class.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- class pyccapt.control.gui.gui_baking.Ui_Baking(variables, conf, SignalEmitter_Pumps_Vacuum, parent=None)[source]
Bases:
objectInitialize the UiBaking class.
- Parameters:
variables – Instance of variables class.
conf – Configuration settings.
parent – Parent widget (default is None).
- save_data_csv()[source]
Prompt the user for a target file and save the baking log CSV.
Pops up the OS Save-As dialog pre-filled with a sensible default filename (
manual_save_<timestamp>.csv) under the existing baking-log folder. Cancel leaves nothing on disk.
- update_vacuum_buffer(value)[source]
Update the vacuum value in the GUI :param value: the temperature value
- Returns:
None
- update_vacuum_cryo_load_lock(value)[source]
Update the vacuum value in the GUI :param value: the temperature value
- Returns:
None
pyccapt.control.gui.gui_cameras module
- class pyccapt.control.gui.gui_cameras.CamerasAlignmentWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetInitialize the CamerasAlignmentWindow class.
- Parameters:
gui_cameras_alignment – GUI cameras alignment instance.
close_event – multiprocessing.Event signalled by this window when it is closed by the user.
command_queue – multiprocessing.Queue of typed string commands sent from the main GUI (“show”, “show_front”, “hide”).
- class pyccapt.control.gui.gui_cameras.SignalEmitter(*args: Any, **kwargs: Any)[source]
Bases:
QObject
- class pyccapt.control.gui.gui_cameras.Ui_Cameras_Alignment(variables, conf, SignalEmitter)[source]
Bases:
objectInitialize the UiCamerasAlignment class.
- Parameters:
variables – Global experiment variables.
conf – Configuration data.
SignalEmitter – Signal emitter for communication.
- default_exposure_time_switch()[source]
Default exposure time switch function
Args: None
Return: None
- set_default_exposure_time(exposure_time_default)[source]
Set the default exposure time
Args: exposure_time_default: Default exposure time
Return: None
- setupUi(Cameras_Alignment)[source]
Set up the GUI for the Cameras Alignment window.
Args: Cameras_Alignment:
Returns: None
pyccapt.control.gui.gui_gates module
- class pyccapt.control.gui.gui_gates.GatesWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetInitialize the GatesWindow class.
- Parameters:
gui_gates – GUI for gates.
*args – Additional arguments for QWidget initialization.
**kwargs –
Additional arguments for QWidget initialization.
- class pyccapt.control.gui.gui_gates.Ui_Gates(variables, conf, parent=None)[source]
Bases:
objectLoad the GUI based on the configuration file.
- Parameters:
None
- Returns:
None
Load the GUI based on the configuration file.
- Parameters:
- Returns:
None
- error_message(message)[source]
The function for showing the error message in the GUI
- Parameters:
message – The message to be shown in the GUI
- Returns:
None
- gates(gate_num)[source]
The function for applying the command of closing or opening gate
- Parameters:
gate_num – The number of the gate to be opened or closed
- Returns:
None
- hideMessage()[source]
The function for hiding the error message in the GUI
- Parameters:
None
- Returns:
None
pyccapt.control.gui.gui_laser_control module
- class pyccapt.control.gui.gui_laser_control.LaserControlWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetInitialize the LaserControlWindow class.
- Parameters:
gui_laser_control – GUI for laser control.
*args – Additional arguments for QWidget initialization.
**kwargs –
Additional arguments for QWidget initialization.
- class pyccapt.control.gui.gui_laser_control.Ui_Laser_Control(variables, conf)[source]
Bases:
objectInitialize the Ui_Laser_Control class.
- Parameters:
variables – Global experiment variables.
conf – Configuration settings.
- error_message(message)[source]
Display an error message and start a timer to hide it after 8 seconds
- Parameters:
message (str) – Error message to display
- Returns:
None
- get_frequency(index)[source]
Handle the close event of the changing of laser rate.
- Parameters:
None
- Returns:
None
- laser_divition_factor_changed()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_enable_clicked()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_listen_clicked()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_on_clicked()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_power_changed()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_rate_changed()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_standby_clicked()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- laser_wavelegnth_changed()[source]
Handle the close event of the GatesWindow.
- Parameters:
None
- Returns:
None
- setupUi(Laser_Control)[source]
Setup the GUI for the laser control. :param Laser_Control: The GUI window
- Returns:
None
- stop()[source]
Stop background workers and release device handles.
Called from gui_main.cleanup() when the user closes the main GUI; without this the laser status Worker QThread (while True loop) keeps running and prevents the Python process from exiting.
- switch_to_cli_clicked()[source]
Operator-initiated NKTPBus -> CLI switch.
Wired to the “Switch to CLI” button (gated behind Override Access). After writing register 0x39 := 1 we try to re-open the CLI session up to
CLI_SWITCH_NUM_ATTEMPTStimes withCLI_SWITCH_RETRY_DELAY_Sbetween attempts. The first attempt fairly often fails because the host-side serial driver hasn’t cleanly flipped from 115 200 baud (Interbus) to 38 400 baud (CLI); the second attempt usually succeeds.
- switch_to_nktpbus_mode()[source]
Switch the laser from CLI -> NKTPBus mode.
After this returns, the CLI session is gone. The operator can either drive the laser from NKT Photonics CONTROL software (the usual reason for switching) or click the “Switch to CLI” button in this window to return to CLI mode.
- CLI_SWITCH_INITIAL_DELAY_S = 1.5
- CLI_SWITCH_NUM_ATTEMPTS = 3
- CLI_SWITCH_RETRY_DELAY_S = 1.0
- class pyccapt.control.gui.gui_laser_control.Worker(*args: Any, **kwargs: Any)[source]
Bases:
QThreadBackground poller for the laser status loop.
The original implementation used while True: which made it unstoppable - the parent QApplication couldn’t exit because the QThread never finished. Now an internal _stop_flag is honoured at every iteration so the main GUI’s cleanup() can shut us down.
pyccapt.control.gui.gui_main module
- class pyccapt.control.gui.gui_main.Ui_PyCCAPT(variables, conf, x_plot, y_plot, t_plot, main_v_dc_plot)[source]
Bases:
objectConstructor for the PyCCAPT UI class.
- Parameters:
- Returns:
None
- cleanup()[source]
Tear down every long-lived resource so the Python process can exit.
- The order matters:
Stop QThreads / QTimers / device handles inside each Ui_* instance. Without this the laser Worker QThread keeps looping forever (msleep(1000)) and the SmarAct poll timers keep firing on already-closed windows.
Force-close the sub-windows so their accept-paths run.
Terminate worker subprocesses and wait briefly for them to die - terminate() is async, and unjoined zombie subprocesses keep the multiprocessing Manager alive, which is what makes “close” appear to do nothing.
Quit the Qt event loop so app.exec() returns and __main__ can release the shared context + os._exit.
- error_message(message)[source]
Display an error message and start a timer to hide it after 8 seconds
- Parameters:
message (str) – Error message to display
- Returns:
None
- on_stop_experiment_worker()[source]
Enable the start and stop buttons after experiment is finished
- Parameters:
None
- Returns:
None
- read_text_lines()[source]
Read the text lines and convert them to a dictionary
- Parameters:
None
- Returns:
None
- reset_button_color(button)[source]
Reset the button color to the original color
- Parameters:
button (QPushButton) – The button to reset the color
- Returns:
None
- retranslateUi(PyCCAPT)[source]
Retranslate the UI with the selected language
Args: PyCCAPT: Main window
Return: None
- setup_parameters_changes()[source]
Function to set up parameters changes
- Parameters:
None
- Returns:
None
- start_experiment_clicked()[source]
Start the experiment worker thread
- Parameters:
None
- Returns:
None
- start_experiment_worker()[source]
Start the experiment worker thread
- Parameters:
None
- Returns:
None
- update_detection_rate(value)[source]
Update the detection rate
- Parameters:
value (float) – The detection rate
- Returns:
None
- update_elapsed_time(value)[source]
Update the speciemen voltage
- Parameters:
value (float) – The speciemen voltage
- Returns:
None
- update_pulse_voltage(value)[source]
Update the pulse voltage
- Parameters:
value (float) – The pulse voltage
- Returns:
None
- update_speciemen_voltage(value)[source]
Update the speciemen voltage
- Parameters:
value (float) – The speciemen voltage
- Returns:
None
pyccapt.control.gui.gui_pumps_vacuum module
- class pyccapt.control.gui.gui_pumps_vacuum.PumpsVacuumWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetWidget for Pumps and Vacuum control window.
Constructor for the PumpsVacuumWindow class.
- Parameters:
gui_pumps_vacuum – Instance of the PumpsVacuum control.
signal_emitter – SignalEmitter object for communication.
*args – Additional positional arguments.
**kwargs – Additional keyword arguments.
- class pyccapt.control.gui.gui_pumps_vacuum.SignalEmitter(*args: Any, **kwargs: Any)[source]
Bases:
QObjectSignal emitter class for emitting signals related to vacuum and pumps control.
- class pyccapt.control.gui.gui_pumps_vacuum.Ui_Pumps_Vacuum(variables, conf, SignalEmitter, parent=None)[source]
Bases:
objectConstructor for the Pumps and Vacuum UI class.
- Parameters:
- Returns:
None
- error_message(message)[source]
Show the warning message :param message: the message to be shown
- Returns:
None
- retranslateUi(Pumps_Vacuum)[source]
Set the text and title of the widgets :param Pumps_Vacuum: the main window
- Returns:
None
- setupUi(Pumps_Vacuum)[source]
Sets up the UI for the Pumps and Vacuum tab. :param Pumps_Vacuum: Pumps and Vacuum tab widget. :type Pumps_Vacuum: object
- Returns:
None
- update_target_temperature_cryo()[source]
Update the temperature value of the cryo head :param None:
- Returns:
None
- update_target_temperature_ll()[source]
Update the temperature value of the load lock :param None:
- Returns:
None
- update_temperature_cryo(value)[source]
Update the temperature value in the GUI :param value: the temperature value of cryo head
- Returns:
None
- update_temperature_cryo_inside(value)[source]
Update the temperature value of cryo head inside sensor in the GUI. :param value: the temperature value of cryo head inside
- Returns:
None
- update_temperature_ll(value)[source]
Update the temperature value in the GUI :param value: the temperature value of load lock
- Returns:
None
pyccapt.control.gui.gui_stage_control module
pyccapt.control.gui.gui_visualization module
- class pyccapt.control.gui.gui_visualization.Ui_Visualization(variables, conf, x_plot, y_plot, t_plot, main_v_dc_plot)[source]
Bases:
objectConstructor for the Visualization UI class.
- Parameters:
variables (object) – Global experiment variables.
conf (dict) – Configuration settings.
x_plot (multiprocessing.Array) – Array for storing the x-axis values of the mass spectrum.
y_plot (multiprocessing.Array) – Array for storing the y-axis values of the mass spectrum.
t_plot (multiprocessing.Array) – Array for storing the time values of the mass spectrum.
main_v_dc_plot (multiprocessing.Array) – Array for storing the main voltage values of the mass spectrum.
- detection_rate_range()[source]
Change the time range of the detection rate
- Parameters:
None
- Returns:
None
- error_message(message)[source]
Display an error message and start a timer to hide it after 8 seconds
- Parameters:
message (str) – Error message to display
- Returns:
None
- heatmap_fdm_switch_change()[source]
No-op kept for backward compatibility.
Hitmap and FDM are now rendered side-by-side in their own panels (detector_heatmap + detector_fdm) every refresh - there is no longer anything to toggle. Any external code that still clicks the (now-hidden) heatmap_fdm_switch button just lands here harmlessly.
- parameters_changes()[source]
Change the parameters for the mass spectrum :param None:
- Returns:
None
- retranslateUi(Visualization)[source]
Set the text of the widgets Args: Visualization: The main window
Return: None
- setupUi(Visualization)[source]
Setup the UI for the Visualization window.
Args: Visualization (QMainWindow): Visualization window.
Return: None
- spectrum_last_events()[source]
Display the last events in the mass spectrum :param None:
- Returns:
None
- spectrum_switch_mc_tof()[source]
Switch between mass spectrum and time of flight spectrum :param None:
- Returns:
None
- class pyccapt.control.gui.gui_visualization.VisualizationWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetWidget for the Visualization window.
Constructor for the VisualizationWindow class.
- Parameters:
variables – Shared variables.
gui_visualization – Instance of the Visualization.
visualization_close_event – multiprocessing.Event signalled by this window when closed by the user.
command_queue – multiprocessing.Queue of typed string commands from the main GUI (“show”, “show_front”, “hide”).
- pyccapt.control.gui.gui_visualization.run_visualization_window(variables, conf, visualization_closed_event, visualization_command_queue, x_plot, y_plot, t_plot, main_v_dc_plot)[source]
Run the Cameras window in a separate process.
- Parameters:
variables – Shared variables.
conf – Configuration dictionary.
visualization_closed_event – Event for the Visualization window closed.
visualization_win_front – Event for the Visualization window front.
x_plot – x plot
y_plot – y plot
t_plot – t plot
main_v_dc_plot – main v dc plot
- Returns:
None