SDC C-Project CF Review 프로그램
LYW
2021-09-23 c77236e1522caa3e2082dd7b5b32f6c30b125172
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
// DlgSelfDiagnosis_Setting.cpp: 구현 파일
//
 
#include "stdafx.h"
#include "ReviewSystem.h"
#include "DlgSelfDiagnosis_Setting.h"
#include "afxdialogex.h"
#include "CHCommonClasses/MacroFile.h"
 
// CDlgSelfDiagnosis_Setting 대화 상자
 
IMPLEMENT_DYNAMIC(CDlgSelfDiagnosis_Setting, CDialogEx)
 
CDlgSelfDiagnosis_Setting::CDlgSelfDiagnosis_Setting(CDiagnosisManager* pDiagnosisManager, CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DLG_SELF_DIAGNOSIS_SETTING, pParent)
    , m_dEditReviewPanelPosX(0)
    , m_dEditReviewPanelPosY(0)
    , m_dEditReviewPanelPosX2(0)
    , m_dEditReviewPanelPosY2(0)
    , m_dEditReviewPanelPosX3(0)
    , m_dEditReviewPanelPosY3(0)
    , m_dEditReviewPanelPosX4(0)
    , m_dEditReviewPanelPosY4(0)
    , m_dEditReviewPanelPosX5(0)
    , m_dEditReviewPanelPosY5(0)
    , m_dEditReviewPanelPosX6(0)
    , m_dEditReviewPanelPosY6(0)
{
    m_pDiagnosisManager = pDiagnosisManager;
}
 
CDlgSelfDiagnosis_Setting::~CDlgSelfDiagnosis_Setting()
{
}
 
