open-scd icon indicating copy to clipboard operation
open-scd copied to clipboard

Unnecessary data type duplication in Import IED plugin

Open danyill opened this issue 2 years ago • 2 comments

Describe the bug

When OpenSCD imports IEDs, in case of collision it checks the DataTypeTemplate to see if it is identical. If it is identical, no name change is required.

If it is not identical, it prefixes a new logical node with the IED name.

We have noticed that this equality check sometimes creates new DataTypeTemplates with no visible difference.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Import IEDs
  2. Use the attached SCL files. (from the XATBZA1P1... file use only the XATBZA1P1 device).
  3. After importing them both, check for changes in the DataTypeTemplates.
  4. Notice that although SIUnitKind (for example) is the same, there is a new DataTypeTemplate for the EnumType id="SIUnitKind", which is called <EnumType id="XATBZA1P1SIUnitKind">
  5. Carry out text diff of the SIUnitKind and XATBZA1P1SIUnitKind EnumTypes and find no difference.

Expected behavior

No new DataTypeTemplate should be created if the SCL requirements are met. Whitespace should not be considered in the creation of new DataTypeTemplates.

Screenshots

Screenshot showing the relevant EnumType:

image

When

XATBZA1P1_Demo_(Converted_to_FW8.40)_StandardDesignMU_v2_NoGOOSERxMap.zip

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Chrome on openscd.github.io.

Additional context

I think this is caused by our use of isEqualNode which means that XML "formatting/presentations concerns" leak into semantic differences which is true for the XML definition but not the SCL definition.

https://github.com/openscd/open-scd/blob/5bded3287bc4d448e11f12c880229f292ee47995/src/menu/ImportIEDs.ts#L178-L211

danyill avatar Mar 16 '23 03:03 danyill

Hello there,

Thank you for opening this issue! We appreciate your interest in our project. However, it seems that this issue hasn't had any activity for a while. To ensure that our issue tracker remains organized and efficient, we occasionally review and address stale issues.

If you believe this issue is still relevant and requires attention, please provide any additional context, updates, or details that might help us understand the problem better. Feel free to continue the conversation here.

If the issue is no longer relevant, you can simply close it. If you're uncertain, you can always reopen it later.

Remember, our project thrives on community contributions, and your input matters. We're here to collaborate and improve. Thank you for being part of this journey!

github-actions[bot] avatar Sep 03 '23 19:09 github-actions[bot]

It looks like is not solved completely. It is still happening to me: the collision mechanism only works when importing one single IED at the time, but importing multiple from the same SCD fails, due it adds the IEDname prefix to the LNtype only for one of them.

DiegoGasca avatar Nov 03 '25 16:11 DiegoGasca