|
|
|
@ -1276,9 +1276,10 @@ namespace SlnMesnac.WCS.WCS
|
|
|
|
int suppleTaskCount = sqlSugarClient.Queryable<WcsTask>().Where(x => x.TaskType == StaticTaskType.SupplySmallPalletFromTonerTask || x.TaskType == StaticTaskType.SupplySmallPalletTask).Count();
|
|
|
|
int suppleTaskCount = sqlSugarClient.Queryable<WcsTask>().Where(x => x.TaskType == StaticTaskType.SupplySmallPalletFromTonerTask || x.TaskType == StaticTaskType.SupplySmallPalletTask).Count();
|
|
|
|
int totalTaskCount = sqlSugarClient.Queryable<WcsTask>().Count();
|
|
|
|
int totalTaskCount = sqlSugarClient.Queryable<WcsTask>().Count();
|
|
|
|
int work2EmptyAmount = workShop2Plc.readInt16ByAddress(StaticData.GetPlcAddress("2#缓存链条线库存数"));
|
|
|
|
int work2EmptyAmount = workShop2Plc.readInt16ByAddress(StaticData.GetPlcAddress("2#缓存链条线库存数"));
|
|
|
|
int work2BusyFlag = workShop2Plc.readInt16ByAddress(StaticData.GetPlcAddress("2#线体忙碌状态"));
|
|
|
|
int work2LineBusyFlag = workShop2Plc.readInt16ByAddress(StaticData.GetPlcAddress("2#缓存空箱线体状态"));
|
|
|
|
if (work3EmptyAmount == 0 && totalTaskCount < 3 && suppleTaskCount == 1 && work2BusyFlag == 0 && work2EmptyAmount > 0)
|
|
|
|
if (work3EmptyAmount == 0 && totalTaskCount < 3 && suppleTaskCount == 1 && work2LineBusyFlag == 0 && work2EmptyAmount > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
workShop2Plc.writeInt16ByAddress(StaticData.GetPlcAddress("2#缓存空箱线体状态"), 1);
|
|
|
|
WcsTask task = new WcsTask();
|
|
|
|
WcsTask task = new WcsTask();
|
|
|
|
task.TaskType = StaticTaskType.SupplySmallPalletTask;
|
|
|
|
task.TaskType = StaticTaskType.SupplySmallPalletTask;
|
|
|
|
task.CurrPointNo = "2DeliverMetrologyRoomPoint";
|
|
|
|
task.CurrPointNo = "2DeliverMetrologyRoomPoint";
|
|
|
|
@ -1295,11 +1296,11 @@ namespace SlnMesnac.WCS.WCS
|
|
|
|
wcsTaskLog.Id = id;
|
|
|
|
wcsTaskLog.Id = id;
|
|
|
|
sqlSugarClient.Insertable(wcsTaskLog).ExecuteCommand();
|
|
|
|
sqlSugarClient.Insertable(wcsTaskLog).ExecuteCommand();
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
workShop2Plc.writeInt16ByAddress(StaticData.GetPlcAddress("2#线体忙碌状态"), 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
|
|
|
|
workShop2Plc.writeInt16ByAddress(StaticData.GetPlcAddress("2#缓存空箱线体状态"), 0);
|
|
|
|
_logger.Error($"3#车间从2#接驳位补充小托盘任务生成提交事务异常{ex.Message}");
|
|
|
|
_logger.Error($"3#车间从2#接驳位补充小托盘任务生成提交事务异常{ex.Message}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_logger.Agv($"生成{task.TaskName},起点:{task.CurrPointNo},终点:{task.EndPointNo}");
|
|
|
|
_logger.Agv($"生成{task.TaskName},起点:{task.CurrPointNo},终点:{task.EndPointNo}");
|
|
|
|
|