From 1dbe46cd9d0f181d08d5a69f72d8548628a13b9d Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 16 七月 2025 17:13:50 +0800
Subject: [PATCH] 优化:显示在流程中解锁,并且把文件字符集统一替换成UTF-8(BOM)
---
EdgeInspector_App/LicenseChecker.cpp | 2
EdgeInspector_App/View/ViewMain_LiveCam.h | 10
EdgeInspector_App/WebSocket/WebSocketClientPool.h | 18
EdgeInspector_App/Data/Glass_Data.h | 8
EdgeInspector_App/Light/ExternLightControlLCP.h | 2
EdgeInspector_App/MilControl_Common.h | 8
EdgeInspector_App/Grabber/MulticamControl.h | 8
EdgeInspector_App/Fitting/CHDataFitting.h | 2
EdgeInspector_App/UITool/textdescriptor.h | 2
EdgeInspector_App/UITool/Server_MemDC.h | 2
EdgeInspector_App/View/ViewRecipeList.cpp | 10
EdgeInspector_App/Process/ThreadControl.h | 12
EdgeInspector_App/Recipe/HardwareSettings.cpp | 2
EdgeInspector_App/WebSocket/WebSocketClientPool.cpp | 122
EdgeInspector_App/Light/ExternLightControlAKPNV.h | 2
EdgeInspector_App/UITool/texture.cpp | 2
EdgeInspector_App/View/ViewRecipeList.h | 10
EdgeInspector_App/EdgeInspector_AppView.h | 4
EdgeInspector_App/Data/Transfer_Data.h | 2
EdgeInspector_App/Grabber/SapLineGrab.cpp | 18
EdgeInspector_App/Side_Data.h | 16
EdgeInspector_App/Data/PostProcess.h | 4
EdgeInspector_App/UITool/General_Draw.h | 4
EdgeInspector_App/Light/ExternLightControl.h | 2
EdgeInspector_App/MainFrm.cpp | 22
EdgeInspector_App/Recipe/GlassRecipe.h | 38
EdgeInspector_App/UITool/Splash.cpp | 2
EdgeInspector_App/PLC/Control_Interface.cpp | 30
EdgeInspector_App/View/ViewPPIDNew.h | 10
EdgeInspector_App/LanguageControl.h | 2
EdgeInspector_App/License/Worker_UpdateLicense.cpp | 34
EdgeInspector_App/Data/DefectStorage.cpp | 4
EdgeInspector_App/UITool/surfacecolor.cpp | 2
EdgeInspector_App/License/Worker_UpdateLicense.h | 10
EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.cpp | 18
EdgeInspector_App/View/ViewMain_HWSetting.h | 10
EdgeInspector_App/Data/DefectStorage.h | 4
EdgeInspector_App/View/ViewMain_LiveCam.cpp | 8
EdgeInspector_App/DlgSideExceptoinSetting.cpp | 4
EdgeInspector_App/InterfaceManager.h | 2
EdgeInspector_App/EdgeInspector_App.h | 16
EdgeInspector_App/Grabber/SoliosControl.h | 12
EdgeInspector_App/EdgeInspector_App.cpp | 104
EdgeInspector_App/UITool/DisplayMessage.h | 2
EdgeInspector_App/EdgeInspector_AppDoc.h | 18
EdgeInspector_App/EdgeInspector_AppDoc.cpp | 36
EdgeInspector_App/Process/InspectCamera.cpp | 2960 ++++++++++++++++++------------------
EdgeInspector_App/UITool/btnenh.h | 2
EdgeInspector_App/Define/StatusMonitor.cpp | 6
EdgeInspector_App/Fitting/CHDataFitting.cpp | 2
EdgeInspector_App/Grabber/MulticamControl.cpp | 10
EdgeInspector_App/Data/TransDataManager.cpp | 14
EdgeInspector_App/Process/InspectCamera.h | 6
EdgeInspector_App/ViewMain_Information.h | 10
EdgeInspector_App/Data/PostProcess.cpp | 48
EdgeInspector_App/UITool/Splash.h | 2
EdgeInspector_App/UITool/textdescriptor.cpp | 2
EdgeInspector_App/UITool/font.cpp | 2
EdgeInspector_App/DlgSideNotchSetting.h | 10
EdgeInspector_App/View/ImgDefect.cpp | 10
EdgeInspector_App/Light/LightManager.h | 4
EdgeInspector_App/UITool/General_Draw.cpp | 2
EdgeInspector_App/Data/Transfer_Data.cpp | 2
EdgeInspector_App/Grabber/SapControl.h | 12
EdgeInspector_App/WebSocket/ThreadPool.h | 4
EdgeInspector_App/View/DlgLogin.h | 2
EdgeInspector_App/View/ViewMain_ScanImage.cpp | 8
EdgeInspector_App/Recipe/HardwareSettings.h | 6
EdgeInspector_App/View/ImgDefect.h | 4
EdgeInspector_App/View/ViewMain_HWSetting.cpp | 10
EdgeInspector_App/MainFrm.h | 16
EdgeInspector_App/Thread/PriorityThread.h | 2
EdgeInspector_App/Recipe/GlassRecipe.cpp | 2
EdgeInspector_App/UITool/surfacecolor.h | 2
EdgeInspector_App/View/ViewRecipeNew.cpp | 6
EdgeInspector_App/View/ViewPPIDNew.cpp | 6
EdgeInspector_App/PLC/Control_Interface.h | 6
EdgeInspector_App/Thread/Thread_CheckSeq.h | 2
EdgeInspector_App/UITool/cellsmanager.h | 2
EdgeInspector_App/Light/LightManager.cpp | 6
EdgeInspector_App/Thread/Thread_ControlIF.cpp | 4
EdgeInspector_App/UITool/MImageStatic.cpp | 4
EdgeInspector_App/ViewMain_Recipe.h | 10
EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.h | 2
EdgeInspector_App/ViewMain_Information.cpp | 12
EdgeInspector_App/BICommon.h | 2
EdgeInspector_App/Thread/Thread_ViewRefresh.cpp | 4
EdgeInspector_App/Define/InspectionBase.cpp | 2
EdgeInspector_App/Thread/Thread_Send.h | 2
EdgeInspector_App/LicenseChecker.h | 2
EdgeInspector_App/Light/ExternLightControlAKPNV.cpp | 2
EdgeInspector_App/EdgeInspector_AppView.cpp | 14
EdgeInspector_App/View/ViewLampControl.cpp | 10
EdgeInspector_App/Thread/Thread_Send.cpp | 4
EdgeInspector_App/UITool/Singleton.h | 26
EdgeInspector_App/UITool/MImageStatic.h | 4
EdgeInspector_App/View/ViewMain_ScanImage.h | 10
EdgeInspector_App/UITool/btnenh.cpp | 2
EdgeInspector_App/Grabber/SoliosControl.cpp | 10
EdgeInspector_App/DlgLicenseInfo.h | 10
EdgeInspector_App/View/FrameImg.cpp | 22
EdgeInspector_App/Thread/Thread_CheckSeq.cpp | 6
EdgeInspector_App/Define/StatusMonitor.h | 10
EdgeInspector_App/Thread/Thread_ControlIF.h | 2
EdgeInspector_App/Process/ThreadControl.cpp | 10
EdgeInspector_App/View/EdgeImageViewer.h | 20
EdgeInspector_App/Grabber/RadientControl.cpp | 10
EdgeInspector_App/targetver.h | 8
EdgeInspector_App/View/DlgLogin.cpp | 2
EdgeInspector_App/Light/ExternLightControlLCP.cpp | 2
EdgeInspector_App/ViewMain_Recipe.cpp | 20
EdgeInspector_App/stdafx.h | 38
EdgeInspector_App/Data/StopWatch.h | 2
EdgeInspector_App/LanguageControl.cpp | 24
EdgeInspector_App/UITool/texture.h | 2
EdgeInspector_App/View/ViewMain_Defect.cpp | 12
EdgeInspector_App/PLC/Control_Interface_New.cpp | 24
EdgeInspector_App/View/ViewMain_Status.h | 8
EdgeInspector_App/View/EdgeImageViewer.cpp | 68
EdgeInspector_App/View/ViewLampControl.h | 10
EdgeInspector_App/DlgSideUserDefectSetting.cpp | 4
EdgeInspector_App/Data/StopWatch.cpp | 2
EdgeInspector_App/DlgSideDimensionSetting.h | 10
EdgeInspector_App/DlgSideUserDefectSetting.h | 10
EdgeInspector_App/WebSocket/WebSocketClient.h | 52
EdgeInspector_App/Side_Data.cpp | 2
EdgeInspector_App/DlgSideDimensionSetting.cpp | 4
EdgeInspector_App/View/FrameImg.h | 12
EdgeInspector_App/DlgLicenseInfo.cpp | 14
EdgeInspector_App/Grabber/SapControl.cpp | 28
EdgeInspector_App/UITool/font.h | 2
EdgeInspector_App/View/ImgListView.h | 22
EdgeInspector_App/Data/TransDataManager.h | 50
EdgeInspector_App/stdafx.cpp | 8
EdgeInspector_App/UITool/cellsmanager.cpp | 2
EdgeInspector_App/View/ImgListView.cpp | 36
EdgeInspector_App/DlgSideExceptoinSetting.h | 10
EdgeInspector_App/resource.h | 0
EdgeInspector_App/View/ViewRecipeNew.h | 8
EdgeInspector_App/UITool/PixelPtr.h | 2
EdgeInspector_App/View/ViewMain_Status.cpp | 6
EdgeInspector_App/Define/InspectionBase.h | 12
EdgeInspector_App/DlgSideNotchSetting.cpp | 6
EdgeInspector_App/Define/Global_Define.h | 98
EdgeInspector_App/Light/ExternLightControl.cpp | 2
EdgeInspector_App/Data/History.h | 2
EdgeInspector_App/Data/Glass_Data.cpp | 8
EdgeInspector_App/Thread/Thread_ViewRefresh.h | 2
EdgeInspector_App/PLC/Control_Interface_New.h | 6
EdgeInspector_App/UITool/DisplayMessage.cpp | 4
EdgeInspector_App/Grabber/SapLineGrab.h | 10
EdgeInspector_App/InterfaceManager.cpp | 28
EdgeInspector_App/WebSocket/WebSocketClient.cpp | 36
EdgeInspector_App/Grabber/RadientControl.h | 12
EdgeInspector_App/Thread/PriorityThread.cpp | 2
EdgeInspector_App/View/ViewMain_Defect.h | 10
EdgeInspector_App/Defect.h | 4
EdgeInspector_App/WebSocket/ThreadPool.cpp | 2
158 files changed, 2,416 insertions(+), 2,396 deletions(-)
diff --git a/EdgeInspector_App/BICommon.h b/EdgeInspector_App/BICommon.h
index 239fca6..1688d1f 100644
--- a/EdgeInspector_App/BICommon.h
+++ b/EdgeInspector_App/BICommon.h
@@ -1,4 +1,4 @@
-#ifndef BL_COMMON_H
+锘�#ifndef BL_COMMON_H
#define BL_COMMON_H
#include <windows.h>
diff --git a/EdgeInspector_App/Data/DefectStorage.cpp b/EdgeInspector_App/Data/DefectStorage.cpp
index 6656b1a..20497cd 100644
--- a/EdgeInspector_App/Data/DefectStorage.cpp
+++ b/EdgeInspector_App/Data/DefectStorage.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "DefectStorage.h"
#include "SISBuffer.h"
#include "BlobStorage.h"
@@ -46,7 +46,7 @@
delete[] m_pDefect;
}
- // 16俺狼 咯盒阑 敌促..恐? 郴干..
+ // 16淇虹嫾 鍜洅闃� 鏁屼績..鎭�? 閮村共..
int DefectSapce= maxDefect+ 16;
m_pDefect= new CDefect[DefectSapce];
diff --git a/EdgeInspector_App/Data/DefectStorage.h b/EdgeInspector_App/Data/DefectStorage.h
index b4386b8..d2f88e8 100644
--- a/EdgeInspector_App/Data/DefectStorage.h
+++ b/EdgeInspector_App/Data/DefectStorage.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "AssemDefect.h"
@@ -35,7 +35,7 @@
class CDefectControl : public CDefectStorage
{
-public:// Defect 傈价何 眠啊.
+public:// Defect 鍌堜环浣� 鐪犲晩.
CDefectControl();
virtual ~CDefectControl();
diff --git a/EdgeInspector_App/Data/Glass_Data.cpp b/EdgeInspector_App/Data/Glass_Data.cpp
index 22cb525..7658bbb 100644
--- a/EdgeInspector_App/Data/Glass_Data.cpp
+++ b/EdgeInspector_App/Data/Glass_Data.cpp
@@ -1,4 +1,4 @@
-// Glass.cpp: implementation of the CGlass class.
+锘�// Glass.cpp: implementation of the CGlass class.
//
//////////////////////////////////////////////////////////////////////
@@ -185,15 +185,15 @@
arrString.clear();
CString strData = strDataInput;
- strData.Trim(); //??3y??óD????μ??é??
+ strData.Trim(); //??3y??贸D????渭??茅??
if (strData.IsEmpty()) {
return TRUE;
}
- if (-1 == strData.Find(strSign)) { //2?°üo?·???·?
+ if (-1 == strData.Find(strSign)) { //2?掳眉o?路???路?
arrString.push_back(strData);
return TRUE;
}
- while (0 == strData.Find(strSign)) { //?-?·é?3yê×??é?μ?·???·?
+ while (0 == strData.Find(strSign)) { //?-?路茅?3y锚脳??茅?渭?路???路?
strData.Delete(0, strSign.GetLength());
}
strData += strSign;
diff --git a/EdgeInspector_App/Data/Glass_Data.h b/EdgeInspector_App/Data/Glass_Data.h
index f15a349..ae6df54 100644
--- a/EdgeInspector_App/Data/Glass_Data.h
+++ b/EdgeInspector_App/Data/Glass_Data.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include <vector>
#include "Global_Define.h"
@@ -96,8 +96,8 @@
BOOL m_bInspectComplete;
BOOL m_bJudgeNG; // TRUE : NG, FALSE : OK
// Defect
- MapDefect m_MapDefect_NG; // 搬窃沥焊 (NG)
- MapDefect m_MapDefect_OK; // 搬窃沥焊 (OK)
+ MapDefect m_MapDefect_NG; // 鎼獌娌ョ剨 (NG)
+ MapDefect m_MapDefect_OK; // 鎼獌娌ョ剨 (OK)
int m_nCurDefectIdx_Total;
int m_nCurDefectIdx_NG;
@@ -119,7 +119,7 @@
CString m_strLoadingTimeFileName;
CString m_strLoadingDayFileName;
- // Stage theta 焊沥
+ // Stage theta 鐒婃播
short m_nStageLongTheta[2];
short m_nStageShortTheta[2];
diff --git a/EdgeInspector_App/Data/History.h b/EdgeInspector_App/Data/History.h
index 9574ebd..a440085 100644
--- a/EdgeInspector_App/Data/History.h
+++ b/EdgeInspector_App/Data/History.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
diff --git a/EdgeInspector_App/Data/PostProcess.cpp b/EdgeInspector_App/Data/PostProcess.cpp
index c9a5c59..cabe072 100644
--- a/EdgeInspector_App/Data/PostProcess.cpp
+++ b/EdgeInspector_App/Data/PostProcess.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "PostProcess.h"
#include "Config.h"
#include "FreeImage.h"
@@ -180,7 +180,7 @@
if (glass_id.IsEmpty() == TRUE)
glass_id.Format(_T("MANUAL_ID"));
- // 获取当前产品加载时间
+ // 鑾峰彇褰撳墠浜у搧鍔犺浇鏃堕棿
CTime tGlassLoading = m_pGlassData->GetLoadingTime();
CString measure_data;
@@ -249,11 +249,11 @@
CString measure_file_path;
if (m_pHardware->m_bSaveResultByHour) {
- // 按小时保存结果
+ // 鎸夊皬鏃朵繚瀛樼粨鏋�
measure_file_path.Format(_T("%s\\%s_%02d_MeasureData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay, tGlassLoading.GetHour());
}
else {
- // 不按小时保存结果
+ // 涓嶆寜灏忔椂淇濆瓨缁撴灉
measure_file_path.Format(_T("%s\\%s_MeasureData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay);
}
@@ -293,9 +293,9 @@
CString strDefectType = g_strDefectType[pDefect->m_DefectInfo.m_DefectLoc];
if ((strDefectType.Compare(_T("Chip")) == 0 || strDefectType.Compare(_T("In_Chip")) == 0))
{
- // 获取当前时间
+ // 鑾峰彇褰撳墠鏃堕棿
std::time_t now = std::time(nullptr);
- // 使用localtime_s代替localtime
+ // 浣跨敤localtime_s浠f浛localtime
std::tm nowTm;
localtime_s(&nowTm, &now);
@@ -379,9 +379,9 @@
if ((strDefectType.Compare(_T("Chip")) == 0 || strDefectType.Compare(_T("In_Chip")) == 0))
{
- // 获取当前时间
+ // 鑾峰彇褰撳墠鏃堕棿
std::time_t now = std::time(nullptr);
- // 使用localtime_s代替localtime
+ // 浣跨敤localtime_s浠f浛localtime
std::tm nowTm;
localtime_s(&nowTm, &now);
@@ -412,11 +412,11 @@
CString Chip_file_path;
if (m_pHardware->m_bSaveResultByHour) {
- // 按小时保存结果
+ // 鎸夊皬鏃朵繚瀛樼粨鏋�
Chip_file_path.Format(_T("%s\\%s_%02d_ChipData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay, tGlassLoading.GetHour());
}
else {
- // 不按小时保存结果
+ // 涓嶆寜灏忔椂淇濆瓨缁撴灉
Chip_file_path.Format(_T("%s\\%s_ChipData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay);
}
@@ -441,11 +441,11 @@
CString Defect_file_path;
if (m_pHardware->m_bSaveResultByHour) {
- // 按小时保存结果
+ // 鎸夊皬鏃朵繚瀛樼粨鏋�
Defect_file_path.Format(_T("%s\\%s_%02d_DefectData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay, tGlassLoading.GetHour());
}
else {
- // 不按小时保存结果
+ // 涓嶆寜灏忔椂淇濆瓨缁撴灉
Defect_file_path.Format(_T("%s\\%s_DefectData.csv"), m_strResultFolder, g_pBase->m_strLoadingDay);
}
@@ -630,7 +630,7 @@
BOOL bSuccess = TRUE;
Lock();
- // 标题文本
+ // 鏍囬鏂囨湰
CString strTitle;
int nSideIdx = (0 <= pDefect->m_DefectInfo.m_nSideIdx && pDefect->m_DefectInfo.m_nSideIdx < MAX_SIDE_COUNT) ? pDefect->m_DefectInfo.m_nSideIdx : MAX_SIDE_COUNT;
int nCategoryIdx = (0 <= pDefect->m_DefectInfo.m_DefectLoc && pDefect->m_DefectInfo.m_DefectLoc < DefectLoc_None) ? pDefect->m_DefectInfo.m_DefectLoc : DefectLoc_Unknown;
@@ -900,7 +900,7 @@
// 3. Corner
- // A 惑何 官蹿
+ // A 鎯戜綍 瀹樿箍
vecStrTitle.push_back(_T("CORNER_1_X"));
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_A)->m_nBottomCornerWidth);
vecStrResultData.push_back(strTemp);
@@ -908,7 +908,7 @@
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_A)->m_nBottomCornerHeight);
vecStrResultData.push_back(strTemp);
- // C 惑何 官蹿
+ // C 鎯戜綍 瀹樿箍
vecStrTitle.push_back(_T("CORNER_2_X"));
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_C)->m_nBottomCornerWidth);
vecStrResultData.push_back(strTemp);
@@ -916,7 +916,7 @@
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_C)->m_nBottomCornerHeight);
vecStrResultData.push_back(strTemp);
- // C 惑何 啪
+ // C 鎯戜綍 鍟�
vecStrTitle.push_back(_T("CORNER_3_X"));
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_C)->m_nTopCornerWidth);
vecStrResultData.push_back(strTemp);
@@ -924,7 +924,7 @@
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_C)->m_nTopCornerHeight);
vecStrResultData.push_back(strTemp);
- // A 惑何 啪
+ // A 鎯戜綍 鍟�
vecStrTitle.push_back(_T("CORNER_4_X"));
strTemp.Format(_T("%d"), m_pGlassData->GetSideData(DIMENSION_A)->m_nTopCornerWidth);
vecStrResultData.push_back(strTemp);
@@ -983,7 +983,7 @@
CSide_Data* pSideData_UP = NULL;
CSide_Data* pSideData_DN = NULL;
- // Notch乐绰 搁 茫扁
+ // Notch涔愮话 鎼� 鑼墎
for(int nSideIdx=0; nSideIdx<MAX_PANEL_SIDE; nSideIdx++)
{
pSideData_UP = m_pGlassData->GetSideData(arryWriteOrder_UP[nSideIdx]);
@@ -995,7 +995,7 @@
for(int nNotchIdx=0; nNotchIdx<MAX_SIDE_NOTCH_COUNT; nNotchIdx++)
{
- // 4-2. Dimension, 酒阀搁栏肺 螟沥
+ // 4-2. Dimension, 閰掗榾鎼佹爮鑲� 铻熸播
for(int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
{
strTemp.Format(_T("NOTCH_%d_DIM_%d"), nNotchIdx+1, nMeasureIdx+1);
@@ -1032,7 +1032,7 @@
// Save Path
CString strFilePath;
if (m_pHardware->m_bSaveResultByHour) {
- // 按小时保存,绑定玻璃 Loading Time
+ // 鎸夊皬鏃朵繚瀛橈紝缁戝畾鐜荤拑 Loading Time
strFilePath.Format(_T("D:\\Data\\%s\\%s\\%d\\%02d\\%02d\\%s_%s_%02d.csv"),
m_pHardware->GetMachineName(),
m_pHardware->GetLineID(),
@@ -1044,7 +1044,7 @@
tLoadingTime.GetHour());
}
else {
- // 按天保存,绑定玻璃 Loading Time
+ // 鎸夊ぉ淇濆瓨锛岀粦瀹氱幓鐠� Loading Time
strFilePath.Format(_T("D:\\Data\\%s\\%s\\%d\\%02d\\%02d\\%s_%s.csv"),
m_pHardware->GetMachineName(),
m_pHardware->GetLineID(),
@@ -1774,7 +1774,7 @@
/*
pDefect->m_nUMOriginX = (int)((double) (pDefect->m_DefectInfo.m_ptDefectPos_pxl.y - nStartLine) * dScanRes);
- pDefect->m_nUMOriginY = (int)((double) (pDefect->m_DefectInfo.m_ptDefectPos_pxl.x * dConvRes)); // 荐沥 鞘夸..
+ pDefect->m_nUMOriginY = (int)((double) (pDefect->m_DefectInfo.m_ptDefectPos_pxl.x * dConvRes)); // 鑽愭播 闉樺じ..
*/
CSIDE_PARM* pSideParam = &pRecipe->m_SideParam[pDefect->m_DefectInfo.m_nSideIdx];
@@ -2017,13 +2017,13 @@
TCHAR szTemp[MAX_PATH];
wcscpy_s(szTemp, MAX_PATH, strFolder);
- szTemp[strFolder.GetLength() + 1] = NULL; // NULL巩磊啊 滴俺 甸绢啊具 茄促.
+ szTemp[strFolder.GetLength() + 1] = NULL; // NULL宸╃鍟� 婊翠亢 鐢哥虎鍟婂叿 鑼勪績.
FileOp.hwnd = NULL;
FileOp.wFunc = FO_DELETE;
FileOp.pFrom = NULL;
FileOp.pTo = NULL;
- FileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI; // 犬牢皋矫瘤啊 救哆档废 汲沥
+ FileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI; // 鐘墷鐨嬬煫鐦ゅ晩 鏁戝搯妗e簾 姹叉播
FileOp.fAnyOperationsAborted = false;
FileOp.hNameMappings = NULL;
FileOp.lpszProgressTitle = NULL;
diff --git a/EdgeInspector_App/Data/PostProcess.h b/EdgeInspector_App/Data/PostProcess.h
index af63e5f..807e659 100644
--- a/EdgeInspector_App/Data/PostProcess.h
+++ b/EdgeInspector_App/Data/PostProcess.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
#include "HardwareSettings.h"
@@ -58,7 +58,7 @@
BOOL DeleteFolder(const CString &strFolder);
private:
- CRITICAL_SECTION m_criticalSection; //?¥3aá?
+ CRITICAL_SECTION m_criticalSection; //?锟�3a谩?
inline void Lock() { ::InitializeCriticalSection(&m_criticalSection); }
inline void Unlock() { ::DeleteCriticalSection(&m_criticalSection); }
diff --git a/EdgeInspector_App/Data/StopWatch.cpp b/EdgeInspector_App/Data/StopWatch.cpp
index d8c0c3b..8251b28 100644
--- a/EdgeInspector_App/Data/StopWatch.cpp
+++ b/EdgeInspector_App/Data/StopWatch.cpp
@@ -1,4 +1,4 @@
-// StopWatch.cpp: implementation of the CStopWatch class.
+锘�// StopWatch.cpp: implementation of the CStopWatch class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
diff --git a/EdgeInspector_App/Data/StopWatch.h b/EdgeInspector_App/Data/StopWatch.h
index f67e952..018916b 100644
--- a/EdgeInspector_App/Data/StopWatch.h
+++ b/EdgeInspector_App/Data/StopWatch.h
@@ -1,4 +1,4 @@
-// StopWatch.h: interface for the CStopWatch class.
+锘�// StopWatch.h: interface for the CStopWatch class.
//
//////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/Data/TransDataManager.cpp b/EdgeInspector_App/Data/TransDataManager.cpp
index d29c8e7..9b611d0 100644
--- a/EdgeInspector_App/Data/TransDataManager.cpp
+++ b/EdgeInspector_App/Data/TransDataManager.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "TransDataManager.h"
#include <fstream>
#include <iostream>
@@ -46,10 +46,10 @@
EnumPackType ePackType = eAscii;
CString tmpItemByte;
- char LineStr[200]; //茄 临窜困 佬绢甸捞绰 滚欺
- char *tmpStr; //窜困肺 谗篮 单捞磐甫 啊府虐绰 器牢磐
+ char LineStr[200]; //鑼� 涓寸獪鍥� 浣虎鐢告崬缁� 婊氭
+ char *tmpStr; //绐滃洶鑲� 璋楃 鍗曟崬纾愮敨 鍟婂簻铏愮话 鍣ㄧ墷纾�
char *strType;
- char seps[]=" ,\t\n"; //备盒磊
+ char seps[]=" ,\t\n"; //澶囩洅纾�
std::ifstream input;
input.open(FilePath, std::ios::in /*| std::ios::nocreate*/);
@@ -95,7 +95,7 @@
int KeyValue = 0;
if (Key == -1)
{
- KeyValue = (int)m_TransDataPackMap.size(); //父老 蜡老 虐蔼阑 林瘤 臼栏搁 措涝鉴栏肺 鉴瞒利牢 牢郸胶 蔼捞 虐蔼捞 凳
+ KeyValue = (int)m_TransDataPackMap.size(); //鐖惰�� 铚¤�� 铏愯敿闃� 鏋楃槫 鑷兼爮鎼� 鎺稘閴存爮鑲� 閴寸瀿鍒╃墷 鐗㈤兏鑳� 钄兼崬 铏愯敿鎹� 鍑�
}
else KeyValue = Key;
@@ -274,7 +274,7 @@
int k = Fstr.GetLength();
- //傍归阑 绝矩促
+ //鍌嶅綊闃� 缁濈煩淇�
for(i=0;i<Fstr.GetLength();i++)
{
if(Fstr.Mid(i,1) != " ")
@@ -282,7 +282,7 @@
}
k = returnValue.GetLength();
- //酒公繁 data档 绝栏搁 "*" 贸府茄促
+ //閰掑叕绻� data妗� 缁濇爮鎼� "*" 璐稿簻鑼勪績
if(returnValue.GetLength() == 0)
returnValue.Format("*");
else if(returnValue.Mid(0,1) == "")
diff --git a/EdgeInspector_App/Data/TransDataManager.h b/EdgeInspector_App/Data/TransDataManager.h
index 3d3a302..8b52c07 100644
--- a/EdgeInspector_App/Data/TransDataManager.h
+++ b/EdgeInspector_App/Data/TransDataManager.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include <map>
@@ -12,7 +12,7 @@
eAscii = 0,
eUnsignedDec
};
-class CTransDataPack //拱幅 沥焊 class.
+class CTransDataPack //鎷卞箙 娌ョ剨 class.
{
protected:
int m_nIndex;
@@ -66,10 +66,10 @@
}
}
- int GetIndex() {return m_nIndex;}; //拱幅 沥焊狼 鉴辑
- int GetByte() {return m_nByte;}; //拱幅 沥焊狼 辨捞.
+ int GetIndex() {return m_nIndex;}; //鎷卞箙 娌ョ剨鐙� 閴磋緫
+ int GetByte() {return m_nByte;}; //鎷卞箙 娌ョ剨鐙� 杈ㄦ崬.
EnumPackType GetPackType() {return m_ePackType;}
- char* GetValue() {return m_pstrData;}; //拱幅 沥焊狼 蔼
+ char* GetValue() {return m_pstrData;}; //鎷卞箙 娌ョ剨鐙� 钄�
void SetValue(char* pstrData)
{
@@ -92,42 +92,42 @@
virtual ~CTransDataManager();
CTransDataManager& operator=(const CTransDataManager& rhs);
- // 檬扁拳
+ // 妾墎鎷�
void ResetPackData();
- // 16柳荐 -> 10柳荐(int)
+ // 16鏌宠崘 -> 10鏌宠崘(int)
int Hex2Dec(CString hex_str);
- // 16柳荐 -> 何龋绝绰 10柳荐(short)
+ // 16鏌宠崘 -> 浣曢緥缁濈话 10鏌宠崘(short)
short Hex2SignedDec(CString hex_str);
- // 酒胶虐 -> 16柳荐 巩磊凯
+ // 閰掕兌铏� -> 16鏌宠崘 宸╃鍑�
CString Asc2Hex(CStringA hex_str);
- // 胶飘傅 -> 16柳荐
+ // 鑳堕鍌� -> 16鏌宠崘
BOOL StrToHex(CHAR* pchData, CHAR* pchDataSrc, INT nLength, BOOL bWordReverse = FALSE);
- // 16柳荐 -> 何龋乐绰 10柳荐
+ // 16鏌宠崘 -> 浣曢緥涔愮话 10鏌宠崘
UINT Hex2UnsignedDec(CString hex_str);
- // 况靛 -> 10柳荐
+ // 鍐甸潧 -> 10鏌宠崘
UINT GetDataWord2Dec(CString buff, int ap, BOOL hi_bit);
- // 况靛 -> 巩磊凯
+ // 鍐甸潧 -> 宸╃鍑�
CString GetDataWord2Str(CString& value, int& addr, int length);
- // 拱幅 沥焊 辑摹
+ // 鎷卞箙 娌ョ剨 杈戞懝
BOOL SearchValueInMap(CString Name, CString& ReturnValue, int& ByteLength);
- // 拱幅 沥焊 辑摹
+ // 鎷卞箙 娌ョ剨 杈戞懝
BOOL SearchValueInMap(CString Name, int& nReturnValue, int& ByteLength);
- // PLC 单捞磐 -> 甘
+ // PLC 鍗曟崬纾� -> 鐢�
BOOL InsertPLCValueToPack(CString keyName, char* pstrData);
- // 蔼 辑摹
+ // 钄� 杈戞懝
BOOL GetPackDataAll(CString &Name, int Index, int &Byte, CString &Value);
- // 拱幅 单捞磐 傈眉 墨款飘
+ // 鎷卞箙 鍗曟崬纾� 鍌堢湁 澧ㄦ椋�
int GetDataPackTotalNumber();
- // 拱幅 单捞磐 傈眉 官捞飘
+ // 鎷卞箙 鍗曟崬纾� 鍌堢湁 瀹樻崬椋�
int GetDataPackTotalByteSize(){return m_DataPackTotalByteSize;};
- // PLC 单捞磐 -> 甘
+ // PLC 鍗曟崬纾� -> 鐢�
BOOL InsertPLCValueToMap(char* pstrRawData,int nLength);
- // 拱幅单捞磐 器杆 殿废
+ // 鎷卞箙鍗曟崬纾� 鍣ㄦ潌 娈垮簾
void InsertTransItemToMap(CString ItemName, int ItemByte, int Key=-1, EnumPackType ePackType = eAscii);
- // 拱幅单捞磐 器杆 佬扁
+ // 鎷卞箙鍗曟崬纾� 鍣ㄦ潌 浣墎
BOOL LoadTransItemFromFile(CString FilePath);
CString GetItemName(int nIndex);
@@ -136,7 +136,7 @@
void ResetData();
private:
int m_DataPackTotalByteSize;
- std::map<CString,CTransDataPack*> m_TransDataPackMap; //拱幅沥焊 捞抚, 辨捞, 蔼俊 措茄 甘 牧抛捞呈
- std::map<CString,CTransDataPack*>::iterator m_TransDataPackMapiterator; //拱幅 沥焊 啊府虐绰 器牢磐
- std::vector<CString> m_vTransDataList; //拱幅 沥焊 府胶飘
+ std::map<CString,CTransDataPack*> m_TransDataPackMap; //鎷卞箙娌ョ剨 鎹炴姎, 杈ㄦ崬, 钄间繆 鎺寗 鐢� 鐗ф姏鎹炲憟
+ std::map<CString,CTransDataPack*>::iterator m_TransDataPackMapiterator; //鎷卞箙 娌ョ剨 鍟婂簻铏愮话 鍣ㄧ墷纾�
+ std::vector<CString> m_vTransDataList; //鎷卞箙 娌ョ剨 搴滆兌椋�
};
diff --git a/EdgeInspector_App/Data/Transfer_Data.cpp b/EdgeInspector_App/Data/Transfer_Data.cpp
index 6c487b9..d03eedb 100644
--- a/EdgeInspector_App/Data/Transfer_Data.cpp
+++ b/EdgeInspector_App/Data/Transfer_Data.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
#include "Transfer_Data.h"
CTransfer_Data::CTransfer_Data()
diff --git a/EdgeInspector_App/Data/Transfer_Data.h b/EdgeInspector_App/Data/Transfer_Data.h
index 630e4aa..178199d 100644
--- a/EdgeInspector_App/Data/Transfer_Data.h
+++ b/EdgeInspector_App/Data/Transfer_Data.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "TransDataManager.h"
diff --git a/EdgeInspector_App/Defect.h b/EdgeInspector_App/Defect.h
index 026e37a..067544f 100644
--- a/EdgeInspector_App/Defect.h
+++ b/EdgeInspector_App/Defect.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#define DEFECTIMAGE_WIDTH 1024
#define DEFECTIMAGE_HEIGHT 500
@@ -190,7 +190,7 @@
int m_nJudge_Type;
// Exception Area
- int m_nExceptionArea; // 0 : 固器窃, 1 : 混娄 吧魔, 2 : 肯傈 器窃
+ int m_nExceptionArea; // 0 : 鍥哄櫒绐�, 1 : 娣峰▌ 鍚ч瓟, 2 : 鑲倛 鍣ㄧ獌
// User Defect Idx
int m_nUserDefectAreaIdx;
diff --git a/EdgeInspector_App/Define/Global_Define.h b/EdgeInspector_App/Define/Global_Define.h
index 3df4976..20d9aac 100644
--- a/EdgeInspector_App/Define/Global_Define.h
+++ b/EdgeInspector_App/Define/Global_Define.h
@@ -1,4 +1,4 @@
-#ifndef GLOBAL_DEFINE_H
+锘�#ifndef GLOBAL_DEFINE_H
#define GLOBAL_DEFINE_H
#include <map>
@@ -42,11 +42,11 @@
#define CHKMAX(a,b) (((a) > (b)) ? (a) : (b))
#define CHKMIN(a,b) (((a) < (b)) ? (a) : (b))
-#define MAX_PANEL_SIDE 4 // 搁 荐
-#define UPDN_TYPE 2 // 惑窍 鞍捞 乐绰版快 2 窍唱父 乐绰版快 1
+#define MAX_PANEL_SIDE 4 // 鎼� 鑽�
+#define UPDN_TYPE 2 // 鎯戠獚 闉嶆崬 涔愮话鐗堝揩 2 绐嶅敱鐖� 涔愮话鐗堝揩 1
#define MAX_SIDE_COUNT 8
#define MAX_CORNER_DIMENSION_MEASURE_COUNT 5
-#define MAX_SIDE_DIMENSION_MEASURE_COUNT 16 // 弥措 Frame 荐 父怒
+#define MAX_SIDE_DIMENSION_MEASURE_COUNT 16 // 寮ユ帾 Frame 鑽� 鐖舵��
#define MAX_SIDE_EXCEPTION_AREA_COUNT 32
#define MAX_SIDE_USER_DEFECT_AREA_COUNT 32
@@ -87,7 +87,7 @@
enum EmSplashCmd {emShow=0, emHide, emText};
- enum ScanDirectionIns { SD_Forward = 0, SD_Backward, SD_Unknown }; // Glass 扁霖 Scan 规氢.
+ enum ScanDirectionIns { SD_Forward = 0, SD_Backward, SD_Unknown }; // Glass 鎵侀湒 Scan 瑙勬阿.
enum DimensionDir { DIMENSION_A=0, DIMENSION_B, DIMENSION_C, DIMENSION_D,DIMENSION_A_DN, DIMENSION_B_DN, DIMENSION_C_DN, DIMENSION_D_DN, DIMENSION_NONE};
enum EM_CORNER_JUDGE {A_ZONE_CRACK=0,B_ZONE_CRACK,B_ZONE_BURR,C_ZONE_CRACK,C_ZONE_BURR, D_ZONE_CRACK, EDGE_THINCRACK, CHIP_WHITE};
@@ -188,17 +188,17 @@
#define IMAGE_WIDTH 4096 // 8192//2048
#define IMAGE_HEIGHT 1024
#define MAX_IMAGE_FRAME 160//100
-#define MAX_IMAGE_FRAME_SHORT 160//100 // 弥措 橇饭烙 荐
-#define MAX_IMAGE_FRAME_LONG 160//100 // 弥措 橇饭烙 荐
+#define MAX_IMAGE_FRAME_SHORT 160//100 // 寮ユ帾 姗囬キ鐑� 鑽�
+#define MAX_IMAGE_FRAME_LONG 160//100 // 寮ユ帾 姗囬キ鐑� 鑽�
#define MAX_SIDE_INSPECT_AREA_COUNT 12
-#define MAX_IMAGE_LINE_SHORT MAX_IMAGE_FRAME_SHORT * IMAGE_HEIGHT // 弥措 扼牢荐
-#define MAX_IMAGE_LINE_LONG MAX_IMAGE_FRAME_LONG * IMAGE_HEIGHT // 弥措 扼牢荐
+#define MAX_IMAGE_LINE_SHORT MAX_IMAGE_FRAME_SHORT * IMAGE_HEIGHT // 寮ユ帾 鎵肩墷鑽�
+#define MAX_IMAGE_LINE_LONG MAX_IMAGE_FRAME_LONG * IMAGE_HEIGHT // 寮ユ帾 鎵肩墷鑽�
#define MAX_IMAGE_LINE MAX_IMAGE_LINE_LONG
#define MAX_LIMIT_LINE (MAX_IMAGE_FRAME - 1) * IMAGE_HEIGHT
-#define MAX_IMAGE_LINE_MARGIN ((MAX_IMAGE_FRAME+50) * IMAGE_HEIGHT) //(150 * IMAGE_HEIGHT) // 弥措 扼牢荐
+#define MAX_IMAGE_LINE_MARGIN ((MAX_IMAGE_FRAME+50) * IMAGE_HEIGHT) //(150 * IMAGE_HEIGHT) // 寮ユ帾 鎵肩墷鑽�
#define ALIGN_4BYTE(width) (width + 3)/4*4
#define PI 3.14159265358979323846
@@ -331,53 +331,53 @@
#define MAX_SIDE_INSPECT_TYPE 8
struct WSSendData {
- //=======================待定==========================
- //uint8_t operation; // 操作符 (1字节)
- //uint8_t operand; // 操作数 (1字节)
- //uint16_t blockNumber; // 图像块编号 (2字节无符号整数)
- //uint32_t dataOffset; // 数据偏移 (4字节无符号整数)
+ //=======================寰呭畾==========================
+ //uint8_t operation; // 鎿嶄綔绗� (1瀛楄妭)
+ //uint8_t operand; // 鎿嶄綔鏁� (1瀛楄妭)
+ //uint16_t blockNumber; // 鍥惧儚鍧楃紪鍙� (2瀛楄妭鏃犵鍙锋暣鏁�)
+ //uint32_t dataOffset; // 鏁版嵁鍋忕Щ (4瀛楄妭鏃犵鍙锋暣鏁�)
//=====================================================
- uint8_t nCheckType = 0; // 检测类型
- uint8_t nRecipe = 0; // 配方
- uint8_t nLineType = 0; // 线别类型
- uint8_t nIndex = 0; // 图片序号
- uint8_t nFrameIdx = 0; // 帧序号
- uint8_t nScanIdx = 0; // 侧别
- uint8_t nNGType = 0; // NG 类型
- uint8_t nPosition = 0; // 位置
- uint8_t nState = 0; // 状态
- uint16_t nEdgeX = 0; // X方向边缘坐标
- uint16_t nEdgeY = 0; // X方向边缘坐标
- uint16_t nNPointY = 0; // Y方向NG区域坐标
- uint16_t nWidth = 0; // 图像宽度
- uint16_t nHeight = 0; // 图像高度
- double dTimeStamp = 0.0; // 时间戳
- uint16_t nLeft = 0; // 在原图的位置
- uint16_t nTop = 0; // 在原图的位置
- std::string strSN = ""; // 序列号
- std::vector<char> image = {}; // 图像数据 (二进制数据)
+ uint8_t nCheckType = 0; // 妫�娴嬬被鍨�
+ uint8_t nRecipe = 0; // 閰嶆柟
+ uint8_t nLineType = 0; // 绾垮埆绫诲瀷
+ uint8_t nIndex = 0; // 鍥剧墖搴忓彿
+ uint8_t nFrameIdx = 0; // 甯у簭鍙�
+ uint8_t nScanIdx = 0; // 渚у埆
+ uint8_t nNGType = 0; // NG 绫诲瀷
+ uint8_t nPosition = 0; // 浣嶇疆
+ uint8_t nState = 0; // 鐘舵��
+ uint16_t nEdgeX = 0; // X鏂瑰悜杈圭紭鍧愭爣
+ uint16_t nEdgeY = 0; // X鏂瑰悜杈圭紭鍧愭爣
+ uint16_t nNPointY = 0; // Y鏂瑰悜NG鍖哄煙鍧愭爣
+ uint16_t nWidth = 0; // 鍥惧儚瀹藉害
+ uint16_t nHeight = 0; // 鍥惧儚楂樺害
+ double dTimeStamp = 0.0; // 鏃堕棿鎴�
+ uint16_t nLeft = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
+ uint16_t nTop = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
+ std::string strSN = ""; // 搴忓垪鍙�
+ std::vector<char> image = {}; // 鍥惧儚鏁版嵁 (浜岃繘鍒舵暟鎹�)
};
struct WSReceiveData {
- // 定义一个表示NG位置的结构体
+ // 瀹氫箟涓�涓〃绀篘G浣嶇疆鐨勭粨鏋勪綋
struct NGPosition {
- uint8_t nNGType = 0; // NG 类型
- uint16_t nLeft = 0; // 在原图的位置
- uint16_t nTop = 0; // 在原图的位置
- uint16_t nRight = 0; // 在原图的位置
- uint16_t nBottom = 0; // 在原图的位置
+ uint8_t nNGType = 0; // NG 绫诲瀷
+ uint16_t nLeft = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
+ uint16_t nTop = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
+ uint16_t nRight = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
+ uint16_t nBottom = 0; // 鍦ㄥ師鍥剧殑浣嶇疆
};
- uint8_t nRecipe = 0; // 配方
- uint8_t nLineType = 0; // 线别类型
- uint8_t nIndex = 0; // 图片序号
- uint8_t nFrameIdx = 0; // 帧序号
- uint8_t nScanIdx = 0; // 侧别
- std::string strSN = ""; // 序列号
- double dTimeStamp = 0.0; // 时间戳
- uint8_t nGNum = 0; // NG 数量
- std::vector<NGPosition> ngPosArray = {}; // NG 位置数组
+ uint8_t nRecipe = 0; // 閰嶆柟
+ uint8_t nLineType = 0; // 绾垮埆绫诲瀷
+ uint8_t nIndex = 0; // 鍥剧墖搴忓彿
+ uint8_t nFrameIdx = 0; // 甯у簭鍙�
+ uint8_t nScanIdx = 0; // 渚у埆
+ std::string strSN = ""; // 搴忓垪鍙�
+ double dTimeStamp = 0.0; // 鏃堕棿鎴�
+ uint8_t nGNum = 0; // NG 鏁伴噺
+ std::vector<NGPosition> ngPosArray = {}; // NG 浣嶇疆鏁扮粍
};
#endif // GLOBAL_DEFINE_H
\ No newline at end of file
diff --git a/EdgeInspector_App/Define/InspectionBase.cpp b/EdgeInspector_App/Define/InspectionBase.cpp
index db1192c..c14d529 100644
--- a/EdgeInspector_App/Define/InspectionBase.cpp
+++ b/EdgeInspector_App/Define/InspectionBase.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
#include "config.h"
const TCHAR *PANEL_SIDE[] = {_T("A_TOP"), _T("B_TOP"), _T("C_TOP"), _T("D_TOP"),_T("A_BOT"), _T("B_BOT"), _T("C_BOT"), _T("D_BOT")};
diff --git a/EdgeInspector_App/Define/InspectionBase.h b/EdgeInspector_App/Define/InspectionBase.h
index 737765f..0801f8c 100644
--- a/EdgeInspector_App/Define/InspectionBase.h
+++ b/EdgeInspector_App/Define/InspectionBase.h
@@ -1,4 +1,4 @@
-// HMX64Fundamentals.h: interface for the CHMX64Fundamentals class.
+锘�// HMX64Fundamentals.h: interface for the CHMX64Fundamentals class.
//
//////////////////////////////////////////////////////////////////////
@@ -17,17 +17,17 @@
public:
CStringArray m_strCamCCA;
CStringArray m_strCamCVI;
- int *m_pBufferSize; // Grab俊辑 Buffer狼 农扁.
- int *m_pBufferCount; // Grab Buffer狼 荐.
- int *m_pMemFrameNo; // 角力 皋葛府 橇饭烙 荐
+ int *m_pBufferSize; // Grab淇婅緫 Buffer鐙� 鍐滄墎.
+ int *m_pBufferCount; // Grab Buffer鐙� 鑽�.
+ int *m_pMemFrameNo; // 瑙掑姏 鐨嬭憶搴� 姗囬キ鐑� 鑽�
int *m_pCameraPort;
int *m_pFrameHeight;
int *m_pFrameWidth;
int *m_nBoardID;
int *m_nBoardCh;
AcqMode m_AcqMode;
- int m_nFrameDefectPixel; // 茄 Frame狼 弥措 搬窃 Pixel 荐
- int m_nMaxDefect; // miniont,2011-04-28, 弥措 搬窃 俺荐
+ int m_nFrameDefectPixel; // 鑼� Frame鐙� 寮ユ帾 鎼獌 Pixel 鑽�
+ int m_nMaxDefect; // miniont,2011-04-28, 寮ユ帾 鎼獌 淇鸿崘
int m_nCameraCount;
int m_nScanCount;
int m_nThreadCount;
diff --git a/EdgeInspector_App/Define/StatusMonitor.cpp b/EdgeInspector_App/Define/StatusMonitor.cpp
index ea165b6..d3b61b9 100644
--- a/EdgeInspector_App/Define/StatusMonitor.cpp
+++ b/EdgeInspector_App/Define/StatusMonitor.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "StatusMonitor.h"
@@ -66,13 +66,13 @@
TCHAR szTemp[MAX_PATH];
wcscpy_s(szTemp, MAX_PATH, strFolder);
- szTemp[strFolder.GetLength() + 1] = NULL; // NULL巩磊啊 滴俺 甸绢啊具 茄促.
+ szTemp[strFolder.GetLength() + 1] = NULL; // NULL宸╃鍟� 婊翠亢 鐢哥虎鍟婂叿 鑼勪績.
FileOp.hwnd = NULL;
FileOp.wFunc = FO_DELETE;
FileOp.pFrom = NULL;
FileOp.pTo = NULL;
- FileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI; // 犬牢皋矫瘤啊 救哆档废 汲沥
+ FileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI; // 鐘墷鐨嬬煫鐦ゅ晩 鏁戝搯妗e簾 姹叉播
FileOp.fAnyOperationsAborted = false;
FileOp.hNameMappings = NULL;
FileOp.lpszProgressTitle = NULL;
diff --git a/EdgeInspector_App/Define/StatusMonitor.h b/EdgeInspector_App/Define/StatusMonitor.h
index 624fbf6..7ad3b82 100644
--- a/EdgeInspector_App/Define/StatusMonitor.h
+++ b/EdgeInspector_App/Define/StatusMonitor.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Singleton.h"
#include "Config.h"
@@ -16,13 +16,13 @@
#include "LicenseChecker.h"
/*
-Main Interface 狼 Instance Pointer 甫 爱绊 乐绰促.
+Main Interface 鐙� Instance Pointer 鐢� 鐖辩粖 涔愮话淇�.
-UI俊辑绰 Main Interface 立辟阑 窍霸登搁 惑龋 曼炼捞骨肺,
+UI淇婅緫缁� Main Interface 绔嬭緹闃� 绐嶉湼鐧绘悂 鎯戦緥 鏇肩偧鎹為鑲�,
-CStatusMonitor 肺 阿 Instance 俊 立辟窍档废 窍磊
+CStatusMonitor 鑲� 闃� Instance 淇� 绔嬭緹绐嶆。搴� 绐嶇
-UI 付促 Interface 父靛绰芭 蓖满栏聪瘪
+UI 浠樹績 Interface 鐖堕潧缁拌姯 钃栨弧鏍忚仾鐦�
*/
class CStatusMonitor : public Singleton<CStatusMonitor>
diff --git a/EdgeInspector_App/DlgLicenseInfo.cpp b/EdgeInspector_App/DlgLicenseInfo.cpp
index a78611c..8a069cd 100644
--- a/EdgeInspector_App/DlgLicenseInfo.cpp
+++ b/EdgeInspector_App/DlgLicenseInfo.cpp
@@ -1,4 +1,4 @@
-// DlgLicenseInfo.cpp : 备泅 颇老涝聪促.
+锘�// DlgLicenseInfo.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CDlgLicenseInfo 措拳 惑磊涝聪促.
+// CDlgLicenseInfo 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CDlgLicenseInfo, CDialogEx)
@@ -48,16 +48,16 @@
// key status
switch (status.nKeyStatus)
{
- case LicenseKey_NotConnected: // 楷搬 救凳
+ case LicenseKey_NotConnected: // 妤锋惉 鏁戝嚦
strValue = L"Key Status = Not Connected";
break;
- case LicenseKey_NotCertified: // 牢刘 救凳
+ case LicenseKey_NotCertified: // 鐗㈠垬 鏁戝嚦
strValue = L"Key Status = Not Certified";
break;
- case LicenseKey_NotActivated: // 劝己拳 救凳
+ case LicenseKey_NotActivated: // 鍔濆繁鎷� 鏁戝嚦
strValue = L"Key Status = Not Activated";
break;
- case LicenseKey_Activated: // 劝己拳 凳
+ case LicenseKey_Activated: // 鍔濆繁鎷� 鍑�
strValue = L"Key Status = Activated";
break;
}
@@ -85,4 +85,4 @@
END_MESSAGE_MAP()
-// CDlgLicenseInfo 皋矫瘤 贸府扁涝聪促.
+// CDlgLicenseInfo 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
diff --git a/EdgeInspector_App/DlgLicenseInfo.h b/EdgeInspector_App/DlgLicenseInfo.h
index f3795e2..106eb1d 100644
--- a/EdgeInspector_App/DlgLicenseInfo.h
+++ b/EdgeInspector_App/DlgLicenseInfo.h
@@ -1,21 +1,21 @@
-#pragma once
+锘�#pragma once
#include "StatusMonitor.h"
-// CDlgLicenseInfo 措拳 惑磊涝聪促.
+// CDlgLicenseInfo 鎺嫵 鎯戠娑濊仾淇�.
class CDlgLicenseInfo : public CDialogEx
{
DECLARE_DYNAMIC(CDlgLicenseInfo)
public:
- CDlgLicenseInfo(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CDlgLicenseInfo(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CDlgLicenseInfo();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DIALOG_LICENSE };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/DlgSideDimensionSetting.cpp b/EdgeInspector_App/DlgSideDimensionSetting.cpp
index 50da183..f8dcc8c 100644
--- a/EdgeInspector_App/DlgSideDimensionSetting.cpp
+++ b/EdgeInspector_App/DlgSideDimensionSetting.cpp
@@ -1,4 +1,4 @@
-// DlgSideDimensionSetting.cpp : 备泅 颇老涝聪促.
+锘�// DlgSideDimensionSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CDlgSideDimensionSetting 措拳 惑磊涝聪促.
+// CDlgSideDimensionSetting 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CDlgSideDimensionSetting, CDialogEx)
diff --git a/EdgeInspector_App/DlgSideDimensionSetting.h b/EdgeInspector_App/DlgSideDimensionSetting.h
index 8c8b495..365ab40 100644
--- a/EdgeInspector_App/DlgSideDimensionSetting.h
+++ b/EdgeInspector_App/DlgSideDimensionSetting.h
@@ -1,25 +1,25 @@
-#pragma once
+锘�#pragma once
#include "GridCtrl.h"
#include "GlassRecipe.h"
#include "Glass_Data.h"
-// CDlgSideDimensionSetting 措拳 惑磊涝聪促.
+// CDlgSideDimensionSetting 鎺嫵 鎯戠娑濊仾淇�.
class CDlgSideDimensionSetting : public CDialogEx
{
DECLARE_DYNAMIC(CDlgSideDimensionSetting)
public:
- CDlgSideDimensionSetting(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CDlgSideDimensionSetting(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CDlgSideDimensionSetting();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_SIDE_DIMENSION_SETTING };
protected:
virtual BOOL OnInitDialog();
BOOL PreTranslateMessage(MSG* pMsg);
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/DlgSideExceptoinSetting.cpp b/EdgeInspector_App/DlgSideExceptoinSetting.cpp
index 9270b74..95ca237 100644
--- a/EdgeInspector_App/DlgSideExceptoinSetting.cpp
+++ b/EdgeInspector_App/DlgSideExceptoinSetting.cpp
@@ -1,4 +1,4 @@
-// DlgSideExceptoinSetting.cpp : 备泅 颇老涝聪促.
+锘�// DlgSideExceptoinSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CDlgSideDimensionSetting 措拳 惑磊涝聪促.
+// CDlgSideDimensionSetting 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CDlgSideExceptoinSetting, CDialogEx)
diff --git a/EdgeInspector_App/DlgSideExceptoinSetting.h b/EdgeInspector_App/DlgSideExceptoinSetting.h
index 9aa25eb..79e6fa0 100644
--- a/EdgeInspector_App/DlgSideExceptoinSetting.h
+++ b/EdgeInspector_App/DlgSideExceptoinSetting.h
@@ -1,26 +1,26 @@
-#pragma once
+锘�#pragma once
#include "GridCtrl.h"
#include "GlassRecipe.h"
#include "Glass_Data.h"
#include "EdgeImageViewer.h"
-// CDlgSideExceptoinSetting 措拳 惑磊涝聪促.
+// CDlgSideExceptoinSetting 鎺嫵 鎯戠娑濊仾淇�.
class CDlgSideExceptoinSetting : public CDialogEx
{
DECLARE_DYNAMIC(CDlgSideExceptoinSetting)
public:
- CDlgSideExceptoinSetting(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CDlgSideExceptoinSetting(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CDlgSideExceptoinSetting();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_SIDE_EXCEPTION_SETTING };
protected:
virtual BOOL OnInitDialog();
BOOL PreTranslateMessage(MSG* pMsg);
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/DlgSideNotchSetting.cpp b/EdgeInspector_App/DlgSideNotchSetting.cpp
index 2333a18..c385892 100644
--- a/EdgeInspector_App/DlgSideNotchSetting.cpp
+++ b/EdgeInspector_App/DlgSideNotchSetting.cpp
@@ -1,4 +1,4 @@
-// DlgSideNotchSetting.cpp : 备泅 颇老涝聪促.
+锘�// DlgSideNotchSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -8,7 +8,7 @@
#include "Global_Define.h"
-// CDlgSideNotchSetting 措拳 惑磊涝聪促.
+// CDlgSideNotchSetting 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CDlgSideNotchSetting, CDialogEx)
@@ -281,7 +281,7 @@
vecParams.push_back(strTemp);
strTemp.Format(_T("Use Notch Defect"));
vecParams.push_back(strTemp);
- strTemp.Format(_T("Inspect Threshold (″)"));
+ strTemp.Format(_T("Inspect Threshold (鈥�)"));
vecParams.push_back(strTemp);
strTemp.Format(_T("Inspect Offset"));
vecParams.push_back(strTemp);
diff --git a/EdgeInspector_App/DlgSideNotchSetting.h b/EdgeInspector_App/DlgSideNotchSetting.h
index a2725dc..782e050 100644
--- a/EdgeInspector_App/DlgSideNotchSetting.h
+++ b/EdgeInspector_App/DlgSideNotchSetting.h
@@ -1,26 +1,26 @@
-#pragma once
+锘�#pragma once
#include "GridCtrl.h"
#include "GlassRecipe.h"
#include "Glass_Data.h"
#include "EdgeImageViewer.h"
-// CDlgSideNotchSetting 措拳 惑磊涝聪促.
+// CDlgSideNotchSetting 鎺嫵 鎯戠娑濊仾淇�.
class CDlgSideNotchSetting : public CDialogEx
{
DECLARE_DYNAMIC(CDlgSideNotchSetting)
public:
- CDlgSideNotchSetting(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CDlgSideNotchSetting(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CDlgSideNotchSetting();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_SIDE_NOTCH_SETTING };
protected:
virtual BOOL OnInitDialog();
BOOL PreTranslateMessage(MSG* pMsg);
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/DlgSideUserDefectSetting.cpp b/EdgeInspector_App/DlgSideUserDefectSetting.cpp
index 9f0504c..327bd90 100644
--- a/EdgeInspector_App/DlgSideUserDefectSetting.cpp
+++ b/EdgeInspector_App/DlgSideUserDefectSetting.cpp
@@ -1,4 +1,4 @@
-// DlgSideUserDefectSetting.cpp : 备泅 颇老涝聪促.
+锘�// DlgSideUserDefectSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CDlgSideDimensionSetting 措拳 惑磊涝聪促.
+// CDlgSideDimensionSetting 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CDlgSideUserDefectSetting, CDialogEx)
diff --git a/EdgeInspector_App/DlgSideUserDefectSetting.h b/EdgeInspector_App/DlgSideUserDefectSetting.h
index 4b9eb49..4152faf 100644
--- a/EdgeInspector_App/DlgSideUserDefectSetting.h
+++ b/EdgeInspector_App/DlgSideUserDefectSetting.h
@@ -1,26 +1,26 @@
-#pragma once
+锘�#pragma once
#include "GridCtrl.h"
#include "GlassRecipe.h"
#include "Glass_Data.h"
#include "EdgeImageViewer.h"
-// CDlgSideUserDefectSetting 措拳 惑磊涝聪促.
+// CDlgSideUserDefectSetting 鎺嫵 鎯戠娑濊仾淇�.
class CDlgSideUserDefectSetting : public CDialogEx
{
DECLARE_DYNAMIC(CDlgSideUserDefectSetting)
public:
- CDlgSideUserDefectSetting(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CDlgSideUserDefectSetting(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CDlgSideUserDefectSetting();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_SIDE_USER_DEFECT_SETTING };
protected:
virtual BOOL OnInitDialog();
BOOL PreTranslateMessage(MSG* pMsg);
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/EdgeInspector_App.cpp b/EdgeInspector_App/EdgeInspector_App.cpp
index 12fe6e2..38a1909 100644
--- a/EdgeInspector_App/EdgeInspector_App.cpp
+++ b/EdgeInspector_App/EdgeInspector_App.cpp
@@ -1,5 +1,5 @@
-
-// EdgeInspector_App.cpp : 览侩 橇肺弊伐俊 措茄 努贰胶 悼累阑 沥狼钦聪促.
+锘�
+// EdgeInspector_App.cpp : 瑙堜京 姗囪偤寮婁紣淇� 鎺寗 鍔窗鑳� 鎮肩疮闃� 娌ョ嫾閽﹁仾淇�.
//
#include "stdafx.h"
@@ -23,7 +23,7 @@
BOOL g_bUse_SaveAllDMP = FALSE;
LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS* pExceptionInfo) {
- // 太阋冼遂伲
+ // 澶構顜﹀喖閬備疾
char szFileName[MAX_PATH];
struct stat buffer;
if (stat("D:\\Inspection\\Temp", &buffer) != 0)
@@ -96,7 +96,7 @@
snprintf(szFileName, MAX_PATH, "D:\\Inspection\\Temp\\EdgeInspector_DmpFile.dmp");
- // ?孙冼遂
+ // ?瀛欏喖閬�
HANDLE hFile = CreateFileA(szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
MINIDUMP_EXCEPTION_INFORMATION dumpInfo;
@@ -104,7 +104,7 @@
dumpInfo.ThreadId = GetCurrentThreadId();
dumpInfo.ClientPointers = TRUE;
- // ?忑dump冼遂
+ // ?蹇慸ump鍐奸亗
BOOL success = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, g_bUse_SaveAllDMP ? MiniDumpWithFullMemory : MiniDumpFilterMemory, &dumpInfo, NULL, NULL);
CloseHandle(hFile);
@@ -126,57 +126,57 @@
BEGIN_MESSAGE_MAP(CEdgeInspector_App, CWinAppEx)
ON_COMMAND(ID_APP_ABOUT, &CEdgeInspector_App::OnAppAbout)
- // 钎霖 颇老阑 扁檬肺 窍绰 巩辑 疙飞涝聪促.
+ // 閽庨湒 棰囪�侀槕 鎵佹鑲� 绐嶇话 宸╄緫 鐤欓娑濊仾淇�.
ON_COMMAND(ID_FILE_NEW, &CWinAppEx::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen)
- // 钎霖 牢尖 汲沥 疙飞涝聪促.
+ // 閽庨湒 鐗㈠皷 姹叉播 鐤欓娑濊仾淇�.
ON_COMMAND(ID_FILE_PRINT_SETUP, &CWinAppEx::OnFilePrintSetup)
END_MESSAGE_MAP()
-// CEdgeInspector_App 积己
+// CEdgeInspector_App 绉繁
CEdgeInspector_App::CEdgeInspector_App()
{
SetUnhandledExceptionFilter(MyUnhandledExceptionFilter);
m_bHiColorIcons = TRUE;
- // 促矫 矫累 包府磊 瘤盔
+ // 淇冪煫 鐭疮 鍖呭簻纾� 鐦ょ洈
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;
#ifdef _MANAGED
- // 览侩 橇肺弊伐阑 傍侩 攫绢 繁鸥烙 瘤盔阑 荤侩窍咯 呼靛茄 版快(/clr):
- // 1) 捞 眠啊 汲沥篮 促矫 矫累 包府磊 瘤盔捞 力措肺 累悼窍绰 单 鞘夸钦聪促.
- // 2) 橇肺璃飘俊辑 呼靛窍妨搁 System.Windows.Forms俊 措茄 曼炼甫 眠啊秦具 钦聪促.
+ // 瑙堜京 姗囪偤寮婁紣闃� 鍌嶄京 鏀虎 绻侀弗鐑� 鐦ょ洈闃� 鑽や京绐嶅挴 鍛奸潧鑼� 鐗堝揩(/clr):
+ // 1) 鎹� 鐪犲晩 姹叉播绡� 淇冪煫 鐭疮 鍖呭簻纾� 鐦ょ洈鎹� 鍔涙帾鑲� 绱偧绐嶇话 鍗� 闉樺じ閽﹁仾淇�.
+ // 2) 姗囪偤鐠冮淇婅緫 鍛奸潧绐嶅Θ鎼� System.Windows.Forms淇� 鎺寗 鏇肩偧鐢� 鐪犲晩绉﹀叿 閽﹁仾淇�.
System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException);
#endif
- // TODO: 酒贰 览侩 橇肺弊伐 ID 巩磊凯阑 绊蜡 ID 巩磊凯肺 官操绞矫坷(鼻厘).
- // 巩磊凯俊 措茄 辑侥: CompanyName.ProductName.SubProduct.VersionInformation
+ // TODO: 閰掕窗 瑙堜京 姗囪偤寮婁紣 ID 宸╃鍑槕 缁婅湣 ID 宸╃鍑偤 瀹樻搷缁炵煫鍧�(榧诲帢).
+ // 宸╃鍑繆 鎺寗 杈戜茎: CompanyName.ProductName.SubProduct.VersionInformation
SetAppID(_T("EdgeInspector_App.AppID.NoVersion"));
- // TODO: 咯扁俊 积己 内靛甫 眠啊钦聪促.
- // InitInstance俊 葛电 吝夸茄 檬扁拳 累诀阑 硅摹钦聪促.
+ // TODO: 鍜墎淇� 绉繁 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
+ // InitInstance淇� 钁涚數 鍚濆じ鑼� 妾墎鎷� 绱瘈闃� 纭呮懝閽﹁仾淇�.
m_bCreateBase = FALSE;
m_bCreateLog = FALSE;
m_hMutex = NULL;
}
-// 蜡老茄 CEdgeInspector_App 俺眉涝聪促.
+// 铚¤�佽寗 CEdgeInspector_App 淇虹湁娑濊仾淇�.
CEdgeInspector_App theApp;
-// CEdgeInspector_App 檬扁拳
+// CEdgeInspector_App 妾墎鎷�
BOOL CEdgeInspector_App::InitInstance()
{
- // 览侩 橇肺弊伐 概聪其胶飘啊 ComCtl32.dll 滚傈 6 捞惑阑 荤侩窍咯 厚林倔 胶鸥老阑
- // 荤侩窍档废 瘤沥窍绰 版快, Windows XP 惑俊辑 馆靛矫 InitCommonControlsEx()啊 鞘夸钦聪促.
- // InitCommonControlsEx()甫 荤侩窍瘤 臼栏搁 芒阑 父甸 荐 绝嚼聪促.
+ // 瑙堜京 姗囪偤寮婁紣 姒傝仾鍏惰兌椋樺晩 ComCtl32.dll 婊氬倛 6 鎹炴儜闃� 鑽や京绐嶅挴 鍘氭灄鍊� 鑳堕弗鑰侀槕
+ // 鑽や京绐嶆。搴� 鐦ゆ播绐嶇话 鐗堝揩, Windows XP 鎯戜繆杈� 棣嗛潧鐭� InitCommonControlsEx()鍟� 闉樺じ閽﹁仾淇�.
+ // InitCommonControlsEx()鐢� 鑽や京绐嶇槫 鑷兼爮鎼� 鑺掗槕 鐖剁敻 鑽� 缁濆毤鑱績.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
- // 览侩 橇肺弊伐俊辑 荤侩且 葛电 傍侩 牧飘费 努贰胶甫 器窃窍档废
- // 捞 亲格阑 汲沥窍绞矫坷.
+ // 瑙堜京 姗囪偤寮婁紣淇婅緫 鑽や京涓� 钁涚數 鍌嶄京 鐗ч璐� 鍔窗鑳剁敨 鍣ㄧ獌绐嶆。搴�
+ // 鎹� 浜叉牸闃� 姹叉播绐嶇粸鐭澐.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
@@ -192,7 +192,7 @@
}
}
- // OLE 扼捞宏矾府甫 檬扁拳钦聪促.
+ // OLE 鎵兼崬瀹忕熅搴滅敨 妾墎鎷抽挦鑱績.
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
@@ -203,18 +203,18 @@
EnableTaskbarInteraction(FALSE);
- // RichEdit 牧飘费阑 荤侩窍妨搁 AfxInitRichEdit2()啊 乐绢具 钦聪促.
+ // RichEdit 鐗ч璐归槕 鑽や京绐嶅Θ鎼� AfxInitRichEdit2()鍟� 涔愮虎鍏� 閽﹁仾淇�.
// AfxInitRichEdit2();
- // 钎霖 檬扁拳
- // 捞甸 扁瓷阑 荤侩窍瘤 臼绊 弥辆 角青 颇老狼 农扁甫 临捞妨搁
- // 酒贰俊辑 鞘夸 绝绰 漂沥 檬扁拳
- // 风凭阑 力芭秦具 钦聪促.
- // 秦寸 汲沥捞 历厘等 饭瘤胶飘府 虐甫 函版窍绞矫坷.
- // TODO: 捞 巩磊凯阑 雀荤 肚绰 炼流狼 捞抚苞 鞍篮
- // 利例茄 郴侩栏肺 荐沥秦具 钦聪促.
- SetRegistryKey(_T("肺拿 览侩 橇肺弊伐 付过荤俊辑 积己等 览侩 橇肺弊伐"));
- LoadStdProfileSettings(4); // MRU甫 器窃窍咯 钎霖 INI 颇老 可记阑 肺靛钦聪促.
+ // 閽庨湒 妾墎鎷�
+ // 鎹炵敻 鎵佺摲闃� 鑽や京绐嶇槫 鑷肩粖 寮ヨ締 瑙掗潚 棰囪�佺嫾 鍐滄墎鐢� 涓存崬濡ㄦ悂
+ // 閰掕窗淇婅緫 闉樺じ 缁濈话 婕傛播 妾墎鎷�
+ // 椋庡嚟闃� 鍔涜姯绉﹀叿 閽﹁仾淇�.
+ // 绉﹀ 姹叉播鎹� 鍘嗗帢绛� 楗槫鑳堕搴� 铏愮敨 鍑界増绐嶇粸鐭澐.
+ // TODO: 鎹� 宸╃鍑槕 闆�鑽� 鑲氱话 鐐兼祦鐙� 鎹炴姎鑻� 闉嶇
+ // 鍒╀緥鑼� 閮翠京鏍忚偤 鑽愭播绉﹀叿 閽﹁仾淇�.
+ SetRegistryKey(_T("鑲烘嬁 瑙堜京 姗囪偤寮婁紣 浠樿繃鑽や繆杈� 绉繁绛� 瑙堜京 姗囪偤寮婁紣"));
+ LoadStdProfileSettings(4); // MRU鐢� 鍣ㄧ獌绐嶅挴 閽庨湒 INI 棰囪�� 鍙闃� 鑲洪潧閽﹁仾淇�.
if (NULL != g_pBase)
{
@@ -236,35 +236,35 @@
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
- // 览侩 橇肺弊伐狼 巩辑 袍敲复阑 殿废钦聪促. 巩辑 袍敲复篮
- // 巩辑, 橇饭烙 芒 棺 轰 荤捞狼 楷搬 开且阑 钦聪促.
+ // 瑙堜京 姗囪偤寮婁紣鐙� 宸╄緫 琚嶆暡澶嶉槕 娈垮簾閽﹁仾淇�. 宸╄緫 琚嶆暡澶嶇
+ // 宸╄緫, 姗囬キ鐑� 鑺� 妫� 杞� 鑽ゆ崬鐙� 妤锋惉 寮�涓旈槕 閽﹁仾淇�.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CEdgeInspector_AppDoc),
- RUNTIME_CLASS(CMainFrame), // 林 SDI 橇饭烙 芒涝聪促.
+ RUNTIME_CLASS(CMainFrame), // 鏋� SDI 姗囬キ鐑� 鑺掓稘鑱績.
RUNTIME_CLASS(CEdgeInspector_AppView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
- // 钎霖 夹 疙飞, DDE, 颇老 凯扁俊 措茄 疙飞临阑 备巩 盒籍钦聪促.
+ // 閽庨湒 澶� 鐤欓, DDE, 棰囪�� 鍑墎淇� 鎺寗 鐤欓涓撮槕 澶囧珐 鐩掔睄閽﹁仾淇�.
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
- // 疙飞临俊 瘤沥等 疙飞阑 叼胶菩摹钦聪促.
- // 览侩 橇肺弊伐捞 /RegServer, /Register, /Unregserver 肚绰 /Unregister肺 矫累等 版快 FALSE甫 馆券钦聪促.
+ // 鐤欓涓翠繆 鐦ゆ播绛� 鐤欓闃� 鍙艰兌鑿╂懝閽﹁仾淇�.
+ // 瑙堜京 姗囪偤寮婁紣鎹� /RegServer, /Register, /Unregserver 鑲氱话 /Unregister鑲� 鐭疮绛� 鐗堝揩 FALSE鐢� 棣嗗埜閽﹁仾淇�.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
- // 芒 窍唱父 檬扁拳登菌栏骨肺 捞甫 钎矫窍绊 诀单捞飘钦聪促.
+ // 鑺� 绐嶅敱鐖� 妾墎鎷崇櫥鑿屾爮楠ㄨ偤 鎹炵敨 閽庣煫绐嶇粖 璇�鍗曟崬椋橀挦鑱績.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
- // 立固荤啊 乐阑 版快俊父 DragAcceptFiles甫 龋免钦聪促.
- // SDI 览侩 橇肺弊伐俊辑绰 ProcessShellCommand 饶俊 捞矾茄 龋免捞 惯积秦具 钦聪促.
+ // 绔嬪浐鑽ゅ晩 涔愰槕 鐗堝揩淇婄埗 DragAcceptFiles鐢� 榫嬪厤閽﹁仾淇�.
+ // SDI 瑙堜京 姗囪偤寮婁紣淇婅緫缁� ProcessShellCommand 楗朵繆 鎹炵熅鑼� 榫嬪厤鎹� 鎯Н绉﹀叿 閽﹁仾淇�.
CMainFrame* pMain = static_cast<CMainFrame*>(AfxGetMainWnd());
//pMain->SetDoc(static_cast<CAlignInspectionDoc*>(pMain->GetActiveDocument()));
@@ -280,29 +280,29 @@
CloseHandle(m_hMutex);
- //TODO: 眠啊茄 眠啊 府家胶甫 贸府钦聪促.
+ //TODO: 鐪犲晩鑼� 鐪犲晩 搴滃鑳剁敨 璐稿簻閽﹁仾淇�.
AfxOleTerm(FALSE);
return CWinAppEx::ExitInstance();
}
-// CEdgeInspector_App 皋矫瘤 贸府扁
+// CEdgeInspector_App 鐨嬬煫鐦� 璐稿簻鎵�
-// 览侩 橇肺弊伐 沥焊俊 荤侩登绰 CAboutDlg 措拳 惑磊涝聪促.
+// 瑙堜京 姗囪偤寮婁紣 娌ョ剨淇� 鑽や京鐧荤话 CAboutDlg 鎺嫵 鎯戠娑濊仾淇�.
class CAboutDlg : public CDialogEx
{
public:
CAboutDlg();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_ABOUTBOX };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
-// 备泅涝聪促.
+// 澶囨硡娑濊仾淇�.
protected:
DECLARE_MESSAGE_MAP()
};
@@ -319,14 +319,14 @@
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()
-// 措拳 惑磊甫 角青窍扁 困茄 览侩 橇肺弊伐 疙飞涝聪促.
+// 鎺嫵 鎯戠鐢� 瑙掗潚绐嶆墎 鍥拌寗 瑙堜京 姗囪偤寮婁紣 鐤欓娑濊仾淇�.
void CEdgeInspector_App::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
-// CEdgeInspector_App 荤侩磊 瘤沥 肺靛/历厘 皋辑靛
+// CEdgeInspector_App 鑽や京纾� 鐦ゆ播 鑲洪潧/鍘嗗帢 鐨嬭緫闈�
void CEdgeInspector_App::PreLoadState()
{
@@ -345,7 +345,7 @@
{
}
-// CEdgeInspector_App 皋矫瘤 贸府扁
+// CEdgeInspector_App 鐨嬬煫鐦� 璐稿簻鎵�
diff --git a/EdgeInspector_App/EdgeInspector_App.h b/EdgeInspector_App/EdgeInspector_App.h
index 5873c3b..d63d781 100644
--- a/EdgeInspector_App/EdgeInspector_App.h
+++ b/EdgeInspector_App/EdgeInspector_App.h
@@ -1,17 +1,17 @@
-
-// EdgeInspector_App.h : EdgeInspector_App 览侩 橇肺弊伐俊 措茄 林 庆歹 颇老
+锘�
+// EdgeInspector_App.h : EdgeInspector_App 瑙堜京 姗囪偤寮婁紣淇� 鎺寗 鏋� 搴嗘 棰囪��
//
#pragma once
#ifndef __AFXWIN_H__
- #error "PCH俊 措秦 捞 颇老阑 器窃窍扁 傈俊 'stdafx.h'甫 器窃钦聪促."
+ #error "PCH淇� 鎺Е 鎹� 棰囪�侀槕 鍣ㄧ獌绐嶆墎 鍌堜繆 'stdafx.h'鐢� 鍣ㄧ獌閽﹁仾淇�."
#endif
-#include "resource.h" // 林 扁龋涝聪促.
+#include "resource.h" // 鏋� 鎵侀緥娑濊仾淇�.
// CEdgeInspector_App:
-// 捞 努贰胶狼 备泅俊 措秦辑绰 EdgeInspector_App.cpp阑 曼炼窍绞矫坷.
+// 鎹� 鍔窗鑳剁嫾 澶囨硡淇� 鎺Е杈戠话 EdgeInspector_App.cpp闃� 鏇肩偧绐嶇粸鐭澐.
//
class CEdgeInspector_App : public CWinAppEx
@@ -21,15 +21,15 @@
ULONG_PTR m_gdiplusToken;
BOOL m_bCreateBase;
- BOOL m_bCreateLog; // 辆丰矫 眉农甫 困秦.
+ BOOL m_bCreateLog; // 杈嗕赴鐭� 鐪夊啘鐢� 鍥扮Е.
HANDLE m_hMutex;
-// 犁沥狼涝聪促.
+// 鐘佹播鐙兼稘鑱績.
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
-// 备泅涝聪促.
+// 澶囨硡娑濊仾淇�.
UINT m_nAppLook;
BOOL m_bHiColorIcons;
diff --git a/EdgeInspector_App/EdgeInspector_AppDoc.cpp b/EdgeInspector_App/EdgeInspector_AppDoc.cpp
index c36918b..b1cfd54 100644
--- a/EdgeInspector_App/EdgeInspector_AppDoc.cpp
+++ b/EdgeInspector_App/EdgeInspector_AppDoc.cpp
@@ -1,10 +1,10 @@
-
-// EdgeInspector_AppDoc.cpp : CEdgeInspector_AppDoc 努贰胶狼 备泅
+锘�
+// EdgeInspector_AppDoc.cpp : CEdgeInspector_AppDoc 鍔窗鑳剁嫾 澶囨硡
//
#include "stdafx.h"
-// SHARED_HANDLERS绰 固府 焊扁, 绵家魄 弊覆 棺 八祸 鞘磐 贸府扁甫 备泅窍绰 ATL 橇肺璃飘俊辑 沥狼且 荐 乐栏哥
-// 秦寸 橇肺璃飘客 巩辑 内靛甫 傍蜡窍档废 秦 凛聪促.
+// SHARED_HANDLERS缁� 鍥哄簻 鐒婃墎, 缁靛榄� 寮婅 妫� 鍏ジ 闉樼 璐稿簻鎵佺敨 澶囨硡绐嶇话 ATL 姗囪偤鐠冮淇婅緫 娌ョ嫾涓� 鑽� 涔愭爮鍝�
+// 绉﹀ 姗囪偤鐠冮瀹� 宸╄緫 鍐呴潧鐢� 鍌嶈湣绐嶆。搴� 绉� 鍑涜仾淇�.
#ifndef SHARED_HANDLERS
#include "EdgeInspector_App.h"
#endif
@@ -25,11 +25,11 @@
END_MESSAGE_MAP()
-// CEdgeInspector_AppDoc 积己/家戈
+// CEdgeInspector_AppDoc 绉繁/瀹舵垐
CEdgeInspector_AppDoc::CEdgeInspector_AppDoc()
{
- // TODO: 咯扁俊 老雀己 积己 内靛甫 眠啊钦聪促.
+ // TODO: 鍜墎淇� 鑰侀泙宸� 绉繁 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
}
@@ -42,8 +42,8 @@
if (!CDocument::OnNewDocument())
return FALSE;
- // TODO: 咯扁俊 犁檬扁拳 内靛甫 眠啊钦聪促.
- // SDI 巩辑绰 捞 巩辑甫 促矫 荤侩钦聪促.
+ // TODO: 鍜墎淇� 鐘佹鎵佹嫵 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
+ // SDI 宸╄緫缁� 鎹� 宸╄緫鐢� 淇冪煫 鑽や京閽﹁仾淇�.
return TRUE;
}
@@ -57,20 +57,20 @@
{
if (ar.IsStoring())
{
- // TODO: 咯扁俊 历厘 内靛甫 眠啊钦聪促.
+ // TODO: 鍜墎淇� 鍘嗗帢 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
}
else
{
- // TODO: 咯扁俊 肺爹 内靛甫 眠啊钦聪促.
+ // TODO: 鍜墎淇� 鑲虹埞 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
}
}
#ifdef SHARED_HANDLERS
-// 绵家魄 弊覆阑 瘤盔钦聪促.
+// 缁靛榄� 寮婅闃� 鐦ょ洈閽﹁仾淇�.
void CEdgeInspector_AppDoc::OnDrawThumbnail(CDC& dc, LPRECT lprcBounds)
{
- // 巩辑狼 单捞磐甫 弊府妨搁 捞 内靛甫 荐沥窍绞矫坷.
+ // 宸╄緫鐙� 鍗曟崬纾愮敨 寮婂簻濡ㄦ悂 鎹� 鍐呴潧鐢� 鑽愭播绐嶇粸鐭澐.
dc.FillSolidRect(lprcBounds, RGB(255, 255, 255));
CString strText = _T("TODO: implement thumbnail drawing here");
@@ -88,14 +88,14 @@
dc.SelectObject(pOldFont);
}
-// 八祸 贸府扁甫 瘤盔钦聪促.
+// 鍏ジ 璐稿簻鎵佺敨 鐦ょ洈閽﹁仾淇�.
void CEdgeInspector_AppDoc::InitializeSearchContent()
{
CString strSearchContent;
- // 巩辑狼 单捞磐俊辑 八祸 能刨明甫 汲沥钦聪促.
- // 能刨明 何盒篮 ";"肺 备盒登绢具 钦聪促.
+ // 宸╄緫鐙� 鍗曟崬纾愪繆杈� 鍏ジ 鑳藉埁鏄庣敨 姹叉播閽﹁仾淇�.
+ // 鑳藉埁鏄� 浣曠洅绡� ";"鑲� 澶囩洅鐧荤虎鍏� 閽﹁仾淇�.
- // 抗: strSearchContent = _T("point;rectangle;circle;ole object;");
+ // 鎶�: strSearchContent = _T("point;rectangle;circle;ole object;");
SetSearchContent(strSearchContent);
}
@@ -119,7 +119,7 @@
#endif // SHARED_HANDLERS
-// CEdgeInspector_AppDoc 柳窜
+// CEdgeInspector_AppDoc 鏌崇獪
#ifdef _DEBUG
void CEdgeInspector_AppDoc::AssertValid() const
@@ -134,4 +134,4 @@
#endif //_DEBUG
-// CEdgeInspector_AppDoc 疙飞
+// CEdgeInspector_AppDoc 鐤欓
diff --git a/EdgeInspector_App/EdgeInspector_AppDoc.h b/EdgeInspector_App/EdgeInspector_AppDoc.h
index 26d0717..f75aef3 100644
--- a/EdgeInspector_App/EdgeInspector_AppDoc.h
+++ b/EdgeInspector_App/EdgeInspector_AppDoc.h
@@ -1,5 +1,5 @@
-
-// EdgeInspector_AppDoc.h : CEdgeInspector_AppDoc 努贰胶狼 牢磐其捞胶
+锘�
+// EdgeInspector_AppDoc.h : CEdgeInspector_AppDoc 鍔窗鑳剁嫾 鐗㈢鍏舵崬鑳�
//
@@ -8,17 +8,17 @@
class CEdgeInspector_AppDoc : public CDocument
{
-protected: // serialization俊辑父 父甸绢笼聪促.
+protected: // serialization淇婅緫鐖� 鐖剁敻缁㈢鑱績.
CEdgeInspector_AppDoc();
DECLARE_DYNCREATE(CEdgeInspector_AppDoc)
-// 漂己涝聪促.
+// 婕傚繁娑濊仾淇�.
public:
-// 累诀涝聪促.
+// 绱瘈娑濊仾淇�.
public:
-// 犁沥狼涝聪促.
+// 鐘佹播鐙兼稘鑱績.
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
@@ -27,7 +27,7 @@
virtual void OnDrawThumbnail(CDC& dc, LPRECT lprcBounds);
#endif // SHARED_HANDLERS
-// 备泅涝聪促.
+// 澶囨硡娑濊仾淇�.
public:
virtual ~CEdgeInspector_AppDoc();
#ifdef _DEBUG
@@ -37,12 +37,12 @@
protected:
-// 积己等 皋矫瘤 甘 窃荐
+// 绉繁绛� 鐨嬬煫鐦� 鐢� 绐冭崘
protected:
DECLARE_MESSAGE_MAP()
#ifdef SHARED_HANDLERS
- // 八祸 贸府扁俊 措茄 八祸 能刨明甫 汲沥窍绰 档快固 窃荐
+ // 鍏ジ 璐稿簻鎵佷繆 鎺寗 鍏ジ 鑳藉埁鏄庣敨 姹叉播绐嶇话 妗e揩鍥� 绐冭崘
void SetSearchContent(const CString& value);
#endif // SHARED_HANDLERS
};
diff --git a/EdgeInspector_App/EdgeInspector_AppView.cpp b/EdgeInspector_App/EdgeInspector_AppView.cpp
index d2a1dcd..4b88969 100644
--- a/EdgeInspector_App/EdgeInspector_AppView.cpp
+++ b/EdgeInspector_App/EdgeInspector_AppView.cpp
@@ -1,5 +1,5 @@
-
-// EdgeInspector_AppView.cpp : CEdgeInspector_AppView 努贰胶狼 备泅
+锘�
+// EdgeInspector_AppView.cpp : CEdgeInspector_AppView 鍔窗鑳剁嫾 澶囨硡
//
#include "stdafx.h"
@@ -13,7 +13,7 @@
// CEdgeInspector_AppView
-// CEdgeInspector_AppView 积己/家戈
+// CEdgeInspector_AppView 绉繁/瀹舵垐
IMPLEMENT_DYNCREATE(CEdgeInspector_AppView, CFormView)
@@ -62,13 +62,13 @@
BOOL CEdgeInspector_AppView::PreCreateWindow(CREATESTRUCT& cs)
{
- // TODO: CREATESTRUCT cs甫 荐沥窍咯 咯扁俊辑
- // Window 努贰胶 肚绰 胶鸥老阑 荐沥钦聪促.
+ // TODO: CREATESTRUCT cs鐢� 鑽愭播绐嶅挴 鍜墎淇婅緫
+ // Window 鍔窗鑳� 鑲氱话 鑳堕弗鑰侀槕 鑽愭播閽﹁仾淇�.
return CFormView::PreCreateWindow(cs);
}
-// CEdgeInspector_AppView 柳窜
+// CEdgeInspector_AppView 鏌崇獪
void CEdgeInspector_AppView::DoDataExchange(CDataExchange* pDX)
{
@@ -93,7 +93,7 @@
ON_EVENT(CEdgeInspector_AppView, IDC_BTN_MAIN_EXIT, DISPID_CLICK, CEdgeInspector_AppView::ClickMenuButton, VTS_NONE)
END_EVENTSINK_MAP()
-// CEdgeInspector_AppView 皋矫瘤 贸府扁
+// CEdgeInspector_AppView 鐨嬬煫鐦� 璐稿簻鎵�
void CEdgeInspector_AppView::CreateChildView()
{
diff --git a/EdgeInspector_App/EdgeInspector_AppView.h b/EdgeInspector_App/EdgeInspector_AppView.h
index 43e4739..f7434d0 100644
--- a/EdgeInspector_App/EdgeInspector_AppView.h
+++ b/EdgeInspector_App/EdgeInspector_AppView.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#include "btnenh.h"
@@ -34,7 +34,7 @@
public:
enum{ IDD = IDD_MAIN_VIEW };
- // 犁沥狼涝聪促.
+ // 鐘佹播鐙兼稘鑱績.
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void DoDataExchange(CDataExchange* pDX);
diff --git a/EdgeInspector_App/Fitting/CHDataFitting.cpp b/EdgeInspector_App/Fitting/CHDataFitting.cpp
index c8e1ecf..8da9aa9 100644
--- a/EdgeInspector_App/Fitting/CHDataFitting.cpp
+++ b/EdgeInspector_App/Fitting/CHDataFitting.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "CHDataFitting.h"
#include <algorithm>
diff --git a/EdgeInspector_App/Fitting/CHDataFitting.h b/EdgeInspector_App/Fitting/CHDataFitting.h
index 4a097e9..de396cc 100644
--- a/EdgeInspector_App/Fitting/CHDataFitting.h
+++ b/EdgeInspector_App/Fitting/CHDataFitting.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include <vector>
typedef std::vector<double> VectorDouble;
diff --git a/EdgeInspector_App/Grabber/MulticamControl.cpp b/EdgeInspector_App/Grabber/MulticamControl.cpp
index da6f8c1..c091380 100644
--- a/EdgeInspector_App/Grabber/MulticamControl.cpp
+++ b/EdgeInspector_App/Grabber/MulticamControl.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "MulticamControl.h"
#include "Global_Define.h"
#include "FrameBufferController.h"
@@ -243,7 +243,7 @@
if (nYStart + nYSize > nBufSizeY* GetEndFrameIdx())
return FALSE;
- // 矫累 橇饭烙 锅龋客 场 橇饭烙 锅龋.
+ // 鐭疮 姗囬キ鐑� 閿呴緥瀹� 鍦� 姗囬キ鐑� 閿呴緥.
int nStartFrameNo = nYStart / nBufSizeY;
int nEndFrameNo = (nYStart + nYSize) / nBufSizeY;
LPBYTE lpHeadAddr = GetFrameHeader(iScan,nStartFrameNo);
@@ -259,7 +259,7 @@
memcpy(lpIn + i * nXSize, lpStart + nLine * nBufSizeX, nXSize);
if (nStartFrameNo <= nEndFrameNo && (nYStart + i + 1) % nBufSizeY == 0)
{
- // 捞固瘤甫 蝶郴具窍绰 康开捞 MemFrameNo 版拌俊 吧媚乐绰 版快 贸府.
+ // 鎹炲浐鐦ょ敨 铦堕兇鍏风獚缁� 搴峰紑鎹� MemFrameNo 鐗堟媽淇� 鍚у獨涔愮话 鐗堝揩 璐稿簻.
lpHeadAddr = GetFrameHeader(iScan,++nStartFrameNo);
lpStart = lpHeadAddr + nXStart;
nLine = 0;
@@ -357,7 +357,7 @@
return FALSE;
}
- if(m_isLiveGrab == TRUE) // Live Grab 矫.
+ if(m_isLiveGrab == TRUE) // Live Grab 鐭�.
{
m_nSetBufferIdx = 0;
@@ -514,7 +514,7 @@
int buffer_pitch_value;
driver_status |= McGetParamInt(m_hGrabChannel, MC_BufferPitch, &buffer_pitch_value);
- ///// Time out 5 檬....
+ ///// Time out 5 妾�....
driver_status |= McSetParamInt(m_hGrabChannel, MC_AcqTimeout_ms, -1);
driver_status |= McSetParamInt(m_hGrabChannel, MC_SurfaceCount, 25);
diff --git a/EdgeInspector_App/Grabber/MulticamControl.h b/EdgeInspector_App/Grabber/MulticamControl.h
index 39751b3..489fb35 100644
--- a/EdgeInspector_App/Grabber/MulticamControl.h
+++ b/EdgeInspector_App/Grabber/MulticamControl.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#include "GrabberControl.h"
@@ -17,7 +17,7 @@
public:
//////////////////////////////////////////////////////////////////////////
// Initialization
- virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 檬扁拳
+ virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 妾墎鎷�
virtual BOOL InitializeBuffer(void *pParam);
//////////////////////////////////////////////////////////////////////////
// Deinit
@@ -75,8 +75,8 @@
public:
_GRABBER_INIT_PARAM_ m_Param;
- int m_nEndFrameIdx; // 泅犁 Grab 茄 荐
- int m_nStartFrameIdx; // 啊厘 坷贰傈俊 Grab茄 Frame狼 牢郸胶.
+ int m_nEndFrameIdx; // 娉呯妬 Grab 鑼� 鑽�
+ int m_nStartFrameIdx; // 鍟婂帢 鍧疯窗鍌堜繆 Grab鑼� Frame鐙� 鐗㈤兏鑳�.
int m_nSetBufferIdx;
int m_nScanIndex;
int m_nBoardID;
diff --git a/EdgeInspector_App/Grabber/RadientControl.cpp b/EdgeInspector_App/Grabber/RadientControl.cpp
index 1b44b8d..37ddb61 100644
--- a/EdgeInspector_App/Grabber/RadientControl.cpp
+++ b/EdgeInspector_App/Grabber/RadientControl.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "RadientControl.h"
#include "FrameBufferController.h"
@@ -331,7 +331,7 @@
if (nYStart + nYSize > nBufSizeY* GetEndFrameIdx())
return FALSE;
- // 矫累 橇饭烙 锅龋客 场 橇饭烙 锅龋.
+ // 鐭疮 姗囬キ鐑� 閿呴緥瀹� 鍦� 姗囬キ鐑� 閿呴緥.
int nStartFrameNo = nYStart / nBufSizeY;
int nEndFrameNo = (nYStart + nYSize) / nBufSizeY;
LPBYTE lpHeadAddr = GetFrameHeader(iScan,nStartFrameNo);
@@ -347,7 +347,7 @@
memcpy(lpIn + i * nXSize, lpStart + nLine * nBufSizeX, nXSize);
if (nStartFrameNo <= nEndFrameNo && (nYStart + i + 1) % nBufSizeY == 0)
{
- // 捞固瘤甫 蝶郴具窍绰 康开捞 MemFrameNo 版拌俊 吧媚乐绰 版快 贸府.
+ // 鎹炲浐鐦ょ敨 铦堕兇鍏风獚缁� 搴峰紑鎹� MemFrameNo 鐗堟媽淇� 鍚у獨涔愮话 鐗堝揩 璐稿簻.
lpHeadAddr = GetFrameHeader(iScan,++nStartFrameNo);
lpStart = lpHeadAddr + nXStart;
nLine = 0;
@@ -439,7 +439,7 @@
CGrabberRadient *pRadient = (CGrabberRadient*)HookDataPtr;
- if(pRadient->m_isLiveGrab == TRUE) // Live Grab 矫.
+ if(pRadient->m_isLiveGrab == TRUE) // Live Grab 鐭�.
{
pRadient->m_nSetBufferIdx = 0;
@@ -616,7 +616,7 @@
/*
MdigControl(m_MilDigitizer, M_CAMERALINK_CC1_SOURCE, M_GRAB_EXPOSURE+M_TIMER1);
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE+M_TIMER1, M_ENABLE);
- MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_SOURCE+M_TIMER1, M_CONTINUOUS); // Periodic 脚龋 牢啊
+ MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_SOURCE+M_TIMER1, M_CONTINUOUS); // Periodic 鑴氶緥 鐗㈠晩
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_TIME+M_TIMER1, nExposureTimer); //10000ns
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_TIME_DELAY+M_TIMER1, nExposureTimerDelay); //10000ns
*/
diff --git a/EdgeInspector_App/Grabber/RadientControl.h b/EdgeInspector_App/Grabber/RadientControl.h
index cec32d7..3eb84d7 100644
--- a/EdgeInspector_App/Grabber/RadientControl.h
+++ b/EdgeInspector_App/Grabber/RadientControl.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#include "Global_Define.h"
@@ -15,7 +15,7 @@
public:
//////////////////////////////////////////////////////////////////////////
// Initialization
- virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 檬扁拳
+ virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 妾墎鎷�
virtual BOOL InitializeBuffer(void *pParam);
//////////////////////////////////////////////////////////////////////////
// Deinit
@@ -68,8 +68,8 @@
public:
_GRABBER_INIT_PARAM_ m_Param;
- MIL_ID m_MilSystem; // 焊靛寸 1函荐
- MIL_ID m_MilDigitizer; // 墨皋扼 函荐
+ MIL_ID m_MilSystem; // 鐒婇潧瀵� 1鍑借崘
+ MIL_ID m_MilDigitizer; // 澧ㄧ殝鎵� 鍑借崘
MIL_ID m_Milbufgrab[BUFFERING_SIZE_MAX];
DIGSTATUS m_DigitizerStatus;
long m_lBord;
@@ -77,8 +77,8 @@
CCriticalSection m_critical;
- int m_nEndFrameIdx; // 泅犁 Grab 茄 荐
- int m_nStartFrameIdx; // 啊厘 坷贰傈俊 Grab茄 Frame狼 牢郸胶.
+ int m_nEndFrameIdx; // 娉呯妬 Grab 鑼� 鑽�
+ int m_nStartFrameIdx; // 鍟婂帢 鍧疯窗鍌堜繆 Grab鑼� Frame鐙� 鐗㈤兏鑳�.
int m_nSetBufferIdx;
int m_nScanIndex;
int m_nAllocatedGrabBufSize;
diff --git a/EdgeInspector_App/Grabber/SapControl.cpp b/EdgeInspector_App/Grabber/SapControl.cpp
index 67454b6..28c2ec7 100644
--- a/EdgeInspector_App/Grabber/SapControl.cpp
+++ b/EdgeInspector_App/Grabber/SapControl.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "SapControl.h"
#define FRAME_HEAD_MARKER 0x55AAFF00
@@ -108,7 +108,7 @@
BOOL CSapControl::CreateXfer()
{
- // Xfer勤甸 积己
+ // Xfer鍕ょ敻 绉繁
if (DisplayStatus("CorXferNew", CorXferNew(m_hBoard, m_hAcq, *m_hBuffer, NULL, &m_hXfer)))
return FALSE;
@@ -120,13 +120,13 @@
xfer_desc.incByte = m_Param.nFrameWidth;
#ifdef FRAME_CALLBACK
- // 妮归 窃荐 殿废
+ // 濡綊 绐冭崘 娈垮簾
if (DisplayStatus("CorXferRegisterCallback"
, CorXferRegisterCallback(m_hXfer
, CORXFER_VAL_EVENT_TYPE_END_OF_FRAME
, XferCallback, (void*)this)))
#else
- // 妮归 窃荐 殿废
+ // 濡綊 绐冭崘 娈垮簾
if (DisplayStatus("CorXferRegisterCallback"
, CorXferRegisterCallback(m_hXfer
, CORXFER_VAL_EVENT_TYPE_END_OF_NLINES + m_Param.nFrameHeight
@@ -139,7 +139,7 @@
if (DisplayStatus("CorXferAppend", CorXferAppend(m_hXfer, m_hAcq, m_hBuffer[i], NULL)))
return FALSE;
- // 妮归 窃荐 殿废
+ // 濡綊 绐冭崘 娈垮簾
if (DisplayStatus("CorXferRegisterCallback"
, CorXferRegisterCallback(m_hXfer
, CORXFER_VAL_EVENT_TYPE_END_OF_FRAME
@@ -164,7 +164,7 @@
return FALSE;
//////////////////////////////////////////////////////////////////////////
- // Buffer 且寸
+ // Buffer 涓斿
CORSTATUS st;
int i;
SIZE_T tempBufferSize= m_Param.nGrabBufSize;
@@ -181,7 +181,7 @@
for (i = 0; i <nBufferrCount; i++)
{
- // Memory Address 且寸.
+ // Memory Address 涓斿.
m_pX64Buffer[i] = (void*)(m_pOneLargeBuffer+ nBufferSize*i);
if (m_pX64Buffer[i])
{
@@ -241,7 +241,7 @@
if (DisplayStatus("CorAcqSetPrms", CorAcqSetPrms(m_hAcq, m_hVic, m_hCam, TRUE)))
return FALSE;
- // 荐笼且 康惑狼 农扁 眠免
+ // 鑽愮涓� 搴锋儜鐙� 鍐滄墎 鐪犲厤
// if (DisplayStatus("CorAcqGetPrm", CorAcqGetPrm(m_hAcq, CORACQ_PRM_SCALE_HORZ, &g_pBase->m_nFrameWidth)))
// return FALSE;
@@ -480,7 +480,7 @@
if(bFreeRun == FALSE)
{
- // 悼扁 康惑犬焊 版快
+ // 鎮兼墎 搴锋儜鐘剨 鐗堝揩
if( DisplayStatus( "CorAcqSetPrm", CorAcqSetPrm(m_hAcq, CORACQ_PRM_EXT_FRAME_TRIGGER_ENABLE, TRUE)))
return FALSE;
@@ -518,7 +518,7 @@
{
g_pLog->DisplayMessage(L"StopAcq : Grab %d, End %d", m_nSetBufferIdx, m_nEndFrameIdx);
- //20141022 yjm abort 肺 窍搁 促澜 弊乏矫 磊操焊靛啊 桓绢滚赴促. 犁何泼父 烹窃..揪广 俺绊积ぱぱせ
+ //20141022 yjm abort 鑲� 绐嶆悂 淇冩緶 寮婁箯鐭� 纾婃搷鐒婇潧鍟� 妗撶虎婊氳荡淇�. 鐘佷綍娉肩埗 鐑圭獌..鎻箍 淇虹粖绉伇銇便仜
if (DisplayStatus("CorXferStop", CorXferStop(m_hXfer)))//if (DisplayStatus("CorXferStop", CorXferAbort(m_hXfer)))
{
g_pLog->DisplayMessage(L"CorXferAbort Fail. Grab %d, End %d", m_nSetBufferIdx, m_nEndFrameIdx);
@@ -587,7 +587,7 @@
if (nYStart + nYSize > nBufSizeY* GetEndFrameIdx())
return FALSE;
- // 矫累 橇饭烙 锅龋客 场 橇饭烙 锅龋.
+ // 鐭疮 姗囬キ鐑� 閿呴緥瀹� 鍦� 姗囬キ鐑� 閿呴緥.
int nStartFrameNo = nYStart / nBufSizeY;
int nEndFrameNo = (nYStart + nYSize) / nBufSizeY;
LPBYTE lpHeadAddr = GetFrameHeader(iScan,nStartFrameNo);
@@ -603,7 +603,7 @@
memcpy(lpIn + i * nXSize, lpStart + nLine * nBufSizeX, nXSize);
if (nStartFrameNo <= nEndFrameNo && (nYStart + i + 1) % nBufSizeY == 0)
{
- // 捞固瘤甫 蝶郴具窍绰 康开捞 MemFrameNo 版拌俊 吧媚乐绰 版快 贸府.
+ // 鎹炲浐鐦ょ敨 铦堕兇鍏风獚缁� 搴峰紑鎹� MemFrameNo 鐗堟媽淇� 鍚у獨涔愮话 鐗堝揩 璐稿簻.
lpHeadAddr = GetFrameHeader(iScan,++nStartFrameNo);
lpStart = lpHeadAddr + nXStart;
nLine = 0;
@@ -726,7 +726,7 @@
{
LPBYTE lpBuffer = NULL;
- // 捞固瘤甫 嘛篮 利捞 绝绰 版快绰 滚欺甫 府畔茄促.
+ // 鎹炲浐鐦ょ敨 鍢涚 鍒╂崬 缁濈话 鐗堝揩缁� 婊氭鐢� 搴滅晹鑼勪績.
if (m_nStartFrameIdx == 0 && m_nEndFrameIdx == 0)
{
if (nFrameNo >= 0 && nFrameNo < g_pBase->m_pMemFrameNo[m_Param.nCameraIdx])
@@ -738,7 +738,7 @@
else
lpBuffer = NULL;
}
- else // 捞固瘤甫 嘛篮 版快绰 Frame No甫 犬牢窍咯 滚欺甫 府畔茄促.
+ else // 鎹炲浐鐦ょ敨 鍢涚 鐗堝揩缁� Frame No鐢� 鐘墷绐嶅挴 婊氭鐢� 搴滅晹鑼勪績.
{
if (nFrameNo >= m_nStartFrameIdx && nFrameNo < m_nEndFrameIdx)
{
diff --git a/EdgeInspector_App/Grabber/SapControl.h b/EdgeInspector_App/Grabber/SapControl.h
index d9bf0e2..61e3a60 100644
--- a/EdgeInspector_App/Grabber/SapControl.h
+++ b/EdgeInspector_App/Grabber/SapControl.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
#include "GrabberControl.h"
@@ -16,7 +16,7 @@
virtual ~CSapControl(void);
public:
- virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 檬扁拳
+ virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 妾墎鎷�
virtual BOOL InitializeBuffer(void *pParam);
virtual BOOL Deinitialize();
virtual BOOL GrabScanStart(int iScan, BOOL bFreeRun, int nPeriod, int nExposure=10, BOOL bAuto=TRUE);
@@ -61,8 +61,8 @@
protected:
_GRABBER_INIT_PARAM_ m_Param;
- int m_nEndFrameIdx; // 泅犁 Grab 茄 荐
- int m_nStartFrameIdx; // 啊厘 坷贰傈俊 Grab茄 Frame狼 牢郸胶.
+ int m_nEndFrameIdx; // 娉呯妬 Grab 鑼� 鑽�
+ int m_nStartFrameIdx; // 鍟婂帢 鍧疯窗鍌堜繆 Grab鑼� Frame鐙� 鐗㈤兏鑳�.
int m_nSetBufferIdx;
int m_nScanIndex;
int m_nAllocatedGrabBufSize;
@@ -74,10 +74,10 @@
CCriticalSection m_csIdxLock;
BYTE* m_pOneLargeBuffer;
- void* m_pX64Buffer[MAX_BUFFER_COUNT]; // 角力 且寸瞪 滚欺.
+ void* m_pX64Buffer[MAX_BUFFER_COUNT]; // 瑙掑姏 涓斿鐬� 婊氭.
CORBUFFER m_hBuffer[MAX_BUFFER_COUNT]; // Handle to Buffer module where acquisition will take place
CORBUFFER m_hFrame[MAX_FRAME_COUNT];
- BOOL m_bIsGrabbing; // Grabbing 吝牢瘤 酒囱瘤 魄窜.
+ BOOL m_bIsGrabbing; // Grabbing 鍚濈墷鐦� 閰掑洷鐦� 榄勭獪.
CORSERVER m_hPC; // Handle to a PC Sapera server
CORSERVER m_hBoard; // Handle to Sapera server that will be acquiring
diff --git a/EdgeInspector_App/Grabber/SapLineGrab.cpp b/EdgeInspector_App/Grabber/SapLineGrab.cpp
index 1ae10c9..1b3a541 100644
--- a/EdgeInspector_App/Grabber/SapLineGrab.cpp
+++ b/EdgeInspector_App/Grabber/SapLineGrab.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "StdAfx.h"
#include "SapLineGrab.h"
@@ -79,7 +79,7 @@
return INITX64_FAIL_CREATEBUFFER;
if(ActivateObjects() == FALSE)
- return INITX64_FAIL_CREATEXFER;// ??? 货肺款 define 急攫 鞘夸
+ return INITX64_FAIL_CREATEXFER;// ??? 璐ц偤娆� define 鎬ユ敨 闉樺じ
m_pXfer->Connect();
m_pXfer->SetAutoConnect(TRUE);
@@ -143,7 +143,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Process侩 滚欺 积己
+ // Process渚� 婊氭 绉繁
// 1. Memory Virtual Alloc
@@ -286,7 +286,7 @@
LPBYTE CSapLineGrab::GetGrabFrameHeader(int nFrameNo, BOOL* bRet)
{
- // 捞固瘤甫 嘛篮 利捞 绝绰 版快绰 滚欺甫 府畔茄促.
+ // 鎹炲浐鐦ょ敨 鍢涚 鍒╂崬 缁濈话 鐗堝揩缁� 婊氭鐢� 搴滅晹鑼勪績.
LPBYTE pBuff= NULL;
if(nFrameNo > m_nSetBufferIdx) return NULL;
@@ -310,7 +310,7 @@
else
lpBuffer = NULL;
}
- else // 捞固瘤甫 嘛篮 版快绰 Frame No甫 犬牢窍咯 滚欺甫 府畔茄促.
+ else // 鎹炲浐鐦ょ敨 鍢涚 鐗堝揩缁� Frame No鐢� 鐘墷绐嶅挴 婊氭鐢� 搴滅晹鑼勪績.
{
if (bRet)
*bRet = TRUE;
@@ -452,7 +452,7 @@
if (bGrabbing == FALSE)
{
- // Snap 疙飞捞 吭栏唱 Callback 窃荐啊 龋免登瘤 臼篮 版快 Abort() 龋免 -> Callback 窃荐啊 龋免登瘤 臼栏搁 Freeze()肺绰 Snap 辆丰啊 救等促.
+ // Snap 鐤欓鎹� 鍚爮鍞� Callback 绐冭崘鍟� 榫嬪厤鐧荤槫 鑷肩 鐗堝揩 Abort() 榫嬪厤 -> Callback 绐冭崘鍟� 榫嬪厤鐧荤槫 鑷兼爮鎼� Freeze()鑲虹话 Snap 杈嗕赴鍟� 鏁戠瓑淇�.
g_pLog->DisplayMessage(_T("Stop Acq Case 1-1 Not Grabbing"));
if(m_bSnapStart == TRUE && m_bXferCall == FALSE)
{
@@ -467,7 +467,7 @@
}
else
{
- // Callback 窃荐啊 龋免等 版快绰 Freeze() 龋免
+ // Callback 绐冭崘鍟� 榫嬪厤绛� 鐗堝揩缁� Freeze() 榫嬪厤
//g_pLog->DisplayMessage(TRUE, "Stop Acq Case 2-1");
if(m_bXferCall)
{
@@ -625,7 +625,7 @@
}
/*
- // 矫累 橇饭烙 锅龋客 场 橇饭烙 锅龋.
+ // 鐭疮 姗囬キ鐑� 閿呴緥瀹� 鍦� 姗囬キ鐑� 閿呴緥.
int nStartFrameNo = nYStart / nBufSizeY;
int nEndFrameNo = (nYStart + nYSize) / nBufSizeY;
LPBYTE lpHeadAddr = GetFrameHeader(iScan,nStartFrameNo);
@@ -641,7 +641,7 @@
memcpy(lpIn + i * nXSize, lpStart + nLine * nBufSizeX, nXSize);
if (nStartFrameNo <= nEndFrameNo && (nYStart + i + 1) % nBufSizeY == 0)
{
- // 捞固瘤甫 蝶郴具窍绰 康开捞 MemFrameNo 版拌俊 吧媚乐绰 版快 贸府.
+ // 鎹炲浐鐦ょ敨 铦堕兇鍏风獚缁� 搴峰紑鎹� MemFrameNo 鐗堟媽淇� 鍚у獨涔愮话 鐗堝揩 璐稿簻.
lpHeadAddr = GetFrameHeader(iScan,++nStartFrameNo);
lpStart = lpHeadAddr + nXStart;
nLine = 0;
diff --git a/EdgeInspector_App/Grabber/SapLineGrab.h b/EdgeInspector_App/Grabber/SapLineGrab.h
index 736b792..d78f311 100644
--- a/EdgeInspector_App/Grabber/SapLineGrab.h
+++ b/EdgeInspector_App/Grabber/SapLineGrab.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "StdAfx.h"
#include "sapclassbasic.h"
@@ -17,14 +17,14 @@
virtual ~CSapLineGrab(void);
public:
- virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 檬扁拳
+ virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 妾墎鎷�
virtual BOOL InitializeBuffer(void *pParam);
virtual BOOL Deinitialize();
virtual BOOL GrabScanStart(int iScan, BOOL bFreeRun, int nPeriod, int nExposure=10, BOOL bAuto=TRUE);
virtual BOOL GrabLiveStart(int nExposure=15);
virtual BOOL GrabScanStop();
virtual BOOL IsGrabbing();
- virtual int IsAcqFrame(int nFrameNo, int nThreadIdx = -1); // Return 0 - 酒流 救嘛澜, Return -1 - 瘤况, Return 1 - 沥惑
+ virtual int IsAcqFrame(int nFrameNo, int nThreadIdx = -1); // Return 0 - 閰掓祦 鏁戝槢婢�, Return -1 - 鐦ゅ喌, Return 1 - 娌ユ儜
virtual LPBYTE GetFrameHeader(int iScan,int nFrameNo, BOOL* bSuccess = NULL);
virtual LPBYTE GetFrameHeaderLine(int iScan,int nLine, BOOL* bSuccess = NULL);
virtual BOOL GetSmallImage(int iScan,LPBYTE lpIn, int nXStart, int nYStart, int nXSize, int nYSize, BOOL bMustMapping = TRUE);
@@ -73,11 +73,11 @@
SapBuffer *m_pSapBuffers;
SapTransfer *m_pXfer;
SapView *View;
- int m_nGrabFrameNo; // 矫累急苞 八荤且 橇饭烙 荐俊辑 拌魂等 角力 嘛绰 橇饭烙 荐.
+ int m_nGrabFrameNo; // 鐭疮鎬ヨ嫗 鍏崵涓� 姗囬キ鐑� 鑽愪繆杈� 鎷岄瓊绛� 瑙掑姏 鍢涚话 姗囬キ鐑� 鑽�.
_GRABBER_INIT_PARAM_ m_Param;
int m_nBoardID;
int m_nAllocatedGrabBufSize;
- int m_cxferCall; // Xfercallback捞 龋免等 墨款飘.
+ int m_cxferCall; // Xfercallback鎹� 榫嬪厤绛� 澧ㄦ椋�.
int m_nScanIndex;
dqGrabIdx m_dqCallbackFrame;
CCriticalSection m_csIdxLock;
diff --git a/EdgeInspector_App/Grabber/SoliosControl.cpp b/EdgeInspector_App/Grabber/SoliosControl.cpp
index e560cad..0f2e984 100644
--- a/EdgeInspector_App/Grabber/SoliosControl.cpp
+++ b/EdgeInspector_App/Grabber/SoliosControl.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "SoliosControl.h"
#include "FrameBufferController.h"
@@ -330,7 +330,7 @@
if (nYStart + nYSize > nBufSizeY* GetEndFrameIdx())
return FALSE;
- // 矫累 橇饭烙 锅龋客 场 橇饭烙 锅龋.
+ // 鐭疮 姗囬キ鐑� 閿呴緥瀹� 鍦� 姗囬キ鐑� 閿呴緥.
int nStartFrameNo = nYStart / nBufSizeY;
int nEndFrameNo = (nYStart + nYSize) / nBufSizeY;
LPBYTE lpHeadAddr = GetFrameHeader(iScan,nStartFrameNo);
@@ -346,7 +346,7 @@
memcpy(lpIn + i * nXSize, lpStart + nLine * nBufSizeX, nXSize);
if (nStartFrameNo <= nEndFrameNo && (nYStart + i + 1) % nBufSizeY == 0)
{
- // 捞固瘤甫 蝶郴具窍绰 康开捞 MemFrameNo 版拌俊 吧媚乐绰 版快 贸府.
+ // 鎹炲浐鐦ょ敨 铦堕兇鍏风獚缁� 搴峰紑鎹� MemFrameNo 鐗堟媽淇� 鍚у獨涔愮话 鐗堝揩 璐稿簻.
lpHeadAddr = GetFrameHeader(iScan,++nStartFrameNo);
lpStart = lpHeadAddr + nXStart;
nLine = 0;
@@ -438,7 +438,7 @@
CGrabberSolios *pRadient = (CGrabberSolios*)HookDataPtr;
- if(pRadient->m_isLiveGrab == TRUE) // Live Grab 矫.
+ if(pRadient->m_isLiveGrab == TRUE) // Live Grab 鐭�.
{
pRadient->m_nSetBufferIdx = 0;
@@ -611,7 +611,7 @@
/*
MdigControl(m_MilDigitizer, M_CAMERALINK_CC1_SOURCE, M_GRAB_EXPOSURE+M_TIMER1);
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE+M_TIMER1, M_ENABLE);
- MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_SOURCE+M_TIMER1, M_CONTINUOUS); // Periodic 脚龋 牢啊
+ MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_SOURCE+M_TIMER1, M_CONTINUOUS); // Periodic 鑴氶緥 鐗㈠晩
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_TIME+M_TIMER1, nExposureTimer); //10000ns
MdigControl(m_MilDigitizer, M_GRAB_EXPOSURE_TIME_DELAY+M_TIMER1, nExposureTimerDelay); //10000ns
*/
diff --git a/EdgeInspector_App/Grabber/SoliosControl.h b/EdgeInspector_App/Grabber/SoliosControl.h
index 7c08cf7..7655c32 100644
--- a/EdgeInspector_App/Grabber/SoliosControl.h
+++ b/EdgeInspector_App/Grabber/SoliosControl.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#include "Global_Define.h"
@@ -15,7 +15,7 @@
public:
//////////////////////////////////////////////////////////////////////////
// Initialization
- virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 檬扁拳
+ virtual BOOL Initialize(void *pParam, int *pErrorCode,int iBoard=0); // Grabber 妾墎鎷�
virtual BOOL InitializeBuffer(void *pParam);
//////////////////////////////////////////////////////////////////////////
// Deinit
@@ -68,8 +68,8 @@
public:
_GRABBER_INIT_PARAM_ m_Param;
- MIL_ID m_MilSystem; // 焊靛寸 1函荐
- MIL_ID m_MilDigitizer; // 墨皋扼 函荐
+ MIL_ID m_MilSystem; // 鐒婇潧瀵� 1鍑借崘
+ MIL_ID m_MilDigitizer; // 澧ㄧ殝鎵� 鍑借崘
MIL_ID m_Milbufgrab[BUFFERING_SIZE_MAX];
DIGSTATUS m_DigitizerStatus;
long m_lBord;
@@ -77,8 +77,8 @@
CCriticalSection m_critical;
- int m_nEndFrameIdx; // 泅犁 Grab 茄 荐
- int m_nStartFrameIdx; // 啊厘 坷贰傈俊 Grab茄 Frame狼 牢郸胶.
+ int m_nEndFrameIdx; // 娉呯妬 Grab 鑼� 鑽�
+ int m_nStartFrameIdx; // 鍟婂帢 鍧疯窗鍌堜繆 Grab鑼� Frame鐙� 鐗㈤兏鑳�.
int m_nSetBufferIdx;
int m_nScanIndex;
int m_nAllocatedGrabBufSize;
diff --git a/EdgeInspector_App/InterfaceManager.cpp b/EdgeInspector_App/InterfaceManager.cpp
index e06011b..86bd20c 100644
--- a/EdgeInspector_App/InterfaceManager.cpp
+++ b/EdgeInspector_App/InterfaceManager.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "InterfaceManager.h"
#include "MulticamControl.h"
#include "RadientControl.h"
@@ -150,7 +150,7 @@
return 0;
}
-// End Signal阑 PLC俊辑 肋 给罐酒辑 Retry 持菌澜
+// End Signal闃� PLC淇婅緫 鑲� 缁欑綈閰掕緫 Retry 鎸佽弻婢�
void CInterfaceManager::PLCSignalRetry(SEND_MESSAGE_SECTION emSection,InspectToControlSignal emSendSignal,enInterface_Send_Control emControlSignal)
{
if(m_HardwareRecipe.m_nPLCSignalRetry <= 0)
@@ -505,7 +505,7 @@
m_PostProcess.SetView((void*) m_pView);
m_PostProcess.RunPostProcessing();
- // 馆靛矫 Scan End 脚龋 焊郴扁 傈俊 秦拎具茄促... Scan End 脚龋 焊尘锭 Loading捞 肯丰 救登搁 救焊郴瘤霸 阜囚乐澜..
+ // 棣嗛潧鐭� Scan End 鑴氶緥 鐒婇兇鎵� 鍌堜繆 绉︽嫀鍏疯寗淇�... Scan End 鑴氶緥 鐒婂皹閿� Loading鎹� 鑲赴 鏁戠櫥鎼� 鏁戠剨閮寸槫闇� 闃滃洑涔愭緶..
m_bGlassLoadingEnd = FALSE;
m_bPLCGlassLoading = FALSE;
@@ -1213,7 +1213,7 @@
if(!m_strReserveRecipe.IsEmpty())
{
g_pLog->DisplayMessage(_T("Apply reserve Recipe Loading - [%s]"), m_strReserveRecipe);
- if (LoadGlassRecipe(m_strReserveRecipe,TRUE)) // 鞍篮 Recipe扼档 利侩 抗距登绢 乐栏搁 促矫 肺爹茄促.
+ if (LoadGlassRecipe(m_strReserveRecipe,TRUE)) // 闉嶇 Recipe鎵兼。 鍒╀京 鎶楄窛鐧荤虎 涔愭爮鎼� 淇冪煫 鑲虹埞鑼勪績.
{
g_pLog->DisplayMessage(_T("Apply reserve Recipe Loading - [%s] : Success"), m_strReserveRecipe);
}
@@ -1227,7 +1227,7 @@
return FALSE;
}
- if (strRcp.CompareNoCase(m_GlassRecipe.GetRecipeName()) != 0) // strRecipeName 官差搁 肺爹茄促.
+ if (strRcp.CompareNoCase(m_GlassRecipe.GetRecipeName()) != 0) // strRecipeName 瀹樺樊鎼� 鑲虹埞鑼勪績.
{
if (LoadGlassRecipe(strRcp,TRUE) == FALSE)
{
@@ -1393,7 +1393,7 @@
BlVision_GetVisionRecipe()->setRecipeType(EI_VISION_RECIPE);
BlVision_GetVisionRecipe()->init();
- for (int i = 0; i < nCount; i++) { //设置分辨率
+ for (int i = 0; i < nCount; i++) { //璁剧疆鍒嗚鲸鐜�
DimensionDir eDir = (DimensionDir)(i);
CBlSideData *pSide = BlVision_GetVisionRecipe()->getSideData(eDir);
@@ -1443,7 +1443,7 @@
g_pLog->DisplayMessage( _T("CreateCamera Start!"));
//////////////////////////////////////////////////////////////////////////
- // Camera Handle 积己.
+ // Camera Handle 绉繁.
int iCam;
BOOL bRet = TRUE;
@@ -1540,7 +1540,7 @@
int nErrorCode;
int nBoardId = iCam;
- // B5 4龋扁 悸泼
+ // B5 4榫嬫墎 鎮告臣
g_pBase->m_strSBKLine = m_HardwareRecipe.GetLineID();
g_pBase->m_strSBKLine.Append(_T("#"));
@@ -1855,6 +1855,8 @@
FreeImage_Unload(bitmap);
Unlock();
+
+ return TRUE;
}
BOOL CInterfaceManager::SaveFullImageModern(CString strPath,LPBYTE lpOrigin,int nImgWidth,int nImgHeight,int iSide,int nStartY,int nQuality /*= 80*/)
@@ -1909,15 +1911,15 @@
cvReleaseImageHeader(&pImg);
#else
Lock();
- // 原始图像数据转 cv::Mat
+ // 鍘熷鍥惧儚鏁版嵁杞� cv::Mat
cv::Mat origin(nImgHeight, nImgWidth, CV_8UC1, lpOrigin + (nImgWidth * nStartY));
- // 缩放图像
+ // 缂╂斁鍥惧儚
cv::Size szNew(static_cast<int>(nImgWidth * dRatio), static_cast<int>(nImgHeight * dRatio));
cv::Mat resized;
cv::resize(origin, resized, szNew, 0, 0, cv::INTER_LINEAR);
- // 设置 JPEG 压缩参数
+ // 璁剧疆 JPEG 鍘嬬缉鍙傛暟
std::vector<int> params = {
cv::IMWRITE_JPEG_QUALITY,
nQuality
@@ -2029,7 +2031,7 @@
strPath.Append(_T("_NG"));
}
#else
- // 加载灰度图像
+ // 鍔犺浇鐏板害鍥惧儚
std::string strFilename = CT2A(strPath);
cv::Mat img = cv::imread(strFilename, cv::IMREAD_GRAYSCALE);
@@ -2057,7 +2059,7 @@
nHeight = img.rows;
}
else {
- // 按比例缩放
+ // 鎸夋瘮渚嬬缉鏀�
const double dRatio = 1.0 - static_cast<double>(IMAGE_COMPRESSRATIO) / 100.0;
int newWidth = static_cast<int>(img.cols / dRatio);
int newHeight = static_cast<int>(img.rows / dRatio);
diff --git a/EdgeInspector_App/InterfaceManager.h b/EdgeInspector_App/InterfaceManager.h
index 85c8bab..275f6a1 100644
--- a/EdgeInspector_App/InterfaceManager.h
+++ b/EdgeInspector_App/InterfaceManager.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
#include "EdgeInspector_AppView.h"
diff --git a/EdgeInspector_App/LanguageControl.cpp b/EdgeInspector_App/LanguageControl.cpp
index e3190be..741fd8c 100644
--- a/EdgeInspector_App/LanguageControl.cpp
+++ b/EdgeInspector_App/LanguageControl.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "LanguageControl.h"
#include <fstream>
#include <iostream>
@@ -47,7 +47,7 @@
char lineBuffer[1024];
- char seps[]="=\n"; //备盒磊
+ char seps[]="=\n"; //澶囩洅纾�
char* pTemp;
char* pContext;
@@ -64,10 +64,10 @@
BSTR bstrWide;
char* pszAnsi;
int nLength;
- nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, NULL, NULL);
+ nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), NULL, NULL);
bstrWide = SysAllocStringLen(NULL, nLength);
- MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, bstrWide, nLength);
+ MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), bstrWide, nLength);
nLength = WideCharToMultiByte(CP_ACP, 0, bstrWide, -1, NULL, 0, NULL, NULL);
pszAnsi = new char[nLength];
@@ -112,7 +112,7 @@
char lineBuffer[1024];
- char seps[]="=\n"; //备盒磊
+ char seps[]="=\n"; //澶囩洅纾�
char* pTemp;
char* pContext;
@@ -129,10 +129,10 @@
BSTR bstrWide;
char* pszAnsi;
int nLength;
- nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, NULL, NULL);
+ nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), NULL, NULL);
bstrWide = SysAllocStringLen(NULL, nLength);
- MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, bstrWide, nLength);
+ MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), bstrWide, nLength);
nLength = WideCharToMultiByte(CP_ACP, 0, bstrWide, -1, NULL, 0, NULL, NULL);
pszAnsi = new char[nLength];
@@ -177,7 +177,7 @@
char lineBuffer[1024];
- char seps[]="=\n"; //备盒磊
+ char seps[]="=\n"; //澶囩洅纾�
//char* pTemp;
//char* pContext;
@@ -194,10 +194,10 @@
BSTR bstrWide;
char* pszAnsi;
int nLength;
- nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, NULL, NULL);
+ nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), NULL, NULL);
bstrWide = SysAllocStringLen(NULL, nLength);
- MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, bstrWide, nLength);
+ MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), bstrWide, nLength);
nLength = WideCharToMultiByte(CP_ACP, 0, bstrWide, -1, NULL, 0, NULL, NULL);
pszAnsi = new char[nLength];
@@ -254,7 +254,7 @@
char lineBuffer[1024];
- char seps[]="=\n"; //备盒磊
+ char seps[]="=\n"; //澶囩洅纾�
//char* pTemp;
//char* pContext;
@@ -274,7 +274,7 @@
nLength = MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, NULL, NULL);
bstrWide = SysAllocStringLen(NULL, nLength);
- MultiByteToWideChar(CP_UTF8, 0, lineBuffer, strlen(lineBuffer) + 1, bstrWide, nLength);
+ MultiByteToWideChar(CP_UTF8, 0, lineBuffer, (int)(strlen(lineBuffer) + 1), bstrWide, nLength);
nLength = WideCharToMultiByte(CP_ACP, 0, bstrWide, -1, NULL, 0, NULL, NULL);
pszAnsi = new char[nLength];
diff --git a/EdgeInspector_App/LanguageControl.h b/EdgeInspector_App/LanguageControl.h
index a9bea57..1d3b9be 100644
--- a/EdgeInspector_App/LanguageControl.h
+++ b/EdgeInspector_App/LanguageControl.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Config.h"
#include "Global_Define.h"
diff --git a/EdgeInspector_App/License/Worker_UpdateLicense.cpp b/EdgeInspector_App/License/Worker_UpdateLicense.cpp
index 47c3215..43582ea 100644
--- a/EdgeInspector_App/License/Worker_UpdateLicense.cpp
+++ b/EdgeInspector_App/License/Worker_UpdateLicense.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
#include "Worker_UpdateLicense.h"
#ifdef _DEBUG
@@ -9,22 +9,22 @@
#pragma comment(lib,"l_mega64.lib")
#endif
-// 皋啊遏 扼捞宏矾府 寇何 窃荐 急攫 矫累
+// 鐨嬪晩閬� 鎵兼崬瀹忕熅搴� 瀵囦綍 绐冭崘 鎬ユ敨 鐭疮
#ifdef __cplusplus
extern "C" {
#endif
- extern unsigned int lock_init_usb(unsigned int op1); // 皋啊遏 沤祸
+ extern unsigned int lock_init_usb(unsigned int op1); // 鐨嬪晩閬� 娌ょジ
extern unsigned char lock_write(unsigned char op1, char op2);
extern unsigned char lock_read(unsigned char op1);
- extern unsigned int lock_boot_cnt(void); // 何泼 冉荐 掘扁
+ extern unsigned int lock_boot_cnt(void); // 浣曟臣 鍐夎崘 鎺樻墎
extern unsigned char lock_version(void);
- extern unsigned char lock_sn(char); // 皋啊遏 绊蜡锅龋
- extern unsigned char lock_check(void); // 皋啊遏 粮犁 咯何甫 狐福绊 埃窜洒 眉农
+ extern unsigned char lock_sn(char); // 鐨嬪晩閬� 缁婅湣閿呴緥
+ extern unsigned char lock_check(void); // 鐨嬪晩閬� 绮妬 鍜綍鐢� 鐙愮缁� 鍩冪獪娲� 鐪夊啘
extern int lock_write_ex(int op1, int op2);
extern int lock_read_ex(int op1);
extern BOOL lock_receive(void);
- // 捞傈 滚傈苞 龋券己 蜡瘤甫 困茄 窃荐, 脚痹诀眉牢 版快 酒贰狼 窃荐绰 荤侩窍瘤 付技夸.
+ // 鎹炲倛 婊氬倛鑻� 榫嬪埜宸� 铚$槫鐢� 鍥拌寗 绐冭崘, 鑴氱椆璇�鐪夌墷 鐗堝揩 閰掕窗鐙� 绐冭崘缁� 鑽や京绐嶇槫 浠樻妧澶�.
extern unsigned char lock_auto(char op1);
extern unsigned char lock_func0(unsigned char op1, unsigned char op2);
extern unsigned char lock_func1(unsigned char op1, unsigned char op2);
@@ -34,7 +34,7 @@
#ifdef __cplusplus
}
#endif
-// 皋啊遏 扼捞宏矾府 寇何 窃荐 急攫 场
+// 鐨嬪晩閬� 鎵兼崬瀹忕熅搴� 瀵囦綍 绐冭崘 鎬ユ敨 鍦�
CWorker_UpdateLicense::CWorker_UpdateLicense(int nIndex, IWorkerUpdateLicense2Parent *pIWUL2P, DWORD dwTick)
: m_nIndex(nIndex), m_pIWUL2P(pIWUL2P), m_dwTick(dwTick)
@@ -53,7 +53,7 @@
{
if (m_bUpdate) return FALSE;
- //Read 胶饭靛 积己
+ //Read 鑳堕キ闈� 绉繁
m_bUpdate = TRUE;
AfxBeginThread(CWorker_UpdateLicense::UpdateLicense,(LPVOID)(this));
@@ -95,7 +95,7 @@
void CWorker_UpdateLicense::Update_License()
{
- ////////////////////// USB侩 皋啊遏 八荤风凭 矫累
+ ////////////////////// USB渚� 鐨嬪晩閬� 鍏崵椋庡嚟 鐭疮
DWORD64 dwTick = GetTickCount64();
m_sStatus.Reset();
@@ -107,16 +107,16 @@
m_sStatus.expTime = tmpTime;
return;
- m_sStatus.nKeyStatus = LicenseKey_NotConnected; // 楷搬 救凳
- m_sStatus.nUsbID = lock_init_usb(8); // 楷搬 眉农
+ m_sStatus.nKeyStatus = LicenseKey_NotConnected; // 妤锋惉 鏁戝嚦
+ m_sStatus.nUsbID = lock_init_usb(8); // 妤锋惉 鐪夊啘
if (0 == m_sStatus.nUsbID)
{
m_pIWUL2P->IWUL2P_LicenceStatus(m_nIndex, m_sStatus);
return;
}
- m_sStatus.nKeyStatus = LicenseKey_NotCertified; // 牢刘 救凳
- if (0 != lock_check()) // 牢刘 眉农
+ m_sStatus.nKeyStatus = LicenseKey_NotCertified; // 鐗㈠垬 鏁戝嚦
+ if (0 != lock_check()) // 鐗㈠垬 鐪夊啘
{
m_pIWUL2P->IWUL2P_LicenceStatus(m_nIndex, m_sStatus);
return;
@@ -132,9 +132,9 @@
}
m_sStatus.strSerialNo = szTemp;
- m_sStatus.nKeyStatus = LicenseKey_NotActivated; // 劝己拳 救凳
+ m_sStatus.nKeyStatus = LicenseKey_NotActivated; // 鍔濆繁鎷� 鏁戝嚦
- // TIME 眉农
+ // TIME 鐪夊啘
int pMemData[16] = { 0 };
CString strTemp;
for (int i = 0; i < 16; i++)
@@ -194,7 +194,7 @@
if (spanTime.GetTotalSeconds() > 0)
{
- m_sStatus.nKeyStatus = LicenseKey_Activated; // 劝己拳凳
+ m_sStatus.nKeyStatus = LicenseKey_Activated; // 鍔濆繁鎷冲嚦
m_pIWUL2P->IWUL2P_LicenceStatus(m_nIndex, m_sStatus);
return;
}
diff --git a/EdgeInspector_App/License/Worker_UpdateLicense.h b/EdgeInspector_App/License/Worker_UpdateLicense.h
index dd20ca0..3707c3b 100644
--- a/EdgeInspector_App/License/Worker_UpdateLicense.h
+++ b/EdgeInspector_App/License/Worker_UpdateLicense.h
@@ -1,10 +1,10 @@
-#pragma once
+锘�#pragma once
enum LicenseKey_Status {
- LicenseKey_NotConnected = 0, // 楷搬 救凳
- LicenseKey_NotCertified, // 牢刘 救凳
- LicenseKey_NotActivated, // 咀萍海捞记 救凳
- LicenseKey_Activated // 咀萍海捞记 凳
+ LicenseKey_NotConnected = 0, // 妤锋惉 鏁戝嚦
+ LicenseKey_NotCertified, // 鐗㈠垬 鏁戝嚦
+ LicenseKey_NotActivated, // 鍜�钀嶆捣鎹炶 鏁戝嚦
+ LicenseKey_Activated // 鍜�钀嶆捣鎹炶 鍑�
};
struct SLicenseStatus
diff --git a/EdgeInspector_App/LicenseChecker.cpp b/EdgeInspector_App/LicenseChecker.cpp
index d82140c..a7935f1 100644
--- a/EdgeInspector_App/LicenseChecker.cpp
+++ b/EdgeInspector_App/LicenseChecker.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "LicenseChecker.h"
diff --git a/EdgeInspector_App/LicenseChecker.h b/EdgeInspector_App/LicenseChecker.h
index 41fb682..8a97219 100644
--- a/EdgeInspector_App/LicenseChecker.h
+++ b/EdgeInspector_App/LicenseChecker.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Worker_UpdateLicense.h"
class CLicenseChecker : public IWorkerUpdateLicense2Parent
diff --git a/EdgeInspector_App/Light/ExternLightControl.cpp b/EdgeInspector_App/Light/ExternLightControl.cpp
index efd398a..6d4f9ac 100644
--- a/EdgeInspector_App/Light/ExternLightControl.cpp
+++ b/EdgeInspector_App/Light/ExternLightControl.cpp
@@ -1,4 +1,4 @@
-// ExternLightControl.cpp: implementation of the CExternLightControl class.
+锘�// ExternLightControl.cpp: implementation of the CExternLightControl class.
//
//////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/Light/ExternLightControl.h b/EdgeInspector_App/Light/ExternLightControl.h
index d043fda..5af35fe 100644
--- a/EdgeInspector_App/Light/ExternLightControl.h
+++ b/EdgeInspector_App/Light/ExternLightControl.h
@@ -1,4 +1,4 @@
-// ExternLightControl.h: interface for the CExternLightControl class.
+锘�// ExternLightControl.h: interface for the CExternLightControl class.
//
//////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/Light/ExternLightControlAKPNV.cpp b/EdgeInspector_App/Light/ExternLightControlAKPNV.cpp
index 485e8c2..cb0dde6 100644
--- a/EdgeInspector_App/Light/ExternLightControlAKPNV.cpp
+++ b/EdgeInspector_App/Light/ExternLightControlAKPNV.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "stdafx.h"
#include "ExternLightControlAKPNV.h"
diff --git a/EdgeInspector_App/Light/ExternLightControlAKPNV.h b/EdgeInspector_App/Light/ExternLightControlAKPNV.h
index 69cd18e..a445e06 100644
--- a/EdgeInspector_App/Light/ExternLightControlAKPNV.h
+++ b/EdgeInspector_App/Light/ExternLightControlAKPNV.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/Light/ExternLightControlLCP.cpp b/EdgeInspector_App/Light/ExternLightControlLCP.cpp
index 0fc04ca..3c08308 100644
--- a/EdgeInspector_App/Light/ExternLightControlLCP.cpp
+++ b/EdgeInspector_App/Light/ExternLightControlLCP.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "stdafx.h"
#include "ExternLightControlLCP.h"
diff --git a/EdgeInspector_App/Light/ExternLightControlLCP.h b/EdgeInspector_App/Light/ExternLightControlLCP.h
index dfd2555..c5de115 100644
--- a/EdgeInspector_App/Light/ExternLightControlLCP.h
+++ b/EdgeInspector_App/Light/ExternLightControlLCP.h
@@ -1,4 +1,4 @@
-
+锘�
#pragma once
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/Light/LightManager.cpp b/EdgeInspector_App/Light/LightManager.cpp
index 45c0282..7006862 100644
--- a/EdgeInspector_App/Light/LightManager.cpp
+++ b/EdgeInspector_App/Light/LightManager.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "StdAfx.h"
#include "ExternLightControlLCP.h"
#include "ExternLightControlAKPNV.h"
@@ -99,13 +99,13 @@
if(pLingControl->OpenControl(pLight->m_nPort) == TRUE)
{
g_pLog->DisplayMessage(_T("Light controller %s connection success : Port[%d]"),strMsg,pLight->m_nPort);
- //TRACE("炼疙 %s 楷搬 己傍 : Port[%d]\n",strMsg,pLight->m_nPort);
+ //TRACE("鐐肩枡 %s 妤锋惉 宸卞倣 : Port[%d]\n",strMsg,pLight->m_nPort);
nOldPort = pLight->m_nPort;
}
else
{
g_pLog->DisplayMessage(_T("Light controller %s connection fail : Port[%d]"),strMsg,pLight->m_nPort);
- //TRACE("炼疙 %s 楷搬 角菩 : Port[%d]\n",strMsg,pLight->m_nPort);
+ //TRACE("鐐肩枡 %s 妤锋惉 瑙掕彥 : Port[%d]\n",strMsg,pLight->m_nPort);
}
m_vecLightControl.push_back(pLingControl);
diff --git a/EdgeInspector_App/Light/LightManager.h b/EdgeInspector_App/Light/LightManager.h
index 7857ffc..5032741 100644
--- a/EdgeInspector_App/Light/LightManager.h
+++ b/EdgeInspector_App/Light/LightManager.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include <vector>
#include "ExternLightControl.h"
@@ -25,7 +25,7 @@
protected:
std::vector<CExternLightControl *> m_vecLightControl;
- //CConfig m_ConfigLightValue; // 饭矫乔俊辑 包府窍磊... 炼疙 汲沥蔼阑 扁撅窍绰 Config File
+ //CConfig m_ConfigLightValue; // 楗煫涔斾繆杈� 鍖呭簻绐嶇... 鐐肩枡 姹叉播钄奸槕 鎵佹拝绐嶇话 Config File
CWnd *m_pParents;
CHardwareSettings *m_pHardwareSetting;
diff --git a/EdgeInspector_App/MainFrm.cpp b/EdgeInspector_App/MainFrm.cpp
index 9589286..9ffc2e9 100644
--- a/EdgeInspector_App/MainFrm.cpp
+++ b/EdgeInspector_App/MainFrm.cpp
@@ -1,5 +1,5 @@
-
-// MainFrm.cpp : CMainFrame 努贰胶狼 备泅
+锘�
+// MainFrm.cpp : CMainFrame 鍔窗鑳剁嫾 澶囨硡
//
#include "stdafx.h"
@@ -29,7 +29,7 @@
ON_WM_GETMINMAXINFO()
END_MESSAGE_MAP()
-// CMainFrame 积己/家戈
+// CMainFrame 绉繁/瀹舵垐
CMainFrame::CMainFrame()
{
@@ -77,10 +77,10 @@
return TRUE;
}
-// CMainFrame 皋矫瘤 贸府扁
+// CMainFrame 鐨嬬煫鐦� 璐稿簻鎵�
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
//CFrameWndEx::OnGetMinMaxInfo(lpMMI);
lpMMI->ptMinTrackSize.x = TOTAL_WINDOW_SIZE_X;
@@ -90,7 +90,7 @@
lpMMI->ptMaxTrackSize.y = TOTAL_WINDOW_SIZE_Y;
}
-// CMainFrame 柳窜
+// CMainFrame 鏌崇獪
#ifdef _DEBUG
void CMainFrame::AssertValid() const
@@ -105,7 +105,7 @@
#endif //_DEBUG
-// CMainFrame 皋矫瘤 贸府扁
+// CMainFrame 鐨嬬煫鐦� 璐稿簻鎵�
void CMainFrame::SetView(CEdgeInspector_AppView *pView)
{
m_pView = pView;
@@ -200,7 +200,7 @@
if (PathFileExists(strExePath) && PathFileExists(strConfigPath)) {
LPCTSTR pszExeName = PathFindFileName(strExePath);
- // 去掉 .exe,并杀死进程
+ // 鍘绘帀 .exe锛屽苟鏉�姝昏繘绋�
TCHAR szNameWithoutExt[MAX_PATH] = { 0 };
_tcscpy_s(szNameWithoutExt, pszExeName);
PathRemoveExtension(szNameWithoutExt);
@@ -220,7 +220,7 @@
if (PathFileExists(strExePath) && PathFileExists(strConfigPath)) {
LPCTSTR pszExeName = PathFindFileName(strExePath);
- // 去掉 .exe,并杀死进程
+ // 鍘绘帀 .exe锛屽苟鏉�姝昏繘绋�
TCHAR szNameWithoutExt[MAX_PATH] = { 0 };
_tcscpy_s(szNameWithoutExt, pszExeName);
PathRemoveExtension(szNameWithoutExt);
@@ -307,7 +307,7 @@
{
m_strReserveRecipe.Empty();
- if(!IsScanNow()) // 八荤 吝
+ if(!IsScanNow()) // 鍏崵 鍚�
{
if(LoadGlassRecipe(strRecipe,TRUE) == TRUE)
{
@@ -510,7 +510,7 @@
g_pBase->m_eProcessMode = PROC_MODE_SIMULATION_ONESIDE;
m_eManualInspectSide = eDim;
- // 烙矫肺 阜澜
+ // 鐑欑煫鑲� 闃滄緶
//return TRUE;
AfxBeginThread(ManualInspectProcess,this);
diff --git a/EdgeInspector_App/MainFrm.h b/EdgeInspector_App/MainFrm.h
index c30e213..ba9eedb 100644
--- a/EdgeInspector_App/MainFrm.h
+++ b/EdgeInspector_App/MainFrm.h
@@ -1,5 +1,5 @@
-
-// MainFrm.h : CMainFrame 努贰胶狼 牢磐其捞胶
+锘�
+// MainFrm.h : CMainFrame 鍔窗鑳剁嫾 鐗㈢鍏舵崬鑳�
//
#pragma once
@@ -12,21 +12,21 @@
, public IDisplyMessage2Parent
{
-protected: // serialization俊辑父 父甸绢笼聪促.
+protected: // serialization淇婅緫鐖� 鐖剁敻缁㈢鑱績.
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
-// 漂己涝聪促.
+// 婕傚繁娑濊仾淇�.
public:
-// 累诀涝聪促.
+// 绱瘈娑濊仾淇�.
public:
-// 犁沥狼涝聪促.
+// 鐘佹播鐙兼稘鑱績.
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-// 备泅涝聪促.
+// 澶囨硡娑濊仾淇�.
public:
virtual ~CMainFrame();
#ifdef _DEBUG
@@ -65,7 +65,7 @@
void SetRegistryRcpName(CString strRecipe);
void ApplyViewRecipeSettingss();
-// 积己等 皋矫瘤 甘 窃荐
+// 绉繁绛� 鐨嬬煫鐦� 鐢� 绐冭崘
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
diff --git a/EdgeInspector_App/MilControl_Common.h b/EdgeInspector_App/MilControl_Common.h
index 1de4fd6..ef7d134 100644
--- a/EdgeInspector_App/MilControl_Common.h
+++ b/EdgeInspector_App/MilControl_Common.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "mil.h"
@@ -13,9 +13,9 @@
{
int nJobIndex;
int nSKipFrame;
- int status; // 泅犁 惑怕... // M_STOP , M_START , M_FREE_START
- int nCount; // 佬篮 扼牢荐...
- int nIndex; // 捞固瘤 滚欺 牢郸胶
+ int status; // 娉呯妬 鎯戞��... // M_STOP , M_START , M_FREE_START
+ int nCount; // 浣 鎵肩墷鑽�...
+ int nIndex; // 鎹炲浐鐦� 婊氭 鐗㈤兏鑳�
int nDisplayFrame;
int nResetFrame;
}DIGSTATUS, *PDIGSTATUS;
diff --git a/EdgeInspector_App/PLC/Control_Interface.cpp b/EdgeInspector_App/PLC/Control_Interface.cpp
index bf11a7e..a8c67c4 100644
--- a/EdgeInspector_App/PLC/Control_Interface.cpp
+++ b/EdgeInspector_App/PLC/Control_Interface.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "Control_Interface.h"
#include "Config.h"
#include "SharedMemoryDefine.h"
@@ -70,17 +70,17 @@
{
m_bConnect = FALSE;
- //4k 农扁狼 傍蜡 皋葛府 颇老 积己
+ //4k 鍐滄墎鐙� 鍌嶈湣 鐨嬭憶搴� 棰囪�� 绉繁
m_hMap = ::CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE
, 0, SHARED_MEMORY_SIZE, _T("MX_COMPONENT_SHARED_MEMORY"));
- //父老 捞固 积己等 按眉啊 乐促搁 捞固 Connector啊 累悼 吝..
+ //鐖惰�� 鎹炲浐 绉繁绛� 鎸夌湁鍟� 涔愪績鎼� 鎹炲浐 Connector鍟� 绱偧 鍚�..
if (::GetLastError() == ERROR_ALREADY_EXISTS)
{
- //捞固 积己等 按眉啊 乐促搁 积己捞 酒聪扼 坷锹栏肺 角青
+ //鎹炲浐 绉繁绛� 鎸夌湁鍟� 涔愪績鎼� 绉繁鎹� 閰掕仾鎵� 鍧烽敼鏍忚偤 瑙掗潚
m_hMap = ::OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,_T("MX_COMPONENT_SHARED_MEMORY"));
}
- else//父老 积己等 按眉啊 绝促搁 沥惑 悼累窍瘤 臼绰促.
+ else//鐖惰�� 绉繁绛� 鎸夌湁鍟� 缁濅績鎼� 娌ユ儜 鎮肩疮绐嶇槫 鑷肩话淇�.
g_pLog->DisplayMessage(_T("Error : No defect PLCConnector program."));
if (m_hMap == NULL)
@@ -89,7 +89,7 @@
return FALSE;
}
- //傍蜡皋葛府 甘俏
+ //鍌嶈湣鐨嬭憶搴� 鐢樹繌
m_pSharedMemory = (char*)::MapViewOfFile(m_hMap, FILE_MAP_ALL_ACCESS, 0, 0, SHARED_MEMORY_SIZE);
if (m_pSharedMemory == NULL)
@@ -98,7 +98,7 @@
return FALSE;
}
- //0栏肺 檬扁拳
+ //0鏍忚偤 妾墎鎷�
ZeroMemory(m_pSharedMemory,SHARED_MEMORY_SIZE);
m_bConnect = TRUE;
@@ -433,7 +433,7 @@
else
memset(m_pSharedMemory+iAddr, 0x00, nWORDSize);
- //葛电 蔼阑 盲况 持篮 饶 PLCConnector俊霸 PLC 林家俊 蔼阑 利档废 脚龋甫 焊辰促.
+ //钁涚數 钄奸槕 鐩插喌 鎸佺 楗� PLCConnector淇婇湼 PLC 鏋楀淇� 钄奸槕 鍒╂。搴� 鑴氶緥鐢� 鐒婅景淇�.
m_pSharedMemory[iStartAddr] = 1;
return true;
@@ -491,7 +491,7 @@
iAddr+=4;
memcpy(m_pSharedMemory+iAddr, WriteData, nWORDSize*2);
- //葛电 蔼阑 盲况 持篮 饶 PLCConnector俊霸 PLC 林家俊 蔼阑 利档废 脚龋甫 焊辰促.
+ //钁涚數 钄奸槕 鐩插喌 鎸佺 楗� PLCConnector淇婇湼 PLC 鏋楀淇� 钄奸槕 鍒╂。搴� 鑴氶緥鐢� 鐒婅景淇�.
m_pSharedMemory[iStartAddr] = 1;
return true;
}
@@ -527,7 +527,7 @@
iAddr+=2;
memcpy(m_pSharedMemory+iAddr, &msecTimer, 4);
- //葛电 蔼阑 盲况 持篮 饶 PLCConnector俊霸 PLC 林家俊 蔼阑 利档废 脚龋甫 焊辰促.
+ //钁涚數 钄奸槕 鐩插喌 鎸佺 楗� PLCConnector淇婇湼 PLC 鏋楀淇� 钄奸槕 鍒╂。搴� 鑴氶緥鐢� 鐒婅景淇�.
m_pSharedMemory[iStartAddr] = 1;
return true;
}
@@ -555,7 +555,7 @@
iAddr+=2;
memcpy(m_pSharedMemory+iAddr, &msecTimer, 4);
- //葛电 蔼阑 盲况 持篮 饶 PLCConnector俊霸 PLC 林家俊 蔼阑 利档废 脚龋甫 焊辰促.
+ //钁涚數 钄奸槕 鐩插喌 鎸佺 楗� PLCConnector淇婇湼 PLC 鏋楀淇� 钄奸槕 鍒╂。搴� 鑴氶緥鐢� 鐒婅景淇�.
m_pSharedMemory[iStartAddr] = 1;
return true;
}
@@ -668,7 +668,7 @@
return TRUE;
}
-// 胶飘傅 -> 16柳荐
+// 鑳堕鍌� -> 16鏌宠崘
BOOL CControl_Interface::StrToHex(CHAR* pchData, CHAR* pchDataSrc, INT nLength, BOOL bWordReverse)
{
//static UCHAR saucHex[] = "0123456789ABCDEF";
@@ -950,16 +950,16 @@
if ( strlength > 6) strlength = 6;
if( nWORDSize > 1000) nWORDSize = 1000;
- //傍蜡 皋葛府俊 拱幅单捞磐甫 佬档废 脚龋甫 焊辰促.
+ //鍌嶈湣 鐨嬭憶搴滀繆 鎷卞箙鍗曟崬纾愮敨 浣。搴� 鑴氶緥鐢� 鐒婅景淇�.
ZeroMemory(m_pSharedMemory + PLC_READ_LONGDATA_ADDRESS_1, (PLC_READ_LONGDATA_LENGTH_1)-(PLC_READ_LONGDATA_ADDRESS_1));
memcpy(m_pSharedMemory+PLC_READ_LONGDATA_ADDRESS_1, strAddress,strlength*sizeof(TCHAR));
memcpy(m_pSharedMemory+PLC_READ_LONGDATA_LENGTH_1, &nWORDSize,2);
memset(m_pSharedMemory+PLC_READ_LONGDATA_SIGNAL_1, 0x01, 1);
- //单捞磐甫 促 佬绊 傍蜡皋葛府 利阑 锭鳖瘤 扁促赴促.
+ //鍗曟崬纾愮敨 淇� 浣粖 鍌嶈湣鐨嬭憶搴� 鍒╅槕 閿硸鐦� 鎵佷績璧翠績.
::WaitForSingleObject(m_ReadEvent,2000);
- //肯丰啊 登搁 秦寸 蔼阑 促矫 佬绢柯促.
+ //鑲赴鍟� 鐧绘悂 绉﹀ 钄奸槕 淇冪煫 浣虎鏌績.
//pData = m_pSharedMemory+PLC_READ_LONGDATA_VALUE;
memcpy(pData, m_pSharedMemory + PLC_READ_LONGDATA_VALUE_1, nWORDSize * 2);
diff --git a/EdgeInspector_App/PLC/Control_Interface.h b/EdgeInspector_App/PLC/Control_Interface.h
index 634af7f..0dab77b 100644
--- a/EdgeInspector_App/PLC/Control_Interface.h
+++ b/EdgeInspector_App/PLC/Control_Interface.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Thread_ControlIF.h"
#include "TransDataManager.h"
@@ -177,8 +177,8 @@
char *m_pSharedMemory;
ST_PLC_RECIVE_01 m_Rcv01;
ST_PLC_SEND_01 m_Send01,m_SentBack01;
- int m_nSignal; //Signal 涝仿
- int m_nLongSignal; //Signal 涝仿
+ int m_nSignal; //Signal 娑濅豢
+ int m_nLongSignal; //Signal 娑濅豢
CEvent m_ReadEvent;
double m_dTickPrevTime;
diff --git a/EdgeInspector_App/PLC/Control_Interface_New.cpp b/EdgeInspector_App/PLC/Control_Interface_New.cpp
index 1371692..0b34c19 100644
--- a/EdgeInspector_App/PLC/Control_Interface_New.cpp
+++ b/EdgeInspector_App/PLC/Control_Interface_New.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "Control_Interface_New.h"
#include "Config.h"
#include "SharedMemoryDefine.h"
@@ -62,17 +62,17 @@
{
m_bConnect = FALSE;
- //4k 农扁狼 傍蜡 皋葛府 颇老 积己
+ //4k 鍐滄墎鐙� 鍌嶈湣 鐨嬭憶搴� 棰囪�� 绉繁
m_hMap = ::CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE
, 0, SHARED_MEMORY_SIZE, _T("MX_COMPONENT_SHARED_MEMORY"));
- //父老 捞固 积己等 按眉啊 乐促搁 捞固 Connector啊 累悼 吝..
+ //鐖惰�� 鎹炲浐 绉繁绛� 鎸夌湁鍟� 涔愪績鎼� 鎹炲浐 Connector鍟� 绱偧 鍚�..
if (::GetLastError() == ERROR_ALREADY_EXISTS)
{
- //捞固 积己等 按眉啊 乐促搁 积己捞 酒聪扼 坷锹栏肺 角青
+ //鎹炲浐 绉繁绛� 鎸夌湁鍟� 涔愪績鎼� 绉繁鎹� 閰掕仾鎵� 鍧烽敼鏍忚偤 瑙掗潚
m_hMap = ::OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,_T("MX_COMPONENT_SHARED_MEMORY"));
}
- else//父老 积己等 按眉啊 绝促搁 沥惑 悼累窍瘤 臼绰促.
+ else//鐖惰�� 绉繁绛� 鎸夌湁鍟� 缁濅績鎼� 娌ユ儜 鎮肩疮绐嶇槫 鑷肩话淇�.
g_pLog->DisplayMessage(_T("Error : No defect PLCConnector program."));
if (m_hMap == NULL)
@@ -81,7 +81,7 @@
return FALSE;
}
- //傍蜡皋葛府 甘俏
+ //鍌嶈湣鐨嬭憶搴� 鐢樹繌
m_pSharedMemory = (char*)::MapViewOfFile(m_hMap, FILE_MAP_ALL_ACCESS, 0, 0, SHARED_MEMORY_SIZE);
if (m_pSharedMemory == NULL)
@@ -90,7 +90,7 @@
return FALSE;
}
- //0栏肺 檬扁拳
+ //0鏍忚偤 妾墎鎷�
ZeroMemory(m_pSharedMemory,SHARED_MEMORY_SIZE);
m_bConnect = TRUE;
@@ -209,7 +209,7 @@
iAddr+=4;
memcpy(m_pSharedMemory+iAddr, WriteData, nWORDSize*2);
- //葛电 蔼阑 盲况 持篮 饶 PLCConnector俊霸 PLC 林家俊 蔼阑 利档废 脚龋甫 焊辰促.
+ //钁涚數 钄奸槕 鐩插喌 鎸佺 楗� PLCConnector淇婇湼 PLC 鏋楀淇� 钄奸槕 鍒╂。搴� 鑴氶緥鐢� 鐒婅景淇�.
m_pSharedMemory[iStartAddr] = 1;
return true;
}
@@ -362,16 +362,16 @@
break;
}
- //傍蜡 皋葛府俊 拱幅单捞磐甫 佬档废 脚龋甫 焊辰促.
+ //鍌嶈湣 鐨嬭憶搴滀繆 鎷卞箙鍗曟崬纾愮敨 浣。搴� 鑴氶緥鐢� 鐒婅景淇�.
ZeroMemory(m_pSharedMemory+nAddress,(nLength)-(nAddress));
memcpy(m_pSharedMemory+nAddress, strAddress,strlength*sizeof(TCHAR));
memcpy(m_pSharedMemory+nLength, &nWORDSize,2);
memset(m_pSharedMemory+nSignal, 0x01, 1);
- //单捞磐甫 促 佬绊 傍蜡皋葛府 利阑 锭鳖瘤 扁促赴促.
+ //鍗曟崬纾愮敨 淇� 浣粖 鍌嶈湣鐨嬭憶搴� 鍒╅槕 閿硸鐦� 鎵佷績璧翠績.
::WaitForSingleObject(m_ReadEvent,2000);
- //肯丰啊 登搁 秦寸 蔼阑 促矫 佬绢柯促.
+ //鑲赴鍟� 鐧绘悂 绉﹀ 钄奸槕 淇冪煫 浣虎鏌績.
//pData = m_pSharedMemory+PLC_READ_LONGDATA_VALUE;
memcpy(pData, m_pSharedMemory+nValue, nWORDSize*2);
@@ -420,7 +420,7 @@
return FALSE;
}
-// 胶飘傅 -> 16柳荐
+// 鑳堕鍌� -> 16鏌宠崘
BOOL CControl_Interface_New::StrToHex(CHAR* pchData, CHAR* pchDataSrc, INT nLength, BOOL bWordReverse)
{
//static UCHAR saucHex[] = "0123456789ABCDEF";
diff --git a/EdgeInspector_App/PLC/Control_Interface_New.h b/EdgeInspector_App/PLC/Control_Interface_New.h
index 7036b13..2ee912e 100644
--- a/EdgeInspector_App/PLC/Control_Interface_New.h
+++ b/EdgeInspector_App/PLC/Control_Interface_New.h
@@ -1,16 +1,16 @@
-#pragma once
+锘�#pragma once
#include "Thread_ControlIF.h"
#include "TransDataManager.h"
#include "BICommon.h"
-// MINI LED EI, NOTCH (狐傅)
+// MINI LED EI, NOTCH (鐙愬倕)
// #define MINI_LED_PLC_ADDR_SENDSIGNAL 2129
// #define MINI_LED_PLC_TRASFERDATA_ADDR 2000
// #define MINI_LED_PLC_ADDR_GLASS_JUDEMENT 2100
// #define MINI_LED_PLC_ADDR_PROFILE_JUDEMENT 4300
-// EI, NOTCH, RCUT (扁粮 BF)
+// EI, NOTCH, RCUT (鎵佺伯 BF)
#if MINI_LED
#define EI_PLC_ADDR_SENDSIGNAL 2129
#define EI_PLC_TRASFERDATA_ADDR 2000
diff --git a/EdgeInspector_App/Process/InspectCamera.cpp b/EdgeInspector_App/Process/InspectCamera.cpp
index 909e2f7..dda71b4 100644
--- a/EdgeInspector_App/Process/InspectCamera.cpp
+++ b/EdgeInspector_App/Process/InspectCamera.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "InspectCamera.h"
#include "GlassRecipe.h"
#include "HardwareSettings.h"
@@ -15,14 +15,14 @@
#endif // USE_WEBSOCKET
#define BOUNDARY_GLASSSTARTWIDTH 160
-#define BOUNDARYHORIZ_LEVELDIST 8 // 荐乞 版拌急阑 茫阑 锭狼 厚背芭府
+#define BOUNDARYHORIZ_LEVELDIST 8 // 靾橅弶 瓴疥硠靹犾潉 彀眷潉 霑岇潣 牍勱祼瓯半Μ
#define TIME_WAIT_GLASS_START 3000
#define align_4byte(in) ((in + 3)/4)*4
#define RAD_TO_DEGREE (double)(180.0f / 3.1415926535f)
CInspectCamera::CInspectCamera(int iCam)
-{
+{
m_iCamera = iCam;
m_pThreadControl = new CThreadControl();
m_pRecipe = NULL;
@@ -62,7 +62,7 @@
ReleaseThread();
ReleaseFullBuffer();
- if(m_pDefectControl != NULL)
+ if (m_pDefectControl != NULL)
delete m_pDefectControl;
m_pDefectControl = NULL;
@@ -78,8 +78,8 @@
void CInspectCamera::ReleaseThread()
{
- m_bExitThread = TRUE;
- if(m_pThreadControl != NULL)
+ m_bExitThread = TRUE;
+ if (m_pThreadControl != NULL)
{
m_pThreadControl->ReleaseThreadControl();
Sleep(100);
@@ -88,9 +88,9 @@
}
}
-int CInspectCamera::InitInspect(int nThread,int maxDefect)
+int CInspectCamera::InitInspect(int nThread, int maxDefect)
{
- m_pThreadControl->InitThreadControl(nThread,this);
+ m_pThreadControl->InitThreadControl(nThread, this);
m_pDefectControl->InitDefectStorage(maxDefect);
@@ -113,7 +113,7 @@
m_bExitThread = FALSE;
CCameraSettings* pCamSetting = m_pHardparm->GetCameraSettings(m_iCamera, m_iScan);
- if(pCamSetting == NULL || m_pGlassData == NULL)
+ if (pCamSetting == NULL || m_pGlassData == NULL)
{
g_pLog->DisplayMessage(_T("HW Setting Error.. or Glass Data Error.."));
return FALSE;
@@ -125,12 +125,12 @@
m_dPixelSizeX = pCamSetting->m_dConvResolution[m_pGlassData->GetStageNo()];
m_dPixelSizeY = pCamSetting->m_dScanResolution[m_pGlassData->GetStageNo()];
- CSide_Data* pSideData = m_pGlassData->GetSideData(pCamSetting->m_eDimension);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(pCamSetting->m_eDimension);
pSideData->m_dPixelSizeX = m_dPixelSizeX;
pSideData->m_dPixelSizeY = m_dPixelSizeY;
#if HALCON_VISION_KEY
- CBlSideData *pBlSideData = BlVision_GetVisionRecipe()->getSideData(pCamSetting->m_eDimension);
+ CBlSideData* pBlSideData = BlVision_GetVisionRecipe()->getSideData(pCamSetting->m_eDimension);
if (NULL != pBlSideData) {
pBlSideData->m_mapSideLineInf.clear();
}
@@ -145,12 +145,12 @@
BOOL CInspectCamera::ScanStartThread()
{
- if(m_pThreadControl == NULL)
- return FALSE;
+ if (m_pThreadControl == NULL)
+ return FALSE;
int nThread = m_pThreadControl->StartThreadControl();
- if(nThread <= 0)
- {
+ if (nThread <= 0)
+ {
return FALSE;
}
@@ -159,25 +159,25 @@
BOOL CInspectCamera::GetCheckFrame(stFrameIndex stFrame)
{
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(m_iCamera,stFrame.nScanIdx);
- if(pCamera == NULL)
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(m_iCamera, stFrame.nScanIdx);
+ if (pCamera == NULL)
return FALSE;
DimensionDir emDim = pCamera->m_eDimension;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
-
- int nFrameHeight = pCamera->m_FrameSize.cy;
- int nStartFrame = pSideData->m_nGlassStartLine/nFrameHeight;
- if(nStartFrame > stFrame.nFrameIdx)
+ int nFrameHeight = pCamera->m_FrameSize.cy;
+ int nStartFrame = pSideData->m_nGlassStartLine / nFrameHeight;
+
+ if (nStartFrame > stFrame.nFrameIdx)
return TRUE;
return FALSE;
}
-ERR_FIND_GLASSSTARTLINE CInspectCamera::IsGlassStartLine(int iThread,int &iScan)
+ERR_FIND_GLASSSTARTLINE CInspectCamera::IsGlassStartLine(int iThread, int& iScan)
{
iScan = m_iScan;
@@ -185,11 +185,11 @@
stFrame.nScanIdx = m_iScan;
- if(m_bFindGlassStart[stFrame.nScanIdx] == TRUE)
+ if (m_bFindGlassStart[stFrame.nScanIdx] == TRUE)
return ERR_FINDGLASSSTART_SUCCESS;
- // 磊悼老锭 橇饭烙 荐甫 面盒洒 棱栏搁 巩力啊 救登绰芭 鞍促父... 橇饭烙 荐啊 何练窍搁 咯扁辑 公茄栏肺 吧覆.. 弊府绊 矫累急 茫疽栏搁 弊成 逞绢啊搁 登瘤 臼唱?
- if(m_pGrabber->GetGrabFrameCount() < 1)
+ // 鞛愲彊鞚茧晫 頂勲爤鞛� 靾橂ゼ 於╇秳頌� 鞛§溂氅� 氍胳牅臧� 鞎堧悩電旉卑 臧欕嫟毵�... 頂勲爤鞛� 靾橁皜 攵�臁表晿氅� 鞐赴靹� 氍错暅鞙茧 瓯鸽.. 攴鸽Μ瓿� 鞁滌瀾靹� 彀眷晿鞙茧┐ 攴鸽儱 雱橃柎臧�氅� 霅橃 鞎婋倶?
+ if (m_pGrabber->GetGrabFrameCount() < 1)
{
Sleep(0);
return ERR_FINDGLASSSTART_FAIL;
@@ -204,63 +204,63 @@
return ERR_FINDGLASSSTART_SUCCESS;
*/
- if(iThread != 0)
- return ERR_FINDGLASSSTART_FAIL;
-
- DimensionDir emDim = GetDimension(stFrame.nScanIdx);
+ if (iThread != 0)
+ return ERR_FINDGLASSSTART_FAIL;
+
+ DimensionDir emDim = GetDimension(stFrame.nScanIdx);
iScan = stFrame.nScanIdx;
- if(FindGlassStartLine(emDim,stFrame) == TRUE)
+ if (FindGlassStartLine(emDim, stFrame) == TRUE)
{
g_pLog->DisplayMessage(_T("Find Start Line Success!"));
- ScanRegionSet(stFrame);
+ ScanRegionSet(stFrame);
m_bFindGlassStart[stFrame.nScanIdx] = TRUE;
m_MsgJob.nState = 1;
m_MsgJob.nDispLine = 0;
m_MsgJob.nSide = (int)emDim;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData != NULL)
+ if (pSideData != NULL)
m_MsgJob.nDispLine = pSideData->m_nGlassStartLine;
- ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS,(WPARAM)&m_MsgJob, (int)emDim);
+ ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS, (WPARAM)&m_MsgJob, (int)emDim);
return ERR_FINDGLASSSTART_SUCCESS;
}
else
- {
+ {
return ERR_FINDGLASSSTART_FIND_FAIL;
}
return ERR_FINDGLASSSTART_FAIL;
}
-BOOL CInspectCamera::OnThreadRun(int iThread, CInspectThread *pInspectThread)
+BOOL CInspectCamera::OnThreadRun(int iThread, CInspectThread* pInspectThread)
{
- if(m_pRecipe == NULL)
- return FALSE;
- if(m_pHardparm == NULL)
+ if (m_pRecipe == NULL)
return FALSE;
- if(m_pGlassData == NULL)
+ if (m_pHardparm == NULL)
return FALSE;
- if(m_pGrabber == NULL)
+ if (m_pGlassData == NULL)
+ return FALSE;
+ if (m_pGrabber == NULL)
return FALSE;
- while(TRUE)
+ while (TRUE)
{
- Sleep(1); // Sleep 1肺 吧绢拎具 茄促... 0栏肺 吧搁 八荤啊 救瞪嫐啊 乐澜.. 恐?
+ Sleep(1); // Sleep 1搿� 瓯胳柎欷橃暭 頃滊嫟... 0鞙茧 瓯鸽┐ 瓴�靷皜 鞎堧悹聥職臧� 鞛堨潓.. 鞕�?
- if(GetCheckExit() == TRUE)
+ if (GetCheckExit() == TRUE)
{
- g_pLog->DisplayMessage(_T("cam %d, Thread %d Thread Exit"),m_iCamera,iThread);
+ g_pLog->DisplayMessage(_T("cam %d, Thread %d Thread Exit"), m_iCamera, iThread);
break;
- }
+ }
- // 1. 0锅 Thread肺 Start Line 茫扁
+ // 1. 0氩� Thread搿� Start Line 彀娟赴
int iRetScan;
- switch(IsGlassStartLine(iThread,iRetScan))
+ switch (IsGlassStartLine(iThread, iRetScan))
{
case ERR_FINDGLASSSTART_FAIL:
continue;
@@ -269,19 +269,19 @@
m_pGrabber->GrabScanStop();
m_pGrabber->ClearGrabIdx();
m_bExitThread = TRUE;
- g_pLog->DisplayMessage(_T("%s Process Find Glass StartLine Fail"),PANEL_SIDE[GetDimension(iRetScan)]);
+ g_pLog->DisplayMessage(_T("%s Process Find Glass StartLine Fail"), PANEL_SIDE[GetDimension(iRetScan)]);
m_MsgJob.nState = 1;
m_MsgJob.nDispLine = 0;
m_MsgJob.nSide = (int)GetDimension(m_iScan);
- ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS,(WPARAM)&m_MsgJob, (int)m_MsgJob.nSide);
+ ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS, (WPARAM)&m_MsgJob, (int)m_MsgJob.nSide);
continue;
break;
- }
-
- // 2. Start Line阑 茫疽栏搁, 茄橇饭烙究 波郴辑 八荤 矫累
+ }
+
+ // 2. Start Line鞚� 彀眷晿鞙茧┐, 頃滍攧霠堨瀯鞌� 旰茧偞靹� 瓴�靷� 鞁滌瀾
stFrameIndex stFrame = m_pGrabber->GetGrabFrame();
- if(stFrame.nScanIdx < 0 || stFrame.nFrameIdx < 0)
+ if (stFrame.nScanIdx < 0 || stFrame.nFrameIdx < 0)
continue;
DimensionDir emDim = GetDimension(stFrame.nScanIdx);
@@ -291,10 +291,10 @@
m_pGlassData->GetSideData(emDim)->SetFrameProc(stFrame.nFrameIdx);
- // 3. Start Line Frame 焊促 捞傈牢瘤 眉农..
- if(CheckStartLineFrame(emDim,stFrame.nFrameIdx) == FALSE)
+ // 3. Start Line Frame 氤措嫟 鞚挫爠鞚胳 觳错伂..
+ if (CheckStartLineFrame(emDim, stFrame.nFrameIdx) == FALSE)
{
- g_pLog->DisplayMessage(_T("Check Start Line Frame.. %s : %d"),g_SideName[(int) emDim], stFrame.nFrameIdx);
+ g_pLog->DisplayMessage(_T("Check Start Line Frame.. %s : %d"), g_SideName[(int)emDim], stFrame.nFrameIdx);
continue;
}
@@ -306,9 +306,9 @@
SetFrameFinish(stFrame.nScanIdx, stFrame.nFrameIdx);
- BOOL bEnd = CheckThreadEnd(iThread,stFrame);
-
- if(stFrame.nFrameIdx % 5 == 0 && bEnd == FALSE && m_pGlassData->GetSideData(emDim)->m_bFindGlassEndLine == FALSE)
+ BOOL bEnd = CheckThreadEnd(iThread, stFrame);
+
+ if (stFrame.nFrameIdx % 5 == 0 && bEnd == FALSE && m_pGlassData->GetSideData(emDim)->m_bFindGlassEndLine == FALSE)
{
m_MsgJob.nState = 1;
m_MsgJob.nDispLine = stFrame.nFrameIdx * m_nFrameHeight;
@@ -340,7 +340,7 @@
}
}
- g_pLog->DisplayMessage(_T("Camera %d-%d Thread End"),m_iCamera,iThread);
+ g_pLog->DisplayMessage(_T("Camera %d-%d Thread End"), m_iCamera, iThread);
return TRUE;
}
@@ -386,7 +386,7 @@
pBlSideData->m_mBotMark.y = pSideData->m_ptBotMark_FindResult.y;
}
- //添加此功能
+ //璀啀電瑯旖�
pBlSideData->m_nStartLine = pSideData->m_nGlassStartLine;
pBlSideData->m_nEndLine = pSideData->m_nGlassEndLine;
pBlSideData->m_vDispVisionResult.clear();
@@ -400,12 +400,12 @@
for (int i = 0; i < ngNum; i++) {
NgInfo ng = ngArray[i];
- //if (ng.isRes) continue; //结果OK,继续
- //这里添加结果
+ //if (ng.isRes) continue; //鞃矌OK锛岇叏宕�
+ //渚鹅焷璀啀鞃矌
if (5 == ng.ngType && (ng.result < ng.minValue || ng.result > ng.maxValue))
{
-
+
CDefect_Info defectInfo;
defectInfo.m_iFrameIdx = stFrame.nFrameIdx; // stFrame.nFrameIdx;
defectInfo.m_nCamID = m_iCamera;
@@ -418,72 +418,50 @@
defectInfo.m_rtDefectPos_pxl = CRect(ng.xPosPxl, ng.yPosPxl, ng.xPosPxl + 50, ng.yPosPxl + 10);
defectInfo.m_DefectLoc = DefectLoc_Corner_Chamfer;
-
+
if (m_pDefectControl != NULL)
- m_pDefectControl->ExtractDefect_CorChamfer(eDim, m_iCamera, stFrame.nScanIdx, DefectLoc_Corner_Chamfer, defectInfo, (int)(ng.result));
+ m_pDefectControl->ExtractDefect_CorChamfer(eDim, m_iCamera, stFrame.nScanIdx, DefectLoc_Corner_Chamfer, defectInfo, (int)(ng.result));
}
}
#endif // HALCON_VISION_KEY
}
-BOOL CInspectCamera::CheckThreadEnd(int iThread,stFrameIndex stFrame)
+BOOL CInspectCamera::CheckThreadEnd(int iThread, stFrameIndex stFrame)
{
- int iScan = stFrame.nScanIdx;
-
- CSingleLock myLoc(&m_csThreadEnd);
+ CSingleLock myLoc(&m_csThreadEnd);
myLoc.Lock();
- // 捞固 场抄 Thread..
- if(m_iThreadEnd[iScan][iThread] == 1)
- {
+ int iScan = stFrame.nScanIdx;
+ if (m_iThreadEnd[iScan][iThread] == 1) {
myLoc.Unlock();
- return FALSE;
+ return FALSE;
}
- BOOL bEnd = FALSE;
-
- if(CheckProcessEnd(iThread,stFrame) == TRUE)
- {
+ BOOL bEnd = FALSE;
+ if (CheckProcessEnd(iThread, stFrame) == TRUE) {
m_iThreadEnd[iScan][iThread] = 1;
bEnd = TRUE;
myLoc.Unlock();
}
- if(bEnd == TRUE)
- {
+ if (bEnd == TRUE) {
DimensionDir emDim = GetDimension(iScan);
-
m_pGlassData->GetSideData(emDim)->m_bInspection_Complete = TRUE;
-
- g_pLog->DisplayMessage(_T("%s Thread %d Process End : Scan %d, Frame %d"),PANEL_SIDE[emDim],iThread,iScan,stFrame.nFrameIdx);
- if(GetThreadEndCount(iScan) == MAX_THREAD)
- {
+ g_pLog->DisplayMessage(_T("%s Thread %d Process End : Scan %d, Frame %d"), PANEL_SIDE[emDim], iThread, iScan, stFrame.nFrameIdx);
+
+ if (GetThreadEndCount(iScan) == MAX_THREAD) {
myLoc.Lock();
SaveFullImageCopy(iScan);
myLoc.Unlock();
- g_pLog->DisplayMessage(_T("%s Scan Process All End"),PANEL_SIDE[emDim]);
+ g_pLog->DisplayMessage(_T("%s Scan Process All End"), PANEL_SIDE[emDim]);
FinallyVisionProc(emDim);
- if(m_pII2S != NULL)
- m_pII2S->II2S_InspectionEnd(m_iCamera,iScan);
-
- /*
- // Waiting All Frame Finish..
- DWORD dwTickCount = GetTickCount();
- while(GetTickCount() - dwTickCount < 5000)
- {
- if(CheckAllFrameFinish(iScan) == TRUE)
- break;
+ if (m_pII2S != NULL) {
+ m_pII2S->II2S_InspectionEnd(m_iCamera, iScan);
}
- */
-
- //m_MsgJob.nState = 2;
- //m_MsgJob.nSide = (int)emDim;
- //m_MsgJob.nDispLine = stFrame.nFrameIdx * m_nFrameHeight;
- //::SendMessage(m_hWndViewScan, WM_POCESS_STATUS,(WPARAM)&m_MsgJob, (int)emDim);
- }
+ }
}
myLoc.Unlock();
@@ -494,8 +472,8 @@
int CInspectCamera::GetThreadEndCount(int iScan)
{
int nCount = 0;
- for(int i=0;i<MAX_THREAD;i++)
- if(m_iThreadEnd[iScan][i] == 1)
+ for (int i = 0; i < MAX_THREAD; i++)
+ if (m_iThreadEnd[iScan][i] == 1)
nCount++;
return nCount;
@@ -508,8 +486,9 @@
m_nFrameFinishIdx[nCurrentScanIdx] = -1;
- for(int i=0; i<MAX_FRAM_COUNT; i++)
+ for (int i = 0; i < MAX_FRAM_COUNT; i++) {
m_bFrameFinish[nCurrentScanIdx][i] = FALSE;
+ }
cslocalLock.Unlock();
}
@@ -539,13 +518,19 @@
CSingleLock cslocalLock(&m_csFrameFinishCheck);
cslocalLock.Lock();
- if(m_nFrameFinishIdx[nCurrentScanIdx] == -1)
+ if (m_nFrameFinishIdx[nCurrentScanIdx] == -1) {
+ cslocalLock.Unlock();
return FALSE;
+ }
- for(int i=0; i<m_nFrameFinishIdx[nCurrentScanIdx]; i++)
- if(m_bFrameFinish[nCurrentScanIdx][i] == FALSE)
+ for (int i = 0; i < m_nFrameFinishIdx[nCurrentScanIdx]; i++) {
+ if (m_bFrameFinish[nCurrentScanIdx][i] == FALSE) {
+ cslocalLock.Unlock();
return FALSE;
+ }
+ }
+ cslocalLock.Unlock();
return TRUE;
}
@@ -574,44 +559,44 @@
double dX_um = GetPixelToUm_X(ptEnd_pxl.x - ptStart_pxl.x);
double dY_um = GetPixelToUm_Y(ptEnd_pxl.y - ptStart_pxl.y);
- return sqrt((dX_um*dX_um) + (dY_um*dY_um));
+ return sqrt((dX_um * dX_um) + (dY_um * dY_um));
}
BOOL CInspectCamera::GetAlignRotate(DimensionDir emDim, CPoint ptSetTopMark, CPoint ptSetBotMark, CRect rtSetArea, CRect& bRotateArea)
{
- if(rtSetArea.IsRectEmpty() || rtSetArea.IsRectNull())
+ if (rtSetArea.IsRectEmpty() || rtSetArea.IsRectNull())
return FALSE;
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bTopMark_Find == FALSE || pSideData->m_bBotMark_Find == FALSE)
+ if (pSideData->m_bTopMark_Find == FALSE || pSideData->m_bBotMark_Find == FALSE)
return FALSE;
CPoint ptSet_Area = rtSetArea.CenterPoint();
- double dSet_DiffX = (double) (ptSetBotMark.x - ptSetTopMark.x);
- double dSet_DiffY = (double) (ptSetBotMark.y - ptSetTopMark.y);
- double dset_T_Rad = (dSet_DiffY == 0.0) ? 0.0 : atan(dSet_DiffX/dSet_DiffY);
+ double dSet_DiffX = (double)(ptSetBotMark.x - ptSetTopMark.x);
+ double dSet_DiffY = (double)(ptSetBotMark.y - ptSetTopMark.y);
+ double dset_T_Rad = (dSet_DiffY == 0.0) ? 0.0 : atan(dSet_DiffX / dSet_DiffY);
CPoint ptFind_TopMark = pSideData->m_ptTopMark_FindResult;
CPoint ptFind_BotMark = pSideData->m_ptBotMark_FindResult;
- double dFind_DiffX = (double) (ptFind_BotMark.x - ptFind_TopMark.x);
- double dFind_DiffY = (double) (ptFind_BotMark.y - ptFind_TopMark.y);
- double dFind_T_Rad = (dFind_DiffY == 0.0) ? 0.0 : atan(dFind_DiffX/dFind_DiffY);
+ double dFind_DiffX = (double)(ptFind_BotMark.x - ptFind_TopMark.x);
+ double dFind_DiffY = (double)(ptFind_BotMark.y - ptFind_TopMark.y);
+ double dFind_T_Rad = (dFind_DiffY == 0.0) ? 0.0 : atan(dFind_DiffX / dFind_DiffY);
double dDiff_T_Rad = dFind_T_Rad - dset_T_Rad;
double dMarkToArea_X_pxl = ptSet_Area.x - ptSetTopMark.x;
double dMarkToArea_Y_pxl = ptSet_Area.y - ptSetTopMark.y;
- double dMarkToArea_Distance_pxl = sqrt((dMarkToArea_X_pxl*dMarkToArea_X_pxl) + (dMarkToArea_Y_pxl*dMarkToArea_Y_pxl));
- double dMarkToArea_T_Rad = (dMarkToArea_Y_pxl == 0.0) ? 0.0 : atan(dMarkToArea_X_pxl/dMarkToArea_Y_pxl);
+ double dMarkToArea_Distance_pxl = sqrt((dMarkToArea_X_pxl * dMarkToArea_X_pxl) + (dMarkToArea_Y_pxl * dMarkToArea_Y_pxl));
+ double dMarkToArea_T_Rad = (dMarkToArea_Y_pxl == 0.0) ? 0.0 : atan(dMarkToArea_X_pxl / dMarkToArea_Y_pxl);
double dRotateArea_T_Rad = dMarkToArea_T_Rad + dDiff_T_Rad;
@@ -620,25 +605,25 @@
double dRotate_X_pxl = sin(dRotateArea_T_Rad) * dMarkToArea_Distance_pxl * dDirection;
double dRotate_Y_pxl = cos(dRotateArea_T_Rad) * dMarkToArea_Distance_pxl * dDirection;
- bRotateArea.left = bRotateArea.right = (int) ptFind_TopMark.x + dRotate_X_pxl;
- bRotateArea.top = bRotateArea.bottom = (int) ptFind_TopMark.y + dRotate_Y_pxl;
+ bRotateArea.left = bRotateArea.right = ptFind_TopMark.x + (LONG)dRotate_X_pxl;
+ bRotateArea.top = bRotateArea.bottom = ptFind_TopMark.y + (LONG)dRotate_Y_pxl;
- bRotateArea.InflateRect(rtSetArea.Width()/2, rtSetArea.Height()/2);
+ bRotateArea.InflateRect(rtSetArea.Width() / 2, rtSetArea.Height() / 2);
return TRUE;
}
-BOOL CInspectCamera::CopyRectImg(LPBYTE pOrg,LPBYTE pTgt,CSize szImg,CRect &rectIns)
+BOOL CInspectCamera::CopyRectImg(LPBYTE pOrg, LPBYTE pTgt, CSize szImg, CRect& rectIns)
{
- if(pOrg == NULL || pTgt == NULL)
+ if (pOrg == NULL || pTgt == NULL)
return FALSE;
int v;
int dv = 0;
- for(v=rectIns.top;v<rectIns.bottom;v++,dv++)
+ for (v = rectIns.top; v < rectIns.bottom; v++, dv++)
{
- CopyMemory(pTgt+dv*rectIns.Width(),pOrg+v*szImg.cx+rectIns.left,rectIns.Width());
+ CopyMemory(pTgt + dv * rectIns.Width(), pOrg + v * szImg.cx + rectIns.left, rectIns.Width());
}
return TRUE;
@@ -646,36 +631,36 @@
void CInspectCamera::SaveDebugImage(DimensionDir eDim, stFrameIndex stFrame, COwnerBuffer* pBuffer, CString strFileName)
{
- if(m_pHardparm == NULL)
+ if (m_pHardparm == NULL)
return;
- if(m_pHardparm->m_bUse_SaveDebugImage == FALSE)
+ if (m_pHardparm->m_bUse_SaveDebugImage == FALSE)
return;
-// #ifdef _DEBUG
- if(pBuffer == NULL)
+ // #ifdef _DEBUG
+ if (pBuffer == NULL)
return;
CString str;
str.Format(_T("D:\\Inspection\\DebugFullImg\\%s_Side[%s]_Frame[%d].jpg"), strFileName, GetSideName(eDim), stFrame.nFrameIdx);
-
+
g_pStatus->CheckDirectory(str);
CBufferAttach saveImage(str);
saveImage.AttachToFile(*pBuffer);
-// #endif
+ // #endif
}
void CInspectCamera::SaveDebugImage(DimensionDir eDim, stFrameIndex stFrame, IplImage* pBuffer, CString strFileName)
{
- if(m_pHardparm == NULL)
+ if (m_pHardparm == NULL)
return;
- if(m_pHardparm->m_bUse_SaveDebugImage == FALSE)
+ if (m_pHardparm->m_bUse_SaveDebugImage == FALSE)
return;
-// #ifdef _DEBUG
- if(pBuffer == NULL)
+ // #ifdef _DEBUG
+ if (pBuffer == NULL)
return;
CString str;
@@ -698,26 +683,28 @@
g_pLog->DisplayMessage(_T("SaveDebugImage error..."));
}
-// #endif
+ // #endif
}
void CInspectCamera::SaveDebugImage(DimensionDir eDim, stFrameIndex stFrame, cv::Mat image, CString strFileName)
{
- if (m_pHardparm == NULL)
+ if (m_pHardparm == NULL) {
return;
+ }
- if (m_pHardparm->m_bUse_SaveDebugImage == FALSE)
+ if (m_pHardparm->m_bUse_SaveDebugImage == FALSE) {
return;
+ }
// #ifdef _DEBUG
- if (image.empty() || image.data == NULL)
+ if (image.empty() || image.data == NULL) {
return;
+ }
CString str;
str.Format(_T("D:\\Inspection\\DebugFullImg\\%s_Side[%s]_Frame[%d].jpg"), strFileName, GetSideName(eDim), stFrame.nFrameIdx);
- try
- {
+ try {
g_pStatus->CheckDirectory(str);
USES_CONVERSION;
@@ -725,8 +712,7 @@
std::string filePath(asciiStr);
cv::imwrite(filePath, image);
}
- catch (...)
- {
+ catch (...) {
g_pLog->DisplayMessage(_T("SaveDebugImage error..."));
}
@@ -735,7 +721,7 @@
CString CInspectCamera::GetSideName(DimensionDir eDim)
{
- switch(eDim)
+ switch (eDim)
{
case DIMENSION_A: return _T("SideA_UP");
break;
@@ -760,23 +746,24 @@
void CInspectCamera::SaveFullImageCopy(int iScan)
{
- // 4/17
- // 畴飘合 皋葛府啊 叠妨辑 促款登绰淀..
- // return;
-
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL) {
return;
- if(m_pGrabber == NULL)
- return;
+ }
- CSingleLock cLock(&m_csSaveimage);
+ if (m_pGrabber == NULL) {
+ return;
+ }
+
+ CSingleLock cLock(&m_csSaveimage);
cLock.Lock();
DimensionDir eDim = GetDimension(iScan);
CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL) {
+ cLock.Unlock();
return;
+ }
int nSetEnd = (pSideData->m_nGlassEndLine <= 0) ? pSideData->m_nPreGlassEndLine : pSideData->m_nGlassEndLine;
int nOffset = 1000;
@@ -786,73 +773,81 @@
g_pLog->DisplayMessage(_T("%s Copy Full Image : nStartLine=%d, nEndLine=%d, nFullSize=%d"), PANEL_SIDE[eDim], nStartLine, nEndLine, nFullSize);
- if(nStartLine < 0)
- {
+ if (nStartLine < 0) {
nStartLine = 0;
}
- if(nFullSize <= 0 || nEndLine < 0)
+ if (nFullSize <= 0 || nEndLine < 0) {
+ cLock.Unlock();
return;
+ }
- //if(nFullSize <= nStartLine)
- // return;
+ if (nFullSize <= nStartLine) {
+ cLock.Unlock();
+ return;
+ }
pINSPECTFULLIMAGE_BUFFER pImgBuf = GetFullImgBuffer(iScan);
- int nFrameWidth,nFrameHeight;
+ int nFrameWidth, nFrameHeight;
- GetFrameSize(m_iCamera,iScan,nFrameWidth,nFrameHeight);
+ GetFrameSize(m_iCamera, iScan, nFrameWidth, nFrameHeight);
- if(nFrameWidth <= 0 || nFrameHeight <= 0)
+ if (nFrameWidth <= 0 || nFrameHeight <= 0) {
+ cLock.Unlock();
return;
+ }
- if(nFullSize/nFrameHeight > m_pGrabber->GetFrameBuffer()->GetFrameCount())
- nFullSize = (m_pGrabber->GetFrameBuffer()->GetFrameCount()-1)*nFrameHeight;
+ if (nFullSize / nFrameHeight > m_pGrabber->GetFrameBuffer()->GetFrameCount()) {
+ nFullSize = (m_pGrabber->GetFrameBuffer()->GetFrameCount() - 1) * nFrameHeight;
+ }
- if(nFullSize <= 100)
+ if (nFullSize <= 100) {
+ cLock.Unlock();
return;
+ }
pImgBuf->iCamIdx = m_iCamera;
pImgBuf->iScanIdx = iScan;
- pImgBuf->SetSize(CSize(nFrameWidth,nFullSize));
+ pImgBuf->SetSize(CSize(nFrameWidth, nFullSize));
g_pLog->DisplayMessage(_T("%s Copy Full Image : nFrameWidth=%d, nFrameHeight=%d"), PANEL_SIDE[eDim], nFrameWidth, nFullSize);
- g_pLog->DisplayMessage(_T("%s Full Image Memory Copy Start : Start[%d]-End[%d]"),PANEL_SIDE[eDim],nStartLine,nEndLine);
+ g_pLog->DisplayMessage(_T("%s Full Image Memory Copy Start : Start[%d]-End[%d]"), PANEL_SIDE[eDim], nStartLine, nEndLine);
- LPBYTE lpHeader = m_pGrabber->GetFrameHeaderLine(iScan,nStartLine);
- if(lpHeader == NULL)
- {
- g_pLog->DisplayMessage(_T("%s Full Image Memory Copy fail : Start[%d]-End[%d]"),PANEL_SIDE[eDim],nStartLine,nEndLine);
+ LPBYTE lpHeader = m_pGrabber->GetFrameHeaderLine(iScan, nStartLine);
+ if (lpHeader == NULL) {
+ cLock.Unlock();
+ g_pLog->DisplayMessage(_T("%s Full Image Memory Copy fail : Start[%d]-End[%d]"), PANEL_SIDE[eDim], nStartLine, nEndLine);
return;
}
- CopyMemory(pImgBuf->pImage,lpHeader,sizeof(BYTE)*pImgBuf->szImage.cx*pImgBuf->szImage.cy);
+ CopyMemory(pImgBuf->pImage, lpHeader, sizeof(BYTE) * pImgBuf->szImage.cx * pImgBuf->szImage.cy);
cLock.Unlock();
- g_pLog->DisplayMessage(_T("%s Full Image Memory Copy complete : Start[%d]-End[%d]"),PANEL_SIDE[eDim],nStartLine,nEndLine);
+ g_pLog->DisplayMessage(_T("%s Full Image Memory Copy complete : Start[%d]-End[%d]"), PANEL_SIDE[eDim], nStartLine, nEndLine);
}
BOOL CInspectCamera::CheckProcessEnd(int iThread, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- if(m_pGrabber == NULL)
- return FALSE;
+ if (m_pGrabber == NULL)
+ return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(GetDimension(stFrame.nScanIdx));
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(g_pStatus->GetGrabFrameCount(stFrame.nScanIdx)-1 <= stFrame.nFrameIdx)
+ if (g_pStatus->GetGrabFrameCount(stFrame.nScanIdx) - 1 <= stFrame.nFrameIdx)
return TRUE;
- if(pSideData->m_nPreGlassEndFrame+MAX_THREAD <= stFrame.nFrameIdx)
- return TRUE;
+ if (pSideData->m_nPreGlassEndFrame + MAX_THREAD <= stFrame.nFrameIdx)
+ return TRUE;
- // Glass End Line阑 茫绰 Thread 鳖瘤 柳青 吝捞搁 促 场抄芭瘤..
- if(pSideData->m_bFindGlassEndLine == TRUE || pSideData->GetFrameProc(pSideData->m_nPreGlassEndFrame) == TRUE)
+ // Glass End Line鞚� 彀倦姅 Thread 旯岇 歆勴枆 欷戩澊氅� 雼� 雭濍倻瓯办..
+ if (pSideData->m_bFindGlassEndLine == TRUE || pSideData->GetFrameProc(pSideData->m_nPreGlassEndFrame) == TRUE)
return TRUE;
return FALSE;
@@ -865,107 +860,107 @@
SetGrabEnd(stFrame.nScanIdx);
}
-BOOL CInspectCamera::CheckStartLineFrame(DimensionDir eDim,int iFrame)
+BOOL CInspectCamera::CheckStartLineFrame(DimensionDir eDim, int iFrame)
{
CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_nGlassStartFrame > iFrame)
+ if (pSideData->m_nGlassStartFrame > iFrame)
return FALSE;
return TRUE;
}
-int CInspectCamera::GetLeftMargin(int iCam,int iScan)
+int CInspectCamera::GetLeftMargin(int iCam, int iScan)
{
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(iCam,iScan);
- if(pCamera == NULL)
- return 0;
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(iCam, iScan);
+ if (pCamera == NULL)
+ return 0;
return pCamera->m_nMarginLeft;
}
-void CInspectCamera::GetFrameSize(int iCam,int iScan,int &nFrameWidth,int &nFrameHeight)
+void CInspectCamera::GetFrameSize(int iCam, int iScan, int& nFrameWidth, int& nFrameHeight)
{
nFrameWidth = nFrameHeight = 0;
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(iCam,iScan);
- if(pCamera == NULL)
- return;
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(iCam, iScan);
+ if (pCamera == NULL)
+ return;
nFrameWidth = pCamera->m_FrameSize.cx;
nFrameHeight = pCamera->m_FrameSize.cy;
}
-BOOL CInspectCamera::FindEndLine(int iThread,DimensionDir emDim,stFrameIndex stFrame)
+BOOL CInspectCamera::FindEndLine(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_nPreGlassEndFrame != stFrame.nFrameIdx)
+ if (pSideData->m_nPreGlassEndFrame != stFrame.nFrameIdx)
return FALSE;
m_MsgJob.nState = 1;
m_MsgJob.nSide = (int)emDim;
- ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS,(WPARAM)&m_MsgJob, (int)emDim);
+ ::SendMessage(m_hWndViewScan, WM_POCESS_STATUS, (WPARAM)&m_MsgJob, (int)emDim);
#define BOUNDARY_GLASSSTARTWIDTH_ENDLINE 140
-#define BOUNDARYHORIZ_LEVELDIST_ENDLINE 50 // 荐乞 版拌急阑 茫阑 锭狼 厚背芭府
+#define BOUNDARYHORIZ_LEVELDIST_ENDLINE 50 // 靾橅弶 瓴疥硠靹犾潉 彀眷潉 霑岇潣 牍勱祼瓯半Μ
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
- int nThreshold = m_pRecipe->m_SideParam[emDim].m_nFindStartEndLine_Threshold * BOUNDARY_GLASSSTARTWIDTH_ENDLINE;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
+ int nThreshold = m_pRecipe->m_SideParam[emDim].m_nFindStartEndLine_Threshold * BOUNDARY_GLASSSTARTWIDTH_ENDLINE;
int nCountinueCount = 0;
int nHStart, nGab;
- BOOL bContinue = FALSE;
- int nDivHor = 0;
- int iScan = stFrame.nScanIdx;
+ BOOL bContinue = FALSE;
+ int nDivHor = 0;
+ int iScan = stFrame.nScanIdx;
- int nSetHor = m_pRecipe->m_SideParam[(int) emDim].m_nFindStartEndLine_X_pxl;
-
- if(nSetHor < BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2) nSetHor = BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2;
- if(nSetHor > nFrameWidth-(BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2)) nSetHor = nFrameWidth-(BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2);
+ int nSetHor = m_pRecipe->m_SideParam[(int)emDim].m_nFindStartEndLine_X_pxl;
- g_pLog->DisplayMessage(_T( "%s End Edge Find position Frame[%d],Hor[%d]"),PANEL_SIDE[emDim],stFrame.nFrameIdx,nSetHor);
+ if (nSetHor < BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2) nSetHor = BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2;
+ if (nSetHor > nFrameWidth - (BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2)) nSetHor = nFrameWidth - (BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2);
- nHStart = nSetHor - BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2;
+ g_pLog->DisplayMessage(_T("%s End Edge Find position Frame[%d],Hor[%d]"), PANEL_SIDE[emDim], stFrame.nFrameIdx, nSetHor);
+
+ nHStart = nSetHor - BOUNDARY_GLASSSTARTWIDTH_ENDLINE / 2;
const int nCalculateFrame = 3;
int nStartFrame = stFrame.nFrameIdx - 2;
- int nVTop = nStartFrame*nFrameHeight;
- LPBYTE lpHeader = m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx,nVTop);
+ int nVTop = nStartFrame * nFrameHeight;
+ LPBYTE lpHeader = m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, nVTop);
- CSISBuffer pVertBuffer(lpHeader,nFrameWidth,nCalculateFrame*nFrameHeight);
+ CSISBuffer pVertBuffer(lpHeader, nFrameWidth, nCalculateFrame * nFrameHeight);
- if(lpHeader == NULL || pVertBuffer.IsValidBuffer() == FALSE)
+ if (lpHeader == NULL || pVertBuffer.IsValidBuffer() == FALSE)
return FALSE;
- int* pnSum = new int[nFrameHeight*nCalculateFrame + BOUNDARYHORIZ_LEVELDIST_ENDLINE];
+ int* pnSum = new int[nFrameHeight * nCalculateFrame + BOUNDARYHORIZ_LEVELDIST_ENDLINE];
- ZeroMemory(pnSum, sizeof(int) * (nFrameHeight*nCalculateFrame + BOUNDARYHORIZ_LEVELDIST_ENDLINE));
+ ZeroMemory(pnSum, sizeof(int) * (nFrameHeight * nCalculateFrame + BOUNDARYHORIZ_LEVELDIST_ENDLINE));
#ifdef _DEBUG
CString str;
- str.Format(_T("D:\\InspectionData\\Debug\\Side_%d_EndLineSearch.bmp"),(int)emDim);
+ str.Format(_T("D:\\InspectionData\\Debug\\Side_%d_EndLineSearch.bmp"), (int)emDim);
CBufferAttach saveImage(str);
saveImage.AttachToFile(pVertBuffer);
#endif
- for (int j = pVertBuffer.GetHeight()-1 ; j >= 0; j--)
+ for (int j = pVertBuffer.GetHeight() - 1; j >= 0; j--)
{
- for (int k = nHStart; k < nHStart+BOUNDARY_GLASSSTARTWIDTH_ENDLINE; k++)
+ for (int k = nHStart; k < nHStart + BOUNDARY_GLASSSTARTWIDTH_ENDLINE; k++)
{
- pnSum[j] += *pVertBuffer.GetDataAddress(k,j);
- }
+ pnSum[j] += *pVertBuffer.GetDataAddress(k, j);
+ }
- if (j <= (pVertBuffer.GetHeight()-1-BOUNDARYHORIZ_LEVELDIST_ENDLINE))
+ if (j <= (pVertBuffer.GetHeight() - 1 - BOUNDARYHORIZ_LEVELDIST_ENDLINE))
{
- if(pnSum[j + BOUNDARYHORIZ_LEVELDIST_ENDLINE] == 0 || pnSum[j] == 0) // 肋 给 等 捞固瘤..
+ if (pnSum[j + BOUNDARYHORIZ_LEVELDIST_ENDLINE] == 0 || pnSum[j] == 0) // 鞛� 氇� 霅� 鞚措歆�..
continue;
- nGab = abs(pnSum[j + BOUNDARYHORIZ_LEVELDIST_ENDLINE] - pnSum[j]);
+ nGab = abs(pnSum[j + BOUNDARYHORIZ_LEVELDIST_ENDLINE] - pnSum[j]);
if (nGab > nThreshold)
nCountinueCount++;
else
@@ -973,13 +968,13 @@
if (nCountinueCount >= 2)
{
- // Glass狼 矫累瘤痢阑 茫酒辑 备炼眉俊 持绰促.
- pSideData->m_nGlassEndLine = nStartFrame*nFrameHeight + j + 2;
- pSideData->m_nGlassEndFrame = pSideData->m_nGlassEndLine/nFrameHeight;
- pSideData->m_bFindGlassEndLine = TRUE;
+ // Glass鞚� 鞁滌瀾歆�鞝愳潉 彀眷晞靹� 甑“觳挫棎 雱k姅雼�.
+ pSideData->m_nGlassEndLine = nStartFrame * nFrameHeight + j + 2;
+ pSideData->m_nGlassEndFrame = pSideData->m_nGlassEndLine / nFrameHeight;
+ pSideData->m_bFindGlassEndLine = TRUE;
// pSideData->m_nGlassEdgeXPos[1] = nSetHor;
- g_pLog->DisplayMessage(_T( "%s End Line Frame %d, Line %d"), PANEL_SIDE[emDim], pSideData->m_nGlassEndFrame, pSideData->m_nGlassEndLine);
+ g_pLog->DisplayMessage(_T("%s End Line Frame %d, Line %d"), PANEL_SIDE[emDim], pSideData->m_nGlassEndFrame, pSideData->m_nGlassEndLine);
/*
// Log
@@ -988,11 +983,11 @@
, PANEL_SIDE[emDim]
, pEdgeInfo->nGlassEdgeXPos[1]
, pEdgeInfo->nGlassEndLine
- , pEdgeInfo->nGlassEndLine / nFrameHeight);
+ , pEdgeInfo->nGlassEndLine / nFrameHeight);
*/
- delete [] pnSum;
-
+ delete[] pnSum;
+
// SaveGlassLineImage(stFrame.nScanIdx,pSideData->m_nGlassEndLine,pSideData->m_nGlassEdgeXPos[1],emDim,_T("EndLine"));
return TRUE;
@@ -1003,61 +998,61 @@
pSideData->m_nGlassEndLine = pSideData->m_nPreGlassEndLine;
pSideData->m_nGlassEndFrame = pSideData->m_nPreGlassEndFrame;
pSideData->m_bFindGlassEndLine = TRUE;
- delete [] pnSum;
+ delete[] pnSum;
- g_pLog->DisplayMessage(_T("%s EndLine Frame %d Fail"),PANEL_SIDE[emDim],stFrame.nFrameIdx);
+ g_pLog->DisplayMessage(_T("%s EndLine Frame %d Fail"), PANEL_SIDE[emDim], stFrame.nFrameIdx);
return FALSE;
}
-BOOL CInspectCamera::FindSideLine(int iThread,DimensionDir emDim,stFrameIndex stFrame)
+BOOL CInspectCamera::FindSideLine(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ if (pSideData == NULL)
{
g_pLog->DisplayMessage(_T("Side Line Find Fail - Glass Data or HW Setting Error"));
return FALSE;
}
- int nFindLine=-1;
+ int nFindLine = -1;
- int nThres = m_pRecipe->m_SideParam[(int)(emDim)].m_nSideLineThreshold;
- int nTopCornerSizeX_pxl = (int) GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeX_um);
- int nTopCornerSizeY_pxl = (int) GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeY_um);
- int nBotCornerSizeX_pxl = (int) GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeX_um);
- int nBotCornerSizeY_pxl = (int) GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeY_um);
+ int nThres = m_pRecipe->m_SideParam[(int)(emDim)].m_nSideLineThreshold;
+ int nTopCornerSizeX_pxl = (int)GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeX_um);
+ int nTopCornerSizeY_pxl = (int)GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeY_um);
+ int nBotCornerSizeX_pxl = (int)GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeX_um);
+ int nBotCornerSizeY_pxl = (int)GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeY_um);
// Make Region
CSISEdgeFind EdgeFind;
- const int nSearchHeight = 100;
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
+ const int nSearchHeight = 100;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
int nFrameYPos = stFrame.nFrameIdx * nFrameHeight;
- CRect rtROI = CRect(GetLeftMargin(m_iCamera,stFrame.nScanIdx),0,m_nFrameWidth-1,m_nFrameHeight);
+ CRect rtROI = CRect(GetLeftMargin(m_iCamera, stFrame.nScanIdx), 0, m_nFrameWidth - 1, m_nFrameHeight);
rtROI.OffsetRect(0, nFrameYPos);
- int nTopCorner_Bottom = pSideData->m_nGlassStartLine + nTopCornerSizeY_pxl;
- int nBotCorner_Top = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine - nBotCornerSizeY_pxl : pSideData->m_nPreGlassEndLine - nBotCornerSizeY_pxl;
+ int nTopCorner_Bottom = pSideData->m_nGlassStartLine + nTopCornerSizeY_pxl;
+ int nBotCorner_Top = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine - nBotCornerSizeY_pxl : pSideData->m_nPreGlassEndLine - nBotCornerSizeY_pxl;
int nTopCorner_Bottom_Frame = nTopCorner_Bottom / nFrameHeight;
int nBotCorner_Top_Frame = nBotCorner_Top / nFrameHeight;
int nYPos_pxl = 0;
- if(nTopCorner_Bottom_Frame == stFrame.nFrameIdx)
+ if (nTopCorner_Bottom_Frame == stFrame.nFrameIdx)
{
rtROI.top = (rtROI.top < nTopCorner_Bottom) ? nTopCorner_Bottom : rtROI.top;
nYPos_pxl = rtROI.top;
rtROI.OffsetRect(0, -nFrameYPos);
}
- else if(nBotCorner_Top_Frame == stFrame.nFrameIdx)
+ else if (nBotCorner_Top_Frame == stFrame.nFrameIdx)
{
rtROI.bottom = (nBotCorner_Top_Frame < rtROI.bottom) ? nBotCorner_Top : rtROI.bottom;
// Frame gap..
- if(rtROI.Height() < m_nFrameHeight/3)
+ if (rtROI.Height() < m_nFrameHeight / 3)
{
int nExtraArea = m_nFrameHeight - rtROI.Height();
int nOffSetY = nFrameYPos - nExtraArea;
@@ -1078,36 +1073,36 @@
rtROI.OffsetRect(0, -nFrameYPos);
}
- if(nSearchHeight < rtROI.Height())
+ if (nSearchHeight < rtROI.Height())
{
- rtROI.top = rtROI.CenterPoint().y - nSearchHeight/2;
+ rtROI.top = rtROI.CenterPoint().y - nSearchHeight / 2;
rtROI.bottom = rtROI.top + nSearchHeight;
}
- if(rtROI.left < 0) rtROI.left = 0;
- if(rtROI.right >= m_nFrameWidth) rtROI.right = m_nFrameWidth-1;
- if(rtROI.top < 0) rtROI.top = 0;
- if(rtROI.bottom >= m_nFrameHeight) rtROI.bottom = m_nFrameHeight-1;
+ if (rtROI.left < 0) rtROI.left = 0;
+ if (rtROI.right >= m_nFrameWidth) rtROI.right = m_nFrameWidth - 1;
+ if (rtROI.top < 0) rtROI.top = 0;
+ if (rtROI.bottom >= m_nFrameHeight) rtROI.bottom = m_nFrameHeight - 1;
// Find Side Line
#define DEFECT_EDGE_AUTO_RATIO 0.3
#define DEFECT_EDGE_AUTO_PITCH 20
#define DEFECT_EDGE_CONTINUE 3
- CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, nYPos_pxl),nFrameWidth,nFrameHeight);
- if(frameBuffer.IsValidBuffer() == FALSE)
+ CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, nYPos_pxl), nFrameWidth, nFrameHeight);
+ if (frameBuffer.IsValidBuffer() == FALSE)
return nFindLine;
-
- EdgeFind.FindEdge_ToRightROI(&frameBuffer,nFindLine,DEFECT_EDGE_AUTO_PITCH,nThres,DEFECT_EDGE_AUTO_RATIO,0,rtROI);
- if(nFindLine > 0 && nFindLine < frameBuffer.GetWidth())
+ EdgeFind.FindEdge_ToRightROI(&frameBuffer, nFindLine, DEFECT_EDGE_AUTO_PITCH, nThres, DEFECT_EDGE_AUTO_RATIO, 0, rtROI);
+
+ if (nFindLine > 0 && nFindLine < frameBuffer.GetWidth())
{
- m_iSideLine[stFrame.nScanIdx] = nFindLine;
+ m_iSideLine[stFrame.nScanIdx] = nFindLine;
pSideData->m_nSideLineFrame[stFrame.nFrameIdx] = nFindLine;
pSideData->m_nSideLinePosY[stFrame.nFrameIdx] = rtROI.CenterPoint().y + nFrameYPos;
- // Side 茫绊, Chamfer 茫绰芭 眠啊 鞘夸...
+ // Side 彀娟碃, Chamfer 彀倦姅瓯� 於旉皜 頃勳殧...
pSideData->m_nSide_Chamfer_LineFrame[stFrame.nFrameIdx] = nFindLine + 0;
g_pLog->DisplayMessage(_T("Find Side Line Frame[%d], Side[%d]"), stFrame.nFrameIdx, nFindLine);
@@ -1116,32 +1111,31 @@
return TRUE;
}
-BOOL CInspectCamera::FindSideLine_ExceptNotch(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindSideLine_ExceptNotch(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
- {
+ if (pSideData == NULL) {
g_pLog->DisplayMessage(_T("Side Line Find Fail - Glass Data or HW Setting Error"));
return FALSE;
}
- int nThres = m_pRecipe->m_SideParam[(int)(emDim)].m_nSideLineThreshold;
- int nTopCornerSizeX_pxl = (int) GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeX_um);
- int nTopCornerSizeY_pxl = (int) GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeY_um);
- int nBotCornerSizeX_pxl = (int) GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeX_um);
- int nBotCornerSizeY_pxl = (int) GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeY_um);
+ int nThres = m_pRecipe->m_SideParam[(int)(emDim)].m_nSideLineThreshold;
+ int nTopCornerSizeX_pxl = (int)GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeX_um);
+ int nTopCornerSizeY_pxl = (int)GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nTopCornerSizeY_um);
+ int nBotCornerSizeX_pxl = (int)GetUmToPixel_X(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeX_um);
+ int nBotCornerSizeY_pxl = (int)GetUmToPixel_Y(m_pRecipe->m_SideParam[(int)(emDim)].m_nBottomCornerSizeY_um);
// Make Region
CSISEdgeFind EdgeFind;
- const int nSearchHeight = 50;
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
+ const int nSearchHeight = 50;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
int nFrameYPos = stFrame.nFrameIdx * nFrameHeight;
- int nTopCorner_Bottom = pSideData->m_nGlassStartLine + nTopCornerSizeY_pxl;
- int nBotCorner_Top = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine - nBotCornerSizeY_pxl : pSideData->m_nPreGlassEndLine - nBotCornerSizeY_pxl;
+ int nTopCorner_Bottom = pSideData->m_nGlassStartLine + nTopCornerSizeY_pxl;
+ int nBotCorner_Top = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine - nBotCornerSizeY_pxl : pSideData->m_nPreGlassEndLine - nBotCornerSizeY_pxl;
int nTopCorner_Bottom_Frame = nTopCorner_Bottom / nFrameHeight;
int nBotCorner_Top_Frame = nBotCorner_Top / nFrameHeight;
@@ -1150,19 +1144,20 @@
CRect rtAllSide_pxl;
rtAllSide_pxl.left = 0;
rtAllSide_pxl.top = nTopCorner_Bottom;
- rtAllSide_pxl.right = nFrameWidth-1;
+ rtAllSide_pxl.right = nFrameWidth - 1;
rtAllSide_pxl.bottom = nBotCorner_Top;
// 2. Make Frame Area
- CRect rtFrame_pxl = CRect(GetLeftMargin(m_iCamera,stFrame.nScanIdx),0,m_nFrameWidth-1,m_nFrameHeight);
+ CRect rtFrame_pxl = CRect(GetLeftMargin(m_iCamera, stFrame.nScanIdx), 0, m_nFrameWidth - 1, m_nFrameHeight);
rtFrame_pxl.OffsetRect(0, nFrameYPos);
// 3. Make Find Side Line Area.
CRect rtROI;
rtROI.IntersectRect(rtFrame_pxl, rtAllSide_pxl);
- if(rtROI.IsRectEmpty() || rtROI.IsRectNull())
+ if (rtROI.IsRectEmpty() || rtROI.IsRectNull()) {
return FALSE;
+ }
// 4. Exception Notch Area...
std::vector<CRect> vectorInspectAreaList_New;
@@ -1176,40 +1171,36 @@
std::vector<CRect> vecInspectArea;
- for(int i=0; i<nNotchCount; i++)
- {
+ for (int i = 0; i < nNotchCount; i++) {
CRect rtNotchArea = pSideData->m_rtNotchArea_pxl[i];
- rtNotchArea.left = GetLeftMargin(m_iCamera,stFrame.nScanIdx);
- rtNotchArea.right = m_nFrameWidth-1;
+ rtNotchArea.left = GetLeftMargin(m_iCamera, stFrame.nScanIdx);
+ rtNotchArea.right = m_nFrameWidth - 1;
vectorInspectAreaList_Old.resize(vectorInspectAreaList_New.size());
- std::copy(vectorInspectAreaList_New.begin(), vectorInspectAreaList_New.end(), vectorInspectAreaList_Old.begin());
+ std::copy(vectorInspectAreaList_New.begin(), vectorInspectAreaList_New.end(), vectorInspectAreaList_Old.begin());
vectorInspectAreaList_New.clear();
- for(int j=0; j<vectorInspectAreaList_Old.size(); j++)
- {
+ for (int j = 0; j < vectorInspectAreaList_Old.size(); j++) {
CRect rtTemp = vectorInspectAreaList_Old[j];
CRect rtNotchInterSectRect;
- rtNotchInterSectRect.IntersectRect(rtTemp, rtNotchArea);
+ rtNotchInterSectRect.IntersectRect(rtTemp, rtNotchArea);
- if(rtNotchInterSectRect.IsRectEmpty() || rtNotchInterSectRect.IsRectNull()) // 畴摹啊 救吧府绰 版快俊绰 促矫 持绢霖促..
- {
+ if (rtNotchInterSectRect.IsRectEmpty() || rtNotchInterSectRect.IsRectNull()) {
vectorInspectAreaList_New.push_back(rtTemp);
continue;
}
- if(rtTemp.Height() == rtNotchInterSectRect.Height()) // Notch啊 康开狼 傈眉牢 版快
+ if (rtTemp.Height() == rtNotchInterSectRect.Height()) {
continue;
+ }
- if(rtTemp.top == rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 1. Notch Frame 困俊 吧赴 版快
- {
+ if (rtTemp.top == rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) {
CRect rtNew = rtTemp;
rtNew.top = rtNotchInterSectRect.bottom;
vectorInspectAreaList_New.push_back(rtNew);
}
- else if(rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 2. Notch Frame 吝埃俊 吧赴 版快
- {
+ else if (rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) {
CRect rtNewTop = rtTemp;
rtNewTop.top = rtNotchInterSectRect.bottom;
vectorInspectAreaList_New.push_back(rtNewTop);
@@ -1218,8 +1209,7 @@
rtNewBot.bottom = rtNotchInterSectRect.top;
vectorInspectAreaList_New.push_back(rtNewBot);
}
- else if(rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom == rtTemp.bottom) // 3. Notch Frame 酒贰俊 吧赴 版快
- {
+ else if (rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom == rtTemp.bottom) {
CRect rtNew = rtTemp;
rtNew.bottom = rtNotchInterSectRect.top;
vectorInspectAreaList_New.push_back(rtNew);
@@ -1227,12 +1217,9 @@
}
}
-
// 5. Side List..
vecInspectArea.clear();
-
- for(int i=0; i<vectorInspectAreaList_New.size(); i++)
- {
+ for (int i = 0; i < vectorInspectAreaList_New.size(); i++) {
CRect rtInspectArea = vectorInspectAreaList_New[i];
vecInspectArea.push_back(rtInspectArea);
}
@@ -1241,25 +1228,24 @@
#define DEFECT_EDGE_AUTO_RATIO 0.3
#define DEFECT_EDGE_AUTO_PITCH 20
#define DEFECT_EDGE_CONTINUE 3
-
+
int nFindSideLineSum = 0;
- int nFindSideLineCount = 0;
+ int nFindSideLineCount = 0;
int nFindSideChamferLineSum = 0;
int nFindSideChamferLineCount = 0;
- int nChamferLineThres = m_pRecipe->m_SideParam[(int) emDim].m_nChamferLineThreshold;
+ int nChamferLineThres = m_pRecipe->m_SideParam[(int)emDim].m_nChamferLineThreshold;
#if HALCON_VISION_KEY
- CBlSideData *pBlSideData = BlVision_GetVisionRecipe()->getSideData(emDim);
+ CBlSideData* pBlSideData = BlVision_GetVisionRecipe()->getSideData(emDim);
#endif
int stepSide = m_pGrabber->GetFrameBuffer()->GetFrameHeight();
+ for (int i = 0; i < vecInspectArea.size(); i++) {
+ CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, vecInspectArea[i].top), nFrameWidth, vecInspectArea[i].Height());
- for(int i=0; i<vecInspectArea.size(); i++)
- {
- CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, vecInspectArea[i].top),nFrameWidth,vecInspectArea[i].Height());
-
- if(frameBuffer.IsValidBuffer() == FALSE)
+ if (frameBuffer.IsValidBuffer() == FALSE) {
continue;
+ }
#ifdef _DEBUG
CString str;
@@ -1271,20 +1257,18 @@
CRect rtFindROI = vecInspectArea[i];
rtFindROI.OffsetRect(0, -rtFindROI.top);
- if(nSearchHeight < rtFindROI.Height())
- {
+ if (nSearchHeight < rtFindROI.Height()) {
CPoint ptCenter = rtFindROI.CenterPoint();
- rtFindROI.top = ptCenter.y - (nSearchHeight/2);
- rtFindROI.bottom = ptCenter.y + (nSearchHeight/2);
+ rtFindROI.top = ptCenter.y - (nSearchHeight / 2);
+ rtFindROI.bottom = ptCenter.y + (nSearchHeight / 2);
}
-
- int nSideLine = -1;
- EdgeFind.FindEdge_ToRightROI(&frameBuffer,nSideLine,DEFECT_EDGE_AUTO_PITCH,nThres,DEFECT_EDGE_AUTO_RATIO,0,rtFindROI);
- if(nSideLine != -1)
- {
+ int nSideLine = -1;
+ EdgeFind.FindEdge_ToRightROI(&frameBuffer, nSideLine, DEFECT_EDGE_AUTO_PITCH, nThres, DEFECT_EDGE_AUTO_RATIO, 0, rtFindROI);
+
+ if (nSideLine != -1) {
#if HALCON_VISION_KEY
- if (NULL != pBlSideData){
+ if (NULL != pBlSideData) {
SideLineInf inf;
inf.left = 0;
inf.top = vecInspectArea[i].top;
@@ -1295,7 +1279,7 @@
int idx = (int)(vecInspectArea[i].top / stepSide);
pBlSideData->m_mapSideLineInf[idx] = inf;
- //打印边界数据
+ //雽斾腹旮嬱嵐閼掛暣
//Log_GetDebug()->TraceInfo("Find Side Line %d: %d, %d, (%d, %d, %d, %d), %d",
// idx,
// inf.nSideLine, inf.nThres,
@@ -1310,87 +1294,88 @@
CChamferInspect chamferIns;
double dLine = -1;
- COwnerBuffer ImgInsBin;
- chamferIns.Binarization(frameBuffer,ImgInsBin,nChamferLineThres);
+ COwnerBuffer ImgInsBin;
+ chamferIns.Binarization(frameBuffer, ImgInsBin, nChamferLineThres);
- chamferIns.FindRightLine_Bin(ImgInsBin,nSideLine,dLine);
- if(dLine != -1)
- {
+ chamferIns.FindRightLine_Bin(ImgInsBin, nSideLine, dLine);
+ if (dLine != -1) {
nFindSideChamferLineSum += (int)dLine;
nFindSideChamferLineCount++;
}
}
}
- if(nFindSideLineCount > 0)
- {
- int nAvgSideLine = (int) (nFindSideLineSum / nFindSideLineCount); // Average..
+ if (nFindSideLineCount > 0) {
+ int nAvgSideLine = (int)(nFindSideLineSum / nFindSideLineCount);
m_iSideLine[stFrame.nScanIdx] = nAvgSideLine;
- pSideData->m_nSideLineFrame[stFrame.nFrameIdx] = nAvgSideLine;
+ pSideData->m_nSideLineFrame[stFrame.nFrameIdx] = nAvgSideLine;
pSideData->m_nSideLinePosY[stFrame.nFrameIdx] = rtROI.CenterPoint().y + nFrameYPos;
}
- if(nFindSideChamferLineCount > 0)
- {
- int nAvgChamferLine = (int) (nFindSideChamferLineSum / nFindSideChamferLineCount); // Average..
- pSideData->m_nSide_Chamfer_LineFrame[stFrame.nFrameIdx] = nAvgChamferLine; // Chamfer Line
+ if (nFindSideChamferLineCount > 0) {
+ int nAvgChamferLine = (int)(nFindSideChamferLineSum / nFindSideChamferLineCount); // Average..
+ pSideData->m_nSide_Chamfer_LineFrame[stFrame.nFrameIdx] = nAvgChamferLine; // Chamfer Line
}
return TRUE;
}
-BOOL CInspectCamera::FindTopCorner(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopCorner(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
CSingleLock localLock(&m_csTopCorner);
localLock.Lock();
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
- return FALSE;
-
- if(pSideData->m_bFindGlassStartLine == FALSE)
+ if (pSideData == NULL || pSideParam == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- if(pSideData->m_bTopCorner_Find == TRUE)
+ if (pSideData->m_bFindGlassStartLine == FALSE) {
+ localLock.Unlock();
+ return FALSE;
+ }
+
+ if (pSideData->m_bTopCorner_Find == TRUE) {
+ localLock.Unlock();
return TRUE;
+ }
- /*
- BOOL bTopCornerUse = (BOOL) (m_pRecipe->m_SideParam[emDim].m_nTopCornerShape == 0) ? FALSE : TRUE;
-
- // Not Use Corner Inspection
- if(bTopCornerUse == FALSE)
+ BOOL bTopCornerUse = (BOOL)(m_pRecipe->m_SideParam[emDim].m_nTopCornerShape == 0) ? FALSE : TRUE;
+ if (bTopCornerUse == FALSE) {
+ localLock.Unlock();
return FALSE;
- */
+ }
- double dCornerSizeY_Um = (double) m_pRecipe->m_SideParam[emDim].m_nTopCornerSizeY_um;
-
- int nCornerSizeY_Pixel = (int) GetUmToPixel_Y(dCornerSizeY_Um);
-
- int nFrameHeight = m_nFrameHeight;
-
- int nFindStartLine = pSideData->m_nGlassStartLine;
-
+ double dCornerSizeY_Um = (double)m_pRecipe->m_SideParam[emDim].m_nTopCornerSizeY_um;
+ int nCornerSizeY_Pixel = (int)GetUmToPixel_Y(dCornerSizeY_Um);
+ int nFrameHeight = m_nFrameHeight;
+ int nFindStartLine = pSideData->m_nGlassStartLine;
int nTopCornerFrameIndex = (nFindStartLine + nCornerSizeY_Pixel) / nFrameHeight;
- if(stFrame.nFrameIdx < nTopCornerFrameIndex+1)
+ if (stFrame.nFrameIdx < nTopCornerFrameIndex + 1) {
+ localLock.Unlock();
return FALSE;
+ }
- int nSideLine = pSideData->m_nSideLineFrame[nTopCornerFrameIndex+1];
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nTopCornerFrameIndex + 1];
- if(nSideLine == -1)
+ if (nSideLine == -1) {
+ localLock.Unlock();
return FALSE;
+ }
- double dCornerSizeX_Um = (double) m_pRecipe->m_SideParam[emDim].m_nTopCornerSizeX_um;
-
- int nCornerSizeX_Pixel = (int) GetUmToPixel_X(dCornerSizeX_Um);
+ double dCornerSizeX_Um = (double)m_pRecipe->m_SideParam[emDim].m_nTopCornerSizeX_um;
+ int nCornerSizeX_Pixel = (int)GetUmToPixel_X(dCornerSizeX_Um);
CRect rtTopCornerArea(0, 0, nCornerSizeX_Pixel, nCornerSizeY_Pixel);
-
rtTopCornerArea.OffsetRect(nSideLine, nFindStartLine);
pSideData->m_bTopCorner_Find = TRUE;
@@ -1399,11 +1384,15 @@
int nTopCornerType = m_pRecipe->m_SideParam[emDim].m_nTopCornerShape;
pSideData->m_nTopCornerShape = m_pRecipe->m_SideParam[emDim].m_nTopCornerShape;;
- if(pSideParam->m_bTopCornerFindDefect == FALSE)
+ if (pSideParam->m_bTopCornerFindDefect == FALSE) {
+ localLock.Unlock();
return FALSE;
+ }
- if(nTopCornerType == (int) 1) return FindTopCorner_CCut(iThread, emDim, stFrame);
- else if(nTopCornerType == (int) 2) return FindTopCorner_RCut(iThread, emDim, stFrame);
+ localLock.Unlock();
+
+ if (nTopCornerType == (int)1) return FindTopCorner_CCut(iThread, emDim, stFrame);
+ else if (nTopCornerType == (int)2) return FindTopCorner_RCut(iThread, emDim, stFrame);
else return FindTopCorner_None(iThread, emDim, stFrame);
return TRUE;
@@ -1411,21 +1400,21 @@
BOOL CInspectCamera::FindTopCorner_None(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtTopCornerArea = pSideData->m_rtTopCornerArea;
rtTopCornerArea.right = rtTopCornerArea.left + ALIGN_4BYTE(rtTopCornerArea.Width());
- if(rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
+ if (rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtTopCornerArea.Width(), rtTopCornerArea.Height());
@@ -1439,7 +1428,7 @@
int nMinSize = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Min_Size;
- int nDilation = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Defect_Size_Dilation;
+ int nDilation = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Defect_Size_Dilation;
// For Draw..
pSideData->m_rtTopCornerArea_Offset = rtTopCornerArea;
@@ -1458,7 +1447,7 @@
int nImageX = nInsStart;
int nImageY = i;
- if (nImageX < 0 ||rtTopCornerArea.Width() <= nImageX || nImageY < 0 || rtTopCornerArea.Height() <= nImageY)
+ if (nImageX < 0 || rtTopCornerArea.Width() <= nImageX || nImageY < 0 || rtTopCornerArea.Height() <= nImageY)
continue;
int nRange = (rtTopCornerArea.Width() <= nImageX + nInsRange) ? (rtTopCornerArea.Width() - 1 - nImageX) : nInsRange;
@@ -1504,23 +1493,23 @@
return TRUE;
}
-BOOL CInspectCamera::FindTopCorner_CCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopCorner_CCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtTopCornerArea = pSideData->m_rtTopCornerArea;
rtTopCornerArea.right = rtTopCornerArea.left + ALIGN_4BYTE(rtTopCornerArea.Width());
- if(rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
+ if (rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtTopCornerArea.Width(), rtTopCornerArea.Height());
@@ -1534,7 +1523,7 @@
int nMinSize = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Min_Size;
- int nDilation = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Defect_Size_Dilation;
+ int nDilation = m_pRecipe->m_SideParam[emDim].m_nTopCornerIns_Defect_Size_Dilation;
// For Draw..
pSideData->m_rtTopCornerArea_Offset = rtTopCornerArea;
@@ -1554,18 +1543,18 @@
for (int i = 0; i < rtTopCornerArea.Width(); i++)
{
int nX = rtTopCornerArea.Width() - 1 - i;
- int nY = (int) (((double)i * dScaleY) + nInsStart);
+ int nY = (int)(((double)i * dScaleY) + nInsStart);
- if (nX < 0 ||rtTopCornerArea.Width() <= nX || nY < 0 || rtTopCornerArea.Height() <= nY)
+ if (nX < 0 || rtTopCornerArea.Width() <= nX || nY < 0 || rtTopCornerArea.Height() <= nY)
continue;
int nRange = (rtTopCornerArea.Height() <= nY + nInsRange) ? (rtTopCornerArea.Height() - 1 - nY) : nInsRange;
- if(nRange == 0)
+ if (nRange == 0)
continue;
- for(int j=0; j<nRange; j++)
- pMaskBuffer.SetPixel(nX, nY+j, 255);
+ for (int j = 0; j < nRange; j++)
+ pMaskBuffer.SetPixel(nX, nY + j, 255);
/*
int nRange = (rtTopCornerArea.Width() <= nX + nInsRange) ? (rtTopCornerArea.Width() - 1 - nX) : nInsRange;
@@ -1615,23 +1604,23 @@
return TRUE;
}
-BOOL CInspectCamera::FindTopCorner_RCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopCorner_RCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtTopCornerArea = pSideData->m_rtTopCornerArea;
rtTopCornerArea.right = rtTopCornerArea.left + ALIGN_4BYTE(rtTopCornerArea.Width());
- if(rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
+ if (rtTopCornerArea.IsRectEmpty() || rtTopCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtTopCornerArea.Width(), rtTopCornerArea.Height());
@@ -1710,78 +1699,91 @@
return TRUE;
}
-BOOL CInspectCamera::FindTopAlignMark(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopAlignMark(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
CSingleLock localLock(&m_csThreadTopAlignMark);
localLock.Lock();
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
-
- if(pSideData == NULL)
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ if (pSideData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- if(pSideData->m_bFindGlassStartLine == FALSE)
+ if (pSideData->m_bFindGlassStartLine == FALSE) {
+ localLock.Unlock();
return FALSE;
+ }
- if(pSideData->m_bTopMark_Find == TRUE)
+ if (pSideData->m_bTopMark_Find == TRUE) {
+ localLock.Unlock();
return TRUE;
+ }
- if(pSideData->m_bTopCorner_Find == FALSE)
- return FALSE;
+ if (pSideData->m_bTopCorner_Find == FALSE) {
+ localLock.Unlock();
+ return FALSE;
+ }
- BOOL bTopAlignMark = (BOOL) (m_pRecipe->m_SideParam[eDim].m_bTopMark_Use == 1) ? TRUE : FALSE;
-
- if(bTopAlignMark == FALSE)
+ BOOL bTopAlignMark = (BOOL)(m_pRecipe->m_SideParam[eDim].m_bTopMark_Use == 1) ? TRUE : FALSE;
+ if (bTopAlignMark == FALSE) {
+ localLock.Unlock();
return FindTopAlignMark_Virtual(iThread, eDim, stFrame);
- else
- {
- if(FindTopAlignMark_TempleteMatching(iThread, eDim, stFrame) == FALSE)
+ }
+ else {
+ if (FindTopAlignMark_TempleteMatching(iThread, eDim, stFrame) == FALSE) {
+ localLock.Unlock();
return FindTopAlignMark_Virtual(iThread, eDim, stFrame);
- else
+ }
+ else {
+ localLock.Unlock();
return TRUE;
+ }
}
}
-BOOL CInspectCamera::FindTopAlignMark_Virtual(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopAlignMark_Virtual(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassStartLine == FALSE)
+ if (pSideData->m_bFindGlassStartLine == FALSE)
return FALSE;
- if(pSideData->m_bTopMark_Find == TRUE)
+ if (pSideData->m_bTopMark_Find == TRUE)
return TRUE;
- if(pSideData->m_bTopCorner_Find == FALSE)
- return FALSE;
-
- // 1. Make ROI
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
-
- int nStartLine = pSideData->m_nGlassStartLine;
- double dEdgeToTopAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeY_um;
- int nEdgeToTopAlignMarkY_Pixel = (int) GetUmToPixel_Y(dEdgeToTopAlignMarkY_Um);
- int nTopAlignMarkY_Pixel = nStartLine + nEdgeToTopAlignMarkY_Pixel;
-
- int nTopAlignMarkYPramIdx = nTopAlignMarkY_Pixel / nFrameHeight;
- if((int) stFrame.nFrameIdx < nTopAlignMarkYPramIdx + 1)
+ if (pSideData->m_bTopCorner_Find == FALSE)
return FALSE;
- int nSideLine = pSideData->m_nSideLineFrame[nTopAlignMarkYPramIdx + 1];
- double nEdgeToTopAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeX_um;
- int nEdgeToTopAlignMarkX_Pixel = (int) GetUmToPixel_X(nEdgeToTopAlignMarkX_Um);
- int nTopAlignMarkX_Pixel = nSideLine + nEdgeToTopAlignMarkX_Pixel;
-
+ // 1. Make ROI
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
+
+ int nStartLine = pSideData->m_nGlassStartLine;
+ double dEdgeToTopAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeY_um;
+ int nEdgeToTopAlignMarkY_Pixel = (int)GetUmToPixel_Y(dEdgeToTopAlignMarkY_Um);
+ int nTopAlignMarkY_Pixel = nStartLine + nEdgeToTopAlignMarkY_Pixel;
+
+ int nTopAlignMarkYPramIdx = nTopAlignMarkY_Pixel / nFrameHeight;
+ if ((int)stFrame.nFrameIdx < nTopAlignMarkYPramIdx + 1)
+ return FALSE;
+
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nTopAlignMarkYPramIdx + 1];
+ double nEdgeToTopAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeX_um;
+ int nEdgeToTopAlignMarkX_Pixel = (int)GetUmToPixel_X(nEdgeToTopAlignMarkX_Um);
+ int nTopAlignMarkX_Pixel = nSideLine + nEdgeToTopAlignMarkX_Pixel;
+
CRect rtSearchArea = CRect(nTopAlignMarkX_Pixel, nTopAlignMarkY_Pixel, nTopAlignMarkX_Pixel, nTopAlignMarkY_Pixel);
rtSearchArea.InflateRect(50, 50);
@@ -1792,67 +1794,67 @@
return TRUE;
}
-BOOL CInspectCamera::FindTopAlignMark_TempleteMatching(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindTopAlignMark_TempleteMatching(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassStartLine == FALSE)
+ if (pSideData->m_bFindGlassStartLine == FALSE)
return FALSE;
- if(pSideData->m_bTopMark_Find == TRUE)
+ if (pSideData->m_bTopMark_Find == TRUE)
return TRUE;
- if(pSideData->m_bTopCorner_Find == FALSE)
- return FALSE;
+ if (pSideData->m_bTopCorner_Find == FALSE)
+ return FALSE;
// 1. Make ROI
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
- int nStartLine = pSideData->m_nGlassStartLine;
- double dEdgeToTopAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeY_um;
- int nEdgeToTopAlignMarkY_Pixel = (int) GetUmToPixel_Y(dEdgeToTopAlignMarkY_Um);
- int nTopAlignMarkY_Pixel = nStartLine + nEdgeToTopAlignMarkY_Pixel;
- int nTopAlignMarkYPramIdx = nTopAlignMarkY_Pixel / nFrameHeight;
+ int nStartLine = pSideData->m_nGlassStartLine;
+ double dEdgeToTopAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeY_um;
+ int nEdgeToTopAlignMarkY_Pixel = (int)GetUmToPixel_Y(dEdgeToTopAlignMarkY_Um);
+ int nTopAlignMarkY_Pixel = nStartLine + nEdgeToTopAlignMarkY_Pixel;
+ int nTopAlignMarkYPramIdx = nTopAlignMarkY_Pixel / nFrameHeight;
- if((int) stFrame.nFrameIdx < nTopAlignMarkYPramIdx + 1)
- return FALSE;
+ if ((int)stFrame.nFrameIdx < nTopAlignMarkYPramIdx + 1)
+ return FALSE;
- int nSideLine = pSideData->m_nSideLineFrame[nTopAlignMarkYPramIdx + 1];
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nTopAlignMarkYPramIdx + 1];
- if(nSideLine <= 0)
+ if (nSideLine <= 0)
{
- CRect rectSide = CRect(0,nTopAlignMarkY_Pixel,nFrameWidth-1,nTopAlignMarkY_Pixel);
+ CRect rectSide = CRect(0, nTopAlignMarkY_Pixel, nFrameWidth - 1, nTopAlignMarkY_Pixel);
- rectSide.InflateRect(0,30);
+ rectSide.InflateRect(0, 30);
- CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rectSide.top),nFrameWidth,rectSide.Height());
+ CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rectSide.top), nFrameWidth, rectSide.Height());
- if(frameBuffer.IsValidBuffer() == FALSE)
+ if (frameBuffer.IsValidBuffer() == FALSE)
return FALSE;
rectSide.OffsetRect(0, -rectSide.top);
- int nThres = m_pRecipe->m_SideParam[(int)(eDim)].m_nSideLineThreshold;
+ int nThres = m_pRecipe->m_SideParam[(int)(eDim)].m_nSideLineThreshold;
CSISEdgeFind EdgeFind;
- EdgeFind.FindEdge_ToRightROI(&frameBuffer,nSideLine,DEFECT_EDGE_AUTO_PITCH,nThres,DEFECT_EDGE_AUTO_RATIO,0,rectSide);
+ EdgeFind.FindEdge_ToRightROI(&frameBuffer, nSideLine, DEFECT_EDGE_AUTO_PITCH, nThres, DEFECT_EDGE_AUTO_RATIO, 0, rectSide);
}
- if(nSideLine <= 0)
+ if (nSideLine <= 0)
return FALSE;
- double nEdgeToTopAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeX_um;
- int nEdgeToTopAlignMarkX_Pixel = (int) GetUmToPixel_X(nEdgeToTopAlignMarkX_Um);
- int nTopAlignMarkX_Pixel = nSideLine + nEdgeToTopAlignMarkX_Pixel;
+ double nEdgeToTopAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nTopMarkToEdgeX_um;
+ int nEdgeToTopAlignMarkX_Pixel = (int)GetUmToPixel_X(nEdgeToTopAlignMarkX_Um);
+ int nTopAlignMarkX_Pixel = nSideLine + nEdgeToTopAlignMarkX_Pixel;
- double dTarget_Rate = m_pRecipe->m_SideParam[(int) eDim].m_dTopMarkTemplateMatchingRate / 100.0;
+ double dTarget_Rate = m_pRecipe->m_SideParam[(int)eDim].m_dTopMarkTemplateMatchingRate / 100.0;
CvPoint ptMax_Point;
double dMat_Max_Rate;
@@ -1921,75 +1923,80 @@
// Make Mark Defect..
CDefect_Info defectInfo;
- defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = stFrame.nScanIdx;
- defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) eDim;
- defectInfo.m_ptDefectPos_pxl = pSideData->m_rtTopMark_SearchArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = pSideData->m_rtTopMark_SearchArea;
- defectInfo.m_DefectLoc = DefectLoc_Mark;
+ defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = stFrame.nScanIdx;
+ defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)eDim;
+ defectInfo.m_ptDefectPos_pxl = pSideData->m_rtTopMark_SearchArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = pSideData->m_rtTopMark_SearchArea;
+ defectInfo.m_DefectLoc = DefectLoc_Mark;
m_pDefectControl->ExtractDefect_Mark(eDim, m_iCamera, stFrame.nScanIdx, defectInfo);
return FALSE;
}
-BOOL CInspectCamera::FindBotCorner(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotCorner(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
CSingleLock localLock(&m_csBotCorner);
localLock.Lock();
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- if (pSideData->m_bFindGlassStartLine == FALSE || pSideData->m_bFindGlassEndLine == FALSE)
+ if (pSideData->m_bFindGlassStartLine == FALSE || pSideData->m_bFindGlassEndLine == FALSE) {
+ localLock.Unlock();
return FALSE;
+ }
- if(pSideData->m_bBotCorner_Find == TRUE)
+ if (pSideData->m_bBotCorner_Find == TRUE) {
+ localLock.Unlock();
return TRUE;
+ }
- /*
- BOOL bBotCornerUse = (BOOL) (m_pRecipe->m_SideParam[emDim].m_nBottomCornerShape == 0) ? FALSE : TRUE;
-
- if(bBotCornerUse == FALSE)
+ BOOL bBotCornerUse = (BOOL)(m_pRecipe->m_SideParam[emDim].m_nBottomCornerShape == 0) ? FALSE : TRUE;
+ if (bBotCornerUse == FALSE) {
+ localLock.Unlock();
return FALSE;
- */
+ }
- double dCornerSizeY_Um = (double) m_pRecipe->m_SideParam[emDim].m_nBottomCornerSizeY_um;
-
- int nCornerSizeY_Pixel = (int) GetUmToPixel_Y(dCornerSizeY_Um);
-
- int nFrameHeight = m_nFrameHeight;
-
- int nFindBottomLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
-
+ double dCornerSizeY_Um = (double)m_pRecipe->m_SideParam[emDim].m_nBottomCornerSizeY_um;
+ int nCornerSizeY_Pixel = (int)GetUmToPixel_Y(dCornerSizeY_Um);
+ int nFrameHeight = m_nFrameHeight;
+ int nFindBottomLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
int nBottomCornerFrameIndex = (nFindBottomLine - nCornerSizeY_Pixel) / nFrameHeight;
- if((int) stFrame.nFrameIdx < nBottomCornerFrameIndex)
+ if ((int)stFrame.nFrameIdx < nBottomCornerFrameIndex) {
+ localLock.Unlock();
return FALSE;
+ }
- // 澜.. 内呈 Side 扼牢捞 捞傈 橇饭烙俊 乐栏搁 绢录瘤.. 茄搁俊 Thread 啊 咯矾俺 倒搁?... 困 橇饭烙狼 Thread 啊 酒流 Side 扼牢阑 给茫疽栏搁.. 绊刮 粱 秦焊磊..
- // 荤捞靛喊 Thread绰 窍唱父 倒绊 八荤 Thread甫 咯矾俺 倒府绰 备炼肺 官层具摆促
- int nSideLine = pSideData->m_nSideLineFrame[nBottomCornerFrameIndex];
- nSideLine = (nSideLine == -1) ? pSideData->m_nSideLineFrame[nBottomCornerFrameIndex] : nSideLine;
+ // 鞚�.. 旖旊剤 Side 霛检澑鞚� 鞚挫爠 頂勲爤鞛勳棎 鞛堨溂氅� 鞏挫歆�.. 頃滊┐鞐� Thread 臧� 鞐煬臧� 霃岆┐?... 鞙� 頂勲爤鞛勳潣 Thread 臧� 鞎勳 Side 霛检澑鞚� 氇混熬鞎橃溂氅�.. 瓿犽 膦� 頃措炒鞛�..
+ // 靷澊霌滊硠 Thread電� 頃橂倶毵� 霃岅碃 瓴�靷� Thread毳� 鞐煬臧� 霃岆Μ電� 甑“搿� 氚旉繑鞎缄矤雼�
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nBottomCornerFrameIndex];
+ nSideLine = (nSideLine == -1) ? (int)pSideData->m_nSideLineFrame[nBottomCornerFrameIndex] : nSideLine;
- if(nSideLine == -1)
+ if (nSideLine == -1) {
+ localLock.Unlock();
return FALSE;
+ }
- double dCornerSizeX_Um = (double) m_pRecipe->m_SideParam[emDim].m_nBottomCornerSizeX_um;
-
- int nCornerSizeX_Pixel = (int) GetUmToPixel_X(dCornerSizeX_Um);
+ double dCornerSizeX_Um = (double)m_pRecipe->m_SideParam[emDim].m_nBottomCornerSizeX_um;
+ int nCornerSizeX_Pixel = (int)GetUmToPixel_X(dCornerSizeX_Um);
CRect rtBottomCornerArea(0, 0, nCornerSizeX_Pixel, nCornerSizeY_Pixel);
-
- rtBottomCornerArea.OffsetRect(nSideLine, nFindBottomLine-nCornerSizeY_Pixel);
+ rtBottomCornerArea.OffsetRect(nSideLine, nFindBottomLine - nCornerSizeY_Pixel);
pSideData->m_bBotCorner_Find = TRUE;
pSideData->m_rtBotCornerArea = rtBottomCornerArea;
@@ -1999,33 +2006,37 @@
int nBottomCornerType = m_pRecipe->m_SideParam[emDim].m_nBottomCornerShape;
- if(pSideParam->m_bBottomCornerFindDefect == FALSE)
+ if (pSideParam->m_bBottomCornerFindDefect == FALSE) {
+ localLock.Unlock();
return FALSE;
+ }
- if(nBottomCornerType == (int) 1) return FindBotCorner_CCut(iThread, emDim, stFrame);
- else if(nBottomCornerType == (int) 2) return FindBotCorner_RCut(iThread, emDim, stFrame);
+ localLock.Unlock();
+
+ if (nBottomCornerType == (int)1) return FindBotCorner_CCut(iThread, emDim, stFrame);
+ else if (nBottomCornerType == (int)2) return FindBotCorner_RCut(iThread, emDim, stFrame);
else return FindBotCorner_None(iThread, emDim, stFrame);
return TRUE;
}
-BOOL CInspectCamera::FindBotCorner_None(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotCorner_None(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtBotCornerArea = pSideData->m_rtBotCornerArea;
rtBotCornerArea.right = rtBotCornerArea.left + ALIGN_4BYTE(rtBotCornerArea.Width());
- if(rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
+ if (rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtBotCornerArea.Width(), rtBotCornerArea.Height());
@@ -2058,7 +2069,7 @@
int nImageX = nInsStart;
int nImageY = rtBotCornerArea.Height() - 1 - i;
- if (nImageX < 0 ||rtBotCornerArea.Width() <= nImageX || nImageY < 0 || rtBotCornerArea.Height() <= nImageY)
+ if (nImageX < 0 || rtBotCornerArea.Width() <= nImageX || nImageY < 0 || rtBotCornerArea.Height() <= nImageY)
continue;
int nRange = (rtBotCornerArea.Width() <= nImageX + nInsRange) ? (rtBotCornerArea.Width() - 1 - nImageX) : nInsRange;
@@ -2105,23 +2116,23 @@
return TRUE;
}
-BOOL CInspectCamera::FindBotCorner_CCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotCorner_CCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtBotCornerArea = pSideData->m_rtBotCornerArea;
rtBotCornerArea.right = rtBotCornerArea.left + ALIGN_4BYTE(rtBotCornerArea.Width());
- if(rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
+ if (rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtBotCornerArea.Width(), rtBotCornerArea.Height());
@@ -2145,7 +2156,7 @@
pSideData->m_rtBotCornerArea_Ins.bottom = pSideData->m_rtBotCornerArea_Offset.bottom - nInsRange;
pSideData->m_rtBotCornerArea_Ins.top = pSideData->m_rtBotCornerArea_Offset.top - nInsRange;
- double dScaleY = (double) rtBotCornerArea.Height() / (double)rtBotCornerArea.Width();
+ double dScaleY = (double)rtBotCornerArea.Height() / (double)rtBotCornerArea.Width();
// 2. Make Masking..
COwnerBuffer pMaskBuffer(rtBotCornerArea.Width(), rtBotCornerArea.Height());
@@ -2154,18 +2165,18 @@
for (int i = 0; i < pMaskBuffer.GetWidth(); i++)
{
int nX = i;
- int nY = (int) ((double)i * dScaleY) - nInsStart;
+ int nY = (int)((double)i * dScaleY) - nInsStart;
if (nX < 0 || pMaskBuffer.GetWidth() <= nX || nY < 0 || pMaskBuffer.GetHeight() <= nY)
continue;
int nRange = (nY - nInsRange < 0) ? nY : nInsRange;
- if(nRange == 0)
+ if (nRange == 0)
continue;
- for(int j=0; j<nRange; j++)
- pMaskBuffer.SetPixel(nX, nY-j, 255);
+ for (int j = 0; j < nRange; j++)
+ pMaskBuffer.SetPixel(nX, nY - j, 255);
}
// 3. Processing
@@ -2206,23 +2217,23 @@
return TRUE;
}
-BOOL CInspectCamera::FindBotCorner_RCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotCorner_RCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == FALSE)
+ if (pSideData == FALSE)
return FALSE;
CRect rtBotCornerArea = pSideData->m_rtBotCornerArea;
rtBotCornerArea.right = rtBotCornerArea.left + ALIGN_4BYTE(rtBotCornerArea.Width());
- if(rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
+ if (rtBotCornerArea.IsRectEmpty() || rtBotCornerArea.IsRectNull())
return FALSE;
- int nFrameWidth = m_nFrameWidth;
+ int nFrameWidth = m_nFrameWidth;
// 1. Inspect ROI
COwnerBuffer pBuffer(rtBotCornerArea.Width(), rtBotCornerArea.Height());
@@ -2301,75 +2312,88 @@
return TRUE;
}
-BOOL CInspectCamera::FindBotAlignMark(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotAlignMark(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
CSingleLock localLock(&m_csThreadBotAlignMark);
localLock.Lock();
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL) {
+ localLock.Unlock();
return FALSE;
+ }
- //if(pSideData->m_bBotCorner_Find == FALSE)
- // return FALSE;
+ if (pSideData->m_bBotCorner_Find == FALSE) {
+ localLock.Unlock();
+ return FALSE;
+ }
- if(pSideData->m_bBotMark_Find == TRUE)
+ if (pSideData->m_bBotMark_Find == TRUE) {
+ localLock.Unlock();
return TRUE;
+ }
- BOOL bBotAlignMark = (BOOL) (m_pRecipe->m_SideParam[eDim].m_bBottomMark_Use == 1) ? TRUE : FALSE;
+ BOOL bBotAlignMark = (BOOL)(m_pRecipe->m_SideParam[eDim].m_bBottomMark_Use == 1) ? TRUE : FALSE;
- if(bBotAlignMark == FALSE)
+ if (bBotAlignMark == FALSE) {
+ localLock.Unlock();
return FindBotAlignMark_Virtual(iThread, eDim, stFrame);
- else
- {
- if(FindBotAlignMark_TempleteMatching(iThread, eDim, stFrame) == FALSE)
+ }
+ else {
+ if (FindBotAlignMark_TempleteMatching(iThread, eDim, stFrame) == FALSE) {
+ localLock.Unlock();
return FindBotAlignMark_Virtual(iThread, eDim, stFrame);
- else
+ }
+ else {
+ localLock.Unlock();
return TRUE;
+ }
}
}
-BOOL CInspectCamera::FindBotAlignMark_Virtual(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotAlignMark_Virtual(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- //if(pSideData->m_bBotCorner_Find == FALSE)
- // return FALSE;
+ //if(pSideData->m_bBotCorner_Find == FALSE)
+ // return FALSE;
- if(pSideData->m_bBotMark_Find == TRUE)
+ if (pSideData->m_bBotMark_Find == TRUE)
return TRUE;
// 1. Make ROI
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
- int nEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
- double dEdgeToBottomAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeY_um;
- int nEdgeToBottomAlignMarkY_Pixel = (int) GetUmToPixel_Y(dEdgeToBottomAlignMarkY_Um);
- int nBottomAlignMarkY_Pixel = nEndLine - nEdgeToBottomAlignMarkY_Pixel;
+ int nEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
+ double dEdgeToBottomAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeY_um;
+ int nEdgeToBottomAlignMarkY_Pixel = (int)GetUmToPixel_Y(dEdgeToBottomAlignMarkY_Um);
+ int nBottomAlignMarkY_Pixel = nEndLine - nEdgeToBottomAlignMarkY_Pixel;
int nBottomCornerTopFrameIndex = nBottomAlignMarkY_Pixel / nFrameHeight; //pSideData->m_rtBotCornerArea.top / nFrameHeight;
int nGlassEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
int nGlassEndLineFrame = nGlassEndLine / nFrameHeight;
- if((int) stFrame.nFrameIdx < nGlassEndLineFrame)
+ if ((int)stFrame.nFrameIdx < nGlassEndLineFrame)
return FALSE;
- int nSideLine = pSideData->m_nSideLineFrame[nBottomCornerTopFrameIndex];
- double nEdgeToBotAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeX_um;
- int nEdgeToBotAlignMarkX_Pixel = (int) GetUmToPixel_X(nEdgeToBotAlignMarkX_Um);
- int nBottomAlignMarkX_Pixel = nSideLine + nEdgeToBotAlignMarkX_Pixel;
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nBottomCornerTopFrameIndex];
+ double nEdgeToBotAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeX_um;
+ int nEdgeToBotAlignMarkX_Pixel = (int)GetUmToPixel_X(nEdgeToBotAlignMarkX_Um);
+ int nBottomAlignMarkX_Pixel = nSideLine + nEdgeToBotAlignMarkX_Pixel;
CRect rtSearchArea = CRect(nBottomAlignMarkX_Pixel, nBottomAlignMarkY_Pixel, nBottomAlignMarkX_Pixel, nBottomAlignMarkY_Pixel);
rtSearchArea.InflateRect(50, 50);
@@ -2381,104 +2405,104 @@
return TRUE;
}
-BOOL CInspectCamera::FindBotAlignMark_TempleteMatching(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::FindBotAlignMark_TempleteMatching(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bBotMark_Find == TRUE)
+ if (pSideData->m_bBotMark_Find == TRUE)
return TRUE;
- //if(pSideData->m_bBotCorner_Find == FALSE)
- // return FALSE;
+ //if(pSideData->m_bBotCorner_Find == FALSE)
+ // return FALSE;
// 1. Make ROI
- int nFrameWidth = m_nFrameWidth;
- int nFrameHeight = m_nFrameHeight;
+ int nFrameWidth = m_nFrameWidth;
+ int nFrameHeight = m_nFrameHeight;
- int nEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
- double dEdgeToBottomAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeY_um;
- int nEdgeToBottomAlignMarkY_Pixel = (int) GetUmToPixel_Y(dEdgeToBottomAlignMarkY_Um);
- int nBottomAlignMarkY_Pixel = nEndLine - nEdgeToBottomAlignMarkY_Pixel;
+ int nEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
+ double dEdgeToBottomAlignMarkY_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeY_um;
+ int nEdgeToBottomAlignMarkY_Pixel = (int)GetUmToPixel_Y(dEdgeToBottomAlignMarkY_Um);
+ int nBottomAlignMarkY_Pixel = nEndLine - nEdgeToBottomAlignMarkY_Pixel;
int nBottomCornerTopFrameIndex = nBottomAlignMarkY_Pixel / nFrameHeight; // pSideData->m_rtBotCornerArea.top / nFrameHeight;
int nGlassEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
int nGlassEndLineFrame = nGlassEndLine / nFrameHeight;
- if((int) stFrame.nFrameIdx < nGlassEndLineFrame)
+ if ((int)stFrame.nFrameIdx < nGlassEndLineFrame)
return FALSE;
- int nSideLine = pSideData->m_nSideLineFrame[nBottomCornerTopFrameIndex];
- if(nSideLine <= 0)
+ int nSideLine = (int)pSideData->m_nSideLineFrame[nBottomCornerTopFrameIndex];
+ if (nSideLine <= 0)
{
- CRect rectSide = CRect(0,nBottomAlignMarkY_Pixel,nFrameWidth-1,nBottomAlignMarkY_Pixel);
+ CRect rectSide = CRect(0, nBottomAlignMarkY_Pixel, nFrameWidth - 1, nBottomAlignMarkY_Pixel);
- rectSide.InflateRect(0,30);
+ rectSide.InflateRect(0, 30);
- CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rectSide.top),nFrameWidth,rectSide.Height());
+ CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rectSide.top), nFrameWidth, rectSide.Height());
- if(frameBuffer.IsValidBuffer() == FALSE)
+ if (frameBuffer.IsValidBuffer() == FALSE)
return FALSE;
rectSide.OffsetRect(0, -rectSide.top);
- int nThres = m_pRecipe->m_SideParam[(int)(eDim)].m_nSideLineThreshold;
+ int nThres = m_pRecipe->m_SideParam[(int)(eDim)].m_nSideLineThreshold;
CSISEdgeFind EdgeFind;
- EdgeFind.FindEdge_ToRightROI(&frameBuffer,nSideLine,DEFECT_EDGE_AUTO_PITCH,nThres,DEFECT_EDGE_AUTO_RATIO,0,rectSide);
+ EdgeFind.FindEdge_ToRightROI(&frameBuffer, nSideLine, DEFECT_EDGE_AUTO_PITCH, nThres, DEFECT_EDGE_AUTO_RATIO, 0, rectSide);
}
- if(nSideLine <= 0)
+ if (nSideLine <= 0)
return FALSE;
- double nEdgeToBotAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeX_um;
- int nEdgeToBotAlignMarkX_Pixel = (int) GetUmToPixel_X(nEdgeToBotAlignMarkX_Um);
- int nBottomAlignMarkX_Pixel = nSideLine + nEdgeToBotAlignMarkX_Pixel;
+ double nEdgeToBotAlignMarkX_Um = m_pRecipe->m_SideParam[eDim].m_nBottomMarkToEdgeX_um;
+ int nEdgeToBotAlignMarkX_Pixel = (int)GetUmToPixel_X(nEdgeToBotAlignMarkX_Um);
+ int nBottomAlignMarkX_Pixel = nSideLine + nEdgeToBotAlignMarkX_Pixel;
- double dTarget_Rate = m_pRecipe->m_SideParam[(int) eDim].m_dBottomMarkTemplateMatchingRate / 100.0;
+ double dTarget_Rate = m_pRecipe->m_SideParam[(int)eDim].m_dBottomMarkTemplateMatchingRate / 100.0;
CvPoint ptMax_Point;
double dMat_Max_Rate;
double dMat_Min_Rate;
- for(int i=0 ; i<MAX_MARKER_COUNT ; i++)
+ for (int i = 0; i < MAX_MARKER_COUNT; i++)
{
-USES_CONVERSION;
+ USES_CONVERSION;
char str_filename[256];
- sprintf_s(str_filename, "%s\\%s\\Side_%d_BotAlign_%d.bmp", W2A(RECIPE_ALIGN_PATH), W2A(m_pRecipe->GetRecipeName()), (int) eDim, i);
+ sprintf_s(str_filename, "%s\\%s\\Side_%d_BotAlign_%d.bmp", W2A(RECIPE_ALIGN_PATH), W2A(m_pRecipe->GetRecipeName()), (int)eDim, i);
IplImage* pTemplateImage = cvLoadImage(str_filename, CV_LOAD_IMAGE_GRAYSCALE);
- if(pTemplateImage == NULL)
+ if (pTemplateImage == NULL)
continue;
CRect rtSearchArea = CRect(nBottomAlignMarkX_Pixel, nBottomAlignMarkY_Pixel, nBottomAlignMarkX_Pixel, nBottomAlignMarkY_Pixel);
rtSearchArea.InflateRect(pTemplateImage->width * 2, pTemplateImage->height * 2);
- CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx,rtSearchArea.top), nFrameWidth, rtSearchArea.Height());
+ CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rtSearchArea.top), nFrameWidth, rtSearchArea.Height());
- if(!frameBuffer.IsValidBuffer())
+ if (!frameBuffer.IsValidBuffer())
continue;
pSideData->m_rtBotMark_SearchArea = rtSearchArea;
- IplImage* scr = cvCreateImage(cvSize(rtSearchArea.Width(),rtSearchArea.Height()),8,1);
+ IplImage* scr = cvCreateImage(cvSize(rtSearchArea.Width(), rtSearchArea.Height()), 8, 1);
- for(int i=0; i<rtSearchArea.Height(); i++)
+ for (int i = 0; i < rtSearchArea.Height(); i++)
memcpy(&scr->imageData[i * scr->widthStep], frameBuffer.GetDataAddress(rtSearchArea.left, i), rtSearchArea.Width());
- IplImage* ResultImage = cvCreateImage(cvSize(scr->width - pTemplateImage->width+1, scr->height - pTemplateImage->height+1 ),32,1);
+ IplImage* ResultImage = cvCreateImage(cvSize(scr->width - pTemplateImage->width + 1, scr->height - pTemplateImage->height + 1), 32, 1);
cvMatchTemplate(scr, pTemplateImage, ResultImage, CV_TM_CCOEFF_NORMED);
cvMinMaxLoc(ResultImage, &dMat_Min_Rate, &dMat_Max_Rate, NULL, &ptMax_Point);
- ptMax_Point.x += pTemplateImage->width/2;
- ptMax_Point.y += pTemplateImage->height/2;
+ ptMax_Point.x += pTemplateImage->width / 2;
+ ptMax_Point.y += pTemplateImage->height / 2;
int nTemplateW = pTemplateImage->width;
int nTemplateH = pTemplateImage->height;
@@ -2486,41 +2510,41 @@
cvReleaseImage(&pTemplateImage);
cvReleaseImage(&scr);
- if(dMat_Max_Rate > dTarget_Rate)
+ if (dMat_Max_Rate > dTarget_Rate)
{
pSideData->m_bBotMark_Find = TRUE;
pSideData->m_rtBotMark_SearchArea = rtSearchArea;
pSideData->m_ptBotMark_FindResult = CPoint(ptMax_Point.x, ptMax_Point.y);
pSideData->m_ptBotMark_FindResult.Offset(rtSearchArea.left, rtSearchArea.top);
pSideData->m_rtBotMark_FindResult = CRect(pSideData->m_ptBotMark_FindResult, pSideData->m_ptBotMark_FindResult);
- pSideData->m_rtBotMark_FindResult.InflateRect(nTemplateW/2, nTemplateH/2);
+ pSideData->m_rtBotMark_FindResult.InflateRect(nTemplateW / 2, nTemplateH / 2);
return TRUE;
- }
+ }
}
// Make Mark Defect..
CDefect_Info defectInfo;
- defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = stFrame.nScanIdx;
- defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) eDim;
- defectInfo.m_ptDefectPos_pxl = pSideData->m_rtBotMark_SearchArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = pSideData->m_rtBotMark_SearchArea;
- defectInfo.m_DefectLoc = DefectLoc_Mark;
+ defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = stFrame.nScanIdx;
+ defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)eDim;
+ defectInfo.m_ptDefectPos_pxl = pSideData->m_rtBotMark_SearchArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = pSideData->m_rtBotMark_SearchArea;
+ defectInfo.m_DefectLoc = DefectLoc_Mark;
m_pDefectControl->ExtractDefect_Mark(eDim, m_iCamera, stFrame.nScanIdx, defectInfo);
return FALSE;
}
-BOOL CInspectCamera::InspectDefect(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::InspectDefect(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
CRect rtInspectArea;
int nCutLine = 0;
- if(MakeInspectRegion(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, rtInspectArea, nCutLine) == FALSE)
+ if (MakeInspectRegion(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, rtInspectArea, nCutLine) == FALSE)
return FALSE;
// Inspect Area.
@@ -2528,9 +2552,9 @@
std::vector<CDefect_Info> vecDefectCandidateList;
- for(int i=0; i<MAX_SIDE_INSPECT_TYPE; i++)
+ for (int i = 0; i < MAX_SIDE_INSPECT_TYPE; i++)
{
- InspectDefect_Process(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, rtInspectArea, nCutLine, (eSideInsType) i, &vecDefectCandidateList);
+ InspectDefect_Process(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, rtInspectArea, nCutLine, (eSideInsType)i, &vecDefectCandidateList);
}
m_pDefectControl->ExtractDefect_Side(eDim, m_iCamera, stFrame.nScanIdx, &vecDefectCandidateList);
@@ -2538,20 +2562,20 @@
return TRUE;
}
-BOOL CInspectCamera::InspectDefect_Side(int iThread,DimensionDir eDim, stFrameIndex stFrame)
+BOOL CInspectCamera::InspectDefect_Side(int iThread, DimensionDir eDim, stFrameIndex stFrame)
{
std::vector<CRect> vecInspectAreaList; // For Notch Region Divide..
int nCutLine = 0;
- if(MakeInspectRegion(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, vecInspectAreaList, nCutLine) == FALSE)
+ if (MakeInspectRegion(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, vecInspectAreaList, nCutLine) == FALSE)
return FALSE;
// Inspect Area.
m_pGlassData->GetSideData(eDim)->m_nSideInspectAreaCount[stFrame.nFrameIdx] = vecInspectAreaList.size();
- for(int nRegionIdx=0; nRegionIdx<vecInspectAreaList.size(); nRegionIdx++)
+ for (int nRegionIdx = 0; nRegionIdx < vecInspectAreaList.size(); nRegionIdx++)
{
- if(MAX_SIDE_INSPECT_AREA_COUNT <= nRegionIdx)
+ if (MAX_SIDE_INSPECT_AREA_COUNT <= nRegionIdx)
continue;
m_pGlassData->GetSideData(eDim)->m_rtInspectArea[stFrame.nFrameIdx] = vecInspectAreaList[nRegionIdx];
@@ -2560,9 +2584,9 @@
std::vector<CDefect_Info> vecDefectCandidateList;
- for(int i=0; i<MAX_SIDE_INSPECT_TYPE; i++)
+ for (int i = 0; i < MAX_SIDE_INSPECT_TYPE; i++)
{
- InspectDefect_Process(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, vecInspectAreaList[nRegionIdx], nCutLine, (eSideInsType) i, &vecDefectCandidateList);
+ InspectDefect_Process(iThread, eDim, stFrame.nScanIdx, stFrame.nFrameIdx, vecInspectAreaList[nRegionIdx], nCutLine, (eSideInsType)i, &vecDefectCandidateList);
}
m_pDefectControl->ExtractDefect_Side(eDim, m_iCamera, stFrame.nScanIdx, &vecDefectCandidateList);
@@ -2571,64 +2595,64 @@
return TRUE;
}
-BOOL CInspectCamera::MakeInspectRegion(int iThread,DimensionDir eDim,int iScan,int iFrame, CRect& rtInspectArea, int& nCutLine)
+BOOL CInspectCamera::MakeInspectRegion(int iThread, DimensionDir eDim, int iScan, int iFrame, CRect& rtInspectArea, int& nCutLine)
{
CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_nSideLineFrame[iFrame] < 0) // Side Line阑 给茫篮 版快..
+ if (pSideData->m_nSideLineFrame[iFrame] < 0) // Side Line鞚� 氇混熬鞚� 瓴届毎..
return FALSE;
// 1. Make Corner Area
- int nFindStartLine = pSideData->m_nGlassStartLine;
- double dTopCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nTopCornerSizeY_um;
- int nTopCornerYSizePixel = (int) GetUmToPixel_Y(dTopCornerSizeY_UM);
- int nTopCornerEndLine = nFindStartLine + nTopCornerYSizePixel;
+ int nFindStartLine = pSideData->m_nGlassStartLine;
+ double dTopCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nTopCornerSizeY_um;
+ int nTopCornerYSizePixel = (int)GetUmToPixel_Y(dTopCornerSizeY_UM);
+ int nTopCornerEndLine = nFindStartLine + nTopCornerYSizePixel;
- int nFindEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
- double dBottomCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nBottomCornerSizeY_um;
- int nBottomCornerYSizePixel = (int) GetUmToPixel_Y(dBottomCornerSizeY_UM);
- int nBottomCornerStartLine = nFindEndLine - nBottomCornerYSizePixel;
+ int nFindEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
+ double dBottomCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nBottomCornerSizeY_um;
+ int nBottomCornerYSizePixel = (int)GetUmToPixel_Y(dBottomCornerSizeY_UM);
+ int nBottomCornerStartLine = nFindEndLine - nBottomCornerYSizePixel;
// 2. Max Inspect Area..
CRect rtFrame;
- rtFrame.left = pSideData->m_nSide_Chamfer_LineFrame[iFrame];
- rtFrame.top = iFrame * m_nFrameHeight;
- rtFrame.right = rtFrame.left;
- rtFrame.bottom = rtFrame.top + m_nFrameHeight;
-
- //rtFrame.top = rtFrame.top; // 困肺 炼陛 歹 八荤秦辑 搬窃捞 钦媚瘤霸 秦焊磊..
- rtFrame.top = rtFrame.top - 100; // 100 Pixel Frame 唱床柳 版快 巩力啊 登聪, 吝汗 八荤窍磊..
+ rtFrame.left = (LONG)pSideData->m_nSide_Chamfer_LineFrame[iFrame];
+ rtFrame.top = iFrame * m_nFrameHeight;
+ rtFrame.right = rtFrame.left;
+ rtFrame.bottom = rtFrame.top + m_nFrameHeight;
- int nMaxInspectRange = 0;
+ //rtFrame.top = rtFrame.top; // 鞙勲 臁瓣笀 雿� 瓴�靷暣靹� 瓴绊暔鞚� 頃╈硱歆�瓴� 頃措炒鞛�..
+ rtFrame.top = rtFrame.top - 100; // 100 Pixel Frame 雮橂垹歆� 瓴届毎 氍胳牅臧� 霅橂媹, 欷戨车 瓴�靷晿鞛�..
- for(int i=0; i<MAX_SIDE_INSPECT_TYPE; i++)
+ int nMaxInspectRange = 0;
+
+ for (int i = 0; i < MAX_SIDE_INSPECT_TYPE; i++)
{
- if(m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_bUseInspect == TRUE)
+ if (m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_bUseInspect == TRUE)
{
- int nSideLineOffset_pxl = (int) GetUmToPixel_X((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_nInspect_SideLine_Offset_um);
- int nInspect_Range_pxl = (int) GetUmToPixel_X((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_nInspect_Range_um);
+ int nSideLineOffset_pxl = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_nInspect_SideLine_Offset_um);
+ int nInspect_Range_pxl = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_nInspect_Range_um);
- int nInsRange = abs(nSideLineOffset_pxl) + abs(nInspect_Range_pxl);
- nMaxInspectRange = (nMaxInspectRange < nInsRange) ? nInsRange : nMaxInspectRange;
+ int nInsRange = abs(nSideLineOffset_pxl) + abs(nInspect_Range_pxl);
+ nMaxInspectRange = (nMaxInspectRange < nInsRange) ? nInsRange : nMaxInspectRange;
}
}
rtFrame.InflateRect(nMaxInspectRange, 0);
// 2. Make Roi, Exception Corner Area
CRect rtGlassSideROI;
- rtGlassSideROI.left = 0;
- rtGlassSideROI.top = (nTopCornerEndLine < nFindStartLine) ? nFindStartLine : nTopCornerEndLine;
- rtGlassSideROI.right = m_nFrameWidth;
- rtGlassSideROI.bottom = nBottomCornerStartLine;
+ rtGlassSideROI.left = 0;
+ rtGlassSideROI.top = (nTopCornerEndLine < nFindStartLine) ? nFindStartLine : nTopCornerEndLine;
+ rtGlassSideROI.right = m_nFrameWidth;
+ rtGlassSideROI.bottom = nBottomCornerStartLine;
nCutLine = rtFrame.CenterPoint().x;
// 3. Return Inspect Area..
rtInspectArea.IntersectRect(rtFrame, rtGlassSideROI);
- if(rtInspectArea.IsRectEmpty() || rtInspectArea.IsRectNull())
+ if (rtInspectArea.IsRectEmpty() || rtInspectArea.IsRectNull())
return FALSE;
rtInspectArea.right = rtInspectArea.left + align_4byte(rtInspectArea.Width());
@@ -2636,57 +2660,57 @@
return TRUE;
}
-BOOL CInspectCamera::MakeInspectRegion(int iThread,DimensionDir eDim,int iScan,int iFrame, std::vector<CRect> & vecInspectArea, int& nCutLine)
+BOOL CInspectCamera::MakeInspectRegion(int iThread, DimensionDir eDim, int iScan, int iFrame, std::vector<CRect>& vecInspectArea, int& nCutLine)
{
CSide_Data* pSideData = m_pGlassData->GetSideData(eDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_nSideLineFrame[iFrame] < 0) // Side Line阑 给茫篮 版快..
+ if (pSideData->m_nSideLineFrame[iFrame] < 0) // Side Line鞚� 氇混熬鞚� 瓴届毎..
return FALSE;
// 1. Make Corner Area
- int nFindStartLine = pSideData->m_nGlassStartLine;
- double dTopCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nTopCornerSizeY_um;
- int nTopCornerYSizePixel = (int) GetUmToPixel_Y(dTopCornerSizeY_UM);
- int nTopCornerEndLine = nFindStartLine + nTopCornerYSizePixel;
+ int nFindStartLine = pSideData->m_nGlassStartLine;
+ double dTopCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nTopCornerSizeY_um;
+ int nTopCornerYSizePixel = (int)GetUmToPixel_Y(dTopCornerSizeY_UM);
+ int nTopCornerEndLine = nFindStartLine + nTopCornerYSizePixel;
- int nFindEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
- double dBottomCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nBottomCornerSizeY_um;
- int nBottomCornerYSizePixel = (int) GetUmToPixel_Y(dBottomCornerSizeY_UM);
- int nBottomCornerStartLine = nFindEndLine - nBottomCornerYSizePixel;
+ int nFindEndLine = (pSideData->m_bFindGlassEndLine == TRUE) ? pSideData->m_nGlassEndLine : pSideData->m_nPreGlassEndLine;
+ double dBottomCornerSizeY_UM = m_pRecipe->m_SideParam[eDim].m_nBottomCornerSizeY_um;
+ int nBottomCornerYSizePixel = (int)GetUmToPixel_Y(dBottomCornerSizeY_UM);
+ int nBottomCornerStartLine = nFindEndLine - nBottomCornerYSizePixel;
// 2. Max Inspect Area..
CRect rtFrame;
- rtFrame.left = pSideData->m_nSide_Chamfer_LineFrame[iFrame];
- rtFrame.top = iFrame * m_nFrameHeight;
- rtFrame.right = rtFrame.left;
- rtFrame.bottom = rtFrame.top + m_nFrameHeight;
+ rtFrame.left = (LONG)pSideData->m_nSide_Chamfer_LineFrame[iFrame];
+ rtFrame.top = iFrame * m_nFrameHeight;
+ rtFrame.right = rtFrame.left;
+ rtFrame.bottom = rtFrame.top + m_nFrameHeight;
- //rtFrame.top = rtFrame.top; // 困肺 炼陛 歹 八荤秦辑 搬窃捞 钦媚瘤霸 秦焊磊..
- rtFrame.top = rtFrame.top - 100; // 100 Pixel Frame 唱床柳 版快 巩力啊 登聪, 吝汗 八荤窍磊..
+ //rtFrame.top = rtFrame.top; // 鞙勲 臁瓣笀 雿� 瓴�靷暣靹� 瓴绊暔鞚� 頃╈硱歆�瓴� 頃措炒鞛�..
+ rtFrame.top = rtFrame.top - 100; // 100 Pixel Frame 雮橂垹歆� 瓴届毎 氍胳牅臧� 霅橂媹, 欷戨车 瓴�靷晿鞛�..
- int nMaxInspectRange = 0;
+ int nMaxInspectRange = 0;
- for(int i=0; i<MAX_SIDE_INSPECT_TYPE; i++)
+ for (int i = 0; i < MAX_SIDE_INSPECT_TYPE; i++)
{
- if(m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_bUseInspect == TRUE)
+ if (m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_bUseInspect == TRUE)
{
- int nSideLineOffset_pxl = (int) GetUmToPixel_X((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_nInspect_SideLine_Offset_um);
- int nInspect_Range_pxl = (int) GetUmToPixel_X((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[i].m_nInspect_Range_um);
+ int nSideLineOffset_pxl = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_nInspect_SideLine_Offset_um);
+ int nInspect_Range_pxl = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[i].m_nInspect_Range_um);
- int nInsRange = abs(nSideLineOffset_pxl) + abs(nInspect_Range_pxl);
- nMaxInspectRange = (nMaxInspectRange < nInsRange) ? nInsRange : nMaxInspectRange;
+ int nInsRange = abs(nSideLineOffset_pxl) + abs(nInspect_Range_pxl);
+ nMaxInspectRange = (nMaxInspectRange < nInsRange) ? nInsRange : nMaxInspectRange;
}
}
rtFrame.InflateRect(nMaxInspectRange, 0);
// 2. Make Roi, Exception Corner Area
CRect rtGlassSideROI;
- rtGlassSideROI.left = 0;
- rtGlassSideROI.top = (nTopCornerEndLine < nFindStartLine) ? nFindStartLine : nTopCornerEndLine;
- rtGlassSideROI.right = m_nFrameWidth;
- rtGlassSideROI.bottom = nBottomCornerStartLine;
+ rtGlassSideROI.left = 0;
+ rtGlassSideROI.top = (nTopCornerEndLine < nFindStartLine) ? nFindStartLine : nTopCornerEndLine;
+ rtGlassSideROI.right = m_nFrameWidth;
+ rtGlassSideROI.bottom = nBottomCornerStartLine;
nCutLine = rtFrame.CenterPoint().x;
@@ -2694,7 +2718,7 @@
CRect rtInspectArea;
rtInspectArea.IntersectRect(rtFrame, rtGlassSideROI);
- if(rtInspectArea.IsRectEmpty() || rtInspectArea.IsRectNull())
+ if (rtInspectArea.IsRectEmpty() || rtInspectArea.IsRectNull())
return FALSE;
// 4. Exception Notch Area...
@@ -2703,47 +2727,47 @@
std::vector<CRect> vectorInspectAreaList_Old;
vectorInspectAreaList_Old.clear();
-
+
std::vector<CRect> vecExceptionNotchAreaList;
- int nNotchCount = m_pRecipe->m_SideParam[(int) eDim].m_nNotchCount;
+ int nNotchCount = m_pRecipe->m_SideParam[(int)eDim].m_nNotchCount;
- for(int i=0; i<nNotchCount; i++)
+ for (int i = 0; i < nNotchCount; i++)
{
- int nDiff_StartLine = nFindStartLine - m_pRecipe->m_SideParam[(int) eDim].m_NotchPrm[i].m_nGlassStartLine_pxl;
+ int nDiff_StartLine = nFindStartLine - m_pRecipe->m_SideParam[(int)eDim].m_NotchPrm[i].m_nGlassStartLine_pxl;
- CRect rtNotchArea = m_pRecipe->m_SideParam[(int) eDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
+ CRect rtNotchArea = m_pRecipe->m_SideParam[(int)eDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
rtNotchArea.OffsetRect(0, nDiff_StartLine);
rtNotchArea.left = 0;
rtNotchArea.right = m_nFrameWidth;
vectorInspectAreaList_Old.resize(vectorInspectAreaList_New.size());
- std::copy(vectorInspectAreaList_New.begin(), vectorInspectAreaList_New.end(), vectorInspectAreaList_Old.begin());
+ std::copy(vectorInspectAreaList_New.begin(), vectorInspectAreaList_New.end(), vectorInspectAreaList_Old.begin());
vectorInspectAreaList_New.clear();
- for(int j=0; j<vectorInspectAreaList_Old.size(); j++)
+ for (int j = 0; j < vectorInspectAreaList_Old.size(); j++)
{
CRect rtTemp = vectorInspectAreaList_Old[j];
CRect rtNotchInterSectRect;
- rtNotchInterSectRect.IntersectRect(rtTemp, rtNotchArea);
+ rtNotchInterSectRect.IntersectRect(rtTemp, rtNotchArea);
- if(rtNotchInterSectRect.IsRectEmpty() || rtNotchInterSectRect.IsRectNull()) // 畴摹啊 救吧府绰 版快俊绰 促矫 持绢霖促..
+ if (rtNotchInterSectRect.IsRectEmpty() || rtNotchInterSectRect.IsRectNull()) // 雲胳箻臧� 鞎堦备毽姅 瓴届毎鞐愲姅 雼れ嫓 雱l柎欷�雼�..
{
vectorInspectAreaList_New.push_back(rtTemp);
continue;
}
- if(rtTemp.Height() == rtNotchInterSectRect.Height()) // Notch啊 康开狼 傈眉牢 版快
+ if (rtTemp.Height() == rtNotchInterSectRect.Height()) // Notch臧� 鞓侅棴鞚� 鞝勳泊鞚� 瓴届毎
continue;
-
- if(rtTemp.top == rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 1. Notch Frame 困俊 吧赴 版快
+
+ if (rtTemp.top == rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 1. Notch Frame 鞙勳棎 瓯鸽Π 瓴届毎
{
CRect rtNew = rtTemp;
rtNew.top = rtNotchInterSectRect.bottom;
vectorInspectAreaList_New.push_back(rtNew);
}
- else if(rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 2. Notch Frame 吝埃俊 吧赴 版快
+ else if (rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom < rtTemp.bottom) // 2. Notch Frame 欷戧皠鞐� 瓯鸽Π 瓴届毎
{
CRect rtNewTop = rtTemp;
rtNewTop.top = rtNotchInterSectRect.bottom;
@@ -2753,7 +2777,7 @@
rtNewBot.bottom = rtNotchInterSectRect.top;
vectorInspectAreaList_New.push_back(rtNewBot);
}
- else if(rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom == rtTemp.bottom) // 3. Notch Frame 酒贰俊 吧赴 版快
+ else if (rtTemp.top < rtNotchInterSectRect.top && rtNotchInterSectRect.bottom == rtTemp.bottom) // 3. Notch Frame 鞎勲灅鞐� 瓯鸽Π 瓴届毎
{
CRect rtNew = rtTemp;
rtNew.bottom = rtNotchInterSectRect.top;
@@ -2765,7 +2789,7 @@
// 5. Make Return
vecInspectArea.clear();
- for(int i=0; i<vectorInspectAreaList_New.size(); i++)
+ for (int i = 0; i < vectorInspectAreaList_New.size(); i++)
{
CRect rtInspectArea = vectorInspectAreaList_New[i];
rtInspectArea.right = rtInspectArea.left + align_4byte(rtInspectArea.Width());
@@ -2776,19 +2800,19 @@
return TRUE;
}
-BOOL CInspectCamera::InspectDefect_Process(int iThread,DimensionDir eDim,int iScan,int iFrame, CRect rtInspectArea, int nCutLine, eSideInsType emInsType, std::vector<CDefect_Info>* pDefectList)
+BOOL CInspectCamera::InspectDefect_Process(int iThread, DimensionDir eDim, int iScan, int iFrame, CRect rtInspectArea, int nCutLine, eSideInsType emInsType, std::vector<CDefect_Info>* pDefectList)
{
if (rtInspectArea.IsRectEmpty() == TRUE || m_pGlassData == NULL)
return FALSE;
- int nSideLine = m_pGlassData->GetSideData(eDim)->m_nSideLineFrame[iFrame];
+ int nSideLine = (int)m_pGlassData->GetSideData(eDim)->m_nSideLineFrame[iFrame];
if (nSideLine < 0)
return FALSE;
DefectLocation defectLoc = DefectLoc_None;
- switch(emInsType)
+ switch (emInsType)
{
case eSideInsType_Chip: defectLoc = DefectLoc_Chip;
break;
@@ -2810,42 +2834,42 @@
return FALSE;
}
- if(m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_bUseInspect == FALSE)
+ if (m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_bUseInspect == FALSE)
return TRUE;
// 0. Parameter Initialize..
- CString strDefectType = _T("Unknown");
- int nMethod = 0;
- int nThreshold_Low = 0;
- int nThreshold_High = 0;
- int nPitch = 0;
- int nPitch_Threshold = 0;
- int nMinSize = 0;
- int nMinSize_X = 0;
- int nMinSize_Y = 0;
- int nDilation = 0;
- int nInsStart = 0;
- int nInsRange = 0;
+ CString strDefectType = _T("Unknown");
+ int nMethod = 0;
+ int nThreshold_Low = 0;
+ int nThreshold_High = 0;
+ int nPitch = 0;
+ int nPitch_Threshold = 0;
+ int nMinSize = 0;
+ int nMinSize_X = 0;
+ int nMinSize_Y = 0;
+ int nDilation = 0;
+ int nInsStart = 0;
+ int nInsRange = 0;
- BOOL bStartNearFilterUse = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_bSide_Filter;
- int nStartNearFilterRange = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nSide_Filter_um;
+ BOOL bStartNearFilterUse = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_bSide_Filter;
+ int nStartNearFilterRange = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nSide_Filter_um;
- nMethod = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nInspect_Method;
- nThreshold_Low = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nMin_Threshold;
- nThreshold_High = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nMax_Threshold;
- nPitch = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nDiff_Pitch;
- nPitch_Threshold = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nDiff_Threshold;
- nMinSize = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nMinSize_Filter_pxl;
- nMinSize_X = (int) GetUmToPixel_X((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nMinSize_Filter_X_um);
- nMinSize_Y = (int) GetUmToPixel_Y((double) m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nMinSize_Filter_Y_um);
- nDilation = m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nDefect_Size_Dilation;
+ nMethod = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nInspect_Method;
+ nThreshold_Low = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nMin_Threshold;
+ nThreshold_High = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nMax_Threshold;
+ nPitch = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nDiff_Pitch;
+ nPitch_Threshold = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nDiff_Threshold;
+ nMinSize = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nMinSize_Filter_pxl;
+ nMinSize_X = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nMinSize_Filter_X_um);
+ nMinSize_Y = (int)GetUmToPixel_Y((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nMinSize_Filter_Y_um);
+ nDilation = m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nDefect_Size_Dilation;
- nInsStart = (int) GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nInspect_SideLine_Offset_um);
- nInsRange = (int) GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int) eDim].m_InspectPrm[(int) emInsType].m_nInspect_Range_um);
+ nInsStart = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nInspect_SideLine_Offset_um);
+ nInsRange = (int)GetUmToPixel_X((double)m_pRecipe->m_SideParam[(int)eDim].m_InspectPrm[(int)emInsType].m_nInspect_Range_um);
//CRect rtProcessArea(rtInspectArea.CenterPoint().x + nInsStart, rtInspectArea.top, rtInspectArea.CenterPoint().x + nInsStart + nInsRange, rtInspectArea.bottom);
CRect rtProcessArea(nCutLine + nInsStart, rtInspectArea.top, nCutLine + nInsStart + nInsRange, rtInspectArea.bottom);
-
+
if (rtProcessArea.right < rtProcessArea.left)
{
@@ -2859,20 +2883,20 @@
return FALSE;
CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(iScan, rtInspectArea.top), m_nFrameWidth, m_nFrameHeight);
- if(frameBuffer.IsValidBuffer() == FALSE)
+ if (frameBuffer.IsValidBuffer() == FALSE)
return FALSE;
// Set Insert Area.. For UI..
- m_pGlassData->GetSideData(eDim)->m_rtInspectArea_InsType[(int) emInsType][iFrame] = rtProcessArea;
+ m_pGlassData->GetSideData(eDim)->m_rtInspectArea_InsType[(int)emInsType][iFrame] = rtProcessArea;
- if(bStartNearFilterUse)
- m_pGlassData->GetSideData(eDim)->m_nSideFilterLine_InsType[(int) emInsType][iFrame] = (0 <= nStartNearFilterRange) ? rtProcessArea.left + nStartNearFilterRange : rtProcessArea.right + nStartNearFilterRange;
+ if (bStartNearFilterUse)
+ m_pGlassData->GetSideData(eDim)->m_nSideFilterLine_InsType[(int)emInsType][iFrame] = (0 <= nStartNearFilterRange) ? rtProcessArea.left + nStartNearFilterRange : rtProcessArea.right + nStartNearFilterRange;
// 1. Inspect ROI
COwnerBuffer pDefectProcessImage(rtProcessArea.Width(), rtProcessArea.Height());
for (int i = 0; i < rtProcessArea.Height(); i++)
- memcpy(pDefectProcessImage.GetDataAddress(0,i), frameBuffer.GetDataAddress(rtProcessArea.left, i), rtProcessArea.Width());
+ memcpy(pDefectProcessImage.GetDataAddress(0, i), frameBuffer.GetDataAddress(rtProcessArea.left, i), rtProcessArea.Width());
// 2. Inspect Algorithm
COwnerBuffer pBinImage;
@@ -2888,10 +2912,10 @@
DefectProcess(eDim, iScan, iFrame, &pDefectProcessImage, &pBinImage, rtProcessArea, nMinSize, nMinSize_X, nMinSize_Y, nDilation, bStartNearFilterUse, nStartNearFilterRange, defectLoc, pDefectList);
CString str;
- str.Format(_T("Defect\\InsArea_Ori_Frame%d_%d_%d_%d_%d"),iFrame, rtInspectArea.left, rtInspectArea.top, rtInspectArea.right, rtInspectArea.bottom);
+ str.Format(_T("Defect\\InsArea_Ori_Frame%d_%d_%d_%d_%d"), iFrame, rtInspectArea.left, rtInspectArea.top, rtInspectArea.right, rtInspectArea.bottom);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), &pDefectProcessImage, str);
- str.Format(_T("Defect\\InsArea_Bin_Frame%d_%d_%d_%d_%d"),iFrame, rtInspectArea.left, rtInspectArea.top, rtInspectArea.right, rtInspectArea.bottom);
+ str.Format(_T("Defect\\InsArea_Bin_Frame%d_%d_%d_%d_%d"), iFrame, rtInspectArea.left, rtInspectArea.top, rtInspectArea.right, rtInspectArea.bottom);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), &pBinImage, str);
return TRUE;
@@ -2946,7 +2970,7 @@
{
if (compareResult.m128i_u8[k] != 0)
{
- pBinImage->SetPixel(j+k, i, 255); //[i * pBinImage->step1() + j + k] = (char)255;
+ pBinImage->SetPixel(j + k, i, 255); //[i * pBinImage->step1() + j + k] = (char)255;
}
}
}
@@ -3041,7 +3065,7 @@
{
if (compareResult.m128i_u8[k] != 0)
{
- pBinImage->SetPixel(j+k, i, 255); // [i * pBinImage->step1() + j + k] = (char)255;
+ pBinImage->SetPixel(j + k, i, 255); // [i * pBinImage->step1() + j + k] = (char)255;
}
}
}
@@ -3136,7 +3160,7 @@
{
if (compareResult.m128i_u8[k] != 0)
{
- pBinImage->SetPixel(j+k, i, 255); // [i * pBinImage->step1() + j + k] = (char)255;
+ pBinImage->SetPixel(j + k, i, 255); // [i * pBinImage->step1() + j + k] = (char)255;
}
}
}
@@ -3226,19 +3250,19 @@
}
// 2. Threshold Suppress
- compare_Thres_Low = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_min_epu8(imageSource, thresLow), thresLow), K_INV_ZERO); // Greater Than
- compare_Thres_High = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(imageSource, thresHigh), thresHigh), K_INV_ZERO); // Less Than
- compare_Thres_Result = _mm_or_si128(compare_Thres_Low, compare_Thres_High);
+ compare_Thres_Low = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_min_epu8(imageSource, thresLow), thresLow), K_INV_ZERO); // Greater Than
+ compare_Thres_High = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(imageSource, thresHigh), thresHigh), K_INV_ZERO); // Less Than
+ compare_Thres_Result = _mm_or_si128(compare_Thres_Low, compare_Thres_High);
// 3. Pitch Compare
- compare_Pitch_Up = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Up));
- compare_Pitch_Down = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Down)); // Less Than
+ compare_Pitch_Up = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Up));
+ compare_Pitch_Down = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Down)); // Less Than
//compare_Pitch_Result = _mm_min_epu8(compare_Pitch_Up, compare_Pitch_Down);
- compare_Pitch_Result = _mm_max_epu8(compare_Pitch_Up, compare_Pitch_Down);
- compare_Pitch_Result = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(compare_Pitch_Result, thresPitch), thresPitch), K_INV_ZERO); // Less Than
+ compare_Pitch_Result = _mm_max_epu8(compare_Pitch_Up, compare_Pitch_Down);
+ compare_Pitch_Result = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(compare_Pitch_Result, thresPitch), thresPitch), K_INV_ZERO); // Less Than
// 4. And
- compare_Result = _mm_and_si128(compare_Thres_Result, compare_Pitch_Result);
+ compare_Result = _mm_and_si128(compare_Thres_Result, compare_Pitch_Result);
int nProcCount = (pImageData->GetWidth() - (16 * nMul));
@@ -3250,7 +3274,7 @@
{
if (compare_Result.m128i_u8[k] != 0)
{
- pBinImage->SetPixel(j+k, i, 255); //[i * pBinImage->GetWidth() + j + k] = (char)255;
+ pBinImage->SetPixel(j + k, i, 255); //[i * pBinImage->GetWidth() + j + k] = (char)255;
}
}
}
@@ -3340,19 +3364,19 @@
}
// 2. Threshold Suppress
- compare_Thres_Low = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_min_epu8(imageSource, thresLow), thresLow), K_INV_ZERO); // Greater Than
- compare_Thres_High = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(imageSource, thresHigh), thresHigh), K_INV_ZERO); // Less Than
- compare_Thres_Result = _mm_or_si128(compare_Thres_Low, compare_Thres_High);
+ compare_Thres_Low = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_min_epu8(imageSource, thresLow), thresLow), K_INV_ZERO); // Greater Than
+ compare_Thres_High = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(imageSource, thresHigh), thresHigh), K_INV_ZERO); // Less Than
+ compare_Thres_Result = _mm_or_si128(compare_Thres_Low, compare_Thres_High);
// 3. Pitch Compare
- compare_Pitch_Up = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Up));
- compare_Pitch_Down = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Down)); // Less Than
+ compare_Pitch_Up = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Up));
+ compare_Pitch_Down = _mm_abs_epi8(_mm_sub_epi8(imageSource, imageSource_Down)); // Less Than
//compare_Pitch_Result = _mm_min_epu8(compare_Pitch_Up, compare_Pitch_Down);
- compare_Pitch_Result = _mm_max_epu8(compare_Pitch_Up, compare_Pitch_Down);
- compare_Pitch_Result = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(compare_Pitch_Result, thresPitch), thresPitch), K_INV_ZERO); // Less Than
+ compare_Pitch_Result = _mm_max_epu8(compare_Pitch_Up, compare_Pitch_Down);
+ compare_Pitch_Result = _mm_andnot_si128(_mm_cmpeq_epi8(_mm_max_epu8(compare_Pitch_Result, thresPitch), thresPitch), K_INV_ZERO); // Less Than
// 4. And
- compare_Result = _mm_and_si128(compare_Thres_Result, compare_Pitch_Result);
+ compare_Result = _mm_and_si128(compare_Thres_Result, compare_Pitch_Result);
int nProcCount = (pImageData->GetWidth() - (16 * nMul));
@@ -3364,7 +3388,7 @@
{
if (compare_Result.m128i_u8[k] != 0)
{
- pBinImage->SetPixel(j+k, i, 255); //[i * pBinImage->GetWidth() + j + k] = (char)255;
+ pBinImage->SetPixel(j + k, i, 255); //[i * pBinImage->GetWidth() + j + k] = (char)255;
}
}
}
@@ -3384,9 +3408,9 @@
static int g_static_debug = 1;
-BOOL CInspectCamera::DefectProcess(DimensionDir eDim,int iScan,int iFrame, COwnerBuffer* pImageData, COwnerBuffer* pBinImage, CRect rtROIPos, int nMinSize, int nMinSizeX, int nMinSizeY, int nDilation, BOOL bStartNearFilter, int nStartNearFilterRange, DefectLocation defectType, std::vector<CDefect_Info>* pDefectList)
+BOOL CInspectCamera::DefectProcess(DimensionDir eDim, int iScan, int iFrame, COwnerBuffer* pImageData, COwnerBuffer* pBinImage, CRect rtROIPos, int nMinSize, int nMinSizeX, int nMinSizeY, int nDilation, BOOL bStartNearFilter, int nStartNearFilterRange, DefectLocation defectType, std::vector<CDefect_Info>* pDefectList)
{
- if(pDefectList == NULL)
+ if (pDefectList == NULL)
return FALSE;
if (pImageData == NULL || pBinImage == NULL)
@@ -3400,8 +3424,8 @@
cv::Mat pBinMat = cv::Mat::zeros(pBinImage->GetHeight(), pBinImage->GetWidth(), CV_8UC1);
- // OwnerBuffer 郴何肺 16硅荐 皋葛府 爱绊 乐绢辑 茄锅俊 墨乔 救蹬..
- for(int i=0; i<pBinImage->GetHeight(); i++)
+ // OwnerBuffer 雮措秬搿� 16氚办垬 氅旊毽� 臧栮碃 鞛堨柎靹� 頃滊矆鞐� 旃错敿 鞎堧徏..
+ for (int i = 0; i < pBinImage->GetHeight(); i++)
CopyMemory(&pBinMat.data[pBinMat.step1() * i], pBinImage->GetDataAddress(0, i), pBinImage->GetWidth());
/*
@@ -3416,17 +3440,17 @@
// cv::dilate(pBinMat, pBinMat, cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(3, 3)), cv::Point(-1,-1), nDilation);
CString strFileName;
- strFileName.Format(_T("Defect\\%s_Origin"), g_strDefectType[(int) defectType]);
+ strFileName.Format(_T("Defect\\%s_Origin"), g_strDefectType[(int)defectType]);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), pImageData, strFileName);
- strFileName.Format(_T("Defect\\%s_Bin"), g_strDefectType[(int) defectType]);
+ strFileName.Format(_T("Defect\\%s_Bin"), g_strDefectType[(int)defectType]);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), pBinImage, strFileName);
cv::Mat matLabel, matStats, matCentrois;
int numOfLables = cv::connectedComponentsWithStats(pBinMat, matLabel, matStats, matCentrois, 8);
- if(numOfLables <= 1) // 硅版 窍唱父 乐澜..
+ if (numOfLables <= 1) // 氚瓣步 頃橂倶毵� 鞛堨潓..
return TRUE;
std::vector<int> vecMin, vecMax, vecSum, vecPixelCount;
@@ -3449,9 +3473,9 @@
int nPxlValue = (int)pImageData->GetPixel(j, i);
- if(nLabelIdx == 0)
+ if (nLabelIdx == 0)
continue;
- if(pBinImage->GetPixel(j, i) == 0 && nLabelIdx < MAX_DEFECT_COUNT_SIDE)
+ if (pBinImage->GetPixel(j, i) == 0 && nLabelIdx < MAX_DEFECT_COUNT_SIDE)
backgroundLables[nLabelIdx] = TRUE;
if (nPxlValue < vecMin[nLabelIdx])
@@ -3466,7 +3490,7 @@
}
}
- int nDefectIdx = (int) pDefectList->size();
+ int nDefectIdx = (int)pDefectList->size();
for (int nIdx = 0; nIdx < numOfLables; nIdx++)
{
@@ -3480,16 +3504,16 @@
int width = matStats.at<int>(nIdx, cv::CC_STAT_WIDTH);
int height = matStats.at<int>(nIdx, cv::CC_STAT_HEIGHT);
- int x = (int)matCentrois.at<double>(nIdx, 0); //吝缴谅钎
+ int x = (int)matCentrois.at<double>(nIdx, 0); //欷戩嫭膦岉憸
int y = (int)matCentrois.at<double>(nIdx, 1);
- if(MAX_DEFECT_COUNT_SIDE < nIdx)
+ if (MAX_DEFECT_COUNT_SIDE < nIdx)
continue;
- if(backgroundLables[nIdx] == TRUE)
+ if (backgroundLables[nIdx] == TRUE)
continue;
- if(nIdx == 0)
+ if (nIdx == 0)
continue;
if ((0 < nStartNearFilterRange && left <= nStartNearFilterRange) || (nStartNearFilterRange < 0 && pBinImage->GetWidth() + nStartNearFilterRange <= left + width))
@@ -3498,10 +3522,10 @@
if (vecPixelCount[nIdx] < nMinSize)
bFiltering = TRUE;
- if(width < nMinSizeX)
+ if (width < nMinSizeX)
bFiltering = TRUE;
- if(height < nMinSizeY)
+ if (height < nMinSizeY)
bFiltering = TRUE;
if (bStartNearFilter == TRUE && bStartNear == FALSE)
@@ -3519,27 +3543,27 @@
CDefect_Info defectInfo;
- defectInfo.m_nIndex = nDefectIdx++;
- defectInfo.m_iFrameIdx = iFrame;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = iScan;
- defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) eDim;
+ defectInfo.m_nIndex = nDefectIdx++;
+ defectInfo.m_iFrameIdx = iFrame;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = iScan;
+ defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)eDim;
- defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = rtDefectArea;
+ defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = rtDefectArea;
- defectInfo.m_nMinSize = nMinSize;
- defectInfo.m_nBlobDilation = area;
+ defectInfo.m_nMinSize = nMinSize;
+ defectInfo.m_nBlobDilation = area;
// Image Info
- defectInfo.m_nBlobCount = vecPixelCount[nIdx];
- defectInfo.m_nGray_Max = vecMax[nIdx];
- defectInfo.m_nGray_Min = vecMin[nIdx];
- defectInfo.m_nGray_Sum = vecSum[nIdx];
- defectInfo.m_dGray_Avg = (double)(defectInfo.m_nGray_Sum) / (double)(defectInfo.m_nBlobCount);
- defectInfo.m_dRectArea_Ratio = 100.0 * ((double) defectInfo.m_nBlobCount) / ((double) (rtDefectArea.Width() * rtDefectArea.Height()));
- defectInfo.m_DefectLoc = defectType;
+ defectInfo.m_nBlobCount = vecPixelCount[nIdx];
+ defectInfo.m_nGray_Max = vecMax[nIdx];
+ defectInfo.m_nGray_Min = vecMin[nIdx];
+ defectInfo.m_nGray_Sum = vecSum[nIdx];
+ defectInfo.m_dGray_Avg = (double)(defectInfo.m_nGray_Sum) / (double)(defectInfo.m_nBlobCount);
+ defectInfo.m_dRectArea_Ratio = 100.0 * ((double)defectInfo.m_nBlobCount) / ((double)(rtDefectArea.Width() * rtDefectArea.Height()));
+ defectInfo.m_DefectLoc = defectType;
pDefectList->push_back(defectInfo);
}
@@ -3548,9 +3572,9 @@
return TRUE;
}
-BOOL CInspectCamera::DefectProcess(DimensionDir eDim,int iScan,int iFrame, IplImage* pImageData, IplImage* pBinImage, CRect rtROIPos, int nMinSize, int nMinSizeX, int nMinSizeY, int nDilation, BOOL bStartNearFilter, int nStartNearFilterRange, DefectLocation defectType, std::vector<CDefect_Info>* pDefectList)
+BOOL CInspectCamera::DefectProcess(DimensionDir eDim, int iScan, int iFrame, IplImage* pImageData, IplImage* pBinImage, CRect rtROIPos, int nMinSize, int nMinSizeX, int nMinSizeY, int nDilation, BOOL bStartNearFilter, int nStartNearFilterRange, DefectLocation defectType, std::vector<CDefect_Info>* pDefectList)
{
- if(pDefectList == NULL)
+ if (pDefectList == NULL)
return FALSE;
if (pImageData == NULL || pBinImage == NULL)
@@ -3564,9 +3588,9 @@
cv::Mat pBinMat = cv::Mat::zeros(pBinImage->height, pBinImage->width, CV_8UC1);
- // OwnerBuffer 郴何肺 16硅荐 皋葛府 爱绊 乐绢辑 茄锅俊 墨乔 救蹬..
- for(int i=0; i<pBinImage->height; i++)
- CopyMemory(&pBinMat.data[pBinMat.step1() * i], &pBinImage->imageData[pBinImage->widthStep*i], pBinImage->width);
+ // OwnerBuffer 雮措秬搿� 16氚办垬 氅旊毽� 臧栮碃 鞛堨柎靹� 頃滊矆鞐� 旃错敿 鞎堧徏..
+ for (int i = 0; i < pBinImage->height; i++)
+ CopyMemory(&pBinMat.data[pBinMat.step1() * i], &pBinImage->imageData[pBinImage->widthStep * i], pBinImage->width);
/*
if(0 < nDilation)
@@ -3580,17 +3604,17 @@
// cv::dilate(pBinMat, pBinMat, cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(3, 3)), cv::Point(-1,-1), nDilation);
CString strFileName;
- strFileName.Format(_T("Defect\\%s_Origin"), g_strDefectType[(int) defectType]);
+ strFileName.Format(_T("Defect\\%s_Origin"), g_strDefectType[(int)defectType]);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), pImageData, strFileName);
- strFileName.Format(_T("Defect\\%s_Bin"), g_strDefectType[(int) defectType]);
+ strFileName.Format(_T("Defect\\%s_Bin"), g_strDefectType[(int)defectType]);
SaveDebugImage(eDim, stFrameIndex(iScan, iFrame), pBinImage, strFileName);
cv::Mat matLabel, matStats, matCentrois;
int numOfLables = cv::connectedComponentsWithStats(pBinMat, matLabel, matStats, matCentrois, 8);
- if(numOfLables <= 1) // 硅版 窍唱父 乐澜..
+ if (numOfLables <= 1) // 氚瓣步 頃橂倶毵� 鞛堨潓..
return TRUE;
std::vector<int> vecMin, vecMax, vecSum, vecPixelCount;
@@ -3611,11 +3635,11 @@
{
int nLabelIdx = (int)label[j];
- int nPxlValue = (int)pImageData->imageData[i*pImageData->widthStep+j];
+ int nPxlValue = (int)pImageData->imageData[i * pImageData->widthStep + j];
- if(nLabelIdx == 0)
+ if (nLabelIdx == 0)
continue;
- if(pBinImage->imageData[i*pImageData->widthStep+j] == 0 && nLabelIdx < MAX_DEFECT_COUNT_SIDE)
+ if (pBinImage->imageData[i * pImageData->widthStep + j] == 0 && nLabelIdx < MAX_DEFECT_COUNT_SIDE)
backgroundLables[nLabelIdx] = TRUE;
if (nPxlValue < vecMin[nLabelIdx])
@@ -3630,7 +3654,7 @@
}
}
- int nDefectIdx = (int) pDefectList->size();
+ int nDefectIdx = (int)pDefectList->size();
for (int nIdx = 0; nIdx < numOfLables; nIdx++)
{
@@ -3644,16 +3668,16 @@
int width = matStats.at<int>(nIdx, cv::CC_STAT_WIDTH);
int height = matStats.at<int>(nIdx, cv::CC_STAT_HEIGHT);
- int x = (int)matCentrois.at<double>(nIdx, 0); //吝缴谅钎
+ int x = (int)matCentrois.at<double>(nIdx, 0); //欷戩嫭膦岉憸
int y = (int)matCentrois.at<double>(nIdx, 1);
- if(MAX_DEFECT_COUNT_SIDE < nIdx)
+ if (MAX_DEFECT_COUNT_SIDE < nIdx)
continue;
- if(backgroundLables[nIdx] == TRUE)
+ if (backgroundLables[nIdx] == TRUE)
continue;
- if(nIdx == 0)
+ if (nIdx == 0)
continue;
if ((0 < nStartNearFilterRange && left <= nStartNearFilterRange) || (nStartNearFilterRange < 0 && pBinImage->width + nStartNearFilterRange <= left + width))
@@ -3664,15 +3688,15 @@
if (nMinSizeX != 0)
{
- if(width < nMinSizeX)
- bFiltering = TRUE;
+ if (width < nMinSizeX)
+ bFiltering = TRUE;
}
- if (nMinSizeY!= 0)
+ if (nMinSizeY != 0)
{
if (height < nMinSizeY)
bFiltering = TRUE;
}
-
+
if (bStartNearFilter == TRUE && bStartNear == FALSE)
bFiltering = TRUE;
@@ -3689,27 +3713,27 @@
CDefect_Info defectInfo;
- defectInfo.m_nIndex = nDefectIdx++;
- defectInfo.m_iFrameIdx = iFrame;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = iScan;
- defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) eDim;
+ defectInfo.m_nIndex = nDefectIdx++;
+ defectInfo.m_iFrameIdx = iFrame;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = iScan;
+ defectInfo.m_nGlassStartLine = m_pGlassData->GetSideData(eDim)->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)eDim;
- defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = rtDefectArea;
+ defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = rtDefectArea;
- defectInfo.m_nMinSize = nMinSize;
- defectInfo.m_nBlobDilation = area;
+ defectInfo.m_nMinSize = nMinSize;
+ defectInfo.m_nBlobDilation = area;
// Image Info
- defectInfo.m_nBlobCount = vecPixelCount[nIdx];
- defectInfo.m_nGray_Max = vecMax[nIdx];
- defectInfo.m_nGray_Min = vecMin[nIdx];
- defectInfo.m_nGray_Sum = vecSum[nIdx];
- defectInfo.m_dGray_Avg = (double)(defectInfo.m_nGray_Sum) / (double)(defectInfo.m_nBlobCount);
- defectInfo.m_dRectArea_Ratio = 100.0 * ((double) defectInfo.m_nBlobCount) / ((double) (rtDefectArea.Width() * rtDefectArea.Height()));
- defectInfo.m_DefectLoc = defectType;
+ defectInfo.m_nBlobCount = vecPixelCount[nIdx];
+ defectInfo.m_nGray_Max = vecMax[nIdx];
+ defectInfo.m_nGray_Min = vecMin[nIdx];
+ defectInfo.m_nGray_Sum = vecSum[nIdx];
+ defectInfo.m_dGray_Avg = (double)(defectInfo.m_nGray_Sum) / (double)(defectInfo.m_nBlobCount);
+ defectInfo.m_dRectArea_Ratio = 100.0 * ((double)defectInfo.m_nBlobCount) / ((double)(rtDefectArea.Width() * rtDefectArea.Height()));
+ defectInfo.m_DefectLoc = defectType;
pDefectList->push_back(defectInfo);
}
@@ -3718,59 +3742,59 @@
return TRUE;
}
-BOOL CInspectCamera::Notch_Process(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Notch_Process(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassEndLine == FALSE) // Notch Processing篮 End Line 茫篮 Frame捞..
+ if (pSideData->m_bFindGlassEndLine == FALSE) // Notch Processing鞚� End Line 彀眷潃 Frame鞚�..
return FALSE;
- if(m_pRecipe == NULL)
+ if (m_pRecipe == NULL)
return FALSE;
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return FALSE;
- if(pSideData->m_bNotchInspection_Complete == TRUE)
+ if (pSideData->m_bNotchInspection_Complete == TRUE)
return TRUE;
- int nNotchCount = m_pRecipe->m_SideParam[(int) emDim].m_nNotchCount;
+ int nNotchCount = m_pRecipe->m_SideParam[(int)emDim].m_nNotchCount;
- g_pLog->DisplayMessage(_T("Notch_Process %s : %d, count %d"),g_SideName[(int) emDim], stFrame.nFrameIdx,nNotchCount);
+ g_pLog->DisplayMessage(_T("Notch_Process %s : %d, count %d"), g_SideName[(int)emDim], stFrame.nFrameIdx, nNotchCount);
pSideData->m_nNotchCount = nNotchCount;
- for(int i=0; i<nNotchCount; i++)
+ for (int i = 0; i < nNotchCount; i++)
{
- if(m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_bNotch_Use == FALSE)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_bNotch_Use == FALSE)
continue;
- CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_ptTopMarkPos;
- CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_ptBotMarkPos;
- CRect rtSet_Area = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
+ CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_ptTopMarkPos;
+ CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_ptBotMarkPos;
+ CRect rtSet_Area = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
CRect rtRotateArea;
CRect rtNotchAreaTemp;
- if(GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
+ if (GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
continue;
- g_pLog->DisplayMessage(_T("Notch_Process %s : %d, idx %d - %d,%d,%d,%d"),g_SideName[(int) emDim], stFrame.nFrameIdx,i,rtRotateArea.left,rtRotateArea.top,rtRotateArea.right,rtRotateArea.bottom);
-
+ g_pLog->DisplayMessage(_T("Notch_Process %s : %d, idx %d - %d,%d,%d,%d"), g_SideName[(int)emDim], stFrame.nFrameIdx, i, rtRotateArea.left, rtRotateArea.top, rtRotateArea.right, rtRotateArea.bottom);
+
pSideData->m_rtNotchArea_pxl[i] = rtRotateArea;
- //屏蔽Notch 区域上下位置
+ //韺侁穪Notch 順愬牭 榫滌珝肟�?
rtRotateArea.top += 15;
rtRotateArea.bottom -= 15;
IplImage* pOriginImage;
IplImage* pEdgeImage;
IplImage* pBinImage;
- pOriginImage = cvCreateImageHeader(cvSize(m_nFrameWidth, rtRotateArea.Height()),8,1);
+ pOriginImage = cvCreateImageHeader(cvSize(m_nFrameWidth, rtRotateArea.Height()), 8, 1);
cvSetData(pOriginImage, m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rtRotateArea.top), IMAGE_WIDTH);
pEdgeImage = cvCloneImage(pOriginImage);
pBinImage = cvCloneImage(pOriginImage);
@@ -3823,7 +3847,7 @@
Notch_Process_FindCircle(emDim, stFrame, i);
// 7. Notch Process End
- g_pLog->DisplayMessage(_T("7. Notch_Process %s : %d, idx %d"),g_SideName[(int) emDim], stFrame.nFrameIdx,i);
+ g_pLog->DisplayMessage(_T("7. Notch_Process %s : %d, idx %d"), g_SideName[(int)emDim], stFrame.nFrameIdx, i);
cvReleaseImageHeader(&pOriginImage);
cvReleaseImage(&pEdgeImage);
cvReleaseImage(&pBinImage);
@@ -3844,39 +3868,39 @@
return;
}
- // 中值滤波器大小,用于去噪,必须为奇数(若偶数会自动减1)
+ // 娅撲护飓�旰柬彫雽曢锛岀棸榛樇鑷�锛岅饭浼庢Ж韼滈憭锛堩澕韮夐憭靷旇彵霑§垜1锛�
const int nSmoothFilter = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_nSmooth_Filter;
- // 磨边区域阈值,控制反二值化阈值,主要用于提取 Notch 边缘特征
+ // 旃犼笅順愬牭鍩翠护锛岇櫊榻‰熃霝椾护牒忓煷浠わ紝瀵か鐥伴花鐡婍槫 Notch 旮嬮崓鏅��
const int nGrindThreshold = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_nGrind_Threshold;
- // 玻璃区域阈值,控制正二值化阈值,用于提取玻璃主体区域
+ // 旯检牆順愬牭鍩翠护锛岇櫊榻℃敚霝椾护牒忓煷浠わ紝鐥伴花鐡婍槫旯检牆瀵珶順愬牭
const int nGlassThreshold = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_nGlass_Threshold;
- // 确保奇数滤波器大小
+ // 須呹磸韼滈憭飓�旰柬彫雽曢
int nFilterSize = (nSmoothFilter % 2 == 0) ? (nSmoothFilter - 1) : nSmoothFilter;
if (nFilterSize > 1) {
- // 中值滤波降噪
+ // 娅撲护飓�旰检妷鑷�
cvSmooth(scr, img_Bin, CV_MEDIAN, nFilterSize);
}
- // Edge图:反二值化阈值处理
+ // Edge鏆狅細霟诫灄浠る簭鍩翠护雵轨灴
cvThreshold(scr, img_Edge, nGrindThreshold, 255, CV_THRESH_BINARY_INV);
CString strEdgeFileName;
strEdgeFileName.Format(_T("Notch\\Notch_%d_Edge.jpg"), nNotchIdx);
SaveDebugImage(emDim, stFrame, img_Edge, strEdgeFileName);
- // Bin图:正常二值化
+ // Bin鏆狅細鏀k伣霝椾护牒�
cvThreshold(scr, img_Bin, nGlassThreshold, 255, CV_THRESH_BINARY);
CString strBinFileName;
strBinFileName.Format(_T("Notch\\Notch_%d_Bin.jpg"), nNotchIdx);
SaveDebugImage(emDim, stFrame, img_Bin, strBinFileName);
}
-void CInspectCamera::Notch_Process_Measure(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr,IplImage* img_Edge,IplImage* img_Bin, CRect rtROI)
+void CInspectCamera::Notch_Process_Measure(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr, IplImage* img_Edge, IplImage* img_Bin, CRect rtROI)
{
- if(m_pRecipe == NULL)
+ if (m_pRecipe == NULL)
return;
double dPixelSizeX = m_dPixelSizeX;
@@ -3886,8 +3910,8 @@
IplImage* img_Find_MeasureLine;
IplImage* img_Result = cvCloneImage(scr);
- double th = (double) m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_nReferece_Line_Threshold;
- int nNotchCenterOffset = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_nNotchCenter_Offset_pxl;
+ double th = (double)m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_nReferece_Line_Threshold;
+ int nNotchCenterOffset = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_nNotchCenter_Offset_pxl;
cvThreshold(scr, img_Bin_MeasureLine, th, 255, CV_THRESH_BINARY);
@@ -3897,36 +3921,36 @@
ptSeed.y = img_Bin_MeasureLine->height / 2;
img_Find_MeasureLine = cvCloneImage(img_Bin_MeasureLine);
- // cvFloodFill(img_Find_MeasureLine, ptSeed, CV_RGB(255,255,255)); // 拱 锭巩俊 急捞 谗绢瘤绰 版快啊 乐绢辑 救茄促.
+ // cvFloodFill(img_Find_MeasureLine, ptSeed, CV_RGB(255,255,255)); // 氍� 霑岆鞐� 靹犾澊 雭婌柎歆�電� 瓴届毎臧� 鞛堨柎靹� 鞎堩暅雼�.
// cvThreshold(img_Find_MeasureLine, img_Find_MeasureLine, 100, 255, CV_THRESH_BINARY);
// 2. Find Curve Line
double dStepAngle = 1.0;
- int nFindStep = (int) (360.0 / dStepAngle);
- int nSkipStep = 30; // 贸澜 30档, 场 30档绰 胶诺茄促.
+ int nFindStep = (int)(360.0 / dStepAngle);
+ int nSkipStep = 30; // 觳橃潓 30霃�, 雭� 30霃勲姅 鞀ろ偟頃滊嫟.
IplImage* img_Find_MeasureLine_Point = cvCloneImage(scr);
std::vector<CPoint> vecPointList;
- for(int i=nSkipStep; i < nFindStep-nSkipStep; i++)
+ for (int i = nSkipStep; i < nFindStep - nSkipStep; i++)
{
- double dFindAngle = ((double) i) * dStepAngle;
+ double dFindAngle = ((double)i) * dStepAngle;
double dSearchRadius = 1800.0 + abs(nNotchCenterOffset);
- for(double dRadius = 0.0; dRadius < dSearchRadius; dRadius += 0.5)
+ for (double dRadius = 0.0; dRadius < dSearchRadius; dRadius += 0.5)
{
- int nX = (int) (ptSeed.x - (cos(ToRadian(dFindAngle)) * dRadius));
- int nY = (int) (ptSeed.y - (sin(ToRadian(dFindAngle)) * dRadius));
+ int nX = (int)(ptSeed.x - (cos(ToRadian(dFindAngle)) * dRadius));
+ int nY = (int)(ptSeed.y - (sin(ToRadian(dFindAngle)) * dRadius));
- if(nX < 0 ||img_Find_MeasureLine->width <= nX)
+ if (nX < 0 || img_Find_MeasureLine->width <= nX)
continue;
- if(nY < 0 ||img_Find_MeasureLine->height <= nY)
+ if (nY < 0 || img_Find_MeasureLine->height <= nY)
continue;
- if(img_Find_MeasureLine->imageData[nY * img_Find_MeasureLine->widthStep + nX] != 0)
+ if (img_Find_MeasureLine->imageData[nY * img_Find_MeasureLine->widthStep + nX] != 0)
{
img_Find_MeasureLine_Point->imageData[nY * img_Find_MeasureLine_Point->widthStep + nX] = 255;
@@ -3939,9 +3963,9 @@
}
// 3. Meausre
- int nCount = vecPointList.size()-2;
+ int nCount = vecPointList.size() - 2;
- if(nCount < MAX_SIDE_NOTCH_MEASURE_COUNT) // 螟沥 器牢飘 俊矾
+ if (nCount < MAX_SIDE_NOTCH_MEASURE_COUNT) // 旄§爼 韽澑韸� 鞐愲煬
{
cvReleaseImage(&img_Bin_MeasureLine);
cvReleaseImage(&img_Find_MeasureLine);
@@ -3950,18 +3974,18 @@
return;
}
- double dPointStep = (double) nCount / (MAX_SIDE_NOTCH_MEASURE_COUNT-1); // 16 Point 螟沥..
+ double dPointStep = (double)nCount / (MAX_SIDE_NOTCH_MEASURE_COUNT - 1); // 16 Point 旄§爼..
- for(int nMeasureIdx=0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
+ for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
{
- int nPointIdx = nMeasureIdx * dPointStep;
+ int nPointIdx = nMeasureIdx * (int)dPointStep;
- if(nPointIdx == 0) nPointIdx = 1;
- else if(vecPointList.size() <= nPointIdx) nPointIdx = vecPointList.size() - 1;
+ if (nPointIdx == 0) nPointIdx = 1;
+ else if (vecPointList.size() <= nPointIdx) nPointIdx = vecPointList.size() - 1;
- CPoint pt_Start = vecPointList[nPointIdx-1];
- CPoint pt_End = vecPointList[nPointIdx+1];
- CPoint pt_Measure = vecPointList[nPointIdx];
+ CPoint pt_Start = vecPointList[nPointIdx - 1];
+ CPoint pt_End = vecPointList[nPointIdx + 1];
+ CPoint pt_Measure = vecPointList[nPointIdx];
m_pGlassData->GetSideData(emDim)->m_ptNotch_Reference[nNotchIdx][nMeasureIdx].x = pt_Measure.x; // + rtROI.left;
m_pGlassData->GetSideData(emDim)->m_ptNotch_Reference[nNotchIdx][nMeasureIdx].y = pt_Measure.y + rtROI.top;
@@ -3971,12 +3995,12 @@
double dAngle_Radian = ToRadian(-90.0);
- if(dDiff_X != 0.0)
- dAngle_Radian = atan(dDiff_y/dDiff_X);
+ if (dDiff_X != 0.0)
+ dAngle_Radian = atan(dDiff_y / dDiff_X);
- dAngle_Radian = ToRadian( 90.0 - abs(ToDegree(dAngle_Radian)) );
+ dAngle_Radian = ToRadian(90.0 - abs(ToDegree(dAngle_Radian)));
- if(pt_End.x - pt_Start.x < 0.0)
+ if (pt_End.x - pt_Start.x < 0.0)
dAngle_Radian = dAngle_Radian * -1.0;
double dSearchRadius = 100.0;
@@ -3989,19 +4013,19 @@
BOOL bEdgeCheck = FALSE;
- for(double dRadius = 0.0; dRadius < dSearchRadius; dRadius += 0.2)
+ for (double dRadius = 0.0; dRadius < dSearchRadius; dRadius += 0.2)
{
double dMeasureRadius = dSearchRadius - dRadius;
- int nX = pt_Measure.x - (cos(dAngle_Radian) * dMeasureRadius);
- int nY = pt_Measure.y + (sin(dAngle_Radian) * dMeasureRadius);
+ int nX = (int)(pt_Measure.x - (cos(dAngle_Radian) * dMeasureRadius));
+ int nY = (int)(pt_Measure.y + (sin(dAngle_Radian) * dMeasureRadius));
img_Result->imageData[pt_Measure.y * img_Result->widthStep + pt_Measure.x] = 0;
- if(nX < 0 ||img_Edge->width <= nX)
+ if (nX < 0 || img_Edge->width <= nX)
continue;
- if(nY < 0 ||img_Edge->height <= nY)
+ if (nY < 0 || img_Edge->height <= nY)
continue;
CPoint ptCheck = CPoint(nX, nY);
@@ -4011,41 +4035,41 @@
BOOL bEdgeFind = FALSE;
BOOL bBinEdgeFind = FALSE;
- for(int nCheckX = 0; nCheckX < 3; nCheckX++)
+ for (int nCheckX = 0; nCheckX < 3; nCheckX++)
{
- for(int nCheckY = 0; nCheckY < 3; nCheckY++)
+ for (int nCheckY = 0; nCheckY < 3; nCheckY++)
{
int nFindX = nX - 1 + nCheckX;
int nFindY = nY - 1 + nCheckY;
- if(nFindX < 0 ||img_Edge->width <= nFindX)
+ if (nFindX < 0 || img_Edge->width <= nFindX)
continue;
- if(nFindY < 0 ||img_Edge->height <= nFindY)
+ if (nFindY < 0 || img_Edge->height <= nFindY)
continue;
- if(img_Edge->imageData[nFindY * img_Edge->widthStep + nFindX] != 0)
+ if (img_Edge->imageData[nFindY * img_Edge->widthStep + nFindX] != 0)
{
bEdgeFind = TRUE;
//break;
}
- if(img_Bin->imageData[nFindY * img_Bin->widthStep + nFindX] != 0)
+ if (img_Bin->imageData[nFindY * img_Bin->widthStep + nFindX] != 0)
{
bBinEdgeFind = TRUE;
//break;
}
- if(bEdgeFind == TRUE && bBinEdgeFind == TRUE)
+ if (bEdgeFind == TRUE && bBinEdgeFind == TRUE)
break;
}
- if(bEdgeFind == TRUE && bBinEdgeFind == TRUE)
- break;
+ if (bEdgeFind == TRUE && bBinEdgeFind == TRUE)
+ break;
}
- if(bEdgeCheck == FALSE && (bEdgeFind == TRUE || bBinEdgeFind == TRUE))
+ if (bEdgeCheck == FALSE && (bEdgeFind == TRUE || bBinEdgeFind == TRUE))
{
- if(bFindEdge == FALSE && bEdgeFind == TRUE)
+ if (bFindEdge == FALSE && bEdgeFind == TRUE)
{
img_Result->imageData[nY * img_Result->widthStep + nX] = 255;
bFindEdge = TRUE;
@@ -4058,7 +4082,7 @@
}
//if(ptCheck != ptFindEdge && bFindEdge == TRUE && bFindChamfer == FALSE)
- if(ptCheck != ptFindEdge && bBinEdgeFind == TRUE && bFindChamfer == FALSE)
+ if (ptCheck != ptFindEdge && bBinEdgeFind == TRUE && bFindChamfer == FALSE)
{
img_Result->imageData[nY * img_Result->widthStep + nX] = 200;
bFindChamfer = TRUE;
@@ -4068,12 +4092,12 @@
m_pGlassData->GetSideData(emDim)->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].y = ptFindChamfer.y + rtROI.top;
}
}
- else if(bEdgeCheck == TRUE && bEdgeFind == FALSE)
+ else if (bEdgeCheck == TRUE && bEdgeFind == FALSE)
{
bEdgeCheck = FALSE;
}
- if(bFindEdge == TRUE && bFindChamfer == TRUE)
+ if (bFindEdge == TRUE && bFindChamfer == TRUE)
break;
}
}
@@ -4099,12 +4123,12 @@
return;
}
-bool CInspectCamera::Notch_Process_Calculate(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr,IplImage* img_Edge,IplImage* img_Bin, CRect rtROI)
+bool CInspectCamera::Notch_Process_Calculate(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr, IplImage* img_Edge, IplImage* img_Bin, CRect rtROI)
{
- if(m_pRecipe == NULL || m_pGlassData == NULL)
+ if (m_pRecipe == NULL || m_pGlassData == NULL)
return FALSE;
- for(int nMeasureIdx=0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
+ for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
{
CPoint ptRef_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Reference[nNotchIdx][nMeasureIdx];
CPoint ptDim_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx];
@@ -4113,7 +4137,7 @@
g_pLog->DisplayMessage(_T("[ERROR] Invalid Ref Point at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Point: (%d, %d)"), nNotchIdx, nMeasureIdx, ptRef_pxl.x, ptRef_pxl.y);
continue;
}
-
+
if (ptDim_pxl.x < 0 || ptDim_pxl.y < 0) {
g_pLog->DisplayMessage(_T("[ERROR] Invalid Dim Point at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Point: (%d, %d)"), nNotchIdx, nMeasureIdx, ptDim_pxl.x, ptDim_pxl.y);
continue;
@@ -4145,7 +4169,7 @@
return TRUE;
}
-void CInspectCamera::Notch_Process_Judge(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr,IplImage* img_Edge,IplImage* img_Bin, CRect rtROI)
+void CInspectCamera::Notch_Process_Judge(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr, IplImage* img_Edge, IplImage* img_Bin, CRect rtROI)
{
if (m_pRecipe == NULL || m_pGlassData == NULL) {
g_pLog->DisplayMessage(_T("[ERROR] Recipe or Glass Data is NULL in Notch_Process_Judge"));
@@ -4158,15 +4182,15 @@
return;
}
- for(int nMeasureIdx=0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
+ for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
{
// Dimension
- if(m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_bNotch_Dimension_Use[nMeasureIdx] == TRUE)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_bNotch_Dimension_Use[nMeasureIdx] == TRUE)
{
double dDimension_um = pSideData->m_dNotch_Dimension_Edge_Result_um[nNotchIdx][nMeasureIdx];
- double dDimension_std_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_STD_mm[nMeasureIdx] * 1000.0;
- double dDimension_min_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_Diff_MIN_mm[nMeasureIdx] * 1000.0;
- double dDimension_max_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_Diff_MAX_mm[nMeasureIdx] * 1000.0;
+ double dDimension_std_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_STD_mm[nMeasureIdx] * 1000.0;
+ double dDimension_min_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_Diff_MIN_mm[nMeasureIdx] * 1000.0;
+ double dDimension_max_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Dimension_Diff_MAX_mm[nMeasureIdx] * 1000.0;
double dDimension_Diff_um = dDimension_std_um - dDimension_um;
pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx] = 1;
@@ -4175,48 +4199,48 @@
pSideData->m_dNotch_Dimension_Edge_Judge_Min_um[nNotchIdx][nMeasureIdx] = dDimension_min_um;
pSideData->m_dNotch_Dimension_Edge_Judge_Max_um[nNotchIdx][nMeasureIdx] = dDimension_max_um;
- if(dDimension_um > dDimension_std_um + dDimension_max_um)
+ if (dDimension_um > dDimension_std_um + dDimension_max_um)
pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx] = 2;
- else if(dDimension_um < dDimension_std_um - dDimension_min_um)
+ else if (dDimension_um < dDimension_std_um - dDimension_min_um)
pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx] = 3;
- if(pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx] != 1)
+ if (pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx] != 1)
{
- // Make 搬窃..
+ // Make 瓴绊暔..
CRect rtDefectArea = CRect(pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].x,
- pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].y,
- pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].x,
- pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].y);
+ pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].y,
+ pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].x,
+ pSideData->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx].y);
rtDefectArea.InflateRect(10, 10);
CDefect_Info defectInfo;
- defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = stFrame.nScanIdx;
- defectInfo.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) emDim;
- defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = rtDefectArea;
- defectInfo.m_DefectLoc = DefectLoc_Notch_Dimension;
+ defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = stFrame.nScanIdx;
+ defectInfo.m_nGlassStartLine = pSideData->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)emDim;
+ defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = rtDefectArea;
+ defectInfo.m_DefectLoc = DefectLoc_Notch_Dimension;
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, defectInfo, dDimension_um, dDimension_Diff_um);
}
}
// Chamfer
- if(m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_bNotch_Chamfer_Use[nMeasureIdx] == TRUE)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_bNotch_Chamfer_Use[nMeasureIdx] == TRUE)
{
double dChamfer_um = pSideData->m_dNotch_Chamfer_Edge_Result_um[nNotchIdx][nMeasureIdx];
- double dChamfer_std_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_STD_mm[nMeasureIdx] * 1000.0;
- double dChamfer_min_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_Diff_MIN_mm[nMeasureIdx] * 1000.0;
- double dChamfer_max_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_Diff_MAX_mm[nMeasureIdx] * 1000.0;
+ double dChamfer_std_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_STD_mm[nMeasureIdx] * 1000.0;
+ double dChamfer_min_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_Diff_MIN_mm[nMeasureIdx] * 1000.0;
+ double dChamfer_max_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Chamfer_Diff_MAX_mm[nMeasureIdx] * 1000.0;
double dChamfer_Diff_um = dChamfer_std_um - dChamfer_um;
pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx] = 1;
#if MINI_LED
- //选取测量研磨尺寸最大值
+ //鏈烅槫昕庫妗旍範雱闺嫻闆㈦寱浠�
if (m_nChamferOffset_um < dChamfer_um) {
m_nChamferOffset_um = dChamfer_um;
}
@@ -4227,88 +4251,88 @@
pSideData->m_dNotch_Chamfer_Edge_Judge_Min_um[nNotchIdx][nMeasureIdx] = dChamfer_min_um;
pSideData->m_dNotch_Chamfer_Edge_Judge_Max_um[nNotchIdx][nMeasureIdx] = dChamfer_max_um;
- if(dChamfer_um > dChamfer_std_um + dChamfer_max_um)
+ if (dChamfer_um > dChamfer_std_um + dChamfer_max_um)
pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx] = 2;
- else if(dChamfer_um < dChamfer_std_um - dChamfer_min_um)
+ else if (dChamfer_um < dChamfer_std_um - dChamfer_min_um)
pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx] = 3;
- if(pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx] != 1)
+ if (pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx] != 1)
{
- // Make 搬窃..
+ // Make 瓴绊暔..
CRect rtDefectArea = CRect(pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].x,
- pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].y,
- pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].x,
- pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].y);
+ pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].y,
+ pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].x,
+ pSideData->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx].y);
rtDefectArea.InflateRect(10, 10);
CDefect_Info defectInfo;
- defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
- defectInfo.m_nCamID = m_iCamera;
- defectInfo.m_nScanIdx = stFrame.nScanIdx;
- defectInfo.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- defectInfo.m_nSideIdx = (int) emDim;
- defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
- defectInfo.m_rtDefectPos_pxl = rtDefectArea;
- defectInfo.m_DefectLoc = DefectLoc_Notch_Chamfer;
+ defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
+ defectInfo.m_nCamID = m_iCamera;
+ defectInfo.m_nScanIdx = stFrame.nScanIdx;
+ defectInfo.m_nGlassStartLine = pSideData->m_nGlassStartLine;
+ defectInfo.m_nSideIdx = (int)emDim;
+ defectInfo.m_ptDefectPos_pxl = rtDefectArea.CenterPoint();
+ defectInfo.m_rtDefectPos_pxl = rtDefectArea;
+ defectInfo.m_DefectLoc = DefectLoc_Notch_Chamfer;
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, defectInfo, dChamfer_um, dChamfer_Diff_um);
}
}
// Make Comment
- char strJudge[4][16] = {"None", "OK", "OV", "UN"};
+ char strJudge[4][16] = { "None", "OK", "OV", "UN" };
sprintf(pSideData->m_strNotchMeasure_Comment[nNotchIdx][nMeasureIdx], "NOTCH[%d]-POINT[%d]-DIM[%.1f/STD:%.1f][%s], CHAMFER[%.1f/STD:%.1f][%s]"
- , nNotchIdx+1, nMeasureIdx+1
+ , nNotchIdx + 1, nMeasureIdx + 1
, pSideData->m_dNotch_Dimension_Edge_Result_um[nNotchIdx][nMeasureIdx]
, pSideData->m_dNotch_Dimension_Edge_Judge_Std_um[nNotchIdx][nMeasureIdx]
- , strJudge[pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx]]
- , pSideData->m_dNotch_Chamfer_Edge_Result_um[nNotchIdx][nMeasureIdx]
- , pSideData->m_dNotch_Chamfer_Edge_Judge_Std_um[nNotchIdx][nMeasureIdx]
- , strJudge[pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx]]);
+ , strJudge[pSideData->m_nNotch_Dimension_Edge_Judge[nNotchIdx][nMeasureIdx]]
+ , pSideData->m_dNotch_Chamfer_Edge_Result_um[nNotchIdx][nMeasureIdx]
+ , pSideData->m_dNotch_Chamfer_Edge_Judge_Std_um[nNotchIdx][nMeasureIdx]
+ , strJudge[pSideData->m_nNotch_Chamfer_Edge_Judge[nNotchIdx][nMeasureIdx]]);
}
}
-void CInspectCamera::Notch_Process_Defect(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr,IplImage* img_Edge,IplImage* img_Bin, CRect rtROI)
+void CInspectCamera::Notch_Process_Defect(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx, IplImage* scr, IplImage* img_Edge, IplImage* img_Bin, CRect rtROI)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return;
- if(scr == NULL)
+ if (scr == NULL)
return;
- CNOTCH_PARM* pNotchParam = &m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx];
+ CNOTCH_PARM* pNotchParam = &m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx];
- if(pNotchParam->m_bNotch_Inspect_Defect_Use == FALSE)
+ if (pNotchParam->m_bNotch_Inspect_Defect_Use == FALSE)
return;
-
+
CString strTemp;
-
- int nSide = (int) emDim;
+
+ int nSide = (int)emDim;
int nThreshold = pNotchParam->m_nNotch_Inspect_Defect_Threshold;
int nOffset = pNotchParam->m_nNotch_Inspect_Defect_Offset;
-#if MINI_NOTCH //Defect检测开关, jiang
+#if MINI_NOTCH //Defect靽标繋鞐皯锛� jiang
int nEdgeThres = pNotchParam->m_nGrind_Threshold;
int nNgType = pNotchParam->m_nNotch_Inspect_Defect_Judge_And;
int xNgSize = pNotchParam->m_nNotch_Inspect_Defect_Judge_X_um;
int yNgSize = pNotchParam->m_nNotch_Inspect_Defect_Judge_Y_um;
-
- Log_GetDebug()->TraceInfo("Norch Info: %d, (%d, %d, %d, %d), ROI(%d, %d, %d, %d), %d",
+
+ Log_GetDebug()->TraceInfo("Norch Info: %d, (%d, %d, %d, %d), ROI(%d, %d, %d, %d), %d",
nNotchIdx, nEdgeThres, nThreshold, nOffset, nNgType,
rtROI.left, rtROI.top, rtROI.right, rtROI.bottom, __LINE__);
- //输出计算信息
+ //娓措啍靺曠偓鏂ゅ彛
std::vector<Point2D> vNorchPoints;
- for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++){
+ for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++) {
CPoint ptChamfer_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx];
Point2D point;
point.x = ptChamfer_pxl.x;
point.y = ptChamfer_pxl.y;
- vNorchPoints.push_back(point);
+ vNorchPoints.push_back(point);
}
CRect defectResult[100];
- //nRet为缺陷数量,当前缺陷数 < 1时,表示为OK
+ //nRet妲櫑灞堥憭膦嗭紝霂犿拡頇у眻閼� < 1鐝傦紝旯婂埢妲∣K
int nRet = BlVision_GetSoftVisionApp()->findNorchDefect(nSide, vNorchPoints, rtROI, nEdgeThres, nOffset, nThreshold, nNgType, xNgSize, yNgSize, defectResult);
printf("Norch Defect Number:%d\n", nRet);
@@ -4336,14 +4360,14 @@
m_nChamferOffset_um = 0;
#endif // MINI_LED
- // 防止过大导致耗时或内存问题
+ // 霠濆埠氩曤寱霃旈埓氪弬靸�旖旊嫺鐙傜棛
if (nOffset > 50) {
g_pLog->DisplayMessage(_T("[WARN] Notch defect offset capped to 50 pixels, original: %d"), nOffset);
nOffset = 50;
}
CRect rcIns = rtROI;
- rcIns.OffsetRect(-rcIns.left,-rcIns.top);
+ rcIns.OffsetRect(-rcIns.left, -rcIns.top);
IplImage* pProcImage = cvCreateImage(cvSize(rcIns.Width(), rcIns.Height()), 8, 1);
IplImage* pProcBinImage = cvCreateImage(cvSize(rcIns.Width(), rcIns.Height()), 8, 1);
IplImage* pProcessCanny = cvCreateImage(cvSize(rcIns.Width(), rcIns.Height()), 8, 1);
@@ -4351,11 +4375,11 @@
IplImage* pMaskImage = cvCreateImage(cvSize(rcIns.Width(), rcIns.Height()), 8, 1);
IplImage* pDilatedMaskImage = cvCreateImage(cvSize(rcIns.Width(), rcIns.Height()), 8, 1);
- for(int i=0; i<rcIns.Height(); i++)
+ for (int i = 0; i < rcIns.Height(); i++)
{
- memcpy(pProcImage->imageData+(i*pProcImage->widthStep), scr->imageData+(rtROI.left + (i*scr->widthStep)), rcIns.Width());
- memcpy(pProcessCanny->imageData+(i*pProcessCanny->widthStep), img_Edge->imageData+(rtROI.left + (i*img_Edge->widthStep)), rcIns.Width());
- memcpy(pProcessBin->imageData+(i*pProcessBin->widthStep), img_Bin->imageData+(rtROI.left + (i*img_Bin->widthStep)), rcIns.Width());
+ memcpy(pProcImage->imageData + (i * pProcImage->widthStep), scr->imageData + (rtROI.left + (i * scr->widthStep)), rcIns.Width());
+ memcpy(pProcessCanny->imageData + (i * pProcessCanny->widthStep), img_Edge->imageData + (rtROI.left + (i * img_Edge->widthStep)), rcIns.Width());
+ memcpy(pProcessBin->imageData + (i * pProcessBin->widthStep), img_Bin->imageData + (rtROI.left + (i * img_Bin->widthStep)), rcIns.Width());
}
strTemp.Format(_T("Notch\\Notch_%d_Defect_Edge"), nNotchIdx);
@@ -4369,27 +4393,27 @@
strTemp.Format(_T("Notch\\Notch_%d_Defect_EdgeOrBin"), nNotchIdx);
SaveDebugImage(emDim, stFrame, pMaskImage, strTemp);
-
+
BOOL bFind;
int nFindX;
- for(int y=0;y<pMaskImage->height;y++)
+ for (int y = 0; y < pMaskImage->height; y++)
{
bFind = FALSE;
nFindX = 0;
- for(int x=0;x<pMaskImage->width;x++)
+ for (int x = 0; x < pMaskImage->width; x++)
{
- if(pMaskImage->imageData[y*pMaskImage->widthStep + x] != 0)
+ if (pMaskImage->imageData[y * pMaskImage->widthStep + x] != 0)
{
bFind = TRUE;
nFindX = x;
break;
- }
+ }
}
- if(bFind == TRUE)
+ if (bFind == TRUE)
{
- memset(&pMaskImage->imageData[y*pMaskImage->widthStep], 255, nFindX);
- memset(&pMaskImage->imageData[y*pMaskImage->widthStep+nFindX], 0, pMaskImage->width - nFindX);
+ memset(&pMaskImage->imageData[y * pMaskImage->widthStep], 255, nFindX);
+ memset(&pMaskImage->imageData[y * pMaskImage->widthStep + nFindX], 0, pMaskImage->width - nFindX);
}
}
@@ -4403,10 +4427,10 @@
strTemp.Format(_T("Notch\\Notch_%d_Defect_MaskDilateImage"), nNotchIdx);
SaveDebugImage(emDim, stFrame, pMaskImage, strTemp);
- for(int i=0; i<pMaskImage->height; i++)
- for(int j=0; j<pMaskImage->width; j++)
- if(pMaskImage->imageData[i*pMaskImage->widthStep + j] != 0)
- pProcImage->imageData[i*pProcImage->widthStep+j] = (char) 255;
+ for (int i = 0; i < pMaskImage->height; i++)
+ for (int j = 0; j < pMaskImage->width; j++)
+ if (pMaskImage->imageData[i * pMaskImage->widthStep + j] != 0)
+ pProcImage->imageData[i * pProcImage->widthStep + j] = (char)255;
strTemp.Format(_T("Notch\\Notch_%d_Defect_ProcImage"), nNotchIdx);
SaveDebugImage(emDim, stFrame, pProcImage, strTemp);
@@ -4417,7 +4441,7 @@
SaveDebugImage(emDim, stFrame, pProcBinImage, strTemp);
#if MINI_LED == 0
- // 限制膨胀次数,防止过大导致耗时或内存问题
+ // 鎺橀健韴囬優電撮憭锛岆牆宀弘矔雽曤彅閳措船鐝傡儉旖旊嫺鐙傜棛
int nDilateCount = pNotchParam->m_nNotch_Inspect_Defect_dilate;
nDilateCount = std::max(0, std::min(nDilateCount, 50));
if (pNotchParam->m_nNotch_Inspect_Defect_dilate != nDilateCount) {
@@ -4443,9 +4467,9 @@
int iScan = stFrame.nScanIdx;
int iFrame = stFrame.nFrameIdx;
CRect rtProcessArea = rtROI;
-
- int nMinSize_X = pNotchParam->m_nNotch_Inspect_Defect_Min_X_um / m_pGlassData->GetSideData(emDim)->m_dPixelSizeX;
- int nMinSize_Y = pNotchParam->m_nNotch_Inspect_Defect_Min_Y_um / m_pGlassData->GetSideData(emDim)->m_dPixelSizeY;
+
+ int nMinSize_X = (pNotchParam->m_nNotch_Inspect_Defect_Min_X_um / (int)m_pGlassData->GetSideData(emDim)->m_dPixelSizeX);
+ int nMinSize_Y = (pNotchParam->m_nNotch_Inspect_Defect_Min_Y_um / (int)m_pGlassData->GetSideData(emDim)->m_dPixelSizeY);
int nMinSize = 0;
int nDilation = 0;
@@ -4455,55 +4479,55 @@
std::vector<CDefect_Info> vecDefectCandidateList;
#if MINI_LED == 0
- DefectProcess(emDim, iScan, iFrame, pProcImage, pDilatedMaskImage, rtProcessArea, nMinSize, nMinSize_X, nMinSize_Y, nDilation, bStartNearFilterUse, nStartNearFilterRange, defectLoc, &vecDefectCandidateList);
+ DefectProcess(emDim, iScan, iFrame, pProcImage, pDilatedMaskImage, rtProcessArea, nMinSize, nMinSize_X, nMinSize_Y, nDilation, bStartNearFilterUse, nStartNearFilterRange, defectLoc, &vecDefectCandidateList);
#else
- DefectProcess(emDim, iScan, iFrame, pProcImage, pProcBinImage, rtProcessArea, nMinSize, nMinSize_X, nMinSize_Y, nDilation, bStartNearFilterUse, nStartNearFilterRange, defectLoc, &vecDefectCandidateList);
+ DefectProcess(emDim, iScan, iFrame, pProcImage, pProcBinImage, rtProcessArea, nMinSize, nMinSize_X, nMinSize_Y, nDilation, bStartNearFilterUse, nStartNearFilterRange, defectLoc, &vecDefectCandidateList);
#endif
-
+
m_pDefectControl->ExtractDefect_Notch(emDim, m_iCamera, stFrame.nScanIdx, nNotchIdx, &vecDefectCandidateList);
cvReleaseImage(&pDilatedMaskImage);
cvReleaseImage(&pMaskImage);
cvReleaseImage(&pProcImage);
cvReleaseImage(&pProcBinImage);
- cvReleaseImage(&pProcessCanny);
+ cvReleaseImage(&pProcessCanny);
cvReleaseImage(&pProcessBin);
#endif
}
void CInspectCamera::Notch_Process_FindCircle(DimensionDir emDim, stFrameIndex stFrame, int nNotchIdx)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return;
- if(pSideData->m_bFindGlassEndLine == FALSE) // Notch Processing篮 End Line 茫篮 Frame捞..
+ if (pSideData->m_bFindGlassEndLine == FALSE) // Notch Processing鞚� End Line 彀眷潃 Frame鞚�..
return;
- if(m_pRecipe == NULL)
+ if (m_pRecipe == NULL)
return;
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return;
- CNOTCH_PARM* pNotchParam = &m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx];
+ CNOTCH_PARM* pNotchParam = &m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx];
- if(pNotchParam == NULL)
+ if (pNotchParam == NULL)
return;
int nNotchCircleCount = pNotchParam->m_nNotch_Circle_Count;
pSideData->m_nNotchCircleCount[nNotchIdx] = nNotchCircleCount;
- for(int nCircleIdx = 0; nCircleIdx < nNotchCircleCount; nCircleIdx++)
+ for (int nCircleIdx = 0; nCircleIdx < nNotchCircleCount; nCircleIdx++)
{
BOOL bUse = pNotchParam->m_bNotch_Circle_Use[nCircleIdx];
- if(bUse == FALSE)
+ if (bUse == FALSE)
continue;
// 1. Make ROI
@@ -4529,7 +4553,7 @@
VectorDouble vectorR;
// 2. Get Edge Line
- int nThreshold = m_pRecipe->m_SideParam[(int) emDim].m_nChamferLineThreshold;
+ int nThreshold = m_pRecipe->m_SideParam[(int)emDim].m_nChamferLineThreshold;
LPBYTE pFrameBuffer = m_pGrabber->GetFrameHeader(stFrame.nScanIdx, 0);
@@ -4566,13 +4590,13 @@
SaveDebugImage(emDim, stFrame, pCannyEdgeImage, strTemp);
// Find Edge
- for(int i=0; i<rtROI.Height(); i+=4)
+ for (int i = 0; i < rtROI.Height(); i += 4)
{
- for(int j=0; j<rtROI.Width(); j++)
+ for (int j = 0; j < rtROI.Width(); j++)
{
BYTE nGray = pCannyEdgeImage->imageData[i * pCannyEdgeImage->widthStep + j];
- if(nGray != 0 )
+ if (nGray != 0)
{
double dX_um = j * m_dPixelSizeX; // rtROI.left + j;
double dY_um = i * m_dPixelSizeY; // rtROI.top + i;
@@ -4588,7 +4612,7 @@
cvReleaseImage(&pCannyEdgeImage);
// 3. Circle Fitting
- if(CCHDataFitting::CircleFitting(vectorX, vectorY, vectorR) == 1)
+ if (CCHDataFitting::CircleFitting(vectorX, vectorY, vectorR) == 1)
{
double dCenterPos_X_um = vectorR[0];
double dCenterPos_Y_um = vectorR[1];
@@ -4598,26 +4622,26 @@
double dCenterPos_Y_pxl = rtROI.top + (dCenterPos_Y_um / m_dPixelSizeY);
pSideData->m_nNotchCircle_Radius_Judge[nNotchIdx][nCircleIdx] = 1;
- pSideData->m_ptNotchCircle_Center_pxl[nNotchIdx][nCircleIdx].x = dCenterPos_X_pxl;
- pSideData->m_ptNotchCircle_Center_pxl[nNotchIdx][nCircleIdx].y = dCenterPos_Y_pxl;
+ pSideData->m_ptNotchCircle_Center_pxl[nNotchIdx][nCircleIdx].x = (LONG)dCenterPos_X_pxl;
+ pSideData->m_ptNotchCircle_Center_pxl[nNotchIdx][nCircleIdx].y = (LONG)dCenterPos_Y_pxl;
pSideData->m_ptNotchCircle_Radius_Result_X_pxl[nNotchIdx][nCircleIdx] = dRadiuse_um / m_dPixelSizeX;
pSideData->m_ptNotchCircle_Radius_Result_Y_pxl[nNotchIdx][nCircleIdx] = dRadiuse_um / m_dPixelSizeY;
pSideData->m_ptNotchCircle_Radius_Result_um[nNotchIdx][nCircleIdx] = dRadiuse_um;
// Judge..
- double dStd_um = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_um[nCircleIdx];
- double dMin_um = abs(m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_Min_um[nCircleIdx]) * -1.0;
- double dMax_um = abs(m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_Max_um[nCircleIdx]);
+ double dStd_um = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_um[nCircleIdx];
+ double dMin_um = abs(m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_Min_um[nCircleIdx]) * -1.0;
+ double dMax_um = abs(m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[nNotchIdx].m_dNotch_Circle_Spec_Radius_Max_um[nCircleIdx]);
double dResult_um = dStd_um - dRadiuse_um;
- pSideData->m_ptNotchCircle_Radius_Judge_Std_um[nNotchIdx][nCircleIdx] = dStd_um;
- pSideData->m_ptNotchCircle_Radius_Judge_Min_um[nNotchIdx][nCircleIdx] = dMin_um;
- pSideData->m_ptNotchCircle_Radius_Judge_Max_um[nNotchIdx][nCircleIdx] = dMax_um;
+ pSideData->m_ptNotchCircle_Radius_Judge_Std_um[nNotchIdx][nCircleIdx] = dStd_um;
+ pSideData->m_ptNotchCircle_Radius_Judge_Min_um[nNotchIdx][nCircleIdx] = dMin_um;
+ pSideData->m_ptNotchCircle_Radius_Judge_Max_um[nNotchIdx][nCircleIdx] = dMax_um;
pSideData->m_ptNotchCircle_Radius_Result_Diff_um[nNotchIdx][nCircleIdx] = dResult_um;
- if(dResult_um < dMin_um || dMax_um < dResult_um)
+ if (dResult_um < dMin_um || dMax_um < dResult_um)
{
pSideData->m_nNotchCircle_Radius_Judge[nNotchIdx][nCircleIdx] = 2; // NG
@@ -4627,14 +4651,14 @@
measureDefect.m_nCamID = m_iCamera;
measureDefect.m_nScanIdx = stFrame.nScanIdx;
measureDefect.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- measureDefect.m_nSideIdx = (int) emDim;
+ measureDefect.m_nSideIdx = (int)emDim;
measureDefect.m_DefectLoc = DefectLoc_Notch_Circle_Radius;
measureDefect.m_ptDefectPos_pxl = rtROI.CenterPoint(); // CPoint(nEndPointPosX, nEndPointPosY);
measureDefect.m_rtDefectPos_pxl = CRect(rtROI.CenterPoint().x - 16, rtROI.CenterPoint().y - 16, rtROI.CenterPoint().x + 16, rtROI.CenterPoint().y + 16);
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, measureDefect, dRadiuse_um, dResult_um);
- sprintf(pSideData->m_strNotchCircle_Radius_Comment[nNotchIdx][nCircleIdx], "Rad. [NG] %.1f um / %.1f um", dRadiuse_um, dResult_um);
+ sprintf(pSideData->m_strNotchCircle_Radius_Comment[nNotchIdx][nCircleIdx], "Rad. [NG] %.1f um / %.1f um", dRadiuse_um, dResult_um);
}
else
{
@@ -4644,61 +4668,61 @@
}
}
-BOOL CInspectCamera::Measure(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- int nEndFrame = pSideData->m_nGlassEndLine/m_nFrameHeight;
+ int nEndFrame = pSideData->m_nGlassEndLine / m_nFrameHeight;
- //if(nEndFrame != stFrame.nFrameIdx)
- // return FALSE;
+ //if(nEndFrame != stFrame.nFrameIdx)
+ // return FALSE;
- g_pLog->DisplayMessage(_T("Measure Start %s - %d"),g_SideName[(int) emDim],stFrame.nFrameIdx);
+ g_pLog->DisplayMessage(_T("Measure Start %s - %d"), g_SideName[(int)emDim], stFrame.nFrameIdx);
// Corner..
Measure_TopCorner(iThread, emDim, stFrame);
Measure_BotCorner(iThread, emDim, stFrame);
- if(pSideData->m_bFindGlassEndLine == FALSE) // Side Line篮 End Line 茫篮 Frame 捞 螟沥 茄促..
+ if (pSideData->m_bFindGlassEndLine == FALSE) // Side Line鞚� End Line 彀眷潃 Frame 鞚� 旄§爼 頃滊嫟..
return FALSE;
- g_pLog->DisplayMessage(_T("Side Measure Start %s - %d"),g_SideName[(int) emDim],stFrame.nFrameIdx);
+ g_pLog->DisplayMessage(_T("Side Measure Start %s - %d"), g_SideName[(int)emDim], stFrame.nFrameIdx);
// Side..
Measure_Side(iThread, emDim, stFrame);
- g_pLog->DisplayMessage(_T("Side Measure End %s - %d"),g_SideName[(int) emDim],stFrame.nFrameIdx);
+ g_pLog->DisplayMessage(_T("Side Measure End %s - %d"), g_SideName[(int)emDim], stFrame.nFrameIdx);
return TRUE;
}
-BOOL CInspectCamera::Measure_Side(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_Side(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
if (pSideData->m_bTopMark_Find == FALSE || pSideData->m_bBotMark_Find == FALSE)
{
- g_pLog->DisplayMessage(_T("Error : [%s] Top Align Mark or Bottom Align Mark Y is not detected.. [Fail to Measure Edge to Align Mark Line]"), g_SideName[(int) emDim]);
+ g_pLog->DisplayMessage(_T("Error : [%s] Top Align Mark or Bottom Align Mark Y is not detected.. [Fail to Measure Edge to Align Mark Line]"), g_SideName[(int)emDim]);
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////////////
#if HALCON_VISION_KEY
- //Set Info, 将MARK信息输入到SDK
+ //Set Info, 靿ARK鏂ゅ彛娓错潤霃昐DK
CBlSideData* pBlSideData = BlVision_GetVisionRecipe()->getSideData(emDim); // ->m_bInspection_Complete = TRUE;
pBlSideData->m_bInspection_Complete = TRUE;
pBlSideData->m_dPixelSizeX = pSideData->m_dPixelSizeX;
@@ -4746,7 +4770,7 @@
double distX = GetPixelToUm_X(ptTopAlignMark.x - ptBottomAlignMark.x);
double distY = GetPixelToUm_Y(ptTopAlignMark.y - ptBottomAlignMark.y);
double dTopAlignToBottomAlignDistance = sqrt((distX * distX) + (distY * distY));
-
+
double dGlassTilt_Radian = 0.0;
if (distX != 0.0)
dGlassTilt_Radian = atan(distX / distY);
@@ -4755,22 +4779,22 @@
for (int nMeasurePointIdx = 0; nMeasurePointIdx < nMeasureCount; nMeasurePointIdx++)
{
- if(MAX_SIDE_DIMENSION_MEASURE_COUNT <= nMeasurePointIdx)
+ if (MAX_SIDE_DIMENSION_MEASURE_COUNT <= nMeasurePointIdx)
break;
- if(pSideData->m_bSideMeasureLine[nMeasurePointIdx] == TRUE)
+ if (pSideData->m_bSideMeasureLine[nMeasurePointIdx] == TRUE)
continue;
double dMeasurePointPosX_um = sin(dGlassTilt_Radian) * pSideParam->m_nSideDimensionPos_TopMarkToDistance_um[nMeasurePointIdx];
double dMeasurePointPosY_um = cos(dGlassTilt_Radian) * pSideParam->m_nSideDimensionPos_TopMarkToDistance_um[nMeasurePointIdx];
- int nMeasurePointPosX = ptTopAlignMark.x + (int) GetUmToPixel_X(dMeasurePointPosX_um);
- int nMeasurePointPosY = ptTopAlignMark.y + (int) GetUmToPixel_Y(dMeasurePointPosY_um);
+ int nMeasurePointPosX = ptTopAlignMark.x + (int)GetUmToPixel_X(dMeasurePointPosX_um);
+ int nMeasurePointPosY = ptTopAlignMark.y + (int)GetUmToPixel_Y(dMeasurePointPosY_um);
double dEndPointPosX_um = cos(dGlassTilt_Radian) * nTopEdgeToMark_X_um * -1.0;
double dEndPointPosY_um = sin(dGlassTilt_Radian) * nTopEdgeToMark_X_um;// * -1.0;
- int nEndPointPosX = nMeasurePointPosX + (int) GetUmToPixel_X(dEndPointPosX_um);
- int nEndPointPosY = nMeasurePointPosY + (int) GetUmToPixel_Y(dEndPointPosY_um);
+ int nEndPointPosX = nMeasurePointPosX + (int)GetUmToPixel_X(dEndPointPosX_um);
+ int nEndPointPosY = nMeasurePointPosY + (int)GetUmToPixel_Y(dEndPointPosY_um);
int nFindRangeX = 100;
int nFindRangeY = 20;
@@ -4778,40 +4802,40 @@
CRect rtFindPos = CRect(nEndPointPosX, nEndPointPosY, nEndPointPosX, nEndPointPosY);
rtFindPos.InflateRect(nFindRangeX, nFindRangeY);
- if(rtFindPos.left < 0) rtFindPos.left = 0;
- if(m_nFrameWidth <= rtFindPos.right) rtFindPos.right = m_nFrameWidth-1;
- if(rtFindPos.top < pSideData->m_nGlassStartLine) rtFindPos.top = pSideData->m_nGlassStartLine;
- if(pSideData->m_nGlassEndLine < rtFindPos.bottom) rtFindPos.bottom = pSideData->m_nGlassEndLine;
+ if (rtFindPos.left < 0) rtFindPos.left = 0;
+ if (m_nFrameWidth <= rtFindPos.right) rtFindPos.right = m_nFrameWidth - 1;
+ if (rtFindPos.top < pSideData->m_nGlassStartLine) rtFindPos.top = pSideData->m_nGlassStartLine;
+ if (pSideData->m_nGlassEndLine < rtFindPos.bottom) rtFindPos.bottom = pSideData->m_nGlassEndLine;
- if(rtFindPos.left >= rtFindPos.right)
+ if (rtFindPos.left >= rtFindPos.right)
continue;
- if(rtFindPos.top >= rtFindPos.bottom)
+ if (rtFindPos.top >= rtFindPos.bottom)
continue;
- if(rtFindPos.Width() <= 20 || rtFindPos.Height() <= 2)
- continue;
+ if (rtFindPos.Width() <= 20 || rtFindPos.Height() <= 2)
+ continue;
LPBYTE pFrameBuffer = m_pGrabber->GetFrameHeader(stFrame.nScanIdx, 0);
- if(pFrameBuffer == NULL)
+ if (pFrameBuffer == NULL)
continue;
COwnerBuffer pFindImage = COwnerBuffer(rtFindPos.Width(), rtFindPos.Height());
- for(int i=0; i<rtFindPos.Height(); i++)
+ for (int i = 0; i < rtFindPos.Height(); i++)
memcpy(pFindImage.GetDataAddress(0, i), pFrameBuffer + (m_nFrameWidth * (rtFindPos.top + i)) + rtFindPos.left, rtFindPos.Width());
- //{
- // CString str;
- // str.Format(_T("D:\\Inspection\\DebugFullImg\\Side\\Org_%s_%02d.bmp"),g_SideName[(int) emDim],nMeasurePointIdx);
- // CBufferAttach attach(str);
- // attach.AttachToFile(pFindImage);
- //}
+ //{
+ // CString str;
+ // str.Format(_T("D:\\Inspection\\DebugFullImg\\Side\\Org_%s_%02d.bmp"),g_SideName[(int) emDim],nMeasurePointIdx);
+ // CBufferAttach attach(str);
+ // attach.AttachToFile(pFindImage);
+ //}
- int nSideLineThres = m_pRecipe->m_SideParam[(int) emDim].m_nSideLineThreshold;
- int nChamferLineThres = m_pRecipe->m_SideParam[(int) emDim].m_nChamferLineThreshold;
+ int nSideLineThres = m_pRecipe->m_SideParam[(int)emDim].m_nSideLineThreshold;
+ int nChamferLineThres = m_pRecipe->m_SideParam[(int)emDim].m_nChamferLineThreshold;
- CRect rtFindROI = CRect(0,0,rtFindPos.Width()-1, rtFindPos.Height()-1);
-
+ CRect rtFindROI = CRect(0, 0, rtFindPos.Width() - 1, rtFindPos.Height() - 1);
+
int nFindEdgeLine = -1;
int nFindChamferLine = -1;
@@ -4825,25 +4849,25 @@
rtFindROI.left = nFindEdgeLine + 3;
CChamferInspect chamferIns;
- COwnerBuffer ImgInsBin;
- chamferIns.Binarization(pFindImage,ImgInsBin,nChamferLineThres);
+ COwnerBuffer ImgInsBin;
+ chamferIns.Binarization(pFindImage, ImgInsBin, nChamferLineThres);
- //{
- // CString str;
- // str.Format(_T("D:\\Inspection\\DebugFullImg\\Side\\Bin_%s_%02d.bmp"),g_SideName[(int) emDim],nMeasurePointIdx);
- // CBufferAttach attach(str);
- // attach.AttachToFile(ImgInsBin);
- //}
+ //{
+ // CString str;
+ // str.Format(_T("D:\\Inspection\\DebugFullImg\\Side\\Bin_%s_%02d.bmp"),g_SideName[(int) emDim],nMeasurePointIdx);
+ // CBufferAttach attach(str);
+ // attach.AttachToFile(ImgInsBin);
+ //}
double dLine = -1;
- chamferIns.FindRightLine_Bin(ImgInsBin,nFindEdgeLine,dLine);
+ chamferIns.FindRightLine_Bin(ImgInsBin, nFindEdgeLine, dLine);
nFindChamferLine = (int)dLine;
//EdgeFind.FindEdge_ToRightROI(&pFindImage, nFindChamferLine, DEFECT_EDGE_AUTO_PITCH, nChamferLineThres, DEFECT_EDGE_AUTO_RATIO, 0, rtFindROI);
-
+
int nSideLine = rtFindPos.left + nFindEdgeLine;
int nChamferLine = rtFindPos.left + ((nFindChamferLine != -1 && pSideParam->m_bSideChamfer_Use[nMeasurePointIdx] == TRUE) ? nFindChamferLine : nFindEdgeLine);
- // Frame俊辑 措钎肺 茫篮吧肺 螟沥 搬苞肺 静霸 沁绰单.... 捞固瘤俊辑 促矫 茫档废 荐沥捞 鞘夸..且鳖??
+ // Frame鞐愳劀 雽�響滊 彀眷潃瓯鸽 旄§爼 瓴瓣臣搿� 鞊瓣矊 頄堧姅雿�.... 鞚措歆�鞐愳劀 雼れ嫓 彀倦弰搿� 靾橃爼鞚� 頃勳殧..頃犼箤??
int nFrameIdx = (int)(nEndPointPosY / m_nFrameHeight);
/*
int nSideLine = pSideData->m_nSideLineFrame[nFrameIdx];
@@ -4864,15 +4888,15 @@
pSideData->m_ptSideMeasure_ChamferLine[nMeasurePointIdx] = ptEnd_ChamferLine; // Measure Chamfer Line..
pSideData->m_dSideMeasrue_Chamfer_Result_mm[nMeasurePointIdx] = dDistance_ChamferLine_mm;
-
+
pSideData->m_bSideMeasureLine[nMeasurePointIdx] = TRUE;
- // 烙矫肺 阜澜. SW 促款.
+ // 鞛勳嫓搿� 毵夓潓. SW 雼れ毚.
// continue;
// Dimension
double dTempValue = pSideParam->m_dSideDimensionSpec_mm_Std[nMeasurePointIdx];
- if(pSideParam->m_bSideDimension_Use[nMeasurePointIdx] == TRUE && dTempValue >= 0)
+ if (pSideParam->m_bSideDimension_Use[nMeasurePointIdx] == TRUE && dTempValue >= 0)
{
double dStd_mm = pSideParam->m_dSideDimensionSpec_mm_Std[nMeasurePointIdx];
double dMin_mm = (dStd_mm - abs(pSideParam->m_dSideDimensionSpec_mm_Min[nMeasurePointIdx]));
@@ -4880,7 +4904,7 @@
double dResult_mm = dDistance_CutLine_mm;
- if(dResult_mm < dMin_mm || dMax_mm < dResult_mm)
+ if (dResult_mm < dMin_mm || dMax_mm < dResult_mm)
{
pSideData->m_nSideMeasure_CutLine_Status[nMeasurePointIdx] = 2; // NG
@@ -4906,23 +4930,23 @@
measureDefect.m_nCamID = m_iCamera;
measureDefect.m_nScanIdx = stFrame.nScanIdx;
measureDefect.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- measureDefect.m_nSideIdx = (int) emDim;
+ measureDefect.m_nSideIdx = (int)emDim;
measureDefect.m_DefectLoc = DefectLoc_Measure_Dimension;
measureDefect.m_ptDefectPos_pxl = ptEnd_CutLine; // CPoint(nEndPointPosX, nEndPointPosY);
measureDefect.m_rtDefectPos_pxl = CRect(ptEnd_CutLine.x - 16, ptEnd_CutLine.y - 16, ptEnd_CutLine.x + 16, ptEnd_CutLine.y + 16);
- g_pLog->DisplayMessage(_T("Measure Glass Line NG Start %s-%d : %d,%d"),g_SideName[(int) emDim],nMeasurePointIdx,measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Glass Line NG Start %s-%d : %d,%d"), g_SideName[(int)emDim], nMeasurePointIdx, measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, measureDefect, dDistance_CutLine_mm, dResult_mm);
- g_pLog->DisplayMessage(_T("Measure Glass Line NG End %s-%d : %d,%d"),g_SideName[(int) emDim],nMeasurePointIdx,measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Glass Line NG End %s-%d : %d,%d"), g_SideName[(int)emDim], nMeasurePointIdx, measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
}
else
pSideData->m_nSideMeasure_CutLine_Status[nMeasurePointIdx] = 1; // OK
}
else if (pSideParam->m_bSideDimension_Use[nMeasurePointIdx] == TRUE && dTempValue < -0.01) {
#if HALCON_VISION_KEY
- //切割线的长度计算, jiang, 09-27, 2024
+ //頃欕獓绐熾彣雮�霕戩厱鐐�, jiang, 09-27, 2024
int nThres = pSideParam->m_nSideDimensionSpec_Thres[nMeasurePointIdx];
int toLineDist = 1000 * pSideParam->m_dSideDimensionSpec_mm_Std[nMeasurePointIdx];
int toTopY = pSideParam->m_nSideDimensionPos_TopMarkToDistance_um[nMeasurePointIdx];
@@ -5012,7 +5036,7 @@
}
// Chamfer
- if(pSideParam->m_bSideChamfer_Use[nMeasurePointIdx] == TRUE)
+ if (pSideParam->m_bSideChamfer_Use[nMeasurePointIdx] == TRUE)
{
double dStd_mm = pSideParam->m_dSideChamfer_Spec_mm_Std[nMeasurePointIdx];
double dMin_mm = (dStd_mm - abs(pSideParam->m_dSideChamfer_Spec_mm_Min[nMeasurePointIdx]));
@@ -5020,7 +5044,7 @@
double dResult_mm = dDistance_ChamferLine_mm;
- if(dResult_mm < dMin_mm || dMax_mm < dResult_mm)
+ if (dResult_mm < dMin_mm || dMax_mm < dResult_mm)
{
pSideData->m_nSideMeasure_ChamferLine_Status[nMeasurePointIdx] = 2; // NG
@@ -5030,16 +5054,16 @@
measureDefect.m_nCamID = m_iCamera;
measureDefect.m_nScanIdx = stFrame.nScanIdx;
measureDefect.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- measureDefect.m_nSideIdx = (int) emDim;
+ measureDefect.m_nSideIdx = (int)emDim;
measureDefect.m_DefectLoc = DefectLoc_Measure_Chamfer;
measureDefect.m_ptDefectPos_pxl = CPoint(nEndPointPosX, nEndPointPosY);
measureDefect.m_rtDefectPos_pxl = CRect(nEndPointPosX - 100, nEndPointPosY - 100, nEndPointPosX + 100, nEndPointPosY + 100);
- g_pLog->DisplayMessage(_T("Measure Glass NG Chamfer Start %s-%d : %d,%d"),g_SideName[(int) emDim],nMeasurePointIdx,measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Glass NG Chamfer Start %s-%d : %d,%d"), g_SideName[(int)emDim], nMeasurePointIdx, measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, measureDefect, dDistance_CutLine_mm, dResult_mm);
- g_pLog->DisplayMessage(_T("Measure Glass NG Chamfer End %s-%d : %d,%d"),g_SideName[(int) emDim],nMeasurePointIdx,measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Glass NG Chamfer End %s-%d : %d,%d"), g_SideName[(int)emDim], nMeasurePointIdx, measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
/*
// Make Defect
@@ -5064,24 +5088,24 @@
pSideData->m_nSideMeasure_ChamferLine_Status[nMeasurePointIdx] = 1; // OK
}
- g_pLog->DisplayMessage(_T("Measure End %s-%d : %d,%d,%d,%d"),g_SideName[(int) emDim],nMeasurePointIdx,rtFindPos.left,rtFindPos.top,rtFindPos.right,rtFindPos.bottom);
+ g_pLog->DisplayMessage(_T("Measure End %s-%d : %d,%d,%d,%d"), g_SideName[(int)emDim], nMeasurePointIdx, rtFindPos.left, rtFindPos.top, rtFindPos.right, rtFindPos.bottom);
}
return TRUE;
}
-BOOL CInspectCamera::Measure_TopCorner(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_TopCorner(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
- if(pSideParam->m_bTopCornerMeasureSize == FALSE)
+ if (pSideParam->m_bTopCornerMeasureSize == FALSE)
return FALSE;
if (pSideData->m_bTopCorner_Find == FALSE)
@@ -5092,36 +5116,36 @@
int nTopCornerType = pSideData->m_nTopCornerShape;
- if(nTopCornerType == (int) 1) return Measure_TopCorner_CCut(iThread, emDim, stFrame);
- else if(nTopCornerType == (int) 2) return Measure_TopCorner_RCut(iThread, emDim, stFrame);
+ if (nTopCornerType == (int)1) return Measure_TopCorner_CCut(iThread, emDim, stFrame);
+ else if (nTopCornerType == (int)2) return Measure_TopCorner_RCut(iThread, emDim, stFrame);
else pSideData->m_bTopCorner_Measure = TRUE;
return TRUE;
}
-BOOL CInspectCamera::Measure_TopCorner_CCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_TopCorner_CCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
CRect rtTopCornerArea = pSideData->m_rtTopCornerArea;
- rtTopCornerArea.InflateRect(50,50);
-
+ rtTopCornerArea.InflateRect(50, 50);
- int iCornerFrame = rtTopCornerArea.bottom/m_nFrameHeight;
- if(iCornerFrame > stFrame.nFrameIdx)
+ int iCornerFrame = rtTopCornerArea.bottom / m_nFrameHeight;
+
+ if (iCornerFrame > stFrame.nFrameIdx)
return FALSE;
- // Corner 八荤 父甸扁..
- if(FindCorner(iThread,emDim,stFrame,0,rtTopCornerArea) == TRUE)
+ // Corner 瓴�靷� 毵岆摛旮�..
+ if (FindCorner(iThread, emDim, stFrame, 0, rtTopCornerArea) == TRUE)
{
double dXSizeStd_um = pSideParam->m_nTopCorner_Measure_Judge_Std_um_X;
double dXSizeMin_um = pSideParam->m_nTopCorner_Measure_Judge_Min_um_X;
@@ -5131,29 +5155,29 @@
double dYSizeMax_um = pSideParam->m_nTopCorner_Measure_Judge_Max_um_Y;
int nOpt = pSideParam->m_nTopCorner_Measure_Judge_OR_AND;
- if(nOpt == 0)
+ if (nOpt == 0)
return FALSE;
double dResultWidth_um = pSideData->m_nTopCornerWidth;
double dResultHeight_um = pSideData->m_nTopCornerHeight;
pSideData->m_bTopCornerMeasureResult = TRUE;
- if(nOpt == 1) // or
+ if (nOpt == 1) // or
{
- if( (dResultWidth_um < dXSizeStd_um-dXSizeMin_um || dResultWidth_um > dXSizeStd_um+dXSizeMax_um) || (dResultHeight_um < dYSizeStd_um-dYSizeMin_um || dResultHeight_um > dYSizeStd_um+dYSizeMax_um))
+ if ((dResultWidth_um < dXSizeStd_um - dXSizeMin_um || dResultWidth_um > dXSizeStd_um + dXSizeMax_um) || (dResultHeight_um < dYSizeStd_um - dYSizeMin_um || dResultHeight_um > dYSizeStd_um + dYSizeMax_um))
{
pSideData->m_bTopCornerMeasureResult = FALSE; // NG
}
}
else // and
{
- if( (dResultWidth_um < dXSizeStd_um-dXSizeMin_um || dResultWidth_um > dXSizeStd_um+dXSizeMax_um) && (dResultHeight_um < dYSizeStd_um-dYSizeMin_um || dResultHeight_um > dYSizeStd_um+dYSizeMax_um))
+ if ((dResultWidth_um < dXSizeStd_um - dXSizeMin_um || dResultWidth_um > dXSizeStd_um + dXSizeMax_um) && (dResultHeight_um < dYSizeStd_um - dYSizeMin_um || dResultHeight_um > dYSizeStd_um + dYSizeMax_um))
{
pSideData->m_bTopCornerMeasureResult = FALSE; // NG
}
}
- if(pSideData->m_bTopCornerMeasureResult == FALSE)
+ if (pSideData->m_bTopCornerMeasureResult == FALSE)
{
// Make Defect
CDefect_Info measureDefect;
@@ -5162,47 +5186,47 @@
measureDefect.m_nCamID = m_iCamera;
measureDefect.m_nScanIdx = stFrame.nScanIdx;
measureDefect.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- measureDefect.m_nSideIdx = (int) emDim;
+ measureDefect.m_nSideIdx = (int)emDim;
measureDefect.m_DefectLoc = DefectLoc_Measure_Corner;
measureDefect.m_ptDefectPos_pxl = pSideData->m_rtTopCornerResult[1].CenterPoint();
measureDefect.m_rtDefectPos_pxl = CRect(measureDefect.m_ptDefectPos_pxl.x - 16, measureDefect.m_ptDefectPos_pxl.y - 16, measureDefect.m_ptDefectPos_pxl.x + 16, measureDefect.m_ptDefectPos_pxl.y + 16);
- g_pLog->DisplayMessage(_T("Measure Top Corner NG Start %s : %d,%d"),g_SideName[(int) emDim],measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Top Corner NG Start %s : %d,%d"), g_SideName[(int)emDim], measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, measureDefect, dResultWidth_um, dResultHeight_um);
- g_pLog->DisplayMessage(_T("Measure Top Corner NG End %s : %d,%d"),g_SideName[(int) emDim],measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Top Corner NG End %s : %d,%d"), g_SideName[(int)emDim], measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
}
-
+
}
-
+
return TRUE;
}
-BOOL CInspectCamera::FindCorner(int iThread,DimensionDir emDim, stFrameIndex stFrame,int nPos,CRect rtConnerRoi)
-{
- g_pLog->DisplayMessage(_T("%s Corner pos %d, frame %d - %d,%d,%d,%d"),g_SideName[(int) emDim],nPos,stFrame.nFrameIdx,rtConnerRoi.left,rtConnerRoi.top,rtConnerRoi.right,rtConnerRoi.bottom);
+BOOL CInspectCamera::FindCorner(int iThread, DimensionDir emDim, stFrameIndex stFrame, int nPos, CRect rtConnerRoi)
+{
+ g_pLog->DisplayMessage(_T("%s Corner pos %d, frame %d - %d,%d,%d,%d"), g_SideName[(int)emDim], nPos, stFrame.nFrameIdx, rtConnerRoi.left, rtConnerRoi.top, rtConnerRoi.right, rtConnerRoi.bottom);
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
// 1. Make ROI
rtConnerRoi.left = (rtConnerRoi.left < 0) ? 0 : rtConnerRoi.left;
rtConnerRoi.top = (rtConnerRoi.top < 0) ? 0 : rtConnerRoi.top;
- rtConnerRoi.right = (rtConnerRoi.right >= m_nFrameWidth) ? m_nFrameWidth-1 : rtConnerRoi.right;
+ rtConnerRoi.right = (rtConnerRoi.right >= m_nFrameWidth) ? m_nFrameWidth - 1 : rtConnerRoi.right;
// 2. Get Image Buffer
- BYTE* pBuffer = m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rtConnerRoi.top);
- IplImage* pConnerOriginImage = cvCreateImage(cvSize(rtConnerRoi.Width(), rtConnerRoi.Height()), 8, 1);
+ BYTE* pBuffer = m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rtConnerRoi.top);
+ IplImage* pConnerOriginImage = cvCreateImage(cvSize(rtConnerRoi.Width(), rtConnerRoi.Height()), 8, 1);
IplImage* pConnerEdgeImage;
- IplImage* pConnerEdgeOutLineImage = cvCreateImage(cvSize(rtConnerRoi.Width(), rtConnerRoi.Height()), 8, 1);
+ IplImage* pConnerEdgeOutLineImage = cvCreateImage(cvSize(rtConnerRoi.Width(), rtConnerRoi.Height()), 8, 1);
- if(pBuffer == NULL)
+ if (pBuffer == NULL)
return FALSE;
- for(int i=0; i<rtConnerRoi.Height(); i++)
- memcpy(pConnerOriginImage->imageData+(i*pConnerOriginImage->widthStep), (char*) &pBuffer[rtConnerRoi.left + (i*m_nFrameWidth)], rtConnerRoi.Width());
+ for (int i = 0; i < rtConnerRoi.Height(); i++)
+ memcpy(pConnerOriginImage->imageData + (i * pConnerOriginImage->widthStep), (char*)&pBuffer[rtConnerRoi.left + (i * m_nFrameWidth)], rtConnerRoi.Width());
pConnerEdgeImage = cvCloneImage(pConnerOriginImage);
@@ -5215,14 +5239,14 @@
BOOL bFind = FALSE;
int nContinueCount = 5;
- UINT nTarget = 0;
- UINT nCompare = 0;
- int nDiff = 0;
+ UINT nTarget = 0;
+ UINT nCompare = 0;
+ int nDiff = 0;
int nEdgeFilter;
double dCornerEdgeTh1;
- if(nPos == 0)
+ if (nPos == 0)
{
nEdgeFilter = pSideParam->m_nTopCornerEdgeFilterSize;
dCornerEdgeTh1 = pSideParam->m_nTopCornerEdgeThreshold;
@@ -5233,46 +5257,46 @@
dCornerEdgeTh1 = pSideParam->m_nBottomCornerEdgeThreshold;
}
- if(nEdgeFilter % 2 == 0)
+ if (nEdgeFilter % 2 == 0)
nEdgeFilter = nEdgeFilter - 1;
- if(1 < nEdgeFilter)
+ if (1 < nEdgeFilter)
cvSmooth(pConnerEdgeImage, pConnerEdgeImage, CV_MEDIAN, nEdgeFilter);
- dCornerEdgeTh1 *= 10.;
+ dCornerEdgeTh1 *= 10.;
double dCornerEdgeTh2 = 40.0;
- int sigma=5;
+ int sigma = 5;
cvCanny(pConnerEdgeImage, pConnerEdgeImage, dCornerEdgeTh1, dCornerEdgeTh2, sigma);
// Side
- for(int i=0; i<pConnerEdgeImage->height; i++)
+ for (int i = 0; i < pConnerEdgeImage->height; i++)
{
- for(int j=0; j<pConnerEdgeImage->width; j++)
+ for (int j = 0; j < pConnerEdgeImage->width; j++)
{
- nTarget = (UINT) pConnerEdgeImage->imageData[pConnerOriginImage->widthStep*i + j];
+ nTarget = (UINT)pConnerEdgeImage->imageData[pConnerOriginImage->widthStep * i + j];
- if(nTarget != 0)
+ if (nTarget != 0)
{
- pConnerEdgeOutLineImage->imageData[pConnerOriginImage->widthStep*i + j] = 255;
+ pConnerEdgeOutLineImage->imageData[pConnerOriginImage->widthStep * i + j] = 255;
break;
}
}
}
// Top, Bottom
- if(nPos == 0)
+ if (nPos == 0)
{
- for(int i=0; i<pConnerEdgeImage->width; i++)
+ for (int i = 0; i < pConnerEdgeImage->width; i++)
{
- for(int j=0; j<pConnerEdgeImage->height; j++)
+ for (int j = 0; j < pConnerEdgeImage->height; j++)
{
- nTarget = (UINT) pConnerEdgeImage->imageData[pConnerOriginImage->widthStep*j + i];
+ nTarget = (UINT)pConnerEdgeImage->imageData[pConnerOriginImage->widthStep * j + i];
- if(nTarget != 0)
+ if (nTarget != 0)
{
- pConnerEdgeOutLineImage->imageData[pConnerEdgeOutLineImage->widthStep*j + i] = 255;
+ pConnerEdgeOutLineImage->imageData[pConnerEdgeOutLineImage->widthStep * j + i] = 255;
break;
}
}
@@ -5280,15 +5304,15 @@
}
else
{
- for(int i=0; i<pConnerEdgeImage->width; i++)
+ for (int i = 0; i < pConnerEdgeImage->width; i++)
{
- for(int j=0; j<pConnerEdgeImage->height; j++)
+ for (int j = 0; j < pConnerEdgeImage->height; j++)
{
- nTarget = (UINT) pConnerEdgeImage->imageData[pConnerOriginImage->widthStep*(pConnerOriginImage->height- 1 -j) + i];
+ nTarget = (UINT)pConnerEdgeImage->imageData[pConnerOriginImage->widthStep * (pConnerOriginImage->height - 1 - j) + i];
- if(nTarget != 0)
+ if (nTarget != 0)
{
- pConnerEdgeOutLineImage->imageData[pConnerEdgeOutLineImage->widthStep*(pConnerEdgeOutLineImage->height- 1 -j) + i] = 255;
+ pConnerEdgeOutLineImage->imageData[pConnerEdgeOutLineImage->widthStep * (pConnerEdgeOutLineImage->height - 1 - j) + i] = 255;
break;
}
}
@@ -5300,7 +5324,7 @@
strTemp.Format(_T("Corner\\ConnerProcess_OutLine_%d.jpg"), nPos);
SaveDebugImage(emDim, stFrame, pConnerEdgeOutLineImage, strTemp);
-
+
// 4. OutLine Projection Data
std::vector<int> vecProjectionX;
@@ -5311,13 +5335,13 @@
int nValue;
- for(int i=0; i<rtConnerRoi.Height(); i++)
+ for (int i = 0; i < rtConnerRoi.Height(); i++)
{
- for(int j=0; j<rtConnerRoi.Width(); j++)
+ for (int j = 0; j < rtConnerRoi.Width(); j++)
{
- nValue = (int) pConnerEdgeOutLineImage->imageData[j+(i*pConnerEdgeOutLineImage->widthStep)];
+ nValue = (int)pConnerEdgeOutLineImage->imageData[j + (i * pConnerEdgeOutLineImage->widthStep)];
- if(pConnerEdgeOutLineImage->imageData[i*pConnerEdgeOutLineImage->widthStep + j] != 0)
+ if (pConnerEdgeOutLineImage->imageData[i * pConnerEdgeOutLineImage->widthStep + j] != 0)
{
vecProjectionX[j]++;
vecProjectionY[i]++;
@@ -5328,12 +5352,12 @@
// 5. Find Edge
CPoint ptConner[3];
- int nMaxCount = -1;
- int nMaxIdx = 0;
+ int nMaxCount = -1;
+ int nMaxIdx = 0;
- for(int i=0; i<rtConnerRoi.Width(); i++)
+ for (int i = 0; i < rtConnerRoi.Width(); i++)
{
- if(nMaxCount < vecProjectionX[i])
+ if (nMaxCount < vecProjectionX[i])
{
nMaxIdx = i;
nMaxCount = vecProjectionX[i];
@@ -5341,14 +5365,14 @@
}
ptConner[0].x = ptConner[1].x = ptConner[2].x = nMaxIdx;
- if(nPos == 0)
+ if (nPos == 0)
{
- nMaxCount = -1;
- nMaxIdx = 0;
+ nMaxCount = -1;
+ nMaxIdx = 0;
- for(int i=0; i<rtConnerRoi.Height(); i++)
+ for (int i = 0; i < rtConnerRoi.Height(); i++)
{
- if(nMaxCount < vecProjectionY[i])
+ if (nMaxCount < vecProjectionY[i])
{
nMaxIdx = i;
nMaxCount = vecProjectionY[i];
@@ -5359,12 +5383,12 @@
}
else
{
- nMaxCount = -1;
- nMaxIdx = 0;
+ nMaxCount = -1;
+ nMaxIdx = 0;
- for(int i=rtConnerRoi.Height()-1; 0 <= i; i--)
+ for (int i = rtConnerRoi.Height() - 1; 0 <= i; i--)
{
- if(nMaxCount < vecProjectionY[i])
+ if (nMaxCount < vecProjectionY[i])
{
nMaxIdx = i;
nMaxCount = vecProjectionY[i];
@@ -5374,41 +5398,41 @@
ptConner[0].y = ptConner[1].y = ptConner[2].y = nMaxIdx;
}
- double dCornerSizeY_Um = (double)pSideParam->m_nTopCornerSizeY_um;
- int nCornerSizeY_Pixel = (int) GetUmToPixel_Y(dCornerSizeY_Um);
- double dCornerSizeX_Um = (double) pSideParam->m_nTopCornerSizeX_um;
- int nCornerSizeX_Pixel = (int) GetUmToPixel_X(dCornerSizeX_Um);
+ double dCornerSizeY_Um = (double)pSideParam->m_nTopCornerSizeY_um;
+ int nCornerSizeY_Pixel = (int)GetUmToPixel_Y(dCornerSizeY_Um);
+ double dCornerSizeX_Um = (double)pSideParam->m_nTopCornerSizeX_um;
+ int nCornerSizeX_Pixel = (int)GetUmToPixel_X(dCornerSizeX_Um);
// 6. Find Conner Cut :
- if(nCornerSizeX_Pixel != 0 && nCornerSizeY_Pixel != 0)
+ if (nCornerSizeX_Pixel != 0 && nCornerSizeY_Pixel != 0)
{
BOOL bFind = FALSE;
double dAddDistance = 0.0;
int nSearchRange = 8;
- int nSearchRangeX = (int) ((double)nCornerSizeX_Pixel * 0.10); // 10%俊辑 茫澜..
- int nSearchRangeY = (int) ((double)nCornerSizeY_Pixel * 0.10); // 10%俊辑 茫澜..
+ int nSearchRangeX = (int)((double)nCornerSizeX_Pixel * 0.10); // 10%鞐愳劀 彀眷潓..
+ int nSearchRangeY = (int)((double)nCornerSizeY_Pixel * 0.10); // 10%鞐愳劀 彀眷潓..
nSearchRangeX = nSearchRangeY = 10;
-
- for(int i=ptConner[0].x ; i<pConnerEdgeOutLineImage->width; i++)
+
+ for (int i = ptConner[0].x; i < pConnerEdgeOutLineImage->width; i++)
{
- if(i < 0 || i >= pConnerEdgeOutLineImage->width)
+ if (i < 0 || i >= pConnerEdgeOutLineImage->width)
continue;
- if(nPos == 0)
+ if (nPos == 0)
{
//for(int j=0; j<nSearchRangeX; j++)
- for(int j=-nSearchRangeX;j<nSearchRangeX;j++)
+ for (int j = -nSearchRangeX; j < nSearchRangeX; j++)
{
- if((ptConner[0].y)+j < 0 || (ptConner[0].y)+j >= pConnerEdgeOutLineImage->height)
+ if ((ptConner[0].y) + j < 0 || (ptConner[0].y) + j >= pConnerEdgeOutLineImage->height)
continue;
- if(pConnerEdgeOutLineImage->imageData[i+(((ptConner[0].y)+j) * pConnerEdgeOutLineImage->widthStep)] != 0)
+ if (pConnerEdgeOutLineImage->imageData[i + (((ptConner[0].y) + j) * pConnerEdgeOutLineImage->widthStep)] != 0)
{
- dAddDistance = (((double)j)*m_dPixelSizeY)/m_dPixelSizeX;
- ptConner[1].x = i + (int) dAddDistance;
+ dAddDistance = (((double)j) * m_dPixelSizeY) / m_dPixelSizeX;
+ ptConner[1].x = i + (int)dAddDistance;
bFind = TRUE;
break;
}
@@ -5417,131 +5441,131 @@
else
{
//for(int j=0; j<nSearchRangeX; j++)
- for(int j=-nSearchRangeX;j<nSearchRangeX;j++)
+ for (int j = -nSearchRangeX; j < nSearchRangeX; j++)
{
- if((ptConner[0].y)-j < 0 || (ptConner[0].y)-j >= pConnerEdgeOutLineImage->height)
+ if ((ptConner[0].y) - j < 0 || (ptConner[0].y) - j >= pConnerEdgeOutLineImage->height)
continue;
- if(pConnerEdgeOutLineImage->imageData[i+(((ptConner[0].y)-j) * pConnerEdgeOutLineImage->widthStep)] != 0)
+ if (pConnerEdgeOutLineImage->imageData[i + (((ptConner[0].y) - j) * pConnerEdgeOutLineImage->widthStep)] != 0)
{
- dAddDistance = (((double)j)*m_dPixelSizeY)/m_dPixelSizeX;
- ptConner[1].x = i + (int) dAddDistance;
+ dAddDistance = (((double)j) * m_dPixelSizeY) / m_dPixelSizeX;
+ ptConner[1].x = i + (int)dAddDistance;
bFind = TRUE;
break;
}
}
- }
+ }
- if(bFind)
+ if (bFind)
break;
}
bFind = FALSE;
- if(nPos == 0)
+ if (nPos == 0)
{
- for(int i=ptConner[0].y ; i<pConnerEdgeOutLineImage->height; i++)
+ for (int i = ptConner[0].y; i < pConnerEdgeOutLineImage->height; i++)
{
- if(i < 0 || i >= pConnerEdgeOutLineImage->height)
+ if (i < 0 || i >= pConnerEdgeOutLineImage->height)
continue;
//for(int j=0; j<nSearchRangeY; j++)
- for(int j=-nSearchRangeY;j<nSearchRangeY;j++)
+ for (int j = -nSearchRangeY; j < nSearchRangeY; j++)
{
- if(ptConner[0].x+j < 0 || ptConner[0].x+j >= pConnerEdgeOutLineImage->widthStep)
+ if (ptConner[0].x + j < 0 || ptConner[0].x + j >= pConnerEdgeOutLineImage->widthStep)
continue;
- if(pConnerEdgeOutLineImage->imageData[ptConner[0].x+j+(i * pConnerEdgeOutLineImage->widthStep)] != 0)
+ if (pConnerEdgeOutLineImage->imageData[ptConner[0].x + j + (i * pConnerEdgeOutLineImage->widthStep)] != 0)
{
- dAddDistance = (((double)j)*m_dPixelSizeX)/m_dPixelSizeY;
- ptConner[2].y = i + (int) dAddDistance;
+ dAddDistance = (((double)j) * m_dPixelSizeX) / m_dPixelSizeY;
+ ptConner[2].y = i + (int)dAddDistance;
bFind = TRUE;
break;
}
}
- if(bFind)
+ if (bFind)
break;
}
}
else
{
- for(int i=ptConner[0].y ; 0 <= i; i--)
+ for (int i = ptConner[0].y; 0 <= i; i--)
{
- if(i < 0 || i >= pConnerEdgeOutLineImage->height)
+ if (i < 0 || i >= pConnerEdgeOutLineImage->height)
continue;
//for(int j=0; j<nSearchRangeY; j++)
- for(int j=-nSearchRangeY;j<nSearchRangeY;j++)
+ for (int j = -nSearchRangeY; j < nSearchRangeY; j++)
{
- if(ptConner[0].x+j < 0 || ptConner[0].x+j >= pConnerEdgeOutLineImage->widthStep)
+ if (ptConner[0].x + j < 0 || ptConner[0].x + j >= pConnerEdgeOutLineImage->widthStep)
continue;
- if(pConnerEdgeOutLineImage->imageData[ptConner[0].x+j+(i * pConnerEdgeOutLineImage->widthStep)] != 0)
+ if (pConnerEdgeOutLineImage->imageData[ptConner[0].x + j + (i * pConnerEdgeOutLineImage->widthStep)] != 0)
{
- dAddDistance = (((double)j)*m_dPixelSizeX)/m_dPixelSizeY;
- ptConner[2].y = i - (int) dAddDistance;
+ dAddDistance = (((double)j) * m_dPixelSizeX) / m_dPixelSizeY;
+ ptConner[2].y = i - (int)dAddDistance;
bFind = TRUE;
break;
}
}
- if(bFind)
+ if (bFind)
break;
}
}
- }
-
- if(nPos == 0)
- {
- pSideData->m_rtTopCornerResult[0].left = rtConnerRoi.left;
- pSideData->m_rtTopCornerResult[0].top = rtConnerRoi.top;
- pSideData->m_rtTopCornerResult[0].right = rtConnerRoi.right;
- pSideData->m_rtTopCornerResult[0].bottom = rtConnerRoi.bottom;
+ }
- if(nPos == 0)
+ if (nPos == 0)
+ {
+ pSideData->m_rtTopCornerResult[0].left = rtConnerRoi.left;
+ pSideData->m_rtTopCornerResult[0].top = rtConnerRoi.top;
+ pSideData->m_rtTopCornerResult[0].right = rtConnerRoi.right;
+ pSideData->m_rtTopCornerResult[0].bottom = rtConnerRoi.bottom;
+
+ if (nPos == 0)
{
- pSideData->m_rtTopCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
- pSideData->m_rtTopCornerResult[1].top = ptConner[0].y + rtConnerRoi.top;
- pSideData->m_rtTopCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
- pSideData->m_rtTopCornerResult[1].bottom = ptConner[2].y + rtConnerRoi.top;
+ pSideData->m_rtTopCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
+ pSideData->m_rtTopCornerResult[1].top = ptConner[0].y + rtConnerRoi.top;
+ pSideData->m_rtTopCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
+ pSideData->m_rtTopCornerResult[1].bottom = ptConner[2].y + rtConnerRoi.top;
}
else
{
- pSideData->m_rtTopCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
- pSideData->m_rtTopCornerResult[1].top = ptConner[2].y + rtConnerRoi.top;
- pSideData->m_rtTopCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
- pSideData->m_rtTopCornerResult[1].bottom = ptConner[0].y + rtConnerRoi.top;
- }
+ pSideData->m_rtTopCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
+ pSideData->m_rtTopCornerResult[1].top = ptConner[2].y + rtConnerRoi.top;
+ pSideData->m_rtTopCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
+ pSideData->m_rtTopCornerResult[1].bottom = ptConner[0].y + rtConnerRoi.top;
+ }
- pSideData->m_nTopCornerWidth = (int)(abs(pSideData->m_rtTopCornerResult[1].right - pSideData->m_rtTopCornerResult[1].left) * m_dPixelSizeX);
- pSideData->m_nTopCornerHeight = (int)(abs(pSideData->m_rtTopCornerResult[1].bottom - pSideData->m_rtTopCornerResult[1].top) * m_dPixelSizeY);
+ pSideData->m_nTopCornerWidth = (int)(abs(pSideData->m_rtTopCornerResult[1].right - pSideData->m_rtTopCornerResult[1].left) * m_dPixelSizeX);
+ pSideData->m_nTopCornerHeight = (int)(abs(pSideData->m_rtTopCornerResult[1].bottom - pSideData->m_rtTopCornerResult[1].top) * m_dPixelSizeY);
pSideData->m_bTopCorner_Measure = TRUE;
}
else
{
- pSideData->m_rtBottomCornerResult[0].left = rtConnerRoi.left;
- pSideData->m_rtBottomCornerResult[0].top = rtConnerRoi.top;
- pSideData->m_rtBottomCornerResult[0].right = rtConnerRoi.right;
- pSideData->m_rtBottomCornerResult[0].bottom = rtConnerRoi.bottom;
+ pSideData->m_rtBottomCornerResult[0].left = rtConnerRoi.left;
+ pSideData->m_rtBottomCornerResult[0].top = rtConnerRoi.top;
+ pSideData->m_rtBottomCornerResult[0].right = rtConnerRoi.right;
+ pSideData->m_rtBottomCornerResult[0].bottom = rtConnerRoi.bottom;
- if(nPos == 0)
+ if (nPos == 0)
{
- pSideData->m_rtBottomCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
- pSideData->m_rtBottomCornerResult[1].top = ptConner[0].y + rtConnerRoi.top;
- pSideData->m_rtBottomCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
- pSideData->m_rtBottomCornerResult[1].bottom = ptConner[2].y + rtConnerRoi.top;
+ pSideData->m_rtBottomCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
+ pSideData->m_rtBottomCornerResult[1].top = ptConner[0].y + rtConnerRoi.top;
+ pSideData->m_rtBottomCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
+ pSideData->m_rtBottomCornerResult[1].bottom = ptConner[2].y + rtConnerRoi.top;
}
else
{
- pSideData->m_rtBottomCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
- pSideData->m_rtBottomCornerResult[1].top = ptConner[2].y + rtConnerRoi.top;
- pSideData->m_rtBottomCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
- pSideData->m_rtBottomCornerResult[1].bottom = ptConner[0].y + rtConnerRoi.top;
- }
+ pSideData->m_rtBottomCornerResult[1].left = ptConner[0].x + rtConnerRoi.left;
+ pSideData->m_rtBottomCornerResult[1].top = ptConner[2].y + rtConnerRoi.top;
+ pSideData->m_rtBottomCornerResult[1].right = ptConner[1].x + rtConnerRoi.left;
+ pSideData->m_rtBottomCornerResult[1].bottom = ptConner[0].y + rtConnerRoi.top;
+ }
- pSideData->m_nBottomCornerWidth = (int)(abs(pSideData->m_rtBottomCornerResult[1].right - pSideData->m_rtBottomCornerResult[1].left) * m_dPixelSizeX);
- pSideData->m_nBottomCornerHeight = (int)(abs(pSideData->m_rtBottomCornerResult[1].bottom - pSideData->m_rtBottomCornerResult[1].top) * m_dPixelSizeY);
+ pSideData->m_nBottomCornerWidth = (int)(abs(pSideData->m_rtBottomCornerResult[1].right - pSideData->m_rtBottomCornerResult[1].left) * m_dPixelSizeX);
+ pSideData->m_nBottomCornerHeight = (int)(abs(pSideData->m_rtBottomCornerResult[1].bottom - pSideData->m_rtBottomCornerResult[1].top) * m_dPixelSizeY);
pSideData->m_bBotCorner_Measure = TRUE;
}
@@ -5550,41 +5574,41 @@
cvReleaseImage(&pConnerEdgeOutLineImage);
vecProjectionX.clear();
- vecProjectionY.clear();
+ vecProjectionY.clear();
- g_pLog->DisplayMessage(_T("%s Corner pos %d End, frame %d - %d,%d,%d,%d"),g_SideName[(int) emDim],nPos,stFrame.nFrameIdx,rtConnerRoi.left,rtConnerRoi.top,rtConnerRoi.right,rtConnerRoi.bottom);
+ g_pLog->DisplayMessage(_T("%s Corner pos %d End, frame %d - %d,%d,%d,%d"), g_SideName[(int)emDim], nPos, stFrame.nFrameIdx, rtConnerRoi.left, rtConnerRoi.top, rtConnerRoi.right, rtConnerRoi.bottom);
return TRUE;
}
-BOOL CInspectCamera::Measure_TopCorner_RCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_TopCorner_RCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
- // R Corner 螟沥
+ // R Corner 旄§爼
return TRUE;
}
-BOOL CInspectCamera::Measure_BotCorner(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_BotCorner(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
- if(pSideParam->m_bBottomCornerMeasureSize == FALSE)
+ if (pSideParam->m_bBottomCornerMeasureSize == FALSE)
return FALSE;
if (pSideData->m_bBotCorner_Find == FALSE)
@@ -5595,35 +5619,35 @@
int nBotCornerType = pSideData->m_nBotCornerShape;
- if(nBotCornerType == (int) 1) return Measure_BotCorner_CCut(iThread, emDim, stFrame);
- else if(nBotCornerType == (int) 2) return Measure_BotCorner_RCut(iThread, emDim, stFrame);
+ if (nBotCornerType == (int)1) return Measure_BotCorner_CCut(iThread, emDim, stFrame);
+ else if (nBotCornerType == (int)2) return Measure_BotCorner_RCut(iThread, emDim, stFrame);
else pSideData->m_bBotCorner_Measure = TRUE;
return TRUE;
}
-BOOL CInspectCamera::Measure_BotCorner_CCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_BotCorner_CCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int) emDim];
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSIDE_PARM* pSideParam = &m_pRecipe->m_SideParam[(int)emDim];
- if(pSideData == NULL || pSideParam == NULL)
+ if (pSideData == NULL || pSideParam == NULL)
return FALSE;
CRect rtBottomCornerArea = pSideData->m_rtBotCornerArea;
- rtBottomCornerArea.InflateRect(50,50);
+ rtBottomCornerArea.InflateRect(50, 50);
- int iCornerFrame = rtBottomCornerArea.bottom/m_nFrameHeight;
+ int iCornerFrame = rtBottomCornerArea.bottom / m_nFrameHeight;
- if(iCornerFrame > stFrame.nFrameIdx)
+ if (iCornerFrame > stFrame.nFrameIdx)
return FALSE;
- // Corner 八荤 父甸扁..
- if(FindCorner(iThread,emDim,stFrame,1,rtBottomCornerArea) == TRUE)
+ // Corner 瓴�靷� 毵岆摛旮�..
+ if (FindCorner(iThread, emDim, stFrame, 1, rtBottomCornerArea) == TRUE)
{
double dXSizeStd_um = pSideParam->m_nBottomCorner_Measure_Judge_Std_um_X;
double dXSizeMin_um = pSideParam->m_nBottomCorner_Measure_Judge_Min_um_X;
@@ -5633,29 +5657,29 @@
double dYSizeMax_um = pSideParam->m_nBottomCorner_Measure_Judge_Max_um_Y;
int nOpt = pSideParam->m_nBottomCorner_Measure_Judge_OR_AND;
- if(nOpt == 0)
+ if (nOpt == 0)
return FALSE;
double dResultWidth_um = pSideData->m_nBottomCornerWidth;
double dResultHeight_um = pSideData->m_nBottomCornerHeight;
pSideData->m_bBottomMeasureResult = TRUE;
- if(nOpt == 1) // or
+ if (nOpt == 1) // or
{
- if( (dResultWidth_um < dXSizeStd_um-dXSizeMin_um || dResultWidth_um > dXSizeStd_um+dXSizeMax_um) || (dResultHeight_um < dYSizeStd_um-dYSizeMin_um || dResultHeight_um > dYSizeStd_um+dYSizeMax_um))
+ if ((dResultWidth_um < dXSizeStd_um - dXSizeMin_um || dResultWidth_um > dXSizeStd_um + dXSizeMax_um) || (dResultHeight_um < dYSizeStd_um - dYSizeMin_um || dResultHeight_um > dYSizeStd_um + dYSizeMax_um))
{
pSideData->m_bBottomMeasureResult = FALSE; // NG
}
}
else // and
{
- if( (dResultWidth_um < dXSizeStd_um-dXSizeMin_um || dResultWidth_um > dXSizeStd_um+dXSizeMax_um) && (dResultHeight_um < dYSizeStd_um-dYSizeMin_um || dResultHeight_um > dYSizeStd_um+dYSizeMax_um))
+ if ((dResultWidth_um < dXSizeStd_um - dXSizeMin_um || dResultWidth_um > dXSizeStd_um + dXSizeMax_um) && (dResultHeight_um < dYSizeStd_um - dYSizeMin_um || dResultHeight_um > dYSizeStd_um + dYSizeMax_um))
{
pSideData->m_bBottomMeasureResult = FALSE; // NG
}
}
- if(pSideData->m_bBottomMeasureResult == FALSE)
+ if (pSideData->m_bBottomMeasureResult == FALSE)
{
// Make Defect
CDefect_Info measureDefect;
@@ -5664,65 +5688,65 @@
measureDefect.m_nCamID = m_iCamera;
measureDefect.m_nScanIdx = stFrame.nScanIdx;
measureDefect.m_nGlassStartLine = pSideData->m_nGlassStartLine;
- measureDefect.m_nSideIdx = (int) emDim;
+ measureDefect.m_nSideIdx = (int)emDim;
measureDefect.m_DefectLoc = DefectLoc_Measure_Corner;
measureDefect.m_ptDefectPos_pxl = pSideData->m_rtTopCornerResult[1].CenterPoint();
measureDefect.m_rtDefectPos_pxl = CRect(measureDefect.m_ptDefectPos_pxl.x - 16, measureDefect.m_ptDefectPos_pxl.y - 16, measureDefect.m_ptDefectPos_pxl.x + 16, measureDefect.m_ptDefectPos_pxl.y + 16);
- g_pLog->DisplayMessage(_T("Measure Bottom Corner NG Start %s : %d,%d"),g_SideName[(int) emDim],measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Bottom Corner NG Start %s : %d,%d"), g_SideName[(int)emDim], measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
m_pDefectControl->ExtractDefect_Measure(emDim, m_iCamera, stFrame.nScanIdx, measureDefect, dResultWidth_um, dResultHeight_um);
- g_pLog->DisplayMessage(_T("Measure Bottom Corner NG End %s : %d,%d"),g_SideName[(int) emDim],measureDefect.m_ptDefectPos_pxl.x,measureDefect.m_ptDefectPos_pxl.y);
+ g_pLog->DisplayMessage(_T("Measure Bottom Corner NG End %s : %d,%d"), g_SideName[(int)emDim], measureDefect.m_ptDefectPos_pxl.x, measureDefect.m_ptDefectPos_pxl.y);
}
}
return TRUE;
}
-BOOL CInspectCamera::Measure_BotCorner_RCut(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::Measure_BotCorner_RCut(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
return TRUE;
}
-BOOL CInspectCamera::UserDefect_Process(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::UserDefect_Process(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassEndLine == FALSE) // User Defect Processing篮 End Line 茫篮 Frame捞..
+ if (pSideData->m_bFindGlassEndLine == FALSE) // User Defect Processing鞚� End Line 彀眷潃 Frame鞚�..
return FALSE;
- if(m_pRecipe == NULL)
+ if (m_pRecipe == NULL)
return FALSE;
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return FALSE;
std::vector<CDefect_Info> vecDefectCandidateList;
- int nUserDefectAreaCount = m_pRecipe->m_SideParam[(int) emDim].m_nUserDefectAreaCount;
+ int nUserDefectAreaCount = m_pRecipe->m_SideParam[(int)emDim].m_nUserDefectAreaCount;
pSideData->m_nUserDefectAreaCount = nUserDefectAreaCount;
- for(int i=0; i<nUserDefectAreaCount; i++)
+ for (int i = 0; i < nUserDefectAreaCount; i++)
{
- if(m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[i].m_bUseInspect == 0)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[i].m_bUseInspect == 0)
continue;
- CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[i].m_ptTopMarkPos;
- CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[i].m_ptBotMarkPos;
- CRect rtSet_Area = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[i].m_rtUserDefectArea;
+ CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[i].m_ptTopMarkPos;
+ CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[i].m_ptBotMarkPos;
+ CRect rtSet_Area = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[i].m_rtUserDefectArea;
CRect rtRotateArea;
- if(GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
+ if (GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
continue;
pSideData->m_rtUserDefectArea_pxl[i] = rtRotateArea;
@@ -5735,47 +5759,47 @@
return TRUE;
}
-BOOL CInspectCamera::InspectDefect_UserDefectProcess(int iThread,DimensionDir emDim, stFrameIndex stFrame, int nUserDefectIdx, CRect rtUserDefectArea, std::vector<CDefect_Info>* pDefectList)
+BOOL CInspectCamera::InspectDefect_UserDefectProcess(int iThread, DimensionDir emDim, stFrameIndex stFrame, int nUserDefectIdx, CRect rtUserDefectArea, std::vector<CDefect_Info>* pDefectList)
{
if (rtUserDefectArea.IsRectEmpty() == TRUE || m_pGlassData == NULL)
return FALSE;
DefectLocation defectLoc = DefectLoc_UserDefect;
- if(m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_bUseInspect == FALSE)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_bUseInspect == FALSE)
return TRUE;
// 0. Parameter Initialize..
- CString strDefectType = _T("Unknown");
- int nMethod = 0;
- int nThreshold_Low = 0;
- int nThreshold_High = 0;
- int nPitch = 0;
- int nPitch_Threshold = 0;
- int nMinSize = 0;
- int nJudge_Size_Min_X_um = 0;
- int nJudge_Size_Min_Y_um = 0;
- int nJudge_Size_Min_OR_AND = 0; // 0 : No Use, 1 : OR, 2 : AND
+ CString strDefectType = _T("Unknown");
+ int nMethod = 0;
+ int nThreshold_Low = 0;
+ int nThreshold_High = 0;
+ int nPitch = 0;
+ int nPitch_Threshold = 0;
+ int nMinSize = 0;
+ int nJudge_Size_Min_X_um = 0;
+ int nJudge_Size_Min_Y_um = 0;
+ int nJudge_Size_Min_OR_AND = 0; // 0 : No Use, 1 : OR, 2 : AND
- nMethod = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nInspect_Method;
- nThreshold_Low = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nMin_Threshold;
- nThreshold_High = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nMax_Threshold;
- nPitch = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nDiff_Pitch;
- nPitch_Threshold = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nDiff_Threshold;
- nMinSize = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nMinSize_Filter_pxl;
- nJudge_Size_Min_X_um = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_X_um;
- nJudge_Size_Min_Y_um = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_Y_um;
- nJudge_Size_Min_OR_AND = m_pRecipe->m_SideParam[(int) emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_OR_AND;
+ nMethod = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nInspect_Method;
+ nThreshold_Low = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nMin_Threshold;
+ nThreshold_High = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nMax_Threshold;
+ nPitch = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nDiff_Pitch;
+ nPitch_Threshold = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nDiff_Threshold;
+ nMinSize = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nMinSize_Filter_pxl;
+ nJudge_Size_Min_X_um = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_X_um;
+ nJudge_Size_Min_Y_um = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_Y_um;
+ nJudge_Size_Min_OR_AND = m_pRecipe->m_SideParam[(int)emDim].m_UserDefectPrm[nUserDefectIdx].m_nJudge_Size_Min_OR_AND;
CSISBuffer frameBuffer(m_pGrabber->GetFrameHeaderLine(stFrame.nScanIdx, rtUserDefectArea.top), m_nFrameWidth, m_nFrameHeight);
- if(frameBuffer.IsValidBuffer() == FALSE)
+ if (frameBuffer.IsValidBuffer() == FALSE)
return FALSE;
// 1. Inspect ROI
COwnerBuffer pDefectProcessImage(rtUserDefectArea.Width(), rtUserDefectArea.Height());
for (int i = 0; i < rtUserDefectArea.Height(); i++)
- memcpy(pDefectProcessImage.GetDataAddress(0,i), frameBuffer.GetDataAddress(rtUserDefectArea.left, i), rtUserDefectArea.Width());
+ memcpy(pDefectProcessImage.GetDataAddress(0, i), frameBuffer.GetDataAddress(rtUserDefectArea.left, i), rtUserDefectArea.Width());
// 2. Inspect Algorithm
COwnerBuffer pBinImage;
@@ -5804,52 +5828,52 @@
return TRUE;
}
-BOOL CInspectCamera::ExceptionArea_Process(int iThread,DimensionDir emDim, stFrameIndex stFrame)
+BOOL CInspectCamera::ExceptionArea_Process(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return FALSE;
- CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
+ CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassEndLine == FALSE) // Exception Area Processing篮 End Line 茫篮 Frame捞..
+ if (pSideData->m_bFindGlassEndLine == FALSE) // Exception Area Processing鞚� End Line 彀眷潃 Frame鞚�..
return FALSE;
- if(m_pRecipe == NULL)
+ if (m_pRecipe == NULL)
return FALSE;
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return FALSE;
- int nExceptionCount = m_pRecipe->m_SideParam[(int) emDim].m_nExptionCount;
+ int nExceptionCount = m_pRecipe->m_SideParam[(int)emDim].m_nExptionCount;
pSideData->m_nExceptionAreaCount = nExceptionCount;
- for(int i=0; i<nExceptionCount; i++)
+ for (int i = 0; i < nExceptionCount; i++)
{
- if(m_pRecipe->m_SideParam[(int) emDim].m_ExpAreaPrm[i].m_nFilterType == 0)
+ if (m_pRecipe->m_SideParam[(int)emDim].m_ExpAreaPrm[i].m_nFilterType == 0)
continue;
- CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int) emDim].m_ExpAreaPrm[i].m_ptTopMarkPos;
- CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int) emDim].m_ExpAreaPrm[i].m_ptBotMarkPos;
- CRect rtSet_Area = m_pRecipe->m_SideParam[(int) emDim].m_ExpAreaPrm[i].m_rtExceptionArea;
+ CPoint ptSet_TopMark = m_pRecipe->m_SideParam[(int)emDim].m_ExpAreaPrm[i].m_ptTopMarkPos;
+ CPoint ptSet_BotMark = m_pRecipe->m_SideParam[(int)emDim].m_ExpAreaPrm[i].m_ptBotMarkPos;
+ CRect rtSet_Area = m_pRecipe->m_SideParam[(int)emDim].m_ExpAreaPrm[i].m_rtExceptionArea;
CRect rtRotateArea;
- if(GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
+ if (GetAlignRotate(emDim, ptSet_TopMark, ptSet_BotMark, rtSet_Area, rtRotateArea) == FALSE)
continue;
pSideData->m_rtExceptionArea_pxl[i] = rtRotateArea;
int nDefectCount = m_pDefectControl->GetDefectCount();
- for(int nDefectIdx=0; nDefectIdx<nDefectCount; nDefectIdx++)
+ for (int nDefectIdx = 0; nDefectIdx < nDefectCount; nDefectIdx++)
{
CDefect* pDefect = m_pDefectControl->GetDefect(nDefectIdx);
- if(pDefect == NULL)
+ if (pDefect == NULL)
continue;
CRect rtDefectArea = pDefect->m_DefectInfo.m_rtDefectPos_pxl;
@@ -5857,20 +5881,20 @@
CRect rtIntersect;
rtIntersect.IntersectRect(rtRotateArea, rtDefectArea);
- if(rtIntersect == rtDefectArea)
+ if (rtIntersect == rtDefectArea)
pDefect->m_nExceptionArea = 2;
- else if(0 < rtIntersect.Width() || 0 < rtIntersect.Height())
+ else if (0 < rtIntersect.Width() || 0 < rtIntersect.Height())
pDefect->m_nExceptionArea = 1;
else
continue;
- int nFilterType = m_pRecipe->m_SideParam[(int) emDim].m_ExpAreaPrm[i].m_nFilterType;
+ int nFilterType = m_pRecipe->m_SideParam[(int)emDim].m_ExpAreaPrm[i].m_nFilterType;
- if(nFilterType == 0)
+ if (nFilterType == 0)
continue;
- else if(nFilterType == 1 && (pDefect->m_nExceptionArea == 1 || pDefect->m_nExceptionArea == 2))
+ else if (nFilterType == 1 && (pDefect->m_nExceptionArea == 1 || pDefect->m_nExceptionArea == 2))
pDefect->m_DefectInfo.m_DefectLoc = DefectLoc_Exception;
- else if(nFilterType == 2 && pDefect->m_nExceptionArea == 2)
+ else if (nFilterType == 2 && pDefect->m_nExceptionArea == 2)
pDefect->m_DefectInfo.m_DefectLoc = DefectLoc_Exception;
}
}
@@ -5878,55 +5902,55 @@
return TRUE;
}
-void CInspectCamera::SaveGlassLineImage(int iScan,int nLine,int nXPos,DimensionDir emDim,CString strName)
+void CInspectCamera::SaveGlassLineImage(int iScan, int nLine, int nXPos, DimensionDir emDim, CString strName)
{
int nImgWidth = 100;
- int nImgHeight = 200;
-
- CvRect saveRect = cvRect(nXPos-nImgWidth,0,nImgWidth*2,nImgHeight*2);
+ int nImgHeight = 200;
- int iStartV = nLine-nImgHeight;
+ CvRect saveRect = cvRect(nXPos - nImgWidth, 0, nImgWidth * 2, nImgHeight * 2);
- if(iStartV < 0)
+ int iStartV = nLine - nImgHeight;
+
+ if (iStartV < 0)
iStartV = 0;
- LPBYTE pImg = m_pGrabber->GetFrameHeaderLine(iScan,iStartV);
- if(pImg == NULL)
+ LPBYTE pImg = m_pGrabber->GetFrameHeaderLine(iScan, iStartV);
+ if (pImg == NULL)
return;
- IplImage *IpImg = cvCreateImage(cvSize(saveRect.width,saveRect.height),8,1);
+ IplImage* IpImg = cvCreateImage(cvSize(saveRect.width, saveRect.height), 8, 1);
cvZero(IpImg);
- int nFrameWidth,nFrameHeight;
+ int nFrameWidth, nFrameHeight;
- GetFrameSize(m_iCamera,iScan,nFrameWidth,nFrameHeight);
+ GetFrameSize(m_iCamera, iScan, nFrameWidth, nFrameHeight);
- for(int i=0; i< saveRect.height; i++)
- {
- memcpy(&IpImg->imageData[IpImg->widthStep*i], pImg+saveRect.x, sizeof(BYTE)*IpImg->width);
+ for (int i = 0; i < saveRect.height; i++)
+ {
+ memcpy(&IpImg->imageData[IpImg->widthStep * i], pImg + saveRect.x, sizeof(BYTE) * IpImg->width);
pImg += nFrameWidth;
}
CString strFile;
- strFile.Format(_T("%s\\IMG_MARK\\%s\\%s\\%s\\%s_%s.jpg"),PATH_INSPECTION_DATA,g_pBase->m_strLoadingDay,g_pBase->m_strHPanelID,g_pBase->m_strLoadingTime,PANEL_SIDE[emDim],strName);
+ strFile.Format(_T("%s\\IMG_MARK\\%s\\%s\\%s\\%s_%s.jpg"), PATH_INSPECTION_DATA, g_pBase->m_strLoadingDay, g_pBase->m_strHPanelID, g_pBase->m_strLoadingTime, PANEL_SIDE[emDim], strName);
g_pStatus->CheckDirectory(strFile);
- cv::Point startPoint(0,saveRect.height/2);
- cv::Point endPoint(saveRect.width,saveRect.height/2);
+ cv::Point startPoint(0, saveRect.height / 2);
+ cv::Point endPoint(saveRect.width, saveRect.height / 2);
cvLine(IpImg, startPoint, endPoint, cvScalar(255, 0, 0), 1);
USES_CONVERSION;
char str_filename[1024];
sprintf_s(str_filename, "%s", W2A(strFile));
- cvSaveImage(str_filename,IpImg);
-
+ cvSaveImage(str_filename, IpImg);
+
cvReleaseImage(&IpImg);
}
-BOOL CInspectCamera::OnThreadEnd(int iThread, CInspectThread *pInspectThread)
+BOOL CInspectCamera::OnThreadEnd(int iThread, CInspectThread* pInspectThread)
{
return TRUE;
}
@@ -5937,79 +5961,79 @@
}
void CInspectCamera::ReleaseFullBuffer()
-{
+{
int i;
- for(i=0;i<MAX_SCAN_COUNT;i++)
+ for (i = 0; i < MAX_SCAN_COUNT; i++)
{
m_FullImgBuffer[i].Reset();
- }
+ }
}
void CInspectCamera::SetSimulation(BOOL bSimulation)
{
m_bSimulation = bSimulation;
- if(m_pGlassData == NULL)
+ if (m_pGlassData == NULL)
return;
m_pGlassData->SetSimulation(bSimulation);
}
-void CInspectCamera::SetParameter(CGlassRecipe *pRecipe,CHardwareSettings *pHW)
+void CInspectCamera::SetParameter(CGlassRecipe* pRecipe, CHardwareSettings* pHW)
{
- g_pLog->DisplayMessage(_T("SetParameter Cam[%d] start"),m_iCamera);
+ g_pLog->DisplayMessage(_T("SetParameter Cam[%d] start"), m_iCamera);
m_bExitThread = TRUE;
- ZeroMemory(m_iThreadEnd,sizeof(m_iThreadEnd));
- ZeroMemory(m_bFindGlassStart,sizeof(m_bFindGlassStart));
- ZeroMemory(m_iSideLine,sizeof(m_iSideLine));
-
+ ZeroMemory(m_iThreadEnd, sizeof(m_iThreadEnd));
+ ZeroMemory(m_bFindGlassStart, sizeof(m_bFindGlassStart));
+ ZeroMemory(m_iSideLine, sizeof(m_iSideLine));
+
m_pRecipe = pRecipe;
m_pHardparm = pHW;
- if(m_pGrabber != NULL)
+ if (m_pGrabber != NULL)
{
m_pGrabber->ClearGrabIdx();
//m_pGrabber->ClearBuffer();
- }
-
- if(m_pDefectControl != NULL)
+ }
+
+ if (m_pDefectControl != NULL)
{
m_pDefectControl->SetHWRecipe(pHW);
m_pDefectControl->ResetDefectControl();
}
- g_pLog->DisplayMessage(_T("SetParameter Cam[%d] end"),m_iCamera);
+ g_pLog->DisplayMessage(_T("SetParameter Cam[%d] end"), m_iCamera);
}
-void CInspectCamera::SetGlassData(CGlass_Data *pGlassData)
+void CInspectCamera::SetGlassData(CGlass_Data* pGlassData)
{
m_pGlassData = pGlassData;
- if(m_pGrabber != NULL)
+ if (m_pGrabber != NULL)
{
- for(int i=0;i<MAX_DIMENSION_COUNT;i++)
+ for (int i = 0; i < MAX_DIMENSION_COUNT; i++)
{
CSide_Data* pSideData = m_pGlassData->GetSideData((DimensionDir)i);
- if(pSideData == NULL)
+ if (pSideData == NULL)
continue;
- pSideData->m_nPreGlassEndFrame = m_pGrabber->GetFrameBuffer()->GetFrameCount()-1;
+ pSideData->m_nPreGlassEndFrame = m_pGrabber->GetFrameBuffer()->GetFrameCount() - 1;
}
}
}
-void CInspectCamera::SetGrabber(CGrabberControl *pGrabber)
+void CInspectCamera::SetGrabber(CGrabberControl* pGrabber)
{
m_pGrabber = pGrabber;
- if(m_pDefectControl != NULL)
+ if (m_pDefectControl != NULL)
m_pDefectControl->SetGrabber(pGrabber);
}
DimensionDir CInspectCamera::GetDimension(int iScan)
{
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(m_iCamera,iScan);
- if(pCamera == NULL)
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(m_iCamera, iScan);
+ if (pCamera == NULL)
return DIMENSION_NONE;
return pCamera->m_eDimension;
@@ -6019,9 +6043,9 @@
{
g_pLog->DisplayMessage(_T("Set Grab End"));
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(m_iCamera,iScan);
-
- if(pCamera == NULL)
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(m_iCamera, iScan);
+
+ if (pCamera == NULL)
{
g_pLog->DisplayMessage(_T("Camera Setting NULL"));
return;
@@ -6029,83 +6053,83 @@
DimensionDir emDim = pCamera->m_eDimension;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return;
int nStageNo = g_pBase->m_nStageNo;
- if(nStageNo < 0 || nStageNo > 1)
+ if (nStageNo < 0 || nStageNo > 1)
nStageNo = 0;
- int nGlassSize = (int) (((double) m_pRecipe->m_SideParam[(int) emDim].m_nSidePanelSize_um) / pCamera->m_dScanResolution[nStageNo]);
+ int nGlassSize = (int)(((double)m_pRecipe->m_SideParam[(int)emDim].m_nSidePanelSize_um) / pCamera->m_dScanResolution[nStageNo]);
pSideData->m_nPreGlassEndLine = pSideData->m_nGlassStartLine + nGlassSize;
- pSideData->m_nPreGlassEndFrame = pSideData->m_nPreGlassEndLine/pCamera->m_FrameSize.cy;
+ pSideData->m_nPreGlassEndFrame = pSideData->m_nPreGlassEndLine / pCamera->m_FrameSize.cy;
- g_pStatus->SetGrabFrametoScan(iScan,pSideData->m_nPreGlassEndFrame+5);
+ g_pStatus->SetGrabFrametoScan(iScan, pSideData->m_nPreGlassEndFrame + 5);
- g_pLog->DisplayMessage(_T("%s Scan %d : Set Grab EndFrame - GlassEnd %d, Frame %d, GrabBuf %d"),PANEL_SIDE[emDim],iScan,pSideData->m_nPreGlassEndLine,pSideData->m_nPreGlassEndFrame,pSideData->m_nPreGlassEndFrame+5);
+ g_pLog->DisplayMessage(_T("%s Scan %d : Set Grab EndFrame - GlassEnd %d, Frame %d, GrabBuf %d"), PANEL_SIDE[emDim], iScan, pSideData->m_nPreGlassEndLine, pSideData->m_nPreGlassEndFrame, pSideData->m_nPreGlassEndFrame + 5);
}
-BOOL CInspectCamera::FindGlassStartLine(DimensionDir emDim,stFrameIndex stFrame)
-{
+BOOL CInspectCamera::FindGlassStartLine(DimensionDir emDim, stFrameIndex stFrame)
+{
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- CCameraSettings *pCamera = m_pHardparm->GetCameraSettings(m_iCamera,stFrame.nScanIdx);
- if(pCamera == NULL)
+ CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(m_iCamera, stFrame.nScanIdx);
+ if (pCamera == NULL)
return FALSE;
- int nFrame = m_pGrabber->GetFrameBuffer()->GetFrameCount()/2;
+ int nFrame = m_pGrabber->GetFrameBuffer()->GetFrameCount() / 2;
int nFrameWidth = pCamera->m_FrameSize.cx;
int nFrameHeight = pCamera->m_FrameSize.cy;
int nSkipFrame = 0; // EI... // (m_bSimulation == FALSE) ? 1 : 0; //pGlsInfo->m_nFindGlassStartOffset[emDim] / nFrameHeight;
- int nSetHor = m_pRecipe->m_SideParam[(int) emDim].m_nFindStartEndLine_X_pxl;
+ int nSetHor = m_pRecipe->m_SideParam[(int)emDim].m_nFindStartEndLine_X_pxl;
- if(nSetHor < BOUNDARY_GLASSSTARTWIDTH / 2) nSetHor = BOUNDARY_GLASSSTARTWIDTH / 2;
- if(nSetHor > nFrameWidth-(BOUNDARY_GLASSSTARTWIDTH / 2)) nSetHor = nFrameWidth-(BOUNDARY_GLASSSTARTWIDTH / 2);
+ if (nSetHor < BOUNDARY_GLASSSTARTWIDTH / 2) nSetHor = BOUNDARY_GLASSSTARTWIDTH / 2;
+ if (nSetHor > nFrameWidth - (BOUNDARY_GLASSSTARTWIDTH / 2)) nSetHor = nFrameWidth - (BOUNDARY_GLASSSTARTWIDTH / 2);
// pSideData->nGlassEdgeXPos[0] = nSetHor;
int j, k, nGab;
int nThreshold = m_pRecipe->m_SideParam[emDim].m_nFindStartEndLine_Threshold * BOUNDARY_GLASSSTARTWIDTH;
- int *pnSum = new int[nFrameHeight + BOUNDARYHORIZ_LEVELDIST];
+ int* pnSum = new int[nFrameHeight + BOUNDARYHORIZ_LEVELDIST];
LPBYTE lpHeader;
int nCountinueCount = 0;
- int nRet,nHStart;
+ int nRet, nHStart;
DWORD dwT1 = GetTickCount();
- g_pLog->DisplayMessage(_T("%s Find Glass Start Start : Scan %d "),PANEL_SIDE[emDim],stFrame.nScanIdx);
+ g_pLog->DisplayMessage(_T("%s Find Glass Start Start : Scan %d "), PANEL_SIDE[emDim], stFrame.nScanIdx);
- for(int iFrame=0;iFrame<nFrame;iFrame++)
+ for (int iFrame = 0; iFrame < nFrame; iFrame++)
{
while (TRUE)
{
nRet = m_pGrabber->IsAcqFrame(iFrame);
- if (nRet < 2) // 酒流 救嘛躯栏骨肺 措扁.
+ if (nRet < 2) // 鞎勳 鞎堨皪順旍溂氙�搿� 雽�旮�.
{
if (GetTickCount() - dwT1 > TIME_WAIT_GLASS_START)
{
- g_pLog->DisplayMessage(_T("%s Find Glass Start : no image(Grab Time Out),%d sec"),PANEL_SIDE[emDim],TIME_WAIT_GLASS_START/1000);
- delete [] pnSum;
+ g_pLog->DisplayMessage(_T("%s Find Glass Start : no image(Grab Time Out),%d sec"), PANEL_SIDE[emDim], TIME_WAIT_GLASS_START / 1000);
+ delete[] pnSum;
return FALSE;
}
Sleep(1);
- }
+ }
else
break;
}
if (nSkipFrame > iFrame)
- continue;
+ continue;
- lpHeader = m_pGrabber->GetFrameHeader(stFrame.nScanIdx,iFrame);
- if(lpHeader == NULL)
+ lpHeader = m_pGrabber->GetFrameHeader(stFrame.nScanIdx, iFrame);
+ if (lpHeader == NULL)
{
- g_pLog->DisplayMessage(_T("%s Find Glass Start : no image(Image is Null)"),PANEL_SIDE[emDim]);
- delete [] pnSum;
+ g_pLog->DisplayMessage(_T("%s Find Glass Start : no image(Image is Null)"), PANEL_SIDE[emDim]);
+ delete[] pnSum;
return FALSE;
}
@@ -6119,40 +6143,40 @@
{
for (k = nHStart; k < nHStart + BOUNDARY_GLASSSTARTWIDTH; k++)
{
- // Grab牢 版快 滚欺狼 版拌俊辑 1024扼牢阑 逞绢哎 版快 促澜 滚欺甫 啊廉客具 茄促.
+ // Grab鞚� 瓴届毎 氩勴嵓鞚� 瓴疥硠鞐愳劀 1024霛检澑鞚� 雱橃柎臧� 瓴届毎 雼れ潓 氩勴嵓毳� 臧�鞝胳檧鞎� 頃滊嫟.
if (j == nFrameHeight && nLine != 0 && bChangeBuffer == FALSE)
- {
+ {
DWORD dwTick = GetTickCount();
while (TRUE)
- {
- if(GetTickCount()-dwTick > TIME_WAIT_GLASS_START/2)
- {
- g_pLog->DisplayMessage(_T("%s No Image"),PANEL_SIDE[emDim]);
- delete [] pnSum;
+ {
+ if (GetTickCount() - dwTick > TIME_WAIT_GLASS_START / 2)
+ {
+ g_pLog->DisplayMessage(_T("%s No Image"), PANEL_SIDE[emDim]);
+ delete[] pnSum;
return FALSE;
}
- if(m_pGrabber->IsAcqFrame(iFrame + 1) > 1)
+ if (m_pGrabber->IsAcqFrame(iFrame + 1) > 1)
{
- lpHeader = m_pGrabber->GetFrameHeader(stFrame.nScanIdx,iFrame + 1);
- if(lpHeader != NULL)
+ lpHeader = m_pGrabber->GetFrameHeader(stFrame.nScanIdx, iFrame + 1);
+ if (lpHeader != NULL)
{
bChangeBuffer = TRUE;
//g_pLog->DisplayMessage(_T("%s Change Buffer %d, %d, %d"),PANEL_SIDE[pRecipe->GetDimension()], j, i, g_pBase->m_pMemFrameNo[GetCameraID()]);
break;
- }
- }
- }
+ }
+ }
+ }
nLine = 0;
}
pnSum[j] += *(lpHeader + nLine * nFrameWidth + k);
}
- nLine++;
+ nLine++;
if (j >= BOUNDARYHORIZ_LEVELDIST)
{
- nGab = abs(pnSum[j - BOUNDARYHORIZ_LEVELDIST] - pnSum[j]);
+ nGab = abs(pnSum[j - BOUNDARYHORIZ_LEVELDIST] - pnSum[j]);
if (nGab > nThreshold)
nCountinueCount++;
else
@@ -6160,27 +6184,27 @@
if (nCountinueCount >= 2)
{
- g_pLog->DisplayMessage(_T("%s Start Line Frame %d, Line %d, Gab %d, Thres %d"), PANEL_SIDE[emDim],iFrame, j, nGab, nThreshold);
- // Glass狼 矫累瘤痢阑 茫酒辑 备炼眉俊 持绰促.
+ g_pLog->DisplayMessage(_T("%s Start Line Frame %d, Line %d, Gab %d, Thres %d"), PANEL_SIDE[emDim], iFrame, j, nGab, nThreshold);
+ // Glass鞚� 鞁滌瀾歆�鞝愳潉 彀眷晞靹� 甑“觳挫棎 雱k姅雼�.
pSideData->m_nGlassStartLine = iFrame * nFrameHeight + j - 2;
- pSideData->m_nGlassStartFrame = pSideData->m_nGlassStartLine/nFrameHeight;
+ pSideData->m_nGlassStartFrame = pSideData->m_nGlassStartLine / nFrameHeight;
pSideData->m_bFindGlassStartLine = TRUE;
// Log
g_pLog->DisplayMessage(_T(""));
g_pLog->DisplayMessage(_T("%s Glass StartLine :: Pixel %ld nFrameNo=%d")
, PANEL_SIDE[emDim]
- , pSideData->m_nGlassStartLine
- , pSideData->m_nGlassStartLine / nFrameHeight);
+ , pSideData->m_nGlassStartLine
+ , pSideData->m_nGlassStartLine / nFrameHeight);
- delete [] pnSum;
+ delete[] pnSum;
// 22.07.24
// SaveGlassLineImage(stFrame.nScanIdx,pSideData->m_nGlassStartLine,nSetHor,emDim,_T("StartLine"));
MakeNotchArea(emDim);
// Make Judge Line
- pSideData->m_nCenterJudgeArea_Start = pSideData->m_nGlassStartLine + m_pRecipe->m_SideParam[(int) emDim].m_nCenterJudgeArea_StartLine_To_Start_pxl;
- pSideData->m_nCenterJudgeArea_End = pSideData->m_nGlassStartLine + m_pRecipe->m_SideParam[(int) emDim].m_nCenterJudgeArea_StartLine_To_End_pxl;
+ pSideData->m_nCenterJudgeArea_Start = pSideData->m_nGlassStartLine + m_pRecipe->m_SideParam[(int)emDim].m_nCenterJudgeArea_StartLine_To_Start_pxl;
+ pSideData->m_nCenterJudgeArea_End = pSideData->m_nGlassStartLine + m_pRecipe->m_SideParam[(int)emDim].m_nCenterJudgeArea_StartLine_To_End_pxl;
return TRUE;
}
@@ -6188,37 +6212,37 @@
}
}
- delete [] pnSum;
+ delete[] pnSum;
return FALSE;
}
BOOL CInspectCamera::MakeNotchArea(DimensionDir emDim)
{
- if(m_pGlassData == NULL || m_pRecipe == NULL)
+ if (m_pGlassData == NULL || m_pRecipe == NULL)
return FALSE;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if(pSideData == NULL)
+ if (pSideData == NULL)
return FALSE;
- if(pSideData->m_bFindGlassStartLine == FALSE)
+ if (pSideData->m_bFindGlassStartLine == FALSE)
return FALSE;
- int nNotchCount = m_pRecipe->m_SideParam[(int) emDim].m_nNotchCount;
+ int nNotchCount = m_pRecipe->m_SideParam[(int)emDim].m_nNotchCount;
pSideData->m_nNotchCount = nNotchCount;
- g_pLog->DisplayMessage(_T("Make Notch Area - Side[%s] Notch Count[%d]"), g_SideName[(int) emDim], nNotchCount);
+ g_pLog->DisplayMessage(_T("Make Notch Area - Side[%s] Notch Count[%d]"), g_SideName[(int)emDim], nNotchCount);
- for(int i=0; i<nNotchCount; i++)
+ for (int i = 0; i < nNotchCount; i++)
{
- if(MAX_SIDE_NOTCH_COUNT <= i)
+ if (MAX_SIDE_NOTCH_COUNT <= i)
break;
- int nStartLine_Offset = pSideData->m_nGlassStartLine - m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_nGlassStartLine_pxl;
+ int nStartLine_Offset = pSideData->m_nGlassStartLine - m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_nGlassStartLine_pxl;
- pSideData->m_rtNotchArea_pxl[i] = m_pRecipe->m_SideParam[(int) emDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
+ pSideData->m_rtNotchArea_pxl[i] = m_pRecipe->m_SideParam[(int)emDim].m_NotchPrm[i].m_rtNotch_Area_pxl;
pSideData->m_rtNotchArea_pxl[i].OffsetRect(0, nStartLine_Offset);
}
@@ -6226,13 +6250,13 @@
return TRUE;
}
-BOOL CInspectCamera::ProcessFrame(int iThread,DimensionDir emDim,stFrameIndex stFrame)
+BOOL CInspectCamera::ProcessFrame(int iThread, DimensionDir emDim, stFrameIndex stFrame)
{
try {
- // 1. Find End Line.. (Corner甫 力寇茄 Side扼牢阑 茫扁 困秦 End Line何磐 茫绰促)
+ // 1. Find End Line.. (Corner毳� 鞝滌櫢頃� Side霛检澑鞚� 彀娟赴 鞙勴暣 End Line攵�韯� 彀倦姅雼�)
FindEndLine(iThread, emDim, stFrame);
- // 2. Find Side Line.. (秦寸 橇饭烙俊辑 Corner/Notch 甫 力寇茄 Side 扼牢 茫扁)
+ // 2. Find Side Line.. (頃措嫻 頂勲爤鞛勳棎靹� Corner/Notch 毳� 鞝滌櫢頃� Side 霛检澑 彀娟赴)
#if USE_AI_DETECT
FindSideLine(iThread, emDim, stFrame);
#else
@@ -6280,15 +6304,15 @@
int CInspectCamera::GetDefectCount()
{
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return 0;
return m_pDefectControl->GetDefectCount();
}
-CDefect *CInspectCamera::GetDefect(int iDefect)
+CDefect* CInspectCamera::GetDefect(int iDefect)
{
- if(m_pDefectControl == NULL)
+ if (m_pDefectControl == NULL)
return NULL;
return m_pDefectControl->GetDefect(iDefect);
@@ -6341,7 +6365,7 @@
if (m_wsClients != nullptr)
{
m_wsClients->set_message_handler([this](const std::string& msg) {
- // JSON 格式
+ // JSON 氇╅
if (!msg.empty() && msg.size() > 3) {
try {
nlohmann::json json_data = nlohmann::json::parse(msg);
@@ -6349,7 +6373,7 @@
DimensionDir emDim = (DimensionDir)(json_data.value("nLineType", 0) - 1);
WSReceiveData wsReceiveData;
- // 解析 JSON 数据并填充 wsReceiveData
+ // 鞃╅ JSON 閼掛暣旯昏紩雲� wsReceiveData
wsReceiveData.nRecipe = json_data.value("Reciepe", 0);
wsReceiveData.nLineType = json_data.value("nLineType", 0);
wsReceiveData.nIndex = json_data.value("nIndex", 0);
@@ -6357,19 +6381,19 @@
wsReceiveData.nFrameIdx = json_data.value("nFrameIdx", 0);
wsReceiveData.strSN = json_data.value("SN", "");
wsReceiveData.dTimeStamp = json_data.value("TimeStamp", 0.0);
- wsReceiveData.nGNum = json_data.value("NGnum", 0); // NG 数量
+ wsReceiveData.nGNum = json_data.value("NGnum", 0); // NG 閼掛
- // 格式化并显示基本信息
+ // 氇╅牒応够闉埢靸橁刀鏂ゅ彛
CString strText;
strText.Format(_T("Reciepe: %d, LineType: %d, Index: %d, SN: %s, NGNum: %d, TimeStamp: %f\n"),
wsReceiveData.nRecipe, wsReceiveData.nLineType, wsReceiveData.nIndex, wsReceiveData.strSN.c_str(), wsReceiveData.nGNum, wsReceiveData.dTimeStamp);
- if (wsReceiveData.nLineType > 0
- && wsReceiveData.nLineType < 9
+ if (wsReceiveData.nLineType > 0
+ && wsReceiveData.nLineType < 9
&& wsReceiveData.nGNum != 0
&& g_pBase->m_strHPanelID.Compare(CString(wsReceiveData.strSN.c_str())) == 0)
{
- // 遍历并填充 ngPosArray
+ // 旯侅爛旯昏紩雲� ngPosArray
auto ngPosArray = json_data["NGPosArray"];
for (auto& ngPos : ngPosArray) {
WSReceiveData::NGPosition ngPosition;
@@ -6403,15 +6427,15 @@
g_pLog->DisplayMessage(strText);
}
catch (const nlohmann::json::parse_error& e) {
- // 处理 JSON 解析错误
+ // 雵轨灴 JSON 鞃╅雽勮綆
std::cerr << "JSON parse error: " << e.what() << std::endl;
}
}
else {
- // 处理空消息
+ // 雵轨灴鞕曪鍙�
std::cerr << "Empty message" << std::endl;
}
- });
+ });
}
}
@@ -6448,18 +6472,18 @@
std::string jsonMetadata = CreateJsonWSSendData(wsData);
- // 预先分配内存,减少动态扩容
+ // 娓¢偙搿疙啝旖旊嫺锛岇垜 甯斤)妾勳湀頊�
std::vector<char> message;
message.reserve(jsonMetadata.size() + width * height);
- // 插入 JSON 数据和图像数据
+ // 昕潤 JSON 閼掛暣氲ㄦ殸鐛楅憭鞎�
message.insert(message.end(), jsonMetadata.begin(), jsonMetadata.end());
message.insert(message.end(), data, data + width * height);
- // 使用 std::move 传递 message,避免拷贝
+ // 璩堢棸 std::move 雸堧挼 message锛岅竵於滌槞甑�
bool isSucceed = m_wsClients->send_binary_to_idle_client_with_retry(std::move(message), 1000, 50);
if (!isSucceed)
- {
+ {
CDefect_Info defectInfo;
CRect rtDefectPos_pxl(left, top, left + width, top + height);
defectInfo.m_iFrameIdx = stFrame.nFrameIdx;
@@ -6583,7 +6607,7 @@
for (int i = 0; i < rtProcessArea.Height(); i++)
memcpy(pDefectProcessImage.GetDataAddress(0, i), frameBuffer.GetDataAddress(rtProcessArea.left, i), rtProcessArea.Width());
- // 发送从临时缓冲区中获取的数据
+ // 霝欑畤雼栰鐝傠粻雲戫槓娅撿偪順る彣閼掛暣
int state = (stFrame.nFrameIdx == 0) ? 1 : (pDefectProcessImage.GetHeight() < IMAGE_HEIGHT ? 2 : 3);
SendImageDataOverWebSocket(eDim, stFrame, stFrame.nFrameIdx, pDefectProcessImage.GetDataAddress(0, 0), state, nCutLine, vecInspectAreaList[nRegionIdx].top, pDefectProcessImage.GetWidth(), pDefectProcessImage.GetHeight());
@@ -6598,7 +6622,7 @@
#if USE_AI_DETECT
void CInspectCamera::SetUseAIDetect(bool bUseAIDetect)
-{
+{
m_bUseAIDetect = bUseAIDetect;
}
@@ -6676,7 +6700,7 @@
rtProcessArea.bottom += nHeightOff;
}
- // 保证图像高度为4的倍数
+ // 甏忚伅鏆犵崡氅曤槕妲�4霃怠閼�
nHeightOff = rtProcessArea.Height() % 4;
if (nHeightOff != 0)
{
@@ -6704,7 +6728,7 @@
myLoc.Lock();
long long dStartTime = GetCurrentTimestamp();
- // 发送从临时缓冲区中获取的数据
+ // 霝欑畤雼栰鐝傠粻雲戫槓娅撿偪順る彣閼掛暣
std::vector<AiDetectResult> results;
if (m_pAiDetectEx->detect(frame, results, m_strChannel)) {
for (auto& result : results) {
diff --git a/EdgeInspector_App/Process/InspectCamera.h b/EdgeInspector_App/Process/InspectCamera.h
index a16b3c1..1300e24 100644
--- a/EdgeInspector_App/Process/InspectCamera.h
+++ b/EdgeInspector_App/Process/InspectCamera.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "ThreadControl.h"
#include "DefectStorage.h"
@@ -59,7 +59,7 @@
// 0. Start Line
BOOL CheckStartLineFrame(DimensionDir eDim,int iFrame);
BOOL FindGlassStartLine(DimensionDir emDim, stFrameIndex stFrame);
- BOOL MakeNotchArea(DimensionDir emDim); // 矫累急阑 茫栏搁 Notch 康开阑 固府 父甸绢 初绰促.
+ BOOL MakeNotchArea(DimensionDir emDim); // 鐭疮鎬ラ槕 鑼爮鎼� Notch 搴峰紑闃� 鍥哄簻 鐖剁敻缁� 鍒濈话淇�.
// 1. Process Frame
BOOL ProcessFrame(int iThread,DimensionDir emDim, stFrameIndex stFrame);
@@ -137,7 +137,7 @@
// 12. Exception Area Process
BOOL ExceptionArea_Process(int iThread,DimensionDir emDim, stFrameIndex stFrame);
- //13. 视觉功能
+ //13. 瑙嗚鍔熻兘
void FinallyVisionProc(DimensionDir eDim);
protected:
diff --git a/EdgeInspector_App/Process/ThreadControl.cpp b/EdgeInspector_App/Process/ThreadControl.cpp
index 5d89499..0148d51 100644
--- a/EdgeInspector_App/Process/ThreadControl.cpp
+++ b/EdgeInspector_App/Process/ThreadControl.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "StdAfx.h"
#include "ThreadControl.h"
@@ -106,7 +106,7 @@
m_nWorkingThread++;
LeaveCriticalSection(&m_csWorkingEnd);
- Sleep(1);// 窍绰 老捞 绝栏搁 OnThreadEndAll 捞 静饭靛 俺荐 父怒 龋免瞪 荐 乐促.
+ Sleep(1);// 绐嶇话 鑰佹崬 缁濇爮鎼� OnThreadEndAll 鎹� 闈欓キ闈� 淇鸿崘 鐖舵�� 榫嬪厤鐬� 鑽� 涔愪績.
if(m_pThreadWorker)
return m_pThreadWorker->OnThreadRun(iThread, pInspectThread);
@@ -191,13 +191,13 @@
{
Sleep(1);
count++;
- if(ms > 0) // 措扁矫埃 力茄捞 乐栏搁.
+ if(ms > 0) // 鎺墎鐭焹 鍔涜寗鎹� 涔愭爮鎼�.
{
if(count > ms)
- return FALSE; // 措扁矫埃 悼救 沥惑 辆丰 给窍绊 府畔.
+ return FALSE; // 鎺墎鐭焹 鎮兼晳 娌ユ儜 杈嗕赴 缁欑獚缁� 搴滅晹.
}
}
- return TRUE; // 沥惑 辆丰 犬牢.
+ return TRUE; // 娌ユ儜 杈嗕赴 鐘墷.
}
BOOL CInspectThread::InitInstance()
diff --git a/EdgeInspector_App/Process/ThreadControl.h b/EdgeInspector_App/Process/ThreadControl.h
index 53a32be..e8ed8cd 100644
--- a/EdgeInspector_App/Process/ThreadControl.h
+++ b/EdgeInspector_App/Process/ThreadControl.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#define MAX_THREAD 1
@@ -31,7 +31,7 @@
virtual ~CInspectThread();
void SetWorker(IThreadWorker *pWorker){m_pWorker= pWorker;}
- BOOL StartThreadLoop(int iThread); // 檬扁
+ BOOL StartThreadLoop(int iThread); // 妾墎
void StartThreadWork(){m_bWorking= TRUE;}
void StopThread();
@@ -60,8 +60,8 @@
class CThreadControl : IThreadWorker
{
- int m_nThreadLoop; // 积己等 Thread Count
- int m_nWorkingThread; // 悼累[累诀]阑 矫累茄 Thread Count
+ int m_nThreadLoop; // 绉繁绛� Thread Count
+ int m_nWorkingThread; // 鎮肩疮[绱瘈]闃� 鐭疮鑼� Thread Count
CInspectThread *m_pThread;
IThreadWorker *m_pThreadWorker;
@@ -75,11 +75,11 @@
public:
- // 1. Thread 磊眉狼 积己苞 家戈俊 包咯.
+ // 1. Thread 纾婄湁鐙� 绉繁鑻� 瀹舵垐淇� 鍖呭挴.
int InitThreadControl(int nThread, IThreadWorker* pThreadWorker);
BOOL ReleaseThreadControl();
- // 2. Thread Loop 救俊辑 累诀狼 瘤矫 咯何父 牧飘费
+ // 2. Thread Loop 鏁戜繆杈� 绱瘈鐙� 鐦ょ煫 鍜綍鐖� 鐗ч璐�
int StartThreadControl();
void StopThreadControl();
diff --git a/EdgeInspector_App/Recipe/GlassRecipe.cpp b/EdgeInspector_App/Recipe/GlassRecipe.cpp
index f1c789c..95dbbc7 100644
--- a/EdgeInspector_App/Recipe/GlassRecipe.cpp
+++ b/EdgeInspector_App/Recipe/GlassRecipe.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "GlassRecipe.h"
//////////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/Recipe/GlassRecipe.h b/EdgeInspector_App/Recipe/GlassRecipe.h
index e09dd22..4a432a8 100644
--- a/EdgeInspector_App/Recipe/GlassRecipe.h
+++ b/EdgeInspector_App/Recipe/GlassRecipe.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Config.h"
#include "cv.h"
@@ -14,11 +14,11 @@
typedef struct tagJUDGEEDGE
{
- BOOL bError; //俊矾 咯何..
- int nRefernce; // 扁霖
- int nTolPlus; // +倾侩坷瞒
- int nTolMinus; // -倾侩坷瞒
- int nSlant; //荤急
+ BOOL bError; //淇婄熅 鍜綍..
+ int nRefernce; // 鎵侀湒
+ int nTolPlus; // +鍊句京鍧风瀿
+ int nTolMinus; // -鍊句京鍧风瀿
+ int nSlant; //鑽ゆ��
}JUDGEEDGE, *PJUDGEEDGE;
typedef struct tagUserDefectArea
@@ -53,10 +53,10 @@
typedef struct tagEXECPTION_AREA
{
int nAreaType;
- CRect rc; // 康开 困摹 (Mark 盔痢)
- SIZE szErrSize; // 捞 康开俊辑 利侩瞪 Size
- int nAppDefect; // 利侩瞪 Defect 辆幅
- int nDetectLimitedArea; // 荤侩磊 汲沥 ROI 荤侩 蜡公
+ CRect rc; // 搴峰紑 鍥版懝 (Mark 鐩旂棦)
+ SIZE szErrSize; // 鎹� 搴峰紑淇婅緫 鍒╀京鐬� Size
+ int nAppDefect; // 鍒╀京鐬� Defect 杈嗗箙
+ int nDetectLimitedArea; // 鑽や京纾� 姹叉播 ROI 鑽や京 铚″叕
void Init()
{
@@ -126,9 +126,9 @@
public:
- TCHAR m_strRecipeName[MAX_STRING_LENGTH]; // 饭矫乔 捞抚.
- TCHAR m_strRecipeFileName[MAX_STRING_LENGTH]; // 饭乔矫 颇老疙
- TCHAR m_strRecipeFileNameBackUp[MAX_STRING_LENGTH]; // 饭乔矫 颇老疙
+ TCHAR m_strRecipeName[MAX_STRING_LENGTH]; // 楗煫涔� 鎹炴姎.
+ TCHAR m_strRecipeFileName[MAX_STRING_LENGTH]; // 楗箶鐭� 棰囪�佺枡
+ TCHAR m_strRecipeFileNameBackUp[MAX_STRING_LENGTH]; // 楗箶鐭� 棰囪�佺枡
int m_nSoftRevision;
CString m_strComment; // Comment
@@ -222,9 +222,9 @@
BOOL WriteRecipe(CConfig *pFile, int nSideIdx, int nNotchIdx);
public:
- int m_nGlassStartLine_pxl; // Notch 殿废 且 锭 Glass Start Line..
- CPoint m_ptTopMarkPos; // Notch 殿废 且 锭 Top Align Mark..
- CPoint m_ptBotMarkPos; // Notch 殿废 且 锭 Bot Align Mark..
+ int m_nGlassStartLine_pxl; // Notch 娈垮簾 涓� 閿� Glass Start Line..
+ CPoint m_ptTopMarkPos; // Notch 娈垮簾 涓� 閿� Top Align Mark..
+ CPoint m_ptBotMarkPos; // Notch 娈垮簾 涓� 閿� Bot Align Mark..
BOOL m_bNotch_Use;
CRect m_rtNotch_Area_pxl;
@@ -258,8 +258,8 @@
// Notch Circle
int m_nNotch_Circle_Count;
BOOL m_bNotch_Circle_Use[MAX_SIDE_NOTCH_CIRCLE_COUNT];
- CPoint m_ptNotch_Circle_TopMarkPos[MAX_SIDE_NOTCH_CIRCLE_COUNT]; // Notch Circle 殿废 且 锭 Top Align Mark..
- CPoint m_ptNotch_Circle_BotMarkPos[MAX_SIDE_NOTCH_CIRCLE_COUNT]; // Notch Circle 殿废 且 锭 Bot Align Mark..
+ CPoint m_ptNotch_Circle_TopMarkPos[MAX_SIDE_NOTCH_CIRCLE_COUNT]; // Notch Circle 娈垮簾 涓� 閿� Top Align Mark..
+ CPoint m_ptNotch_Circle_BotMarkPos[MAX_SIDE_NOTCH_CIRCLE_COUNT]; // Notch Circle 娈垮簾 涓� 閿� Bot Align Mark..
CRect m_rtNotch_Circle_Area_pxl[MAX_SIDE_NOTCH_CIRCLE_COUNT];
double m_dNotch_Circle_Spec_Radius_um[MAX_SIDE_NOTCH_CIRCLE_COUNT];
double m_dNotch_Circle_Spec_Radius_Min_um[MAX_SIDE_NOTCH_CIRCLE_COUNT];
@@ -330,7 +330,7 @@
BOOL WriteRecipe(CConfig *pFile, int nSideIdx);
public:
- int m_nSidePanelSize_um; // Scan 搁狼 技肺 规氢 农扁
+ int m_nSidePanelSize_um; // Scan 鎼佺嫾 鎶�鑲� 瑙勬阿 鍐滄墎
int m_nFindStartEndLine_X_pxl; // Start/End Find Pos X
int m_nFindStartEndLine_Threshold;
int m_nSideLineThreshold;
diff --git a/EdgeInspector_App/Recipe/HardwareSettings.cpp b/EdgeInspector_App/Recipe/HardwareSettings.cpp
index 2a5f35c..e7f9f00 100644
--- a/EdgeInspector_App/Recipe/HardwareSettings.cpp
+++ b/EdgeInspector_App/Recipe/HardwareSettings.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "HardwareSettings.h"
//////////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/Recipe/HardwareSettings.h b/EdgeInspector_App/Recipe/HardwareSettings.h
index 1343696..afb57c3 100644
--- a/EdgeInspector_App/Recipe/HardwareSettings.h
+++ b/EdgeInspector_App/Recipe/HardwareSettings.h
@@ -1,11 +1,11 @@
-#pragma once
+锘�#pragma once
#include "Config.h"
#include "Global_Define.h"
-#define HARDWARE_SETTING_PATH _T("c:\\EdgeInspector_App\\Config\\HardwareSetting.cfg") // cfg 立辟 版肺汲沥
+#define HARDWARE_SETTING_PATH _T("c:\\EdgeInspector_App\\Config\\HardwareSetting.cfg") // cfg 绔嬭緹 鐗堣偤姹叉播
#define HARDWARE_SETTING_BACKUP_DIR_PATH _T("c:\\EdgeInspector_App\\Config\\Backup")
-#define KEY_BASIC _T("Software\\EdgeInspector_App\\BASIC\\") // 饭瘤胶飘府 立辟 版肺汲沥
+#define KEY_BASIC _T("Software\\EdgeInspector_App\\BASIC\\") // 楗槫鑳堕搴� 绔嬭緹 鐗堣偤姹叉播
#define MAX_CNC_COUNT 6
#define MAX_NCUT_STAGE_COUNT 12
#define MAX_CCUT_STAGE_COUNT 1
diff --git a/EdgeInspector_App/Side_Data.cpp b/EdgeInspector_App/Side_Data.cpp
index ee68e39..072b53e 100644
--- a/EdgeInspector_App/Side_Data.cpp
+++ b/EdgeInspector_App/Side_Data.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "Side_Data.h"
diff --git a/EdgeInspector_App/Side_Data.h b/EdgeInspector_App/Side_Data.h
index e2039ce..11f0368 100644
--- a/EdgeInspector_App/Side_Data.h
+++ b/EdgeInspector_App/Side_Data.h
@@ -1,7 +1,7 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
-// 弥措 橇饭烙 160, 1橇饭烙 1024, 256栏肺 唱床辑 八荤窍搁 1橇饭烙俊 4 = 640俺 沥档
+// 寮ユ帾 姗囬キ鐑� 160, 1姗囬キ鐑� 1024, 256鏍忚偤 鍞卞簥杈� 鍏崵绐嶆悂 1姗囬キ鐑欎繆 4 = 640淇� 娌ユ。
#define MAX_INSPECT_AREA_LIST 1024
class CSide_Data
@@ -20,7 +20,7 @@
double m_dPixelSizeX;
double m_dPixelSizeY;
- BOOL m_bInspection_Complete; // 八荤 肯丰 犬牢
+ BOOL m_bInspection_Complete; // 鍏崵 鑲赴 鐘墷
// Start Line
BOOL m_bFindGlassStartLine;
@@ -28,7 +28,7 @@
int m_nGlassStartFrame;
// Pre End Line
- int m_nPreGlassEndLine; // 抗惑登绰 End Line
+ int m_nPreGlassEndLine; // 鎶楁儜鐧荤话 End Line
int m_nPreGlassEndFrame;
// End Line
@@ -74,11 +74,11 @@
int m_nBotMarkToEdge_X_pxl;
int m_nBotMarkToEdge_Y_pxl;
- // Scan Start锭 固府 拌魂秦辑 静磊..
+ // Scan Start閿� 鍥哄簻 鎷岄瓊绉﹁緫 闈欑..
double m_dCamResolutionX;
double m_dCamResolutionY;
- // Frame 喊 茫篮 Side Line...
+ // Frame 鍠� 鑼 Side Line...
double m_nSideLineFrame[MAX_IMAGE_FRAME]; // Frame Side Line
double m_nSide_Chamfer_LineFrame[MAX_IMAGE_FRAME]; // Frame Side Line
@@ -90,7 +90,7 @@
int m_nSideInspectAreaCount[MAX_IMAGE_FRAME];
CRect m_rtSideInspectArea[MAX_IMAGE_FRAME][MAX_SIDE_INSPECT_AREA_COUNT];
- CRect m_rtInspectArea_InsType[MAX_SIDE_INSPECT_TYPE][MAX_IMAGE_FRAME]; // 八荤 康开
+ CRect m_rtInspectArea_InsType[MAX_SIDE_INSPECT_TYPE][MAX_IMAGE_FRAME]; // 鍏崵 搴峰紑
int m_nSideFilterLine_InsType[MAX_SIDE_INSPECT_TYPE][MAX_IMAGE_FRAME]; // Side Filter Line
// Measure Dimension
@@ -187,7 +187,7 @@
int m_nNgDefectCount;
// Thread Processing..
- BOOL m_nFrameThreadProc[MAX_IMAGE_FRAME]; // Thread啊 瘤唱埃 Frame阑 眉农窍磊..
+ BOOL m_nFrameThreadProc[MAX_IMAGE_FRAME]; // Thread鍟� 鐦ゅ敱鍩� Frame闃� 鐪夊啘绐嶇..
CCriticalSection m_csFrameThread;
};
diff --git a/EdgeInspector_App/Thread/PriorityThread.cpp b/EdgeInspector_App/Thread/PriorityThread.cpp
index c4ee047..faec624 100644
--- a/EdgeInspector_App/Thread/PriorityThread.cpp
+++ b/EdgeInspector_App/Thread/PriorityThread.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "PriorityThread.h"
#ifdef _DEBUG
diff --git a/EdgeInspector_App/Thread/PriorityThread.h b/EdgeInspector_App/Thread/PriorityThread.h
index 3da6f7d..0e11cc3 100644
--- a/EdgeInspector_App/Thread/PriorityThread.h
+++ b/EdgeInspector_App/Thread/PriorityThread.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "WorkThreadPool.h"
diff --git a/EdgeInspector_App/Thread/Thread_CheckSeq.cpp b/EdgeInspector_App/Thread/Thread_CheckSeq.cpp
index 918f478..32bf3d2 100644
--- a/EdgeInspector_App/Thread/Thread_CheckSeq.cpp
+++ b/EdgeInspector_App/Thread/Thread_CheckSeq.cpp
@@ -1,4 +1,4 @@
-// ProcPADThread.cpp : implementation file
+锘�// ProcPADThread.cpp : implementation file
//
#include "StdAfx.h"
@@ -28,7 +28,7 @@
{
BOOL bReturn = TRUE;
- // Thread 积己 饶 Thread 荐青
+ // Thread 绉繁 楗� Thread 鑽愰潚
bReturn = CreateTimerThread(this);
return bReturn;
@@ -96,7 +96,7 @@
SendCheckMSG.dwTickEnd = GetTickCount();
SendCheckMSG.dwDuration = SendCheckMSG.dwTickEnd - SendCheckMSG.dwTickStart;
- if(pStats->IsPostProcStart() == TRUE) // Post Process啊 矫累登菌栏搁 了促 昏力 茄促.
+ if(pStats->IsPostProcStart() == TRUE) // Post Process鍟� 鐭疮鐧昏弻鏍忔悂 浜嗕績 鏄忓姏 鑼勪績.
{
it->bDelete = TRUE;
continue;
diff --git a/EdgeInspector_App/Thread/Thread_CheckSeq.h b/EdgeInspector_App/Thread/Thread_CheckSeq.h
index 87082e1..52f8622 100644
--- a/EdgeInspector_App/Thread/Thread_CheckSeq.h
+++ b/EdgeInspector_App/Thread/Thread_CheckSeq.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#if _MSC_VER > 1000
#pragma once
diff --git a/EdgeInspector_App/Thread/Thread_ControlIF.cpp b/EdgeInspector_App/Thread/Thread_ControlIF.cpp
index 31b7d41..7de9e62 100644
--- a/EdgeInspector_App/Thread/Thread_ControlIF.cpp
+++ b/EdgeInspector_App/Thread/Thread_ControlIF.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "Thread_ControlIF.h"
#ifdef _DEBUG
@@ -21,7 +21,7 @@
{
BOOL bReturn = TRUE;
- // Thread 积己 饶 Thread 荐青
+ // Thread 绉繁 楗� Thread 鑽愰潚
bReturn = CreateTimerThread(this);
return bReturn;
diff --git a/EdgeInspector_App/Thread/Thread_ControlIF.h b/EdgeInspector_App/Thread/Thread_ControlIF.h
index a3f8e93..bc40791 100644
--- a/EdgeInspector_App/Thread/Thread_ControlIF.h
+++ b/EdgeInspector_App/Thread/Thread_ControlIF.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "TimerThreadPool.h"
diff --git a/EdgeInspector_App/Thread/Thread_Send.cpp b/EdgeInspector_App/Thread/Thread_Send.cpp
index c667f5e..4d3a2f5 100644
--- a/EdgeInspector_App/Thread/Thread_Send.cpp
+++ b/EdgeInspector_App/Thread/Thread_Send.cpp
@@ -1,4 +1,4 @@
-// ProcPADThread.cpp : implementation file
+锘�// ProcPADThread.cpp : implementation file
//
#include "StdAfx.h"
@@ -26,7 +26,7 @@
{
BOOL bReturn = TRUE;
- // Thread 积己 饶 Thread 荐青
+ // Thread 绉繁 楗� Thread 鑽愰潚
bReturn = CreateTimerThread(this);
return bReturn;
diff --git a/EdgeInspector_App/Thread/Thread_Send.h b/EdgeInspector_App/Thread/Thread_Send.h
index fadef77..0dbf3e2 100644
--- a/EdgeInspector_App/Thread/Thread_Send.h
+++ b/EdgeInspector_App/Thread/Thread_Send.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#if _MSC_VER > 1000
#pragma once
diff --git a/EdgeInspector_App/Thread/Thread_ViewRefresh.cpp b/EdgeInspector_App/Thread/Thread_ViewRefresh.cpp
index ea404de..909156e 100644
--- a/EdgeInspector_App/Thread/Thread_ViewRefresh.cpp
+++ b/EdgeInspector_App/Thread/Thread_ViewRefresh.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "Thread_ViewRefresh.h"
@@ -16,7 +16,7 @@
{
BOOL bReturn = TRUE;
- // Thread 积己 饶 Thread 荐青
+ // Thread 绉繁 楗� Thread 鑽愰潚
bReturn = CreateTimerThread(this);
return bReturn;
diff --git a/EdgeInspector_App/Thread/Thread_ViewRefresh.h b/EdgeInspector_App/Thread/Thread_ViewRefresh.h
index 4c7e7e7..1bc260e 100644
--- a/EdgeInspector_App/Thread/Thread_ViewRefresh.h
+++ b/EdgeInspector_App/Thread/Thread_ViewRefresh.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "TimerThreadPool.h"
#include "Global_Define.h"
diff --git a/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.cpp b/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.cpp
index 36ba5d5..16ff690 100644
--- a/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.cpp
+++ b/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "TriggerControl_Mvsol.h"
CTriggerControl_Mvsol::CTriggerControl_Mvsol(void)
@@ -90,29 +90,29 @@
return (m_hTriggerControl == NULL) ? FALSE : TRUE;
}
-// 飘府芭0锅 盲澄狼 浚内歹 涝仿阑 0锅栏肺 静扁
+// 椋樺簻鑺�0閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 0閿呮爮鑲� 闈欐墎
// SND : 02 57 00 00 00 74 00 80 00 4B 03
// ACK : 02 77 00 00 00 74 00 80 00 6B 03
-// 飘府芭1锅 盲澄狼 浚内歹 涝仿阑 0锅栏肺 静扁
+// 椋樺簻鑺�1閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 0閿呮爮鑲� 闈欐墎
// SND : 02 57 00 01 00 74 00 80 00 4C 03
// ACK : 02 77 00 01 00 74 00 80 00 6C 03
-// 飘府芭2锅 盲澄狼 浚内歹 涝仿阑 0锅栏肺 静扁
+// 椋樺簻鑺�2閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 0閿呮爮鑲� 闈欐墎
// SND : 02 57 00 7D 22 00 74 00 80 00 4D 03
// ACK : 02 77 00 7D 22 00 74 00 80 00 6D 03
-// 飘府芭3锅 盲澄狼 浚内歹 涝仿阑 0锅栏肺 静扁
+// 椋樺簻鑺�3閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 0閿呮爮鑲� 闈欐墎
// SND : 02 57 00 7D 23 00 74 00 80 00 4E 03
// ACK : 02 77 00 7D 23 00 74 00 80 00 6E 03
-// 飘府芭0锅 盲澄狼 浚内歹 涝仿阑 1锅栏肺 静扁
+// 椋樺簻鑺�0閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 1閿呮爮鑲� 闈欐墎
// SND : 02 57 00 00 10 74 00 80 00 5B 03
// ACK : 02 77 00 00 10 74 00 80 00 7B 03
-// 飘府芭1锅 盲澄狼 浚内歹 涝仿阑 1锅栏肺 静扁
+// 椋樺簻鑺�1閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 1閿呮爮鑲� 闈欐墎
// SND : 02 57 00 01 10 74 00 80 00 5C 03
// ACK : 02 77 00 00 10 74 00 80 00 7B 03
-// 飘府芭2锅 盲澄狼 浚内歹 涝仿阑 1锅栏肺 静扁
+// 椋樺簻鑺�2閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 1閿呮爮鑲� 闈欐墎
// SND : 02 57 00 7D 22 10 74 00 80 00 5D 03
// ACK : 02 77 00 7D 22 10 74 00 80 00 7D 5D 03
-// 飘府芭3锅 盲澄狼 浚内歹 涝仿阑 1锅栏肺 静扁
+// 椋樺簻鑺�3閿� 鐩叉緞鐙� 娴氬唴姝� 娑濅豢闃� 1閿呮爮鑲� 闈欐墎
// SND : 02 57 00 7D 23 10 74 00 80 00 5E 03
// ACK : 02 77 00 7D 23 10 74 00 80 00 7E 03
diff --git a/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.h b/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.h
index 616aca4..bf09172 100644
--- a/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.h
+++ b/EdgeInspector_App/TriggerBoard/TriggerControl_Mvsol.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
class CTriggerControl_Mvsol
{
diff --git a/EdgeInspector_App/UITool/DisplayMessage.cpp b/EdgeInspector_App/UITool/DisplayMessage.cpp
index 9660a68..264a4ec 100644
--- a/EdgeInspector_App/UITool/DisplayMessage.cpp
+++ b/EdgeInspector_App/UITool/DisplayMessage.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "DisplayMessage.h"
CDisplayMessage::CDisplayMessage(void)
@@ -33,7 +33,7 @@
BOOL CDisplayMessage::MakeLogFile()
{
- // Log 贸府
+ // Log 璐稿簻
if (m_strLogPath.IsEmpty())
return FALSE;
diff --git a/EdgeInspector_App/UITool/DisplayMessage.h b/EdgeInspector_App/UITool/DisplayMessage.h
index b06be99..5287adf 100644
--- a/EdgeInspector_App/UITool/DisplayMessage.h
+++ b/EdgeInspector_App/UITool/DisplayMessage.h
@@ -1,4 +1,4 @@
-// DisplayMessage.h: interface for the CDisplayMessage class.
+锘�// DisplayMessage.h: interface for the CDisplayMessage class.
//
//////////////////////////////////////////////////////////////////////
diff --git a/EdgeInspector_App/UITool/General_Draw.cpp b/EdgeInspector_App/UITool/General_Draw.cpp
index 7b563a0..da8f348 100644
--- a/EdgeInspector_App/UITool/General_Draw.cpp
+++ b/EdgeInspector_App/UITool/General_Draw.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "StdAfx.h"
#include "General_Draw.h"
#include "Server_MemDC.h"
diff --git a/EdgeInspector_App/UITool/General_Draw.h b/EdgeInspector_App/UITool/General_Draw.h
index b7d445f..7b3bd7c 100644
--- a/EdgeInspector_App/UITool/General_Draw.h
+++ b/EdgeInspector_App/UITool/General_Draw.h
@@ -1,4 +1,4 @@
-#if !defined(__GENERALDRAW_INCLUDED__)
+锘�#if !defined(__GENERALDRAW_INCLUDED__)
#define __GENERALDRAW_INCLUDED__
//////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
CreateFont(&m_Font[EN_ITEMFONT],14,_T("Arial"));
CreateFont(&m_Font[EN_DATAFONT],12,_T("Arial"));
CreateFont(&m_Font[EN_BUTTONFONT],24,_T("Arial"));
- CreateFont(&m_Font[EN_HANFONT],12,_T("奔覆眉"));
+ CreateFont(&m_Font[EN_HANFONT],12,_T("濂旇鐪�"));
CreateFont(&m_Font[EN_LARGEFONT],48,_T("Arial"));
CreateFont(&m_Font[EN_MIDDLEFONT],35,_T("Arial"));
}
diff --git a/EdgeInspector_App/UITool/MImageStatic.cpp b/EdgeInspector_App/UITool/MImageStatic.cpp
index af503ca..babae94 100644
--- a/EdgeInspector_App/UITool/MImageStatic.cpp
+++ b/EdgeInspector_App/UITool/MImageStatic.cpp
@@ -1,4 +1,4 @@
-// MImageStatic.cpp : implementation file
+锘�// MImageStatic.cpp : implementation file
//
#include "stdafx.h"
@@ -233,7 +233,7 @@
void CMImageStatic::ResetImageStatic()
{
- // 搬窃 捞固瘤 滚欺甫 檬扁拳.
+ // 鎼獌 鎹炲浐鐦� 婊氭鐢� 妾墎鎷�.
ZeroMemory(m_ImageBuf, DEFECTIMAGE_WIDTH * DEFECTIMAGE_HEIGHT + 1);
m_bSetImage = FALSE;
m_rectDefect = CRect(0,0,0,0);
diff --git a/EdgeInspector_App/UITool/MImageStatic.h b/EdgeInspector_App/UITool/MImageStatic.h
index 619d47b..8f3a08c 100644
--- a/EdgeInspector_App/UITool/MImageStatic.h
+++ b/EdgeInspector_App/UITool/MImageStatic.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_HMIMAGESTATIC_H__D74697CD_885E_4E7C_A9EA_2A57C3F51B4A__INCLUDED_)
+锘�#if !defined(AFX_HMIMAGESTATIC_H__D74697CD_885E_4E7C_A9EA_2A57C3F51B4A__INCLUDED_)
#define AFX_HMIMAGESTATIC_H__D74697CD_885E_4E7C_A9EA_2A57C3F51B4A__INCLUDED_
#if _MSC_VER > 1000
@@ -20,7 +20,7 @@
// Attributes
public:
- UCHAR m_ImageBuf[DEFECTIMAGE_WIDTH * DEFECTIMAGE_HEIGHT + 1]; // 搬窃 捞固瘤甫 焊咯林绰 滚欺.
+ UCHAR m_ImageBuf[DEFECTIMAGE_WIDTH * DEFECTIMAGE_HEIGHT + 1]; // 鎼獌 鎹炲浐鐦ょ敨 鐒婂挴鏋楃话 婊氭.
BYTE m_BitmapInfo[sizeof(BITMAPINFOHEADER)+256*sizeof(RGBQUAD)];
BOOL m_bSetImage;
void ResetImageStatic();
diff --git a/EdgeInspector_App/UITool/PixelPtr.h b/EdgeInspector_App/UITool/PixelPtr.h
index 3a22864..5b82e62 100644
--- a/EdgeInspector_App/UITool/PixelPtr.h
+++ b/EdgeInspector_App/UITool/PixelPtr.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
class CPixelPtr
{
diff --git a/EdgeInspector_App/UITool/Server_MemDC.h b/EdgeInspector_App/UITool/Server_MemDC.h
index 4fede22..3c342b4 100644
--- a/EdgeInspector_App/UITool/Server_MemDC.h
+++ b/EdgeInspector_App/UITool/Server_MemDC.h
@@ -1,4 +1,4 @@
-#if !defined(CControlMemDC__INCLUDED_)
+锘�#if !defined(CControlMemDC__INCLUDED_)
#define CControlMemDC__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/Singleton.h b/EdgeInspector_App/UITool/Singleton.h
index 9cd06a8..a6a1529 100644
--- a/EdgeInspector_App/UITool/Singleton.h
+++ b/EdgeInspector_App/UITool/Singleton.h
@@ -1,4 +1,4 @@
-//////////////////////////////////////////////////////////////////////////////////////
+锘�//////////////////////////////////////////////////////////////////////////////////////
// Singleton.h: interface for the Singleton class.
//////////////////////////////////////////////////////////////////////////////////////
// ex) sample
@@ -24,10 +24,10 @@
/*---------------------------------------------------------------------------
-# 颇老疙 : Singleton.h
-# 汲 疙 : interface for the Singleton template class.
-# 郴 仿 :
-# 厚 绊 :
+# 棰囪�佺枡 : Singleton.h
+# 姹� 鐤� : interface for the Singleton template class.
+# 閮� 浠� :
+# 鍘� 缁� :
---------------------------------------------------------------------------*/
@@ -48,14 +48,14 @@
/*---------------------------------------------------------------------------
-# 努贰胶 疙 : Singleton
-# 何葛努贰胶 : 绝澜
-# 曼炼努贰胶 : 绝澜
-# 包府氓烙磊 : Voidhoon
-# 汲 疙 :
-# 函 荐 :
-# 郴 仿 :
-# 巩 力 痢 :
+# 鍔窗鑳� 鐤� : Singleton
+# 浣曡憶鍔窗鑳� : 缁濇緶
+# 鏇肩偧鍔窗鑳� : 缁濇緶
+# 鍖呭簻姘撶儥纾� : Voidhoon
+# 姹� 鐤� :
+# 鍑� 鑽� :
+# 閮� 浠� :
+# 宸� 鍔� 鐥� :
---------------------------------------------------------------------------*/
diff --git a/EdgeInspector_App/UITool/Splash.cpp b/EdgeInspector_App/UITool/Splash.cpp
index b5ad03c..f340eb0 100644
--- a/EdgeInspector_App/UITool/Splash.cpp
+++ b/EdgeInspector_App/UITool/Splash.cpp
@@ -1,4 +1,4 @@
-// ===========================================================================
+锘�// ===========================================================================
// File Splash.cpp
// Desc The implementation file for the CSplash class.
// ===========================================================================
diff --git a/EdgeInspector_App/UITool/Splash.h b/EdgeInspector_App/UITool/Splash.h
index db5f9fb..2c740be 100644
--- a/EdgeInspector_App/UITool/Splash.h
+++ b/EdgeInspector_App/UITool/Splash.h
@@ -1,4 +1,4 @@
-// ===========================================================================
+锘�// ===========================================================================
// File Splash.h
// Desc The interface of the CSplash class
// ===========================================================================
diff --git a/EdgeInspector_App/UITool/btnenh.cpp b/EdgeInspector_App/UITool/btnenh.cpp
index 95519b6..fd12318 100644
--- a/EdgeInspector_App/UITool/btnenh.cpp
+++ b/EdgeInspector_App/UITool/btnenh.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/btnenh.h b/EdgeInspector_App/UITool/btnenh.h
index c6342b0..864f61c 100644
--- a/EdgeInspector_App/UITool/btnenh.h
+++ b/EdgeInspector_App/UITool/btnenh.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_BTNENH_H__56F13D02_8CDD_42E1_9A73_46B206613CA4__INCLUDED_)
+锘�#if !defined(AFX_BTNENH_H__56F13D02_8CDD_42E1_9A73_46B206613CA4__INCLUDED_)
#define AFX_BTNENH_H__56F13D02_8CDD_42E1_9A73_46B206613CA4__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/cellsmanager.cpp b/EdgeInspector_App/UITool/cellsmanager.cpp
index 54e3cc3..13d5b01 100644
--- a/EdgeInspector_App/UITool/cellsmanager.cpp
+++ b/EdgeInspector_App/UITool/cellsmanager.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/cellsmanager.h b/EdgeInspector_App/UITool/cellsmanager.h
index e8480a6..c18e90f 100644
--- a/EdgeInspector_App/UITool/cellsmanager.h
+++ b/EdgeInspector_App/UITool/cellsmanager.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_CELLSMANAGER_H__519A1760_5ECF_4E09_ADF7_27E85FC5E0F8__INCLUDED_)
+锘�#if !defined(AFX_CELLSMANAGER_H__519A1760_5ECF_4E09_ADF7_27E85FC5E0F8__INCLUDED_)
#define AFX_CELLSMANAGER_H__519A1760_5ECF_4E09_ADF7_27E85FC5E0F8__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/font.cpp b/EdgeInspector_App/UITool/font.cpp
index 4a9b88c..e369adf 100644
--- a/EdgeInspector_App/UITool/font.cpp
+++ b/EdgeInspector_App/UITool/font.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/font.h b/EdgeInspector_App/UITool/font.h
index d3d0066..c56ef78 100644
--- a/EdgeInspector_App/UITool/font.h
+++ b/EdgeInspector_App/UITool/font.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_FONT_H__680D290B_7A37_47D6_8E9B_300045E3AE85__INCLUDED_)
+锘�#if !defined(AFX_FONT_H__680D290B_7A37_47D6_8E9B_300045E3AE85__INCLUDED_)
#define AFX_FONT_H__680D290B_7A37_47D6_8E9B_300045E3AE85__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/surfacecolor.cpp b/EdgeInspector_App/UITool/surfacecolor.cpp
index 4389926..ec9cc92 100644
--- a/EdgeInspector_App/UITool/surfacecolor.cpp
+++ b/EdgeInspector_App/UITool/surfacecolor.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/surfacecolor.h b/EdgeInspector_App/UITool/surfacecolor.h
index 1f8a020..e40639e 100644
--- a/EdgeInspector_App/UITool/surfacecolor.h
+++ b/EdgeInspector_App/UITool/surfacecolor.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_SURFACECOLOR_H__C6425A9A_E45A_4DD6_BB82_0603E9663A09__INCLUDED_)
+锘�#if !defined(AFX_SURFACECOLOR_H__C6425A9A_E45A_4DD6_BB82_0603E9663A09__INCLUDED_)
#define AFX_SURFACECOLOR_H__C6425A9A_E45A_4DD6_BB82_0603E9663A09__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/textdescriptor.cpp b/EdgeInspector_App/UITool/textdescriptor.cpp
index 7c088e5..99b24fc 100644
--- a/EdgeInspector_App/UITool/textdescriptor.cpp
+++ b/EdgeInspector_App/UITool/textdescriptor.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/textdescriptor.h b/EdgeInspector_App/UITool/textdescriptor.h
index 652ae18..b4a4c2a 100644
--- a/EdgeInspector_App/UITool/textdescriptor.h
+++ b/EdgeInspector_App/UITool/textdescriptor.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_TEXTDESCRIPTOR_H__8439099C_F0E9_45BA_9D40_FCE6F4946E85__INCLUDED_)
+锘�#if !defined(AFX_TEXTDESCRIPTOR_H__8439099C_F0E9_45BA_9D40_FCE6F4946E85__INCLUDED_)
#define AFX_TEXTDESCRIPTOR_H__8439099C_F0E9_45BA_9D40_FCE6F4946E85__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/UITool/texture.cpp b/EdgeInspector_App/UITool/texture.cpp
index 466ab7e..d14020a 100644
--- a/EdgeInspector_App/UITool/texture.cpp
+++ b/EdgeInspector_App/UITool/texture.cpp
@@ -1,4 +1,4 @@
-// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
+锘�// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
diff --git a/EdgeInspector_App/UITool/texture.h b/EdgeInspector_App/UITool/texture.h
index 38455c4..21de78f 100644
--- a/EdgeInspector_App/UITool/texture.h
+++ b/EdgeInspector_App/UITool/texture.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_TEXTURE_H__AF25E66F_E258_4096_BA2D_3E2E9DB88B3D__INCLUDED_)
+锘�#if !defined(AFX_TEXTURE_H__AF25E66F_E258_4096_BA2D_3E2E9DB88B3D__INCLUDED_)
#define AFX_TEXTURE_H__AF25E66F_E258_4096_BA2D_3E2E9DB88B3D__INCLUDED_
#if _MSC_VER > 1000
diff --git a/EdgeInspector_App/View/DlgLogin.cpp b/EdgeInspector_App/View/DlgLogin.cpp
index 778013e..dd05bf8 100644
--- a/EdgeInspector_App/View/DlgLogin.cpp
+++ b/EdgeInspector_App/View/DlgLogin.cpp
@@ -1,4 +1,4 @@
-// DlgLogin.cpp : implementation file
+锘�// DlgLogin.cpp : implementation file
//
#include "stdafx.h"
diff --git a/EdgeInspector_App/View/DlgLogin.h b/EdgeInspector_App/View/DlgLogin.h
index 46d7bbf..7f3092b 100644
--- a/EdgeInspector_App/View/DlgLogin.h
+++ b/EdgeInspector_App/View/DlgLogin.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
/////////////////////////////////////////////////////////////////////////////
// CDlgLogin dialog
#include "EdgeInspector_App.h"
diff --git a/EdgeInspector_App/View/EdgeImageViewer.cpp b/EdgeInspector_App/View/EdgeImageViewer.cpp
index dc5ab95..418d499 100644
--- a/EdgeInspector_App/View/EdgeImageViewer.cpp
+++ b/EdgeInspector_App/View/EdgeImageViewer.cpp
@@ -1,4 +1,4 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
#include "EdgeImageViewer.h"
// CEdgeImageViewer
@@ -136,8 +136,8 @@
{
CMenu menu;
CMenu popMenu;
- menu.CreateMenu(); // 弥惑困 焕措 皋春
- popMenu.CreatePopupMenu(); // 扑诀皋春
+ menu.CreateMenu(); // 寮ユ儜鍥� 鐒曟帾 鐨嬫槬
+ popMenu.CreatePopupMenu(); // 鎵戣瘈鐨嬫槬
popMenu.AppendMenu(MF_SEPARATOR);
popMenu.AppendMenu(MF_STRING, ID_MODE_USER_SELECT, _T("User Select (Mark/Manual Measure)"));
@@ -230,7 +230,7 @@
if(bAllCheck)
popMenu.CheckMenuItem(ID_MODE_VIEW_DEFECT_ALL,MF_CHECKED);
- // 牧咆胶飘 皋春 龋免
+ // 鐗у拞鑳堕 鐨嬫槬 榫嬪厤
CRect rect;
GetWindowRect(rect);
int nX = rect.left + point.x;
@@ -498,8 +498,8 @@
void CEdgeImageViewer::OnPaint()
{
CPaintDC dc(this); // device context for painting
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊钦聪促.
- // 弊府扁 皋矫瘤俊 措秦辑绰 CStatic::OnPaint()阑(甫) 龋免窍瘤 付绞矫坷.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
+ // 寮婂簻鎵� 鐨嬬煫鐦や繆 鎺Е杈戠话 CStatic::OnPaint()闃�(鐢�) 榫嬪厤绐嶇槫 浠樼粸鐭澐.
UpdateView();
}
@@ -529,7 +529,7 @@
// 1. Draw Buffer Image
UpdateView_Image(&memDC);
- //2. 显示视觉效果
+ //2. 鏄剧ず瑙嗚鏁堟灉
UpdateView_VisionResult(&memDC);
@@ -568,7 +568,7 @@
for (int i = 0; i < nCount; i++) {
DispVisionResult inf = pSideData->m_vDispVisionResult[i];
int nType = inf.nType;
- if (0 == nType) { //点
+ if (0 == nType) { //鐐�
CRect rtMarkPos_pxl = CRect(inf.pointX-31, inf.pointY-31, inf.pointX + 31, inf.pointY + 31);
CRect rtMarkPos_wnd = GetWndPos(rtMarkPos_pxl);
CPoint ptMarkPos_wnd = rtMarkPos_wnd.CenterPoint();
@@ -582,7 +582,7 @@
memDC->LineTo(ptMarkPos_wnd.x - 8, ptMarkPos_wnd.y + 8);
}
}
- else if (1 == nType) { //矩形
+ else if (1 == nType) { //鐭╁舰
CRect rtMarkPos_pxl = CRect(inf.rectX1, inf.rectY1, inf.rectX2, inf.rectY2);
CRect rtMarkSearchPos_wnd = GetWndPos(rtMarkPos_pxl);
if (4 == inf.eVision) {
@@ -598,7 +598,7 @@
memDC->Rectangle(rtMarkSearchPos_wnd);
}
}
- else if (2 == nType) { //圆
+ else if (2 == nType) { //鍦�
CRect rtMarkPos_pxl = CRect(inf.circleX - inf.circleRadius, inf.circleY - inf.circleRadius, inf.circleX + inf.circleRadius, inf.circleY + inf.circleRadius);
CRect rtMarkSearchPos_wnd = GetWndPos(rtMarkPos_pxl);
memDC->SelectObject(&pen);
@@ -609,7 +609,7 @@
memDC->Ellipse(rtMarkSearchPos_wnd);
}
}
- else if (3 == nType) { //直线
+ else if (3 == nType) { //鐩寸嚎
CRect rtMarkPos_pxl = CRect(inf.rectX1 - 31, inf.rectY1 - 31, inf.rectX1 + 31, inf.rectY1 + 31);
CRect rtMarkPos_wnd = GetWndPos(rtMarkPos_pxl);
CPoint pt0 = rtMarkPos_wnd.CenterPoint();
@@ -718,7 +718,7 @@
UpdateView_MousePoint(&memDC);
#if HALCON_VISION_KEY
- //17. 显示vision Rsult
+ //17. 鏄剧ずvision Rsult
UpdateView_VisionResult(&memDC);
#endif // HALCON_VISION_KEY
@@ -861,7 +861,7 @@
if(m_ptMousePos_Pxl.y < 0 || m_nTotalHeight <= m_ptMousePos_Pxl.y)
return;
- int nYPos = m_ptMousePos_Pxl.y - m_ptDisplayStart_pxl.y; // Recipe View俊辑 Scroll 且 锭 滚欺 困摹甫 官厕;;;
+ int nYPos = m_ptMousePos_Pxl.y - m_ptDisplayStart_pxl.y; // Recipe View淇婅緫 Scroll 涓� 閿� 婊氭 鍥版懝鐢� 瀹樺帟;;;
int nPos = (nYPos * m_nFrameWidth) + m_ptMousePos_Pxl.x;
@@ -872,7 +872,7 @@
memDC->TextOut(10, m_rtWnd.Height() - 45, strTemp);
#if HALCON_VISION_KEY
- if ((0 != m_ptMouseDown.x || 0 != m_ptMouseDown.y) && BlVision_GetVisionRecipe()->getVisionSetOpen()) { //鼠标改变
+ if ((0 != m_ptMouseDown.x || 0 != m_ptMouseDown.y) && BlVision_GetVisionRecipe()->getVisionSetOpen()) { //榧犳爣鏀瑰彉
strTemp.Format(_T("(%d / %d)"), m_ptMouseDown.x, m_ptMouseDown.y);
memDC->TextOut(10, m_rtWnd.Height() - 25, strTemp);
@@ -897,11 +897,13 @@
void CEdgeImageViewer::UpdateView_InspectArea(CDC* memDC)
{
- if(m_pBuffer == NULL || memDC == NULL || m_pGlassData == NULL)
+ if (m_pBuffer == NULL || memDC == NULL || m_pGlassData == NULL) {
return;
+ }
- if(m_MenuStatus[MODE_VIEW_INSPECT_AREA] == FALSE)
+ if (m_MenuStatus[MODE_VIEW_INSPECT_AREA] == FALSE) {
return;
+ }
CPen pen_SideLine(PS_DASH, 1, RGB(255,127,39));
CPen pen_ChamferLine(PS_DASH, 1, RGB(255,255,0));
@@ -916,49 +918,42 @@
CRect rcTmp,rtRealPos;
int nFilterLine;
- int nChamferLine;
- for(int nFrameIdx = 0; nFrameIdx < MAX_IMAGE_FRAME; nFrameIdx++)
- {
+ for(int nFrameIdx = 0; nFrameIdx < MAX_IMAGE_FRAME; nFrameIdx++) {
CRect rtArea_Inspect = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_rtInspectArea[nFrameIdx];
- int nSideLine = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nSideLineFrame[nFrameIdx];
- int nSideChamferLine = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nSide_Chamfer_LineFrame[nFrameIdx];
+ int nSideLine = (int)m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nSideLineFrame[nFrameIdx];
+ int nSideChamferLine = (int)m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nSide_Chamfer_LineFrame[nFrameIdx];
// Side Line
rtRealPos = rtArea_Inspect;
nFilterLine = nSideLine;
- if(0 < nFilterLine)
- {
+ if(0 < nFilterLine) {
memDC->SelectObject(&pen_SideLine);
memDC->MoveTo(int((nFilterLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
memDC->LineTo(int((nFilterLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.bottom - m_ptDisplayStart_pxl.y) * m_dZoom));
}
- if(0 < nSideChamferLine)
- {
+ if(0 < nSideChamferLine) {
memDC->SelectObject(&pen_ChamferLine);
memDC->MoveTo(int((nSideChamferLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
memDC->LineTo(int((nSideChamferLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.bottom - m_ptDisplayStart_pxl.y) * m_dZoom));
}
- for(int nInsType = 0; nInsType < MAX_SIDE_INSPECT_TYPE; nInsType++)
- {
+ for(int nInsType = 0; nInsType < MAX_SIDE_INSPECT_TYPE; nInsType++) {
CRect rtArea = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_rtInspectArea_InsType[nInsType][nFrameIdx];
int nFilterLine = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nSideFilterLine_InsType[nInsType][nFrameIdx];
rtRealPos = rtArea;
nFilterLine = nFilterLine;
- if(rtRealPos.IsRectEmpty() != TRUE && rtRealPos.IsRectNull() != TRUE)
- {
+ if(rtRealPos.IsRectEmpty() != TRUE && rtRealPos.IsRectNull() != TRUE) {
rcTmp.left = int((rtRealPos.left - m_ptDisplayStart_pxl.x ) * m_dZoom);
rcTmp.right = int((rtRealPos.right - m_ptDisplayStart_pxl.x ) * m_dZoom);
rcTmp.top = int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom);
rcTmp.bottom = int((rtRealPos.bottom - m_ptDisplayStart_pxl.y) * m_dZoom);
- if(rcTmp.top < 0 && rcTmp.bottom > 0 || rcTmp.top > 0 && rcTmp.top < m_rtWnd.bottom +1 || rcTmp.bottom > 0 && rcTmp.bottom < m_rtWnd.bottom +1)
- {
+ if(rcTmp.top < 0 && rcTmp.bottom > 0 || rcTmp.top > 0 && rcTmp.top < m_rtWnd.bottom +1 || rcTmp.bottom > 0 && rcTmp.bottom < m_rtWnd.bottom +1) {
memDC->SelectObject(&pen_Green);
memDC->MoveTo(int((rtRealPos.left - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
memDC->LineTo(int((rtRealPos.right - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
@@ -967,8 +962,7 @@
memDC->LineTo(int((rtRealPos.left - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
}
- if(0 < nFilterLine)
- {
+ if(0 < nFilterLine) {
memDC->SelectObject(&pen_FilterLine);
memDC->MoveTo(int((nFilterLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.top - m_ptDisplayStart_pxl.y) * m_dZoom));
memDC->LineTo(int((nFilterLine - m_ptDisplayStart_pxl.x ) * m_dZoom) , int((rtRealPos.bottom - m_ptDisplayStart_pxl.y) * m_dZoom));
@@ -1933,7 +1927,7 @@
rtCircle.bottom = rtCircle.top + (nDistanceY_wnd * 2);
memDC->Arc(rtCircle, CPoint(rtCircle.left, rtCircle.CenterPoint().y), CPoint(rtCircle.left, rtCircle.CenterPoint().y));
- /* 康开 救狼 1/4 盔父 焊捞绊 酵阑锭..
+ /* 搴峰紑 鏁戠嫾 1/4 鐩旂埗 鐒婃崬缁� 閰甸槕閿�..
if((ptEnd_Wnd.x < ptStart_Wnd.x && ptEnd_Wnd.y < ptStart_Wnd.y) || (ptEnd_Wnd.x > ptStart_Wnd.x && ptEnd_Wnd.y > ptStart_Wnd.y))
memDC->Arc(rtCircle, CPoint(rtCircle.CenterPoint().x, ptEnd_Wnd.y), CPoint(ptEnd_Wnd.x, rtCircle.CenterPoint().y));
else
@@ -2240,7 +2234,7 @@
for(int nX = m_ptMousePos_Pxl.x -8; nX < m_ptMousePos_Pxl.x + 8 ; nX++)
{
int nX_pxl = nX;
- int nY_pxl = nY - m_ptDisplayStart_pxl.y; // Recipe View俊辑 Scroll 且 锭 滚欺 困摹甫 官厕;;;
+ int nY_pxl = nY - m_ptDisplayStart_pxl.y; // Recipe View淇婅緫 Scroll 涓� 閿� 婊氭 鍥版懝鐢� 瀹樺帟;;;
if(nX_pxl < 0 || m_nFrameWidth <= nX_pxl)
continue;
@@ -2263,7 +2257,7 @@
for(int nX = m_ptMousePos_Pxl.x -8; nX < m_ptMousePos_Pxl.x + 8 ; nX++)
{
int nX_pxl = nX;
- int nY_pxl = nY - m_ptDisplayStart_pxl.y; // Recipe View俊辑 Scroll 且 锭 滚欺 困摹甫 官厕;;;
+ int nY_pxl = nY - m_ptDisplayStart_pxl.y; // Recipe View淇婅緫 Scroll 涓� 閿� 婊氭 鍥版懝鐢� 瀹樺帟;;;
if(nX_pxl < 0 || m_nFrameWidth <= nX_pxl)
continue;
@@ -2349,7 +2343,7 @@
#if HALCON_VISION_KEY
void CEdgeImageViewer::OnLButtonUp(UINT nFlags, CPoint point)
{
- // TODO: 在此添加消息处理程序代码和/或调用默认值
+ // TODO: 鍦ㄦ娣诲姞娑堟伅澶勭悊绋嬪簭浠g爜鍜�/鎴栬皟鐢ㄩ粯璁ゅ��
m_isMouseDown = FALSE;
CWnd::OnLButtonUp(nFlags, point);
diff --git a/EdgeInspector_App/View/EdgeImageViewer.h b/EdgeInspector_App/View/EdgeImageViewer.h
index 476d73a..c29a073 100644
--- a/EdgeInspector_App/View/EdgeImageViewer.h
+++ b/EdgeInspector_App/View/EdgeImageViewer.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include <bitset>
#include "Global_Define.h"
#include "cv.h"
@@ -181,12 +181,12 @@
double m_dPixelSizeY; // Resolution Y
double m_dZoom;
- bitset<MAX_DISPLAY_SET> m_MenuStatus; // 拳搁 葛靛 惑怕
- EdgeViewer_ManualMeasure m_ManualMeasureStatus; // 荐悼 螟沥 惑怕
+ bitset<MAX_DISPLAY_SET> m_MenuStatus; // 鎷虫悂 钁涢潧 鎯戞��
+ EdgeViewer_ManualMeasure m_ManualMeasureStatus; // 鑽愭偧 铻熸播 鎯戞��
- CPoint m_ptDisplayStart_pxl; // View狼 0,0 狼 Pxl 困摹
- CPoint m_ptMousePos_Wnd; // Wnd狼 付快胶 困摹
- CPoint m_ptMousePos_Pxl; // Pixel狼 付快胶 困摹
+ CPoint m_ptDisplayStart_pxl; // View鐙� 0,0 鐙� Pxl 鍥版懝
+ CPoint m_ptMousePos_Wnd; // Wnd鐙� 浠樺揩鑳� 鍥版懝
+ CPoint m_ptMousePos_Pxl; // Pixel鐙� 浠樺揩鑳� 鍥版懝
public:
@@ -212,11 +212,11 @@
SIZE m_szImg;
SIZE m_szMark;
MANUAL_MEASURE m_ManualMeausre;
- CPoint m_ptMouseSaved; // Profile Save 扁瓷矫 荤侩
+ CPoint m_ptMouseSaved; // Profile Save 鎵佺摲鐭� 鑽や京
IViewInterface2Parent *m_pI2M;
- CRect m_rcROI; // 泅力 焊咯瘤绊 乐绰 康开
+ CRect m_rcROI; // 娉呭姏 鐒婂挴鐦ょ粖 涔愮话 搴峰紑
CFont m_sideFont;
CImage m_ImageMagnify;
EXECPTION_AREA m_refMark;
@@ -228,10 +228,10 @@
CGlassRecipe* m_pRecipe;
public:
- CPoint m_ptMouseCurrent; // 泅犁 付快胶 谅钎
+ CPoint m_ptMouseCurrent; // 娉呯妬 浠樺揩鑳� 璋呴拵
EXECPTION_AREA *m_pTracker;
CRect m_WndRect;
- POINT m_ptOrg; // 傈眉 捞固瘤俊辑 Display 矫累 谅钎
+ POINT m_ptOrg; // 鍌堢湁 鎹炲浐鐦や繆杈� Display 鐭疮 璋呴拵
int m_nModeTrackerVCR;
CPoint m_ptOldMouseVCR;
diff --git a/EdgeInspector_App/View/FrameImg.cpp b/EdgeInspector_App/View/FrameImg.cpp
index 9d0ac4d..f836b31 100644
--- a/EdgeInspector_App/View/FrameImg.cpp
+++ b/EdgeInspector_App/View/FrameImg.cpp
@@ -1,4 +1,4 @@
-// FrameImg.cpp : 备泅 颇老涝聪促.
+锘�// FrameImg.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -415,7 +415,7 @@
WCHAR wStr[MAX_PATH];
- FontFamily fontFamily(L"奔覆眉");
+ FontFamily fontFamily(L"濂旇鐪�");
Font font(&fontFamily,11, FontStyleBold );
swprintf(wStr, L"%d[%d,%d]",m_Image.GetPixel(m_ptCur.x + m_nScrStartX,m_ptCur.y) & 0xff,m_ptCur.x + m_nScrStartX,m_ptCur.y);
@@ -908,8 +908,8 @@
void CFrameImg::OnPaint()
{
CPaintDC dc(this); // device context for painting
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊钦聪促.
- // 弊府扁 皋矫瘤俊 措秦辑绰 CStatic::OnPaint()阑(甫) 龋免窍瘤 付绞矫坷.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
+ // 寮婂簻鎵� 鐨嬬煫鐦や繆 鎺Е杈戠话 CStatic::OnPaint()闃�(鐢�) 榫嬪厤绐嶇槫 浠樼粸鐭澐.
ViewUpdate();
}
@@ -1786,7 +1786,7 @@
dc.SetTextColor(RGB(0,0,255));
dc.TextOut(120,3,strTmp);
- // TFT CF Line阑 弊赴促.
+ // TFT CF Line闃� 寮婅荡淇�.
szROI.cx = CHKMIN(int(m_WndRect.Width() / m_dZoom), m_szImg.cx);
szROI.cy = int(m_WndRect.Height() / m_dZoom);
@@ -1843,13 +1843,13 @@
dc.MoveTo(x,y-7);
dc.LineTo(x,y+7);
- // Corner甫 弊赴促.
+ // Corner鐢� 寮婅荡淇�.
DrawCorner(dc,ptMark);
- //Defect阑 弊赴促.
+ //Defect闃� 寮婅荡淇�.
DrawDefect(dc);
- // 八荤 康开阑 弊赴促
+ // 鍏崵 搴峰紑闃� 寮婅荡淇�
//DrawInspectArea(dc);
DrawMeasureLine(dc,ptMark);
@@ -1902,7 +1902,7 @@
int nValue;
int nTx = (int)(x * m_dZoom) - 40;
- if(m_nSide < 4) // 惑何
+ if(m_nSide < 4) // 鎯戜綍
{
// CF LINE
dc.MoveTo((int)((pInsResult->nGrindframe[0][nFrameIndex]- m_ptOrg.x) * m_dZoom) , m_ptMouseCurrent.y);
@@ -1932,7 +1932,7 @@
//strTmp.Format("GRIND : %d um",nValue);
dc.TextOut( nTx ,m_ptMouseCurrent.y + 30,strTmp);
}
- else // 窍何
+ else // 绐嶄綍
{
// TFT LINE
dc.MoveTo((int)((pInsResult->nGrindframe[0][nFrameIndex]- m_ptOrg.x) * m_dZoom) , m_ptMouseCurrent.y);
@@ -2108,7 +2108,7 @@
GetResolution(dResH,dResV);
- // 付农甫 弊赴促.
+ // 浠樺啘鐢� 寮婅荡淇�.
dc.SelectObject(&pen2);
if(bMark[0])
diff --git a/EdgeInspector_App/View/FrameImg.h b/EdgeInspector_App/View/FrameImg.h
index 7d58e51..ed068eb 100644
--- a/EdgeInspector_App/View/FrameImg.h
+++ b/EdgeInspector_App/View/FrameImg.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
// CFrameImg
@@ -148,11 +148,11 @@
SIZE m_szImg;
SIZE m_szMark;
MANUAL_MEASURE m_ManualMeausre;
- CPoint m_ptMouseSaved; // Profile Save 扁瓷矫 荤侩
+ CPoint m_ptMouseSaved; // Profile Save 鎵佺摲鐭� 鑽や京
IViewInterface2Parent *m_pI2M;
- bitset<MAX_DISPLAY_MODE> m_bitModeDisplay; // 拳搁 葛靛 bit
- CRect m_rcROI; // 泅力 焊咯瘤绊 乐绰 康开
+ bitset<MAX_DISPLAY_MODE> m_bitModeDisplay; // 鎷虫悂 钁涢潧 bit
+ CRect m_rcROI; // 娉呭姏 鐒婂挴鐦ょ粖 涔愮话 搴峰紑
CFont m_sideFont;
CImage m_ImageMagnify;
EXECPTION_AREA m_refMark;
@@ -164,10 +164,10 @@
CGlassRecipe* m_pRecipe;
public:
- CPoint m_ptMouseCurrent; // 泅犁 付快胶 谅钎
+ CPoint m_ptMouseCurrent; // 娉呯妬 浠樺揩鑳� 璋呴拵
EXECPTION_AREA *m_pTracker;
CRect m_WndRect;
- POINT m_ptOrg; // 傈眉 捞固瘤俊辑 Display 矫累 谅钎
+ POINT m_ptOrg; // 鍌堢湁 鎹炲浐鐦や繆杈� Display 鐭疮 璋呴拵
int m_nModeTrackerVCR;
CPoint m_ptOldMouseVCR;
diff --git a/EdgeInspector_App/View/ImgDefect.cpp b/EdgeInspector_App/View/ImgDefect.cpp
index 6db6f77..719f2de 100644
--- a/EdgeInspector_App/View/ImgDefect.cpp
+++ b/EdgeInspector_App/View/ImgDefect.cpp
@@ -1,4 +1,4 @@
-// ImgDefect.cpp : 备泅 颇老涝聪促.
+锘�// ImgDefect.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -35,7 +35,7 @@
-// CImgDefect 皋矫瘤 贸府扁涝聪促.
+// CImgDefect 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BOOL CImgDefect::Create(RECT const & rect, CWnd * pParentWnd /*= 0*/)
@@ -68,8 +68,8 @@
void CImgDefect::OnPaint()
{
CPaintDC dc(this); // device context for painting
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊钦聪促.
- // 弊府扁 皋矫瘤俊 措秦辑绰 CWnd::OnPaint()阑(甫) 龋免窍瘤 付绞矫坷.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
+ // 寮婂簻鎵� 鐨嬬煫鐦や繆 鎺Е杈戠话 CWnd::OnPaint()闃�(鐢�) 榫嬪厤绐嶇槫 浠樼粸鐭澐.
CDC *pDC = GetDC();
@@ -117,7 +117,7 @@
DrawManualMeasure(memDC);
}
}
- else // 角 Size Mode
+ else // 瑙� Size Mode
{
rc.right = m_img.GetWidth();
rc.bottom = m_img.GetHeight();
diff --git a/EdgeInspector_App/View/ImgDefect.h b/EdgeInspector_App/View/ImgDefect.h
index 1e94e92..b382801 100644
--- a/EdgeInspector_App/View/ImgDefect.h
+++ b/EdgeInspector_App/View/ImgDefect.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
// CImgDefect
@@ -33,7 +33,7 @@
int m_nMode;
BOOL m_bMeasure;
int m_nTurn;
- int m_nTextPos; // 0: Text 免仿 救窃 1: left Top, 2: rigt top, 3: left bottom, 4: right bottom
+ int m_nTextPos; // 0: Text 鍏嶄豢 鏁戠獌 1: left Top, 2: rigt top, 3: left bottom, 4: right bottom
CString m_strTextInfo;
double m_dPx,m_dPy;
public:
diff --git a/EdgeInspector_App/View/ImgListView.cpp b/EdgeInspector_App/View/ImgListView.cpp
index a2ca3a6..79140c7 100644
--- a/EdgeInspector_App/View/ImgListView.cpp
+++ b/EdgeInspector_App/View/ImgListView.cpp
@@ -1,4 +1,4 @@
-// ImgListView.cpp : implementation file
+锘�// ImgListView.cpp : implementation file
//
#include "stdafx.h"
@@ -63,7 +63,7 @@
{
m_bProcesing = 0;
m_bSelect = 0;
- _stprintf(m_Path,_T("%s%s"),strFilePath,strFileName);
+ _stprintf_s(m_Path, MAX_PATH, _T("%s%s"), strFilePath, strFileName);
m_bValid = m_Img.Load(m_Path);
m_rcImg = CRect(0,0,100,100);
}
@@ -75,7 +75,7 @@
void CPotoItem::Draw(CDC *pDC, CRect rcClient, CRect rcChange)
{
//------------------------------------------------------
- // 沥荤阿屈 农扁甫 爱绰 皋葛府DC 积己( MemDC )
+ // 娌ヨ崵闃垮眻 鍐滄墎鐢� 鐖辩话 鐨嬭憶搴淒C 绉繁( MemDC )
//------------------------------------------------------
CDC MemDC;
@@ -85,7 +85,7 @@
MemBitmap.CreateCompatibleBitmap( pDC , rcChange.Width() , rcChange.Height() );
CBitmap * pOldBitmap = (CBitmap *)MemDC.SelectObject( &MemBitmap );
- // 硅版 磨窍扁
+ // 纭呯増 纾ㄧ獚鎵�
CRect rcMemDC(0, 0, rcChange.Width(), rcChange.Height());
if(m_bSelect)
@@ -95,8 +95,8 @@
if(m_bProcesing)
DrawRect(&MemDC,RGB(255,0,0),rcMemDC);
- // 咯归篮 啊肺 技肺 5
- // Text 啊 静咯龙 傍埃 25
+ // 鍜綊绡� 鍟婅偤 鎶�鑲� 5
+ // Text 鍟� 闈欏挴榫� 鍌嶅焹 25
CRect rcImg (5, 5, rcChange.Width()-5, rcChange.Height()-ITEM_TEXT);
m_Img.Draw(MemDC.GetSafeHdc(), rcImg);
DrawText(&MemDC,RGB(0,0,255));
@@ -117,8 +117,8 @@
int mode = pDC->SetBkMode( TRANSPARENT );
int modeText = pDC->SetTextColor( color );
//-----------------------------------------------------------
- // 捞固瘤疙阑 拳搁俊 免仿茄促.
- // File Name捞 15磊 捞惑 登搁 ~~ 肺 绵距
+ // 鎹炲浐鐦ょ枡闃� 鎷虫悂淇� 鍏嶄豢鑼勪績.
+ // File Name鎹� 15纾� 鎹炴儜 鐧绘悂 ~~ 鑲� 缁佃窛
//-----------------------------------------------------------
CString strtmp;
// if(m_strName.GetLength() > 15)
@@ -476,7 +476,7 @@
MemDC.CreateCompatibleDC( &dc );
MemBitmap.CreateCompatibleBitmap( &dc , rect.Width() , rect.Height() );
pOldBitmap = (CBitmap *)MemDC.SelectObject( &MemBitmap );
- MemDC.FillRect( &rect , &m_BgBrush ); // 硅版祸栏肺 快急 磨秦林绊...
+ MemDC.FillRect( &rect , &m_BgBrush ); // 纭呯増绁告爮鑲� 蹇�� 纾ㄧЕ鏋楃粖...
MemDC.SetWindowOrg( ptScroll.x , ptScroll.y ); // SetWindowOrg()
@@ -496,8 +496,8 @@
if( !tmpRc.IntersectRect( pImgItem->m_rcImg , rcInvalid ) )
{
- //辑肺 般摹绰 何盒捞 绝促绰 巴阑 唱鸥辰促.
- //溜 泅犁 酒捞袍篮 拳搁俊 促矫 弊府瘤 臼绰促.
+ //杈戣偤 鑸懝缁� 浣曠洅鎹� 缁濅績缁� 宸撮槕 鍞遍弗杈颁績.
+ //婧� 娉呯妬 閰掓崬琚嶇 鎷虫悂淇� 淇冪煫 寮婂簻鐦� 鑷肩话淇�.
continue;
}
pImgItem->Draw(&MemDC,rcInvalid,pImgItem->m_rcImg);
@@ -529,7 +529,7 @@
void CImgListView::OnLButtonDown(UINT nFlags, CPoint point)
{
CPoint ptScroll(point);
- ptScroll += GetScrollPosition(); // 胶农费等 谅钎甫 歹秦林绊...
+ ptScroll += GetScrollPosition(); // 鑳跺啘璐圭瓑 璋呴拵鐢� 姝圭Е鏋楃粖...
if(SelectItemChk(ptScroll))
Invalidate(FALSE);//Invalidate();
@@ -550,7 +550,7 @@
BOOL CImgListView::OnEraseBkgnd(CDC* pDC)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
CRect rect ;
GetClientRect(&rect);
pDC->FillRect(rect, &m_BgBrush);
@@ -570,8 +570,8 @@
CPoint ptScroll = GetScrollPosition();
pDC->SetWindowOrg(ptScroll.x,ptScroll.y);
//----------------------------------------------------
- // Invalidate 等 康开狼 谅钎甫 稠府 谅钎拌肺 函拳窍扁
- // 困秦辑 掘绢柯促.
+ // Invalidate 绛� 搴峰紑鐙� 璋呴拵鐢� 绋犲簻 璋呴拵鎷岃偤 鍑芥嫵绐嶆墎
+ // 鍥扮Е杈� 鎺樼虎鏌績.
//----------------------------------------------------
CRect rcInvalid;
GetClientRect(rcInvalid);
@@ -602,8 +602,8 @@
tmpRc = pImgItem->m_rcImg;
if( !tmpRc.IntersectRect( pImgItem->m_rcImg , rcInvalid ) )
{
- //辑肺 般摹绰 何盒捞 绝促绰 巴阑 唱鸥辰促.
- //溜 泅犁 酒捞袍篮 拳搁俊 促矫 弊府瘤 臼绰促.
+ //杈戣偤 鑸懝缁� 浣曠洅鎹� 缁濅績缁� 宸撮槕 鍞遍弗杈颁績.
+ //婧� 娉呯妬 閰掓崬琚嶇 鎷虫悂淇� 淇冪煫 寮婂簻鐦� 鑷肩话淇�.
continue;
}
pImgItem->Draw(&MemDC,rcInvalid,pImgItem->m_rcImg);
@@ -620,7 +620,7 @@
void CImgListView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
//UpdateView();
CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
}
diff --git a/EdgeInspector_App/View/ImgListView.h b/EdgeInspector_App/View/ImgListView.h
index ac4abde..7aa4bae 100644
--- a/EdgeInspector_App/View/ImgListView.h
+++ b/EdgeInspector_App/View/ImgListView.h
@@ -1,4 +1,4 @@
-#if !defined(AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_)
+锘�#if !defined(AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_)
#define AFX_IMGLISTVIEW_H__C0DD00C1_EEA9_4E84_BB03_8DE83B2DEDEA__INCLUDED_
#if _MSC_VER > 1000
@@ -15,11 +15,11 @@
#define LEFT_MARJIN 15
#define TOP_MARJIN 15
-#define ITEM_WIDTH 190 // 380 // 蔼捞 官差绢具 窍骨肺 define捞唱 const绰 绢匡府瘤 臼绰促.
+#define ITEM_WIDTH 190 // 380 // 钄兼崬 瀹樺樊缁㈠叿 绐嶉鑲� define鎹炲敱 const缁� 缁㈠尅搴滅槫 鑷肩话淇�.
#define ITEM_HEIGHT 160 // 320 //
-#define ITEM_TEXT 22 // 酒捞袍俊 措茄 臂磊 臭捞
-#define ITEM_ROW_MARJIN 15 // 酒捞袍苞 酒捞袍狼 啊肺荤捞
-#define ITEM_COL_MARJIN 20 // 酒捞袍苞 酒捞袍狼 技肺荤捞
+#define ITEM_TEXT 22 // 閰掓崬琚嶄繆 鎺寗 鑷傜 鑷崬
+#define ITEM_ROW_MARJIN 15 // 閰掓崬琚嶈嫗 閰掓崬琚嶇嫾 鍟婅偤鑽ゆ崬
+#define ITEM_COL_MARJIN 20 // 閰掓崬琚嶈嫗 閰掓崬琚嶇嫾 鎶�鑲鸿崵鎹�
class CPotoItem
{
@@ -36,9 +36,9 @@
CImage m_Img;
CRect m_rcImg;
- BOOL m_bSelect; // 急琶 登菌绰啊
- BOOL m_bValid; // 按眉狼 粮犁己
- BOOL m_bProcesing; // 贸府吝牢啊
+ BOOL m_bSelect; // 鎬ョ惗 鐧昏弻缁板晩
+ BOOL m_bValid; // 鎸夌湁鐙� 绮妬宸�
+ BOOL m_bProcesing; // 璐稿簻鍚濈墷鍟�
TCHAR m_Path[MAX_PATH];
CRect GetRect() { return m_rcImg; }
@@ -91,10 +91,10 @@
public:
IMG_MAP m_ImgMap;
- int m_nHItem; // 技肺肺 割俺啊 免仿捞 瞪巴牢啊?
+ int m_nHItem; // 鎶�鑲鸿偤 鍓蹭亢鍟� 鍏嶄豢鎹� 鐬反鐗㈠晩?
int m_nHItemOld;
- int m_nAddItem; // 佬绢甸牢 酒捞袍狼 醚肮荐
- CBrush m_BgBrush; // 硅版Brush
+ int m_nAddItem; // 浣虎鐢哥墷 閰掓崬琚嶇嫾 閱氳偖鑽�
+ CBrush m_BgBrush; // 纭呯増Brush
CImage* m_pSelImg;
CPotoItem *m_pSelectItem;
public:
diff --git a/EdgeInspector_App/View/ViewLampControl.cpp b/EdgeInspector_App/View/ViewLampControl.cpp
index bcf0497..829a504 100644
--- a/EdgeInspector_App/View/ViewLampControl.cpp
+++ b/EdgeInspector_App/View/ViewLampControl.cpp
@@ -1,4 +1,4 @@
-// Dlg_LampControl.cpp : 备泅 颇老涝聪促.
+锘�// Dlg_LampControl.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -6,7 +6,7 @@
#include "Global_Define.h"
-// CViewLampControl 措拳 惑磊涝聪促.
+// CViewLampControl 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewLampControl, CDialog)
@@ -106,7 +106,7 @@
}
return TRUE; // return TRUE unless you set the focus to a control
- // 抗寇: OCX 加己 其捞瘤绰 FALSE甫 馆券秦具 钦聪促.
+ // 鎶楀瘒: OCX 鍔犲繁 鍏舵崬鐦ょ话 FALSE鐢� 棣嗗埜绉﹀叿 閽﹁仾淇�.
}
void CViewLampControl::ClickChkLampOnOffButton()
@@ -337,7 +337,7 @@
void CViewLampControl::OnNMCustomdrawSlider2(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
- // TODO: 咯扁俊 牧飘费 舅覆 贸府扁 内靛甫 眠啊钦聪促.
+ // TODO: 鍜墎淇� 鐗ч璐� 鑸呰 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
LampValueUpdate(1,IDC_EDIT_LAMP_VALUE_2);
*pResult = 0;
@@ -346,7 +346,7 @@
void CViewLampControl::OnNMCustomdrawSlider3(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR);
- // TODO: 咯扁俊 牧飘费 舅覆 贸府扁 内靛甫 眠啊钦聪促.
+ // TODO: 鍜墎淇� 鐗ч璐� 鑸呰 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩閽﹁仾淇�.
LampValueUpdate(2,IDC_EDIT_LAMP_VALUE_3);
diff --git a/EdgeInspector_App/View/ViewLampControl.h b/EdgeInspector_App/View/ViewLampControl.h
index abacb8c..8217b43 100644
--- a/EdgeInspector_App/View/ViewLampControl.h
+++ b/EdgeInspector_App/View/ViewLampControl.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "afxcmn.h"
#include "EdgeInspector_App.h"
#include "Global_Define.h"
@@ -6,7 +6,7 @@
#include "GlassRecipe.h"
#include "HardwareSettings.h"
#include "Glass_Data.h"
-// CViewLampControl 措拳 惑磊涝聪促.
+// CViewLampControl 鎺嫵 鎯戠娑濊仾淇�.
#define UM_LIGHT_APPLY_RECIPE (WM_USER + 4001)
@@ -17,14 +17,14 @@
DECLARE_DYNAMIC(CViewLampControl)
public:
- CViewLampControl(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewLampControl(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewLampControl();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_LAMP_CONTROL };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
void ClickChkLampOnOffButton();
void ClickChkCloseButton();
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/View/ViewMain_Defect.cpp b/EdgeInspector_App/View/ViewMain_Defect.cpp
index c6bb4cc..ac7b02b 100644
--- a/EdgeInspector_App/View/ViewMain_Defect.cpp
+++ b/EdgeInspector_App/View/ViewMain_Defect.cpp
@@ -1,4 +1,4 @@
-// ViewDefect.cpp : 备泅 颇老涝聪促.
+锘�// ViewDefect.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
#include "Global_Define.h"
-// CViewDefect 措拳 惑磊涝聪促.
+// CViewDefect 鎺嫵 鎯戠娑濊仾淇�.
#define GRID_FIX_COLOR RGB(144,200,246)
#define GRID_COLOR RGB(242,242,242)
@@ -110,7 +110,7 @@
return TRUE;
}
-// CViewDefect 皋矫瘤 贸府扁涝聪促.
+// CViewDefect 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
void CViewMain_Defect::SetRecipe(CHardwareSettings *pHW)
{
m_pHardware = pHW;
@@ -215,7 +215,7 @@
if(m_pSelDefect->m_strSaveImagePath.IsEmpty() == TRUE || m_pSelDefect->m_bJudge_NG == FALSE)
{
- // Buffer俊辑 捞固瘤 啊廉坷霸 窍绰巴档..
+ // Buffer淇婅緫 鎹炲浐鐦� 鍟婂粔鍧烽湼 绐嶇话宸存。..
}
else
@@ -294,7 +294,7 @@
void CViewMain_Defect::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
SCROLLINFO si;
si.fMask = SIF_ALL;
m_ctrlScrollH.GetScrollInfo(&si, SIF_ALL);
@@ -560,7 +560,7 @@
lf.lfItalic = 0;
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
- _tcscpy(lf.lfFaceName, _T("Arial"));
+ _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
m_GrdDefect.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
m_GrdDefect.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
diff --git a/EdgeInspector_App/View/ViewMain_Defect.h b/EdgeInspector_App/View/ViewMain_Defect.h
index c5e8e25..85ebc30 100644
--- a/EdgeInspector_App/View/ViewMain_Defect.h
+++ b/EdgeInspector_App/View/ViewMain_Defect.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "Global_Define.h"
#include "GridCtrl.h"
@@ -13,21 +13,21 @@
typedef std::vector<CDefect*> LISTDefect;
typedef std::vector<CDefect*>::iterator LISTDefectit;
-// CViewDefect 措拳 惑磊涝聪促.
+// CViewDefect 鎺嫵 鎯戠娑濊仾淇�.
class CViewMain_Defect : public CDialogEx
{
DECLARE_DYNAMIC(CViewMain_Defect)
public:
- CViewMain_Defect(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_Defect(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_Defect();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_DEFECT };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog(void);
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
diff --git a/EdgeInspector_App/View/ViewMain_HWSetting.cpp b/EdgeInspector_App/View/ViewMain_HWSetting.cpp
index cff989c..888f978 100644
--- a/EdgeInspector_App/View/ViewMain_HWSetting.cpp
+++ b/EdgeInspector_App/View/ViewMain_HWSetting.cpp
@@ -1,4 +1,4 @@
-// ViewHWSetting.cpp : 备泅 颇老涝聪促.
+锘�// ViewHWSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -8,7 +8,7 @@
#include "Global_Define.h"
#include "NewCellTypes\GridCellCombo.h"
-// CViewHWSetting 措拳 惑磊涝聪促.
+// CViewHWSetting 鎺嫵 鎯戠娑濊仾淇�.
extern BOOL g_bUse_SaveAllDMP;
const int LIGHT_COLUMN_COUNT = 4;
const TCHAR* LIGHT_COLUMN_ITEM[LIGHT_COLUMN_COUNT] = {_T("ID"),_T("Type"),_T("Port&IP"),_T("Maker")};
@@ -144,7 +144,7 @@
return TRUE;
}
-// CViewHWSetting 皋矫瘤 贸府扁涝聪促.
+// CViewHWSetting 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
void CViewMain_HWSetting::Init_LightGrid()
@@ -173,7 +173,7 @@
lf.lfItalic = 0;
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
- _tcscpy(lf.lfFaceName, _T("Arial"));
+ _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
m_LightGrid.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
m_LightGrid.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
@@ -230,7 +230,7 @@
lf.lfItalic = 0;
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
- _tcscpy(lf.lfFaceName, _T("Arial"));
+ _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
m_CameraGrid.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
m_CameraGrid.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
diff --git a/EdgeInspector_App/View/ViewMain_HWSetting.h b/EdgeInspector_App/View/ViewMain_HWSetting.h
index 997af42..7dc5366 100644
--- a/EdgeInspector_App/View/ViewMain_HWSetting.h
+++ b/EdgeInspector_App/View/ViewMain_HWSetting.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "btnenh.h"
#include "General_Draw.h"
@@ -8,7 +8,7 @@
#include "HardwareSettings.h"
#include "DlgLicenseInfo.h"
-// CViewHWSetting 措拳 惑磊涝聪促.
+// CViewHWSetting 鎺嫵 鎯戠娑濊仾淇�.
class CHardwareSettings;
class CViewMain_HWSetting : public CDialogEx
@@ -16,14 +16,14 @@
DECLARE_DYNAMIC(CViewMain_HWSetting)
public:
- CViewMain_HWSetting(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_HWSetting(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_HWSetting();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_HWSETTING };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnPaint();
diff --git a/EdgeInspector_App/View/ViewMain_LiveCam.cpp b/EdgeInspector_App/View/ViewMain_LiveCam.cpp
index 65f10b8..d3b6ac5 100644
--- a/EdgeInspector_App/View/ViewMain_LiveCam.cpp
+++ b/EdgeInspector_App/View/ViewMain_LiveCam.cpp
@@ -1,4 +1,4 @@
-// ViewLiveCam.cpp : 备泅 颇老涝聪促.
+锘�// ViewLiveCam.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
#include "Global_Define.h"
-// CViewLiveCam 措拳 惑磊涝聪促.
+// CViewLiveCam 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewMain_LiveCam, CDialogEx)
@@ -52,7 +52,7 @@
ON_EVENT(CViewMain_LiveCam, IDC_BTN_CAM_SNAP, DISPID_CLICK, CViewMain_LiveCam::OnBnClickedBtnCamSnap, VTS_NONE)
END_EVENTSINK_MAP()
-// CViewLiveCam 皋矫瘤 贸府扁涝聪促.
+// CViewLiveCam 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
int CViewMain_LiveCam::GetIndex(int nSide)
{
int nIndex = 0;
@@ -190,7 +190,7 @@
void CViewMain_LiveCam::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
int nIndex;
diff --git a/EdgeInspector_App/View/ViewMain_LiveCam.h b/EdgeInspector_App/View/ViewMain_LiveCam.h
index 5cda639..d541afe 100644
--- a/EdgeInspector_App/View/ViewMain_LiveCam.h
+++ b/EdgeInspector_App/View/ViewMain_LiveCam.h
@@ -1,7 +1,7 @@
-#pragma once
+锘�#pragma once
#include "FrameImg.h"
-// CViewLiveCam 措拳 惑磊涝聪促.
+// CViewLiveCam 鎺嫵 鎯戠娑濊仾淇�.
class CHardwareSettings;
class CGlass_Data;
@@ -10,14 +10,14 @@
DECLARE_DYNAMIC(CViewMain_LiveCam)
public:
- CViewMain_LiveCam(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_LiveCam(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_LiveCam();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_LIVECAM };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
diff --git a/EdgeInspector_App/View/ViewMain_ScanImage.cpp b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
index e616eeb..f597c00 100644
--- a/EdgeInspector_App/View/ViewMain_ScanImage.cpp
+++ b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
@@ -1,4 +1,4 @@
-// ViewScanImage.cpp : 备泅 颇老涝聪促.
+锘�// ViewScanImage.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -20,7 +20,7 @@
};
-// CViewScanImage 措拳 惑磊涝聪促.
+// CViewScanImage 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewMain_ScanImage, CDialogEx)
@@ -163,7 +163,7 @@
END_EVENTSINK_MAP()
-// CViewScanImage 皋矫瘤 贸府扁涝聪促.
+// CViewScanImage 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BOOL CViewMain_ScanImage::OnInitDialog()
{
UpdateData(FALSE);
@@ -970,7 +970,7 @@
void CViewMain_ScanImage::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
- // TODO: 咯扁俊 皋矫瘤 贸府扁 内靛甫 眠啊 棺/肚绰 扁夯蔼阑 龋免钦聪促.
+ // TODO: 鍜墎淇� 鐨嬬煫鐦� 璐稿簻鎵� 鍐呴潧鐢� 鐪犲晩 妫�/鑲氱话 鎵佸く钄奸槕 榫嬪厤閽﹁仾淇�.
if(!pScrollBar)
{
return CDialogEx::OnHScroll(nSBCode, nPos, pScrollBar);
diff --git a/EdgeInspector_App/View/ViewMain_ScanImage.h b/EdgeInspector_App/View/ViewMain_ScanImage.h
index 0eb5fe9..0baa9b0 100644
--- a/EdgeInspector_App/View/ViewMain_ScanImage.h
+++ b/EdgeInspector_App/View/ViewMain_ScanImage.h
@@ -1,9 +1,9 @@
-#pragma once
+锘�#pragma once
//#include "FrameImg.h"
#include "EdgeImageViewer.h"
#include "afxcmn.h"
-// CViewScanImage 措拳 惑磊涝聪促.
+// CViewScanImage 鎺嫵 鎯戠娑濊仾淇�.
class CHardwareSettings;
class CGlass_Data;
@@ -12,14 +12,14 @@
DECLARE_DYNAMIC(CViewMain_ScanImage)
public:
- CViewMain_ScanImage(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_ScanImage(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_ScanImage();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_SCANIMAGE };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnPaint();
diff --git a/EdgeInspector_App/View/ViewMain_Status.cpp b/EdgeInspector_App/View/ViewMain_Status.cpp
index 2cdd781..e3d180d 100644
--- a/EdgeInspector_App/View/ViewMain_Status.cpp
+++ b/EdgeInspector_App/View/ViewMain_Status.cpp
@@ -1,4 +1,4 @@
-// ViewMainStatus.cpp : 备泅 颇老涝聪促.
+锘�// ViewMainStatus.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CViewMainStatus 措拳 惑磊涝聪促.
+// CViewMainStatus 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewMain_Status, CDialogEx)
@@ -31,7 +31,7 @@
END_MESSAGE_MAP()
-// CViewMainStatus 皋矫瘤 贸府扁涝聪促.
+// CViewMainStatus 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BOOL CViewMain_Status::OnInitDialog(void)
{
diff --git a/EdgeInspector_App/View/ViewMain_Status.h b/EdgeInspector_App/View/ViewMain_Status.h
index cb0cf26..48353cd 100644
--- a/EdgeInspector_App/View/ViewMain_Status.h
+++ b/EdgeInspector_App/View/ViewMain_Status.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "resource.h"
#include "Global_Define.h"
#include "StatusMonitor.h"
@@ -10,14 +10,14 @@
DECLARE_DYNAMIC(CViewMain_Status)
public:
- CViewMain_Status(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_Status(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_Status();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_STATUS };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog(void);
virtual BOOL PreTranslateMessage(MSG* pMsg);
diff --git a/EdgeInspector_App/View/ViewPPIDNew.cpp b/EdgeInspector_App/View/ViewPPIDNew.cpp
index f59ed9c..5bfaacb 100644
--- a/EdgeInspector_App/View/ViewPPIDNew.cpp
+++ b/EdgeInspector_App/View/ViewPPIDNew.cpp
@@ -1,9 +1,9 @@
-
+锘�
#include "stdafx.h"
#include "ViewPPIDNew.h"
-// CViewPPIDNew 措拳 惑磊涝聪促.
+// CViewPPIDNew 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewPPIDNew, CDialog)
@@ -35,7 +35,7 @@
ON_EVENT(CViewPPIDNew, IDC_BTN_PPIDNEW_CANCEL, DISPID_CLICK, CViewPPIDNew::ClickBtnPpidnewCancel, VTS_NONE)
END_EVENTSINK_MAP()
-// CViewPPIDNew 皋矫瘤 贸府扁涝聪促.
+// CViewPPIDNew 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BOOL CViewPPIDNew::OnInitDialog()
{
diff --git a/EdgeInspector_App/View/ViewPPIDNew.h b/EdgeInspector_App/View/ViewPPIDNew.h
index ca29252..5880ec5 100644
--- a/EdgeInspector_App/View/ViewPPIDNew.h
+++ b/EdgeInspector_App/View/ViewPPIDNew.h
@@ -1,23 +1,23 @@
-#pragma once
+锘�#pragma once
#include "EdgeInspector_App.h"
#include "General_Draw.h"
-// CViewPPIDNew 措拳 惑磊涝聪促.
+// CViewPPIDNew 鎺嫵 鎯戠娑濊仾淇�.
class CViewPPIDNew : public CDialog
{
DECLARE_DYNAMIC(CViewPPIDNew)
public:
- CViewPPIDNew(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewPPIDNew(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewPPIDNew();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_PPID_NEW };
protected:
virtual BOOL OnInitDialog();
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
DECLARE_MESSAGE_MAP()
public:
diff --git a/EdgeInspector_App/View/ViewRecipeList.cpp b/EdgeInspector_App/View/ViewRecipeList.cpp
index 9297aef..eb3724d 100644
--- a/EdgeInspector_App/View/ViewRecipeList.cpp
+++ b/EdgeInspector_App/View/ViewRecipeList.cpp
@@ -1,4 +1,4 @@
-
+锘�
#include "stdafx.h"
#include "ViewRecipeList.h"
#include "ViewRecipeNew.h"
@@ -12,7 +12,7 @@
const TCHAR* PPIDLIST_COLUMN_ITEM[PPIDLIST_COLUMN_COUNT] = {_T("No"),_T("PLC Index"),_T("Recipe")};
const int PPIDLIST_COLUMN_WIDHT[PPIDLIST_COLUMN_COUNT] = {50,130,145};
-// CViewRecipeList 措拳 惑磊涝聪促.
+// CViewRecipeList 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewRecipeList, CDialogEx)
@@ -113,7 +113,7 @@
finder.Close();
}
-// CViewRecipeList 皋矫瘤 贸府扁涝聪促.
+// CViewRecipeList 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
void CViewRecipeList::OnShowWindow(BOOL bShow, UINT nStatus)
{
@@ -238,7 +238,7 @@
lf.lfItalic = 0;
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
- _tcscpy(lf.lfFaceName, _T("Arial"));
+ _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
m_ListRecipe.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
m_ListRecipe.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
@@ -292,7 +292,7 @@
lf.lfItalic = 0;
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
- _tcscpy(lf.lfFaceName, _T("Arial"));
+ _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
m_ListPPID.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
m_ListPPID.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
diff --git a/EdgeInspector_App/View/ViewRecipeList.h b/EdgeInspector_App/View/ViewRecipeList.h
index a0b27df..071d5b4 100644
--- a/EdgeInspector_App/View/ViewRecipeList.h
+++ b/EdgeInspector_App/View/ViewRecipeList.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "General_Draw.h"
@@ -9,7 +9,7 @@
#include "HardwareSettings.h"
#include "Glass_Data.h"
-// CViewRecipeList 措拳 惑磊涝聪促.
+// CViewRecipeList 鎺嫵 鎯戠娑濊仾淇�.
#define UM_SELECT_RECIPE (WM_USER + 1001)
@@ -18,15 +18,15 @@
DECLARE_DYNAMIC(CViewRecipeList)
public:
- CViewRecipeList(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewRecipeList(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewRecipeList();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_RECIPE_LIST };
protected:
virtual BOOL OnInitDialog();
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnBnClickedButListNewrecipe();
diff --git a/EdgeInspector_App/View/ViewRecipeNew.cpp b/EdgeInspector_App/View/ViewRecipeNew.cpp
index cdcb9cc..8f83b7c 100644
--- a/EdgeInspector_App/View/ViewRecipeNew.cpp
+++ b/EdgeInspector_App/View/ViewRecipeNew.cpp
@@ -1,10 +1,10 @@
-//
+锘�//
#include "stdafx.h"
#include "ViewRecipeNew.h"
-// CViewRecipeNew 措拳 惑磊涝聪促.
+// CViewRecipeNew 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewRecipeNew, CDialog)
@@ -36,7 +36,7 @@
ON_EVENT(CViewRecipeNew, IDC_BTN_RECIPENEW_OK, DISPID_CLICK, CViewRecipeNew::ClickBtnRecipenewOk, VTS_NONE)
ON_EVENT(CViewRecipeNew, IDC_BTN_RECIPENEW_CANCEL, DISPID_CLICK, CViewRecipeNew::ClickBtnRecipenewCancel, VTS_NONE)
END_EVENTSINK_MAP()
-// CViewRecipeNew 皋矫瘤 贸府扁涝聪促.
+// CViewRecipeNew 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BOOL CViewRecipeNew::OnInitDialog()
{
diff --git a/EdgeInspector_App/View/ViewRecipeNew.h b/EdgeInspector_App/View/ViewRecipeNew.h
index c535339..cd5d1d7 100644
--- a/EdgeInspector_App/View/ViewRecipeNew.h
+++ b/EdgeInspector_App/View/ViewRecipeNew.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "EdgeInspector_App.h"
#include "General_Draw.h"
@@ -9,15 +9,15 @@
DECLARE_DYNAMIC(CViewRecipeNew)
public:
- CViewRecipeNew(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewRecipeNew(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewRecipeNew();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_DLG_RECIPE_NEW };
protected:
virtual BOOL OnInitDialog();
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
afx_msg void OnPaint();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
DECLARE_MESSAGE_MAP()
diff --git a/EdgeInspector_App/ViewMain_Information.cpp b/EdgeInspector_App/ViewMain_Information.cpp
index 5f874a9..8d14757 100644
--- a/EdgeInspector_App/ViewMain_Information.cpp
+++ b/EdgeInspector_App/ViewMain_Information.cpp
@@ -1,4 +1,4 @@
-// ViewMainInformation.cpp : 备泅 颇老涝聪促.
+锘�// ViewMainInformation.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -7,7 +7,7 @@
#include "afxdialogex.h"
-// CViewMainInformation 措拳 惑磊涝聪促.
+// CViewMainInformation 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewMain_Information, CDialogEx)
@@ -435,16 +435,16 @@
{
CString strText;
- strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nUnitNo);//研磨部
+ strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nUnitNo);//鐮旂(閮�
SetDlgItemText(IDC_STATIC_INSINFO_UNITNO, strText);
- strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nEqpNo);//研磨段
+ strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nEqpNo);//鐮旂(娈�
SetDlgItemText(IDC_STATIC_INSINFO_EQPNO, strText);
- strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nisGrind);//研磨棒
+ strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nisGrind);//鐮旂(妫�
SetDlgItemText(IDC_STATIC_INSINFO_ISGRIND, strText);
- strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nRoughPadLayer);//研磨棒使用寿命
+ strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nRoughPadLayer);//鐮旂(妫掍娇鐢ㄥ鍛�
SetDlgItemText(IDC_STATIC_INSINFO_GLASS_ID, strText);
strText.Format(_T("%d"), g_pStatus->m_pTransData->m_nHandNumber);//Stage No
diff --git a/EdgeInspector_App/ViewMain_Information.h b/EdgeInspector_App/ViewMain_Information.h
index e5a348e..71d9d7a 100644
--- a/EdgeInspector_App/ViewMain_Information.h
+++ b/EdgeInspector_App/ViewMain_Information.h
@@ -1,21 +1,21 @@
-#pragma once
+锘�#pragma once
#include "GridCtrl.h"
-// CViewMainInformation 措拳 惑磊涝聪促.
+// CViewMainInformation 鎺嫵 鎯戠娑濊仾淇�.
class CViewMain_Information : public CDialogEx
{
DECLARE_DYNAMIC(CViewMain_Information)
public:
- CViewMain_Information(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_Information(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_Information();
-// 措拳 惑磊 单捞磐涝聪促.
+// 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_INFORMATION };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
diff --git a/EdgeInspector_App/ViewMain_Recipe.cpp b/EdgeInspector_App/ViewMain_Recipe.cpp
index a576591..fae101f 100644
--- a/EdgeInspector_App/ViewMain_Recipe.cpp
+++ b/EdgeInspector_App/ViewMain_Recipe.cpp
@@ -1,4 +1,4 @@
-// ViewLedRecipeSetting.cpp : 备泅 颇老涝聪促.
+锘�// ViewLedRecipeSetting.cpp : 澶囨硡 棰囪�佹稘鑱績.
//
#include "stdafx.h"
@@ -9,7 +9,7 @@
#include "ViewLampControl.h"
#include "DlgLogin.h"
#include "Global_Define.h"
-// CViewLedRecipeSetting 措拳 惑磊涝聪促.
+// CViewLedRecipeSetting 鎺嫵 鎯戠娑濊仾淇�.
IMPLEMENT_DYNAMIC(CViewMain_Recipe, CDialogEx)
@@ -150,7 +150,7 @@
END_MESSAGE_MAP()
-// CViewLedRecipeSetting 皋矫瘤 贸府扁涝聪促.
+// CViewLedRecipeSetting 鐨嬬煫鐦� 璐稿簻鎵佹稘鑱績.
BEGIN_EVENTSINK_MAP(CViewMain_Recipe, CDialogEx)
ON_EVENT(CViewMain_Recipe, IDC_BTN_IMG_LOAD, DISPID_CLICK, CViewMain_Recipe::ClickImgLoadButton, VTS_NONE)
ON_EVENT(CViewMain_Recipe, IDC_BTN_IMG_SAVE, DISPID_CLICK, CViewMain_Recipe::ClickImgSaveButton, VTS_NONE)
@@ -309,10 +309,10 @@
#if HALCON_VISION_KEY
void CViewMain_Recipe::onMsgVisionEvent(int code, int eDir) {
/* code */
- if (1 == code) { //获取区域数据
+ if (1 == code) { //鑾峰彇鍖哄煙鏁版嵁
m_pThis->SetFrameRegion();
}
- else if (2 == code) { //获取效果
+ else if (2 == code) { //鑾峰彇鏁堟灉
m_pThis->DispAllResult();
}
}
@@ -906,7 +906,7 @@
tickCount = GetTickCount();
- // 急琶等 Recipe 荐沥.
+ // 鎬ョ惗绛� Recipe 鑽愭播.
if (m_pDlgRecipe->WriteRecipeFile() == FALSE)
{
AfxMessageBox(_T("Save Fail"), MB_OK | MB_ICONERROR);
@@ -989,7 +989,7 @@
void CViewMain_Recipe::DeleteVectorList()
{
- // Vector 昏力
+ // Vector 鏄忓姏
LinkList* pList = NULL;
for (VectorLinkListIt it = m_VectorLinkList.begin(); it != m_VectorLinkList.end(); it++)
{
@@ -1076,7 +1076,7 @@
{
if(strRecipe.IsEmpty() == TRUE)
{
- //AfxMessageBox("Recipe Name捞 绝嚼聪促.");
+ //AfxMessageBox("Recipe Name鎹� 缁濆毤鑱績.");
return FALSE;
}
@@ -3166,7 +3166,7 @@
{
CPaintDC dc(this);
- DrawMarkImage(); // 恐 捞芭 秦拎具父 贸澜俊 付农 捞固瘤啊 弊妨龙鳖..
+ DrawMarkImage(); // 鎭� 鎹炶姯 绉︽嫀鍏风埗 璐告緶淇� 浠樺啘 鎹炲浐鐦ゅ晩 寮婂Θ榫欓硸..
}
void CViewMain_Recipe::ClickButtonOpenExceptionSettingView()
@@ -3191,7 +3191,7 @@
void CViewMain_Recipe::ClickButtonVisionSetting()
{
- // TODO: 在此处添加消息处理程序代码
+ // TODO: 鍦ㄦ澶勬坊鍔犳秷鎭鐞嗙▼搴忎唬鐮�
#if HALCON_VISION_KEY
IVisionRecipe* pInstance = BlVision_GetVisionRecipe();
if (!pInstance->getVisionUse()) {
diff --git a/EdgeInspector_App/ViewMain_Recipe.h b/EdgeInspector_App/ViewMain_Recipe.h
index c049701..446919e 100644
--- a/EdgeInspector_App/ViewMain_Recipe.h
+++ b/EdgeInspector_App/ViewMain_Recipe.h
@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
#include "btnenh.h"
#include "General_Draw.h"
@@ -14,21 +14,21 @@
#include "ViewLampControl.h"
#include "ViewRecipeList.h"
-// CViewLedRecipeSetting 措拳 惑磊涝聪促.
+// CViewLedRecipeSetting 鎺嫵 鎯戠娑濊仾淇�.
class CViewMain_Recipe : public CDialogEx
{
DECLARE_DYNAMIC(CViewMain_Recipe)
public:
- CViewMain_Recipe(CWnd* pParent = NULL); // 钎霖 积己磊涝聪促.
+ CViewMain_Recipe(CWnd* pParent = NULL); // 閽庨湒 绉繁纾婃稘鑱績.
virtual ~CViewMain_Recipe();
- // 措拳 惑磊 单捞磐涝聪促.
+ // 鎺嫵 鎯戠 鍗曟崬纾愭稘鑱績.
enum { IDD = IDD_MAIN_VIEW_RECIPE };
protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔涝聪促.
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 鐦ょ洈娑濊仾淇�.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
LRESULT OnProcessStatus(WPARAM wParam, LPARAM lParam);
diff --git a/EdgeInspector_App/WebSocket/ThreadPool.cpp b/EdgeInspector_App/WebSocket/ThreadPool.cpp
index 8ef2c68..01b2d34 100644
--- a/EdgeInspector_App/WebSocket/ThreadPool.cpp
+++ b/EdgeInspector_App/WebSocket/ThreadPool.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "ThreadPool.h"
ThreadPool::ThreadPool(size_t thread_count) : m_stop(false) {
diff --git a/EdgeInspector_App/WebSocket/ThreadPool.h b/EdgeInspector_App/WebSocket/ThreadPool.h
index 3e106c5..2a97e93 100644
--- a/EdgeInspector_App/WebSocket/ThreadPool.h
+++ b/EdgeInspector_App/WebSocket/ThreadPool.h
@@ -1,4 +1,4 @@
-#ifndef THREADPOOL_H
+锘�#ifndef THREADPOOL_H
#define THREADPOOL_H
#include <vector>
@@ -15,7 +15,7 @@
explicit ThreadPool(size_t thread_count);
~ThreadPool();
- // 提交任务
+ // 鎻愪氦浠诲姟
template<class F>
void enqueue(F&& task) {
{
diff --git a/EdgeInspector_App/WebSocket/WebSocketClient.cpp b/EdgeInspector_App/WebSocket/WebSocketClient.cpp
index 84ef4b0..8f03469 100644
--- a/EdgeInspector_App/WebSocket/WebSocketClient.cpp
+++ b/EdgeInspector_App/WebSocket/WebSocketClient.cpp
@@ -1,13 +1,13 @@
-#include "stdafx.h"
+锘�#include "stdafx.h"
#include "WebSocketClient.h"
//WebSocketClient::WebSocketClient() : m_connected(false), m_reconnect(true), m_close_done(false), m_message_received(false), m_heartbeat_interval(5) {
-// // 清除之前的客户端配置并重新初始化
+// // 娓呴櫎涔嬪墠鐨勫鎴风閰嶇疆骞堕噸鏂板垵濮嬪寲
// m_client.clear_access_channels(websocketpp::log::alevel::all);
// m_client.clear_error_channels(websocketpp::log::elevel::all);
// m_client.init_asio();
//
-// // 设置事件回调
+// // 璁剧疆浜嬩欢鍥炶皟
// m_client.set_open_handler([this](websocketpp::connection_hdl hdl) { on_open(hdl); });
// m_client.set_message_handler([this](websocketpp::connection_hdl hdl, message_ptr msg) { on_message(hdl, msg); });
// m_client.set_close_handler([this](websocketpp::connection_hdl hdl) { on_close(hdl); });
@@ -27,7 +27,7 @@
// m_client.clear_access_channels(websocketpp::log::alevel::all);
// m_client.clear_error_channels(websocketpp::log::elevel::all);
//
-// std::lock_guard<std::mutex> lock(m_mutex); // 保护共享资源
+// std::lock_guard<std::mutex> lock(m_mutex); // 淇濇姢鍏变韩璧勬簮
// auto con = m_client.get_connection(uri, ec);
//
// if (ec) {
@@ -39,7 +39,7 @@
// m_client.connect(con);
// }
//
-// // 启动工作线程
+// // 鍚姩宸ヤ綔绾跨▼
// m_thread = std::thread(&WebSocketClient::run, this);
//}
//
@@ -95,9 +95,9 @@
// std::string message = m_message_queue.front();
// m_message_queue.pop();
//
-// send(message); // 发送消息
+// send(message); // 鍙戦�佹秷鎭�
//
-// set_busy(false); // 设置为空闲状态,并处理下一个
+// set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬侊紝骞跺鐞嗕笅涓�涓�
// process_next_message();
// }
//}
@@ -108,9 +108,9 @@
// std::vector<char> binary_data = m_binary_queue.front();
// m_binary_queue.pop();
//
-// send_binary(binary_data); // 发送二进制数据
+// send_binary(binary_data); // 鍙戦�佷簩杩涘埗鏁版嵁
//
-// set_busy(false); // 设置为空闲状态,并处理下一个
+// set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬侊紝骞跺鐞嗕笅涓�涓�
// process_next_binary();
// }
//}
@@ -120,7 +120,7 @@
// m_message_received = false;
//
// if (m_connected.load()) {
-// // 发送消息
+// // 鍙戦�佹秷鎭�
// websocketpp::lib::error_code ec;
// m_client.send(m_hdl, message, websocketpp::frame::opcode::text, ec);
// if (ec) {
@@ -128,7 +128,7 @@
// return false;
// }
//
-// // 等待消息或超时
+// // 绛夊緟娑堟伅鎴栬秴鏃�
// if (m_cv.wait_for(lock, std::chrono::milliseconds(timeout_ms), [this]() { return m_message_received; })) {
// std::cout << "Server response received." << std::endl;
// return true;
@@ -148,7 +148,7 @@
// m_message_received = false;
//
// if (m_connected.load()) {
-// // 发送消息
+// // 鍙戦�佹秷鎭�
// websocketpp::lib::error_code ec;
// m_client.send(m_hdl, binary_data.data(), binary_data.size(), websocketpp::frame::opcode::binary, ec);
// if (ec) {
@@ -156,7 +156,7 @@
// return false;
// }
//
-// // 等待消息或超时
+// // 绛夊緟娑堟伅鎴栬秴鏃�
// if (m_cv.wait_for(lock, std::chrono::milliseconds(timeout_ms), [this]() { return m_message_received; })) {
// std::cout << "Server response received." << std::endl;
// return true;
@@ -275,29 +275,29 @@
// }
//
// m_message_received = true;
-// m_cv.notify_one(); // 唤醒等待线程
+// m_cv.notify_one(); // 鍞ら啋绛夊緟绾跨▼
//}
//
//void WebSocketClient::on_close(connection_hdl hdl) {
// std::cout << "Connection closed." << std::endl;
// std::lock_guard<std::mutex> lock(m_mutex);
//
-// m_hdl.reset(); // 清空连接句柄
+// m_hdl.reset(); // 娓呯┖杩炴帴鍙ユ焺
// m_connected.store(false);
// if (m_close_handler) {
// m_close_handler();
// }
//
-// // 如果需要重连
+// // 濡傛灉闇�瑕侀噸杩�
// if (m_reconnect.load()) {
//
-// // 停止当前运行的事件循环
+// // 鍋滄褰撳墠杩愯鐨勪簨浠跺惊鐜�
// //m_client.stop();
// //if (m_thread.joinable()) {
// // m_thread.join();
// //}
// std::cerr << "Connection lost. Attempting to reconnect..." << std::endl;
-// //reconnect(); // 启动重连机制
+// //reconnect(); // 鍚姩閲嶈繛鏈哄埗
// }
// else {
// m_cv.notify_one();
diff --git a/EdgeInspector_App/WebSocket/WebSocketClient.h b/EdgeInspector_App/WebSocket/WebSocketClient.h
index e1f3789..ea850b0 100644
--- a/EdgeInspector_App/WebSocket/WebSocketClient.h
+++ b/EdgeInspector_App/WebSocket/WebSocketClient.h
@@ -1,4 +1,4 @@
-#ifndef WEBSOCKETCLIENT_H
+锘�#ifndef WEBSOCKETCLIENT_H
#define WEBSOCKETCLIENT_H
//#include <websocketpp/config/asio_no_tls_client.hpp>
@@ -27,62 +27,62 @@
// WebSocketClient();
// ~WebSocketClient();
//
-// // 连接到指定的URI
+// // 杩炴帴鍒版寚瀹氱殑URI
// void connect(const std::string& uri);
//
-// // 增加客户端的状态标识
+// // 澧炲姞瀹㈡埛绔殑鐘舵�佹爣璇�
// bool is_busy() const;
// void set_busy(bool busy);
//
-// // 发送文本消息
+// // 鍙戦�佹枃鏈秷鎭�
// void send(const std::string& message);
//
-// // 发送二进制数据
+// // 鍙戦�佷簩杩涘埗鏁版嵁
// void send_binary(const std::vector<char>& binary_data);
//
-// // 通过队列发送文本消息
+// // 閫氳繃闃熷垪鍙戦�佹枃鏈秷鎭�
// void enqueue_message(const std::string& message);
//
-// // 通过队列发送二进制数据
+// // 閫氳繃闃熷垪鍙戦�佷簩杩涘埗鏁版嵁
// void enqueue_binary(const std::vector<char>& binary_data);
//
-// // 处理下一个消息
+// // 澶勭悊涓嬩竴涓秷鎭�
// void process_next_message();
// void process_next_binary();
//
-// // 发送文本消息并等待回复
+// // 鍙戦�佹枃鏈秷鎭苟绛夊緟鍥炲
// bool send_and_wait(const std::string& message, int timeout_ms);
//
-// // 发送二进制数据并等待回复
+// // 鍙戦�佷簩杩涘埗鏁版嵁骞剁瓑寰呭洖澶�
// bool send_binary_and_wait(const std::vector<char>& binary_data, int timeout_ms);
//
-// // 关闭连接
+// // 鍏抽棴杩炴帴
// void close();
//
-// // 设置各种回调函数
+// // 璁剧疆鍚勭鍥炶皟鍑芥暟
// void set_open_handler(OpenHandler handler);
// void set_message_handler(MessageHandler handler);
// void set_close_handler(CloseHandler handler);
// void set_fail_handler(FailHandler handler);
// void set_pong_handler(PongHandler handler);
//
-// // 设置心跳间隔(单位:秒)
+// // 璁剧疆蹇冭烦闂撮殧锛堝崟浣嶏細绉掞級
// void set_heartbeat_interval(int interval);
//
-// // 获取当前连接的URL
+// // 鑾峰彇褰撳墠杩炴帴鐨刄RL
// std::string get_current_url();
//
-// // 检查当前连接是否仍然有效
+// // 妫�鏌ュ綋鍓嶈繛鎺ユ槸鍚︿粛鐒舵湁鏁�
// bool is_connected() const;
//
//private:
-// // WebSocket 运行函数
+// // WebSocket 杩愯鍑芥暟
// void run();
//
-// // 心跳检查函数
+// // 蹇冭烦妫�鏌ュ嚱鏁�
// void heartbeat();
//
-// // 回调函数触发器
+// // 鍥炶皟鍑芥暟瑙﹀彂鍣�
// void on_open(websocketpp::connection_hdl hdl);
// void on_message(connection_hdl hdl, message_ptr msg);
// void on_close(websocketpp::connection_hdl hdl);
@@ -90,13 +90,13 @@
// void on_pong(websocketpp::connection_hdl hdl, const std::string& payload);
//
//private:
-// // WebSocket客户端实例
+// // WebSocket瀹㈡埛绔疄渚�
// client m_client;
//
-// // WebSocket 连接句柄
+// // WebSocket 杩炴帴鍙ユ焺
// connection_hdl m_hdl;
//
-// // 线程相关
+// // 绾跨▼鐩稿叧
// std::thread m_thread;
// std::thread m_heartbeat_thread;
// std::atomic<bool> m_connected;
@@ -104,21 +104,21 @@
// int m_heartbeat_interval;
// bool m_message_received;
//
-// // 发送队列
+// // 鍙戦�侀槦鍒�
// std::queue<std::string> m_message_queue;
// std::queue<std::vector<char>> m_binary_queue;
//
-// // 标识客户端是否忙碌
+// // 鏍囪瘑瀹㈡埛绔槸鍚﹀繖纰�
// std::atomic<bool> m_busy;
//
-// // 线程同步相关
+// // 绾跨▼鍚屾鐩稿叧
// bool m_close_done;
// std::condition_variable m_cv;
//
-// // 互斥锁,用于保护共享资源
+// // 浜掓枼閿侊紝鐢ㄤ簬淇濇姢鍏变韩璧勬簮
// std::mutex m_mutex;
//
-// // 回调函数
+// // 鍥炶皟鍑芥暟
// OpenHandler m_open_handler;
// MessageHandler m_message_handler;
// CloseHandler m_close_handler;
diff --git a/EdgeInspector_App/WebSocket/WebSocketClientPool.cpp b/EdgeInspector_App/WebSocket/WebSocketClientPool.cpp
index ebd36c4..96418f6 100644
--- a/EdgeInspector_App/WebSocket/WebSocketClientPool.cpp
+++ b/EdgeInspector_App/WebSocket/WebSocketClientPool.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
#include "WebSocketClientPool.h"
//WebSocketClientPool::WebSocketClientPool(size_t thread_count) : m_thread_pool(thread_count) {}
@@ -33,7 +33,7 @@
// }
// }
//
-// // 清空之前的客户端,确保是干净的状态
+// // 娓呯┖涔嬪墠鐨勫鎴风锛岀‘淇濇槸骞插噣鐨勭姸鎬�
// m_clients.clear();
//}
//
@@ -62,148 +62,148 @@
//bool WebSocketClientPool::post_to_idle_client(const std::string& message) {
// for (auto& client : m_clients) {
// if (client->is_connected()) {
-// // 提交发送任务到线程池
+// // 鎻愪氦鍙戦�佷换鍔″埌绾跨▼姹�
// m_thread_pool.enqueue([client, message]() {
-// client->set_busy(true); // 标记为忙碌
-// client->send(message); // 发送消息
-// client->set_busy(false); // 完成后标记为空闲
+// client->set_busy(true); // 鏍囪涓哄繖纰�
+// client->send(message); // 鍙戦�佹秷鎭�
+// client->set_busy(false); // 瀹屾垚鍚庢爣璁颁负绌洪棽
// });
-// return true; // 成功提交任务
+// return true; // 鎴愬姛鎻愪氦浠诲姟
// }
// }
-// return false; // 没有可用客户端
+// return false; // 娌℃湁鍙敤瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::post_binary_to_idle_client(const std::vector<char>& binary_data) {
// for (auto& client : m_clients) {
// if (client->is_connected()) {
-// // 提交发送任务到线程池
+// // 鎻愪氦鍙戦�佷换鍔″埌绾跨▼姹�
// m_thread_pool.enqueue([client, binary_data]() {
-// client->set_busy(true); // 标记为忙碌
-// client->send_binary(binary_data); // 发送二进制数据
-// client->set_busy(false); // 完成后标记为空闲
+// client->set_busy(true); // 鏍囪涓哄繖纰�
+// client->send_binary(binary_data); // 鍙戦�佷簩杩涘埗鏁版嵁
+// client->set_busy(false); // 瀹屾垚鍚庢爣璁颁负绌洪棽
// });
-// return true; // 成功提交任务
+// return true; // 鎴愬姛鎻愪氦浠诲姟
// }
// }
-// return false; // 没有可用客户端
+// return false; // 娌℃湁鍙敤瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::send_to_idle_client(const std::string& message, int timeout_ms) {
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// // 标记为忙
+// // 鏍囪涓哄繖
// client->set_busy(true);
//
-// // 使用线程池发送消息
+// // 浣跨敤绾跨▼姹犲彂閫佹秷鎭�
// m_thread_pool.enqueue([client, message, timeout_ms]() {
-// // 发送消息并等待服务器回复
-// client->send_and_wait(message, timeout_ms); // 5秒超时
-// client->set_busy(false); // 标记为空闲
+// // 鍙戦�佹秷鎭苟绛夊緟鏈嶅姟鍣ㄥ洖澶�
+// client->send_and_wait(message, timeout_ms); // 5绉掕秴鏃�
+// client->set_busy(false); // 鏍囪涓虹┖闂�
// });
//
-// return true; // 成功发送消息,返回 true
+// return true; // 鎴愬姛鍙戦�佹秷鎭紝杩斿洖 true
// }
// }
-// return false; // 没有空闲客户端
+// return false; // 娌℃湁绌洪棽瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::send_binary_to_idle_client(const std::vector<char>& binary_data, int timeout_ms) {
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// // 标记为忙
+// // 鏍囪涓哄繖
// client->set_busy(true);
//
-// // 使用线程池发送消息
+// // 浣跨敤绾跨▼姹犲彂閫佹秷鎭�
// m_thread_pool.enqueue([client, binary_data, timeout_ms]() {
-// // 发送消息并等待服务器回复
+// // 鍙戦�佹秷鎭苟绛夊緟鏈嶅姟鍣ㄥ洖澶�
// client->send_binary_and_wait(binary_data, timeout_ms);
-// client->set_busy(false); // 标记为空闲
+// client->set_busy(false); // 鏍囪涓虹┖闂�
// });
//
-// return true; // 成功发送消息,返回 true
+// return true; // 鎴愬姛鍙戦�佹秷鎭紝杩斿洖 true
// }
// }
-// return false; // 没有空闲客户端
+// return false; // 娌℃湁绌洪棽瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::send_to_idle_client_and_wait(const std::string& message, int timeout_ms) {
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// client->set_busy(true); // 标记为忙
+// client->set_busy(true); // 鏍囪涓哄繖
//
// try {
-// // 直接在当前线程调用 send_and_wait,阻塞直到任务完成
+// // 鐩存帴鍦ㄥ綋鍓嶇嚎绋嬭皟鐢� send_and_wait锛岄樆濉炵洿鍒颁换鍔″畬鎴�
// bool result = client->send_and_wait(message, timeout_ms);
-// client->set_busy(false); // 设置为空闲状态
-// return result; // 返回结果
+// client->set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬�
+// return result; // 杩斿洖缁撴灉
// }
// catch (const std::exception& e) {
// std::cerr << "Exception during sending: " << e.what() << std::endl;
-// client->set_busy(false); // 即使发生异常,也要重置为未忙状态
-// return false; // 发生异常,返回失败
+// client->set_busy(false); // 鍗充娇鍙戠敓寮傚父锛屼篃瑕侀噸缃负鏈繖鐘舵��
+// return false; // 鍙戠敓寮傚父锛岃繑鍥炲け璐�
// }
// }
// }
-// return false; // 没有空闲客户端
+// return false; // 娌℃湁绌洪棽瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::send_binary_to_idle_client_and_wait(const std::vector<char>& binary_data, int timeout_ms) {
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// client->set_busy(true); // 标记为忙
+// client->set_busy(true); // 鏍囪涓哄繖
//
// try {
-// // 直接在当前线程调用 send_and_wait,阻塞直到任务完成
+// // 鐩存帴鍦ㄥ綋鍓嶇嚎绋嬭皟鐢� send_and_wait锛岄樆濉炵洿鍒颁换鍔″畬鎴�
// bool result = client->send_binary_and_wait(binary_data, timeout_ms);
-// client->set_busy(false); // 设置为空闲状态
-// return result; // 返回结果
+// client->set_busy(false); // 璁剧疆涓虹┖闂茬姸鎬�
+// return result; // 杩斿洖缁撴灉
// }
// catch (const std::exception& e) {
// std::cerr << "Exception during sending: " << e.what() << std::endl;
-// client->set_busy(false); // 即使发生异常,也要重置为未忙状态
-// return false; // 发生异常,返回失败
+// client->set_busy(false); // 鍗充娇鍙戠敓寮傚父锛屼篃瑕侀噸缃负鏈繖鐘舵��
+// return false; // 鍙戠敓寮傚父锛岃繑鍥炲け璐�
// }
// }
// }
-// return false; // 没有空闲客户端
+// return false; // 娌℃湁绌洪棽瀹㈡埛绔�
//}
//
//bool WebSocketClientPool::send_to_idle_client_with_retry(const std::string& message, int total_timeout_ms, int retry_interval_ms) {
// auto start_time = std::chrono::steady_clock::now();
//
// while (true) {
-// // 查找空闲客户端
+// // 鏌ユ壘绌洪棽瀹㈡埛绔�
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// // 标记为忙
+// // 鏍囪涓哄繖
// client->set_busy(true);
//
-// // 使用线程池发送消息
+// // 浣跨敤绾跨▼姹犲彂閫佹秷鎭�
// m_thread_pool.enqueue([client, message]() {
// try {
-// // 发送消息并等待服务器回复
-// client->send_and_wait(message, 5000); // 这里的超时可以根据需要调整
+// // 鍙戦�佹秷鎭苟绛夊緟鏈嶅姟鍣ㄥ洖澶�
+// client->send_and_wait(message, 5000); // 杩欓噷鐨勮秴鏃跺彲浠ユ牴鎹渶瑕佽皟鏁�
// }
// catch (const std::exception& e) {
// std::cerr << "Error sending data: " << e.what() << std::endl;
// }
-// client->set_busy(false); // 标记为空闲
+// client->set_busy(false); // 鏍囪涓虹┖闂�
// });
//
-// return true; // 成功发送
+// return true; // 鎴愬姛鍙戦��
// }
// }
//
-// // 计算已使用的时间
+// // 璁$畻宸蹭娇鐢ㄧ殑鏃堕棿
// auto elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start_time).count();
//
// if (elapsed_time >= total_timeout_ms) {
// std::cerr << "Timeout: failed to send data within the specified timeout of " << total_timeout_ms << " ms." << std::endl;
-// return false; // 超时,无法发送
+// return false; // 瓒呮椂锛屾棤娉曞彂閫�
// }
//
-// // 没有找到空闲客户端,等待 retry_interval_ms 毫秒后重试
+// // 娌℃湁鎵惧埌绌洪棽瀹㈡埛绔紝绛夊緟 retry_interval_ms 姣鍚庨噸璇�
// std::this_thread::sleep_for(std::chrono::milliseconds(retry_interval_ms));
// }
//}
@@ -212,37 +212,37 @@
// auto start_time = std::chrono::steady_clock::now();
//
// while (true) {
-// // 查找空闲客户端
+// // 鏌ユ壘绌洪棽瀹㈡埛绔�
// for (auto& client : m_clients) {
// if (!client->is_busy() && client->is_connected()) {
-// // 标记为忙
+// // 鏍囪涓哄繖
// client->set_busy(true);
//
-// // 使用线程池发送消息
+// // 浣跨敤绾跨▼姹犲彂閫佹秷鎭�
// m_thread_pool.enqueue([client, binary_data = std::move(binary_data)]() mutable {
// try {
-// // 发送消息并等待服务器回复
-// client->send_binary_and_wait(binary_data, 5000); // 这里的超时可以根据需要调整
+// // 鍙戦�佹秷鎭苟绛夊緟鏈嶅姟鍣ㄥ洖澶�
+// client->send_binary_and_wait(binary_data, 5000); // 杩欓噷鐨勮秴鏃跺彲浠ユ牴鎹渶瑕佽皟鏁�
// }
// catch (const std::exception& e) {
// std::cerr << "Error sending binary data: " << e.what() << std::endl;
// }
-// client->set_busy(false); // 标记为空闲
+// client->set_busy(false); // 鏍囪涓虹┖闂�
// });
//
-// return true; // 成功发送
+// return true; // 鎴愬姛鍙戦��
// }
// }
//
-// // 计算已使用的时间
+// // 璁$畻宸蹭娇鐢ㄧ殑鏃堕棿
// auto elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start_time).count();
//
// if (elapsed_time >= total_timeout_ms) {
// std::cerr << "Timeout: failed to send data within the specified timeout of " << total_timeout_ms << " ms." << std::endl;
-// return false; // 超时,无法发送
+// return false; // 瓒呮椂锛屾棤娉曞彂閫�
// }
//
-// // 没有找到空闲客户端,等待 retry_interval_ms 毫秒后重试
+// // 娌℃湁鎵惧埌绌洪棽瀹㈡埛绔紝绛夊緟 retry_interval_ms 姣鍚庨噸璇�
// std::this_thread::sleep_for(std::chrono::milliseconds(retry_interval_ms));
// }
//}
diff --git a/EdgeInspector_App/WebSocket/WebSocketClientPool.h b/EdgeInspector_App/WebSocket/WebSocketClientPool.h
index 21357e9..464df79 100644
--- a/EdgeInspector_App/WebSocket/WebSocketClientPool.h
+++ b/EdgeInspector_App/WebSocket/WebSocketClientPool.h
@@ -1,4 +1,4 @@
-#ifndef WEBSOCKETCLIENTWITHPOOL_H
+锘�#ifndef WEBSOCKETCLIENTWITHPOOL_H
#define WEBSOCKETCLIENTWITHPOOL_H
//#include "WebSocketClient.h"
@@ -9,33 +9,33 @@
// explicit WebSocketClientPool(size_t thread_count);
// ~WebSocketClientPool();
//
-// // 初始化客户端
+// // 鍒濆鍖栧鎴风
// void init_clients(const std::vector<std::string>& uris);
//
-// // 退出所有客户端
+// // 閫�鍑烘墍鏈夊鎴风
// void exit_clients();
//
-// // 使用线程池发送消息
+// // 浣跨敤绾跨▼姹犲彂閫佹秷鎭�
// void post_to_all(const std::string& message);
// void post_binary_to_all(const std::vector<char>& binary_data);
//
-// // 从池中选择一个空闲的客户端进行发送,不需要服务器响应
+// // 浠庢睜涓�夋嫨涓�涓┖闂茬殑瀹㈡埛绔繘琛屽彂閫侊紝涓嶉渶瑕佹湇鍔″櫒鍝嶅簲
// bool post_to_idle_client(const std::string& message);
// bool post_binary_to_idle_client(const std::vector<char>& binary_data);
//
-// // 从池中选择一个空闲的客户端进行发送,并需要服务器响应
+// // 浠庢睜涓�夋嫨涓�涓┖闂茬殑瀹㈡埛绔繘琛屽彂閫侊紝骞堕渶瑕佹湇鍔″櫒鍝嶅簲
// bool send_to_idle_client(const std::string& message, int timeout_ms);
// bool send_binary_to_idle_client(const std::vector<char>& binary_data, int timeout_ms);
//
-// // 从池中选择一个空闲的客户端进行发送,并等待服务器响应
+// // 浠庢睜涓�夋嫨涓�涓┖闂茬殑瀹㈡埛绔繘琛屽彂閫侊紝骞剁瓑寰呮湇鍔″櫒鍝嶅簲
// bool send_to_idle_client_and_wait(const std::string& message, int timeout_ms);
// bool send_binary_to_idle_client_and_wait(const std::vector<char>& binary_data, int timeout_ms);
//
-// // 从池中选择一个空闲的客户端进行发送,并等待服务器响应,如果超时则重试
+// // 浠庢睜涓�夋嫨涓�涓┖闂茬殑瀹㈡埛绔繘琛屽彂閫侊紝骞剁瓑寰呮湇鍔″櫒鍝嶅簲锛屽鏋滆秴鏃跺垯閲嶈瘯
// bool send_to_idle_client_with_retry(const std::string& message, int total_timeout_ms, int retry_interval_ms);
// bool send_binary_to_idle_client_with_retry(std::vector<char>&& binary_data, int total_timeout_ms, int retry_interval_ms);
//
-// // 设置 WebSocket 客户端事件处理程序
+// // 璁剧疆 WebSocket 瀹㈡埛绔簨浠跺鐞嗙▼搴�
// void set_open_handler(WebSocketClient::OpenHandler handler);
// void set_message_handler(WebSocketClient::MessageHandler handler);
// void set_close_handler(WebSocketClient::CloseHandler handler);
diff --git a/EdgeInspector_App/resource.h b/EdgeInspector_App/resource.h
index 1c78a92..c6d9a99 100644
--- a/EdgeInspector_App/resource.h
+++ b/EdgeInspector_App/resource.h
Binary files differ
diff --git a/EdgeInspector_App/stdafx.cpp b/EdgeInspector_App/stdafx.cpp
index 8c41ff8..03d2642 100644
--- a/EdgeInspector_App/stdafx.cpp
+++ b/EdgeInspector_App/stdafx.cpp
@@ -1,7 +1,7 @@
-
-// stdafx.cpp : 钎霖 器窃 颇老父 甸绢 乐绰 家胶 颇老涝聪促.
-// EdgeInspector_App.pch绰 固府 哪颇老等 庆歹啊 邓聪促.
-// stdafx.obj俊绰 固府 哪颇老等 屈侥 沥焊啊 器窃邓聪促.
+锘�
+// stdafx.cpp : 閽庨湒 鍣ㄧ獌 棰囪�佺埗 鐢哥虎 涔愮话 瀹惰兌 棰囪�佹稘鑱績.
+// EdgeInspector_App.pch缁� 鍥哄簻 鍝鑰佺瓑 搴嗘鍟� 閭撹仾淇�.
+// stdafx.obj淇婄话 鍥哄簻 鍝鑰佺瓑 灞堜茎 娌ョ剨鍟� 鍣ㄧ獌閭撹仾淇�.
#include "stdafx.h"
diff --git a/EdgeInspector_App/stdafx.h b/EdgeInspector_App/stdafx.h
index 2447d54..f415982 100644
--- a/EdgeInspector_App/stdafx.h
+++ b/EdgeInspector_App/stdafx.h
@@ -1,7 +1,7 @@
-
-// stdafx.h : 磊林 荤侩窍瘤父 磊林 函版登瘤绰 臼绰
-// 钎霖 矫胶袍 器窃 颇老 棺 橇肺璃飘 包访 器窃 颇老捞
-// 甸绢 乐绰 器窃 颇老涝聪促.
+锘�
+// stdafx.h : 纾婃灄 鑽や京绐嶇槫鐖� 纾婃灄 鍑界増鐧荤槫缁� 鑷肩话
+// 閽庨湒 鐭兌琚� 鍣ㄧ獌 棰囪�� 妫� 姗囪偤鐠冮 鍖呰 鍣ㄧ獌 棰囪�佹崬
+// 鐢哥虎 涔愮话 鍣ㄧ獌 棰囪�佹稘鑱績.
#pragma once
@@ -10,32 +10,32 @@
#endif
#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // 芭狼 荤侩登瘤 臼绰 郴侩篮 Windows 庆歹俊辑 力寇钦聪促.
+#define VC_EXTRALEAN // 鑺嫾 鑽や京鐧荤槫 鑷肩话 閮翠京绡� Windows 搴嗘淇婅緫 鍔涘瘒閽﹁仾淇�.
#endif
#include "targetver.h"
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 老何 CString 积己磊绰 疙矫利栏肺 急攫邓聪促.
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 鑰佷綍 CString 绉繁纾婄话 鐤欑煫鍒╂爮鑲� 鎬ユ敨閭撹仾淇�.
-// MFC狼 傍烹 何盒苞 公矫 啊瓷茄 版绊 皋矫瘤俊 措茄 见扁扁甫 秦力钦聪促.
+// MFC鐙� 鍌嶇児 浣曠洅鑻� 鍏煫 鍟婄摲鑼� 鐗堢粖 鐨嬬煫鐦や繆 鎺寗 瑙佹墎鎵佺敨 绉﹀姏閽﹁仾淇�.
#define _AFX_ALL_WARNINGS
-#include <afxwin.h> // MFC 琴缴 棺 钎霖 备己 夸家涝聪促.
-#include <afxext.h> // MFC 犬厘涝聪促.
+#include <afxwin.h> // MFC 鐞寸即 妫� 閽庨湒 澶囧繁 澶稿娑濊仾淇�.
+#include <afxext.h> // MFC 鐘帢娑濊仾淇�.
-#include <afxdisp.h> // MFC 磊悼拳 努贰胶涝聪促.
+#include <afxdisp.h> // MFC 纾婃偧鎷� 鍔窗鑳舵稘鑱績.
#ifndef _AFX_NO_OLE_SUPPORT
-#include <afxdtctl.h> // Internet Explorer 4 傍侩 牧飘费俊 措茄 MFC 瘤盔涝聪促.
+#include <afxdtctl.h> // Internet Explorer 4 鍌嶄京 鐗ч璐逛繆 鎺寗 MFC 鐦ょ洈娑濊仾淇�.
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // Windows 傍侩 牧飘费俊 措茄 MFC 瘤盔涝聪促.
+#include <afxcmn.h> // Windows 鍌嶄京 鐗ч璐逛繆 鎺寗 MFC 鐦ょ洈娑濊仾淇�.
#endif // _AFX_NO_AFXCMN_SUPPORT
-#include <afxcontrolbars.h> // MFC狼 府夯 棺 牧飘费 阜措 瘤盔
+#include <afxcontrolbars.h> // MFC鐙� 搴滃く 妫� 鐗ч璐� 闃滄帾 鐦ょ洈
#include "InspectionBase.h"
@@ -55,7 +55,7 @@
static UINT g_nSequenceOffColor = RGB(0, 0, 0);
static UINT g_nSequenceOnColor = RGB(0, 180, 0);
-//1. 采集模块
+//1. 閲囬泦妯″潡
#include "../SDK/BlGrabber/include/FrameBufferController.h"
#include "../SDK/BlGrabber/include/GrabberControl.h"
#if _DEBUG
@@ -65,7 +65,7 @@
#endif
#if HALCON_VISION_KEY
-//2. 视觉日志模块
+//2. 瑙嗚鏃ュ織妯″潡
#include "../SDK/LogSDK/include/ILogger.h"
#include "../SDK/LogSDK/include/LogLib.h"
#if _DEBUG
@@ -74,7 +74,7 @@
#pragma comment(lib,"../SDK/LogSDK/lib/x64/Release/Log.lib")
#endif
-//3. 视觉显示模块
+//3. 瑙嗚鏄剧ず妯″潡
#include "../SDK/BaseDisplaySDK/include/typesdef.h"
#include "../SDK/BaseDisplaySDK/include/BaseVision.h"
#include "../SDK/BaseDisplaySDK/include/IClsShape.h"
@@ -86,7 +86,7 @@
#pragma comment(lib,"../SDK/BaseDisplaySDK/lib/x64/Release/BaseDisplay.lib")
#endif
-//4. 视觉处理模块
+//4. 瑙嗚澶勭悊妯″潡
#include "../SDK/BlVisionPro/include/IVisionRecipe.h"
#include "../SDK/BlVisionPro/include/ISoftVisionApp.h"
#include "../SDK/BlVisionPro/include/BlVisionLib.h"
@@ -97,7 +97,7 @@
#endif
#endif
-//5. AI模块
+//5. AI妯″潡
#include "../SDK/AIClient/include/AiDetectEx.h"
#if _DEBUG
#pragma comment (lib, "../SDK/AIClient/lib/AIClientD.lib")
@@ -105,7 +105,7 @@
#pragma comment (lib, "../SDK/AIClient/lib/AIClient.lib")
#endif
-//6. SIS底层模块
+//6. SIS搴曞眰妯″潡
#ifdef _DEBUG
#pragma comment(lib, "../SDK/CHThreadPool/lib/x64/Release/CHThreadPoolD.lib")
#pragma comment(lib, "../SDK/SISControls/lib/x64/Release/SISControlsD.lib")
diff --git a/EdgeInspector_App/targetver.h b/EdgeInspector_App/targetver.h
index ad5ca61..0ae86e8 100644
--- a/EdgeInspector_App/targetver.h
+++ b/EdgeInspector_App/targetver.h
@@ -1,8 +1,8 @@
-#pragma once
+锘�#pragma once
-// 器窃 SDKDDKVer.h绰 荤侩 啊瓷茄 Windows 敲阀汽 吝 滚傈捞 啊厘 臭篮 敲阀汽阑 沥狼钦聪促.
+// 鍣ㄧ獌 SDKDDKVer.h缁� 鑽や京 鍟婄摲鑼� Windows 鏁查榾姹� 鍚� 婊氬倛鎹� 鍟婂帢 鑷 鏁查榾姹介槕 娌ョ嫾閽﹁仾淇�.
-// 捞傈 Windows 敲阀汽俊 措秦 览侩 橇肺弊伐阑 呼靛窍妨绰 版快俊绰 SDKDDKVer.h甫 器窃窍扁 傈俊
-// WinSDKVer.h甫 器窃窍绊 _WIN32_WINNT 概农肺甫 瘤盔窍妨绰 敲阀汽栏肺 汲沥窍绞矫坷.
+// 鎹炲倛 Windows 鏁查榾姹戒繆 鎺Е 瑙堜京 姗囪偤寮婁紣闃� 鍛奸潧绐嶅Θ缁� 鐗堝揩淇婄话 SDKDDKVer.h鐢� 鍣ㄧ獌绐嶆墎 鍌堜繆
+// WinSDKVer.h鐢� 鍣ㄧ獌绐嶇粖 _WIN32_WINNT 姒傚啘鑲虹敨 鐦ょ洈绐嶅Θ缁� 鏁查榾姹芥爮鑲� 姹叉播绐嶇粸鐭澐.
#include <SDKDDKVer.h>
--
Gitblit v1.9.3