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

namespace GcDevicePc.GCBuffer
{
    class DPBuffer
    {
        public struct TiemInfo
        {
            public ushort runtimenow;
            public ushort alltime;
        }

        public struct TempInfo
        {
            //前进样口
            public float FPActualTemp;
            public float FPSetTemp;
            //后进样口
            public float BPActualTemp;
            public float BPSetTemp;
            //柱箱
            public float ColActualTemp;
            public float ColSetTemp;
            //前检测器
            public float fDetActualTemp;
            public float fDetSetTemp;
            //中检测器
            public float iDetActualTemp;
            public float iDetSetTemp;
            //后检测器
            public float bDetActualTemp;
            public float bDetSetTemp;

            //辅助Aux1
            public float AuxActualTemp1;
            public float AuxSetTemp1;
            //辅助Aux2
            public float AuxActualTemp2;
            public float AuxSetTemp2;

        }

        public struct valvetime
        {
            public float start1;
            public float end1;
            public float start2;
            public float end2;
            public float start3;
            public float end3;
            public float start4;
            public float end4;
        }

        public struct ValveShowInfo
        {
            public bool u16ValveOne;        //阀开关状态
            public valvetime ValveOneTime;  //时间
            public bool u16ValveTwo;        //阀开关状态
            public valvetime ValveTwoTime;  //时间
            public bool u16ValveThree;      //阀开关状态
            public valvetime ValveThreeTime;//时间
            public bool u16ValveFour;       //阀开关状态
            public valvetime ValveFourTime; //时间
            public bool u16ValveFive;       //阀开关状态
            public valvetime ValveFiveTime; //时间
            public bool u16ValveSix;       //阀开关状态
            public valvetime ValveSixTime; //时间
        }

        public struct ISportInfo
        {
            public float fallpressure;
            public float fpressure1;
            public float fpressure2;
            public float fpressure3;

            public float ballpressure;
            public float bpressure1;
            public float bpressure2;
            public float bpressure3;
        }

        public struct DetInfo
        {
            public ushort fDetStatue;
            public bool fDetSwitch;  //点火状态
            public float fDetValue;  //信号值
            public ushort fDetPol;   //档位

            public ushort iDetStatue;
            public bool iDetSwitch;
            public float iDetValue;
            public ushort iDetPol;

            public ushort bDetStatue;
            public bool bDetSwitch;
            public float bDetValue;
            public ushort bDetPol;
        }

        public struct ShowInfo
        {
          public TiemInfo showtime;
          public TempInfo showtemp;
          public ValveShowInfo showValve;
          public ISportInfo showISport;
          public DetInfo showDet;
        }

        public ShowInfo ShowList = new ShowInfo();

        public void DPInit()
        {
            ShowList.showtime.runtimenow = 0;
            ShowList.showValve.ValveOneTime.start1 = 0;


            this.ShowList.showtemp.FPActualTemp = 0.0f;
            this.ShowList.showtemp.FPSetTemp = 0.0f;
            this.ShowList.showtemp.BPActualTemp = 0.0f;
            this.ShowList.showtemp.BPSetTemp = 0.0f;
            this.ShowList.showtemp.ColActualTemp = 0.0f;
            this.ShowList.showtemp.ColSetTemp = 0.0f;
            this.ShowList.showtemp.fDetActualTemp = 0.0f;
            this.ShowList.showtemp.fDetSetTemp = 0.0f;
            this.ShowList.showtemp.iDetActualTemp = 0.0f;
            this.ShowList.showtemp.iDetSetTemp = 0.0f;
            this.ShowList.showtemp.bDetActualTemp = 0.0f;
            this.ShowList.showtemp.bDetSetTemp = 0.0f;
            this.ShowList.showtemp.AuxActualTemp1 = 0.0f;
            this.ShowList.showtemp.AuxSetTemp1 = 0.0f;
            this.ShowList.showtemp.AuxActualTemp2 = 0.0f;
            this.ShowList.showtemp.AuxSetTemp2 = 0.0f;


            this.ShowList.showValve.u16ValveOne = false;
            this.ShowList.showValve.ValveOneTime.start1 = 0;
            this.ShowList.showValve.ValveOneTime.end1 = 0;
            this.ShowList.showValve.ValveOneTime.start2 = 0;
            this.ShowList.showValve.ValveOneTime.end2 = 0;
            this.ShowList.showValve.ValveOneTime.start3 = 0;
            this.ShowList.showValve.ValveOneTime.end3 = 0;
            this.ShowList.showValve.ValveOneTime.start4 = 0;
            this.ShowList.showValve.ValveOneTime.end4 = 0;
            this.ShowList.showValve.u16ValveTwo = false;
            this.ShowList.showValve.ValveTwoTime.start1 = 0;
            this.ShowList.showValve.ValveTwoTime.end1 = 0;
            this.ShowList.showValve.ValveTwoTime.start2 = 0;
            this.ShowList.showValve.ValveTwoTime.end2 = 0;
            this.ShowList.showValve.ValveTwoTime.start3 = 0;
            this.ShowList.showValve.ValveTwoTime.end3 = 0;
            this.ShowList.showValve.ValveTwoTime.start4 = 0;
            this.ShowList.showValve.ValveTwoTime.end4 = 0;
            this.ShowList.showValve.u16ValveThree = false;
            this.ShowList.showValve.ValveThreeTime.start1 = 0;
            this.ShowList.showValve.ValveThreeTime.end1 = 0;
            this.ShowList.showValve.ValveThreeTime.start2 = 0;
            this.ShowList.showValve.ValveThreeTime.end2 = 0;
            this.ShowList.showValve.ValveThreeTime.start3 = 0;
            this.ShowList.showValve.ValveThreeTime.end3 = 0;
            this.ShowList.showValve.ValveThreeTime.start4 = 0;
            this.ShowList.showValve.ValveThreeTime.end4 = 0;
            this.ShowList.showValve.u16ValveFour = false;
            this.ShowList.showValve.ValveFourTime.start1 = 0;
            this.ShowList.showValve.ValveFourTime.end1 = 0;
            this.ShowList.showValve.ValveFourTime.start2 = 0;
            this.ShowList.showValve.ValveFourTime.end2 = 0;
            this.ShowList.showValve.ValveFourTime.start3 = 0;
            this.ShowList.showValve.ValveFourTime.end3 = 0;
            this.ShowList.showValve.ValveFourTime.start4 = 0;
            this.ShowList.showValve.ValveFourTime.end4 = 0;
            this.ShowList.showValve.u16ValveFive = false;
            this.ShowList.showValve.ValveFiveTime.start1 = 0;
            this.ShowList.showValve.ValveFiveTime.end1 = 0;
            this.ShowList.showValve.ValveFiveTime.start2 = 0;
            this.ShowList.showValve.ValveFiveTime.end2 = 0;
            this.ShowList.showValve.ValveFiveTime.start3 = 0;
            this.ShowList.showValve.ValveFiveTime.end3 = 0;
            this.ShowList.showValve.ValveFiveTime.start4 = 0;
            this.ShowList.showValve.ValveFiveTime.end4 = 0;
            this.ShowList.showValve.u16ValveSix = false;
            this.ShowList.showValve.ValveSixTime.start1 = 0;
            this.ShowList.showValve.ValveSixTime.end1 = 0;
            this.ShowList.showValve.ValveSixTime.start2 = 0;
            this.ShowList.showValve.ValveSixTime.end2 = 0;
            this.ShowList.showValve.ValveSixTime.start3 = 0;
            this.ShowList.showValve.ValveSixTime.end3 = 0;
            this.ShowList.showValve.ValveSixTime.start4 = 0;
            this.ShowList.showValve.ValveSixTime.end4 = 0;


            //this.ShowList.showValve.ValveTime = new valvetime[6];
            //for (i = 0; i < 6; i++)
            //{
            //    this.ShowList.showValve.ValveTime[i].start = new float[4];
            //    this.ShowList.showValve.ValveTime[i].end = new float[4];
            //}

            this.ShowList.showISport.fallpressure = 0.0f;
            this.ShowList.showISport.fpressure1 = 0.0f;
            this.ShowList.showISport.fpressure2 = 0.0f;
            this.ShowList.showISport.fpressure3 = 0.0f;
            this.ShowList.showISport.ballpressure = 0.0f;
            this.ShowList.showISport.bpressure1 = 0.0f;
            this.ShowList.showISport.bpressure2 = 0.0f;
            this.ShowList.showISport.bpressure3 = 0.0f;

            this.ShowList.showDet.fDetPol = 0;
            this.ShowList.showDet.fDetValue = 0.0f;
            this.ShowList.showDet.fDetStatue = 0;
            this.ShowList.showDet.fDetSwitch = false;
    
            this.ShowList.showDet.iDetPol = 0;
            this.ShowList.showDet.iDetValue = 0.0f;
            this.ShowList.showDet.iDetStatue = 0;
            this.ShowList.showDet.iDetSwitch = false;

            this.ShowList.showDet.bDetPol = 0;
            this.ShowList.showDet.bDetValue = 0.0f;
            this.ShowList.showDet.bDetStatue = 0;
            this.ShowList.showDet.bDetSwitch = false;

            // this.ShowList.errorifo.ErrorStatus = new byte[9];
        }

        public DPBuffer()
        {
            DPInit();
        }

        ~DPBuffer()
        {

        }
    }
}
