// RMMInfoWriter.cpp : 구현 파일입니다.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewRecipeEditor.h"
|
#include "RMMInfoWriter.h"
|
#include <fstream>
|
|
using namespace std;
|
|
// CRMMInfoWriter
|
|
IMPLEMENT_DYNAMIC(CRMMInfoWriter, CWnd)
|
|
CRMMInfoWriter::CRMMInfoWriter()
|
{
|
m_vecRcpRsReviewManager.clear();
|
}
|
|
CRMMInfoWriter::~CRMMInfoWriter()
|
{
|
}
|
|
|
BEGIN_MESSAGE_MAP(CRMMInfoWriter, CWnd)
|
END_MESSAGE_MAP()
|
|
|
|
BOOL CRMMInfoWriter::WriteRmm(int nMachineType)
|
{
|
BOOL retVal = TRUE;
|
m_vecRcpRsReviewManager.clear();
|
|
retVal = ReadAllRecipes();
|
|
if (retVal == TRUE)
|
{
|
retVal = WriteRmmFile(nMachineType);
|
}
|
|
return retVal;
|
}
|
|
BOOL CRMMInfoWriter::ReadAllRecipes()
|
{ // private function
|
CString strSearchPath;
|
BOOL bReturn = FALSE;
|
CFileFind finder;
|
BOOL wrongRecipe = FALSE;
|
CString strRecipeName;
|
|
strSearchPath.Format(_T("%s\\*.rcp"), _REVIEW_RECIPE_PATH_);
|
|
bReturn = finder.FindFile(strSearchPath);
|
while(bReturn)
|
{
|
wrongRecipe = FALSE;
|
bReturn = finder.FindNextFile();
|
if(finder.IsDots()) continue;
|
if(finder.IsDirectory()) continue;
|
|
strRecipeName = finder.GetFileTitle();
|
if (strRecipeName.GetLength() < 0)
|
{ // 파일 사이즈가 3 초과일 경우 실패!
|
wrongRecipe = TRUE;
|
}
|
else
|
{
|
for (int i = 0; i < strRecipeName.GetLength(); i++)
|
{
|
//if (strRecipeName.GetAt(i) < '0' || strRecipeName.GetAt(i) > '9')
|
//{ // 파일 이름에 숫자가 아니면 실패
|
// wrongRecipe = TRUE;
|
// break;
|
//}
|
}
|
}
|
if (wrongRecipe == TRUE)
|
{ // 혹시 default인가?
|
if (strRecipeName != _T("Default"))
|
continue;
|
}
|
|
ReadOneRecipe(strRecipeName);
|
}
|
return TRUE;
|
}
|
|
BOOL CRMMInfoWriter::ReadOneRecipe( CString RecipeName )
|
{
|
CString strOneRecipeFile;
|
BOOL bReturn = TRUE;
|
|
|
strOneRecipeFile.Format(_T("%s\\%s.rcp"), _REVIEW_RECIPE_PATH_, RecipeName);
|
|
CMacroFile macroFile;
|
macroFile.Clear();
|
CRcp_RsReviewManager currentReadRecipeManager;
|
if (FALSE == macroFile.Read(strOneRecipeFile))
|
{
|
TRACE(_T("CRecipeEditorDlg::ReadRecipeFile() fail to read recipe file\n"));
|
bReturn = FALSE;
|
}
|
else
|
{
|
currentReadRecipeManager.GetProfile(macroFile);
|
|
//
|
// if(m_pRsMeasureManager)
|
// {
|
// m_pRsMeasureManager->GetProfile(macroFile);
|
// }
|
//
|
// if(m_pRsAlignManager)
|
// {
|
// m_pRsAlignManager->GetProfile(macroFile);
|
// }
|
//
|
// if(m_pRsDefectFindManager)
|
// {
|
// m_pRsDefectFindManager->GetProfile(macroFile);
|
// }
|
}
|
CRsRcpReviewInfo* prsRcpReviewInfo = currentReadRecipeManager.GetRsRcpReviewInfo();
|
prsRcpReviewInfo->m_strRecipeName = RecipeName; // Recipe Name 기입
|
|
m_vecRcpRsReviewManager.push_back(currentReadRecipeManager);
|
return bReturn;
|
|
|
return TRUE;
|
}
|
|
BOOL CRMMInfoWriter::WriteRmmFile(int nMachineType)
|
|
//2,5
|
|
{ // private function
|
CString strLine;
|
ofstream outFile;
|
BOOL retVal = TRUE;
|
|
outFile.open(_WRITE_RMM_FILE_,ios_base::out);
|
|
strLine.Format(_T("[EQP_PARAM_INFO]"));
|
outFile << strLine << endl;
|
|
|
if(nMachineType==0){
|
strLine.Format(_T("COUNT=%d"),12);
|
outFile << strLine << endl;
|
|
for (int i = 0; i <12; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,CRACK[i]);
|
outFile << strLine << endl;
|
}
|
}
|
if(nMachineType==1){
|
strLine.Format(_T("COUNT=%d"),12);
|
outFile << strLine << endl;
|
|
for (int i = 0; i <12; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,IJP[i]);
|
outFile << strLine << endl;
|
}
|
}
|
if(nMachineType==2){
|
strLine.Format(_T("COUNT=%d"),7);
|
outFile << strLine << endl;
|
|
for (int i = 0; i <7; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,TFE[i]);
|
outFile << strLine << endl;
|
}
|
}
|
if(nMachineType==3){
|
strLine.Format(_T("COUNT=%d"),12);
|
outFile << strLine << endl;
|
for (int i = 0; i <12; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,LAMI[i]);
|
outFile << strLine << endl;
|
}
|
|
|
}
|
if(nMachineType==4){
|
strLine.Format(_T("COUNT=%d"),6);
|
outFile << strLine << endl;
|
for (int i = 0; i <6; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,HCUT[i]);
|
outFile << strLine << endl;
|
}
|
}
|
if(nMachineType==5){
|
strLine.Format(_T("COUNT=%d"),7);
|
outFile << strLine << endl;
|
for (int i = 0; i <7; i++)
|
{
|
strLine.Format(_T("PARAM_NAME_%04d=%s"),i,TFEOFF[i]);
|
outFile << strLine << endl;
|
}
|
|
}
|
|
|
|
strLine.Format(_T("[RECIPE_INFO]"));
|
outFile << strLine << endl;
|
strLine.Format(_T("COUNT=%d"),m_vecRcpRsReviewManager.size());
|
outFile << strLine << endl;
|
|
CRsRcpReviewInfo* pRsRcpReviewInfo;
|
|
for (unsigned int i = 0; i< m_vecRcpRsReviewManager.size(); i++)
|
{
|
pRsRcpReviewInfo = m_vecRcpRsReviewManager[i].GetRsRcpReviewInfo();
|
|
|
|
CRcpSchedulingInfo* pRcpSchedulingInfo = pRsRcpReviewInfo->GetRcpSchedulingInfo();
|
|
int wsipoint = pRcpSchedulingInfo->GetMaxWsiPointCount();
|
if(pRsRcpReviewInfo->m_strRecipeName == _T("Default")){
|
continue;
|
}
|
|
strLine.Format(_T("[%s]"),pRsRcpReviewInfo->m_strRecipeName);
|
outFile << strLine << endl;
|
|
if(nMachineType == 5 || nMachineType == 2)
|
{
|
strLine.Format(_T("WSI_COUNT=%d"),wsipoint);
|
outFile << strLine << endl;
|
}
|
|
strLine.Format(_T("REVIEW_PLAN=%d"), pRsRcpReviewInfo->GetRcpPlanInfoCount()); //
|
outFile << strLine << endl;
|
|
strLine.Format(_T("REVIEW_COUNT=%d"), pRsRcpReviewInfo->GetRcpSchedulingInfo()->GetMaxPointCount());
|
outFile << strLine << endl;
|
|
if(pRsRcpReviewInfo->GetRcpLightInfoCount() != 0)
|
{
|
strLine.Format(_T("REVIEW_LIGHT_LEVEL=%d"), pRsRcpReviewInfo->GetRcpLightInfo(0)->m_nLightLevel);
|
outFile << strLine << endl;
|
|
strLine.Format(_T("REVIEW_LIGHT_MIN_LEVEL=%d"), pRsRcpReviewInfo->GetRcpLightInfo(0)->m_nMinThresLevel);
|
outFile << strLine << endl;
|
|
strLine.Format(_T("REVIEW_LIGHT_MAX_LEVEL=%d"), pRsRcpReviewInfo->GetRcpLightInfo(0)->m_nMaxThresLevel);
|
outFile << strLine << endl;
|
}
|
else
|
{
|
strLine.Format(_T("REVIEW_LIGHT_LEVEL=%d"), 0);
|
outFile << strLine << endl;
|
|
strLine.Format(_T("REVIEW_LIGHT_MIN_LEVEL=%d"), 0);
|
outFile << strLine << endl;
|
|
strLine.Format(_T("REVIEW_LIGHT_MAX_LEVEL=%d"), 0);
|
outFile << strLine << endl;
|
|
}
|
|
if(pRsRcpReviewInfo->GetRcpAFMRecipeInfoCount() != 0)
|
{
|
strLine.Format(_T("REVIEW_AFM_MAGNIFIC_INDEX=%d"), pRsRcpReviewInfo->GetRcpAFMRecipeInfo(0)->m_nZoomIndex);
|
outFile << strLine << endl;
|
}
|
else
|
{
|
strLine.Format(_T("REVIEW_AFM_MAGNIFIC_INDEX=%d"), 0);
|
outFile << strLine << endl;
|
}
|
|
|
if(nMachineType == 2)
|
{
|
continue;
|
}
|
else if(nMachineType ==4){
|
continue;
|
}
|
else if(nMachineType ==5){
|
continue;
|
}
|
|
|
int priorityCount = pRsRcpReviewInfo->GetRcpPriorityInfoCount();
|
if(nMachineType == 1)
|
{
|
strLine.Format(_T("PRIORITY_CONDITION_COUNT=%d"), priorityCount);
|
}
|
else
|
{
|
strLine.Format(_T("PRIORITY_CONDITION=%d"), priorityCount);
|
}
|
outFile <<strLine << endl;
|
|
int nGrayType =pRsRcpReviewInfo->GetRcpPriorityInfo(0)->GetPriorityGrayData();
|
int nOptic=0;
|
|
if(nGrayType == 1){
|
nOptic = 1 ;
|
}
|
else if(nGrayType == 2)
|
{
|
nOptic = 2;
|
}
|
else{
|
nOptic = 0 ;
|
}
|
|
|
strLine.Format(_T("PRIORITY_OPTIC=%d"), nOptic + 1);
|
outFile << strLine << endl;
|
|
|
strLine.Format(_T("PRIORITY_GRAY=%d"), nGrayType + 1);
|
outFile << strLine << endl;
|
|
|
strLine.Format(_T("PRIORITY_STACK=%d"),pRsRcpReviewInfo->GetRcpPriorityInfo(0)->GetPriorityStackData() + 1);
|
outFile << strLine << endl;
|
|
strLine.Format(_T("SORTING_TYPE=%d"), pRsRcpReviewInfo->GetRcpReviewSortInfo()->m_nSortType + 1);
|
outFile << strLine << endl;
|
|
|
|
strLine.Format(_T("SORTING_ORDER=%d"), pRsRcpReviewInfo->GetRcpReviewSortInfo()->m_nSortData+1);
|
outFile << strLine << endl;
|
|
|
|
}
|
return retVal;
|
}
|