| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Common.LoctionEnum; |
| | | using WIDESEA_Common.Tools; |
| | |
| | | { |
| | | if (Interlocked.Exchange(ref _readZTBSignalsoZ_Down, 1) == 0) |
| | | { |
| | | |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | |
| | | //Convert.ToBoolean(plc.ReadValue("R_Feedingrequest".ToString(), SB_Up_Location)); |
| | | if (GYR_RFX) |
| | | { |
| | | |
| | | #region 记录下料请求信号 |
| | | WriteLog.GetLog().Write($"{plc.PLCName}下料请求:{GYR_RFX}---{DateTime.Now}", $"正极涂布下料请求"); |
| | | #endregion |
| | | //找到路由规则(以设备为起点的路由规则) |
| | | List<base_routing_table> Routing_Table = routingRepository.Find(d => d.route_began == SB_Up_Location); |
| | | base_ware_location location_TB = null; |
| | |
| | | if (x == 1) |
| | | { |
| | | agvRepository.Add(agvtask, true); |
| | | WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"生成任务:{agvtask.agv_tasknum},终点货位【{location_TB.upper_code}】状态:托盘光电检测:{location_TB.tpgd},状态:{location_TB.location_state},更新时间:{location_TB.wireless_time}", $"【{TBSB}】下料任务生成"); |
| | | WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】下料任务生成"); |
| | | //WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"生成任务:{agvtask.agv_tasknum},终点货位【{location_TB.upper_code}】状态:托盘光电检测:{location_TB.tpgd},状态:{location_TB.location_state},更新时间:{location_TB.wireless_time}", $"【{TBSB}】下料任务生成"); |
| | | //WriteDBLog.Info($"【{TBSB}】下料任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】下料任务生成"); |
| | | return content.OK(); |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | //WriteLog.Info($"任务生成").Write($"结束时间: {DateTime.Now} 异常信息:{ex.Message} -------------- {Environment.NewLine}", $"任务生成"); |
| | | throw; |
| | | WriteLog.GetLog().Write($"正极涂布下料:{DateTime.Now} --------------{ex}", $"正极涂布下料"); |
| | | } |
| | | finally |
| | | { |
| | | |
| | | Interlocked.Exchange(ref _readZTBSignalsoZ_Down, 0); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |