diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelUtilities.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelUtilities.java index f6cf111c91..ee065cd1cf 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelUtilities.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelUtilities.java @@ -24,6 +24,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.NavigableSet; +import java.util.Set; import java.util.TreeSet; import javax.measure.unit.Unit; @@ -34,6 +35,7 @@ import com.raytheon.uf.common.dataplugin.level.CompareType; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.MasterLevel; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.viz.core.exception.VizCommunicationException; /** @@ -57,8 +59,8 @@ public class LevelUtilities { static { try { - hPa = (Unit) UnitFormat.getUCUMInstance().parseProductUnit( - "hPa", new ParsePosition(0)); + hPa = UnitFormat.getUCUMInstance().parseProductUnit("hPa", + new ParsePosition(0)); } catch (Exception e) { // this is bad } @@ -122,7 +124,15 @@ public class LevelUtilities { }; Map> masterLevelToOrderedSet = new HashMap>(); - for (Level level : LevelMappingFactory.getInstance().getAllLevels()) { + Set allLevels; + try { + allLevels = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels(); + } catch (CommunicationException e) { + throw new VizCommunicationException(e); + } + for (Level level : allLevels) { NavigableSet levels = masterLevelToOrderedSet.get(level .getMasterLevel().getName()); if (levels == null) { diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF index f4e82edc0c..e6600a06ad 100644 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF @@ -15,11 +15,12 @@ Require-Bundle: org.eclipse.core.runtime, com.raytheon.viz.core;bundle-version="1.12.1174", com.raytheon.viz.core.graphing;bundle-version="1.12.1174", com.raytheon.uf.viz.xy.timeseries;bundle-version="1.12.1174", - javax.measure;bundle-version="1.0.0" + javax.measure;bundle-version="1.0.0", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174", + com.raytheon.uf.common.comm;bundle-version="1.12.1174" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: com.raytheon.uf.common.dataplugin, com.raytheon.uf.common.dataplugin.grid, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.dataplugin.radar, com.raytheon.uf.common.dataplugin.radar.util, com.raytheon.uf.common.dataquery.requests, diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java index 8ad51cafd0..5d99123897 100644 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java +++ b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java @@ -35,6 +35,8 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.geospatial.MapUtil; @@ -44,8 +46,6 @@ import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.level.LevelUtilities; import com.raytheon.uf.viz.core.rsc.DisplayType; import com.raytheon.uf.viz.core.style.level.SingleLevel; @@ -238,6 +238,7 @@ public class PointDataTimeSeriesAdapter extends return loadDataOAInternal(recordsToLoad); } + @Override public SingleLevel getLevel() { SingleLevel level = new SingleLevel("SURFACE"); level.setValue(0.0); @@ -246,7 +247,8 @@ public class PointDataTimeSeriesAdapter extends return level; } try { - LevelMapping mapping = LevelMappingFactory.getInstance() + LevelMapping mapping = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForKey(resourceData.getLevelKey()); for (Level l : mapping.getLevels()) { if (LevelUtilities.isPressureLevel(l)) { @@ -260,7 +262,7 @@ public class PointDataTimeSeriesAdapter extends } } } - } catch (VizException e) { + } catch (Exception e) { // return the default } return level; diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/inv/AbstractInventory.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/inv/AbstractInventory.java index e4b9877298..7e9dcee725 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/inv/AbstractInventory.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/inv/AbstractInventory.java @@ -35,6 +35,7 @@ import java.util.concurrent.BlockingQueue; import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.derivparam.tree.AbstractNode; import com.raytheon.uf.common.derivparam.tree.DataTree; @@ -47,7 +48,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.level.LevelUtilities; import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData; import com.raytheon.uf.viz.derivparam.data.FloatRequestableData; @@ -137,27 +137,36 @@ public abstract class AbstractInventory implements DerivParamUpdateListener { */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } StackEntry other = (StackEntry) obj; - if (!getOuterType().equals(other.getOuterType())) + if (!getOuterType().equals(other.getOuterType())) { return false; - if (level != other.level) + } + if (level != other.level) { return false; + } if (source == null) { - if (other.source != null) + if (other.source != null) { return false; - } else if (!source.equals(other.source)) + } + } else if (!source.equals(other.source)) { return false; + } if (parameter == null) { - if (other.parameter != null) + if (other.parameter != null) { return false; - } else if (!parameter.equals(other.parameter)) + } + } else if (!parameter.equals(other.parameter)) { return false; + } return true; } @@ -474,8 +483,10 @@ public abstract class AbstractInventory implements DerivParamUpdateListener { protected Collection getAllLevels() { if (allLevels == null) { try { - return LevelMappingFactory.getInstance().getAllLevels(); - } catch (VizCommunicationException e) { + return LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels(); + } catch (CommunicationException e) { // TODO recover from this. statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); @@ -1094,7 +1105,13 @@ public abstract class AbstractInventory implements DerivParamUpdateListener { // because it is valid for all requests } else if (type == LevelType.LevelMapping) { LevelNode target = null; - for (Level fieldLevel : field.getLevelMapping().getLevels()) { + List levels; + try { + levels = field.getLevelMapping().getLevels(); + } catch (CommunicationException e) { + throw new VizCommunicationException(e); + } + for (Level fieldLevel : levels) { target = resolveNode(fieldSourceNode, fieldParamAbbrev, fieldLevel, stack, nodata); if (target != null) { diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/DerivParamField.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/DerivParamField.java index 7f1859e02a..97cfd8bd32 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/DerivParamField.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/DerivParamField.java @@ -27,11 +27,11 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.adapters.UnitAdapter; import com.raytheon.uf.viz.core.exception.VizCommunicationException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; /** * Metadata about a derived parameter field. @@ -131,7 +131,8 @@ public class DerivParamField implements ISerializableObject, IDerivParamField { public boolean setLevel(String level) throws VizCommunicationException { levelType = LevelType.parseLevel(level); if (levelType == LevelType.LevelMapping) { - levelMapping = LevelMappingFactory.getInstance() + levelMapping = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForKey(level); if (levelMapping == null) { levelType = null; diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/ValidLevelGenerator.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/ValidLevelGenerator.java index 9a394f5b83..05d2c3289b 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/ValidLevelGenerator.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/library/ValidLevelGenerator.java @@ -34,11 +34,11 @@ import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.MasterLevel; import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapper; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.util.mapping.Mapper; import com.raytheon.uf.common.util.mapping.MultipleMappingException; import com.raytheon.uf.viz.core.exception.VizCommunicationException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; /** * Generates the valid levels for a derived parameter script based on it @@ -74,7 +74,8 @@ public class ValidLevelGenerator { private Set masterLevelsHandled; public ValidLevelGenerator() { - lmf = LevelMappingFactory.getInstance(); + lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); lf = LevelFactory.getInstance(); lm = LevelMapper.getInstance(); } @@ -84,61 +85,65 @@ public class ValidLevelGenerator { masterLevels = new HashMap>(); validLevels = new HashSet(); masterLevelsHandled = new HashSet(); - if (validLevelsString != null && validLevelsString.length() > 0) { - String[] levelTokenArray = validLevelsString.split(","); - List tokensToProcess = new ArrayList( - levelTokenArray.length); + try { + if (validLevelsString != null && validLevelsString.length() > 0) { + String[] levelTokenArray = validLevelsString.split(","); + List tokensToProcess = new ArrayList( + levelTokenArray.length); - for (String token : levelTokenArray) { - tokensToProcess.add(token); - } - - // generate initial list - Iterator iter = tokensToProcess.iterator(); - - while (iter.hasNext()) { - String token = iter.next(); - - if (token.charAt(0) == '!') { - token = token.substring(1); + for (String token : levelTokenArray) { + tokensToProcess.add(token); } - // See if this is a group. - Map> tmp = lmf - .getLevelMapForGroup(token); - if (tmp != null) { - masterLevels = tmp; - iter.remove(); - break; - } - } + // generate initial list + Iterator iter = tokensToProcess.iterator(); - if (masterLevels.size() == 0 && tokensToProcess.size() > 0) { - for (Level l : lmf.getAllLevels()) { - MasterLevel ml = l.getMasterLevel(); - Set levels = masterLevels.get(ml); - if (levels == null) { - levels = new HashSet(); - masterLevels.put(ml, levels); + while (iter.hasNext()) { + String token = iter.next(); + + if (token.charAt(0) == '!') { + token = token.substring(1); } + // See if this is a group. + Map> tmp = lmf + .getLevelMapForGroup(token); - levels.add(l); - } - } - - if (tokensToProcess.size() > 0) { - for (String token : tokensToProcess) { - try { - processLevelToken(token); - } catch (CommunicationException e) { - throw new VizCommunicationException(e); + if (tmp != null) { + masterLevels = tmp; + iter.remove(); + break; } } - } else { - for (Set levels : masterLevels.values()) { - validLevels.addAll(levels); + + if (masterLevels.size() == 0 && tokensToProcess.size() > 0) { + for (Level l : lmf.getAllLevels()) { + MasterLevel ml = l.getMasterLevel(); + Set levels = masterLevels.get(ml); + if (levels == null) { + levels = new HashSet(); + masterLevels.put(ml, levels); + } + + levels.add(l); + } + } + + if (tokensToProcess.size() > 0) { + for (String token : tokensToProcess) { + try { + processLevelToken(token); + } catch (CommunicationException e) { + throw new VizCommunicationException(e); + } + } + } else { + for (Set levels : masterLevels.values()) { + validLevels.addAll(levels); + } } } + } catch (CommunicationException e) { + throw new VizCommunicationException(e); } return validLevels; diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF index 3cf4e5f9b3..a67744bba3 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/META-INF/MANIFEST.MF @@ -23,12 +23,12 @@ Require-Bundle: org.eclipse.ui, com.raytheon.viz.grid;bundle-version="1.11.17", com.raytheon.viz.core.contours;bundle-version="1.11.17", com.raytheon.uf.viz.sounding;bundle-version="1.11.17", - com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.11.17" + com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.11.17", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.uf.viz.objectiveanalysis.rsc Import-Package: com.raytheon.uf.common.comm, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.dataplugin.radar, com.raytheon.uf.common.gridcoverage, com.raytheon.uf.viz.derivparam.library, diff --git a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java index 63c9cd9839..6950598c18 100644 --- a/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java +++ b/cave/com.raytheon.uf.viz.objectiveanalysis/src/com/raytheon/uf/viz/objectiveanalysis/rsc/OAResourceData.java @@ -32,10 +32,10 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.MasterLevel; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; import com.raytheon.uf.viz.core.rsc.LoadProperties; @@ -196,29 +196,30 @@ public class OAResourceData extends AbstractRequestableResourceData { DataTime[] times = super.getAvailableTimes(); if (this.levelKey.equals(ALL_TILTS)) { LevelFactory factory = LevelFactory.getInstance(); - MasterLevel ml; - try { - ml = factory.getMasterLevel("TILT"); - } catch (CommunicationException e) { - throw new VizCommunicationException(e); - } - Set allLevels = LevelMappingFactory.getInstance() - .getAllLevels(); - List levels = new ArrayList(); - for (Level l : allLevels) { - if (l.getMasterLevel().equals(ml)) { - levels.add(l); - } - } List timesWithLevels = new ArrayList(); - for (int i = 0; i < times.length; ++i) { - for (int j = 0; j < levels.size(); ++j) { - DataTime time = times[i].clone(); - time.setLevelValue(levels.get(j).getLevelonevalue()); - if (time.isSpatial()) { - timesWithLevels.add(time); + try { + MasterLevel ml = factory.getMasterLevel("TILT"); + Set allLevels = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels(); + List levels = new ArrayList(); + for (Level l : allLevels) { + if (l.getMasterLevel().equals(ml)) { + levels.add(l); } } + + for (int i = 0; i < times.length; ++i) { + for (int j = 0; j < levels.size(); ++j) { + DataTime time = times[i].clone(); + time.setLevelValue(levels.get(j).getLevelonevalue()); + if (time.isSpatial()) { + timesWithLevels.add(time); + } + } + } + } catch (CommunicationException e) { + throw new VizCommunicationException(e); } return timesWithLevels .toArray(new DataTime[timesWithLevels.size()]); diff --git a/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF index 949ac37275..defcc04b8b 100644 --- a/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.grid/META-INF/MANIFEST.MF @@ -25,7 +25,8 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.viz.points;bundle-version="1.0.0", com.raytheon.uf.common.gridcoverage, org.apache.commons.beanutils;bundle-version="1.8.3", - com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0" + com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174" Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.viz.grid, com.raytheon.viz.grid.inv, @@ -36,7 +37,6 @@ Export-Package: com.raytheon.viz.grid, Import-Package: com.raytheon.edex.scriptfactory, com.raytheon.uf.common.colormap, com.raytheon.uf.common.comm, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.derivparam.tree, com.raytheon.uf.common.localization, com.raytheon.uf.common.message, diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java index f0d46ed512..668f13dfb7 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java @@ -42,15 +42,14 @@ import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.level.MasterLevel; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.drawables.ResourcePair; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.rsc.DisplayType; import com.raytheon.uf.viz.core.rsc.ResourceProperties; import com.raytheon.uf.viz.core.rsc.ResourceType; @@ -195,8 +194,11 @@ public class GridProductBrowserDataDefinition extends params = Arrays.asList(value); } else if (key.equals(GridInventory.MASTER_LEVEL_QUERY)) { if (levels == null) { - levels = new ArrayList(LevelMappingFactory - .getInstance().getAllLevels()); + levels = new ArrayList( + LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels()); } Iterator iter = levels.iterator(); while (iter.hasNext()) { @@ -209,8 +211,11 @@ public class GridProductBrowserDataDefinition extends } else if (key.equals(GridInventory.LEVEL_ONE_QUERY)) { double doubleValue = Double.parseDouble(value); if (levels == null) { - levels = new ArrayList(LevelMappingFactory - .getInstance().getAllLevels()); + levels = new ArrayList( + LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels()); } Iterator iter = levels.iterator(); while (iter.hasNext()) { @@ -221,8 +226,11 @@ public class GridProductBrowserDataDefinition extends } else if (key.equals(GridInventory.LEVEL_TWO_QUERY)) { double doubleValue = Double.parseDouble(value); if (levels == null) { - levels = new ArrayList(LevelMappingFactory - .getInstance().getAllLevels()); + levels = new ArrayList( + LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getAllLevels()); } Iterator iter = levels.iterator(); while (iter.hasNext()) { @@ -280,9 +288,6 @@ public class GridProductBrowserDataDefinition extends return returnQueue.toArray(new String[0]); } } - } catch (VizCommunicationException e) { - statusHandler.handle(Priority.ERROR, "Unable to query data for " - + productName, e); } catch (CommunicationException e) { statusHandler.handle(Priority.ERROR, "Unable to query data for " + productName, e); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java index 809059318b..a1c7ad0321 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridNameGenerator.java @@ -19,11 +19,11 @@ **/ package com.raytheon.viz.grid.rsc; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.rsc.AbstractNameGenerator; import com.raytheon.uf.viz.core.rsc.AbstractVizResource; @@ -144,13 +144,14 @@ public class GridNameGenerator extends AbstractNameGenerator { private String lookupPlane(Level level) { try { - LevelMapping mapping = LevelMappingFactory.getInstance() + LevelMapping mapping = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForLevel(level); if (mapping == null) { return level.getMasterLevel().getName(); } return mapping.getDisplayName(); - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { return level.getMasterLevel().getName(); } diff --git a/cave/com.raytheon.viz.pointdata/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.pointdata/META-INF/MANIFEST.MF index 6c4bd232bd..ef1104283b 100644 --- a/cave/com.raytheon.viz.pointdata/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.pointdata/META-INF/MANIFEST.MF @@ -18,7 +18,8 @@ Require-Bundle: org.apache.batik, com.raytheon.uf.viz.localization;bundle-version="1.12.1174", org.jep;bundle-version="1.0.0", com.raytheon.uf.common.python;bundle-version="1.12.1161", - com.raytheon.uf.common.pointdata;bundle-version="1.12.1174" + com.raytheon.uf.common.pointdata;bundle-version="1.12.1174", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174" Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.viz.pointdata, com.raytheon.viz.pointdata.drawables, @@ -28,7 +29,6 @@ Export-Package: com.raytheon.viz.pointdata, Import-Package: com.raytheon.edex.meteoLib, com.raytheon.uf.common.comm, com.raytheon.uf.common.dataplugin.grid, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.derivparam.tree, com.raytheon.uf.common.message.response, com.raytheon.uf.common.pointdata, diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataDefinition.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataDefinition.java index 883e627541..170deb5510 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataDefinition.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotModelDataDefinition.java @@ -18,6 +18,7 @@ import java.util.concurrent.LinkedBlockingQueue; import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; @@ -29,9 +30,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.map.MapDescriptor; import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.uf.viz.core.rsc.ResourceType; @@ -281,14 +280,15 @@ public class PlotModelDataDefinition extends try { Level level = LevelFactory.getInstance().getLevel( Long.parseLong(levelid)); - validLevels.add(LevelMappingFactory.getInstance() - .getLevelMappingForLevel(level).getDisplayName()); + validLevels + .add(LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(level) + .getDisplayName()); } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } catch (VizCommunicationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - e); } } return validLevels.toArray(new String[0]); diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java index 26a6fd0bfa..956e46e980 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/AbstractPointDataInventory.java @@ -28,7 +28,9 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.derivparam.tree.DataTree; import com.raytheon.uf.common.derivparam.tree.LevelNode; @@ -40,9 +42,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.RecordFactory; import com.raytheon.uf.viz.core.catalog.CatalogQuery; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData; import com.raytheon.uf.viz.derivparam.inv.AbstractInventory; import com.raytheon.uf.viz.derivparam.library.DerivParamDesc; @@ -278,9 +278,11 @@ public abstract class AbstractPointDataInventory extends AbstractInventory { public static Level getStationLevel() { try { - return LevelMappingFactory.getInstance() + return LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForKey("Station").getLevels().get(0); - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); return null; } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java index 5ebbb8282e..8dc020a32f 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/PointDataCubeAdapter.java @@ -25,8 +25,10 @@ import java.util.Collection; import java.util.List; import java.util.Map; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.TimeQueryRequest; import com.raytheon.uf.common.dataquery.requests.TimeQueryRequestSet; @@ -45,8 +47,8 @@ import com.raytheon.uf.viz.core.comm.Loader; import com.raytheon.uf.viz.core.datastructure.CubeUtil; import com.raytheon.uf.viz.core.datastructure.IDataCubeAdapter; import com.raytheon.uf.viz.core.datastructure.VizDataCubeException; +import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData; import com.raytheon.uf.viz.derivparam.inv.AvailabilityContainer; @@ -143,8 +145,15 @@ public class PointDataCubeAdapter implements IDataCubeAdapter { source += type; } - List levels = LevelMappingFactory.getInstance() - .getLevelMappingForKey(levelKey).getLevels(); + List levels; + try { + levels = LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForKey(levelKey).getLevels(); + } catch (CommunicationException e) { + throw new VizCommunicationException(e); + } List nodes = inventory.getNodes(source, Arrays.asList(parameters), levels); PointMetadataContainer pmc = new PointMetadataContainer(queryParams, diff --git a/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF b/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF index 6ceafd4e11..c8353b6ce8 100644 --- a/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.viz.volumebrowser/META-INF/MANIFEST.MF @@ -31,7 +31,9 @@ Require-Bundle: org.eclipse.ui, com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0", gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0", com.raytheon.uf.common.message;bundle-version="1.12.1174", - com.raytheon.viz.core.graphing;bundle-version="1.12.1174" + com.raytheon.viz.core.graphing;bundle-version="1.12.1174", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174", + com.raytheon.uf.common.comm;bundle-version="1.12.1174" Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.viz.volumebrowser, com.raytheon.viz.volumebrowser.catalog, @@ -41,7 +43,6 @@ Export-Package: com.raytheon.viz.volumebrowser, Import-Package: com.raytheon.uf.common.comm, com.raytheon.uf.common.dataplugin.grid, com.raytheon.uf.common.dataplugin.grid.dataset, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.gridcoverage, com.raytheon.uf.common.menus.xml, com.raytheon.uf.viz.core.maps.display, diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java index 350c8ee3dd..16eb26a3b7 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractDataCatalog.java @@ -29,15 +29,16 @@ import java.util.List; import java.util.Set; import java.util.regex.Pattern; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizCommunicationException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.level.LevelUtilities; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.DisplayType; @@ -373,12 +374,13 @@ public abstract class AbstractDataCatalog implements IDataCatalog { } } else { try { - LevelMappingFactory lmf = LevelMappingFactory.getInstance(); + LevelMappingFactory lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); LevelMapping lm = lmf.getLevelMappingForKey(planesKey); if (lm != null) { levels = lm.getLevels(); } - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java index e4bc9d0202..112efe0bb2 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/AbstractInventoryDataCatalog.java @@ -38,13 +38,13 @@ import org.eclipse.core.runtime.jobs.Job; import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.LevelFactory; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.datastructure.DataCubeContainer; import com.raytheon.uf.viz.core.exception.VizCommunicationException; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.level.LevelUtilities; import com.raytheon.uf.viz.derivparam.inv.AbstractInventory; import com.raytheon.viz.volumebrowser.vbui.DataListsProdTableComp.DataSelection; @@ -184,16 +184,13 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { } request.addAvailablePlane("spatial-" + level.getMasterLevel().getName()); - try { - LevelMapping lm = LevelMappingFactory.getInstance() - .getLevelMappingForLevel(level); + LevelMapping lm = LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) + .getLevelMappingForLevel(level); - if (lm != null) { - request.addAvailablePlane(lm.getKey()); - } - } catch (VizCommunicationException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + if (lm != null) { + request.addAvailablePlane(lm.getKey()); } } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, @@ -255,6 +252,7 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { return result; } + @Override public List getSupportedSources() { return getSupportedSourcesInternal(); } @@ -280,7 +278,8 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { if (selectedPlanes == null || selectedPlanes.length == 0) { return null; } - LevelMappingFactory lmf = LevelMappingFactory.getInstance(); + LevelMappingFactory lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); for (String plane : selectedPlanes) { Collection levels = Collections.emptyList(); if (plane.startsWith("spatial-")) { @@ -297,7 +296,7 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog { if (lm != null) { try { levels = lm.getLevels(); - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java index 49db9b9853..b3c468c6e0 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/GridDataCatalog.java @@ -35,8 +35,10 @@ import org.geotools.geometry.Envelope2D; import org.geotools.geometry.jts.ReferencedEnvelope; import org.opengis.referencing.operation.MathTransform; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.geospatial.MapUtil; @@ -47,7 +49,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.level.LevelUtilities; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.DisplayType; @@ -182,11 +183,12 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { // Get all possible levels for the selected levels List selectedLevels = Collections.emptyList(); try { - LevelMappingFactory lmf = LevelMappingFactory.getInstance(); + LevelMappingFactory lmf = LevelMappingFactory + .getInstance(LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE); selectedLevels = new ArrayList(lmf .getLevelMappingForKey( catalogEntry.selectedPlanesKey).getLevels()); - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } @@ -422,8 +424,8 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { .getCoordinateReferenceSystem()); Envelope2D env = gridGeom.getEnvelope2D(); for (String letter : pointLetters) { - Coordinate c = PointsDataManager.getInstance() - .getCoordinate(letter); + Coordinate c = PointsDataManager.getInstance() + .getCoordinate(letter); DirectPosition2D dp = new DirectPosition2D(c.x, c.y); llToCRS.transform(dp, dp); if (env.contains(dp.x, dp.y)) { @@ -508,8 +510,8 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog { .getTransformFromLatLon(gridGeom .getCoordinateReferenceSystem()); Envelope2D env = gridGeom.getEnvelope2D(); - for (String letter : pdm.getPointNames()) { - Coordinate c = pdm.getCoordinate(letter); + for (String letter : pdm.getPointNames()) { + Coordinate c = pdm.getCoordinate(letter); DirectPosition2D dp = new DirectPosition2D(c.x, c.y); llToCRS.transform(dp, dp); if (env.contains(dp.x, dp.y)) { diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java index 5dca1d2ee1..4a21e11deb 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java @@ -32,7 +32,9 @@ import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; @@ -41,9 +43,7 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.viz.core.catalog.DbQuery; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; import com.raytheon.uf.viz.core.exception.VizException; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.ResourceType; import com.raytheon.uf.viz.d2d.nsharp.rsc.BufruaNSharpResourceData; @@ -390,9 +390,11 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { @Override protected Collection get3DLevels() { try { - return LevelMappingFactory.getInstance() + return LevelMappingFactory + .getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForKey("Station").getLevels(); - } catch (VizCommunicationException e) { + } catch (CommunicationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); return Collections.emptyList(); } diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/widget/MenuContributionItem.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/widget/MenuContributionItem.java index 72ddf033da..708b559514 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/widget/MenuContributionItem.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/widget/MenuContributionItem.java @@ -28,8 +28,8 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; -import com.raytheon.uf.viz.core.level.LevelMapping; -import com.raytheon.uf.viz.core.level.LevelMappingFactory; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.viz.volumebrowser.vbui.MenuItemManager; import com.raytheon.viz.volumebrowser.xml.MenuContribution; @@ -93,7 +93,8 @@ public class MenuContributionItem extends ContributionItem { item.setData(this); if (menuContribution.xml.textLookup.equals("LevelMapping")) { - LevelMapping mapping = LevelMappingFactory.getInstance() + LevelMapping mapping = LevelMappingFactory.getInstance( + LevelMappingFactory.VOLUMEBROWSER_LEVEL_MAPPING_FILE) .getLevelMappingForKey(menuContribution.xml.key); if (mapping != null) { menuContribution.xml.menuText = mapping.getDisplayName(); diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF index 227ba85dff..22174d72a5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF @@ -29,7 +29,8 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174" com.google.guava;bundle-version="1.0.0", com.raytheon.uf.common.util;bundle-version="1.12.1174", org.apache.commons.lang;bundle-version="2.3.0", - com.raytheon.uf.common.python.concurrent;bundle-version="1.0.0" + com.raytheon.uf.common.python.concurrent;bundle-version="1.0.0", + com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174" Export-Package: com.raytheon.edex.plugin.gfe, com.raytheon.edex.plugin.gfe.config, com.raytheon.edex.plugin.gfe.db.dao, @@ -53,7 +54,6 @@ Import-Package: com.raytheon.edex.db.dao, com.raytheon.uf.common.activetable, com.raytheon.uf.common.comm, com.raytheon.uf.common.dataplugin, - com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.dataplugin.persist, com.raytheon.uf.common.dataplugin.warning, com.raytheon.uf.common.datastorage, diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java index 594b8177d0..1497851218 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java @@ -44,7 +44,6 @@ import com.raytheon.edex.plugin.gfe.paraminfo.GridParamInfo; import com.raytheon.edex.plugin.gfe.paraminfo.GridParamInfoLookup; import com.raytheon.edex.plugin.gfe.paraminfo.ParameterInfo; import com.raytheon.edex.plugin.gfe.server.GridParmManager; -import com.raytheon.edex.plugin.gfe.util.GridTranslator; import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; @@ -65,7 +64,8 @@ import com.raytheon.uf.common.dataplugin.gfe.slice.VectorGridSlice; import com.raytheon.uf.common.dataplugin.grid.GridPathProvider; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.Level; -import com.raytheon.uf.common.dataplugin.level.LevelFactory; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping; +import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory; import com.raytheon.uf.common.datastorage.DataStoreFactory; import com.raytheon.uf.common.datastorage.IDataStore; import com.raytheon.uf.common.datastorage.Request; @@ -104,6 +104,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * 03/19/2013 #1774 randerso Fix accumulative grid time ranges * 04/04/2013 #1774 randerso Moved wind component checking to GfeIngestNotificaionFilter * 04/04/2013 #1787 randerso Move the D2D to GFE translation logic out of GFED2DDao + * 04/17/2013 #1913 randerso Added GFE level mapping to replace GridTranslator * * * @@ -196,6 +197,8 @@ public class D2DGridDatabase extends VGridDatabase { private static final Pattern parmHrPattern = Pattern .compile("(\\D+)\\d+hr"); + private static final String GFE_LEVEL_MAPPING_FILE = "grid/gfeLevelMappingFile.xml"; + private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler("GFE:"); @@ -1178,27 +1181,33 @@ public class D2DGridDatabase extends VGridDatabase { // no-op } - public D2DParm getD2DParm(String d2dParmName, Level level) { + public D2DParm getD2DParm(String d2dParmName, Level d2dLevel) { String gfeParmName = getGfeParmName(d2dParmName); - String levelName = GridTranslator.getShortLevelName(level - .getMasterLevel().getName(), level.getLevelonevalue(), level - .getLeveltwovalue()); + String gfeLevel = getGFELevel(d2dLevel); + if (gfeLevel == null) { + statusHandler.warn("No GFE level found for D2D model: " + + d2dModelName + " D2D parm: " + d2dParmName + + " D2D level:" + d2dLevel + " GFE model: " + + dbId.getModelName() + " GFE parm: " + gfeParmName + + ". Check gfeLevelMapping and parameterInfo files."); + return null; + } - D2DParm parm = d2dParms.get(compositeName(gfeParmName, levelName)); + D2DParm parm = d2dParms.get(compositeName(gfeParmName, gfeLevel)); if (parm == null) { // try to find one with duration (XXXnnhr) Matcher matcher = parmHrPattern.matcher(d2dParmName); if (matcher.find()) { String abbrev = matcher.group(1); gfeParmName = getGfeParmName(abbrev); - parm = d2dParms.get(compositeName(gfeParmName, levelName)); + parm = d2dParms.get(compositeName(gfeParmName, gfeLevel)); } } if (parm == null) { statusHandler.warn("No gridParameterInfo found for " - + compositeName(gfeParmName, levelName) + ":" + + compositeName(gfeParmName, gfeLevel) + ":" + dbId.getModelId() + ". Check parameterInfo file."); } @@ -1244,32 +1253,36 @@ public class D2DGridDatabase extends VGridDatabase { } private static Level getD2DLevel(String gfeLevel) { - String levelName = GridTranslator.getLevelName(gfeLevel); - - double[] levelValues = GridTranslator.getLevelValue(gfeLevel); - boolean levelOnePresent = (levelValues[0] != Level - .getInvalidLevelValue()); - boolean levelTwoPresent = (levelValues[1] != Level - .getInvalidLevelValue()); - Level level = null; - - // to have a level 2, must have a level one + List levels; try { - if (levelOnePresent && levelTwoPresent) { - level = LevelFactory.getInstance().getLevel(levelName, - levelValues[0], levelValues[1]); - } else if (levelOnePresent) { - level = LevelFactory.getInstance().getLevel(levelName, - levelValues[0]); - } else { - level = LevelFactory.getInstance().getLevel(levelName, 0.0); - } + levels = LevelMappingFactory.getInstance(GFE_LEVEL_MAPPING_FILE) + .getLevelMappingForKey(gfeLevel).getLevels(); } catch (CommunicationException e) { - statusHandler.error(e.getLocalizedMessage(), e); + levels = Collections.emptyList(); } - if (level == null) { - statusHandler.warn(gfeLevel + " does not map to a D2D level"); + + Level level = null; + if (levels.isEmpty()) { + statusHandler.warn("No D2D level found for: " + gfeLevel); + } else { + level = levels.get(0); } return level; } + + private static String getGFELevel(Level d2dLevel) { + LevelMapping levelMapping; + try { + levelMapping = LevelMappingFactory.getInstance( + GFE_LEVEL_MAPPING_FILE).getLevelMappingForLevel(d2dLevel); + } catch (CommunicationException e) { + levelMapping = null; + } + + String gfeLevel = null; + if (levelMapping != null) { + gfeLevel = levelMapping.getKey(); + } + return gfeLevel; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/GridTranslator.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/GridTranslator.java deleted file mode 100644 index 2a8803628d..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/util/GridTranslator.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.edex.plugin.gfe.util; - -import java.util.Arrays; -import java.util.List; -import java.util.regex.Pattern; - -import com.raytheon.uf.common.dataplugin.level.Level; -import com.raytheon.uf.common.dataplugin.level.LevelFactory; - -/** - * Singleton that assists with grid data - * - *
- * SOFTWARE HISTORY
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * May 5, 2008              njensen     Initial creation
- * Aug 22, 2008 1502        dglazesk    Changed to JAXB unmarshalling
- * Dec 06, 2012 1394        rjpeter     Attend static compiled patterns.
- * 
- * - * @author njensen - * @version 1.0 - */ - -public class GridTranslator { - - private static final List NEEDS_ZERO = Arrays.asList("BLD", "WBZ"); - - private static final Pattern ANY_NUMBER = Pattern.compile("[0-9]"); - - private static final Pattern NOT_NUMBER = Pattern.compile("[^0-9]"); - - private GridTranslator() { - } - - public static String getLevelName(String shorthand) { - return ANY_NUMBER.matcher(shorthand).replaceAll(""); - } - - public static double[] getLevelValue(String shorthand) { - String levelString = NOT_NUMBER.matcher(shorthand).replaceAll(""); - int length = levelString.length(); - double[] retVal = new double[2]; - retVal[0] = Level.getInvalidLevelValue(); - retVal[1] = Level.getInvalidLevelValue(); - switch (length) { - case 0: - retVal[0] = 0.0; - break; - case 1: - case 2: - retVal[0] = Double.parseDouble(levelString); - break; - case 3: - if (levelString.charAt(0) != '0') { - retVal[0] = Double.parseDouble(levelString); - } else { - retVal[1] = Double.parseDouble(levelString); - if (levelString.charAt(0) == '0') { - retVal[0] = 0.0; - } - } - break; - case 4: - if (levelString.charAt(0) == '0') { - retVal[0] = 0.0; - retVal[1] = Double.parseDouble(levelString); - } else if (levelString.charAt(0) == '1') { - retVal[0] = Double.parseDouble(levelString); - } else { - retVal[0] = Double.parseDouble(levelString.substring(0, 2)); - retVal[1] = Double.parseDouble(levelString.substring(2, 4)); - } - break; - case 5: - retVal[0] = Double.parseDouble(levelString.substring(0, 2)); - retVal[1] = Double.parseDouble(levelString.substring(2, 5)); - break; - case 6: - retVal[0] = Double.parseDouble(levelString.substring(0, 3)); - retVal[1] = Double.parseDouble(levelString.substring(3, 6)); - break; - case 7: - retVal[0] = Double.parseDouble(levelString.substring(0, 4)); - retVal[1] = Double.parseDouble(levelString.substring(4, 7)); - break; - case 8: - retVal[0] = Double.parseDouble(levelString.substring(0, 4)); - retVal[1] = Double.parseDouble(levelString.substring(4, 8)); - break; - default: - break; - } - return retVal; - } - - /** - * Formats short level name in GFE format - * - * @param name - * @param levelOne - * @param levelTwo - * @return short level name - */ - public static String getShortLevelName(String name, double levelOne, - double levelTwo) { - StringBuilder tmp = new StringBuilder(); - - if (name == null) { - tmp.append(LevelFactory.UNKNOWN_LEVEL); - } else { - tmp.append(name); - - if ((levelOne != Level.getInvalidLevelValue()) - && ((levelOne != 0) - || (levelTwo != Level.getInvalidLevelValue()) || NEEDS_ZERO - .contains(name))) { - tmp.append(String.valueOf(Math.round(levelOne))); - } - if (levelTwo != Level.getInvalidLevelValue()) { - tmp.append(String.valueOf(Math.round(levelTwo))); - } - } - return tmp.toString(); - } - - public static void main(String[] args) { - double[] testLevelsBL = { 0, 30, 60, 90, 120, 150, 180, -999999 }; - double[] testLevelsMB = { 1100, 1050, 1000, 950, 900, 850, 800, 750, - 700, 650, 600, 550, 500, 450, 400, 350, 300, 250, 200, 150, - 100, -999999 }; - - String levelName; - String level; - double[] levels; - double l1, l2; - - levelName = "BL"; - for (int i = 0; i < testLevelsBL.length; i++) { - l1 = testLevelsBL[i]; - for (int j = i + 1; j < testLevelsBL.length; j++) { - l2 = testLevelsBL[j]; - level = GridTranslator.getShortLevelName(levelName, l1, l2); - levels = GridTranslator.getLevelValue(level); - System.out.println(levelName - + " " - + l1 - + " " - + l2 - + ": " - + level - + " " - + Arrays.toString(levels) - + ((l1 == levels[0]) && (l2 == levels[1]) ? " passed" - : " failed")); - } - } - - levelName = "MB"; - for (int i = 0; i < testLevelsMB.length; i++) { - l1 = testLevelsMB[i]; - for (int j = i + 1; j < testLevelsMB.length; j++) { - l2 = testLevelsMB[j]; - level = GridTranslator.getShortLevelName(levelName, l1, l2); - levels = GridTranslator.getLevelValue(level); - System.out.println(levelName - + " " - + l1 - + " " - + l2 - + ": " - + level - + " " - + Arrays.toString(levels) - + ((l1 == levels[0]) && (l2 == levels[1]) ? " passed" - : " failed")); - } - } - - levelName = "SFC"; - l1 = 0; - l2 = -999999; - level = GridTranslator.getShortLevelName(levelName, l1, l2); - levels = GridTranslator.getLevelValue(level); - System.out.println(levelName - + " " - + l1 - + " " - + l2 - + ": " - + level - + " " - + Arrays.toString(levels) - + ((l1 == levels[0]) && (l2 == levels[1]) ? " passed" - : " failed")); - - levelName = "BLD"; - l1 = 0; - l2 = -999999; - level = GridTranslator.getShortLevelName(levelName, l1, l2); - levels = GridTranslator.getLevelValue(level); - System.out.println(levelName - + " " - + l1 - + " " - + l2 - + ": " - + level - + " " - + Arrays.toString(levels) - + ((l1 == levels[0]) && (l2 == levels[1]) ? " passed" - : " failed")); - - levelName = "WBZ"; - l1 = 0; - l2 = -999999; - level = GridTranslator.getShortLevelName(levelName, l1, l2); - levels = GridTranslator.getLevelValue(level); - System.out.println(levelName - + " " - + l1 - + " " - + l2 - + ": " - + level - + " " - + Arrays.toString(levels) - + ((l1 == levels[0]) && (l2 == levels[1]) ? " passed" - : " failed")); - } -} diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml new file mode 100644 index 0000000000..24e7c21b94 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml @@ -0,0 +1,462 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs160.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs160.xml index e3fb9bbcc4..e3c8214e0f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs160.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs160.xml @@ -1,4 +1,10 @@ + 0 @@ -445,9 +451,9 @@ 20.0 -99999.0 0 - MB 0>500 + SFC - MB0500 + SFC diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs161.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs161.xml index e3fb9bbcc4..e3c8214e0f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs161.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs161.xml @@ -1,4 +1,10 @@ + 0 @@ -445,9 +451,9 @@ 20.0 -99999.0 0 - MB 0>500 + SFC - MB0500 + SFC diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs213.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs213.xml index d6347c6724..3bf7d18660 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs213.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs213.xml @@ -1,4 +1,10 @@ + 0 @@ -275,9 +281,9 @@ 20.0 -99999.0 0 - MB 0>500 + SFC - MB0500 + SFC diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs254.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs254.xml index e3fb9bbcc4..e3c8214e0f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs254.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/gfs254.xml @@ -1,4 +1,10 @@ + 0 @@ -445,9 +451,9 @@ 20.0 -99999.0 0 - MB 0>500 + SFC - MB0500 + SFC diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/hpcGuideNDFD.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/hpcGuideNDFD.xml index 52f61e8294..873b4a7fbc 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/hpcGuideNDFD.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/hpcGuideNDFD.xml @@ -1,6 +1,10 @@ @@ -129,7 +133,7 @@ wx Weather - + wx Weather 0.0 diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm202.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm202.xml deleted file mode 100644 index 5e7fd4ee21..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm202.xml +++ /dev/null @@ -1,358 +0,0 @@ - - - - 0 - 21600 - 43200 - 64800 - 86400 - 108000 - 129600 - 151200 - 172800 - - - vw - v wind component - m/s - meter/sec - vWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - staticSpacing - Grid spacing - meters - -99999.0 - - - tp - total precipitation - mm - millimeter - totPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - av - absolute vorticity - /s - 1/second - absVort - -0.00999999977648 - 0.00999999977648 - -99999.0 - 4 - MB 850 700 500 250 - - MB850 - MB700 - MB500 - MB250 - - - - gh - Geopotential height - m - meters - geoPotHt - -2000.0 - 20000.0 - -99999.0 - 20 - MB 1000-50 by 50 - - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - - - - pw - precipitable water - mm - millimeter - precipH2O - 0.0 - 300.0 - -99999.0 - 0 - SIG 0>100 - - SIG0100 - - - - bli - Best lifted index - K - degree_Kelvin - bestLftInd - -20.0 - 50.0 - -99999.0 - 0 - SIG 84>98 - - SIG8498 - - - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - rh - Relative Humidity - % - percent - rh - 0.0 - 100.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 SIG 47>100 - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - SIG47100 - - - - sli - Surface lifted index - K - degree_Kelvin - LftInd - -20.0 - 20.0 - -99999.0 - 0 - MB 50>100 - - MB50100 - - - - snd - snow depth - m - meters - snowDepth - 0.0 - 100.0 - -99999.0 - 0 - SFC - - SFC - - - - staticTopo - Topography - meters - -99999.0 - - - pmsl - pressure at mean sea level - Pa - pascal - PMSL - 80000.0 - 110000.0 - -99999.0 - 0 - MSL - - MSL - - - - uw - u wind component - m/s - meter/sec - uWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - st - soil temperature - K - degree_Kelvin - soilT - 0.0 - 1000.0 - -99999.0 - 0 - BLS - - BLS - - - - p - pressure - Pa - pascal - atmP - 0.0 - 110000.0 - -99999.0 - 1 - SFC TROP - - SFC - TROP - - - - t - Temperature - K - degree_Kelvin - T - 180.0 - 330.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm207.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm207.xml deleted file mode 100644 index 116284ad4b..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm207.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - 0 - 21600 - 43200 - 64800 - 86400 - 108000 - 129600 - 151200 - 172800 - - - pvv - Pressure vertical velocity - Pa/s - pascal/second - Pvv - -2.5 - 2.5 - -99999.0 - 9 - MB 850 700 500 400 300 250 200 150 100 - - MB850 - MB700 - MB500 - MB400 - MB300 - MB250 - MB200 - MB150 - MB100 - - - - vw - v wind component - m/s - meter/sec - vWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - staticSpacing - Grid spacing - meters - -99999.0 - - - tp - total precipitation - mm - millimeter - totPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - av - absolute vorticity - /s - 1/second - absVort - -0.00999999977648 - 0.00999999977648 - -99999.0 - 4 - MB 850 700 500 250 - - MB850 - MB700 - MB500 - MB250 - - - - cp - convective precipitation - mm - millimeter - convPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - gh - Geopotential height - m - meters - geoPotHt - -2000.0 - 20000.0 - -99999.0 - 20 - MB 1000-50 by 50 - - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - - - - pw - precipitable water - mm - millimeter - precipH2O - 0.0 - 300.0 - -99999.0 - 0 - SIG 0>100 - - SIG0100 - - - - bli - Best lifted index - K - degree_Kelvin - bestLftInd - -20.0 - 50.0 - -99999.0 - 0 - SIG 84>98 - - SIG8498 - - - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - rh - Relative Humidity - % - percent - rh - 0.0 - 100.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 SIG 47>100 - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - SIG47100 - - - - sli - Surface lifted index - K - degree_Kelvin - LftInd - -20.0 - 20.0 - -99999.0 - 0 - MB 50>100 - - MB50100 - - - - snd - snow depth - m - meters - snowDepth - 0.0 - 100.0 - -99999.0 - 0 - SFC - - SFC - - - - staticTopo - Topography - meters - -99999.0 - - - pmsl - pressure at mean sea level - Pa - pascal - PMSL - 80000.0 - 110000.0 - -99999.0 - 0 - MSL - - MSL - - - - uw - u wind component - m/s - meter/sec - uWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - st - soil temperature - K - degree_Kelvin - soilT - 0.0 - 1000.0 - -99999.0 - 0 - BLS - - BLS - - - - p - pressure - Pa - pascal - atmP - 0.0 - 110000.0 - -99999.0 - 1 - SFC TROP - - SFC - TROP - - - - t - Temperature - K - degree_Kelvin - T - 180.0 - 330.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm211.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm211.xml deleted file mode 100644 index 27c1c995e1..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm211.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - 0 - 21600 - 43200 - 64800 - 86400 - 108000 - 129600 - 151200 - 172800 - - - pvv - Pressure vertical velocity - Pa/s - pascal/second - Pvv - -2.5 - 2.5 - -99999.0 - 9 - MB 850 700 500 400 300 250 200 150 100 - - MB850 - MB700 - MB500 - MB400 - MB300 - MB250 - MB200 - MB150 - MB100 - - - - vw - v wind component - m/s - meter/sec - vWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - staticSpacing - Grid spacing - meters - -99999.0 - - - tp - total precipitation - mm - millimeter - totPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - av - absolute vorticity - /s - 1/second - absVort - -0.00999999977648 - 0.00999999977648 - -99999.0 - 4 - MB 850 700 500 250 - - MB850 - MB700 - MB500 - MB250 - - - - cp - convective precipitation - mm - millimeter - convPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - gh - Geopotential height - m - meters - geoPotHt - -2000.0 - 20000.0 - -99999.0 - 20 - MB 1000-50 by 50 - - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - - - - pw - precipitable water - mm - millimeter - precipH2O - 0.0 - 300.0 - -99999.0 - 0 - SIG 0>100 - - SIG0100 - - - - bli - Best lifted index - K - degree_Kelvin - bestLftInd - -20.0 - 50.0 - -99999.0 - 0 - SIG 84>98 - - SIG8498 - - - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - rh - Relative Humidity - % - percent - rh - 0.0 - 100.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 SIG 47>100 - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - SIG47100 - - - - sli - Surface lifted index - K - degree_Kelvin - LftInd - -20.0 - 20.0 - -99999.0 - 0 - MB 50>100 - - MB50100 - - - - snd - snow depth - m - meters - snowDepth - 0.0 - 100.0 - -99999.0 - 0 - SFC - - SFC - - - - staticTopo - Topography - meters - -99999.0 - - - pmsl - pressure at mean sea level - Pa - pascal - PMSL - 80000.0 - 110000.0 - -99999.0 - 0 - MSL - - MSL - - - - uw - u wind component - m/s - meter/sec - uWind - -150.0 - 150.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - - st - soil temperature - K - degree_Kelvin - soilT - 0.0 - 1000.0 - -99999.0 - 0 - BLS - - BLS - - - - p - pressure - Pa - pascal - atmP - 0.0 - 110000.0 - -99999.0 - 1 - SFC TROP - - SFC - TROP - - - - t - Temperature - K - degree_Kelvin - T - 180.0 - 330.0 - -99999.0 - 21 - SIG 9823 MB 1000-50 by 50 FH 1829 2743 3658 TROP - - SIG9823 - MB1000 - MB950 - MB900 - MB850 - MB800 - MB750 - MB700 - MB650 - MB600 - MB550 - MB500 - MB450 - MB400 - MB350 - MB300 - MB250 - MB200 - MB150 - MB100 - MB50 - FH1829 - FH2743 - FH3658 - TROP - - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm213.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm213.xml deleted file mode 100644 index 3daf7abbe6..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ngm213.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - 21600 - 43200 - 64800 - 86400 - 108000 - 129600 - 151200 - 172800 - - - staticTopo - Topography - meters - -99999.0 - - - pvv - Pressure vertical velocity - Pa/s - pascal/second - Pvv - -2.5 - 2.5 - -99999.0 - 9 - MB 850 700 500 400 300 250 200 150 100 - - MB850 - MB700 - MB500 - MB400 - MB300 - MB250 - MB200 - MB150 - MB100 - - - - tp - total precipitation - mm - millimeter - totPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - staticSpacing - Grid spacing - meters - -99999.0 - - - cp - convective precipitation - mm - millimeter - convPrecip - 0.0 - 1000.0 - -99999.0 - 0 - SFC - - SFC - - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ruc236.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ruc236.xml index 536e49420c..79a60dc99d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ruc236.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/ruc236.xml @@ -1,4 +1,10 @@ + 0 @@ -457,9 +463,9 @@ 20.0 -99999.0 0 - SFC + MB 0>500 - SFC + MB0500 diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/DatabaseLevelMapping.java b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/DatabaseLevelMapping.java similarity index 89% rename from cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/DatabaseLevelMapping.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/DatabaseLevelMapping.java index 592fa8ec11..dbb1cccf24 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/DatabaseLevelMapping.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/DatabaseLevelMapping.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.core.level; +package com.raytheon.uf.common.dataplugin.level.mapping; import java.util.ArrayList; import java.util.List; @@ -33,7 +33,6 @@ import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; /** * Class defines a database level @@ -46,6 +45,8 @@ import com.raytheon.uf.viz.core.exception.VizCommunicationException; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 11/16/2008 #3576 rjpeter Initial version + * 04/17/2013 #1913 randerso Moved to common + * * * * @author rjpeter @@ -59,16 +60,16 @@ public class DatabaseLevelMapping { .getHandler(DatabaseLevelMapping.class); @XmlAttribute - private String levelName = null; - - @XmlAttribute - private String levelOneValue = null; + private String unit = null; @XmlAttribute private String levelTwoValue = null; @XmlAttribute - private String unit = null; + private String levelOneValue = null; + + @XmlAttribute + private String levelName = null; public String getLevelName() { return levelName; @@ -102,7 +103,7 @@ public class DatabaseLevelMapping { this.unit = unit; } - public List getLevels() throws VizCommunicationException { + public List getLevels() throws CommunicationException { String[] levelOneValues = new String[0]; String[] levelTwoValues = new String[0]; @@ -145,16 +146,11 @@ public class DatabaseLevelMapping { } // handle any aliasing etc - try { - Level level = LevelFactory.getInstance().getLevel(levelName, - lvl1, lvl2, unit); - if (level != null) { - rval.add(level); - } - } catch (CommunicationException e) { - throw new VizCommunicationException(e); + Level level = LevelFactory.getInstance().getLevel(levelName, lvl1, + lvl2, unit); + if (level != null) { + rval.add(level); } - } return rval; diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMapping.java b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMapping.java similarity index 93% rename from cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMapping.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMapping.java index b600ff6501..eb83bcfdf9 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMapping.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMapping.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.uf.viz.core.level; +package com.raytheon.uf.common.dataplugin.level.mapping; import java.util.ArrayList; import java.util.List; @@ -29,9 +29,9 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; /** * Class defines a mapping from a display level to one or more database levels. @@ -46,6 +46,7 @@ import com.raytheon.uf.viz.core.exception.VizCommunicationException; * 11/01/2007 #518 S.Manoj Initial version * 11/16/2009 #3120 rjpeter Modifed to better integrate with level framework. * 11/21/2009 #3576 rjpeter Added group + * 04/17/2013 #1913 randerso Moved to common * * @author smanoj * @version 1.0 @@ -119,7 +120,7 @@ public class LevelMapping implements ISerializableObject { this.databaseLevels = databaseLevels; } - public List getLevels() throws VizCommunicationException { + public List getLevels() throws CommunicationException { if (levelList == null) { List levelList = new ArrayList(); for (DatabaseLevelMapping mapping : databaseLevels) { diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFactory.java similarity index 85% rename from cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFactory.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFactory.java index 234bec3cd1..da3296fa38 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFactory.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.core.level; +package com.raytheon.uf.common.dataplugin.level.mapping; import java.io.File; import java.util.Collection; @@ -29,13 +29,13 @@ import java.util.Set; import javax.xml.bind.JAXB; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.level.Level; import com.raytheon.uf.common.dataplugin.level.MasterLevel; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.uf.viz.core.exception.VizCommunicationException; /** * Factory for getting level mappings @@ -49,15 +49,19 @@ import com.raytheon.uf.viz.core.exception.VizCommunicationException; * ------------ ---------- ----------- -------------------------- * 11/16/2009 #3120 rjpeter Initial version * 11/21/2009 #3576 rjpeter Added group capability + * 04/17/2013 #1913 randerso Moved to common * * @author rjpeter * @version 1.0 */ public class LevelMappingFactory { + // TODO: this should move somewhere else + public static final String VOLUMEBROWSER_LEVEL_MAPPING_FILE = "volumebrowser/LevelMappingFile.xml"; + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(LevelMappingFactory.class); - private static LevelMappingFactory instance = null; + private static Map instanceMap = new HashMap(); private Map keyToLevelMappings = new HashMap(); @@ -69,16 +73,17 @@ public class LevelMappingFactory { private Map>> groupToMasterLevels = new HashMap>>(); - public synchronized static LevelMappingFactory getInstance() { + public synchronized static LevelMappingFactory getInstance(String filePath) { + LevelMappingFactory instance = instanceMap.get(filePath); if (instance == null) { - instance = new LevelMappingFactory(); + instance = new LevelMappingFactory(filePath); + instanceMap.put(filePath, instance); } return instance; } - private LevelMappingFactory() { - File path = PathManagerFactory.getPathManager().getStaticFile( - "volumebrowser/LevelMappingFile.xml"); + private LevelMappingFactory(String filePath) { + File path = PathManagerFactory.getPathManager().getStaticFile(filePath); LevelMappingFile levelMapFile = null; long start = System.currentTimeMillis(); try { @@ -115,7 +120,7 @@ public class LevelMappingFactory { } public LevelMapping getLevelMappingForLevel(Level level) - throws VizCommunicationException { + throws CommunicationException { if (!levelToLevelMappingsInitialized) { initializeLevelToLevelMappings(); } @@ -126,7 +131,7 @@ public class LevelMappingFactory { return keyToLevelMappings.values(); } - public Set getAllLevels() throws VizCommunicationException { + public Set getAllLevels() throws CommunicationException { if (!levelToLevelMappingsInitialized) { initializeLevelToLevelMappings(); } @@ -134,15 +139,14 @@ public class LevelMappingFactory { } public Map> getLevelMapForGroup(String group) - throws VizCommunicationException { + throws CommunicationException { if (!groupToMasterLevelsInitialized) { initializeGroupToMasterLevels(); } return groupToMasterLevels.get(group); } - private void initializeLevelToLevelMappings() - throws VizCommunicationException { + private void initializeLevelToLevelMappings() throws CommunicationException { for (LevelMapping mapping : keyToLevelMappings.values()) { String group = mapping.getGroup(); @@ -165,8 +169,7 @@ public class LevelMappingFactory { levelToLevelMappingsInitialized = true; } - private void initializeGroupToMasterLevels() - throws VizCommunicationException { + private void initializeGroupToMasterLevels() throws CommunicationException { for (LevelMapping mapping : keyToLevelMappings.values()) { String group = mapping.getGroup(); Map> masterLevels = null; diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFile.java b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFile.java similarity index 91% rename from cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFile.java rename to edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFile.java index 53021b9f09..5aac577271 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/level/LevelMappingFile.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.level/src/com/raytheon/uf/common/dataplugin/level/mapping/LevelMappingFile.java @@ -18,7 +18,7 @@ * further licensing information. **/ -package com.raytheon.uf.viz.core.level; +package com.raytheon.uf.common.dataplugin.level.mapping; import java.util.ArrayList; import java.util.List; @@ -44,6 +44,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * ------------ ---------- ----------- -------------------------- * 11/01/2007 #518 S.Manoj Initial version * 11/16/2009 #3120 rjpeter Refactored to use factory and level mapping. + * 04/17/2013 #1913 randerso Moved to common * * @author smanoj * @version 1.0 @@ -56,7 +57,7 @@ public class LevelMappingFile implements ISerializableObject { STANDARD, COMPOSITE, BINARY, XSECT, TSECT, VRTGPH, DIAGRAM, ALL, SURFACE }; - @XmlElements( { @XmlElement(name = "Level", type = LevelMapping.class) }) + @XmlElements({ @XmlElement(name = "Level", type = LevelMapping.class) }) private List levelMappingFile; public List getLevelMappingFile() {