Merge remote-tracking branch 'origin/master'

# Conflicts:
#	WCS.BLL/Tool/Helper.cs
This commit is contained in:
hehaibing-1996
2024-06-29 20:06:41 +08:00
2 changed files with 59 additions and 6 deletions

View File

@ -354,5 +354,53 @@ namespace WCS.BLL.Tool
}
}
public static byte[] OutstoreWarnLight_1(int lightid, string lightcolor, int status, int beestatus)
{
byte color = 0x00;
switch (lightcolor)
{
case "红":
color = 0x01;
break;
case "绿":
color = 0x02;
break;
case "黄":
color = 0x03;
break;
case "蓝":
color = 0x04;
break;
case "紫":
color = 0x05;
break;
case "青":
color = 0x06;
break;
case "白":
color = 0x07;
break;
case "无":
color = 0x00;
break;
}
byte[] data1 = new byte[5 + 3 * 6];
data1[0] = 0xff;
data1[1] = 0x01;
data1[2] = 0x00;
data1[3] = (byte)(data1.Length + 2);
data1[4] = 0x06;
for (int i = 0; i < 6; i++)
{
data1[5 + i * 3] = (byte)(lightid + i);
data1[6 + i * 3] = (byte)status;
data1[7 + i * 3] = color;
}
//data1[5 + 3 * 7 - 3] = (byte)(lightid + 6);
//data1[5 + 3 * 7 - 2] =(byte)beestatus;
//data1[5 + 3 * 7 - 1] = 0x00;
byte[] data2 = Crc16(data1, data1.Length, true);
return data2;
}
}
}