private void PopulateBigPicList(string iconFile)
        {
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();

            Query.ImageSearch imageSearch = new ImageSearch();
            string[] files = imageSearch.SelectedBestImageChanged(iconFile);
            if (files == null)
            {
                MessageBox.Show("没有搜索到对应的二级图片", "警告");
                return;
            }

            this.secPicListView.Scrollable = true;
            this.secPicListView.MultiSelect = false;
            this.secPicListView.View = View.LargeIcon;
            this.secPicListView.LargeImageList = imageList2;

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList2.Images.Add(Image.FromFile(files[i]));
                string text = System.IO.Path.GetFileName(files[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag = files[i],
                    Text = text,
                    ImageIndex = i
                };
                this.secPicListView.Items.Add(item);
            }
        }
        void bindPiclist()
        {
            this.picList.Clear();
            this.imageList1.Images.Clear();

            DateTime time   = ImageSearch.getDateTimeStr(videoList.FocusedItem.Tag as string);
            int      cameID = int.Parse(this.comboBox1.Text);

            string[] fileArr = ImageSearch.FacesCapturedAt(time, cameID, true);//得到图片路径
            if (fileArr.Length == 0)
            {
                return;
            }

            for (int i = 0; i < fileArr.Length; ++i)
            {
                this.imageList1.Images.Add(Image.FromFile(fileArr[i]));
                string       text = System.IO.Path.GetFileName(fileArr[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag        = fileArr[i].ToString(),
                    Text       = text,
                    ImageIndex = i
                };
                this.picList.Items.Add(item);
            }
            this.picList.Scrollable     = true;
            this.picList.MultiSelect    = false;
            this.picList.View           = View.LargeIcon;
            this.picList.LargeImageList = imageList1;
        }
Beispiel #3
0
        private void PopulateBigPicList(string iconFile)
        {
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();

            Query.ImageSearch imageSearch = new ImageSearch();
            string[]          files       = imageSearch.SelectedBestImageChanged(iconFile);
            if (files == null)
            {
                MessageBox.Show("没有搜索到对应的二级图片", "警告");
                return;
            }

            this.secPicListView.Scrollable     = true;
            this.secPicListView.MultiSelect    = false;
            this.secPicListView.View           = View.LargeIcon;
            this.secPicListView.LargeImageList = imageList2;


            for (int i = 0; i < files.Length; i++)
            {
                this.imageList2.Images.Add(Image.FromFile(files[i]));
                string       text = System.IO.Path.GetFileName(files[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag        = files[i],
                    Text       = text,
                    ImageIndex = i
                };
                this.secPicListView.Items.Add(item);
            }
        }
Beispiel #4
0
        void view_SelectVideoFile(object sender, EventArgs e)
        {
            this.view.ClearFacesList();

            DateTime time = ImageSearch.getDateTimeStr(this.view.SelectedVideoFile);

            this.SearchFacesCapturedAt(this.view.SelectedIP, 2, time);
        }
        void bindPiclist()
        {
            this.picList.Clear();
            this.imageList1.Images.Clear();

            DateTime time = ImageSearch.getDateTimeStr(videoList.FocusedItem.Tag as string);

            Camera selectedCamera = this.comboBox1.SelectedItem as Camera;

            ImagePair[] faces = null;

            try
            {
                faces = SearchProxy.FacesCapturedAt(2, time);
            }
            catch (System.ServiceModel.CommunicationException)
            {
                MessageBox.Show("通讯错误, 请重试");
                IChannel ch = SearchProxy as IChannel;
                if (ch.State == CommunicationState.Faulted)
                {
                    this.CreateProxy();
                }

                return;
            }


            if (faces.Length == 0)
            {
                return;
            }

            foreach (var aFace in faces)
            {
                this.imageList1.Images.Add(aFace.Face);
                string       text = System.IO.Path.GetFileName(aFace.FacePath);
                ListViewItem item = new ListViewItem
                {
                    Tag        = aFace,
                    Text       = text,
                    ImageIndex = this.imageList1.Images.Count - 1,
                };
                this.picList.Items.Add(item);
            }

            this.picList.Scrollable     = true;
            this.picList.MultiSelect    = false;
            this.picList.View           = View.LargeIcon;
            this.picList.LargeImageList = imageList1;
        }
Beispiel #6
0
        private void bestPicListView_ItemActivate(object sender, System.EventArgs e)
        {
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();

            Query.ImageSearch imageSearch = new ImageSearch();
            string[]          files       = imageSearch.SelectedBestImageChanged(this.bestPicListView.FocusedItem.Text, RemoteImaging.Query.ImageDirSys.BeginDir);
            this.secPicListView.Scrollable     = true;
            this.secPicListView.MultiSelect    = false;
            this.secPicListView.View           = View.LargeIcon;
            this.secPicListView.LargeImageList = imageList2;

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList2.Images.Add(Image.FromFile(files[i]));
                this.secPicListView.Items.Add(System.IO.Path.GetFileNameWithoutExtension(files[i]), i);
            }

            string filePath = RemoteImaging.Query.ImageDirSys.BeginDir + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(0, 2) + "\\" +
                              (2000 + int.Parse(this.bestPicListView.FocusedItem.Text.Substring(3, 2))).ToString() + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(5, 2) + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(7, 2) + "\\" + Query.ImageDirSys.IconPath + "\\" + this.bestPicListView.FocusedItem.Text;

            //show modify icon
            if (File.Exists(filePath))
            {
                this.pictureBox1.Image = Image.FromFile(filePath);
            }
            //

            //detail infomation
            Camera camera = new Camera();

            camera.ID             = 01;
            camera.Name           = "四川大学南大门摄像头";
            this.gotPlaceTxt.Text = "四川大学南大门摄像头";

            string focusedFileName = this.bestPicListView.FocusedItem.Text;

            this.gotTimeTxt.Text = (2000 + int.Parse(focusedFileName.Substring(3, 2))).ToString() + "年" + //year
                                   focusedFileName.Substring(5, 2) + "月" +                                //month
                                   focusedFileName.Substring(7, 2) + "日" +                                //day
                                   focusedFileName.Substring(9, 2) + "时" +                                //hour
                                   focusedFileName.Substring(11, 2) + "分" +                               //minute
                                   focusedFileName.Substring(13, 2) + "妙";                                //second

            //
        }
Beispiel #7
0
        private void bestPicListView_ItemActivate(object sender, System.EventArgs e)
        {
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();

            Query.ImageSearch imageSearch = new ImageSearch();
            string[] files = imageSearch.SelectedBestImageChanged(this.bestPicListView.FocusedItem.Text, RemoteImaging.Query.ImageDirSys.BeginDir);
            this.secPicListView.Scrollable = true;
            this.secPicListView.MultiSelect = false;
            this.secPicListView.View = View.LargeIcon;
            this.secPicListView.LargeImageList = imageList2;

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList2.Images.Add(Image.FromFile(files[i]));
                this.secPicListView.Items.Add(System.IO.Path.GetFileNameWithoutExtension(files[i]), i);
            }

            string filePath = RemoteImaging.Query.ImageDirSys.BeginDir + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(0, 2) + "\\" +
                              (2000 + int.Parse(this.bestPicListView.FocusedItem.Text.Substring(3, 2))).ToString() + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(5, 2) + "\\" +
                              this.bestPicListView.FocusedItem.Text.Substring(7, 2) + "\\" + Query.ImageDirSys.IconPath + "\\" + this.bestPicListView.FocusedItem.Text;

            //show modify icon
            if (File.Exists(filePath))
            {
                this.pictureBox1.Image = Image.FromFile(filePath);
            }
            //

            //detail infomation
            Camera camera = new Camera();
            camera.ID = 01;
            camera.Name = "四川大学南大门摄像头";
            this.gotPlaceTxt.Text = "四川大学南大门摄像头";

            string focusedFileName = this.bestPicListView.FocusedItem.Text;
            this.gotTimeTxt.Text = (2000 + int.Parse(focusedFileName.Substring(3, 2))).ToString() + "年" + //year
                                   focusedFileName.Substring(5, 2) + "月" + //month
                                   focusedFileName.Substring(7, 2) + "日" + //day
                                   focusedFileName.Substring(9, 2) + "时" + //hour
                                   focusedFileName.Substring(11, 2) + "分" + //minute
                                   focusedFileName.Substring(13, 2) + "妙";//second

            //
        }
