提交代码
This commit is contained in:
@ -56,6 +56,7 @@ namespace WCS.BLL.HardWare
|
||||
public int RowCounts { get; set; }
|
||||
public int ColumnCounts { get; set; }
|
||||
public Mode CurrentMode { get; set; }
|
||||
|
||||
public DateTime SetCurrentModeTime { get; set; }
|
||||
public string ModulesStr { get; set; }//当前货架所有模组的Str
|
||||
public string GroupName { get; set; }
|
||||
@ -95,7 +96,6 @@ namespace WCS.BLL.HardWare
|
||||
/// </summary>
|
||||
public List<ProcessingExceptionType> ProcessingExceptions { get; set; } = new List<ProcessingExceptionType>();
|
||||
public string? CurrentCom { get; set; } = string.Empty;
|
||||
//TODO 退出入库清除
|
||||
|
||||
public MatInfoResponse InStoreData { get; set; }
|
||||
|
||||
@ -119,6 +119,7 @@ namespace WCS.BLL.HardWare
|
||||
{
|
||||
try
|
||||
{
|
||||
Logs.Write($"[GoInInstore IPAddress]{IPAddress}", LogsType.Instore);
|
||||
if (this.CurrentMode == Mode.入库模式)
|
||||
{
|
||||
CurrentCom = IPAddress;
|
||||
@ -217,6 +218,7 @@ namespace WCS.BLL.HardWare
|
||||
WarningLight.BlueLight(TcpCleint);
|
||||
//绑定当前进入入库PDA/WCS前端的IP
|
||||
CurrentCom = IPAddress;
|
||||
Logs.Write($"[GoInInstore CurrentCom]{CurrentCom}", LogsType.Instore);
|
||||
//返回成功
|
||||
return;
|
||||
}
|
||||
@ -866,6 +868,15 @@ namespace WCS.BLL.HardWare
|
||||
}
|
||||
}
|
||||
|
||||
public void CalibrationSetOffset(int moduleId, int offSet)
|
||||
{
|
||||
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
|
||||
if (moudle != null)
|
||||
{
|
||||
moudle.CalibrationSetOffset(offSet, TcpCleint);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCurrentMode(Mode mode)
|
||||
{
|
||||
this.CurrentMode = mode;
|
||||
@ -891,11 +902,62 @@ namespace WCS.BLL.HardWare
|
||||
{
|
||||
try
|
||||
{
|
||||
OrderNumber = "自检中...";
|
||||
if (CurrentMode == Mode.待机模式)
|
||||
OrderNumber = "自检中...";
|
||||
foreach (var module in Modules.Where(t => t.IsEnable).ToList())
|
||||
{
|
||||
module.IsSelfCheck = true;
|
||||
module.ShelfCheck(TcpCleint);
|
||||
}
|
||||
|
||||
//状态校验 自检模式未响应
|
||||
Task.Run(() =>
|
||||
{
|
||||
var timeOut = 3000;
|
||||
var timeSpan = TimeSpan.FromMilliseconds(0);
|
||||
var beginTime = DateTime.Now;
|
||||
while (timeSpan <= TimeSpan.FromMilliseconds(timeOut))
|
||||
{
|
||||
timeSpan = DateTime.Now - beginTime;
|
||||
//所有板子成功进入入库模式 表示进入入库模式成功,跳出循环
|
||||
var isSelfChecking = Modules.Where(t => t.IsSelfCheck)
|
||||
.Where(t => t.IsEnable)
|
||||
.Any();
|
||||
if (!isSelfChecking)
|
||||
{
|
||||
break;
|
||||
}
|
||||
//循环延时处理
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
|
||||
var notReturnList = Modules.Where(t => t.IsSelfCheck)
|
||||
.Where(t => t.IsEnable).ToList();
|
||||
|
||||
if (notReturnList.Count > 0)
|
||||
{
|
||||
Logs.Write($"货架{ShelfCode}存在模组自检未响应:", LogsType.Instore);
|
||||
foreach (var item in notReturnList)
|
||||
{
|
||||
ExceptionMessages.Add($"模组{item.ModuleCode}未响应自检!");
|
||||
}
|
||||
//通信校验
|
||||
var messages = notReturnList.Select(t => $"模组{t.ModuleCode}未响应自检!").ToList();
|
||||
var exceptionMessage = string.Join("\r\n", messages);
|
||||
var warningModel = new WebSocketMessageModel()
|
||||
{
|
||||
IsWarning = false,
|
||||
WarningType = WarningTypeEnum.自检未响应,
|
||||
StoreId = 0,
|
||||
StoreCode = "",
|
||||
ShelfCode = ShelfCode,
|
||||
ShelfId = ShelfId,
|
||||
WarningMessage = exceptionMessage,
|
||||
ClientIp = WebSocketIpAddress,
|
||||
};
|
||||
WarningManager.SendWarning(warningModel);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -903,7 +965,8 @@ namespace WCS.BLL.HardWare
|
||||
}
|
||||
finally
|
||||
{
|
||||
OrderNumber = string.Empty;
|
||||
if (CurrentMode == Mode.待机模式)
|
||||
OrderNumber = string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@ -1211,7 +1274,6 @@ namespace WCS.BLL.HardWare
|
||||
|
||||
if (storeInfo == null)
|
||||
{
|
||||
//TODO 报错
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1219,7 +1281,6 @@ namespace WCS.BLL.HardWare
|
||||
.FirstOrDefault();
|
||||
if (module == null)
|
||||
{
|
||||
//TODO 报错
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1261,7 +1322,7 @@ namespace WCS.BLL.HardWare
|
||||
{
|
||||
module.ComfirmErrInstore(TcpCleint);
|
||||
WarningLight.WaringLightBlueEnd(TcpCleint);
|
||||
//TO DO Logs.Write($"[{guid}]该位置已放置物料!");
|
||||
Logs.Write($"{storeInfo.StoreCode}该位置已放置物料!", LogsType.Instore);
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
@ -1293,7 +1354,7 @@ namespace WCS.BLL.HardWare
|
||||
MatSupplier = this.InStoreData.supplier,
|
||||
|
||||
InstoreTime = DateTime.Now,
|
||||
InstoreUser = ""
|
||||
InstoreUser = this.InStoreData.InstoreUser,
|
||||
};
|
||||
|
||||
//出入库记录表
|
||||
@ -1367,9 +1428,10 @@ namespace WCS.BLL.HardWare
|
||||
.Where(t => t.ShelfId == ShelfId)
|
||||
.Where(t => t.BoardId == boardId && t.LightNumber == lightNumber)
|
||||
.First();
|
||||
//库位未找到
|
||||
if (storeInfo == null)
|
||||
{
|
||||
//TO DO 库位未找到
|
||||
Logs.Write($"【InStoreExceptionReturnProcess】boardId:{boardId},lightNumber{lightNumber},库位未找到 ", LogsType.Instore);
|
||||
return;
|
||||
}
|
||||
//已放物料丢失了 物料多放了 储位恢复正常
|
||||
@ -1421,6 +1483,8 @@ namespace WCS.BLL.HardWare
|
||||
};
|
||||
WarningManager.SendWarning(warningModel);
|
||||
|
||||
WarningLight.WaringLightAlwaysRed(TcpCleint);
|
||||
|
||||
ProcessingExceptions.Add(new ProcessingExceptionType()
|
||||
{
|
||||
BoardId = boardId,
|
||||
@ -1446,6 +1510,8 @@ namespace WCS.BLL.HardWare
|
||||
};
|
||||
WarningManager.SendWarning(warningModel);
|
||||
|
||||
WarningLight.WaringLightAlwaysRed(TcpCleint);
|
||||
|
||||
ProcessingExceptions.Add(new ProcessingExceptionType()
|
||||
{
|
||||
BoardId = boardId,
|
||||
@ -1651,6 +1717,7 @@ namespace WCS.BLL.HardWare
|
||||
var orderMatDetails = DbHelp.db.Queryable<OutOrderMatDetail>()
|
||||
.Where(t => t.OrderId == CurrentOutOrder.Id)
|
||||
.Where(t => t.MatSN == inventoryDetail.MatSN)
|
||||
.Where(t => t.IsSended == false)
|
||||
.First();
|
||||
|
||||
if (orderMatDetails == null)
|
||||
@ -2030,7 +2097,9 @@ namespace WCS.BLL.HardWare
|
||||
WarningMessage = exceptionMessage,
|
||||
ClientIp = WebSocketIpAddress,
|
||||
};
|
||||
|
||||
WarningManager.SendWarning(warningModel);
|
||||
WarningLight.WaringLightAlwaysRed(TcpCleint);
|
||||
|
||||
ProcessingExceptions.Add(new ProcessingExceptionType()
|
||||
{
|
||||
@ -2055,7 +2124,9 @@ namespace WCS.BLL.HardWare
|
||||
WarningMessage = exceptionMessage,
|
||||
ClientIp = WebSocketIpAddress
|
||||
};
|
||||
|
||||
WarningManager.SendWarning(warningModel);
|
||||
WarningLight.WaringLightAlwaysRed(TcpCleint);
|
||||
|
||||
ProcessingExceptions.Add(new ProcessingExceptionType()
|
||||
{
|
||||
@ -2182,6 +2253,16 @@ namespace WCS.BLL.HardWare
|
||||
|
||||
public void SelfCheckProcess(byte[] data, int boardId, int lightNumber)
|
||||
{
|
||||
var module = this.Modules.Where(t => t.BoardId == boardId).FirstOrDefault();
|
||||
if (module == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
module.IsSelfCheck = false;
|
||||
}
|
||||
|
||||
if (data[TcpCleint.PreFixLength + 3] == 0x01)
|
||||
{
|
||||
//比对结果相同
|
||||
|
Reference in New Issue
Block a user