Beispiel #1
0
        private void RunCa310Test()
        {
            if (flagCa310Mode)
            {
                Dictionary <string, CIE1931Value> items = new Dictionary <string, CIE1931Value>();
                fixture.RotateOn();
                Thread.Sleep(1000);

                foreach (TestItem testItem in xml.Items)
                {
                    log.WriteUartLog(string.Format("Ca310Mode - Set panel to {0}\r\n", testItem.TestName));

                    if (dut.ChangePanelColor(testItem.TestName))
                    {
                        Thread.Sleep(3000);
                        CIE1931Value cie = ca310Pipe.GetCa310Data();
                        log.WriteUartLog(string.Format("Ca310Mode - CIE1931xyY: {0}\r\n", cie.ToString()));
                        items.Add(testItem.TestName, cie.Copy());
                    }
                    else
                    {
                        args.StatusInfo = string.Format("Can't set panel color to {0}\r\n", testItem.TestName);
                        break;
                    }
                }
                fixture.RotateOff();
                Thread.Sleep(1000);
                log.WriteCa310Log(SerialNumber, items);
            }
        }
Beispiel #2
0
        private void RunTest()
        {
            try
            {
                DateTime startTime, stopTime;
                startTime = DateTime.Now;

                if (m_flagCa310Mode)
                {
                    Dictionary <string, CIE1931Value> items = new Dictionary <string, CIE1931Value>();
                    fixture.RotateOn();
                    Thread.Sleep(1000);
                    foreach (TestItem testItem in xml.Items)
                    {
                        log.WriteUartLog(string.Format("Ca310Mode - Set panel to {0}\r\n", testItem.TestName));

                        if (dut.ChangePanelColor(testItem.TestName))
                        {
                            Thread.Sleep(3000);
                            CIE1931Value cie = ca310Pipe.GetCa310Data();
                            log.WriteUartLog(string.Format("Ca310Mode - CIE1931xyY: {0}\r\n", cie.ToString()));
                            items.Add(testItem.TestName, cie.Copy());
                        }
                        else
                        {
                            string str = string.Format("Can't set panel color to {0}\r\n", testItem.TestName);
                            sslStatus.Text = str;
                            pf             = false;
                            break;
                        }
                    }
                    fixture.RotateOff();
                    Thread.Sleep(1000);
                    log.WriteCa310Log(serialNumber, items);
                }

                foreach (TestItem testItem in xml.Items)
                {
                    log.WriteUartLog(string.Format("Set panel to {0}\r\n", testItem.TestName));

                    if (dut.ChangePanelColor(testItem.TestName))
                    {
                        Thread.Sleep(3000);
                        m_colorimeter.ExposureTime = testItem.Exposure;
                        Bitmap bitmap = m_colorimeter.GrabImage();
                        pf &= this.DisplayTest(displaycornerPoints, bitmap, (ColorPanel)Enum.Parse(typeof(ColorPanel), testItem.TestName));
                        //this.Invoke(new Action<Bitmap, PictureBox>(this.refreshtestimage), bitmap, picturebox_test);
                    }
                    else
                    {
                        string str = string.Format("Can't set panel color to {0}\r\n", testItem.TestName);
                        sslStatus.Text = str;
                        pf             = false;
                        break;
                    }
                }

                if (pf)
                {
                    log.WriteUartLog("Test result is PASS\r\n");
                    this.Invoke(new Action(delegate() {
                        tbox_pf.Visible   = true;
                        tbox_pf.BackColor = Color.Green;
                        tbox_pf.Text      = "Pass";
                    }));
                }
                else
                {
                    log.WriteUartLog("Test result is FAIL\r\n");
                    this.Invoke(new Action(delegate() {
                        tbox_pf.Visible   = true;
                        tbox_pf.BackColor = Color.Red;
                        tbox_pf.Text      = "Fail";
                    }));
                }
                log.UartFlush();

                stopTime = DateTime.Now;
                log.WriteCsv(serialNumber, startTime, stopTime, xml.Items);
                //SFC.CreateResultFile(1, pf ? "PASS" : "FAIL");

                while (dut.checkDUT())
                {
                    this.Invoke(new Action(delegate(){
                        sslStatus.Text = "Please take out DUT.";
                    }));
                    Thread.Sleep(100);

                    if (m_flagExit)
                    {
                        break;
                    }
                }

                tbox_dut_connect.Text      = "TBD";
                tbox_dut_connect.BackColor = Color.FromArgb(224, 224, 224);
                tbox_sn.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }