public CalibPPControl(CalibPPSetting calibrate) { InitializeComponent(); this.subObject = calibrate; InitUserControl(); CalibratePP = new CalibPointToPoint(); }
/// <summary> /// 显示当前标定数据 /// </summary> /// <param name="calibratePP"></param> public void LoadCalibration(CalibPointToPoint calibratePP) { CalibratePP.ChangeCalibrateDataEventHandler -= ChangeCalibData; CalibratePP = calibratePP; CalibratePP.ChangeCalibrateDataEventHandler += ChangeCalibData; ChangeCalibData(null, EventArgs.Empty); }
public CalibPPSetting(CalibPointToPoint calibratePP) { CalibratePP = calibratePP; }
private void LoadPointData(CalibPointToPoint calibratePP) { dataGridView1.EndEdit(); dataGridView1.Rows.Clear(); for (int i = 0; i < calibratePP.CalibrateData.Count; i++) { string[] str = new string[] { (i + 1).ToString(), calibratePP.CalibrateData[i].PixelRow.ToString("f2"), calibratePP.CalibrateData[i].PixelCol.ToString("f2"), calibratePP.CalibrateData[i].X.ToString("f2"), calibratePP.CalibrateData[i].Y.ToString("f2") }; dataGridView1.Rows.Add(str); } if (iOpRowIndex > -1 && iOpRowIndex < dataGridView1.Rows.Count) { //dataGridView1.Rows[iOpRowIndex].Selected = true; dataGridView1.CurrentCell = dataGridView1.Rows[iOpRowIndex].Cells[0]; } //else //{ // dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count-1].Cells[0]; //} if (calibratePP.IsBuiltted) { string sx = "Sx:" + calibratePP.Sx.ToString("f4"); string sy = "Sy:" + calibratePP.Sy.ToString("f4"); string ang = "Angle:" + (calibratePP.Phi * 180 / Math.PI).ToString("f4"); string theta = "Theta:" + (calibratePP.Theta * 180 / Math.PI).ToString("f4"); string Moved = "Tx:" + calibratePP.Tx.ToString("f3") + "/" + "Ty:" + calibratePP.Ty.ToString("f3"); string Error = "Error:" + calibratePP.CalibrateError().ToString("f4"); textBox12.Text = sx; textBox9.Text = sy; textBox8.Text = ang; textBox6.Text = theta; textBox7.Text = Moved; textBox5.Text = Error; } else { textBox12.Text = string.Empty; textBox9.Text = string.Empty; textBox8.Text = string.Empty; textBox6.Text = string.Empty; textBox7.Text = string.Empty; textBox5.Text = string.Empty; } if (dataGridView1.Rows.Count > 0) { 除选中点ToolStripMenuItem.Enabled = true; } else { 除选中点ToolStripMenuItem.Enabled = false; } if (dataGridView1.Rows.Count > 2) { 建造转换ToolStripMenuItem.Enabled = true; } else { 建造转换ToolStripMenuItem.Enabled = false; } }