From 2d9272bdcdbdbca81396a61493e4ef6a822dcf4a Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期四, 24 七月 2025 14:21:33 +0800 Subject: [PATCH] 代码提交 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob/CommonRGVJob.cs | 38 ++++++++++++++++++++++---------------- 1 files changed, 22 insertions(+), 16 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob/CommonRGVJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob/CommonRGVJob.cs" index 60de693..1a68bf3 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob/CommonRGVJob.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RGVJob/CommonRGVJob.cs" @@ -82,12 +82,6 @@ CommonRGV commonRGV = (CommonRGV)context.JobDetail.JobDataMap.Get("JobParams"); if (commonRGV != null) { - //if (!commonRGV.IsEventSubscribed) - //{ - // commonRGV.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢 - //} - - //commonRGV.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆� if (commonRGV.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.WorkCompleted)) { var x = commonRGV.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum); @@ -146,16 +140,7 @@ } return Task.CompletedTask; } - /// <summary> - /// 浠诲姟瀹屾垚浜嬩欢璁㈤槄鐨勬柟娉� - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) - { - CommonRGV? commonRGV = sender as CommonRGV; - - } + public void RGVTaskFinish(CommonRGV commonRGV, int TaskNum) { @@ -182,7 +167,9 @@ if (device != null) { CommonConveyorLine conveyorLine = (CommonConveyorLine)device; + //var x = conveyorLine.Communicator.Read<string>("DB1103.16"); Thread.Sleep(100); + var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, stationManager.stationChildCode); if (Barcode == null) @@ -195,6 +182,25 @@ } else { + if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting) + { + Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.TargetAddress&&x.stationType==7); + if (stationManager != null) + { + IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManager.stationPLC); + if (device != null) + { + CommonConveyorLine conveyorLine = (CommonConveyorLine)device; + Thread.Sleep(100); + var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, stationManager.stationChildCode); + conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTargetAddress, Convert.ToInt16(stationManager.stationNextChildCode), stationManager.stationChildCode); + Thread.Sleep(100); + conveyorLine.SetValue(ConveyorLineDBName.ConveyorLineTaskNum, Convert.ToInt16(1000), stationManager.stationChildCode); + Thread.Sleep(100); + conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, Convert.ToSByte(2), stationManager.stationChildCode); + } + } + } var content = _taskService.RGVTaskCompleted(TaskNum); } } -- Gitblit v1.9.3