bec-widgets 0.80.1__py3-none-any.whl → 0.81.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.
Files changed (28) hide show
  1. CHANGELOG.md +12 -12
  2. PKG-INFO +1 -1
  3. bec_widgets/examples/__init__.py +0 -9
  4. bec_widgets/widgets/buttons/color_button/color_button.py +19 -0
  5. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/METADATA +1 -1
  6. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/RECORD +10 -28
  7. pyproject.toml +1 -1
  8. bec_widgets/examples/motor_movement/__init__.py +0 -9
  9. bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -250
  10. bec_widgets/examples/motor_movement/motor_controller.ui +0 -926
  11. bec_widgets/widgets/motor_control/__init__.py +0 -0
  12. bec_widgets/widgets/motor_control/motor_control.py +0 -252
  13. bec_widgets/widgets/motor_control/motor_table/__init__.py +0 -0
  14. bec_widgets/widgets/motor_control/motor_table/motor_table.py +0 -484
  15. bec_widgets/widgets/motor_control/motor_table/motor_table.ui +0 -113
  16. bec_widgets/widgets/motor_control/movement_absolute/__init__.py +0 -0
  17. bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +0 -159
  18. bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.ui +0 -149
  19. bec_widgets/widgets/motor_control/movement_relative/__init__.py +0 -0
  20. bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +0 -230
  21. bec_widgets/widgets/motor_control/movement_relative/movement_relative.ui +0 -298
  22. bec_widgets/widgets/motor_control/selection/__init__.py +0 -0
  23. bec_widgets/widgets/motor_control/selection/selection.py +0 -110
  24. bec_widgets/widgets/motor_control/selection/selection.ui +0 -69
  25. tests/unit_tests/test_motor_control.py +0 -588
  26. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/WHEEL +0 -0
  27. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/entry_points.txt +0 -0
  28. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,298 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ui version="4.0">
