From 8d55ed4a167d9b09d65e4a26ece287c6e37a9c84 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 12 九月 2025 10:58:58 +0800
Subject: [PATCH] 1. 修复SG精度检编辑框修改覆盖问题(界面频繁刷新导致)

---
 SourceCode/Bond/SGMeasurement/SGMeasurementDlg.cpp |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.cpp b/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.cpp
index 4f7a030..28b1a27 100644
--- a/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.cpp
+++ b/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.cpp
@@ -994,11 +994,21 @@
 		RC nRet = SGIF_GetCalcDataALL(DeviceID, value);
 		if (nRet == RC_OK) {
 			for (int i = 0; i < 4; ++i) {
-				m_dOutValues[i] = value[i].Value;
-			}
+				double dNew = value[i].Value;
+				if (fabs(m_dOutValues[i] - dNew) > 1e-6) {
+					m_dOutValues[i] = dNew;
 
-			// 鏇存柊缁戝畾鎺т欢
-			UpdateData(FALSE);
+					CString str;
+					str.Format(_T("%.3f"), dNew);
+
+					switch (i) {
+					case 0: GetDlgItem(IDC_EDIT_OUT1)->SetWindowText(str); break;
+					case 1: GetDlgItem(IDC_EDIT_OUT2)->SetWindowText(str); break;
+					case 2: GetDlgItem(IDC_EDIT_OUT3)->SetWindowText(str); break;
+					case 3: GetDlgItem(IDC_EDIT_OUT4)->SetWindowText(str); break;
+					}
+				}
+			}
 		}
 		else {
 			CString strError;

--
Gitblit v1.9.3