#pragma once #include #include "CHCommonClasses/MacroFile.h" #define DRS_STRING_LENGTH 25 #define IMAGEID_LENGTH 100 #define DEFECT_NAME_LENGTH 100 #define DEFECT_CODE_LENGTH 20 #define DEFECT_LENGTH 50 enum DrsType {DrsType_Network = 0, DrsType_Count}; enum AutoDrsCmdType { AutoDrsCmdType_None=-1, AutoDrsCmdType_StrInfo, AutoDrsCmdType_RawImg, AutoDrsCmdType_Abort, AutoDrsCmdType_EndMeas, AutoDrsCmdType_EndConnect, AutoDrsCmdType_Count }; enum AutoDrsResultType { AutoDrsResultType_MsgNG=-2, AutoDrsResultType_NG, AutoDrsResultType_None, AutoDrsResultType_OK }; enum AutoDrsResultIndex { AutoDrsResultIndex_ImageID=0, AutoDrsResultIndex_DefectName, AutoDrsResultIndex_DefectCode, AutoDrsResultIndex_SX, AutoDrsResultIndex_SY, AutoDrsResultIndex_EX, AutoDrsResultIndex_EY, AutoDrsResultIndex_Defect1, AutoDrsResultIndex_Defect2, AutoDrsResultIndex_Defect3, AutoDrsResultIndex_Tilt, AutoDrsResultIndex_Focus, AutoDrsResultIndex_Bright, AutoDrsResultIndex_Uniform, AutoDrsResultIndex_WB, AutoDrsResultIndex_Count }; // interface interface IAutoDrsConnector2Parent { virtual void IADC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0; virtual void IADC2P_ConnectionStatus(int nIndex, BOOL bStatus) = 0; virtual void IADC2P_ReceiveEndMeasure(int nIndex, BOOL bStatus) = 0; }; class CAutoDrsConnectorInfo { public: CAutoDrsConnectorInfo(int nIndex=0) :m_nIndex(nIndex) { Reset(); } ~CAutoDrsConnectorInfo(void) { Reset(); } void Reset() { m_nControllerType = 0; m_strName = _T(""); m_strConnectionPort = _T(""); m_strUploadImagePath = _T(""); m_strDrsImagePath = _T(""); m_strDrsResultPath = _T(""); } BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName) { if (pFile==NULL) return FALSE; CString strValue = _T(""); strValue = strItemName + _T("_INDEX"); pFile->GetItem(strValue, m_nIndex, 0); strValue = strItemName + _T("_NAME"); pFile->GetItem(strValue, m_strName, _T("")); strValue = strItemName + _T("_CONTROL_TYPE"); pFile->GetItem(strValue, m_nControllerType, 0); strValue = strItemName + _T("_CONNECT_PORT"); pFile->GetItem(strValue, m_strConnectionPort, _T("")); strValue = strItemName + _T("_PATH_UPLOAD"); pFile->GetItem(strValue, m_strUploadImagePath, _T("")); strValue = strItemName + _T("_PATH_DRS_IMAGE"); pFile->GetItem(strValue, m_strDrsImagePath, _T("")); strValue = strItemName + _T("_PATH_DRS_RESULT"); pFile->GetItem(strValue, m_strDrsResultPath, _T("")); return TRUE; } BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName) { if (pFile==NULL) return FALSE; CString strValue = _T(""); strValue = strItemName + _T("_INDEX"); pFile->SetItem(strValue, m_nIndex); strValue = strItemName + _T("_NAME"); pFile->SetItem(strValue, m_strName); strValue = strItemName + _T("_CONTROL_TYPE"); pFile->SetItem(strValue, m_nControllerType); strValue = strItemName + _T("_CONNECT_PORT"); pFile->SetItem(strValue, m_strConnectionPort); strValue = strItemName + _T("_PATH_UPLOAD"); pFile->SetItem(strValue, m_strUploadImagePath); strValue = strItemName + _T("_PATH_DRS_IMAGE"); pFile->SetItem(strValue, m_strDrsImagePath); strValue = strItemName + _T("_PATH_DRS_RESULT"); pFile->SetItem(strValue, m_strDrsResultPath); return TRUE; } int GetIndex() const { return m_nIndex; } CString GetName() const { return m_strName; } int GetControllerType() const { return m_nControllerType; } CString GetConnectionPort() const { return m_strConnectionPort; } CString GetUploadImagePath()const { return m_strUploadImagePath; } CString GetDrsImagePath()const { return m_strDrsImagePath; } CString GetResultPath()const { return m_strDrsResultPath; } void SetIndex(int nIndex) { m_nIndex = nIndex; } void SetName(const CString& strName) { m_strName = strName; } void SetControllerType(int nType) { m_nControllerType = nType; } void SetConnectionPort(const CString& strPort) { m_strConnectionPort = strPort; } void SetUploadImagePath(const CString& strPath) { m_strUploadImagePath = strPath; } void SetDrsImagePath(const CString& strPath) { m_strDrsImagePath = strPath; } void SetResultPath(const CString& strPath) { m_strDrsResultPath = strPath; } protected: int m_nIndex; CString m_strName; int m_nControllerType; CString m_strConnectionPort; CString m_strUploadImagePath; // Upload File Path CString m_strDrsImagePath; // Local Image Path CString m_strDrsResultPath; // Drs Result File Path }; struct SDrsTransferData { SDrsTransferData() { reset(); } ~SDrsTransferData() { reset(); } void reset() { memset( strModelID, 0, sizeof( char ) * DRS_STRING_LENGTH ); memset( strGlassID, 0, sizeof( char ) * DRS_STRING_LENGTH ); memset( strFlowID, 0, sizeof( char ) * DRS_STRING_LENGTH ); memset( strStepID, 0, sizeof( char ) * DRS_STRING_LENGTH ); memset( strLotID, 0, sizeof( char ) * DRS_STRING_LENGTH ); } char strModelID[DRS_STRING_LENGTH]; char strGlassID[DRS_STRING_LENGTH]; char strFlowID[DRS_STRING_LENGTH]; char strStepID[DRS_STRING_LENGTH]; char strLotID[DRS_STRING_LENGTH]; }; class CAutoDrsCommandData { public: CAutoDrsCommandData() { Reset(); } virtual ~CAutoDrsCommandData() { Reset(); } void Reset() { // Message Type nCommandType = -1; // String Data strFileName =_T(""); // Integer Data nLocation = 0; nSubType = 0; nDefectIndex = 0; nUMAreaSize = 0; nStckInfo = 0; nCameraID = 0; nScanIndex = 0; nLevelSrcMin = 0; nLevelSrcMax = 0; nLevelRefMin = 0; nLevelRefMax = 0; nRevCamIndex = 0; } public: int nCommandType; CString strFileName; int nLocation; int nSubType; int nDefectIndex; int nUMAreaSize; int nStckInfo; int nCameraID; int nScanIndex; int nLevelSrcMin; int nLevelSrcMax; int nLevelRefMin; int nLevelRefMax; int nRevCamIndex; }; class CAutoDrsResultData { public: CAutoDrsResultData() { Reset(); } virtual ~CAutoDrsResultData() { Reset(); } void Reset() { nReviewDefectIndex = 0; nRankIndex = 0; ZeroMemory(strImageID, sizeof(char)*IMAGEID_LENGTH); ZeroMemory(strDefectName, sizeof(char)*DEFECT_NAME_LENGTH); ZeroMemory(strDefectCode, sizeof(char)*DEFECT_CODE_LENGTH); ZeroMemory(strDefect1, sizeof(char)*DEFECT_LENGTH); ZeroMemory(strDefect2, sizeof(char)*DEFECT_LENGTH); ZeroMemory(strDefect3, sizeof(char)*DEFECT_LENGTH); nSX = nSY = nEX = nEY = 0; fTilt = 0.0; nFocus = 0; nBright = 0; nUniformity = 0; nWB = 0; bCopy = FALSE; } public: // receive data int nReviewDefectIndex; int nRankIndex; int nSX; int nSY; int nEX; int nEY; int nFocus; int nBright; int nUniformity; int nWB; float fTilt; BOOL bCopy; char strImageID[IMAGEID_LENGTH]; char strDefectName[DEFECT_NAME_LENGTH]; char strDefectCode[DEFECT_CODE_LENGTH]; char strDefect1[DEFECT_LENGTH]; char strDefect2[DEFECT_LENGTH]; char strDefect3[DEFECT_LENGTH]; }; typedef std::vector VectorAutoDrsResultData; typedef std::vector::iterator VectorAutoDrsResultDataIt; typedef std::vector::const_iterator constVectorAutoDrsResultDataIt;