Skip to content

Commit

Permalink
set filename and use it in doExplicitLinks() messages
Browse files Browse the repository at this point in the history
  • Loading branch information
marcadetd committed Apr 15, 2022
1 parent a0dc693 commit fe38f80
Show file tree
Hide file tree
Showing 23 changed files with 255 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
console.debug( EXPLICIT_LINK_CATEGORY, getLineNumber(), "AbstractDataAttributeImpl.doBuildExplicitLinks()" );
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(), "AbstractDataAttributeImpl.doBuildExplicitLinks()" );

// see Issue #13
super.doBuildExplicitLinks( console );
Expand All @@ -1485,14 +1485,14 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from AbstractDataAttribute: ";

if( ( getType() == null ) || getType().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "type is missing" );
return;
}

DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "DataTypeTemplates is missing" );
return;
}
Expand All @@ -1508,13 +1508,13 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" EnumType( id = ", getType(), " )" );
return;
}
setRefersToEnumType( res.get( 0 ) );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AbstractDataAttribute refers to EnumType( id = ", getType(), " ) on line ",
getRefersToEnumType().getLineNumber() );
}
Expand All @@ -1529,13 +1529,13 @@ else if( "Struct".equals( getBType() ) ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" DAType( id = ", getType(), " )" );
return;
}
setRefersToDAType( res.get( 0 ) );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AbstractDataAttribute refers to EnumType( id = ", getType(), " ) on line ",
getRefersToDAType().getLineNumber() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ public boolean isSetReferredByLNode() {
*/
@Override
public LDevice getParentLDevice() {
AbstractRiseClipseConsole.getConsole().emergency( EXPLICIT_LINK_CATEGORY, getLineNumber(),
AbstractRiseClipseConsole.getConsole().emergency( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AnyLNImpl.getParentLDevice() called" );
return null;
}
Expand Down Expand Up @@ -1505,7 +1505,7 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
console.debug( EXPLICIT_LINK_CATEGORY, getLineNumber(), "AnyLNImpl.doBuildExplicitLinks()" );
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(), "AnyLNImpl.doBuildExplicitLinks()" );

// see Issue #13
super.doBuildExplicitLinks( console );
Expand All @@ -1517,13 +1517,13 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from AnyLN on line: ";

if( ( getLnType() == null ) || getLnType().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnType is missing" );
return;
}
DataTypeTemplates dtt = SclUtilities.getSCL( this ).getDataTypeTemplates();
if( dtt == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "DataTypeTemplates is missing" );
return;
}
Expand All @@ -1535,18 +1535,18 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" LNodeType( id = ", getLnType(), " )" );
return;
}
setRefersToLNodeType( res.get( 0 ) );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
"AnyLN on line ", getLineNumber(), " refers to LNodeType( id = ", getLnType(),
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"AnyLN refers to LNodeType( id = ", getLnType(),
" ) on line ", getRefersToLNodeType().getLineNumber() );

if( ( getLnClass() != null ) && !getLnClass().equals( getRefersToLNodeType().getLnClass() ) ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass in LNodeType( id = ", getLnType(), " ) is ",
getRefersToLNodeType().getLnClass(), " and not ", getLnClass() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
console.debug( EXPLICIT_LINK_CATEGORY, getLineNumber(), "AssociationImpl.doBuildExplicitLinks()" );
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(), "AssociationImpl.doBuildExplicitLinks()" );

// see Issue #13
super.doBuildExplicitLinks( console );
Expand All @@ -1260,17 +1260,17 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from Association: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing " );
return;
}
if( ( getLdInst() == null ) || getLdInst().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "ldInst is missing " );
return;
}
if( ( getLnClass() == null ) || getLnClass().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass is missing " );
return;
}
Expand All @@ -1279,25 +1279,25 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// IED.name == Association.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
" IED( name = ", getIedName(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found IED( name = ", getIedName(), " ) on line ",
ied.getLeft().getLineNumber() );

