Exemple #1
0
        /// <summary>
        /// 按时间回放按钮按下
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPlayBackByTime_Click(object sender, EventArgs e)
        {
            playBy = 1;
            frm_PlayBackByTimeSet fPBSet = new frm_PlayBackByTimeSet();

            fPBSet.cmbChannelSelect.Items.Clear();
            for (int i = 0; i < deviceInfo.byChanNum; i++)
            {
                fPBSet.cmbChannelSelect.Items.Add(i.ToString());
            }
            fileInfo = new NET_RECORDFILE_INFO();
            int  fileCount          = 0;
            bool blnQueryRecordFile = false;

            fPBSet.ShowDialog();
            if (fPBSet.blnOKEnter == true)
            {
                DateTime startTime = fPBSet.dtpStart.Value;
                DateTime endTime   = fPBSet.dtpEnd.Value;
                if (startTime.Date >= endTime.Date)
                {
                    MessageBox.Show("开始日期不在结束日期设置前,请重新设置!", pMsgTitle);
                }
                else
                {
                    blnQueryRecordFile = DHClient.DHQueryRecordFile(pLoginID, int.Parse(fPBSet.txtChannelID.Text.ToString()), RECORD_FILE_TYPE.ALLRECORDFILE,
                                                                    startTime, endTime, null, ref fileInfo, Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)), out fileCount, 5000, false); //按时间回放
                    if (blnQueryRecordFile == true)
                    {
                        if (picRealPlay == null)
                        {
                            picRealPlay = picRealPlay15;
                        }
                        pPlayBackChannelID = int.Parse(fPBSet.txtChannelID.Text.ToString());
                        pPlayBackHandle[pPlayBackChannelID] = DHClient.DHPlayBackByTime(pLoginID, pPlayBackChannelID, startTime, endTime, picRealPlay.Handle, null, IntPtr.Zero);
                        if (pPlayBackHandle[pPlayBackChannelID] == 0)
                        {
                            MessageBox.Show("按时间回放失败!", pMsgTitle);
                        }
                        else
                        {
                            btnPlay.Text = "||";
                            //画面按钮有效性控制
                            btnPlayBackByTime.Enabled   = false;
                            gpbPlayBackControl.Enabled  = true;
                            btnPlay.Enabled             = true;
                            btnSlow.Enabled             = true;
                            btnStop.Enabled             = true;
                            btnFast.Enabled             = true;
                            btnSetpPlayS.Enabled        = true;
                            hsbPlayBack.Enabled         = true;
                            btnPlayByRecordFile.Enabled = false;
                        }
                    }
                }
                //MessageBox.Show(blnQueryRecordFile.ToString(),MsgTitle);
            }
        }
