Пример #1
0
        public Engine(Config config)
        {
            this.config      = config;
            this.colorimeter = new Colorimeter();
            this.xml         = new Xml(this.config.ScriptName);

            if (!this.config.IsSimulation)
            {
                this.fixture = new Fixture(this.config.FixturePortName);
                //this.ca310Pipe = new Ca310Pipe(System.Windows.Forms.Application.StartupPath);
                IDevice intergrate = new IntegratingSphere(this.fixture, this.config.LCP3005PortName);
                DevManage.Instance.AddDevice(fixture);
                DevManage.Instance.AddDevice(intergrate);
            }

            dut  = (DUT)Activator.CreateInstance(Type.GetType("DUTclass." + this.config.ProductType));
            mode = (TestMode)Enum.Parse(typeof(TestMode), this.config.TestMode);

            ip              = new imagingpipeline();
            args            = new DataChangeEventArgs();
            tableArgs       = new TableViewEventArgs();
            tableArgs.Items = xml.Items;

            log          = new Testlog();
            SerialNumber = "";

            if (!System.IO.Directory.Exists(IMAGE_SAVE_PATH))
            {
                System.IO.Directory.CreateDirectory(IMAGE_SAVE_PATH);
            }
        }
Пример #2
0
        private void engine_dataChange(object sender, DataChangeEventArgs args)
        {
            sslStatus.Text    = args.StatusInfo;
            tbox_ccdtemp.Text = args.CCDTemperature.ToString();
            tbox_uptime.Text  = String.Format("{0:D2}h:{1:D2}m:{2:D2}s",
                                              args.Uptime.Hours, args.Uptime.Minutes, args.Uptime.Seconds);
            tbox_colorimeterstatus.Text = args.CCDStatusInfo;

            if (args.Image != null && args.Image != preImage)
            {
                picturebox_test.Image = args.Image;
                preImage = args.Image;
            }

            if (!config.IsScanSerialNumber)
            {
                tbox_sn.Text = args.SerialNumber;
            }

            if (engine.IsDutReady)
            {
                tbox_dut_connect.Text      = "Connected";
                tbox_dut_connect.ForeColor = Color.White;
                tbox_dut_connect.BackColor = Color.Green;
            }
            else
            {
                tbox_dut_connect.Text      = "TBD";
                tbox_dut_connect.ForeColor = Color.Black;
                tbox_dut_connect.BackColor = Color.FromArgb(244, 244, 244);
            }

            if (engine.IsShopFlowReady)
            {
                tbox_shopfloor.Text      = "Connected";
                tbox_shopfloor.ForeColor = Color.White;
                tbox_shopfloor.BackColor = Color.Green;
            }
            else
            {
                tbox_shopfloor.Text      = "TBD";
                tbox_shopfloor.ForeColor = Color.Black;
                tbox_shopfloor.BackColor = Color.FromArgb(244, 244, 244);
            }

            tbox_pf.Text = args.PassOrFail;

            if (args.PassOrFail == "READY" || args.PassOrFail == "TESTING")
            {
                tbox_pf.ForeColor = Color.Blue;
                tbox_pf.BackColor = SystemColors.Info;
            }
            else if (args.PassOrFail == "PASS")
            {
                tbox_pf.ForeColor = Color.White;
                tbox_pf.BackColor = Color.Green;
            }
            else if (args.PassOrFail == "FAIL")
            {
                tbox_pf.ForeColor = Color.White;
                tbox_pf.BackColor = Color.Red;
            }
        }