From 419c45d4ae0a1815208c101c3e09788ec1698dc2 Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期五, 23 五月 2025 17:28:08 +0800 Subject: [PATCH] 更改任务号等临时编码的生成机制 --- Program.cs | 45 +++++++++++++++++++-------------------------- 1 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Program.cs b/Program.cs index 40608f4..02bf3c6 100644 --- a/Program.cs +++ b/Program.cs @@ -3,16 +3,19 @@ using System.Threading; using System.Threading.Tasks; -using HH.WCS.Mobox3.AnGang.AppStart; -using HH.WCS.Mobox3.AnGang.Devices; +using HH.WCS.Mobox3.AnGang.core; +using HH.WCS.Mobox3.AnGang.device; using Microsoft.Owin.Hosting; using Topshelf; +using Monitor = HH.WCS.Mobox3.AnGang.core.Monitor; + namespace HH.WCS.Mobox3.AnGang { internal class Program { + //[STAThread] // TODO SNAP static void Main(string[] args) { //鍩虹璁剧疆淇℃伅鍒濆鍖�@@ -22,9 +25,12 @@ //2.0 寮�惎tcp StartTcp(); //3.0 寮�惎S7 - StartS7(); + //StartS7(); //4.0 寮�惎Modbus - StartModbus(); + //StartModbus(); + + //寮�惎鐩告満 + StartSnap(); //5.0 寮�惎绾跨▼ var rc = HostFactory.Run(x => @@ -55,7 +61,7 @@ Console.WriteLine("Startup ApiController"); Task.Run(() => { - var url = Settings.Config.WebApiUrl; + var url = Settings.WebApiUrl; Console.WriteLine(url); using (WebApp.Start<Startup>(url)) { @@ -70,8 +76,8 @@ /// </summary> private static void StartTcp() { - var tcpServerIP = Settings.Config.TCPServerIP; - var tcpServerPort = Settings.Config.TCPServerPort; + var tcpServerIP = Settings.TCPServerIP; + var tcpServerPort = Settings.TCPServerPort; new TcpServer(tcpServerIP, tcpServerPort); } @@ -92,18 +98,6 @@ // Console.WriteLine("S7ProductionLineHelper," + item.ProductionLine_IP); // } //} - - ////绉伴噸鐨凷7璁惧 - //var weightPLCDevice = Settings.WeightDevices; - - //if (weightPLCDevice.Count > 0) - //{ - // foreach (var item in weightPLCDevice) - // { - // new S7Helper(item.WeightDevice_IP, (short)item.WeightDevice_Rack, (short)item.WeightDevice_Slot); - // Console.WriteLine("S7WeightDeviceHelper," + item.WeightDevice_Name); - // } - //} } /// <summary> @@ -122,19 +116,18 @@ //} } + private static void StartSnap() { + new SnapManager(Settings.Snaps[0]); + } + public class WorkThread { public void Start() { List<Task> tasks = new List<Task>(); // 娣诲姞浠诲姟鎺ㄩ�绾跨▼ - //tasks.Add(GetTask(WCSCore.Dispatch)); - - ////娣诲姞鑷畾涔夌嚎绋�- //tasks.Add(GetTask(Monitor.CheckEmptyCnt));//妫�祴绌烘墭鐩�- - ////鏍规嵁S7/Modbus鍗忚鍒ゆ柇杈撻�绾跨殑淇″彿 鍘熸潗鏂欎骇绾垮簱鍖�>婊℃墭缂撳瓨搴撳尯锛岀┖鎵樼紦瀛樺簱鍖�>鍘熸潗鏂欎骇绾垮簱鍖�- //tasks.Add(GetTask(Monitor.CheckS7Devices)); + tasks.Add(GetTask(WCSCore.Dispatch)); + //tasks.Add(GetTask(Monitor.CheckCountOrder)); Task.WaitAll(tasks.ToArray()); } -- Gitblit v1.9.1