| | |
| | | 锘縰sing AutoMapper; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using WIDESEAWCS_Tasks.娴嬭瘯鏋朵粨; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly IMapper _mapper; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ITaskService _taskService; |
| | | public static CSJReadData cSJReadData = new CSJReadData(); |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private WebSocketServer _webSocketServer; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper) |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, 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)) |
| | |
| | | } |
| | | } |
| | | } |
| | | cSJReadData.R_CSJ_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | cSJReadData.R_CSJ_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | cSJReadData.R_CSJ_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | cSJReadData.R_CSJ_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | cSJReadData.R_CSJ_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | cSJReadData.R_CSJ_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string cSJData = JsonConvert.SerializeObject(cSJReadData); |
| | | _webSocketServer.PublishAllClientPayload(cSJData); |
| | | } |
| | | } |
| | | catch (Exception ex) |