Beispiel #8
0
        private void PopulateBigPicList(string iconFile)
        {
            this.imageList2.Images.Clear();

            string[] files = ImageSearch.SelectedBestImageChanged(iconFile);
            if (files == null)
            {
                MessageBox.Show("没有搜索到对应的二级图片", "警告");
                return;
            }

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList2.Images.Add(Image.FromFile(files[i]));
                string       text = System.IO.Path.GetFileName(files[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag        = files[i],
                    Text       = text,
                    ImageIndex = i
                };
            }
        }
Beispiel #9
0
        private void queryBtn_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ClearLists();

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }
            string cameraID = int.Parse(this.comboBox1.Text).ToString("D2");


            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);

            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }
            /////
            DateTimeInString dtString1 = DateTimeInString.FromDateTime(dateTime1);

            DateTimeInString dtString2 = DateTimeInString.FromDateTime(dateTime2);

            Query.ImageDirSys startDir = new ImageDirSys(cameraID, dtString1);
            Query.ImageDirSys endDir   = new ImageDirSys(cameraID, dtString2);

            imagesFound = ImageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.SearchType.PicType);

            if (imagesFound.Length == 0)
            {
                MessageBox.Show(this, "未找到图片");
                return;
            }


            CalcPagesCount();
            currentPage = 1;
            UpdatePagesLabel();


            if (imagesFound == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!", "警告");
                return;
            }

            this.bestPicListView.Scrollable     = true;
            this.bestPicListView.MultiSelect    = false;
            this.bestPicListView.View           = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;


            ShowCurrentPage();

            Cursor.Current = Cursors.Default;
        }
        private void queryBtn_Click(object sender, EventArgs e)
        {
            this.bestPicListView.Clear();
            this.imageList1.Images.Clear();
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();
            this.pictureBox1.Image = null;

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }
            string cameraID = int.Parse(this.comboBox1.Text).ToString("D2");

            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);
            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }
            /////
            string year1 = dateTime1.Year.ToString("D4");
            string month1 = dateTime1.Month.ToString("D2");
            string day1 = dateTime1.Day.ToString("D2");
            string hour1 = dateTime1.Hour.ToString("D2");
            string minute1 = dateTime1.Minute.ToString("D2");
            string second1 = dateTime1.Second.ToString("D2");

            string year2 = dateTime2.Year.ToString("D4");
            string month2 = dateTime2.Month.ToString("D2");
            string day2 = dateTime2.Day.ToString("D2");
            string hour2 = dateTime2.Hour.ToString("D2");
            string minute2 = dateTime2.Minute.ToString("D2");
            string second2 = dateTime2.Second.ToString("D2");

            Query.ImageDirSys startDir = new ImageDirSys(cameraID, year1, month1, day1, hour1, minute1, second1);
            Query.ImageDirSys endDir = new ImageDirSys(cameraID, year2, month2, day2, hour2, minute2, second2);
            Query.ImageSearch imageSearch = new ImageSearch();

            string[] files = imageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.SearchType.PicType);
            if (files == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!", "警告");
                return;
            }

            this.bestPicListView.Scrollable = true;
            this.bestPicListView.MultiSelect = false;
            this.bestPicListView.View = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;

            for (int i = 0; i < files.Length; ++i)
            {
                this.imageList1.Images.Add(Image.FromFile(files[i]));
                string text = System.IO.Path.GetFileName(files[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag = files[i],
                    Text = text,
                    ImageIndex = i
                };
                this.bestPicListView.Items.Add(item);
            }
        }
