예제 #1
0
        public void SetCameraParam(CameraParamStruct param)
        {
            int nRet = m_CameraOperator.SetFloatValue("ExposureTime", param.Exposure);

            if (nRet != CameraOperator.CO_OK)
            {
                MessageBox.Show("设置曝光时间失败!");
            }

            m_CameraOperator.SetEnumValue("GainAuto", 0);
            nRet = m_CameraOperator.SetFloatValue("Gain", param.Gain);
            if (nRet != CameraOperator.CO_OK)
            {
                MessageBox.Show("设置增益失败!");
            }

            nRet = m_CameraOperator.SetFloatValue("AcquisitionFrameRate", param.FramRate);
            if (nRet != CameraOperator.CO_OK)
            {
                MessageBox.Show("设置帧率失败!");
            }
        }
예제 #2
0
        public override void SetExtTrigger()
        {
            try
            {
                //int ret = 1;
                // ret= m_pOperator.SetEnumValue("TriggerSelector", 0);//0 :AcquisitionStart
                //// if (ret==0)
                // {
                //     ret = m_pOperator.SetEnumValue("TriggerSelector", 3);//3:FrameStart
                //     if (ret==0)
                //     {
                //         m_pOperator.SetEnumValue("TriggerSelector", 0);//0 :AcquisitionStart
                //         m_pOperator.SetEnumValue("TriggerMode", 0);//0:Off

                //         m_pOperator.SetEnumValue("TriggerSelector", 3);//3:FrameStart
                //         m_pOperator.SetEnumValue("TriggerMode", 1);//1:On

                //         //触发源选择:0 - Line0;
                //         //           1 - Line1;
                //         //           2 - Line2;
                //         //           3 - Line3;
                //         //           4 - Counter;
                //         //           7 - Software;
                //         m_pOperator.SetEnumValue("TriggerSource", 1);

                //     }
                //     else
                //     {
                //       //  m_pOperator.SetEnumValue("TriggerSelector", 0);//0 :AcquisitionStart

                //         m_pOperator.SetEnumValue("TriggerMode", 1);//1:On
                //         m_pOperator.SetEnumValue("TriggerSource", 1);
                //        // m_pOperator.StartGrabbing();


                //     }
                // }
                m_pOperator.SetEnumValue("TriggerMode", 1);
                //触发源选择:0 - Line0;
                //           1 - Line1;
                //           2 - Line2;
                //           3 - Line3;
                //           4 - Counter;
                //           7 - Software;
                m_pOperator.SetEnumValue("TriggerSource", 0);

                //m_pOperator.SetEnumValue("TriggerMode", 1);
                //m_pOperator.SetEnumValue("TriggerSource", 1);


                m_pOperator.SetEnumValue("ExposureAuto", 0);

                m_pOperator.SetFloatValue("TriggerDelay", (float)triggerDelayAbs);
                m_pOperator.SetIntValue("LineDebouncerTime", (uint)LineDebouncerTimeAbs);
                Command      = Command.ExtTrigger;
                IsExtTrigger = true;
            }
            catch (Exception ex)
            {
                Util.WriteLog(this.GetType(), ex);
                Util.Notify("相机外触发设置异常");
            }
        }