// find inside an LDevice with
// LDevice.name == Association.ldInst
Pair< LDevice, Integer > lDevice = SclUtilities.getLDevice( ied.getLeft(), getLdInst() );
if( lDevice.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
" LDevice( inst = ", getLdInst(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found ", "LDevice( inst = ", getLdInst(), " )", " on line ",
lDevice.getLeft().getLineNumber() );

Expand All @@ -1310,13 +1310,13 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
}
mess += " )";
if( anyLN.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
return;
}
setRefersToAnyLN( anyLN.getLeft() );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
"Association on line ", getLineNumber(), " refers to ", mess, " on line ",
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"Association refers to ", mess, " on line ",
getRefersToAnyLN().getLineNumber() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
console.debug( EXPLICIT_LINK_CATEGORY, getLineNumber(), "ClientLNImpl.doBuildExplicitLinks()" );
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(), "ClientLNImpl.doBuildExplicitLinks()" );

// see Issue #13
super.doBuildExplicitLinks( console );
Expand All @@ -1166,17 +1166,17 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from ClientLN: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing" );
return;
}
if( ( getLdInst() == null ) || getLdInst().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "ldInst is missing" );
return;
}
if( ( getLnClass() == null ) || getLnClass().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass is missing" );
return;
}
Expand All @@ -1185,23 +1185,23 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// IED.name == ClientLN.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find " : "found several " ),
"IED( name = ", getIedName(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found IED( name = ", getIedName(), " ) on line ", ied.getLeft().getLineNumber() );

Pair< AccessPoint, Integer > ap = null;
if( ( getApRef() == null ) || getApRef().isEmpty() ) {
if( ied.getLeft().getAccessPoint().size() == 0 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "no AccessPoint found in ied ( name = ", ied.getLeft().getName(), " )" );
return;
}
if( ied.getLeft().getAccessPoint().size() > 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found several AccessPoint in ied ( name = ", ied.getLeft().getName(),
" ) but apRef not specified" );
return;
Expand All @@ -1211,12 +1211,12 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
else {
ap = SclUtilities.getAccessPoint( ied.getLeft(), getApRef() );
if( ap.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
" AccessPoint( name = ", getApRef(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found ", "AccessPoint( name = ", getApRef(), " ) on line ",
ap.getLeft().getLineNumber() );
}
Expand All @@ -1230,12 +1230,12 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
else {
Pair< LDevice, Integer > lDevice = SclUtilities.getLDevice( ap.getLeft(), getLdInst() );
if( lDevice.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
" LDevice( inst = ", getLdInst(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found LDevice( inst = ", getLdInst(), " ) on line ",
lDevice.getLeft().getLineNumber() );

Expand All @@ -1248,13 +1248,13 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
}
mess += " )";
if( anyLN.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
return;
}
setRefersToAnyLN( anyLN.getLeft() );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
"ClientLN on line ", getLineNumber(), " refers to ", mess, " on line ",
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"ClientLN refers to ", mess, " on line ",
getRefersToAnyLN().getLineNumber() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ public String toString() {

@Override
protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
console.debug( EXPLICIT_LINK_CATEGORY, getLineNumber(), "ConnectedAPImpl.doBuildExplicitLinks()" );
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(), "ConnectedAPImpl.doBuildExplicitLinks()" );

// see Issue #13
super.doBuildExplicitLinks( console );
Expand All @@ -1032,12 +1032,12 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from ConnectedAP: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing" );
return;
}
if( ( getApName() == null ) || getApName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "apName is missing" );
return;
}
Expand All @@ -1046,23 +1046,23 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// IED.name == ConnectedAP.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
" IED( name = ", getIedName(), " )" );
return;
}
console.info( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.info( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "found IED( name = ", getIedName(), " ) on line ",
ied.getLeft().getLineNumber() );
Pair< AccessPoint, Integer > ap = SclUtilities.getAccessPoint( ied.getLeft(), getApName() );
if( ap.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
" AccessPoint( name = ", getApName(), " )" );
return;
}
setRefersToAccessPoint( ap.getLeft() );
console.notice( EXPLICIT_LINK_CATEGORY, getLineNumber(),
console.notice( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
"ConnectedAP on line refers to AccessPoint( name = ", getApName(), " ) on line ",
getRefersToAccessPoint().getLineNumber() );
}
Expand Down
Loading

0 comments on commit fe38f80

Please sign in to comment.