SDC C-Project CF Review 프로그램
LYW
2022-07-05 63439977901d54a01924ed76290931aeddbce66c
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#pragma once
 
#include <vector>
#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<CAutoDrsResultData>                        VectorAutoDrsResultData;
typedef std::vector<CAutoDrsResultData>::iterator            VectorAutoDrsResultDataIt;
typedef std::vector<CAutoDrsResultData>::const_iterator        constVectorAutoDrsResultDataIt;