using System.Collections; using WcsMain.Enum.Stacker; namespace WcsMain.EquipOperation.Entity.Stacker; /// /// 写入PLC的任务 ---- 堆垛机 /// public class StackerPlcTask { /// /// 设备号,用于识别写入哪个堆垛机 /// public int? StackerId { get; set; } /// /// 任务号 /// public int? PlcId { get; set; } = 0; /// /// 任务类型 /// public short? TaskType { get; set; } = 0; /// /// 取货站台 /// public short? GetStand { get; set; } = 0; /// /// 入库巷道号 /// public short? InTunnelId { get; set; } = 0; /// /// 出库巷道号 /// public short? OutTunnelId { get; set; } = 0; /// /// 卸货站台 /// public short? SetStand { get; set; } = 0; /// /// 取货排 /// public short? GetQueue { get; set; } = 0; /// /// 取货列 /// public short? GetLine { get; set; } = 0; /// /// 取货层 /// public short? GetLayer { get; set; } = 0; /// /// 卸货排 /// public short? SetQueue { get; set; } = 0; /// /// 卸货列 /// public short? SetLine { get; set; } = 0; /// /// 卸货层 /// public short? SetLayer { get; set; } = 0; /// /// 取货深度 /// public short? GetDeep { get; set; } = 0; /// /// 卸货深度 /// public short? SetDeep { get; set; } = 0; /// /// 尺寸 /// public short? Size { get; set; } = 0; /// /// 重量 /// public short? Weight { get; set; } = 0; /// /// 料箱码 /// public int Code { get; set; } public override string ToString() { return $"PlcId:{PlcId},{GetQueue}排{GetLine}列{GetLayer}层{GetDeep}深 --> {SetQueue}排{SetLine}列{SetLayer}层{SetDeep}深"; } /// /// 默认的直接从入口搬出去的任务 /// /// /// /// /// /// public static StackerPlcTask DefaultErrTask(int plcId, int stackerId, int forkId, int vehicleNo = 999999999) { StackerPlcTask stackerTask = new() { StackerId = stackerId, PlcId = plcId, TaskType = Convert.ToInt16(WcsTaskTypeEnum.moveTask), GetStand = 0, InTunnelId = Convert.ToInt16(stackerId), OutTunnelId = Convert.ToInt16(stackerId), SetStand = 0, GetQueue = 2, GetLine = Convert.ToInt16(forkId), GetLayer = 1, GetDeep = 1, SetQueue = 2, SetLine = Convert.ToInt16(forkId), SetLayer = 3, SetDeep = 1, Size = 0, Weight = 0, Code = vehicleNo, }; return stackerTask; } }