Ejemplo n.º 1
0
        //private void MesStopstatMonitor()
        //{
        //    try
        //    {
        //        string reStr = "";
        //        foreach(CtlNodeBaseModel node in nodeList)
        //        {
        //            if(node.MesIDS == null || node.MesIDS.Count()<1)
        //            {
        //                continue;
        //            }
        //            foreach(string mesID in node.MesIDS)
        //            {
        //                if(node.MesStopstat) // 如果是停机状态不用查询
        //                {
        //                    continue;
        //                }
        //                //查询MES停机状态
        //                string jsonStr="";
        //                RootObject rObj = WShelper.DevStopstatQuery(mesID,ref jsonStr);
        //                if(rObj.RES.Contains("NG"))
        //                {
        //                    node.LogRecorder.AddDebugLog(node.NodeName,string.Format("查询{0}停机失败,返回{1},发送json:{2}", mesID, rObj.RES,jsonStr));
        //                    continue;
        //                }
        //                if(rObj.CONTROL_TYPE.ToUpper()=="STOP")
        //                {
        //                    node.LogRecorder.AddDebugLog(node.NodeName, string.Format("查询{0}停机状态,结果:停机,返回结果;{1}", mesID,rObj.CONTROL_TYPE));
        //                    node.MesStopstat = true;
        //                }
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Console.WriteLine(ex.ToString());
        //    }
        //}
        private bool ParsePLines(XElement lineRoot, ref string reStr)
        {
            lineList = new List <CtlLineBaseModel>();
            IEnumerable <XElement> lineXEList = lineRoot.Elements("Line");

            foreach (XElement el in lineXEList)
            {
                CtlLineBaseModel line = new CtlLineBaseModel();
                if (!line.ParseCfg(el, ref reStr))
                {
                    return(false);
                }
                foreach (CtlNodeBaseModel node in line.NodeList)
                {
                    node.PlcRWStop = plcRWs[node.LineID - 1];
                }
                lineList.Add(line);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public void InitLineMonitor(int lineSeq, CtlLineBaseModel line)
        {
            //this.flowLayoutPanel1.Controls.Clear();

            Size boxSize = new Size(0, 0);

            View.UserControlLine userControlLine = null;
            if (lineSeq == 1)
            {
                userControlLine = this.userControlLine1;
            }
            else if (lineSeq == 2)
            {
                userControlLine = this.userControlLine2;
            }
            else
            {
                userControlLine = this.userControlLine3;
            }
            userControlLine.LineName = line.LineName;
            int nodeCount = line.NodeList.Count();

            for (int i = 0; i < nodeCount; i++)
            {
                CtlNodeBaseModel   node        = line.NodeList[i];
                UserControlCtlNode monitorNode = new UserControlCtlNode();
                monitorNode.Title = node.NodeName;
                userControlLine.Add(monitorNode);
                userCtlNodes[node.NodeName] = monitorNode;
                monitorNode.TimerInfo       = "40";
                monitorNode.RefreshDisp();
                nodeStatusList.Add(new CtlNodeStatus(node.NodeName)
                {
                    ProductBarcode = node.CurrentStat.ProductBarcode
                });
            }
            userControlLine.ReLayout();
        }