Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_array():
logger.info('array function')
pvnames = array_func.get_pvnames()
sig_value = EpicsSignal(pvnames['value'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
sig_value.value = 2.0
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % array_func(value=2.0))
def test_sync():
logger.info('synchronous function')
pvnames = sync_func.get_pvnames()
sig_a = EpicsSignal(pvnames['a'])
sig_b = EpicsSignal(pvnames['b'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
a, b = 3.0, 4.0
sig_a.value = a
sig_b.value = b
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % sync_func(a=a, b=b))
def test_bool():
logger.info('logical or of two boolean values')
pvnames = bool_func.get_pvnames()
sig_bool1 = EpicsSignal(pvnames['bool_one'])
sig_bool2 = EpicsSignal(pvnames['bool_two'])
sig_proc = EpicsSignal(pvnames['process'])
sig_status = EpicsSignal(pvnames['status'])
sig_ret = EpicsSignal(pvnames['retval'])
one, two = True, False
sig_bool1.value = one
sig_bool2.value = two
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r (string is %r)' %
(sig_ret.value, sig_ret.get(as_string=True)))
logger.info('called normally: %r' % bool_func(bool_one=one, bool_two=two))
one, two = False, False
sig_bool1.value = one
sig_bool2.value = two
sig_proc.value = 1
def test_array_input():
logger.info('array input function')
pvnames = array_input_func.get_pvnames()
sig_value = EpicsSignal(pvnames['value'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
input_ = np.array([5, 10, 15])
sig_value.value = input_
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % array_input_func(value=input_))
def test_bool():
logger.info('logical or of two boolean values')
pvnames = bool_func.get_pvnames()
sig_bool1 = EpicsSignal(pvnames['bool_one'])
sig_bool2 = EpicsSignal(pvnames['bool_two'])
sig_proc = EpicsSignal(pvnames['process'])
sig_status = EpicsSignal(pvnames['status'])
sig_ret = EpicsSignal(pvnames['retval'])
one, two = True, False
sig_bool1.value = one
sig_bool2.value = two
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r (string is %r)' %
(sig_ret.value, sig_ret.get(as_string=True)))
logger.info('called normally: %r' % bool_func(bool_one=one, bool_two=two))
one, two = False, False
sig_bool1.value = one
sig_bool2.value = two
def test_async():
logger.info('asynchronous function')
pvnames = async_func.get_pvnames()
sig_a = EpicsSignal(pvnames['a'])
sig_b = EpicsSignal(pvnames['b'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
a, b = 3.0, 4.0
sig_a.value = a
sig_b.value = b
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % async_func(a=a, b=b))
def test_no_arg():
logger.info('no argument function')
pvnames = no_arg_func.get_pvnames()
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % no_arg_func())
def test_async():
logger.info('asynchronous function')
pvnames = async_func.get_pvnames()
sig_a = EpicsSignal(pvnames['a'])
sig_b = EpicsSignal(pvnames['b'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
a, b = 3.0, 4.0
sig_a.value = a
sig_b.value = b
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % async_func(a=a, b=b))
def test_array():
logger.info('array function')
pvnames = array_func.get_pvnames()
sig_value = EpicsSignal(pvnames['value'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
sig_value.value = 2.0
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % array_func(value=2.0))
def test_string():
logger.info('string function')
pvnames = string_func.get_pvnames()
sig_value = EpicsSignal(pvnames['value'])
sig_proc = EpicsSignal(pvnames['process'])
sig_ret = EpicsSignal(pvnames['retval'])
sig_value.value = 'hello'
sig_proc.value = 1
time.sleep(0.1)
logger.info('result through channel access: %r' % sig_ret.value)
logger.info('called normally: %r' % string_func(value='hello'))