SDC C-Project CF Review 프로그램
kojingeun
2023-07-14 f77e8008cac062596058fca2aeddda62b80bedbf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// CFGlassRecipe.h: interface for the CGlassRecipe class.
//
//////////////////////////////////////////////////////////////////////
 
#if !defined(AFX_CFGLASSRECIPE_H__6BC9EE1D_9AE2_4A47_8520_E6FA1A7869DC__INCLUDED_)
#define AFX_CFGLASSRECIPE_H__6BC9EE1D_9AE2_4A47_8520_E6FA1A7869DC__INCLUDED_
 
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
 
#include "CFRecipeJudge.h"
#include "PADRecipe.h"
#include "GlassRecipeHeader.h"
 
 
class AFX_EXT_CLASS CModelRecipe
{
public:
    CModelRecipe();
    virtual ~CModelRecipe();
    CModelRecipe(CModelRecipe& rhs);
    CModelRecipe& operator=(CModelRecipe& rhs);
 
    void                ResetCFRecipeModel();
    BOOL                ReadRecipeFile(int nIdx, CHMRegiConfig* pFile, CString strRecipeName);
    BOOL                WriteRecipeFile(int nIdx, CHMRegiConfig* pFile, CString strRecipeName);
    BOOL                ReadRecipe(CMosisPacket *pPacket);
    BOOL                WriteRecipe(CMosisPacket *pPacket);
    
    int                    GetCellStart(int iCell){return m_pXCellStart==NULL?0:m_pXCellStart[iCell];}
 
    CMODEL_RECIPE_PARM    *GetModelRcpPrm(){return &m_pModelRcpParm;}
    void                SetModelRcpPrm(CMODEL_RECIPE_PARM &pPrm){m_pModelRcpParm=pPrm;}
 
    CMODEL_COORDI_PARM    *GetCoordiRcpPrm(){return &m_pModelRcpParm.m_pCoordiParm;}
    void                SetCoordiRcpPrm(CMODEL_COORDI_PARM &pPrm){m_pModelRcpParm.m_pCoordiParm=pPrm;}
 
    CMODEL_INSPECT_PARM    *GetInsRcpPrm(CameraType Camtype){return Camtype==CamType_Reflex?&m_pModelRcpParm.m_pRefInsParm:&m_pModelRcpParm.m_pTransInsParm;}
    void                SetInsRcpPrm(CMODEL_INSPECT_PARM &pPrm,CameraType Camtype){Camtype==CamType_Reflex?m_pModelRcpParm.m_pRefInsParm=pPrm:m_pModelRcpParm.m_pTransInsParm=pPrm;}
 
    CMODEL_FINDPATTERN_PARM    *GetFindEdgeRcpPrm(CameraType Camtype){return Camtype==CamType_Reflex?&m_pModelRcpParm.m_pRefFindParm:&m_pModelRcpParm.m_pTransFindParm;}
    void                SetFindEdgeRcpPrm(CMODEL_FINDPATTERN_PARM &pPrm,CameraType Camtype){Camtype==CamType_Reflex?m_pModelRcpParm.m_pRefFindParm=pPrm:m_pModelRcpParm.m_pTransFindParm=pPrm;}
 
    //////////////////////////////////////////////////////////////////////////
    // Cell ¼ö¿Í Cell°£ °Å¸®.
    int                    GetXCellNum()            { return GetCoordiRcpPrm()->m_CoordInfoX.m_nCellNum; }
    int                    GetXEdge2Pat()            { return GetCoordiRcpPrm()->m_CoordInfoX.m_nEdgetoPattern; }    
    int                    GetXPattern()            { return GetCoordiRcpPrm()->m_CoordInfoX.m_nPattern; }    
    int                    GetXPat2Edge()            { return GetCoordiRcpPrm()->m_CoordInfoX.m_nPatterntoEdge; }    
    int                    GetXPat2Pat(int nIdx);
    int                    GetXPat2Pat(ScanDirectionIns SDI,int nIdx);
    int                    GetYCellNum()            { return GetCoordiRcpPrm()->m_CoordInfoY.m_nCellNum; }
    int                    GetYEdge2Pat()            { return GetCoordiRcpPrm()->m_CoordInfoY.m_nEdgetoPattern; }
    int                    GetYPat2Pat(int nIdx);
    int                    GetYPat2Pat(ScanDirectionIns SDI,int nIdx);
    int                    GetYPattern()            { return GetCoordiRcpPrm()->m_CoordInfoY.m_nPattern; }
    int                    GetYPat2Edge()            { return GetCoordiRcpPrm()->m_CoordInfoY.m_nPatterntoEdge; }    
 
    void                SetXCellNum();
    void                SetXCellNum(int nCount);
    void                SetXPat2Pat(int nIdx, int nValue);
    void                SetYCellNum();
    void                SetYCellNum(int nCount);
    void                SetYPat2Pat(int nIdx, int nValue);
 
