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