From 4d9d8d22e3666076988c30afb4e7c6fe365c19aa Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期二, 06 一月 2026 18:53:04 +0800
Subject: [PATCH] 1.修复一个回复错误的问题;

---
 SourceCode/Bond/SGMeasurement/SGMeasurementDlg.h |   68 ++++++++++++++++++++++++++++++++--
 1 files changed, 64 insertions(+), 4 deletions(-)

diff --git a/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.h b/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.h
index 96e570b..a1d8aae 100644
--- a/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.h
+++ b/SourceCode/Bond/SGMeasurement/SGMeasurementDlg.h
@@ -3,6 +3,11 @@
 //
 
 #pragma once
+
+#include "PLCSignalListener.h"
+#include "ProductResultStorage.h"
+
+#include <map>
 #include <vector>
 #include <numeric>
 #include <algorithm>
@@ -49,6 +54,13 @@
 	DECLARE_MESSAGE_MAP()
 
 private:
+	/**
+	 * @brief 閫�鍑虹▼搴忔椂鐨勬竻鐞嗘搷浣溿��
+	 *
+	 * 姝ゅ嚱鏁板湪绋嬪簭閫�鍑哄墠琚皟鐢紝鐢ㄤ簬鎵ц蹇呰鐨勮祫婧愰噴鏀句笌鐘舵�佹仮澶嶏紝
+	 * 鍖呮嫭鏂紑璁惧杩炴帴銆佺Щ闄ゆ墭鐩樺浘鏍囩瓑銆�
+	 * 鏈�缁堥攢姣佷富绐楀彛骞堕��鍑哄簲鐢ㄣ��
+	 */
 	void ExitApplication();
 
 	/**
@@ -85,7 +97,7 @@
 	 * @param content 鏃ュ織鍐呭銆�
 	 * @param color 瀛椾綋棰滆壊锛岄粯璁や负榛戣壊銆�
 	 */
-	void AppendLogLineRichStyled(const CString& content, COLORREF color = RGB(0, 0, 0));
+	void AppendLogLineRichStyled(const CString& strContent, COLORREF color = RGB(0, 0, 0));
 
 	/**
 	 * @brief 楂樹寒鏃ュ織涓墍鏈夊尮閰嶆寚瀹氬瓧绗︿覆鐨勯儴鍒嗐��
@@ -138,14 +150,25 @@
 	 * @param fJumpThreshold 璺冲彉闃堝�硷紝鐢ㄤ簬妫�娴嬫暟鎹殑鏄庢樉鏂偣銆�
 	 * @param nWindow 璺冲彉鍒ゆ柇鐨勫墠鍚庣獥鍙e搴︺��
 	 * @param nValleyMargin valley 鐐逛箣鍚庡灏戜釜鐐逛綔涓哄疄闄呭垏鍓茬偣銆�
-	 * @param nMinGlass1Count 绗竴娈垫渶灏戞湁鏁堢偣鏁伴檺鍒躲��
+	 * @param nMinGlass1Count 鏈�灏戞湁鏁堢偣鏁伴檺鍒躲��
 	 *
 	 * @return true 琛ㄧず鍒囧壊鎴愬姛锛宖alse 琛ㄧず澶辫触锛堜緥濡傛暟鎹笉瓒虫垨鏃犳槑鏄捐烦鍙橈級銆�
 	 */
 	bool SplitGlassSegments(int nOutNo, const std::vector<float>& validData,
 		std::vector<float>& vecGlass1, std::vector<float>& vecGlass2,
-		float fJumpThreshold = 1.0f, int nWindow = 3, int nValleyMargin = 0,
-		int nMinGlass1Count = 10);
+		float fJumpThreshold = 0.2f, int nWindow = 3, int nValleyMargin = 0,
+		int nMinGlassCount = 10);
+
+	/**
+	 * @brief 瀵规暟鎹寜鏁存暟閮ㄥ垎杩涜鍒嗙粍锛屼繚鐣欐暟鎹噺鏈�澶氱殑涓�缁勶紙鎺掗櫎寮傚父/骞叉壈锛夈��
+	 *
+	 * @param nOutNo 杈撳嚭閫氶亾缂栧彿锛岀敤浜庢棩蹇楄褰曘��
+	 * @param vecInput 鍘熷娴偣鏁版嵁锛堝凡瑁佸壀鏃犳晥鍊硷級銆�
+	 * @param vecOutput 杈撳嚭琚繚鐣欑殑涓昏鍒嗙粍鏁版嵁锛堟渶澶氱殑閭g粍锛夈��
+	 *
+	 * @return true 琛ㄧず鎴愬姛杩囨护鍑轰富鍒嗙粍锛宖alse 琛ㄧず鎵�鏈夋暟鎹兘琚繃婊ゆ垨涓虹┖銆�
+	 */
+	bool FilterDominantGroup(int nOutNo, const std::vector<float>& vecInput, std::vector<float>& vecOutput);
 
 	/**
 	 * @brief 浠庤緭鍏ユ暟鎹腑鎻愬彇涓�涓浐瀹氶暱搴︾殑绋冲畾鍖洪棿銆�
@@ -178,10 +201,33 @@
 		const std::vector<float>& vecGlass2,
 		float& fAvg1, float& fAvg2, float& fOffset);
 
+	/**
+	 * @brief 鍒濆鍖栬澶囩鐨勬暟鎹瓨鍌ㄧ紦鍐插尯銆�
+	 *
+	 * 璋冪敤搴曞眰鎺ュ彛娓呴櫎褰撳墠瀛樺偍鍖哄唴瀹癸紝涓烘柊涓�杞殑鏁版嵁閲囬泦鍋氬噯澶囥��
+	 * 蹇呴』鍦ㄨ澶囪繛鎺ユ垚鍔熶笖鏈繘琛屾暟鎹瓨鍌ㄦ椂璋冪敤銆�
+	 *
+	 * @return true 琛ㄧず鍒濆鍖栨垚鍔燂紱false 琛ㄧず澶辫触锛堝彲鑳芥槸璁惧鏈繛鎺ユ垨璋冪敤鎺ュ彛閿欒锛夈��
+	 */
 	bool InitDataStorage();
 
