Skip to content

Commit

Permalink
Add sensor group to demo IOC
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Apr 11, 2024
1 parent e59d43d commit 37a38a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/user/examples/epics_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ class OldSensor(Device):
# Create ophyd-async devices
with DeviceCollector():
det = demo.Sensor(pv_prefix)
det_group = demo.SensorGroup(pv_prefix)
samp = demo.SampleStage(pv_prefix)
15 changes: 13 additions & 2 deletions src/ophyd_async/epics/demo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,22 @@ def start_ioc_subprocess() -> str:
pv_prefix = "".join(random.choice(string.ascii_uppercase) for _ in range(12)) + ":"
here = Path(__file__).absolute().parent
args = [sys.executable, "-m", "epicscorelibs.ioc"]

# Create standalone sensor
args += ["-m", f"P={pv_prefix}"]
args += ["-d", str(here / "sensor.db")]
for suff in "XY":
args += ["-m", f"P={pv_prefix}{suff}:"]

# Create sensor group
for suffix in ["1", "2", "3"]:
args += ["-m", f"P={pv_prefix}{suffix}:"]
args += ["-d", str(here / "sensor.db")]

# Create X and Y motors
for suffix in ["X", "Y"]:
args += ["-m", f"P={pv_prefix}{suffix}:"]
args += ["-d", str(here / "mover.db")]

# Start IOC
process = subprocess.Popen(
args,
stdin=subprocess.PIPE,
Expand Down

0 comments on commit 37a38a1

Please sign in to comment.