From eda0be4ee8c98aebf1e017b51dc5b245a188f1cf Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Wed, 12 Aug 2026 09:53:06 +0800 Subject: [PATCH] 1 --- ViewModel/MainWindowVM.cs | 40 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/ViewModel/MainWindowVM.cs b/ViewModel/MainWindowVM.cs index eb0e629..5af9445 100644 --- a/ViewModel/MainWindowVM.cs +++ b/ViewModel/MainWindowVM.cs @@ -2006,6 +2006,20 @@ namespace ViewModel { if (RunStatu == RunStatuEnum.Normal) { + if (MyPLC != null && MyPLC.PLC != null && MyPLC.PLC.PlcStatus.StatusBackground == ColorStr.Green) + { + if (lockTime.AddSeconds(1) < DateTime.Now) + { + + lockTime = DateTime.Now; + MyPLC.PLC.Write("Y2", true); + Door = "已锁"; + break; + + } + + + } if (!fir) { MyPLC.Conneced(); @@ -2034,20 +2048,7 @@ namespace ViewModel LogicDispatch(LogicDispatchFlow); - if (MyPLC != null && MyPLC.PLC != null && MyPLC.PLC.PlcStatus.StatusBackground == ColorStr.Green) - { - if (lockTime.AddSeconds(1) < DateTime.Now) - { - - lockTime = DateTime.Now; - MyPLC.PLC.Write("Y2", true); - Door = "已锁"; - break; - - } - - - } + } } @@ -3219,16 +3220,7 @@ namespace ViewModel /// public void Start(object per) { - - - if (Door != "已锁") - { - - ExcepStop("请关闭门锁后再启动"); - return; - - } - + if (RunStatu == RunStatuEnum.Normal) { return;