Exemplo n.º 1
0
        public void executeAction(TreeNode treeNode)
        {
            if (treeNode is StepCompositeNode || treeNode is TreeNode)
            {
                foreach (TreeNode childNodes in treeNode.Nodes)
                {
                    executeAction(childNodes);
                }
            }

            if (treeNode is StepLeafNode)
            {
                StepLeafNode stepLeafNode = treeNode as StepLeafNode;

                DataSets.dsModuleStructure3.dtStepLeafRow      stepLeaf        = stepLeafNode.getStepLeaf();
                DataSets.dsModuleStructure3.dtActionValueRow[] actionValueRows = stepLeaf.GetdtActionValueRows();

                //DataSets.dsModuleStructure3.dtActionValueDataTable table = stepLeafNode.getActionValueDataTable();

                foreach (DataSets.dsModuleStructure3.dtActionValueRow actionValueRow in actionValueRows)
                {
                    mainProtocol.executeAction(actionValueRow);
                    while (serial.isBusy == true || PCANCom.Instance.isBusy == true)
                    {
                        ;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void tlvProtocol_DragDrop(object sender, DragEventArgs e)
        {
            // Retrieve the client coordinates of the drop location.
            Point targetPoint = tlvProtocol.PointToClient(new Point(e.X, e.Y));

            // Retrieve the node at the drop location.
            TreeNode          targetNode            = tlvProtocol.GetNodeAt(targetPoint);
            TreeNode          dropNode              = new TreeNode();
            StepCompositeNode treeNodeStepComposite = (StepCompositeNode)e.Data.GetData(typeof(StepCompositeNode));
            StepLeafNode      treeNodeStepLeaf      = (StepLeafNode)e.Data.GetData(typeof(StepLeafNode));

            if (treeNodeStepComposite != null)
            {
                addNodes(treeNodeStepComposite.getStepCompositeRow(), targetNode);
            }
            else if (treeNodeStepLeaf != null)
            {
                targetNode.Nodes.Add(new StepLeafNode(treeNodeStepLeaf.getStepLeaf(), dsModuleStructure.dtActionValue));
            }
        }