You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

714 lines
22 KiB
C++

#include "StdAfx.h"
#include "ProgramLaserTuiHuo.h"
#include "GlobalFunction.h"
#include "LogMgr.h"
#include "WorkTime.h"
#include "FileMgr.h"
#include "WorkFileMgr.h"
#include "Layer.h"
#include "ObjFillMgr.h"
#include "Laser.h"
#include "Propertie.h"
#include "PropertieMgr.h"
#include "AuthorityMgr.h"
#include "MsgBox.h"
#include "CStringFuc.h"
#include "Layer.h"
#include "PenParMgr.h"
#include "ObjBase.h"
#include "ObjContainer.h"
#include "ExceptionMsg.h"
#include "WorkRecord.h"
#include "WorkAreaMgr.h"
#include "PenParMgr.h"
#include "CommonFlowMgr.h"
#include "LaserPowCheckMgr.h"
#include "EncryptionMgr.h"
#include "TimingProgressMgr.h"
#include "AllThreadMgr.h"
#include "ObjPline.h"
#include "CommomText.h"
#include "WaferRecipeDataMgr.h"
#include "WarningMgr.h"
#include "AllThreadMgr.h"
#include "ModuleDeviceMgr.h"
#define CYCLIC_RUN_TIMES_FILE _T("\\CommPar\\CyclicRun.bin")
#define SCAN_AREA_FILE_PATH _T("\\ScanArea\\")
#define CUR_SOFT_VISION "v 2.1.5" //<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD>߳<EFBFBD>(<28><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>)
UINT AutoWorkFlowCtrlThread(LPVOID pParam)
{
CProgramLaserTuiHuo *p = (CProgramLaserTuiHuo *)pParam;
p->AutoWorkFlowCtrl();
return 0;
}
//ִ<><D6B4>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><><D6B4>һ<EFBFBD><D2BB>)
UINT ExecuteStepThread(LPVOID pParam)
{
CProgramLaserTuiHuo *p = (CProgramLaserTuiHuo *)pParam;
p->ExecuteCurStep();
return 0;
}
CProgramLaserTuiHuo *gProgramLaserTuiHuo = new CProgramLaserTuiHuo;
CProgramLaserTuiHuo::CProgramLaserTuiHuo(void)
{
m_pMeasureThread = NULL;//<2F><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
m_bCheckLaserPar = true;//<2F>ӹ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ʵ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ƥ<EFBFBD><C6A5>
m_BackTime2Mins = 300;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߼<EFBFBD>ʱ(<28>رյ<D8B1>Դ)(<28><><EFBFBD><EFBFBD>)
m_CurAutoWorkStep = _AutoWork_Step_Stop;
m_OldAutoWorkStep = _AutoWork_Step_Stop;
m_bAutoWorking = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
m_bStopAfterThisCycle = false;//<2F><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD>ֹͣ
m_bAutoPowerMode = false;//<2F><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD>ƥ<EFBFBD><C6A5>ģʽ
m_bStopWork = false;//<2F>Ƿ<EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
m_bLockAllDlgPane = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_bAutoTransferMode = false;//<2F>Զ<EFBFBD><D4B6><EFBFBD>Ƭģʽ
m_bLastWaferEnd = false;//<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>һƬ<D2BB><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_bLockCurRecipe = false;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰrecipe <20><>ʾ(<28><><EFBFBD><EFBFBD>ֵ)
m_bCyclicRunMode = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>CyclicRun ģʽ
m_bCyclicRunExcuting = false;//CyclicRun <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>
m_AllCyclicWaferCnt = 0;//CyclicRun Wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_CurCyclicWaferCnt = 0;//CyclicRun Wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_WaferScanType = 0;//wafer ɨ<>ʽ
m_RecoverScanIdxAdjust = 1;//<2F>ָ<EFBFBD>ɨ<EFBFBD><C9A8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ĵڼ<C4B5><DABC><EFBFBD><EFBFBD>߿<EFBFBD>ʼ(<28><><EFBFBD><EFBFBD>ֵ)
m_CurLaserPathBmpId = IDB_BTN_IMG21;//<2F><>ǰ<EFBFBD><C7B0>·<EFBFBD><C2B7><EFBFBD><EFBFBD>ͼID
m_CurAnnealPercent = 0;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>ɶ<EFBFBD>
m_bSoftInitComplete = false;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
m_DeviceID = "LA2540G";//<2F><>ǰ<EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>(<28><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
m_CurSoftVision = CUR_SOFT_VISION;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_LaipuLaserDataDir = "E:\\LaipuLaserData";//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼,<2C><><EFBFBD><EFBFBD>E:\LaipuLaserData
}
CProgramLaserTuiHuo::~CProgramLaserTuiHuo(void)
{
}
CMFCPropertyGridProperty *CProgramLaserTuiHuo::CreatGridProperty()
{
CString PropertyName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CString Description;//<2F><><EFBFBD><EFBFBD>
CString Path = GetParDirName();//<2F>洢·<E6B4A2><C2B7>
CString Name;
CString GroupName;
CString ModuleName;
//-------------------------------------------------------------------------------//
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><EFBFBD>");
GroupName = PropertyName;
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
//-------------------------------------------------------------------------------//
if(gAuthorityMgr->CheckAuthority(_Authority_Factory))
{
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_bLockAllDlgPane");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_bLockAllDlgPane);
pPropertie->SetType(_PROP_TYPE_BOOL);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bLockAllDlgPane, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_bLockCurRecipe");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_bLockCurRecipe);
pPropertie->SetType(_PROP_TYPE_BOOL);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Recipe<EFBFBD><EFBFBD>ʾ");
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Recipe<EFBFBD><EFBFBD>ʾ");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bLockCurRecipe, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_LaipuLaserDataDir");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_LaipuLaserDataDir);
pPropertie->SetType(_PROP_TYPE_STRING);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼");
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ洢Ŀ¼(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч)");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
pPropertie->SetModuleName(ModuleName);
CMFCPropertyGridProperty* p = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_LaipuLaserDataDir, Description);
pGroup->AddSubItem(p);
gDevicePropertieMgr.Insert(p, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_ObjTxtFilePath");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_ObjTxtFilePath);
pPropertie->SetType(_PROP_TYPE_STRING);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("Obj Txt ·<><C2B7>");
Description = _T("Obj Txt ·<><C2B7>");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_ObjTxtFilePath, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_DeviceID");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_DeviceID);
pPropertie->SetType(_PROP_TYPE_STRING);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD>豸ID");
Description = _T("<EFBFBD><EFBFBD>ǰ<EFBFBD>豸ID");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_DeviceID, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_WorkRecordFilePath");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_WorkRecordFilePath);
pPropertie->SetType(_PROP_TYPE_STRING);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD>ӹ<EFBFBD><EFBFBD><EFBFBD>¼·<EFBFBD><EFBFBD>");
Description = _T("<EFBFBD>ӹ<EFBFBD><EFBFBD><EFBFBD>¼ <20>ļ<EFBFBD>·<EFBFBD><C2B7>");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_WorkRecordFilePath, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_BackTime2Mins");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_BackTime2Mins);
pPropertie->SetType(_PROP_TYPE_INT);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߼<EFBFBD>ʱ");
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߼<EFBFBD>ʱ(<28><><EFBFBD><EFBFBD>)");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_BackTime2Mins, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_WaferScanType");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_WaferScanType);
pPropertie->SetType(_PROP_TYPE_INT);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("ɨ<EFBFBD>ʽ");
Description = _T("0:S <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1:S <20>ҵ<EFBFBD><D2B5><EFBFBD>2:<3A><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>3:<3A><><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>4:S <20>ϵ<EFBFBD><CFB5><EFBFBD>5:S <20><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>6:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>7:<3A><><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_WaferScanType, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
Name = _T("m_RecoverScanIdxAdjust");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_RecoverScanIdxAdjust);
pPropertie->SetType(_PROP_TYPE_INT);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
PropertyName = _T("<EFBFBD>ָ<EFBFBD>ɨ<EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><EFBFBD><EFBFBD>");
Description = _T("<EFBFBD>ָ<EFBFBD>ɨ<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ĵڼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>ʼ");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_RecoverScanIdxAdjust, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
}
//-------------------------------------------------------------------------------//
return pGroup;
}
//<2F><>Ӧ<EFBFBD><D3A6><EFBFBD>Եı
void CProgramLaserTuiHuo::OnPropertyChanged()
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B2BC>
GetFrame()->LockPane(m_bLockAllDlgPane);
m_pView->RefreshView();
}
#if 1
void CProgramLaserTuiHuo::OnAppInitialize()
{
CWorkTime WorkTime;
m_AppOpenTime = WorkTime.GetDateTime("/",":");//<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>򿪵<EFBFBD>ʱ<EFBFBD><CAB1>
//<2F><><EFBFBD>浱ǰ<E6B5B1>ļ<EFBFBD><C4BC><EFBFBD>Ŀ¼
//m_LaipuLaserDataDirҪ<72><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
m_CurLaipuLaserDataDir= m_LaipuLaserDataDir;
}
void CProgramLaserTuiHuo::OnExitApp()
{
}
//<2F><><EFBFBD>Ͻ<EFBFBD><CFBD>˳<EFBFBD><CBB3><EFBFBD>ť(<28><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Թرճ<D8B1><D5B3><EFBFBD>)
bool CProgramLaserTuiHuo::CloseAppCheck()
{
if(gAuthorityMgr->IsbLoginDlgOpen())
{
gLogMgr->WriteDebugLog("CloseAppCheck-->LoginDlgOpen");
return false;
}
CMsgBox MsgBox;
if(MsgBox.ConfirmOkCancel("<EFBFBD>رճ<EFBFBD><EFBFBD><EFBFBD>?")==false)
return false;
return true;//<2F><><EFBFBD>Թر<D4B9>
}
//<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>
bool CProgramLaserTuiHuo::IsOneDirScanType()
{
if((m_WaferScanType==2) ||(m_WaferScanType==3)||(m_WaferScanType==6)||(m_WaferScanType==7))
return true;
return false;
}
//ͨ<><CDA8>ϵͳ<CFB5><CDB3>Ϣ<EFBFBD><CFA2><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::CloseAppBySysMsg()
{
gLogMgr->WriteDebugLog("Func--->CloseAppBySysMsg");
HWND hWnd;
CString WndName = "LaiPuDrawing - [<5B>ޱ<EFBFBD><DEB1><EFBFBD>]";
hWnd = (HWND)::FindWindow(NULL,WndName);
if(hWnd != NULL)
{
::SendMessage(hWnd,WM_SYSCOMMAND, SC_CLOSE,0);
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::ReStartApp()
{
gLogMgr->WriteDebugLog("Func--->ReStartApp");
//<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
char strPath[100];
GetModuleFileName(NULL,strPath,100);
//<2F><><EFBFBD><EFBFBD><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD>̳ɹ<CCB3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>WM_QUIT<49><54>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD>Ľ<EFBFBD><C4BD>̣<EFBFBD>
STARTUPINFO startInfo;
PROCESS_INFORMATION processInfo;
ZeroMemory(&startInfo, sizeof(STARTUPINFO));
startInfo.cb = sizeof(STARTUPINFO);
if(CreateProcess(NULL,(LPTSTR)(LPCTSTR)strPath, NULL, NULL,FALSE, 0, NULL, NULL, &startInfo, &processInfo))
{
CloseHandle( processInfo.hProcess );
CloseHandle( processInfo.hThread );
PostQuitMessage(WM_CLOSE);
}
}
#endif
#if 1
//<2F><><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD>(bAutoMode = true <20>Զ<EFBFBD><D4B6><EFBFBD>Ƭģʽ=false <20>ֶ<EFBFBD><D6B6>˻<EFBFBD>)
//Job start <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
bool CProgramLaserTuiHuo::StartWork(bool bAutoMode)
{
return true;
}
//<2F>ӹ<EFBFBD>ǰ׼<C7B0><D7BC>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫִ<D2AA>еIJ<D0B5><C4B2><EFBFBD>)
bool CProgramLaserTuiHuo::StartWorkPrepare()
{
return true;
}
#endif
#if 1//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̹<EFBFBD><CCB9><EFBFBD>
//<2F><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::SetCurAutoWorkStep(EAutoWorkStep Step)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(Step==_AutoWork_Step_Stop)
{
m_OldAutoWorkStep = _AutoWork_Step_NULL;
m_CurAutoWorkStep = _AutoWork_Step_NULL;
}
CString Log;
switch(Step)
{
case _AutoWork_Step_Transfer_Load://<2F><><EFBFBD><EFBFBD>
Log = "_AutoWork_Step_Transfer_Load";
break;
case _AutoWork_Step_Tuihuo_Progress://<2F>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>
Log = "_AutoWork_Step_Tuihuo_Progress";
break;
case _AutoWork_Step_Transfer_UnLoad://<2F><><EFBFBD><EFBFBD>
Log = "_AutoWork_Step_Transfer_UnLoad";
break;
case _AutoWork_Step_Stop://ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
Log = "_AutoWork_Step_Stop";
break;
case _AutoWork_Step_NULL://ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
Log = "_AutoWork_Step_NULL";
break;
default:
break;
}
Log = "Flow---->SetCurAutoWorkStep : " + Log;
gLogMgr->WriteDebugLog(Log);
m_CurAutoWorkStep = Step;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>
void CProgramLaserTuiHuo::AutoWorkFlowCtrl()
{
while(1)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱֹͣ<CDA3>߳<EFBFBD>
if(gAllThreadMgr.IsbStopAllThread())
break;
//<2F><><EFBFBD><EFBFBD><EFBFBD>߳̿<DFB3>ʼ
gAllThreadMgr.SetThreadInfoState(_EThreadType_AutoWorkFlowCtrlThread,true);
Sleep(500);
if(m_CurAutoWorkStep == m_OldAutoWorkStep)//<2F>ޱ仯
continue;
if(m_bAutoWorking)
{
//<2F><>¼<EFBFBD><C2BC>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
m_OldAutoWorkStep = m_CurAutoWorkStep;
if(m_CurAutoWorkStep != _AutoWork_Step_NULL)
{
//<2F><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ִ<EFBFBD><D6B4>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
AfxBeginThread(ExecuteStepThread,this);
}
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>߳̽<DFB3><CCBD><EFBFBD>
gAllThreadMgr.SetThreadInfoState(_EThreadType_AutoWorkFlowCtrlThread,false);
}
//ִ<>е<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::ExecuteCurStep()
{
if(gExitApp)
return;
gAllThreadMgr.SetThreadInfoState(_EThreadType_ExecuteStepThread,true);
switch(m_CurAutoWorkStep)
{
case _AutoWork_Step_Transfer_Load://<2F><><EFBFBD><EFBFBD>
OnLoadWaferToPlat();
break;
case _AutoWork_Step_Tuihuo_Progress://<2F>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>
OnTuiHuoProgress();
break;
case _AutoWork_Step_Transfer_UnLoad://<2F><><EFBFBD><EFBFBD>
OnUnLoadPlatWaferToPod();
break;
case _AutoWork_Step_Stop://ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
OnWorkStop();
break;
default:
break;
}
//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
if(!m_bAutoWorking && m_CurAutoWorkStep!= _AutoWork_Step_Stop && m_CurAutoWorkStep!= _AutoWork_Step_NULL)
{
OnWorkStop();
}
gAllThreadMgr.SetThreadInfoState(_EThreadType_ExecuteStepThread,false);
}
//<2F><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD>ֹͣ
void CProgramLaserTuiHuo::StopAftrThisCycle()
{
m_bStopAfterThisCycle = true;
gLogMgr->WriteDebugLog("Func---->Stop After This Cycle");
}
#endif
#if 1//<2F><>Ƭ<EFBFBD><C6AC><EFBFBD>صĸ<D8B5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F>Ƿ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>Load
bool CProgramLaserTuiHuo::IsReadyToLoad()
{
return false;
}
//<2F>Ƿ<EFBFBD>load <20><><EFBFBD><EFBFBD>
bool CProgramLaserTuiHuo::IsLoadEnd()
{
return false;
}
//<2F>Ƿ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>Unload
bool CProgramLaserTuiHuo::IsReadyToUnload()
{
return false;
}
//<2F>Ƿ<EFBFBD>unload <20><><EFBFBD><EFBFBD>
bool CProgramLaserTuiHuo::IsUnloadEnd()
{
return false;
}
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>wafer
bool CProgramLaserTuiHuo::HasUntreatedWafer()
{
return false;
}
#endif
#if 1
//load wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool CProgramLaserTuiHuo::OnLoadWaferToPlat()
{
return true;
}
//<2F>ӹ<EFBFBD>(<28><><EFBFBD>Զ<EFBFBD>ģʽֱ<CABD>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>)
void CProgramLaserTuiHuo::OnTuiHuoProgress()
{
}
void CProgramLaserTuiHuo::OnTuiHuoProgressExt()
{
}
//<2F><>wafer <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4>䵽pod
bool CProgramLaserTuiHuo::OnUnLoadPlatWaferToPod()
{
return true;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Job ֹͣ<CDA3><D6B9><EFBFBD>߽<EFBFBD><DFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
void CProgramLaserTuiHuo::OnWorkStop()
{
}
#endif
#if 1
//<2F>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::ManualTransferLoad()
{
}
//<2F>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::ManualTransferUnLoad()
{
}
//<2F>ֶ<EFBFBD><D6B6><EFBFBD>arm/׼ֱ<D7BC><D6B1><EFBFBD>ϵ<EFBFBD>wafer <20>˻<EFBFBD><CBBB>Ϻ<EFBFBD>
void CProgramLaserTuiHuo::ManualArmAlignerUnLoad()
{
}
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>/Arm2 <20>ֱ۵<D6B1>wafer)
void CProgramLaserTuiHuo::ManualRecoverAllWafer()
{
}
#endif
#if 1
UINT CyclicRunThread(LPVOID pParam)
{
CProgramLaserTuiHuo *p = (CProgramLaserTuiHuo *)pParam;
p->CyclicRun();
return 0;
}
//<2F><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>CyclicRun
void CProgramLaserTuiHuo::OnClickeCyclicRun()
{
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ܽ<EFBFBD><DCBD><EFBFBD>CyclicRun
bool CProgramLaserTuiHuo::CheckCyclicRunCondition()
{
return true;
}
//<2F><><EFBFBD><EFBFBD>CyclicRun
void CProgramLaserTuiHuo::StartCyclicRunThread()
{
gLogMgr->WriteDebugLog("Func---->StartCyclicRunThread");
m_bCyclicRunExcuting = true;
m_bCyclicRunMode = true;
//<2F><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>ִ<EFBFBD><D6B4>
AfxBeginThread(CyclicRunThread,this);
}
//ֹͣCyclicRun ģʽ
void CProgramLaserTuiHuo::StopCyclicRunThread()
{
gLogMgr->WriteDebugLog("Func---->StopCyclicRunThread");
m_bCyclicRunMode = false;
}
void CProgramLaserTuiHuo::CyclicRun()
{
gLogMgr->WriteDebugLog("Func---->CyclicRun");
while(1)
{
Sleep(CTRL_CYCLIC_RUN_DELAY);
if(gAllThreadMgr.IsbStopAllThread())
break;
if(!m_bCyclicRunMode)
break;
gAllThreadMgr.SetThreadInfoState(_EThreadType_CyclicRunThread,true);
CyclicRunExt();
}
gAllThreadMgr.SetThreadInfoState(_EThreadType_CyclicRunThread,false);
m_bCyclicRunExcuting = false;
gLogMgr->WriteDebugLog("Func---->CyclicRun End");
}
void CProgramLaserTuiHuo::CyclicRunExt()
{
}
void CProgramLaserTuiHuo::ClearCyclicWaferCnt()
{
CMsgBox MsgBox;
if(MsgBox.ConfirmOkCancel("Cur Run Times <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?"))
{
m_CurCyclicWaferCnt = 0;
gLogMgr->WriteDebugLog("Func---->ClearCyclicWaferCnt");
}
}
//<2F><>ȡ<EFBFBD><C8A1>ǰCyclic <20><><EFBFBD><EFBFBD>
CString CProgramLaserTuiHuo::GetCyclicWaferCnt()
{
return Int2CString(m_AllCyclicWaferCnt);
}
CString CProgramLaserTuiHuo::GetCurCyclicWaferCnt()
{
return Int2CString(m_CurCyclicWaferCnt);
}
//<2F>ۼӵ<DBBC>ǰCyclic <20><><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::CyclicWaferInc()
{
if(!m_bCyclicRunMode)
return;
m_AllCyclicWaferCnt++;
m_CurCyclicWaferCnt++;
WriteCyclicWaferCntToFile(m_AllCyclicWaferCnt);
}
//Cyclic <20><><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ļ<EFBFBD>
void CProgramLaserTuiHuo::WriteCyclicWaferCntToFile(int CyclicWaferCnt)
{
CString s;
s.Format("Func---->WriteCyclicWaferCntToFile : %ld",CyclicWaferCnt);
gLogMgr->WriteDebugLog(s);
CFileMgr FileMgr;
CString FilePath;
FileMgr.GetFullFilePath(FilePath,CYCLIC_RUN_TIMES_FILE);
ofstream FileStream;
FileStream.open(FilePath);
FileStream<<Int2CString(CyclicWaferCnt);
}
//<2F><><EFBFBD>ļ<EFBFBD><C4BC>лָ<D0BB>Cyclic <20><><EFBFBD><EFBFBD>
void CProgramLaserTuiHuo::ReadCyclicWaferCntFromFile()
{
CFileMgr FileMgr;
CString FilePath;
FileMgr.GetFullFilePath(FilePath,CYCLIC_RUN_TIMES_FILE);
if(!FileMgr.IsFileExist(FilePath))
{
//<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD>һ<EFBFBD><D2BB>
WriteCyclicWaferCntToFile(0);
return;
}
vector<CString> StrVec;
FileMgr.ReadFileToStringVec(FilePath,StrVec);
if(StrVec.size()>0)
{
m_AllCyclicWaferCnt = CStringToInt(StrVec[0]);
CString s;
s.Format("Func---->ReadCyclicWaferCntFromFile : %ld",m_AllCyclicWaferCnt);
gLogMgr->WriteDebugLog(s);
}
}
#endif
#if 1
//<2F><><EFBFBD><EFBFBD>"E:\\LaipuLaserData"
CString CProgramLaserTuiHuo::GetLaipuLaserDataDir(CString Path)
{
CString DataDir = m_CurLaipuLaserDataDir;
DataDir += Path;
return DataDir;
}
CString CProgramLaserTuiHuo::GetScanAreaFilePath()
{
CString ScanAreaFilePath = GetLaipuLaserDataDir(SCAN_AREA_FILE_PATH);
return ScanAreaFilePath;
}
#endif