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,137 @@
|
|
|
1
|
+
from pymodaq_utils.enums import StrEnum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ThreadStatus(StrEnum):
|
|
5
|
+
""" Allowed Generic commands sent from a plugin using the method: emit_status
|
|
6
|
+
|
|
7
|
+
Valid both for DAQ_Move and DAQ_Viewer control modules
|
|
8
|
+
|
|
9
|
+
See Also
|
|
10
|
+
--------
|
|
11
|
+
ControlModule.thread_status
|
|
12
|
+
"""
|
|
13
|
+
UPDATE_STATUS = 'update_status'
|
|
14
|
+
CLOSE = 'close'
|
|
15
|
+
UPDATE_SETTINGS = 'update_settings'
|
|
16
|
+
UPDATE_MAIN_SETTINGS = 'update_main_settings'
|
|
17
|
+
UPDATE_UI = 'update_ui'
|
|
18
|
+
RAISE_TIMEOUT = 'raise_timeout'
|
|
19
|
+
SHOW_SPLASH = 'show_splash'
|
|
20
|
+
CLOSE_SPLASH = 'close_splash'
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ThreadStatusMove(StrEnum):
|
|
24
|
+
""" Allowed Generic commands sent from a plugin using the method: emit_status
|
|
25
|
+
|
|
26
|
+
Valid only for DAQ_Move control module
|
|
27
|
+
|
|
28
|
+
See Also
|
|
29
|
+
--------
|
|
30
|
+
DAQ_Move.thread_status
|
|
31
|
+
"""
|
|
32
|
+
INI_STAGE = 'ini_stage'
|
|
33
|
+
GET_ACTUATOR_VALUE = 'get_actuator_value'
|
|
34
|
+
MOVE_DONE = 'move_done'
|
|
35
|
+
OUT_OF_BOUNDS = 'outofbounds'
|
|
36
|
+
SET_ALLOWED_VALUES = 'set_allowed_values'
|
|
37
|
+
STOP = 'stop'
|
|
38
|
+
UNITS = 'units'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ThreadStatusViewer(StrEnum):
|
|
42
|
+
""" Allowed Generic commands sent from a plugin using the method: emit_status
|
|
43
|
+
|
|
44
|
+
Valid only for DAQ_Viewer control module
|
|
45
|
+
|
|
46
|
+
See Also
|
|
47
|
+
--------
|
|
48
|
+
DAQ_Viewer.thread_status
|
|
49
|
+
"""
|
|
50
|
+
INI_DETECTOR = 'ini_detector'
|
|
51
|
+
GRAB = 'grab'
|
|
52
|
+
GRAB_STOPPED = 'grab_stopped'
|
|
53
|
+
INI_LCD = 'init_lcd'
|
|
54
|
+
LCD = 'lcd'
|
|
55
|
+
STOP = 'stop'
|
|
56
|
+
UPDATE_CHANNELS = 'update_channels'
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class ControlToHardwareMove(StrEnum):
|
|
61
|
+
""" Allowed commands sent from a DAQ_Move to its DAQ_Move_Hardware in another thread
|
|
62
|
+
using the method: command_hardware
|
|
63
|
+
|
|
64
|
+
Valid only for DAQ_Move command_hardware commands
|
|
65
|
+
|
|
66
|
+
"""
|
|
67
|
+
INI_STAGE = 'ini_stage'
|
|
68
|
+
STOP_MOTION = 'stop_motion'
|
|
69
|
+
RESET_STOP_MOTION = 'reset_stop_motion'
|
|
70
|
+
MOVE_ABS = 'move_abs'
|
|
71
|
+
MOVE_REL = 'move_rel'
|
|
72
|
+
MOVE_HOME = 'move_home'
|
|
73
|
+
GET_ACTUATOR_VALUE = 'get_actuator_value'
|
|
74
|
+
CLOSE = 'close'
|
|
75
|
+
|
|
76
|
+
class ControlToHardwareViewer(StrEnum):
|
|
77
|
+
""" Allowed commands sent from a DAQ_Viewer to its DAQ_Detector in another thread
|
|
78
|
+
using the method: command_hardware
|
|
79
|
+
|
|
80
|
+
Valid only for DAQ_Viewer command_hardware commands
|
|
81
|
+
|
|
82
|
+
"""
|
|
83
|
+
INI_DETECTOR = 'ini_detector'
|
|
84
|
+
|
|
85
|
+
SINGLE = 'single'
|
|
86
|
+
GRAB = 'grab'
|
|
87
|
+
STOP_GRAB = 'stop_grab'
|
|
88
|
+
ROI_SELECT = 'roi_select'
|
|
89
|
+
UPDATE_SCANNER = 'update_scanner' # may be deprecated
|
|
90
|
+
CROSSHAIR = 'crosshair'
|
|
91
|
+
UPDATE_WAIT_TIME = 'update_wait_time'
|
|
92
|
+
CLOSE = 'close'
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class UiToMainMove(StrEnum):
|
|
96
|
+
""" Allowed Commands to be sent from the DAQ_Move_UI to the DAQ_Move
|
|
97
|
+
"""
|
|
98
|
+
INIT = 'init'
|
|
99
|
+
QUIT = 'quit'
|
|
100
|
+
SHOW_LOG = 'show_log'
|
|
101
|
+
SHOW_CONFIG = 'show_config'
|
|
102
|
+
STOP = 'stop'
|
|
103
|
+
|
|
104
|
+
MOVE_ABS = 'move_abs'
|
|
105
|
+
MOVE_REL = 'move_rel'
|
|
106
|
+
|
|
107
|
+
ACTUATOR_CHANGED = 'actuator_changed'
|
|
108
|
+
|
|
109
|
+
GET_VALUE = 'get_value'
|
|
110
|
+
|
|
111
|
+
FIND_HOME = 'find_home'
|
|
112
|
+
REL_VALUE = 'rel_value'
|
|
113
|
+
|
|
114
|
+
LOOP_GET_VALUE = 'loop_get_value'
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class UiToMainViewer(StrEnum):
|
|
118
|
+
""" Allowed Commands to be sent from the DAQ_Viewer_UI to the DAQ_Viewer
|
|
119
|
+
"""
|
|
120
|
+
INIT = 'init'
|
|
121
|
+
QUIT = 'quit'
|
|
122
|
+
SHOW_LOG = 'show_log'
|
|
123
|
+
SHOW_CONFIG = 'show_config'
|
|
124
|
+
STOP = 'stop'
|
|
125
|
+
|
|
126
|
+
SNAP = 'snap'
|
|
127
|
+
GRAB = 'grab'
|
|
128
|
+
SAVE_CURRENT = 'save_current'
|
|
129
|
+
SAVE_NEW = 'save_new'
|
|
130
|
+
OPEN = 'open'
|
|
131
|
+
|
|
132
|
+
DETECTOR_CHANGED = 'detector_changed'
|
|
133
|
+
VIEWERS_CHANGED = 'viewers_changed'
|
|
134
|
+
DAQ_TYPE_CHANGED = 'daq_type_changed'
|
|
135
|
+
|
|
136
|
+
DO_BKG = 'do_bkg'
|
|
137
|
+
TAKE_BKG = 'take_bkg'
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from importlib import import_module
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from qtpy import QtCore
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from pymodaq_gui.utils import CustomApp
|
|
8
|
+
|
|
9
|
+
from pymodaq_utils.utils import ThreadCommand
|
|
10
|
+
from pymodaq_utils.config import Config as ConfigUtils
|
|
11
|
+
from pymodaq.utils.config import Config
|
|
12
|
+
|
|
13
|
+
config_utils = ConfigUtils()
|
|
14
|
+
config = Config()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ControlModuleUI(CustomApp):
|
|
18
|
+
""" Base Class for ControlModules UIs
|
|
19
|
+
|
|
20
|
+
Attributes
|
|
21
|
+
----------
|
|
22
|
+
command_sig: Signal[Threadcommand]
|
|
23
|
+
This signal is emitted whenever some actions done by the user has to be
|
|
24
|
+
applied on the main module. Possible commands are:
|
|
25
|
+
See specific implementation
|
|
26
|
+
|
|
27
|
+
See Also
|
|
28
|
+
--------
|
|
29
|
+
:class:`daq_move_ui.DAQ_Move_UI`, :class:`daq_viewer_ui.DAQ_Viewer_UI`
|
|
30
|
+
"""
|
|
31
|
+
command_sig = QtCore.Signal(ThreadCommand)
|
|
32
|
+
|
|
33
|
+
def __init__(self, parent):
|
|
34
|
+
super().__init__(parent)
|
|
35
|
+
self.config = config
|
|
36
|
+
|
|
37
|
+
def display_status(self, txt, wait_time=config_utils('general', 'message_status_persistence')):
|
|
38
|
+
if self.statusbar is not None:
|
|
39
|
+
self.statusbar.showMessage(txt, wait_time)
|
|
40
|
+
|
|
41
|
+
def do_init(self, do_init=True):
|
|
42
|
+
"""Programmatically press the Init button
|
|
43
|
+
API entry
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
do_init: bool
|
|
47
|
+
will fire the Init button depending on the argument value and the button check state
|
|
48
|
+
"""
|
|
49
|
+
raise NotImplementedError
|
|
50
|
+
|
|
51
|
+
def send_init(self, checked: bool):
|
|
52
|
+
"""Should be implemented to send to the main app the fact that someone (un)checked init."""
|
|
53
|
+
raise NotImplementedError
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def register_uis(parent_module_name: str = 'pymodaq.control_modules.daq_move_ui'):
|
|
57
|
+
uis = []
|
|
58
|
+
try:
|
|
59
|
+
scanner_module = import_module(f'{parent_module_name}.uis')
|
|
60
|
+
|
|
61
|
+
scanner_path = Path(scanner_module.__path__[0])
|
|
62
|
+
|
|
63
|
+
for file in scanner_path.iterdir():
|
|
64
|
+
if file.is_file() and 'py' in file.suffix and file.stem != '__init__':
|
|
65
|
+
try:
|
|
66
|
+
uis.append(import_module(f'.{file.stem}', scanner_module.__name__))
|
|
67
|
+
except (ModuleNotFoundError, Exception) as e:
|
|
68
|
+
pass
|
|
69
|
+
except ModuleNotFoundError:
|
|
70
|
+
pass
|
|
71
|
+
finally:
|
|
72
|
+
return uis
|