Issue #1869 Fix goes sounding updates.

Change-Id: Ib974c8e88bea021e0e8505e6fb2974f4e108dc80

Former-commit-id: 309624cb7b [formerly dbe74b56e5] [formerly 309624cb7b [formerly dbe74b56e5] [formerly 21abe429ec [formerly 127609cb0ced4b4554943ad78d4263cb70489a90]]]
Former-commit-id: 21abe429ec
Former-commit-id: 0b9c18aa23 [formerly e92d1e9cad]
Former-commit-id: c74c93af71
This commit is contained in:
Ben Steffensmeier 2013-07-05 15:40:04 -05:00
parent c0905c536e
commit 812a14c5cc
3 changed files with 47 additions and 13 deletions

View file

@ -27,6 +27,8 @@ import java.util.Map;
import org.apache.commons.lang.Validate;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.viz.core.catalog.LayerProperty;
import com.raytheon.uf.viz.core.catalog.ScriptCreator;
@ -50,6 +52,7 @@ import com.raytheon.uf.viz.core.rsc.ResourceType;
* Aug 13, 2007 chammack Initial Creation.
* Dec 03, 2007 461 bphillip Modified Time Matching to use VizTim
* Aug 19, 2009 2586 rjpeter Updated error handling.
* Jul 05, 2013 1869 bsteffen Fix goes sounding updates.
* </pre>
*
* @author chammack
@ -155,8 +158,13 @@ public class Loader {
"Map must contain a datauri and plugin name");
}
vals.put(DATAURI_COLUMN, new RequestConstraint(obj.get(DATAURI_COLUMN)
.toString()));
try {
vals.putAll(RequestConstraint.toConstraintMapping(DataURIUtil
.createDataURIMap(obj.get(DATAURI_COLUMN).toString())));
} catch (PluginException e) {
throw new VizException(e);
}
vals.put(PLUGINNAME_COLUMN, new RequestConstraint(obj.get(
PLUGINNAME_COLUMN).toString()));
lp.setDesiredProduct(ResourceType.PLAN_VIEW);

View file

@ -37,33 +37,34 @@ import org.eclipse.core.runtime.ListenerList;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.edex.meteoLib.WindComp;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.sounding.SoundingLayer;
import com.raytheon.uf.common.sounding.SoundingLayer.DATA_TYPE;
import com.raytheon.uf.common.sounding.VerticalSounding;
import com.raytheon.uf.common.sounding.WxMath;
import com.raytheon.uf.common.sounding.SoundingLayer.DATA_TYPE;
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.common.time.DataTime;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
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.IResourceDataChanged;
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.sounding.SoundingParams;
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
import com.raytheon.uf.viz.xy.map.rsc.PointRenderable;
@ -71,7 +72,6 @@ import com.raytheon.viz.core.ColorUtil;
import com.raytheon.viz.core.graphing.LineStroke;
import com.raytheon.viz.core.graphing.WGraphics;
import com.raytheon.viz.core.graphing.WindBarbFactory;
import com.raytheon.viz.skewt.Activator;
import com.raytheon.viz.skewt.SkewTDescriptor;
import com.raytheon.viz.skewt.SkewtDisplay;
import com.raytheon.viz.skewt.rscdata.SkewTResourceData;
@ -87,7 +87,8 @@ import com.vividsolutions.jts.geom.Geometry;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 10, 2009 randerso Initial creation
* Sep 10, 2009 randerso Initial creation
* Jul 05, 2013 1869 bsteffen Fix goes sounding updates.
*
* </pre>
*
@ -1538,4 +1539,24 @@ public class SkewTResource extends
}
point.paint(target, paintProps);
}
@Override
protected void resourceDataChanged(ChangeType type, Object updateObject) {
super.resourceDataChanged(type, updateObject);
if (type == ChangeType.DATA_UPDATE
&& updateObject instanceof PluginDataObject[]) {
PluginDataObject[] objects = (PluginDataObject[]) updateObject;
try {
VerticalSounding[] soundings = resourceData
.convertToSounding(objects);
for (VerticalSounding vs : soundings) {
addSounding(vs.getDataTime(), vs);
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
}
}
}

View file

@ -50,7 +50,8 @@ import com.raytheon.viz.skewt.rsc.SkewTResource;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 23, 2009 randerso Initial creation
* Sep 23, 2009 randerso Initial creation
* Jul 05, 2013 1869 bsteffen Fix goes sounding updates.
*
* </pre>
*
@ -92,16 +93,20 @@ public class SkewTResourceData extends AbstractRequestableResourceData {
protected SkewTResource constructResource(LoadProperties loadProperties,
PluginDataObject[] objects) throws VizException {
soundings = convertToSounding(objects);
return new SkewTResource(this, loadProperties);
}
public VerticalSounding[] convertToSounding(PluginDataObject[] objects)
throws VizException {
if (objects != null && objects.length > 0) {
AbstractVerticalSoundingAdapter adapter = getAdapter(objects[0]);
adapter.setObjects(objects);
soundings = adapter.createSoundings();
return adapter.createSoundings();
} else {
soundings = new VerticalSounding[0];
return new VerticalSounding[0];
}
SkewTResource rsc = new SkewTResource(this, loadProperties);
return rsc;
}
protected AbstractVerticalSoundingAdapter getAdapter(PluginDataObject object)