public void Calculate()
        {
            switch (CalculateTypeIndex)
            {
            case 0:
                SensorLength = VisionCalculate.CalculateSensorLength(ViewLength, Focus, Height);
                Result       = SensorLength;
                break;

            case 1:
                ViewLength = VisionCalculate.CalculateViewLength(SensorLength, Focus, Height);
                Result     = ViewLength;
                break;

            case 2:
                Focus  = VisionCalculate.CalculateFocus(SensorLength, ViewLength, Height);
                Result = Focus;
                break;

            case 3:
                Height = VisionCalculate.CalculateHeight(SensorLength, ViewLength, Focus);
                Result = Height;
                break;

            default:
                break;
            }
        }
        /// <summary>
        /// 计算视野范围
        /// </summary>
        public void CalculateViewSize()
        {
            if ((SensorIndex == -1) || (SensorIndex >= ValidSensors?.Count))
            {
                MessageBox.Show("未选择有效传感器");
                return;
            }

            var sensor = ValidSensors[SensorIndex];

            var h = VisionCalculate.CalculateViewLength(sensor.SensorSize.Horizontal, Focus3, Height3);
            var v = VisionCalculate.CalculateViewLength(sensor.SensorSize.Vertical, Focus3, Height3);

            ViewSize = new Size <double>(h, v).ToString();
        }