-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: add tests that revealed some minor bugs
- Loading branch information
Showing
2 changed files
with
150 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python3 | ||
from textwrap import dedent | ||
|
||
from caproto import ChannelType | ||
from caproto.server import PVGroup, ioc_arg_parser, pvproperty, run | ||
|
||
|
||
class VariousTypesIOC(PVGroup): | ||
""" | ||
An IOC with three uncoupled read/writable PVs. | ||
Scalar PVs | ||
---------- | ||
COMP (int) | ||
""" | ||
|
||
INT = pvproperty( | ||
value=3, | ||
dtype=ChannelType.INT, | ||
) | ||
|
||
FLOAT = pvproperty( | ||
value=3.14, | ||
dtype=ChannelType.FLOAT, | ||
precision=3, | ||
) | ||
|
||
STRING = pvproperty( | ||
value="pi", | ||
dtype=ChannelType.STRING, | ||
) | ||
|
||
ENUM = pvproperty( | ||
value=2, | ||
dtype=ChannelType.ENUM, | ||
enum_strings=["e", "i", "pi"] | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
ioc_options, run_options = ioc_arg_parser( | ||
default_prefix="VAR:TYPES:", desc=dedent(VariousTypesIOC.__doc__) | ||
) | ||
ioc = VariousTypesIOC(**ioc_options) | ||
run(ioc.pvdb, **run_options) |
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