HYEquip_Config.cs 2.9 KB
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace OnlineStore.LoadCSVLibrary
{
   
    public class HYEquip_Config : DeviceConfig
    {
        public HYEquip_Config()
            : base()
        {
        }
        public HYEquip_Config(int id, string cid, string type, string filepath)
            : base(id, cid, type, filepath)
        {
            IsDebug = 0;
        }
        public void LoadParam()
        {
            if (Id.Equals(202))
            {
                WorkDeviceId = 101;
            }
            else if (Id.Equals(203))
            {
                WorkDeviceId = 101;
            }

            int[] sideIns = new int[] { 201, 203 };
            int[] sideOuts = new int[] { 202, 204};
            int[] lineIns = new int[] { 202, 204};
            int[] lineOuts = new int[] { 209, 211 };
            if (sideIns.Contains(Id))
            {
                IsSideWayIn = true ;
            }
            else if (sideOuts.Contains(Id))
            {
                IsSideWayOut = true ;
            }
            if (lineIns.Contains(Id))
            {
                AtLineIn = true ;
            }
            else if (lineOuts.Contains(Id))
            {
                AtLineOut = true ;
            }
            LineName = "LineA";
            if (Id.Equals(201)|| Id.Equals(204))
            {
                LineName = "LineA";
            }
            else if (Id.Equals(205))
            {
                LineName = "LineB";
            }
        }


        /// <summary>
        /// 设备是否处于调试状态(1=调试,0=正常)
        /// </summary>
        [ConfigProAttribute("IsDebug", false)]
        public int IsDebug { get; set; }

        /// <summary>
        ///  PRO,0,HY所在流水线,LineName,C1,,
        /// </summary>
        [ConfigProAttribute("LineName", false)]
        public string  LineName { get; set; }
        /// <summary>
        ///  PRO,0,HY工位对应的设备,WorkDevice,105,,
        /// </summary>
        [ConfigProAttribute("WorkDeviceId", false)]
        public int  WorkDeviceId { get; set; }
        /// <summary>
        ///  PRO,0,HY是否是托盘横移入口,IsSideWayIn,0,,
        /// </summary>
        [ConfigProAttribute("IsSideWayIn", false)]
        public bool IsSideWayIn { get; set; }
        /// <summary>
        ///  PRO,0,HY是否是托盘横移出口,IsSideWayOut,1,,
        /// </summary>
        [ConfigProAttribute("IsSideWayOut", false)]
        public bool IsSideWayOut { get; set; }
        /// <summary>
        ///  HY是否在线体入口
        /// </summary>
        [ConfigProAttribute("AtLineIn", false)]
        public bool AtLineIn { get; set; }
        /// <summary>
        ///  PRO,0,HY是否在线体出口
        /// </summary>
        [ConfigProAttribute("AtLineOut", false)]
        public bool AtLineOut { get; set; }

    }
}