Пример #1
0
        public static IArgumentProvider GetArgumentProvider(ExtractProductIdentify productIdentify, ExtractAlgorithmIdentify algorithmIdentify)
        {
            if (productIdentify == null || algorithmIdentify == null)
            {
                return(null);
            }
            ThemeDef theme = GetThemeDefByIdentify(productIdentify.ThemeIdentify);

            if (theme == null)
            {
                return(null);
            }
            ProductDef prd = theme.GetProductDefByIdentify(productIdentify.ProductIdentify);

            if (prd == null)
            {
                return(null);
            }
            SubProductDef subPrd = prd.GetSubProductDefByIdentify(productIdentify.SubProductIdentify);

            if (subPrd == null)
            {
                return(null);
            }
            AlgorithmDef      alg    = subPrd.GetAlgorithmDefByAlgorithmIdentify(algorithmIdentify);
            IArgumentProvider argprd = CreateArgumentProvider(alg, BandRefTableHelper.GetBandRefTable(algorithmIdentify.Satellite, algorithmIdentify.Sensor));

            if (argprd != null)
            {
                argprd.SetArg("AlgorithmName", alg.Identify);
            }
            return(argprd);
        }
Пример #2
0
        private void GetProductNameByIdentify()
        {
            if (string.IsNullOrEmpty(ProductIdentify))
            {
                return;
            }
            ThemeDef theme = MonitoringThemeFactory.GetThemeDefByIdentify("CMA");

            if (theme == null)
            {
                return;
            }
            ProductDef pro = theme.GetProductDefByIdentify(ProductIdentify);

            if (pro == null)
            {
                return;
            }
            ProductName = pro.Name;
            if (string.IsNullOrEmpty(SubProductIdentify))
            {
                return;
            }
            SubProductDef subPro = pro.GetSubProductDefByIdentify(SubProductIdentify);

            if (subPro == null)
            {
                return;
            }
            SubProductName = subPro.Name;
        }
Пример #3
0
        public static IArgumentProvider GetArgumentProvider(ExtractProductIdentify productIdentify, string algorithmIdentify, string satellite, string sensor)
        {
            if (productIdentify == null || algorithmIdentify == null)
            {
                return(null);
            }
            ThemeDef theme = GetThemeDefByIdentify(productIdentify.ThemeIdentify);

            if (theme == null)
            {
                return(null);
            }
            ProductDef prd = theme.GetProductDefByIdentify(productIdentify.ProductIdentify);

            if (prd == null)
            {
                return(null);
            }
            SubProductDef subPrd = prd.GetSubProductDefByIdentify(productIdentify.SubProductIdentify);

            if (subPrd == null)
            {
                return(null);
            }
            AlgorithmDef alg = subPrd.GetAlgorithmDefByIdentify(algorithmIdentify);

            return(CreateArgumentProvider(alg, BandRefTableHelper.GetBandRefTable(satellite, sensor)));
        }
Пример #4
0
 public MonitoringProduct()
 {
     _productDef = GetProductDef();
     if (_productDef == null)
     {
         throw new Exception("加载产品失败" + _name);
     }
     Init(_productDef);
 }
Пример #5
0
 protected virtual void Init(ProductDef productDef)
 {
     _productDef = productDef;
     if (_productDef != null)
     {
         _name = productDef.Name;
     }
     _identify = productDef.Identify;
 }
Пример #6
0
 public virtual void Dispose()
 {
     if (_subProducts != null && _subProducts.Count > 0)
     {
         foreach (IMonitoringSubProduct prd in _subProducts)
         {
             prd.Dispose();
         }
         _subProducts.Clear();
         _subProducts = null;
     }
     _productDef = null;
 }
Пример #7
0
        protected virtual void Init(ProductDef productDef)
        {
            _productDef = productDef;
            _identify   = productDef.Identify;
            _name       = productDef.Name;
            Dictionary <string, Type> subprds = LoadSubProducts();

            if (subprds != null)
            {
                foreach (string id in subprds.Keys)
                {
                    SubProductDef def = _productDef.GetSubProductDefByIdentify(id);
                    object        obj = Activator.CreateInstance(subprds[id], def);
                    if (obj != null)
                    {
                        _subProducts.Add(obj as IMonitoringSubProduct);
                    }
                }
            }
        }
