报警灯
This commit is contained in:
@ -219,8 +219,11 @@ namespace WCS.BLL.HardWare
|
||||
shelfModel.WarningBoardId = shelfInfo.LightId;
|
||||
shelfModel.ClientIp = ClientIp;
|
||||
shelfModel.StoreList = new List<SingleLightStoreModel>();
|
||||
|
||||
Logs.Write($"[单灯后台刷新线程]亮灯任务数量{currentTasks.Count}!");
|
||||
currentTasks.ForEach(task =>
|
||||
{
|
||||
Logs.Write($"[单灯后台刷新线程]亮灯任务{task.ModuleCode}!");
|
||||
var module = MXL4Modules.Where(t => t.ModuleCode == task.ModuleCode).First();
|
||||
if (module != null)
|
||||
{
|
||||
@ -405,6 +408,8 @@ namespace WCS.BLL.HardWare
|
||||
{
|
||||
var tcpClient = TCPClientManager.Service.GetClients().Where(t => t.IP + ":" + t.Port.ToString() == ClientIp).FirstOrDefault();
|
||||
if (tcpClient != null)
|
||||
{
|
||||
lock (tcpClient)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -420,6 +425,8 @@ namespace WCS.BLL.HardWare
|
||||
Message = $"【单灯单独控制】{client}指令发送中遇到异常{ex.Message}",
|
||||
};
|
||||
}
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -352,25 +352,6 @@ namespace WCS.BLL.Tool
|
||||
var lightCount = 0;
|
||||
foreach (var shelf in shelfs)
|
||||
{
|
||||
//6个报警灯需要发送指令
|
||||
|
||||
if (shelf.WarningLightMode != -1)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var singleLightData = GenerateSingleLightData(shelf.WarningBoardId + i, shelf.WarningLightMode, shelf.WarningLightColor);
|
||||
lightCount++;
|
||||
dataBase = dataBase.Concat(singleLightData).ToArray();
|
||||
}
|
||||
}
|
||||
//蜂鸣器需要发送指令
|
||||
if (shelf.WarningLightMode == 3)//单灯短亮一次的情况下 蜂鸣器短鸣一次
|
||||
{
|
||||
var singleLightData = GenerateSingleLightData(shelf.WarningBoardId + 6, 3, shelf.WarningLightColor);
|
||||
lightCount++;
|
||||
dataBase = dataBase.Concat(singleLightData).ToArray();
|
||||
}
|
||||
|
||||
//库位灯指令
|
||||
if (shelf.StoreList != null && shelf.StoreList.Count > 0)
|
||||
{
|
||||
@ -384,6 +365,26 @@ namespace WCS.BLL.Tool
|
||||
}
|
||||
}
|
||||
}
|
||||
//6个报警灯需要发送指令
|
||||
|
||||
if (shelf.WarningLightMode != -1)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
var singleLightData = GenerateSingleLightData(shelf.WarningBoardId + i, shelf.WarningLightMode, shelf.WarningLightColor);
|
||||
lightCount++;
|
||||
dataBase = dataBase.Concat(singleLightData).ToArray();
|
||||
}
|
||||
}
|
||||
//蜂鸣器需要发送指令
|
||||
//if (shelf.WarningLightMode == 3)//单灯短亮一次的情况下 蜂鸣器短鸣一次
|
||||
//{
|
||||
// var singleLightData = GenerateSingleLightData(shelf.WarningBoardId + 6, 3, shelf.WarningLightColor);
|
||||
// lightCount++;
|
||||
// dataBase = dataBase.Concat(singleLightData).ToArray();
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
byte[] length_base = BitConverter.GetBytes(dataBase.Length + 2);
|
||||
|
@ -124,7 +124,8 @@ namespace WCS.WebApi.Controllers
|
||||
if (row == 1)
|
||||
{
|
||||
//之前已经占用的id
|
||||
var id = (shelf.Rowcounts - 1) * (shelf.Columncounts + 7);
|
||||
var id = (shelf.Rowcounts - 1) * (shelf.Columncounts + 6);
|
||||
|
||||
//奇数行 灯Id是最后一个灯
|
||||
for (int i = shelf.Columncounts; i > 0; i--)
|
||||
{
|
||||
@ -177,11 +178,11 @@ namespace WCS.WebApi.Controllers
|
||||
else
|
||||
{
|
||||
//之前已经占用的id
|
||||
var id = (shelf.Rowcounts - 1) * (shelf.Columncounts + 7);
|
||||
var id = (shelf.Rowcounts - 1) * (shelf.Columncounts + 6);
|
||||
shelf.LightId = ++id;
|
||||
|
||||
//灯占7个ID
|
||||
id = id + 6;
|
||||
//灯占6个ID
|
||||
id = id + 5;
|
||||
//奇数行 灯Id是最后一个灯
|
||||
for (int i = 1; i <= shelf.Columncounts; i++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user