forked from DiamondLightSource/dodal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a62271
commit a0508fe
Showing
4 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
from ophyd import Component, Device | ||
from ophyd.status import StatusBase | ||
|
||
from dodal.devices.slits.gap_and_centre_slit_base_classes import GapAndCentreSlit2d | ||
from dodal.devices.slits.gap_and_center_slit_base_classes import GapAndCenterSlit2d | ||
from dodal.devices.slits.slit_motor import SlitMotor | ||
|
||
|
||
class I24Slits04VirtualMotors(GapAndCentreSlit2d): | ||
x_centre: Device = Component(SlitMotor, "X:CENTER") | ||
class I24Slits04VirtualMotors(GapAndCenterSlit2d): | ||
x_center: Device = Component(SlitMotor, "X:CENTER") | ||
x_size: Device = Component(SlitMotor, "X:SIZE") | ||
|
||
y_centre: Device = Component(SlitMotor, "Y:CENTER") | ||
x_center: Device = Component(SlitMotor, "Y:CENTER") | ||
y_size: Device = Component(SlitMotor, "Y:SIZE") | ||
|
||
def set(self, position_tuple): | ||
x_centre_value, x_size_value, y_centre_value, y_size_value = position_tuple | ||
x_center_value, x_size_value, x_center_value, y_size_value = position_tuple | ||
|
||
status = StatusBase() | ||
status.set_finished() | ||
|
||
status &= self.x_centre.set(x_centre_value) | ||
status &= self.x_center.set(x_center_value) | ||
status &= self.x_size.set(x_size_value) | ||
status &= self.y_centre.set(y_centre_value) | ||
status &= self.x_center.set(x_center_value) | ||
status &= self.y_size.set(y_size_value) | ||
|
||
return status | ||
|
||
def read(self): | ||
return ( | ||
self.x_centre.read(), | ||
self.x_center.read(), | ||
self.x_size.read(), | ||
self.y_centre.read(), | ||
self.y_size.read() | ||
self.x_center.read(), | ||
self.y_size.read(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters