From 6087507f5c9445055a38f7b861e40a22e82d3316 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 25 七月 2025 16:09:29 +0800
Subject: [PATCH] 1. ProfileInspect单独使用坐标转换参数,与全局的区分开。如果ProfileInspect没有设置,那么默认使用全局的

---
 ENRIT/Recipe/GlassRecipe.cpp         |   28 +++
 ENRIT/ENRIT.vcxproj                  |    2 
 ENRIT/View/ViewRecipeSetting.cpp     |    4 
 ENRIT/Process/InspectCamera.cpp      |   22 ++
 ENRIT/View/DlgCoordinateConvert.h    |   40 +++++
 ENRIT/View/ViewRecipeProfileView.cpp |   64 +++++---
 ENRIT/Recipe/GlassRecipe.h           |    5 
 ENRIT/View/ViewRecipeProfileView.h   |    5 
 ENRIT/View/DlgCoordinateConvert.cpp  |  210 ++++++++++++++++++++++++++++++
 ENRIT/ENRIT.vcxproj.filters          |    6 
 10 files changed, 345 insertions(+), 41 deletions(-)

diff --git a/ENRIT/ENRIT.vcxproj b/ENRIT/ENRIT.vcxproj
index 04e043b..5977c2e 100644
--- a/ENRIT/ENRIT.vcxproj
+++ b/ENRIT/ENRIT.vcxproj
@@ -328,6 +328,7 @@
     <ClInclude Include="UITool\surfacecolor.h" />
     <ClInclude Include="UITool\textdescriptor.h" />
     <ClInclude Include="UITool\texture.h" />
+    <ClInclude Include="View\DlgCoordinateConvert.h" />
     <ClInclude Include="View\DlgLicenseInfo.h" />
     <ClInclude Include="View\DlgLogin.h" />
     <ClInclude Include="View\FrameImg.h" />
@@ -412,6 +413,7 @@
     <ClCompile Include="UITool\surfacecolor.cpp" />
     <ClCompile Include="UITool\textdescriptor.cpp" />
     <ClCompile Include="UITool\texture.cpp" />
+    <ClCompile Include="View\DlgCoordinateConvert.cpp" />
     <ClCompile Include="View\DlgLicenseInfo.cpp" />
     <ClCompile Include="View\DlgLogin.cpp" />
     <ClCompile Include="View\FrameImg.cpp" />
diff --git a/ENRIT/ENRIT.vcxproj.filters b/ENRIT/ENRIT.vcxproj.filters
index 94e699c..a485108 100644
--- a/ENRIT/ENRIT.vcxproj.filters
+++ b/ENRIT/ENRIT.vcxproj.filters
@@ -549,6 +549,9 @@
     <ClInclude Include="IncludeSDK.h">
       <Filter>澶存枃浠�</Filter>
     </ClInclude>
+    <ClInclude Include="View\DlgCoordinateConvert.h">
+      <Filter>View</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="ENRIT.cpp">
@@ -782,6 +785,9 @@
     <ClCompile Include="CLanguageControl.cpp">
       <Filter>Language</Filter>
     </ClCompile>
+    <ClCompile Include="View\DlgCoordinateConvert.cpp">
+      <Filter>View</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="ENRIT.rc">
diff --git a/ENRIT/Process/InspectCamera.cpp b/ENRIT/Process/InspectCamera.cpp
index f6df629..cbf22ff 100644
--- a/ENRIT/Process/InspectCamera.cpp
+++ b/ENRIT/Process/InspectCamera.cpp
@@ -4009,12 +4009,22 @@
 	if(nStageNo < 0 || nStageNo > 1)
 		nStageNo = 0;
 
-	int			nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectChip = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
-	int			nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectCrack = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
-	int			nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectBroken = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
+	double dConvRes = pCamera->m_dConvResolution[nStageNo];
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dProfileRes = profile.m_dConvResolution[eDim][nStageNo];
+		if (dProfileRes > 0.0) {
+			dConvRes = dProfileRes;
+		}
+	}
+
+	int		nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea / dConvRes);
+	CRect	rectChip = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
+	int		nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea / dConvRes);
+	CRect	rectCrack = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
+	int		nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea / dConvRes);
+	CRect	rectBroken = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
 
 	rectChip.InflateRect(align_4byte(nChipInsArea)/2,0);	
 	rectCrack.InflateRect(align_4byte(nCrackInsArea)/2,0);	
