Skip to content

Commit

Permalink
Merge pull request #207 from mpostol/UANodeSetValidation5.1.0
Browse files Browse the repository at this point in the history
Remove dependency on CodeProtect #200
  • Loading branch information
mpostol authored Feb 4, 2021
2 parents 287ae5d + 6f113e0 commit b802108
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ModelDesigner.ImportExport/ImportOPCDAAddressSpace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
// To be in touch join the community at GITTER: https://gitter.im/mpostol/OPC-UA-OOI
//___________________________________________________________________________________

using CAS.Lib.OPC.AddressSpace;
using CAS.UA.Model.Designer.ImportExport.Properties;
using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using System.Xml;
using CASLibOPCAddressSpace = CAS.Lib.OPC.AddressSpace;
using OpcUaModelCompiler = UAOOI.SemanticData.UAModelDesignExport.XML;

namespace CAS.UA.Model.Designer.ImportExport
Expand Down Expand Up @@ -43,7 +43,7 @@ public static void CreateImportMenuItems(ToolStripItemCollection items, EventHan
/// <returns></returns>
public static OpcUaModelCompiler.NodeDesign[] OnImportMenuItemClick(string targetNamespace)
{
using (DictionaryManagement dic = new DictionaryManagement())
using (CASLibOPCAddressSpace.DictionaryManagement dic = new CASLibOPCAddressSpace.DictionaryManagement())
{
if (!dic.Open())
return null;
Expand Down Expand Up @@ -109,8 +109,7 @@ private static OpcUaModelCompiler.ObjectDesign CreateFolder(XmlQualifiedName nam
};
}

private static void ImportServer
(AddressSpaceDataBase.ServersTableRow svr, string targetNamespace, UniqueName uniqueName, List<OpcUaModelCompiler.NodeDesign> nodes)
private static void ImportServer(CASLibOPCAddressSpace.AddressSpaceDataBase.ServersTableRow svr, string targetNamespace, UniqueName uniqueName, List<OpcUaModelCompiler.NodeDesign> nodes)
{
string name = NewName;
XmlQualifiedName sftName = new XmlQualifiedName(NewName, targetNamespace);
Expand All @@ -124,14 +123,14 @@ private static void ImportServer
};
nodes.Add(sft);
List<OpcUaModelCompiler.InstanceDesign> cldrn = new List<OpcUaModelCompiler.InstanceDesign>();
foreach (AddressSpaceDataBase.TagsTableRow item in svr.GetTagsTableRows())
foreach (CASLibOPCAddressSpace.AddressSpaceDataBase.TagsTableRow item in svr.GetTagsTableRows())
ImportTag(item, targetNamespace, uniqueName, sft.SymbolicName, nodes, cldrn);
sft.Children = new OpcUaModelCompiler.ListOfChildren() { Items = cldrn.ToArray() };
}

private static void ImportTag
(
AddressSpaceDataBase.TagsTableRow parentItem,
CASLibOPCAddressSpace.AddressSpaceDataBase.TagsTableRow parentItem,
string targetNamespace,
UniqueName uniqueName,
XmlQualifiedName parentObject,
Expand Down Expand Up @@ -170,7 +169,7 @@ private static void ImportTag
OpcUaModelCompiler.ObjectDesign sf = CreateFolder(new XmlQualifiedName(uniqueName.GetUniqueName(pbe.Name), targetNamespace), pbe.ItemName, pbe.Name);
nodes.Add(sf);
List<OpcUaModelCompiler.InstanceDesign> myChildren = new List<OpcUaModelCompiler.InstanceDesign>();
foreach (AddressSpaceDataBase.TagsTableRow item in parentItem.GetTagsTableRows())
foreach (CASLibOPCAddressSpace.AddressSpaceDataBase.TagsTableRow item in parentItem.GetTagsTableRows())
ImportTag(item, targetNamespace, uniqueName, sf.SymbolicName, nodes, myChildren);
sf.Children = new OpcUaModelCompiler.ListOfChildren() { Items = myChildren.ToArray() };
sf.References = new OpcUaModelCompiler.Reference[]
Expand Down

0 comments on commit b802108

Please sign in to comment.