public bool SetParameter(ECameraParameter parameter, double value) { switch (parameter) { case ECameraParameter.OffsetX: return(_camera.Parameters[PLCamera.OffsetX].TrySetValue((long)Math.Round(value))); case ECameraParameter.OffsetY: return(_camera.Parameters[PLCamera.OffsetY].TrySetValue((long)Math.Round(value))); case ECameraParameter.Width: return(_camera.Parameters[PLCamera.Width].TrySetValue((long)Math.Round(value))); case ECameraParameter.Height: return(_camera.Parameters[PLCamera.Height].TrySetValue((long)Math.Round(value))); case ECameraParameter.Exposure: return(_camera.Parameters[PLCamera.ExposureTime].TrySetValue(value)); case ECameraParameter.Gain: return(_camera.Parameters[PLCamera.Gain].TrySetValue(value)); case ECameraParameter.FrameRate: return(_camera.Parameters[PLCamera.AcquisitionFrameRate].TrySetValue(value)); case ECameraParameter.TriggerDelay: return(_camera.Parameters[PLCamera.TriggerDelay].TrySetValue(value)); } return(false); }
public bool SetParameter(ECameraParameter parameter, double value) { if (_camera != null) { if (_camera.SetParameter(parameter, value)) { if (ParameterChanged != null) { ParameterChanged(GetParameterInfo()); } return(true); } } return(false); }
public bool SetParameter(ECameraParameter parameter, double value) { int nRet = 0; switch (parameter) { case ECameraParameter.OffsetX: nRet = _device.MV_CC_SetAOIoffsetX_NET((uint)Math.Round(value)); break; case ECameraParameter.OffsetY: nRet = _device.MV_CC_SetAOIoffsetY_NET((uint)Math.Round(value)); break; case ECameraParameter.Width: nRet = _device.MV_CC_SetWidth_NET((uint)Math.Round(value)); break; case ECameraParameter.Height: nRet = _device.MV_CC_SetHeight_NET((uint)Math.Round(value)); break; case ECameraParameter.Exposure: nRet = _device.MV_CC_SetExposureTime_NET((float)value); break; case ECameraParameter.Gain: nRet = _device.MV_CC_SetGain_NET((float)value); break; case ECameraParameter.FrameRate: nRet = _device.MV_CC_SetFrameRate_NET((float)value); break; case ECameraParameter.TriggerDelay: nRet = _device.MV_CC_SetTriggerDelay_NET((float)value); break; } return(MyCamera.MV_OK == nRet); }