diff --git a/ENRIT/Recipe/GlassRecipe.cpp b/ENRIT/Recipe/GlassRecipe.cpp
index 0faf916..957704d 100644
--- a/ENRIT/Recipe/GlassRecipe.cpp
+++ b/ENRIT/Recipe/GlassRecipe.cpp
@@ -3612,6 +3612,8 @@
 	CopyMemory(m_stProfile,rh.m_stProfile,sizeof(ST_PROFILE_SETTING)*MAX_PROFILE_SETTING_COUNT);
 	CopyMemory(m_stCamferUp,rh.m_stCamferUp,sizeof(ST_CHAMFER_SETTING)*MAX_PROFILE_SETTING_COUNT);
 	CopyMemory(m_stCamferDn,rh.m_stCamferDn,sizeof(ST_CHAMFER_SETTING)*MAX_PROFILE_SETTING_COUNT);
+	CopyMemory(m_dConvResolution, rh.m_dConvResolution, sizeof(double) * MAX_DIMENSION_COUNT * MAX_STAGE_HAND_COUNT);
+	CopyMemory(m_dScanResolution, rh.m_dScanResolution, sizeof(double) * MAX_DIMENSION_COUNT * MAX_STAGE_HAND_COUNT);
 
 	return *this;
 }
@@ -3640,7 +3642,17 @@
 		str.Format(_T("CAD_PROFILE_OFFSET_X"));
 		pFile->GetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetX[i]);	
 		str.Format(_T("CAD_PROFILE_OFFSET_Y"));
-		pFile->GetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetY[i]);	
+		pFile->GetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetY[i]);
+
+		for (int j = 0; j < MAX_STAGE_HAND_COUNT; j++) {
+			// Conv Resolution
+			str.Format(_T("CONV_RESOLUTION_%d_%d"), i, j);
+			pFile->GetItemValue(i, (TCHAR*)(LPCTSTR)str, m_dConvResolution[i][j]);
+
+			// Scan Resolution
+			str.Format(_T("SCAN_RESOLUTION_%d_%d"), i, j);
+			pFile->GetItemValue(i, (TCHAR*)(LPCTSTR)str, m_dScanResolution[i][j]);
+		}
 	}
 
 	for(i=0;i<MAX_PROFILE_SETTING_COUNT;i++)
@@ -3702,7 +3714,15 @@
 		str.Format(_T("CAD_PROFILE_OFFSET_X"));
 		pFile->SetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetX[i]);	
 		str.Format(_T("CAD_PROFILE_OFFSET_Y"));
-		pFile->SetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetY[i]);	
+		pFile->SetItemValue(i,(TCHAR*)(LPCTSTR)str, m_nCADOffsetY[i]);
+
+		for (int j = 0; j < MAX_STAGE_HAND_COUNT; j++) {
+			str.Format(_T("CONV_RESOLUTION_%d_%d"), i, j);
+			pFile->SetItemValue(i, (TCHAR*)(LPCTSTR)str, m_dConvResolution[i][j]);
+
+			str.Format(_T("SCAN_RESOLUTION_%d_%d"), i, j);
+			pFile->SetItemValue(i, (TCHAR*)(LPCTSTR)str, m_dScanResolution[i][j]);
+		}
 	}
 
 	for(i=0;i<MAX_PROFILE_SETTING_COUNT;i++)
@@ -3751,7 +3771,9 @@
 	ZeroMemory(m_nCADOffsetX,sizeof(int)*MAX_DIMENSION_COUNT);
 	ZeroMemory(m_stProfile,sizeof(ST_PROFILE_SETTING)*MAX_PROFILE_SETTING_COUNT);
 	ZeroMemory(m_stCamferUp,sizeof(ST_CHAMFER_SETTING)*MAX_PROFILE_SETTING_COUNT);
