From d23b1f4f17fc7d86b65856c0b2a6090f19344a8f Mon Sep 17 00:00:00 2001 From: Tim Jensen Date: Tue, 29 Mar 2016 12:52:23 -0500 Subject: [PATCH] Omaha #5491: Add additional special case for QPFSCAN Change-Id: I9c4e84314054a6913f7b067eab3808e5acadab94 Former-commit-id: 375ce5c253a37d6b5fce19ce4802e0186a07282c --- .../edex/plugin/ffmp/common/FFMPConfig.java | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java index 6738ebc69d..5e67d18902 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/common/FFMPConfig.java @@ -30,6 +30,7 @@ import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; +import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.SOURCE_TYPE; import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager; import com.raytheon.uf.common.monitor.config.FFTIDataManager; import com.raytheon.uf.common.monitor.processing.IMonitorProcessing; @@ -61,7 +62,7 @@ import com.vividsolutions.jts.geom.GeometryFactory; * Aug 08, 2015 4722 dhladky Simplified source map additions, config. * Sep.09, 2015 4756 dhladky Further simplified configuration. * Mar 04, 2016 5429 dhladky Special case for RFCFFG multi-RFC mosaics. - * + * Mar 29, 2016 5491 tjensen Special case for QPFSCAN * * * @author dhladky @@ -333,23 +334,23 @@ public class FFMPConfig { String[] keys = dataKey.split(":"); String checkSourceName = null; String sourceKey = null; - + if (keys != null && keys.length > 1) { checkSourceName = keys[0]; sourceKey = keys[1]; } else { checkSourceName = dataKey; - } + } if (checkSourceName.equals(sourceName)) { String dataUri = sourceMap.get(dataKey); Object dataObject = null; - + if (source.getDataType().equals( FFMPSourceConfigurationManager.DATA_TYPE.XMRG .getDataType())) { - dataObject = getXMRGFile(dataUri); + dataObject = getXMRGFile(dataUri); } else if (source.getDataType().equals( FFMPSourceConfigurationManager.DATA_TYPE.PDO .getDataType())) { @@ -363,8 +364,9 @@ public class FFMPConfig { .getDataType())) { dataObject = getGrib(dataUri); } - - sourceHash = processSource(sourceHash, dataObject, source, sourceKey); + + sourceHash = processSource(sourceHash, dataObject, + source, sourceKey); } } @@ -380,7 +382,6 @@ public class FFMPConfig { e); } } - /** * Grab the XMRG file for use @@ -433,17 +434,20 @@ public class FFMPConfig { public HashMap getSourceData(String sourceName) { return sources.get(sourceName); } - + /** * Process the sources from the URIfilter and ready them for processing. + * * @param sourceHash * @param dataObject * @param source * @param sourceKey * @return sourceHash */ - private HashMap processSource(HashMap sourceHash, Object dataObject, SourceXML source, String sourceKey) { - + private HashMap processSource( + HashMap sourceHash, Object dataObject, + SourceXML source, String sourceKey) { + if (dataObject != null) { // Is this a primary source? ProductXML product = ffmpgen.getSourceConfig().getProduct( @@ -472,22 +476,26 @@ public class FFMPConfig { HashMap virtSourceHash = new HashMap(); virtSourceHash.put(sourceKey, dataObject); sources.put(product.getVirtual(), virtSourceHash); - } else if (source.isRfc()){ - // The special case of RFCFFG, must have separate URI's for each RFC mosaic piece - // Use existing sourceKey that designates that mosaic piece. + } else if (source.isRfc()) { + /* + * The special case of RFCFFG, must have separate URI's for each + * RFC mosaic piece. Use existing sourceKey that designates that + * mosaic piece. + */ + } else if (source.getSourceType().equals(SOURCE_TYPE.QPF.name())) { + /* + * The special case of QPFSCAN. Use existing sourceKey that + * designates that mosaic piece. + */ } else { - // NON Primary sources, find the primary. - String primarySource = ffmpgen - .getSourceConfig() + // NON Primary sources, find the primary. + String primarySource = ffmpgen.getSourceConfig() .getPrimarySource(source); // Find the sourceKey to run against. - for (ProductRunXML productRun : ffmpgen - .getRunConfig().getRunner(getCWA()) - .getProducts()) { - if (productRun.getProductName().equals( - primarySource)) { - sourceKey = productRun - .getProductKey(); + for (ProductRunXML productRun : ffmpgen.getRunConfig() + .getRunner(getCWA()).getProducts()) { + if (productRun.getProductName().equals(primarySource)) { + sourceKey = productRun.getProductKey(); break; } } @@ -495,7 +503,7 @@ public class FFMPConfig { // Add to hash of sources to be processed. sourceHash.put(sourceKey, dataObject); } - + return sourceHash; }