diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java index 8e54101886..497bc7e3f0 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -42,16 +42,17 @@ import com.raytheon.viz.grid.util.TiltRequest; /** * The RequestableDataRecord Class - * + * *
- * + * * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 18, 2010 bsteffen Initial creation * + * *- * + * * @author bsteffen * @version 1.0 */ @@ -60,7 +61,7 @@ public class RequestableDataRecord extends GribRecord { private static final long serialVersionUID = 1L; - private AbstractRequestableData requester; + private final AbstractRequestableData requester; public RequestableDataRecord(AbstractRequestableData requester) throws VizException { @@ -74,6 +75,9 @@ public class RequestableDataRecord extends GribRecord { coverage); } GribModel modelInfo = new GribModel(); + if (requester instanceof GribRequestableData) { + setGridVersion(((GribRequestableData) requester).getGribSource().getGridVersion()); + } modelInfo.setModelName(requester.getSource()); modelInfo.setLocation(coverage); modelInfo.setLevel(requester.getLevel()); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FFGVizGroupResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FFGVizGroupResource.java new file mode 100644 index 0000000000..e8a58a889e --- /dev/null +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FFGVizGroupResource.java @@ -0,0 +1,203 @@ +/** + * 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.viz.grid.rsc; +import java.util.ArrayList; +import java.util.Map; + +import com.raytheon.uf.common.geospatial.ReferencedCoordinate; +import com.raytheon.uf.common.time.DataTime; +import com.raytheon.uf.viz.core.IGraphicsTarget; +import com.raytheon.uf.viz.core.drawables.PaintProperties; +import com.raytheon.uf.viz.core.drawables.ResourcePair; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.map.MapDescriptor; +import com.raytheon.uf.viz.core.rsc.AbstractVizResource; +import com.raytheon.uf.viz.core.rsc.IRefreshListener; +import com.raytheon.uf.viz.core.rsc.IResourceDataChanged; +import com.raytheon.uf.viz.core.rsc.LoadProperties; +import com.raytheon.uf.viz.core.rsc.ResourceList; +import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability; +import com.raytheon.viz.core.rsc.VizGroupResourceData; + +/** + * FFG Group Resource class. + * + * Based off VizGroupResource.java + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Sep 19, 2012 1162 mpduff Initial creation. + * + *+ * + * @author mpduff + * @version 1.0 + */ + +public class FFGVizGroupResource extends + AbstractVizResource
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 29, 2011 mpduff Initial creation - * + * Jan 29, 2011 mpduff Initial creation + * Sep 19, 2012 1162 mpudff Protect against null pointer + * *- * + * * @author mpduff * @version 1.0 */ public class FfgGridNameGenerator extends GridNameGenerator { - + public FfgGridNameGenerator() { } /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.grid.rsc.GridNameGenerator#getName(com.raytheon.uf.viz * .core.rsc.AbstractVizResource) */ @Override public String getName(AbstractVizResource, ?> absResource) { - String unit = ((VizGroupResource) absResource).getCapability(ColorMapCapability.class).getColorMapParameters().getDisplayUnit().toString(); - return ((VizGroupResourceData) absResource.getResourceData()).getName() + "(" + unit + ")"; + Unit> unitObj = ((FFGVizGroupResource) absResource).getCapability(ColorMapCapability.class).getColorMapParameters().getDisplayUnit(); + if (unitObj != null) { + return ((VizGroupResourceData) absResource.getResourceData()).getName() + "(" + unitObj.toString() + ")"; + } + + return ((VizGroupResourceData) absResource.getResourceData()).getName(); } } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FfgVizGroupResourceData.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FfgVizGroupResourceData.java index 8ef549e06b..bcecd0da91 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FfgVizGroupResourceData.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/FfgVizGroupResourceData.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -28,16 +28,19 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; +import com.raytheon.uf.viz.core.rsc.AbstractVizResource; +import com.raytheon.uf.viz.core.rsc.LoadProperties; import com.raytheon.viz.core.rsc.VizGroupResourceData; /** * FFG Resource Data. - * + * *
* * SOFTWARE HISTORY @@ -50,7 +53,7 @@ import com.raytheon.viz.core.rsc.VizGroupResourceData; ** * @author mpduff - * @version 1.0 + * @version 1.0 */ public class FfgVizGroupResourceData extends VizGroupResourceData { @@ -85,4 +88,11 @@ public class FfgVizGroupResourceData extends VizGroupResourceData { return availableTimes.toArray(new DataTime[availableTimes.size()]); } + + @Override + protected AbstractVizResource, ?> constructResource( + LoadProperties loadProperties, PluginDataObject[] objects) + throws VizException { + return new FFGVizGroupResource(this, loadProperties); + } } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java index 6ae4499d6a..4288fe7a07 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/GridResource.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -112,6 +112,7 @@ import com.raytheon.viz.core.rsc.hdf5.AbstractTileSet; import com.raytheon.viz.core.rsc.hdf5.MemoryBasedTileSet; import com.raytheon.viz.core.style.image.ImagePreferences; import com.raytheon.viz.grid.GridLevelTranslator; +import com.raytheon.viz.grid.record.RequestableDataRecord; import com.raytheon.viz.grid.rsc.GridNameGenerator.IGridNameResource; import com.raytheon.viz.grid.rsc.GridNameGenerator.LegendParameters; import com.raytheon.viz.grid.xml.FieldDisplayTypesFactory; @@ -121,14 +122,14 @@ import com.vividsolutions.jts.io.WKTReader; /** * Grid Resource - * + * * Accepts grib data records from different time and levels. Data record array * should represent a single parameter. - * + * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Feb 28, 2007 chammack Initial Creation. @@ -139,9 +140,10 @@ import com.vividsolutions.jts.io.WKTReader; * 06/19/2012 14988 D. Friedman Choose interpolation method based on * ImagingCapability.isInterpolationState(). * Oversample reprojected grids. - * + * 09/20/2012 15394 mpduff Condense the PDOs based on grid version. + * Get DataTime from paintProps. *- * + * * @author chammack * @version 1 */ @@ -202,7 +204,7 @@ public class GridResource extends * The great protector of all things related to dataTimes, do not modify or * iterate over pdosToParse, dataTimes, or tileSet unless you sync on this * or else... - * + * */ protected Object timeLock = new Object(); @@ -540,7 +542,7 @@ public class GridResource extends } private class DataRetrievalJob extends Job { - private ConcurrentLinkedQueue