From 09b864e0e3b793187a606ffd0d829aef9511653a Mon Sep 17 00:00:00 2001
From: duheng <2286773002@qq.com>
Date: 星期二, 18 三月 2025 13:55:51 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0

---
 WinFrmUI/IBox.WinFrmUI/Form/IBoxFormProtocol.cs |   37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormProtocol.cs b/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormProtocol.cs
index d35d1a9..81dc358 100644
--- a/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormProtocol.cs
+++ b/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormProtocol.cs
@@ -1,7 +1,7 @@
 锘�//using CodeProvider;
 using DevExpress.Utils.Extensions;
+using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
-using System.Data;
 using Yw;
 using Yw.WinFrmUI;
 
@@ -9,17 +9,13 @@
 {
     public partial class IBoxFormProtocol : DocumentPage
     {
-        private string startCode = "[&start&]";
-        private string endCode = "[&end&]";
-        private string paramCode = "[&param&]";
-        private string getprotocolCode = "getprotocol";
-        private string saveprotocolCode = "saveprotocol";
+        
         public IBoxFormProtocol()
         {
             this.PageTitle.Caption = "鍗忚閰嶇疆";
             InitializeComponent();
             SetData();
-            
+
         }
         public event EventHandler<string> SendData;
         private void SendText(string content)
@@ -27,8 +23,10 @@
             SendData?.Invoke(null, content);
         }
 
-
-       
+        public void HideButton()
+        {
+            simpleButton1.Visible  = false;
+        }
         private void simpleButton1_Click(object sender, EventArgs e)
         {
             Save();
@@ -40,10 +38,8 @@
         /// </summary>
         public void Save()
         {
-            SendText(startCode + saveprotocolCode + paramCode + JsonHelper.Object2Json(GetData()) + endCode);
-
+            SendText(IBoxHelper.startCode + IBoxHelper.saveprotocolCode + IBoxHelper.paramCode + JsonHelper.Object2Json(GetData()) + IBoxHelper.endCode);
         }
-
         public void SetData()
         {
 
@@ -204,7 +200,7 @@
         private void EboxFormProtocol_Load(object sender, EventArgs e)
         {
             Thread.Sleep(500);
-            SendText(startCode + getprotocolCode + paramCode + endCode);
+            SendText(IBoxHelper.startCode + IBoxHelper.getprotocolCode + IBoxHelper.paramCode + IBoxHelper.endCode);
         }
 
         /// <summary>
@@ -226,14 +222,15 @@
                     stopBits = System.IO.Ports.StopBits.One
                 };
             }
-            if (isBlue) { 
-            this.Invoke(new Action(() =>
+            if (isBlue)
             {
-                var protocols = new dModbus().ProtocolType();
-                var des = protocols.FirstOrDefault(x => x.Value == model.ProtocolType).Key;
-                imageComboBoxEditType.SelectItemByDescription(des);
-                ChangeType(model.ProtocolType, model);
-            }));
+                this.Invoke(new Action(() =>
+                {
+                    var protocols = new dModbus().ProtocolType();
+                    var des = protocols.FirstOrDefault(x => x.Value == model.ProtocolType).Key;
+                    imageComboBoxEditType.SelectItemByDescription(des);
+                    ChangeType(model.ProtocolType, model);
+                }));
             }
             else
             {

--
Gitblit v1.9.3