Omaha #2061 Remove references to IDecoderGettable.Amount from Range Rings.

Former-commit-id: 5a4f7a1fd4 [formerly f292f204c9] [formerly fc25774506 [formerly e267e8b0bae314abf3396db6072c6ff8adc732bf]]
Former-commit-id: fc25774506
Former-commit-id: 94b465fa15
This commit is contained in:
Ben Steffensmeier 2014-06-11 13:45:05 -05:00
parent 8e16d5d3e0
commit 217734a2ba
5 changed files with 106 additions and 98 deletions

View file

@ -19,28 +19,34 @@
**/
package com.raytheon.viz.awipstools.capabilityInterfaces;
import com.raytheon.uf.common.dataplugin.IDecoderGettable.Amount;
import javax.measure.Measure;
import javax.measure.quantity.Length;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.viz.awipstools.ui.layer.RangeRingsOverlayLayer;
import com.vividsolutions.jts.geom.Coordinate;
/**
* TODO Add Description
* Interface for {@link AbstractVizResource}s that are able to provide
* information that can be used to draw range rings.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 11, 2014 2061 bsteffen Switch from Amount to Measure.
*
* </pre>
*
* @author bgonzale
* @version 1.0
* @see RangeRingsOverlayLayer
*/
public interface IRangeableResource {
public Amount getElevation();
public Measure<?, Length> getElevation();
public Coordinate getCenter();

View file

@ -54,12 +54,15 @@ import com.vividsolutions.jts.geom.Envelope;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 12-03-09 #3698 bgonzale Range rings overlay with labels
* for radius in km and miles and
* labels for elevation in ftMSL and
* kmAgl.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Dec 03, 2009 3698 bgonzale Range rings overlay with labels
* for radius in km and miles and
* labels for elevation in ftMSL and
* kmAgl.
* Jun 11, 2014 2061 bsteffen Switch IRangeableResource to return
* Measure.
*
*
*
* </pre>
@ -139,8 +142,7 @@ public class RangeRingsOverlayLayer implements IRenderable {
this.rangedResource = rangedResource;
this.center = this.rangedResource.getCenter();
this.resourceSourceElevationInMeters = this.rangedResource
.getElevation().getUnit().getConverterTo(SI.METER)
.convert(this.rangedResource.getElevation().doubleValue());
.getElevation().doubleValue(SI.METER);
this.gc.setStartingGeographicPoint(this.center.x, this.center.y);
updateTilt();
}
@ -151,15 +153,16 @@ public class RangeRingsOverlayLayer implements IRenderable {
* @seecom.raytheon.viz.core.rsc.IVizResource#paint(com.raytheon.viz.core.
* IGraphicsTarget, com.raytheon.viz.core.PixelExtent, double, float)
*/
@Override
public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException {
// calculate ring spacing to use, in miles
float zoomLevel = (float) paintProps.getZoomLevel();
float zoomLevel = paintProps.getZoomLevel();
IExtent pixelExtent = paintProps.getView().getExtent();
float metersZoomConstant = 500000;
int mapWidth = descriptor.getMapWidth();
float dataZoom = (float) ((mapWidth * zoomLevel) / metersZoomConstant);
float dataZoom = (mapWidth * zoomLevel) / metersZoomConstant;
double dRing = getStandardRadius(dataZoom);
IWireframeShape shape = getRangeRingsWireframe(dRing, pixelExtent,

View file

@ -27,13 +27,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.measure.unit.NonSI;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.IDecoderGettable.Amount;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
@ -63,7 +60,6 @@ import com.raytheon.uf.viz.d2d.core.sampling.ID2DSamplingResource;
import com.raytheon.uf.viz.d2d.core.time.D2DTimeMatcher;
import com.raytheon.uf.viz.d2d.core.time.ID2DTimeMatchingExtension;
import com.raytheon.uf.viz.d2d.core.time.TimeMatcher;
import com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource;
import com.raytheon.viz.radar.DefaultVizRadarRecord;
import com.raytheon.viz.radar.VizRadarRecord;
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
@ -79,12 +75,13 @@ import com.vividsolutions.jts.geom.Coordinate;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 03, 2010 mnash Initial creation
* MAR 05, 2013 15313 kshresth Added sampling for DMD
* Apr 11, 2013 DR 16030 D. Friedman Fix NPE.
* May 5, 2014 DR 17201 D. Friedman Enable same-radar time matching.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 03, 2010 mnash Initial creation
* MAR 05, 2013 15313 kshresth Added sampling for DMD
* Apr 11, 2013 16030 D. Friedman Fix NPE.
* May 5, 2014 17201 D. Friedman Enable same-radar time matching.
* Jun 11, 2014 2061 bsteffen Move rangeable methods to radial resource
*
* </pre>
*
@ -94,7 +91,7 @@ import com.vividsolutions.jts.geom.Coordinate;
public class AbstractRadarResource<D extends IDescriptor> extends
AbstractVizResource<RadarResourceData, D> implements
IResourceDataChanged, IRangeableResource, IDataScaleResource,
IResourceDataChanged, IDataScaleResource,
IRadarTextGeneratingResource, ICacheObjectCallback<RadarRecord>,
ID2DTimeMatchingExtension {
private static final transient IUFStatusHandler statusHandler = UFStatus
@ -523,49 +520,6 @@ public class AbstractRadarResource<D extends IDescriptor> extends
return radarRecords;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#getCenter
* ()
*/
@Override
public Coordinate getCenter() {
RadarRecord record = getRadarRecord(displayedDate);
if (record != null) {
return new Coordinate(record.getLongitude(), record.getLatitude());
}
return new Coordinate();
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#
* getElevation()
*/
@Override
public Amount getElevation() {
return new Amount(0.0, NonSI.FOOT);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#getTilt
* ()
*/
@Override
public double getTilt() {
double tilt = 0.0;
if (displayedDate != null) {
tilt = displayedDate.getLevelValue();
}
return tilt;
}
/*
* (non-Javadoc)
*

View file

@ -72,7 +72,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.core.rsc.hdf5.ImageTile;
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
import com.raytheon.viz.radar.VizRadarRecord;
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
import com.raytheon.viz.radar.util.DataUtilities;
@ -85,9 +84,11 @@ import com.vividsolutions.jts.geom.Coordinate;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 4, 2010 mnash Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Aug 04, 2010 mnash Initial creation
* Jun 11, 2014 2061 bsteffen Move rangeable capability to radial
* resource
*
* </pre>
*
@ -345,9 +346,6 @@ public class RadarImageResource<D extends IDescriptor> extends
paintProps.getAlpha());
}
}
RangeRingsOverlayCapability rrcap = getCapability(RangeRingsOverlayCapability.class);
rrcap.setRangeableResource(this);
rrcap.paint(target, paintProps);
}
public void paintRadar(IGraphicsTarget target, PaintProperties paintProps)

View file

@ -24,13 +24,13 @@ import java.util.HashMap;
import java.util.Map;
import javax.measure.Measure;
import javax.measure.quantity.Length;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.IDecoderGettable.Amount;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
@ -40,11 +40,14 @@ import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.colormap.IColormappedImageExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.awipstools.capabilities.EAVCapability;
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
import com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource;
import com.raytheon.viz.awipstools.common.EstimatedActualVelocity;
import com.raytheon.viz.awipstools.common.IRadialVelocityToolSource;
import com.raytheon.viz.radar.VizRadarRecord;
@ -56,17 +59,19 @@ import com.raytheon.viz.radar.rsc.RadarResourceData;
import com.vividsolutions.jts.geom.Coordinate;
/**
* TODO Add Description
* {@link RadarImageResource} that is able to display radial data.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 29, 2010 mnash Initial creation
* 05/02/2013 DR 14587 D. Friedman Implement IRadialVelocityToolSource
* Jul 31, 2013 2190 mschenke Convert interrogate string "msl" to Measure and
* put in as "height"
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jul 29, 2010 mnash Initial creation
* May 02, 2013 14587 D. Friedman Implement IRadialVelocityToolSource
* Jul 31, 2013 2190 mschenke Convert interrogate string "msl" to
* Measure and put in as "height"
* Jun 11, 2014 2061 bsteffen Move rangeable methods here.
*
* </pre>
*
* @author mnash
@ -74,7 +79,7 @@ import com.vividsolutions.jts.geom.Coordinate;
*/
public class RadarRadialResource extends RadarImageResource<MapDescriptor>
implements IRadialVelocityToolSource {
implements IRadialVelocityToolSource, IRangeableResource {
public static final String HEIGHT_INTERROGATE_ID = "height";
@ -90,19 +95,13 @@ public class RadarRadialResource extends RadarImageResource<MapDescriptor>
super(rrd, loadProps, interrogator);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.radar.rsc.AbstractRadarResource#getElevation()
*/
@Override
public Amount getElevation() {
RadarRecord radarRecord = getRadarRecord(displayedDate);
if (radarRecord != null) {
return new Amount(radarRecord.getElevation(), NonSI.FOOT);
}
return super.getElevation();
protected void paintInternal(IGraphicsTarget target,
PaintProperties paintProps) throws VizException {
super.paintInternal(target, paintProps);
RangeRingsOverlayCapability rrcap = getCapability(RangeRingsOverlayCapability.class);
rrcap.setRangeableResource(this);
rrcap.paint(target, paintProps);
}
/*
@ -268,4 +267,52 @@ public class RadarRadialResource extends RadarImageResource<MapDescriptor>
}
return RadarProductFactory.isVelocityProductCode(productCode);
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#
* getElevation()
*/
@Override
public Measure<?, Length> getElevation() {
RadarRecord radarRecord = getRadarRecord(displayedDate);
if (radarRecord != null) {
return Measure.valueOf(radarRecord.getElevation(), NonSI.FOOT);
}
return Measure.valueOf(0.0, NonSI.FOOT);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#getCenter
* ()
*/
@Override
public Coordinate getCenter() {
RadarRecord record = getRadarRecord(displayedDate);
if (record != null) {
return new Coordinate(record.getLongitude(), record.getLatitude());
}
return new Coordinate();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource#getTilt
* ()
*/
@Override
public double getTilt() {
double tilt = 0.0;
if (displayedDate != null) {
tilt = displayedDate.getLevelValue();
}
return tilt;
}
}