コード例 #1
0
        private void buttonApplyLeftCameraConfig_Click(object sender, EventArgs e)
        {
            string leftExposureTime = numleftExposureTime.Value.ToString();

            CameraCoreInterface.SetCameraParam(LeftCameraName, GX_FEATURE_ID.GX_FLOAT_EXPOSURE_TIME, (double)numleftExposureTime.Value);
            WriteCameraConfigValueToFile(_leftCameraConfigPath, "ExposureTime", leftExposureTime);
        }
コード例 #2
0
        private void toolStripButtonEndCari_Click(object sender, EventArgs e)
        {
            int step = toolStripComboBox1.SelectedIndex;

            if (step < 3)
            {
                toolStripComboBox1.SelectedIndex++;
                step++;
            }
            if (step == 3)
            {
                toolStripComboBox1.SelectedIndex = 0;
            }
            switch (step)
            {
            case 0:
            {
                break;
            }

            case 1:
            {
                panelCaribrationLeft.Enabled = panelCaribrationRight.Enabled = true;
                numLeftHigh.Enabled          = numRightHigh.Enabled = true;
                numLeftLow.Enabled           = numRightLow.Enabled = true;
                CameraCoreInterface.SetCameraCaribrationStep(2);
                CameraCoreInterface.SetCameraCaribrationParam(LeftCameraName, (int)numLeftHigh.Value, (int)numLeftLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
                CameraCoreInterface.SetCameraCaribrationParam(RightCameraName, (int)numRightHigh.Value, (int)numRightLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
                break;
            }

            case 2:
            {
                numLeftHigh.Enabled = numRightHigh.Enabled = numLeftLow.Enabled = numRightLow.Enabled = false;
                CameraCoreInterface.SetCameraCaribrationStep(3);
                CameraCoreInterface.SetCameraCaribrationParam(LeftCameraName, (int)numLeftHigh.Value, (int)numLeftLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
                CameraCoreInterface.SetCameraCaribrationParam(RightCameraName, (int)numRightHigh.Value, (int)numRightLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
                break;
            }

            case 3:
            {
                CameraCoreInterface.SetCameraCaribrationStep(0);
                panelCaribrationLeft.Enabled    = panelCaribrationRight.Enabled = false;
                toolStripButtonCariMode.Checked = false;
                toolStripButtonEndCari.Enabled  = false;
                break;
            }
            }
        }
コード例 #3
0
        private void toolStripButtonSetting_Click(object sender, EventArgs e)
        {
            CameraViewerSettings viewerSettings = new CameraViewerSettings();

            viewerSettings.StartPosition = FormStartPosition.CenterParent;
            viewerSettings.Settings      = _cemraSettings;
            viewerSettings.ShowDialog(_parentForm);
            _cemraSettings = viewerSettings.Settings;
            if (toolStripComboBox1.SelectedIndex > 0)
            {
                CameraCoreInterface.SetCameraCaribrationParam(LeftCameraName, (int)numLeftHigh.Value, (int)numLeftLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
                CameraCoreInterface.SetCameraCaribrationParam(RightCameraName, (int)numRightHigh.Value, (int)numRightLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
            }
        }
コード例 #4
0
 private void buttonCameraStart_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(LeftCameraName) && !string.IsNullOrEmpty(RightCameraName))
     {
         int isCariMode = toolStripButtonCariMode.Checked ? 1 : 0;
         if (
             CameraCoreInterface.CameraStart(pictureBoxLeft.Handle, pictureBoxRight.Handle, pictureBoxLeft.Width,
                                             pictureBoxLeft.Height, isCariMode) != 0)
         {
             //CameraCoreInterface.ImportConfigs(_leftCameraConfigPath, LeftCameraName);
             //CameraCoreInterface.ImportConfigs(_rightCameraConfigPath, RightCameraName);
         }
         toolStripButtonCameraClose.Enabled = true;
         toolStripButtonCameraStart.Enabled = false;
     }
     else
     {
         MessageBox.Show("IP地址不能为空!");
     }
 }
コード例 #5
0
 private void buttonCameraClose_Click(object sender, EventArgs e)
 {
     CameraCoreInterface.CameraClose();
     toolStripButtonCameraClose.Enabled = false;
     toolStripButtonCameraStart.Enabled = true;
 }
コード例 #6
0
 private void numericUpDown3_ValueChanged(object sender, EventArgs e)
 {
     CameraCoreInterface.SetCameraCaribrationParam(RightCameraName, (int)numRightHigh.Value, (int)numRightLow.Value, _cemraSettings.MinDotCount, _cemraSettings.MaxError);
 }