InOutParam.cs 2.7 KB
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
 

namespace OnlineStore.DeviceLibrary
{
    /// <summary>
    /// 出入仓参数(出入库操作时传入的参数类)
    /// </summary>
    public class InOutParam
    {
        public static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        public InOutParam()
        {
            ACStoreP = null;
            this.PosInfo = new InOutPosInfo("", "");
            MoveP = null;   
        }
        
        public InOutParam(InOutPosInfo inoutInfo, LineMoveP linePosition = null)
        {
            ACStoreP = null; ;
            MoveP = linePosition; 
            this.PosInfo = inoutInfo;
        } 
        private ACSquareSPosition ACStoreP = null;

        public ACSquareSPosition GetACPosition()
        {
            try
            {
                if (ACStoreP == null)
                {
                    string posId = PosInfo != null ? PosInfo.PosId : "";
                    ACStoreP = CSVPositionReader<ACSquareSPosition>.GetPositon(posId);
                }
            }
            catch (Exception ex)
            {
                LogUtil.error(log, "出入库获取库位信息GetKTKPosition出错:" + ex.ToString());
            }
            return ACStoreP;
        } 

        public InOutPosInfo PosInfo { get; set; }
        public LineMoveP MoveP { get; set; } 

    } /// <summary>
      /// 夹具编码信息(保存夹具检测到的IO数值,和对应的料仓位置)
      /// </summary>
    public class InOutPosInfo
    {
        public InOutPosInfo(string barcode, string posId, string platew = "", string plateh = "", int shelftype=1)
        {
            this.barcode = barcode;
            this.PosId = posId;
            this.PlateW = platew;
            this.PlateH = plateh;
           
        }

        /// <summary>
        /// 物品二维码
        /// </summary>
        public string barcode { get; set; }
        /// <summary>
        /// 库位号编码
        /// </summary>
        public string PosId { get; set; }
        /// <summary>
        /// 料盘宽
        /// </summary>
        public string PlateW { get; set; }
        /// <summary>
        /// 料盘高
        /// </summary>
        public string PlateH { get; set; }


        /// <summary>
        /// 使用左侧托架=1,还是右侧托架=2
        /// </summary>
        public int ShelfType = 1;
    
        public string ToStr()
        {
            return " barcode[" + barcode + "],PosId [" + PosId + "],plateW [" + PlateW + "],plateH [" + PlateH + "],ShelfLR [" + ShelfType + "]";
        }

    }
}