bec-widgets 1.1.0__py3-none-any.whl → 1.3.0__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.
- CHANGELOG.md +22 -26
- PKG-INFO +1 -1
- bec_widgets/cli/client.py +21 -0
- bec_widgets/utils/colors.py +129 -35
- bec_widgets/widgets/bec_status_box/status_item.py +1 -0
- bec_widgets/widgets/colormap_widget/__init__.py +0 -0
- bec_widgets/widgets/colormap_widget/bec_color_map_widget.pyproject +1 -0
- bec_widgets/widgets/colormap_widget/bec_color_map_widget_plugin.py +54 -0
- bec_widgets/widgets/colormap_widget/colormap_widget.py +73 -0
- bec_widgets/widgets/colormap_widget/register_bec_color_map_widget.py +17 -0
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +3 -3
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui +18 -4
- {bec_widgets-1.1.0.dist-info → bec_widgets-1.3.0.dist-info}/METADATA +1 -1
- {bec_widgets-1.1.0.dist-info → bec_widgets-1.3.0.dist-info}/RECORD +18 -13
- pyproject.toml +1 -1
- {bec_widgets-1.1.0.dist-info → bec_widgets-1.3.0.dist-info}/WHEEL +0 -0
- {bec_widgets-1.1.0.dist-info → bec_widgets-1.3.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-1.1.0.dist-info → bec_widgets-1.3.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,6 +1,28 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
|
4
|
+
## v1.3.0 (2024-10-30)
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* fix(colors): extend color map validation for matplotlib and colorcet maps (if available) ([`14dd8c5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/14dd8c5b2947c92f6643b888d71975e4e8d4ee88))
|
9
|
+
|
10
|
+
### Features
|
11
|
+
|
12
|
+
* feat(colormap_button): colormap button with menu to select colormap filtered by the colormap type ([`b039933`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b039933405e2fbe92bd81bd0748e79e8d443a741))
|
13
|
+
|
14
|
+
|
15
|
+
## v1.2.0 (2024-10-25)
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* feat(colors): evenly spaced color generation + new golden ratio calculation ([`40c9fea`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/40c9fea35f869ef52e05948dd1989bcd99f602e0))
|
20
|
+
|
21
|
+
### Refactoring
|
22
|
+
|
23
|
+
* refactor: add bec_lib version to statusbox ([`5d4b86e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5d4b86e1c6e1800051afce4f991153e370767fa6))
|
24
|
+
|
25
|
+
|
4
26
|
## v1.1.0 (2024-10-25)
|
5
27
|
|
6
28
|
### Features
|
@@ -147,29 +169,3 @@ complete UI ([`49268e3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/49268e38
|
|
147
169
|
### Features
|
148
170
|
|
149
171
|
* feat: add bec-app script to launch applications ([`8bf4842`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8bf48427884338672a8e3de3deb20439b0bfdf99))
|
150
|
-
|
151
|
-
|
152
|
-
## v0.114.0 (2024-10-02)
|
153
|
-
|
154
|
-
### Bug Fixes
|
155
|
-
|
156
|
-
* fix: prevent exception when empty string updates are coming from widget ([`04cfb1e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/04cfb1edf19437d54f07b868bcf3cfc2a35fd3bc))
|
157
|
-
|
158
|
-
* fix: use new 'scan_axis' signal, to set_x and select x axis on waveform
|
159
|
-
|
160
|
-
Fixes #361, do not try to change x axis when not permitted ([`efa2763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/efa276358b0f5a45cce9fa84fa5f9aafaf4284f7))
|
161
|
-
|
162
|
-
### Features
|
163
|
-
|
164
|
-
* feat: new 'scan_axis' signal
|
165
|
-
|
166
|
-
Signal is emitted before "scan_started", to inform about scan positioner
|
167
|
-
and (start, stop) positions. In case of multiple bundles, the signal
|
168
|
-
is emitted multiple times. ([`f084e25`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f084e2514bc9459cccaa951b79044bc25884e738))
|
169
|
-
|
170
|
-
|
171
|
-
## v0.113.0 (2024-10-02)
|
172
|
-
|
173
|
-
### Testing
|
174
|
-
|
175
|
-
* test: add tests for scan_status_callback ([`dc0c825`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dc0c825fd594c093a24543ff803d6c6564010e92))
|
PKG-INFO
CHANGED
bec_widgets/cli/client.py
CHANGED
@@ -16,6 +16,7 @@ class Widgets(str, enum.Enum):
|
|
16
16
|
"""
|
17
17
|
|
18
18
|
AbortButton = "AbortButton"
|
19
|
+
BECColorMapWidget = "BECColorMapWidget"
|
19
20
|
BECDock = "BECDock"
|
20
21
|
BECDockArea = "BECDockArea"
|
21
22
|
BECFigure = "BECFigure"
|
@@ -34,6 +35,7 @@ class Widgets(str, enum.Enum):
|
|
34
35
|
PositionIndicator = "PositionIndicator"
|
35
36
|
PositionerBox = "PositionerBox"
|
36
37
|
PositionerControlLine = "PositionerControlLine"
|
38
|
+
PositionerGroup = "PositionerGroup"
|
37
39
|
ResetButton = "ResetButton"
|
38
40
|
ResumeButton = "ResumeButton"
|
39
41
|
RingProgressBar = "RingProgressBar"
|
@@ -64,6 +66,15 @@ class AbortButton(RPCBase):
|
|
64
66
|
"""
|
65
67
|
|
66
68
|
|
69
|
+
class BECColorMapWidget(RPCBase):
|
70
|
+
@property
|
71
|
+
@rpc_call
|
72
|
+
def colormap(self):
|
73
|
+
"""
|
74
|
+
Get the current colormap name.
|
75
|
+
"""
|
76
|
+
|
77
|
+
|
67
78
|
class BECCurve(RPCBase):
|
68
79
|
@rpc_call
|
69
80
|
def remove(self):
|
@@ -2690,6 +2701,16 @@ class PositionerControlLine(RPCBase):
|
|
2690
2701
|
"""
|
2691
2702
|
|
2692
2703
|
|
2704
|
+
class PositionerGroup(RPCBase):
|
2705
|
+
@rpc_call
|
2706
|
+
def set_positioners(self, device_names: "str"):
|
2707
|
+
"""
|
2708
|
+
Redraw grid with positioners from device_names string
|
2709
|
+
|
2710
|
+
Device names must be separated by space
|
2711
|
+
"""
|
2712
|
+
|
2713
|
+
|
2693
2714
|
class ResetButton(RPCBase):
|
2694
2715
|
@property
|
2695
2716
|
@rpc_call
|
bec_widgets/utils/colors.py
CHANGED
@@ -107,9 +107,98 @@ class Colors:
|
|
107
107
|
angles.append(angle)
|
108
108
|
return angles
|
109
109
|
|
110
|
+
@staticmethod
|
111
|
+
def set_theme_offset(theme: Literal["light", "dark"] | None = None, offset=0.2) -> tuple:
|
112
|
+
"""
|
113
|
+
Set the theme offset to avoid colors too close to white or black with light or dark theme respectively for pyqtgraph plot background.
|
114
|
+
|
115
|
+
Args:
|
116
|
+
theme(str): The theme to be applied.
|
117
|
+
offset(float): Offset to avoid colors too close to white or black with light or dark theme respectively for pyqtgraph plot background.
|
118
|
+
|
119
|
+
Returns:
|
120
|
+
tuple: Tuple of min_pos and max_pos.
|
121
|
+
|
122
|
+
Raises:
|
123
|
+
ValueError: If theme_offset is not between 0 and 1.
|
124
|
+
"""
|
125
|
+
|
126
|
+
if offset < 0 or offset > 1:
|
127
|
+
raise ValueError("theme_offset must be between 0 and 1")
|
128
|
+
|
129
|
+
if theme is None:
|
130
|
+
app = QApplication.instance()
|
131
|
+
if hasattr(app, "theme"):
|
132
|
+
theme = app.theme.theme
|
133
|
+
|
134
|
+
if theme == "light":
|
135
|
+
min_pos = 0.0
|
136
|
+
max_pos = 1 - offset
|
137
|
+
else:
|
138
|
+
min_pos = 0.0 + offset
|
139
|
+
max_pos = 1.0
|
140
|
+
|
141
|
+
return min_pos, max_pos
|
142
|
+
|
143
|
+
@staticmethod
|
144
|
+
def evenly_spaced_colors(
|
145
|
+
colormap: str,
|
146
|
+
num: int,
|
147
|
+
format: Literal["QColor", "HEX", "RGB"] = "QColor",
|
148
|
+
theme_offset=0.2,
|
149
|
+
theme: Literal["light", "dark"] | None = None,
|
150
|
+
) -> list:
|
151
|
+
"""
|
152
|
+
Extract `num` colors from the specified colormap, evenly spaced along its range,
|
153
|
+
and return them in the specified format.
|
154
|
+
|
155
|
+
Args:
|
156
|
+
colormap (str): Name of the colormap.
|
157
|
+
num (int): Number of requested colors.
|
158
|
+
format (Literal["QColor","HEX","RGB"]): The format of the returned colors ('RGB', 'HEX', 'QColor').
|
159
|
+
theme_offset (float): Has to be between 0-1. Offset to avoid colors too close to white or black with light or dark theme respectively for pyqtgraph plot background.
|
160
|
+
theme (Literal['light', 'dark'] | None): The theme to be applied. Overrides the QApplication theme if specified.
|
161
|
+
|
162
|
+
Returns:
|
163
|
+
list: List of colors in the specified format.
|
164
|
+
|
165
|
+
Raises:
|
166
|
+
ValueError: If theme_offset is not between 0 and 1.
|
167
|
+
"""
|
168
|
+
if theme_offset < 0 or theme_offset > 1:
|
169
|
+
raise ValueError("theme_offset must be between 0 and 1")
|
170
|
+
|
171
|
+
cmap = pg.colormap.get(colormap)
|
172
|
+
min_pos, max_pos = Colors.set_theme_offset(theme, theme_offset)
|
173
|
+
|
174
|
+
# Generate positions that are evenly spaced within the acceptable range
|
175
|
+
if num == 1:
|
176
|
+
positions = np.array([(min_pos + max_pos) / 2])
|
177
|
+
else:
|
178
|
+
positions = np.linspace(min_pos, max_pos, num)
|
179
|
+
|
180
|
+
# Sample colors from the colormap at the calculated positions
|
181
|
+
colors = cmap.map(positions, mode="float")
|
182
|
+
color_list = []
|
183
|
+
|
184
|
+
for color in colors:
|
185
|
+
if format.upper() == "HEX":
|
186
|
+
color_list.append(QColor.fromRgbF(*color).name())
|
187
|
+
elif format.upper() == "RGB":
|
188
|
+
color_list.append(tuple((np.array(color) * 255).astype(int)))
|
189
|
+
elif format.upper() == "QCOLOR":
|
190
|
+
color_list.append(QColor.fromRgbF(*color))
|
191
|
+
else:
|
192
|
+
raise ValueError("Unsupported format. Please choose 'RGB', 'HEX', or 'QColor'.")
|
193
|
+
return color_list
|
194
|
+
|
110
195
|
@staticmethod
|
111
196
|
def golden_angle_color(
|
112
|
-
colormap: str,
|
197
|
+
colormap: str,
|
198
|
+
num: int,
|
199
|
+
format: Literal["QColor", "HEX", "RGB"] = "QColor",
|
200
|
+
theme_offset=0.2,
|
201
|
+
theme: Literal["dark", "light"] | None = None,
|
113
202
|
) -> list:
|
114
203
|
"""
|
115
204
|
Extract num colors from the specified colormap following golden angle distribution and return them in the specified format.
|
@@ -118,45 +207,39 @@ class Colors:
|
|
118
207
|
colormap (str): Name of the colormap.
|
119
208
|
num (int): Number of requested colors.
|
120
209
|
format (Literal["QColor","HEX","RGB"]): The format of the returned colors ('RGB', 'HEX', 'QColor').
|
210
|
+
theme_offset (float): Has to be between 0-1. Offset to avoid colors too close to white or black with light or dark theme respectively for pyqtgraph plot background.
|
121
211
|
|
122
212
|
Returns:
|
123
213
|
list: List of colors in the specified format.
|
124
214
|
|
125
215
|
Raises:
|
126
|
-
ValueError: If
|
216
|
+
ValueError: If theme_offset is not between 0 and 1.
|
127
217
|
"""
|
218
|
+
|
128
219
|
cmap = pg.colormap.get(colormap)
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
app = QApplication.instance()
|
142
|
-
if hasattr(app, "theme") and app.theme.theme == "light":
|
143
|
-
background = 255
|
144
|
-
else:
|
145
|
-
background = 0
|
146
|
-
if np.abs(np.mean(color[:3] * 255) - background) < 50:
|
147
|
-
ii += 1
|
148
|
-
continue
|
220
|
+
phi = (1 + np.sqrt(5)) / 2 # Golden ratio
|
221
|
+
golden_angle_conjugate = 1 - (1 / phi) # Approximately 0.38196601125
|
222
|
+
|
223
|
+
min_pos, max_pos = Colors.set_theme_offset(theme, theme_offset)
|
224
|
+
|
225
|
+
# Generate positions within the acceptable range
|
226
|
+
positions = np.mod(np.arange(num) * golden_angle_conjugate, 1)
|
227
|
+
positions = min_pos + positions * (max_pos - min_pos)
|
228
|
+
|
229
|
+
# Sample colors from the colormap at the calculated positions
|
230
|
+
colors = cmap.map(positions, mode="float")
|
231
|
+
color_list = []
|
149
232
|
|
233
|
+
for color in colors:
|
150
234
|
if format.upper() == "HEX":
|
151
|
-
|
235
|
+
color_list.append(QColor.fromRgbF(*color).name())
|
152
236
|
elif format.upper() == "RGB":
|
153
|
-
|
237
|
+
color_list.append(tuple((np.array(color) * 255).astype(int)))
|
154
238
|
elif format.upper() == "QCOLOR":
|
155
|
-
|
239
|
+
color_list.append(QColor.fromRgbF(*color))
|
156
240
|
else:
|
157
241
|
raise ValueError("Unsupported format. Please choose 'RGB', 'HEX', or 'QColor'.")
|
158
|
-
|
159
|
-
return colors
|
242
|
+
return color_list
|
160
243
|
|
161
244
|
@staticmethod
|
162
245
|
def hex_to_rgba(hex_color: str, alpha=255) -> tuple:
|
@@ -385,7 +468,7 @@ class Colors:
|
|
385
468
|
return color
|
386
469
|
|
387
470
|
@staticmethod
|
388
|
-
def validate_color_map(color_map: str) -> str:
|
471
|
+
def validate_color_map(color_map: str, return_error: bool = True) -> str | bool:
|
389
472
|
"""
|
390
473
|
Validate the colormap input if it is supported by pyqtgraph. Can be used in any pydantic model as a field validator. If validation fails it prints all available colormaps from pyqtgraph instance.
|
391
474
|
|
@@ -393,13 +476,24 @@ class Colors:
|
|
393
476
|
color_map(str): The colormap to be validated.
|
394
477
|
|
395
478
|
Returns:
|
396
|
-
str: The validated colormap.
|
479
|
+
str: The validated colormap, if colormap is valid.
|
480
|
+
bool: False, if colormap is invalid.
|
481
|
+
|
482
|
+
Raises:
|
483
|
+
PydanticCustomError: If colormap is invalid.
|
397
484
|
"""
|
398
|
-
|
485
|
+
available_pg_maps = pg.colormap.listMaps()
|
486
|
+
available_mpl_maps = pg.colormap.listMaps("matplotlib")
|
487
|
+
available_mpl_colorcet = pg.colormap.listMaps("colorcet")
|
488
|
+
|
489
|
+
available_colormaps = available_pg_maps + available_mpl_maps + available_mpl_colorcet
|
399
490
|
if color_map not in available_colormaps:
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
491
|
+
if return_error:
|
492
|
+
raise PydanticCustomError(
|
493
|
+
"unsupported colormap",
|
494
|
+
f"Colormap '{color_map}' not found in the current installation of pyqtgraph. Choose on the following: {available_colormaps}.",
|
495
|
+
{"wrong_value": color_map},
|
496
|
+
)
|
497
|
+
else:
|
498
|
+
return False
|
405
499
|
return color_map
|
@@ -141,6 +141,7 @@ class StatusItem(QWidget):
|
|
141
141
|
metrics_text = (
|
142
142
|
f"<b>SERVICE:</b> {self.config.service_name}<br><b>STATUS:</b> {self.config.status}<br>"
|
143
143
|
)
|
144
|
+
metrics_text += f"<b>BEC_LIB VERSION:</b> {self.config.info['version']}<br>"
|
144
145
|
if self.config.metrics:
|
145
146
|
for key, value in self.config.metrics.items():
|
146
147
|
if key == "create_time":
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{'files': ['colormap_widget.py']}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright (C) 2022 The Qt Company Ltd.
|
2
|
+
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
|
4
|
+
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
|
+
|
6
|
+
from bec_widgets.utils.bec_designer import designer_material_icon
|
7
|
+
from bec_widgets.widgets.colormap_widget.colormap_widget import BECColorMapWidget
|
8
|
+
|
9
|
+
DOM_XML = """
|
10
|
+
<ui language='c++'>
|
11
|
+
<widget class='BECColorMapWidget' name='bec_color_map_widget'>
|
12
|
+
</widget>
|
13
|
+
</ui>
|
14
|
+
"""
|
15
|
+
|
16
|
+
|
17
|
+
class BECColorMapWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
18
|
+
def __init__(self):
|
19
|
+
super().__init__()
|
20
|
+
self._form_editor = None
|
21
|
+
|
22
|
+
def createWidget(self, parent):
|
23
|
+
t = BECColorMapWidget(parent)
|
24
|
+
return t
|
25
|
+
|
26
|
+
def domXml(self):
|
27
|
+
return DOM_XML
|
28
|
+
|
29
|
+
def group(self):
|
30
|
+
return "BEC Buttons"
|
31
|
+
|
32
|
+
def icon(self):
|
33
|
+
return designer_material_icon(BECColorMapWidget.ICON_NAME)
|
34
|
+
|
35
|
+
def includeFile(self):
|
36
|
+
return "bec_color_map_widget"
|
37
|
+
|
38
|
+
def initialize(self, form_editor):
|
39
|
+
self._form_editor = form_editor
|
40
|
+
|
41
|
+
def isContainer(self):
|
42
|
+
return False
|
43
|
+
|
44
|
+
def isInitialized(self):
|
45
|
+
return self._form_editor is not None
|
46
|
+
|
47
|
+
def name(self):
|
48
|
+
return "BECColorMapWidget"
|
49
|
+
|
50
|
+
def toolTip(self):
|
51
|
+
return "BECColorMapWidget"
|
52
|
+
|
53
|
+
def whatsThis(self):
|
54
|
+
return self.toolTip()
|
@@ -0,0 +1,73 @@
|
|
1
|
+
from pyqtgraph.widgets.ColorMapButton import ColorMapButton
|
2
|
+
from qtpy.QtCore import Property, Signal, Slot
|
3
|
+
from qtpy.QtWidgets import QSizePolicy, QVBoxLayout, QWidget
|
4
|
+
|
5
|
+
from bec_widgets.utils import Colors
|
6
|
+
from bec_widgets.utils.bec_widget import BECWidget
|
7
|
+
|
8
|
+
|
9
|
+
class BECColorMapWidget(BECWidget, QWidget):
|
10
|
+
colormap_changed_signal = Signal(str)
|
11
|
+
ICON_NAME = "palette"
|
12
|
+
USER_ACCESS = ["colormap"]
|
13
|
+
|
14
|
+
def __init__(self, parent=None, cmap: str = "magma"):
|
15
|
+
super().__init__()
|
16
|
+
QWidget.__init__(self, parent=parent)
|
17
|
+
|
18
|
+
# Create the ColorMapButton
|
19
|
+
self.button = ColorMapButton()
|
20
|
+
|
21
|
+
# Set the size policy and minimum width
|
22
|
+
size_policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
|
23
|
+
self.button.setSizePolicy(size_policy)
|
24
|
+
self.button.setMinimumWidth(100)
|
25
|
+
self.button.setMinimumHeight(30)
|
26
|
+
|
27
|
+
# Create the layout
|
28
|
+
self.layout = QVBoxLayout(self)
|
29
|
+
self.layout.addWidget(self.button)
|
30
|
+
self.layout.setSpacing(0)
|
31
|
+
self.layout.setContentsMargins(0, 0, 0, 0)
|
32
|
+
|
33
|
+
# Set the initial colormap
|
34
|
+
self.button.setColorMap(cmap)
|
35
|
+
self._cmap = cmap
|
36
|
+
|
37
|
+
# Connect the signal
|
38
|
+
self.button.sigColorMapChanged.connect(self.colormap_changed)
|
39
|
+
|
40
|
+
@Property(str)
|
41
|
+
def colormap(self):
|
42
|
+
"""Get the current colormap name."""
|
43
|
+
return self._cmap
|
44
|
+
|
45
|
+
@colormap.setter
|
46
|
+
def colormap(self, name):
|
47
|
+
"""Set the colormap by name."""
|
48
|
+
if self._cmap != name:
|
49
|
+
if Colors.validate_color_map(name, return_error=False) is False:
|
50
|
+
return
|
51
|
+
self.button.setColorMap(name)
|
52
|
+
self._cmap = name
|
53
|
+
self.colormap_changed_signal.emit(name)
|
54
|
+
|
55
|
+
@Slot()
|
56
|
+
def colormap_changed(self):
|
57
|
+
"""
|
58
|
+
Emit the colormap changed signal with the current colormap selected in the button.
|
59
|
+
"""
|
60
|
+
cmap = self.button.colorMap().name
|
61
|
+
self._cmap = cmap
|
62
|
+
self.colormap_changed_signal.emit(cmap)
|
63
|
+
|
64
|
+
|
65
|
+
if __name__ == "__main__": # pragma: no cover
|
66
|
+
import sys
|
67
|
+
|
68
|
+
from qtpy.QtWidgets import QApplication
|
69
|
+
|
70
|
+
app = QApplication(sys.argv)
|
71
|
+
window = BECColorMapWidget()
|
72
|
+
window.show()
|
73
|
+
sys.exit(app.exec())
|
@@ -0,0 +1,17 @@
|
|
1
|
+
def main(): # pragma: no cover
|
2
|
+
from qtpy import PYSIDE6
|
3
|
+
|
4
|
+
if not PYSIDE6:
|
5
|
+
print("PYSIDE6 is not available in the environment. Cannot patch designer.")
|
6
|
+
return
|
7
|
+
from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
|
8
|
+
|
9
|
+
from bec_widgets.widgets.colormap_widget.bec_color_map_widget_plugin import (
|
10
|
+
BECColorMapWidgetPlugin,
|
11
|
+
)
|
12
|
+
|
13
|
+
QPyDesignerCustomWidgetCollection.addCustomWidget(BECColorMapWidgetPlugin())
|
14
|
+
|
15
|
+
|
16
|
+
if __name__ == "__main__": # pragma: no cover
|
17
|
+
main()
|
@@ -53,7 +53,7 @@ class CurveSettings(SettingWidget):
|
|
53
53
|
x_entry = self.target_widget.waveform._x_axis_mode["entry"]
|
54
54
|
self._enable_ui_elements(x_name, x_entry)
|
55
55
|
cm = self.target_widget.config.color_palette
|
56
|
-
self.ui.color_map_selector_scan.
|
56
|
+
self.ui.color_map_selector_scan.colormap = cm
|
57
57
|
|
58
58
|
# Scan Curve Table
|
59
59
|
for source in ["scan_segment", "async"]:
|
@@ -115,10 +115,10 @@ class CurveSettings(SettingWidget):
|
|
115
115
|
@Slot()
|
116
116
|
def change_colormap(self, target: Literal["scan", "dap"]):
|
117
117
|
if target == "scan":
|
118
|
-
cm = self.ui.color_map_selector_scan.
|
118
|
+
cm = self.ui.color_map_selector_scan.colormap
|
119
119
|
table = self.ui.scan_table
|
120
120
|
if target == "dap":
|
121
|
-
cm = self.ui.color_map_selector_dap.
|
121
|
+
cm = self.ui.color_map_selector_dap.colormap
|
122
122
|
table = self.ui.dap_table
|
123
123
|
rows = table.rowCount()
|
124
124
|
colors = Colors.golden_angle_color(colormap=cm, num=max(10, rows + 1), format="HEX")
|
@@ -231,7 +231,14 @@
|
|
231
231
|
</widget>
|
232
232
|
</item>
|
233
233
|
<item row="0" column="3">
|
234
|
-
|
234
|
+
<widget class="BECColorMapWidget" name="color_map_selector_scan">
|
235
|
+
<property name="sizePolicy">
|
236
|
+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
237
|
+
<horstretch>0</horstretch>
|
238
|
+
<verstretch>0</verstretch>
|
239
|
+
</sizepolicy>
|
240
|
+
</property>
|
241
|
+
</widget>
|
235
242
|
</item>
|
236
243
|
</layout>
|
237
244
|
</widget>
|
@@ -330,7 +337,14 @@
|
|
330
337
|
</widget>
|
331
338
|
</item>
|
332
339
|
<item row="0" column="3">
|
333
|
-
|
340
|
+
<widget class="BECColorMapWidget" name="color_map_selector_dap">
|
341
|
+
<property name="sizePolicy">
|
342
|
+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
343
|
+
<horstretch>0</horstretch>
|
344
|
+
<verstretch>0</verstretch>
|
345
|
+
</sizepolicy>
|
346
|
+
</property>
|
347
|
+
</widget>
|
334
348
|
</item>
|
335
349
|
</layout>
|
336
350
|
</widget>
|
@@ -348,9 +362,9 @@
|
|
348
362
|
<header>device_line_edit</header>
|
349
363
|
</customwidget>
|
350
364
|
<customwidget>
|
351
|
-
|
365
|
+
<class>BECColorMapWidget</class>
|
352
366
|
<extends>QWidget</extends>
|
353
|
-
|
367
|
+
<header>bec_color_map_widget</header>
|
354
368
|
</customwidget>
|
355
369
|
</customwidgets>
|
356
370
|
<resources/>
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=Dc1iDjsc72UxdUtihx4uSZU0lrTQeR8hZwGx1MQBfKE,8432
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=_2UjH6RE9uF_L2m5tSMnH0gU_uk3yYpbiqZ4xOmn8Js,7555
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=5iMS9a6gKROtyrKkwM8TJFrq8CZTmf4RI8eMo7cK_Uc,1332
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=AaO71xG-jmQrFd4ta4Tn04Ly7BteVemv9_HBJe55o8c,2592
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
|
12
12
|
.gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
|
@@ -24,7 +24,7 @@ bec_widgets/assets/app_icons/alignment_1d.png,sha256=5VouaWieb4lVv3wUBNHaO5ovUW2
|
|
24
24
|
bec_widgets/assets/app_icons/bec_widgets_icon.png,sha256=K8dgGwIjalDh9PRHUsSQBqgdX7a00nM3igZdc20pkYM,1747017
|
25
25
|
bec_widgets/cli/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
|
26
26
|
bec_widgets/cli/auto_updates.py,sha256=DwzRChcFIWPH2kCYvp8H7dXvyYSKGYv6LwCmK2sDR2E,5676
|
27
|
-
bec_widgets/cli/client.py,sha256=
|
27
|
+
bec_widgets/cli/client.py,sha256=IT6tg-_SaJ5heTb6qE9P7aSs50tiR8Xh3BDmkkHnv5I,85502
|
28
28
|
bec_widgets/cli/client_utils.py,sha256=EdDfo3uuYAWtZiDGGu3_GPnl94FSLkNG2N_4I9FNfMc,11809
|
29
29
|
bec_widgets/cli/generate_cli.py,sha256=C5SOlUeDzFgEptgpa5vdiF6c-YILLcfILZZtk9jr_H0,6637
|
30
30
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
@@ -60,7 +60,7 @@ bec_widgets/utils/bec_dispatcher.py,sha256=OFmkx9vOz4pA4Sdc14QreyDZ870QYskJ4B5da
|
|
60
60
|
bec_widgets/utils/bec_signal_proxy.py,sha256=PKJ7v8pKrAaqA9XNDMZZBlhVtEInX-ae6_0m2cQhiEw,2107
|
61
61
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
62
62
|
bec_widgets/utils/bec_widget.py,sha256=1lrHNuvW6uOuPpr-cJBYJNbFekTsqpnQdfTo3P5tbWI,3330
|
63
|
-
bec_widgets/utils/colors.py,sha256=
|
63
|
+
bec_widgets/utils/colors.py,sha256=zL9ieD_Bsb2ehd6tPpgfkhu1u5qrQRIE4mvoqM2iqko,16546
|
64
64
|
bec_widgets/utils/container_utils.py,sha256=0wr3ZfuMiAFKCrQHVjxjw-Vuk8wsHdridqcjy2eY840,1531
|
65
65
|
bec_widgets/utils/crosshair.py,sha256=f13tn1v_8FJ6C0WOLyDUXHaG_Nfzj4nMlLVEGqvs5Zc,11838
|
66
66
|
bec_widgets/utils/entry_validator.py,sha256=3skJIsUwTYicT76AMHm_M78RiWtUgyD2zb-Rxo2HdHQ,1313
|
@@ -99,7 +99,7 @@ bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=udxOoTqO_qVO08B8kmVz
|
|
99
99
|
bec_widgets/widgets/bec_status_box/bec_status_box.pyproject,sha256=JWtx3Csfn2h7ODtk10HtyBNLf6tFIqyU6g04rMWOO1U,32
|
100
100
|
bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py,sha256=UmsXAmeHg7FRkzirOLBPi3LwbRbG75w8LglYt4jn6Fc,1412
|
101
101
|
bec_widgets/widgets/bec_status_box/register_bec_status_box.py,sha256=EiQITnkNw7IU7hE776wAeXro97eZd9XlsB9essgCebE,481
|
102
|
-
bec_widgets/widgets/bec_status_box/status_item.py,sha256=
|
102
|
+
bec_widgets/widgets/bec_status_box/status_item.py,sha256=ZV0gqHCZ7mSui02NThSV7fHlIlYpH1kCoVf4LdAVUMY,5610
|
103
103
|
bec_widgets/widgets/button_abort/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
104
104
|
bec_widgets/widgets/button_abort/abort_button.pyproject,sha256=UtuaE0Lvs6uOGufhatUyJS_n2l6EBbYaGuILj_BNCLs,30
|
105
105
|
bec_widgets/widgets/button_abort/abort_button_plugin.py,sha256=3q0a4UE2O9s96Jjg6wi03CpXdQ7CnOI20ep7etEdxMo,1285
|
@@ -125,6 +125,11 @@ bec_widgets/widgets/colormap_selector/colormap_selector.py,sha256=axDOBNY8-KkavJ
|
|
125
125
|
bec_widgets/widgets/colormap_selector/colormap_selector.pyproject,sha256=lHl9qmlMCB6BKB2orqctKwLcKK3Swc0THsyr-5O_vXM,35
|
126
126
|
bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py,sha256=c5Kk4do8vi0y1bC54zaihvBC55iXaVkc8UMaCQEPwyE,1388
|
127
127
|
bec_widgets/widgets/colormap_selector/register_colormap_selector.py,sha256=bfw7RWmTmMLTLxGT-izSwcGtxGLKvL3jdivJw2z8oN4,512
|
128
|
+
bec_widgets/widgets/colormap_widget/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
129
|
+
bec_widgets/widgets/colormap_widget/bec_color_map_widget.pyproject,sha256=mGOToBLJAbXOuDLMXzQgcrAvLs9CuMKAucwlpntd6-M,33
|
130
|
+
bec_widgets/widgets/colormap_widget/bec_color_map_widget_plugin.py,sha256=qWaeoeYvaNhr3rDDW8bda7aAq1SDNoWqrAu4RPX0OY0,1331
|
131
|
+
bec_widgets/widgets/colormap_widget/colormap_widget.py,sha256=dIXKureIA8JY5ntJMFnoaBu824AilWjRMTrA5kyzTa8,2227
|
132
|
+
bec_widgets/widgets/colormap_widget/register_bec_color_map_widget.py,sha256=6-i1IDzHNOhO6H1nwm2eqKiGuQZaRoIGgLYdRCdtsCM,515
|
128
133
|
bec_widgets/widgets/console/console.py,sha256=f6wlG8ToLdspEzTVPs8NtYUGsUbfc1_mObLZGS1_ulM,24563
|
129
134
|
bec_widgets/widgets/console/console.pyproject,sha256=JcoDuZG03g1Bxkd3Aipo7jjLexujfbibIZqXHIgLSWc,26
|
130
135
|
bec_widgets/widgets/console/console_plugin.py,sha256=Jc1m24cjwyZI6cZB5twDTq9zjleeAMTaCDEJo5l5Q88,1349
|
@@ -275,8 +280,8 @@ bec_widgets/widgets/waveform/register_bec_waveform_widget.py,sha256=qZHVZH_lP2hv
|
|
275
280
|
bec_widgets/widgets/waveform/waveform_widget.py,sha256=x8OnXsSVTChceTO8l7ySY2oB2rpzHMZfS5PbxYV0LuY,25934
|
276
281
|
bec_widgets/widgets/waveform/waveform_popups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
277
282
|
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
278
|
-
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=
|
279
|
-
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui,sha256=
|
283
|
+
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py,sha256=znTKD1bChRr1kG9Jg2XaCdWiENUg9nX09LTN2VbWdlI,12992
|
284
|
+
bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui,sha256=vaOfrygcQp3-H82AkMUHgV2v0Y_TmRO5KLui-bWoado,11056
|
280
285
|
bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
281
286
|
bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/dap_summary_dialog.py,sha256=XOHppMcONwfhAYpqIc51VOrpunWmPSn50sT3I0MjW2c,1173
|
282
287
|
bec_widgets/widgets/website/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -284,8 +289,8 @@ bec_widgets/widgets/website/register_website_widget.py,sha256=LIQJpV9uqcBiPR9cEA
|
|
284
289
|
bec_widgets/widgets/website/website.py,sha256=42pncCc_zI2eqeMArIurVmPUukRo5bTxa2h1Skah-io,3012
|
285
290
|
bec_widgets/widgets/website/website_widget.pyproject,sha256=scOiV3cV1_BjbzpPzy2N8rIJL5P2qIZz8ObTJ-Uvdtg,25
|
286
291
|
bec_widgets/widgets/website/website_widget_plugin.py,sha256=pz38_C2cZ0yvPPS02wdIPcmhFo_yiwUhflsASocAPQQ,1341
|
287
|
-
bec_widgets-1.
|
288
|
-
bec_widgets-1.
|
289
|
-
bec_widgets-1.
|
290
|
-
bec_widgets-1.
|
291
|
-
bec_widgets-1.
|
292
|
+
bec_widgets-1.3.0.dist-info/METADATA,sha256=5iMS9a6gKROtyrKkwM8TJFrq8CZTmf4RI8eMo7cK_Uc,1332
|
293
|
+
bec_widgets-1.3.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
294
|
+
bec_widgets-1.3.0.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
|
295
|
+
bec_widgets-1.3.0.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
296
|
+
bec_widgets-1.3.0.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|