Ejemplo n.º 1
0
    def test_saving(self):
        m = Motor()

        m.position = 1 * q.mm
        m.stash().wait()
        m.position = 2 * q.mm
        m.stash().wait()
        m.position = 0.123 * q.mm
        m.position = 1.234 * q.mm

        m.restore().wait()
        self.assertEqual(m.position, 2 * q.mm)

        m.restore().wait()
        self.assertEqual(m.position, 1 * q.mm)
Ejemplo n.º 2
0
def test_different_calibration_unit():
    calibration = LinearCalibration(q.count / q.deg, 0 * q.deg)

    motor = DummyMotor(calibration)
    motor.position = 0 * q.deg
    motor.move(1 * q.deg).wait()
    assert motor.position == 1 * q.deg
Ejemplo n.º 3
0
def test_focusing():
    motor = Motor(hard_limits=(MIN_POSITION.magnitude,
                               MAX_POSITION.magnitude))
    motor.position = 85. * q.mm
    camera = BlurringCamera(motor)
    focus(camera, motor).wait()
    assert_almost_equal(motor.position, FOCUS_POSITION, 1e-2)
Ejemplo n.º 4
0
def test_different_calibration_unit():
    calibration = LinearCalibration(q.count / q.deg, 0 * q.deg)

    motor = DummyMotor(calibration)
    motor.position = 0 * q.deg
    motor.move(1 * q.deg).wait()
    assert motor.position == 1 * q.deg