示例#1
0
文件: Node.cs 项目: peace2048/h-opc
 /// <summary>
 /// Creates a new node
 /// </summary>
 /// <param name="name">the name of the node</param>
 /// <param name="parent">The parent node</param>
 protected Node(string name, Node parent = null)
 {
     Name = name;
       Parent = parent;
       if (parent != null && !string.IsNullOrEmpty(parent.Tag))
     Tag = parent.Tag + '.' + name;
       else
     Tag = name;
 }
示例#2
0
文件: Node.cs 项目: pilhokim/h-opc
 /// <summary>
 /// Creates a new node
 /// </summary>
 /// <param name="client">the client the node belongs to</param>
 /// <param name="name">the name of the node</param>
 /// <param name="parent">The parent node</param>
 protected Node(IClient<Node> client, string name, Node parent = null)
 {
     Client = client;
       Name = name;
       Parent = parent;
       if (parent != null && !string.IsNullOrEmpty(parent.Tag))
     Tag = parent.Tag + '.' + name;
       else
     Tag = name;
 }
示例#3
0
文件: UaNode.cs 项目: peace2048/h-opc
 /// <summary>
 /// Instantiates a UaNode class
 /// </summary>
 /// <param name="name">the name of the node</param>
 /// <param name="nodeId">The UA Id of the node</param>
 /// <param name="parent">The parent node</param>
 internal UaNode(string name, string nodeId, Node parent = null)
     : base(name, parent)
 {
     NodeId = nodeId;
 }
示例#4
0
文件: UaNode.cs 项目: pilhokim/h-opc
 /// <summary>
 /// Instantiates a UaNode class
 /// </summary>
 /// <param name="client">the client the node belongs to</param>
 /// <param name="name">the name of the node</param>
 /// <param name="nodeId">The UA Id of the node</param>
 /// <param name="parent">The parent node</param>
 internal UaNode(IClient<UaNode> client, string name, string nodeId, Node parent = null)
     : base(client, name, parent)
 {
     NodeId = nodeId;
 }
示例#5
0
文件: DaNode.cs 项目: peace2048/h-opc
 /// <summary>
 /// Instantiates a DaNode class
 /// </summary>
 /// <param name="name">the name of the node</param>
 /// <param name="tag"></param>
 /// <param name="parent">The parent node</param>
 public DaNode(string name, string tag, Node parent = null)
     : base(name, parent)
 {
     Tag = tag;
 }
示例#6
0
文件: DaNode.cs 项目: pilhokim/h-opc
 /// <summary>
 /// Instantiates a DaNode class
 /// </summary>
 /// <param name="client">the client the node belongs to</param>
 /// <param name="name">the name of the node</param>
 /// <param name="tag"></param>
 /// <param name="parent">The parent node</param>
 public DaNode(IClient<Node> client, string name, string tag, Node parent = null)
     : base(client, name, parent)
 {
     Tag = tag;
 }
示例#7
0
文件: Repl.cs 项目: yuriik83/h-opc
 private void Cd(IList<string> args)
 {
     if (!args.Any())
     throw new BadCommandException();
       _currentNode = _client.FindNode(GenerateRelativeTag(args[0]));
 }
示例#8
0
文件: Repl.cs 项目: yuriik83/h-opc
 public Repl(IClient<Node> client)
 {
     _client = client;
       _currentNode = client.RootNode;
 }
示例#9
0
文件: Repl.cs 项目: yuriik83/h-opc
 private void RunCommand(Command command)
 {
     switch (command.Cmd)
       {
     case SupportedCommands.Help:
       ShowHelp();
       break;
     case SupportedCommands.Read:
       Read(command.Args);
       break;
     case SupportedCommands.Write:
       Write(command.Args);
       break;
     case SupportedCommands.Ls:
       ShowSubnodes();
       break;
     case SupportedCommands.Root:
       _currentNode = _client.RootNode;
       break;
     case SupportedCommands.Up:
       _currentNode = _currentNode.Parent ?? _client.RootNode;
       break;
     case SupportedCommands.Monitor:
       Monitor(command.Args);
       break;
     case SupportedCommands.Cd:
       Cd(command.Args);
       break;
     default:
       throw new BadCommandException();
       }
 }