Skip to content

Added device content dict to tango.sim. #712

Open
burkeds wants to merge 1 commit into
mainfrom
add-content-to-tango-demo
Open

Added device content dict to tango.sim. #712
burkeds wants to merge 1 commit into
mainfrom
add-content-to-tango-demo

Conversation

@burkeds

@burkeds burkeds commented Dec 19, 2024

Copy link
Copy Markdown
Collaborator

This dict can be imported and passed to MultiDeviceTestContext to access the demo device servers in a normal python script or ipython kernel. This step is analogous to start_ioc_subprocess used in the epics demo.

from tango.test_context import MultiDeviceTestContext
from ophyd_async.tango.sim import device_content, TangoDetector

async def test_devices():
    with MultiDeviceTestContext(device_content, process=True) as context:
        detector = TangoDetector(
            mover_trl=context.get_device_access("sim/motor/1"),
            counter_trls=[
                context.get_device_access("sim/counter/1"),
                context.get_device_access("sim/counter/2"),
            ],
            name = "detector"
        )
        await detector.connect()
        await detector.read()

await test_devices()

… passed to MultiDeviceTestContext to access the demo device servers in a normal python script or ipython kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant