示例#1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public MainWinForm()
        {
            m_videoPanels = new ArrayList();

            InitializeComponent();

            devideScreen();

            m_sdkOperator = new BVCUSdkOperator(this);

            m_getPuList = new GetPuListDel(procGetPuList);//设置获得设备列表后的响应,初始化treeview

            m_capturePath = "";
            m_recordPath  = "";

            m_activePanelBorder = new RectBorder(panelVideo, Color.Red);
            Panel panel = m_videoPanels[0] as Panel;

            m_activePanelBorder.show(panel.Location, panel.Width, panel.Height, ACTIVE_PANEL_BORDER_WIDTH);
            m_activePanel = panel;
            RecordPath    = "E:\\PIPE_DATA\\TEST";

            //定时器
            sndData_timer           = new System.Timers.Timer(1000);
            sndData_timer.Elapsed  += new ElapsedEventHandler(sndMsg_TSP);
            sndData_timer.AutoReset = true;
            sndData_timer.Enabled   = false;

            //连接数据库
            if (conn != null)
            {
                conn.Close();
            }

            string connStr = "server=127.0.0.1;user id=root; password=TBG244; database=controlbox; pooling=false";

            try
            {
                conn = new MySqlConnection(connStr);
                conn.Open();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Error connecting to the server: " + ex.Message);
            }

            /*test
             * gsSrData = new gsData();
             * gsSrData.CH4 = 23;
             * gsSrData.CO = 24;
             * gsSrData.CO2 = 25;
             * gsSrData.H2S = 26;
             * gsSrData.NH3 = 27;
             * gsSrData.O2 = 28;
             *
             * string sql1 = string.Format(@"insert into gassensordata(DataTime,CO,CO2,H2S,NH3) values('{0}', '{1}', '{2}', '{3}', '{4}')", DateTime.Now, gsSrData.CO, gsSrData.CO2, gsSrData.CO2, gsSrData.NH3);
             * MySqlCommand mycmd = new MySqlCommand(sql1, conn);
             * mycmd.ExecuteNonQuery();
             * */
        }
示例#2
0
 public void SetBVCUSdk(BVCUSdkOperator globalBVCUSdk)
 {
     m_globalBVCUSdk = globalBVCUSdk;
 }