Auto: abcip-2.3 — descriptions to OPC UA Description
Threads tag/UDT-member descriptions captured by the L5K (#346) and L5X (#347) parsers through AbCipTagDefinition + AbCipStructureMember into DriverAttributeInfo, so the address-space builder sets the OPC UA Description attribute on each Variable node. L5kMember and L5xParser also now capture per-member descriptions (via the (Description := "...") attribute block on L5K and the <Description> child on L5X), and L5kIngest forwards them. DriverNodeManager surfaces DriverAttributeInfo.Description as the Variable's Description property. Description is added as a trailing optional parameter on DriverAttributeInfo (default null) so every other driver continues to construct the record unchanged. Closes #231
This commit is contained in:
@@ -163,11 +163,21 @@ public static class L5xParser
|
||||
arrayDim = dim;
|
||||
}
|
||||
|
||||
// Description child — same shape as on Tag nodes; sometimes wrapped in CDATA.
|
||||
string? description = null;
|
||||
var descNode = memberNode.SelectSingleNode("Description");
|
||||
if (descNode is not null)
|
||||
{
|
||||
var raw = descNode.Value;
|
||||
if (!string.IsNullOrEmpty(raw)) description = raw.Trim();
|
||||
}
|
||||
|
||||
return new L5kMember(
|
||||
Name: name,
|
||||
DataType: dataType,
|
||||
ArrayDim: arrayDim,
|
||||
ExternalAccess: string.IsNullOrEmpty(externalAccess) ? null : externalAccess);
|
||||
ExternalAccess: string.IsNullOrEmpty(externalAccess) ? null : externalAccess,
|
||||
Description: description);
|
||||
}
|
||||
|
||||
private static L5kDataType? ReadAddOnInstruction(XPathNavigator aoiNode)
|
||||
@@ -200,11 +210,20 @@ public static class L5xParser
|
||||
arrayDim = dim;
|
||||
}
|
||||
|
||||
string? paramDescription = null;
|
||||
var paramDescNode = paramNode.SelectSingleNode("Description");
|
||||
if (paramDescNode is not null)
|
||||
{
|
||||
var raw = paramDescNode.Value;
|
||||
if (!string.IsNullOrEmpty(raw)) paramDescription = raw.Trim();
|
||||
}
|
||||
|
||||
members.Add(new L5kMember(
|
||||
Name: paramName,
|
||||
DataType: dataType,
|
||||
ArrayDim: arrayDim,
|
||||
ExternalAccess: string.IsNullOrEmpty(externalAccess) ? null : externalAccess));
|
||||
ExternalAccess: string.IsNullOrEmpty(externalAccess) ? null : externalAccess,
|
||||
Description: paramDescription));
|
||||
}
|
||||
return new L5kDataType(name, members);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user