Exemple #1
0
        public static IImageDetails AnalyseImageDetails(
            string path,
            ILocationManager locationManager,
            IClsNmbManager clsNmbManager,
            IFaultManager faultManager)
        {
            IImageDetails image;

            string imageName = System.IO.Path.GetFileName(path);

            string[] filenameArray = imageName.Split(extensionSeparator);

            string[] inputArray = filenameArray[0].Split(majorTick);

            if (inputArray.Length < 2 || inputArray.Length > 4)
            {
                faultManager.AddFault(
                    "Can't split into nmb and stn",
                    imageName);
            }

            string[] nmbsArray = inputArray[0].Split(minorTick);

            ILocation stn =
                locationManager.GetStn(
                    inputArray[1]);

            string year =
                inputArray.Length > 2 ?
                inputArray[2] :
                string.Empty;

            string multipleNote =
                inputArray.Length > 3 ?
                inputArray[3] :
                string.Empty;

            image =
                new ImageDetails(
                    path,
                    year,
                    stn,
                    multipleNote);

            ClsClass clss =
                ImageDetailFactory.GetCls(
                    nmbsArray.ToList(),
                    path,
                    faultManager,
                    clsNmbManager);

            image.SetClss(
                clss.Clss,
                clss.PresentNmbs);

            return(image);
        }
Exemple #2
0
        private void AnalyseFiles(
            string[] files,
            ILocationManager locationManager,
            IClsNmbManager clsNmbManager,
            IFaultManager faultManager)
        {
            //List<IImageDetails> images = new List<IImageDetails>();

            for (int index = 0; index < files.Length; ++index)
            {
                IImageDetails image =
                    ImageDetailFactory.AnalyseImageDetails(
                        files[index],
                        locationManager,
                        clsNmbManager,
                        faultManager);

                this.images.Add(image);
            }

            //return this.images;
        }