-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
channel and commands in YAML files #1023
Comments
I do not recall discussing this and we should have a really good look, as it is not only Tango, but also Exporter, probably Epics and all the rest using the commands/channels mechanism. |
I do not think it was ever discussed, either. And I am pretty sure I never looked at it. The exported yaml config files deal with properties and contained objects, but channels and commands are handled separately in the XML world and are simply not looked at in the conversion. I think the commands and channels need their own, well-thought-out handling in the yaml world, and that they should be treated as special cases - as they already are in the XML world. One possibility might be separate attributes 'channels' and 'commands' in parallel with 'objects' and 'configuration', and putting a list of dictionaries in with a dictionary for every channel and every command. One could write the conversion code once to re-export from XML it was decided how the end result should look. But it would have to be the people who understand commands and channels who look at this. |
We did some light discussions on this topic, and came up with following suggestion. Let's add a custom section for each protocol, that define command and channel bindings. The structure of each protocol section will have following format:
An example how you would configure Tango commands and channels.
An example how you would configure exporter command and channels.
An example of binding MXCuBE channels to EPICS Process Variables:
This format allows to write configs where |
Not my expertise, so I am not qualified to judge. It does look nice, though. |
@elmjag , thanks for sharing this discussion. I agree that the suggested structure looks cleaner, reducing a lot of repetition. :) I would just make a small change to better fit it for EPICS (which will be used here at ESS, and is already used by LNLS/Sirius and some other members). The key does not always apply to us. It's indeed a good practice to have a common prefix for the PVs, like in this one: However, it's not guaranteed in cases when a device is, for example, controlled by more than one EPICS IOC: https://github.com/mxcube/mxcubecore/blob/develop/mxcubecore/configuration/lnls_manaca/detector.xml So, in your example I would change the key to make it more flexible (without breaking the other cases), like this:
For cases where we don't have the (like in lnls_manaca/detector.xml), we could set as None (or maybe just omit it?), like this:
|
If I recall correctly, when we discussed this with @elmjag our assumption was that for Epics, the name prefix and the name would be simply concatenated. Which means that it should be possible to set the prefix to an empty string So an Epics bridge could look like this: epics:
'': # No common prefix for Epics names
channels:
det_threshols_energy: # name in MXCuBE
name: MX2:cam1:ThresholdEnergy # name in epics
user_beam_x:
name: MNC:S:SOFT:ao:BeamX |
And of course, in case it was not obvious, the idea is that it can also be done like this: epics:
MX2:cam1::
channels:
det_threshols_energy: # name in MXCuBE
name: ThresholdEnergy # name in epics
MNC:S:SOFT::
channels:
user_beam_x:
name: ao:BeamX |
@fabcor-maxiv thanks for the examples. If it works with an empty string or setting more than one end-point, then it looks good to me! :) To be honest it wasn't obvious for me in the first look, but if we include a quick example like this in the docs, then it would be enough to understand. |
I'm planning to write a bit more detailed documentation, with a lot of examples, in the future. First I want work a bit on the implementation. |
Seems that we have a possibly workable configuration format. Thanks everyone for looking at this. I'll take a stab at implementing this. We'll see of this works out in practice. |
Hi @elmjag, could you, please, give more details on how you convert the protocol name to type, which is taken into account when you choose in the HO which is your protocol. |
Not sure I understand the question. Each protocol gets it's own section in the config file. The section name is what defines the protocol used when creating the Command/Channel object. The XML attribute For example:
Will look like this:
I have started writing documentation on how channels and commands will be configured: It's is very incomplete so far, but perhaps it clarifies the idea. |
This is my initial attempt at implementing this: #1034 |
Give the following XML configuration file:
How would it be expressed as YAML config file? Did we discuss it at some point?
Currently, when generating YAML files with mxcubeweb-server's
--export-yaml-config
flag, thechannel
andcommand
tags are just ignored.The text was updated successfully, but these errors were encountered: