From bdf0dc4cb183d3fec40e1d51b3bb94b7e53d0a55 Mon Sep 17 00:00:00 2001
From: chenluhua1980 <Chenluhua@qq.com>
Date: 星期日, 04 一月 2026 10:45:07 +0800
Subject: [PATCH] 1.修复报文字段差异风险: S1F3:项目用 getSubItemU4(0) 取 SVID;日志里有 U2 的情况,可能导致解析失败后回退成 SV=0。 S6F11:项目发送 DATAID(U4) + CEID(U4);日志样例里第一个字段是 U2,可能存在类型/字段定义不一致。

---
 SourceCode/Bond/BoounionPLC/PlcView.h |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/BoounionPLC/PlcView.h b/SourceCode/Bond/BoounionPLC/PlcView.h
index da44c6d..27a3e52 100644
--- a/SourceCode/Bond/BoounionPLC/PlcView.h
+++ b/SourceCode/Bond/BoounionPLC/PlcView.h
@@ -1,7 +1,28 @@
 #pragma once
 #include "CBaseView.h"
+#include "BlButton.h"
 #include "PLC.h"
 
+// BUTTON控件
+#define BTN_MAX			7
+#define BTN_RUN			0 // 启动
+#define BTN_AUTO		1 // 自动
+#define BTN_PUASE		2 // 暂停
+#define BTN_MANUAL		3 // 手动
+#define BTN_MUTE		4 // 静音
+#define BTN_OPR			5 // 复位
+#define BTN_STOP		6 // 停止
+
+// 操作类型
+enum class OperationType {
+	RUN = 0,			// 启动
+	AUTO,				// 自动
+	PUASE,				// 暂停
+	MANUAL,				// 手动
+	MUTE,			    // 静音
+	OPR,				// 复位
+	STOP				// 停止
+};
 
 class CPlcView :public CBaseView
 {
@@ -19,11 +40,21 @@
 	void Resize();
 
 private:
+	void SetButtonBackgroundColors(CBlButton* btn, bool bOff);
+	void HandleOperation(OperationType eOpType);
+	void WriteOperationDataToPLC(OperationType eOpType, bool bPressed);
+
+private:
 	COLORREF m_crBkgnd;
 	HBRUSH m_hbrBkgnd;
 	IObserver* m_pObserver;
 	CPLC* m_pPlc;
 
+private:
+	// 控件
+	CBlButton* m_pBlBtns[BTN_MAX];
+	COLORREF m_crPlcNameBack;
+	HBRUSH m_hbrPlcName;
 
 	// 对话框数据
 #ifdef AFX_DESIGN_TIME
@@ -39,5 +70,14 @@
 	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
 	afx_msg void OnDestroy();
 	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnClose();
+	afx_msg void OnBnClickedButtonActivate();
+	afx_msg void OnBnClickedButtonAuto();
+	afx_msg void OnBnClickedButtonPuase();
+	afx_msg void OnBnClickedButtonManualOperation();
+	afx_msg void OnBnClickedButtonSoundOff();
+	afx_msg void OnBnClickedButtonResetting();
+	afx_msg void OnBnClickedButtonStop();
+	afx_msg void OnTimer(UINT_PTR nIDEvent);
 };
 

--
Gitblit v1.9.3