Skip to content

Metadata module, notes for developers

Aurore Finco edited this page Feb 11, 2022 · 2 revisions

Files involved

  • GUI files:

    • metadatagui.py
    • ui_metadatagui.ui
  • Logic files (only modified):

    • save_logic.py
    • odmr_logic.py
    • more to come...

General working principle

This module does not have its own logic, it just connects to the save logic.
When a parameter is added, the metadatagui calls the update_additional_parameters function of the save logic. The save logic is now modified to echo this change on the remote save logic, if connected, again simply by calling the update_additional_parameters function.
The save logic now sends 2 signals:

  • sigAddParamsUpdated when the _additional_parameters dictionary is updated. This signal is connected to the function update_param_list in the GUI, which handles the widgets.
  • sigFileSaved, which sends the module name and the timestamp everytime you save a data file. These are then displayed in the GUI by the function display_saved_file

Handling of the GUI widgets

All the GUI widgets that can appear or disappear are stored in a dictionary entry_dict. The keys of this dictionary are the same as the keys of the _additional_parameters dictionary of the savelogic. Each element of entry_dict is a tuple of length 3, containing:

  • The label, whose text is the same as the dict key.
  • The input widget, either a QDoubleSpinBox or a modified QTextEdit depending on the input type. If what is enters by the user can be converted to a float, we consider it as a number and use a QDoubleSpinBox. The modified QTextEdit is defined in the file qtwidgets/text_edit.py, the purpose of the modification is to send signals only when the editing is finished. This input widget is connected to the function update_value, which is actually calling the update_additional_parameters function in the save logic.
  • The remove button, which is directly connected to the function remove_additional_parameter in the save logic.

What are the other modules writing as metadata?

ODMR module

This module sends the CW parameters as metadata. When you start the CW, the following parameters are set:

  • CW microwave (set to ON)
  • CW frequency (Hz)
  • CW power (dBm) When you stop the CW, the frequency and power parameters are removed, and parameter CW microwave is set to OFF.