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
// lnNs shall be available only if the logical node name space deviates from the name space referenced in the attribute ldNs of the LLN0
StringlnNs=null;
Optional<DOType>doType=
lNodeType
.getDO()
.stream()
.filter(d->"NamPlt".equals(d.getName()))
.findAny()
.map(d->d.getRefersToDOType());
if(doType.isPresent()){
Optional<DA>da1=
doType
.get()
.getDA()
.stream()
.filter(d->"lnNs".equals(d.getName()))
.findAny();
if(da1.isPresent()){
if(da1.get().getVal().size()==1){
lnNs=da1.get().getVal().get(0).getValue();
}
elseif(da1.get().getVal().size()>1){
diagnostics.add(newBasicDiagnostic(
Diagnostic.WARNING,
RiseClipseValidatorSCL.DIAGNOSTIC_SOURCE,
0,
"[NSD validation] PresenceCondition \"MONamPlt\" for DO for LNodeType (line "+lNodeType.getLineNumber()+"): multiple values for lnNs",
newObject[]{lNodeType}));
}
for(AnyLNln:lNodeType.getReferredByAnyLN()){
StringlnNs=ln.getNamespace();
if((lnNs==null)||lnNs.isEmpty()){
continue;
}
// The attribute ldNs shall be a DataAttribute of the name plate NamPlt of the LOGICAL- NODE-ZERO (LLN0).