Esempio n. 1
0
        private void comboDev_SelectedIndexChanged(object sender, EventArgs e)
        {
            DEV_INFO   devInfo      = new DEV_INFO();
            ComboxItem selecteditem = (ComboxItem)comboDev.SelectedItem;

            devInfo = (DEV_INFO)selecteditem.Value;

            for (int i = 0; i < devInfo.NetDeviceInfo.byChanNum + devInfo.NetDeviceInfo.iDigChannel; i++)
            {
                comboChannel.Items.Add(i + 1);
            }
            comboChannel.SelectedIndex = 0;
            m_lLoginID = devInfo.lLoginID;
        }
Esempio n. 2
0
        // 点击网网络的选项卡
        private void tabControlPlayBack_Click(object sender, EventArgs e)
        {
            if (tabControlPlayBack.SelectedTab.Name == "tabPageRemovePlayBack")
            {
                comboDev.Items.Clear();
                ClientDemo clientForm = new ClientDemo();

                foreach (Form form in Application.OpenForms)
                {
                    if (form.Name == "ClientDemo")
                    {
                        clientForm = (ClientDemo)form;
                        break;
                    }
                }

                foreach (TreeNode node in clientForm.devForm.DevTree.Nodes)
                {
                    ComboxItem item = new ComboxItem(node.Text, node.Tag);
                    comboDev.Items.Add(item);
                }

                comboRecordType.Items.Clear();

                comboRecordType.Items.Add("全部录像");
                comboRecordType.Items.Add("外部报警");
                comboRecordType.Items.Add("视频检测");
                comboRecordType.Items.Add("普通录像");
                comboRecordType.Items.Add("手动录像");
                comboRecordType.Items.Add("全部图片");
                comboRecordType.Items.Add("外部报警图片");
                comboRecordType.Items.Add("视频检测图片");
                comboRecordType.Items.Add("普通图片");
                comboRecordType.Items.Add("手动抓图");
                comboRecordType.SelectedIndex = 0;

                checkFile.Checked = true;
            }
            else
            {
            }
        }
        // 点击网网络的选项卡
        private void tabControlPlayBack_Click(object sender, EventArgs e)
        {
            if (tabControlPlayBack.SelectedTab.Name == "tabPageRemovePlayBack")
            {
                comboDev.Items.Clear();
                ClientDemo clientForm = new ClientDemo();

                foreach (Form form in Application.OpenForms)
                {
                    if (form.Name == "ClientDemo")
                    {
                        clientForm = (ClientDemo)form;
                        break;
                    }
                }

                foreach (TreeNode node in clientForm.devForm.DevTree.Nodes)
                {
                    ComboxItem item = new ComboxItem(node.Text, node.Tag);
                    comboDev.Items.Add(item);
                }

                comboRecordType.Items.Clear();

                comboRecordType.Items.Add("All video");
                comboRecordType.Items.Add("External alarm video");
                comboRecordType.Items.Add("Video detection video");
                comboRecordType.Items.Add("Ordinary video");
                comboRecordType.Items.Add("Manual recording");
                comboRecordType.Items.Add("All pictures");
                comboRecordType.Items.Add("Alarm to capture");
                comboRecordType.Items.Add("Video capture detection");
                comboRecordType.Items.Add("Capture timing");
                comboRecordType.Items.Add("Manual capture");
                comboRecordType.SelectedIndex = 0;

                checkFile.Checked = true;
            }
            else
            {
            }
        }
