Skip to content
Snippets Groups Projects
Commit 39739219 authored by Gabriel Fedel's avatar Gabriel Fedel :speech_balloon: Committed by Gabriel Fedel
Browse files

tests: Update tests to new behavior

Include AI ENBL-TRANSF and remove PV aligment from SMNM of aux channels
parent 819853f5
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ class TestAIChannels:
sleep(0.1)
assert res == 0
caput(prefix + (":AI%d-ENBL-TRANSF") % c, 1)
@pytest.mark.parametrize("ch", list(range(0,10)))
def test_acq(self, prefix, board, ch):
"""
......
......@@ -8,15 +8,12 @@ import numpy as np
MAXINTERVAL = 65 #ms
def round_smnm(smnm):
return (smnm + 0x1F) &~0x1F
def get_max_acq(prefix, dec_fac):
fsamp = caget(prefix + ":F-SAMPLING")
neariqn = caget(prefix + ":IQSMPL-NEARIQN-RBV")
faclimit = 1/(fsamp*1000)*neariqn
return round_smnm(int(MAXINTERVAL/(faclimit*dec_fac)))
return int(MAXINTERVAL/(faclimit*dec_fac))
def get_max_dec(prefix, smnm):
fsamp = caget(prefix + ":F-SAMPLING")
......@@ -41,7 +38,7 @@ class TestDownSampledChannels:
caput(prefix + (":DWN%d-SMNM" % ch), smnm)
sleep(0.1)
smnm_rbv = caget(prefix + (":DWN%d-SMNM-RBV" % ch))
assert round_smnm(smnm) == int(smnm_rbv)
assert smnm == int(smnm_rbv)
#decimation
assert check_readback(prefix + (":DWN%d-DEC-ENBL" % ch), 1)
max_dec = get_max_dec(prefix, smnm_rbv)
......@@ -197,7 +194,7 @@ class TestDownSampledChannels:
ca.poll(1)
smnm_rbv = caget(prefix + (":DWN%d-SMNM-RBV" % ch))
assert round_smnm(smnm) == int(smnm_rbv)
assert smnm == int(smnm_rbv)
assert check_readback(prefix + (":DWN%d-DEC-ENBL" % ch), 0)
......@@ -244,7 +241,7 @@ class TestDownSampledChannels:
caput(prefix + (":DWN%d-SMNM" % ch), smnm)
sleep(0.1)
smnm_rbv = caget(prefix + (":DWN%d-SMNM-RBV" % ch))
assert round_smnm(smnm) == int(smnm_rbv)
assert smnm == int(smnm_rbv)
assert check_readback(prefix + (":DWN%d-DEC-ENBL" % ch), 1)
assert check_readback(prefix + (":DWN%d-DEC-FAC" % ch), dec_fac)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment