Shared controller/device state with reflexivity
A very important think which should be handled by BLISS is to allow the outside to deal with controllers/devices.
An example with motors.
- How the motor share it's state between sessions?
- What can we reach from a motor?
Problem
For now
- we don't know how to design properly a component which shares it's state between sessions (and then without the outside)
- from outside we have to deal in different way with each device we have to interact with. There is no list of available stuffs.
Solution
The basis for BLISS would be to provide:
- Guideline to design controller with synchronized states
- From this guideline we could simplify such implementation for main use cases
- Normalize a way to describe and retrieve this informations
I talk about multi-session. But if you want to switch from that to a single session+RPC you already have everything you need to switch BLISS base code.
Proposal/Example
A very common solution (see Qt, see Tango, see python) is to describe all that stuffs as property. What we need for now is:
- getter/setter (no setter -> read only)
- type (for example
float
,string
,named-bliss-objects-from-the-session
) - event (the one used for now by our RPC event)
So what you could describe your object such way,
and ideally this could handle the implementation details (Cache
or Channel
...) for you.
class MyBlissObject:
position = BlissObjectProperty(get_position, set_position, event="position", type=float)
velocity = BlissObjectProperty(get_velocity, set_velocity, event="velocity", type=float)
subdevice = BlissObjectProperty(get_subdevice, set_subdevice, event="subdevice", type="device")
And as result we are able to read this description for any device.
What do you think. How could help to define such guideline?
I am about to work on such abstraction. I could design a small stuff just for my use case, but we could think about something a bit more useful.