private void buttonSelectWorldPos_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Multiselect = false;//该值确定是否可以选择多个文件
            dialog.Title       = "选择输入文件";
            dialog.Filter      = "所有文件(*.*)|*.*";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                textBoxWorldCoordianteFilePath.Text = dialog.FileName;
                string filePath = dialog.FileName;

                listViewParameterSet.Items.Clear();
                m_calibrationCenter.AllLineData.Clear();

                StreamReader sr = new StreamReader(filePath, Encoding.Default);
                String       sourceMessage;
                while ((sourceMessage = sr.ReadLine()) != null)
                {
//                     sourceMessage = "02, 240.45, -321.864, -341.843, -179.9956, 0.0033, -0.0098";
                    AqCalibration.CalibrationDataGroup calibrationlineData = new AqCalibration.CalibrationDataGroup();
                    int startIndex = 0;
                    for (int i = 0; i < 6; i++)
                    {
                        int endIndex = sourceMessage.IndexOf(",", startIndex);
                        if (i == 0)
                        {
                            //ImageA,暂时用作用来标记世界坐标系下对应图像中圆点的索引
                            calibrationlineData.CameraPosition.ImageA = Convert.ToUInt16(sourceMessage.Substring(startIndex, endIndex - startIndex));
                        }
                        else if (i == 1)
                        {
                            calibrationlineData.RobotCoordinate.RobotX = Convert.ToDouble(sourceMessage.Substring(startIndex, endIndex - startIndex));
                        }
                        else if (i == 2)
                        {
                            calibrationlineData.RobotCoordinate.RobotY = Convert.ToDouble(sourceMessage.Substring(startIndex, endIndex - startIndex));
                        }
                        else if (i == 5)
                        {
                            calibrationlineData.RobotCoordinate.RobotRz = Convert.ToDouble(sourceMessage.Substring(endIndex + 1, sourceMessage.Length - endIndex - 1));
                        }
                        startIndex = endIndex + 1;
                    }
                    m_calibrationCenter.AllLineData.Add(calibrationlineData);
                    ListViewItem line = new ListViewItem("", 0);
                    line.SubItems.Add("");
                    line.SubItems.Add(calibrationlineData.RobotCoordinate.RobotX.ToString());
                    line.SubItems.Add(calibrationlineData.RobotCoordinate.RobotY.ToString());
                    line.SubItems.Add(calibrationlineData.RobotCoordinate.RobotRz.ToString());
                    listViewParameterSet.Items.Add(line);
                }

                buttonSelectCalPic.Enabled = true;
            }
        }
        private bool ReadCalibrationDataFromFile()
        {
            m_calibrationCenter.AllLineData.Clear();
            string sectionName = "Calibration";
            string keyValue    = "LineGroupCount";
            int    lineGroup   = IniFile.ReadValue(sectionName, keyValue, 0);

            for (int i = 0; i < lineGroup; i++)
            {
                AqCalibration.CalibrationDataGroup calibrationlineData = new AqCalibration.CalibrationDataGroup();
                keyValue = string.Format("CameraX{0}", i);
                calibrationlineData.CameraPosition.ImageX = Convert.ToDouble(IniFile.ReadValue(sectionName, keyValue, "0"));
                keyValue = string.Format("CameraY{0}", i);
                calibrationlineData.CameraPosition.ImageY = Convert.ToDouble(IniFile.ReadValue(sectionName, keyValue, "0"));
                keyValue = string.Format("RobotX{0}", i);
                calibrationlineData.RobotCoordinate.RobotX = Convert.ToDouble(IniFile.ReadValue(sectionName, keyValue, "0"));
                keyValue = string.Format("RobotY{0}", i);
                calibrationlineData.RobotCoordinate.RobotY = Convert.ToDouble(IniFile.ReadValue(sectionName, keyValue, "0"));
                keyValue = string.Format("RobotRz{0}", i);
                calibrationlineData.RobotCoordinate.RobotRz = Convert.ToDouble(IniFile.ReadValue(sectionName, keyValue, "0"));
                m_calibrationCenter.AllLineData.Add(calibrationlineData);
            }

            keyValue           = "ResultImageX";
            textBoxImageX.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue           = "ResultImageY";
            textBoxImageY.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue           = "ResultImageRz";
            textBoxImageA.Text = IniFile.ReadValue(sectionName, keyValue, "0");

            keyValue = "RobotPosX";
            textBoxRobotPosX.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue = "RobotPosY";
            textBoxRobotPosY.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue = "RobotPosRz";
            textBoxRobotPosRz.Text = IniFile.ReadValue(sectionName, keyValue, "0");

            keyValue = "CatchPosX";
            textBoxCatchRobotX.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue = "CatchPosY";
            textBoxCatchRobotY.Text = IniFile.ReadValue(sectionName, keyValue, "0");
            keyValue = "CatchPosRz";
            textBoxCatchRobotRz.Text = IniFile.ReadValue(sectionName, keyValue, "0");

            return(true);
        }
        private void buttonNewLine_Click(object sender, EventArgs e)
        {
            ListViewItem line = new ListViewItem(textBoxCameraX.Text, 0);

            line.SubItems.Add(textBoxCameraY.Text);
            line.SubItems.Add(textBoxRobotX.Text);
            line.SubItems.Add(textBoxRobotY.Text);
            line.SubItems.Add(textBoxRobotRz.Text);
            listViewParameterSet.Items.Add(line);

            AqCalibration.CalibrationDataGroup calibrationlineData = new AqCalibration.CalibrationDataGroup();
            calibrationlineData.CameraPosition.ImageX   = Convert.ToDouble(textBoxCameraX.Text);
            calibrationlineData.CameraPosition.ImageY   = Convert.ToDouble(textBoxCameraY.Text);
            calibrationlineData.RobotCoordinate.RobotX  = Convert.ToDouble(textBoxRobotX.Text);
            calibrationlineData.RobotCoordinate.RobotY  = Convert.ToDouble(textBoxRobotY.Text);
            calibrationlineData.RobotCoordinate.RobotRz = Convert.ToDouble(textBoxRobotRz.Text);
            m_calibrationCenter.AllLineData.Add(calibrationlineData);
            textBoxCameraX.Text = "";
            textBoxCameraY.Text = "";
            textBoxRobotX.Text  = "";
            textBoxRobotY.Text  = "";
            textBoxRobotRz.Text = "";
        }