Skip to content
Snippets Groups Projects
Commit 452896c1 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

Merge branch...

Merge branch '30-digits-at-the-end-of-a-do-name-is-an-instance-number-only-when-the-presence-condition-requires' into 'master'

Resolve "digits at the end of a DO name is an instance number only when the presence condition requires one"

Closes #30

See merge request !31
parents 6765e277 7fb79740
No related branches found
No related tags found
1 merge request!31Resolve "digits at the end of a DO name is an instance number only when the presence condition requires one"
Pipeline #5188 passed
......@@ -452,9 +452,9 @@ public class RiseClipseValidatorSCL {
console.info( " dominique.marcadet@centralesupelec.fr" );
console.info( " aurelie.dehouck-neveu@edf.fr" );
console.info( "Web site:" );
console.info( " http://wdi.supelec.fr/software/RiseClipse/" );
console.info( " http://wdi.centralesupelec.fr/software/RiseClipse/" );
console.info( "" );
console.info( "RiseClipseValidatorSCL version: 1.1.0 a18 (19 February 2020)" );
console.info( "RiseClipseValidatorSCL version: 1.1.0 a19 (31 March 2020)" );
console.info( "" );
}
......
......@@ -15,7 +15,7 @@
** dominique.marcadet@centralesupelec.fr
** aurelie.dehouck-neveu@edf.fr
** Web site:
** http://wdi.supelec.fr/software/RiseClipse/
** http://wdi.centralesupelec.fr/software/RiseClipse/
*************************************************************************
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.nsd;
......@@ -626,16 +626,17 @@ public class DataObjectPresenceConditionValidator {
private boolean addDO( DO do_, String anyLNClassName, DiagnosticChain diagnostics ) {
// An instance number may be set as a suffix
String[] names;
if( do_.getName().matches( "[a-zA-Z]+\\d+" )) {
// but a number at the end of the name is not always an instance number !
// Therefore, we first look for with the full name, then with the name without the suffix
String[] names = new String[] { do_.getName() };
if( ! presentDO.containsKey( names[0] )) {
// if( do_.getName().matches( "[a-zA-Z]+\\d+" )) {
names = do_.getName().split( "(?=\\d)", 2 );
}
else {
names = new String[] { do_.getName() };
}
if( names.length == 0 ) {
console.error( "[NSD validation] Unexpected DO name " + do_.getName() + " in LNodeType (line " + do_.getParentLNodeType().getLineNumber() );
return false;
if( names.length == 0 ) {
console.error( "[NSD validation] Unexpected DO name " + do_.getName() + " in LNodeType (line " + do_.getParentLNodeType().getLineNumber() );
return false;
}
}
if( ! presentDO.containsKey( names[0] )) {
if( base != null ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment