using System;
using System.Collections.Generic;
using System.Text;

namespace Model
{
    public class MDevice
    {
        string _barcode;
        /// <summary>
        /// 托盘条形码
        /// </summary>
        public string Barcode
        {
            set { _barcode = value; }
            get { return _barcode; }
        }
        int _devindex;
        /// <summary>
        /// 设备唯一索引
        /// </summary>
        public int DeviceIndex
        {
            get { return _devindex; }
            set { _devindex = value; }
        }
        int _deviceKind;
        /// <summary>
        /// 设备类型索引
        /// </summary>
        public int DeviceKind
        {
            get { return _deviceKind; }
            set { _deviceKind = value; }
        }
        int _dbw1address;
        /// <summary>
        /// DB1区的发送数据的起始地址
        /// </summary>
        public int Dbw1Address
        {
            get { return _dbw1address; }
            set { _dbw1address = value; }
        }
        int _dbw1SendLength;
        /// <summary>
        /// DB1区的发送长度
        /// </summary>
        public int Dbw1SendLength
        {
            get { return _dbw1SendLength; }
            set { _dbw1SendLength = value; }
        }
        
        int _dbw2address;
        /// <summary>
        /// DB2区的获取数据的起始地址
        /// </summary>
        public int Dbw2Address
        {
            get { return _dbw2address; }
            set { _dbw2address = value; }
        }
        decimal _dbw2GetLength;
        /// <summary>
        /// DB2区的获取数据的长度
        /// </summary>
        public decimal Dbw2Getlength
        {
            get { return _dbw2GetLength; }
            set { _dbw2GetLength = value; }
        }
        string _devname;
        /// <summary>
        /// 设备名称
        /// </summary>
        public string DeviceName
        {
            get { return _devname; }
            set { _devname = value; }
        }
        int _runstate;
        /// <summary>
        /// 0空闲；1运行；2故障；3离线；4被停用；5动作完成
        /// </summary>
        public int RunState
        {
            get { return _runstate; }
            set { _runstate = value; }
        }
        int _lastrunstate;//20110411
        /// <summary>
        /// 上一次的运行状态
        /// </summary>

        public int LastRunState
        {
            get { return _lastrunstate; }
            set { _lastrunstate = value; }
        }
        bool _havegoods;
        /// <summary>
        /// 是否载货
        /// </summary>
        public bool HaveGoods
        {
            get { return _havegoods; }
            set { _havegoods = value; }
        }
        int _controlmode;
        /// <summary>
        /// 1自动，2半自动，3手动
        /// </summary>
        public int ControlMode
        {
            get { return _controlmode; }
            set { _controlmode = value; }
        }
        int _xcoor;
        /// <summary>
        /// X坐标（列）
        /// </summary>
        public int XCoor
        {
            get { return _xcoor; }
            set { _xcoor = value; }
        }
        int _ycoor;
        /// <summary>
        /// Y坐标（层）
        /// </summary>
        public int YCoor
        {
            get { return _ycoor; }
            set { _ycoor = value; }
        }
        int _zcoor;
        /// <summary>
        /// Z坐标（1，2）排
        /// </summary>
        public int ZCoor
        {
            get { return _zcoor; }
            set { _zcoor = value; }
        }
        int _taskno;
        /// <summary>
        /// 设备指令索引
        /// </summary>
        public int TaskNo
        {
            get { return _taskno; }
            set { _taskno = value; }
        }
        char _ifKeyDevice;
        /// <summary>
        /// 是否为关键设备
        /// </summary>
        public char IfKeyDevice
        {
            get { return _ifKeyDevice; }
            set { _ifKeyDevice = value; }
        }
        int _errorCode=-1;
        /// <summary>
        /// 设备故障代码
        /// </summary>
        public int ErrorCode
        {
            get { return _errorCode; }
            set { _errorCode = value; }
        }
        string _arrowLocation;
        /// <summary>
        /// 设备运行的目标位置（设备索引）
        /// </summary>
        public string ArrowLocation
        {
            get { return _arrowLocation; }
            set { _arrowLocation = value; }
        }
        string _CommType;
        /// <summary>
        /// 通讯类型库标识
        /// </summary>
        public string CommType
        {
            get { return _CommType; }
            set { _CommType = value; }
        }
        string _BeDetected;
        /// <summary>
        /// 被提前检测的光电组：运行标志，故障点等；负数表示检测有探物
        /// </summary>
        public string BeDetected
        {
            get { return _BeDetected; }
            set { _BeDetected = value; }
        }
        string _BindingDevice;
        /// <summary>
        /// 设备（入口处）探物检测开关的设备索引
        /// </summary>
        public string BindingDevice
        {
            get { return _BindingDevice; }
            set { _BindingDevice = value; }
        }
        string _BindingDeviceOut;
        /// <summary>
        /// 设备出口处检测开关的设备索引
        /// </summary>
        public string BindingDeviceOut
        {
            get { return _BindingDeviceOut; }
            set { _BindingDeviceOut = value; }
        }
        int _DeviceVisual;

        public int DeviceVisual
        {
            get { return _DeviceVisual; }
            set { _DeviceVisual = value; }
        }
        string _ControlName;

        public string ControlName
        {
            get { return _ControlName; }
            set { _ControlName = value; }
        }
        int _AppendBarcode;

