Skip to content

Commit

Permalink
Merge pull request #50 from riseclipse/49-remove-the-warnings-of-type…
Browse files Browse the repository at this point in the history
…-sclexplicitlinks

Warnings about explicit links commented out
  • Loading branch information
marcadetd authored Jul 10, 2024
2 parents e7cb804 + 6d426f5 commit 1b1d272
Show file tree
Hide file tree
Showing 22 changed files with 365 additions and 365 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1549,18 +1549,18 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
if( !( "Enum".equals( getBType() ) || "Struct".equals( getBType() ) ) ) {
return;
}
String messagePrefix = "while resolving link from AbstractDataAttribute: ";
// String messagePrefix = "while resolving link from AbstractDataAttribute: ";

if( ( getType() == null ) || getType().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "type is missing" );
// 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, getFilename(), getLineNumber(),
messagePrefix, "DataTypeTemplates is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
return;
}

Expand All @@ -1575,9 +1575,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" EnumType( id = ", getType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " EnumType( id = ", getType(), " )" );
return;
}
setRefersToEnumType( res.get( 0 ) );
Expand All @@ -1596,9 +1596,9 @@ else if( "Struct".equals( getBType() ) ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" DAType( id = ", getType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " DAType( id = ", getType(), " )" );
return;
}
setRefersToDAType( res.get( 0 ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1511,17 +1511,17 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// lnClass The LN class according to IEC 61850-7-x
// inst The LN instance number identifying this LN – an unsigned integer

String messagePrefix = "while resolving link from AnyLN on line: ";
// String messagePrefix = "while resolving link from AnyLN on line: ";

if( ( getLnType() == null ) || getLnType().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnType is missing" );
// 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, getFilename(), getLineNumber(),
messagePrefix, "DataTypeTemplates is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "DataTypeTemplates is missing" );
return;
}

Expand All @@ -1532,9 +1532,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
.collect( Collectors.toList() );

if( res.size() != 1 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
" LNodeType( id = ", getLnType(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( res.size() == 0 ) ? "cannot find" : "found several" ),
// " LNodeType( id = ", getLnType(), " )" );
return;
}
setRefersToLNodeType( res.get( 0 ) );
Expand All @@ -1543,9 +1543,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
" ) on line ", getRefersToLNodeType().getLineNumber() );

if( ( getLnClass() != null ) && !getLnClass().equals( getRefersToLNodeType().getLnClass() ) ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass in LNodeType( id = ", getLnType(), " ) is ",
getRefersToLNodeType().getLnClass(), " and not ", getLnClass() );
// 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 @@ -1317,28 +1317,28 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from Association: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "iedName is missing " );
return;
}
if( ( getLdInst() == null ) || getLdInst().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "ldInst is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "ldInst is missing " );
return;
}
if( ( getLnClass() == null ) || getLnClass().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass is missing " );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass is missing " );
return;
}

// find an IED with
// IED.name == Association.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
" IED( name = ", getIedName(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
// " IED( name = ", getIedName(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1349,9 +1349,9 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
// LDevice.name == Association.ldInst
Pair< LDevice, Integer > lDevice = SclUtilities.getLDevice( ied.getLeft(), getLdInst() );
if( lDevice.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
" LDevice( inst = ", getLdInst(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
// " LDevice( inst = ", getLdInst(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1369,8 +1369,8 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
}
mess += " )";
if( anyLN.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
return;
}
setRefersToAnyLN( anyLN.getLeft() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1167,28 +1167,28 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from ClientLN: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "iedName is missing" );
return;
}
if( ( getLdInst() == null ) || getLdInst().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "ldInst is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "ldInst is missing" );
return;
}
if( ( getLnClass() == null ) || getLnClass().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "lnClass is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "lnClass is missing" );
return;
}

// find an IED with
// IED.name == ClientLN.iedName
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find " : "found several " ),
"IED( name = ", getIedName(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find " : "found several " ),
// "IED( name = ", getIedName(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1197,24 +1197,24 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
Pair< AccessPoint, Integer > ap = null;
if( ( getApRef() == null ) || getApRef().isEmpty() ) {
if( ied.getLeft().getAccessPoint().size() == 0 ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "no AccessPoint found in ied ( name = ", ied.getLeft().getName(), " )" );
// 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, getFilename(), getLineNumber(),
messagePrefix, "found several AccessPoint in ied ( name = ", ied.getLeft().getName(),
" ) but apRef not specified" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "found several AccessPoint in ied ( name = ", ied.getLeft().getName(),
// " ) but apRef not specified" );
return;
}
ap = Pair.of( ied.getLeft().getAccessPoint().get( 0 ), 1 );
}
else {
ap = SclUtilities.getAccessPoint( ied.getLeft(), getApRef() );
if( ap.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
" AccessPoint( name = ", getApRef(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
// " AccessPoint( name = ", getApRef(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1231,9 +1231,9 @@ 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, getFilename(), getLineNumber(),
messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
" LDevice( inst = ", getLdInst(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( lDevice.getRight() == 0 ) ? "cannot find" : "found several" ),
// " LDevice( inst = ", getLdInst(), " )" );
return;
}
console.debug( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
Expand All @@ -1249,8 +1249,8 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
}
mess += " )";
if( anyLN.getLeft() == null ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( anyLN.getRight() == 0 ) ? "cannot find" : "found several" ), mess );
return;
}
setRefersToAnyLN( anyLN.getLeft() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1088,13 +1088,13 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
String messagePrefix = "while resolving link from ConnectedAP: ";

if( ( getIedName() == null ) || getIedName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "iedName is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "iedName is missing" );
return;
}
if( ( getApName() == null ) || getApName().isEmpty() ) {
console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, "apName is missing" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, "apName is missing" );
return;
}

Expand All @@ -1103,19 +1103,19 @@ protected void doBuildExplicitLinks( @NonNull IRiseClipseConsole console ) {
Pair< IED, Integer > ied = SclUtilities.getIED( SclUtilities.getSCL( this ), getIedName() );
if( ied.getLeft() == null ) {

console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
" IED( name = ", getIedName(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ied.getRight() == 0 ) ? "cannot find" : "found several" ),
// " IED( name = ", getIedName(), " )" );
return;
}
console.debug( 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, getFilename(), getLineNumber(),
messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
" AccessPoint( name = ", getApName(), " )" );
// console.warning( EXPLICIT_LINK_CATEGORY, getFilename(), getLineNumber(),
// messagePrefix, ( ( ap.getRight() == 0 ) ? "cannot find" : "found several" ),
// " AccessPoint( name = ", getApName(), " )" );
return;
}
setRefersToAccessPoint( ap.getLeft() );
Expand Down
Loading

0 comments on commit 1b1d272

Please sign in to comment.