From 667fdb9480c9878ae31d98b8a41b75e39cbe264d Mon Sep 17 00:00:00 2001 From: Dominique Marcadet <Dominique.Marcadet@centralesupelec.fr> Date: Mon, 20 May 2019 22:40:44 +0200 Subject: [PATCH] add messages when presence conditions are checked --- ...taAttributePresenceConditionValidator.java | 18 +++++++++++++ .../DataObjectPresenceConditionValidator.java | 25 ++++++++++++++++++- ...bDataObjectPresenceConditionValidator.java | 18 +++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataAttributePresenceConditionValidator.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataAttributePresenceConditionValidator.java index 0e8f2cd..f00f954 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataAttributePresenceConditionValidator.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataAttributePresenceConditionValidator.java @@ -570,6 +570,7 @@ public class DataAttributePresenceConditionValidator { // Element is mandatory // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( mandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"M\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.mandatory ) { if( presentDA.get( name ) == null ) { diagnostics.add( new BasicDiagnostic( @@ -587,6 +588,7 @@ public class DataAttributePresenceConditionValidator { // Element is optional // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( optional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"O\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.optional ) { if( presentDA.get( name ) == null ) { // Nothing @@ -598,6 +600,7 @@ public class DataAttributePresenceConditionValidator { // Element is forbidden // Usage in standard NSD files (version 2007B): DataObject if( forbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"F\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.forbidden ) { if( presentDA.get( name ) != null ) { diagnostics.add( new BasicDiagnostic( @@ -665,6 +668,7 @@ public class DataAttributePresenceConditionValidator { // At least one of marked elements of a group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataObject and DataAttribute and SubDataAttribute if( atLeastOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtLeastOne\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< Integer, HashSet< String > > e1 : atLeastOne.entrySet() ) { boolean groupOK = false; for( String member : e1.getValue() ) { @@ -689,6 +693,7 @@ public class DataAttributePresenceConditionValidator { // At most one of marked elements shall be present // Usage in standard NSD files (version 2007B): DataObject if( atMostOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtMostOne\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int count = 0; for( String s : atMostOne ) { if( presentDA.get( s ) != null ) { @@ -711,6 +716,7 @@ public class DataAttributePresenceConditionValidator { // All or none of the elements of a group n shall be present // Usage in standard NSD files (version 2007B): DataAttribute if( allOrNonePerGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOrNonePerGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< Integer, HashSet< String > > e1 : allOrNonePerGroup.entrySet() ) { int groupCount = 0; for( String member : e1.getValue() ) { @@ -735,6 +741,7 @@ public class DataAttributePresenceConditionValidator { // All elements of only one group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataAttribute if( allOnlyOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOnlyOneGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allOnlyOneGroup.entrySet() ) { int groupCount = 0; @@ -783,6 +790,7 @@ public class DataAttributePresenceConditionValidator { // All elements of at least one group n shall be present // Usage in standard NSD files (version 2007B): DataAttribute if( allAtLeastOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllAtLeastOneGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allAtLeastOneGroup.entrySet() ) { int groupCount = 0; @@ -811,6 +819,7 @@ public class DataAttributePresenceConditionValidator { // Mandatory if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MF\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseForbidden.entrySet() ) { if( presentDA.get( entry.getValue() ) != null ) { if( presentDA.get( entry.getKey() ) == null ) { @@ -844,6 +853,7 @@ public class DataAttributePresenceConditionValidator { // Mandatory if sibling element is present, otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryIfSiblingPresentElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MO\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseOptional.entrySet() ) { if( presentDA.get( entry.getValue() ) != null ) { if( presentDA.get( entry.getKey() ) == null ) { @@ -865,6 +875,7 @@ public class DataAttributePresenceConditionValidator { // Optional if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( optionalIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OM\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseMandatory.entrySet() ) { if( presentDA.get( entry.getValue() ) == null ) { if( presentDA.get( entry.getKey() ) == null ) { @@ -886,6 +897,7 @@ public class DataAttributePresenceConditionValidator { // Forbidden if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( forbiddenIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"FM\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : forbiddenIfSiblingPresentElseMandatory.entrySet() ) { if( presentDA.get( entry.getValue() ) != null ) { if( presentDA.get( entry.getKey() ) != null ) { @@ -920,6 +932,7 @@ public class DataAttributePresenceConditionValidator { // If satisfied, the element is mandatory, otherwise optional // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseOptional.entrySet() ) { String doc = cdc .getDataAttribute() @@ -950,6 +963,7 @@ public class DataAttributePresenceConditionValidator { // If satisfied, the element is mandatory, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseForbidden.entrySet() ) { String doc = cdc .getDataAttribute() @@ -980,6 +994,7 @@ public class DataAttributePresenceConditionValidator { // If satisfied, the element is optional, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( optionalIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OFcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfTextConditionElseForbidden.entrySet() ) { String doc = cdc .getDataAttribute() @@ -1059,6 +1074,7 @@ public class DataAttributePresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOln0\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); EList< AbstractDataObject > adoList = doType.getReferredByAbstractDataObject(); for( AbstractDataObject ado : adoList ) { if( ado instanceof DO ) { @@ -1088,6 +1104,7 @@ public class DataAttributePresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise forbidden // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFln0\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); EList< AbstractDataObject > adoList = doType.getReferredByAbstractDataObject(); for( AbstractDataObject ado : adoList ) { if( ado instanceof DO ) { @@ -1346,6 +1363,7 @@ public class DataAttributePresenceConditionValidator { // Optional if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject and DataAttribute if( optionalIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OF\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseForbidden.entrySet() ) { if( presentDA.get( entry.getValue() ) == null ) { if( presentDA.get( entry.getKey() ) != null ) { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java index 5afc1bc..a3fe6f5 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/DataObjectPresenceConditionValidator.java @@ -34,7 +34,6 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.DA; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DO; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI; import fr.centralesupelec.edf.riseclipse.iec61850.scl.DOType; -import fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice; import fr.centralesupelec.edf.riseclipse.iec61850.scl.LN0; import fr.centralesupelec.edf.riseclipse.iec61850.scl.LNodeType; import fr.centralesupelec.edf.riseclipse.iec61850.scl.Val; @@ -682,6 +681,7 @@ public class DataObjectPresenceConditionValidator { // Element is mandatory // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( mandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"M\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.mandatory ) { if( presentDO.get( name ) == null ) { diagnostics.add( new BasicDiagnostic( @@ -708,6 +708,7 @@ public class DataObjectPresenceConditionValidator { // Element is optional // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( optional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"O\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.optional ) { if( presentDO.get( name ) == null ) { } @@ -727,6 +728,7 @@ public class DataObjectPresenceConditionValidator { // Element is forbidden // Usage in standard NSD files (version 2007B): DataObject if( forbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"F\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.forbidden ) { if( presentDO.get( name ) != null ) { diagnostics.add( new BasicDiagnostic( @@ -770,6 +772,7 @@ public class DataObjectPresenceConditionValidator { // At least one element shall be present; all instances have an instance number > 0 // Usage in standard NSD files (version 2007B): DataObject if( mandatoryMulti != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"Mmulti\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.mandatoryMulti ) { if( presentDO.get( name ) == null ) { diagnostics.add( new BasicDiagnostic( @@ -796,6 +799,7 @@ public class DataObjectPresenceConditionValidator { // Zero or more elements may be present; all instances have an instance number > 0 // Usage in standard NSD files (version 2007B): DataObject if( optionalMulti != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"Omulti\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.optionalMulti ) { if( presentDO.get( name ) == null ) { } @@ -816,6 +820,7 @@ public class DataObjectPresenceConditionValidator { // At least one of marked elements of a group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataObject and DataAttribute and SubDataAttribute if( atLeastOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtLeastOne\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< Integer, HashSet< String > > e1 : atLeastOne.entrySet() ) { boolean groupOK = false; for( String member : e1.getValue() ) { @@ -840,6 +845,7 @@ public class DataObjectPresenceConditionValidator { // At most one of marked elements shall be present // Usage in standard NSD files (version 2007B): DataObject if( atMostOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtMostOne\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); int count = 0; for( String s : atMostOne ) { if( presentDO.get( s ) != null ) { @@ -862,6 +868,7 @@ public class DataObjectPresenceConditionValidator { // All or none of the elements of a group n shall be present // Usage in standard NSD files (version 2007B): DataAttribute if( allOrNonePerGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOrNonePerGroup\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< Integer, HashSet< String > > e1 : allOrNonePerGroup.entrySet() ) { int groupCount = 0; for( String member : e1.getValue() ) { @@ -886,6 +893,7 @@ public class DataObjectPresenceConditionValidator { // All elements of only one group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataAttribute if( allOnlyOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOnlyOneGroup\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allOnlyOneGroup.entrySet() ) { int groupCount = 0; @@ -934,6 +942,7 @@ public class DataObjectPresenceConditionValidator { // All elements of at least one group n shall be present // Usage in standard NSD files (version 2007B): DataAttribute if( allAtLeastOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllAtLeastOneGroup\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allAtLeastOneGroup.entrySet() ) { int groupCount = 0; @@ -962,6 +971,7 @@ public class DataObjectPresenceConditionValidator { // Mandatory if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MF\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseForbidden.entrySet() ) { if( presentDO.get( entry.getValue() ) != null ) { if( presentDO.get( entry.getKey() ) == null ) { @@ -995,6 +1005,7 @@ public class DataObjectPresenceConditionValidator { // Mandatory if sibling element is present, otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryIfSiblingPresentElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MO\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseOptional.entrySet() ) { if( presentDO.get( entry.getValue() ) != null ) { if( presentDO.get( entry.getKey() ) == null ) { @@ -1016,6 +1027,7 @@ public class DataObjectPresenceConditionValidator { // Optional if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( optionalIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OM\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseMandatory.entrySet() ) { if( presentDO.get( entry.getValue() ) == null ) { if( presentDO.get( entry.getKey() ) == null ) { @@ -1037,6 +1049,7 @@ public class DataObjectPresenceConditionValidator { // Forbidden if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( forbiddenIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"FM\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : forbiddenIfSiblingPresentElseMandatory.entrySet() ) { if( presentDO.get( entry.getValue() ) != null ) { if( presentDO.get( entry.getKey() ) != null ) { @@ -1071,6 +1084,7 @@ public class DataObjectPresenceConditionValidator { // If satisfied, the element is mandatory, otherwise optional // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOcond\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseOptional.entrySet() ) { String doc = anyLNClass .getDataObject() @@ -1101,6 +1115,7 @@ public class DataObjectPresenceConditionValidator { // If satisfied, the element is mandatory, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFcond\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseForbidden.entrySet() ) { String doc = anyLNClass .getDataObject() @@ -1131,6 +1146,7 @@ public class DataObjectPresenceConditionValidator { // If satisfied, the element is optional, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( optionalIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OFcond\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : optionalIfTextConditionElseForbidden.entrySet() ) { String doc = anyLNClass .getDataObject() @@ -1160,6 +1176,7 @@ public class DataObjectPresenceConditionValidator { // One or more elements shall be present; all instances have an instance number within range [min, max] (see IEC 61850-7-1) // Usage in standard NSD files (version 2007B): None if( mandatoryMultiRange != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MmultiRange\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.mandatoryMultiRange.keySet() ) { if( presentDO.get( name ) == null ) { diagnostics.add( new BasicDiagnostic( @@ -1203,6 +1220,7 @@ public class DataObjectPresenceConditionValidator { // Zero or more elements may be present; all instances have an instance number within range [min, max] (see IEC 61850-7-1) // Usage in standard NSD files (version 2007B): DataObject if( optionalMultiRange != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OmultiRange\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : this.optionalMultiRange.keySet() ) { if( presentDO.get( name ) == null ) { } @@ -1255,6 +1273,7 @@ public class DataObjectPresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOln0\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : mandatoryInLLN0ElseOptional ) { if( presentDO.get( name ) == null ) { for( AnyLN anyLN : lNodeType.getReferredByAnyLN() ) { @@ -1276,6 +1295,7 @@ public class DataObjectPresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise forbidden // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFln0\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : mandatoryInLLN0ElseForbidden ) { for( AnyLN anyLN : lNodeType.getReferredByAnyLN() ) { if( presentDO.get( name ) == null ) { @@ -1417,6 +1437,7 @@ public class DataObjectPresenceConditionValidator { // Element is mandatory in the context of a root logical device; otherwise it is optional // Usage in standard NSD files (version 2007B): DataObject if( mandatoryInRootLogicalDeviceElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOrootLD\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( String name : mandatoryInRootLogicalDeviceElseOptional ) { for( AnyLN anyLN : lNodeType.getReferredByAnyLN() ) { Optional< DOI > grRef = @@ -1520,6 +1541,7 @@ public class DataObjectPresenceConditionValidator { // Usage in standard NSD files (version 2007B): DataObject // TODO: same as "MOlnNs" ? if( mandatoryIfNameSpaceOfLogicalNodeDeviatesElseOptional2 != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MONamPlt\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); // The attribute lnNs shall be a DataAttribute of the name plate NamPlt of a logical node String lnNs = ""; @@ -1612,6 +1634,7 @@ public class DataObjectPresenceConditionValidator { // Optional if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject and DataAttribute if( optionalIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OF\" on LNodeType id=" + lNodeType.getId() + " ) at line " + lNodeType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseForbidden.entrySet() ) { if( presentDO.get( entry.getValue() ) == null ) { if( presentDO.get( entry.getKey() ) != null ) { diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/SubDataObjectPresenceConditionValidator.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/SubDataObjectPresenceConditionValidator.java index 0c945f7..822ad15 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/SubDataObjectPresenceConditionValidator.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/nsd/SubDataObjectPresenceConditionValidator.java @@ -570,6 +570,7 @@ public class SubDataObjectPresenceConditionValidator { // Element is mandatory // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( mandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"M\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.mandatory ) { if( presentSDO.get( name ) == null ) { diagnostics.add( new BasicDiagnostic( @@ -587,6 +588,7 @@ public class SubDataObjectPresenceConditionValidator { // Element is optional // Usage in standard NSD files (version 2007B): DataObject and DataAttribute and SubDataAttribute if( optional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"O\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.optional ) { if( presentSDO.get( name ) == null ) { // Nothing @@ -598,6 +600,7 @@ public class SubDataObjectPresenceConditionValidator { // Element is forbidden // Usage in standard NSD files (version 2007B): DataObject if( forbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"F\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( String name : this.forbidden ) { if( presentSDO.get( name ) != null ) { diagnostics.add( new BasicDiagnostic( @@ -665,6 +668,7 @@ public class SubDataObjectPresenceConditionValidator { // At least one of marked elements of a group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataObject and DataAttribute and SubDataAttribute if( atLeastOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtLeastOne\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< Integer, HashSet< String > > e1 : atLeastOne.entrySet() ) { boolean groupOK = false; for( String member : e1.getValue() ) { @@ -689,6 +693,7 @@ public class SubDataObjectPresenceConditionValidator { // At most one of marked elements shall be present // Usage in standard NSD files (version 2007B): DataObject if( atMostOne != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AtMostOne\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int count = 0; for( String s : atMostOne ) { if( presentSDO.get( s ) != null ) { @@ -712,6 +717,7 @@ public class SubDataObjectPresenceConditionValidator { // Usage in standard NSD files (version 2007B): DataAttribute if( allOrNonePerGroup != null ) { for( Entry< Integer, HashSet< String > > e1 : allOrNonePerGroup.entrySet() ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOrNonePerGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int groupCount = 0; for( String member : e1.getValue() ) { if( presentSDO.get( member ) != null ) { @@ -735,6 +741,7 @@ public class SubDataObjectPresenceConditionValidator { // All elements of only one group n shall be present // Usage in standard NSD files (version 2007B): DataObject and SubDataAttribute if( allOnlyOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllOnlyOneGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allOnlyOneGroup.entrySet() ) { int groupCount = 0; @@ -783,6 +790,7 @@ public class SubDataObjectPresenceConditionValidator { // All elements of at least one group n shall be present // Usage in standard NSD files (version 2007B): DataAttribute if( allAtLeastOneGroup != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"AllAtLeastOneGroup\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); int groupNumber = 0; for( Entry< Integer, HashSet< String > > e1 : allAtLeastOneGroup.entrySet() ) { int groupCount = 0; @@ -811,6 +819,7 @@ public class SubDataObjectPresenceConditionValidator { // Mandatory if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"<<<<<<<<mf\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseForbidden.entrySet() ) { if( presentSDO.get( entry.getValue() ) != null ) { if( presentSDO.get( entry.getKey() ) == null ) { @@ -844,6 +853,7 @@ public class SubDataObjectPresenceConditionValidator { // Mandatory if sibling element is present, otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryIfSiblingPresentElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MO\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfSiblingPresentElseOptional.entrySet() ) { if( presentSDO.get( entry.getValue() ) != null ) { if( presentSDO.get( entry.getKey() ) == null ) { @@ -865,6 +875,7 @@ public class SubDataObjectPresenceConditionValidator { // Optional if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( optionalIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OM\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseMandatory.entrySet() ) { if( presentSDO.get( entry.getValue() ) == null ) { if( presentSDO.get( entry.getKey() ) == null ) { @@ -886,6 +897,7 @@ public class SubDataObjectPresenceConditionValidator { // Forbidden if sibling element is present, otherwise mandatory // Usage in standard NSD files (version 2007B): None if( forbiddenIfSiblingPresentElseMandatory != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"FM\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : forbiddenIfSiblingPresentElseMandatory.entrySet() ) { if( presentSDO.get( entry.getValue() ) != null ) { if( presentSDO.get( entry.getKey() ) != null ) { @@ -920,6 +932,7 @@ public class SubDataObjectPresenceConditionValidator { // If satisfied, the element is mandatory, otherwise optional // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseOptional.entrySet() ) { String doc = cdc .getSubDataObject() @@ -950,6 +963,7 @@ public class SubDataObjectPresenceConditionValidator { // If satisfied, the element is mandatory, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( mandatoryIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : mandatoryIfTextConditionElseForbidden.entrySet() ) { String doc = cdc .getSubDataObject() @@ -980,6 +994,7 @@ public class SubDataObjectPresenceConditionValidator { // If satisfied, the element is optional, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject if( optionalIfTextConditionElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OFcond\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfTextConditionElseForbidden.entrySet() ) { String doc = cdc .getSubDataObject() @@ -1059,6 +1074,7 @@ public class SubDataObjectPresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise optional // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseOptional != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MOln0\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); EList< AbstractDataObject > adoList = doType.getReferredByAbstractDataObject(); for( AbstractDataObject ado : adoList ) { if( ado instanceof DO ) { @@ -1088,6 +1104,7 @@ public class SubDataObjectPresenceConditionValidator { // Element is mandatory in the context of LLN0; otherwise forbidden // Usage in standard NSD files (version 2007B): DataAttribute if( mandatoryInLLN0ElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"MFln0\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); EList< AbstractDataObject > adoList = doType.getReferredByAbstractDataObject(); for( AbstractDataObject ado : adoList ) { if( ado instanceof DO ) { @@ -1346,6 +1363,7 @@ public class SubDataObjectPresenceConditionValidator { // Optional if sibling element is present, otherwise forbidden // Usage in standard NSD files (version 2007B): DataObject and DataAttribute if( optionalIfSiblingPresentElseForbidden != null ) { + AbstractRiseClipseConsole.getConsole().verbose( "[NSD validation] validation of presence condition \"OF\" on DOType id=" + doType.getId() + " ) at line " + doType.getLineNumber() ); for( Entry< String, String > entry : optionalIfSiblingPresentElseForbidden.entrySet() ) { if( presentSDO.get( entry.getValue() ) == null ) { if( presentSDO.get( entry.getKey() ) != null ) { -- GitLab