|
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
|
#include "WorkFileMgr.h"
|
|
|
|
|
|
#include "GlobalDefine.h"
|
|
|
|
|
|
#include "TemplateMgr.h"
|
|
|
|
|
|
#include "WorkFileLable.h"
|
|
|
|
|
|
#include "LogMgr.h"
|
|
|
|
|
|
#include "ModuleDeviceMgr.h"
|
|
|
|
|
|
#include "ModuleDrawMgr.h"
|
|
|
|
|
|
#include "ObjComponentMgr.h"
|
|
|
|
|
|
#include "MsgBox.h"
|
|
|
|
|
|
#include "ProductMgr.h"
|
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
|
#include "LaserDeviceMgr.h"
|
|
|
|
|
|
#include "MarkAreaMgr.h"
|
|
|
|
|
|
#include "FileMgr.h"
|
|
|
|
|
|
#include "OptoWaveLaserMgr.h"
|
|
|
|
|
|
#include "Laser.h"
|
|
|
|
|
|
#include "PlatformXY.h"
|
|
|
|
|
|
#include "CommonFlowMgr.h"
|
|
|
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
|
|
|
#include "ProgramCspMarkMgr.h"
|
|
|
|
|
|
#include "SemiSecsCommMgr.h"
|
|
|
|
|
|
#include "ExceptionMsg.h"
|
|
|
|
|
|
#include "ProgressMgr.h"
|
|
|
|
|
|
#include "DlgProgress.h"
|
|
|
|
|
|
#include "PIWaveLaserMgr.h"
|
|
|
|
|
|
#include "DeviceState.h"
|
|
|
|
|
|
|
|
|
|
|
|
CString CWorkFileMgr::m_CurOpenFile;
|
|
|
|
|
|
bool CWorkFileMgr::m_bManualOpr = false;
|
|
|
|
|
|
CWorkFileMgr::CWorkFileMgr(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
CWorkFileMgr::~CWorkFileMgr(void)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
#if 1
|
|
|
|
|
|
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
bool CWorkFileMgr::IsOpenFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_CurOpenFile == "")
|
|
|
|
|
|
{
|
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
|
MsgBox.Show("δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>!");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
void CWorkFileMgr::OnOpenFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
TCHAR szFilters[]=("MAK <20>ļ<EFBFBD>(*.mak)|*.mak");
|
|
|
|
|
|
CFileDialog dlg(TRUE,("mak"),("MarkFile"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilters);
|
|
|
|
|
|
CString Path = gCommonFlowMgr->GetWorkFileDefualtPath();
|
|
|
|
|
|
dlg.m_ofn.lpstrInitialDir = Path;
|
|
|
|
|
|
if(dlg.DoModal()==IDOK)
|
|
|
|
|
|
{
|
|
|
|
|
|
OpenFileByPath(dlg.GetPathName());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::OpenFileByPath(CString Path)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString s = "OpenFile: ";
|
|
|
|
|
|
s += Path;
|
|
|
|
|
|
CString sMapFileName = gProgramCspMarkMgr->GetCurCspWaferParRef().m_sMapFileName;
|
|
|
|
|
|
gLogMgr->WriteDebugLog(s);
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(1), 3);
|
|
|
|
|
|
bool ReadRes= ReadWorkFile(Path);
|
|
|
|
|
|
if (!ReadRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(3), 3);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><>¼<EFBFBD><C2BC>ǰ<EFBFBD><EFBFBD><F2BFAAB5>ļ<EFBFBD><C4BC><EFBFBD>------------------------------------------
|
|
|
|
|
|
SaveFileName(Path);
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(2), 3);
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurOpenRecipe(Path);
|
|
|
|
|
|
gProgramCspMarkMgr->GetCurCspWaferParRef().m_sMapFileName = sMapFileName;
|
|
|
|
|
|
if (!gProgramCspMarkMgr->GetCurCspWaferParRef().m_sMapFileName.IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
OnOpenMapFile(gProgramCspMarkMgr->GetCurCspWaferParRef().m_sMapFileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
gProgramCspMarkMgr->SetCurMakFilePath(Path);
|
|
|
|
|
|
CLayer &Layer = GetLayerInstance();
|
|
|
|
|
|
Layer.ResetMapDieModeTXT();
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|
|
|
|
|
gProgramCspMarkMgr->ResetCurSelMarkEnd();
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(3), 3);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CWorkFileMgr::OpenFileByPathEAP(CString Path)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString s = "OpenFile: ";
|
|
|
|
|
|
s += Path;
|
|
|
|
|
|
gLogMgr->WriteDebugLog(s);
|
|
|
|
|
|
|
|
|
|
|
|
ReadWorkFile(Path);
|
|
|
|
|
|
#ifdef NEW_SCP
|
|
|
|
|
|
#else
|
|
|
|
|
|
GetFrame()->m_DlgDeviceState.m_CurOpenRecipe = Path;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurOpenRecipe(Path);
|
|
|
|
|
|
|
|
|
|
|
|
CLayer &Layer = GetLayerInstance();
|
|
|
|
|
|
Layer.ResetMapDieModeTXT();
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|
|
|
|
|
gProgramCspMarkMgr->ResetCurSelMarkEnd();
|
|
|
|
|
|
}
|
|
|
|
|
|
void CWorkFileMgr::OnOpenMapFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
TCHAR szFilters[] = ("TXT <20>ļ<EFBFBD>(*.txt)|*.txt|All Files (*.*)|*.*||");
|
|
|
|
|
|
CFileDialog dlg(TRUE, ("txt"), ("MarkFile"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilters);
|
|
|
|
|
|
CString Path = gCommonFlowMgr->GetWorkFileDefualtPath();
|
|
|
|
|
|
dlg.m_ofn.lpstrInitialDir = Path;
|
|
|
|
|
|
if (dlg.DoModal() == IDOK)
|
|
|
|
|
|
{
|
|
|
|
|
|
int type = 0;
|
|
|
|
|
|
CFileMgr FileMgr;
|
|
|
|
|
|
CString filepath;
|
|
|
|
|
|
if (!gProgramCspMarkMgr->GetCurMakFilePath().IsEmpty())
|
|
|
|
|
|
filepath = gProgramCspMarkMgr->GetCurMakFilePath();
|
|
|
|
|
|
else
|
|
|
|
|
|
FileMgr.GetFullFilePath(filepath, MAK_FILE_PATH);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|
|
|
|
|
|
|
|
|
|
|
if (dlg.GetPathName().Find(".txt") >= 0
|
|
|
|
|
|
|| dlg.GetPathName().Find(".TXT") >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* fp;
|
|
|
|
|
|
fp = fopen(dlg.GetPathName(), "r");
|
|
|
|
|
|
if (!fp)
|
|
|
|
|
|
return;
|
|
|
|
|
|
char buffer[1024];
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
if (fgets(buffer, sizeof(buffer), fp) != nullptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = buffer;
|
|
|
|
|
|
if (str.Find("DEVICE:") != -1)
|
|
|
|
|
|
type = 1;
|
|
|
|
|
|
else if (str.Find("ID :") != -1)
|
|
|
|
|
|
type = 0;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (dlg.GetPathName().Find(".req") >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
|
MsgBox.Show("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (dlg.GetPathName().Find(".mak") >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString name = dlg.GetPathName();
|
|
|
|
|
|
//CDlgProgress dlg;
|
|
|
|
|
|
///gProgressMgr.SetWorkProgress(&dlg.GetProgress());
|
|
|
|
|
|
//std::thread t = std::thread([this, name]()
|
|
|
|
|
|
//{
|
|
|
|
|
|
OpenFileByPath(name);
|
|
|
|
|
|
//});
|
|
|
|
|
|
//dlg.DoModal();
|
|
|
|
|
|
//t.join();
|
|
|
|
|
|
//gProgressMgr.SetWorkProgress(NULL);
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
type = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OpenMapFileByPath(filepath,
|
|
|
|
|
|
dlg.GetPathName(), type);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::OnOpenMapFile(CString mapFile)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!mapFile.IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
int type = 0;
|
|
|
|
|
|
CFileMgr FileMgr;
|
|
|
|
|
|
CString filepath;
|
|
|
|
|
|
if (!gProgramCspMarkMgr->GetCurMakFilePath().IsEmpty())
|
|
|
|
|
|
filepath = gProgramCspMarkMgr->GetCurMakFilePath();
|
|
|
|
|
|
else
|
|
|
|
|
|
FileMgr.GetFullFilePath(filepath, MAK_FILE_PATH);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|
|
|
|
|
if (mapFile.Find(".txt") >= 0
|
|
|
|
|
|
|| mapFile.Find(".TXT") >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* fp;
|
|
|
|
|
|
fp = fopen(mapFile, "r");
|
|
|
|
|
|
if (!fp)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
char buffer[1024];
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
if (fgets(buffer, sizeof(buffer), fp) != nullptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = buffer;
|
|
|
|
|
|
if (str.Find("DEVICE:") != -1)
|
|
|
|
|
|
type = 1;
|
|
|
|
|
|
else if (str.Find("ID :") != -1)
|
|
|
|
|
|
type = 0;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (mapFile.Find(".mak") >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return OpenFileByPath(mapFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
type = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return OpenMapFileByPath(filepath,
|
|
|
|
|
|
mapFile, type);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::OpenMapFileByPath(CString Path, CString mapFile, int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString s = "OpenFile: ";
|
|
|
|
|
|
s += Path;
|
|
|
|
|
|
gLogMgr->WriteDebugLog(s);
|
|
|
|
|
|
|
|
|
|
|
|
bool ReadRes = ReadWorkMapFile(Path, mapFile, type);
|
|
|
|
|
|
if (!ReadRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
//AfxMessageBox("<22><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>");
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><>¼<EFBFBD><C2BC>ǰ<EFBFBD><EFBFBD><F2BFAAB5>ļ<EFBFBD><C4BC><EFBFBD>------------------------------------------
|
|
|
|
|
|
SaveMapFileName(Path);
|
|
|
|
|
|
|
|
|
|
|
|
gSemiSecsCommMgr->SetCurOpenRecipe(Path);
|
|
|
|
|
|
|
|
|
|
|
|
CLayer &Layer = GetLayerInstance();
|
|
|
|
|
|
Layer.ResetMapDieModeTXT();
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|
|
|
|
|
gProgramCspMarkMgr->ResetCurSelMarkEnd();
|
|
|
|
|
|
|
|
|
|
|
|
gObjComponentMgr->SetMapFileOpened(true);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::ReadWorkMapFile(CString FilePath, CString mapFile, int type, bool bCreatCspWaferData)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>----------------------------------------------------------
|
|
|
|
|
|
vector<CLab> LabVec;
|
|
|
|
|
|
bool ReadRes = ReadWorkFileExt(FilePath, LabVec);
|
|
|
|
|
|
if (!ReadRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (LabVec.empty())
|
|
|
|
|
|
{
|
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD><EFBFBD>ȡ<EFBFBD>ļ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>", _LOG_ERROR);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>ģ<EFBFBD><C4A3>------------------------------------------------------------
|
|
|
|
|
|
CLabVecRang LabVecRang(LabVec, 0, LabVec.size() - 1);
|
|
|
|
|
|
vector<CLabVecRang> LabVecRangVec;
|
|
|
|
|
|
|
|
|
|
|
|
SeparateStrVec(LabVecRang, LabVecRangVec, LAB_MODULE_START, LAB_MODULE_END);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ÿ<EFBFBD><C3BF>ģ<EFBFBD><C4A3>---------------------------------------------------
|
|
|
|
|
|
vector<CLabVecRang>::iterator iter = LabVecRangVec.begin();
|
|
|
|
|
|
vector<CLabVecRang>::iterator iter_end = LabVecRangVec.end();
|
|
|
|
|
|
for (; iter != iter_end; iter++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (gModuleDrawMgr.ReadWorkFile(*iter))
|
|
|
|
|
|
continue;//<2F><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>ȡ
|
|
|
|
|
|
gModuleDeviceMgr.ReadWorkFile(*iter);
|
|
|
|
|
|
}
|
|
|
|
|
|
//GetMainDlgPtr()->PostMessageA(WM_PROCESS_OPENFILE, 0, 0);
|
|
|
|
|
|
//CDlgProgress dlg;
|
|
|
|
|
|
//gProgressMgr.SetWorkProgress(&dlg.GetProgress());
|
|
|
|
|
|
//std::thread t = std::thread([this, mapFile, type, bCreatCspWaferData]()
|
|
|
|
|
|
//{
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
return OpenMapExtern(mapFile, type, bCreatCspWaferData);
|
|
|
|
|
|
//});
|
|
|
|
|
|
//dlg.DoModal();
|
|
|
|
|
|
//t.join();
|
|
|
|
|
|
//gProgressMgr.SetWorkProgress(NULL);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CWorkFileMgr::OpenMapExtern(CString mapFile, int type, bool bCreatCspWaferData)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bCreatCspWaferData)
|
|
|
|
|
|
{
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(1), 3);
|
|
|
|
|
|
|
|
|
|
|
|
CCspWaferPar waferPar = gProgramCspMarkMgr->GetCurCspWaferPar();
|
|
|
|
|
|
CString name = waferPar.m_FontName;
|
|
|
|
|
|
CCspWaferPar wPar;
|
|
|
|
|
|
MapData vData;
|
|
|
|
|
|
if (type == 0)
|
|
|
|
|
|
ResolvingTxtFile(mapFile, wPar, vData);
|
|
|
|
|
|
else if (type == 1)
|
|
|
|
|
|
ResolvingSinfFile(mapFile, wPar, vData);
|
|
|
|
|
|
else if (type == 2)
|
|
|
|
|
|
ResolvingTskFile(mapFile, wPar, vData);
|
|
|
|
|
|
|
|
|
|
|
|
if (wPar != waferPar
|
|
|
|
|
|
&& !gProgramCspMarkMgr->GetCurMakFilePath().IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(3), 3);
|
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
str.Format("size.w %f==%f size.h %f=%f row %d==%d col %d==%d file:%s",
|
|
|
|
|
|
wPar.m_DieSize.w, waferPar.m_DieSize.w, wPar.m_DieSize.h, waferPar.m_DieSize.h,
|
|
|
|
|
|
wPar.m_ArrayXcnt, waferPar.m_ArrayXcnt, wPar.m_ArrayYcnt, waferPar.m_ArrayYcnt, mapFile);
|
|
|
|
|
|
MsgBox.Show("Map<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>Recipe<EFBFBD>Ա<EFBFBD>ʧ<EFBFBD><EFBFBD>", str);
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
waferPar.m_sMapFileName = mapFile;
|
|
|
|
|
|
waferPar.m_nTotalDieSize = wPar.m_nTotalDieSize;
|
|
|
|
|
|
waferPar.m_nBin1DieSize = wPar.m_nBin1DieSize;
|
|
|
|
|
|
waferPar.m_nBinFailSize = wPar.m_nBinFailSize;
|
|
|
|
|
|
waferPar.m_ArrayXcnt = wPar.m_ArrayXcnt;
|
|
|
|
|
|
waferPar.m_ArrayYcnt = wPar.m_ArrayYcnt;
|
|
|
|
|
|
waferPar.m_DieSize = wPar.m_DieSize;
|
|
|
|
|
|
waferPar.m_WaferDia = wPar.m_WaferDia;
|
|
|
|
|
|
waferPar.m_DieAngle = wPar.m_DieAngle;
|
|
|
|
|
|
waferPar.m_FirstDieCoord = wPar.m_FirstDieCoord;
|
|
|
|
|
|
waferPar.m_mapBinCode = wPar.m_mapBinCode;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//waferPar.m_WaferDia = max((int)(waferPar.m_ArrayYcnt*waferPar.m_DieSize.h), (int)(waferPar.m_ArrayXcnt*waferPar.m_DieSize.w));
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(2), 3);
|
|
|
|
|
|
gProgramCspMarkMgr->SetCurCspWaferPar(waferPar);
|
|
|
|
|
|
gProgramCspMarkMgr->CreatCspWaferData(vData);
|
|
|
|
|
|
gProgressMgr.SetCurProgress(static_cast<int>(3), 3);
|
|
|
|
|
|
//OnSaveFile();
|
|
|
|
|
|
}
|
|
|
|
|
|
if (gProgramCspMarkMgr->IsbOldFileVersion20200714())
|
|
|
|
|
|
{
|
|
|
|
|
|
CLayer &layer = GetLayerInstance();
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Txt BasePt Ϊ<><CEAA><EFBFBD>ĵ<EFBFBD>
|
|
|
|
|
|
layer.UpdateObjTxtBasePt();
|
|
|
|
|
|
}
|
|
|
|
|
|
gProgramCspMarkMgr->SetbOldFileVersion20200714(false);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CWorkFileMgr::ResolvingSinfFile(CString FilePath,CCspWaferPar& waferPar,MapData& mapData)
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* fp;
|
|
|
|
|
|
fp = fopen(FilePath, "r");
|
|
|
|
|
|
if (!fp)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
char buffer[1024]; // <20><><EFBFBD><EFBFBD>ÿ<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>1024<32>ֽ<EFBFBD>
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
int startY = 0;
|
|
|
|
|
|
int startX = 0;
|
|
|
|
|
|
bool bForReverseX = false;//true <20><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
|
bool bForReverseY = false;//true <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while (fgets(buffer, sizeof(buffer), fp) != nullptr) {
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
str = buffer;
|
|
|
|
|
|
str.Replace("\n", "");
|
|
|
|
|
|
int CommaPosPer = str.Find("REFPX:", 0);
|
|
|
|
|
|
if (str.Find("REFPX:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("REFPX:") + 1);
|
|
|
|
|
|
//waferPar.m_FirstDieCoord.x = atof(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("REFPY:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("REFPY:") + 1);
|
|
|
|
|
|
//waferPar.m_FirstDieCoord.y = atof(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("FNLOC:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("FNLOC:") + 1);
|
|
|
|
|
|
waferPar.m_DieAngle = atoi(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("XDIES:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("XDIES:") + 1);
|
|
|
|
|
|
waferPar.m_DieSize.w = atof(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("YDIES:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("YDIES:") + 1);
|
|
|
|
|
|
waferPar.m_DieSize.h = atof(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("ROWCT:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("ROWCT:") + 1);
|
|
|
|
|
|
waferPar.m_ArrayYcnt = atoi(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("COLCT:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("COLCT:") + 1);
|
|
|
|
|
|
waferPar.m_ArrayXcnt = atoi(str);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>90<39>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if ((waferPar.m_DieAngle / 90) % 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
int t = waferPar.m_ArrayXcnt;
|
|
|
|
|
|
waferPar.m_ArrayXcnt = waferPar.m_ArrayYcnt;
|
|
|
|
|
|
waferPar.m_ArrayYcnt = t;
|
|
|
|
|
|
|
|
|
|
|
|
bForReverseX = false;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bForReverseY = true; //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
i = (waferPar.m_ArrayYcnt / 2 + waferPar.m_ArrayYcnt % 2);
|
|
|
|
|
|
|
|
|
|
|
|
startY = -waferPar.m_ArrayYcnt / 2;
|
|
|
|
|
|
startX = -waferPar.m_ArrayXcnt / 2;
|
|
|
|
|
|
if (waferPar.m_ArrayYcnt % 2 == 0) startY += 1;
|
|
|
|
|
|
if (waferPar.m_ArrayXcnt % 2 == 0) startX += 1;
|
|
|
|
|
|
//i = info.iFirstY - info.iCenterY;
|
|
|
|
|
|
//j = info.iFirstX - info.iCenterX;
|
|
|
|
|
|
if (bForReverseY) startY *= -1;
|
|
|
|
|
|
if (bForReverseX) startX *= -1;
|
|
|
|
|
|
i = startY;
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("RowData:", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("RowData:") + 1);
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
int CommaPosPer = 0;
|
|
|
|
|
|
do {
|
|
|
|
|
|
CommaPosPer = str.Find(" ", CommaPosPer);
|
|
|
|
|
|
CString sTemp = str.Left(CommaPosPer);
|
|
|
|
|
|
str = str.Right(str.GetLength() - CommaPosPer - 1);
|
|
|
|
|
|
if (sTemp != "___"
|
|
|
|
|
|
&& !sTemp.IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sTemp == "@@@")
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(i, j, false, 0, "");
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(i, j, true, 0, sTemp.GetBuffer(0));
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!bForReverseX)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
++j;
|
|
|
|
|
|
else //<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
|
--j;
|
|
|
|
|
|
} while (CommaPosPer >= 0);
|
|
|
|
|
|
|
|
|
|
|
|
if (bForReverseY) //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
--i;
|
|
|
|
|
|
else //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
|
|
|
|
|
++i;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
double scientificToDecimal(std::string scientificStr)
|
|
|
|
|
|
{
|
|
|
|
|
|
size_t ePos = scientificStr.find('e');
|
|
|
|
|
|
if (ePos == std::string::npos)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw std::invalid_argument("String is not in scientific notation");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double coefficient = std::stod(scientificStr.substr(0, ePos));
|
|
|
|
|
|
int exponent = std::stoi(scientificStr.substr(ePos + 1));
|
|
|
|
|
|
return coefficient * std::pow(10.0, exponent);
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::ResolvingTxtFile(CString FilePath, CCspWaferPar& waferPar, MapData& mapData)
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* fp;
|
|
|
|
|
|
fp = fopen(FilePath, "r");
|
|
|
|
|
|
if (!fp)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
char buffer[1024]; // <20><><EFBFBD><EFBFBD>ÿ<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>1024<32>ֽ<EFBFBD>
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
int startY = 0;
|
|
|
|
|
|
int startX = 0;
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
bool bForReverseX = false;//true <20><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
|
bool bForReverseY = false;//true <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
while (fgets(buffer, sizeof(buffer), fp) != nullptr) {
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
str = buffer;
|
|
|
|
|
|
str.Replace("\n", "");
|
|
|
|
|
|
int CommaPosPer = str.Find("Ref Points :", 0);
|
|
|
|
|
|
if (str.Find("Ref Points :", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("Ref Points :") - 1);
|
|
|
|
|
|
CommaPosPer = str.Find("_", 0);
|
|
|
|
|
|
if (CommaPosPer != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
int nPos = str.Find(",", 0);
|
|
|
|
|
|
if (nPos != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString value = str.Mid(CommaPosPer + 1, nPos - CommaPosPer - 1);
|
|
|
|
|
|
//waferPar.m_FirstDieCoord.x = atof(value);
|
|
|
|
|
|
str = str.Right(str.GetLength() - nPos - 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
CommaPosPer = str.Find("_", 0);
|
|
|
|
|
|
if (CommaPosPer != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//waferPar.m_FirstDieCoord.y = atof(str.Right(str.GetLength() - CommaPosPer - 1));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("X_step=", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("X_step=") - 1);
|
|
|
|
|
|
int CommaPosPer = str.Find("*", 0);
|
|
|
|
|
|
if (CommaPosPer != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString value = str.Left(CommaPosPer);
|
|
|
|
|
|
waferPar.m_DieSize.w = atof(value);
|
|
|
|
|
|
str = str.Right(str.GetLength() - CommaPosPer - 1);
|
|
|
|
|
|
int posL = str.Find("(", 0);
|
|
|
|
|
|
int posR = str.Find(")", 0);
|
|
|
|
|
|
if (posL != -1
|
|
|
|
|
|
&& posR != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
value = str.Mid(posL + 1, posR - posL - 1);
|
|
|
|
|
|
value.Replace("^", "e");
|
|
|
|
|
|
waferPar.m_DieSize.w *= scientificToDecimal(value.GetBuffer(0));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("Y_step=", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("Y_step=") - 1);
|
|
|
|
|
|
int CommaPosPer = str.Find("*", 0);
|
|
|
|
|
|
if (CommaPosPer != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
CString value = str.Left(CommaPosPer);
|
|
|
|
|
|
waferPar.m_DieSize.h = atof(value);
|
|
|
|
|
|
str = str.Right(str.GetLength() - CommaPosPer - 1);
|
|
|
|
|
|
int posL = str.Find("(", 0);
|
|
|
|
|
|
int posR = str.Find(")", 0);
|
|
|
|
|
|
if (posL != -1
|
|
|
|
|
|
&& posR != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
value = str.Mid(posL + 1, posR - posL - 1);
|
|
|
|
|
|
value.Replace("^", "e");
|
|
|
|
|
|
waferPar.m_DieSize.h *= scientificToDecimal(value.GetBuffer(0));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("Flat(degree) :", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("Flat(degree) :") - 1);
|
|
|
|
|
|
waferPar.m_DieAngle =atoi(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("_Row Count :", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("_Row Count :") - 1);
|
|
|
|
|
|
waferPar.m_ArrayYcnt = atoi(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.Find("_Column count :", 0) != -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
str = str.Right(str.GetLength() - sizeof("_Column count :") - 1);
|
|
|
|
|
|
waferPar.m_ArrayXcnt = atoi(str);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>90<39>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if ((waferPar.m_DieAngle / 90) % 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
int t = waferPar.m_ArrayXcnt;
|
|
|
|
|
|
waferPar.m_ArrayXcnt = waferPar.m_ArrayYcnt;
|
|
|
|
|
|
waferPar.m_ArrayYcnt = t;
|
|
|
|
|
|
|
|
|
|
|
|
bForReverseX = false;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bForReverseY = true; //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
i = (waferPar.m_ArrayYcnt / 2 + waferPar.m_ArrayYcnt % 2);
|
|
|
|
|
|
|
|
|
|
|
|
startY = -waferPar.m_ArrayYcnt / 2;
|
|
|
|
|
|
startX = -waferPar.m_ArrayXcnt / 2;
|
|
|
|
|
|
if (waferPar.m_ArrayYcnt % 2 == 0) startY += 1;
|
|
|
|
|
|
if (waferPar.m_ArrayXcnt % 2 == 0) startX += 1;
|
|
|
|
|
|
//i = info.iFirstY - info.iCenterY;
|
|
|
|
|
|
//j = info.iFirstX - info.iCenterX;
|
|
|
|
|
|
if (bForReverseY) startY *= -1;
|
|
|
|
|
|
if (bForReverseX) startX *= -1;
|
|
|
|
|
|
i = startY;
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.GetAt(0)!='/')
|
|
|
|
|
|
{
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
while (!str.IsEmpty())
|
|
|
|
|
|
{
|
|
|
|
|
|
if (str.GetAt(0) == 'x')
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(i, j, false, 0, "");
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (str.GetAt(0) != '.')
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(i, j, true, 0, str.Left(1).GetBuffer(0));
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
}
|
|
|
|
|
|
str.Delete(0, 1);
|
|
|
|
|
|
|
|
|
|
|
|
if (!bForReverseX)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
++j;
|
|
|
|
|
|
else //<2F><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
|
--j;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (bForReverseY) //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
--i;
|
|
|
|
|
|
else //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>
|
|
|
|
|
|
++i;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
char getBit(char ch, int position)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (position < 0 || position > 7) {
|
|
|
|
|
|
std::cerr << "Position must be between 0 and 7." << std::endl;
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
// <20><>λ<EFBFBD><CEBB>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA>λλ<CEBB><CEBB>
|
|
|
|
|
|
int shift = 7 - position;
|
|
|
|
|
|
// ʹ<><CAB9>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡλֵ
|
|
|
|
|
|
return (ch >> shift) & 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::ResolvingTskFile(CString FilePath, CCspWaferPar& waferPar, MapData& mapData)
|
|
|
|
|
|
{
|
|
|
|
|
|
FILE* fp;
|
|
|
|
|
|
fp = fopen(FilePath, "rb");
|
|
|
|
|
|
if (!fp)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned char buffer[1024]; // <20><><EFBFBD><EFBFBD>ÿ<EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>1024<32>ֽ<EFBFBD>
|
|
|
|
|
|
CString str;
|
|
|
|
|
|
TskMapHeadInfo info;
|
|
|
|
|
|
TskDie1Byte die1;
|
|
|
|
|
|
TskDie2Byte die2;
|
|
|
|
|
|
TskDie3Byte die3;
|
|
|
|
|
|
bool bForReverseX = false;//true <20><><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>
|
|
|
|
|
|
bool bForReverseY = false;//true <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
//while (fgets(buffer, sizeof(buffer), fp) != nullptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
str = buffer;
|
|
|
|
|
|
int n = fread(buffer, 1, sizeof(TskMapHeadInfo), fp);
|
|
|
|
|
|
info = *(TskMapHeadInfo*)buffer;
|
|
|
|
|
|
info.SwapInt();
|
|
|
|
|
|
|
|
|
|
|
|
waferPar.m_DieSize.h = info.iSizeY * 1.0 / 100000.0;
|
|
|
|
|
|
waferPar.m_DieSize.w = info.iSizeX * 1.0 / 100000.0;
|
|
|
|
|
|
waferPar.m_ArrayXcnt = info.iCols;
|
|
|
|
|
|
waferPar.m_ArrayYcnt = info.iRows;
|
|
|
|
|
|
waferPar.m_WaferDia = max((int)(waferPar.m_ArrayYcnt*waferPar.m_DieSize.h), (int)(waferPar.m_ArrayXcnt*waferPar.m_DieSize.w));
|
|
|
|
|
|
waferPar.m_FirstDieCoord.x = info.iOffsetCenterX * 1.0 / 100000.0;
|
|
|
|
|
|
waferPar.m_FirstDieCoord.y = info.iOffsetCenterY * 1.0 / 100000.0;
|
|
|
|
|
|
waferPar.m_DieAngle = info.iAngle;
|
|
|
|
|
|
if (info.iSize == 60)
|
|
|
|
|
|
{
|
|
|
|
|
|
waferPar.m_WaferDia = 150;
|
|
|
|
|
|
gProgramCspMarkMgr->SetCspWaferType(_CspWaferType_6);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (info.iSize == 80)
|
|
|
|
|
|
{
|
|
|
|
|
|
waferPar.m_WaferDia = 200;
|
|
|
|
|
|
gProgramCspMarkMgr->SetCspWaferType(_CspWaferType_8);
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>90<39>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if ((waferPar.m_DieAngle / 90) % 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
int t = waferPar.m_ArrayXcnt;
|
|
|
|
|
|
waferPar.m_ArrayXcnt = waferPar.m_ArrayYcnt;
|
|
|
|
|
|
waferPar.m_ArrayYcnt = t;
|
|
|
|
|
|
info.iRows = waferPar.m_ArrayYcnt;
|
|
|
|
|
|
info.iCols = waferPar.m_ArrayXcnt;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD>ݽǶȣ<C7B6>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if (waferPar.m_DieAngle == 180)
|
|
|
|
|
|
{
|
|
|
|
|
|
bForReverseX = false; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
bForReverseY = true; //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////X<><58><EFBFBD><EFBFBD> 1:left 2:right
|
|
|
|
|
|
//if (info.cXDirect == 1)
|
|
|
|
|
|
// bForReverseX = false;
|
|
|
|
|
|
//else
|
|
|
|
|
|
// bForReverseX = true;
|
|
|
|
|
|
////Y<><59><EFBFBD><EFBFBD> 1:forward 2:backward
|
|
|
|
|
|
//if (info.cYDirect == 1)
|
|
|
|
|
|
// bForReverseY = false;
|
|
|
|
|
|
//else
|
|
|
|
|
|
// bForReverseY = true;
|
|
|
|
|
|
//<2F><>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>DIE<49><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int startY = -info.iRows / 2;
|
|
|
|
|
|
int startX = -info.iCols / 2;
|
|
|
|
|
|
if (info.iRows % 2 == 0) startY += 1;
|
|
|
|
|
|
if (info.iCols % 2 == 0) startX += 1;
|
|
|
|
|
|
//i = info.iFirstY - info.iCenterY;
|
|
|
|
|
|
//j = info.iFirstX - info.iCenterX;
|
|
|
|
|
|
if (bForReverseY) startY *= -1;
|
|
|
|
|
|
if (bForReverseX) startX *= -1;
|
|
|
|
|
|
i = startY;
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
|
|
|
|
|
|
int count = info.iCols * info.iRows;
|
|
|
|
|
|
|
|
|
|
|
|
while (count--)
|
|
|
|
|
|
{
|
|
|
|
|
|
n = fread(buffer, 1, 2, fp);
|
|
|
|
|
|
die1.Conver(*(unsigned short*)buffer);
|
|
|
|
|
|
n = fread(buffer, 1, 2, fp);
|
|
|
|
|
|
die2.Conver(*(unsigned short*)buffer);
|
|
|
|
|
|
n = fread(buffer, 1, 2, fp);
|
|
|
|
|
|
die3.Conver(*(unsigned short*)buffer);
|
|
|
|
|
|
|
|
|
|
|
|
//char szFilePath[MAX_PATH + 1] = { 0 };
|
|
|
|
|
|
//sprintf(szFilePath, "x:%d,y:%d,format:%d %d\n", die1.iCoordX, die2.iCoordY, die2.iValueX, die2.iValueY);
|
|
|
|
|
|
//OutputDebugStringA(szFilePath);
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>DIE
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>mapping<6E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
int iRowIndex = die2.iValueY == 0 ? die2.iCoordY : -die2.iCoordY;
|
|
|
|
|
|
int iColIndex = die2.iValueX == 0 ? die1.iCoordX : -die1.iCoordX;
|
|
|
|
|
|
iColIndex -= info.iCenterX;
|
|
|
|
|
|
iRowIndex -= info.iCenterY;
|
|
|
|
|
|
|
|
|
|
|
|
if (info.cXDirect == 1) iColIndex = -iColIndex;
|
|
|
|
|
|
if (info.cYDirect == 1) iRowIndex = -iRowIndex;
|
|
|
|
|
|
//iRowIndex = i;
|
|
|
|
|
|
//iColIndex = j;
|
|
|
|
|
|
|
|
|
|
|
|
if (die1.iTestRes == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(iRowIndex, iColIndex, 1, 0, std::to_string(die3.iBinCode));
|
|
|
|
|
|
data.iMark = die1.iMark;
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
waferPar.m_nBin1DieSize++;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (die1.iTestRes == 0)//<2F><><EFBFBD><EFBFBD>DIE
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(iRowIndex, iColIndex, 0, 0, std::to_string(die3.iBinCode));
|
|
|
|
|
|
data.iMark = die1.iMark;
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
waferPar.m_nBin1DieSize++;
|
|
|
|
|
|
}
|
|
|
|
|
|
else//<2F><><EFBFBD><EFBFBD>DIE
|
|
|
|
|
|
{
|
|
|
|
|
|
DieData data(iRowIndex, iColIndex, 2, 0, std::to_string(die3.iBinCode));
|
|
|
|
|
|
data.iMark = die1.iMark;
|
|
|
|
|
|
mapData.vDies.push_back(data);
|
|
|
|
|
|
waferPar.m_nBinFailSize++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
waferPar.m_mapBinCode[die3.iBinCode]++;
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD>е<EFBFBD><D0B5>о<EFBFBD><D0BE><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
|
if (!bForReverseX)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (++j > info.iCols / 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!bForReverseY)
|
|
|
|
|
|
++i;
|
|
|
|
|
|
else
|
|
|
|
|
|
--i;
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (--j < -info.iCols / 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!bForReverseY)
|
|
|
|
|
|
++i;
|
|
|
|
|
|
else
|
|
|
|
|
|
--i;
|
|
|
|
|
|
j = startX;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
//<2F><>DIE<49><45><EFBFBD><EFBFBD>=BIN1+<2B><><EFBFBD><EFBFBD>
|
|
|
|
|
|
auto it = waferPar.m_mapBinCode.find(1);
|
|
|
|
|
|
if (it != waferPar.m_mapBinCode.end())
|
|
|
|
|
|
{
|
|
|
|
|
|
waferPar.m_nTotalDieSize = it->second + waferPar.m_nBinFailSize;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void CWorkFileMgr::SaveFileName(CString FileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_CurOpenFile = FileName;
|
|
|
|
|
|
gProgramCspMarkMgr->SetCurMakFilePath(m_CurOpenFile);
|
|
|
|
|
|
#ifndef NEW_SCP
|
|
|
|
|
|
GetCurDocPtr()->SetTitle(m_CurOpenFile);
|
|
|
|
|
|
#else
|
|
|
|
|
|
string path = m_CurOpenFile;
|
|
|
|
|
|
string::size_type iPos = path.find_last_of('\\') + 1;
|
|
|
|
|
|
string filename = path.substr(iPos, path.length() - iPos);
|
|
|
|
|
|
GetMainDlgPtr()->SetTitleRecipeFile(filename.c_str());
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
void CWorkFileMgr::SaveMapFileName(CString FileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_CurOpenFile = FileName;
|
|
|
|
|
|
gProgramCspMarkMgr->SetCurMakFilePath(m_CurOpenFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD>浱ǰ<E6B5B1><EFBFBD><F2BFAAB5>ĵ<EFBFBD>
|
|
|
|
|
|
bool CWorkFileMgr::OnSaveFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(m_CurOpenFile == "")//<2F>µ<EFBFBD><C2B5>ļ<EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Ϊ
|
|
|
|
|
|
if (OnSaveFileAs())
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else//<2F><><EFBFBD>浱ǰ<E6B5B1><EFBFBD><F2BFAAB5>ļ<EFBFBD>
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveFile(m_CurOpenFile);
|
|
|
|
|
|
CMsgBox MsgBox;
|
|
|
|
|
|
MsgBox.Show(m_CurOpenFile+" <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!");
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Ϊ
|
|
|
|
|
|
bool CWorkFileMgr::OnSaveFileAs()
|
|
|
|
|
|
{
|
|
|
|
|
|
TCHAR szFilters[]=("MAK <20>ļ<EFBFBD>(*.mak)|*.mak");
|
|
|
|
|
|
CFileDialog dlg(FALSE,("mak"),("MarkFile"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilters);
|
|
|
|
|
|
CString Path = gCommonFlowMgr->GetWorkFileDefualtPath();
|
|
|
|
|
|
dlg.m_ofn.lpstrInitialDir = Path;
|
|
|
|
|
|
if(dlg.DoModal()==IDOK)
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveFile(dlg.GetPathName());
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
void CWorkFileMgr::SaveFile(CString FileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveWorkFile(FileName);
|
|
|
|
|
|
SaveFileName(FileName);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#if 1
|
|
|
|
|
|
|
|
|
|
|
|
void CWorkFileMgr::SaveWorkFile(CString FilePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
vector<CLab> LabVec;//<2F>洢<EFBFBD><E6B4A2><EFBFBD>б<EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ҫ<EFBFBD>洢<EFBFBD><E6B4A2>ģ<EFBFBD><C4A3>
|
|
|
|
|
|
//<2F>Ѽ<EFBFBD><D1BC><EFBFBD><EFBFBD>б<EFBFBD>ǩ
|
|
|
|
|
|
gProgramCspMarkMgr->SaveWorkFile(LabVec);//CSP<53><50><EFBFBD><EFBFBD>
|
|
|
|
|
|
gTemplateMgr->SaveWorkFile(LabVec);//ͼ<>β<EFBFBD><CEB2><EFBFBD>
|
|
|
|
|
|
gObjComponentMgr->SaveWorkFile(LabVec);//obj <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
SaveWorkFileExt(FilePath,LabVec);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>б<EFBFBD>ǩд<C7A9><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
void CWorkFileMgr::SaveWorkFileExt(CString FilePath,vector<CLab> &LabVec)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFile file(FilePath,CFile::modeReadWrite|CFile::modeCreate);
|
|
|
|
|
|
CArchive ar(&file,CArchive::store);
|
|
|
|
|
|
|
|
|
|
|
|
size_t LabCnt = LabVec.size();
|
|
|
|
|
|
|
|
|
|
|
|
ar<<LabCnt;//<2F><>ǩ<EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
|
|
|
|
|
|
vector<CLab>::iterator iter = LabVec.begin();
|
|
|
|
|
|
vector<CLab>::iterator iter_end = LabVec.end();
|
|
|
|
|
|
for(;iter!=iter_end;iter++)
|
|
|
|
|
|
{
|
|
|
|
|
|
(*iter).Serialize(ar);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#if 1
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>obj <20>ļ<EFBFBD>
|
|
|
|
|
|
void CWorkFileMgr::OpenObjFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
TCHAR szFilters[]=("OBJ <20>ļ<EFBFBD>(*.obj)|*.obj");
|
|
|
|
|
|
CFileDialog dlg(TRUE,("obj"),("ObjFile"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilters);
|
|
|
|
|
|
if(dlg.DoModal()==IDOK)
|
|
|
|
|
|
{
|
|
|
|
|
|
//gDraw->SetbDelOldObj(false);//<2F><>Ҫɾ<D2AA><C9BE>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>obj
|
|
|
|
|
|
ReadObjTemplateFile(dlg.GetPathName());
|
|
|
|
|
|
CLayer &layer = GetLayerInstance();
|
|
|
|
|
|
layer.NotSelAllObj();
|
|
|
|
|
|
GetCurViewPtr()->RefreshView();
|
|
|
|
|
|
//gDraw->SetbDelOldObj(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>obj <20>ļ<EFBFBD>
|
|
|
|
|
|
void CWorkFileMgr::SaveObjFile()
|
|
|
|
|
|
{
|
|
|
|
|
|
TCHAR szFilters[]=("OBJ <20>ļ<EFBFBD>(*.obj)|*.obj");
|
|
|
|
|
|
CFileDialog dlg(FALSE,("obj"),("ObjFile"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilters);
|
|
|
|
|
|
if(dlg.DoModal()==IDOK)
|
|
|
|
|
|
{
|
|
|
|
|
|
SaveObjTemplateFile(dlg.GetPathName());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//ͨ<><CDA8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>obj <20>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>)
|
|
|
|
|
|
void CWorkFileMgr::ReadObjFileByName(CString FileName)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFileMgr FileMgr;
|
|
|
|
|
|
CString FilePath;//<2F><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
|
|
|
|
|
FileMgr.GetFullFilePath(FilePath,FileName);
|
|
|
|
|
|
ReadObjTemplateFile(FilePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
//ͨ<><CDA8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>obj <20>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>)
|
|
|
|
|
|
void CWorkFileMgr::ReadObjTemplateFile(CString FilePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
ReadWorkFile(FilePath);
|
|
|
|
|
|
}
|
|
|
|
|
|
//ֻ<><D6BB><EFBFBD><EFBFBD>obj ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
void CWorkFileMgr::SaveObjTemplateFile(CString FilePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
vector<CLab> LabVec;//<2F>洢<EFBFBD><E6B4A2><EFBFBD>б<EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//<2F>Ѽ<EFBFBD><D1BC><EFBFBD><EFBFBD>б<EFBFBD>ǩ
|
|
|
|
|
|
gTemplateMgr->SaveWorkFile(LabVec);
|
|
|
|
|
|
//<2F><><EFBFBD>б<EFBFBD>ǩд<C7A9><D0B4><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
|
SaveWorkFileExt(FilePath,LabVec);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#if 1
|
|
|
|
|
|
bool CWorkFileMgr::ReadWorkFile(CString FilePath,bool bCreatCspWaferData)
|
|
|
|
|
|
{
|
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>----------------------------------------------------------
|
|
|
|
|
|
vector<CLab> LabVec;
|
|
|
|
|
|
bool ReadRes=ReadWorkFileExt(FilePath,LabVec);
|
|
|
|
|
|
if (!ReadRes)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (LabVec.empty())
|
|
|
|
|
|
{
|
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD><EFBFBD>ȡ<EFBFBD>ļ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>", _LOG_ERROR);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>ģ<EFBFBD><C4A3>------------------------------------------------------------
|
|
|
|
|
|
CLabVecRang LabVecRang(LabVec,0,LabVec.size()-1);
|
|
|
|
|
|
vector<CLabVecRang> LabVecRangVec;
|
|
|
|
|
|
|
|
|
|
|
|
SeparateStrVec(LabVecRang,LabVecRangVec,LAB_MODULE_START,LAB_MODULE_END);
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ÿ<EFBFBD><C3BF>ģ<EFBFBD><C4A3>---------------------------------------------------
|
|
|
|
|
|
vector<CLabVecRang>::iterator iter = LabVecRangVec.begin();
|
|
|
|
|
|
vector<CLabVecRang>::iterator iter_end = LabVecRangVec.end();
|
|
|
|
|
|
for(;iter!=iter_end;iter++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(gModuleDrawMgr.ReadWorkFile(*iter))
|
|
|
|
|
|
continue;//<2F><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>ȡ
|
|
|
|
|
|
gModuleDeviceMgr.ReadWorkFile(*iter);
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if(bCreatCspWaferData)
|
|
|
|
|
|
{
|
|
|
|
|
|
gProgramCspMarkMgr->CreatCspWaferData();
|
|
|
|
|
|
}
|
|
|
|
|
|
if(gProgramCspMarkMgr->IsbOldFileVersion20200714())
|
|
|
|
|
|
{
|
|
|
|
|
|
CLayer &layer = GetLayerInstance();
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Txt BasePt Ϊ<><CEAA><EFBFBD>ĵ<EFBFBD>
|
|
|
|
|
|
layer.UpdateObjTxtBasePt();
|
|
|
|
|
|
}
|
|
|
|
|
|
gProgramCspMarkMgr->SetbOldFileVersion20200714(false);
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool CWorkFileMgr::ReadWorkFileExt(CString FilePath,vector<CLab> &LabVec)
|
|
|
|
|
|
{
|
|
|
|
|
|
CFile file;
|
|
|
|
|
|
if(file.Open(FilePath,CFile::modeRead))
|
|
|
|
|
|
{
|
|
|
|
|
|
CArchive ar(&file,CArchive::load);
|
|
|
|
|
|
size_t LabCnt;
|
|
|
|
|
|
ar>>LabCnt;//<2F>ȶ<EFBFBD>ȡ<EFBFBD><C8A1>ǩ<EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
for(size_t i=0;i<LabCnt;i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
CLab Lab;
|
|
|
|
|
|
Lab.Serialize(ar);
|
|
|
|
|
|
LabVec.push_back(Lab);
|
|
|
|
|
|
}
|
|
|
|
|
|
file.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
gLogMgr->WriteDebugLog("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ȡʧ<EFBFBD><EFBFBD>", _LOG_ERROR);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><>LabVecRang <20>и<EFBFBD><D0B8><EFBFBD>StrLabStart <20><>StrLabEnd <20><>ǩ<EFBFBD><C7A9>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>str <20><><EFBFBD>浽LabVecRangVec
|
|
|
|
|
|
void CWorkFileMgr::SeparateStrVec(CLabVecRang &LabVecRang,vector<CLabVecRang> &LabVecRangVec,LAB_TYPE StrLabStart,LAB_TYPE StrLabEnd)
|
|
|
|
|
|
{
|
|
|
|
|
|
size_t StartCnt = 0;//<2F><><EFBFBD><EFBFBD>Ƕ<EFBFBD><EFBFBD><D7B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
size_t StartIdx = 0;
|
|
|
|
|
|
size_t EndIdx = 0;
|
|
|
|
|
|
|
|
|
|
|
|
size_t Start = LabVecRang.GetStart();
|
|
|
|
|
|
size_t End = LabVecRang.GetEnd()+1;
|
|
|
|
|
|
for(size_t i=Start;i<End;i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(LabVecRang.GetLabType(i)==StrLabStart)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(StartCnt==0)//ֻ<>е<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ż<EFBFBD>¼
|
|
|
|
|
|
{
|
|
|
|
|
|
StartIdx = i+1;//<2F><>¼<EFBFBD><C2BC><EFBFBD>뿪ʼλ<CABC><CEBB>
|
|
|
|
|
|
}
|
|
|
|
|
|
StartCnt++;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(LabVecRang.GetLabType(i)==StrLabEnd)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(StartCnt==1)
|
|
|
|
|
|
{
|
|
|
|
|
|
EndIdx = i-1;//Ŀ<><C4BF><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD>жϵ<D0B6><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ
|
|
|
|
|
|
//if(EndIdx>StartIdx)//<2F><>Ҫ<EFBFBD>Ѽ<EFBFBD><D1BC>յķ<D5B5>Χ
|
|
|
|
|
|
{
|
|
|
|
|
|
CLabVecRang Rang(LabVecRang.GetVec(),StartIdx,EndIdx);
|
|
|
|
|
|
LabVecRangVec.push_back(Rang);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
StartCnt--;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//<2F><>StrVec <20><><EFBFBD>Һͱ<D2BA>ǩLabStr ƥ<><C6A5><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ǩ<EFBFBD><C7A9>ֵ,û<><C3BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>""
|
|
|
|
|
|
CLab CWorkFileMgr::FindLab(CLabVecRang &LabVecRang,LAB_TYPE LabStr)
|
|
|
|
|
|
{
|
|
|
|
|
|
CLab ret;
|
|
|
|
|
|
size_t Start = LabVecRang.GetStart();
|
|
|
|
|
|
size_t End = LabVecRang.GetEnd()+1;
|
|
|
|
|
|
for(size_t i=Start;i<End;i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(LabVecRang.GetLabType(i)==LabStr)
|
|
|
|
|
|
{
|
|
|
|
|
|
ret = LabVecRang.GetLab(i);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|