8.6.5.3. pymodaq_gui.parameter.utils module
- class pymodaq_gui.parameter.utils.ParameterWithPath(parameter, path=None)[source]
Bases:
SerializableBaseholds together a Parameter object and its full path
To be used when communicating between TCPIP to reconstruct properly the Parameter
- Variables:
parameter (
Parameter) – a Parameter objectpath (
full pathofthe parameter (a listofnames,an empty tuple is also used for a parameter not in a tree),) – if None it is constructed from the parameter parents
- Attributes:
- parameter
- path
Methods
deserialize(bytes_str)Convert bytes into a ParameterWithPath object
value()The value of the parameter
serialize
- pymodaq_gui.parameter.utils.change_visibility_all_descendants(param, visible=True)[source]
Recursively show all descendants of a parameter
- Return type:
- pymodaq_gui.parameter.utils.compareParameters(param1, param2, with_self=True)[source]
Compare the structure and the opts of two parameters with their children, return True if structure and all opts are identical. If with_self is False, only the children opts are compared.
- pymodaq_gui.parameter.utils.compareStructureParameter(param1, param2)[source]
Compare the structure of two parameters with their children, return True if structure is identical
- pymodaq_gui.parameter.utils.compareValuesParameter(param1, param2, with_self=True)[source]
Compare the structure and the values of two parameters with their children, return True if structures and values are identical. If with_self is False, only the children opts are compared.
- pymodaq_gui.parameter.utils.filter_parameter_tree(param, search_text='')[source]
Filter parameter tree based on search text. Returns True if this parameter or any of its children match the search.
- Return type:
- pymodaq_gui.parameter.utils.getOpts(param)[source]
Return an OrderedDict with tree structures of all opts for all children of this parameter
- Parameters:
param (
Parameter)- Return type:
- pymodaq_gui.parameter.utils.getStruct(param)[source]
Return an OrderedDict with tree structures of all children of this parameter
- Parameters:
param (
Parameter)- Return type:
- pymodaq_gui.parameter.utils.getValues(param)[source]
Return an OrderedDict with tree structures of all values for all children of this parameter
- Parameters:
param (
Parameter)- Return type:
- pymodaq_gui.parameter.utils.get_param_dict_from_name(parent_list, name, pop=False)[source]
Get dict under parent whose name is name. The parent_list structure is the one used to init a Parameter object
- pymodaq_gui.parameter.utils.get_param_from_name(parent, name)[source]
Get Parameter under parent whose name is name
- pymodaq_gui.parameter.utils.get_param_path(param)[source]
Get the parameter path from its highest parent down to the given parameter including its identifier (name)
- pymodaq_gui.parameter.utils.get_widget_from_tree(parameter_tree, widget_instance)[source]
Get the widgets of the items of a ParameterTree whose class has the name of the given class
- pymodaq_gui.parameter.utils.is_name_in_dict(dict_tmp, name)[source]
Check if a dict, as used to init a Parameter, has the given name
- Return type:
- pymodaq_gui.parameter.utils.iter_children(param, childlist=None, filter_type=(), filter_name=(), select_filter=False)[source]
Get a list of parameters’ name under a given Parameter (see iter_children_params)
- Returns:
The list of the children name from the given node.
- Return type:
- pymodaq_gui.parameter.utils.iter_children_params(param, childlist=None, output_type=None, filter_type=(), filter_name=(), select_filter=False)[source]
Get a list of parameters under a given Parameter.
- Parameters:
param (
Parameter) – the root node to be coursedchildlist (
Optional[list]) – the child/output list, the results are appended to it. A new list is used if Noneoutput_type (
Optional[str]) – the attribute of parameter that will be added to the output listfilter_type (
Iterable[str]) – filter children sharing those typesfilter_name (
Iterable[str]) – filter children sharing those namesselect_filter (
bool) – if True, add filtered parameters to output list. if False (default), add non-filtered parameter to output list.
- Returns:
The list of the children from the given node.
- Return type:
- pymodaq_gui.parameter.utils.scroll_linear(scroll_val, min_val, max_val)[source]
Convert a scroll value [0-100] to a linear scale between min_val and max_val
- pymodaq_gui.parameter.utils.scroll_log(scroll_val, min_val, max_val)[source]
Convert a scroll value [0-100] to a log scale between min_val and max_val
- pymodaq_gui.parameter.utils.set_param_from_param(param_old, param_new)[source]
Walk through parameters children and set values using new parameter values.
- Return type: