| | |
| | | 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; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.Extensions; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Services.IRepositories; |
| | | using WIDESEA_Services.Repositories; |
| | |
| | | { |
| | | if (Interlocked.Exchange(ref _readGFBUPSignalsoF, 1) == 0) |
| | | { |
| | | |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | |
| | | var SBtask = agvRepository.FindFirst(f => f.agv_toaddress == plc.EquipType); |
| | | //有结束本次循环 |
| | | if (SBtask != null) { continue; } |
| | | #region 记录上料请求信号 |
| | | WriteLog.GetLog().Write($"{plc.PLCName}上料请求:{GYR_RFX.Content}---{DateTime.Now}", $"负极棍分上料请求"); |
| | | #endregion |
| | | List<base_routing_table> Routing_Table = routingRepository.Find(d => d.route_end == plc.EquipType); |
| | | List<base_ware_location> loctionList = new List<base_ware_location>(); |
| | | foreach (var item in Routing_Table) |
| | |
| | | if (a==1) |
| | | { |
| | | agvRepository.Add(agvtask, true); |
| | | WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"生成任务:{agvtask.agv_tasknum},起点货位【{Location.upper_code}】状态:托盘光电检测:{Location.tpgd},状态:{Location.location_state},更新时间:{Location.wireless_time}", $"【{TBSB}】上料任务生成"); |
| | | WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】上料任务生成"); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | WriteLog.GetLog().Write($"负极棍分上料:{DateTime.Now} --------------{ex}", $"负极棍分上料调度"); |
| | | } |
| | | finally |
| | | { |
| | | Interlocked.Exchange(ref _readGFBUPSignalsoF, 0); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |