From ed8d469ccdc0e627d8f180bb92a9d78dbdb008b1 Mon Sep 17 00:00:00 2001
From: jace.tang <1536884497@qq.com>
Date: 星期六, 11 二月 2023 21:34:01 +0800
Subject: [PATCH] 调整sizeDetection输出结果的判断

---
 FormPlcOperation.cs |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/FormPlcOperation.cs b/FormPlcOperation.cs
index 1a2d7c4..9fe2695 100644
--- a/FormPlcOperation.cs
+++ b/FormPlcOperation.cs
@@ -25,6 +25,12 @@
 
             _opc.ReadOneItem_Wrapper(OPCOutputTag.PingbiSafeGuard, ref result);
             cbPingbiSafeGuard.Checked = result != null && (bool)result ? true : false;
+
+            this.Load += (s, e) =>
+              {
+                  cbPingbiGuangshan.CheckedChanged += cbPingbiGuangshan_CheckedChanged;
+                  cbPingbiSafeGuard.CheckedChanged += cbPingbiSafeGuard_CheckedChanged;
+              };
         }
 
         private void cbLoadRbtAlarm_CheckedChanged(object sender, EventArgs e)
@@ -54,12 +60,18 @@
 
         private void cbPingbiGuangshan_CheckedChanged(object sender, EventArgs e)
         {
-            _opc.Write(OPCOutputTag.PingbiGuangShan, cbPingbiGuangshan.Checked);
+            if (new ConfigPassword("").ShowDialog() == DialogResult.OK)
+            {
+                _opc.Write(OPCOutputTag.PingbiGuangShan, cbPingbiGuangshan.Checked);
+            }
         }
 
         private void cbPingbiSafeGuard_CheckedChanged(object sender, EventArgs e)
         {
-            _opc.Write(OPCOutputTag.PingbiSafeGuard, cbPingbiSafeGuard.Checked);
+            if (new ConfigPassword("").ShowDialog() == DialogResult.OK)
+            {
+                _opc.Write(OPCOutputTag.PingbiSafeGuard, cbPingbiSafeGuard.Checked);
+            }
         }
     }
 }

--
Gitblit v1.8.0