private void WriteData() { AIniPartOffset aIniPartOffset = new AIniPartOffset(lblTypeName.Text); for (int i = 0; i < ASDef._3D_POSITION_COUNT; i++) { aIniPartOffset.m_ppstHoleXY[i, 0].dX = Convert.ToDouble(m_pptxtHoleX[i, 0].Text); aIniPartOffset.m_ppstHoleXY[i, 1].dX = Convert.ToDouble(m_pptxtHoleX[i, 1].Text); aIniPartOffset.m_ppstHoleXY[i, 0].dY = Convert.ToDouble(m_pptxtHoleY[i, 0].Text); aIniPartOffset.m_ppstHoleXY[i, 1].dY = Convert.ToDouble(m_pptxtHoleY[i, 1].Text); aIniPartOffset.m_pstCalibXYZ[i].dX = Convert.ToDouble(m_ptxtCalibX[i].Text); aIniPartOffset.m_pstCalibXYZ[i].dY = Convert.ToDouble(m_ptxtCalibY[i].Text); aIniPartOffset.m_pstCalibXYZ[i].dZ = Convert.ToDouble(m_ptxtCalibZ[i].Text); aIniPartOffset.m_pstXYZ[i].dX = Convert.ToDouble(m_ptxtX[i].Text); aIniPartOffset.m_pstXYZ[i].dY = Convert.ToDouble(m_ptxtY[i].Text); aIniPartOffset.m_pstXYZ[i].dZ = Convert.ToDouble(m_ptxtZ[i].Text); } aIniPartOffset.Write(); // 2015.04.08 string strTxt = "Part Offset Change: " + lblTypeName.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); for (int i = 0; i < ASDef._3D_POSITION_COUNT; i++) { strTxt = "P" + (i + 1).ToString() + "_HoleL_X: " + m_pptxtHoleX[i, 0].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_HoleL_Y: " + m_pptxtHoleY[i, 0].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_HoleR_X: " + m_pptxtHoleX[i, 1].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_HoleR_Y: " + m_pptxtHoleY[i, 1].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_Calib_X: " + m_ptxtCalibX[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_Calib_Y: " + m_ptxtCalibY[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_Calib_Z: " + m_ptxtCalibZ[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_X: " + m_ptxtX[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_Y: " + m_ptxtY[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "P" + (i + 1).ToString() + "_Z: " + m_ptxtZ[i].Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); } }
private void ReadData() { // 2011.08.08 AIniPartOffset aIniPartOffset = new AIniPartOffset(lblTypeName.Text); aIniPartOffset.Read(); for (int i = 0; i < ASDef._3D_POSITION_COUNT; i++) { m_pptxtHoleX[i, 0].Text = aIniPartOffset.m_ppstHoleXY[i, 0].dX.ToString("0.00"); m_pptxtHoleX[i, 1].Text = aIniPartOffset.m_ppstHoleXY[i, 1].dX.ToString("0.00"); m_pptxtHoleY[i, 0].Text = aIniPartOffset.m_ppstHoleXY[i, 0].dY.ToString("0.00"); m_pptxtHoleY[i, 1].Text = aIniPartOffset.m_ppstHoleXY[i, 1].dY.ToString("0.00"); m_ptxtCalibX[i].Text = aIniPartOffset.m_pstCalibXYZ[i].dX.ToString("0.00"); m_ptxtCalibY[i].Text = aIniPartOffset.m_pstCalibXYZ[i].dY.ToString("0.00"); m_ptxtCalibZ[i].Text = aIniPartOffset.m_pstCalibXYZ[i].dZ.ToString("0.00"); m_ptxtX[i].Text = aIniPartOffset.m_pstXYZ[i].dX.ToString("0.00"); m_ptxtY[i].Text = aIniPartOffset.m_pstXYZ[i].dY.ToString("0.00"); m_ptxtZ[i].Text = aIniPartOffset.m_pstXYZ[i].dZ.ToString("0.00"); } }