Пример #1
0
        public DianJiaoProcess(NodeDianjiao dianjiao, string inputPath)
        {
            this.dianjiaoDev = dianjiao;
            this.inputPath   = inputPath;

            addrDic["OPA007"]   = "D8739";
            addrDic["OPA007-1"] = "D8736";
            addrDic["OPA007-2"] = "D8737";

            addrDic["OPA008"]   = "D8734";
            addrDic["OPA008-1"] = "D8730";
            addrDic["OPA008-2"] = "D8731";
            this.stepIndex      = 1;
        }
Пример #2
0
        public virtual bool ParseCfg(XElement xe, ref string reStr)
        {
            try
            {
                this.lineName = xe.Attribute("name").Value.ToString();
                XElement devCfgRoot = xe.Element("DevCfg");
                if (devCfgRoot != null)
                {
                    IEnumerable <XElement> devXEList = devCfgRoot.Elements("Dev");
                    foreach (XElement el in devXEList)
                    {
                        CtlDevBaseModel ctlDev = new CtlDevBaseModel();
                        if (!ctlDev.ParseCfg(el, ref reStr))
                        {
                            return(false);
                        }
                        devList.Add(ctlDev);
                    }
                }
                XElement nodeCfgRoot = xe.Element("NodeCfg");
                if (nodeCfgRoot != null)
                {
                    IEnumerable <XElement> nodeXEList = nodeCfgRoot.Elements("Node");
                    foreach (XElement el in nodeXEList)
                    {
                        string           className = (string)el.Attribute("className");
                        CtlNodeBaseModel ctlNode   = null;
                        switch (className)
                        {
                        case "LineNodes.NodePalletBind":
                        {
                            ctlNode = new NodePalletBind();
                            break;
                        }

                        case "LineNodes.NodeScrewLock":
                        {
                            ctlNode = new NodeScrewLock();
                            break;
                        }

                        case "LineNodes.NodeUV":
                        {
                            ctlNode = new NodeUV();
                            break;
                        }

                        case "LineNodes.NodeDianjiao":
                        {
                            ctlNode = new NodeDianjiao();
                            break;
                        }

                        case "LineNodes.NodeSwitchBind":
                        {
                            ctlNode = new NodeSwitchBind();
                            break;
                        }

                        case "LineNodes.NodeCCDCheck":
                        {
                            ctlNode = new NodeCCDCheck();
                            break;
                        }

                        case "LineNodes.NodeLaserClean":
                        {
                            ctlNode = new NodeLaserClean();
                            break;
                        }

                        case "LineNodes.NodeWeld":
                        {
                            ctlNode = new NodeWeld();
                            break;
                        }

                        case "LineNodes.NodePackFasten":
                        {
                            ctlNode = new NodePackFasten();
                            break;
                        }

                        case "LineNodes.NodePackLabel":
                        {
                            ctlNode = new NodePackLabel();
                            break;
                        }

                        case "LineNodes.NodePackWeld":
                        {
                            ctlNode = new NodePackWeld();
                            break;
                        }

                        case "LineNodes.NodePackOutput":
                        {
                            ctlNode = new NodePackOutput();
                            break;
                        }

                        case "LineNodes.NodeUpDownMachine":
                        {
                            ctlNode = new NodeUpDownMachine();
                            break;
                        }

                        case "LineNodes.NodeTailRobot":
                        {
                            ctlNode = new NodeTailRobot();
                            break;
                        }

                        case "LineNodes.NodeManualStation":
                        {
                            ctlNode = new  NodeManualStation();
                            break;
                        }

                        case "LineNodes.BakeStation":
                        {
                            ctlNode = new BakeStation();
                            break;
                        }

                        case "LineNodes.NodeCManualStation":
                        {
                            ctlNode = new  NodeCManualStation();
                            break;
                        }

                        default:
                            break;
                        }
                        if (ctlNode != null)
                        {
                            if (this.lineName == "A线")
                            {
                                ctlNode.LineID = 1;
                            }
                            else if (this.lineName == "B线")
                            {
                                ctlNode.LineID = 2;
                            }
                            else
                            {
                                ctlNode.LineID = 3;
                            }
                            if (!ctlNode.BuildCfg(el, ref reStr))
                            {
                                return(false);
                            }
                            this.nodeList.Add(ctlNode);
                        }
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.ToString();
                return(false);
            }
        }