Replies: 7 comments
-
Just like EDM, MEDM, ... the file format has not been documented. This is in part because we provide both the editor and the runtime, and reserve the right to adjust the file format while trying to remain compatible with previous versions. The display builder is for example quite lenient when it comes to opening BOY files, re-mapping or re-interpreting that format. One potential issue here is that we try to keep the display file minimalist, omitting all default values. This is a valid file:
On the other extreme, a label can look like this, and that's with empty actions, rules, scripts:
If you want to create a schema, you can start with https://github.com/ControlSystemStudio/phoebus/blob/master/app/display/model/src/test/java/org/csstudio/display/builder/model/AllWidgetsAllProperties.java At the same time, it might be useful to check the widget hierarchy, for example Widget -> VisibleWidget -> MacroWidget to see how the base widget has properties x, y, width, height, .., VisibleWidget adds visible and tooltip, and so on to get a similar hierarchy in the schema. Do you know if there's a way to do that such that sites with locally added widgets can then also add them to the schema? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the throughout reply and sorry for the delay. I had a heck of a time trying to figure out how to run AllWidgetsAllProperties.java on the command line. I actually never figured it out, tried many different iterations of mvn exec:java and also tried phoebus.sh -main. Let me know if you have a quick hint of what I should have done. In the end the solution was opening the project in an IDE and simply right-clicking on the file... The output file of AllWidgetsAllProperties.java looks like a good starting point. I'm not a XML schema expert but I can read up about it and see how different schemas could work.
I don't know of a way right now but can look into that as well. |
Beta Was this translation helpful? Give feedback.
-
I would also run it from within the IDE, and as noted you'll have to change the EXAMPLE_FILE path because its current value last worked when this was all Eclipse plugins, https://github.com/kasemir/org.csstudio.display.builder, before phoebus. The ant build of the app-display-model-${version}.jar does include the test code, so you can run it from within the product:
A long time ago I invoked it that way as part of the nightly build, back when some where discussing display file formats, how just Instead of running AllWidgetsAllProperties, you could also use plain phoebus with the preference setting
This way, any time you write a display file from the editor it will include all the default values, so you get the full set of values for a widget. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for writing phoebusgen! This will enable all kinds of automation workflows. |
Beta Was this translation helpful? Give feedback.
-
Thanks Lorenzo that is really helpful. I would like to try out the schema and generated code strategy if I get some time. It would really help future maintenance for phoebusgen. generateDS looks promising |
Beta Was this translation helpful? Give feedback.
-
Hello, I have just make a pull request |
Beta Was this translation helpful? Give feedback.
-
That is really nice @katysaintin! |
Beta Was this translation helpful? Give feedback.
-
I remember at one point a few months ago there was a discussion to create an XML schema document for the widgets. Is that correct? If so, is there a status on that?
Phoebusgen is a package to auto generate the XML from python and I think a schema doc would be useful for the package instead of what I have been doing which is all manual.
https://github.com/als-epics/phoebusgen
I'd be happy to help. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions