Skip to content

Commit

Permalink
Merge model compiler fixes with latest code.
Browse files Browse the repository at this point in the history
  • Loading branch information
randy-armstrong committed Feb 5, 2021
1 parent a2e8489 commit 1305e94
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 53 deletions.
69 changes: 69 additions & 0 deletions Stack/Opc.Ua.Core/Stack/State/ModelCompilerExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;

namespace Opc.Ua
{
public partial class NodeState
{
/// <summary>
/// The specification that defines the node.
/// </summary>
public string Specification { get; set; }

/// <summary>
/// The documentation for the node that is saved in the NodeSet.
/// </summary>
public string NodeSetDocumentation { get; set; }
}

public partial class StructureDefinition
{
/// <summary>
/// The first non-inherited field in the structure definition.
/// </summary>
public int FirstExplicitFieldIndex { get; set; }
}

public partial class NodeStateCollection
{
/// <summary>
/// Writes the collection to a stream using the Opc.Ua.Schema.UANodeSet schema.
/// </summary>
public void SaveAsNodeSet2(
ISystemContext context,
Stream ostrm,
Export.ModelTableEntry model,
DateTime lastModified,
bool outputRedundantNames)
{
Opc.Ua.Export.UANodeSet nodeSet = new Opc.Ua.Export.UANodeSet();

if (lastModified != DateTime.MinValue)
{
nodeSet.LastModified = lastModified;
nodeSet.LastModifiedSpecified = true;
}

if (model != null)
{
nodeSet.Models = new Export.ModelTableEntry[] { model };
}

for (int ii = 0; ii < s_AliasesToUse.Length; ii++)
{
nodeSet.AddAlias(context, s_AliasesToUse[ii].Alias, s_AliasesToUse[ii].NodeId);
}

for (int ii = 0; ii < this.Count; ii++)
{
nodeSet.Export(context, this[ii], outputRedundantNames);
}

nodeSet.Write(ostrm);
}
}
}
2 changes: 1 addition & 1 deletion Stack/Opc.Ua.Core/Stack/State/NodeState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Opc.Ua
/// <summary>
/// The base class for custom nodes.
/// </summary>
public abstract class NodeState : IDisposable, IFormattable
public abstract partial class NodeState : IDisposable, IFormattable
{
#region Constructors
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Stack/Opc.Ua.Core/Stack/State/NodeStateCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Opc.Ua
/// <summary>
/// Stores a collection of nodes.
/// </summary>
public class NodeStateCollection : List<NodeState>
public partial class NodeStateCollection : List<NodeState>
{
#region Constructors
/// <summary>
Expand Down

0 comments on commit 1305e94

Please sign in to comment.