huangxiaoqiang
2025-04-21 2a20cd300ab6d9233a708a0f4558ba3d92c9f0a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using HslCommunication;
using MoYu;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
 
namespace WIDESEAWCS_Tasks.ConveyorLineJob
{
    public class EmptyTrayStationHandler : IStationHandler
    {
        private readonly CommonConveyorLineJob _commonConveyorLineJob;
 
        public EmptyTrayStationHandler(CommonConveyorLineJob commonConveyorLineJob)
        {
            _commonConveyorLineJob = commonConveyorLineJob;
        }
 
        public async Task HandleStationAsync(CommonConveyorLine conveyorLine, Dt_StationManager station, ConveyorLineTaskCommand command, ConveyorLineTaskCommandWrite commandWrite)
        {
            var structs = BitConverter.GetBytes(commandWrite.WriteInteractiveSignal).Reverse().ToArray().ToBoolArray();
            if (structs[0])
            {
                var log = $"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{station.stationChildCode}】空托盘请求扫码入库";
                await _commonConveyorLineJob.LogAndWarn(conveyorLine.DeviceName, log);
                _commonConveyorLineJob.NGRequestTaskInbound(conveyorLine, command, station, 0);
            }
            else
            {
                _commonConveyorLineJob.ConveyorLineSendFinish(conveyorLine, station.stationChildCode, 0, false);
            }
        }
    }
}