#pragma once
|
|
#include <vector>
|
#include "CHCommonClasses/MacroFile.h"
|
|
#define MAX_WSI_RESULT_COUNT 12
|
#define MAX_WSI_REFLOW_RESULT_COUNT 20
|
|
enum WSIReflowResultInfo { WsiReflow_AZoneJudge=0,
|
WsiReflow_BZoneJudge,
|
WsiReflow_CZoneJudge,
|
WsiReflow_DZoneJudge,
|
WsiReflowInfo_EZoneJudge,
|
WsiReflowInfo_FZoneJudge,
|
WsiReflow_PointIndex,
|
WsiReflow_Result_Info_Count };
|
|
enum WsiMessageType { WMT_MeasureReady=0, WMT_MeasureStart, WMT_MeasureMotionEnd, WMT_MeasureEnd, WMT_MeasureTimeout };
|
enum WsiDirType { WsiDirType_Left=0, WsiDirType_Top, WsiDirType_Right, WsiDirType_Bottom };
|
enum WsiMode { WsiMode_None=0, WsiMode_Wsi, WsiMode_Confocal };
|
enum WsiMeasureType { WsiMeasureType_Normal=0, WsiMeasureType_Monomer, WsiMeasureType_User, WsiMeasureType_MultiShot,WsiMeasureType_VLSI};
|
|
struct SWsiResult
|
{
|
SWsiResult()
|
{
|
nGlassType = 0;
|
nResultIndex = -1;
|
nResultCode = 0;
|
nResultType = -1;
|
nXSlopeWarn = 0;
|
dDamDistance = 0.;
|
memset(pResultData, 0, sizeof(pResultData));
|
memset(pReflowResultData, 0, sizeof(pReflowResultData));
|
nDefectType =-1;
|
nMultiShot =-1;
|
nCurrentShotNumber = -1;
|
bBigSizeDefect=FALSE;
|
bObjectType =FALSE;
|
fHeight = 0.0f;
|
fWidthX = 0.0f;
|
fWidthY = 0.0f;
|
fAratio = 0.0f;
|
|
nDecisionZoneA = -1;
|
nDecisionZoneB = -1;
|
nDecisionZoneC = -1;
|
nDecisionZoneD = -1;
|
nDecisionZoneE = -1;
|
nDecisionZoneF = -1;
|
nDecisionZoneSlotB = -1;
|
|
dDistFromRef = 0.;
|
|
nJugementR = -1;
|
nJugementG = -1;
|
nJugementB = -1;
|
|
dRZoneHeight = 0.;
|
dGZoneHeight = 0.;
|
dBZoneHeight = 0.;
|
|
dDefectHeight = 0.;
|
|
dCSHeight = 0.;
|
}
|
int nGlassType; //TFE=0,MN=1,QD=2,BANK=3 CS =4 CSG = 5
|
int nResultIndex;
|
int nResultCode;
|
int nResultType;
|
int nXSlopeWarn;
|
int nDefectType;
|
int nMultiShot;
|
int nCurrentShotNumber;
|
int nWsiState;
|
double dAccuracy;
|
double dRepeatability;
|
|
bool bBigSizeDefect;
|
|
float fHeight;
|
float fWidthX;
|
float fWidthY;
|
float fAratio; //TFE
|
|
int nDecisionZoneA;
|
int nDecisionZoneB;
|
int nDecisionZoneC;
|
int nDecisionZoneD;
|
int nDecisionZoneE;
|
int nDecisionZoneF;
|
int nPointIndex;
|
int nDecisionZoneSlotB;
|
|
double dDistFromRef; //MN
|
|
bool bObjectType;
|
int nJugementR;
|
int nJugementG;
|
int nJugementB;
|
double dRZoneHeight;
|
double dGZoneHeight;
|
double dBZoneHeight;
|
double dDefectHeight; //QD
|
|
double dCSHeight; //cs
|
|
|
double dDamDistance;
|
double pResultData[MAX_WSI_RESULT_COUNT];
|
int pReflowResultData[MAX_WSI_REFLOW_RESULT_COUNT];
|
};
|
typedef std::vector<SWsiResult> VectorWsiResult;
|
typedef std::vector<SWsiResult>::iterator VectorWsiResultIt;
|
typedef std::vector<SWsiResult>::const_iterator constVectorWsiResultIt;
|
|
struct SDataWsiMeasurement
|
{
|
SDataWsiMeasurement()
|
{
|
nIndex = 0;
|
strCellID = _T("");
|
bMeasure = TRUE;
|
nDirection1 = WsiDirType_Left;
|
nDirection2 = WsiDirType_Bottom;
|
}
|
int nIndex;
|
CString strCellID;
|
BOOL bMeasure;
|
int nDirection1;
|
int nDirection2;
|
};
|
typedef std::vector<SDataWsiMeasurement> VectorDataWsiMeasurement;
|
typedef std::vector<SDataWsiMeasurement>::iterator VectorDataWsiMeasurementIt;
|
typedef std::vector<SDataWsiMeasurement>::const_iterator constVectorDataWsiMeasurementIt;
|
|
struct SDataWsiJudge
|
{
|
SDataWsiJudge()
|
{
|
nHorzPlusWarningMargin = 0;
|
nHorzPlusNGMargin = 0;
|
nHorzMinusWarningMargin = 0;
|
nHorzMinusNGMargin = 0;
|
|
nVertPlusWarningMargin = 0;
|
nVertPlusNGMargin = 0;
|
nVertMinusWarningMargin = 0;
|
nVertMinusNGMargin = 0;
|
}
|
|
// direction top, bottom
|
int nHorzPlusWarningMargin;
|
int nHorzPlusNGMargin;
|
int nHorzMinusWarningMargin;
|
int nHorzMinusNGMargin;
|
|
// direction left, right
|
int nVertPlusWarningMargin;
|
int nVertPlusNGMargin;
|
int nVertMinusWarningMargin;
|
int nVertMinusNGMargin;
|
};
|
|
interface IWsiControl2Parnet
|
{
|
virtual void IWC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0;
|
virtual BOOL IWC2P_SetMeasureInfo(int nIndex, int nPointIndex, const CString& strImagFilename) = 0;
|
virtual BOOL IWC2P_SetMeasureInfo(int nIndex, int nPointIndex, const CString& strImagFilename, const CString& strImagFilename2) = 0;
|
virtual BOOL IWC2P_SetMeasureInfo(int nIndex, int nPointIndex, const CString& strImagFilename, int nWsiType) = 0;
|
virtual BOOL IWC2P_GetMeasureInfo(int nIndex, int nPointIndex, short& nLoc, short& nOptic, short& nGray, CString& strCellID) = 0;
|
virtual int IWC2P_GetCurrentStatus(int nIndex, CString& strGlassID, CString& strRecipeID, int& nType) = 0;
|
virtual void IWC2P_SetConnectedStatus(int nIndex, int nConnectStatus) = 0;
|
virtual void IWC2P_RecvMeasureMessage(int nIndex, int nMessageType, int nMessageResult) = 0;
|
virtual void IWC2P_SetMeasureResult(int nIndex, const SWsiResult& measureResut) = 0;
|
virtual void IWC2P_SetScanEnd(int nIndex, int nPointIndex, int nPositionX, int nPositionY) = 0;
|
virtual int IWC2P_GetWsiType() = 0;
|
virtual void IWC2P_SetWSIErrorCheck(int nIndex,CString strAlarmMessage)= 0;
|
virtual void IWC2P_SetWSIAliveCheck()= 0;
|
};
|
|
class CWsiControlInfo
|
{
|
public:
|
CWsiControlInfo(int nIndex=0) : m_nIndex(nIndex) { Reset(); }
|
~CWsiControlInfo(void) { Reset(); }
|
void Reset()
|
{
|
m_strName = _T("");
|
m_nControllerType = 0;
|
m_strConnectionPort = _T("");
|
m_nMode = WsiMode_None;
|
m_dOffsetX = 0.0;
|
m_dOffsetY = 0.0;
|
m_dWSIFOVX = 0.0;
|
m_dWSIFOVY = 0.0;
|
m_dWSISCANDIR = 0;
|
|
m_vecDataWsiMeasurement.clear();
|
}
|
|
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("_MODE");
|
pFile->GetItem(strValue, m_nMode, 0);
|
|
strValue = strItemName + _T("_OFFSET_X");
|
pFile->GetItem(strValue, m_dOffsetX, 0.0);
|
|
strValue = strItemName + _T("_OFFSET_Y");
|
pFile->GetItem(strValue, m_dOffsetY, 0.0);
|
|
strValue = strItemName + _T("_FOV_X");
|
pFile->GetItem(strValue, m_dWSIFOVX, 0.0);
|
|
strValue = strItemName + _T("_FOV_Y");
|
pFile->GetItem(strValue, m_dWSIFOVY, 0.0);
|
|
strValue = strItemName + _T("_SCAN_DIR");
|
pFile->GetItem(strValue, m_dWSISCANDIR, 0);
|
|
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("_MODE");
|
pFile->SetItem(strValue, m_nMode);
|
|
strValue = strItemName + _T("_OFFSET_X");
|
pFile->SetItem(strValue, m_dOffsetX);
|
|
strValue = strItemName + _T("_OFFSET_Y");
|
pFile->SetItem(strValue, m_dOffsetY);
|
|
strValue = strItemName + _T("_FOV_X");
|
pFile->SetItem(strValue, m_dWSIFOVX);
|
|
strValue = strItemName + _T("_FOV_Y");
|
pFile->SetItem(strValue, m_dWSIFOVY);
|
|
strValue = strItemName + _T("_SCAN_DIR");
|
pFile->SetItem(strValue, m_dWSISCANDIR);
|
|
return TRUE;
|
}
|
|
// getter
|
int GetIndex() const { return m_nIndex; }
|
CString GetName() const { return m_strName; }
|
int GetControllerType() const { return m_nControllerType; }
|
CString GetConnectionPort() const { return m_strConnectionPort; }
|
int GetMode() const { return m_nMode; }
|
double GetOffsetX() const { return m_dOffsetX; }
|
double GetOffsetY() const { return m_dOffsetY; }
|
double GetWSIFOVX() const { return m_dWSIFOVX; }
|
double GetWSIFOVY() const { return m_dWSIFOVY; }
|
int GetWSIScanDir() const { return m_dWSISCANDIR; }
|
|
// setter
|
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 SetMode(int nMode) { m_nMode = nMode; }
|
void SetOffsetX(double dValue) { m_dOffsetX = dValue; }
|
void SetOffsetY(double dValue) { m_dOffsetY = dValue; }
|
void SetWSIFOVX(double dValue) { m_dWSIFOVX = dValue; }
|
void SetWSIFOVY(double dValue) { m_dWSIFOVY = dValue; }
|
void SetWSIScanDir(double dValue) { m_dWSISCANDIR = dValue; }
|
|
// wsi measurement data
|
void SetWsiMeasurementCount(int nCnt) { m_vecDataWsiMeasurement.resize(nCnt); }
|
int GetWsiMeasurementCount() const { return int(m_vecDataWsiMeasurement.size()); }
|
SDataWsiMeasurement* GetWsiMeasurementData(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=int(m_vecDataWsiMeasurement.size())) return NULL;
|
return &m_vecDataWsiMeasurement[nIdx];
|
}
|
const SDataWsiMeasurement* GetWsiMeasurementData(int nIdx) const
|
{
|
if (nIdx<0 || nIdx>=int(m_vecDataWsiMeasurement.size())) return NULL;
|
return &m_vecDataWsiMeasurement[nIdx];
|
}
|
void SetDataIndex(int nIdx, int nIdxData)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return;
|
m_vecDataWsiMeasurement[nIdx].nIndex = nIdxData;
|
}
|
void SetDataCellID(int nIdx, CString strCellID)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return;
|
m_vecDataWsiMeasurement[nIdx].strCellID = strCellID;
|
}
|
void SetDataMeasure(int nIdx, BOOL bMeasure)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return;
|
m_vecDataWsiMeasurement[nIdx].bMeasure = bMeasure;
|
}
|
void SetDataDirection1(int nIdx, int nDirData)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return;
|
m_vecDataWsiMeasurement[nIdx].nDirection1 = nDirData;
|
}
|
void SetDataDirection2(int nIdx, int nDirData)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return;
|
m_vecDataWsiMeasurement[nIdx].nDirection2 = nDirData;
|
}
|
int GetDataIndex(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return -1;
|
return m_vecDataWsiMeasurement[nIdx].nIndex;
|
}
|
CString GetDataCellID(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return _T("");
|
return m_vecDataWsiMeasurement[nIdx].strCellID;
|
}
|
BOOL GetDataMeasure(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return FALSE;
|
return m_vecDataWsiMeasurement[nIdx].bMeasure;
|
}
|
int GetDataDirection1(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return -1;
|
return m_vecDataWsiMeasurement[nIdx].nDirection1;
|
}
|
int GetDataDirection2(int nIdx)
|
{
|
if (nIdx<0 || nIdx>=GetWsiMeasurementCount()) return -1;
|
return m_vecDataWsiMeasurement[nIdx].nDirection2;
|
}
|
|
// wsi judge data
|
SDataWsiJudge* GetWsiJudgeData() { return &m_dataWsiJudge; }
|
const SDataWsiJudge* GetWsiJudgeData() const { return &m_dataWsiJudge; }
|
void SetHorzWarningMargin(int nPlusMargin, int nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
m_dataWsiJudge.nHorzPlusWarningMargin = nPlusMargin;
|
m_dataWsiJudge.nHorzMinusWarningMargin = nMinusMargin;
|
}
|
void GetHorzWarningMargin(int& nPlusMargin, int& nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
nPlusMargin = m_dataWsiJudge.nHorzPlusWarningMargin;
|
nMinusMargin = m_dataWsiJudge.nHorzMinusWarningMargin;
|
}
|
void SetHorzNGMargin(int nPlusMargin, int nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
m_dataWsiJudge.nHorzPlusNGMargin = nPlusMargin;
|
m_dataWsiJudge.nHorzMinusNGMargin = nMinusMargin;
|
}
|
void GetHorzNGMargin(int& nPlusMargin, int& nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
nPlusMargin = m_dataWsiJudge.nHorzPlusNGMargin;
|
nMinusMargin = m_dataWsiJudge.nHorzMinusNGMargin;
|
}
|
void SetVertWarningMargin(int nPlusMargin, int nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
m_dataWsiJudge.nVertPlusWarningMargin = nPlusMargin;
|
m_dataWsiJudge.nVertMinusWarningMargin = nMinusMargin;
|
}
|
void GetVertWarningMargin(int& nPlusMargin, int& nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
nPlusMargin = m_dataWsiJudge.nVertPlusWarningMargin;
|
nMinusMargin = m_dataWsiJudge.nVertMinusWarningMargin;
|
}
|
void SetVertNGMargin(int nPlusMargin, int nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
m_dataWsiJudge.nVertPlusNGMargin = nPlusMargin;
|
m_dataWsiJudge.nVertMinusNGMargin = nMinusMargin;
|
}
|
void GetVertNGMargin(int& nPlusMargin, int& nMinusMargin)
|
{
|
if (GetWsiJudgeData()==NULL) return;
|
nPlusMargin = m_dataWsiJudge.nVertPlusNGMargin;
|
nMinusMargin = m_dataWsiJudge.nVertMinusNGMargin;
|
}
|
|
protected:
|
int m_nIndex;
|
CString m_strName;
|
int m_nControllerType;
|
CString m_strConnectionPort;
|
int m_nMode;
|
double m_dOffsetX;
|
double m_dOffsetY;
|
double m_dWSIFOVX; //거대결함 측정을 위한 FOV
|
double m_dWSIFOVY; //거대결함 측정을 위한 FOV
|
int m_dWSISCANDIR;//거대결함 측정을 위한 측정 순서
|
|
VectorDataWsiMeasurement m_vecDataWsiMeasurement;
|
SDataWsiJudge m_dataWsiJudge;
|
};
|