-	ZeroMemory(m_stCamferDn,sizeof(ST_CHAMFER_SETTING)*MAX_PROFILE_SETTING_COUNT);	
+	ZeroMemory(m_stCamferDn,sizeof(ST_CHAMFER_SETTING)*MAX_PROFILE_SETTING_COUNT);
+	ZeroMemory(m_dConvResolution, sizeof(double) * MAX_DIMENSION_COUNT * MAX_STAGE_HAND_COUNT);
+	ZeroMemory(m_dScanResolution, sizeof(double) * MAX_DIMENSION_COUNT * MAX_STAGE_HAND_COUNT);
 }
 
 //////////////////////////////////////////////////////////////////////////
diff --git a/ENRIT/Recipe/GlassRecipe.h b/ENRIT/Recipe/GlassRecipe.h
index b7b4bf4..b7c0bee 100644
--- a/ENRIT/Recipe/GlassRecipe.h
+++ b/ENRIT/Recipe/GlassRecipe.h
@@ -1025,7 +1025,10 @@
 	int				m_nCADOffsetY[MAX_DIMENSION_COUNT];
 	ST_PROFILE_SETTING	m_stProfile[MAX_PROFILE_SETTING_COUNT];
 	ST_CHAMFER_SETTING	m_stCamferUp[MAX_PROFILE_SETTING_COUNT];
-	ST_CHAMFER_SETTING	m_stCamferDn[MAX_PROFILE_SETTING_COUNT];	
+	ST_CHAMFER_SETTING	m_stCamferDn[MAX_PROFILE_SETTING_COUNT];
+
+	double			m_dConvResolution[MAX_DIMENSION_COUNT][MAX_STAGE_HAND_COUNT];
+	double			m_dScanResolution[MAX_DIMENSION_COUNT][MAX_STAGE_HAND_COUNT];
 };
 
 class CGlassRecipe
