#include "StdAfx.h" #include "ResultFile.h" CResultFile::CResultFile(void) { m_pCurResult = NULL; m_bCut = m_bCorner = m_bDim = m_bSpline = m_bNotch = FALSE; } CResultFile::CResultFile(CResultData *pResult) { m_bMakeResultFile = TRUE; m_gBase = g_pBase; m_pCurResult = pResult; if(m_pCurResult == NULL) { g_pLog->DisplayMessage(_T("Result Data Fail! : CurGlass is NULL")); m_bMakeResultFile = FALSE; } if(m_gBase->m_strHPanelID.IsEmpty() == TRUE) { g_pLog->DisplayMessage(_T("Result Data Fail! : No PanelID")); m_bMakeResultFile = FALSE; } } CResultFile::~CResultFile(void) { } void CResultFile::SetInsParm(BOOL bCut,BOOL bCorner,BOOL bDim,BOOL bSpline,BOOL bNotch) { m_bCut = bCut; m_bCorner = bCorner; m_bDim = bDim; m_bSpline = bSpline; m_bNotch = bNotch; } BOOL CResultFile::MakeResultFile(CString strFolder,CString strFolder_Notch,BOOL bFinalResult)//20140528 { if(m_bMakeResultFile == FALSE || m_pCurResult == NULL) return FALSE; CString strGlassID,strPath; CString strContents,strValue; CStdioFile *pFile = NULL; CFileException ex; CString strHostID; CString strContents_Notch, strPath_Notch;//20140528 CStdioFile *pFile_Notch = NULL;//20140528 CFileException ex_Notch;//20140528 strGlassID = m_gBase->m_strHPanelID; strPath.Format(_T("%s\\%s.csv"),strFolder,strGlassID); strPath_Notch.Format(_T("%s\\%s.csv"),strFolder_Notch,strGlassID);//20140528 pFile = new CStdioFile(); if (!pFile->Open(strPath, CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite|CFile::shareDenyWrite, &ex)) { #ifdef _DEBUG TCHAR szCause[255] = {0}; ex.GetErrorMessage(szCause, 255); g_pLog->DisplayMessage(_T("Result Data Fail! : File Open Fail[%s]"),szCause); #endif if (pFile) delete pFile,pFile = NULL; } pFile_Notch = new CStdioFile();//20140528 if (!pFile_Notch->Open(strPath_Notch, CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite|CFile::shareDenyWrite, &ex_Notch))//20140528 { #ifdef _DEBUG TCHAR szCause[255] = {0}; ex_Notch.GetErrorMessage(szCause, 255); g_pLog->DisplayMessage(_T("Result Notch Data Fail! : File Open Fail[%s]"),szCause); #endif if (pFile_Notch) delete pFile_Notch,pFile_Notch = NULL; } BOOL bResult;//20140528 bResult = MakeResultRaw(strContents,strContents_Notch,m_bCorner);//20140528 if(strContents.GetLength() > 0 && pFile != NULL) pFile->WriteString(strContents); if (pFile && pFile->m_hFile != CFile::hFileNull) pFile->Close(); if (pFile) delete pFile,pFile = NULL; if(strContents_Notch.GetLength() > 0 && pFile_Notch != NULL)//20140528 pFile_Notch->WriteString(strContents_Notch); if (pFile_Notch && pFile_Notch->m_hFile != CFile::hFileNull) //20140528 pFile_Notch->Close(); if (pFile_Notch) //20140528 delete pFile_Notch,pFile_Notch = NULL; return bResult; } void CResultFile::MakeChamferResult(CString &strContents,BOOL bCornerIns) { double *dRangeVal,dCutAvg; BOOL bResult; CString strResult,strValue; bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_TOP][DIMENSION_A]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_A]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_TOP][DIMENSION_A][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountCF < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG"); //20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Upper APos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Upper APos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Upper APos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[1]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountCF);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_BOTTOM][DIMENSION_A]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_A]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_BOTTOM][DIMENSION_A][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Lower APos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Lower APos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Lower APos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[2]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountTFT);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_TOP][DIMENSION_B]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_B]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_TOP][DIMENSION_B][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountCF < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Upper BPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Upper BPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Upper BPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[3]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountCF);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_BOTTOM][DIMENSION_B]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_B]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_BOTTOM][DIMENSION_B][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Lower BPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Lower BPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Lower BPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[4]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountTFT);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_TOP][DIMENSION_C]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_C]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_TOP][DIMENSION_C][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Upper CPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Upper CPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Upper CPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[5]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountCF);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_BOTTOM][DIMENSION_C]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_C]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_BOTTOM][DIMENSION_C][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Lower CPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Lower CPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Lower CPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[6]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountTFT);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_TOP][DIMENSION_D]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_D]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_TOP][DIMENSION_D][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Upper DPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Upper DPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Upper DPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[7]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountCF);//20140603 bResult = m_pCurResult->m_bCutAreaRes[CAMDIR_BOTTOM][DIMENSION_D]; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_D]; dRangeVal = &m_pCurResult->m_dCutAreaPoint[CAMDIR_BOTTOM][DIMENSION_D][0]; // if(bCornerIns == TRUE && m_pCurResult->m_nErrorCountTFT < MAX_ERROR_COUNT) strResult = _T("OK");//20140603 if(bResult == FALSE)//20140603 strResult = _T("NG"); else if(bResult == TRUE) strResult = _T("OK"); // else strResult = _T("NG");//20140603 if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Chamfer Lower DPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Chamfer Lower DPos]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dCutAvg,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); else strValue.Format(_T("[Chamfer Lower DPos]\r\n*\r\n")); strContents += strValue; g_pLog->DisplayMessage(_T("[8]bResult,dCutAvg,dRangeVal %d, %d,%d,%d"),bResult,dCutAvg,dRangeVal,m_pCurResult->m_nErrorCountTFT);//20140603 if(m_bCut == TRUE) { dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_A]; strValue.Format(_T("[Chamfer Upper APos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_A]; strValue.Format(_T("[Chamfer Lower APos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_B]; strValue.Format(_T("[Chamfer Upper BPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_B]; strValue.Format(_T("[Chamfer Lower BPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_C]; strValue.Format(_T("[Chamfer Upper CPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_C]; strValue.Format(_T("[Chamfer Lower CPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_TOP][DIMENSION_D]; strValue.Format(_T("[Chamfer Upper DPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; dCutAvg = m_pCurResult->m_dCutAreaAvg[CAMDIR_BOTTOM][DIMENSION_D]; strValue.Format(_T("[Chamfer Lower DPos Specific Area]\r\n%.3f\r\n"),dCutAvg); strContents += strValue; } else { strValue.Format(_T("[Chamfer Upper APos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Lower APos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Upper BPos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Lower BPos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Upper CPos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Lower CPos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Upper DPos Specific Area]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Chamfer Lower DPos Specific Area]\r\n*\r\n")); strContents += strValue; } } void CResultFile::MakeChamferDiagonalLineResult(CString &strContents)//20140622 { double dDiagonalLineValue; BOOL bResult; CString strResult,strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_A]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_A]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Upper APos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Upper APos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Upper APos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_A]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_A]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Lower APos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Lower APos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Lower APos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_B]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_B]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Upper BPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Upper BPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Upper BPos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_B]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_B]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Lower BPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Lower BPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Lower BPos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_C]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_C]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Upper CPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Upper CPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Upper CPos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_C]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_C]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Lower CPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Lower CPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Lower CPos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_D]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_TOP][DIMENSION_D]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Upper DPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Upper DPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Upper DPos]\r\n*\r\n")); strContents += strValue; bResult = m_pCurResult->m_bCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_D]; dDiagonalLineValue = m_pCurResult->m_dCutAreaDiagonalLine[CAMDIR_BOTTOM][DIMENSION_D]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); if(m_bCut == FALSE) strResult = _T("*"); strValue.Format(_T("[Diagonal Line Ins Lower DPos Result]\r\n%s\r\n"),strResult); strContents += strValue; if(m_bCut == TRUE) strValue.Format(_T("[Diagonal Line Ins Lower DPos]\r\n%.3f\r\n"),dDiagonalLineValue); else strValue.Format(_T("[Diagonal Line Ins Lower DPos]\r\n*\r\n")); strContents += strValue; } void CResultFile::MakeDimensionResult(CString &strContents,BOOL bCornerIns) { double *dRangeVal; BOOL bResult; CString strResult,strValue; double dAvgDimen; if(m_bDim == TRUE) { dRangeVal = &m_pCurResult->m_dDimensionPoint[DIMENSION_A][0]; bResult = m_pCurResult->m_bDimensionRes[DIMENSION_A]; dAvgDimen = m_pCurResult->m_dDimensionAvg[DIMENSION_A]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Dimension APos Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Dimension APos Size]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dAvgDimen,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dRangeVal = &m_pCurResult->m_dDimensionPoint[DIMENSION_B][0]; bResult = m_pCurResult->m_bDimensionRes[DIMENSION_B]; dAvgDimen = m_pCurResult->m_dDimensionAvg[DIMENSION_B]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Dimension BPos Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Dimension BPos Size]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dAvgDimen,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dRangeVal = &m_pCurResult->m_dDimensionPoint[DIMENSION_C][0]; bResult = m_pCurResult->m_bDimensionRes[DIMENSION_C]; dAvgDimen = m_pCurResult->m_dDimensionAvg[DIMENSION_C]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Dimension CPos Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Dimension CPos Size]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dAvgDimen,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dRangeVal = &m_pCurResult->m_dDimensionPoint[DIMENSION_D][0]; bResult = m_pCurResult->m_bDimensionRes[DIMENSION_D]; dAvgDimen = m_pCurResult->m_dDimensionAvg[DIMENSION_D]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Dimension DPos Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Dimension DPos Size]\r\n%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dAvgDimen,dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; } else { strValue.Format(_T("[Dimension APos Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension APos Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension BPos Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension BPos Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension CPos Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension CPos Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension DPos Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Dimension DPos Size]\r\n*\r\n")); strContents += strValue; } } void CResultFile::MakeSplineResult(CString &strContents) { double dSpline,*dSpMaxDefect; double *dRangeVal; BOOL bResult; CString strResult,strValue; if(m_bSpline == TRUE) { dSpMaxDefect = m_pCurResult->m_dSplineMaxDefect; dSpline = m_pCurResult->m_dSplineAvg[1][1]; // Left ÇϺΠbResult = m_pCurResult->m_bSplineRes[1][1]; dRangeVal = &m_pCurResult->m_dSplinePoint[1][1][0]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Spline CCut Left Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Spline CCut Left Size]\r\n%.3f\r\n"),dSpline); strContents += strValue; strValue.Format(_T("[Spline CCut Left MaxDefect]\r\n%.3f\r\n"),dSpMaxDefect[0]); strContents += strValue; strValue.Format(_T("[Spline CCut Left Range]\r\n%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dSpline = m_pCurResult->m_dSplineAvg[1][0]; // Left »óºÎ bResult = m_pCurResult->m_bSplineRes[1][0]; dRangeVal = &m_pCurResult->m_dSplinePoint[1][0][0]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Spline CCut Right Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Spline CCut Right Size]\r\n%.3f\r\n"),dSpline); strContents += strValue; strValue.Format(_T("[Spline CCut Right MaxDefect]\r\n%.3f\r\n"),dSpMaxDefect[1]); strContents += strValue; strValue.Format(_T("[Spline CCut Right Range]\r\n%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dSpline = m_pCurResult->m_dSplineAvg[0][1]; // Right »óºÎ bResult = m_pCurResult->m_bSplineRes[0][1]; dRangeVal = &m_pCurResult->m_dSplinePoint[0][1][0]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Spline RCut Left Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Spline RCut Left Size]\r\n%.3f\r\n"),dSpline); strContents += strValue; strValue.Format(_T("[Spline RCut Left MaxDefect]\r\n%.3f\r\n"),dSpMaxDefect[2]); strContents += strValue; strValue.Format(_T("[Spline RCut Left Range]\r\n%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; dSpline = m_pCurResult->m_dSplineAvg[0][0]; // Right ÇϺΠbResult = m_pCurResult->m_bSplineRes[0][0]; dRangeVal = &m_pCurResult->m_dSplinePoint[0][0][0]; if(bResult == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Spline RCut Right Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Spline RCut Right Size]\r\n%.3f\r\n"),dSpline); strContents += strValue; strValue.Format(_T("[Spline RCut Right MaxDefect]\r\n%.3f\r\n"),dSpMaxDefect[3]); strContents += strValue; strValue.Format(_T("[Spline RCut Right Range]\r\n%.3f,%.3f,%.3f,%.3f,%.3f\r\n"),dRangeVal[0],dRangeVal[1],dRangeVal[2],dRangeVal[3],dRangeVal[4]); strContents += strValue; } else { strValue.Format(_T("[Spline CCut Left Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Left Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Left MaxDefect]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Left Range]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Right Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Right Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Right MaxDefect]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline CCut Right Range]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Left Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Left Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Left MaxDefect]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Left Range]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Right Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Right Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Right MaxDefect]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Spline RCut Right Range]\r\n*\r\n")); strContents += strValue; } } void CResultFile::MakeCornerResult(CString &strContents) { ////////////////////////////////////////////////////////////////////////// // Corner CString strResult,strValue; if(m_bCorner == TRUE) { BOOL bResultWidth = m_pCurResult->m_bCornerResWidth[1][1]; double dCornerWidth = m_pCurResult->m_dCornerWidth[1][1]; BOOL bResultHeight = m_pCurResult->m_bCornerResHeight[1][1]; double dCornerHeight = m_pCurResult->m_dCornerHeight[1][1]; if(bResultWidth == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Left Upper Width Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Left Upper Width Size]\r\n%.3f\r\n"),dCornerWidth); strContents += strValue; if(bResultHeight == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Left Upper Height Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Left Upper Height Size]\r\n%.3f\r\n"),dCornerHeight); strContents += strValue; bResultWidth = m_pCurResult->m_bCornerResWidth[1][0]; dCornerWidth = m_pCurResult->m_dCornerWidth[1][0]; bResultHeight = m_pCurResult->m_bCornerResHeight[1][0]; dCornerHeight = m_pCurResult->m_dCornerHeight[1][0]; if(bResultWidth == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Right Upper Width Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Right Upper Width Size]\r\n%.3f\r\n"),dCornerWidth); strContents += strValue; if(bResultHeight == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Right Upper Height Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Right Upper Height Size]\r\n%.3f\r\n"),dCornerHeight); strContents += strValue; bResultWidth = m_pCurResult->m_bCornerResWidth[0][1]; dCornerWidth = m_pCurResult->m_dCornerWidth[0][1]; bResultHeight = m_pCurResult->m_bCornerResHeight[0][1]; dCornerHeight = m_pCurResult->m_dCornerHeight[0][1]; if(bResultWidth == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Left Lower Width Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Left Lower Width Size]\r\n%.3f\r\n"),dCornerWidth); strContents += strValue; if(bResultHeight == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Left Lower Height Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Left Lower Height Size]\r\n%.3f\r\n"),dCornerHeight); strContents += strValue; bResultWidth = m_pCurResult->m_bCornerResWidth[0][0]; dCornerWidth = m_pCurResult->m_dCornerWidth[0][0]; bResultHeight = m_pCurResult->m_bCornerResHeight[0][0]; dCornerHeight = m_pCurResult->m_dCornerHeight[0][0]; if(bResultWidth == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Right Lower Width Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Right Lower Width Size]\r\n%.3f\r\n"),dCornerWidth); strContents += strValue; if(bResultHeight == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Corner Right Lower Height Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Corner Right Lower Height Size]\r\n%.3f\r\n"),dCornerHeight); strContents += strValue; } else { strValue.Format(_T("[Corner Left Upper Width Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Upper Width Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Upper Height Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Upper Height Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Upper Width Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Upper Width Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Upper Height Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Upper Height Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Lower Width Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Lower Width Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Lower Height Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Left Lower Height Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Lower Width Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Lower Width Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Lower Height Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Corner Right Lower Height Size]\r\n*\r\n")); strContents += strValue; } } void CResultFile::MakeNotchResult(CString &strContents) { //////////////////// double dNotchAvgThick = 0.; BOOL bNotchAvgThick = FALSE; CString strResult,strValue; if(m_bNotch == TRUE) { dNotchAvgThick = m_pCurResult->m_dNCutThick[CAMDIR_TOP]; bNotchAvgThick = m_pCurResult->m_bNCutThick[CAMDIR_TOP]; if(bNotchAvgThick == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Notch Chamfer Top Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Notch Chamfer Top]\r\n%.3f\r\n"),dNotchAvgThick); strContents += strValue; dNotchAvgThick = m_pCurResult->m_dNCutThick[CAMDIR_BOTTOM]; bNotchAvgThick = m_pCurResult->m_bNCutThick[CAMDIR_BOTTOM]; if(bNotchAvgThick == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Notch Chamfer Bottom Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Notch Chamfer Bottom]\r\n%.3f\r\n"),dNotchAvgThick); strContents += strValue; double dNotch=0.; BOOL bNotch = FALSE; dNotch = m_pCurResult->m_dNCutAvg[CAMDIR_TOP]; bNotch = m_pCurResult->m_bNCutSize[CAMDIR_TOP]; if(bNotch == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Notch Top Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Notch Top Size]\r\n%.3f\r\n"),dNotch); strContents += strValue; dNotch = m_pCurResult->m_dNCutAvg[CAMDIR_BOTTOM]; bNotch = m_pCurResult->m_bNCutSize[CAMDIR_BOTTOM]; if(bNotch == TRUE) strResult = _T("OK"); else strResult = _T("NG"); strValue.Format(_T("[Notch Bottom Result]\r\n%s\r\n"),strResult); strContents += strValue; strValue.Format(_T("[Notch Bottom Size]\r\n%.3f\r\n"),dNotch); strContents += strValue; strValue.Format(_T("[Notch Dx Size]\r\n%d,%d,%d,%d\r\n"),(int)m_pCurResult->m_dNCutX[DIMENSION_A],(int)m_pCurResult->m_dNCutX[DIMENSION_B] ,(int)m_pCurResult->m_dNCutX[DIMENSION_C],(int)m_pCurResult->m_dNCutX[DIMENSION_D]); strContents += strValue; strValue.Format(_T("[Notch Dy Size]\r\n%d,%d,%d,%d\r\n"),(int)m_pCurResult->m_dNCutY[DIMENSION_A],(int)m_pCurResult->m_dNCutY[DIMENSION_B] ,(int)m_pCurResult->m_dNCutY[DIMENSION_C],(int)m_pCurResult->m_dNCutY[DIMENSION_D]); strContents += strValue; CString strTmp,strPosTmp[3],strPos[3]; for(int iDim=0;iDimm_pointIMG[0][iDim][iR].x);//20140528 strPosTmp[1].Format(_T("%d,"),m_pCurResult->m_pointIMG[0][iDim][iR].y);//20140528 strPosTmp[2].Format(_T("%.2f,"),m_pCurResult->m_dNCutRange[0][iDim][iR]);//20140528 } else { strPosTmp[0].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG[0][iDim][iR].x);//20140528 strPosTmp[1].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG[0][iDim][iR].y);//20140528 strPosTmp[2].Format(_T("%.2f\r\n"),m_pCurResult->m_dNCutRange[0][iDim][iR]);//20140528 } strPos[0] += strPosTmp[0]; strPos[1] += strPosTmp[1]; strPos[2] += strPosTmp[2]; } switch(iDim) { case 0: strTmp="A"; break; case 1: strTmp="B"; break; case 2: strTmp="C"; break; case 3: strTmp="D"; break; } strValue.Format(_T("[%s Notch Range Position X]\r\n"),strTmp); strContents += strValue; strContents += strPos[0]; strValue.Format(_T("[%s Notch Range Position Y]\r\n"),strTmp); strContents += strValue; strContents += strPos[1]; strValue.Format(_T("[%s Notch Range Value]\r\n"),strTmp); strContents += strValue; strContents += strPos[2]; } } else { strValue.Format(_T("[Notch Chamfer Top Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Chamfer Top]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Chamfer Bottom Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Chamfer Bottom]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Top Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Top Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Bottom Result]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Bottom Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Dx Size]\r\n*\r\n")); strContents += strValue; strValue.Format(_T("[Notch Dy Size]\r\n*\r\n")); strContents += strValue; CString strTmp,strPosTmp[3],strPos[3]; for(int iDim=0;iDimm_nNotchInsCount[iDim];iR++) { if(iR != m_pCurResult->m_nNotchInsCount[iDim]-1) { strPosTmp[0].Format(_T("%d,"),m_pCurResult->m_pointIMG[0][iDim][iR].x); strPosTmp[1].Format(_T("%d,"),m_pCurResult->m_pointIMG[0][iDim][iR].y); strPosTmp[2].Format(_T("%.2f,"),m_pCurResult->m_dNCutRange[0][iDim][iR]); strPosTmp[3].Format(_T("%.2f,"),m_pCurResult->m_dNCutRange_Cham[0][iDim][iR]); strPosTmp[4].Format(_T("%.2f,"),m_pCurResult->m_dNCutRange_Cham[1][iDim][iR]); strPosTmp[5].Format(_T("%d,"),m_pCurResult->m_pointIMG_Dy[0][iDim][iR].x); strPosTmp[6].Format(_T("%d,"),m_pCurResult->m_pointIMG_Dy[0][iDim][iR].y); strPosTmp[7].Format(_T("%.2f,"),m_pCurResult->m_dNCutRange_Dy[0][iDim][iR]); } else { strPosTmp[0].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG[0][iDim][iR].x); strPosTmp[1].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG[0][iDim][iR].y); strPosTmp[2].Format(_T("%.2f\r\n"),m_pCurResult->m_dNCutRange[0][iDim][iR]); strPosTmp[3].Format(_T("%.2f\r\n"),m_pCurResult->m_dNCutRange_Cham[0][iDim][iR]); strPosTmp[4].Format(_T("%.2f\r\n"),m_pCurResult->m_dNCutRange_Cham[1][iDim][iR]); strPosTmp[5].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG_Dy[0][iDim][iR].x); strPosTmp[6].Format(_T("%d\r\n"),m_pCurResult->m_pointIMG_Dy[0][iDim][iR].y); strPosTmp[7].Format(_T("%.2f\r\n"),m_pCurResult->m_dNCutRange_Dy[0][iDim][iR]); } strPos[0] += strPosTmp[0]; strPos[1] += strPosTmp[1]; strPos[2] += strPosTmp[2]; strPos[3] += strPosTmp[3]; strPos[4] += strPosTmp[4]; strPos[5] += strPosTmp[5]; strPos[6] += strPosTmp[6]; strPos[7] += strPosTmp[7]; bNCutRangeDim &= m_pCurResult->m_bNCutRange[0][iDim][iR]; bNCutRangeChamTop &= m_pCurResult->m_bNCutRange_Cham[0][iDim][iR]; bNCutRangeChamBot &= m_pCurResult->m_bNCutRange_Cham[1][iDim][iR]; } switch(iDim) { case 0: strTmp="A"; break; case 1: strTmp="B"; break; case 2: strTmp="C"; break; case 3: strTmp="D"; break; } strValue.Format(_T("[%s Notch Range Count]\r\n"),strTmp); strContents += strValue; strInsCount.Format(_T("%d\r\n"),m_pCurResult->m_nNotchInsCount[iDim]); strContents += strInsCount; strValue.Format(_T("[%s Notch Range Position X]\r\n"),strTmp); strContents += strValue; strContents += strPos[0]; strValue.Format(_T("[%s Notch Range Position Y]\r\n"),strTmp); strContents += strValue; strContents += strPos[1]; if(bNCutRangeDim == TRUE) strResult = _T("OK\r\n"); else strResult = _T("NG\r\n"); strValue.Format(_T("[%s Notch Range Dimension Result]\r\n"),strTmp); strContents += strValue; strContents += strResult; strValue.Format(_T("[%s Notch Range Dimension Value]\r\n"),strTmp); strContents += strValue; strContents += strPos[2]; if(bNCutRangeChamTop == TRUE) strResult = _T("OK\r\n"); else strResult = _T("NG\r\n"); strValue.Format(_T("[%s Notch Range Chamfer Top Result]\r\n"),strTmp); strContents += strValue; strContents += strResult; strValue.Format(_T("[%s Notch Range Chamfer Top Value]\r\n"),strTmp); strContents += strValue; strContents += strPos[3]; if(bNCutRangeChamBot == TRUE) strResult = _T("OK\r\n"); else strResult = _T("NG\r\n"); strValue.Format(_T("[%s Notch Range Chamfer Bot Result]\r\n"),strTmp); strContents += strValue; strContents += strResult; strValue.Format(_T("[%s Notch Range Chamfer Bot Value]\r\n"),strTmp); strContents += strValue; strContents += strPos[4]; strValue.Format(_T("[%s Notch Range Position X_Dy]\r\n"),strTmp); strContents += strValue; strContents += strPos[5]; strValue.Format(_T("[%s Notch Range Position Y_Dy]\r\n"),strTmp); strContents += strValue; strContents += strPos[6]; strValue.Format(_T("[%s Notch Range Dimension Value_Dy]\r\n"),strTmp); strContents += strValue; strContents += strPos[7]; } } else { for(int iDim=0;iDimm_dGlassSize[0]); strContents += strValue; strValue.Format(_T("[Glass Size Y]\r\n%.3f\r\n"),m_pCurResult->m_dGlassSize[1]); strContents += strValue; strValue.Format(_T("[A Left Line Margin]\r\n")); strContents += strValue; strValue.Format(_T("%d,%d\r\n"),m_pCurResult->m_nLeftLineMargin[0],m_pCurResult->m_nLeftLineMargin[1]); strContents += strValue; strValue.Format(_T("[B Left Line Margin]\r\n")); strContents += strValue; strValue.Format(_T("%d,%d\r\n"),m_pCurResult->m_nLeftLineMargin[2],m_pCurResult->m_nLeftLineMargin[3]); strContents += strValue; strValue.Format(_T("[C Left Line Margin]\r\n")); strContents += strValue; strValue.Format(_T("%d,%d\r\n"),m_pCurResult->m_nLeftLineMargin[4],m_pCurResult->m_nLeftLineMargin[5]); strContents += strValue; strValue.Format(_T("[D Left Line Margin]\r\n")); strContents += strValue; strValue.Format(_T("%d,%d\r\n"),m_pCurResult->m_nLeftLineMargin[6],m_pCurResult->m_nLeftLineMargin[7]); strContents += strValue; } BOOL CResultFile::MakeResultRaw(CString &strContents, CString &strContents_Notch, BOOL bCornerIns)//20140528 { CString strValue; strValue.Format(_T("[Host ID]\r\n%s\r\n"),m_gBase->m_strHPanelID); strContents += strValue; strValue.Format(_T("[Start Date]\r\n%s\r\n"),(m_pCurResult->m_strScanStartTime).Left(8)); strContents += strValue; strValue.Format(_T("[Start Time]\r\n%s\r\n"),(m_pCurResult->m_strScanStartTime).Mid(9,6)); strContents += strValue; strValue.Format(_T("[End Date]\r\n%s\r\n"),(m_pCurResult->m_strScanEndTime).Left(8)); strContents += strValue; strValue.Format(_T("[End Time]\r\n%s\r\n"),(m_pCurResult->m_strScanEndTime).Mid(9,6)); strContents += strValue; strValue.Format(_T("[Recipe Name]\r\n%s\r\n"),m_pCurResult->m_strRecipeName); strContents += strValue; CString strMachine = _T("RCut Machine"); strValue.Format(_T("[Machine Name]\r\n%s\r\n"),strMachine); strContents += strValue; strContents_Notch = strContents;//20140528 MakeChamferResult(strContents,bCornerIns); MakeChamferDiagonalLineResult(strContents);//20140622 MakeDimensionResult(strContents,bCornerIns); MakeSplineResult(strContents); MakeCornerResult(strContents); MakeNotchResult(strContents); MakeEtcResult(strContents); MakeDefectRaw(strContents); MakeNotchInsPointResult(strContents_Notch);//20140528 return TRUE; } void CResultFile::MakeDefectRaw(CString &strContents) { if(m_pCurResult->m_pDefectIns == NULL || m_pCurResult->m_nDefectCnt <= 0) return; CString strValue,strTmp; strValue.Format(_T("[Information of Detections]\r\n")); strContents += strValue; int iDefect = 0; CInspectDefect *pDefect; DimensionDir emDir; MapDefectIt it; for(it=m_pCurResult->m_pDefectIns->begin();it!=m_pCurResult->m_pDefectIns->end();it++,iDefect++) { pDefect = static_cast(it->second); if(pDefect == NULL) continue; strValue.Format(_T("%d,"),iDefect); strContents += strValue; emDir = (DimensionDir)pDefect->m_nSideLoc; strContents += PANEL_SIDE[emDir]; if(pDefect->m_nCameraDir == 0) strValue = _T("Top,"); else strValue = _T("Bot,"); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nUMOriginX); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nUMOriginY); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nUMSize); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_sDefectPeak); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nUMSizeX); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nUMSizeY); strContents += strValue; strValue.Format(_T("%d,"),pDefect->m_nDefectRScale); strContents += strValue; switch(pDefect->m_sDefectLoc) { case 0: strValue.Format(_T("Crack")); break; case 1: strValue.Format(_T("Broken")); break; case 2: strValue.Format(_T("Chip")); break; case 3: strValue.Format(_T("Chamfer")); break; case 4: strValue.Format(_T("Burr")); break; case 5: strValue.Format(_T("Thin")); break; case 6: strValue.Format(_T("Area")); break; case 7: strValue.Format(_T("NCut")); break; case 8: strValue.Format(_T("CCD Hole")); break; case 9: strValue.Format(_T("Profile")); break; default: strValue.Format(_T("Unknown")); break; } strContents += strValue; strContents += _T(",\r\n"); } }