提交代码

This commit is contained in:
hehaibing-1996
2024-06-29 17:30:54 +08:00
parent 5ea25c477c
commit 344158c722
43 changed files with 1148 additions and 98 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
@ -240,6 +241,52 @@ namespace WCS.BLL.Tool
return senddata1;
}
public static byte[] InstoreLightAndWarnLight(int board_id, int lightid)
{
byte[] data1 = new byte[8 + 3 * 7];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x07;
//库位灯
data1[5] = (byte)board_id;
data1[6] = 0x03;
data1[7] = 0x02;
//7就是带的有蜂鸣器
for (int i = 0; i < 7; i++)
{
data1[8 + i * 3] = (byte)(lightid + i);
data1[9 + i * 3] = 0x03;
data1[10 + i * 3] = 0x02;
}
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);
return senddata1;
}
//出库确认 蜂鸣器鸣叫一次
public static byte[] CommitOutstoreBee(int lightid)
{
byte[] data1 = new byte[5 + 3 * 1];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x07;
data1[5] = (byte)(lightid + 6);
data1[6] = 0x03;
data1[7] = 0x02;
byte[] sendData = Tool.Helper.Crc16(data1, data1.Length, true);
return sendData;
}
/// <summary>
/// 库位灯常亮/关闭
/// </summary>
@ -293,5 +340,20 @@ namespace WCS.BLL.Tool
return data;
}
/// <summary>
/// 返回数据处理
/// </summary>
public static void ReturnDataProcess(TCPClient tcpClient, byte[] returnData)
{
if (returnData[0] == 0xFF && returnData[1] == 0x00 && returnData[3] == 0x08
&& returnData[4] == 0x01 && returnData[5] == 0x06)
{
var sendData = Query();
tcpClient.Send(sendData);
return;
}
}
}
}