diff --git a/ENRIT/View/DlgCoordinateConvert.cpp b/ENRIT/View/DlgCoordinateConvert.cpp
new file mode 100644
index 0000000..6124531
--- /dev/null
+++ b/ENRIT/View/DlgCoordinateConvert.cpp
@@ -0,0 +1,210 @@
+锘�// DlgCoordinateConvert.cpp: 瀹炵幇鏂囦欢
+//
+
+#include "stdafx.h"
+#include "ENRIT.h"
+#include "afxdialogex.h"
+#include "DlgCoordinateConvert.h"
+
+// CDlgCoordinateConvert 瀵硅瘽妗�
+
+const int CAM_COLUMN_COUNT = 5;
+const TCHAR* CAM_COLUMN_NAMES[CAM_COLUMN_COUNT] = {
+	_T("Dimension"),
+	_T("0 Hand Resolution(H)"),
+	_T("0 Hand Resolution(V)"),
+	_T("1 Hand Resolution(H)"),
+	_T("1 Hand Resolution(V)")
+};
+
+const int CAM_COLUMN_WIDTHS[CAM_COLUMN_COUNT] = {
+	80, 120, 120, 120, 120
+};
+
+#define GRID_FIX_COLOR			RGB(144,200,246)
+#define GRID_COLOR				RGB(242,242,242)
+#define GRID_TEXT_COLOR			RGB(255,255,255)
+#define GRID_LINE_COLOR			GRID_FIX_COLOR
+
+IMPLEMENT_DYNAMIC(CDlgCoordinateConvert, CDialogEx)
+
+CDlgCoordinateConvert::CDlgCoordinateConvert(CWnd* pParent /*=nullptr*/)
+	: CDialogEx(IDD_DLG_COORD_CONVERT, pParent)
+	, m_nCameraCount(0)
+	, m_nScanCount(0)
+	, m_pDlgRecipe(nullptr)
+{
+
+}
+
+CDlgCoordinateConvert::~CDlgCoordinateConvert()
+{
+}
+
+void CDlgCoordinateConvert::SetRecipe(CGlassRecipe* pRecipe)
+{
+	m_pDlgRecipe = pRecipe;
+}
+
+void CDlgCoordinateConvert::InitCameraGrid()
+{
+	if (m_gridCameraList.GetSafeHwnd() == NULL) {
+		return;
+	}
+
+	m_gridCameraList.GetDefaultCell(TRUE, FALSE)->SetBackClr(GRID_FIX_COLOR);
+	m_gridCameraList.GetDefaultCell(FALSE, TRUE)->SetBackClr(GRID_FIX_COLOR);
+	m_gridCameraList.GetDefaultCell(FALSE, FALSE)->SetBackClr(GRID_COLOR);
+	m_gridCameraList.SetFixedBkColor(GRID_FIX_COLOR);
+	m_gridCameraList.SetGridLines(GVL_BOTH);
+
+	m_gridCameraList.SetColumnCount(CAM_COLUMN_COUNT);
+	m_gridCameraList.SetRowCount(10);
+	m_gridCameraList.SetFixedRowCount(1);
+	m_gridCameraList.SetFixedColumnCount(0);
+	m_gridCameraList.ExpandColumnsToFit();
+
+	CFont* pFont = m_gridCameraList.GetFont();
+	if (!pFont) {
+		return;
+	}
+
+	LOGFONT lf;
+	pFont->GetLogFont(&lf);
+	lf.lfItalic = 0;
+	lf.lfHeight = 14;
+	lf.lfWeight = FW_BOLD;
+	_tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("Arial"));
+
+	m_gridCameraList.GetDefaultCell(TRUE, FALSE)->SetFont(&lf);
+	m_gridCameraList.GetDefaultCell(FALSE, TRUE)->SetFont(&lf);
+	m_gridCameraList.GetDefaultCell(TRUE, TRUE)->SetFont(&lf);
+	m_gridCameraList.SetEditable(TRUE);
+	m_gridCameraList.EnableSelection(TRUE);
+
+	InitCameraGridHeader();
+}
+
+void CDlgCoordinateConvert::InitCameraGridHeader()
+{
+	CString str;
+	GV_ITEM Item;
+	int		nCol = 0;
+	int		iLoop;
+
+	Item.mask = GVIF_TEXT;
+	Item.row = 0;
+	for (iLoop = 0; iLoop < CAM_COLUMN_COUNT; iLoop++) {
+		Item.col = nCol++;
+		Item.strText = CAM_COLUMN_NAMES[iLoop];
+		m_gridCameraList.SetItem(&Item);
+		m_gridCameraList.SetColumnWidth(Item.col, CAM_COLUMN_WIDTHS[iLoop]);
+	}
+
+	m_gridCameraList.Invalidate();
+}
+
+void CDlgCoordinateConvert::FillCameraGrid()
+{
+	m_gridCameraList.SetRowCount(MAX_DIMENSION_COUNT + 1);
+
+	CProfileInspect_Prm profile;
+	if (m_pDlgRecipe != nullptr) {
+		profile = m_pDlgRecipe->m_ProfilePrm;
+	}
+	else {
+		for (int i = 0; i < MAX_DIMENSION_COUNT; i++) {
+			profile.m_dConvResolution[i][0] = 0.01;
+			profile.m_dConvResolution[i][1] = 0.01;
+			profile.m_dScanResolution[i][0] = 0.01;
+			profile.m_dScanResolution[i][1] = 0.01;
+		}
+	}
+
+	CString str;
+	const TCHAR* SET_INS_DIMENSION[] = { _T("A Top"),_T("B Top"),_T("C Top"),_T("D Top"),_T("A Bot"),_T("B Bot"),_T("C Bot"),_T("D Bot") };
+	for (int i = 0; i < MAX_DIMENSION_COUNT; ++i) {
+		int iRow = i + 1;
+
+		m_gridCameraList.SetItemText(iRow, 0, SET_INS_DIMENSION[i]);
+		m_gridCameraList.SetItemState(iRow, 0, GVIS_READONLY);
+
+		str.Format(_T("%.10f"), profile.m_dConvResolution[i][0]);
+		m_gridCameraList.SetItemText(iRow, 1, str);
+
+		str.Format(_T("%.10f"), profile.m_dConvResolution[i][1]);
+		m_gridCameraList.SetItemText(iRow, 2, str);
+
+		str.Format(_T("%.10f"), profile.m_dScanResolution[i][0]);
+		m_gridCameraList.SetItemText(iRow, 3, str);
+
+		str.Format(_T("%.10f"), profile.m_dScanResolution[i][1]);
+		m_gridCameraList.SetItemText(iRow, 4, str);
+	}
+
+	m_gridCameraList.Invalidate();
+}
+
+void CDlgCoordinateConvert::DoDataExchange(CDataExchange* pDX)
+{
+	CDialogEx::DoDataExchange(pDX);
+	DDX_Control(pDX, IDC_CAMERA_LIST, m_gridCameraList);
+	DDX_Text(pDX, IDC_EDIT_CAMERA_COUNT, m_nCameraCount);
+	DDX_Text(pDX, IDC_EDIT_SCAN_COUNT, m_nScanCount);
+}
+
+BEGIN_MESSAGE_MAP(CDlgCoordinateConvert, CDialogEx)
+END_MESSAGE_MAP()
+
+BEGIN_EVENTSINK_MAP(CDlgCoordinateConvert, CDialogEx)
+	ON_EVENT(CDlgCoordinateConvert, IDC_BTN_CONVERT_APPLY, DISPID_CLICK, CDlgCoordinateConvert::OnClickBtnConvertApply, VTS_NONE)
+	ON_EVENT(CDlgCoordinateConvert, IDC_BTN_CONVERT_CLOSE, DISPID_CLICK, CDlgCoordinateConvert::OnClickBtnConvertClose, VTS_NONE)
+END_EVENTSINK_MAP()
+
+// CDlgCoordinateConvert 娑堟伅澶勭悊绋嬪簭
+
+BOOL CDlgCoordinateConvert::OnInitDialog()
+{
+	CDialogEx::OnInitDialog();
+
+	// TODO:  鍦ㄦ娣诲姞棰濆鐨勫垵濮嬪寲
+	m_nCameraCount = g_pBase->m_nCameraCount;
+	m_nScanCount = g_pBase->m_nScanCount;
+
+	InitCameraGrid();
+	FillCameraGrid();
+
+	UpdateData(FALSE);
+
+	return TRUE;  // return TRUE unless you set the focus to a control
+	// 寮傚父: OCX 灞炴�ч〉搴旇繑鍥� FALSE
+}
+
+void CDlgCoordinateConvert::OnClickBtnConvertApply()
+{
+	if (m_pDlgRecipe != nullptr) {
+		for (int i = 0; i < MAX_DIMENSION_COUNT; ++i) {
+			int iRow = i + 1;
+
+			CString strVal;
+			strVal = m_gridCameraList.GetItemText(iRow, 1);
+			m_pDlgRecipe->m_ProfilePrm.m_dConvResolution[i][0] = _tstof(strVal);
+
+			strVal = m_gridCameraList.GetItemText(iRow, 2);
+			m_pDlgRecipe->m_ProfilePrm.m_dConvResolution[i][1] = _tstof(strVal);
+
+			strVal = m_gridCameraList.GetItemText(iRow, 3);
+			m_pDlgRecipe->m_ProfilePrm.m_dScanResolution[i][0] = _tstof(strVal);
+
+			strVal = m_gridCameraList.GetItemText(iRow, 4);
+			m_pDlgRecipe->m_ProfilePrm.m_dScanResolution[i][1] = _tstof(strVal);
+		}
+	}
+
+	this->EndDialog(IDOK);
+}
+
+void CDlgCoordinateConvert::OnClickBtnConvertClose()
+{
+	this->EndDialog(IDCANCEL);
+}
\ No newline at end of file
diff --git a/ENRIT/View/DlgCoordinateConvert.h b/ENRIT/View/DlgCoordinateConvert.h
new file mode 100644
index 0000000..8641015
--- /dev/null
+++ b/ENRIT/View/DlgCoordinateConvert.h
@@ -0,0 +1,40 @@
+锘�#pragma once
+#include "afxdialogex.h"
+#include "GlassRecipe.h"
+
+// CDlgCoordinateConvert 瀵硅瘽妗�
+
+class CDlgCoordinateConvert : public CDialogEx
+{
+	DECLARE_DYNAMIC(CDlgCoordinateConvert)
+
+public:
+	CDlgCoordinateConvert(CWnd* pParent = nullptr);   // 鏍囧噯鏋勯�犲嚱鏁�
+	virtual ~CDlgCoordinateConvert();
+
+	// 璁剧疆閰嶆柟
+	void SetRecipe(CGlassRecipe* pRecipe);
+
+// 瀵硅瘽妗嗘暟鎹�
+#ifdef AFX_DESIGN_TIME
+	enum { IDD = IDD_DLG_COORD_CONVERT };
+#endif
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 鏀寔
+	virtual BOOL OnInitDialog();
+	afx_msg void OnClickBtnConvertApply();
+	afx_msg void OnClickBtnConvertClose();
+	DECLARE_MESSAGE_MAP()
+	DECLARE_EVENTSINK_MAP()
+
+private:
+	void InitCameraGrid();
+	void InitCameraGridHeader();
+	void FillCameraGrid();
+
+	int m_nCameraCount;
+	int m_nScanCount;
+	CGridCtrl m_gridCameraList;
+	CGlassRecipe* m_pDlgRecipe;
+};
diff --git a/ENRIT/View/ViewRecipeProfileView.cpp b/ENRIT/View/ViewRecipeProfileView.cpp
index 1877287..50214a1 100644
--- a/ENRIT/View/ViewRecipeProfileView.cpp
+++ b/ENRIT/View/ViewRecipeProfileView.cpp
@@ -6,6 +6,7 @@
 #include "ViewRecipeProfileView.h"
 #include "afxdialogex.h"
 #include "Global_Define.h"