    //////////////////////////////////////////////////////////////////////////
    // Ä«¸Þ¶óº° °ª.
    int                    GetCamBMThreshold(int nIdx,CameraType CamType);
    int                    GetCamPatThreshold(int nIdx,CameraType CamType);
    int                    GetCamSkipSize(int nIdx,CameraType CamType);
    
    void                SetCamNum(int nCount,CameraType CamType);
    void                SetCamBMThreshold(int nIdx, int nValue,CameraType CamType);
    void                SetCamPatThreshold(int nIdx, int nValue,CameraType CamType);
    void                SetCamSkipSize(int nIdx, int nValue,CameraType CamType);
    
    DefectLocation        GetDefectLoc()                    { return GetModelRcpPrm()->m_DefectLoc; }
    void                SetDefectLoc(int nValue)        { GetModelRcpPrm()->m_DefectLoc = static_cast<DefectLocation>(nValue); }
    BOOL                GetReportResult()                { return GetModelRcpPrm()->m_bReportResult; }
    void                SetReportResult(BOOL bReport)    { GetModelRcpPrm()->m_bReportResult = bReport; }
 
protected:
    CMODEL_RECIPE_PARM    m_pModelRcpParm;        
 
// minion't,2009-10-29        
public:
    void SetJudgeRecipe(CCFRecipeJudge *pJudgeRecipe) { m_pJudgeCondition  = pJudgeRecipe; }
    const CCFRecipeJudge *GetJudgeRecipe(void) { return m_pJudgeCondition;}
 
    void SetModelID(int iID) { m_iModelID = iID; }
 
protected:
    CCFRecipeJudge        *m_pJudgeCondition;        // Pointer¸¸ °®°í ÀÖÀÚ.
    int                    m_iModelID;
 
    int*                m_pXCellStart;
};
 
//////////////////////////////////////////////////////////////////////////
// Glass Recipe
class AFX_EXT_CLASS CGlassRecipe  
{
public:
    CGlassRecipe();
    CGlassRecipe(int nCameraNum, int nScanNum);
    virtual ~CGlassRecipe();
    CGlassRecipe(CGlassRecipe& rhs);
    CGlassRecipe& operator=(CGlassRecipe& rhs);
 
    BOOL operator==(CGlassRecipe& rhs);
    BOOL operator!=(CGlassRecipe& rhs);
    
    void                SetCamScanInfo(int nTransCam,int nRefCam, int nScanNum);
    void                SetCamNScanNum(int nTransCam,int nRefCam, int nScanNum);    
    void                ResetCFGlassRecipe();
 
    //////////////////////////////////////////////////////////////////////////
    // ÀÐ°í ¾²±â.
    BOOL                IsRecipeFile(CString strRecipe);
    BOOL                MakeRecipeFileName(CString strRecipe);
    BOOL                MakeRecipeDelegateFile(CString strRecipe);
    BOOL                ReadRecipeTitle();
    BOOL                ReadRecipeFile();
    BOOL                WriteRecipeFile(BOOL bCheck = TRUE);
    BOOL                ReadRecipePacket(CMosisPacket *pPacket);
    BOOL                WriteRecipePacket(CMosisPacket *pPacket);
 
    BOOL                ReadJudgePixelDefect();
    BOOL                ReadJudgeZoneJudge();
    BOOL                ReadJudgeRScaleDefect();
 
    //////////////////////////////////////////////////////////////////////////
    // Recipe Á¤º¸¿¡ Á¢±Ù
    CPADRecipe*            GetPADRecipe(){return &m_pPADRecipe;}
    CPADRecipeModel        *GetPADRecipeModel(int iModel){return GetPADRecipe()->GetPADModel(iModel);}
    pPADLightSetting    GetPADLightParm(int iLight){return GetPADRecipe()->GetLightSetting(iLight);}    
 
    CGLASS_RECIPE_PARM    *GetGlassRcpPrm(){return &m_pGlassRcpParm;}
    void                SetGlassRcpPrm(CGLASS_RECIPE_PARM &pPrm){m_pGlassRcpParm=pPrm;}
 
    CRECIPE_INFO_PARM    *GetRcpInfoPrm(){return &GetGlassRcpPrm()->m_pRcpInfoPrm;}
    void                SetRcpInfoPrm(CRECIPE_INFO_PARM &pPrm){GetGlassRcpPrm()->m_pRcpInfoPrm=pPrm;}
 
    CCAMERA_INSPECT_PARM *GetInspectPrm(CameraType Camtype){return Camtype==CamType_Reflex?&GetGlassRcpPrm()->m_pRefInspectPrm:&GetGlassRcpPrm()->m_pTransInspectPrm;}
    void                SetInspectPrm(CameraType Camtype,CCAMERA_INSPECT_PARM &pPrm){Camtype==CamType_Reflex?GetGlassRcpPrm()->m_pRefInspectPrm=pPrm:GetGlassRcpPrm()->m_pTransInspectPrm=pPrm;}
 
