Пример #1
0
        public void Serch_file(PanelPathManager new_panel_list)
        {
            PanelPathManager panel_list  = new PanelPathManager();
            List <string>    search_list = new Disk_part().getall; // get serch disk name;

            foreach (var search_disk in search_list)
            {
                Console.WriteLine("pc: {1} ; disk: {0}", search_disk, PcIp);
                try
                {
                    string        diskpath1             = Path.Combine(PcIp, "NetworkDrive", search_disk, "Defect Info", "Origin");
                    string        diskpath2             = Path.Combine(PcIp, "NetworkDrive", search_disk, "Defect Info", "Result");
                    List <string> image_directory_list  = Directory.GetDirectories(diskpath1).ToList();
                    List <string> result_directory_list = Directory.GetDirectories(diskpath2).ToList();
                    image_directory_list.Sort();
                    result_directory_list.Sort();

                    foreach (var item in image_directory_list)
                    {
                        string this_panel_result_dir = result_directory_list.FirstOrDefault(x => { return(x.Substring(x.Length - 17) == item.Substring(item.Length - 17)); });
                        if (this_panel_result_dir != null)
                        {
                            PanelPathContainer this_panel = new PanelPathContainer(item.Substring(item.Length - 17), item, this_panel_result_dir, EqId, PcName, search_disk);
                            panel_list.PanelPathAdd(this_panel);
                            result_directory_list.Remove(this_panel_result_dir);
                        }
                        else
                        {
                            log_list.Add(String.Format("result file not exist; panel id : {0}; path: {1}", item.Substring(item.Length - 17), item));
                            //Console.WriteLine("result file not exist: {0}",item.Name);
                        }
                    }

                    foreach (var item in result_directory_list)
                    {
                        string this_panel_image_dir = image_directory_list.FirstOrDefault(x => { return(x.Substring(x.Length - 17) == item.Substring(item.Length - 17)); });
                        if (this_panel_image_dir != null)
                        {
                            PanelPathContainer this_panel = new PanelPathContainer(item.Substring(item.Length - 17), this_panel_image_dir, item, EqId, PcName, search_disk);
                            if (!panel_list.Contains(this_panel.Panel_id))
                            {
                                panel_list.PanelPathAdd(this_panel);
                            }
                            image_directory_list.Remove(this_panel_image_dir);
                        }
                        else
                        {
                            log_list.Add(String.Format("image file not exist; panel id : {0}; path: {0}", item.Substring(item.Length - 17), item));
                        }
                    }
                }

                catch (Exception e)
                {
                    log_list.Add(String.Format("查询文件失败:{0}", e.Message));
                }
            }
            Console.WriteLine("pc: {0} finishied;", PcIp);
            new_panel_list.AddRange(panel_list);
        }
Пример #2
0
 public PanelMission(string panelId, MissionType type, PanelPathContainer panelPath)
 {
     PanelId       = panelId;
     Repetition    = 1; // TODO:设置任务人员检查
     PanelJudge    = new PanelJudgeTable();
     Type          = type;
     AddTime       = DateTime.Now;
     Complete      = false;
     PanelPath     = panelPath;
     MissionNumber = DateTime.Now.ToBinary();
 }
Пример #3
0
 public void PanelPathAdd(PanelPathContainer thispanel)
 {
     lock (ContainerLock)
     {
         if (theContainer.ContainsKey(thispanel.Panel_id))
         {
             theContainer[thispanel.Panel_id].Add(thispanel);
         }
         else
         {
             theContainer.Add(thispanel.Panel_id, new List <PanelPathContainer> {
                 thispanel
             });
         }
     }
 }