Beispiel #1
0
        private static SDatinfo CreateDatinfo(string fname, SubProductCatalogDef catalogDef)
        {
            string          infoFileName = GetInfoFileName(fname);
            CatalogItemInfo ctl;

            if (!File.Exists(infoFileName))
            {
                ctl = TryCreateInfoFromMainFile(fname, infoFileName, catalogDef);
            }
            else
            {
                ctl = new CatalogItemInfo(infoFileName);
                if (!ctl.Properties.ContainsKey("CatalogDef") ||
                    string.IsNullOrEmpty(ctl.Properties["CatalogDef"].ToString()) ||
                    !ctl.Properties.ContainsKey("CycFlagCN"))
                {
                    ctl = TryCreateInfoFromMainFile(fname, infoFileName, catalogDef);
                }
            }
            if (ctl == null)
            {
                ctl = new CatalogItemInfo(infoFileName);
            }
            var datinfo = new SDatinfo
            {
                CatalogDef         = ctl.GetPropertyValue("CatalogDef"),
                CatalogItemCN      = ctl.GetPropertyValue("CatalogItemCN"),
                CycFlagCN          = ctl.GetPropertyValue("CycFlagCN"),
                ExtInfos           = ctl.GetPropertyValue("ExtInfos"),
                FileDir            = ctl.GetPropertyValue("FileDir"),
                FileName           = ctl.GetPropertyValue("FileName"),
                OrbitDateTime      = ctl.GetPropertyValue("OrbitDateTime"),
                OrbitTimeGroup     = ctl.GetPropertyValue("OrbitTimeGroup"),
                OrbitTimes         = ctl.GetPropertyValue("OrbitTimes"),
                ProductIdentify    = ctl.GetPropertyValue("ProductIdentify"),
                Region             = ctl.GetPropertyValue("Region"),
                Satellite          = ctl.GetPropertyValue("Satellite"),
                Sensor             = ctl.GetPropertyValue("Sensor"),
                SubProductIdentify = ctl.GetPropertyValue("SubProductIdentify"),
                SourceFileName     = fname
            };

            return(datinfo);
        }
Beispiel #2
0
        public CatalogItem(SDatinfo datinfo)
        {
            _fileName = datinfo.SourceFileName;
            var info = new CatalogItemInfo();

            info.Properties.Add("ProductIdentify", datinfo.ProductIdentify);
            info.Properties.Add("SubProductIdentify", datinfo.SubProductIdentify);
            info.Properties.Add("FileName", datinfo.FileName);
            info.Properties.Add("FileDir", datinfo.FileDir);
            info.Properties.Add("CatalogDef", datinfo.CatalogDef);
            info.Properties.Add("Satellite", datinfo.Satellite);
            info.Properties.Add("Sensor", datinfo.Sensor);
            info.Properties.Add("OrbitDateTime", datinfo.OrbitDateTime);
            info.Properties.Add("OrbitTimeGroup", datinfo.OrbitTimeGroup);
            info.Properties.Add("CatalogItemCN", datinfo.CatalogItemCN);
            info.Properties.Add("Region", datinfo.Region);
            info.Properties.Add("ExtInfos", datinfo.ExtInfos);
            info.Properties.Add("CycFlagCN", datinfo.CycFlagCN);
            info.Properties.Add("OrbitTimes", datinfo.OrbitTimes);
            _info = info;
        }