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.

230 lines
8.4 KiB
C

#pragma once
#include "module.h"
#include "WorkCmdContainer.h"
#include "EnumDirection.h"
#include "WorkCmdInvoker.h"
//<2F><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum eExcuteFlowType
{
_ExcuteFlow_Null = 0,
_ExcuteFlow_Foup_LoadMap_Port1,
_ExcuteFlow_Foup_LoadMap_Port2,
_ExcuteFlow_Foup_Unload_Port1,
_ExcuteFlow_Foup_Unload_Port2,
_ExcuteFlow_Manual_Anneal_Start,//<2F><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6>˻<EFBFBD>
};
//<2F><><EFBFBD><EFBFBD><EFBFBD>߲<EFBFBD><DFB2>Բ<EFBFBD><D4B2><EFBFBD>
class CLaserSpotMarkPar
{
public:
CLaserSpotMarkPar(void)
{
m_SpotGap = 2;//<2F><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>X <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mm
m_SpotOffsetZ = 0.1;//<2F><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>Z <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mm
m_SpotCntZ = 30;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_SpotCntF = 30;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_SpotMarkDelay = 2;//ÿ<><C3BF><EFBFBD><EFBFBD><E3BFAA>ʱ<EFBFBD><CAB1>ms
};
public:
double m_SpotGap;//<2F><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>X <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mm
double m_SpotOffsetZ;//<2F><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>Z <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>mm
int m_SpotCntZ;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int m_SpotCntF;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int m_SpotMarkDelay;//ÿ<><C3BF><EFBFBD><EFBFBD><E3BFAA>ʱ<EFBFBD><CAB1>s
};
class CLaserSpotPt
{
public:
CLaserSpotPt(void)
{
m_AdjustZVal = 0;//Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
};
public:
Dbxy m_Coord;
double m_AdjustZVal;//Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
};
//XY <20>˶<EFBFBD><CBB6><EFBFBD><EFBFBD>Բ<EFBFBD><D4B2><EFBFBD>
class CXyMoveTestPar
{
public:
CXyMoveTestPar(void)
{
m_CycleTimes = 10;//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_MoveSpeed = 200;// <20>ƶ<EFBFBD><C6B6>ٶ<EFBFBD>X
};
public:
int m_CycleTimes;//ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
double m_MoveSpeed;// <20>ƶ<EFBFBD><C6B6>ٶ<EFBFBD>
};
//<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CMovePtData
{
public:
CMovePtData(void)
{
};
public:
Dbxy m_MaxCoord;//<2F><><EFBFBD><EFBFBD>ֵ
Dbxy m_MinCoord;//<2F><>Сֵ
Dbxy m_AvgCoord;//ƽ<><C6BD>ֵ
vector<Dbxy> m_PtVec;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
};
class CTestLine
{
public:
CTestLine(void)
{
};
public:
Dbxy m_pt1;
Dbxy m_pt2;
};
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CCommonFlowMgr :public CModule
{
public:
CCommonFlowMgr(void);
~CCommonFlowMgr(void);
virtual CMFCPropertyGridProperty *CreatGridProperty();
virtual MODULE GetModuleType(){return _COMMON_FLOW_PROP;};
virtual void OnAppInitialize();
virtual void Draw(CDC* pDC);
virtual CString GetParDirName();
bool InitDeviceFlow(bool bConfirmMsgBox);
bool IsbConnectObj(){return m_bConnectObj;};
bool IsbShowErrMsg(){return m_bShowErrMsg;};
bool IsbStopWorkMsg(){return m_bStopWorkMsg;};
bool IsbShowStartMsg(){return m_bShowStartMsg;};
void SetErrMsg(CString s){m_ErrMsg = s;};
CString GetErrMsg(){return m_ErrMsg;};
bool MoveToPos(Dbxy MovePt,Dbxy TargetPt,double MotorZCoord);
bool CheckDeviceInitState();
double GetOneLineScanSpeed(){return m_OneLineScanSpeed;};
void SetOneLineScanSpeed(double val){m_OneLineScanSpeed = val;};
void OneLineLaserTest();
bool AtLaserSafePlace(Dbxy PlatformCoord);
void ManualMoveAsixXY(double MoveDis,DIRECTION MoveDir);
void ManualMoveAsixZ(double dis);
CXyMoveTestPar GetCurXyMoveTestPar(){return m_CurXyMoveTestPar;};
void SetCurXyMoveTestPar(CXyMoveTestPar par){m_CurXyMoveTestPar = par;};
void XyMoveTestFlow();
bool IsbXyMoveTesting(){return m_bXyMoveTesting;};
void XYMoveSaveCoord();
void OpenMoveTestObj();
void InitMoveRetList(CListCtrl &List);
void InsertMoveRetList(CListCtrl &List);
bool LaserPowCheckFlow();
CLaserSpotMarkPar GetLaserSpotMarkPar(){return m_LaserSpotMarkPar;};
void SetLaserSpotMarkPar(CLaserSpotMarkPar par){m_LaserSpotMarkPar = par;};
void CreatLaserSpotMarkPt();
void LaserSpotMarkFlow();
void SetbLaserSpotMarkMode(bool b);
bool IsbLaserSpotMarkMode(){return m_bLaserSpotMarkMode;};
bool IsbIniMotorZ(){return m_bIniMotorZ;};
bool IsbIniPlatfrom(){return m_bIniPlatfrom;};
int GetLightAlamTime(){return m_LightAlamTime;};
int CollectMultiMovePoint();
void CollectMultiPointVecToFile();
void PlanenessMeasureFlow();
bool CheckLaserBeamFlow();
bool CheckRecipeEnergyDensityFlow(double Laser1Curr);
bool MoveToPowMeasureFlow();
bool IsbKeepJobN2Air(){return m_bKeepJobN2Air;};
bool ManualTransferWaferFlow();
void JobQueueCtrlFlow();
void PauseJobQueueCtrlFlow();
void StopJobQueueCtrlFlow();
bool ExcuteSimpleFlowType(eExcuteFlowType FlowType);
void AutoFindFocusFlow();
void ManualCtrlPlatWaferFlow(bool bWaferOn);
void CloseLaserLddFlow();
bool IsbAutomationWorking(){return m_bAutomationWorking;};
bool IsbStopAutomationWork(){return m_bStopAutomationWork;};
void StartAutomationWorkFlowThread();
void StartAutomationWorkFlow();
void StopAutomationWorkFlow();
private:
bool CommWorkStart();
void CommWorkEnd();
void CreatAnnealScanCmd(CWorkCmdInvoker &CmdInvoker);
void InsertMoveRetListExt(CListCtrl &List,int line,int Idx,CMovePtData &MovePtData,X_OR_Y Xy);
void OneLineLaserTestExt(Dbxy Pt1,Dbxy Pt2);
void CalXYMoveTestResult(int MeasurePtCnt);
bool LaserPowCheckFlowExt();
void DrawLaserSpotPt(CDC* pDC);
bool CheckLaserSpotData();
void DrawTestLineVec(CDC* pDC);
void CreatAutoFindFocusInvokerCmd(CWorkCmdInvoker &WorkCmdInvoker,bool bToLaserFocus);
void CreatPowCheckPrepareCmd(CWorkCmdInvoker &CmdInvoker);
private:
//<2F><>ͨ<EFBFBD>
bool m_bNeedInit;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD>в<EFBFBD><D0B2><EFBFBD>
bool m_bShowStartMsg;//<2F>ڿ<EFBFBD>ʼ<EFBFBD>ӹ<EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><C7B7>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ʾ
bool m_bShowErrMsg;//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ʾ
CString m_ErrMsg;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
bool m_bStopWorkMsg;//<2F><><EFBFBD><EFBFBD>ֹͣ<CDA3><D6B9>ť<EFBFBD><C5A5><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>
double m_OneLineScanSpeed;//<2F><><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD>ߵ<EFBFBD><DFB5>ٶ<EFBFBD>
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>-----------------------------------------------------
bool m_bIniConfirmMsgBox;//<2F>Ƿ񵯳<C7B7><F1B5AFB3><EFBFBD>ʼ<EFBFBD><CABC>ȷ<EFBFBD>϶Ի<CFB6><D4BB><EFBFBD>
bool m_bIniPlatfrom;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ̨
bool m_bIniMotorZ;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Z
bool m_bInitedToProductPt;//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA>Ƿ񷵻<C7B7><F1B7B5BB><EFBFBD><EFBFBD>ϵ<EFBFBD>
bool m_bConnectObj;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>obj <20><><EFBFBD><EFBFBD>
bool m_bSetLightState;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>þ<EFBFBD>ʾ<EFBFBD><CABE>״̬
double m_MotorZSafeCoord;//Z <20><><EFBFBD>İ<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>(<28><><EFBFBD><EFBFBD>ֵ)
int m_CurDrawLineCnt;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD>Ƶ<EFBFBD><C6B5>߶μ<DFB6><CEBC><EFBFBD><EFBFBD><EFBFBD>
int m_DrawLineGapCnt;//ÿ<><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߻<EFBFBD><DFBB><EFBFBD>һ<EFBFBD><D2BB>(<28><><EFBFBD><EFBFBD>ֵ)
int m_TransferTestDelay;//<2F><>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms
int m_OneLineAnnealTimeAdjsut;//<2F><><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD><DFB6>˻<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>ms
CXyMoveTestPar m_CurXyMoveTestPar;//<2F><>ǰ<EFBFBD><C7B0>XY <20>˶<EFBFBD><CBB6><EFBFBD><EFBFBD>Բ<EFBFBD><D4B2><EFBFBD>
bool m_bXyMoveTesting;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>XY <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
int m_MoveTestDelay;//<2F>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms
vector<Dbxy> m_XyMoveTestVec;//<2F>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
vector<CMovePtData> m_MovePtDataVec;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bLaserSpotMarkMode;//<2F><>ǰ<EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
vector<CLaserSpotPt> m_LaserSpotPtVec;//<2F><><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD>
CLaserSpotMarkPar m_LaserSpotMarkPar;//<2F><><EFBFBD><EFBFBD><EFBFBD>ߵIJ<DFB5><C4B2><EFBFBD>
int m_LightAlamTime;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
vector<CTestLine> m_CTestLineVec;
bool m_bKeepJobN2Air;//<2F><>job <20><><EFBFBD><EFBFBD>ʱһֱ<D2BB><D6B1><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>
bool m_bCtrlN2Air;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Թر<D4B9>)
bool m_bAutomationWorking;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool m_bStopAutomationWork;//ֹͣ<CDA3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
};
extern CCommonFlowMgr *gCommonFlowMgr;