This commit is contained in:
陶坤
2024-06-25 13:37:23 +08:00
parent 452c434c89
commit bc5b8eae47
2 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -161,15 +162,21 @@ namespace WCS.BLL.Tool
color = 0x00; color = 0x00;
break; break;
} }
byte[] data1 = new byte[8]; byte[] data1 = new byte[8 + 3 * 6];
data1[0] = 0xff; data1[0] = 0xff;
data1[1] = 0x02; data1[1] = 0x02;
data1[2] = 0x00; data1[2] = 0x00;
data1[3] = 0x0a; data1[3] = 0x0a;
data1[4] = (byte)lightid; for (int i = 0; i < 7;i++)
data1[5] = (byte)status; {
data1[6] = color; data1[4 + i * 3] = (byte)(lightid + i);
data1[7] = (byte)beestatus; data1[5 + i * 3] = (byte)status;
data1[6 + i * 3] = color;
}
//data1[4] = (byte)lightid;
//data1[5] = (byte)status;
//data1[6] = color;
data1[25] = (byte)beestatus;
byte[] data2 = Crc16(data1, data1.Length, true); byte[] data2 = Crc16(data1, data1.Length, true);
return data2; return data2;
} }
@ -193,14 +200,20 @@ namespace WCS.BLL.Tool
//入库警示灯短亮(绿色),蜂鸣器鸣叫一次 //入库警示灯短亮(绿色),蜂鸣器鸣叫一次
public static byte[] InstoreWarnLight(int lightid) public static byte[] InstoreWarnLight(int lightid)
{ {
byte[] data1 = new byte[8]; byte[] data1 = new byte[8 + 3 * 6];
data1[0] = 0xff; data1[0] = 0xff;
data1[1] = 0x02; data1[1] = 0x02;
data1[2] = 0x00; data1[2] = 0x00;
data1[3] = 0x0a; data1[3] = 0x0a;
data1[4] = (byte)lightid; for (int i = 0; i < 7; i++)
data1[5] = 0x03; {
data1[6] = 0x02; data1[4 + i * 3] = (byte)(lightid + i);
data1[5 + i * 3] = 0x03;
data1[6 + i * 3] = 0x02;
}
//data1[4] = (byte)lightid;
//data1[5] = 0x03;
//data1[6] = 0x02;
data1[7] = 0x02; data1[7] = 0x02;
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true); byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);
return senddata1; return senddata1;

View File

@ -20,7 +20,6 @@ namespace WebApi
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
WebSoceketManager.InitWebSocket(); WebSoceketManager.InitWebSocket();
DbInit.InitDb(); DbInit.InitDb();