Exemplo n.º 1
0
        public Nut()
        {
            CameraCheckOut inic = new CameraCheckOut();

            inic.leadToTheHole  = 1;
            inic.nextCameraName = "CCD1";
            this.checkedResult  = new List <CameraCheckOut>();
            jiance = new List <jiancejieguo>();
            this.checkedResult.Add(inic);
            posNo = 0;
        }
Exemplo n.º 2
0
        public static void CheckData(DataSet ds, string cameraName, CCamera instance)
        {
            Initial();
            int               current        = int.Parse(cameraName.Substring(3, 1));
            string            nextCameraName = "CCD" + (current + 1).ToString();
            DataRowCollection drc            = ds.Tables["detailTable"].Rows;
            int               checkresult    = (int)Holes.firstHole;
            List <int>        CheckList      = new List <int>();

            int index = 0;

            foreach (DataRow dr in drc)
            {
                if (dr[0].ToString() == cameraName)
                {
                    double xz = (double)dr[2];
                    double sx = (double)dr[3];
                    double xx = (double)dr[4];
                    double jg = (double)dr[5];

                    //良品
                    if (jg >= xx && jg <= sx)
                    {
                        checkresult = (int)Holes.secondHole;
                        instance.goodcountlist[index]++;
                    }
                    //未识别
                    else if (jg == xz)
                    {
                        checkresult = (int)Holes.thirdHole;
                    }

                    //不良品
                    else
                    {
                        checkresult = (int)Holes.firstHole;
                        instance.badcountlist[index]++;
                    }
                    CheckList.Add(checkresult);

                    index++;
                }
            }

            //不良品
            if (CheckList.Contains((int)Holes.firstHole))
            {
                checkresult = (int)Holes.firstHole;
            }
            //未识别
            else if (CheckList.Contains((int)Holes.thirdHole))
            {
                checkresult = (int)Holes.thirdHole;
            }
            //良品
            else if (CheckList.Contains((int)Holes.secondHole))
            {
                checkresult = (int)Holes.secondHole;
            }
            else
            {
                checkresult = (int)Holes.thirdHole;
            }
            if (CheckList.Count != 0)
            {
                //Card.mu.WaitOne();
                lock (Card.lockobj)
                {
                    //10.28ch改为逆向查找

                    Nut nut;
                    for (int i = 0; i < Turntable.Instance.nutqueue.Count; i++)
                    {
                        CameraCheckOut cco = new CameraCheckOut();
                        nut = Turntable.Instance.nutqueue[i];
                        int length = nut.checkedResult.Count;
                        //  Console.WriteLine("" + nut.checkedResult[length - 1].nextCameraName + "ff" + instance.poscmin + "ww" + nut.initialPos);
                        if (nut.checkedResult[length - 1].nextCameraName == cameraName && instance.poscmin == nut.initialPos)
                        //if (nut.posNo == CameraID[cameraName])
                        {
                            cco.leadToTheHole  = checkresult;
                            cco.nextCameraName = nextCameraName;
                            //   Console.WriteLine("" + cameraName + "" + nut.initialPos);
                            nut.checkedResult.Add(cco);
                            jiancejieguo jcjg1 = new jiancejieguo();
                            foreach (DataRow drx in drc)
                            {
                                if (drx[0].ToString() == cameraName)
                                {
                                    jcjg1 = new jiancejieguo();
                                    jcjg1.jiancexiangmu = drx[1].ToString();
                                    jcjg1.celiangjieguo = (double)drx[5];
                                    nut.jiance.Add(jcjg1);
                                }
                            }
                            break;
                        }
                    }
                }
            }
        }