bec-widgets 0.93.1__py3-none-any.whl → 0.93.2__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,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.93.2 (2024-08-07)
4
+
5
+ ### Fix
6
+
7
+ * fix(scan_group_box): Scan Spinboxes limits increased to max allowed values; setting dialog for step size and decimal precision for ScanDoubleSpinBox on right click ([`a372925`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a372925fffa787c686198ae7cb3f9c15b459c109))
8
+
3
9
  ## v0.93.1 (2024-08-06)
4
10
 
5
11
  ### Documentation
@@ -141,11 +147,3 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
141
147
  ### Test
142
148
 
143
149
  * test(image_widget): tests added ([`70fb276`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/70fb276fdf31dffc105435d3dfe7c5caea0b10ce))
144
-
145
- ## v0.89.0 (2024-07-22)
146
-
147
- ### Unknown
148
-
149
- * Revert "feat(themes): moved themes to bec_qthemes"
150
-
151
- This reverts commit 3798714369adf4023f833b7749d2f46a0ec74eee ([`fd6ae91`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.93.1
3
+ Version: 0.93.2
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
@@ -1,9 +1,13 @@
1
1
  from typing import Literal
2
2
 
3
+ from qtpy.QtCore import Qt
3
4
  from qtpy.QtWidgets import (
4
5
  QCheckBox,
5
6
  QComboBox,
7
+ QDialog,
8
+ QDialogButtonBox,
6
9
  QDoubleSpinBox,
10
+ QFormLayout,
7
11
  QGridLayout,
8
12
  QGroupBox,
9
13
  QLabel,
@@ -25,13 +29,46 @@ class ScanArgType:
25
29
  LITERALS = "dict"
26
30
 
27
31
 
32
+ class SettingsDialog(QDialog):
33
+ def __init__(self, parent=None):
34
+ super().__init__(parent)
35
+ self.setWindowTitle("Settings")
36
+
37
+ layout = QFormLayout()
38
+
39
+ self.precision_spin_box = QSpinBox()
40
+ self.precision_spin_box.setRange(
41
+ -2147483647, 2147483647
42
+ ) # 2147483647 is the largest int which qt allows
43
+
44
+ self.step_size_spin_box = QDoubleSpinBox()
45
+ self.step_size_spin_box.setRange(-float("inf"), float("inf"))
46
+
47
+ fixed_width = 80
48
+ self.precision_spin_box.setFixedWidth(fixed_width)
49
+ self.step_size_spin_box.setFixedWidth(fixed_width)
50
+
51
+ layout.addRow("Decimal Precision:", self.precision_spin_box)
52
+ layout.addRow("Step Size:", self.step_size_spin_box)
53
+
54
+ button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
55
+ button_box.accepted.connect(self.accept)
56
+ button_box.rejected.connect(self.reject)
57
+ layout.addWidget(button_box)
58
+
59
+ self.setLayout(layout)
60
+
61
+ def getValues(self):
62
+ return self.precision_spin_box.value(), self.step_size_spin_box.value()
63
+
64
+
28
65
  class ScanSpinBox(QSpinBox):
29
66
  def __init__(
30
67
  self, parent=None, arg_name: str = None, default: int | None = None, *args, **kwargs
31
68
  ):
32
69
  super().__init__(parent=parent, *args, **kwargs)
33
70
  self.arg_name = arg_name
34
- self.setRange(-9999, 9999)
71
+ self.setRange(-2147483647, 2147483647) # 2147483647 is the largest int which qt allows
35
72
  if default is not None:
36
73
  self.setValue(default)
37
74
 
@@ -42,10 +79,25 @@ class ScanDoubleSpinBox(QDoubleSpinBox):
42
79
  ):
43
80
  super().__init__(parent=parent, *args, **kwargs)
44
81
  self.arg_name = arg_name
45
- self.setRange(-9999, 9999)
82
+ self.setRange(-float("inf"), float("inf"))
46
83
  if default is not None:
47
84
  self.setValue(default)
48
85
 
86
+ self.setContextMenuPolicy(Qt.CustomContextMenu)
87
+ self.customContextMenuRequested.connect(self.showSettingsDialog)
88
+
89
+ self.setToolTip("Right click to open settings dialog for decimal precision and step size.")
90
+
91
+ def showSettingsDialog(self):
92
+ dialog = SettingsDialog(self)
93
+ dialog.precision_spin_box.setValue(self.decimals())
94
+ dialog.step_size_spin_box.setValue(self.singleStep())
95
+
96
+ if dialog.exec_() == QDialog.Accepted:
97
+ precision, step_size = dialog.getValues()
98
+ self.setDecimals(precision)
99
+ self.setSingleStep(step_size)
100
+
49
101
 
50
102
  class ScanLineEdit(QLineEdit):
51
103
  def __init__(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.93.1
3
+ Version: 0.93.2
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=BtKhZI3dhK09En1BfpglYi-ZJwG6ZdC-iJr7kXFVfCg,8346
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=otbJ_R-dxPpGAB9azrMzUtAkApa_Rb6PWyiQJUsa_nw,6808
5
+ CHANGELOG.md,sha256=spzDesIf7s2aE5sC5pxzLq1MdY_T2b6_do4e34BATH0,6847
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=JXPydLuNR0lLLpQgXI6v6Inf_PohIvMDbdVbwqAu2TU,1307
7
+ PKG-INFO,sha256=TcCIhjrNtkkjWajNX4527UVSTz2fKUASrMkLpWld1bg,1307
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=GjsstJ8Kw2uhgeB7Pb6QbZXwpcsVvlq4wwH5LoOEyJg,2356
9
+ pyproject.toml,sha256=Pv6pZHHF70YWR33PfBCPolOWW57nO6KLvd7iRLWgjPI,2356
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
@@ -220,7 +220,7 @@ bec_widgets/widgets/scan_control/register_scan_control.py,sha256=xUX2yR0-MaIMg9_
220
220
  bec_widgets/widgets/scan_control/scan_control.py,sha256=YT3Vvy27_FY3UY7IXvy87o9ZB_syauuEKzkJFOpbP4s,7610
221
221
  bec_widgets/widgets/scan_control/scan_control.pyproject,sha256=eTgVDFKToIH8_BbJjM2RvbOLr7HnYoidX0SAHx640DM,30
222
222
  bec_widgets/widgets/scan_control/scan_control_plugin.py,sha256=vglBKLZKVSFsVxiU1s6j1X4ASyfD2YWzMGBSeup_Q7E,1379
223
- bec_widgets/widgets/scan_control/scan_group_box.py,sha256=wrrJLfI0apfll0NKpqM8ymlbl5NaqA9cKNgyfVdYR00,7420
223
+ bec_widgets/widgets/scan_control/scan_group_box.py,sha256=BpX9ZphqOhdEbQnGzNeNlmuZsMS__U97CkBMical2FY,9300
224
224
  bec_widgets/widgets/spinner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
225
225
  bec_widgets/widgets/spinner/register_spinner_widget.py,sha256=_zCPjLh4M7NTSHP1Atdn6yu33zJ3LJkcBy3KOJ5eSVY,476
226
226
  bec_widgets/widgets/spinner/spinner.py,sha256=3A-VcX7HLDyqWsMoTUpB4jKHL26YuAbwOk3qonp3dI4,2591
@@ -370,8 +370,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
370
370
  tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
371
371
  tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
372
372
  tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
373
- bec_widgets-0.93.1.dist-info/METADATA,sha256=JXPydLuNR0lLLpQgXI6v6Inf_PohIvMDbdVbwqAu2TU,1307
374
- bec_widgets-0.93.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
375
- bec_widgets-0.93.1.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
376
- bec_widgets-0.93.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
377
- bec_widgets-0.93.1.dist-info/RECORD,,
373
+ bec_widgets-0.93.2.dist-info/METADATA,sha256=TcCIhjrNtkkjWajNX4527UVSTz2fKUASrMkLpWld1bg,1307
374
+ bec_widgets-0.93.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
375
+ bec_widgets-0.93.2.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
376
+ bec_widgets-0.93.2.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
377
+ bec_widgets-0.93.2.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.93.1"
7
+ version = "0.93.2"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [