| | |
| | | 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 _readFTBSignalsoZ, 1) == 0) |
| | | { |
| | | |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | |
| | | var SBtask = agvRepository.FindFirst(f => f.agv_fromaddress == SB_Up_Location || f.agv_toaddress == SB_Up_Location); |
| | | //有结束本次循环 |
| | | if (SBtask != null) { continue; } |
| | | |
| | | #region 记录上料请求信号 |
| | | WriteLog.GetLog().Write($"{plc.PLCName}上料请求:{GYR_RFX}---{DateTime.Now}", $"负极涂布上料请求"); |
| | | #endregion |
| | | //找到对应箔材库货位(36号位置),并确认有料 |
| | | base_ware_location location_36 = locRepository.FindFirst(t => t.upper_code == "FJ-BCHCJ36" && t.location_state == LoctionStateEnum.LocationState_Stored.ToString() && t.status == 1 && t.logic_col == 1 && t.task == 2); |
| | | |
| | |
| | | if (a==1) |
| | | { |
| | | agvRepository.Add(agvtask, true); |
| | | WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"生成任务:{agvtask.agv_tasknum},起点货位【{location_36.upper_code}】状态:托盘光电检测:{location_36.tpgd},状态:{location_36.location_state},更新时间:{location_36.wireless_time}", $"【{TBSB}】上料任务生成"); |
| | | WriteDBLog.Info($"【{TBSB}】上料任务生成").Write($"----------------任务生成成功 {DateTime.Now} -------------- {Environment.NewLine}", $"【{TBSB}】上料任务生成"); |
| | | } |
| | | //WriteLog.GetLog("设备呼叫").Write($"设备{TBSB},呼叫成功,任务{agvtask.agv_tasknum}生成", "设备呼叫"); |
| | | break; |
| | |
| | | |
| | | } |
| | | } |
| | | catch (Exception) |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | WriteLog.GetLog().Write($"负极棍分上料:{DateTime.Now} --------------{ex}", $"负极棍分上料调度"); |
| | | } |
| | | finally |
| | | { |
| | | Interlocked.Exchange(ref _readFTBSignalsoZ, 0); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |