SDC C-Project CF Review 프로그램
kojingeun
2023-11-24 c112cf54a238afa473e7eb0ea6298e06f4957658
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#pragma once
 
#include <vector>
 
#include "CHEdgeTriangle/RecipeFormula.h"
#include "CHImageControls/CHImageData.h"
#include "CHReviewResult/DefectResult.h"
typedef std::vector<CCHImageData*>                    VectorImageData;
typedef std::vector<CCHImageData*>::iterator        VectorImageDataIt;
 
namespace CHReviewResult
{
    enum ReviewType            { ReviewType_Review = 0, ReviewType_User, ReviewType_Wsi, ReviewType_Measure, ReviewType_Reflow, ReviewType_WsiReflow,ReviewType_WsiUser, ReviewType_Wsi_MultiShot
    };
    enum ReviewResultCode    { ReviewResult_None = 0, ReviewResult_TriggerMissing=1, ReviewResult_Snap_Complete=3, ReviewResult_Processing=7, ReviewResult_Process_Fail=15, ReviewResult_Process_Complete=31 };
    enum WsiResultCode        { WsiResult_None = 0, WsiResult_Fail=1, WsiResultSuccess=2 };
    enum MeasureResultCode    { MeasureResult_None = 0, MeasureResult_Fail=1, MeasureResult_Success=2 };
    //     enum WSIResultInfo        {    Wsi_X_Height=0, 
    //                                 Wsi_X_Width, 
    //                                 Wsi_X_Area,
    //                                 Wsi_X_A_Ratio, 
    //                                 Wsi_X_LEFT_1_A_Ratio, 
    //                                 Wsi_X_LEFT_2_A_Ratio, 
    //                                 Wsi_X_LEFT_3_A_Ratio, 
    //                                 Wsi_X_LEFT_4_A_Ratio, 
    //                                 Wsi_X_Right_1_A_Ratio, 
    //                                 Wsi_X_Right_2_A_Ratio, 
    //                                 Wsi_X_Right_3_A_Ratio, 
    //                                 Wsi_X_Right_4_A_Ratio,
    //                                 Wsi_Result_Info_Count };
 
    // [2016:11:20]-[WEZASW] : WSI ��� Data �׸� ����
    enum WSIResultInfo        {    Wsi_X_Height=0, 
        Wsi_X_Width, 
        Wsi_X_Area,
        Wsi_X_A_Ratio, 
        Wsi_Result_Info_Count };
 
    // [2016:11:20]-[WEZASW] : WSI ��� Data �׸� ����
    enum WSIReflowResultInfomation        {    WsiReflowInfo_AZoneJudge=0, 
        WsiReflowInfo_BZoneJudge, 
        WsiReflowInfo_CZoneJudge,                                         
        WsiReflowInfo_DZoneJudge,
        WsiReflowInfo_PointIndex, 
        WsiReflowInfo_Result_Info_Count };
        
 
#define MAX_MEASURERESULT       10   
#define MAX_IMAGEDATA           5                     //Fix CD Measure 2016-03-23
 
    // reflow
#define REFLOW_LINE_DATA        6
    enum ReflowErrorInfo    {    ReflowError_WrongSide=-5,
        ReflowError_RoiLengthError=-3,
        ReflowError_RoiSettingError=-2,
        ReflowError_ImageLoadFail=-1 };
}
 
using namespace CHReviewResult;
 
class AFX_EXT_CLASS SReviewResult : public CDefectResult
{
public:
    SReviewResult();
    virtual ~SReviewResult();
    void Reset();
 
public:
    CString                ProcessID;
    int                    nSequenceNo;            // B7 Review Image Naming Rule
    int                    nResultCode;            // result code
    int                    nReviewType;            // Review, Measure, User, Wsi
    int                    nModuleIdx;                // module idx
    int                    nResultIdx;                // result idx
    int                    nRangeIdx;                // range idx
    int                    nZoomIdx;                // zoom idx
    double                dMagnification;            // magnification
    double                dMeasureResolution;        // resolution
    int                    nLightLevel;            // light level
    int                    nExposureTime;            // exposure time
    BOOL                bDigitalZoom;            // digital zoom ?
    double                dRulerInterval;            // ruler Interval
    double                dTargetMotorX;            // ���� ��ǥ
    double                dTargetMotorY;            // ���� ��ǥ
    int                    nUMGrabPosX;            // Snap Pos
    int                    nUMGrabPosY;            // Snap Pos
    int                    nReviewSnapSerialNo;    // serial no
    CString                strSnapTime;            // snap time
    double                dDurationTime;            // duration time
 
    VectorImageData        vectorImageData;        // camera image 
 
    CString                strImgFileName;
    CString                strImgFilePath;
 
    int                    nMagnificationOffsetX;
    int                    nMagnificationOffsetY;
 
    // defect find data
    int                    nReview_ResultCode;
    int                    nReview_Width;
    int                    nReview_Height;
    int                    nReview_Length;
    int                    nReview_Square;
    int                    nReview_Stat;
 
