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 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))); }
public static void SetBandArgs(IMonitoringSubProduct subProduct, string satellite, string sensor, params object[] args) { if (subProduct.ArgumentProvider == null || subProduct.ArgumentProvider.CurrentAlgorithmDef == null) { return; } BandnameRefTable bandRefTable = BandRefTableHelper.GetBandRefTable(satellite, sensor); bool isOK = false; if (bandRefTable != null) { isOK = SetBands(subProduct.ArgumentProvider, subProduct.ArgumentProvider.CurrentAlgorithmDef.Bands, bandRefTable); (subProduct.ArgumentProvider as ArgumentProvider).BandArgsIsSetted = true; } if (!isOK) { isOK = SetBands(subProduct.ArgumentProvider, subProduct.ArgumentProvider.CurrentAlgorithmDef.Bands); (subProduct.ArgumentProvider as ArgumentProvider).BandArgsIsSetted = isOK; } }
public static void FillDefaultArguments(IArgumentProvider argumentProvider, AlgorithmDef alg, string satellite, string sensor) { argumentProvider.Reset(); SetBands(argumentProvider, alg.Bands, BandRefTableHelper.GetBandRefTable(satellite, sensor)); SetArguments(argumentProvider, alg.Arguments); }