com-pas / compas-sct

System Configuration Tool (SCT) components
Apache License 2.0
9 stars 9 forks source link

RSR-368 : Automated LNode.iedName update into SCD file - Part 3 of 4 #67

Closed jeanetiennelemaire closed 2 years ago

jeanetiennelemaire commented 2 years ago

As a COMPAS service user, this US purpose is to create a COMPAS service that generate a new SCD file and complete it with Substation section from SSD file, IED section from STD files and Private elements.

 

As service user, I would like to have a service in order to create a new SCD file and complete it with:

updated /Substation/VoltageLevel/Bay/Function/LNode.iedName (cf US RSR-368)   

Prerequisites: 

The following COMPAS services have already been developed: RSR-161  to edit LNode section for a given Substation/VoltageLevel/Bay/Function in current SCD file US RSR-358 and RSR-367 have been developed  

The inputs of this service are:

A SCD file (required) defined by Header.id, Header.version and Header.revision.  

US process description:

 The goal of this US is to update the Private SCL/Substation/VoltageLevel/Bay/Function/LNode @iedName and if necessary create new SCL/Substation/VoltageLevel/Bay/Function/LNode

For each SCL/Substation/VoltageLevel/Bay/Function/LNode @iedName: As a LNode object may have one, two or three LNode/Private/compas:ICDHeader, there are 3 cases in order that all LNode objects have one and only one Private  LNode/Private/compas:ICDHeader: case 0) If the LNode section doesn't contain any Private LNode/Private/compas:ICDHeader then the processing is aborted and an error message is returned case 1) If the LNode section contains only one LNode/Private/compas:ICDHeader then copy LNode/Private/compas:ICDHeader @IEDName into /LNode @iedName to rename it case 2) If the LNode section contains two LNode/Private/compas:ICDHeader then: create a new LNode section with the same iedName, ldInst and lnClass into the same Function XML node and cut and paste the second Private section into this new LNode section for each of the 2 LNode sections, copy the LNode/Private/compas:ICDHeader @IEDName into /LNode @iedName to rename it case 3) If the LNode section contains 3 LNode/Private/compas:ICDHeader then: create 2 new LNode sections with the same iedName, ldInst and lnClass into the same Function XML node and cut and paste the second Private section into this first new LNode section and cut and paste the third Private section into this second new LNode section for each of the 3 LNode sections, copy the LNode/Private/compas:ICDHeader @IEDName into /LNode @iedName to rename it An example is provided in attachement; see XML_Example.xml  

Output:

The SCD file has been completed with these elements:

all SCL/Substation/VoltageLevel/Bay/Function/LNode has one and only one Private LNode/Private/compas:ICDHeader all SCL/Substation/VoltageLevel/Bay/Function/LNode @iedName have been renamed with its LNode/Private/compas:ICDHeader @IEDName  

Error messages:

All error messages from COMPAS services are returned If one LNode section doesn't contain any Private LNode/Private/compas:ICDHeader then the processing is aborted and an error message is returned: "SCL/Substation/VoltageLevel/Bay/Function/LNode doesn't contain any Private LNode/Private/compas:ICDHeader. The processing is aborted."

samirromdhani commented 2 years ago

Hello @DamienPERNET,

You can specify the error message when no private found SCL/Substation/VoltageLevel/Bay/Function/LNode doesn't contain any Private LNode/Private/compas:ICDHeader. The processing is aborted.

I think that LNode/Private/compas:ICDHeader is a wrong definition of a Private, how about compas:ICDHeader. How do you think ? This part of the message The processing is aborted. it is necessary?

DamienPERNET commented 2 years ago

The error message should be SCL/Substation/VoltageLevel/Bay/Function/LNode doesn't contain any Private compas:ICDHeader.

massifben commented 2 years ago

Hello @DamienPERNET, in case the attribute LNode/Private/compas:ICDHeader@iedName is missing or is an empty string, I suggest this error message : SCL/Substation/VoltageLevel/Bay/Function/LNode/Private/compas:ICDHeader doesn't contain any @IEDName attribute or attribute is blank It is similar to the error message when compas:ICDHeader is missing.

DamienPERNET commented 2 years ago

Hello @massifben OK for the error message. The value of XPath SCL/Substation @name/VoltageLevel @name/Bay @name/Function @name/LNode @iedName @ldInst @prefix @lnClass @lnInst/Private/compas:ICDHeader where error occurs should be returned in order to fix quickly the /Substation section from SSD file

massifben commented 2 years ago

Hello, @DamienPERNET, I will add the XPath values for this error in this particular feature, but I think you could create an issue to generalize this to all error messages in compas services, for consistency.