添加报警窗口

出库流程调试、优化
This commit is contained in:
hehaibing-1996
2024-05-05 16:57:20 +08:00
parent d283924ae1
commit 311a695498
44 changed files with 2272 additions and 307 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
@ -24,14 +25,10 @@ namespace WCS.BLL.Manager
foreach (var ip in ips)
{
var tcpCleint = new TCPClient(ip, "192.168.9.183:20003");
//var tcpCleint = new TCPClient("192.168.0.183:20002", "192.168.0.183:20003");
//配置断线重连
tcpCleint.tcpClient.Received += (client, e) =>
{
var clientIpHost = client.IP + ":" + client.Port;
var TcpCleint = TCPClientManager.GetTCPClientByIPHost(clientIpHost);
if (TcpCleint == null)
@ -108,6 +105,30 @@ namespace WCS.BLL.Manager
}
}
public static void InitStatus()
{
Task.Run(() =>
{
try
{
Thread.Sleep(1000);
//给所有板子发复位
TCPClients.ForEach(tcpClient =>
{
//板子复位
new SmartShelfModule() { BoardId = 2047 }.Reset(tcpClient);
//报警灯复位
new WarningLight().CloseLight(tcpClient);
});
}
catch (Exception ex)
{
Logs.Write($"启动时复位异常,{ex.Message}");
}
});
}
public static TCPClient GetTCPClientByIPHost(string IpHost)
{
return TCPClients.Where(t => t.RemoteIPHost == IpHost).FirstOrDefault();