void CDlgSelfDiagnosis_Setting::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_EDIT_FILE_PATH, m_editFilePath);
    DDX_Control(pDX, IDC_EDIT_PANEL_COUNT_SQUARENESS, m_editPanelCount_Squareness);
    DDX_Control(pDX, IDC_EDIT_JUDGE_DATA_DEGREE, m_editJudgeData_Degree);
    DDX_Control(pDX, IDC_EDIT_AF_DELAY, m_editAFDelay);
    DDX_Control(pDX, IDC_EDIT_JUDGE_DATA_Z_RANGE, m_editJudgeDataZRange);
    DDX_Control(pDX, IDC_COMBO_FLANTESS_MODE, m_ComboFlatnessMode);
    DDX_Control(pDX, IDC_EDIT_RANGE_COUNT_FLATNESS, m_editRangeCount_Flatness);
    DDX_Control(pDX, IDC_EDIT_GLASS_SIZE_X, m_editGlassSizeX);
    DDX_Control(pDX, IDC_EDIT_GLASS_SIZE_Y, m_editGlassSizeY);
    DDX_Control(pDX, IDC_EDIT_PANEL_COUNT_WSI, m_editPanelCount_Wsi);
    DDX_Control(pDX, IDC_EDIT_JUDGE_DATA_3SIGMA, m_editJudgeData_3Sigma);
    DDX_Control(pDX, IDC_STATIC_FILE, m_staticFile);
    DDX_Control(pDX, IDC_EDIT_CAMERA_RESOLUTION, m_editCameraResolution);
    DDX_Control(pDX, IDC_EDIT_CAMERA_FRAME_WIDTH, m_editFrameWidth);
    DDX_Control(pDX, IDC_EDIT_CAMERA_FRAME_HEIGHT, m_editFrameHeight);
    DDX_Control(pDX, IDC_EDIT_MODULE_COUNT, m_editModuleCount);
    DDX_Control(pDX, IDC_EDIT_WSI_PANEL_POS_X, m_editPanelPosX);
    DDX_Control(pDX, IDC_EDIT_WSI_PANEL_POS_Y, m_editPanelPosY);
    DDX_Control(pDX, IDC_EDIT_WSI_PANEL_POS_X2, m_editPanelPosX2);
    DDX_Control(pDX, IDC_EDIT_WSI_PANEL_POS_Y2, m_editPanelPosY2);
    /*< LYW 20210719 : #3517 ADD Start >*/
    DDX_Control(pDX, IDC_CHECK_SELF_DIAGNOSIS_FLATNESS_SKIP, m_CheckFlatnessSkip);
    DDX_Control(pDX, IDC_EDIT_SQUARENESS_STANDARD, m_editSquarenessStandard);
    DDX_Control(pDX, IDC_EDIT_SQUARENESS_STANDARD2, m_editSquarenessStandard2);
    DDX_Control(pDX, IDC_EDIT_WSI_STANDARD, m_editWSIStandard);
    /*< LYW 20210719 : #3517 ADD End >*/
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X, m_dEditReviewPanelPosX);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y, m_dEditReviewPanelPosY);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X2, m_dEditReviewPanelPosX2);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y2, m_dEditReviewPanelPosY2);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X3, m_dEditReviewPanelPosX3);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y3, m_dEditReviewPanelPosY3);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X4, m_dEditReviewPanelPosX4);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y4, m_dEditReviewPanelPosY4);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X5, m_dEditReviewPanelPosX5);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y5, m_dEditReviewPanelPosY5);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_X6, m_dEditReviewPanelPosX6);
    DDX_Text(pDX, IDC_EDIT_REVIEW_PANEL_POS_Y6, m_dEditReviewPanelPosY6);
}
 
 
CString CDlgSelfDiagnosis_Setting::GetFileSaveLastTime()
{
    CString strFilePath = REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_PATH;
    CString strFileName = _T("AutoDiagnosisSetting.cfg");
    strFilePath = strFilePath + _T('\\') + strFileName;
 
    HANDLE h_File = CreateFile(strFilePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
    CString strDate, strYear, strMonth, strDay, strHour, strMinute;
    if (h_File != INVALID_HANDLE_VALUE) {
        //** create_time : 생성 날짜, access_time : 마지막 접근날짜, write_time : 마지막 수정 날짜
        FILETIME create_time, access_time, write_time;
        //** System Time 취득
        GetFileTime(h_File, &create_time, &access_time, &write_time);
 
        //** SystemTime은 UTC형식(Universal Time Coordinated)이기 때문에 그냥 사용 불가능
        //** 지역시간으로 변경(일반적인 시간 계산법 2015/11/09 21:18:35)
        SYSTEMTIME write_system_time, write_local_time;
        FileTimeToSystemTime(&write_time, &write_system_time);
 
        //** write_local_time변수에 변환되어 저장됨
        //** 저장된 형태는 WORD형(short)
        //** wYear, wMonth, wDay, wHour, wMinute, wSecond를 활용하여 사용하면 됨
        SystemTimeToTzSpecificLocalTime(NULL, &write_system_time, &write_local_time);
        
        
        
        strYear.Format("%d", write_local_time.wYear);
        strMonth.Format("%02d", write_local_time.wMonth);
        strDay.Format("%02d", write_local_time.wDay);
        //strHour.Format("%02d", write_local_time.wHour);
        //strMinute.Format("%02d", write_local_time.wMinute);
        strDate = _T("마지막으로 파일을 수정한 날짜 : ")+ strYear +_T("-") + strMonth+ _T("-") + strDay;
        CloseHandle(h_File);
    }
 
    return strDate;
}
 
BOOL CDlgSelfDiagnosis_Setting::ReadAutoDiagnosisConfigFile()
{
    /*< LYW 20210719 : #3517 ADD Start >*/
    CString strConfigFilePath = _T("");
    strConfigFilePath.Format(_T("%s\\%s"), REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_PATH, REVIEW_AUTO_DIAGNOSIS_SETTING_FILE_NAME);
    m_pDiagnosisManager->LoadSettingConfigFile(strConfigFilePath);
    /*< LYW 20210719 : #3517 ADD End >*/
 
    CDiagnosisInfo* pSettingInfo = m_pDiagnosisManager->GetDiagnosisInfo();
    if (pSettingInfo == NULL)
        return FALSE;
 
    CString strTemp = _T("");
 
    m_editFilePath.SetWindowTextA(strConfigFilePath);
 
    strTemp.Format("%d", pSettingInfo->GetModuleCount());
    m_editModuleCount.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetCameraResolution());
    m_editCameraResolution.SetWindowTextA(strTemp);
    
    strTemp.Format("%d", pSettingInfo->GetPanelCount_Squareness());
    m_editPanelCount_Squareness.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetJudgeData_Degree());
    m_editJudgeData_Degree.SetWindowTextA(strTemp);
 
    /*< LYW 20210719 : #3517 ADD Start >*/
    strTemp.Format("%f", pSettingInfo->GetSquarenessStandard());
    m_editSquarenessStandard.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetSquarenessStandard2());
    m_editSquarenessStandard2.SetWindowTextA(strTemp);
    /*< LYW 20210719 : #3517 ADD End >*/
 
    strTemp.Format("%d", pSettingInfo->GetCameraFrameWidth());
    m_editFrameWidth.SetWindowTextA(strTemp);
 
    strTemp.Format("%d", pSettingInfo->GetCameraFrameHeight());
    m_editFrameHeight.SetWindowTextA(strTemp);
 
    strTemp.Format("%d", pSettingInfo->GetAFDelay());
    m_editAFDelay.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetJudgeData_ZRange());
    m_editJudgeDataZRange.SetWindowTextA(strTemp);
 
    int nFlatnessMode = pSettingInfo->GetFlatnessMode();
    int nRangeCount_Flatness = pSettingInfo->GetRangeCount_Flatness();
 
    m_ComboFlatnessMode.AddString("Mode_2x2");
    m_ComboFlatnessMode.AddString("Mode_3x3");
    m_ComboFlatnessMode.AddString("Mode_3x4");
    m_ComboFlatnessMode.AddString("Mode_4x5");
    m_ComboFlatnessMode.AddString("Mode_10x10");
    m_ComboFlatnessMode.SetCurSel(nFlatnessMode);
 
    strTemp.Format("%d",nRangeCount_Flatness);
    m_editRangeCount_Flatness.SetWindowTextA(strTemp);
 
 
    strTemp.Format("%d", pSettingInfo->GetGlassSizeX_Flatness());
    m_editGlassSizeX.SetWindowTextA(strTemp);
 
    strTemp.Format("%d", pSettingInfo->GetGlassSizeY_Flatness());
    m_editGlassSizeY.SetWindowTextA(strTemp);
 
    /*< LYW 20210719 : #3517 ADD Start >*/
    m_CheckFlatnessSkip.SetCheck(pSettingInfo->GetFlastnessSkipMode());
    /*< LYW 20210719 : #3517 ADD End >*/
 
    strTemp.Format("%d", pSettingInfo->GetPanelCount_Wsi());
    m_editPanelCount_Wsi.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetJudgeData_3Sigma());
    m_editJudgeData_3Sigma.SetWindowTextA(strTemp);
 
    /*< LYW 20210719 : #3517 ADD Start >*/
    strTemp.Format("%f", pSettingInfo->GetWSIStandard());
    m_editWSIStandard.SetWindowTextA(strTemp);
    /*< LYW 20210719 : #3517 ADD End >*/
 
    strTemp.Format("%f", pSettingInfo->GetPanelPosX_Wsi());
    m_editPanelPosX.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetPanelPosY_Wsi());
    m_editPanelPosY.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetPanelPosX2_Wsi());
    m_editPanelPosX2.SetWindowTextA(strTemp);
 
    strTemp.Format("%f", pSettingInfo->GetPanelPosY2_Wsi());
    m_editPanelPosY2.SetWindowTextA(strTemp);
 
    //review
    m_dEditReviewPanelPosX = pSettingInfo->GetReviewPanelPosX();
    m_dEditReviewPanelPosY = pSettingInfo->GetReviewPanelPosY();
    m_dEditReviewPanelPosX3 = pSettingInfo->GetReviewPanelPosX3();
    m_dEditReviewPanelPosY3 = pSettingInfo->GetReviewPanelPosY3();
    m_dEditReviewPanelPosX5 = pSettingInfo->GetReviewPanelPosX5();
    m_dEditReviewPanelPosY5 = pSettingInfo->GetReviewPanelPosY5();
 
    m_dEditReviewPanelPosX2 = pSettingInfo->GetReviewPanelPosX2();
    m_dEditReviewPanelPosY2 = pSettingInfo->GetReviewPanelPosY2();
    m_dEditReviewPanelPosX4 = pSettingInfo->GetReviewPanelPosX4();
    m_dEditReviewPanelPosY4 = pSettingInfo->GetReviewPanelPosY4();
    m_dEditReviewPanelPosX6 = pSettingInfo->GetReviewPanelPosX6();
    m_dEditReviewPanelPosY6 = pSettingInfo->GetReviewPanelPosY6();
 
    UpdateData(FALSE);
 
    return TRUE;
}
 