        public int AppendBarcode
        {
            get { return _AppendBarcode; }
            set { _AppendBarcode = value; }
        }
        int _MaxSendCount;

        public int MaxSendCount
        {
            get { return _MaxSendCount; }
            set { _MaxSendCount = value; }
        }
        int _SendInterval;

        public int SendInterval
        {
            get { return _SendInterval; }
            set { _SendInterval = value; }
        }
        char _NeedOptimize;

        public char NeedOptimize
        {
            get { return _NeedOptimize; }
            set { _NeedOptimize = value; }
        }
        string _LocalIP;

        public string LocalIP
        {
            get { return _LocalIP; }
            set { _LocalIP = value; }
        }
        int _LocalPort;

        public int LocalPort
        {
            get { return _LocalPort; }
            set { _LocalPort = value; }
        }
        string _RemoteIP;

        public string RemoteIP
        {
            get { return _RemoteIP; }
            set { _RemoteIP = value; }
        }
        int _RemotePort;

        public int RemotePort
        {
            get { return _RemotePort; }
            set { _RemotePort = value; }
        }
        string _OPCProgID;

        public string OPCProgID
        {
            get { return _OPCProgID; }
            set { _OPCProgID = value; }
        }
        int _ErrorTaskNo;
        /// <summary>
        /// 发生错误的设备指令索引
        /// </summary>
        public int ErrorTaskNo
        {
            get { return _ErrorTaskNo; }
            set { _ErrorTaskNo = value; }
        }
        string _SendOutDetect;
        /// <summary>
        /// 输送机送出时需要检测的光电信号设备索引
        /// </summary>
        public string SendOutDetect
        {
            get { return _SendOutDetect; }
            set { _SendOutDetect = value; }
        }
        int[] _returnMessage;
        /// <summary>
        /// 通讯返回的信息
        /// </summary>
        public int[] ReturnMessage
        {
            get { return _returnMessage; }
            set { _returnMessage = value; }
        }
        string _OnlyDetectIO;
        /// <summary>
        /// 判断一个设备是否只检测IO信号:1只检测IO信号
        /// </summary>
        public string OnlyDetectIO
        {
            get { return _OnlyDetectIO; }
            set { _OnlyDetectIO = value; }
        }
        string _UseCommonDB;
        /// <summary>
        /// 判断一个设备是否使用通用DB区发送指令（长输送机链的中间输送机）
        /// </summary>
        public string UseCommonDB
        {
            get { return _UseCommonDB; }
            set { _UseCommonDB = value; }
        }
        
        string _IfCorrelDoubleFork;
        /// <summary>
        /// 是否为堆垛机双叉关联控制
        /// </summary>
        public string IfCorrelDoubleFork
        {
            get { return _IfCorrelDoubleFork; }
            set { _IfCorrelDoubleFork = value; }
        }
        string _DoubleForkDetect;
        /// <summary>
        /// 双叉堆垛机在一个输送机取两个盘需要额外检测的探物开关
        /// </summary>
        public string DoubleForkDetect
        {
            get { return _DoubleForkDetect; }
            set { _DoubleForkDetect = value; }
        }
        string _DoubleFork;
        /// <summary>
        /// 设备双叉属性：0，不确定；1近货叉；2远货叉
        /// </summary>
        public string DoubleFork
        {
            get { return _DoubleFork; }
            set { _DoubleFork = value; }
        }
        //20100609
        int _SerialPort;
        /// <summary>
        /// 串口序号
        /// </summary>
        public int SerialPort
        {
            get { return _SerialPort; }
            set { _SerialPort = value; }
        }
        //20100609
        string _CommSettings;
        /// <summary>
        /// 串口设置
        /// </summary>
        public string CommSettings
        {
            get { return _CommSettings; }
            set { _CommSettings = value; }
        }
        //20100714
        string _S7Connection;
        /// <summary>
        /// OPC连接ID，默认值：S7:[S7 connection_1]
        /// </summary>
        public string S7Connection
        {
            get { return _S7Connection; }
            set { _S7Connection = value; }
        }

        int _SplitByte;
        /// <summary>
        /// 20101118设备光电开关占用的字节
        /// </summary>
        public int SplitByte
        {
            get { return _SplitByte; }
            set { _SplitByte = value; }
        }
        int _SplitByte_0;
        /// <summary>
        /// 20101118设备光电开关占用的字节bit0，入口探物
        /// </summary>
        public int SplitByte_0
        {
            get { return _SplitByte_0; }
            set { _SplitByte_0 = value; }
        }
        int _SplitByte_1;
        /// <summary>
        /// 20101118设备光电开关占用的字节bit1，出口探物
        /// </summary>
        public int SplitByte_1
        {
            get { return _SplitByte_1; }
            set { _SplitByte_1 = value; }
        }
        int _SplitByte_2;
        /// <summary>
        /// 20101118设备光电开关占用的字节bit2，顶升高位
        /// </summary>
        public int SplitByte_2
        {
            get { return _SplitByte_2; }
            set { _SplitByte_2 = value; }
        }
        int _SplitByte_3;
        /// <summary>
        /// 20101118设备光电开关占用的字节bit3，顶升低位
        /// </summary>
        public int SplitByte_3
        {
            get { return _SplitByte_3; }
            set { _SplitByte_3 = value; }
        }
    }
}
