예제 #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();
       }
 }