+	/**
+	 * @brief 鍚姩璁惧绔暟鎹噰闆嗗拰瀛樺偍銆�
+	 *
+	 * 璋冪敤姝ゅ嚱鏁板悗璁惧寮�濮嬮噰闆嗗苟缂撳瓨鏁版嵁銆�
+	 * 閫氬父閰嶅悎瑙﹀彂妯″紡杩涜閲囬泦銆�
+	 *
+	 * @return true 琛ㄧず鍚姩鎴愬姛锛沠alse 琛ㄧず鍚姩澶辫触銆�
+	 */
 	bool StartDataStorage();
 
+	/**
+	 * @brief 鍋滄鏁版嵁閲囬泦骞朵粠璁惧鑾峰彇褰撳墠瀛樺偍鏁版嵁銆�
+	 *
+	 * 璋冪敤鍚庤澶囧仠姝㈤噰闆嗭紝骞跺皾璇曡鍙栨寚瀹氱鍙g殑鏁版嵁锛屼緵鍚庣画鍒嗘瀽澶勭悊銆�
+	 *
+	 * @return true 琛ㄧず鍋滄骞惰鍙栨暟鎹垚鍔燂紱false 琛ㄧず澶辫触锛堝璁惧鏈搷搴旀垨鏁版嵁鏃犳晥锛夈��
+	 */
 	bool StopDataStorage();
 
 	/**
@@ -288,4 +334,18 @@
 	 * @brief 鏍囪绋嬪簭鏄惁閫氳繃鎵樼洏鍥炬爣閫�鍑�
 	 */
 	BOOL m_bExitingFromTray;
+
+	// === PLC 淇″彿鐩戝惉鍣� ===
+
+	/**
+	 * @brief PLC 淇″彿鐩戝惉鍣ㄥ疄渚嬶紝鐢ㄤ簬澶勭悊 PLC 淇″彿浜嬩欢
+	 */
+	CPLCSignalListener m_plcListener;
+
+	// === 浜у搧缁撴灉瀛樺偍 ===
+
+	/**
+	 * @brief 浜у搧缁撴灉瀛樺偍瀹炰緥锛岀敤浜庝繚瀛樺拰绠$悊娴嬮噺缁撴灉
+	 */
+	CProductResultStorage m_resultStorage;
 };

--
Gitblit v1.9.3