コード例 #1
0
        public Carrier VisionInspect()
        {
            Carrier _carrier = new Carrier();

            if (Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
            {
                if (!HSTVision.Simulation)
                {
                    if (/*Machine.HSTMachine.Workcell.HSTSettings.Install.HGADetectionUsingVision &&*/ Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
                    {
                        if (_inputcamera != null)
                        {
                            if (_inputcamera.GrabManual(true))
                            {
                                if (_inputcameraVisionApp.RunToolBlock(_inputcamera.grabImage, "NoCarrierInfo"))
                                {
                                    _carrier.ImageFileName = _inputcameraVisionApp.ImageFileName(); //

                                    _carrier.Hga1.Hga_Status          = _inputcameraVisionApp.GetResult(0);
                                    _carrier.Hga2.Hga_Status          = _inputcameraVisionApp.GetResult(1);
                                    _carrier.Hga3.Hga_Status          = _inputcameraVisionApp.GetResult(2);
                                    _carrier.Hga4.Hga_Status          = _inputcameraVisionApp.GetResult(3);
                                    _carrier.Hga5.Hga_Status          = _inputcameraVisionApp.GetResult(4);
                                    _carrier.Hga6.Hga_Status          = _inputcameraVisionApp.GetResult(5);
                                    _carrier.Hga7.Hga_Status          = _inputcameraVisionApp.GetResult(6);
                                    _carrier.Hga8.Hga_Status          = _inputcameraVisionApp.GetResult(7);
                                    _carrier.Hga9.Hga_Status          = _inputcameraVisionApp.GetResult(8);
                                    _carrier.Hga10.Hga_Status         = _inputcameraVisionApp.GetResult(9);
                                    _carrier.IsLoadedInWrongDirection = _inputcameraVisionApp.IsBoatReverse();
                                    _carrier.IsDycemBoat = _inputcameraVisionApp.IsDycemBoat();
                                    CommonFunctions.Instance.visionError = "NoError";
                                }
                                else
                                {
                                    CommonFunctions.Instance.visionError = _inputcameraVisionApp.ErrorMessage();
                                }
                            }
                            else
                            {
                                MessageBox.Show("Fail to acquire image");
                            }
                        }
                        else
                        {
                            MessageBox.Show("InputCamera not initialize...");
                        }
                    }
                    else
                    {
                        _carrier.Hga1.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga2.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga3.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga4.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga5.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga6.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga7.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga8.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga9.Hga_Status  = HGAStatus.HGAPresent;
                        _carrier.Hga10.Hga_Status = HGAStatus.HGAPresent;
                    }
                }
            }
            else
            {
                _carrier.Hga1.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga2.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga3.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga4.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga5.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga6.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga7.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga8.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga9.Hga_Status  = HGAStatus.HGAPresent;
                _carrier.Hga10.Hga_Status = HGAStatus.HGAPresent;
            }
            return(_carrier);
        }
コード例 #2
0
        public Carrier VisionInspect(HGAStatus hgaStatus, string CarrierID)
        {
            Carrier _carrier = new Carrier();

            if (Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
            {
                if (!HSTVision.Simulation)
                {
                    if (/*HSTMachine.Workcell.HSTSettings.Install.HGADetectionUsingVision && */ Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
                    {
                        if (_outputcamera != null)
                        {
                            if (_outputcamera.GrabManual(true))
                            {
                                if (_outputcameraVisionApp.RunToolBlock(_outputcamera.grabImage, CarrierID)) // return true if vision tool success
                                {
                                    _carrier.ImageFileName = _outputcameraVisionApp.ImageFileName();         //

                                    _carrier.Hga1.Hga_Status  = _outputcameraVisionApp.GetResult(0);
                                    _carrier.Hga2.Hga_Status  = _outputcameraVisionApp.GetResult(1);
                                    _carrier.Hga3.Hga_Status  = _outputcameraVisionApp.GetResult(2);
                                    _carrier.Hga4.Hga_Status  = _outputcameraVisionApp.GetResult(3);
                                    _carrier.Hga5.Hga_Status  = _outputcameraVisionApp.GetResult(4);
                                    _carrier.Hga6.Hga_Status  = _outputcameraVisionApp.GetResult(5);
                                    _carrier.Hga7.Hga_Status  = _outputcameraVisionApp.GetResult(6);
                                    _carrier.Hga8.Hga_Status  = _outputcameraVisionApp.GetResult(7);
                                    _carrier.Hga9.Hga_Status  = _outputcameraVisionApp.GetResult(8);
                                    _carrier.Hga10.Hga_Status = _outputcameraVisionApp.GetResult(9);
                                }
                            }
                            else
                            {
                                MessageBox.Show("Fail to acquire image");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Output Camera not initialize...");
                        }
                    }
                    else
                    {
                        _carrier.Hga1.Hga_Status  = hgaStatus;
                        _carrier.Hga2.Hga_Status  = hgaStatus;
                        _carrier.Hga3.Hga_Status  = hgaStatus;
                        _carrier.Hga4.Hga_Status  = hgaStatus;
                        _carrier.Hga5.Hga_Status  = hgaStatus;
                        _carrier.Hga6.Hga_Status  = hgaStatus;
                        _carrier.Hga7.Hga_Status  = hgaStatus;
                        _carrier.Hga8.Hga_Status  = hgaStatus;
                        _carrier.Hga9.Hga_Status  = hgaStatus;
                        _carrier.Hga10.Hga_Status = hgaStatus;
                    }
                }
            }
            else
            {
                _carrier.Hga1.Hga_Status  = hgaStatus;
                _carrier.Hga2.Hga_Status  = hgaStatus;
                _carrier.Hga3.Hga_Status  = hgaStatus;
                _carrier.Hga4.Hga_Status  = hgaStatus;
                _carrier.Hga5.Hga_Status  = hgaStatus;
                _carrier.Hga6.Hga_Status  = hgaStatus;
                _carrier.Hga7.Hga_Status  = hgaStatus;
                _carrier.Hga8.Hga_Status  = hgaStatus;
                _carrier.Hga9.Hga_Status  = hgaStatus;
                _carrier.Hga10.Hga_Status = hgaStatus;
            }

            return(_carrier);
        }