Topic: Change in terminals of new elements and conductors xml format v0.9

Hi,

I have a script that number de conductors in my project using the color of the conductor and the order of the elements by folio, X-position and Y-position. I extract the group of conductors that are suppose to have the same number using the id of the terminals in the element.

But with the v0.9 I'm having a problem, some conductors don't have the terminal as is in the element but the UUID of the terminal as in the collection and the UUID of the element it belongs to:

<conductor horizontal-alignment="AlignBottom" displaytext="1" formula="" text_color="#000000" conductor_section="" num="_" cable="" tension_protocol="" bus="" numsize="7" y="0" horizrotatetext="0" type="multi" dash-size="2" color2="#000000" x="0" onetextperfolio="0" element2="{d9b0ea30-87a5-4a55-9fb8-56e6d9d03bab}" condsize="1" vertirotatetext="270" conductor_color="" freezeLabel="false" function="" bicolor="false" terminal1="0" terminal2="{05fdba7b-6122-47ce-9e68-fe7ebc9c3df3}" vertical-alignment="AlignRight">

This is happening with the elements I've done with version 0.9.

I'm trying to change my script, so it finds the id terminal using the element uuid and the terminal uuid in the condcutor. How do I do it? it seems that I might have to do it with the orientation of the terminal, cause there is no relation between the terminal in the element of the diagram and the terminal of the element in the collection:

In the diagram

<terminal x="0" number="_" id="48" name="_" y="-11" orientation="0" nameHidden="0"/>
<terminal x="0" number="_" id="49" name="_" y="11" orientation="2" nameHidden="0"/>

In the collection

<terminal x="0" name="" y="15" orientation="s" uuid="{05fdba7b-6122-47ce-9e68-fe7ebc9c3df3}"/>
<terminal x="0" name="" y="-15" orientation="n" uuid="{67931c05-57c6-40dd-8607-3e2bb47feaa8}"/>

Thanks

Re: Change in terminals of new elements and conductors xml format v0.9

With the version 0.8, when you draw a new element each terminal of the element have an uuid (this uuid never change).
Now when you drop this element in the diagram editor and append a conductor to this element, the xml of the conductor is like this :
element1=uuid terminal1=uuid.
That mean the first extremity of the conductor is docked to terminal "uuid" of the element "uuid". Be careful, the uuid of the terminal is the same in the element xml definition(.elmt) and the xml of the project (.qet), but the uuid of the element is the uuid of the element 'instance' in the diagram (.qet) but not the uuid of the element xml definition (.elmt).
This is the new way how conductor is save when he is docked to a terminal with an uuid, but conductor can also be docked to an "old" element without "uuid" terminal, in this case the old syntax is used.
Also, the first extremity of a conductor can be docked to a "uuid" terminal and  the second extremity on a terminal without "uuid". So the xml of the conductor is a mix of the two syntax.

Développeur QElectroTech

Re: Change in terminals of new elements and conductors xml format v0.9

Thank you Joshua,

I'll change the way I'm processing the conductors so it works with both syntaxis.

Re: Change in terminals of new elements and conductors xml format v0.9

Thanks for the answer Joshua.

But I haven't been able to relate the UUID of the terminal with the Id in the instance of the element. Do you have any directions on how can I do it?