    // wsi data : ��� ���� �׸� �߰�
    int                    nWsi_ResultCode;                            // ���� ����
    int                    nWsi_Type;                                    // �Ը� / ����
    int                    nWsi_SlopeWarn;
    double                pWsi_ResultData[Wsi_Result_Info_Count];        // um
    int                    nWsiReflowPositionIndex;                    // WsiReflowPositionIndex
    int                    nWsi_pReflowResultData[WsiReflowInfo_Result_Info_Count];
    double                dWsi_DamDistance;
    bool                bBigSizeDefect;
    int                    nMultiShotNum; //�Ŵ���� �Կ� ����
 
    int                    nGlassType; //TFE=0,MN=1,QD=2,BANK=3 CS =4 CSG = 5 
 
    int                    nWsi_ResultIndex;
    int                    nWsi_DefectType;
 
    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
 
    int                    nJugementR;
    int                    nJugementG;
    int                    nJugementB;
    double                dRZoneHeight;
    double                dGZoneHeight;
    double                dBZoneHeight;
    double                dDefectHeight; //wsi Height
 
    double                dCSHeight; //cs
 
    // measure data
    int                    nMeasure_RecipeIndex;
    int                    nMeasure_ResultCode;
    VectorResultFormula vecMeasure_ResultData;
 
    // reflow data
    int                    nReflow_Result;                            // ������ Line�� ����. 3 �̸� : DAM2 Reflow ����, 4~5 : DAM1 Reflow ����, 6 : no Reflow ���� / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
    int                    pReflow_LinePosData[REFLOW_LINE_DATA];    // Line ��ǥ ��� �迭. DAM#2 �ٱ� 2 Lines, DAM#2, DAM#1 ������ ��ǥ�� �����(��, Pattern�� �������� �ٱ��ʺ��� ����)
    int                    nReflow_Side;
    int                    nInspectionMode;
    int                    nReflow_CellIndex;
 
    BOOL                bCheckWSISendToMotor;  //�������� ��ǥ �������� Ȯ�� 
    BOOL                bCheckSendToMotor;  //WSI ����� �������� ��ǥ �������� Ȯ�� 
 
};
typedef std::vector<SReviewResult>                    VectorSReviewResult;
typedef std::vector<SReviewResult>::iterator        VectorSReviewResultIt;
typedef std::vector<SReviewResult>::const_iterator    constVectorSReviewResultIt;
 
class AFX_EXT_CLASS CReviewResult
{
public:
    CReviewResult(int nModuleIndex=-1);
    virtual ~CReviewResult(void);
    void Reset();
 
    double GetTotalReviewTime();
    double GetTotalReviewTime(int nIndex);
    double GetReviewTime(int nIndex);
    double GetReviewTime(int nStartIdx, int nEndIdx);
 
    void AddSReviewResult(const SReviewResult& reviewResult);
    void ResizeReviewResult(int nCount);
 
    BOOL CheckComplete() const;
 
    int    GetSReviewResultCount(int nResultCode=ReviewResult_None) const;
    SReviewResult* GetSReviewResult(int nIndex);
    const SReviewResult* GetSReviewResult(int nIndex) const;
    VectorSReviewResult*        GetVectorSReviewResult()                { return &m_vecSReviewResult; }
    const VectorSReviewResult*    GetVectorSReviewResult() const            { return &m_vecSReviewResult; }
 
 
    void    SetModuleIndex(int nIdx)                        { m_nModuleIndex = nIdx; }
    int        GetModuleIndex() const                            { return m_nModuleIndex; }
 
    void    SetLastSReviewResultIndex(int nIdx)                { m_nLastSReviewResultIndex = nIdx; }
    int        GetLastSReviewResultIndex()    const                { return m_nLastSReviewResultIndex; }
 
    void    SetStartSReviewResultIndex(int nIdx)            { m_nStartSReviewResultIndex = nIdx; }
    int        GetStartSReviewResultIndex() const                { return m_nStartSReviewResultIndex; }
 
    void    SetEndSReviewResultIndex(int nIdx)                { m_nEndSReviewResultIndex = nIdx; }
    int        GetEndSReviewResultIndex() const                { return m_nEndSReviewResultIndex; }
 
    void    SetLastSReviewResultTick(DWORD dwTick)            { m_dwLastSReviewResultTick = dwTick; }
    DWORD    GetLastSReviewResultTick() const                { return m_dwLastSReviewResultTick; }
 
    void    SetCollisionPostionX(int nPosion) { m_nCollisionPositionX = nPosion; }
    int        GetCollisionPositionX() const { return m_nCollisionPositionX; }
 
public:
    int                    m_nLastSReviewResultIndex;
    int                    m_nStartSReviewResultIndex;
    int                    m_nEndSReviewResultIndex;
    DWORD                m_dwLastSReviewResultTick;
 
    int                    m_nModuleIndex;
 
    int                    m_nCollisionPositionX;
 
    //protected:
    VectorSReviewResult m_vecSReviewResult;
 
};