Beispiel #11
0
        private void queryBtn_Click(object sender, EventArgs e)
        {
            string cameraID = this.comboBox1.Text;

            string dataStr1    = this.dateTimePicker1.Text;
            int    indexYear1  = dataStr1.IndexOf("年");
            int    indexMonth1 = dataStr1.IndexOf("月");
            int    indexDay1   = dataStr1.IndexOf("日");

            string year1  = dataStr1.Substring(0, 4);
            string month1 = int.Parse(dataStr1.Substring(indexYear1 + 1, indexMonth1 - indexYear1 - 1)).ToString("D2");
            string day1   = int.Parse(dataStr1.Substring(indexMonth1 + 1, indexDay1 - indexMonth1 - 1)).ToString("D2");

            string timeStr1 = this.timeEdit1.Text;
            int    index1   = timeStr1.IndexOf(":");
            int    index2   = timeStr1.LastIndexOf(":");

            string hour1   = timeStr1.Substring(0, index1);
            string minute1 = timeStr1.Substring(index1 + 1, index2 - index1 - 1);
            string second1 = timeStr1.Substring(index2 + 1, timeStr1.Length - index2 - 1);

            string dataStr2    = this.dateTimePicker2.Text;
            int    indexYear2  = dataStr2.IndexOf("年");
            int    indexMonth2 = dataStr2.IndexOf("月");
            int    indexDay2   = dataStr2.IndexOf("日");

            string year2  = dataStr2.Substring(0, 4);
            string month2 = int.Parse(dataStr2.Substring(indexYear2 + 1, indexMonth2 - indexYear2 - 1)).ToString("D2");
            string day2   = int.Parse(dataStr2.Substring(indexMonth2 + 1, indexDay2 - indexMonth2 - 1)).ToString("D2");

            string timeStr2 = this.timeEdit2.Text;
            int    index3   = timeStr2.IndexOf(":");
            int    index4   = timeStr2.LastIndexOf(":");

            string hour2   = timeStr2.Substring(0, index3);
            string minute2 = timeStr2.Substring(index3 + 1, index4 - index3 - 1);
            string second2 = timeStr2.Substring(index4 + 1, timeStr2.Length - index4 - 1);

            //judge the input validation
            DateTime dateTime1 = new DateTime(int.Parse(year1), int.Parse(month1), int.Parse(day1), int.Parse(hour1), int.Parse(minute1), int.Parse(second1));
            DateTime dateTime2 = new DateTime(int.Parse(year2), int.Parse(month2), int.Parse(day2), int.Parse(hour2), int.Parse(minute2), int.Parse(second2));

            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }
            //

            this.bestPicListView.Clear();
            this.imageList1.Images.Clear();

            Query.ImageDirSys startDir    = new ImageDirSys(cameraID, year1, month1, day1, hour1, minute1, second1);
            Query.ImageDirSys endDir      = new ImageDirSys(cameraID, year2, month2, day2, hour2, minute2, second2);
            Query.ImageSearch imageSearch = new ImageSearch();

            string[] files = imageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.BeginDir);
            if (files == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!", "警告");
                return;
            }

            this.bestPicListView.Scrollable     = true;
            this.bestPicListView.MultiSelect    = false;
            this.bestPicListView.View           = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList1.Images.Add(Image.FromFile(files[i]));
                this.bestPicListView.Items.Add(System.IO.Path.GetFileName(files[i]), i);
            }
        }
        private void queryBtn_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            this.picList.Clear();

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }

            Camera selectedCamera = this.comboBox1.SelectedItem as Camera;


            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);

            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }

            if (StreamServerProxy != null && IsPlaying)
            {
                try
                {
                    StreamServerProxy.Stop();
                    IsPlaying = false;
                }
                catch (System.ServiceModel.EndpointNotFoundException)
                {
                }
            }

            CreateProxy();
            Video[] videos = null;



            try
            {
                videos = SearchProxy.SearchVideos(2, dateTime1, dateTime2);
            }
            catch (System.ServiceModel.CommunicationException)
            {
                MessageBox.Show("通讯错误, 请重试");
                IChannel ch = SearchProxy as IChannel;
                if (ch.State == CommunicationState.Faulted)
                {
                    this.CreateProxy();
                }

                return;
            }


            if (videos.Length == 0)
            {
                MessageBox.Show("没有搜索到满足条件的视频!", "警告");
                return;
            }

            this.videoList.Items.Clear();

            foreach (Video v in videos)
            {
                string       videoPath = v.Path;
                DateTime     dTime     = ImageSearch.getDateTimeStr(videoPath);//"2009-6-29 14:00:00"
                ListViewItem lvl       = new ListViewItem();
                lvl.Text = dTime.ToString();
                lvl.SubItems.Add(videoPath);
                lvl.Tag = videoPath;

                if (this.faceCapturedRadioButton.Checked)
                {
                    if (v.HasFaceCaptured)
                    {
                        lvl.ImageIndex = 0;
                        videoList.Items.Add(lvl);
                    }
                }

                if (this.allVideoRadioButton.Checked)
                {
                    if (v.HasFaceCaptured)
                    {
                        lvl.ImageIndex = 0;
                    }
                    else
                    {
                        lvl.ImageIndex = 1;
                    }
                    videoList.Items.Add(lvl);
                }
            }

            Cursor.Current = Cursors.Default;
        }
        private void queryBtn_Click(object sender, EventArgs e)
        {
            this.axVLCPlugin21.Toolbar = true;

            this.picList.Clear();

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }


            int cameraID = int.Parse(this.comboBox1.Text);

            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);

            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }

            Video[] videos = FileSystemStorage.VideoFilesBetween(cameraID, dateTime1, dateTime2);

            if (videos.Length == 0)
            {
                MessageBox.Show("没有搜索到满足条件的视频!", "警告");
                return;
            }

            this.videoList.Items.Clear();

            foreach (Video v in videos)
            {
                string       videoPath = v.Path;
                DateTime     dTime     = ImageSearch.getDateTimeStr(videoPath);//"2009-6-29 14:00:00"
                ListViewItem lvl       = new ListViewItem();
                lvl.Text = dTime.ToString();
                lvl.SubItems.Add(videoPath);
                lvl.Tag = videoPath;

                if (faceCapturedVideoRadioButton.Checked == true)
                {
                    if (v.HasFaceCaptured)
                    {
                        lvl.ImageIndex = 0;
                        videoList.Items.Add(lvl);
                    }
                }

                if (AllVideoTypeRadioButton.Checked == true)
                {
                    if (v.HasFaceCaptured)
                    {
                        lvl.ImageIndex = 0;
                    }
                    else
                    {
                        lvl.ImageIndex = 1;
                    }
                    videoList.Items.Add(lvl);
                }
            }
        }
        private void queryBtn_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ClearLists();

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }
            string cameraID = int.Parse(this.comboBox1.Text).ToString("D2");

            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);
            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }
            /////
            string year1 = dateTime1.Year.ToString("D4");
            string month1 = dateTime1.Month.ToString("D2");
            string day1 = dateTime1.Day.ToString("D2");
            string hour1 = dateTime1.Hour.ToString("D2");
            string minute1 = dateTime1.Minute.ToString("D2");
            string second1 = dateTime1.Second.ToString("D2");

            string year2 = dateTime2.Year.ToString("D4");
            string month2 = dateTime2.Month.ToString("D2");
            string day2 = dateTime2.Day.ToString("D2");
            string hour2 = dateTime2.Hour.ToString("D2");
            string minute2 = dateTime2.Minute.ToString("D2");
            string second2 = dateTime2.Second.ToString("D2");

            Query.ImageDirSys startDir = new ImageDirSys(cameraID, year1, month1, day1, hour1, minute1, second1);
            Query.ImageDirSys endDir = new ImageDirSys(cameraID, year2, month2, day2, hour2, minute2, second2);
            Query.ImageSearch imageSearch = new ImageSearch();

            imagesFound = imageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.SearchType.PicType);

            if (imagesFound.Length == 0)
            {
                MessageBox.Show(this, "未找到图片");
                return;
            }

            CalcPagesCount();
            currentPage = 1;
            UpdatePagesLabel();

            if (imagesFound == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!", "警告");
                return;
            }

            this.bestPicListView.Scrollable = true;
            this.bestPicListView.MultiSelect = false;
            this.bestPicListView.View = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;

            ShowCurrentPage();

            Cursor.Current = Cursors.Default;
        }
