mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
fix: motor selection is disabled while motor is moving
This commit is contained in:
@ -15,9 +15,7 @@ from bec_lib.core import MessageEndpoints, BECMessage
|
|||||||
# - setting motor speed and frequency
|
# - setting motor speed and frequency
|
||||||
# - setting motor acceleration
|
# - setting motor acceleration
|
||||||
# - updating motor precision
|
# - updating motor precision
|
||||||
# - put motor selection dropdown or listwidget
|
|
||||||
# - put motor status (moving, stopped, etc)
|
# - put motor status (moving, stopped, etc)
|
||||||
# - remove all hardcoded references to samx and samy
|
|
||||||
# - add spinBox for motor scatter size
|
# - add spinBox for motor scatter size
|
||||||
# - add mouse interactions with the plot -> click to select coordinates, double click to move?
|
# - add mouse interactions with the plot -> click to select coordinates, double click to move?
|
||||||
# - adjust right click actions
|
# - adjust right click actions
|
||||||
@ -34,7 +32,7 @@ class MotorApp(QWidget):
|
|||||||
# Motor Control Thread
|
# Motor Control Thread
|
||||||
self.motor_thread = MotorControl()
|
self.motor_thread = MotorControl()
|
||||||
|
|
||||||
self.motor_x, self.motor_y = None, None # dev.samx, dev.samy
|
self.motor_x, self.motor_y = None, None
|
||||||
self.limit_x, self.limit_y = None, None
|
self.limit_x, self.limit_y = None, None
|
||||||
|
|
||||||
# Coordinates tracking
|
# Coordinates tracking
|
||||||
@ -105,8 +103,11 @@ class MotorApp(QWidget):
|
|||||||
self.motorControl.setEnabled(True)
|
self.motorControl.setEnabled(True)
|
||||||
|
|
||||||
def enable_motor_controls(self, disable: bool) -> None:
|
def enable_motor_controls(self, disable: bool) -> None:
|
||||||
# Disable or enable all controls within the motorControl group box
|
self.motorControl.setEnabled(disable)
|
||||||
for widget in self.motorControl.findChildren(QtWidgets.QWidget):
|
self.motorSelection.setEnabled(disable)
|
||||||
|
|
||||||
|
# Disable or enable all controls within the motorControl_absolute group box
|
||||||
|
for widget in self.motorControl_absolute.findChildren(QtWidgets.QWidget):
|
||||||
widget.setEnabled(disable)
|
widget.setEnabled(disable)
|
||||||
|
|
||||||
# Enable the pushButton_stop if the motor is moving
|
# Enable the pushButton_stop if the motor is moving
|
||||||
@ -358,7 +359,6 @@ class MotorControl(QThread):
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
active_devices=["samx", "samy"],
|
|
||||||
parent=None,
|
parent=None,
|
||||||
):
|
):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
Reference in New Issue
Block a user