From f9ee14fbfe22a0a56350580838bb6e4b57f829dc Mon Sep 17 00:00:00 2001 From: 海波 张 <2956280567@qq.com> Date: 星期二, 29 七月 2025 17:28:13 +0800 Subject: [PATCH] 等待交互修改 --- Program.cs | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/Program.cs b/Program.cs index 1e57a87..cf06bf4 100644 --- a/Program.cs +++ b/Program.cs @@ -90,6 +90,9 @@ List<Task> tasks = new List<Task>(); + //灏忚溅鍔ㄤ綔缂撳瓨澶勭悊 + tasks.Add(GetTask1(Monitor.agvActionManage)); + //娣诲姞agv浠诲姟鎺ㄩ�绾跨▼ tasks.Add(GetTask(TaskCore.Dispatch)); @@ -103,7 +106,12 @@ //淇敼浣滀笟鐘舵�(鏍规嵁浣滀笟瀵瑰簲浠诲姟鐨勭姸鎬� tasks.Add(GetTask(Monitor.UpdateWorkState)); + //绌烘墭鑷姩鍑哄簱 + tasks.Add(GetTask(Monitor.ktAuto)); + //鏍规嵁閰嶇疆锛屾瘡闂撮殧澶氬皯鍒嗛挓鎻愰珮澶氬皯浼樺厛绾�+ tasks.Add(GetTask(Monitor.UpdateOutTaskPriority)); + } public void Stop() { Console.WriteLine("work stopped"); } @@ -121,6 +129,26 @@ }); return task; } + + + private Task GetTask1(Action action) + { + var task = Task.Run(() => { + while (true) + { + try + { + action(); + } + catch (Exception ex) + { + LogHelper.Error(ex.Message, ex); + } + Thread.Sleep(200); + } + }); + return task; + } } } } -- Gitblit v1.9.1