示例#1
0
        public void RefreshNodeStatus()
        {
            List <CtlNodeStatus> ns = this.lineMonitorPresenter.GetNodeStatus();

            for (int i = 0; i < Math.Min(ns.Count(), this.nodeStatusList.Count()); i++)
            {
                CtlNodeStatus nodeStatus = this.nodeStatusList[i];
                ns[i].Copy(ref nodeStatus);
                UserControlCtlNode monitorNode = userCtlNodes[nodeStatus.NodeName];
                monitorNode.BkgColor   = nodeColorMap[nodeStatus.Status];
                monitorNode.DispDetail = nodeStatus.StatDescribe;
                monitorNode.RefreshDisp();
                //monitorNode.DispPopupInfo = "主机条码:"+nodeStatus.ProductBarcode;
            }
        }
示例#2
0
        //public void InitNodeMonitorview()
        //{

        //    nodeStatusList = new List<CtlNodeStatus>();
        //    userCtlNodes = new Dictionary<string, UserControlCtlNode>();
        //    userCtlNodesAsrsA = new Dictionary<string,UserControlCtlNode>();
        //    this.flowPanel1.Controls.Clear();
        //    string[] nodeIDS = new string[] { "1001", "2001", "2003", "2002"};
        //    Size boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel1.Width / (nodeIDS.Count() + 1);
        //    boxSize.Height = (int)(this.flowPanel1.Height);
        //    for(int i=0;i<nodeIDS.Count();i++)
        //    {
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeIDS[i]);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = CtlNode.NodeName;
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesAsrsA[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel1.Controls.Add(monitorNode);
        //       // nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }

        //    userCtlNodesAsrsB = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel2.Controls.Clear();
        //    nodeIDS = new string[] { "1002", "2011", "2012", "2013"};
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel2.Width / (nodeIDS.Count() + 1);
        //    boxSize.Height = (int)(this.flowPanel2.Height);
        //    for (int i = 0; i < nodeIDS.Count(); i++)
        //    {
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeIDS[i]);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = CtlNode.NodeName;
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesAsrsB[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel2.Controls.Add(monitorNode);
        //       // nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }
        //    userCtlNodesWelding = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel3.Controls.Clear();
        //    nodeIDS = new string[] { "4001", "4002", "4003", "4004","4005","4006","4007","4008" };
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel3.Width*2 / (nodeIDS.Count());
        //    boxSize.Height = (int)(this.flowPanel2.Height/2.0f);
        //    for (int i = 0; i < nodeIDS.Count(); i++)
        //    {
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeIDS[i]);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = "#"+(i+1).ToString();
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesWelding[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel3.Controls.Add(monitorNode);
        //     //   nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }
        //    userCtlNodesPack = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel4.Controls.Clear();
        //    nodeIDS = new string[] { "5001", "5002"};
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel4.Width / (nodeIDS.Count())-20;
        //    boxSize.Height = (int)(this.flowPanel4.Height);
        //    for (int i = 0; i < nodeIDS.Count(); i++)
        //    {
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeIDS[i]);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = CtlNode.NodeName;
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesPack[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel4.Controls.Add(monitorNode);
        //       // nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }
        //    userCtlNodesAsmTop = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel5.Controls.Clear();
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel5.Width/ 16-4;
        //    boxSize.Height = (int)(this.flowPanel5.Height*2);
        //    for (int i = 0; i < 32;i++ )
        //    {
        //        string nodeID = (6001 + i).ToString();
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeID);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Margin = new Padding(1,1,1,1);

        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = (i+1).ToString();
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesAsmTop[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel5.Controls.Add(monitorNode);
        //        //nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }

        //    userCtlNodesAsmBottom = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel6.Controls.Clear();
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel6.Width/12-2;
        //    boxSize.Height = (int)(this.flowPanel6.Height * 2);
        //    for (int i = 0; i < 24; i++)
        //    {
        //        string nodeID = (7001 + i).ToString();
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeID);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Margin = new Padding(1);
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = (i + 1).ToString();
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesAsmBottom[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel6.Controls.Add(monitorNode);
        //        //nodeStatusList.Add(new CtlNodeStatus(CtlNode.NodeName) { ProductBarcode = CtlNode.CurrentStat.ProductBarcode });
        //    }
        //    userCtlNodesBinding = new Dictionary<string, UserControlCtlNode>();
        //    this.flowPanel7.Controls.Clear();
        //    boxSize = new Size(0, 0);
        //    boxSize.Width = this.flowPanel7.Width-2;
        //    boxSize.Height = (int)(this.flowPanel7.Height-2);
        //    {
        //        string nodeID = "8001";
        //        CtlNodeBaseModel CtlNode = presenter.GetNodeByID(nodeID);
        //        UserControlCtlNode monitorNode = new UserControlCtlNode();
        //        monitorNode.Margin = new Padding(1);
        //        monitorNode.Size = boxSize;
        //        //监控控件属性赋值
        //        monitorNode.Title = CtlNode.NodeName;
        //        monitorNode.TimerInfo = "40";

        //        monitorNode.RefreshDisp();
        //        userCtlNodesBinding[CtlNode.NodeName] = monitorNode;
        //        userCtlNodes[CtlNode.NodeName] = monitorNode;
        //        this.flowPanel7.Controls.Add(monitorNode);
        //    }
        //    nodeColorMap = new Dictionary<EnumNodeStatus, Color>();
        //    nodeColorMap[EnumNodeStatus.设备故障] = Color.Red;
        //    nodeColorMap[EnumNodeStatus.设备空闲] = Color.Green;
        //    nodeColorMap[EnumNodeStatus.设备使用中] = Color.Yellow;

        //    nodeColorMap[EnumNodeStatus.无法识别] = Color.PaleVioletRed;
        //    this.pictureBox1.BackColor = nodeColorMap[EnumNodeStatus.设备故障];
        //    this.pictureBox2.BackColor = nodeColorMap[EnumNodeStatus.设备空闲];
        //    this.pictureBox3.BackColor = nodeColorMap[EnumNodeStatus.设备使用中];

        //    this.pictureBox5.BackColor = nodeColorMap[EnumNodeStatus.无法识别];
        //}
        public void RefreshNodeStatus()
        {
            List <CtlNodeStatus> ns = this.presenter.GetNodeStatus();

            for (int i = 0; i < ns.Count(); i++)
            {
                if (!userCtlNodes.Keys.Contains(ns[i].NodeName))
                {
                    continue;
                }
                CtlNodeStatus nodeStatus = ns[i];

                //ns[i].Copy(ref nodeStatus);
                UserControlCtlNode monitorNode = userCtlNodes[nodeStatus.NodeName];
                monitorNode.BkgColor   = nodeColorMap[nodeStatus.Status];
                monitorNode.DispDetail = nodeStatus.StatDescribe;
                monitorNode.RefreshDisp();
                monitorNode.DispPopupInfo = "主机条码:" + nodeStatus.ProductBarcode;
            }
        }
示例#3
0
        public void RefreshNodeStatus()
        {
            List <CtlNodeStatus> ns = this.lineMonitorPresenter.GetNodeStatus();

            for (int i = 0; i < ns.Count(); i++)
            {
                CtlNodeStatus nodeStatus = this.nodeStatusList[i];
                ns[i].Copy(ref nodeStatus);
                UserControlCtlNode monitorNode = userCtlNodes[nodeStatus.NodeName];
                monitorNode.BkgColor   = nodeColorMap[nodeStatus.Status];
                monitorNode.DispDetail = nodeStatus.StatDescribe;
                monitorNode.RefreshDisp();
                monitorNode.DispPopupInfo = "主机条码:" + nodeStatus.ProductBarcode;
            }
            this.label19.Text = string.Format("待贴标队列:{0}", lineMonitorPresenter.GetPrintListLen());
            this.label12.Text = "当前正在检测的设备数量:" + lineMonitorPresenter.GetRunningDetectdevs().ToString();

            //投产信息
            string barcode = this.nodeStatusList[0].ProductBarcode;

            if (string.IsNullOrWhiteSpace(barcode))
            {
                this.label3.Text = "";
                this.label4.Text = "";
                return;
            }
            this.label3.Text = barcode.ToUpper();
            int L = barcode.IndexOf("L");

            if (L < 0 || L > barcode.Count())
            {
                L = barcode.Count();
            }
            string productCata = barcode.Substring(0, L);

            this.label4.Text = string.Format("{0},{1}", productCata, this.lineMonitorPresenter.GetProductCfgInfo(productCata));
        }