+#include "DlgCoordinateConvert.h"
 
 // CViewRecipeProfileView 措拳 惑磊涝聪促.
 
@@ -147,17 +148,15 @@
 	CDialogEx::DoDataExchange(pDX);
 }
 
-
 BEGIN_MESSAGE_MAP(CViewRecipeProfileView, CDialogEx)
 	ON_WM_SHOWWINDOW()
 END_MESSAGE_MAP()
 
 BEGIN_EVENTSINK_MAP(CViewRecipeProfileView, CDialogEx)
-	
+	ON_EVENT(CViewRecipeProfileView, IDC_BTN_PROFILE_TEST_RUN, DISPID_CLICK, CViewRecipeProfileView::ClickChkButProfileTestRun, VTS_NONE)
+	ON_EVENT(CViewRecipeProfileView, IDC_BTN_PROFILE_COORDINATE_CONVERT, DISPID_CLICK, CViewRecipeProfileView::ClickChkButCoordinateConvert, VTS_NONE)
 	ON_EVENT(CViewRecipeProfileView, IDC_BTN_PROFILE_MAKECAD, DISPID_CLICK, CViewRecipeProfileView::ClickChkButMakeCAD, VTS_NONE)
 	ON_EVENT(CViewRecipeProfileView, IDC_BTN_PROFILE_APPLY, DISPID_CLICK, CViewRecipeProfileView::ClickChkButProfileApplay, VTS_NONE)
