Client Library for Control Systems
-
Define the API of the Lima client library -
Review with the Bliss team -
Implement the library on top of the device servers
The basic idea is to centralized and hide the implementation details of the Lima distributed application with a client library in Python.
from Lima2.Client import Detector
from uuid import uuid1
det = Detector("id00/limacontrol/sam_simulator", "id00/limareceiver/sam_simulator1")
# Construct parameters with default values
acq_params = det.AcqParams() # Acquisition parameters
proc_params = det.ProcParams() # Processing parameters
# Get current parameters from DS
acq_params = det.getAcqParams() # Current acquisition parameters
proc_params = det.getProcParams() # Current Processing parameters
# Acquisition
uuid = uuid1()
det.prepareAcq(uuid, acq_params, proc_params)
det.startAcq()
det.stopAcq()
det.stateAcq()
evt = det.getStateChangeEvent() # Returns a gevent.Event used to track
# Processing
uuids = det.listPipelines() # Returns a list of all processing pipelines UUIDs
det.abortPipeline(acq_uuid) # Abort a given processing pipeline
det.erasePipeline(acq_uuid) # Erase a given processing pipeline
nb_frames_acquired = det.nbFramesAcquired() # Returns the number of frames acquired
nb_frames_xferred = det.nbFramesXferred() # Returns the number of frames transferred
# Miscellaneous
version = det.version() # Versions info
det_info = det.detInfo() # Static detector info
Edited by Alejandro Homs Puron