| | |
| | | /*#region << ç æ¬ 注 é >> |
| | | *//*---------------------------------------------------------------- |
| | | * å½å空é´ï¼WIDESEAWCS_Tasks.ConveyorLineJob |
| | | ---------------------------------------------------------------- |
| | | *å½å空é´ï¼WIDESEAWCS_Tasks.ConveyorLineJob |
| | | * å建è
ï¼è¡ç«¥åº |
| | | * å建æ¶é´ï¼2024/8/2 16:13:36 |
| | | * çæ¬ï¼V1.0.0 |
| | |
| | | * çæ¬ï¼V1.0.1 |
| | | * ä¿®æ¹è¯´æï¼ |
| | | * |
| | | *----------------------------------------------------------------*//* |
| | | #endregion << ç æ¬ 注 é >> |
| | | *---------------------------------------------------------------- |
| | | #endregion << ç æ¬ 注 é >>*/ |
| | | |
| | | using AutoMapper; |
| | | using Newtonsoft.Json; |
| | |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_Model.Models.System; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IMapper _mapper; |
| | | private readonly IDt_PlatformStationService _PlatformStationService; |
| | | |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper) |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, IDt_PlatformStationService dt_PlatformStation) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _routerService = routerService; |
| | | _mapper = mapper; |
| | | _PlatformStationService = dt_PlatformStation; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | Console.Out.WriteLine(DateTime.Now); |
| | | try |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (conveyorLine != null) |
| | | { |
| | | |
| | | /*List<Dt_PlatformStation> childDeviceCodes = _PlatformStationService.getStatiomList(conveyorLine.DeviceCode); |
| | | foreach (Dt_PlatformStation childDeviceCode in childDeviceCodes) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode.Station_code); |
| | | if (command != null) |
| | | { |
| | | DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)); |
| | | if (deviceProtocolDetail != null) |
| | | { |
| | | MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType); |
| | | if (method != null) |
| | | { |
| | | method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode }); |
| | | } |
| | | else |
| | | { |
| | | //todo æªæ¾å°æ¹æ³æ¶ |
| | | } |
| | | } |
| | | } |
| | | //}); |
| | | //tasks.Add(task); |
| | | }*/ |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString()); |
| | | } |
| | | finally |
| | | { |
| | | Console.Out.WriteLine(DateTime.Now); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | */ |