Exemplo n.º 1
0
        private void FrmHikVideo_Load(object sender, EventArgs e)
        {
            if (currentCamera == null)
            {
                panVideo1.Text = "摄像机参数未配置";
                return;
            }
            try
            {
                //初始化SDK
                IPCer.InitSDK();

                bool b = ipCer.Login(currentCamera.Ip, currentCamera.Port, currentCamera.UserName, currentCamera.Password);
                if (!b)
                {
                    panVideo1.Text = "登录失败:" + returnError(IPCer.GetLastErrorCode());
                    return;
                }
                b = ipCer.StartPreview(panVideo1.Handle, currentCamera.Channel);
                if (!b)
                {
                    panVideo1.Text = "预览失败:" + returnError(IPCer.GetLastErrorCode());
                    return;
                }
            }
            catch (Exception ex)
            {
                panVideo1.Text = "预览异常:请检查参数是否正确;" + ex.Message;
            }
        }
Exemplo n.º 2
0
        private void FrmHikVideo_Load(object sender, EventArgs e)
        {
            try
            {
                //初始化SDK
                IPCer.InitSDK();

                CmcsCamera cmcsCamera = commonDAO.SelfDber.Entity <CmcsCamera>("where Name=:Name", new { Name = this.Text });

                if (cmcsCamera == null)
                {
                    panVideo1.Text = "登录失败:未找到该摄像头配置信息";
                    return;
                }

                bool b = ipCer.Login(cmcsCamera.Ip, cmcsCamera.Port, cmcsCamera.UserName, cmcsCamera.Password);
                if (!b)
                {
                    panVideo1.Text = "登录失败:" + returnError(IPCer.GetLastErrorCode());
                    return;
                }
                b = ipCer.StartPreview(panVideo1.Handle, cmcsCamera.Channel);
                if (!b)
                {
                    panVideo1.Text = "预览失败:" + returnError(IPCer.GetLastErrorCode());
                    return;
                }
            }
            catch (Exception ex)
            {
                panVideo1.Text = "预览异常:请检查参数是否正确;" + ex.Message;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 开始模拟数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, EventArgs e)
        {
            iPCer_Identify1.Login("192.168.1.50", 80, "admin", "admin123");
            uint ss = IPCer.GetLastErrorCode();

            iPCer_Identify1.StartPreview(panVideo1.Handle, 1);
            //iPCer_Identify1.OnReceived = ReceiveData1;
            iPCer_Identify1.SetDVRCallBack();
            iPCer_Identify1.SetupAlarm();
        }
Exemplo n.º 4
0
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void FormInit()
        {
            BindData();
            // 生成开门按钮
            GridButtonXEditControl btnNewCode = superGridControl1.PrimaryGrid.Columns["gcmlOpen"].EditControl as GridButtonXEditControl;

            btnNewCode.ColorTable = eButtonColor.BlueWithBackground;
            btnNewCode.Click     += new EventHandler(btnOpen_Click);

            IPCer.InitSDK();
        }
Exemplo n.º 5
0
 private void FrmHikVideo_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         ipCer.StopPreview();
         ipCer.LoginOut();
         IPCer.CleanupSDK();
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 6
0
 private void FrmCamera_FormClosing(object sender, FormClosingEventArgs e)
 {
     iPCer_Identify1.CloseAlarm();
     iPCer_Identify1.LoginOut();
     IPCer.CleanupSDK();
 }
Exemplo n.º 7
0
 /// <summary>
 /// 窗体加载的时候获取所有状态为在途的车辆
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FrmCarLocation_Load(object sender, EventArgs e)
 {
     IPCer.InitSDK();
 }
Exemplo n.º 8
0
 private void FrmDoorManager_FormClosing(object sender, FormClosingEventArgs e)
 {
     IPCer.CleanupSDK();
 }