nomad_camels package

Subpackages

Submodules

nomad_camels.CAMELS_start module

class nomad_camels.CAMELS_start.LoadingScreen

Bases: QDialog

set_progress(value)
Parameters:

value

set_text(text)
Parameters:

text

staticMetaObject = PySide6.QtCore.QMetaObject("LoadingScreen" inherits "QDialog": )
nomad_camels.CAMELS_start.start_camels()

nomad_camels.MainApp_v2 module

class nomad_camels.MainApp_v2.MainWindow(parent=None)

Bases: Ui_MainWindow, QMainWindow

Main Window for the program. Connects to all the other classes.

add_button_to_manuals(name)
Parameters:

name

add_button_to_meas(name)
Parameters:

name

add_functions_to_manual_button(button, name)
Parameters:
  • button

  • name

add_functions_to_meas_button(button, name)
Parameters:
  • button

  • name

add_manual_control()
add_manual_control_to_data(control_data)
Parameters:

control_data

add_measurement_protocol()
add_prot_to_data(protocol)
Parameters:

protocol

add_subs_and_plots_from_dict(dictionary)
Parameters:

dictionary

add_to_open_windows(window)
Parameters:

window

add_to_plots(plot)
Parameters:

plot

bluesky_setup()
build_protocol(protocol_name, ask_file=True)

Calls the build_protocol from nomad_camels.bluesky_handling.protocol_builder for the selected protocol and provides it with a savepath and user- and sample-data.

Parameters:
  • protocol_name

  • ask_file – (Default value = True)

change_catalog_name()
change_preferences()
Called when any preferences are changed. Makes the dictionary

of preferences and calls save_preferences from the load_save_functions module.

change_preset(preset)

saves the old device preset, then changes to / loads the new preset.

Parameters:

preset

change_theme()
change_user_type()

Shows / hides the ui-elements depending on the type of user, e.g. the NOMAD login button is only shown if NOMAD user is selected.

check_password_protection()
close() bool

Calling the save_state method when closing the window.

closeEvent(a0)

Calling the save_state method when closing the window.

Parameters:

a0

close_manual_control(control, name)
Parameters:
  • control

  • name

close_plots()
edit_sample_info()

Calls dialog for user-information when pushButton_editSampleInfo is clicked.

The opened AddRemoveDialoge contains columns for Name, Identifier, and Preparation-Info. If the dialog is canceled, nothing is changed, otherwise the new data will be written into self.userdata.

edit_user_info()

Calls dialog for user-information when pushButton_editUserInfo is clicked.

The opened AddRemoveDialoge contains columns for Name, E-Mail, Affiliation, Address, ORCID and Phone of the user. If the dialog is canceled, nothing is changed, otherwise the new data will be written into self.userdata.

get_sample_name_data()
get_user_name_data()
import_measurement_protocol()
launch_data_exporter()
launch_device_builder()
launch_epics_builder()
launch_hdf5_exporter()
load_backup_preset()

Opens a QFileDialog in the Backup-folder of the presets. If a backup is selected, the current preset is put into backup.

load_extensions()
load_preferences()

Loads the preferences.

Those may contain: - autosave: turn on / off autosave on closing the program. - dark_mode: turning dark-mode on / off. - number_format: the number format for display, can be either “mixed”, “plain” or “scientific”. - mixed_from: the exponent from where to switch to scientific format, if number_format is “mixed”. - n_decimals: the number of displayed decimals of a number. - py_files_path: the path, where python files (e.g. protocols) are created. - meas_files_path: the path, where measurement data is stored. - device_driver_path: the path, where NOMAD CAMELS can find the installed devices. - databroker_catalog_name: the name of the databroker catalog

load_preset(preset)

Called when loading a preset (e.g. when loading the last state). Opens the given preset.

Parameters:

preset

load_sample_data()

Loading the dictionary from %localappdata%/sampledata.json, selecting the active sample and saving the rest into self.sampledata.

load_state()

Loads the most recent presets.

load_user_data()

Loading the dictionary from %localappdata%/userdata.json, selecting the active user and saving the rest into self.userdata.

login_logout_nomad()

Handles logging in / out of NOMAD when the respective button is pushed

login_nomad()

Handles the login to NOMAD. If the login is successful, the UI is adapted to show all the NOMAD-related buttons.

make_save_dict()
manage_extensions()
manage_instruments()
manual_control_order_changed(order)
Parameters:

order

new_preset()

Create a new, empty device-preset via a QFileDialog.

open_data_path(protocol_name)
open_manual_control_config(control_name)
Parameters:

control_name

open_protocol(protocol_name)
Parameters:

protocol_name

open_protocol_config(prot_name)
Parameters:

prot_name

pause_protocol()
populate_manuals_buttons()
populate_meas_buttons()
propagate_exception(exception)
protocol_finished(*args)
Parameters:

*args

protocol_order_changed(order)
Parameters:

order

protocol_stepper_signal
remove_manual_control(control_name)
Parameters:

control_name

remove_protocol(prot_name)
Parameters:

prot_name

resume_protocol()
run_done_file_signal
run_protocol(protocol_name)

This function runs the given protocol protocol_name. First the protocol is built, then imported. The used instruments are instantiated with device_handling.instantiate_devices and functions from the protocol like creating plots are called.

If everything runs correctly and a nomad upload should be done, after protocol_finished is called, this function will wait for it and then handle the upload.

run_protocol_part2()
save_preset_as()

Opens a QFileDialog to save the device preset. A backup / autosave of the preset is made automatically.

save_sample_data()

Calling the save_dictionary function with the savefile as %localappdata%/sampledata.json and self.sampledata as dictionary.

save_state(fromload=False, do_backup=True)

Saves the current states of both presets.

Parameters:
  • fromload – (Default value = False)

  • do_backup – (Default value = True)

save_user_data()

Calling the save_dictionary function with the savefile as %localappdata%/userdata.json and self.userdata as dictionary.

select_nomad_sample()
show_nomad_sample()
show_nomad_upload()

Shows / hides the settings for directly uploading data to NOMAD.

start_manual_control(name)
Parameters:

name

staticMetaObject = PySide6.QtCore.QMetaObject("MainWindow" inherits "QMainWindow": Methods:   #39 type=Signal, signature=protocol_stepper_signal(int), parameters=int   #40 type=Signal, signature=run_done_file_signal(QString), parameters=QString )
stop_protocol()
toggle_dark_mode()

Turning dark mode on / off, called whenever the settings are changed. Using qdarkstyle to provide the stylesheets.

update_channels()

Called when the active devices change. The channels in variables_handling are updated with the ones provided by the active devices.

update_man_cont_data(control_data, old_name)
Parameters:
  • control_data

  • old_name

update_preference_settings()
update_prot_data(protocol, old_name)
Parameters:
  • protocol

  • old_name

with_or_without_instruments()

Module contents