Ejemplo n.º 1
0
        // Methods -------------------------------------------------------------
        public override void InitializeController()
        {
            SetAction(1);
            try
            {
                if (!Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
                {
                    return;
                }
                HSTVision = HSTMachine.HwSystem.GetHwComponent((int)HSTHwSystem.HardwareComponent.VisionSystem) as VisionHardware;
                if (!HSTVision.Simulation)
                {
                    _outputcamera          = new Camera(HSTVision.GetCamera(Machine.HSTMachine.Workcell.CalibrationSettings.Vision.OutputCamera.CameraSerialNumber));
                    _outputcameraVisionApp = new VisionApp();

                    //---------------- Dont save the images during start up ------------------------
                    ConfigureOutputCamera(false, false);
                    //----------------
                    for (int count = 0; count < 3; count++)
                    {
                        _outputcamera.GrabManual(true);
                        Thread.Sleep(500);
                    }
                    ConfigureOutputCamera(Machine.HSTMachine.Workcell.CalibrationSettings.Vision.OutputCamera.SaveImagesLessThanTenHGAs,
                                          Machine.HSTMachine.Workcell.CalibrationSettings.Vision.OutputCamera.SaveAllImages);
                }
            }
            catch (Exception ex)
            {
                throw CreateControllerException(1, ex);
            }
        }
Ejemplo n.º 2
0
        public override void InitializeController()
        {
            if (!Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
            {
                return;
            }
            HSTVision = HSTMachine.HwSystem.GetHwComponent((int)HSTHwSystem.HardwareComponent.VisionSystem) as VisionHardware;

            if (!HSTVision.Simulation)
            {
                _inputcamera          = new Camera(HSTVision.GetCamera(Machine.HSTMachine.Workcell.CalibrationSettings.Vision.InputCamera.CameraSerialNumber));
                _inputcameraVisionApp = new VisionApp();

                ConfigureInputCamera(false, false);
                for (int count = 0; count < 3; count++)
                {
                    _inputcamera.GrabManual(true);
                    Thread.Sleep(500);
                }
                ConfigureInputCamera(Machine.HSTMachine.Workcell.CalibrationSettings.Vision.InputCamera.SaveImagesLessThanTenHGAs,
                                     Machine.HSTMachine.Workcell.CalibrationSettings.Vision.InputCamera.SaveAllImages);
            }
        }