Exemple #1
0
        public static OPCDAViewHelper GetInstance()
        {
            if (instance == null)
            {
                instance            = new OPCDAViewHelper();
                opcdaNode.Tag       = Type();
                opcdaNode.ForeColor = System.Drawing.Color.Black;
            }

            return(instance);
        }
Exemple #2
0
 public static void StartMonitor()
 {
     if (DgiotHelper.StrTobool(ConfigHelper.GetConfig("OPCDACheck")))
     {
         interval = int.Parse(ConfigHelper.GetConfig("OPCDAInterval")) * 1000;
         int count = int.Parse(ConfigHelper.GetConfig("OPCDACount"));
         OpcDa.StartGroup(OPCDAViewHelper.GetRootNode(), interval, count);
     }
     else
     {
         OpcDa.StopGroup();
     }
 }
Exemple #3
0
 public static void NodeMouseDoubleClick(MouseButtons buttons, TreeNode node)
 {
     if (buttons == MouseButtons.Right && node.Checked) // 单击鼠标右键写
     {
         LogHelper.Log("Right node " + node.Text + " tag " + node.Tag + " Level " + node.Level.ToString());
         if (node.Tag.ToString() == NodeTypeValue[(int)NodeType.OPCDA])
         {
             OPCDAViewHelper.AddItems(node);
         }
     }
     else if (buttons == MouseButtons.Left && node.Checked) // 双击鼠标左键读
     {
         LogHelper.Log("Left node " + node.Text + " ToolTipText " + node.ToolTipText + " Level " + node.Level.ToString());
         OPCDAHelper.GetTreeNodes(node.Text);
     }
 }
Exemple #4
0
        public static void GetTreeNodes(string service)
        {
            OpcDaService server = OpcDa.GetOpcDaService(host, service);

            OPCDAViewHelper.GetTreeNodes(server);
        }
Exemple #5
0
 public static void Start()
 {
     Config();
     OPCDAViewHelper.View();
     View();
 }
Exemple #6
0
 public static void TreeView_AfterSelect(TreeViewAction action, TreeNode node)
 {
     // 通过鼠标或者键盘触发事件,防止修改节点的Checked状态时候再次进入
     if ((action == TreeViewAction.ByMouse || action == TreeViewAction.ByKeyboard) && node.Checked)
     {
         LogHelper.Log("select node " + node.Text + " tag " + node.Tag + " key " + OPCDAViewHelper.Key(node.FullPath.ToString()));
     }
 }