How to use the ophyd.controls.EpicsSignal function in ophyd

To help you get started, we’ve selected a few ophyd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bluesky / ophyd / examples / cas_function.py View on Github external
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))
github bluesky / ophyd / examples / cas_function.py View on Github external
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))
github bluesky / ophyd / examples / cas_function.py View on Github external
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
github bluesky / ophyd / examples / cas_function.py View on Github external
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_))
github bluesky / ophyd / examples / cas_function.py View on Github external
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
github bluesky / ophyd / examples / cas_function.py View on Github external
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))
github bluesky / ophyd / examples / cas_function.py View on Github external
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())
github bluesky / ophyd / examples / cas_function.py View on Github external
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))
github bluesky / ophyd / examples / cas_function.py View on Github external
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))
github bluesky / ophyd / examples / cas_function.py View on Github external
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'))