    CEDGECRACK_RECIPE_PARM    *GetEdgeCrackPrm(){return &GetGlassRcpPrm()->m_pEdgeCrack;}
    void                SetEdgeCrackPrm(CEDGECRACK_RECIPE_PARM &pPrm){GetGlassRcpPrm()->m_pEdgeCrack=pPrm;}
 
    CLIGHT_RECIPE_PARM    *GetLightPrm(CameraType Camtype){return Camtype==CamType_Reflex?&GetGlassRcpPrm()->m_pRefLightParm:&GetGlassRcpPrm()->m_pTransLightParm;}
    void                SetLightPrm(CameraType Camtype,CLIGHT_RECIPE_PARM &pPrm){Camtype==CamType_Reflex?GetGlassRcpPrm()->m_pRefLightParm=pPrm:GetGlassRcpPrm()->m_pTransLightParm=pPrm;}
 
    CGLASS_ALIGN_PARM    *GetAlignPrm(){return &GetGlassRcpPrm()->m_pGlassAlignParm;}
    void                SetAlignPrm(CGLASS_ALIGN_PARM &pPrm){GetGlassRcpPrm()->m_pGlassAlignParm=pPrm;}
 
    CGLASS_MASKING_PARM    *GetMaskingPrm(){return &GetGlassRcpPrm()->m_pGlassMaskParm;}
    void                SetMaskingPrm(CGLASS_MASKING_PARM &pPrm){GetGlassRcpPrm()->m_pGlassMaskParm=pPrm;}
 
    CGLASS_DEFECT_JUDG_PARM    *GetDefectJudePrm(){return &GetGlassRcpPrm()->m_pDefectJudge;}
    void                SetDefectJudePrm(CGLASS_DEFECT_JUDG_PARM &pPrm){GetGlassRcpPrm()->m_pDefectJudge=pPrm;}
 
    CGLASS_STACK_PARM    *GetStackPrm(){return &GetGlassRcpPrm()->m_pStackParm;}
    void                SetStackPrm(CGLASS_STACK_PARM &pPrm){GetGlassRcpPrm()->m_pStackParm=pPrm;}
 
    CGLASS_RECIPE_ETC_PARM    *GetEtcPrm(){return &GetGlassRcpPrm()->m_pGlassEtcParm;}
    void                SetEtcPrm(CGLASS_RECIPE_ETC_PARM &pPrm){GetGlassRcpPrm()->m_pGlassEtcParm=pPrm;}
 
    int                    GetModelCount()                        { return m_nModelCount; }    
    CModelRecipe*        GetRecipeModel(int id){return m_pModel+id;}
    BOOL                ReadIsZoneData();    
    
    //////////////////////////////////////////////////////////////////////////
    // X - Y¿¡ Á¾¼ÓÀûÀΠ°¡°øµÈ Á¤º¸ Á¦°ø.
    int                    GetUMCellXPatStart(int nModelIdx, int nCellXIdx);
    int                    GetUMCellXPatEnd(int nModelIdx, int nCellXIdx);
    int                    GetUMCellYPatStart(int nModelIdx, int nCellYIdx);
    int                    GetUMCellYPatEnd(int nModelIdx, int nCellYIdx);
 
    //////////////////////////////////////////////////////////////////////////
    // Utility Function
    int                    GetPreviousCellNumber(int iPreviousModel);                // minion't,2009-10-29. purpose : preventing Cell ID duplication.
    int                    GetModelIndexByCellID(int iCellID);                         // minion't,2009-10-29
    const CCFRecipeJudge        *GetJudgeRecipeyByCellID(int iCellID);                    // minion't,2009-10-29
    int                    GetCellIdx(int nModelIdx, int nXIdx, int nYIdx);
    int                    GetCellIdxContinue(int nModelIdx, int nXIdx, int nYIdx);
    CString                MakeCellNum(int nCellNum, int nSubpanel2nd = 2);
    
    
protected:
    CPADRecipe                    m_pPADRecipe;            // PAD Recipe
    CGLASS_RECIPE_PARM            m_pGlassRcpParm;        // Glass Recipe Parm    
 
    //////////////////////////////////////////////////////////////////////////
    // ÀÐ°í ¾²±â
    CHMRegiConfig                m_RecipeFile;
 
    
    //////////////////////////////////////////////////////////////////////////
    // Model
    int                            m_nModelCount;    
    CModelRecipe*                m_pModel;
 
    void                        SetModelCount(int nCount);            
};
 
#endif // !defined(AFX_CFGLASSRECIPE_H__6BC9EE1D_9AE2_4A47_8520_E6FA1A7869DC__INCLUDED_)