8.5.4.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
- parameter
a Parameter object
- Type:
Parameter
- path
- Type:
full pathofthe parameter,if None it is constructed from the parameter parents
- Attributes:
- parameter
- path
Methods
deserialize(bytes_str)Convert bytes into a ParameterWithPath object
serialize
value
- classmethod deserialize(bytes_str)[source]
Convert bytes into a ParameterWithPath object
- Return type:
Union[ParameterWithPath,Tuple[ParameterWithPath,bytes]]- Returns:
ParameterWithPath (
the decoded object)bytes (
the remaining bytes string if any)
- property parameter: Parameter
- pymodaq_gui.parameter.utils.change_visibility_all_descendants(param, visible=True)[source]
Recursively show all descendants of a parameter
- 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
- Parameters:
param1 (
Parameter)param2 (
Parameter)
- Return type:
- 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
- Parameters:
parent_list (
(listofdicts) as definedtoinit Parameter object)name (
(str) valuetofind for the key:name)pop (
(bool) if True remove the matched dict from parent)
- Return type:
dict the matched dict
- pymodaq_gui.parameter.utils.get_param_from_name(parent, name)[source]
Get Parameter under parent whose name is name
- Parameters:
parent (
Parameter)name (
str)
- Return type:
Parameter
- 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.iter_children(param, childlist=[], 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=[], output_type=None, filter_type=(), filter_name=(), select_filter=False)[source]
Get a list of parameters under a given Parameter.
- Parameters:
param (
Parameter (pyqtgraph)) – the root node to be coursedchildlist (
list) – the child/output listoutput_type (
str) – the attribute of parameter that will be added to the output listfilter_type (
list) – filter children sharing those typesfilter_name (
list) – 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
- Parameters:
scroll
min_val
max_val
- Return type:
the scaled value