def test_shared_parameters(self): dummy = RotationMotor() fancy = BreakingMotor() dummy.position = 10 * q.deg self.assertEqual(dummy.position, 10 * q.deg) fancy.position = 20 * q.deg self.assertEqual(fancy.position, 20 * q.deg)
def get_axes(): """Get all the dummy axes.""" x_lin = LinearMotor() y_lin = LinearMotor() z_lin = LinearMotor() x_rot = RotationMotor() y_rot = RotationMotor() z_rot = RotationMotor() x_lin_axis = base.Axis('x', x_lin) y_lin_axis = base.Axis('y', y_lin, direction=-1) z_lin_axis = base.Axis('z', z_lin) x_rot_axis = base.Axis('x', x_rot) y_rot_axis = base.Axis('y', y_rot) z_rot_axis = base.Axis('z', z_rot, direction=-1) return (x_lin_axis, y_lin_axis, z_lin_axis, x_rot_axis, y_rot_axis, z_rot_axis)
def setUp(self): Radiography.setUp(self) self.tomo_motor = RotationMotor() self.tomo_motor.motion_velocity = 20000 * q.deg / q.s self.vertical_motor = LinearMotor() self.vertical_motor.motion_velocity = 10000 * q.mm / q.s self.camera.tomo_axis = self.tomo_motor self.camera.vertical_axis = self.vertical_motor
class TestRotationMotor(TestCase): def setUp(self): super(TestRotationMotor, self).setUp() self.motor = RotationMotor() def test_set_position(self): position = 1 * q.deg self.motor.position = position self.assertEqual(position, self.motor.position) self.assertEqual(self.motor.state, 'standby') def test_move(self): position = 1 * q.deg delta = 0.5 * q.deg self.motor.position = position self.motor.move(delta).join() self.assertEqual(position + delta, self.motor.position) self.assertEqual(self.motor.state, 'standby')
def setUp(self): self.seq = list(range(10)) self.camera = Camera() self.linear_motor = LinearMotor() self.linear_motor2 = LinearMotor() self.rotation_motor = RotationMotor()
def setUp(self): super(TestRotationMotor, self).setUp() self.motor = RotationMotor()
async def test_determine_rotation_axis(self): rot_motor = RotationMotor() axis = await determine_rotation_axis(self.camera, self.shutter, self.motor, rot_motor, 1 * q.mm, 3 * q.mm) self.assertTrue(isinstance(axis, q.Quantity))
def setUp(self): Radiography.setUp(self) self.tomo_motor = RotationMotor() self.tomo_motor.motion_velocity = 20000 * q.deg / q.s self.camera.tomo_axis = self.tomo_motor