TrayInfo.cs 3.1 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 

namespace OnlineStore.DeviceLibrary
{
    /// <summary>
    /// 托盘信息
    /// </summary>
    public class TrayInfo
    {

        public TrayInfo(int trayNum, bool isFull = false, int inOrOut = 0)
        {
            this.TrayCode = trayNum;
            this.IsFull = isFull;
            this.InOrOutStore = inOrOut;
        }
        public TrayInfo(int trayNum, bool isFull, int inOrOut, string wareCode, string posId, int plateH, int plateW)
        {
            this.TrayCode = trayNum;
            this.IsFull = isFull;
            this.InOrOutStore = inOrOut;
            this.WareCode = wareCode;
            this.PosId = posId;
            this.PlateH = plateH;
            this.PlateW = plateW;
            InStoreNG = false;
            NgMsg = "";
        }
        public string ToStr()
        {
            string type = "无操作";
            if (InOrOutStore.Equals(1))
            {
                type = "入库";
            }
            else
            {
                type = "出库";
            }
            return "托盘【" + TrayCode + "】" + (IsFull ? "有料," : "空,") + type + "," + WareCode + "," + PosId + "," + PlateH + "," + PlateW + "," + InStoreNG + "," + NgMsg;
        }
        /// <summary>
        /// 夹具编码值(1-32?)
        /// </summary>
        public int TrayCode { get; set; }
        /// <summary>
        /// 是否有料盘,true=有料盘
        /// </summary>
        public bool IsFull { get; set; }
        /// <summary>
        /// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
        /// </summary>
        public int InOrOutStore { get; set; }

        /// <summary>
        /// 物品二维码信息
        /// </summary>
        public string WareCode { get; set; }
        /// <summary>
        /// 位置名(对应配置表的位置)
        /// </summary>
        public string PosId { get; set; }
        /// <summary>
        /// 料盘高度
        /// </summary>
        public int PlateH { get; set; }
        /// <summary>
        /// 料盘宽度
        /// </summary>
        public int PlateW { get; set; }
        /// <summary>
        /// 入库失败料盘,未扫到码或获取库位号失败
        /// </summary>
        public bool InStoreNG = false;
        public string NgMsg = "";

        public bool EmergencyOut = false;
    }
    /// <summary>
    /// 托盘上的物料的类型
    /// </summary>
    internal class ReelType
    {
        /// <summary>
        /// 等待入库料盘
        /// </summary>
        internal static  int InStore = 1;

        /// <summary>
        /// 料仓出库料盘
        /// </summary>
        internal static int OutStore = 2;

        /// <summary>
        /// 紧急出库料盘
        /// </summary>
        internal static int OutStore_Equip = 3;

        /// <summary>
        /// 入库失败需要NG气缸退出的料盘
        /// </summary>
        internal static int InStoreNG = 4;
    }
}