-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite EPICS signal tests * Address review comments
- Loading branch information
Showing
16 changed files
with
694 additions
and
878 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import atexit | ||
from pathlib import Path | ||
|
||
from ophyd_async.epics.testing import TestingIOC | ||
|
||
HERE = Path(__file__).absolute().parent | ||
|
||
|
||
def start_ioc_subprocess(prefix: str, num_counters: int): | ||
"""Start an IOC subprocess with EPICS database for sample stage and sensor | ||
with the same pv prefix | ||
""" | ||
ioc = TestingIOC() | ||
# Create X and Y motors | ||
for suffix in ["X", "Y"]: | ||
ioc.add_database(HERE / "mover.db", P=f"{prefix}STAGE:{suffix}:") | ||
# Create a multichannel counter with num_counters | ||
ioc.add_database(HERE / "multichannelcounter.db", P=f"{prefix}MCC:") | ||
for i in range(1, num_counters + 1): | ||
ioc.add_database( | ||
HERE / "counter.db", | ||
P=f"{prefix}MCC:", | ||
CHANNEL=str(i), | ||
X=f"{prefix}STAGE:X:", | ||
Y=f"{prefix}STAGE:Y:", | ||
) | ||
# Start IOC and register it to be stopped at exit | ||
ioc.start() | ||
atexit.register(ioc.stop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
from ._example_ioc import ( | ||
CA_PVA_RECORDS, | ||
PVA_RECORDS, | ||
ExampleCaDevice, | ||
ExampleEnum, | ||
ExamplePvaDevice, | ||
ExampleTable, | ||
connect_example_device, | ||
get_example_ioc, | ||
EpicsTestCaDevice, | ||
EpicsTestEnum, | ||
EpicsTestIocAndDevices, | ||
EpicsTestPvaDevice, | ||
EpicsTestSubsetEnum, | ||
EpicsTestTable, | ||
) | ||
from ._utils import TestingIOC, generate_random_PV_prefix | ||
from ._utils import TestingIOC, generate_random_pv_prefix | ||
|
||
__all__ = [ | ||
"CA_PVA_RECORDS", | ||
"PVA_RECORDS", | ||
"ExampleCaDevice", | ||
"ExampleEnum", | ||
"ExamplePvaDevice", | ||
"ExampleTable", | ||
"connect_example_device", | ||
"get_example_ioc", | ||
"EpicsTestCaDevice", | ||
"EpicsTestEnum", | ||
"EpicsTestSubsetEnum", | ||
"EpicsTestPvaDevice", | ||
"EpicsTestTable", | ||
"EpicsTestIocAndDevices", | ||
"TestingIOC", | ||
"generate_random_PV_prefix", | ||
"generate_random_pv_prefix", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.