-	ON_EVENT(CViewRecipeProfileView, IDC_BTN_PROFILE_TEST_RUN, DISPID_CLICK, CViewRecipeProfileView::ClickChkButProfileTestRun, VTS_NONE)
-
 END_EVENTSINK_MAP()
 
 BOOL CViewRecipeProfileView::OnInitDialog()
@@ -218,6 +217,36 @@
 	}
 
 	return CDialog::PreTranslateMessage(pMsg);
+}
+
+void CViewRecipeProfileView::ClickChkButProfileTestRun()
+{
+	if (m_pProfileProc == NULL)
+		return;
+
+	CString			str = _T("C:\\RCutProject\\Profile\\TEST5_B.prf");
+
+	m_pProfileProc->ReadProfileData(str);
+
+	CPoint		ptFirst, ptSecond;
+
+	ptFirst = CPoint(2160, 32512);
+	ptSecond = CPoint(2186, 66030);
+
+	//m_pProfileProc->RotateProfileData(ptFirst,ptSecond);
+}
+
+void CViewRecipeProfileView::ClickChkButCoordinateConvert()
+{
+	if (m_pProfileProc == NULL || m_pDlgRecipe == NULL) {
+		return;
+	}
+
+	CDlgCoordinateConvert dlg;
+	dlg.SetRecipe(m_pDlgRecipe);
+	if (dlg.DoModal() == IDOK) {
+		g_pLog->DisplayMessage(_T("User applied coordinate conversion!"));
+	}
 }
 
 void CViewRecipeProfileView::ClickChkButMakeCAD()