Beispiel #15
0
        private void queryBtn_Click(object sender, EventArgs e)
        {
            this.bestPicListView.Clear();
            this.imageList1.Images.Clear();
            this.secPicListView.Clear();
            this.imageList2.Images.Clear();
            this.pictureBox1.Image = null;

            if (this.comboBox1.Text == "" || this.comboBox1.Text == null)
            {
                MessageBox.Show("请选择要查询的摄像头ID", "警告");
                return;
            }
            string cameraID = int.Parse(this.comboBox1.Text).ToString("D2");


            //judge the input validation
            DateTime date1 = this.dateTimePicker1.Value;
            DateTime date2 = this.dateTimePicker2.Value;
            DateTime time1 = this.timeEdit1.Time;
            DateTime time2 = this.timeEdit2.Time;

            DateTime dateTime1 = new DateTime(date1.Year, date1.Month, date1.Day, time1.Hour, time1.Minute, time1.Second);
            DateTime dateTime2 = new DateTime(date2.Year, date2.Month, date2.Day, time2.Hour, time2.Minute, time2.Second);

            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!", "警告");
                return;
            }
            /////
            string year1   = dateTime1.Year.ToString("D4");
            string month1  = dateTime1.Month.ToString("D2");
            string day1    = dateTime1.Day.ToString("D2");
            string hour1   = dateTime1.Hour.ToString("D2");
            string minute1 = dateTime1.Minute.ToString("D2");
            string second1 = dateTime1.Second.ToString("D2");

            string year2   = dateTime2.Year.ToString("D4");
            string month2  = dateTime2.Month.ToString("D2");
            string day2    = dateTime2.Day.ToString("D2");
            string hour2   = dateTime2.Hour.ToString("D2");
            string minute2 = dateTime2.Minute.ToString("D2");
            string second2 = dateTime2.Second.ToString("D2");

            Query.ImageDirSys startDir    = new ImageDirSys(cameraID, year1, month1, day1, hour1, minute1, second1);
            Query.ImageDirSys endDir      = new ImageDirSys(cameraID, year2, month2, day2, hour2, minute2, second2);
            Query.ImageSearch imageSearch = new ImageSearch();

            string[] files = imageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.SearchType.PicType);
            if (files == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!", "警告");
                return;
            }

            this.bestPicListView.Scrollable     = true;
            this.bestPicListView.MultiSelect    = false;
            this.bestPicListView.View           = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;

            for (int i = 0; i < files.Length; ++i)
            {
                this.imageList1.Images.Add(Image.FromFile(files[i]));
                string       text = System.IO.Path.GetFileName(files[i]);
                ListViewItem item = new ListViewItem()
                {
                    Tag        = files[i],
                    Text       = text,
                    ImageIndex = i
                };
                this.bestPicListView.Items.Add(item);
            }
        }
