Beispiel #1
0
        public void Init()
        {
            try
            {
                XCamera            cam         = XCamera.GetInstance();
                XCameraCapturePara capturePara = cam.CapturePara;

                if (capturePara.ImageFileType == emDSFileType.FILE_JPG)
                {
                    _radioGroupCaptureFileType.SelectedIndex = 0;
                }
                else if (capturePara.ImageFileType == emDSFileType.FILE_BMP)
                {
                    _radioGroupCaptureFileType.SelectedIndex = 1;
                }
                else
                {
                    _radioGroupCaptureFileType.SelectedIndex = 2;
                }

                _trackBarJpgFileQulity.Enabled = (_radioGroupCaptureFileType.SelectedIndex == 0);
                _trackBarJpgFileQulity.Value   = capturePara.ImageQuality;
                _buttonEditPicSavePath.Text    = capturePara.ImageSavePath;

                _spinEditMutiCaptureCnt.Value = capturePara.MutiCaptureCount;
                _textEditMutiCaptureTime.Text = ((double)(capturePara.MutiCaptureTimeStep) / 1000.0).ToString();

                _spinEditAccuFrameCnt.Value = capturePara.FluModeAccuFrameCnt;
                _spinEditFrameStep.Value    = capturePara.FluModeFrameStep;

                int videoQuality  = 2;
                var cameraCamType = Convert.ToInt32(ConfigManager.GetAppConfig("CameraType"));
                if (cameraCamType == 1)
                {
                    cam.GetRecordQuality(out videoQuality);
                    _radioGroupAVIQuality.SelectedIndex = videoQuality - 1;
                }
                _buttonEditVideoSavePath.Text = capturePara.VideoSavePath;
                int maxVideoSize;
                cam.GetMaxVideoFileSize(out maxVideoSize);
                _spinEditMaxVideoSize.Value = maxVideoSize;
                if (!cam.IsActive())
                {
                    _radioGroupAVIQuality.Enabled = false;
                    _spinEditMaxVideoSize.Enabled = false;
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.Message);
            }
        }