コード例 #1
0
        /// <summary>
        /// 设置相机触发延时
        /// </summary>
        /// <param name="lineIdx">外触发端口</param>
        /// <param name="trigdelay">延时时间,单位毫秒</param>
        /// <returns></returns>
        protected override bool DoSetTriggerDelay(int lineIdx, float trigdelay)
        {
            bool rt = false;

            try
            {
                if (_deviceRef != null)
                {
                    //SDK--固定外触发输入,无需指定输入端口,时间单位微秒
                    using (ThridLibray.IFloatParameter p = _deviceRef.ParameterCollection[ThridLibray.ParametrizeNameSet.TriggerDelay])
                    {
                        trigdelay *= 1000;
                        rt         = p.SetValue(trigdelay);
                    }
                }

                if (!rt)
                {
                    if (DriverExceptionDel != null)
                    {
                        DriverExceptionDel(string.Format("错误:大华相机设置触发延时失败!\n错误代码:{0:X8}", 99));
                    }
                }
            }
            catch
            {
            }
            finally
            {
            }
            return(rt);
        }
コード例 #2
0
        protected override bool DoSetFrameRate(float fps)
        {
            bool rt = false;

            try
            {
                if (_deviceRef != null)
                {
                    using (ThridLibray.IFloatParameter p = _deviceRef.ParameterCollection[ThridLibray.ParametrizeNameSet.AcquisitionFrameRate])
                    {
                        rt = p.SetValue(fps);
                    }
                }

                if (!rt)
                {
                    if (DriverExceptionDel != null)
                    {
                        DriverExceptionDel(string.Format("错误:大华相机设置帧率失败!\n错误代码:{0:X8}", 99));
                    }
                }
            }
            catch
            {
            }
            finally
            {
            }
            return(rt);
        }