| | |
| | | using WIDESEAWCS_Common.StackerCraneEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IShuttleCar; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_TaskInfoService; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.ShuttleCarJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IShuttleCarService _shuttleCarService; |
| | | private readonly ICacheService _cacheService; |
| | | |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IShuttleCarService shuttleCarService) |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IShuttleCarService shuttleCarService, ICacheService cacheService) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _shuttleCarService = shuttleCarService; |
| | | _cacheService = cacheService; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | if (commonStackerCrane != null) |
| | | { |
| | | commonStackerCrane.Communicator.IsReadAfterWrite = false; |
| | | #region è·åå åæºä¿¡æ¯ |
| | | StackerCraneTaskCommandR common = ReadCustomer<StackerCraneTaskCommandR>(commonStackerCrane, commonStackerCrane.DeviceCode); |
| | | _cacheService.AddOrUpdate(commonStackerCrane.DeviceCode, common); |
| | | #endregion |
| | | #region ä¿¡å·äº¤äºå¤ç |
| | | //Heartbeat(commonStackerCrane); |
| | | ShuttleCarSignal(commonStackerCrane); |
| | |
| | | |
| | | #region ä»»å¡å®æ |
| | | var completeStatus = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.CompleteStatus); |
| | | if (completeStatus == 2 || completeStatus == 3) |
| | | if (common.CompleteStatus == 2 || common.CompleteStatus == 3) |
| | | { |
| | | NormalCompleted(commonStackerCrane); |
| | | } |