pymodaq 5.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pymodaq/__init__.py +98 -0
- pymodaq/control_modules/__init__.py +1 -0
- pymodaq/control_modules/daq_move.py +1238 -0
- pymodaq/control_modules/daq_move_ui/__init__.py +0 -0
- pymodaq/control_modules/daq_move_ui/factory.py +48 -0
- pymodaq/control_modules/daq_move_ui/ui_base.py +359 -0
- pymodaq/control_modules/daq_move_ui/uis/__init__.py +0 -0
- pymodaq/control_modules/daq_move_ui/uis/binary.py +139 -0
- pymodaq/control_modules/daq_move_ui/uis/original.py +120 -0
- pymodaq/control_modules/daq_move_ui/uis/relative.py +124 -0
- pymodaq/control_modules/daq_move_ui/uis/simple.py +126 -0
- pymodaq/control_modules/daq_viewer.py +1517 -0
- pymodaq/control_modules/daq_viewer_ui.py +407 -0
- pymodaq/control_modules/mocks.py +57 -0
- pymodaq/control_modules/move_utility_classes.py +1141 -0
- pymodaq/control_modules/thread_commands.py +137 -0
- pymodaq/control_modules/ui_utils.py +72 -0
- pymodaq/control_modules/utils.py +591 -0
- pymodaq/control_modules/viewer_utility_classes.py +670 -0
- pymodaq/daq_utils/__init__.py +0 -0
- pymodaq/daq_utils/daq_utils.py +6 -0
- pymodaq/dashboard.py +2396 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Client.aliases +3 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Client.lvlps +3 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Client.lvproj +32 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Client.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Server_1Dgaussian.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_Server_2Dgaussian.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_read_cmd.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_read_float.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_read_int.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_send_data.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_send_int.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_send_scalar.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/DAQ_TCP_send_string.vi +0 -0
- pymodaq/examples/Labview_TCP_Client/client_state.ctl +0 -0
- pymodaq/examples/Labview_TCP_Client/cmd_types.ctl +0 -0
- pymodaq/examples/__init__.py +0 -0
- pymodaq/examples/function_plotter.py +160 -0
- pymodaq/examples/nonlinearscanner.py +126 -0
- pymodaq/examples/qt_less_standalone_module.py +165 -0
- pymodaq/examples/tcp_client.py +97 -0
- pymodaq/extensions/__init__.py +25 -0
- pymodaq/extensions/adaptive/__init__.py +2 -0
- pymodaq/extensions/adaptive/adaptive_optimization.py +179 -0
- pymodaq/extensions/adaptive/loss_function/_1d_loss_functions.py +73 -0
- pymodaq/extensions/adaptive/loss_function/_2d_loss_functions.py +73 -0
- pymodaq/extensions/adaptive/loss_function/__init__.py +3 -0
- pymodaq/extensions/adaptive/loss_function/loss_factory.py +110 -0
- pymodaq/extensions/adaptive/utils.py +123 -0
- pymodaq/extensions/bayesian/__init__.py +2 -0
- pymodaq/extensions/bayesian/acquisition/__init__.py +2 -0
- pymodaq/extensions/bayesian/acquisition/acquisition_function_factory.py +80 -0
- pymodaq/extensions/bayesian/acquisition/base_acquisition_function.py +105 -0
- pymodaq/extensions/bayesian/bayesian_optimization.py +143 -0
- pymodaq/extensions/bayesian/utils.py +180 -0
- pymodaq/extensions/console.py +73 -0
- pymodaq/extensions/daq_logger/__init__.py +1 -0
- pymodaq/extensions/daq_logger/abstract.py +52 -0
- pymodaq/extensions/daq_logger/daq_logger.py +519 -0
- pymodaq/extensions/daq_logger/db/__init__.py +0 -0
- pymodaq/extensions/daq_logger/db/db_logger.py +300 -0
- pymodaq/extensions/daq_logger/db/db_logger_models.py +100 -0
- pymodaq/extensions/daq_logger/h5logging.py +84 -0
- pymodaq/extensions/daq_scan.py +1218 -0
- pymodaq/extensions/daq_scan_ui.py +241 -0
- pymodaq/extensions/data_mixer/__init__.py +0 -0
- pymodaq/extensions/data_mixer/daq_0Dviewer_DataMixer.py +97 -0
- pymodaq/extensions/data_mixer/data_mixer.py +262 -0
- pymodaq/extensions/data_mixer/model.py +108 -0
- pymodaq/extensions/data_mixer/models/__init__.py +0 -0
- pymodaq/extensions/data_mixer/models/equation_model.py +91 -0
- pymodaq/extensions/data_mixer/models/gaussian_fit_model.py +65 -0
- pymodaq/extensions/data_mixer/parser.py +53 -0
- pymodaq/extensions/data_mixer/utils.py +23 -0
- pymodaq/extensions/h5browser.py +9 -0
- pymodaq/extensions/optimizers_base/__init__.py +0 -0
- pymodaq/extensions/optimizers_base/optimizer.py +1016 -0
- pymodaq/extensions/optimizers_base/thread_commands.py +22 -0
- pymodaq/extensions/optimizers_base/utils.py +427 -0
- pymodaq/extensions/pid/__init__.py +16 -0
- pymodaq/extensions/pid/actuator_controller.py +14 -0
- pymodaq/extensions/pid/daq_move_PID.py +154 -0
- pymodaq/extensions/pid/pid_controller.py +1016 -0
- pymodaq/extensions/pid/utils.py +189 -0
- pymodaq/extensions/utils.py +111 -0
- pymodaq/icon.ico +0 -0
- pymodaq/post_treatment/__init__.py +6 -0
- pymodaq/post_treatment/load_and_plot.py +352 -0
- pymodaq/resources/__init__.py +0 -0
- pymodaq/resources/config_template.toml +57 -0
- pymodaq/resources/preset_default.xml +1 -0
- pymodaq/resources/setup_plugin.py +73 -0
- pymodaq/splash.png +0 -0
- pymodaq/utils/__init__.py +0 -0
- pymodaq/utils/array_manipulation.py +6 -0
- pymodaq/utils/calibration_camera.py +180 -0
- pymodaq/utils/chrono_timer.py +203 -0
- pymodaq/utils/config.py +53 -0
- pymodaq/utils/conftests.py +5 -0
- pymodaq/utils/daq_utils.py +158 -0
- pymodaq/utils/data.py +128 -0
- pymodaq/utils/enums.py +6 -0
- pymodaq/utils/exceptions.py +38 -0
- pymodaq/utils/gui_utils/__init__.py +10 -0
- pymodaq/utils/gui_utils/loader_utils.py +75 -0
- pymodaq/utils/gui_utils/utils.py +18 -0
- pymodaq/utils/gui_utils/widgets/lcd.py +8 -0
- pymodaq/utils/h5modules/__init__.py +2 -0
- pymodaq/utils/h5modules/module_saving.py +526 -0
- pymodaq/utils/leco/__init__.py +25 -0
- pymodaq/utils/leco/daq_move_LECODirector.py +217 -0
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +163 -0
- pymodaq/utils/leco/director_utils.py +74 -0
- pymodaq/utils/leco/leco_director.py +166 -0
- pymodaq/utils/leco/pymodaq_listener.py +364 -0
- pymodaq/utils/leco/rpc_method_definitions.py +43 -0
- pymodaq/utils/leco/utils.py +74 -0
- pymodaq/utils/logger.py +6 -0
- pymodaq/utils/managers/__init__.py +0 -0
- pymodaq/utils/managers/batchscan_manager.py +346 -0
- pymodaq/utils/managers/modules_manager.py +589 -0
- pymodaq/utils/managers/overshoot_manager.py +242 -0
- pymodaq/utils/managers/preset_manager.py +229 -0
- pymodaq/utils/managers/preset_manager_utils.py +262 -0
- pymodaq/utils/managers/remote_manager.py +484 -0
- pymodaq/utils/math_utils.py +6 -0
- pymodaq/utils/messenger.py +6 -0
- pymodaq/utils/parameter/__init__.py +10 -0
- pymodaq/utils/parameter/utils.py +6 -0
- pymodaq/utils/scanner/__init__.py +5 -0
- pymodaq/utils/scanner/scan_config.py +16 -0
- pymodaq/utils/scanner/scan_factory.py +259 -0
- pymodaq/utils/scanner/scan_selector.py +477 -0
- pymodaq/utils/scanner/scanner.py +324 -0
- pymodaq/utils/scanner/scanners/_1d_scanners.py +174 -0
- pymodaq/utils/scanner/scanners/_2d_scanners.py +299 -0
- pymodaq/utils/scanner/scanners/__init__.py +1 -0
- pymodaq/utils/scanner/scanners/sequential.py +224 -0
- pymodaq/utils/scanner/scanners/tabular.py +319 -0
- pymodaq/utils/scanner/utils.py +110 -0
- pymodaq/utils/svg/__init__.py +6 -0
- pymodaq/utils/svg/svg_renderer.py +20 -0
- pymodaq/utils/svg/svg_view.py +35 -0
- pymodaq/utils/svg/svg_viewer2D.py +50 -0
- pymodaq/utils/tcp_ip/__init__.py +6 -0
- pymodaq/utils/tcp_ip/mysocket.py +12 -0
- pymodaq/utils/tcp_ip/serializer.py +13 -0
- pymodaq/utils/tcp_ip/tcp_server_client.py +772 -0
- pymodaq-5.1.6.dist-info/METADATA +238 -0
- pymodaq-5.1.6.dist-info/RECORD +154 -0
- pymodaq-5.1.6.dist-info/WHEEL +4 -0
- pymodaq-5.1.6.dist-info/entry_points.txt +7 -0
- pymodaq-5.1.6.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import random
|
|
2
|
+
|
|
3
|
+
from pymodaq_utils.logger import set_logger, get_module_name
|
|
4
|
+
from pymodaq_utils import utils
|
|
5
|
+
|
|
6
|
+
from pymodaq_gui.parameter.pymodaq_ptypes import registerParameterType, GroupParameter
|
|
7
|
+
from pymodaq_gui.parameter.utils import get_param_dict_from_name
|
|
8
|
+
|
|
9
|
+
from pymodaq.control_modules.move_utility_classes import params as daq_move_params
|
|
10
|
+
from pymodaq.control_modules.viewer_utility_classes import params as daq_viewer_params
|
|
11
|
+
from pymodaq.utils.daq_utils import get_plugins
|
|
12
|
+
|
|
13
|
+
logger = set_logger(get_module_name(__file__))
|
|
14
|
+
|
|
15
|
+
DAQ_Move_Stage_type = get_plugins('daq_move')
|
|
16
|
+
DAQ_0DViewer_Det_types = get_plugins('daq_0Dviewer')
|
|
17
|
+
DAQ_1DViewer_Det_types = get_plugins('daq_1Dviewer')
|
|
18
|
+
DAQ_2DViewer_Det_types = get_plugins('daq_2Dviewer')
|
|
19
|
+
DAQ_NDViewer_Det_types = get_plugins('daq_NDviewer')
|
|
20
|
+
|
|
21
|
+
# Fixed names that will sort the plugin in remote/mock
|
|
22
|
+
REMOTE_ITEMS = {'LECODirector', 'TCPServer'}
|
|
23
|
+
MOCK_ITEMS = {}
|
|
24
|
+
|
|
25
|
+
def iterative_show_pb(params):
|
|
26
|
+
for param in params:
|
|
27
|
+
if param['type'] == 'itemselect' or param['type'] == 'list':
|
|
28
|
+
param['show_pb'] = True
|
|
29
|
+
elif 'children' in param:
|
|
30
|
+
iterative_show_pb(param['children'])
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def find_last_index(list_children:list=[], name_prefix ='',format_string='02.0f'):
|
|
34
|
+
# Custom function to find last available index
|
|
35
|
+
child_indexes = ([int(par.name()[len(name_prefix) + 1:]) for par in list_children if name_prefix in par.name()])
|
|
36
|
+
if child_indexes == []:
|
|
37
|
+
newindex = 0
|
|
38
|
+
else:
|
|
39
|
+
newindex = max(child_indexes) + 1
|
|
40
|
+
return f'{newindex:{format_string}}'
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def categorize_items(item_list, remote_items=None, mock_items=None):
|
|
44
|
+
"""
|
|
45
|
+
Core function: categorize any list of items into Mock/Plugin/Remote.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
item_list: List of items to categorize
|
|
49
|
+
remote_items: Custom set of remote items (optional)
|
|
50
|
+
mock_items: Custom set of mock items (optional)
|
|
51
|
+
|
|
52
|
+
Returns: dict {category: [items]} with only non-empty categories
|
|
53
|
+
"""
|
|
54
|
+
remote_items = remote_items or REMOTE_ITEMS
|
|
55
|
+
mock_items = mock_items or MOCK_ITEMS
|
|
56
|
+
|
|
57
|
+
categorized = {'Remote': [], 'Mock': [], 'Plugin': []}
|
|
58
|
+
|
|
59
|
+
for item in item_list:
|
|
60
|
+
if item in remote_items:
|
|
61
|
+
categorized['Remote'].append(item)
|
|
62
|
+
elif item in mock_items or 'mock' in item.lower():
|
|
63
|
+
categorized['Mock'].append(item)
|
|
64
|
+
else:
|
|
65
|
+
categorized['Plugin'].append(item)
|
|
66
|
+
|
|
67
|
+
# Return only non-empty categories
|
|
68
|
+
return {k: v for k, v in categorized.items() if v}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def add_category_layers(dimension_dict, remote_items=None, mock_items=None):
|
|
72
|
+
"""
|
|
73
|
+
Add category layers to a dimension dictionary.
|
|
74
|
+
Uses categorize_items for each dimension.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
dimension_dict: {dimension: [items]}
|
|
78
|
+
|
|
79
|
+
Returns: {dimension: {category: [items]}}
|
|
80
|
+
"""
|
|
81
|
+
result = {}
|
|
82
|
+
|
|
83
|
+
for dimension, items in dimension_dict.items():
|
|
84
|
+
# Reuse the core categorization function
|
|
85
|
+
result[dimension] = categorize_items(items, remote_items, mock_items)
|
|
86
|
+
|
|
87
|
+
return result
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def make_move_params(typ):
|
|
91
|
+
params = daq_move_params
|
|
92
|
+
iterative_show_pb(params)
|
|
93
|
+
|
|
94
|
+
parent_module = utils.find_dict_in_list_from_key_val(DAQ_Move_Stage_type, 'name', typ)
|
|
95
|
+
class_ = getattr(getattr(parent_module['module'], 'daq_move_' + typ),
|
|
96
|
+
'DAQ_Move_' + typ)
|
|
97
|
+
params_hardware = getattr(class_, 'params')
|
|
98
|
+
iterative_show_pb(params_hardware)
|
|
99
|
+
|
|
100
|
+
for main_child in params:
|
|
101
|
+
if main_child['name'] == 'move_settings':
|
|
102
|
+
main_child['children'] = params_hardware
|
|
103
|
+
controller_dict = get_param_dict_from_name(params_hardware, 'controller_ID')
|
|
104
|
+
controller_dict['value'] = random.randint(0, 9999)
|
|
105
|
+
|
|
106
|
+
elif main_child['name'] == 'main_settings':
|
|
107
|
+
typ_dict = get_param_dict_from_name(main_child['children'], 'move_type')
|
|
108
|
+
typ_dict['value'] = typ
|
|
109
|
+
|
|
110
|
+
return params
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def make_viewer_params(typ):
|
|
114
|
+
params = daq_viewer_params
|
|
115
|
+
iterative_show_pb(params)
|
|
116
|
+
|
|
117
|
+
for main_child in params:
|
|
118
|
+
if main_child['name'] == 'main_settings':
|
|
119
|
+
for child in main_child['children']:
|
|
120
|
+
if child['name'] == 'DAQ_type':
|
|
121
|
+
child['value'] = typ[0:5]
|
|
122
|
+
if child['name'] == 'detector_type':
|
|
123
|
+
child['value'] = typ[6:]
|
|
124
|
+
if child['name'] == 'controller_status':
|
|
125
|
+
child['visible'] = True
|
|
126
|
+
|
|
127
|
+
if '0D' in typ:
|
|
128
|
+
parent_module = utils.find_dict_in_list_from_key_val(DAQ_0DViewer_Det_types, 'name', typ[6:])
|
|
129
|
+
class_ = getattr(getattr(parent_module['module'], 'daq_0Dviewer_' + typ[6:]), 'DAQ_0DViewer_' + typ[6:])
|
|
130
|
+
elif '1D' in typ:
|
|
131
|
+
parent_module = utils.find_dict_in_list_from_key_val(DAQ_1DViewer_Det_types, 'name', typ[6:])
|
|
132
|
+
class_ = getattr(getattr(parent_module['module'], 'daq_1Dviewer_' + typ[6:]), 'DAQ_1DViewer_' + typ[6:])
|
|
133
|
+
elif '2D' in typ:
|
|
134
|
+
parent_module = utils.find_dict_in_list_from_key_val(DAQ_2DViewer_Det_types, 'name', typ[6:])
|
|
135
|
+
class_ = getattr(getattr(parent_module['module'], 'daq_2Dviewer_' + typ[6:]), 'DAQ_2DViewer_' + typ[6:])
|
|
136
|
+
elif 'ND' in typ:
|
|
137
|
+
parent_module = utils.find_dict_in_list_from_key_val(DAQ_NDViewer_Det_types, 'name', typ[6:])
|
|
138
|
+
class_ = getattr(getattr(parent_module['module'], 'daq_NDviewer_' + typ[6:]), 'DAQ_NDViewer_' + typ[6:])
|
|
139
|
+
for main_child in params:
|
|
140
|
+
if main_child['name'] == 'main_settings':
|
|
141
|
+
for child in main_child['children']:
|
|
142
|
+
if child['name'] == 'axes':
|
|
143
|
+
child['visible'] = True
|
|
144
|
+
|
|
145
|
+
params_hardware = getattr(class_, 'params')
|
|
146
|
+
iterative_show_pb(params_hardware)
|
|
147
|
+
|
|
148
|
+
for main_child in params:
|
|
149
|
+
# Was this condition useful?
|
|
150
|
+
# if main_child['name'] == 'detector_settings':
|
|
151
|
+
# while len(main_child['children']) > 0:
|
|
152
|
+
# for child in main_child['children']:
|
|
153
|
+
# main_child['children'].remove(child)
|
|
154
|
+
|
|
155
|
+
# main_child['children'].extend(params_hardware)
|
|
156
|
+
if main_child['name'] == 'detector_settings':
|
|
157
|
+
main_child['children'] = params_hardware
|
|
158
|
+
controller_dict = get_param_dict_from_name(main_child['children'], 'controller_ID')
|
|
159
|
+
controller_dict['value'] = random.randint(0, 9999)
|
|
160
|
+
|
|
161
|
+
return params
|
|
162
|
+
|
|
163
|
+
class PresetScalableGroupMove(GroupParameter):
|
|
164
|
+
"""
|
|
165
|
+
|
|
|
166
|
+
|
|
167
|
+
================ =============
|
|
168
|
+
**Attributes** **Type**
|
|
169
|
+
*opts* dictionnary
|
|
170
|
+
================ =============
|
|
171
|
+
|
|
172
|
+
See Also
|
|
173
|
+
--------
|
|
174
|
+
hardware.DAQ_Move_Stage_type
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
def __init__(self, **opts):
|
|
178
|
+
opts['type'] = 'groupmove'
|
|
179
|
+
opts['addText'] = "Add"
|
|
180
|
+
opts['addMenu'] = categorize_items([mov['name'] for mov in DAQ_Move_Stage_type])
|
|
181
|
+
super().__init__(**opts)
|
|
182
|
+
|
|
183
|
+
def addNew(self, typ:tuple):
|
|
184
|
+
"""
|
|
185
|
+
Add a child.
|
|
186
|
+
|
|
187
|
+
=============== ===========
|
|
188
|
+
**Parameters** **Type**
|
|
189
|
+
*typ* string
|
|
190
|
+
=============== ===========
|
|
191
|
+
"""
|
|
192
|
+
name_prefix = 'move'
|
|
193
|
+
typ = typ[-1] #Only need last entry here
|
|
194
|
+
new_index = find_last_index(self.children(), name_prefix, format_string='02.0f')
|
|
195
|
+
params = make_move_params(typ)
|
|
196
|
+
child = {'title': f'Actuator {new_index}',
|
|
197
|
+
'name': f'{name_prefix}{new_index}',
|
|
198
|
+
'type': 'group',
|
|
199
|
+
'removable': True, 'renamable': False,
|
|
200
|
+
'children': [
|
|
201
|
+
{'title': 'Name:', 'name': 'name', 'type': 'str',
|
|
202
|
+
'value': f'Move {new_index}'},
|
|
203
|
+
{'title': 'Init?:', 'name': 'init', 'type': 'bool', 'value': True},
|
|
204
|
+
{'title': 'Settings:', 'name': 'params', 'type': 'group', 'children': params},
|
|
205
|
+
]}
|
|
206
|
+
self.addChild(child)
|
|
207
|
+
|
|
208
|
+
registerParameterType('groupmove', PresetScalableGroupMove, override=True)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class PresetScalableGroupDet(GroupParameter):
|
|
212
|
+
"""
|
|
213
|
+
=============== ==============
|
|
214
|
+
**Attributes** **Type**
|
|
215
|
+
*opts* dictionnary
|
|
216
|
+
*options* string list
|
|
217
|
+
=============== ==============
|
|
218
|
+
|
|
219
|
+
See Also
|
|
220
|
+
--------
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
def __init__(self, **opts):
|
|
224
|
+
opts['type'] = 'groupdet'
|
|
225
|
+
opts['addText'] = "Add"
|
|
226
|
+
options = {
|
|
227
|
+
'DAQ0D': [name for name in [plugin['name'] for plugin in DAQ_0DViewer_Det_types]],
|
|
228
|
+
'DAQ1D': [name for name in [plugin['name'] for plugin in DAQ_1DViewer_Det_types]],
|
|
229
|
+
'DAQ2D': [name for name in [plugin['name'] for plugin in DAQ_2DViewer_Det_types]],
|
|
230
|
+
'DAQND': [name for name in [plugin['name'] for plugin in DAQ_NDViewer_Det_types]],
|
|
231
|
+
}
|
|
232
|
+
opts['addMenu'] = add_category_layers(options)
|
|
233
|
+
|
|
234
|
+
super().__init__(**opts)
|
|
235
|
+
|
|
236
|
+
def addNew(self, typ:tuple):
|
|
237
|
+
"""
|
|
238
|
+
Add a child.
|
|
239
|
+
|
|
240
|
+
=============== =========== ================
|
|
241
|
+
**Parameters** **Type** **Description*
|
|
242
|
+
*typ* string the viewer name
|
|
243
|
+
=============== =========== ================
|
|
244
|
+
"""
|
|
245
|
+
try:
|
|
246
|
+
name_prefix = 'det'
|
|
247
|
+
typ = "/".join((typ[0],typ[-1])) #Only need first and last element to retrieve associated plugin
|
|
248
|
+
new_index = find_last_index(list_children=self.children(), name_prefix=name_prefix, format_string='02.0f')
|
|
249
|
+
params = make_viewer_params(typ)
|
|
250
|
+
child = {'title': f'Det {new_index}', 'name': f'{name_prefix}{new_index}',
|
|
251
|
+
'type': 'group', 'children': [
|
|
252
|
+
{'title': 'Name:', 'name': 'name', 'type': 'str', 'value': f'Det {new_index}'},
|
|
253
|
+
{'title': 'Init?:', 'name': 'init', 'type': 'bool', 'value': True},
|
|
254
|
+
{'title': 'Settings:', 'name': 'params', 'type': 'group', 'children': params},
|
|
255
|
+
], 'removable': True, 'renamable': False}
|
|
256
|
+
|
|
257
|
+
self.addChild(child)
|
|
258
|
+
except Exception as e:
|
|
259
|
+
print(str(e))
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
registerParameterType('groupdet', PresetScalableGroupDet, override=True)
|