Skip to content

Commit

Permalink
Definition is enumeration if at least a field is not default value -1…
Browse files Browse the repository at this point in the history
…, since there is a very small probability for an enumeration to contain one field only (#1579)
  • Loading branch information
mrsuciu committed Nov 8, 2021
1 parent ea3444b commit 372449b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Stack/Opc.Ua.Core/Schema/UANodeSetHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -996,11 +996,11 @@ private Opc.Ua.DataTypeDefinition Import(UADataType dataType, Opc.Ua.Export.Data
if (source.Field != null)
{
// check if definition is for enumeration or structure.
bool isStructure = Array.Exists<DataTypeField>(source.Field, delegate (DataTypeField fieldLookup) {
return fieldLookup.Value == -1;
bool isEnumeration = Array.Exists<DataTypeField>(source.Field, delegate (DataTypeField fieldLookup) {
return fieldLookup.Value != -1;
});

if (isStructure)
if (!isEnumeration)
{
StructureDefinition sd = new StructureDefinition();
sd.BaseDataType = ImportNodeId(source.BaseType, namespaceUris, true);
Expand Down

0 comments on commit 372449b

Please sign in to comment.