| | |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_TaskInfoService; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | |
| | |
| | | private readonly IMapper _mapper; |
| | | private readonly IRgvOperationService _gvOperationService; |
| | | private readonly IEquipmentStatusService _equipmentStatusService; |
| | | //private readonly TaskService _task; |
| | | |
| | | public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IAgvStationService agvStation, IMapper mapper, IRgvOperationService gvOperationService, IEquipmentStatusService equipmentStatusService) |
| | | { |
| | |
| | | _mapper = mapper; |
| | | _gvOperationService = gvOperationService; |
| | | _equipmentStatusService=equipmentStatusService; |
| | | //_task = task; |
| | | } |
| | | |
| | | public async Task Execute(IJobExecutionContext context) |
| | |
| | | |
| | | if (aQMConveyor.DoorRequest == 1 && aQMConveyor.IndicatorStatus == (int)SafetyDoorStatus.YellowBlink2Hz) |
| | | { |
| | | if (aQMConveyor.EmergencyStopStatus == 1) |
| | | if (aQMConveyor.EmergencyStopStatus == 1) //请æ±å¼é¨çå¾
ä»»å¡å®æ |
| | | { |
| | | bool AQMzckm = tasktype == 1 ? GetDeviceAddress.InRGVRGVStepprocess() : GetDeviceAddress.OutRGVRGVStepprocess(); //夿æ¯å¦æè¿ç¨ä»»å¡ |
| | | if (AQMzckm) |
| | |
| | | bool RGVRGV_DWorkingmode = tasktype == 1 ? _gvOperationService.InWriteOutbuttonpause(null).Status : _gvOperationService.WriteOutbuttonpause(null).Status; |
| | | |
| | | bool RGVstate = tasktype == 1 ? GetDeviceAddress.InRGVStatice() : GetDeviceAddress.OutRGVStatice(); //夿æ¯å¦å
¨ä¸ºæå¨ |
| | | if (RGVstate) |
| | | WebResponseContent webResponse = _taskService.StkRunStatus(); |
| | | if (RGVstate && webResponse.Status == true) |
| | | { |
| | | //åå
¥å¼é¨ä¿¡å· |
| | | GetDeviceAddress.WriteSecurityDoorpolice(aGVStation.ChildPosiDeviceCode, "OpenDoor", 1); |
| | |
| | | } |
| | | |
| | | } |
| | | else |
| | | else //æ¥åç«é©¬æåè®¾å¤ |
| | | { |
| | | bool AQMkm = tasktype == 1 ? GetDeviceAddress.InRGVStatice() : GetDeviceAddress.OutRGVStatice(); |
| | | if (AQMkm) |
| | | WebResponseContent webResponse = _taskService.StkRunStatus(); |
| | | |
| | | if (AQMkm && webResponse.Status == true) |
| | | { |
| | | GetDeviceAddress.WriteSecurityDoorpolice(aGVStation.ChildPosiDeviceCode, "OpenDoor", 1); |
| | | } |
| | |
| | | } |
| | | |
| | | //ç«å°ä¿¡å· |
| | | public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder) |
| | | /* public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder) |
| | | { |
| | | DeviceProDTO? deviceProDTO6 = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == kladder |
| | | && x.DeviceProParamName == "HCJ_GoodsStatus" |
| | | && x.DeviceProParamType == "ReadDeviceCommand"); |
| | | if(deviceProDTO6 == null) { return false; } |
| | | |
| | | if (deviceProDTO6.DeviceChildCode == "2016"||deviceProDTO6.DeviceChildCode == "2017"|| deviceProDTO6.DeviceChildCode == "2018"|| deviceProDTO6.DeviceChildCode == "2019" |
| | | || deviceProDTO6.DeviceChildCode == "1001"|| deviceProDTO6.DeviceChildCode == "1002") |
| | | { |
| | | var value1 = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress); |
| | | //å»¶æ¶5ç§ |
| | | System.Threading.Thread.Sleep(5000); |
| | | var value2 = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress); |
| | | if (value1 != value2 && (value1 !=0 && value2 !=0)) { return false; }; |
| | | return true; |
| | | } |
| | | var value = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress); |
| | | |
| | | if (value == 0) { return true; } |
| | | return false; |
| | | }*/ |
| | | |
| | | |
| | | |
| | | //ç«å°ä¿¡å· |
| | | public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder) |
| | | { |
| | | DeviceProDTO? deviceProDTO = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == kladder |
| | | && x.DeviceProParamName == "HCJ_GoodsStatus" |
| | | && x.DeviceProParamType == "ReadDeviceCommand"); |
| | | // è¿äºç«å°éè¦âå»¶æ¶5ç§å¹¶æ¯è¾ç¬¬ä¸æ¬¡ä¸æå䏿¬¡ç»æâ |
| | | bool isPlatformCode = |
| | | kladder == "2016" || kladder == "2017" || kladder == "2018" || kladder == "2019" || |
| | | kladder == "1001" || kladder == "1002"; |
| | | |
| | | if (isPlatformCode) |
| | | { |
| | | // ç¬¬ä¸æ¬¡è¯»å |
| | | short first = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress); |
| | | |
| | | // å»¶æ¶5ç§ |
| | | System.Threading.Thread.Sleep(5000); |
| | | |
| | | // æå䏿¬¡è¯»å |
| | | short last = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress); |
| | | |
| | | // åè®®ï¼0=æ ä¿¡å·=æ è´§=ç©ºä½ |
| | | return first == 0 && last == 0; |
| | | } |
| | | else |
| | | { |
| | | short value = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress); |
| | | return value == 0; // 0=空ä½å¯æ¾ï¼1=æè´§ä¸å¯æ¾ |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |