Beispiel #1
0
        // Online mode
        private void RunSequence()
        {
            #region Init Ca310
            if (m_flagCa310Mode)
            {
                if (ca310Pipe == null)
                {
                    ca310Pipe      = new Ca310Pipe(Application.StartupPath);
                    sslStatus.Text = "Initilaze Ca310 device.";

                    if (!ca310Pipe.Connect())
                    {
                        sslStatus.Text = ca310Pipe.ErrorMessage;
                    }
                    else
                    {
                        MessageBox.Show("Please switch the Ca310 to init.");
                        sslStatus.Text = "Ca310 has Connected.";
                        ca310Pipe.ResetZero();
                    }
                }
            }
            else
            {
                if (ca310Pipe != null)
                {
                    ca310Pipe.Disconnect();
                    ca310Pipe = null;
                }
            }
            #endregion

            do
            {
                fixture.CheckDoubleStart();
                fixture.HoldIn();

                while (!dut.checkDUT())
                {
                    sslStatus.Text = "Wait DUT.";
                    Thread.Sleep(100);

                    if (m_flagExit)
                    {
                        break;
                    }
                }

                log.WriteUartLog(string.Format("DUT connected, DeviceID: {0}\r\n", dut.DeviceID));
                tbox_dut_connect.Text      = "DUT connected";
                tbox_dut_connect.BackColor = Color.Green;
                sslStatus.Text             = "Please type in 16 digit SN";
                Thread.Sleep(500);

                while (serialNumber == "")
                {
                    sslStatus.Text = "Wait type SN";
                }
                log.SerialNumber = tbox_sn.Text;
                log.WriteUartLog(string.Format("Serial number: {0}\r\n", tbox_sn.Text));

                if (!checkshopfloor())
                {
                    sslStatus.Text = "Shopfloor system is not working";
                }
                else
                {
                    log.WriteUartLog("Shopfloor has connected.\r\n");
                    btn_start.Enabled   = false;
                    btn_start.BackColor = Color.LightBlue;

                    this.RunTest();
                }
                serialNumber = "";
                fixture.IntegratingSphereDown();
                fixture.RotateOff();
                fixture.HoldOut();
            }while (!m_flagExit);
        }
Beispiel #2
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);
            }
        }