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); }
public MonitoringSubProduct(SubProductDef subProductDef) { _subProductDef = subProductDef; if (subProductDef == null) { return; } _name = subProductDef.Name; _identify = subProductDef.Identify; if (subProductDef.Algorithms == null || subProductDef.Algorithms.Length == 0) { return; } //通过默认算法设置参数提供者 _algorithmDefs = new List <AlgorithmDef>(subProductDef.Algorithms); if (_algorithmDefs.Count > 0) { ExtractProductIdentify pid = new ExtractProductIdentify(); pid.ThemeIdentify = subProductDef.ProductDef.Theme.Identify; pid.ProductIdentify = subProductDef.ProductDef.Identify; pid.SubProductIdentify = subProductDef.Identify; _argumentProvider = MonitoringThemeFactory.GetArgumentProvider(pid, _algorithmDefs[0].Identify); _argumentProvider.SetArg("AlgorithmName", _algorithmDefs[0].Identify); } }
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))); }
private IArgumentProvider GetDefaultArgProvider(string algIdentify, string satellite, string sensor, string[] args) { ExtractProductIdentify id1 = new ExtractProductIdentify(); id1.ProductIdentify = _subProductDef.ProductDef.Identify; id1.SubProductIdentify = _subProductDef.Identify; id1.ThemeIdentify = "CMA"; return(MonitoringThemeFactory.GetArgumentProvider(id1, algIdentify, satellite, sensor)); }
public AlgorithmDef UseDefaultAlgorithm(string productIdentify) { if (_algorithmDefs == null || _algorithmDefs.Count == 0) { return(null); } ExtractProductIdentify pid = new ExtractProductIdentify(); pid.ProductIdentify = productIdentify; pid.SubProductIdentify = _identify; pid.ThemeIdentify = "CMA"; _argumentProvider = MonitoringThemeFactory.GetArgumentProvider(pid, _algorithmDefs[0].Identify); return(_algorithmDefs[0]); }
private IArgumentProvider GetDefaultArgProvider(string satellite, string sensor, string[] args) { ExtractProductIdentify id1 = new ExtractProductIdentify(); id1.ProductIdentify = _subProductDef.ProductDef.Identify; id1.SubProductIdentify = _subProductDef.Identify; id1.ThemeIdentify = "CMA"; // ExtractAlgorithmIdentify id2 = new ExtractAlgorithmIdentify(); id2.Satellite = satellite; id2.Sensor = sensor; id2.CustomIdentify = (args != null && args.Length > 0) ? args[0] : null; // return(MonitoringThemeFactory.GetArgumentProvider(id1, id2)); }
public void ResetArgumentProvider(string algIdentify) { ExtractProductIdentify pid = new ExtractProductIdentify(); pid.ThemeIdentify = "CMA"; pid.ProductIdentify = _subProductDef.ProductDef.Identify; pid.SubProductIdentify = _subProductDef.Identify; IArgumentProvider prd = MonitoringThemeFactory.GetArgumentProvider(pid, algIdentify); if (prd != null) { string[] argNames = prd.ArgNames; if (argNames != null) { foreach (string name in argNames) { _argumentProvider.SetArg(name, prd.GetArg(name)); } } } }
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); }
public void ResetArgumentProvider(string algIdentify) { ExtractProductIdentify pid = new ExtractProductIdentify(); pid.ThemeIdentify = _subProductDef.ProductDef.Theme.Identify; pid.ProductIdentify = _subProductDef.ProductDef.Identify; pid.SubProductIdentify = _subProductDef.Identify; Dictionary <string, object> algShare = ReadAlgShareArg(); IArgumentProvider prd = MonitoringThemeFactory.GetArgumentProvider(pid, algIdentify); if (prd != null) { string[] argNames = prd.ArgNames; if (argNames != null) { foreach (string name in argNames) { _argumentProvider.SetArg(name, prd.GetArg(name)); } } } CopyAlgShareArg(algShare); UpdateCurrentAlgorithmDef(algIdentify); }