@@ -307,6 +336,10 @@
 	SetSlashText(GLOBAL_DEFINE::emHide, _T(""), RGB(0,0,0));
 }
 
+void CViewRecipeProfileView::ClickChkButProfileApplay()
+{
+	UpdateData(TRUE);
+}
 
 void CViewRecipeProfileView::OnShowWindow(BOOL bShow, UINT nStatus)
 {
@@ -314,29 +347,6 @@
 	{
 		UpdateData(FALSE);				
 	}
-}
-
-void CViewRecipeProfileView::ClickChkButProfileApplay()
-{
-	UpdateData(TRUE);
-}
-
-void CViewRecipeProfileView::ClickChkButProfileTestRun()
-{
-	if(m_pProfileProc == NULL)
-		return;
-
-	CString			str=_T("C:\\RCutProject\\Profile\\TEST5_B.prf");
-
-	m_pProfileProc->ReadProfileData(str);
-
-	CPoint		ptFirst,ptSecond;
-
-	ptFirst = CPoint(2160,32512);
-	ptSecond = CPoint(2186,66030);
-
-	//m_pProfileProc->RotateProfileData(ptFirst,ptSecond);
-
 }
 
 void CViewRecipeProfileView::SetRecipe(CHardwareSettings *pHW,CGlassRecipe *pRecipe)
diff --git a/ENRIT/View/ViewRecipeProfileView.h b/ENRIT/View/ViewRecipeProfileView.h
index b93219e..4c3bced 100644
--- a/ENRIT/View/ViewRecipeProfileView.h
+++ b/ENRIT/View/ViewRecipeProfileView.h
@@ -24,9 +24,10 @@
 
 protected:
 	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 瘤盔涝聪促.
+	void		 ClickChkButProfileTestRun();
+	void		 ClickChkButCoordinateConvert();
 	void		 ClickChkButMakeCAD();
 	void		 ClickChkButProfileApplay();
-	void		ClickChkButProfileTestRun();
 	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
 	virtual BOOL OnInitDialog();
 	virtual BOOL PreTranslateMessage(MSG* pMsg);
@@ -45,7 +46,7 @@
 protected:
 	CProfileCADProc			*m_pProfileProc;
 	CHardwareSettings		*m_pHardware;
-	CGlassRecipe		*m_pDlgRecipe;
+	CGlassRecipe			*m_pDlgRecipe;
 	CSplash					m_splash;
 	CMFCButton				m_chkProfileUse[MAX_PROFILE_SETTING_COUNT];
 	CFontControl			m_FontControl;
diff --git a/ENRIT/View/ViewRecipeSetting.cpp b/ENRIT/View/ViewRecipeSetting.cpp
index e271935..ff1fd48 100644
--- a/ENRIT/View/ViewRecipeSetting.cpp
+++ b/ENRIT/View/ViewRecipeSetting.cpp
@@ -314,7 +314,7 @@
 		return;
 	}
 
-	SetButtonSelectSel(eSelView,FALSE);
+	SetButtonSelectSel(eSelView, FALSE);
 
 	ChangeSelectView(nViewID);
 }
@@ -459,7 +459,7 @@
 
 		InitScrollInfo();
 
-		UINT		eViewID[] = {IDC_RDO_RCP_INSPECT_SETTING,IDC_RDO_RCP_PROFILE_SETTING};
+		UINT eViewID[] = { IDC_RDO_RCP_INSPECT_SETTING, IDC_RDO_RCP_PROFILE_SETTING, IDC_RDO_RCP_CHAMFER_SETTING };
 
 		ChangeRcpView(eViewID[m_nCndSelect]);
 	}

--
Gitblit v1.9.3