public void Write() { string strValue; strValue = m_stCommon.dX.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonX", strValue, ASDef._INI_FILE); strValue = m_stCommon.dY.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonY", strValue, ASDef._INI_FILE); strValue = m_stCommon.dZ.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonZ", strValue, ASDef._INI_FILE); strValue = m_stCommon.dAX.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonAX", strValue, ASDef._INI_FILE); strValue = m_stCommon.dAY.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonAY", strValue, ASDef._INI_FILE); strValue = m_stCommon.dAZ.ToString("0.000"); AUtil.WritePrivateProfileString("P" + (m_nPosition + 1).ToString(), "Frame_CommonAZ", strValue, ASDef._INI_FILE); // 2016.10.11 strValue = m_stPose.dX.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseX_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); strValue = m_stPose.dY.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseY_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); strValue = m_stPose.dZ.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseZ_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); strValue = m_stPose.dAX.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseAX_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); strValue = m_stPose.dAY.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseAY_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); strValue = m_stPose.dAZ.ToString("0.000"); AUtil.WritePrivateProfileString(m_strType, "Frame_PoseAZ_P" + (m_nPosition + 1).ToString(), strValue, ASDef._INI_FILE); }
public void WriteIniPlcToPc() { try { // 2011.06.23 AUtil.WritePrivateProfileString(Name, "PlcToPc", m_strPlcToPc, ASDef._INI_FILE); } catch { } }
public void Write() { string strKeyName, strValue; for (int i = 0; i < ASDef._3D_POSITION_COUNT; i++) { strKeyName = "PartOffset_HoleX_P" + (i + 1).ToString() + "L"; strValue = m_ppstHoleXY[i, 0].dX.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_HoleX_P" + (i + 1).ToString() + "R"; // 2011.08.22 0->1 strValue = m_ppstHoleXY[i, 1].dX.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_HoleY_P" + (i + 1).ToString() + "L"; strValue = m_ppstHoleXY[i, 0].dY.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_HoleY_P" + (i + 1).ToString() + "R"; // 2011.08.22 0->1 strValue = m_ppstHoleXY[i, 1].dY.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); // 2011.07.29--------------- strKeyName = "PartOffset_CalibX"; strValue = m_pstCalibXYZ[i].dX.ToString("0.00"); AUtil.WritePrivateProfileString("P" + (i + 1).ToString(), strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_CalibY"; strValue = m_pstCalibXYZ[i].dY.ToString("0.00"); AUtil.WritePrivateProfileString("P" + (i + 1).ToString(), strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_CalibZ"; strValue = m_pstCalibXYZ[i].dZ.ToString("0.00"); AUtil.WritePrivateProfileString("P" + (i + 1).ToString(), strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_X_P" + (i + 1).ToString(); strValue = m_pstXYZ[i].dX.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_Y_P" + (i + 1).ToString(); strValue = m_pstXYZ[i].dY.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); strKeyName = "PartOffset_Z_P" + (i + 1).ToString(); strValue = m_pstXYZ[i].dZ.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, strKeyName, strValue, ASDef._INI_FILE); //--------------------------- } }
public void WriteIniOffset(int nCount) { try { AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_X", m_pstOffset[nCount].dX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_Y", m_pstOffset[nCount].dY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_Z", m_pstOffset[nCount].dZ.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_AX", m_pstOffset[nCount].dAX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_AY", m_pstOffset[nCount].dAY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Offset" + nCount.ToString() + "_AZ", m_pstOffset[nCount].dAZ.ToString(), ASDef._INI_FILE); } catch { } }
// 2014.11.04 public void WriteIniUse() { try { if (m_bUse) { AUtil.WritePrivateProfileString(Name, "Use", "O", ASDef._INI_FILE); } else { AUtil.WritePrivateProfileString(Name, "Use", "X", ASDef._INI_FILE); } } catch { } }
public void Write() { string strValue; for (int i = 0; i < ASDef._3D_POSITION_COUNT; i++) { strValue = m_pstXYZ[i].dX.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, "HoleLocation_P" + (i + 1).ToString() + "_X", strValue, ASDef._INI_FILE); strValue = m_pstXYZ[i].dY.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, "HoleLocation_P" + (i + 1).ToString() + "_Y", strValue, ASDef._INI_FILE); strValue = m_pstXYZ[i].dZ.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, "HoleLocation_P" + (i + 1).ToString() + "_Z", strValue, ASDef._INI_FILE); } strValue = m_dCheckLength.ToString("0.00"); AUtil.WritePrivateProfileString(m_strType, "HoleLocation_CheckLength", strValue, ASDef._INI_FILE); }
// save private void btnSave_Click(object sender, EventArgs e) { int nType = cmbType.SelectedIndex; AType aType = AVisionProBuild.GetType(nType); string strSN = "";//, strTempSN = ""; //int nPos = -1; StringBuilder sb = new StringBuilder(100); for (int i = 0; i < aType.m_lstAPoint.Count; i++) { strSN = lstvwPoint.Items[i].SubItems[2].Text; strSN = strSN.Trim(); if (strSN.Length == 0) { MessageBox.Show(AUtil.GetXmlLanguage("The_camera_is_not_set_point_exists") + "\r\n" + AUtil.GetXmlLanguage("First_Set_your_camera_to_the_point"), "", MessageBoxButtons.OK, MessageBoxIcon.Error); //MessageBox.Show("카메라가 설정되지 않는 포인트가 존재합니다\r\n해당 포인트에 카메라 설정을 먼저 하세요", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } for (int i = 0; i < aType.m_lstAPoint.Count; i++) { // camera serial number strSN = lstvwPoint.Items[i].SubItems[2].Text; strSN = strSN.Trim(); //AUtil.WritePrivateProfileString(aType.Name, "Dev_" + lstvwPoint.Items[i].SubItems[1].Text, strSN, ASDef._INI_FILE); AUtil.WritePrivateProfileString(aType.Name, "Dev_Point" + i.ToString(), strSN, ASDef._INI_FILE); aType.m_lstAPoint[i].m_strDevName = strSN; // pixel format strSN = lstvwPoint.Items[i].SubItems[3].Text; strSN = strSN.Trim(); AUtil.WritePrivateProfileString(aType.Name, "Point" + i.ToString() + "_PixelFormat", strSN, ASDef._INI_FILE); aType.m_lstAPoint[i].m_strPixelFormat = strSN; } MessageBox.Show(AUtil.GetXmlLanguage("Completed_the_save")); //MessageBox.Show("저장을 완료하였습니다"); }
// 2011.06.23 public void WriteIniLimit(int nCount) { try { // 2012.02.08 AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_X", m_pstLimitLow[nCount].dX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_Y", m_pstLimitLow[nCount].dY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_Z", m_pstLimitLow[nCount].dZ.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_AX", m_pstLimitLow[nCount].dAX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_AY", m_pstLimitLow[nCount].dAY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_Low_AZ", m_pstLimitLow[nCount].dAZ.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_X", m_pstLimitHigh[nCount].dX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_Y", m_pstLimitHigh[nCount].dY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_Z", m_pstLimitHigh[nCount].dZ.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_AX", m_pstLimitHigh[nCount].dAX.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_AY", m_pstLimitHigh[nCount].dAY.ToString(), ASDef._INI_FILE); AUtil.WritePrivateProfileString(Name, "Limit" + nCount.ToString() + "_High_AZ", m_pstLimitHigh[nCount].dAZ.ToString(), ASDef._INI_FILE); } catch { } }
private void btnSave_Click(object sender, EventArgs e) { AUtil.WritePrivateProfileString("DelTime", "OK", txtOk.Text, ASDef._INI_FILE); AUtil.WritePrivateProfileString("DelTime", "NG", txtNg.Text, ASDef._INI_FILE); // 2011.08.17 AUtil.WritePrivateProfileString("DelTime", "TOTAL_OK", txtTotalOK.Text, ASDef._INI_FILE); // 2011.08.17 AUtil.WritePrivateProfileString("DelTime", "TOTAL_NG", txtTotalNG.Text, ASDef._INI_FILE); AUtil.WritePrivateProfileString("DelTime", "LOG", txtLog.Text, ASDef._INI_FILE); AUtil.WritePrivateProfileString("DelTime", "TIME", dTDel.Text, ASDef._INI_FILE); // 2017.06.08 AVisionProBuild.m_strResultPath = txtPath.Text; AUtil.WritePrivateProfileString("PATH", "ResultPath", txtPath.Text, ASDef._INI_FILE); AUtil.PostMessage(m_hParent, ASDef._WM_LOAD_FILEDEL, 0, 0); // 2015.02.11 string strTxt = "FileDel Change: "; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "OK: " + txtOk.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "NG: " + txtNg.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "TotalOK: " + txtTotalOK.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "TotalNG: " + txtTotalNG.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "LOG: " + txtLog.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); strTxt = "TIME: " + dTDel.Text; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); // 2017.06.08 strTxt = "Path: " + AVisionProBuild.m_strResultPath; AVisionProBuild.WriteLogFile(strTxt, ".Setup.txt"); }
public void Init(bool bNew) { // 2011.06.23 m_pstLimitLow = new ASDef._stRobotShift[ASDef._LIMIT_COUNT]; m_pstLimitHigh = new ASDef._stRobotShift[ASDef._LIMIT_COUNT]; m_pstOffset = new ASDef._stRobotShift[ASDef._OFFSET_COUNT]; StringBuilder sb = new StringBuilder(256); int i; for (i = 0; i < m_nPointCount; ++i) { if (bNew) { // 2018.01.18 by kdi APoint aPoint = new APoint("Point" + i.ToString(), false); m_lstAPoint.Add(aPoint); m_cogtgType.Tools.Add(aPoint.GetToolGroupPoint() as ICogTool); // 2016.06.20 //#if !_USE_1Camera #if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL && !_USE_FLIR && !_USE_1Camera) // 2015.10.02 by kdi. APoint aPoint_Acq = new APoint("Point" + i.ToString(), true); m_cogtgType_Acq.Tools.Add(aPoint_Acq.GetToolGroupPoint() as ICogTool); aPoint.SetAcqFifo(m_cogtgType_Acq.Tools[i] as CogToolGroup); #endif // 2013.02.03 AUtil.GetPrivateProfileString(m_cogtgType.Name, "Point" + i.ToString() + "_FlipRotation", "0", sb, 10, ASDef._INI_FILE); aPoint.m_nFlipRotation = Convert.ToInt32(sb.ToString()); AUtil.WritePrivateProfileString(m_cogtgType.Name, "Point" + i.ToString() + "_FlipRotation", aPoint.m_nFlipRotation.ToString(), ASDef._INI_FILE); // 2018.01.18 by kdi #if _USE_BASLER_PYLON // 2012.01.02 AUtil.GetPrivateProfileString(m_cogtgType.Name, "Dev_Point" + i.ToString(), aPoint.Name, sb, 255, ASDef._INI_FILE); aPoint.m_strDevName = sb.ToString(); //AUtil.WritePrivateProfileString(m_cogtgType.Name, "Dev_Point" + i.ToString(), aPoint.m_strDevName, ASDef._INI_FILE); // 2018.01.18 by kdi #endif } else { APoint aPoint = new APoint(m_cogtgType.Tools[i] as CogToolGroup); // 2016.06.20 //#if !_USE_1Camera #if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL && !_USE_FLIR && !_USE_1Camera) // 2015.10.06 if (m_cogtgType_Acq.Tools.Count > i) { // 2015.10.02 by kdi aPoint.SetAcqFifo(m_cogtgType_Acq.Tools[i] as CogToolGroup); } else { APoint aPoint_Acq = new APoint("Point" + i.ToString(), true); m_cogtgType_Acq.Tools.Add(aPoint_Acq.GetToolGroupPoint() as ICogTool); aPoint.SetAcqFifo(m_cogtgType_Acq.Tools[i] as CogToolGroup); } #endif m_lstAPoint.Add(aPoint); // 2013.02.03 AUtil.GetPrivateProfileString(m_cogtgType.Name, "Point" + i.ToString() + "_FlipRotation", "0", sb, 10, ASDef._INI_FILE); aPoint.m_nFlipRotation = Convert.ToInt32(sb.ToString()); AUtil.WritePrivateProfileString(m_cogtgType.Name, "Point" + i.ToString() + "_FlipRotation", aPoint.m_nFlipRotation.ToString(), ASDef._INI_FILE); /* 2013.04.12 * // 2012.04.24 #if (!_USE_BASLER_PYLON && !_USE_IMAGING_CONTROL) * AAcqFifo aAcqFifo = aPoint.GetTool("AcqFifo", 0) as AAcqFifo; * if (aAcqFifo != null) * { * // 2012.05.08 * if (aAcqFifo.AcqFifoTool.Operator != null) * { * if (aAcqFifo.GetFrameGrabberName().Contains("acA2500")) * { * AIniExposure aIniExposure = new AIniExposure(m_cogtgType.Name, i); * aIniExposure.Read(); * aAcqFifo.Exposure = Convert.ToDouble(aIniExposure.m_nExposure); * } * } * } * #elif _USE_BASLER_PYLON */ // 2018.01.18 by kdi #if _USE_BASLER_PYLON // 2012.01.02 //AUtil.GetPrivateProfileString(m_cogtgType.Name, "Dev_" + aPoint.Name, aPoint.Name, sb, 255, ASDef._INI_FILE); AUtil.GetPrivateProfileString(m_cogtgType.Name, "Dev_Point" + i.ToString(), aPoint.Name, sb, 255, ASDef._INI_FILE); aPoint.m_strDevName = sb.ToString(); //AUtil.WritePrivateProfileString(m_cogtgType.Name, "Dev_" + aPoint.Name, aPoint.m_strDevName, ASDef._INI_FILE); // 2016.09.30 by kdi AUtil.GetPrivateProfileString(m_cogtgType.Name, "Point" + i.ToString() + "_PixelFormat", "Mono 8", sb, 100, ASDef._INI_FILE); aPoint.m_strPixelFormat = sb.ToString(); // 2018.01.18 by kdi #endif } } for (i = 0; i < ASDef._OFFSET_COUNT; ++i) { ReadIniOffset(i); } // 2011.06.23 for (i = 0; i < ASDef._LIMIT_COUNT; ++i) { ReadIniLimit(i); } ReadIniPlcToPc(); // 2014.11.04 ReadIniUse(); }