1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-09 18:27:52 +01:00

refefactor: motor_by_string removed, motor names passed directly to dev[motor_name]

This commit is contained in:
wyzula-jan
2023-09-04 11:28:24 +02:00
parent 359f9e37d2
commit 3c5f90e0e3

View File

@@ -461,16 +461,11 @@ class MotorControl(QThread):
self.action = None
self._initialize_motor()
def motor_by_string(self, motor_x_name: str, motor_y_name: str) -> tuple:
motor_x_index = self.all_motors_names.index(motor_x_name)
motor_y_index = self.all_motors_names.index(motor_y_name)
motor_x = self.all_motors[motor_x_index]
motor_y = self.all_motors[motor_y_index]
return motor_x, motor_y
def connect_motors(self, motor_x_name: str, motor_y_name: str) -> None:
self.motor_x, self.motor_y = self.motor_by_string(motor_x_name, motor_y_name)
self.motor_x, self.motor_y = (
dev[motor_x_name],
dev[motor_y_name],
) # self.motor_by_string(motor_x_name, motor_y_name)
(self.current_x, self.current_y) = self.get_coordinates()