This commit is contained in:
hehaibing-1996
2024-11-12 19:37:47 +08:00
parent 3aa7e09e6a
commit ab53de1796
3 changed files with 33 additions and 6 deletions

View File

@ -122,9 +122,15 @@ namespace WCS.DAL.DbModels
/// <summary>
/// 区域
/// </summary>
[SugarColumn(ColumnName = "area", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)")]
[SugarColumn(ColumnName = "area", Length = 50, IsNullable = false, DefaultValue = "0", ColumnDescription = "货架的区域 用于煤科院按区域灭灯")]
public string Area { get; set; }
/// <summary>
/// 单灯每个库位灯的个数
/// </summary>
[SugarColumn(ColumnName = "single_light_number", IsNullable = false, DefaultValue = "1", ColumnDescription = "单灯货架灯的个数,用于煤科院大库位灯")]
public int SingleLightNumber { get; set; }
/// <summary>
/// 序号
/// </summary>

View File

@ -75,7 +75,10 @@ namespace WCS.BLL.Services.Service
{
var shelfModel = new SingleLightShelfModel();
//报警灯
shelfModel.WarningLightMode = request.LightMode;
if(shelf.LightId > 0)
{
shelfModel.WarningLightMode = request.LightMode;
}
shelfModel.WarningLightColor = request.ColorMode;
shelfModel.WarningBoardId = shelf.LightId;
shelfModel.ClientIp = shelf.ClientIp;
@ -86,6 +89,7 @@ namespace WCS.BLL.Services.Service
BoardId = t.BoardId,
LightMode = request.LightMode,
LightColor = request.ColorMode,
LightNumber = t.SingleLightNumber,
}).ToList();
shelfModels.Add(shelfModel);

View File

@ -376,9 +376,12 @@ namespace WCS.BLL.Tool
{
foreach (var store in shelf.StoreList)
{
var singleLightData = GenerateSingleLightData(store.BoardId, store.LightMode, store.LightColor);
lightCount++;
dataBase = dataBase.Concat(singleLightData).ToArray();
for (int i = 0; i < store.LightNumber; i++)
{
var singleLightData = GenerateSingleLightData(store.BoardId + i, store.LightMode, store.LightColor);
lightCount++;
dataBase = dataBase.Concat(singleLightData).ToArray();
}
}
}
}
@ -408,7 +411,7 @@ namespace WCS.BLL.Tool
{
public string ClientIp { get; set; } = string.Empty;
public int WarningBoardId { get; set; }
public int WarningLightMode { get; set; }
public int WarningLightMode { get; set; } = -1;
public int WarningBuzzerMode { get; set; }
public int WarningLightColor { get; set; }
public List<SingleLightStoreModel> StoreList { get; set; } = new List<SingleLightStoreModel>();
@ -419,6 +422,11 @@ namespace WCS.BLL.Tool
public int BoardId { get; set; }
public int LightMode { get; set; }
public int LightColor { get; set; }
/// <summary>
/// 单灯存在大库位灯 每个库位可能不止一个灯 故加此字段
/// </summary>
public int LightNumber { get; set; } = 1;
}
//单灯货架全部灭灯
@ -433,6 +441,15 @@ namespace WCS.BLL.Tool
dataBase[5] = 0xff;
dataBase[6] = 0x00;
dataBase[7] = 0x00;
//byte[] dataBase = new byte[6];
//dataBase[0] = 0xff;
//dataBase[1] = 0x00;
//dataBase[2] = 0x00;
//dataBase[3] = 0x08;
//dataBase[4] = 0x02;
//dataBase[5] = 0x01;
//dataBase[6] = 0x00;
//dataBase[7] = 0x00;
byte[] dataWithCRC = Crc16(dataBase, dataBase.Length, true);
return dataWithCRC;
}