| | |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using AutoMapper; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | using HslCommunication.WebSocket; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | public static ZHReadData zHReadData = new ZHReadData(); |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly IMapper _mapper; |
| | | private WebSocketServer _webSocketServer; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper) |
| | | public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper, WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper = mapper; |
| | | _webSocketServer = webSocketServer; |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | zHReadData.R_ZH_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | zHReadData.R_ZH_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | zHReadData.R_ZH_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | zHReadData.R_ZH_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | zHReadData.R_ZH_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | zHReadData.R_ZH_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string zHData = JsonConvert.SerializeObject(zHReadData); |
| | | _webSocketServer.PublishAllClientPayload(zHData); |
| | | } |
| | | } |
| | | catch (Exception ex) |