Added tests for MasterMACS

This commit is contained in:
2025-07-24 12:54:26 +02:00
parent 8a573295f0
commit 7f8c2e17b0
9 changed files with 51 additions and 11 deletions

View File

@@ -218,3 +218,7 @@ class SinqMotor(Motor):
class TurboPMAC(SinqMotor):
pass
class MasterMACS(SinqMotor):
pass

View File

@@ -30,7 +30,7 @@ pmacAsynIPPortConfigure("$(ASYN_PORT)","$(TURBOPMAC1_IP):$(TURBOPMAC1_PORT)")
turboPmacController("$(NAME)","$(ASYN_PORT)",8,$(TURBOPMAC1_BUSYPOLL),$(TURBOPMAC1_IDLEPOLL),1);
turboPmacAxis("$(NAME)",1);
turboPmacAxis("$(NAME)",5);
#turboPmacAxis("$(NAME)",5);
# Set the number of subsequent timeouts
setMaxSubsequentTimeouts("$(NAME)", 20);

View File

@@ -6,15 +6,7 @@ def stop_reset_enable_move_sequence(motor, target):
motor.write_field('stop', 1)
motor.write_field('reseterrorpv', 1)
# Wait until the motor is disabled.
# motor.wait_disabled()
motor.write_field('enable', 1)
# Wait until the motor is enabled.
# motor.wait_enabled()
motor.move_and_wait(target)
assert motor.at_target(target)
assert not motor.has_error()

View File

View File

@@ -0,0 +1,9 @@
# This module defines fixtures which are shared for all tests of motor "lin1".
import pytest
from common import MasterMACS
@pytest.fixture(autouse=True)
def motor():
return MasterMACS('masterMacs1', 'lin1')

View File

@@ -0,0 +1,34 @@
# Run a selection of common tests
from tests.move import *
from tests.sinqMotor.limits import *
from tests.sinqMotor.common import *
from tests.sinqMotor.turboPmac.reset import reset
def test_stop_reset_enable_move_sequence(motor):
stop_reset_enable_move_sequence(motor, 4)
stop_reset_enable_move_sequence(motor, 2)
def test_move_to_low_limit_switch(motor):
reset(motor, 1)
move_to_low_limit_switch(motor)
def test_move_to_high_limit_switch(motor):
reset(motor, 1)
move_to_high_limit_switch(motor)
def test_move_while_move(motor):
reset(motor, 1)
move_while_move(motor, -60, -20)
def test_stop(motor):
reset(motor, 1)
stop(motor, 18)
# def test_reread_limits_from_hw(motor):
# reread_limits_from_hw(motor)

View File

@@ -1,4 +1,4 @@
# This module defines fixtures which are shared for all tests of motor "rot1".
# This module defines fixtures which are shared for all tests of motor "lin1".
import pytest
from common import TurboPMAC

View File

@@ -2,7 +2,7 @@
from tests.move import *
from tests.sinqMotor.limits import *
from tests.sinqMotor.turboPmac.common import *
from tests.sinqMotor.common import *
from tests.sinqMotor.turboPmac.reset import reset
@@ -10,6 +10,7 @@ def test_stop_reset_enable_move_sequence(motor):
stop_reset_enable_move_sequence(motor, 5)
stop_reset_enable_move_sequence(motor, 0)
def test_move_to_low_limit_switch(motor):
reset(motor)
move_to_low_limit_switch(motor)