pymodaq 3.6.12__py3-none-any.whl → 4.0.1__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.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +13 -6
- pymodaq/control_modules/__init__.py +0 -7
- pymodaq/control_modules/daq_move.py +965 -2
- pymodaq/control_modules/daq_move_ui.py +319 -0
- pymodaq/control_modules/daq_viewer.py +1573 -3
- pymodaq/control_modules/daq_viewer_ui.py +393 -0
- pymodaq/control_modules/mocks.py +51 -0
- pymodaq/control_modules/move_utility_classes.py +709 -8
- pymodaq/control_modules/utils.py +256 -0
- pymodaq/control_modules/viewer_utility_classes.py +663 -6
- pymodaq/daq_utils.py +89 -0
- pymodaq/dashboard.py +91 -72
- pymodaq/examples/custom_app.py +12 -11
- pymodaq/examples/custom_viewer.py +10 -10
- pymodaq/examples/function_plotter.py +16 -13
- pymodaq/examples/nonlinearscanner.py +8 -6
- pymodaq/examples/parameter_ex.py +7 -7
- pymodaq/examples/preset_MockCamera.xml +1 -0
- pymodaq/extensions/__init__.py +16 -0
- pymodaq/extensions/console.py +76 -0
- pymodaq/{daq_logger.py → extensions/daq_logger.py} +115 -65
- pymodaq/extensions/daq_scan.py +1339 -0
- pymodaq/extensions/daq_scan_ui.py +240 -0
- pymodaq/extensions/h5browser.py +23 -0
- pymodaq/{pid → extensions/pid}/__init__.py +4 -2
- pymodaq/{pid → extensions/pid}/daq_move_PID.py +2 -2
- pymodaq/{pid → extensions/pid}/pid_controller.py +48 -36
- pymodaq/{pid → extensions/pid}/utils.py +52 -6
- pymodaq/extensions/utils.py +40 -0
- pymodaq/post_treatment/__init__.py +6 -0
- pymodaq/{daq_analysis → post_treatment/daq_analysis}/daq_analysis_main.py +17 -17
- pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_main.py +8 -14
- pymodaq/post_treatment/load_and_plot.py +219 -0
- pymodaq/post_treatment/process_to_scalar.py +263 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +1 -1
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +1 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +109784 -109173
- pymodaq/resources/QtDesigner_Ressources/icons.svg +142 -0
- pymodaq/resources/VERSION +1 -1
- pymodaq/resources/config_template.toml +32 -13
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/{daq_utils → utils}/Tuto innosetup/script_full_setup.iss +1 -1
- pymodaq/utils/__init__.py +0 -29
- pymodaq/utils/abstract/__init__.py +48 -0
- pymodaq/{daq_utils → utils}/abstract/logger.py +7 -3
- pymodaq/utils/array_manipulation.py +379 -8
- pymodaq/{daq_utils → utils}/calibration_camera.py +6 -6
- pymodaq/{daq_utils → utils}/chrono_timer.py +1 -1
- pymodaq/utils/config.py +448 -0
- pymodaq/utils/conftests.py +5 -0
- pymodaq/utils/daq_utils.py +828 -8
- pymodaq/utils/data.py +1873 -7
- pymodaq/{daq_utils → utils}/db/db_logger/db_logger.py +86 -47
- pymodaq/{daq_utils → utils}/db/db_logger/db_logger_models.py +31 -10
- pymodaq/{daq_utils → utils}/enums.py +12 -7
- pymodaq/utils/exceptions.py +37 -0
- pymodaq/utils/factory.py +82 -0
- pymodaq/{daq_utils → utils}/gui_utils/__init__.py +1 -1
- pymodaq/utils/gui_utils/custom_app.py +129 -0
- pymodaq/utils/gui_utils/file_io.py +66 -0
- pymodaq/{daq_utils → utils}/gui_utils/layout.py +2 -2
- pymodaq/{daq_utils → utils}/gui_utils/utils.py +13 -3
- pymodaq/{daq_utils → utils}/gui_utils/widgets/__init__.py +2 -2
- pymodaq/utils/gui_utils/widgets/label.py +24 -0
- pymodaq/{daq_utils → utils}/gui_utils/widgets/lcd.py +12 -7
- pymodaq/{daq_utils → utils}/gui_utils/widgets/push.py +66 -2
- pymodaq/{daq_utils → utils}/gui_utils/widgets/qled.py +6 -4
- pymodaq/utils/gui_utils/widgets/spinbox.py +24 -0
- pymodaq/{daq_utils → utils}/gui_utils/widgets/table.py +2 -2
- pymodaq/utils/h5modules/__init__.py +1 -0
- pymodaq/{daq_utils/h5backend.py → utils/h5modules/backends.py} +200 -112
- pymodaq/utils/h5modules/browsing.py +683 -0
- pymodaq/utils/h5modules/data_saving.py +839 -0
- pymodaq/utils/h5modules/h5logging.py +110 -0
- pymodaq/utils/h5modules/module_saving.py +350 -0
- pymodaq/utils/h5modules/saving.py +914 -0
- pymodaq/utils/h5modules/utils.py +85 -0
- pymodaq/utils/logger.py +64 -6
- pymodaq/utils/managers/action_manager.py +460 -0
- pymodaq/{daq_utils → utils}/managers/batchscan_manager.py +144 -112
- pymodaq/{daq_utils → utils}/managers/modules_manager.py +188 -114
- pymodaq/{daq_utils → utils}/managers/overshoot_manager.py +3 -3
- pymodaq/utils/managers/parameter_manager.py +110 -0
- pymodaq/{daq_utils → utils}/managers/preset_manager.py +17 -13
- pymodaq/{daq_utils → utils}/managers/preset_manager_utils.py +8 -7
- pymodaq/{daq_utils → utils}/managers/remote_manager.py +7 -6
- pymodaq/{daq_utils → utils}/managers/roi_manager.py +148 -57
- pymodaq/utils/math_utils.py +546 -10
- pymodaq/{daq_utils → utils}/messenger.py +5 -1
- pymodaq/utils/parameter/__init__.py +2 -15
- pymodaq/{daq_utils → utils}/parameter/ioxml.py +12 -6
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/__init__.py +1 -3
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/filedir.py +1 -1
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/itemselect.py +3 -0
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/led.py +1 -1
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +161 -0
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/slide.py +1 -1
- pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/table.py +1 -1
- pymodaq/utils/parameter/utils.py +206 -11
- pymodaq/utils/plotting/data_viewers/__init__.py +6 -0
- pymodaq/utils/plotting/data_viewers/viewer.py +393 -0
- pymodaq/utils/plotting/data_viewers/viewer0D.py +251 -0
- pymodaq/utils/plotting/data_viewers/viewer1D.py +574 -0
- pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer1Dbasic.py +8 -3
- pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer2D.py +292 -357
- pymodaq/{daq_utils → utils}/plotting/data_viewers/viewer2D_basic.py +58 -75
- pymodaq/utils/plotting/data_viewers/viewerND.py +738 -0
- pymodaq/{daq_utils → utils}/plotting/gant_chart.py +2 -2
- pymodaq/{daq_utils → utils}/plotting/items/axis_scaled.py +4 -2
- pymodaq/{daq_utils → utils}/plotting/items/image.py +8 -6
- pymodaq/utils/plotting/navigator.py +355 -0
- pymodaq/utils/plotting/scan_selector.py +480 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +88 -0
- pymodaq/utils/plotting/utils/filter.py +538 -0
- pymodaq/utils/plotting/utils/lineout.py +224 -0
- pymodaq/{daq_utils → utils}/plotting/utils/plot_utils.py +196 -84
- pymodaq/{daq_utils → utils}/plotting/utils/signalND.py +21 -13
- pymodaq/utils/plotting/widgets.py +76 -0
- pymodaq/utils/scanner/__init__.py +10 -0
- pymodaq/utils/scanner/scan_factory.py +204 -0
- pymodaq/utils/scanner/scanner.py +271 -0
- pymodaq/utils/scanner/scanners/_1d_scanners.py +117 -0
- pymodaq/utils/scanner/scanners/_2d_scanners.py +293 -0
- pymodaq/utils/scanner/scanners/sequential.py +192 -0
- pymodaq/utils/scanner/scanners/tabular.py +294 -0
- pymodaq/utils/scanner/utils.py +83 -0
- pymodaq/utils/slicing.py +47 -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 +51 -0
- pymodaq/{daq_utils → utils}/tcp_server_client.py +36 -37
- pymodaq/{daq_utils → utils}/tree_layout/tree_layout_main.py +50 -35
- pymodaq/utils/units.py +216 -0
- pymodaq-4.0.1.dist-info/METADATA +159 -0
- {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info}/RECORD +167 -170
- {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info}/WHEEL +1 -2
- pymodaq-4.0.1.dist-info/entry_points.txt +8 -0
- pymodaq/daq_move/daq_move_gui.py +0 -279
- pymodaq/daq_move/daq_move_gui.ui +0 -534
- pymodaq/daq_move/daq_move_main.py +0 -1042
- pymodaq/daq_move/process_from_QtDesigner_DAQ_Move_GUI.bat +0 -2
- pymodaq/daq_move/utility_classes.py +0 -671
- pymodaq/daq_scan.py +0 -2160
- pymodaq/daq_utils/array_manipulation.py +0 -386
- pymodaq/daq_utils/config.py +0 -273
- pymodaq/daq_utils/conftests.py +0 -7
- pymodaq/daq_utils/custom_parameter_tree.py +0 -9
- pymodaq/daq_utils/daq_enums.py +0 -133
- pymodaq/daq_utils/daq_utils.py +0 -1402
- pymodaq/daq_utils/exceptions.py +0 -71
- pymodaq/daq_utils/gui_utils/custom_app.py +0 -103
- pymodaq/daq_utils/gui_utils/file_io.py +0 -75
- pymodaq/daq_utils/gui_utils/widgets/spinbox.py +0 -9
- pymodaq/daq_utils/h5exporter_hyperspy.py +0 -115
- pymodaq/daq_utils/h5exporters.py +0 -242
- pymodaq/daq_utils/h5modules.py +0 -1559
- pymodaq/daq_utils/h5utils.py +0 -241
- pymodaq/daq_utils/managers/action_manager.py +0 -236
- pymodaq/daq_utils/managers/parameter_manager.py +0 -57
- pymodaq/daq_utils/math_utils.py +0 -705
- pymodaq/daq_utils/parameter/__init__.py +0 -1
- pymodaq/daq_utils/parameter/oldpymodaq_ptypes.py +0 -1626
- pymodaq/daq_utils/parameter/pymodaq_ptypes/pixmap.py +0 -85
- pymodaq/daq_utils/parameter/utils.py +0 -136
- pymodaq/daq_utils/plotting/data_viewers/__init__.py +0 -0
- pymodaq/daq_utils/plotting/data_viewers/process_from_QtDesigner_0DViewer_GUI.bat +0 -2
- pymodaq/daq_utils/plotting/data_viewers/viewer0D.py +0 -204
- pymodaq/daq_utils/plotting/data_viewers/viewer0D_GUI.py +0 -89
- pymodaq/daq_utils/plotting/data_viewers/viewer0D_GUI.ui +0 -131
- pymodaq/daq_utils/plotting/data_viewers/viewer1D.py +0 -781
- pymodaq/daq_utils/plotting/data_viewers/viewerND.py +0 -894
- pymodaq/daq_utils/plotting/data_viewers/viewerbase.py +0 -64
- pymodaq/daq_utils/plotting/items/__init__.py +0 -0
- pymodaq/daq_utils/plotting/navigator.py +0 -500
- pymodaq/daq_utils/plotting/scan_selector.py +0 -289
- pymodaq/daq_utils/plotting/utils/__init__.py +0 -0
- pymodaq/daq_utils/plotting/utils/filter.py +0 -236
- pymodaq/daq_utils/plotting/viewer0D/__init__.py +0 -0
- pymodaq/daq_utils/plotting/viewer0D/viewer0D_main.py +0 -4
- pymodaq/daq_utils/plotting/viewer1D/__init__.py +0 -0
- pymodaq/daq_utils/plotting/viewer1D/viewer1D_main.py +0 -4
- pymodaq/daq_utils/plotting/viewer1D/viewer1Dbasic.py +0 -4
- pymodaq/daq_utils/plotting/viewer2D/viewer_2D_basic.py +0 -4
- pymodaq/daq_utils/plotting/viewer2D/viewer_2D_main.py +0 -4
- pymodaq/daq_utils/plotting/viewerND/__init__.py +0 -0
- pymodaq/daq_utils/plotting/viewerND/viewerND_main.py +0 -4
- pymodaq/daq_utils/scanner.py +0 -1289
- pymodaq/daq_utils/tree_layout/__init__.py +0 -0
- pymodaq/daq_viewer/__init__.py +0 -0
- pymodaq/daq_viewer/daq_gui_settings.py +0 -237
- pymodaq/daq_viewer/daq_gui_settings.ui +0 -441
- pymodaq/daq_viewer/daq_viewer_main.py +0 -2225
- pymodaq/daq_viewer/process_from_QtDesigner_DAQ_GUI_settings.bat +0 -2
- pymodaq/daq_viewer/utility_classes.py +0 -673
- pymodaq/examples/logger_image/__init__.py +0 -0
- pymodaq/examples/logger_image/logger_displayer.py +0 -121
- pymodaq/examples/logger_image/setup.svg +0 -3119
- pymodaq/examples/logger_image/setup_svg.py +0 -114
- pymodaq/h5browser.py +0 -39
- pymodaq/utils/scanner.py +0 -15
- pymodaq-3.6.12.dist-info/METADATA +0 -39
- pymodaq-3.6.12.dist-info/entry_points.txt +0 -8
- pymodaq-3.6.12.dist-info/top_level.txt +0 -1
- /pymodaq/{daq_analysis → post_treatment/daq_analysis}/__init__.py +0 -0
- /pymodaq/{daq_measurement → post_treatment/daq_measurement}/__init__.py +0 -0
- /pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_GUI.py +0 -0
- /pymodaq/{daq_measurement → post_treatment/daq_measurement}/daq_measurement_GUI.ui +0 -0
- /pymodaq/{daq_measurement → post_treatment/daq_measurement}/process_from_QtDesigner_DAQ_Measurement_GUI.bat +0 -0
- /pymodaq/{daq_utils → utils}/Tuto innosetup/Tuto innosetup.odt +0 -0
- /pymodaq/{daq_utils → utils}/Tuto innosetup/Tuto innosetup.pdf +0 -0
- /pymodaq/{daq_move → utils/db}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils/db/db_logger}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils}/gui_utils/dock.py +0 -0
- /pymodaq/{daq_utils → utils}/gui_utils/list_picker.py +0 -0
- /pymodaq/{daq_utils/abstract → utils/managers}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/bool.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/date.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/list.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/numeric.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/tableview.py +0 -0
- /pymodaq/{daq_utils → utils}/parameter/pymodaq_ptypes/text.py +0 -0
- /pymodaq/{daq_utils/db → utils/plotting}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils}/plotting/image_viewer.py +0 -0
- /pymodaq/{daq_utils/db/db_logger → utils/plotting/items}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils}/plotting/items/crosshair.py +0 -0
- /pymodaq/{daq_utils/managers → utils/plotting/utils}/__init__.py +0 -0
- /pymodaq/{daq_utils → utils}/qvariant.py +0 -0
- /pymodaq/{daq_utils/plotting/viewer2D → utils/scanner/scanners}/__init__.py +0 -0
- /pymodaq/{daq_utils/plotting → utils/tree_layout}/__init__.py +0 -0
- {pymodaq-3.6.12.dist-info → pymodaq-4.0.1.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
from qtpy.QtCore import QObject, Signal, QEvent, QBuffer, QIODevice
|
|
1
|
+
from qtpy.QtCore import QObject, Signal, QEvent, QBuffer, QIODevice, Qt
|
|
2
2
|
from qtpy import QtWidgets, QtCore, QtGui
|
|
3
3
|
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
dashboard_submodules_params = [
|
|
6
8
|
{'title': 'Save 2D datas and above:', 'name': 'save_2D', 'type': 'bool', 'value': True},
|
|
@@ -10,6 +12,12 @@ dashboard_submodules_params = [
|
|
|
10
12
|
{'title': 'N saved:', 'name': 'N_saved', 'type': 'int', 'default': 0, 'value': 0, 'visible': False},
|
|
11
13
|
]
|
|
12
14
|
|
|
15
|
+
def get_splash_sc():
|
|
16
|
+
here = Path(__file__)
|
|
17
|
+
splash_sc = QtWidgets.QSplashScreen(QtGui.QPixmap(str(here.parent.parent.parent.joinpath('splash.png'))),
|
|
18
|
+
Qt.WindowStaysOnTopHint)
|
|
19
|
+
return splash_sc
|
|
20
|
+
|
|
13
21
|
|
|
14
22
|
def clickable(widget):
|
|
15
23
|
class Filter(QObject):
|
|
@@ -111,20 +119,22 @@ def widget_to_png_to_bytes(widget, keep_aspect=True, width=200, height=100):
|
|
|
111
119
|
if keep_aspect:
|
|
112
120
|
height = width * wheight / wwidth
|
|
113
121
|
|
|
114
|
-
png = png.scaled(width, height, QtCore.Qt.KeepAspectRatio)
|
|
122
|
+
png = png.scaled(int(width), int(height), QtCore.Qt.KeepAspectRatio)
|
|
115
123
|
buffer = QtCore.QBuffer()
|
|
116
124
|
buffer.open(QtCore.QIODevice.WriteOnly)
|
|
117
125
|
png.save(buffer, "png")
|
|
118
126
|
return buffer.data().data()
|
|
119
127
|
|
|
120
128
|
|
|
121
|
-
def pngbinary2Qlabel(databinary):
|
|
129
|
+
def pngbinary2Qlabel(databinary, scale_height: int = None):
|
|
122
130
|
buff = QBuffer()
|
|
123
131
|
buff.open(QIODevice.WriteOnly)
|
|
124
132
|
buff.write(databinary)
|
|
125
133
|
dat = buff.data()
|
|
126
134
|
pixmap = QtGui.QPixmap()
|
|
127
135
|
pixmap.loadFromData(dat, 'PNG')
|
|
136
|
+
if scale_height is not None and isinstance(scale_height, int):
|
|
137
|
+
pixmap = pixmap.scaledToHeight(scale_height)
|
|
128
138
|
label = QtWidgets.QLabel()
|
|
129
139
|
label.setPixmap(pixmap)
|
|
130
140
|
return label
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Created the 29/07/2022
|
|
4
|
+
|
|
5
|
+
@author: Sebastien Weber
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from qtpy import QtWidgets, QtCore, QtGui
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class LabelWithFont(QtWidgets.QLabel):
|
|
12
|
+
|
|
13
|
+
def __init__(self, text: str = '', *args, font_name=None, font_size=None, isbold=False, isitalic=False, **kwargs):
|
|
14
|
+
super().__init__(text, *args, **kwargs)
|
|
15
|
+
|
|
16
|
+
font = QtGui.QFont()
|
|
17
|
+
if font_name is not None:
|
|
18
|
+
font.setFamily(font_name)
|
|
19
|
+
if font_size is not None:
|
|
20
|
+
font.setPointSize(font_size)
|
|
21
|
+
|
|
22
|
+
font.setBold(isbold)
|
|
23
|
+
font.setItalic(isitalic)
|
|
24
|
+
self.setFont(font)
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
1
5
|
from qtpy import QtWidgets
|
|
2
6
|
from qtpy.QtCore import QObject
|
|
3
|
-
from pymodaq.
|
|
7
|
+
from pymodaq.utils.plotting.data_viewers.viewer0D import Viewer0D
|
|
8
|
+
from pymodaq.utils.data import DataRaw
|
|
4
9
|
import sys
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
class LCD(QObject):
|
|
8
13
|
|
|
9
14
|
def __init__(self, parent, **kwargs):
|
|
10
|
-
super(
|
|
15
|
+
super().__init__()
|
|
11
16
|
self.Nvals = None
|
|
12
17
|
self.labels = None
|
|
13
18
|
self.parent = parent
|
|
@@ -15,26 +20,26 @@ class LCD(QObject):
|
|
|
15
20
|
self.digits = 3
|
|
16
21
|
self.setupui(**kwargs)
|
|
17
22
|
|
|
18
|
-
def setvalues(self, values):
|
|
23
|
+
def setvalues(self, values: List[np.ndarray]):
|
|
19
24
|
"""
|
|
20
25
|
display values on lcds
|
|
21
26
|
Parameters
|
|
22
27
|
----------
|
|
23
|
-
values: list of
|
|
28
|
+
values: list of 0D ndarray
|
|
24
29
|
|
|
25
30
|
Returns
|
|
26
31
|
-------
|
|
27
32
|
|
|
28
33
|
"""
|
|
29
34
|
while len(values) < self.Nvals:
|
|
30
|
-
values.append(0.)
|
|
35
|
+
values.append(np.array([0.]))
|
|
31
36
|
if len(values) > self.Nvals:
|
|
32
37
|
values = values[:self.Nvals]
|
|
33
38
|
vals = []
|
|
34
39
|
for ind, val in enumerate(values):
|
|
35
40
|
self.lcds[ind].display(val[0])
|
|
36
41
|
vals.append(val)
|
|
37
|
-
self.viewer0D.show_data(
|
|
42
|
+
self.viewer0D.show_data(DataRaw(name='LCD', data=values))
|
|
38
43
|
|
|
39
44
|
def setupui(self, **kwargs):
|
|
40
45
|
if 'digits' in kwargs:
|
|
@@ -89,7 +94,7 @@ class LCD(QObject):
|
|
|
89
94
|
|
|
90
95
|
|
|
91
96
|
if __name__ == '__main__':
|
|
92
|
-
from pymodaq.
|
|
97
|
+
from pymodaq.utils.math_utils import gauss1D
|
|
93
98
|
import numpy as np
|
|
94
99
|
|
|
95
100
|
x = np.linspace(0, 200, 201)
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
|
|
3
3
|
from qtpy import QtWidgets, QtCore, QtGui
|
|
4
|
-
from
|
|
4
|
+
from qtpy.QtWidgets import QWidget
|
|
5
|
+
from pymodaq.utils.gui_utils.widgets.spinbox import SpinBox
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
EDIT_PUSH_TYPES = ['abs', 'rel']
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class PushButtonIcon(QtWidgets.QPushButton):
|
|
11
|
-
def __init__(self, icon_name: str, text: str):
|
|
12
|
+
def __init__(self, icon_name: str, text: str, checkable=False, tip="", menu=None):
|
|
12
13
|
super().__init__(text)
|
|
14
|
+
self._menu = menu
|
|
13
15
|
if icon_name != '':
|
|
14
16
|
icon = QtGui.QIcon()
|
|
15
17
|
if Path(icon_name).is_file():
|
|
@@ -19,6 +21,12 @@ class PushButtonIcon(QtWidgets.QPushButton):
|
|
|
19
21
|
icon.addPixmap(QtGui.QPixmap(f":/icons/Icon_Library/{icon_name}.png"), QtGui.QIcon.Normal,
|
|
20
22
|
QtGui.QIcon.Off)
|
|
21
23
|
self.setIcon(icon)
|
|
24
|
+
self.setCheckable(checkable)
|
|
25
|
+
self.setToolTip(tip)
|
|
26
|
+
|
|
27
|
+
def contextMenuEvent(self, event):
|
|
28
|
+
if self._menu is not None:
|
|
29
|
+
self._menu.exec(event.globalPos())
|
|
22
30
|
|
|
23
31
|
|
|
24
32
|
class EditPushInfo:
|
|
@@ -82,4 +90,60 @@ class EditPushRel(EditPush):
|
|
|
82
90
|
self._push_minus.clicked.connect(lambda: self.emit_clicked(-1))
|
|
83
91
|
|
|
84
92
|
|
|
93
|
+
class ActionMenu(QtWidgets.QAction):
|
|
94
|
+
def __init__(self, *args, menu=None, **kwargs):
|
|
95
|
+
super().__init__(*args, **kwargs)
|
|
96
|
+
self._menu = menu
|
|
97
|
+
|
|
98
|
+
def contextMenuEvent(self, event):
|
|
99
|
+
if self._menu is not None:
|
|
100
|
+
self._menu.exec(event.globalPos())
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def main(init_qt=True):
|
|
104
|
+
import sys
|
|
105
|
+
|
|
106
|
+
if init_qt: # used for the test suite
|
|
107
|
+
app = QtWidgets.QApplication(sys.argv)
|
|
108
|
+
|
|
109
|
+
widget = QtWidgets.QWidget()
|
|
110
|
+
widget.setLayout(QtWidgets.QVBoxLayout())
|
|
111
|
+
toolbar = QtWidgets.QToolBar()
|
|
112
|
+
widget.layout().addWidget(toolbar)
|
|
113
|
+
|
|
114
|
+
action = QtWidgets.QAction('blabla')
|
|
115
|
+
toolbar.addAction(action)
|
|
116
|
+
|
|
117
|
+
menu1 = QtWidgets.QMenu()
|
|
118
|
+
menu1.addAction('Add new task')
|
|
119
|
+
menu1.addAction('Edit current row')
|
|
120
|
+
menu1.addAction('Remove selected rows')
|
|
121
|
+
menu1.addSeparator()
|
|
122
|
+
menu1.addAction('Affect Responsable')
|
|
123
|
+
menu2 = QtWidgets.QMenu()
|
|
124
|
+
menu2.addAction('Affect volunteers')
|
|
125
|
+
menu2.addAction('Remove volunteers')
|
|
126
|
+
menu2.addSeparator()
|
|
127
|
+
menu2.addAction('Show localisation')
|
|
128
|
+
|
|
129
|
+
icon = QtGui.QIcon()
|
|
130
|
+
icon.addPixmap(QtGui.QPixmap(f":/icons/Icon_Library/{'run2'}.png"), QtGui.QIcon.Normal,
|
|
131
|
+
QtGui.QIcon.Off)
|
|
132
|
+
action2 = ActionMenu(icon, 'grab', menu=menu1)
|
|
133
|
+
|
|
134
|
+
toolbar.addAction(action2)
|
|
135
|
+
grab_pb = PushButtonIcon('run2', text='', checkable=True, menu=menu2)
|
|
136
|
+
grab_pb.setFlat(True)
|
|
137
|
+
toolbar.addWidget(grab_pb)
|
|
138
|
+
|
|
139
|
+
otherpb = PushButtonIcon('run2', 'grab me')
|
|
140
|
+
widget.layout().addWidget(otherpb)
|
|
141
|
+
|
|
142
|
+
widget.show()
|
|
143
|
+
if init_qt:
|
|
144
|
+
sys.exit(app.exec_())
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
if __name__ == '__main__':
|
|
148
|
+
main()
|
|
85
149
|
|
|
@@ -3,22 +3,24 @@ import numpy as np
|
|
|
3
3
|
from qtpy import QtCore, QtGui, QtWidgets
|
|
4
4
|
from qtpy.QtWidgets import QLabel
|
|
5
5
|
from qtpy.QtCore import QObject, Signal
|
|
6
|
-
from pymodaq.
|
|
6
|
+
from pymodaq.utils.gui_utils.utils import clickable
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class QLED(QLabel):
|
|
10
10
|
value_changed = Signal(bool)
|
|
11
11
|
|
|
12
|
-
def __init__(self, parent=None, scale=1):
|
|
12
|
+
def __init__(self, parent=None, scale=1, readonly=True):
|
|
13
13
|
QLabel.__init__(self, parent)
|
|
14
14
|
# self.setText("")
|
|
15
15
|
self.red_icon = QtGui.QPixmap(":/icons/Icon_Library/red_light.png")
|
|
16
16
|
self.green_icon = QtGui.QPixmap(":/icons/Icon_Library/greenLight2.png")
|
|
17
17
|
self.setPixmap(self.red_icon)
|
|
18
18
|
self.state = False
|
|
19
|
-
self.clickable =
|
|
19
|
+
self.clickable = not readonly
|
|
20
|
+
# set the possibility to click and control the state of the LED otherwise it behaves as an indicator
|
|
20
21
|
clickable(self).connect(
|
|
21
|
-
self.LED_Clicked)
|
|
22
|
+
self.LED_Clicked)
|
|
23
|
+
# clickable is a function importing a filter class to deal with mouse down event as a signal see GUI_utils
|
|
22
24
|
self.setText("empty")
|
|
23
25
|
self.setMaximumWidth(self.height())
|
|
24
26
|
if scale != 1:
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from qtpy import QtWidgets, QtGui
|
|
2
|
+
from pyqtgraph.widgets.SpinBox import SpinBox
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SpinBox(SpinBox):
|
|
6
|
+
"""
|
|
7
|
+
In case I want to add pyqtgraph spinbox functionalities
|
|
8
|
+
"""
|
|
9
|
+
def __init__(self, *args, font_size=None, min_height=20, **kwargs):
|
|
10
|
+
super().__init__(*args, **kwargs)
|
|
11
|
+
|
|
12
|
+
if font_size is not None:
|
|
13
|
+
font = QtGui.QFont()
|
|
14
|
+
font.setPointSize(font_size)
|
|
15
|
+
self.setFont(font)
|
|
16
|
+
self.setMinimumHeight(min_height)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class QSpinBox_ro(SpinBox):
|
|
20
|
+
def __init__(self, *args, readonly=True, **kwargs):
|
|
21
|
+
super().__init__(*args, **kwargs)
|
|
22
|
+
self.setMaximum(100000)
|
|
23
|
+
self.setReadOnly(readonly)
|
|
24
|
+
self.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons)
|
|
@@ -2,8 +2,8 @@ import copy
|
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
from qtpy.QtCore import QLocale, Qt, QModelIndex
|
|
5
|
-
from pymodaq.
|
|
6
|
-
from pymodaq.
|
|
5
|
+
from pymodaq.utils import daq_utils as utils
|
|
6
|
+
from pymodaq.utils.qvariant import QVariant
|
|
7
7
|
from qtpy import QtWidgets, QtCore
|
|
8
8
|
|
|
9
9
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import browsing
|