bec-widgets 0.99.0__py3-none-any.whl → 0.99.8__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.
- .gitlab-ci.yml +0 -1
- CHANGELOG.md +70 -82
- PKG-INFO +2 -2
- bec_widgets/cli/client.py +3 -3
- bec_widgets/qt_utils/toolbar.py +11 -5
- bec_widgets/utils/bec_widget.py +11 -2
- bec_widgets/utils/colors.py +18 -2
- bec_widgets/utils/crosshair.py +4 -0
- bec_widgets/utils/plugin_templates/plugin.template +2 -2
- bec_widgets/widgets/bec_queue/bec_queue.py +2 -0
- bec_widgets/widgets/bec_queue/bec_queue_plugin.py +1 -1
- bec_widgets/widgets/bec_status_box/bec_status_box.py +2 -0
- bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +1 -1
- bec_widgets/widgets/color_button/color_button.py +2 -0
- bec_widgets/widgets/color_button/color_button_plugin.py +1 -1
- bec_widgets/widgets/colormap_selector/colormap_selector.py +1 -0
- bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +1 -1
- bec_widgets/widgets/dark_mode_button/dark_mode_button.py +12 -3
- bec_widgets/widgets/dark_mode_button/dark_mode_button_plugin.py +1 -1
- bec_widgets/widgets/device_browser/device_browser.py +2 -0
- bec_widgets/widgets/device_browser/device_browser_plugin.py +1 -1
- bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +1 -1
- bec_widgets/widgets/device_combobox/device_combobox.py +2 -0
- bec_widgets/widgets/device_line_edit/device_line_edit.py +2 -0
- bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +1 -1
- bec_widgets/widgets/dock/dock.py +1 -0
- bec_widgets/widgets/dock/dock_area.py +30 -10
- bec_widgets/widgets/dock/dock_area_plugin.py +1 -1
- bec_widgets/widgets/figure/figure.py +1 -1
- bec_widgets/widgets/figure/plots/plot_base.py +6 -0
- bec_widgets/widgets/figure/plots/waveform/waveform.py +12 -7
- bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +3 -3
- bec_widgets/widgets/image/bec_image_widget_plugin.py +1 -1
- bec_widgets/widgets/image/image_widget.py +1 -0
- bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +1 -1
- bec_widgets/widgets/motor_map/motor_map_widget.py +1 -0
- bec_widgets/widgets/position_indicator/position_indicator.py +2 -0
- bec_widgets/widgets/position_indicator/position_indicator_plugin.py +1 -1
- bec_widgets/widgets/positioner_box/positioner_box.py +1 -0
- bec_widgets/widgets/positioner_box/positioner_box_plugin.py +1 -1
- bec_widgets/widgets/positioner_box/positioner_control_line.py +2 -0
- bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +1 -1
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +1 -0
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +1 -1
- bec_widgets/widgets/scan_control/scan_control.py +2 -0
- bec_widgets/widgets/scan_control/scan_control_plugin.py +1 -4
- bec_widgets/widgets/spinner/spinner.py +2 -0
- bec_widgets/widgets/spinner/spinner_widget_plugin.py +1 -1
- bec_widgets/widgets/stop_button/stop_button.py +2 -0
- bec_widgets/widgets/stop_button/stop_button_plugin.py +1 -1
- bec_widgets/widgets/text_box/text_box.py +1 -0
- bec_widgets/widgets/text_box/text_box_plugin.py +1 -1
- bec_widgets/widgets/toggle/toggle.py +1 -0
- bec_widgets/widgets/toggle/toggle_switch_plugin.py +1 -1
- bec_widgets/widgets/vscode/vs_code_editor_plugin.py +1 -1
- bec_widgets/widgets/vscode/vscode.py +1 -0
- bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +1 -1
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +14 -13
- bec_widgets/widgets/waveform/waveform_widget.py +39 -2
- bec_widgets/widgets/website/website.py +42 -10
- bec_widgets/widgets/website/website_widget_plugin.py +1 -1
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/METADATA +2 -2
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/RECORD +85 -122
- docs/assets/widget_screenshots/buttons.png +0 -0
- docs/developer/widget_development/bec_dispatcher.md +1 -1
- docs/developer/widget_development/widget_base_class.md +171 -0
- docs/developer/widget_development/widget_development.md +3 -2
- docs/index.md +2 -2
- docs/user/widgets/buttons/buttons.md +32 -5
- docs/user/widgets/dock_area/bec_dock_area.md +4 -2
- docs/user/widgets/position_indicator/position_indicator.md +1 -8
- docs/user/widgets/spinner/spinner.md +0 -7
- docs/user/widgets/waveform/waveform_widget.md +3 -3
- docs/user/widgets/widgets.md +1 -1
- pyproject.toml +2 -2
- tests/unit_tests/test_configs/config_device.yaml +1 -1
- tests/unit_tests/test_configs/config_device_no_entry.yaml +1 -1
- tests/unit_tests/test_configs/config_scan.yaml +1 -1
- tests/unit_tests/test_crosshair.py +2 -2
- tests/unit_tests/test_waveform1d.py +14 -14
- tests/unit_tests/test_waveform_widget.py +2 -2
- tests/unit_tests/test_website_widget.py +2 -2
- bec_widgets/assets/toolbar_icons/add.svg +0 -3
- bec_widgets/assets/toolbar_icons/attach_all.svg +0 -3
- bec_widgets/assets/toolbar_icons/auto_range.svg +0 -3
- bec_widgets/assets/toolbar_icons/compare.svg +0 -3
- bec_widgets/assets/toolbar_icons/connection.svg +0 -4
- bec_widgets/assets/toolbar_icons/device_line_edit.svg +0 -3
- bec_widgets/assets/toolbar_icons/drag_pan_mode.svg +0 -3
- bec_widgets/assets/toolbar_icons/export.svg +0 -9
- bec_widgets/assets/toolbar_icons/fft.svg +0 -11
- bec_widgets/assets/toolbar_icons/fitting_parameters.svg +0 -3
- bec_widgets/assets/toolbar_icons/history.svg +0 -4
- bec_widgets/assets/toolbar_icons/image.svg +0 -3
- bec_widgets/assets/toolbar_icons/image_autorange.svg +0 -3
- bec_widgets/assets/toolbar_icons/import.svg +0 -9
- bec_widgets/assets/toolbar_icons/line_axis.svg +0 -3
- bec_widgets/assets/toolbar_icons/line_curve.svg +0 -3
- bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +0 -3
- bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
- bec_widgets/assets/toolbar_icons/motor_map.svg +0 -3
- bec_widgets/assets/toolbar_icons/photo_library.svg +0 -3
- bec_widgets/assets/toolbar_icons/positioner_box.svg +0 -3
- bec_widgets/assets/toolbar_icons/progress.svg +0 -3
- bec_widgets/assets/toolbar_icons/queue.svg +0 -3
- bec_widgets/assets/toolbar_icons/rectangle_mode.svg +0 -3
- bec_widgets/assets/toolbar_icons/remove.svg +0 -5
- bec_widgets/assets/toolbar_icons/reset_settings.svg +0 -3
- bec_widgets/assets/toolbar_icons/restore_state.svg +0 -3
- bec_widgets/assets/toolbar_icons/ring_progress.svg +0 -3
- bec_widgets/assets/toolbar_icons/rotate_left.svg +0 -3
- bec_widgets/assets/toolbar_icons/rotate_right.svg +0 -3
- bec_widgets/assets/toolbar_icons/save.svg +0 -3
- bec_widgets/assets/toolbar_icons/save_state.svg +0 -3
- bec_widgets/assets/toolbar_icons/scan_control.svg +0 -3
- bec_widgets/assets/toolbar_icons/settings.svg +0 -4
- bec_widgets/assets/toolbar_icons/status.svg +0 -3
- bec_widgets/assets/toolbar_icons/terminal.svg +0 -3
- bec_widgets/assets/toolbar_icons/transform.svg +0 -3
- bec_widgets/assets/toolbar_icons/waveform.svg +0 -3
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/WHEEL +0 -0
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/licenses/LICENSE +0 -0
@@ -28,6 +28,7 @@ except ImportError:
|
|
28
28
|
|
29
29
|
|
30
30
|
class BECWaveformWidget(BECWidget, QWidget):
|
31
|
+
ICON_NAME = "show_chart"
|
31
32
|
USER_ACCESS = [
|
32
33
|
"curves",
|
33
34
|
"plot",
|
@@ -58,8 +59,14 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|
58
59
|
dap_summary_update = Signal(dict)
|
59
60
|
autorange_signal = Signal()
|
60
61
|
new_scan = Signal()
|
62
|
+
crosshair_position_changed = Signal(tuple)
|
63
|
+
crosshair_position_changed_string = Signal(str)
|
64
|
+
crosshair_position_clicked = Signal(tuple)
|
65
|
+
crosshair_position_clicked_string = Signal(str)
|
61
66
|
crosshair_coordinates_changed = Signal(tuple)
|
67
|
+
crosshair_coordinates_changed_string = Signal(str)
|
62
68
|
crosshair_coordinates_clicked = Signal(tuple)
|
69
|
+
crosshair_coordinates_clicked_string = Signal(str)
|
63
70
|
|
64
71
|
def __init__(
|
65
72
|
self,
|
@@ -99,7 +106,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|
99
106
|
),
|
100
107
|
"separator_2": SeparatorAction(),
|
101
108
|
"curves": MaterialIconAction(
|
102
|
-
icon_name="
|
109
|
+
icon_name="timeline", tooltip="Open Curves Configuration"
|
103
110
|
),
|
104
111
|
"fit_params": MaterialIconAction(
|
105
112
|
icon_name="monitoring", tooltip="Open Fitting Parameters"
|
@@ -136,6 +143,20 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|
136
143
|
self.waveform.new_scan.connect(self.new_scan)
|
137
144
|
self.waveform.crosshair_coordinates_changed.connect(self.crosshair_coordinates_changed)
|
138
145
|
self.waveform.crosshair_coordinates_clicked.connect(self.crosshair_coordinates_clicked)
|
146
|
+
self.waveform.crosshair_coordinates_changed.connect(
|
147
|
+
self._emit_crosshair_coordinates_changed_string
|
148
|
+
)
|
149
|
+
self.waveform.crosshair_coordinates_clicked.connect(
|
150
|
+
self._emit_crosshair_coordinates_clicked_string
|
151
|
+
)
|
152
|
+
self.waveform.crosshair_position_changed.connect(self.crosshair_position_changed)
|
153
|
+
self.waveform.crosshair_position_clicked.connect(self.crosshair_position_clicked)
|
154
|
+
self.waveform.crosshair_position_changed.connect(
|
155
|
+
self._emit_crosshair_position_changed_string
|
156
|
+
)
|
157
|
+
self.waveform.crosshair_position_clicked.connect(
|
158
|
+
self._emit_crosshair_position_clicked_string
|
159
|
+
)
|
139
160
|
|
140
161
|
def _hook_actions(self):
|
141
162
|
self.toolbar.widgets["save"].action.triggered.connect(self.export)
|
@@ -156,6 +177,22 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|
156
177
|
# lambda: self.save_config(path=None, gui=True)
|
157
178
|
# )
|
158
179
|
|
180
|
+
@SafeSlot(tuple)
|
181
|
+
def _emit_crosshair_coordinates_changed_string(self, coordinates):
|
182
|
+
self.crosshair_coordinates_changed_string.emit(str(coordinates))
|
183
|
+
|
184
|
+
@SafeSlot(tuple)
|
185
|
+
def _emit_crosshair_coordinates_clicked_string(self, coordinates):
|
186
|
+
self.crosshair_coordinates_clicked_string.emit(str(coordinates))
|
187
|
+
|
188
|
+
@SafeSlot(tuple)
|
189
|
+
def _emit_crosshair_position_changed_string(self, position):
|
190
|
+
self.crosshair_position_changed_string.emit(str(position))
|
191
|
+
|
192
|
+
@SafeSlot(tuple)
|
193
|
+
def _emit_crosshair_position_clicked_string(self, position):
|
194
|
+
self.crosshair_position_clicked_string.emit(str(position))
|
195
|
+
|
159
196
|
###################################
|
160
197
|
# Dialog Windows
|
161
198
|
###################################
|
@@ -248,7 +285,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
|
248
285
|
y_entry: str | None = None,
|
249
286
|
z_entry: str | None = None,
|
250
287
|
color: str | None = None,
|
251
|
-
color_map_z: str | None = "
|
288
|
+
color_map_z: str | None = "magma",
|
252
289
|
label: str | None = None,
|
253
290
|
validate: bool = True,
|
254
291
|
dap: str | None = None, # TODO add dap custom curve wrapper
|
@@ -1,6 +1,6 @@
|
|
1
|
-
from qtpy.QtCore import QUrl, qInstallMessageHandler
|
1
|
+
from qtpy.QtCore import Property, QUrl, Slot, qInstallMessageHandler
|
2
2
|
from qtpy.QtWebEngineWidgets import QWebEngineView
|
3
|
-
from qtpy.QtWidgets import QApplication
|
3
|
+
from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget
|
4
4
|
|
5
5
|
from bec_widgets.utils.bec_widget import BECWidget
|
6
6
|
|
@@ -14,18 +14,45 @@ def suppress_qt_messages(type_, context, msg):
|
|
14
14
|
qInstallMessageHandler(suppress_qt_messages)
|
15
15
|
|
16
16
|
|
17
|
-
class WebsiteWidget(BECWidget,
|
17
|
+
class WebsiteWidget(BECWidget, QWidget):
|
18
18
|
"""
|
19
19
|
A simple widget to display a website
|
20
20
|
"""
|
21
21
|
|
22
|
+
ICON_NAME = "travel_explore"
|
22
23
|
USER_ACCESS = ["set_url", "get_url", "reload", "back", "forward"]
|
23
24
|
|
24
25
|
def __init__(self, parent=None, url: str = None, config=None, client=None, gui_id=None):
|
25
26
|
super().__init__(client=client, config=config, gui_id=gui_id)
|
26
|
-
|
27
|
+
QWidget.__init__(self, parent=parent)
|
28
|
+
layout = QVBoxLayout()
|
29
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
30
|
+
self.website = QWebEngineView()
|
31
|
+
layout.addWidget(self.website)
|
32
|
+
self.setLayout(layout)
|
27
33
|
self.set_url(url)
|
28
34
|
|
35
|
+
@Property(str)
|
36
|
+
def url(self) -> str:
|
37
|
+
"""
|
38
|
+
The url of the website widget
|
39
|
+
|
40
|
+
Returns:
|
41
|
+
str: The url
|
42
|
+
"""
|
43
|
+
return self.get_url()
|
44
|
+
|
45
|
+
@url.setter
|
46
|
+
def url(self, url: str) -> None:
|
47
|
+
"""
|
48
|
+
Set the url of the website widget
|
49
|
+
|
50
|
+
Args:
|
51
|
+
url (str): The url to set
|
52
|
+
"""
|
53
|
+
self.set_url(url)
|
54
|
+
|
55
|
+
@Slot(str)
|
29
56
|
def set_url(self, url: str) -> None:
|
30
57
|
"""
|
31
58
|
Set the url of the website widget
|
@@ -35,7 +62,9 @@ class WebsiteWidget(BECWidget, QWebEngineView):
|
|
35
62
|
"""
|
36
63
|
if not url:
|
37
64
|
return
|
38
|
-
|
65
|
+
if not isinstance(url, str):
|
66
|
+
return
|
67
|
+
self.website.setUrl(QUrl(url))
|
39
68
|
|
40
69
|
def get_url(self) -> str:
|
41
70
|
"""
|
@@ -44,31 +73,34 @@ class WebsiteWidget(BECWidget, QWebEngineView):
|
|
44
73
|
Returns:
|
45
74
|
str: The current url
|
46
75
|
"""
|
47
|
-
return self.url().toString()
|
76
|
+
return self.website.url().toString()
|
48
77
|
|
78
|
+
@Slot()
|
49
79
|
def reload(self):
|
50
80
|
"""
|
51
81
|
Reload the website
|
52
82
|
"""
|
53
|
-
QWebEngineView.reload(self)
|
83
|
+
QWebEngineView.reload(self.website)
|
54
84
|
|
85
|
+
@Slot()
|
55
86
|
def back(self):
|
56
87
|
"""
|
57
88
|
Go back in the history
|
58
89
|
"""
|
59
|
-
QWebEngineView.back(self)
|
90
|
+
QWebEngineView.back(self.website)
|
60
91
|
|
92
|
+
@Slot()
|
61
93
|
def forward(self):
|
62
94
|
"""
|
63
95
|
Go forward in the history
|
64
96
|
"""
|
65
|
-
QWebEngineView.forward(self)
|
97
|
+
QWebEngineView.forward(self.website)
|
66
98
|
|
67
99
|
def cleanup(self):
|
68
100
|
"""
|
69
101
|
Cleanup the widget
|
70
102
|
"""
|
71
|
-
self.page().deleteLater()
|
103
|
+
self.website.page().deleteLater()
|
72
104
|
|
73
105
|
|
74
106
|
if __name__ == "__main__":
|
@@ -33,7 +33,7 @@ class WebsiteWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
33
33
|
return "BEC Utils"
|
34
34
|
|
35
35
|
def icon(self):
|
36
|
-
return designer_material_icon(
|
36
|
+
return designer_material_icon(WebsiteWidget.ICON_NAME)
|
37
37
|
|
38
38
|
def includeFile(self):
|
39
39
|
return "website_widget"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: bec_widgets
|
3
|
-
Version: 0.99.
|
3
|
+
Version: 0.99.8
|
4
4
|
Summary: BEC Widgets
|
5
5
|
Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
|
6
6
|
Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
|
@@ -11,7 +11,7 @@ Classifier: Topic :: Scientific/Engineering
|
|
11
11
|
Requires-Python: >=3.10
|
12
12
|
Requires-Dist: bec-ipython-client>=2.21.4,~=2.21
|
13
13
|
Requires-Dist: bec-lib>=2.21.4,~=2.21
|
14
|
-
Requires-Dist: bec-qthemes
|
14
|
+
Requires-Dist: bec-qthemes>=0.4.2,~=0.4
|
15
15
|
Requires-Dist: black~=24.0
|
16
16
|
Requires-Dist: isort>=5.13.2,~=5.13
|
17
17
|
Requires-Dist: pydantic~=2.0
|