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.

330 lines
13 KiB
C

#pragma once
#include "GlobalDefine.h"
#include "module.h"
#include "OffsetTable.h"
#define Rcp_AreaName_Idx 18 //ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ(ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ)
#define Rcp_AreaIdx_Idx (Rcp_AreaName_Idx+1)
#define Rcp_N2_Idx (Rcp_AreaIdx_Idx+1)//N2<4E><32><EFBFBD><EFBFBD>
#define Rcp_UseCurN2Val_Idx (Rcp_N2_Idx+1)//ʹ<><CAB9>Recipe<70><65>MFC<46><43><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
#define Rcp_OffsetTab_Idx (Rcp_UseCurN2Val_Idx+1)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define Rcp_RunTimes_Idx (Rcp_OffsetTab_Idx+1)//<2F><><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
#define Rcp_Cassette_Tier_Idx (Rcp_RunTimes_Idx+1)//<2F>Ϻв<CFBA><D0B2><EFBFBD>
#define Rcp_CalInfo_Start_Idx (Rcp_Cassette_Tier_Idx+1) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
#define Rcp_EdiScope_Idx 9 //<2F><><EFBFBD><EFBFBD><EFBFBD>ܶȸ<DCB6><C8B8><EFBFBD><ECBEAB>
#define Rcp_OverlapX_Idx (Rcp_EdiScope_Idx+1)
#define Rcp_OverlapY_Idx (Rcp_OverlapX_Idx+1)
#define Rcp_FixSpeed_Idx (Rcp_OverlapY_Idx+2)
#define Rcp_FixGap_Idx (Rcp_FixSpeed_Idx+1)
#define Rcp_List_Val_Col 6//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>list <20>е<EFBFBD><D0B5>к<EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum ERecipeParType
{
_RecipeParType_Null = 0,
_RecipeParType_Double,
_RecipeParType_Bool,
_RecipeParType_CString,
_RecipeParType_Int,
};
enum ERecipeCtrlType
{
_RecipeCtrl_AddGroup = 0,
_RecipeCtrl_DelGroup,
_RecipeCtrl_GroupName,
_RecipeCtrl_AddRecipe,
_RecipeCtrl_DelRecipe,
_RecipeCtrl_CopyRecipe,
_RecipeCtrl_MoveRecipe,
_RecipeCtrl_RecipeName,
_RecipeCtrl_AddSubRecipe,
_RecipeCtrl_DelSubRecipe,
_RecipeCtrl_SubRecipeName,
};
//һ<><D2BB>recipe <20><><EFBFBD><EFBFBD>
class CRecipeParameter
{
public:
CRecipeParameter()
{
m_ParDoubleVal = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
m_DoubleMinVal = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ
m_DoubleMaxVal = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
m_ParIntVal = 0;
m_ParType = _RecipeParType_Double;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_ListItemWidht = 100;//<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
m_bRcpInfoPar = false;//<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>ܱ<EFBFBD><DCB1>༭)
m_ParUnit = "/";//<2F><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>λ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
m_DetailInfo = "δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
};
CString GetParStr();
void SetValByStr(CString s);
CString GetParTypeStr();
void SetTypeByStr(CString TypeStr);
void GetRangeStr(CString &Min,CString &Max);
public:
CString m_ParName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>)
double m_ParDoubleVal;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ(<28><><EFBFBD><EFBFBD>)
bool m_ParBoolVal;//bool ֵ(<28><><EFBFBD><EFBFBD>)
CString m_ParStrVal;//<2F>ַ<EFBFBD><D6B7><EFBFBD>ֵ(<28><><EFBFBD><EFBFBD>)
int m_ParIntVal;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ(<28><><EFBFBD><EFBFBD>)
CString m_ParShowName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ERecipeParType m_ParType;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int m_ListItemWidht;//<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
double m_DoubleMinVal;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ
double m_DoubleMaxVal;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
bool m_bRcpInfoPar;//<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>ܱ<EFBFBD><DCB1>༭)
CString m_ParUnit;//<2F><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>λ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
CString m_DetailInfo;//<2F><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
};
class CRecipeCtrlItem
{
public:
CRecipeCtrlItem(){};
public:
CString m_DlgTitle;
CString *m_EditName1;
CString *m_EditName2;
CComboBox *m_RecipeCtrlGroupComb;
CString m_SelGroupName;
};
class CRecipeParCtrlItem
{
public:
CRecipeParCtrlItem(){};
public:
double *m_EditParVal;
CString *m_EditParName;
CComboBox *m_SelScanAreaComb;
CComboBox *m_SelScanAreaIdxComb;
CComboBox *m_SelBoolValComb;
CComboBox *m_SelOffsetTableComb;
CString m_SelScanAreaStr;
};
class CSubRecipe
{
public:
CSubRecipe();
void IntiRecipeParVec();
void ReadMFCCtrlScalFile();
public:
CString m_SubRecipeName;
bool m_bUseSubRecipe;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
vector<CRecipeParameter> m_RecipeParVec;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COffsetTable m_OffsetTable;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
vector<vector<CString>> MFCScalStrVec;
};
class CRecipeCtrlPar
{
public:
CRecipeCtrlPar(){};
public:
ERecipeCtrlType m_CtrlType;
CString m_FilePath;
CString m_NewFilePath;
CString m_RcpName;
CString m_RcpNameNew;
CString m_SubRcpName;
CString m_SubRcpNameNew;
};
//һ<><D2BB>Recipe (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ֵ)
class CRecipe
{
public:
CRecipe();
void RecipeReset();
bool IsValid();
void SaveRecipeParToFile(CString FilePath);
void ReadRecipeParFromFile(CString FilePath);
CRecipeParameter GetRecipePar(CString ParName);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪParName <20><>ֵ
void SetRecipePar(CString ParName,CRecipeParameter RecipePar);//<2F><><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>ΪParName <20><>ֵ
bool CheckParRange(bool bShowMsg);
bool CheckParRangeByName(CString ParName,double val);
bool CheckParRangeExt(CRecipeParameter &RecipePar,double ParVal,bool bShowMsg);
CString GetShowName();
vector<CRecipeParameter> &GetRecipeParVec();
vector<CSubRecipe> &GetSubRecipeVec(){return m_SubRecipeVec;};
void AddSubRecipe(CString SubRecipeName);
int GetCurSubRecipeIdx(){return m_CurSubRecipeIdx;};
void SetCurSubRecipeIdx(int idx){m_CurSubRecipeIdx = idx;};
CString GetCurSubRecipeName();
void SetCurSubRecipeName(CString Name);
void DelSubRecipe(CString SubRecipeName);
bool ReadOffsetTableFile(CString TableName);
double GetOffsetParVal(CString ParName);
public:
int m_GroupIdx;//<2F><><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>(1~10)
int m_RecipeIdx;//<2F><><EFBFBD><EFBFBD><EFBFBD>еı<D0B5><C4B1><EFBFBD>(1~50)
double m_DoubleValCnt;//double <20><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F>µIJ<C2B5><C4B2><EFBFBD>
CString m_RecipeName;//Recipe <20><>
CString m_FilePath;//<2F><EFBFBD><E6B4A2>Ŀ¼
bool m_bEnableEdit;//<2F><>ǰʱ<C7B0><CAB1><EFBFBD><EFBFBD><EFBFBD>Ա༭
int m_CurSubRecipeIdx;//<2F><>ǰʹ<C7B0>õ<EFBFBD>SubRecipe <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD>Χ)(<28><EFBFBD>ͼӹ<CDBC>ʱ<EFBFBD><CAB1><EFBFBD>õ<EFBFBD>)
vector<CSubRecipe> m_SubRecipeVec;//<2F><><EFBFBD><EFBFBD>һƬwafer <20><>recipe ִ<><D6B4>(<28><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>SubRecipe <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B1A8>)
};
//recipe <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
class CRecipeMgr:public CModule
{
public:
CRecipeMgr(void);
virtual ~CRecipeMgr(void);
virtual void OnAppInitialize();
void InitRecipeGourpFile();
CRecipeParameter GetCurRecipePar(CString ParName);
void SelRecipeScanArea(CComboBox &ComboBox);
void SetCurSelGourpIdx(int Idx);
void SetCurSelRecipeIdx(int Idx);
void SetbChangeName(bool b){m_bChangeGroupName = b;};
bool GetbChangeName(){return m_bChangeGroupName;};
void SaveCurSelRecipe(CRecipe Recipe);
CRecipe GetCurWorkRecipe(){return m_CurWorkRecipe;};
void SetCurWorkRecipe(CRecipe Recipe){m_CurWorkRecipe = Recipe;};
CString GetCurSelGroupName();
CString GetSelGroupRecipeStr();
void UpdateSelRecipeList(CListCtrl &List,bool bInsert);
void CreatRecipeScanPath(CRecipe *pRecipe,int SubRecipeIdx);
bool EditRecipeByCtrlType(ERecipeCtrlType t);
ERecipeCtrlType GetCurRecipeCtrlType(){return m_CurRecipeCtrlType;};
CString RecipeCtrlExcute(CRecipeCtrlItem &CtrlItem);
void BindingRecipeGroupComb(CComboBox *p);
void RecipeCtrlInit(CRecipeCtrlItem &CtrlItem);
void InitGroupRecipeList(CListCtrl &List);
void UpdateGroupRecipeList(CListCtrl &List);
void InitEditRecipeList(CListCtrl &List,bool bShowParRange);
void InitEditSubRecipeList(CListCtrl &List);
void UpdateEditRecipeList(CListCtrl &RecipeList,CListCtrl &RecipeInfoList,bool bResetErrRangeParIdxSet=true);
void UpdateEditSubRecipeList(CListCtrl &List);
bool SaveEditRecipePar(CListCtrl &ListCtrl,CListCtrl &RecipeInfoList);
void AddSubRecipe(CString SubRecipeName);
void SetSubRecipeIdx(int idx);
bool MoveSubRecipe(bool bMoveUp);
void OnSelRecipeIdxChange(int idx);
bool ReadEditRecipeFromFile();
CString GetCurEditRecipeInfo();
CString GetCurEditSubRecipeInfo();
void ChangeRecipeName(CString NewRcpName);
void DelSubRecipe(CString SubRecipeName);
void SetCurSelRecipeName(CString s){m_CurSelRecipeName = s;};
void UpdatParBoolComb(CComboBox &Comb);
void UpdateAreaIdxCombo(CComboBox &AreaIdxComb);
bool UpdateRecipeInfoPar(CRecipe &Recipe);
void UpdateRecipeGroupComb(CComboBox *pComb);
void UpdateSelRecipeComb(CComboBox &ComboBox,vector<CString> &SelGroupRecipeNameVec);
bool ReadEditRecipeFromFile(CRecipe &Recipe,int SelGroupIdx,CString SelRecipeName);
void UpdateAllRecipeParToList(CRecipe Recipe,CListCtrl &RecipeList);
CString GetCtrlRecipeFilePath(CString GroupName,CString RecipeName);
void UpdateSelSubRecipeComb(CComboBox &ComboBox,CRecipe Recipe);
void CreatScanPath(CString AreaName,int AreaIdx);
CRecipe GetCurEditRecipe(){return m_CurEditRecipe;};
void CreatCurEditRecipeScanPath();
void UpdateRecipeGroupVec();
void UpdateEditRecipeListExt(CRecipe &Recipe,CListCtrl &RecipeList,CListCtrl &RecipeInfoList);
void UpdateEditSubRecipeListExt(CRecipe &Recipe,CListCtrl &List);
CString GetAreaIdxStr(int k);
CString CreatCurParDataPath();
void SaveRecipeHistoy(CRecipeCtrlPar RecipeCtrlPar);
bool CheckRecipeNameExist(CString RecipeName);
CString GetRecipePathByName(CString RecipeName);
void DeleteRecipeGroup(CString GroupName);
bool IsErrRangeParIdx(int idx){return m_ErrRangeParIdxSet.count(idx);};
bool IsChangeParIdx(int idx){return m_ChangeParIdxSet.count(idx);};
bool IsInvalidParIdx(int idx){return m_InvalidParIdxSet.count(idx);};
void UpdateEditRecipeListExt(CListCtrl &RecipeList,CRecipe &Recipe);
void UpdateInvalidParIdxSet(CRecipe &Recipe);
void UpdateLaserFocusProp();
void UpdateRecipeGroupInfo();
CString GetOffsetTablePath(CString TabName);
CString GetShowParText(int Row);
CString CheckInvalidChar(CString Str);
private:
CString GetGroupDirPath(int GroupIdx);
CString GetRecipeNameListPath();
CString GetRecipeFilePath(int GroupIdx,int RecipeIdx);
CString GetRecipePath();
void CreatRecipeFilePath();
void AddRecipeGroup(CString GroupName);
void AddRecipe(CString GroupName,CString RecipeName);
void ChangeGroupName(CString NewGroupName);
CString GetRecipeCtrlName(ERecipeCtrlType RecipeCtrlType);
void ChangeSubRecipeName(CString NewRcpName);
void SaveRecipeToXml(CString FilePath,CRecipe &Recipe);
void ReadCurGroupRecipeName(vector<CString> &SelGroupRecipeNameVec);
bool ReadRecipeFromXml(CString FilePath,CRecipe &Recipe);
void MoveRecipe(CString GroupName,CString RecipeName);
void CopyRecipe(CString NewRecipeName);
void DeletRecipe(CString RecipeName);
bool IsbSelEditRecipe();
void ResetParIdxSet();
private:
CRecipe m_CurWorkRecipe;//<2F><>ǰ<EFBFBD>ӹ<EFBFBD>ʹ<EFBFBD>õ<EFBFBD>recipe
bool m_bChangeGroupName;//true <20><><EFBFBD><EFBFBD>group <20><><EFBFBD><EFBFBD>,false <20><><EFBFBD><EFBFBD>recipe <20><><EFBFBD><EFBFBD>
vector<CString> m_RecipeGroupNameVec;
int m_CurSelGroupIdx;//<2F><>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD>gourp <20><><EFBFBD><EFBFBD>ֵ
vector<CRecipe> m_CurGroupRecipeVec;//<2F><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>recipe <20><><EFBFBD><EFBFBD>
int m_CurSelRecipeIdx;//<2F><>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD>recipe <20><><EFBFBD><EFBFBD>ֵ
//<2F>µIJ<C2B5><C4B2><EFBFBD>
vector<CString> m_NewRecipeGroupNameVec;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
vector<CString> m_CurSelGroupRecipeNameVec;//<2F><>ǰѡ<C7B0>е<EFBFBD><D0B5><EFBFBD>recipe <20><><EFBFBD><EFBFBD>
ERecipeCtrlType m_CurRecipeCtrlType;//<2F><>ǰ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CComboBox *m_pRecipeGroupComb;
int m_CurSelRecipeParIdx;//<2F><>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD>par <20><><EFBFBD><EFBFBD>ֵ
CString m_CurSelGroupName;//<2F><>ǰѡ<C7B0><D1A1>Group <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CString m_CurSelRecipeName;//<2F><>ǰѡ<C7B0><D1A1>recipe <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CRecipe m_CurEditRecipe;//<2F><>ǰ<EFBFBD><EFBFBD><E0BCAD>recipe
//<2F><><EFBFBD><EFBFBD>recipe list <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
set<int> m_ErrRangeParIdxSet;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
set<int> m_ChangeParIdxSet;//<2F><EFBFBD><E4BBAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
set<int> m_InvalidParIdxSet;//<2F><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
double m_FocusAdjustMin;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7>Сֵ
double m_FocusAdjustMax;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>ֵ
};
extern CRecipeMgr *gRecipeMgr;