Esempio n. 4
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            // 条件检测
            if (comboDev.SelectedIndex < 0)
            {
                MessageBox.Show("Select a Device!");
                return;
            }
            if (!checkFile.Checked && !checkTime.Checked)
            {
                MessageBox.Show("Select a Search mode!");
                return;
            }


            ClearResult();

            H264_DVR_TIME StartTime;
            H264_DVR_TIME StopTime;

            int nChannel  = comboChannel.SelectedIndex;    //channel No.
            int nFileType = comboRecordType.SelectedIndex; //file type

            StartTime.dwYear   = beginDate.Value.Year;
            StartTime.dwMonth  = beginDate.Value.Month;
            StartTime.dwDay    = beginDate.Value.Day;
            StartTime.dwHour   = beginTime.Value.Hour;
            StartTime.dwMinute = beginTime.Value.Minute;
            StartTime.dwSecond = beginTime.Value.Second;

            StopTime.dwYear   = endDate.Value.Year;
            StopTime.dwMonth  = endDate.Value.Month;
            StopTime.dwDay    = endDate.Value.Day;
            StopTime.dwHour   = endDate.Value.Hour;
            StopTime.dwMinute = endDate.Value.Minute;
            StopTime.dwSecond = endDate.Value.Second;
            H264_DVR_FILE_DATA[] szSend = new H264_DVR_FILE_DATA[100];

            ComboxItem item = (ComboxItem)comboDev.SelectedItem;

            if (item.Value != null)
            {
                DEV_INFO devInfo = (DEV_INFO)item.Value;


                int lLoginID = devInfo.lLoginID;
                int nMaxLen  = 100;
                int waitTime = 4000;
                int nNum     = 0;
                H264_DVR_FINDINFO searchInfo = new H264_DVR_FINDINFO();
                searchInfo.startTime  = StartTime;
                searchInfo.endTime    = StopTime;
                searchInfo.nChannelN0 = nChannel;
                searchInfo.nFileType  = nFileType;


                IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(H264_DVR_FILE_DATA)) * 100);



                int nRet = XMSDK.H264_DVR_FindFile(lLoginID, ref searchInfo, ptr, nMaxLen, out nNum, waitTime);
                m_nCurRecNum = nNum;

                for (int index = 0; index < 100; index++)
                {
                    unsafe
                    {
                        int *pDev = (int *)ptr.ToPointer();
                        pDev += Marshal.SizeOf(typeof(H264_DVR_FILE_DATA)) * index / 4;

                        IntPtr ptrTemp = new IntPtr(pDev);
                        szSend[index] = (H264_DVR_FILE_DATA)Marshal.PtrToStructure(ptrTemp, typeof(H264_DVR_FILE_DATA));
                    }
                }

                if (nRet > 0)
                {
                    if (nNum > 0)
                    {
                        m_nGetPage++;
                        m_nCurPage = 1;
                        if (m_nCurRecNum > m_listFile.Capacity)
                        {
                            m_listFile.Capacity = m_nCurRecNum;
                        }


                        for (int i = 0; i < m_nCurRecNum; i++)
                        {
                            m_listFile.Add(szSend[i]);
                        }

                        m_nSearchInfo.nChannelN0         = nChannel;
                        m_nSearchInfo.nFileType          = nFileType;
                        m_nSearchInfo.startTime.dwYear   = szSend[m_nCurRecNum - 1].stEndTime.year;
                        m_nSearchInfo.startTime.dwMonth  = szSend[m_nCurRecNum - 1].stEndTime.month;
                        m_nSearchInfo.startTime.dwDay    = szSend[m_nCurRecNum - 1].stEndTime.day;
                        m_nSearchInfo.startTime.dwHour   = szSend[m_nCurRecNum - 1].stEndTime.hour;
                        m_nSearchInfo.startTime.dwMinute = szSend[m_nCurRecNum - 1].stEndTime.minute;
                        m_nSearchInfo.startTime.dwSecond = szSend[m_nCurRecNum - 1].stEndTime.second;
                        m_nSearchInfo.endTime            = searchInfo.endTime;

                        if (nNum < PLAYBACK_MAX_FILE_NUM)
                        {
                            m_nTotalPage = m_nGetPage;
                        }

                        AddFileListInfo(m_nCurRecNum);//add list item
                        SetPageBtnState();
                    }
                    else
                    {
                        MessageBox.Show("No File");
                    }
                }
                else
                {
                    MessageBox.Show("SearchFail");
                }
            }
        }
        // 点击网网络的选项卡
        private void tabControlPlayBack_Click(object sender, EventArgs e)
        {
            if (tabControlPlayBack.SelectedTab.Name == "tabPageRemovePlayBack")
            {
                comboDev.Items.Clear();
                ClientDemo clientForm = new ClientDemo();

                foreach (Form form in Application.OpenForms)
                {
                    if (form.Name == "ClientDemo")
                    {
                        clientForm = (ClientDemo)form;
                        break;
                    }
                }

                foreach (TreeNode node in clientForm.devForm.DevTree.Nodes)
                {
                    ComboxItem item = new ComboxItem(node.Text,node.Tag);
                    comboDev.Items.Add(item);
                }

                comboRecordType.Items.Clear();

                comboRecordType.Items.Add("全部录像");
                comboRecordType.Items.Add("外部报警");
                comboRecordType.Items.Add("视频检测");
                comboRecordType.Items.Add("普通录像");
                comboRecordType.Items.Add("手动录像");
                comboRecordType.Items.Add("全部图片");
                comboRecordType.Items.Add("外部报警图片");
                comboRecordType.Items.Add("视频检测图片");
                comboRecordType.Items.Add("普通图片");
                comboRecordType.Items.Add("手动抓图");
                comboRecordType.SelectedIndex = 0;

                checkFile.Checked = true;
            }
            else
            {

            }
        }