/// <summary> /// Anda 光源 /// </summary> /// <param name="lightType"></param> public void SelectLight(LightType lightType) { //Machine.Instance.Light.SetLight(lightType); if (Machine.Instance.Light.Lighting.lightVendor == Drive.Sensors.Lighting.LightVendor.Anda) { AndaLight light = Machine.Instance.Light.Lighting as AndaLight; light.SetLight(lightType); } this.cbxLight.SelectedIndex = (int)lightType; }
/// <summary> /// 飞拍相机、光源的初始化设置 /// </summary> /// <returns></returns> public Result FlyMarksInit(LightType lightType, int gain, int ExpExposureTime) { //高速IO设备的切换 DOMgr.Instance.FindBy(2).Set(true); //光源设置 //Machine.Instance.Light.SetLight(lightType); if (Machine.Instance.Light.Lighting.lightVendor == Sensors.Lighting.LightVendor.Anda) { AndaLight light = Machine.Instance.Light.Lighting as AndaLight; light.SetLight(lightType); } //相机参数设置 Machine.Instance.Camera.StopGrabing(); Machine.Instance.Camera.SetTriggerMode(true); Machine.Instance.Camera.SetGain(gain); Machine.Instance.Camera.SetExposure(ExpExposureTime); Machine.Instance.Camera.StartGrabing(); return(Result.OK); }
//private void Timer_Tick(object sender, EventArgs e) //{ // if (Machine.Instance.Camera.Executor == null) // { // return; // } // lock (Machine.Instance.Camera) // { // Bitmap bitmapNew = Machine.Instance.Camera.Executor.CurrentBmp; // Bitmap bitmapOld = picCamera.Image as Bitmap; // if (bitmapNew != null && bitmapNew != bitmapOld) // { // picCamera.Image = bitmapNew; // bitmapOld?.Dispose(); // } // } //} private void CbxLight_SelectedIndexChanged(object sender, EventArgs e) { if (this.camera == null) { return; } LightType lightType = (LightType)this.cbxLight.SelectedIndex; //Machine.Instance.Light.SetLight(lightType); if (Machine.Instance.Light.Lighting.lightVendor == Drive.Sensors.Lighting.LightVendor.Anda) { AndaLight light = Machine.Instance.Light.Lighting as AndaLight; light.SetLight(lightType); } Properties.Settings.Default.ligthType = this.cbxLight.SelectedIndex; if (this.camera.Prm != null && this.prmBackUp != null) { CompareObj.CompareProperty(this.camera.Prm, this.prmBackUp, null, this.GetType().Name); } }