From 6e8c851cd0671577522bfb79207fe29335bd7de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Tue, 8 Nov 2022 11:24:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKControl/Main.cs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/HKControl/Main.cs b/HKControl/Main.cs index edbc425..9874308 100644 --- a/HKControl/Main.cs +++ b/HKControl/Main.cs @@ -25,20 +25,25 @@ namespace HKControl /// public bool GetIsSwipe(int CarNum) { - if (!DataModels.ContainsKey(CarNum)) return false; switch (CarNum) { case 1: + if (!DataModels.ContainsKey(1)) return false; return DataModels[1].LeftWindowData.IsSwipe; case 2: + if (!DataModels.ContainsKey(1)) return false; return DataModels[1].RightWindowData.IsSwipe; case 3: + if (!DataModels.ContainsKey(2)) return false; return DataModels[2].LeftWindowData.IsSwipe; case 4: + if (!DataModels.ContainsKey(2)) return false; return DataModels[2].RightWindowData.IsSwipe; case 5: + if (!DataModels.ContainsKey(3)) return false; return DataModels[3].LeftWindowData.IsSwipe; case 6: + if (!DataModels.ContainsKey(3)) return false; return DataModels[3].LeftWindowData.IsSwipe; default: break; @@ -117,17 +122,17 @@ namespace HKControl Thread.Sleep(100); }), $"{item.DeviceNum} 号设备监听", true); - ThreadManage.GetInstance().StartLong(new Action(() => - { - for (int i = 0; i < 6; i++) - { - if (RTrig.GetInstance($"窗口{i + 1}").Start(GetIsComplete(i + 1))) - { - CompleteNotify[i]?.Invoke(); - } - } - Thread.Sleep(100); - }), "完成通知"); + //ThreadManage.GetInstance().StartLong(new Action(() => + //{ + // for (int i = 0; i < 6; i++) + // { + // if (RTrig.GetInstance($"窗口{i + 1}").Start(GetIsComplete(i + 1))) + // { + // CompleteNotify[i]?.Invoke(); + // } + // } + // Thread.Sleep(100); + //}), "完成通知"); }); SiemensDicitonary[item.DeviceNum].Connect(CpuType.S7200Smart, item.IpAddress); @@ -177,9 +182,9 @@ namespace HKControl private void Control(int num, string add) { - HKLog.HKLogImport.WriteInfo($"{num} 号出餐口控制"); + HKLog.HKLogImport.WriteInfo($"地址:{add} {num} 号出餐口控制"); SiemensDicitonary[num].Write(add, true); - Thread.Sleep(1000); + Thread.Sleep(2000); SiemensDicitonary[num].Write(add, false); }