diff --git a/slic/utils/ioc/ioc.py b/slic/utils/ioc/ioc.py index 88579862..4ee5fb18 100644 --- a/slic/utils/ioc/ioc.py +++ b/slic/utils/ioc/ioc.py @@ -1,6 +1,9 @@ -import pcaspy from pcaspy import SimpleServer from pcaspy.tools import ServerThread + +from slic.core.adjustable import Adjustable +from slic.utils.registry import instances + from .adjdrv import AdjustableDriver @@ -17,11 +20,15 @@ DEFAULTS = { class IOC(ServerThread): - def __init__(self, adjs, prefix="slic"): + def __init__(self, adjs=None, prefix="slic"): # ensure prefix ends with colon if not prefix.endswith(":"): prefix += ":" + # if nothing specified, collect all Adjustables + if adjs is None: + adjs = instances(Adjustable, weak=True) + # allow dict with custom IDs if not isinstance(adjs, dict): adjs = {a.ID: a for a in adjs}