3
- <class>Form</class>
4
- <widget class="QWidget" name="Form">
5
- <property name="geometry">
6
- <rect>
7
- <x>0</x>
8
- <y>0</y>
9
- <width>285</width>
10
- <height>405</height>
11
- </rect>
12
- </property>
13
- <property name="minimumSize">
14
- <size>
15
- <width>285</width>
16
- <height>405</height>
17
- </size>
18
- </property>
19
- <property name="windowTitle">
20
- <string>Motor Control Relative</string>
21
- </property>
22
- <layout class="QVBoxLayout" name="verticalLayout">
23
- <item>
24
- <widget class="QGroupBox" name="motorControl">
25
- <property name="minimumSize">
26
- <size>
27
- <width>261</width>
28
- <height>394</height>
29
- </size>
30
- </property>
31
- <property name="title">
32
- <string>Motor Control Relative</string>
33
- </property>
34
- <layout class="QVBoxLayout" name="verticalLayout_5">
35
- <item>
36
- <widget class="QCheckBox" name="checkBox_enableArrows">
37
- <property name="text">
38
- <string>Move with arrow keys</string>
39
- </property>
40
- </widget>
41
- </item>
42
- <item>
43
- <widget class="QCheckBox" name="checkBox_same_xy">
44
- <property name="text">
45
- <string>Step [X] = Step [Y]</string>
46
- </property>
47
- </widget>
48
- </item>
49
- <item>
50
- <layout class="QGridLayout" name="step_grid">
51
- <item row="2" column="0">
52
- <widget class="QLabel" name="label_step_y">
53
- <property name="minimumSize">
54
- <size>
55
- <width>111</width>
56
- <height>19</height>
57
- </size>
58
- </property>
59
- <property name="text">
60
- <string>Step [Y]</string>
61
- </property>
62
- </widget>
63
- </item>
64
- <item row="0" column="0">
65
- <widget class="QLabel" name="label_2">
66
- <property name="minimumSize">
67
- <size>
68
- <width>111</width>
69
- <height>19</height>
70
- </size>
71
- </property>
72
- <property name="text">
73
- <string>Decimal</string>
74
- </property>
75
- </widget>
76
- </item>
77
- <item row="1" column="1">
78
- <widget class="QDoubleSpinBox" name="spinBox_step_x">
79
- <property name="minimumSize">
80
- <size>
81
- <width>110</width>
82
- <height>19</height>
83
- </size>
84
- </property>
85
- <property name="alignment">
86
- <set>Qt::AlignCenter</set>
87
- </property>
88
- <property name="minimum">
89
- <double>0.000000000000000</double>
90
- </property>
91
- <property name="maximum">
92
- <double>99.000000000000000</double>
93
- </property>
94
- <property name="singleStep">
95
- <double>0.100000000000000</double>
96
- </property>
97
- <property name="value">
98
- <double>1.000000000000000</double>
99
- </property>
100
- </widget>
101
- </item>
102
- <item row="1" column="0">
103
- <widget class="QLabel" name="label_step_x">
104
- <property name="minimumSize">
105
- <size>
106
- <width>111</width>
107
- <height>19</height>
108
- </size>
109
- </property>
110
- <property name="text">
111
- <string>Step [X]</string>
112
- </property>
113
- </widget>
114
- </item>
115
- <item row="2" column="1">
116
- <widget class="QDoubleSpinBox" name="spinBox_step_y">
117
- <property name="minimumSize">
118
- <size>
119
- <width>110</width>
120
- <height>19</height>
121
- </size>
122
- </property>
123
- <property name="alignment">
124
- <set>Qt::AlignCenter</set>
125
- </property>
126
- <property name="minimum">
127
- <double>0.000000000000000</double>
128
- </property>
129
- <property name="maximum">
130
- <double>99.000000000000000</double>
131
- </property>
132
- <property name="singleStep">
133
- <double>0.100000000000000</double>
134
- </property>
135
- <property name="value">
136
- <double>1.000000000000000</double>
137
- </property>
138
- </widget>
139
- </item>
140
- <item row="0" column="1">
141
- <widget class="QSpinBox" name="spinBox_precision">
142
- <property name="minimumSize">
143
- <size>
144
- <width>110</width>
145
- <height>19</height>
146
- </size>
147
- </property>
148
- <property name="alignment">
149
- <set>Qt::AlignCenter</set>
150
- </property>
151
- <property name="maximum">
152
- <number>8</number>
153
- </property>
154
- <property name="value">
155
- <number>2</number>
156
- </property>
157
- </widget>
158
- </item>
159
- </layout>
160
- </item>
161
- <item>
162
- <layout class="QGridLayout" name="direction_grid">
163
- <property name="sizeConstraint">
164
- <enum>QLayout::SetDefaultConstraint</enum>
165
- </property>
166
- <item row="1" column="2" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
167
- <widget class="QToolButton" name="toolButton_up">
168
- <property name="minimumSize">
169
- <size>
170
- <width>26</width>
171
- <height>26</height>
172
- </size>
173
- </property>
174
- <property name="text">
175
- <string>...</string>
176
- </property>
177
- <property name="arrowType">
178
- <enum>Qt::UpArrow</enum>
179
- </property>
180
- </widget>
181
- </item>
182
- <item row="2" column="4">
183
- <spacer name="horizontalSpacer_2">
184
- <property name="orientation">
185
- <enum>Qt::Horizontal</enum>
186
- </property>
187
- <property name="sizeHint" stdset="0">
188
- <size>
189
- <width>40</width>
190
- <height>20</height>
191
- </size>
192
- </property>
193
- </spacer>
194
- </item>
195
- <item row="3" column="2" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
196
- <widget class="QToolButton" name="toolButton_down">
197
- <property name="minimumSize">
198
- <size>
199
- <width>26</width>
200
- <height>26</height>
201
- </size>
202
- </property>
203
- <property name="text">
204
- <string>...</string>
205
- </property>
206
- <property name="arrowType">
207
- <enum>Qt::DownArrow</enum>
208
- </property>
209
- </widget>
210
- </item>
211
- <item row="2" column="1">
212
- <widget class="QToolButton" name="toolButton_left">
213
- <property name="minimumSize">
214
- <size>
215
- <width>26</width>
216
- <height>26</height>
217
- </size>
218
- </property>
219
- <property name="text">
220
- <string>...</string>
221
- </property>
222
- <property name="arrowType">
223
- <enum>Qt::LeftArrow</enum>
224
- </property>
225
- </widget>
226
- </item>
227
- <item row="0" column="2">
228
- <spacer name="verticalSpacer">
229
- <property name="orientation">
230
- <enum>Qt::Vertical</enum>
231
- </property>
232
- <property name="sizeHint" stdset="0">
233
- <size>
234
- <width>20</width>
235
- <height>40</height>
236
- </size>
237
- </property>
238
- </spacer>
239
- </item>
240
- <item row="2" column="3">
241
- <widget class="QToolButton" name="toolButton_right">
242
- <property name="minimumSize">
243
- <size>
244
- <width>26</width>
245
- <height>26</height>
246
- </size>
247
- </property>
248
- <property name="text">
249
- <string>...</string>
250
- </property>
251
- <property name="arrowType">
252
- <enum>Qt::RightArrow</enum>
253
- </property>
254
- </widget>
255
- </item>
256
- <item row="2" column="0">
257
- <spacer name="horizontalSpacer">
258
- <property name="orientation">
259
- <enum>Qt::Horizontal</enum>
260
- </property>
261
- <property name="sizeHint" stdset="0">
262
- <size>
263
- <width>40</width>
264
- <height>20</height>
265
- </size>
266
- </property>
267
- </spacer>
268
- </item>
269
- <item row="4" column="2">
270
- <spacer name="verticalSpacer_2">
271
- <property name="orientation">
272
- <enum>Qt::Vertical</enum>
273
- </property>
274
- <property name="sizeHint" stdset="0">
275
- <size>
276
- <width>20</width>
277
- <height>40</height>
278
- </size>
279
- </property>
280
- </spacer>
281
- </item>
282
- </layout>
283
- </item>
284
- <item>
285
- <widget class="QPushButton" name="pushButton_stop">
286
- <property name="text">
287
- <string>Stop Movement</string>
288
- </property>
289
- </widget>
290
- </item>
291
- </layout>
292
- </widget>
293
- </item>
294
- </layout>
295
- </widget>
296
- <resources/>
297
- <connections/>
298
- </ui>
File without changes
@@ -1,110 +0,0 @@
1
- # pylint: disable = no-name-in-module,missing-module-docstring
2
- import os
3
-
4
- from qtpy import uic
5
- from qtpy.QtCore import Signal as pyqtSignal
6
- from qtpy.QtCore import Slot as pyqtSlot
7
- from qtpy.QtWidgets import QComboBox
8
-
9
- from bec_widgets.widgets.motor_control.motor_control import MotorControlWidget
10
-
11
-
12
- class MotorControlSelection(MotorControlWidget):
13
- """
14
- Widget for selecting the motors to control.
15
-
16
- Signals:
17
- selected_motors_signal (pyqtSignal(str,str)): Signal to emit the selected motors.
18
- Slots:
19
- get_available_motors (pyqtSlot): Slot to populate the available motors in the combo boxes and set the index based on the configuration.
20
- enable_motor_controls (pyqtSlot(bool)): Slot to enable/disable the motor controls GUI.
21
- on_config_update (pyqtSlot(dict)): Slot to update the config dict.
22
- """
23
-
24
- selected_motors_signal = pyqtSignal(str, str)
25
-
26
- def _load_ui(self):
27
- """Load the UI from the .ui file."""
28
- current_path = os.path.dirname(__file__)
29
- uic.loadUi(os.path.join(current_path, "selection.ui"), self)
30
-
31
- def _init_ui(self):
32
- """Initialize the UI."""
33
- # Lock GUI while motors are moving
34
- self.motor_thread.lock_gui.connect(self.enable_motor_controls)
35
-
36
- self.pushButton_connecMotors.clicked.connect(self.select_motor)
37
- self.get_available_motors()
38
-
39
- # Connect change signals to change color
40
- self.comboBox_motor_x.currentIndexChanged.connect(
41
- lambda: self.set_combobox_style(self.comboBox_motor_x, "#ffa700")
42
- )
43
- self.comboBox_motor_y.currentIndexChanged.connect(
44
- lambda: self.set_combobox_style(self.comboBox_motor_y, "#ffa700")
45
- )
46
-
47
- @pyqtSlot(dict)
48
- def on_config_update(self, config: dict) -> None:
49
- """
50
- Update config dict
51
- Args:
52
- config(dict): New config dict
53
- """
54
- self.config = config
55
-
56
- # Get motor names
57
- self.motor_x, self.motor_y = (
58
- self.config["motor_control"]["motor_x"],
59
- self.config["motor_control"]["motor_y"],
60
- )
61
-
62
- self._init_ui()
63
-
64
- @pyqtSlot(bool)
65
- def enable_motor_controls(self, enable: bool) -> None:
66
- """
67
- Enable or disable the motor controls.
68
- Args:
69
- enable(bool): True to enable, False to disable.
70
- """
71
- self.motorSelection.setEnabled(enable)
72
-
73
- @pyqtSlot()
74
- def get_available_motors(self) -> None:
75
- """
76
- Slot to populate the available motors in the combo boxes and set the index based on the configuration.
77
- """
78
- # Get all available motors
79
- self.motor_list = self.motor_thread.get_all_motors_names()
80
-
81
- # Populate the combo boxes
82
- self.comboBox_motor_x.addItems(self.motor_list)
83
- self.comboBox_motor_y.addItems(self.motor_list)
84
-
85
- # Set the index based on the config if provided
86
- if self.config:
87
- index_x = self.comboBox_motor_x.findText(self.motor_x)
88
- index_y = self.comboBox_motor_y.findText(self.motor_y)
89
- self.comboBox_motor_x.setCurrentIndex(index_x if index_x != -1 else 0)
90
- self.comboBox_motor_y.setCurrentIndex(index_y if index_y != -1 else 0)
91
-
92
- def set_combobox_style(self, combobox, color: str) -> None:
93
- """
94
- Set the combobox style to a specific color.
95
- Args:
96
- combobox(QComboBox): Combobox to change the color.
97
- color(str): Color to set the combobox to.
98
- """
99
- combobox.setStyleSheet(f"QComboBox {{ background-color: {color}; }}")
100
-
101
- def select_motor(self):
102
- """Emit the selected motors"""
103
- motor_x = self.comboBox_motor_x.currentText()
104
- motor_y = self.comboBox_motor_y.currentText()
105
-
106
- # Reset the combobox color to normal after selection
107
- self.set_combobox_style(self.comboBox_motor_x, "")
108
- self.set_combobox_style(self.comboBox_motor_y, "")
109
-
110
- self.selected_motors_signal.emit(motor_x, motor_y)
@@ -1,69 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ui version="4.0">
3
- <class>Form</class>
4
- <widget class="QWidget" name="Form">
5
- <property name="geometry">
6
- <rect>
7
- <x>0</x>
8
- <y>0</y>
9
- <width>285</width>
10
- <height>156</height>
11
- </rect>
12
- </property>
13
- <property name="minimumSize">
14
- <size>
15
- <width>285</width>
16
- <height>156</height>
17
- </size>
18
- </property>
19
- <property name="windowTitle">
20
- <string>Motor Control Selection</string>
21
- </property>
22
- <layout class="QVBoxLayout" name="verticalLayout">
23
- <item>
24
- <widget class="QGroupBox" name="motorSelection">
25
- <property name="minimumSize">
26
- <size>
27
- <width>261</width>
28
- <height>145</height>
29
- </size>
30
- </property>
31
- <property name="title">
32
- <string>Motor Selection</string>
33
- </property>
34
- <layout class="QGridLayout" name="gridLayout_4">
35
- <item row="1" column="0">
36
- <widget class="QLabel" name="label_5">
37
- <property name="text">
38
- <string>Motor X</string>
39
- </property>
40
- </widget>
41
- </item>
42
- <item row="1" column="1">
43
- <widget class="QComboBox" name="comboBox_motor_x"/>
44
- </item>
45
- <item row="2" column="0">
46
- <widget class="QLabel" name="label_8">
47
- <property name="text">
48
- <string>Motor Y</string>
49
- </property>
50
- </widget>
51
- </item>
52
- <item row="3" column="0" colspan="2">
53
- <widget class="QPushButton" name="pushButton_connecMotors">
54
- <property name="text">
55
- <string>Connect Motors</string>
56
- </property>
57
- </widget>
58
- </item>
59
- <item row="2" column="1">
60
- <widget class="QComboBox" name="comboBox_motor_y"/>
61
- </item>
62
- </layout>
63
- </widget>
64
- </item>
65
- </layout>
66
- </widget>
67
- <resources/>
68
- <connections/>
69
- </ui>