BOOL CDlgSelfDiagnosis_Setting::WriteAutoDiagnosisConfigFile()
{
    UpdateData(TRUE);
 
    BOOL bReturn = FALSE;
    CString strTemp;
    int nTemp;
    double dTemp;
 
    CMacroFile macroFile;
    macroFile.Clear();
 
    CString strItem = _T("");
 
    strItem.Format(_T("MODULE_COUNT"));
    m_editModuleCount.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("SQUARENESS_PANEL_COUNT"));
    m_editPanelCount_Squareness.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("SQUARENESS_CAMERA_RESOLUTION"));
    m_editCameraResolution.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("SQUARENESS_JUDGE_DATA_DEGREE"));
    m_editJudgeData_Degree.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("SQUARENESS_CAMERA_FRAME_WIDTH"));
    m_editFrameWidth.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("SQUARENESS_CAMERA_FRAME_HEIGHT"));
    m_editFrameHeight.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("FLATNESS_AF_DELAY"));
    m_editAFDelay.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("FLATNESS_JUDGE_DATA_Z_RANGE"));
    m_editJudgeDataZRange.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("FLATNESS_MODE"));
    nTemp = m_ComboFlatnessMode.GetCurSel();
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("FLATNESS_RANGECOUNT"));
    m_editRangeCount_Flatness.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("FLATNESS_GLASS_X"));
    m_editGlassSizeX.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("FLATNESS_GLASS_Y"));
    m_editGlassSizeY.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    /*< LYW 20210719 : #3517 ADD Start >*/
    strItem.Format(_T("FLATNESS_SKIPMODE"));
    nTemp = m_CheckFlatnessSkip.GetCheck();
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("SQUARENESS_STANDARD"));
    m_editSquarenessStandard.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("SQUARENESS_STANDARD2"));
    m_editSquarenessStandard2.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("WSI_STANDARD"));
    m_editWSIStandard.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    /*< LYW 20210719 : #3517 ADD End >*/
 
    strItem.Format(_T("WSI_PANEL_COUNT"));
    m_editPanelCount_Wsi.GetWindowTextA(strTemp);
    nTemp = atoi(strTemp);
    macroFile.SetItem(strItem, nTemp);
 
    strItem.Format(_T("WSI_JUDGE_DATA_3SIGMA"));
    m_editJudgeData_3Sigma.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("WSI_PANEL_POSX"));
    m_editPanelPosX.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("WSI_PANEL_POSY"));
    m_editPanelPosY.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("WSI_PANEL_POSX2"));
    m_editPanelPosX2.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    strItem.Format(_T("WSI_PANEL_POSY2"));
    m_editPanelPosY2.GetWindowTextA(strTemp);
    dTemp = atof(strTemp);
    macroFile.SetItem(strItem, dTemp);
 
    //Review
    strItem.Format(_T("REVIEW_PANEL_POSX"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX);
 
    strItem.Format(_T("REVIEW_PANEL_POSY"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY);
 
    strItem.Format(_T("REVIEW_PANEL_POSX3"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX3);
 
    strItem.Format(_T("REVIEW_PANEL_POSY3"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY3);
 
    strItem.Format(_T("REVIEW_PANEL_POSX5"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX5);
 
    strItem.Format(_T("REVIEW_PANEL_POSY5"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY5);
 
    strItem.Format(_T("REVIEW_PANEL_POSX2"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX2);
 
    strItem.Format(_T("REVIEW_PANEL_POSY2"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY2);
 
    strItem.Format(_T("REVIEW_PANEL_POSX4"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX4);
 
    strItem.Format(_T("REVIEW_PANEL_POSY4"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY4);
 
    strItem.Format(_T("REVIEW_PANEL_POSX6"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosX6);
 
    strItem.Format(_T("REVIEW_PANEL_POSY6"));
    macroFile.SetItem(strItem, m_dEditReviewPanelPosY6);
 
    CString strFilePath;
    m_editFilePath.GetWindowTextA(strFilePath);
 
    bReturn = macroFile.Write(strFilePath);
 
    return bReturn;
}
 
BEGIN_MESSAGE_MAP(CDlgSelfDiagnosis_Setting, CDialogEx)
    ON_BN_CLICKED(IDC_BUTTON_SAVE, &CDlgSelfDiagnosis_Setting::OnBnClickedButtonSave)
    ON_CBN_SELCHANGE(IDC_COMBO_FLANTESS_MODE, &CDlgSelfDiagnosis_Setting::OnCbnSelchangeComboFlantessMode)
    ON_BN_CLICKED(IDC_BUTTON_LOAD, &CDlgSelfDiagnosis_Setting::OnBnClickedButtonLoad)
END_MESSAGE_MAP()
 
 
// CDlgSelfDiagnosis_Setting 메시지 처리기
 
 
void CDlgSelfDiagnosis_Setting::OnBnClickedButtonSave()
{
    LPCTSTR pAppNameTemp = AfxGetApp()->m_pszAppName;
    AfxGetApp()->m_pszAppName = _T("자가진단");
 
    if (WriteAutoDiagnosisConfigFile())
    {
        AfxMessageBox(_T("저장 완료!"));
        m_staticFile.SetWindowTextA(GetFileSaveLastTime());
    }
    else
        AfxMessageBox(_T("저장 실패!"));
 
    AfxGetApp()->m_pszAppName = pAppNameTemp;
}
 
 
BOOL CDlgSelfDiagnosis_Setting::OnInitDialog()
{
    CDialogEx::OnInitDialog();
 
    // TODO:  여기에 추가 초기화 작업을 추가합니다.
    m_staticFile.SetWindowTextA(GetFileSaveLastTime());
    ReadAutoDiagnosisConfigFile();
    return TRUE;  // return TRUE unless you set the focus to a control
                  // 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}
 
 
void CDlgSelfDiagnosis_Setting::OnCbnSelchangeComboFlantessMode()
{
    int nMode = m_ComboFlatnessMode.GetCurSel();
    int nRangeCount = 0;
    CString strMode = _T("");
 
    if (nMode == Mode_2x2)
        nRangeCount = 4;
    else if (nMode == Mode_3x3)
        nRangeCount = 9;
    else if (nMode == Mode_3x4)
        nRangeCount = 12;
    else if (nMode == Mode_4x5)
        nRangeCount = 20;
    else if (nMode == Mode_10x10)
        nRangeCount = 100;
 
    strMode.Format("%d", nRangeCount);
    m_editRangeCount_Flatness.SetWindowTextA(strMode);
}
 
 
void CDlgSelfDiagnosis_Setting::OnBnClickedButtonLoad()
{
    // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
    ReadAutoDiagnosisConfigFile();
}