#include "StdAfx.h"
|
#include "GlassRawCPJT.h"
|
#include "akLoggerExt.h"
|
#include "MacroResultFile.h"
|
#include "akCore/akFileUtil.h"
|
#include "akGridData.h"
|
|
//#include "AOIDefinitionType.h"
|
//#include "AOIDefinition.h"
|
|
#define LOCAL_INDEX_PATH "D:\\DIT_ResultData\\Index\\"
|
#define LOCAL_REV_IMAGE_PATH "D:\\ResultData\\UploadImage\\"
|
#define LOCAL_AOI_IMAGE_PATH "D:\\Image\\Defect\\"
|
#define LOCAL_MURA_IMAGE_PATH "D:\\DIT_ResultData\\Mura\\IMG\\"
|
#define LOCAL_DEEP_PATH "D:\\DIT_ResultData\\Deeplearning\\"
|
|
#define LOCAL_RTMS_INFO_PATH "D:\\RTMS_TEMP\\"
|
|
#define LOCAL_RAWPATH_INFO_INI_PATH "D:\\ResultData\\"
|
#define RAWINFO_FILE_NAME "RESULT_INFO.ini"
|
|
#define LOCAL_AOIRAWDFS_PATH "D:\\DIT_ResultData\\Raw"
|
#define LOCAL_AOIRAWBIN_PATH "D:\\DIT_ResultData\\RawBin"
|
#define NETWORK_AOIRAWDFS_PATH "\\\\126.100.100.1\\d\\DIT_ResultData\\Raw"
|
#define NETWORK_AOIRAWBIN_PATH "\\\\126.100.100.1\\d\\DIT_ResultData\\RawBin"
|
|
#define NETWORK_AOIRAWFILE_SUB_PATH "\\\\126.100.100.1\\d\\Raw_im\\"
|
#define NETWORK_AOI_IMAGE_PATH "\\\\126.100.100.1\\d\\Image\\Defect\\"
|
//0404NWH
|
#define NETWORK_MURARAW_PATH "\\\\126.100.100.1\\d\\DIT_ResultData\\Mura\\RAW" //0405nwh
|
#define NETWORK_MURA_IMAGE_PATH "\\\\126.100.100.1\\d\\DIT_ResultData\\Mura\\IMG" //0405nwh
|
|
char* g_pCellCode = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
void _TimeDelay(int delay)
|
{
|
MSG msg;
|
BOOL fRst = FALSE;
|
|
clock_t lBlockTime = delay + clock();
|
|
while (lBlockTime > clock())
|
{
|
fRst = (BOOL)PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
|
if (fRst)
|
{
|
TranslateMessage(&msg);
|
DispatchMessage(&msg);
|
}
|
Sleep(10);
|
}
|
}
|
|
CGlassRawCPJT::CGlassRawCPJT(void)
|
{
|
CreateDirectory("D:\\RTMS_Signal", NULL);
|
CreateDirectory(LOCAL_AOIRAWDFS_PATH, NULL);
|
CreateDirectory(LOCAL_AOIRAWBIN_PATH, NULL);
|
CreateDirectory("D:\\Raw_im", NULL);
|
m_MuraResultFile.readOptionFile("C:\\DIT_Review\\ReviewServerConfig\\MacroInfo.cfg");
|
|
m_GlassRawRTMS.SetMuraResult(&m_MuraResultFile);
|
m_nWriteRawDefectIdx = 1;
|
m_bReviewEndCheck = FALSE;
|
}
|
|
CGlassRawCPJT::~CGlassRawCPJT(void)
|
{
|
}
|
|
BOOL CGlassRawCPJT::SequenceGlassLoading( CgrmGlassRawData* pData )
|
{
|
//스택기능
|
if(m_StackResult.getStackUse())
|
{
|
//201218 CJH - Stack Download 시도
|
SendMessageFTPDownloadStack(pData->GetGlassData());
|
|
m_StackResult.StackFileReadStart(pData->GetGlassData()->m_strGlassID);
|
}
|
if (m_RawMergeResult.getRawMergeUse())
|
{
|
SendMessageFTPDownloadDataFile(pData->GetGlassData());
|
m_RawMergeResult.RawMergeFileReadStart(pData->GetGlassData()->m_strGlassID);
|
}
|
|
return TRUE;
|
}
|
|
BOOL CGlassRawCPJT::SequenceInspectEnd( CgrmGlassRawData* pData )
|
{
|
m_bReviewEndCheck = FALSE;
|
//210128
|
m_tmReviewEnd = m_tmReviewStart = CTime::GetCurrentTime();
|
pData->GetGlassData()->m_tmReviewEnd = m_tmReviewEnd; // Insp End 시 Raw 업로드로, E_TIME, LD_TIME 입력 [ 21-03-18 KJG ]
|
m_tmFileCreateTime = CTime::GetCurrentTime();
|
|
//여기에서 라인별로 파일명, 혹은 Path 위치 결정하면됨. AOIServer 혹은 ReviewServer에서 안해도됨 [김태현2019/9/4]
|
pData->GetGlassData()->m_strFileName;
|
{
|
_grmGlassData* pGlassData = pData->GetGlassData();
|
CTime CurrTime = pGlassData->m_tmGlassLoading;
|
CString strTime=_T(""), strFileName=_T("");
|
strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
|
|
CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
|
strFileName.Format("%s_%s_%s.bin", pGlassData->m_strGlassID, pGlassData->m_strStepID, strTime.GetBuffer(0));
|
|
strcpy(pData->GetGlassData()->m_strFileName, strFileName.GetBuffer(0));
|
}
|
strcpy(pData->GetGlassData()->m_strPath, LOCAL_AOIRAWBIN_PATH);
|
|
|
if(!WriteBinFile(pData))
|
return FALSE;
|
|
|
if (1) ReadMuraFile(pData);
|
|
|
if (WriteAOIFile(pData) == FALSE)
|
return FALSE;
|
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
_TimeDelay(5000); // 이미지 복사 시간 대기
|
//210218 CJH - 검사 종료시 결과파일 및 CCD Image 업로드
|
SendMessageFTPUploadRaw(pData->GetGlassData());
|
|
BOOL bIsBDI = strcmp((pData->GetGlassData()->m_strLine), _T("BDI")) == 0 ? TRUE : FALSE;
|
if (bIsBDI)
|
{
|
SendMessageFTPUploadImage(pData->GetGlassData(), FTPCMD_AOI_IMAGE);
|
}
|
|
SendMessageFTPUploadImage(pData->GetGlassData(), FTPCMD_MURA_IMAGE);//0405nwh
|
|
return TRUE;
|
}
|
|
BOOL CGlassRawCPJT::SequenceReviewStart( CgrmGlassRawData* pData )
|
{
|
//210128
|
m_tmReviewStart = m_tmReviewEnd = CTime::GetCurrentTime();
|
|
//여기에서 라인별로 파일명, 혹은 Path 위치 결정하면됨. AOIServer 혹은 ReviewServer에서 안해도됨 [김태현2019/9/4]
|
pData->GetGlassData()->m_strFileName;
|
strcpy(pData->GetGlassData()->m_strPath, NETWORK_AOIRAWBIN_PATH);
|
|
//strcpy(pData->GetGlassData()->m_strPath, LOCAL_AOIRAWBIN_PATH);
|
|
CString strFindFile;
|
int nCloseTime = 600*100000;//sec
|
int nReTryTime = 30;
|
{
|
CTime tmReviewLoading = CTime::GetCurrentTime();
|
CString strWild;
|
|
strWild.Format("%s\\%s_%s_*.bin", pData->GetGlassData()->m_strPath, pData->GetGlassData()->m_strGlassID,pData->GetGlassData()->m_strStepID);
|
CakFileUtil akFileFinder;
|
while(nReTryTime--)
|
{
|
akFileFinder.FindFile(strWild.GetBuffer(0), FALSE);
|
VECFINDDATA* pFindData = akFileFinder.getFindData();
|
int nFileNamePos = strlen(akFileFinder.getProcessPath());
|
std::map<LONGLONG, CString> mapSpanFileName;
|
for(int i=0; i<pFindData->size(); i++)
|
{
|
char* pFileName = &((*pFindData)[i]).name[nFileNamePos];
|
{
|
CakParser parser;
|
parser.process(pFileName, "_.");
|
if(parser.getTokNum() < 4) continue;
|
|
int nDataTime[8]={};
|
{
|
int nTokIndex=0;
|
const char* pGlassId = parser.getTokStr(nTokIndex++);
|
const char* pStepId = parser.getTokStr(nTokIndex++);
|
char* pDate = &pFileName[parser.getTokPos(nTokIndex++)];
|
char* pTime = &pFileName[parser.getTokPos(nTokIndex++)];
|
|
nDataTime[0] = (pDate[0]-'0')*1000 + (pDate[1]-'0')*100 + (pDate[2]-'0')*10+ (pDate[3]-'0')*1;
|
nDataTime[1] = (pDate[4]-'0')*10+ (pDate[5]-'0')*1;
|
nDataTime[2] = (pDate[6]-'0')*10+ (pDate[7]-'0')*1;
|
nDataTime[3] = (pTime[0]-'0')*10+ (pTime[1]-'0')*1;
|
nDataTime[4] = (pTime[2]-'0')*10+ (pTime[3]-'0')*1;
|
nDataTime[5] = (pTime[4]-'0')*10+ (pTime[5]-'0')*1;
|
}
|
|
CTime tmTemp(nDataTime[0], nDataTime[1], nDataTime[2], nDataTime[3], nDataTime[4], nDataTime[5] );
|
CTimeSpan tmSpan = tmReviewLoading-tmTemp;
|
mapSpanFileName.insert(std::make_pair(tmSpan.GetTotalSeconds(), pFileName));
|
}
|
}
|
|
if(mapSpanFileName.empty() == FALSE)
|
{
|
if(mapSpanFileName.begin()->first < nCloseTime)
|
{
|
//가장 최근 결과파일 찾기 성공 [김태현 2019/7/17]
|
strFindFile = mapSpanFileName.begin()->second;
|
break;
|
}
|
}
|
akFileFinder.clear();
|
Sleep(100);
|
}
|
}
|
|
if(strFindFile.IsEmpty()) return FALSE;
|
|
strcpy(pData->GetGlassData()->m_strFileName, strFindFile.GetBuffer(0));
|
|
|
if(!ReadBinFile(pData))
|
return FALSE;
|
|
strcpy(pData->GetGlassData()->m_strPath, LOCAL_AOIRAWBIN_PATH);
|
|
pData->GetGlassData()->m_tmReviewLoading = m_tmReviewStart;
|
|
return TRUE;
|
}
|
|
|
BOOL CGlassRawCPJT::SequenceReviewEnd( CgrmGlassRawData* pData )
|
{
|
m_bReviewEndCheck = TRUE;
|
m_tmReviewEnd = m_tmReviewStart = CTime::GetCurrentTime();
|
m_tmFileCreateTime = CTime::GetCurrentTime();
|
pData->GetGlassData()->m_tmReviewEnd = m_tmReviewEnd;
|
|
//여기에서 라인별로 파일명, 혹은 Path 위치 결정하면됨. AOIServer 혹은 ReviewServer에서 안해도됨 [김태현2019/9/4]
|
pData->GetGlassData()->m_strFileName;
|
strcpy(pData->GetGlassData()->m_strPath, NETWORK_AOIRAWDFS_PATH);
|
|
if(1) ReadMuraFile(pData);
|
|
if(WriteAOIFile(pData) == FALSE)
|
return FALSE;
|
|
//210126 CJH - Review End에서만 RTMS 결과파일 생성하도록 변경
|
if (m_GlassRawRTMS.WriteAOIFile(pData) == FALSE)
|
return FALSE;
|
|
if(1)
|
{
|
_grmGlassData* pGlassData = pData->GetGlassData();
|
|
SendMessageFTPUploadRaw(pGlassData);
|
SendMessageFTPUploadImage(pGlassData, FTPCMD_AOI_IMAGE);
|
SendMessageFTPUploadImage(pGlassData, FTPCMD_REVIEW_IMAGE);
|
SendMessageFTPUploadImage(pGlassData, FTPCMD_MURA_IMAGE);//0405nwh
|
|
}
|
|
|
|
|
return TRUE;
|
}
|
|
BOOL CGlassRawCPJT::SequenceFtpUpload(char* pRawFilePathName)
|
{
|
// Manual Upload 기능 [21-02-05 KJG]
|
CTime tmFileCreate;
|
_grmGlassData GlassData;
|
_grmGlassData* pGlassData = &GlassData;
|
|
//정보 얻어오기 [김태현 2019/1/25]
|
char* pFileName = CakFileUtil::getFileName(pRawFilePathName);
|
char* pext = CakFileUtil::getFileExt(pRawFilePathName);
|
|
if (!strcmp(pext, "") == FALSE) return FALSE; // 확장자가 없음
|
|
CakParser parser;
|
FILE* pf = fopen(pRawFilePathName, "r");
|
if (pf)
|
{
|
CString strParse, strLDTime;
|
char buffer[512];
|
fgets(buffer, 512, pf);
|
fgets(buffer, 512, pf);
|
fgets(buffer, 512, pf);
|
fgets(buffer, 512, pf);
|
parser.process(buffer, " ");
|
|
if (parser.getTokNum() < 20) return FALSE;
|
strParse = parser.getTokStr(0);
|
if (strParse != "DATA") return FALSE;
|
strParse = parser.getTokStr(1);
|
if (strParse != "PANEL") return FALSE;
|
|
strcpy(pGlassData->m_strProcessID, "");
|
strcpy(pGlassData->m_strProductID, "");
|
strcpy(pGlassData->m_strLotID, "");
|
strcpy(pGlassData->m_strStepID, "");
|
strcpy(pGlassData->m_strGlassID, "");
|
|
strcpy(pGlassData->m_strProcessID, parser.getTokStr(4));
|
strcpy(pGlassData->m_strProductID, parser.getTokStr(5));
|
strcpy(pGlassData->m_strLotID, parser.getTokStr(5)); // C-PJT - m_strLotID = m_strProductID
|
strcpy(pGlassData->m_strStepID, parser.getTokStr(6));
|
strcpy(pGlassData->m_strGlassID, parser.getTokStr(9));
|
strLDTime = parser.getTokStr(19);
|
|
if (pGlassData->m_strProcessID == "" || pGlassData->m_strProductID == "" || pGlassData->m_strLotID == "" || pGlassData->m_strStepID == "" || pGlassData->m_strGlassID == "")
|
{
|
AKLOG("Manual Upload Fail : Parsing Data is Empty");
|
return FALSE;
|
}
|
int nYear = _ttoi(strLDTime.Left(4));
|
int nMon = _ttoi(strLDTime.Mid(4, 2));
|
int nDay = _ttoi(strLDTime.Mid(6, 2));
|
int nHour = _ttoi(strLDTime.Mid(8, 2));
|
int nMin = _ttoi(strLDTime.Mid(10, 2));
|
int nSec = _ttoi(strLDTime.Mid(12, 2));
|
pGlassData->m_tmGlassLoading = CTime(nYear, nMon, nDay, nHour, nMin, nSec);
|
|
m_tmFileCreateTime = CTime::GetCurrentTime();
|
strcpy(pGlassData->m_strPath, NETWORK_AOIRAWDFS_PATH);
|
|
SendMessageFTPUploadRaw(pGlassData);
|
SendMessageFTPUploadImage(pGlassData, FTPCMD_AOI_IMAGE);
|
SendMessageFTPUploadImage(pGlassData, FTPCMD_REVIEW_IMAGE);
|
AKLOG("Manual Success : %s File Send FTPUploader Command", pRawFilePathName);
|
|
}
|
else
|
{
|
AKLOG("Manual Upload Fail : Can't Open File");
|
return FALSE;
|
}
|
|
fclose(pf);
|
|
|
return TRUE;
|
}
|
|
|
BOOL CGlassRawCPJT::WriteAOIFile( CgrmGlassRawData* pData )
|
{
|
BOOL bResult = TRUE;
|
|
bResult &= MakeAOIFile(pData);
|
|
m_GlassRawAna.MakeAnaFile(pData);
|
//m_GlassRawRTMS.WriteAOIFile(pData);
|
|
AKLOG("WriteAOIFile Complete");
|
return bResult;
|
}
|
|
BOOL CGlassRawCPJT::MakeAOIFile( CgrmGlassRawData* pData )
|
{
|
AKLOG("MakeAOIFile Start");
|
m_nWriteRawDefectIdx = 1;
|
|
_grmGlassData* pGlass = pData->GetGlassData();
|
CString strFilePathName;
|
CString strFileName;//파일생성 시간 때문에 여기서 정확하게 파일명 다시 정정
|
{
|
//Glass 정보
|
CTime CurrTime = m_tmReviewEnd;
|
CString strTime;
|
strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
|
CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
|
strFileName.Format("%s", pGlass->m_strGlassID); // 신기대 프로 요청 확장자 삭제
|
}
|
|
strFilePathName.Format("%s\\%s", pGlass->m_strPath, strFileName);//pGlass->m_strFileName);
|
//strFilePathName.Format("C:\\AOIServer\\NFS\\RAW\\%s", pData->GetGlassData()->m_strFileName);
|
|
// 글라스 ID만 존재하여 재검사 시 파일 생성 실패. 삭제한다
|
DeleteFile(strFilePathName);
|
//FILE* pf = fopen(strFilePathName.GetBuffer(0), "w");
|
FILE* pf = fopen(strFilePathName.GetBuffer(0), "w");
|
if(pf == NULL)
|
{
|
AKLOG("MakeAOIFile Fail : [%s]", strFilePathName.GetBuffer(0));
|
return FALSE;
|
}
|
|
|
|
CString strBuffer;
|
CString strLine;
|
|
//////////////////////////////////////////////////////////////////////////
|
//HEDER ITEM
|
{
|
makeDataHeader(strLine, pGlass);
|
fprintf(pf, "%s\n", strLine.GetBuffer(0));
|
}
|
|
|
//////////////////////////////////////////////////////////////////////////
|
//GLASSDATA
|
{
|
makeDataGlass(strLine, pGlass);
|
fprintf(pf, "%s\n", strLine.GetBuffer(0));
|
}
|
|
//////////////////////////////////////////////////////////////////////////
|
//CELL & DEFECT DATA
|
{
|
|
//make
|
{
|
for (int iCell = 0; iCell < pData->GetGlassData()->m_nCellNum; iCell++)
|
{
|
_grmCellData* pCell = pData->GetCellData(iCell);
|
makeDataCell(strLine, pData, pCell);
|
fprintf(pf, "%s\n", strLine);
|
|
for (int iDefect = 0; iDefect < pData->GetGlassData()->m_nDefectNum; iDefect++)
|
{
|
_grmDefectData* pDefect = pData->GetDefectData(iDefect);
|
if (pDefect->m_nCellIdx != iCell) continue;
|
//210203 CJH - CutOff 대상 결과파일 작성 제외
|
if (pDefect->m_bDefectCutoff == TRUE) continue;
|
|
if (makeDataDefect(strLine, pData, pDefect))
|
{
|
fprintf(pf, "%s\n", strLine);
|
}
|
}
|
|
}
|
}
|
}
|
|
|
|
|
|
AKLOG("MakeAOIFile Complete : [%s]", strFilePathName.GetBuffer(0));
|
fclose(pf);
|
return TRUE;
|
}
|
|
void CGlassRawCPJT::makeDataHeader( CString& strLine, _grmGlassData* pGlassData )
|
{
|
strLine.Empty();
|
CString strValue;
|
|
strValue = "ITEM PANEL MODULETYPE MODULEID PROCESSID PRODUCTID STEPID PROD_TYPE BATCHID H_PANELID E_PANELID P_PANELID OPERID COMP_COUNT PPID GRADE CODE R_GRADE MAP_IMAGE L_TIME U_TIME S_TIME E_TIME T_DEFECT TR PR TB TW RB RW T_STACK MAX_AVG_GRAY MAX_PORTION OK_CELL RJ_CELL RW_CELL NR_CELL CSTID SLOT_NO JOB_END TD_DEFECT SD_DEFECT PD_DEFECT SP_DEFECT PAD_GATE PAD_DATA M_DEFECT C_DEFECT BR_DEFECT IMG_COUNT RECIPE SHRINK RAW_CUT"; //53ea
|
strLine += strValue; strLine += "\n";
|
strValue = "ITEM SUBPANEL SUBPANELID COORD_X COORD_Y SIZE_X SIZE_Y GATELINE DATALINE GRADE CODE R_GRADE T_DEFECT TD_DEFECT SD_DEFECT PD_DEFECT SP_DEFECT PAD_GATE PAD_DATA M_DEFECT C_DEFECT PRO_IMAGE AVG_GRAY_0 PORTION_0 CORNER_GRAY_0 AVG_AMP_0 FFT_VAR_0 FFT_VAH_0 FFT_VAQ_0 FFT_PK_0 AVG_GRAY_1 PORTION_1 CORNER_GRAY_1 AVG_AMP_1 FFT_VAR_1 FFT_VAH_1 FFT_VAQ_1 FFT_PK_1 AVG_GRAY_2 PORTION_2 CORNER_GRAY_2 AVG_AMP_2 FFT_VAR_2 FFT_VAH_2 FFT_VAQ_2 FFT_PK_2 AVG_GRAY_3 PORTION_3 CORNER_GRAY_3 AVG_AMP_3 FFT_VAR_3 FFT_VAH_3 FFT_VAQ_3 FFT_PK_3"; //54ea 21-06-21 Mura Data 추가
|
strLine += strValue; strLine += "\n";
|
//210405
|
//ITEM DEFECT ID DEF_NO COORD_X COORD_Y GATELINE DATALINE SIZE_S SIZE_W SIZE_L SIZE_H GRADE CODE STACK_FLAG STACK_COUNT STACK_STEP IMAGE_FILE DSC_CODE VC_CODE DCR_CODE DEFECT_SIZE REPEAT_DEFECT WSI_HEIGHT CS_HEIGHT C_GRADE GRAY_MIN GRAY_MAX GRAY_AVG GRAY_DEF WSI_IMAGE USE_CCDIMAGE SCAN_NUM CAM_POSITION CCD_NO R_GRAY_MIN R_GRAY_MAX R_GRAY_AVG SCAN_AI REVIEW_AI INS_MODE INS_CHANNEL COMPACTNESS THICKNESS MAJOR MINOR WSI_TYPE DEFECT_TYPE SHRINK
|
strValue = "ITEM DEFECT ID DEF_NO COORD_X COORD_Y GATELINE DATALINE SIZE_S SIZE_W SIZE_L SIZE_H GRADE CODE STACK_FLAG STACK_COUNT STACK_STEP IMAGE_FILE DSC_CODE VC_CODE DCR_CODE DEFECT_SIZE REPEAT_DEFECT WSI_HEIGHT CS_HEIGHT C_GRADE GRAY_MIN GRAY_MAX GRAY_AVG GRAY_DEF WSI_IMAGE USE_CCDIMAGE SCAN_NUM CAM_POSITION CCD_NO R_GRAY_MIN R_GRAY_MAX R_GRAY_AVG R_HEIGHT G_HEIGHT B_HEIGHT INS_CHANNEL COMPACTNESS THICKNESS MAJOR MINOR WSI_TYPE DEFECT_TYPE SHRINK CLASS_CODE"; //50ea
|
strLine += strValue;
|
|
}
|
#define SPRINTRAWSTART char strItemValue[1024];int nItemValueLen, nItemValuePos = 0;memset(strItemValue, ' ', sizeof(char)*1024)
|
#define SPRINTRAW(ITEMSIZE, fmt, ...) nItemValueLen = sprintf(strItemValue+nItemValuePos, fmt,##__VA_ARGS__); strItemValue[nItemValuePos+ nItemValueLen] = ' ';nItemValuePos+=ITEMSIZE+1
|
#define SPRINTRAWEND strItemValue[nItemValuePos - 1] = 0; strLine = strItemValue
|
void CGlassRawCPJT::makeDataGlass( CString& strLine, _grmGlassData* pGlassData )
|
{
|
SPRINTRAWSTART;
|
|
CString strValue;
|
|
/* PANEL ITEM
|
01 4 ITEM // ITEM Separator
|
02 5 PANEL // PANEL Separator
|
03 5 MODULETYPE // Module Type
|
04 27 MODULEID // Module ID
|
05 20 PROCESSID // ProcessID
|
06 20 PRODUCTID // ProductID
|
07 10 STEPID // StepID
|
08 2 PROD_TYPE // Prod Type
|
09 12 BATCHID // Batch ID
|
10 12 H_PANELID // Host Panel ID
|
11 12 E_PANELID // Panel ID Reading by VCR
|
12 12 P_PANELID // Pair Panel ID
|
13 16 OPERID // Perator ID or Module ID
|
14 3 COMP_COUNT // Cell Count
|
15 16 PPID // PPID (Recipe Name)
|
16 4 GRADE // Grade (Judgement)
|
17 4 CODE // Grade Code (Judgement Code)
|
18 4 R_GRADE // Grade by Operator (Re-Judgement)
|
19 16 MAP_IMAGE // Map Image File Name
|
20 14 L_TIME // Cassette or Conveyor에서 OUT된 시간
|
21 14 U_TIME // Cassette or Conveyor에서 IN된 시간
|
22 14 S_TIME // Stage에서 검사/계측 시작된 시각
|
23 14 E_TIME // Stage에서 검사/계측 종료된 시각
|
24 12 T_DEFECT // Common Item 1 - Total Defect Count
|
25 12 TR // Panel 정보 02
|
26 12 PR // Panel 정보 03
|
27 12 TB // Panel 정보 04
|
28 12 TW // Panel 정보 05
|
29 12 RB // Panel 정보 06
|
30 12 RW // Panel 정보 07
|
31 12 T_STACK // SD+SP 수
|
32 12 BMDF // Panel 정보 09 -> 변경 MAX_AVG_GRAY 04/12
|
33 12 CJ // Panel 정보 10 -> 변경 MAX_PORTION 04/12
|
34 12 OK_CELL // OK Cell Count
|
35 12 RJ_CELL // RJ Cell Count
|
36 12 RW_CELL // RW Cell Count
|
37 12 NR_CELL // NR Cell Count
|
38 12 MASK_CELL // MASK Cell Count - CST ID
|
39 12 A_CELL // 이상 Cell Count - SLOT NO
|
40 12 P_CELL // Pattern Shift Cell Count - JOB END
|
41 12 TD_DEFECT // Total Defect Count -> TD Defect Count
|
42 12 SD_DEFECT // SD Defect Count
|
43 12 PD_DEFECT // PD Defect Count
|
44 12 SP_DEFECT // SP Defect Count
|
45 12 PAD_GATE // PAD Gate 불량 수
|
46 12 PAD_DATA // PAD Data 불량 수
|
47 12 M_DEFECT // MASK 불량 수
|
48 12 C_DEFECT // COMMON 불량
|
49 12 BR_DEFECT // SCRATCH 불량 수
|
50 12 CRACK // Crack 불량 수 - Image 촬상 갯수
|
51 12 P_SHIFT // Pattern Shift 불량 수 - 레시피 이름
|
*/
|
|
//////////////////////////////////////////////////////////////////////////
|
// [김태현2020/9/15]
|
// SPRINTRAW(데이터 크기, "VALUE");
|
|
// 01 4 ITEM // ITEM Separator
|
SPRINTRAW(4, "DATA");
|
// 02 5 PANEL // PANEL Separator
|
SPRINTRAW(5, "PANEL");
|
// 03 5 MODULETYPE // Module Type
|
/*SPRINTRAW(5, "*");*/
|
if (strlen(pGlassData->m_strEquipID) == 0)
|
{
|
SPRINTRAW(5, "*");
|
}
|
else
|
{
|
CString temp = pGlassData->m_strEquipID;
|
SPRINTRAW(5, "%s", temp.Left(5));
|
}
|
// 04 27 MODULEID // Module ID
|
if (strlen(pGlassData->m_strOperID) == 0)
|
{
|
SPRINTRAW(27, "*");
|
}
|
else
|
{
|
SPRINTRAW(27, "%s", pGlassData->m_strOperID);
|
}
|
// 05 20 PROCESSID // ProcessID
|
if (strlen(pGlassData->m_strProcessID) == 0)
|
{
|
SPRINTRAW(20, "*");
|
}
|
else
|
{
|
SPRINTRAW(20, "%s", pGlassData->m_strProcessID);
|
}
|
// 06 20 PRODUCTID // ProductID
|
if (strlen(pGlassData->m_strProductID) == 0)
|
{
|
SPRINTRAW(20, "*");
|
}
|
else
|
{
|
SPRINTRAW(20, "%s", pGlassData->m_strProductID);
|
}
|
// 07 10 STEPID // StepID
|
if (strlen(pGlassData->m_strStepID) == 0)
|
{
|
SPRINTRAW(10, "*");
|
}
|
else
|
{
|
SPRINTRAW(10, "%s", pGlassData->m_strStepID);
|
}
|
// 08 2 PROD_TYPE // Prod Type
|
if (strlen(pGlassData->m_strProdType) == 0)
|
{
|
SPRINTRAW(2, "*");
|
}
|
else
|
{
|
SPRINTRAW(2, "%s", pGlassData->m_strProdType);
|
}
|
// 09 12 BATCHID // Batch ID - Glass ID 앞 6자리
|
strValue = pGlassData->m_strGlassID;
|
SPRINTRAW(12, "%s", strValue.Left(6));
|
// 10 12 H_PANELID // Host Panel ID
|
if (strlen(pGlassData->m_strGlassID) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strGlassID);
|
}
|
// 11 12 E_PANELID // Panel ID Reading by VCR
|
if (strlen(pGlassData->m_strEPPID) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strEPPID);
|
}
|
// 12 12 P_PANELID // Pair Panel ID
|
if (strlen(pGlassData->m_strPairHPanelID) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strPairHPanelID);
|
}
|
// 13 16 OPERID // Perator ID or Module ID
|
if (strlen(pGlassData->m_strOperID) == 0)
|
{
|
SPRINTRAW(16, "*");
|
}
|
else
|
{
|
SPRINTRAW(16, "%s", pGlassData->m_strOperID);
|
}
|
// 14 3 COMP_COUNT // Cell Count
|
SPRINTRAW(3, "%d", pGlassData->m_nCellNum);
|
// 15 16 PPID // PPID (Recipe Name)
|
if (strlen(pGlassData->m_strPPID) == 0)
|
{
|
SPRINTRAW(16, "*");
|
}
|
else
|
{
|
SPRINTRAW(16, "%s", pGlassData->m_strPPID);
|
}
|
// 16 4 GRADE // Grade (Judgement)
|
if (strlen(pGlassData->m_strGlassJudge) == 0)
|
{
|
SPRINTRAW(4, "*");
|
}
|
else
|
{
|
SPRINTRAW(4, "%s", pGlassData->m_strGlassJudge);
|
}
|
// 17 4 CODE // Grade Code (Judgement Code)
|
if (strlen(pGlassData->m_strGlassCode) == 0)
|
{
|
SPRINTRAW(4, "*");
|
}
|
else
|
{
|
SPRINTRAW(4, "%s", pGlassData->m_strGlassCode);
|
}
|
// 18 4 R_GRADE // Grade by Operator (Re-Judgement)
|
SPRINTRAW(4, "*");
|
// 19 16 MAP_IMAGE // Map Image File Name
|
// if (strlen(pGlassData->m_strFileName) == 0)
|
// {
|
// SPRINTRAW(16, "*");
|
// }
|
// else
|
// {
|
// SPRINTRAW(16, "%s", pGlassData->m_strFileName);
|
// }
|
SPRINTRAW(16, "map01.jpg"); //Defect Map 자릿수가 20자리가 넘는다..
|
// 20 14 L_TIME // Cassette or Conveyor에서 OUT된 시간
|
strValue.Format("%04d%02d%02d%02d%02d%02d" // START_TIME
|
, pGlassData->m_tmGlassLoading.GetYear()
|
, pGlassData->m_tmGlassLoading.GetMonth()
|
, pGlassData->m_tmGlassLoading.GetDay()
|
, pGlassData->m_tmGlassLoading.GetHour()
|
, pGlassData->m_tmGlassLoading.GetMinute()
|
, pGlassData->m_tmGlassLoading.GetSecond());
|
SPRINTRAW(14, "%s", (LPSTR)(LPCTSTR)strValue);
|
// 21 14 U_TIME // Cassette or Conveyor에서 IN된 시간
|
strValue.Format("%04d%02d%02d%02d%02d%02d" // E_TIME
|
, pGlassData->m_tmReviewEnd.GetYear()
|
, pGlassData->m_tmReviewEnd.GetMonth()
|
, pGlassData->m_tmReviewEnd.GetDay()
|
, pGlassData->m_tmReviewEnd.GetHour()
|
, pGlassData->m_tmReviewEnd.GetMinute()
|
, pGlassData->m_tmReviewEnd.GetSecond());
|
SPRINTRAW(14, "%s", (LPSTR)(LPCTSTR)strValue);
|
// 22 14 S_TIME // Stage에서 검사/계측 시작된 시각
|
strValue.Format("%04d%02d%02d%02d%02d%02d" // START_TIME
|
, pGlassData->m_tmInspectionStart.GetYear()
|
, pGlassData->m_tmInspectionStart.GetMonth()
|
, pGlassData->m_tmInspectionStart.GetDay()
|
, pGlassData->m_tmInspectionStart.GetHour()
|
, pGlassData->m_tmInspectionStart.GetMinute()
|
, pGlassData->m_tmInspectionStart.GetSecond());
|
SPRINTRAW(14, "%s", (LPSTR)(LPCTSTR)strValue);
|
// 23 14 E_TIME // Stage에서 검사/계측 종료된 시각
|
strValue.Format("%04d%02d%02d%02d%02d%02d" // E_TIME
|
, pGlassData->m_tmReviewEnd.GetYear()
|
, pGlassData->m_tmReviewEnd.GetMonth()
|
, pGlassData->m_tmReviewEnd.GetDay()
|
, pGlassData->m_tmReviewEnd.GetHour()
|
, pGlassData->m_tmReviewEnd.GetMinute()
|
, pGlassData->m_tmReviewEnd.GetSecond());
|
SPRINTRAW(14, "%s", (LPSTR)(LPCTSTR)strValue);
|
// 24 6 T_DEFECT // Common Item 1 - Total Defect Count
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNum - pGlassData->m_nCutOffDefectNum); //210203 CJH - Cutoff 결함은 전체개수에서 제외해준다.
|
// 25 6 TR // Panel 정보 02
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumJudgeTR);
|
// 26 6 PR // Panel 정보 03
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumJudgePR);
|
// 27 6 TB // Panel 정보 04
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeTB);
|
// 28 6 TW // Panel 정보 05
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeTW);
|
// 29 6 RB // Panel 정보 06
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeRB);
|
// 30 6 RW // Panel 정보 07
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeRW);
|
// 31 6 T_STACK // Panel 정보 08 SD+SP 수 입력
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumStackSD + pGlassData->m_nDefectNumStackSP);
|
//32 6 BMDF // Panel 정보 09 -> 변경 MAX_AVG_GRAY 04/12 nwh
|
if (strlen(pGlassData->m_strMaxAvgGray) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strMaxAvgGray);
|
}
|
// 33 6 CJ // Panel 정보 10 -> 변경 MAX_PORTION 04/12 nwh
|
if (strlen(pGlassData->m_strMaxPortion) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strMaxPortion);
|
}
|
// 34 6 OK_CELL // OK Cell Count
|
SPRINTRAW(12, "*");
|
// 35 6 RJ_CELL // RJ Cell Count
|
SPRINTRAW(12, "*");
|
// 36 6 RW_CELL // RW Cell Count
|
SPRINTRAW(12, "*");
|
// 37 6 NR_CELL // NR Cell Count
|
SPRINTRAW(12, "*");
|
// 38 6 MASK_CELL // MASK Cell Count //201215 CJH - CSTID로 변경
|
if (strlen(pGlassData->m_strCSTID) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strCSTID);
|
}
|
|
SPRINTRAW(12, "%d", pGlassData->m_nSlot_No); // SLot_No 추가 [ 21-03-18 KJG ]
|
|
SPRINTRAW(12, "%d", pGlassData->m_bJob_end); // Job_end 추가 [ 21-03-18 KJG ]
|
|
// 41 6 TD_DEFECT // TD Defect Count -> 현공정에서 나온 모든 결함 : Total - SD
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumStackTD);
|
// 42 6 SD_DEFECT // SD Defect Count -> TD 결함에서 Stack 결함을 제외한 결함(우리 설비에서 첫 발견된 결함)
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumStackSD);
|
// 43 6 PD_DEFECT // PD Defect Count -> 현재 공정에서 검출된 특정 Partial 결함(사양서 상에는 Zone이라 되어있으나 실질적으로는 Classfication에 통과된 결함)
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumStackPD);
|
// 44 6 SP_DEFECT // SP Defect Count -> 현재 공정에서 검출된 특정 Partial 결함 중, 이전 공정의 Partial 결함을 제외한 결함
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumStackSP);
|
// 45 6 PAD_GATE // PAD Gate 불량 수
|
SPRINTRAW(12, "*");
|
// 46 6 PAD_DATA // PAD Data 불량 수
|
SPRINTRAW(12, "*");
|
// 47 6 M_DEFECT // MASK 불량 수
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeMD);
|
// 48 6 C_DEFECT // COMMON 불량
|
SPRINTRAW(12, "%d", pGlassData->m_nDefectNumTypeCD);
|
// 49 6 S_DEFECT // SCRATCH 불량 수
|
SPRINTRAW(12, "*");
|
// 50 6 CRACK // Crack 불량 수 //201217 CJH - Image 촬상 개수로 변경
|
//SPRINTRAW(12, "%d", pGlassData->m_nDefectNumLocCrack);
|
SPRINTRAW(12, "%d", pGlassData->m_nReviewNum);
|
// 51 6 P_SHIFT // Pattern Shift 불량 수 //201217 CJH - Recipe로 변경
|
if (strlen(pGlassData->m_strRecipeName) == 0)
|
{
|
SPRINTRAW(16, "*");
|
}
|
else if(strlen(pGlassData->m_strRecipeName) <= 16)
|
{
|
SPRINTRAW(16, "%s", pGlassData->m_strRecipeName);
|
}
|
else if (strlen(pGlassData->m_strRecipeName) > 16)
|
{
|
CString temp = pGlassData->m_strRecipeName; // 레시피 17자리 넘어가면 DCOLL 발생으로 예외처리 [ 21-06-02 KJG ]
|
temp = temp.Left(16);
|
SPRINTRAW(16, "%s", temp.GetBuffer(0));
|
}
|
|
// 52 12 SHRINK // Server or Frame Shrink 동작 여부
|
if (strlen(pGlassData->m_strShrinked) == 0)
|
{
|
SPRINTRAW(12, "*");
|
}
|
else
|
{
|
SPRINTRAW(12, "%s", pGlassData->m_strShrinked);
|
}
|
// 53 12 RAW_CUT // RAW 입력 Defect 수량 상한 사용여부
|
if (pGlassData->m_bRawCutoff)
|
{
|
SPRINTRAW(12, "USE");
|
}
|
else
|
{
|
SPRINTRAW(12, "UNUSE");
|
}
|
|
SPRINTRAWEND; //중요!!! 젤 마지막에 꼭 있어야함!!!(삭제금지) [김태현2020/9/23]
|
}
|
|
void CGlassRawCPJT::makeDataCell( CString& strLine, CgrmGlassRawData* pData, _grmCellData* pCellData )
|
{
|
SPRINTRAWSTART;
|
|
/* SUBPanel ITEM
|
01 4 ITEM // ITEM
|
02 8 SUBPANEL // SUBPANEL
|
03 12 SUBPANELID // Subpanel ID
|
04 7 COORD_X // X Beginnign Coord
|
05 7 COORD_Y // Y Beginning Coord
|
06 7 SIZE_X // X-axis Size
|
07 7 SIZE_Y // Y-axis Size
|
08 6 GATELINE // GateLine
|
09 6 DATALINE // DataLine
|
10 4 GRADE // Grade (Judgement)
|
11 4 CODE // Grade Code (Judgement)
|
12 4 R_GRADE // Grade by Operator (Re-Judgement)
|
13 12 T_DEFECT // Total Defect Count
|
14 12 TD_DEFECT // TD Defect Count
|
15 12 SD_DEFECT // SD Defect Count
|
16 12 PD_DEFECT // PD Defect Count
|
17 12 SP_DEFECT // SP Defect Coun
|
18 12 PAD_GATE // PAD Gate Defect Count
|
19 12 PAD_DATA // PAD Data Defect Count
|
20 12 M_DEFECT // MASK Defect Count
|
21 12 C_DEFECT // COMMON Defect Count
|
22 12 S_DEFECT // SCRATCH Defect Count
|
23 12 CRACK // CRACK Defect Count
|
24 12 P_SHIFT // Pattern Shift Defect Count
|
*/
|
|
// 01 4 ITEM // ITEM
|
SPRINTRAW(4, "DATA");
|
// 02 8 SUBPANEL // SUBPANEL
|
SPRINTRAW(8, "SUBPANEL");
|
// 03 12 SUBPANELID // Subpanel ID
|
//SPRINTRAW(12, "%d", pCellData->m_nCellID);
|
SPRINTRAW(12, "%s%c%c", pData->GetGlassData()->m_strGlassID, '0' + pCellData->m_nCellID / 36, g_pCellCode[pCellData->m_nCellID % 36]);
|
|
// 글라스 원점 기준 Y좌표 반대
|
// 코너컷 기준으로 결과파일 좌표가 생성되는데 고객사에 명확한 확인 필요
|
// Server는 모든 좌표를 글라스 원점 기준으로 하는데 코너컷 기준이 되어야하는지 봐야함
|
// 셀 위치는 글라스 원점, 좌표는 코너컷???
|
// 210129 CJH - 셀 원점 위치에 따라 좌표위치 변경 LeftTop(1,-1) RightTop(-1,-1) LeftBottom(1,1) RightBottom(-1,1)
|
if (pCellData->m_nCellXDir == 1)
|
{
|
// 04 7 COORD_X // X Beginning Coord
|
SPRINTRAW(8, "%d", pCellData->m_rectCellLeft);
|
}
|
else
|
{
|
// 04 7 COORD_X // X Beginning Coord
|
SPRINTRAW(8, "%d", pCellData->m_rectCellRight);
|
}
|
|
if (pCellData->m_nCellYDir == 1)
|
{
|
// 05 7 COORD_Y // Y Beginning Coord //Top을 해야 제대로 값이 들어감...Rect부터 잘못 들어가는듯
|
SPRINTRAW(8, "%d", pCellData->m_rectCellTop * -1);
|
}
|
else
|
{
|
// 05 7 COORD_Y // Y Beginning Coord
|
SPRINTRAW(8, "%d", pCellData->m_rectCellBottom * -1);
|
}
|
// 06 7 SIZE_X // X-axis Size
|
SPRINTRAW(7, "%d", pCellData->m_rectCellRight - pCellData->m_rectCellLeft);
|
// 07 7 SIZE_Y // Y-axis Size
|
SPRINTRAW(7, "%d", pCellData->m_rectCellBottom - pCellData->m_rectCellTop);
|
// 08 6 GATELINE // 총 GateLine 수
|
SPRINTRAW(6, "%d", pCellData->m_nGateNum);
|
// 09 6 DATALINE // 총 DataLine 수
|
SPRINTRAW(6, "%d", pCellData->m_nDataNum);
|
// 10 4 GRADE // Grade (Judgement)
|
SPRINTRAW(4, "%s", GetDefectInfoToString(DMT_DefectJudge, pCellData->m_nJudgement));
|
|
// 11 4 CODE // Grade Code (Judgement)
|
SPRINTRAW(4, "OOOO");
|
// 12 4 R_GRADE // Grade by Operator (Re-Judgement)
|
SPRINTRAW(4, "*");
|
// 13 6 T_DEFECT // Total Defect Count
|
SPRINTRAW(12, "%d", pCellData->getTotalDefectNum());
|
// 14 6 TD_DEFECT // TD Defect Count - total defect
|
SPRINTRAW(12, "%d", pCellData->m_nDefectTDCount);
|
// 15 6 SD_DEFECT // SD Defect Count - stack defect
|
SPRINTRAW(12, "%d", pCellData->m_nDefectSDCount);
|
// 16 6 PD_DEFECT // PD Defect Count - partial defect
|
SPRINTRAW(12, "%d", pCellData->m_nDefectPDCount);
|
// 17 6 SP_DEFECT // SP Defect Count - stack partial
|
SPRINTRAW(12, "%d", pCellData->m_nDefectSPCount);
|
// 18 6 PAD_GATE // PAD Gate Defect Count
|
SPRINTRAW(12, "*");
|
// 19 6 PAD_DATA // PAD Data Defect Count
|
SPRINTRAW(12, "*");
|
// 20 6 M_DEFECT // MASK Defect Count
|
SPRINTRAW(12, "%d", pCellData->m_nDefectNumTypeMD);
|
// 21 6 C_DEFECT // COMMON Defect Count
|
SPRINTRAW(12, "%d", pCellData->m_nDefectNumTypeCD);
|
|
// 22 6 S_DEFECT -> 22 6 PRO_IMAGE 변경 nwh0404
|
if (strlen(pCellData->m_strProImage))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strProImage);
|
}
|
else
|
{
|
SPRINTRAW(12,"*");
|
}
|
|
// 23 12 AVG_GRAY_0
|
if (strlen(pCellData->m_strAvgGray_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgGray_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 24 12 PORTION_0
|
if (strlen(pCellData->m_strPortion_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strPortion_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
//kyh 0622
|
// 25 12 CORNER_GRAY_0
|
if (strlen(pCellData->m_strCorner_Gray_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strCorner_Gray_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 26 12 AVG_AMP_0
|
if (strlen(pCellData->m_strAvgAmp_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgAmp_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 27 12 FFT_VAR_0
|
if (strlen(pCellData->m_strFFTVar_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVar_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 28 12 FFT_VAH_0
|
if (strlen(pCellData->m_strFFTVah_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVah_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 29 12 FFT_VAQ_0
|
if (strlen(pCellData->m_strFFTVaq_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVaq_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 30 12 FFT_PK_0
|
if (strlen(pCellData->m_strFFTPK_0))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTPK_0);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 31 12 AVG_GRAY_1
|
if (strlen(pCellData->m_strAvgGray_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgGray_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 32 12 PORTION_1
|
if (strlen(pCellData->m_strPortion_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strPortion_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
//kyh 0622
|
// 33 12 CORNER_GRAY_1
|
if (strlen(pCellData->m_strCorner_Gray_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strCorner_Gray_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 34 12 AVG_AMP_1
|
if (strlen(pCellData->m_strAvgAmp_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgAmp_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 35 12 FFT_VAR_1
|
if (strlen(pCellData->m_strFFTVar_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVar_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 36 12 FFT_VAH_1
|
if (strlen(pCellData->m_strFFTVah_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVah_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 37 12 FFT_VAQ_1
|
if (strlen(pCellData->m_strFFTVaq_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVaq_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 38 12 FFT_PK_1
|
if (strlen(pCellData->m_strFFTPK_1))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTPK_1);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 39 12 AVG_GRAY_2
|
if (strlen(pCellData->m_strAvgGray_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgGray_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 40 12 PORTION_2
|
if (strlen(pCellData->m_strPortion_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strPortion_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
//kyh 0622
|
// 41 12 CORNER_GRAY_2
|
if (strlen(pCellData->m_strCorner_Gray_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strCorner_Gray_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 42 12 AVG_AMP_2
|
if (strlen(pCellData->m_strAvgAmp_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgAmp_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 43 12 FFT_VAR_2
|
if (strlen(pCellData->m_strFFTVar_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVar_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 44 12 FFT_VAH_2
|
if (strlen(pCellData->m_strFFTVah_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVah_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 45 12 FFT_VAQ_2
|
if (strlen(pCellData->m_strFFTVaq_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVaq_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 46 12 FFT_PK_2
|
if (strlen(pCellData->m_strFFTPK_2))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTPK_2);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 47 12 AVG_GRAY_3
|
if (strlen(pCellData->m_strAvgGray_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgGray_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 48 12 PORTION_3
|
if (strlen(pCellData->m_strPortion_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strPortion_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
//kyh 0622
|
// 49 12 CORNER_GRAY_3
|
if (strlen(pCellData->m_strCorner_Gray_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strCorner_Gray_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 50 12 AVG_AMP_3
|
if (strlen(pCellData->m_strAvgAmp_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strAvgAmp_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 51 12 FFT_VAR_3
|
if (strlen(pCellData->m_strFFTVar_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVar_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 52 12 FFT_VAH_3
|
if (strlen(pCellData->m_strFFTVah_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVah_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 53 12 FFT_VAQ_3
|
if (strlen(pCellData->m_strFFTVaq_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTVaq_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 54 12 FFT_PK_3
|
if (strlen(pCellData->m_strFFTPK_3))
|
{
|
SPRINTRAW(12, "%s", pCellData->m_strFFTPK_3);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
SPRINTRAWEND; //중요!!! 젤 마지막에 꼭 있어야함!!!(삭제금지) [김태현2020/9/23]
|
}
|
|
BOOL CGlassRawCPJT::makeDataDefect( CString& strLine, CgrmGlassRawData* pData, _grmDefectData* pDefectData )
|
{
|
SPRINTRAWSTART;
|
CString strItem;
|
/* DEFECT ITEM
|
// 01 4 ITEM // ITEM
|
// 02 6 DEFECT // DEFECT
|
// 03 12 ID // Subpanel ID
|
// 04 5 DEF_NO // Defect Number of Panel
|
// 05 7 COORD_X // Defect Location from origin point X
|
// 06 7 COORD_Y // Defect Location from origin point Y
|
// 07 6 GATELINE // Defect Gateline
|
// 08 6 DATALINE // Defect Dataline
|
// 09 4 SIZE_S // Defect Size (Square)
|
// 10 4 SIZE_W // Defect Size (Width)
|
// 11 4 SIZE_L // Defect Size (Length)
|
// 12 4 SIZE_H // Defect Size (Height)
|
// 13 4 GRADE // Defect Grade
|
// 14 4 CODE // Defect Code
|
// 15 2 STACK_FLAG // Current Defect Flag
|
// 16 2 STACK_COUNT // Count of Defect detected step
|
// 17 60 STACK_STEP // Flow(Step) of defect detection
|
// 18 16 IMAGE_FILE // Image file Name
|
// 19 12 DSC Code
|
// 20 12 Image 분류 Code
|
// 21 12 불량이 위치한 Zone No 입력
|
// 22 12 불량 크기 (L,H,M,S)
|
// 23 12 M/N/C/S/K/*
|
// 24 12 미사용
|
// 25 12 미사용
|
// 26 12 전 STEP 판정 D/F 유무
|
// 27 12 Gray Min
|
// 28 12 Gray Max
|
// 29 12 Gray Average
|
// 30 12 Defect Peak
|
// 31 12 미사용
|
// 32 12 미사용
|
// 33 12 Scan 번호
|
// 34 12 Camera ID
|
// 35 12 미사용
|
// 36 12 R_SRC_MIN
|
// 37 12 R_SRC_MAX
|
// 38 12 R_SRC_AVG
|
// 39 12 Scan AI 분류결과
|
// 40 12 Review AI 분류결과
|
// 41 12 검출모드 (Dark or Bright)
|
// 42 12 검출채널 RGB
|
*/
|
|
// 01 4 ITEM // ITEM
|
SPRINTRAW(4, "DATA");
|
// 02 6 DEFECT // DEFECT
|
SPRINTRAW(6, "DEFECT");
|
// 03 12 ID // Subpanel ID
|
SPRINTRAW(12, "%s%c%c", pData->GetGlassData()->m_strGlassID, '0' + pDefectData->m_nCellIdx / 36, g_pCellCode[pDefectData->m_nCellIdx % 36]);
|
// 04 5 DEF_NO // Defect Number of Panel
|
// RAW 파일용 Defect Index
|
//SPRINTRAW(5, "%d", pDefectData->m_nDefectIdx);
|
SPRINTRAW(5, "%d", m_nWriteRawDefectIdx++);
|
// 05 8 COORD_X // Defect Location from origin point X
|
SPRINTRAW(8, "%d", pDefectData->m_nUMCenterAlignX);
|
// 06 8 COORD_Y // Defect Location from origin point Y
|
// 신기대프로 요청 임시 수정
|
SPRINTRAW(8, "%d", pDefectData->m_nUMCenterAlignY*-1);
|
// 07 6 GATELINE // Defect Gateline
|
SPRINTRAW(6, "%d", pDefectData->m_nCellGate);
|
// 08 6 DATALINE // Defect Dataline
|
SPRINTRAW(6, "%d", pDefectData->m_nCellData);
|
// 09 4 SIZE_S // Defect Size (Square)
|
if (abs(pDefectData->m_nPixelSize) > 9999) {
|
SPRINTRAW(4, "%d",9999);
|
}
|
else
|
{
|
SPRINTRAW(4, "%d", pDefectData->m_nPixelSize);
|
}
|
|
// 10 4 SIZE_W // Defect Size (Width)
|
if (abs(pDefectData->m_nUMSizeX) > 9999) {
|
SPRINTRAW(4, "%d", 9999);
|
}
|
else
|
{
|
|
SPRINTRAW(4, "%d", pDefectData->m_nUMSizeX);
|
}
|
|
// 11 4 SIZE_L // Defect Size (Length)
|
if (abs(pDefectData->m_nUMSizeY) > 9999) {
|
SPRINTRAW(4, "%d", 9999);
|
}
|
else
|
{
|
SPRINTRAW(4, "%d", pDefectData->m_nUMSizeY);
|
|
}
|
|
// 12 4 SIZE_H // Defect Size (Height)
|
if (abs(pDefectData->m_nDefectRScale) > 9999) {
|
SPRINTRAW(4, "%d", 9999);
|
}
|
else
|
{
|
strItem.Format("%d", pDefectData->m_nDefectRScale);
|
SPRINTRAW(4, "%.4s", strItem.GetBuffer(0));
|
}
|
|
|
// 13 4 GRADE // Defect Grade
|
SPRINTRAW(4, "%s", GetDefectInfoToString(DMT_DefectJudge, pDefectData->m_DefectJudgement));
|
// 14 4 CODE // Defect Code
|
if (strlen(pDefectData->m_strDefectCode))
|
{
|
SPRINTRAW(4, "%.4s", pDefectData->m_strDefectCode);
|
}
|
else
|
{
|
SPRINTRAW(4, "*");
|
}
|
// 15 2 STACK_FLAG // Current Defect Flag //201221 CJH - TD/SD/PD/SP
|
if (pDefectData->m_StackInfo == Stack_Unknown)
|
{
|
SPRINTRAW(2, "%s", "UK");
|
}
|
else if (pDefectData->m_StackInfo == Stack_TD)
|
{
|
SPRINTRAW(2, "%s", "TD");
|
}
|
else if (pDefectData->m_StackInfo == Stack_SD)
|
{
|
SPRINTRAW(2, "%s", "SD");
|
}
|
else if (pDefectData->m_StackInfo == Stack_PD)
|
{
|
SPRINTRAW(2, "%s", "PD");
|
}
|
else if (pDefectData->m_StackInfo == Stack_SP)
|
{
|
SPRINTRAW(2, "%s", "SP");
|
}
|
else
|
{
|
SPRINTRAW(2, "*");
|
}
|
// 16 2 STACK_COUNT // Count of Defect detected step
|
SPRINTRAW(2, "%2d", pDefectData->m_nStackStepCount);
|
// 17 60 STACK_STEP // Flow(Step) of defect detection
|
if (strlen(pDefectData->m_strStackFirst))
|
{
|
SPRINTRAW(60, "%s", pDefectData->m_strStackFirst);
|
}
|
else
|
{
|
SPRINTRAW(60, "*");
|
}
|
// 18 16 IMAGE_FILE // Image file Name
|
// 검사 이미지 미사용
|
if (strlen(pDefectData->m_ReviewDefect.m_strRevImageName))
|
{
|
SPRINTRAW(16, "%s", pDefectData->m_ReviewDefect.m_strRevImageName);
|
}
|
else
|
{
|
SPRINTRAW(16, "*");
|
}
|
// 19 12 DSC_CODE // Common 01 DSC Code
|
SPRINTRAW(12, "*");
|
// 20 12 VC_CODE // Common 02 Image 분류 Code
|
SPRINTRAW(12, "*");
|
// 21 12 ZONE_NO // Common 03 불량이 위치한 Zone No 입력
|
// Zone Data
|
int nValue = 0;
|
for (int i = 15; i >= 0; i--)
|
{
|
if (pDefectData->m_sZonePixelCount[i] > 0)
|
nValue += 1;
|
if (i > 0)
|
nValue = nValue << 1;
|
}
|
SPRINTRAW(12, "%04X", nValue);
|
|
// 22 12 DEFECT_SIZE // Common 04 불량 크기 (L,H,M,S)
|
if (pDefectData->m_DefectSizeType == SizeType_Small)
|
{
|
SPRINTRAW(12, "S");
|
}
|
else if (pDefectData->m_DefectSizeType == SizeType_Mid)
|
{
|
SPRINTRAW(12, "M");
|
}
|
else if (pDefectData->m_DefectSizeType == SizeType_Large)
|
{
|
SPRINTRAW(12, "L");
|
}
|
else if (pDefectData->m_DefectSizeType == SizeType_Huge)
|
{
|
SPRINTRAW(12, "H");
|
}
|
else if (pDefectData->m_DefectSizeType == SizeType_Ultra)
|
{
|
SPRINTRAW(12, "U");
|
}
|
else
|
{
|
SPRINTRAW(12, "S");
|
}
|
//SizeType_Small
|
// 23 12 REPEAT_DEFECT // Common 05 M/N/C/S/K/*
|
if (pDefectData->m_DefectSubType == DefectSubType_MC)
|
{
|
SPRINTRAW(12, "MC");
|
}
|
else if (pDefectData->m_DefectSubType == DefectSubType_Mask)
|
{
|
SPRINTRAW(12, "MD");
|
}
|
else if (pDefectData->m_DefectSubType == DefectSubType_Common)
|
{
|
SPRINTRAW(12, "CD");
|
}
|
else if (pDefectData->m_DefectSubType == DefectSubType_NoDefect)
|
{
|
SPRINTRAW(12, "NO");
|
}
|
else
|
{
|
SPRINTRAW(12, "N");
|
}
|
// 24 12 // Common 06 미사용 -> WSI 높이 기입
|
//m_nPlanType == ditRaw::RTP_WSI 이걸로 비교하니깐 가끔 비교안되고 넘어감 210205
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
SPRINTRAW(12, "%.03lf", pDefectData->m_ReviewDefect.m_fWsi_ResultData[1]);
|
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 25 12 // Common 07 미사용 -> CS 높이 기입
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
SPRINTRAW(12, "%.03lf", pDefectData->m_ReviewDefect.m_fWsi_ResultData[3]);
|
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 26 12 // Common 08 전 STEP 판정 D/F 유무
|
SPRINTRAW(12, "*");
|
// 27 12 GRAY_MIN // Common 09 Gray Min
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelSrcMin);
|
// 28 12 GRAY_MAX // Common 10 Gray Max
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelSrcMax);
|
// 29 12 GRAY_AVG // Common 11 Gray Average
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelSrcAvg);
|
// 30 12 GRAY_DEF // Common 12 Defect Peak
|
if (static_cast<int>(pDefectData->m_sDefectPeak) == 0)
|
{
|
SPRINTRAW(12, "1");
|
}
|
else
|
{
|
SPRINTRAW(12, "%d", pDefectData->m_sDefectPeak);
|
}
|
|
// 31 NO USE -> WSI Image Name
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
if (strlen(pDefectData->m_ReviewDefect.m_strWsi_3DImageFilename))
|
{
|
SPRINTRAW(12, "%s", pDefectData->m_ReviewDefect.m_strWsi_3DImageFilename);
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 32 NO USE -> CCD Image 유무
|
if (strlen(pDefectData->m_strAoiImageName))
|
{
|
SPRINTRAW(12, "O");
|
}
|
else
|
{
|
SPRINTRAW(12, "X");
|
}
|
// 33 12 CAM_POSITION // Common 15 Scan 번호
|
SPRINTRAW(12, "%d", pDefectData->m_nScanIdx);
|
// 34 12 CAM_POSITION // Common 16 Camera ID
|
SPRINTRAW(12, "%d", pDefectData->m_nCameraID);
|
// 35 12 Defect Idx // Common 25 Defect Idx
|
SPRINTRAW(12, "%d", pDefectData->m_nDefectIdx);
|
// 36 12 R_SRC_MIN // Common 18 R_SRC_MIN
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelRefMin);
|
// 37 12 R_SRC_MAX // Common 19 R_SRC_MAX
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelRefMax);
|
// 38 12 R_SRC_AVG // Common 20 R_SRC_AVG
|
SPRINTRAW(12, "%d", pDefectData->m_nLevelRefAvg);
|
// 39 12 Scan AI 분류결과 // Common 21 고객사 입력==>>>> 0405변경WSI R Height//210405
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
SPRINTRAW(12, "%.03lf", pDefectData->m_ReviewDefect.m_fWsi_ResultData[4]);
|
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 40 12 Review AI 분류결과 // Common 22 고객사 입력==>>>> 0405변경WSI G Height//210405
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
SPRINTRAW(12, "%.03lf", pDefectData->m_ReviewDefect.m_fWsi_ResultData[5]);
|
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 41 12 검출모드 (Dark or Bright) // Common 23 고객사 입력==>>>> 0405변경WSI B Height//210405
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
SPRINTRAW(12, "%.03lf", pDefectData->m_ReviewDefect.m_fWsi_ResultData[6]);
|
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
// 42 12 검출채널 RGB // Common 24 고객사 입력
|
CString strData; // 검출 채널 추가 ex) 0, 1, 2 [ 21-03-23 KJG ]
|
int nLayers = pDefectData->m_nHliLayers;
|
strItem = _T("");
|
for (int i = 0; i < 8; i++)
|
{
|
if (nLayers & 1)
|
{
|
if (strItem.IsEmpty()) strData.Format("%d", i);
|
else strData.Format(",%d", i);
|
strItem += strData;
|
}
|
nLayers = nLayers >> 1;
|
}
|
SPRINTRAW(12, "%s", strItem);
|
|
// 43 12 Compactness //201215 CJH - 43~46 신규 Defect Feature 결과파일 추가
|
SPRINTRAW(12, "%d", pDefectData->m_nCompact);
|
// 44 12 Thickness
|
SPRINTRAW(12, "%d", pDefectData->m_nThickness);
|
// 45 12 Major
|
SPRINTRAW(12, "%d", pDefectData->m_nMajor);
|
// 46 12 Minor
|
SPRINTRAW(12, "%d", pDefectData->m_nMinor);
|
// 47 12 WSI Defect Type 0 normal 1 metal 2Huge 3diffuse 4 trashy
|
if (pDefectData->m_ReviewDefect.m_nWsi_Type == 2)
|
{
|
if (strlen(GetWsiDefectType(pDefectData->m_ReviewDefect.m_fWsi_ResultData[0])))
|
{
|
SPRINTRAW(12, "%s", GetWsiDefectType(pDefectData->m_ReviewDefect.m_fWsi_ResultData[0]));
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
}
|
else
|
{
|
SPRINTRAW(12, "*");
|
}
|
|
// 48 12 Defect Type 추가 [ 21-03-23 KJG ]
|
if (pDefectData->m_DefectType == DefectType_RBlack)
|
{
|
SPRINTRAW(12, "RB");
|
}
|
else if (pDefectData->m_DefectType == DefectType_RWhite)
|
{
|
SPRINTRAW(12, "RW");
|
}
|
else if (pDefectData->m_DefectType == DefectType_TBlack)
|
{
|
SPRINTRAW(12, "TB");
|
}
|
else if (pDefectData->m_DefectType == DefectType_TWhite)
|
{
|
SPRINTRAW(12, "TW");
|
}
|
else
|
{
|
SPRINTRAW(12, "UN");
|
}
|
|
// 49 12 Frame Shrink 정보 추가
|
SPRINTRAW(12, "%d", pDefectData->m_bShrinked);
|
|
// 50 12 CLASS_NO // Zone Classification NO
|
// Zone Data
|
nValue = 0;
|
for (int i = 15; i >= 0; i--)
|
{
|
if (pDefectData->m_sZoneClassPixelCount[i] > 0)
|
nValue += 1;
|
if (i > 0)
|
nValue = nValue << 1;
|
}
|
SPRINTRAW(12, "%04X", nValue);
|
|
SPRINTRAWEND; //중요!!! 젤 마지막에 꼭 있어야함!!!(삭제금지) [김태현2020/9/23]
|
|
return TRUE;
|
}
|
|
BOOL CGlassRawCPJT::ReadMuraFile( CgrmGlassRawData* pData )//0404nwh
|
{
|
CString strMacroFilePath;
|
{
|
strMacroFilePath.Format("%s\\%s", NETWORK_MURARAW_PATH, pData->GetGlassData()->m_strGlassID);
|
|
CFileFind FF;
|
|
if (FF.FindFile(strMacroFilePath))
|
{
|
FF.FindNextFile();
|
strMacroFilePath = FF.GetFilePath();
|
FF.Close();
|
}
|
else
|
{
|
AKLOG("Find Macro File Fail. [%s]", strMacroFilePath);
|
return FALSE;
|
}
|
}
|
////Mura Image Server 특정 폴더에 저장
|
CString strMacroImageSrcPath;
|
CString strMacroImageTarPath;
|
|
strMacroImageSrcPath.Format("%s\\%s", NETWORK_MURA_IMAGE_PATH, pData->GetGlassData()->m_strGlassID);
|
strMacroImageTarPath.Format("%s\\%s\\MuraImage", NETWORK_AOI_IMAGE_PATH, pData->GetGlassData()->m_strGlassID); //생각좀해보자
|
|
//CreateDirectory("D:\\Image\\Defect\\Mura",NULL); 안해도될거같음
|
if (strMacroImageSrcPath.IsEmpty() == FALSE)
|
{
|
AKLOG("Macro Image File Copy Start[%s]", strMacroImageTarPath);
|
CakFileUtil::CopyFolder(strMacroImageSrcPath.GetBuffer(0), strMacroImageTarPath.GetBuffer(0), FALSE);
|
|
if (m_bReviewEndCheck == TRUE)
|
{
|
CakFileUtil::DeleteFolder(strMacroImageSrcPath.GetBuffer(0), FALSE);
|
}
|
AKLOG("Macro Image File Copy End");
|
}
|
|
///Mura 결과파일 읽고 쓰기 삭제
|
if (m_MuraResultFile.openFile_Mura(strMacroFilePath.GetBuffer(0)) == TRUE)
|
{
|
AKLOG("Macro File Read Success : %dItem", m_MuraResultFile.GetSubPanelNum());
|
if (m_bReviewEndCheck == TRUE)
|
{
|
DeleteFile(strMacroFilePath);
|
}
|
}
|
else
|
{
|
AKLOG("Macro File Read Fail[%s]", strMacroFilePath);
|
//DeleteFile(strMacroResultTargetPath);
|
return FALSE;
|
}
|
return TRUE;
|
}
|
|
|
void CGlassRawCPJT::SendMessageFTPUploadRaw( _grmGlassData* pGlassData )
|
{
|
if(pGlassData == NULL) return;
|
HWND hWnd = ::FindWindow(NULL, "FTPUploader");
|
if(hWnd == NULL) return;
|
|
char strServerFolder[256] = {};
|
char strServerFile[256] = {};
|
char strLocalFolder[256] = {};
|
char pLocalFile[256] = {};
|
char strRTMSFile[32] = {};
|
char strServerRawFileSubPath[256] = {};
|
char strServer_SubFileName[32] = {};
|
|
GetFormatDescription(FTPCMD_RAW, strServerFolder, strServerFile, strLocalFolder, pLocalFile, strRTMSFile, strServerRawFileSubPath, strServer_SubFileName,pGlassData); //taek 201211
|
|
CFTPCopyDataParam upParam;
|
strcpy(upParam.m_strServer_FolderName, strServerFolder);
|
strcpy(upParam.m_strServer_FileName, strServerFile);
|
strcpy(upParam.m_strLocal_FolderName, strLocalFolder);
|
strcpy(upParam.m_strLocal_FileName, pLocalFile);
|
strcpy(upParam.m_strServer_SubFilePath, strServerRawFileSubPath);
|
strcpy(upParam.m_strServer_SubFileName, strServer_SubFileName);
|
strcpy(upParam.m_strServer_SignalFolderName, "");
|
strcpy(upParam.m_strServer_SignalFileName, "");
|
strcpy(upParam.m_strRTMS_FileName, ""); //taek 201211
|
upParam.m_nCreateSignalFile = FALSE;//m_ctrlCreateSignal.GetCheck();
|
upParam.m_nSendResultCode = FALSE;//m_ctrlResultAck.GetCheck();
|
upParam.m_nProcessType = CFTPCopyDataParam::FTPProcessType_UpFile;
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
upParam.m_nDataType = CFTPCopyDataParam::FTPDataType_Raw;
|
|
COPYDATASTRUCT cds;
|
cds.dwData = CFTPCopyDataParam::FTPCopyDataCmd_RawUpload;
|
cds.cbData = sizeof(CFTPCopyDataParam);
|
cds.lpData = &upParam;
|
|
DWORD dwReturn = 0;
|
if(SendMessageTimeout(hWnd, WM_COPYDATA, NULL, (LPARAM)&cds, SMTO_NORMAL, 30000, (PDWORD_PTR)(dwReturn)) == FALSE)
|
{
|
}
|
|
}
|
|
void CGlassRawCPJT::SendMessageFTPDownloadStack( _grmGlassData* pGlassData )
|
{
|
if(pGlassData == NULL) return;
|
HWND hWnd = ::FindWindow(NULL, "FTPUploader");
|
if(hWnd == NULL) return;
|
|
char strServerFolder[256] = {};
|
char strServerFile[256] = {};
|
char strLocalFolder[256] = {};
|
char pLocalFile[256] = {};
|
char strRTMSFile[32] = {};
|
char strServerRawFileSubPath[256] = {};
|
char strServer_SubFileName[256] = {};
|
|
GetFormatDescription(FTPCMD_STACK, strServerFolder, strServerFile, strLocalFolder, pLocalFile, strRTMSFile, strServerRawFileSubPath, strServer_SubFileName,pGlassData);
|
|
CFTPCopyDataParam upParam;
|
strcpy(upParam.m_strServer_FolderName, strServerFolder);
|
strcpy(upParam.m_strServer_FileName, strServerFile);
|
strcpy(upParam.m_strLocal_FolderName, strLocalFolder);
|
strcpy(upParam.m_strLocal_FileName, pLocalFile);
|
strcpy(upParam.m_strServer_SignalFolderName, "");
|
strcpy(upParam.m_strServer_SignalFileName, "");
|
strcpy(upParam.m_strRTMS_FileName, "");
|
upParam.m_nCreateSignalFile = FALSE;//m_ctrlCreateSignal.GetCheck();
|
upParam.m_nSendResultCode = FALSE;//m_ctrlResultAck.GetCheck();
|
upParam.m_nProcessType = CFTPCopyDataParam::FTPProcessType_DownFile;
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
upParam.m_nDataType = CFTPCopyDataParam::FTPDataType_Stack;
|
|
COPYDATASTRUCT cds;
|
cds.dwData = CFTPCopyDataParam::FTPCopyDataCmd_RawDownload;
|
cds.cbData = sizeof(CFTPCopyDataParam);
|
cds.lpData = &upParam;
|
|
DWORD dwReturn = 0;
|
if(SendMessageTimeout(hWnd, WM_COPYDATA, NULL, (LPARAM)&cds, SMTO_NORMAL, 20000, (PDWORD_PTR)(dwReturn)) == FALSE)
|
{
|
}
|
}
|
|
void CGlassRawCPJT::SendMessageFTPDownloadDataFile( _grmGlassData* pGlassData )
|
{
|
if(pGlassData == NULL) return;
|
HWND hWnd = ::FindWindow(NULL, "FTPUploader");
|
if(hWnd == NULL) return;
|
|
char strServerFolder[256] = {};
|
char strServerFile[256] = {};
|
char strLocalFolder[256] = {};
|
char pLocalFile[256] = {};
|
char strRTMSFile[32] = {};
|
char strServerRawFileSubPath[256] = {};
|
char strServer_SubFileName[256] = {};
|
|
GetFormatDescription(FTPCMD_RAWMERGE, strServerFolder, strServerFile, strLocalFolder, pLocalFile, strRTMSFile, strServerRawFileSubPath, strServer_SubFileName, pGlassData);
|
|
CFTPCopyDataParam upParam;
|
strcpy(upParam.m_strServer_FolderName, strServerFolder);
|
strcpy(upParam.m_strServer_FileName, strServerFile);
|
strcpy(upParam.m_strLocal_FolderName, strLocalFolder);
|
strcpy(upParam.m_strLocal_FileName, pLocalFile);
|
strcpy(upParam.m_strServer_SignalFolderName, "");
|
strcpy(upParam.m_strServer_SignalFileName, "");
|
upParam.m_nCreateSignalFile = FALSE;//m_ctrlCreateSignal.GetCheck();
|
upParam.m_nSendResultCode = FALSE;//m_ctrlResultAck.GetCheck();
|
upParam.m_nProcessType = CFTPCopyDataParam::FTPProcessType_DownFile;
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
upParam.m_nDataType = CFTPCopyDataParam::FTPDataType_Raw;
|
|
COPYDATASTRUCT cds;
|
cds.dwData = CFTPCopyDataParam::FTPCopyDataCmd_RawDownload;
|
cds.cbData = sizeof(CFTPCopyDataParam);
|
cds.lpData = &upParam;
|
|
DWORD dwReturn = 0;
|
if(SendMessageTimeout(hWnd, WM_COPYDATA, NULL, (LPARAM)&cds, SMTO_NORMAL, 20000, (PDWORD_PTR)(dwReturn)) == FALSE)
|
{
|
}
|
}
|
|
void CGlassRawCPJT::SendMessageFTPUploadImage( _grmGlassData* pGlassData, emFTPCommand sort)
|
{
|
if(pGlassData == NULL) return;
|
HWND hWnd = ::FindWindow(NULL, "FTPUploader");
|
if(hWnd == NULL) return;
|
|
char strServerFolder[256] = {};
|
char strServerFile[32];// = "*.*";
|
char strLocalFolder[256] = {};
|
char strLocalFile[32];// = "*.*";
|
char strRTMSFile[256] = {}; //taek 201211
|
char strServerRawFileSubPath[256] = {};
|
char strServer_SubFileName[256] = {};
|
|
GetFormatDescription(sort, strServerFolder, strServerFile, strLocalFolder, strLocalFile, strRTMSFile, strServerRawFileSubPath, strServer_SubFileName,pGlassData); //taek 201211
|
|
CFTPCopyDataParam upParam;
|
strcpy(upParam.m_strServer_FolderName, strServerFolder);
|
strcpy(upParam.m_strServer_FileName, strServerFile);
|
strcpy(upParam.m_strLocal_FolderName, strLocalFolder);
|
strcpy(upParam.m_strLocal_FileName, strLocalFile);
|
strcpy(upParam.m_strServer_SignalFolderName, "");
|
strcpy(upParam.m_strServer_SignalFileName, "");
|
strcpy(upParam.m_strRTMS_FileName, strRTMSFile); //taek 201211
|
upParam.m_nCreateSignalFile = FALSE;
|
upParam.m_nSendResultCode = FALSE;
|
upParam.m_nProcessType = CFTPCopyDataParam::FTPProcessType_UpFile;
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
upParam.m_nDataType = CFTPCopyDataParam::FTPDataType_Image;
|
|
COPYDATASTRUCT cds;
|
cds.dwData = CFTPCopyDataParam::FTPCopyDataCmd_ImageUpload; // FTP Uploader에서는 구분되어 있지 않음!
|
cds.cbData = sizeof(CFTPCopyDataParam);
|
cds.lpData = &upParam;
|
|
DWORD dwReturn = 0;
|
if(SendMessageTimeout(hWnd, WM_COPYDATA, NULL, (LPARAM)&cds, SMTO_NORMAL, 20000, (PDWORD_PTR)(dwReturn)) == FALSE)
|
{
|
}
|
}
|
|
|
BOOL CGlassRawCPJT::SendMessageFTPUploadIndexFile( _grmGlassData* pGlassData )
|
{
|
if(pGlassData == NULL)
|
return FALSE;
|
|
HWND hWnd = ::FindWindow(NULL, "FTPUploader");
|
if(hWnd == NULL) return FALSE;
|
|
|
char strServerFolder[256] = {};
|
char strServerFile[256] = {};
|
char strLocalFolder[256] = {};
|
char pLocalFile[256] = {};
|
char strRTMSFile[32] = {};
|
char strServerRawFileSubPath[256];
|
char strServer_SubFileName[256] = {};
|
|
GetFormatDescription(FTPCMD_INDEX, strServerFolder, strServerFile, strLocalFolder, pLocalFile, strRTMSFile, strServerRawFileSubPath, strServer_SubFileName, pGlassData);
|
|
|
// if(0)//test
|
// {
|
// sprintf(strServerFolder, "HDD1/DIT/TestC");
|
// ServerFile = "ftptestfile.txt";
|
//
|
// sprintf(strLocalFolder, "D:");
|
// pLocalFile = "ftptestfile.txt";
|
// }
|
|
|
CFTPCopyDataParam upParam;
|
strcpy(upParam.m_strServer_FolderName, strServerFolder);
|
strcpy(upParam.m_strServer_FileName, strServerFile);
|
strcpy(upParam.m_strLocal_FolderName, strLocalFolder);
|
strcpy(upParam.m_strLocal_FileName, pLocalFile);
|
strcpy(upParam.m_strServer_SignalFolderName, "");
|
strcpy(upParam.m_strServer_SignalFileName, "");
|
strcpy(upParam.m_strRTMS_FileName, "");
|
upParam.m_nCreateSignalFile = FALSE;//m_ctrlCreateSignal.GetCheck();
|
upParam.m_nSendResultCode = FALSE;//m_ctrlResultAck.GetCheck();
|
upParam.m_nProcessType = CFTPCopyDataParam::FTPProcessType_UpFile;
|
// [C-PRJ] Image Upload Define - KHT (2020/11/19)
|
upParam.m_nDataType = CFTPCopyDataParam::FTPDataType_Index;
|
|
COPYDATASTRUCT cds;
|
cds.dwData = CFTPCopyDataParam::FTPCopyDataCmd_RawUpload;
|
cds.cbData = sizeof(CFTPCopyDataParam);
|
cds.lpData = &upParam;
|
|
DWORD dwReturn = 0;
|
if(SendMessageTimeout(hWnd, WM_COPYDATA, NULL, (LPARAM)&cds, SMTO_NORMAL, 20000, (PDWORD_PTR)(dwReturn)) == FALSE)
|
{
|
}
|
return TRUE;
|
}
|
|
void CGlassRawCPJT::GetFormatDescription(emFTPCommand sort, char* pServerPath, char* pServerFile, char* pLocalPath, char* pLocalFile, char* pRTMSFile, char* pServerFileSubPath, char* pServerFileSubName, _grmGlassData* pGlassData) //taek 201211
|
{
|
CString strGlassID = pGlassData->m_strGlassID;
|
//For test
|
//if (strlen(strGlassID) == 0) strGlassID = "HPANELID";
|
|
CString strGlassIDLevel6th = strGlassID.Left(6);
|
CString strGlassIDLevel5th = strGlassID.Left(5);
|
CString strGlassIDLevel8th = strGlassID.Left(8);
|
|
CString strLotID = pGlassData->m_strLotID;
|
CString strStepID = pGlassData->m_strStepID;
|
CString strProcessID = pGlassData->m_strProcessID;
|
//For test
|
//if (strlen(strStepID) == 0) strStepID = "F11112";
|
|
strLotID.MakeLower();
|
strStepID.MakeLower();
|
strGlassID.MakeLower();
|
strGlassIDLevel6th.MakeLower();
|
strProcessID.MakeLower();
|
|
switch(sort)
|
{
|
case FTPCMD_AOI_IMAGE:
|
{
|
if(strGlassID.GetLength() > 6)
|
sprintf(pServerPath, "\\%s\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th, strGlassID);
|
else
|
sprintf(pServerPath, "\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th);
|
|
sprintf(pLocalPath, "%s%s", NETWORK_AOI_IMAGE_PATH, strGlassID.GetBuffer(0));
|
strcpy(pServerFile, "*.*");
|
strcpy(pLocalFile, "*.*");
|
}
|
break;
|
case FTPCMD_REVIEW_IMAGE:
|
{
|
CTime time = m_tmFileCreateTime;
|
|
CString strTime = NULL;
|
CString strInsEndTime = NULL;
|
|
strTime = pGlassData->m_tmGlassLoading.Format("%Y%m%d%H%M%S");
|
strInsEndTime = pGlassData->m_tmInspectionEND.Format("%Y%m%d%H%M%S");
|
|
if (strGlassID.GetLength() > 6)
|
sprintf(pServerPath, "\\%s\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th, strGlassID);
|
else
|
sprintf(pServerPath, "\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th);
|
|
sprintf(pLocalPath, "%s%s_%s", LOCAL_REV_IMAGE_PATH, strGlassID.GetBuffer(0), strTime);
|
strcpy(pServerFile, "*.*");
|
strcpy(pLocalFile, "*.*");
|
//Result ini 리뷰 이미지 path 채우기
|
CString strRawFilePathName = NULL;
|
CString strLine = NULL;
|
CString strPath = NULL;
|
strRawFilePathName += LOCAL_RAWPATH_INFO_INI_PATH;
|
strRawFilePathName += RAWINFO_FILE_NAME;
|
FILE* pf = fopen(strRawFilePathName.GetBuffer(0), "a");
|
if(pf != NULL)
|
{
|
strLine = pServerPath;
|
strPath = strLine.Left(strLine.GetLength() - 1);
|
fprintf(pf, "IMGPATH= Z:\%s\n", strPath.GetBuffer(0));
|
fprintf(pf, "DISK=FILESERVER\n");
|
fclose(pf);
|
}
|
|
//RTMS 결과 파일 업로드
|
CString strRTMSPathFileName = NULL;
|
CString strRTMSFileName = NULL;
|
|
strRTMSFileName.Format("%s#%s#%04d%02d%02d%02d%02d%02d.Signal", pGlassData->m_strEquipID, pGlassData->m_strProductID, time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond());
|
|
strRTMSPathFileName += LOCAL_RTMS_INFO_PATH;
|
strRTMSPathFileName += strRTMSFileName;
|
|
// strRTMSFileName = strRawFilePath.Left(strRawFilePath.GetLength()-1); //taek 마지막 값 빼고 가져오기 test
|
|
FILE* pfile = fopen(strRTMSPathFileName.GetBuffer(0), "a");
|
|
sprintf(pRTMSFile, "%s", strRTMSPathFileName); //taek 201211
|
|
if (pfile != NULL)
|
{
|
fprintf(pfile, "MODULE_ID = %s\n", pGlassData->m_strEquipID);
|
fprintf(pfile, "PRODUCT_ID = %s\n", pGlassData->m_strProductID);
|
fprintf(pfile, "PROCESS_ID = %s\n", pGlassData->m_strProcessID);
|
fprintf(pfile, "STEP_ID = %s\n", pGlassData->m_strStepID);
|
fprintf(pfile, "PANEL_ID = %s\n", pGlassData->m_strGlassID);
|
fprintf(pfile, "RESULT = *\n");
|
fprintf(pfile, "REASON_CODE = *\n");
|
fprintf(pfile, "RDP_PATH_RAW = \\cfq1raw1cai1coi%s\n", GetRawFilePath());
|
fprintf(pfile, "RDP_PATH_IMAGE = \\cfq1img1cai1coi%s\n", strLine.Left(strLine.GetLength() - 1));
|
fprintf(pfile, "INSP_TIME = %s\n", strInsEndTime);
|
fclose(pfile);
|
}
|
}
|
break;
|
case FTPCMD_RAW:
|
{
|
CTime time = m_tmFileCreateTime;
|
SetRawFilePath("");
|
|
CString strFileName;//파일생성 시간 때문에 여기서 정확하게 파일명 다시 정정
|
{
|
//Glass 정보
|
CTime CurrTime = m_tmFileCreateTime;
|
CString strTime;
|
strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
|
CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
|
// 시간, 확장자 없앰 [11/20/2020 Server]
|
strFileName.Format("%s", pGlassData->m_strGlassID);
|
strFileName.MakeLower();
|
}
|
/*sprintf(pServerPath, "%s\\%04d%02d%02d\\%s\\%s\\%s\\Data", pGlassData->m_strEquipID, time.GetYear(), time.GetMonth(), time.GetDay(),
|
strGlassIDLevel5th.GetBuffer(0),
|
strGlassIDLevel8th.GetBuffer(0),
|
strGlassID.GetBuffer(0)); */
|
|
//if (strGlassID.GetLength() > 6)
|
// sprintf(pServerPath, "\\%s\\%s\\%s\\%s\\", strLotID, strStepID, strGlassIDLevel6th, strGlassID);
|
//else
|
sprintf(pServerPath, "\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th);
|
|
sprintf(pLocalPath, "%s", pGlassData->m_strPath);
|
|
sprintf(pServerFile, "%s", strFileName.GetBuffer(0));
|
sprintf(pLocalFile, "%s", strFileName.GetBuffer(0));
|
|
CString strServerSubRawFilePath= NULL;
|
CString strServerSubRawFileName = NULL;
|
{
|
strServerSubRawFilePath += NETWORK_AOIRAWFILE_SUB_PATH;
|
|
CString strTime;
|
CTime CurrTime = m_tmFileCreateTime;
|
strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
|
CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
|
// 시간, 확장자 없앰 [11/20/2020 Server]
|
strServerSubRawFileName.Format("\\%s_%s", pGlassData->m_strGlassID, strTime);
|
//strServerSubRawFilePath += strServerSubRawFileName;
|
BOOL bIsBDI = strcmp((pGlassData->m_strLine), _T("BDI")) == 0 ? TRUE : FALSE; // BDI 인 경우 InspectorEnd 시에 SubFile 생성 [ 21-03-23 KJG ]
|
if (m_bReviewEndCheck || bIsBDI) // InspectEnd 시에는 SubFile 미생성 변경 [ 21-03-18 KJG ]
|
{
|
sprintf(pServerFileSubName, "%s", strServerSubRawFileName.GetBuffer(0));
|
sprintf(pServerFileSubPath, "%s", strServerSubRawFilePath.GetBuffer(0));
|
}
|
else
|
{
|
sprintf(pServerFileSubName, "%s", "");
|
sprintf(pServerFileSubPath, "%s", "");
|
}
|
|
}
|
|
//Result ini raw 파일이름(path포함)write
|
CString strRawFilePathName = NULL;
|
CString strLine = NULL;
|
strRawFilePathName += LOCAL_RAWPATH_INFO_INI_PATH;
|
strRawFilePathName += RAWINFO_FILE_NAME;
|
FILE* pf = fopen(strRawFilePathName.GetBuffer(0), "w");
|
if(pf != NULL)
|
{
|
strLine = pServerPath + strFileName;
|
fprintf(pf, "[RESULT_PATH]\n");
|
fprintf(pf, "RAWPATH= X:\%s\n", strLine.GetBuffer(0));
|
SetRawFilePath(strLine.GetBuffer(0));
|
fprintf(pf, "SUMPATH= \n");
|
fclose(pf);
|
}
|
}
|
break;
|
case FTPCMD_STACK:
|
{
|
//201218 CJH - Stack Download 경로 설정
|
sprintf(pServerPath, "\\stack\\%s\\%s\\%s", strProcessID,
|
strStepID,
|
strGlassIDLevel6th.GetBuffer(0));
|
|
sprintf(pServerFile, "%s",
|
strGlassID);
|
|
sprintf(pLocalPath, "%s", m_StackResult.getStackLocalPath());
|
sprintf(pLocalFile, "%s", strGlassID.GetBuffer(0));
|
}
|
break;
|
case FTPCMD_RAWMERGE:
|
{
|
sprintf(pServerPath, "\\%s\\%s\\%s", strProcessID, strStepID,strGlassIDLevel6th.GetBuffer(0)); // 서버 경로 확인후 수정 kjg
|
sprintf(pServerFile, "%s",strGlassID);
|
|
sprintf(pLocalPath, "%s", m_RawMergeResult.getRawMergeLocalPath());
|
sprintf(pLocalFile, "%s", strGlassID.GetBuffer(0));
|
}
|
break;
|
case FTPCMD_MURA_IMAGE: //0404nwh
|
{ //
|
/*CTime time = m_tmFileCreateTime;
|
sprintf(pServerPath, "%s\\%04d%02d%02d\\%s\\%s\\%s\\Image", pGlassData->m_strEquipID, time.GetYear(), time.GetMonth(), time.GetDay(),
|
strGlassIDLevel5th.GetBuffer(0),
|
strGlassIDLevel8th.GetBuffer(0),
|
strGlassID.GetBuffer(0));
|
|
sprintf(pLocalPath, "%s%s", LOCAL_MURA_IMAGE_PATH, strGlassID.GetBuffer(0));
|
strcpy(pServerFile, "*.*");
|
strcpy(pLocalFile, "*.*");*/
|
|
if (strGlassID.GetLength() > 6)
|
sprintf(pServerPath, "\\%s\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th, strGlassID);
|
else
|
sprintf(pServerPath, "\\%s\\%s\\%s\\", strProcessID, strStepID, strGlassIDLevel6th);
|
|
sprintf(pLocalPath, "%s%s", LOCAL_MURA_IMAGE_PATH, strGlassID.GetBuffer(0));
|
strcpy(pServerFile, "*.*");
|
strcpy(pLocalFile, "*.*");
|
}
|
|
break;
|
case FTPCMD_INDEX:
|
{
|
CTime time = m_tmFileCreateTime;
|
sprintf(pServerPath, "INDEX\\%s", pGlassData->m_strEquipID);
|
sprintf(pServerFile, "%04d%02d%02d_%s.csv", time.GetYear(), time.GetMonth(), time.GetDay(), pGlassData->m_strStepID);
|
|
sprintf(pLocalPath, "%s", LOCAL_INDEX_PATH);
|
sprintf(pLocalFile, "%s", pServerFile);
|
}
|
break;
|
|
case FTPCMD_LINK:
|
{
|
CTime time = m_tmFileCreateTime;
|
CString strFileName;//파일생성 시간 때문에 여기서 정확하게 파일명 다시 정정
|
{
|
//Glass 정보
|
CTime CurrTime = m_tmFileCreateTime;
|
CString strTime;
|
strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
|
CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
|
strFileName.Format("%s_%s_%s.csv", pGlassData->m_strOperID, pGlassData->m_strGlassID, strTime.GetBuffer(0));
|
}
|
sprintf(pServerPath, "%s\\%s\\%s\\%s\\%s", "LINK", pGlassData->m_strEquipID,
|
strGlassIDLevel5th.GetBuffer(0),
|
strGlassIDLevel8th.GetBuffer(0),
|
strGlassID.GetBuffer(0));
|
|
sprintf(pLocalPath, "%s", pGlassData->m_strPath);
|
|
sprintf(pServerFile, "%s", strFileName.GetBuffer(0));
|
sprintf(pLocalFile, "%s", strFileName.GetBuffer(0));
|
}
|
break;
|
}
|
|
|
}
|
|
|
|
CString CGlassRawCPJT::GetDefectInfoToString(emDefectMemberType nDefectInfoType, int nParam)
|
{
|
CString sStr;
|
switch(nDefectInfoType)
|
{
|
case DMT_DefectJudge:// Judge
|
{
|
switch (nParam)
|
{
|
case Judge_OK: sStr.Format("OK");
|
break;
|
case Judge_RP: sStr.Format("RP");
|
break;
|
case Judge_NG: sStr.Format("NG");
|
break;
|
case Judge_TR: sStr.Format("TR");
|
break;
|
case Judge_PR: sStr.Format("PR");
|
break;
|
case Judge_PT: sStr.Format("PT");
|
break;
|
case Judge_Review: sStr.Format("RV");
|
break;
|
case Judge_RC: sStr.Format("RC");
|
break;
|
case Judge_Size: sStr.Format("SZ");
|
break;
|
case Judge_VI: sStr.Format("VI");
|
break;
|
case Judge_Rework: sStr.Format("RW");
|
break;
|
case Judge_Unknown: sStr.Format("OK");//sStr.Format("Unknown"); //Unknown도 일단 OK
|
break;
|
default: sStr.Format("OK");//sStr.Format("Ets");
|
break;
|
}
|
}
|
break;
|
|
case DMT_DefectSizeType:
|
{
|
sStr = "S";
|
switch(nParam)
|
{
|
//case SizeType_Unknown: sStr.Format("U"); break;
|
case 1/*SizeType_Small*/: sStr.Format("S");
|
break;
|
case 2/*SizeType_Mid*/: sStr.Format("M");
|
break;
|
case 3/*SizeType_Large*/: sStr.Format("L");
|
break;
|
case 4/*SizeType_Huge*/: sStr.Format("O");
|
break;
|
//case SizeType_Ultra: sStr.Format("Ultra"); break;
|
//default: sStr.Format("Ets"); break;
|
}
|
}
|
break;
|
|
|
}
|
return sStr;
|
}
|
|
CString CGlassRawCPJT::GetWsiDefectType(int nType)
|
{
|
CString strDefectType=_T("");
|
switch (nType)
|
{
|
case 0: strDefectType.Format("normal");
|
break;
|
case 1: strDefectType.Format("metal");
|
break;
|
case 2: strDefectType.Format("huge");
|
break;
|
case 3: strDefectType.Format("diffuse");
|
break;
|
case 4: strDefectType.Format("trashy");
|
break;
|
}
|
return strDefectType;
|
}
|