From 656f90b301ba307c909de4ee94b88af817adf0d8 Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期一, 14 七月 2025 16:18:22 +0800 Subject: [PATCH] 添加CgDetail信息同步字段和锁状态字段,修改相关逻辑 --- Program.cs | 50 +++++++++++++++++++++++--------------------------- 1 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Program.cs b/Program.cs index 40608f4..84cf1fb 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] // SNAP 娉ㄩ噴璇ヨ淇濈暀鍏朵粬琛屽悗锛岀▼搴忔甯歌繍琛� static void Main(string[] args) { //鍩虹璁剧疆淇℃伅鍒濆鍖�@@ -20,11 +23,14 @@ //1.0 寮�惎api Startup(); //2.0 寮�惎tcp - StartTcp(); + //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,9 +76,9 @@ /// </summary> private static void StartTcp() { - var tcpServerIP = Settings.Config.TCPServerIP; - var tcpServerPort = Settings.Config.TCPServerPort; - new TcpServer(tcpServerIP, tcpServerPort); + //var tcpServerIP = Settings.TCPServerIP; + //var tcpServerPort = Settings.TCPServerPort; + //new TcpServer(tcpServerIP, tcpServerPort); } @@ -90,18 +96,6 @@ // { // new S7Helper(item.ProductionLine_IP, (short)item.ProductionLine_Rack, (short)item.ProductionLine_Slot); // 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); // } //} } @@ -122,19 +116,21 @@ //} } + 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(WCSCore.Dispatch)); + //tasks.Add(GetTask(Monitor.CheckCountOrder)); - ////娣诲姞鑷畾涔夌嚎绋�- //tasks.Add(GetTask(Monitor.CheckEmptyCnt));//妫�祴绌烘墭鐩�- - ////鏍规嵁S7/Modbus鍗忚鍒ゆ柇杈撻�绾跨殑淇″彿 鍘熸潗鏂欎骇绾垮簱鍖�>婊℃墭缂撳瓨搴撳尯锛岀┖鎵樼紦瀛樺簱鍖�>鍘熸潗鏂欎骇绾垮簱鍖�- //tasks.Add(GetTask(Monitor.CheckS7Devices)); + tasks.Add(GetTask(Monitor.InboundDataSync)); + tasks.Add(GetTask(Monitor.OutboundDataSync)); Task.WaitAll(tasks.ToArray()); } -- Gitblit v1.9.1