Exemple #2
0
        /// <summary>
        /// 按时间回放按钮按下
        /// </summary>
        /// <param name="sender">系统参数</param>
        /// <param name="e">系统参数</param>
        private void btn_PlayBackByTime_Click(object sender, EventArgs e)
        {
            if (clientInstance.Logined == true)
            {
                frm_PlayBackByTimeSet fPBSet   = new frm_PlayBackByTimeSet();
                NET_RECORDFILE_INFO   fileInfo = new NET_RECORDFILE_INFO();
                int  fileCount          = 0;
                bool blnQueryRecordFile = false;

                fPBSet.ShowDialog();
                if (fPBSet.blnOKEnter == true)
                {
                    DateTime startTime = fPBSet.dtpStart.Value;
                    DateTime endTime   = fPBSet.dtpEnd.Value;
                    if (startTime.Date >= endTime.Date)
                    {
                        MessageBox.Show("开始日期不在结束日期设置前,请重新设置!", MsgTitle);
                    }
                    else
                    {
                        blnQueryRecordFile = clientInstance.QueryRecordFile(int.Parse(fPBSet.txtChannelID.Text.ToString()), 0, startTime, endTime, null, out fileInfo, Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)), out fileCount, 5000, false);
                        if (blnQueryRecordFile == true)
                        {
                            if (picRealPlay == null)
                            {
                                picRealPlay = picRealPlay15;
                            }
                            if (clientInstance.PlayBackByTime(int.Parse(fPBSet.txtChannelID.Text.ToString()), startTime, endTime, picRealPlay.Handle, null, IntPtr.Zero) == false)
                            {
                                MessageBox.Show("按时间回放失败!", MsgTitle);
                            }
                            else
                            {
                                btnPlay.Text = "||";
                                //画面按钮有效性控制
                                btn_PlayBackByTime.Enabled = false;
                                tclControl.Enabled         = true;
                                btnPlay.Enabled            = true;
                                btnSlow.Enabled            = true;
                                btnStop.Enabled            = true;
                                btnFast.Enabled            = true;
                                btnNext.Enabled            = true;
                                hsbPlayBack.Enabled        = true;
                            }
                        }
                    }
                    //MessageBox.Show(blnQueryRecordFile.ToString(),MsgTitle);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// 按时间回放按钮按下
        /// </summary>
        /// <param name="sender">系统参数</param>
        /// <param name="e">系统参数</param>
        private void btn_PlayBackByTime_Click(object sender, EventArgs e)
        {
            if(clientInstance.Logined==true)
            {
                frm_PlayBackByTimeSet fPBSet = new frm_PlayBackByTimeSet();
                 NET_RECORDFILE_INFO fileInfo = new NET_RECORDFILE_INFO();
                int fileCount=0;
                bool blnQueryRecordFile = false;

                fPBSet.ShowDialog();
                if (fPBSet.blnOKEnter == true)
                {
                    DateTime startTime = fPBSet.dtpStart.Value;
                    DateTime endTime = fPBSet.dtpEnd.Value;
                    if (startTime.Date>= endTime.Date)
                    {
                        MessageBox.Show("开始日期不在结束日期设置前,请重新设置!", MsgTitle);
                    }
                    else
                    {
                        blnQueryRecordFile = clientInstance.QueryRecordFile(int.Parse(fPBSet.txtChannelID.Text.ToString()), 0, startTime, endTime, null, out fileInfo, Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)), out fileCount, 5000, false);
                        if (blnQueryRecordFile == true)
                        {
                            if (picRealPlay == null)
                            {
                                picRealPlay = picRealPlay15;
                            }
                            if (clientInstance.PlayBackByTime(int.Parse(fPBSet.txtChannelID.Text.ToString()), startTime, endTime, picRealPlay.Handle, null, IntPtr.Zero) == false)
                            {
                                MessageBox.Show("按时间回放失败!", MsgTitle);
                            }
                            else
                            {
                                btnPlay.Text = "||";
                                //画面按钮有效性控制
                                btn_PlayBackByTime.Enabled = false;
                                tclControl.Enabled = true;
                                btnPlay.Enabled = true;
                                btnSlow.Enabled = true;
                                btnStop.Enabled = true;
                                btnFast.Enabled = true;
                                btnNext.Enabled = true;
                                hsbPlayBack.Enabled = true;
                            }
                        }
                    }
                    //MessageBox.Show(blnQueryRecordFile.ToString(),MsgTitle);
                }
            }
        }
        /// <summary>
        /// 按时间回放按钮按下
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPlayBackByTime_Click(object sender, EventArgs e)
        {
            playBy = 1;
            frm_PlayBackByTimeSet fPBSet = new frm_PlayBackByTimeSet();
            fPBSet.cmbChannelSelect.Items.Clear();
            for (int i = 0; i < deviceInfo.byChanNum; i++)
            {
                fPBSet.cmbChannelSelect.Items.Add(i.ToString());
            }
            fileInfo = new NET_RECORDFILE_INFO();
            int fileCount = 0;
            bool blnQueryRecordFile = false;

            fPBSet.ShowDialog();
            if (fPBSet.blnOKEnter == true)
            {
                DateTime startTime = fPBSet.dtpStart.Value;
                DateTime endTime = fPBSet.dtpEnd.Value;
                if (startTime.Date >= endTime.Date)
                {
                    MessageBox.Show("开始日期不在结束日期设置前,请重新设置!", pMsgTitle);
                }
                else
                {
                    blnQueryRecordFile = DHClient.DHQueryRecordFile(pLoginID, int.Parse(fPBSet.txtChannelID.Text.ToString()), RECORD_FILE_TYPE.ALLRECORDFILE, 
                                                                    startTime, endTime, null, ref fileInfo, Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)), out  fileCount, 5000, false);//按时间回放
                    if (blnQueryRecordFile == true)
                    {
                        if (picRealPlay == null)
                        {
                            picRealPlay = picRealPlay15;
                        }
                        pPlayBackChannelID = int.Parse(fPBSet.txtChannelID.Text.ToString());
                        pPlayBackHandle[pPlayBackChannelID] = DHClient.DHPlayBackByTime(pLoginID, pPlayBackChannelID, startTime, endTime, picRealPlay.Handle, null, IntPtr.Zero);
                        if (pPlayBackHandle[pPlayBackChannelID] == 0)
                        {
                            MessageBox.Show("按时间回放失败!", pMsgTitle);
                        }
                        else
                        {
                            btnPlay.Text = "||";
                            //画面按钮有效性控制
                            btnPlayBackByTime.Enabled = false;
                            gpbPlayBackControl.Enabled = true;
                            btnPlay.Enabled = true;
                            btnSlow.Enabled = true;
                            btnStop.Enabled = true;
                            btnFast.Enabled = true;
                            btnSetpPlayS.Enabled = true;
                            hsbPlayBack.Enabled = true;
                            btnPlayByRecordFile.Enabled = false;
                        }
                    }
                }
                //MessageBox.Show(blnQueryRecordFile.ToString(),MsgTitle);
            }
        }