| | |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using AutoMapper; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Tasks.å¹²èä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public static GMReadData gMReadData = new GMReadData(); |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IMapper _mapper; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper) |
| | | public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper,WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _cacheService = cacheService; |
| | | _routerRepository = routerRepository; |
| | | _mapper = mapper; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | } |
| | | } |
| | | } |
| | | gMReadData.R_GM_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | gMReadData.R_GM_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | gMReadData.R_GM_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | gMReadData.R_GM_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | gMReadData.R_GM_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | gMReadData.R_GM_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string gMData = JsonConvert.SerializeObject(gMReadData); |
| | | _webSocketServer.PublishAllClientPayload(gMData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | else if (existTask != null && existTask.TaskState != (int)TaskStatusEnum.SC_Execute) |
| | | { |
| | | WriteError(commonStackerCrane.DeviceCode, $"ä»»å¡{task.TaskNum}æµ
è´§ä½ä»»å¡{existTask.TaskNum}ä»»å¡ç¶æä¸ä¸ºå åå¾
æ§è¡"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ä»»å¡{task.TaskNum}æµ
è´§ä½ä»»å¡{existTask.TaskNum}ä»»å¡ç¶æä¸ä¸ºå åå¾
æ§è¡"); |
| | | return null; |
| | | } |
| | | else |