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

namespace GcDevicePc.GCBuffer
{
    class HMIBuffer
    {
        public struct hmiinfo
        {
            /// <summary>
            /// 方法相关
            /// </summary>
            public ushort batno;
            public ushort batruncount;
            public ushort oneruntime;
            public ushort singlerun;
            public ushort batrun;
            public ushort methodstatus;
            public ushort waitstart;
            public ushort hmistatus;
            public ushort runtime;

            /// <summary>
            /// 方法的开始和结束时间
            /// </summary>
            /// ps:只有在methodstatus == 4 || == 5的时候NowStartTime开始时间才是有效的 NowEndTime为方法结束后有效
            public UInt32 NowStartTime;
            public UInt32 NowEndTime;

            /// <summary>
            /// 10路继电器
            /// </summary>
            public byte[] TenRelay;

            /// <summary>
            /// 点火状态
            /// </summary>
            public ushort[] FireStatus;

            public ushort[] DACStatus;

            public byte[] ErrorStatus;

            public bool hmioffline ;

            public ushort[] HMIMac;
        }

        public hmiinfo gcinfo = new hmiinfo();

        public HMIBuffer()
        {
            gcinfo.batno = 0;
            gcinfo.batruncount = 0;
            gcinfo.oneruntime = 0;
            gcinfo.singlerun = 0;
            gcinfo.methodstatus = 0;
            gcinfo.waitstart = 0;
            gcinfo.hmistatus = 0;
            gcinfo.runtime = 0;
            gcinfo.TenRelay = new byte[10];
            gcinfo.FireStatus = new ushort[4] { 0, 0, 0 ,0};
            gcinfo.DACStatus = new ushort[6] { 0, 0, 0,0,0,0 };
            gcinfo.ErrorStatus = new byte[9];
            gcinfo.hmioffline = false;
            gcinfo.HMIMac = new ushort[3] { 0, 0, 0};
        }

        ~HMIBuffer()
        {

        }

    }
}
