Skip to content
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

BUG: only add delay tag if there is a non-0 delay specified #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tangkong
Copy link
Contributor

As the title says, we should only include the <delay> xml tag if there is a delay to report. It defaults to 0 on the phoebus side.

Rabbit hole:
The way we're generating xml files here is a little circuitous. We create an ElementTree and produce its string representation, only to re-parse it into a minidom and pretty-print it again. The only difference this produces is in the <?xml version="1.0" ?> at the beginning of the file, where the encoding may show up.

I've not changed this here, but it's not so hard to just omit minidom and use xml.etree.ElementTree the whole way.

@KaushikMalapati
Copy link
Contributor

This looks good to me, but should we do the same thing for Description? There are some entries in KFE/SXR-EBD that have no description and generate in the xml.

https://github.com/ControlSystemStudio/phoebus/blob/c443eb093ce17bcb2c12517fc21040cec7ff2a36/app/alarm/examples/alarm_configuration.xsd#L52

@tangkong
Copy link
Contributor Author

You're right, the description and delay fields look similar in configuration according to that .xsd you shared. I'll confirm with Thorsten just to make sure.

@KaushikMalapati
Copy link
Contributor

Can you ask thorsten if having component tags like
<component name="CRIX"/>
is ok?

They generate for all our empty configurations

(pcds-5.9.1) [kaushikm@tmo-daq tk-nalsm]$ grep -r "/>"
Binary file .git/objects/pack/pack-74aa568e69cc4ccb100102b9a9dd8166a3b915f2.pack matches
XML/KFE/CRIX-alarms.xml:   <component name="CRIX"/>
XML/KFE/QRIX-alarms.xml:   <component name="QRIX"/>
XML/LFE/CXI-alarms.xml:   <component name="CXI"/>
XML/LFE/XCS-alarms.xml:   <component name="XCS"/>
XML/LFE/MEC-alarms.xml:   <component name="MEC"/>
XML/LFE/MFX-alarms.xml:   <component name="MFX"/>
XML/LFE/XPP-alarms.xml:   <component name="XPP"/>

Everything else looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants