Пример #1
0
        private void LoadProgress()
        {
            System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(ImageBladeGroup));
            System.IO.StreamReader file = new System.IO.StreamReader(PATH_TO_SAVED_PROG_FILE);
            this.ImageGroup = (ImageBladeGroup)reader.Deserialize(file);

            if ((this.ImageGroup.Blade == "") || (this.ImageGroup.AssetName == "") || (this.ImageGroup.SiteName == "") || (this.ImageGroup.Latitude == ""))
            {
                Dictionary <string, string> InfoData = new Dictionary <string, string>();
                string infoFile = Path.Combine(this.ImageGroup.BaseDirectory, "ExtraInfo.txt");
                if (File.Exists(infoFile))
                {
                    string[] lines = System.IO.File.ReadAllLines(infoFile);
                    foreach (string line in lines)
                    {
                        string[] parts = line.Split(':');
                        if (parts.Length > 1)
                        {
                            parts[1] = parts[1].Trim();
                            parts[0] = parts[0].Trim();
                            InfoData.Add(parts[0], parts[1]);
                        }
                    }
                    this.ImageGroup.AssetName = InfoData["Turbine"];
                    this.ImageGroup.Blade     = InfoData["Blade"];
                    this.ImageGroup.SiteName  = InfoData["Site name"];
                    this.ImageGroup.Latitude  = InfoData["Latitude"];
                    this.ImageGroup.Longitude = InfoData["Longitude"];
                }
            }


            file.Close();
        }
Пример #2
0
        public ImageBladeGroup SortImagesByPasses(ImageBladeGroup ImageGroup)
        {
            ImageGroup.FullImageList = SortImagesByType(ImageGroup.FullImageList);
            ImageGroup.FullImageList = MiddleOutSelect(ImageGroup.FullImageList, ImageLocationType.Pass1);
            ImageGroup.FullImageList = MiddleOutSelect(ImageGroup.FullImageList, ImageLocationType.Pass2);
            ImageGroup.FullImageList = MiddleOutSelect(ImageGroup.FullImageList, ImageLocationType.Pass3);
            ImageGroup.FullImageList = MiddleOutSelect(ImageGroup.FullImageList, ImageLocationType.Pass4);
            ImageGroup.FullImageList = GetTipImages(ImageGroup.FullImageList);

            return(ImageGroup);
        }