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 ushort[] EPCStatus;//epc状态

            public ushort[] HmiAbnormal;//hmi异常报警
        }

        public hmiinfo gcinfo = new hmiinfo();

        public struct adjust
        {
            public float setpotency;//设定浓度
            public float trackpotency;//跟踪浓度
            public long settime;//设定时间
            public long executefun;//执行功能
            public long funrun;//功能启停
            public long runtime;//运行时间
            public long executestat;//执行状态

            //
            public int currentstate;//当前状态

        }
        public adjust gcadjust = new adjust();
        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[12];
            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 };
            gcinfo.EPCStatus = new ushort[16] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            gcinfo.HmiAbnormal = new ushort[3] { 0, 0, 0 };

            gcadjust.executefun = 0;
            gcadjust.executestat = 0;
            gcadjust.runtime = 0;
            gcadjust.funrun = 0;
            gcadjust.setpotency = 0;
            gcadjust.settime = 1800;
            gcadjust.trackpotency = 0;
            gcadjust.currentstate = 0;
        }

        ~HMIBuffer()
        {

        }

    }
}