Пример #8
0
        public static IArgumentProvider GetArgumentProvider(ExtractProductIdentify productIdentify, string algorithmIdentify)
        {
            if (productIdentify == null || algorithmIdentify == null)
            {
                return(null);
            }
            ThemeDef theme = GetThemeDefByIdentify(productIdentify.ThemeIdentify);

            if (theme == null)
            {
                return(null);
            }
            ProductDef prd = theme.GetProductDefByIdentify(productIdentify.ProductIdentify);

            if (prd == null)
            {
                return(null);
            }
            SubProductDef subPrd = prd.GetSubProductDefByIdentify(productIdentify.SubProductIdentify);

            if (subPrd == null)
            {
                return(null);
            }
            AlgorithmDef      alg    = subPrd.GetAlgorithmDefByIdentify(algorithmIdentify);
            IArgumentProvider argPrd = CreateArgumentProvider(alg, null);

            if (alg.Bands != null)
            {
                foreach (BandDef b in alg.Bands)
                {
                    argPrd.SetArg(b.Identify, b.BandNo);
                }
            }
            return(argPrd);
        }
Пример #9
0
        private ProductDef CreatProduct(XElement element, ThemeDef theme)
        {
            ProductDef product = new ProductDef();

            product.Theme = theme;
            string value = element.Attribute("name").Value;

            if (!String.IsNullOrEmpty(value))
            {
                product.Name = value;
            }
            value = element.Attribute("image").Value;
            if (!String.IsNullOrEmpty(value))
            {
                product.Image = value;
            }
            value = element.Attribute("group").Value;
            if (!String.IsNullOrEmpty(value))
            {
                product.Group = value;
            }
            value = element.Attribute("uiprovider").Value;
            if (!String.IsNullOrEmpty(value))
            {
                product.UIProvider = value;
            }
            value = element.Attribute("identify").Value;
            if (!String.IsNullOrEmpty(value))
            {
                product.Identify = value;
            }
            IEnumerable <XElement> subProductsElements = element.Element(XName.Get("SubProducts")).Elements();

            if (subProductsElements != null && subProductsElements.Count() != 0)
            {
                SubProductDef        subPro;
                List <SubProductDef> subs = new List <SubProductDef>();
                foreach (XElement ele in subProductsElements)
                {
                    subPro = CreatSubProduct(ele);
                    if (subPro != null)
                    {
                        subs.Add(subPro);
                    }
                    subPro.ProductDef = product;
                    //Console.WriteLine("SubProduct:"+ele.Attribute("name").Value);
                }
                if (subs != null && subs.Count != 0)
                {
                    product.SubProducts = subs.ToArray();
                }
            }
            IEnumerable <XElement> aoisElements = Elements(element.Element("AOITemplates"));

            if (aoisElements != null && aoisElements.Count() != 0)
            {
                List <AOITemplate> aoiList = new List <AOITemplate>();
                foreach (XElement ele in aoisElements)
                {
                    AOITemplate aoi = CreateAOITemplate(ele);
                    if (aoi != null)
                    {
                        aoiList.Add(aoi);
                    }
                }
                product.AOITemplates = aoiList.ToArray();
            }
            return(product);
        }
Пример #10
0
 public MonitoringProduct()
 {
     _productDef = GetProductDef();
     Init(_productDef);
 }
Пример #11
0
        protected override void Init(GeoDo.RSS.MIF.Core.ProductDef productDef)
        {
            base.Init(productDef);
            _identify = productDef.Identify;
            SubProductDef subProductDef = productDef.GetSubProductDefByIdentify("DBLV");

            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBinaryBag(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("0CLM");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBinaryCLM(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("WTGS");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBinaryWTGS(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BPCD");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductPixelCoverRate(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BACD");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBAGCoverDegree(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCCA");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBagStatisticArea(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCDA");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBagStatAreaByDegree(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCDE");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBagStatAreaByIntensity(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("0IMG");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductIMGBAG(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("STAT");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductSTATBAG(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("FREQ");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductFREQBAG(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCDF");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBAGFreqByCoverDegree(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCAF");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBAGFreqByCoverArea(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("TFRV");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductTFRVBAG(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("THAN");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductTHANBAG(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("FREO");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductFREQBAGOld(subProductDef));
            }
            subProductDef = productDef.GetSubProductDefByIdentify("BCDO");
            if (subProductDef != null)
            {
                _subProducts.Add(new SubProductBAGOldFreqByCoverDegree(subProductDef));
            }
        }