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}】【{station.stationRemark}】空托盘请求扫码入库";
|
await _commonConveyorLineJob.LogAndWarn(conveyorLine.DeviceName, log);
|
_commonConveyorLineJob.NGRequestTaskInbound(conveyorLine, command, station, 0);
|
}
|
else
|
{
|
_commonConveyorLineJob.ConveyorLineSendFinish(conveyorLine, station.stationChildCode, 0, false);
|
}
|
}
|
}
|
}
|