Beispiel #16
0
        private void queryBtn_Click(object sender, EventArgs e)
        {
            string cameraID = this.comboBox1.Text;

            string dataStr1 = this.dateTimePicker1.Text;
            int indexYear1 = dataStr1.IndexOf("年");
            int indexMonth1 = dataStr1.IndexOf("月");
            int indexDay1 = dataStr1.IndexOf("日");

            string year1 = dataStr1.Substring(0,4);
            string month1 = int.Parse(dataStr1.Substring(indexYear1+1, indexMonth1-indexYear1-1)).ToString("D2");
            string day1 = int.Parse(dataStr1.Substring(indexMonth1+1,indexDay1-indexMonth1-1)).ToString("D2");

            string timeStr1 = this.timeEdit1.Text;
            int index1 = timeStr1.IndexOf(":");
            int index2 = timeStr1.LastIndexOf(":");

            string hour1 = timeStr1.Substring(0,index1);
            string minute1 = timeStr1.Substring(index1+1,index2-index1-1);
            string second1 = timeStr1.Substring(index2+1,timeStr1.Length-index2-1);

            string dataStr2 = this.dateTimePicker2.Text;
            int indexYear2 = dataStr2.IndexOf("年");
            int indexMonth2 = dataStr2.IndexOf("月");
            int indexDay2 = dataStr2.IndexOf("日");

            string year2 = dataStr2.Substring(0, 4);
            string month2 = int.Parse(dataStr2.Substring(indexYear2 + 1, indexMonth2 - indexYear2 - 1)).ToString("D2");
            string day2 = int.Parse(dataStr2.Substring(indexMonth2 + 1, indexDay2 - indexMonth2 - 1)).ToString("D2");

            string timeStr2 = this.timeEdit2.Text;
            int index3 = timeStr2.IndexOf(":");
            int index4 = timeStr2.LastIndexOf(":");

            string hour2 = timeStr2.Substring(0, index3);
            string minute2 = timeStr2.Substring(index3 + 1, index4 - index3 - 1);
            string second2 = timeStr2.Substring(index4 + 1, timeStr2.Length - index4 - 1);

            //judge the input validation
            DateTime dateTime1 = new DateTime(int.Parse(year1),int.Parse(month1),int.Parse(day1),int.Parse(hour1),int.Parse(minute1),int.Parse(second1));
            DateTime dateTime2 = new DateTime(int.Parse(year2), int.Parse(month2), int.Parse(day2), int.Parse(hour2), int.Parse(minute2), int.Parse(second2));
            if (dateTime1 >= dateTime2)
            {
                MessageBox.Show("时间起点不应该大于或者等于时间终点,请重新输入!","警告");
                return;
            }
            //

            this.bestPicListView.Clear();
            this.imageList1.Images.Clear();

            Query.ImageDirSys startDir = new ImageDirSys(cameraID, year1, month1, day1, hour1, minute1, second1);
            Query.ImageDirSys endDir = new ImageDirSys(cameraID, year2, month2, day2, hour2, minute2, second2);
            Query.ImageSearch imageSearch = new ImageSearch();

            string[] files = imageSearch.SearchImages(startDir, endDir, RemoteImaging.Query.ImageDirSys.BeginDir);
            if (files == null)
            {
                MessageBox.Show("没有搜索到满足条件的图片!","警告");
                return;
            }

            this.bestPicListView.Scrollable = true;
            this.bestPicListView.MultiSelect = false;
            this.bestPicListView.View = View.LargeIcon;
            this.bestPicListView.LargeImageList = imageList1;

            for (int i = 0; i < files.Length; i++)
            {
                this.imageList1.Images.Add(Image.FromFile(files[i]));
                this.bestPicListView.Items.Add(System.IO.Path.GetFileName(files[i]), i);
            }
        }