Fixed some typos
This commit is contained in:
@@ -37,4 +37,4 @@ def startioc():
|
||||
f'epicsEnvSet("MASTERMACS1_PORT", "{config["controllers"]["masterMacs1"]["port"]}")\n')
|
||||
|
||||
# Start the IOC itself
|
||||
subprocess.run("st_cmd")
|
||||
subprocess.run("st.cmd")
|
||||
|
||||
@@ -9,4 +9,4 @@ source testenv/bin/activate
|
||||
|
||||
pip install 'caproto'
|
||||
pip install 'pytest'
|
||||
pip install 'yaml'
|
||||
pip install 'pyyaml'
|
||||
@@ -1,41 +0,0 @@
|
||||
import time
|
||||
|
||||
|
||||
def home(motor, forward):
|
||||
|
||||
encoder = motor.read_field('encoder_type')
|
||||
if encoder == 'absolute':
|
||||
is_absolute = True
|
||||
elif encoder == 'incremental':
|
||||
is_absolute = False
|
||||
else:
|
||||
raise ValueError(f'Unknown encoder type {encoder}')
|
||||
|
||||
# Start a homing run and observe the motor behaviour depending on the
|
||||
# encoder type
|
||||
if forward:
|
||||
motor.write_field('homeforward')
|
||||
else:
|
||||
motor.write_field('homereverse')
|
||||
|
||||
# Give the record some time to react
|
||||
time.sleep(0.5)
|
||||
|
||||
if is_absolute:
|
||||
# Motor should not move at all
|
||||
assert motor.read_field('moving') == 0
|
||||
assert motor.read_field('donemoving') == 1
|
||||
assert not motor.has_error()
|
||||
else:
|
||||
# Motor should start movement
|
||||
assert motor.read_field('moving') == 1
|
||||
assert motor.read_field('donemoving') == 0
|
||||
assert not motor.has_error()
|
||||
assert not motor.is_homed()
|
||||
|
||||
motor.wait_for_done()
|
||||
|
||||
assert motor.read_field('moving') == 0
|
||||
assert motor.read_field('donemoving') == 1
|
||||
assert not motor.has_error()
|
||||
assert motor.is_homed()
|
||||
@@ -1,21 +0,0 @@
|
||||
import time
|
||||
|
||||
|
||||
def reread_limits_from_hw(motor):
|
||||
"""
|
||||
sinqAxis motors usually read their limits from the hardware at each poll,
|
||||
hence any values manually written to DHLM or DLLM should be overwritten
|
||||
after the next poll at latest
|
||||
"""
|
||||
(high_limit, low_limit) = motor.limits()
|
||||
motor.write_field('dialhighlimit', high_limit-+10)
|
||||
motor.write_field('diallowlimit', low_limit-10)
|
||||
|
||||
# After two seconds, at least one poll has been done
|
||||
time.sleep(2)
|
||||
|
||||
# Values should have been reread
|
||||
assert motor.read_field('highlimit') == high_limit
|
||||
assert motor.read_field('lowlimit') == low_limit
|
||||
assert motor.read_field('dialhighlimit') == high_limit
|
||||
assert motor.read_field('diallowlimit') == low_limit
|
||||
@@ -1,9 +0,0 @@
|
||||
# Prepare
|
||||
|
||||
import pytest
|
||||
from common import TurboPMAC
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lin1():
|
||||
return TurboPMAC()
|
||||
@@ -1,25 +0,0 @@
|
||||
# This module defines fixtures which are shared for all tests of motor "rot1".
|
||||
|
||||
import pytest
|
||||
from common import TurboPMAC, read_config
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def motor():
|
||||
config = read_config()
|
||||
return TurboPMAC(config['controllers']['turboPmac1']['ip'],
|
||||
config['controllers']['turboPmac1']['port'],
|
||||
config['pvprefix'] + 'turboPmac1:rot1')
|
||||
|
||||
|
||||
def reset(motor):
|
||||
"""
|
||||
Reset the motor for the next test. This means the following things:
|
||||
1) Resetting all errors
|
||||
2) Enabling the motor
|
||||
3) Moving to zero
|
||||
"""
|
||||
motor.write_field('stop', 1)
|
||||
motor.write_field('reseterrorpv', 1)
|
||||
motor.write_field('enable', 1)
|
||||
motor.move_and_wait(0)
|
||||
@@ -1,18 +0,0 @@
|
||||
# Run a selection of common tests
|
||||
|
||||
from tests.move import *
|
||||
from tests.sinqAxis.limits import *
|
||||
from tests.sinqAxis.turboPmac.rot1.conftest import reset
|
||||
|
||||
|
||||
# def test_move_to_low_limit_switch(motor):
|
||||
# reset(motor)
|
||||
# move_to_low_limit_switch(motor)
|
||||
|
||||
|
||||
# def test_move_to_high_limit_switch(motor):
|
||||
# reset(motor)
|
||||
# move_to_high_limit_switch(motor)
|
||||
|
||||
def test_reread_limits_from_hw(motor):
|
||||
reread_limits_from_hw(motor)
|
||||
Reference in New Issue
Block a user