Skip to content

Commit

Permalink
Remove DefaultValue
Browse files Browse the repository at this point in the history
  • Loading branch information
Archie-Miller committed Jan 24, 2025
1 parent f1a1318 commit 323e49b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions NodeSetToAML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str
case BuiltInType.UInteger:
case BuiltInType.Enumeration:
{
a.DefaultAttributeValue = a.AttributeValue = val;
a.AttributeValue = val;
break;
}

Expand All @@ -851,13 +851,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str
if ( bytes != null )
{
string encoded = Convert.ToBase64String( bytes, 0, bytes.Length );
a.DefaultAttributeValue = a.AttributeValue = new Variant( encoded.ToString() );
//StringBuilder stringBuilder = new StringBuilder();
//for( int index = 0; index < bytes.Length; index++ )
//{
// stringBuilder.Append( (char)bytes[ index ] );
//}
//a.DefaultAttributeValue = a.AttributeValue = new Variant( stringBuilder.ToString() );
a.AttributeValue = new Variant( encoded.ToString() );
}

break;
Expand All @@ -880,7 +874,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str

if ( nodeId != null )
{
a.DefaultAttributeValue = a.AttributeValue = nodeId;
a.AttributeValue = nodeId;
AttributeType rootNodeId = a.Attribute[ "RootNodeId" ];
if ( rootNodeId != null )
{
Expand Down Expand Up @@ -955,14 +949,14 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str
case BuiltInType.StatusCode:
{
StatusCode statusCode = (StatusCode)val.Value;
a.DefaultAttributeValue = a.AttributeValue = statusCode.Code;
a.AttributeValue = statusCode.Code;

break;
}

case BuiltInType.QualifiedName:
{
a.DefaultAttributeValue = a.AttributeValue = val;
a.AttributeValue = val;

QualifiedName qualifiedName = val.Value as QualifiedName;
if( qualifiedName != null )
Expand All @@ -983,7 +977,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str
Opc.Ua.LocalizedText localizedText = (Opc.Ua.LocalizedText)val.Value;
if( localizedText != null && localizedText.Text != null )
{
a.DefaultAttributeValue = a.AttributeValue = localizedText.Text;
a.AttributeValue = localizedText.Text;
if ( !string.IsNullOrEmpty( localizedText.Locale ) )
{
AddModifyAttribute(a.Attribute, localizedText.Locale,
Expand Down

0 comments on commit 323e49b

Please sign in to comment.