bec-widgets 0.99.9__py3-none-any.whl → 0.99.10__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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.99.10 (2024-08-29)
4
+
5
+ ### Fix
6
+
7
+ * fix(stop_button): queue logic scan changed to halt instead of abort and reset ([`4a89028`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4a890281f7eaef02d0ec9f4c5bf080be11fe0fe3))
8
+
9
+ ### Refactor
10
+
11
+ * refactor(stop_button): stop button changed to QWidget and adapted for toolbar ([`097946f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/097946fd688b8faf770e7cc0e689ea668206bc7a))
12
+
13
+ * refactor: added hide option for device selection button ([`cdd1752`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cdd175207e922904b2efbb2d9ecf7c556c617f2e))
14
+
3
15
  ## v0.99.9 (2024-08-28)
4
16
 
5
17
  ### Fix
@@ -142,20 +154,6 @@ If not theme is set, the init of the BECWidget base class sets the default theme
142
154
 
143
155
  ## v0.97.0 (2024-08-23)
144
156
 
145
- ### Feature
146
-
147
- * feat(designer): added designer icon factory ([`82a55dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82a55ddf3eafb589cb63408db1c0e7e5c9d629da))
148
-
149
157
  ### Fix
150
158
 
151
159
  * fix(toolbar icon): fixed material icon toolbar for theme changes ([`3ecbd60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3ecbd60627994417c9175364e5909710dbcdceb2))
152
-
153
- ## v0.96.3 (2024-08-23)
154
-
155
- ### Documentation
156
-
157
- * docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
158
-
159
- ### Fix
160
-
161
- * fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.99.9
3
+ Version: 0.99.10
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
@@ -32,7 +32,7 @@ class PositionerBox(BECWidget, QWidget):
32
32
  USER_ACCESS = ["set_positioner"]
33
33
  device_changed = Signal(str, str)
34
34
 
35
- def __init__(self, parent=None, device: Positioner = None, *args, **kwargs):
35
+ def __init__(self, parent=None, device: Positioner = None, **kwargs):
36
36
  """Initialize the PositionerBox widget.
37
37
 
38
38
  Args:
@@ -97,15 +97,6 @@ class PositionerBox(BECWidget, QWidget):
97
97
  dialog.setLayout(layout)
98
98
  dialog.exec()
99
99
 
100
- @Slot(str)
101
- def _positioner_changed(self, positioner_name: str):
102
- """Changed input in combobox.
103
-
104
- Args:
105
- positioner_name (str): name of the positioner
106
- """
107
- self.set_positioner(positioner_name)
108
-
109
100
  def init_device(self):
110
101
  """Init the device view and readback"""
111
102
  if self._check_device_is_valid(self.device):
@@ -138,7 +129,27 @@ class PositionerBox(BECWidget, QWidget):
138
129
  self._device = value
139
130
  self.device_changed.emit(old_device, value)
140
131
 
141
- def set_positioner(self, positioner: str):
132
+ @Property(bool)
133
+ def hide_device_selection(self):
134
+ """Hide the device selection"""
135
+ return not self.ui.tool_button.isVisible()
136
+
137
+ @hide_device_selection.setter
138
+ def hide_device_selection(self, value: bool):
139
+ """Set the device selection visibility"""
140
+ self.ui.tool_button.setVisible(not value)
141
+
142
+ @Slot(bool)
143
+ def show_device_selection(self, value: bool):
144
+ """Show the device selection
145
+
146
+ Args:
147
+ value (bool): Show the device selection
148
+ """
149
+ self.hide_device_selection = not value
150
+
151
+ @Slot(str)
152
+ def set_positioner(self, positioner: str | Positioner):
142
153
  """Set the device
143
154
 
144
155
  Args:
@@ -191,6 +202,7 @@ class PositionerBox(BECWidget, QWidget):
191
202
  self.ui.step_size.setDecimals(precision)
192
203
  self.ui.step_size.setValue(10**-precision * 10)
193
204
 
205
+ # pylint: disable=unused-argument
194
206
  @Slot(dict, dict)
195
207
  def on_device_readback(self, msg_content: dict, metadata: dict):
196
208
  """Callback for device readback.
@@ -1,27 +1,44 @@
1
- from qtpy.QtWidgets import QPushButton
1
+ from bec_qthemes import material_icon
2
+ from qtpy.QtCore import Qt
3
+ from qtpy.QtWidgets import QHBoxLayout, QPushButton, QToolButton, QWidget
2
4
 
3
- from bec_widgets.qt_utils.error_popups import SafeSlot as Slot
5
+ from bec_widgets.qt_utils.error_popups import SafeSlot
4
6
  from bec_widgets.utils.bec_widget import BECWidget
5
7
 
6
8
 
7
- class StopButton(BECWidget, QPushButton):
9
+ class StopButton(BECWidget, QWidget):
8
10
  """A button that stops the current scan."""
9
11
 
10
12
  ICON_NAME = "dangerous"
11
13
 
12
- def __init__(self, parent=None, client=None, config=None, gui_id=None):
14
+ def __init__(self, parent=None, client=None, config=None, gui_id=None, toolbar=False):
13
15
  super().__init__(client=client, config=config, gui_id=gui_id)
14
- QPushButton.__init__(self, parent=parent)
16
+ QWidget.__init__(self, parent=parent)
15
17
 
16
18
  self.get_bec_shortcuts()
17
- self.setText("Stop")
18
- self.setStyleSheet(
19
- "background-color: #cc181e; color: white; font-weight: bold; font-size: 12px;"
20
- )
21
- self.clicked.connect(self.stop_scan)
22
19
 
23
- @Slot()
20
+ self.layout = QHBoxLayout(self)
21
+ self.layout.setSpacing(0)
22
+ self.layout.setContentsMargins(0, 0, 0, 0)
23
+ self.layout.setAlignment(Qt.AlignmentFlag.AlignVCenter)
24
+
25
+ if toolbar:
26
+ icon = material_icon(
27
+ "stop", size=(20, 20), color="#cc181e", filled=True, convert_to_pixmap=False
28
+ )
29
+ self.button = QToolButton(icon=icon)
30
+ self.button.triggered.connect(self.stop_scan)
31
+ else:
32
+ self.button = QPushButton()
33
+ self.button.setText("Stop")
34
+ self.button.setStyleSheet(
35
+ "background-color: #cc181e; color: white; font-weight: bold; font-size: 12px;"
36
+ )
37
+ self.button.clicked.connect(self.stop_scan)
38
+
39
+ self.layout.addWidget(self.button)
40
+
41
+ @SafeSlot()
24
42
  def stop_scan(self):
25
43
  """Stop the scan."""
26
- self.queue.request_scan_abortion()
27
- self.queue.request_queue_reset()
44
+ self.queue.request_scan_halt()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.99.9
3
+ Version: 0.99.10
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
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=HE_stq5wl-0wE5ZetfEmaaDbectk20jX7Z2cxwsBegg,8348
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=MdXIEU49qr8_UEhCn75X2Qs5CV3NcQ_l3SlCkgGnkoY,6778
5
+ CHANGELOG.md,sha256=8YPpCwOpu5V6FgaplOkX0H_LvOWYNXwuJyKAtAueZ1Y,6862
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=nlw53C25bX_6xmlP6i_3jICYJ_Bv8q7Skm6XNvv69WI,1333
7
+ PKG-INFO,sha256=JQ0kq0C_gndkxeyqnay6w3QQyYb8ShQvxfkqEH3Rd4Q,1334
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=tReXe3fv4T7rV5vYW1uDQ5JlLK-YzGJM7l2OmmYa5Kk,2543
9
+ pyproject.toml,sha256=monX0rBwlphrV8Hyu2hYn4hMDQ4DIYl0-KpKCqpJfiA,2544
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
@@ -160,7 +160,7 @@ bec_widgets/widgets/position_indicator/position_indicator.pyproject,sha256=s0JEf
160
160
  bec_widgets/widgets/position_indicator/position_indicator_plugin.py,sha256=ehQPpwkjJ7k365i4gdwtmAmCbVmB1tvQLEo60J_ivo4,1413
161
161
  bec_widgets/widgets/position_indicator/register_position_indicator.py,sha256=OZNiMgM_80TPSAXK_0hXAkne4vUh8DGvh_OdpOiMpwI,516
162
162
  bec_widgets/widgets/positioner_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
163
- bec_widgets/widgets/positioner_box/positioner_box.py,sha256=7IJGPeXxD-myv5uKfcsvOYsNmyAGTIjGewAQogxJr68,10805
163
+ bec_widgets/widgets/positioner_box/positioner_box.py,sha256=BKRzfvWVjsjxb56g7FvjuMpY9Gks4DMe08sQuFAQDy4,11187
164
164
  bec_widgets/widgets/positioner_box/positioner_box.pyproject,sha256=7966pHdDseaHciaPNEKgdQgbUThSZf5wEDCeAEJh9po,32
165
165
  bec_widgets/widgets/positioner_box/positioner_box.ui,sha256=Y-Xp0z32okT7X4-rL5r7dF_QH_QpXvPes3f778cC7_k,5633
166
166
  bec_widgets/widgets/positioner_box/positioner_box_plugin.py,sha256=kJtQgRFGkJYWbZqJ7K7o0UhdsgAlODUVZL8pKJWwMhs,1413
@@ -189,7 +189,7 @@ bec_widgets/widgets/spinner/spinner_widget.pyproject,sha256=zzLajGB3DTgVnrSqMey2
189
189
  bec_widgets/widgets/spinner/spinner_widget_plugin.py,sha256=AZYJJe40olMzqL6Edk6J-X_iNHcXrU-EQN4mCUCp_Fo,1355
190
190
  bec_widgets/widgets/stop_button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
191
191
  bec_widgets/widgets/stop_button/register_stop_button.py,sha256=U7r3fEOH-uPhAQI-nTituHXDDXDWR4JQZ7_vD6b_dfM,471
192
- bec_widgets/widgets/stop_button/stop_button.py,sha256=tQIUNl8TLVaosFs2tDLMuypXHgzeukLL14AgVkE0crA,861
192
+ bec_widgets/widgets/stop_button/stop_button.py,sha256=GAssgEV_F6NJxmcdrQYfI2egVqYhQeMotdgnwLn9ISs,1517
193
193
  bec_widgets/widgets/stop_button/stop_button.pyproject,sha256=Cc_xbv-zfzNVpsdg_1QyzuTlrJaM9_BkIjes70umrx0,29
194
194
  bec_widgets/widgets/stop_button/stop_button_plugin.py,sha256=Si1MSJo0izUxM4Bl_cPbihOCQWr9QUjTDpA7dKV8x5Y,1363
195
195
  bec_widgets/widgets/text_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -224,8 +224,8 @@ bec_widgets/widgets/website/register_website_widget.py,sha256=LIQJpV9uqcBiPR9cEA
224
224
  bec_widgets/widgets/website/website.py,sha256=kDlqjwtx0yft1ZNRhTdHnYh_5KZHfqT_ZGPOKT4C-yI,2619
225
225
  bec_widgets/widgets/website/website_widget.pyproject,sha256=scOiV3cV1_BjbzpPzy2N8rIJL5P2qIZz8ObTJ-Uvdtg,25
226
226
  bec_widgets/widgets/website/website_widget_plugin.py,sha256=pz38_C2cZ0yvPPS02wdIPcmhFo_yiwUhflsASocAPQQ,1341
227
- bec_widgets-0.99.9.dist-info/METADATA,sha256=nlw53C25bX_6xmlP6i_3jICYJ_Bv8q7Skm6XNvv69WI,1333
228
- bec_widgets-0.99.9.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
229
- bec_widgets-0.99.9.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
230
- bec_widgets-0.99.9.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
231
- bec_widgets-0.99.9.dist-info/RECORD,,
227
+ bec_widgets-0.99.10.dist-info/METADATA,sha256=JQ0kq0C_gndkxeyqnay6w3QQyYb8ShQvxfkqEH3Rd4Q,1334
228
+ bec_widgets-0.99.10.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
229
+ bec_widgets-0.99.10.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
230
+ bec_widgets-0.99.10.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
231
+ bec_widgets-0.99.10.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.99.9"
7
+ version = "0.99.10"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [