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

using GcDevicePc.IniParam;
using GcDevicePc.GCBuffer;

namespace GcDevicePc
{
    class globaldata
    {
        public struct DeviceInfo
        {
            public string ModuleName;
            public string MacAddr;
            public string IpAddr;
            public string Netmask;
            public string Gateway;
            public bool bActive;
        };
        public static DeviceInfo m_DeviceInfo;
        public static ArrayList DeviceList = new ArrayList();

        //辅助工具使用的HMI List
        public static ArrayList hHMIList = new ArrayList();

        public static int device_index;     //总共探测出的设备数目
        public static int current_device;   //当前使用的设备号

        public static string connection_ip;  //当前连接IP
        //端口
        public static ushort datamodbusport = 502;  //modbus端口
        public static ushort udpport = 233;         //UDP端口
        public static ushort fileserverport = 911;  //文件传输端口
        //Modbus地址
        public static ushort tempstart = 100;
        public static ushort statusstart = 124;
        public static ushort valusstatus = 16;
        public static ushort detstatus = 3;
        public static ushort hmistatus = 144;

        //public static string DataFolder;    //数据保存目录
        //public static string RunFolder;     //当前程序运行目录
        //public static string MethodFolder;  //当前方法目录
        //public static string StatusFolder;  //当前状态目录
        //public static string subStatusFolder;  //当前状态目录
        //public static string RunTabFolder;  //当前运行表目录

        //public static string cur_MethodName;  //当前方法名
        //public static string cur_OpenMethodName;  //当前方法名
        //public static string cur_StatusName;  //当前状态名
        //public static string cur_RunTab;      //当前运行表名
        //public static string cur_DataName;      //保存数据文件名
        public static string show_MethodName;  //显示方法名

        //public static bool system_Statue;  //系统开启状态
        //public static ushort work_Statue;  //系统工作状态
        //public static ushort RunType = 0;  //运行类型  0 打开运行  1 智能运行 2 批处理


        public static ushort MethodRun_Statue;  //方法运行状态
        public static ushort RunTime_Now;  //运行时间
        public static ushort RunTotal_Now;  //运行总时间

        public static CProfileDevice m_profileMethod = new CProfileDevice();//方法的一些Ini文件参数
        public static MethodConfig m_configDlg = new MethodConfig();
        ///////////////////////////////////////////////////////////////////////////////////
        ///                            新全局buffer                                     ///
        ///                                                                             ///    
        ///                                                                             ///                    
        ///////////////////////////////////////////////////////////////////////////////////
        //用于侧边栏显示的Buffer
        public static DPBuffer m_dpbuffer = new DPBuffer();
        public static HMIBuffer m_hmibuffer = new HMIBuffer();
        public static PCBuffer m_pcbuffer = new PCBuffer();
        public static SignalBuffer m_signalbuffer = new SignalBuffer();
       
        ///////////////////////////////////////////////////////////////////////////////////
        //public static CProfileDevice open_profileMethod = new CProfileDevice();
        //public static MethodConfig open_configDlg = new MethodConfig();

       

      //  public static Modbus m_modbus = new Modbus();
        public static int starttimer = 0x7FFFFFFF; //开始时间
       // public static int savetimer; //开始时间

        //public static int[] channel1_timer = new int[30];
        //public static float[] channel1_data = new float[30];

        //public struct Channel_XY
        //{
        //    public int ctimer;
        //    public float cdata;
        //};

        //public static Channel_XY Channel1_Port;
        //public static ArrayList Draw_Port = new ArrayList();
     
        //Flag
        //public static bool startflag = false;
        //public static bool startclear = false;
        //public static bool stopflag = false;
        //public static bool cancelflag = false;

        public static bool startflag = false;    //开始按键的标志位
        public static bool startclear = false;   //清除开始按键之前的数据
        public static bool stopflag = false;       //停止按键的标志位
        public static bool cancelflag = false;   //取消按键的标志位

    }
}
