Omaha #3861 Separate product creation from the main vb plugin.

Former-commit-id: 00e617e97a2979f756de4e58ff602b707a0cc509
This commit is contained in:
Ben Steffensmeier 2015-08-03 18:27:26 -05:00
parent f727ed5ed7
commit 23bfac5d4c
62 changed files with 2920 additions and 1149 deletions

View file

@ -2,8 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Acarssounding Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.acarssounding;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.acarssounding.Activator
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
@ -23,9 +22,10 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
org.geotools;bundle-version="2.6.4",
javax.measure;bundle-version="1.0.0",
com.raytheon.viz.volumebrowser;bundle-version="1.12.1174",
com.raytheon.viz.volumebrowser;bundle-version="1.15.0",
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.derivparam;bundle-version="1.14.0"
com.raytheon.uf.common.derivparam;bundle-version="1.14.0",
com.raytheon.uf.viz.volumebrowser.dataplugin;bundle-version="1.15.0"
Import-Package: com.raytheon.uf.common.inventory.exception,
com.raytheon.uf.viz.datacube
Bundle-ClassPath: com.raytheon.uf.viz.acarssounding.jar

View file

@ -1,5 +1,6 @@
output.com.raytheon.uf.viz.acarssounding.jar = bin/
bin.includes = META-INF/,\
res/,\
com.raytheon.uf.viz.acarssounding.jar
com.raytheon.uf.viz.acarssounding.jar,\
plugin.xml
source.com.raytheon.uf.viz.acarssounding.jar = src/

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.raytheon.viz.volumebrowser.datacatalog">
<dataCatalog
catalogClass="com.raytheon.uf.viz.acarssounding.AcarsSoundingVbDataCatalog">
</dataCatalog>
</extension>
<extension
point="com.raytheon.viz.volumebrowser.productcreator">
<productCreator
creatorClass="com.raytheon.uf.viz.acarssounding.AcarsSoundingProductCreator"
plugins="acarssounding"
resourceType="sounding">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.VarHeightProductCreator"
plugins="acarssounding"
resourceType="var_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.TimeSeriesProductCreator"
plugins="acarssounding"
resourceType="time_series">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointTimeHeightProductCreator"
plugins="acarssounding"
resourceType="time_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointCrossSectionProductCreator"
plugins="acarssounding"
resourceType="cross_section">
</productCreator>
</extension>
</plugin>

View file

@ -0,0 +1,53 @@
/**
* 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.uf.viz.acarssounding;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.vb.NSharpProductCreator;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
/**
*
* Creates {@link AcarsSndNSharpResourceData} for loading acars sounding data in
* nsharp.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class AcarsSoundingProductCreator extends NSharpProductCreator {
@Override
protected D2DNSharpResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return new AcarsSndNSharpResourceData();
}
}

View file

@ -19,10 +19,7 @@
**/
package com.raytheon.uf.viz.acarssounding;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.datacatalog.PointDataCatalog;
import com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointDataCatalog;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
/**
@ -32,11 +29,12 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2013 2269 bsteffen Initial javadoc
* Aug 19, 2013 2269 bsteffen Fix MDCRS data and switch acars to use
* nsharp.
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 19, 2013 2269 bsteffen Initial javadoc
* Aug 19, 2013 2269 bsteffen Fix MDCRS data and switch acars to use
* nsharp.
* Aug 03, 2015 3861 bsteffen Move resource creation to product creator
*
* </pre>
*
@ -50,15 +48,4 @@ public class AcarsSoundingVbDataCatalog extends PointDataCatalog {
return new String[] { "acarssounding" };
}
@Override
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
if (resourceType == ResourceType.SOUNDING
&& catalogEntry.getSelectedData().getSourcesKey()
.equals("acarssounding")) {
return new AcarsSndNSharpResourceData();
}
return super.getResourceData(catalogEntry, resourceType);
}
}

View file

@ -1,88 +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.uf.viz.acarssounding;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
/**
* The activator class controls the plug-in life cycle
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2013 2269 bsteffen Initial javadoc
* Aug 19, 2013 2269 bsteffen Fix MDCRS data and switch acars to use
* nsharp.
*
* </pre>
*
* @author unknown
* @version 1.0
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.acarssounding";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
DataCatalogManager.getDataCatalogManager().addDataCatalog(
new AcarsSoundingVbDataCatalog());
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: GFE in D2D
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.gfe;singleton:=true
Bundle-Version: 1.15.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.d2d.gfe.Activator
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
@ -19,11 +18,10 @@ Require-Bundle: org.eclipse.swt;bundle-version="3.8.1",
com.raytheon.uf.viz.xy.timeseries;bundle-version="1.13.0",
com.raytheon.uf.common.style,
com.raytheon.uf.viz.productbrowser,
com.raytheon.viz.volumebrowser;bundle-version="1.13.0",
javax.measure
Export-Package: com.raytheon.uf.viz.d2d.gfe,
com.raytheon.uf.viz.d2d.gfe.browser,
com.raytheon.viz.volumebrowser;bundle-version="1.15.0",
javax.measure,
com.raytheon.uf.viz.core.maps;bundle-version="1.14.1"
Export-Package: com.raytheon.uf.viz.d2d.gfe.browser,
com.raytheon.uf.viz.d2d.gfe.rsc,
com.raytheon.uf.viz.d2d.gfe.xy
Import-Package: org.osgi.framework;version="1.7.0"
Bundle-ClassPath: com.raytheon.uf.viz.d2d.gfe.jar

View file

@ -24,4 +24,23 @@
name="GFE Time Series Adapter">
</timeSeriesAdapter>
</extension>
<extension
point="com.raytheon.viz.volumebrowser.datacatalog">
<dataCatalog
catalogClass="com.raytheon.uf.viz.d2d.gfe.browser.GFEVbDataCatalog">
</dataCatalog>
</extension>
<extension
point="com.raytheon.viz.volumebrowser.productcreator">
<productCreator
creatorClass="com.raytheon.uf.viz.d2d.gfe.browser.GfeMapProductCreator"
plugins="gfe"
resourceType="plan_view">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.TimeSeriesProductCreator"
plugins="gfe"
resourceType="time_series">
</productCreator>
</extension>
</plugin>

View file

@ -1,40 +0,0 @@
package com.raytheon.uf.viz.d2d.gfe;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import com.raytheon.uf.viz.d2d.gfe.browser.GFEVbDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
DataCatalogManager.getDataCatalogManager().addDataCatalog(
new GFEVbDataCatalog());
}
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.viz.d2d.gfe.browser;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -41,15 +40,10 @@ import com.raytheon.uf.common.style.StyleException;
import com.raytheon.uf.common.style.StyleManager;
import com.raytheon.uf.common.style.StyleManager.StyleType;
import com.raytheon.uf.common.style.StyleRule;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.d2d.gfe.rsc.GFEGridResource;
import com.raytheon.uf.viz.d2d.gfe.rsc.GFEGridResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogEntry;
@ -67,12 +61,13 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 9, 2011 bsteffen Initial creation
* May 02, 2013 1949 bsteffen Update GFE data access in Product
* Browser, Volume Browser, and Data Access
* Framework.
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Mar 09, 2011 bsteffen Initial creation
* May 02, 2013 1949 bsteffen Update GFE data access in Product Browser,
* Volume Browser, and Data Access Framework
* Aug 03, 2015 3861 bsteffen Move resource creation to product creator
*
*
* </pre>
*
@ -250,31 +245,6 @@ public class GFEVbDataCatalog extends AbstractDataCatalog {
.getSelectedData()));
}
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalogEntry catalogEntry, ResourceType resourceType,
DisplayType displayType) {
Collection<ResourcePair> rsc = super.getResourcesToLoad(catalogEntry,
resourceType, displayType);
for (ResourcePair pair : rsc) {
AbstractResourceData rd = pair.getResourceData();
if (rd instanceof GFEGridResourceData) {
((GFEGridResourceData) rd).setLegendString(getName(
catalogEntry, displayType));
}
}
return rsc;
}
@Override
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
if (resourceType == ResourceType.PLAN_VIEW) {
return new GFEGridResourceData();
}
return super.getResourceData(catalogEntry, resourceType);
}
@Override
protected String getDisplayUnit(IDataCatalogEntry catalogEntry,
DisplayType displayType) {

View file

@ -0,0 +1,55 @@
/**
* 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.uf.viz.d2d.gfe.browser;
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.d2d.gfe.rsc.GFEGridResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.AbstractMapProductCreator;
/**
*
* Creates {@link GFEGridResourceData} for use on a {@link MapRenderableDisplay}
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class GfeMapProductCreator extends AbstractMapProductCreator {
@Override
protected GFEGridResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
GFEGridResourceData data = new GFEGridResourceData();
data.setLegendString(dataCatalog.getName(catalogEntry, displayType));
return data;
}
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: D2D Nsharp
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.nsharp;singleton:=true
Bundle-Version: 1.14.1.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
@ -22,8 +22,10 @@ Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14.0",
com.raytheon.uf.common.topo,
com.raytheon.viz.pointdata,
com.raytheon.uf.viz.image.export;bundle-version="1.14.0",
org.eclipse.core.runtime;bundle-version="3.8.0"
org.eclipse.core.runtime;bundle-version="3.8.0",
com.raytheon.viz.volumebrowser;bundle-version="1.15.0"
Export-Package: com.raytheon.uf.viz.d2d.nsharp,
com.raytheon.uf.viz.d2d.nsharp.display,
com.raytheon.uf.viz.d2d.nsharp.rsc
com.raytheon.uf.viz.d2d.nsharp.rsc,
com.raytheon.uf.viz.d2d.nsharp.vb
Bundle-ClassPath: com.raytheon.uf.viz.d2d.nsharp.jar

View file

@ -79,5 +79,13 @@
</contextId>
</classContext>
</extension>
<extension
point="com.raytheon.viz.volumebrowser.productcreator">
<productCreator
creatorClass="com.raytheon.uf.viz.d2d.nsharp.vb.NSharpProductCreator"
plugins="grid,bufrua,modelsounding,poessounding,goessounding"
resourceType="sounding">
</productCreator>
</extension>
</plugin>

View file

@ -32,6 +32,7 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
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.topo.TopoException;
@ -40,19 +41,23 @@ import com.raytheon.uf.viz.core.exception.VizException;
/**
*
* TODO Add Description
* {@link D2DNSharpResourceData} for loading gridded data into nsharp.
*
* TODO rename to GridNSharpResourceData, grib only remains for backward
* compatibility in xml.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 26, 2011 bsteffen Initial creation
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
* and moved into common
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Jul 26, 2011 bsteffen Initial creation
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes and moved
* into common
* 04/27/2015 RM#6674&7787 Chin Chen support model sounding query data interpolation and nearest point option
*
* Aug 03, 2015 3861 bsteffen Automatically determine sounding type from
* request constraints.
*
* </pre>
*
@ -77,8 +82,11 @@ public class GribNSharpResourceData extends D2DNSharpResourceData {
@Override
protected void preparePointInfo() throws VizException {
// everything should already be set
return;
/* Always keep the type in sync with what is in the metadata map. */
RequestConstraint typeConstraint = metadataMap.get("info.datasetId");
if (typeConstraint != null) {
this.setSoundingType(typeConstraint.getConstraintValue());
}
}
@Override

View file

@ -0,0 +1,92 @@
/**
* 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.uf.viz.d2d.nsharp.vb;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDisplay;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.d2d.nsharp.rsc.BufruaNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.GoesSndNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.GribNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.MdlSndNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.PoesSndNSharpResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.AbstractProductCreator;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Create various {@link D2DNSharpResourceData}s for using nsharp with the
* volume browser.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class NSharpProductCreator extends AbstractProductCreator {
@Override
protected D2DNSharpResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
String sourceKey = catalogEntry.getSelectedData().getSourcesKey();
if (sourceKey.equals("bufrua")) {
return new BufruaNSharpResourceData();
} else if (sourceKey.equals("modelsoundingETA")) {
return new MdlSndNSharpResourceData("NAMSND");
} else if (sourceKey.equals("modelsoundingGFS")) {
return new MdlSndNSharpResourceData("GFSSND");
} else if (sourceKey.equals("poessounding")) {
return new PoesSndNSharpResourceData();
} else if (sourceKey.equals("goessounding")) {
return new GoesSndNSharpResourceData();
} else {
D2DNSharpResourceData tmpData = new GribNSharpResourceData(
catalogEntry.getSelectedData().getSourcesKey());
tmpData.setCoordinate(PointLineUtil
.getPointCoordinate(catalogEntry));
String pointName = catalogEntry.getSelectedData().getPlanesKey();
tmpData.setPointName(pointName);
return tmpData;
}
}
@Override
protected AbstractRenderableDisplay createNewRenderableDisplay(VolumeBrowserDialogSettings dialogSettings, SelectedData selectedData) {
NsharpSkewTPaneDisplay display = new NsharpSkewTPaneDisplay();
display.setDescriptor(new NsharpSkewTPaneDescriptor());
return display;
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.viz.volumebrowser.dataplugin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,30 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Volume Browser Data Plugins
Bundle-SymbolicName: com.raytheon.uf.viz.volumebrowser.dataplugin;singleton:=true
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.15.1",
com.raytheon.viz.volumebrowser;bundle-version="1.15.0",
org.eclipse.core.runtime;bundle-version="3.8.0",
com.raytheon.uf.common.time;bundle-version="1.14.0",
com.raytheon.uf.viz.xy.varheight;bundle-version="1.15.0",
com.raytheon.uf.viz.xy.timeseries;bundle-version="1.14.0",
com.raytheon.uf.viz.xy.timeheight;bundle-version="1.15.0",
com.raytheon.uf.viz.xy.crosssection;bundle-version="1.15.0",
com.raytheon.uf.common.geospatial;bundle-version="1.15.0",
com.raytheon.uf.common.pointdata;bundle-version="1.15.0",
com.raytheon.viz.pointdata;bundle-version="1.15.0",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.14.1",
com.raytheon.uf.common.derivparam;bundle-version="1.14.1",
com.raytheon.uf.viz.points;bundle-version="1.0.0",
com.raytheon.uf.viz.core.maps;bundle-version="1.14.1",
com.raytheon.uf.common.dataplugin;bundle-version="1.14.0",
com.raytheon.viz.grid;bundle-version="1.15.0",
com.raytheon.uf.viz.objectiveanalysis;bundle-version="1.15.0",
com.raytheon.uf.common.inventory;bundle-version="1.14.0",
com.raytheon.viz.awipstools;bundle-version="1.14.0",
com.raytheon.uf.viz.datacube;bundle-version="1.14.0",
com.raytheon.uf.viz.core.grid;bundle-version="1.15.0"
Export-Package: com.raytheon.uf.viz.volumebrowser.dataplugin.point

View file

@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.raytheon.viz.volumebrowser.datacatalog">
<dataCatalog
catalogClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridDataCatalog">
</dataCatalog>
<dataCatalog
catalogClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointDataCatalog">
</dataCatalog>
<dataCatalog
catalogClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.DmdDataCatalog">
</dataCatalog>
<dataCatalog
catalogClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.ModelSoundingCatalog">
</dataCatalog>
<dataCatalog
catalogClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.VwpDataCatalog">
</dataCatalog>
</extension>
<extension
point="com.raytheon.viz.volumebrowser.productcreator">
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridMapProductCreator"
plugins="grid"
resourceType="plan_view">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridCrossSectionProductCreator"
plugins="grid"
resourceType="cross_section">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridTimeHeightProductCreator"
plugins="grid"
resourceType="time_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridVarHeightProductCreator"
plugins="grid"
resourceType="var_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridTimeSeriesProductCreator"
plugins="grid"
resourceType="time_series">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.OAMapProductCreator"
plugins="obs,bufrua"
resourceType="plan_view">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.OATimeSeriesProductCreator"
plugins="bufrua,obs"
resourceType="time_series">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.TimeSeriesProductCreator"
plugins="goessounding,poessounding,profiler,bufrmosLAMP,modelsounding,radar"
resourceType="time_series">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointCrossSectionProductCreator"
plugins="goessounding,poessounding,profiler,bufrua,modelsounding"
resourceType="cross_section">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.PointTimeHeightProductCreator"
plugins="goessounding,poessounding,profiler,bufrua,modelsounding,radar"
resourceType="time_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.uf.viz.volumebrowser.dataplugin.point.VwpCrossSectionCreator"
plugins="radar"
resourceType="cross_section">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.VarHeightProductCreator"
plugins="goessounding,poessounding,profiler,bufrua,modelsounding,radar"
resourceType="var_height">
</productCreator>
<productCreator
creatorClass="com.raytheon.viz.volumebrowser.loader.VarHeightHodoProductCreator"
plugins="radar,profiler"
resourceType="sounding">
</productCreator>
</extension>
</plugin>

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin;
import java.util.ArrayList;
import java.util.Arrays;
@ -45,6 +45,10 @@ 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.datacube.DataCubeContainer;
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.DataListsProdTableComp.DataSelection;
import com.raytheon.viz.volumebrowser.vbui.MenuItemManager;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
@ -52,19 +56,21 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserAction;
/**
* TODO Add Description
* Base {@link IDataCatalog} for plugin types that use an
* {@link AbstractInventory} to track parameter availability.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 14, 2010 bsteffen Initial creation
* Jul 25, 2013 2112 bsteffen Fix volume browser sounding errors.
* Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived
* parameters to common
* Sep 09, 2014 3356 njensen Remove CommunicationException
* May 18, 2015 4412 bsteffen Use all level mappings for plane names
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Apr 14, 2010 bsteffen Initial creation
* Jul 25, 2013 2112 bsteffen Fix volume browser sounding errors.
* Jan 30, 2014 2725 ekladstr updated exception handling during move of derived
* parameters to common
* Sep 09, 2014 3356 njensen Remove CommunicationException
* May 18, 2015 4412 bsteffen Use all level mappings for plane names
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
* </pre>
*
@ -223,13 +229,13 @@ public abstract class AbstractInventoryDataCatalog extends AbstractDataCatalog {
protected Collection<String> get3DPlanes(Collection<String> sources) {
Set<String> results = new HashSet<String>();
if (sources == null || sources.isEmpty()) {
results.addAll(getPointLineKeys());
results.addAll(PointLineUtil.getPointLineKeys());
results.addAll(MenuItemManager.getInstance().getLatLonKeys());
} else {
List<String> allSources = getSupportedSourcesInternal();
for (String source : sources) {
if (allSources.contains(source)) {
results.addAll(getPointLineKeys());
results.addAll(PointLineUtil.getPointLineKeys());
results.addAll(MenuItemManager.getInstance()
.getLatLonKeys());
}

View file

@ -0,0 +1,68 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridEnsembleHelper.GridProductCreator;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionRenderableDisplay;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.CrossSectionProductCreator;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
/**
*
* {@link ProductCreator} for loading grid data on a
* {@link CrossSectionRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridCrossSectionProductCreator extends CrossSectionProductCreator
implements GridProductCreator {
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return GridEnsembleHelper.getResourcesToLoad(this, dataCatalog,
catalogEntry, displayType);
}
@Override
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return super.getResourcesToLoad(dataCatalog, catalogEntry, displayType);
}
}

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.grid;
import java.util.ArrayList;
import java.util.Collection;
@ -25,7 +25,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.NavigableSet;
import java.util.Set;
@ -36,7 +35,6 @@ import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.geometry.BoundingBox;
import org.opengis.referencing.operation.MathTransform;
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.dataplugin.level.util.LevelUtilities;
@ -47,20 +45,15 @@ import com.raytheon.uf.common.gridcoverage.GridCoverage;
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.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.GribNSharpResourceData;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.uf.viz.volumebrowser.dataplugin.AbstractInventoryDataCatalog;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.grid.inv.GridInventory;
import com.raytheon.viz.grid.rsc.GridNameGenerator;
import com.raytheon.viz.grid.rsc.GridResourceData;
import com.raytheon.viz.grid.util.CoverageUtils;
import com.raytheon.viz.grid.xml.FieldDisplayTypesFactory;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.MenuItemManager;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.SpaceTimeMenu;
@ -70,24 +63,25 @@ import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.LineString;
/**
* Implements the IDataCatalog interface for grib data.
* Implements the IDataCatalog interface for grid data.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 27, 2009 2161 lvenable Initial creation
* Oct 21, 2009 1711 bsteffen Updated Baseline and Points to use new
* ToolsDataManager
* Nov 17, 2009 3120 rjpeter Updated to use LevelMappingFactory.
* Jul 31, 2012 875 rferrel Now uses points.
* May 30, 2013 2055 bsteffen Remove modelName from sounding pointName.
* Dec 06, 2013 2271 mpduff Added check for null coordinate.
* Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived
* parameters to common
* Mar 11, 2014 #2718 randerso Changes for GeoTools 10.5
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* May 27, 2009 2161 lvenable Initial creation
* Oct 21, 2009 1711 bsteffen Updated Baseline and Points to use new
* ToolsDataManager
* Nov 17, 2009 3120 rjpeter Updated to use LevelMappingFactory.
* Jul 31, 2012 875 rferrel Now uses points.
* May 30, 2013 2055 bsteffen Remove modelName from sounding pointName.
* Dec 06, 2013 2271 mpduff Added check for null coordinate.
* Jan 30, 2014 2725 ekladstr updated exception handling during move of derived
* parameters to common
* Mar 11, 2014 2718 randerso Changes for GeoTools 10.5
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
* </pre>
*
@ -255,83 +249,6 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog {
return new String[] { GridInventory.PLUGIN_NAME };
}
@Override
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
AbstractRequestableResourceData rscData = null;
switch (resourceType) {
case PLAN_VIEW:
GridResourceData gRscData = new GridResourceData();
if (catalogEntry.getDialogSettings().getSpaceTimeSelection() == SpaceTimeMenu.SPACE) {
gRscData.setSpatial(true);
} else {
gRscData.setNameGenerator(new GridNameGenerator(catalogEntry
.getSelectedData().getPlanesText()));
}
rscData = gRscData;
break;
case SOUNDING:
D2DNSharpResourceData tmpData = new GribNSharpResourceData(
catalogEntry.getSelectedData().getSourcesKey());
tmpData.setCoordinate(getPointCoordinate(catalogEntry));
String pointName = catalogEntry.getSelectedData().getPlanesKey();
tmpData.setPointName(pointName);
rscData = tmpData;
break;
default:
rscData = super.getResourceData(catalogEntry, resourceType);
}
return rscData;
}
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalogEntry catalogEntry, ResourceType resourceType,
DisplayType displayType) {
Map<String, RequestConstraint> metadataMap = getProductParameters(catalogEntry);
List<String> ensemebles = null;
try {
ensemebles = getGridInventory().getEnsembles(metadataMap);
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"Error occured during perturbation query.", e);
}
if ((ensemebles != null) && (ensemebles.size() > 1)) {
Collections.sort(ensemebles);
Collection<ResourcePair> requests = new ArrayList<ResourcePair>();
for (String ensemble : ensemebles) {
Collection<ResourcePair> origRequests = super
.getResourcesToLoad(catalogEntry, resourceType,
displayType);
for (ResourcePair request : origRequests) {
((AbstractRequestableResourceData) request
.getResourceData()).getMetadataMap().put(
GridConstants.ENSEMBLE_ID,
new RequestConstraint(ensemble.toString()));
requests.add(request);
}
}
return requests;
} else {
return super.getResourcesToLoad(catalogEntry, resourceType,
displayType);
}
}
/**
* @return
*/
private GridInventory getGridInventory() {
return (GridInventory) getInventory();
}
/*
* (non-Javadoc)
*
@ -483,7 +400,7 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog {
|| (viewSelection == ViewMenu.TIMESERIES)) {
Set<String> results = new HashSet<String>();
results.addAll(MenuItemManager.getInstance().getLatLonKeys());
results.addAll(getPointLineKeys());
results.addAll(PointLineUtil.getPointLineKeys());
return results;
}
ToolsDataManager tdm = ToolsDataManager.getInstance();
@ -497,7 +414,7 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog {
Set<String> results = new HashSet<String>();
results.addAll(MenuItemManager.getInstance()
.getLatLonKeys());
results.addAll(getPointLineKeys());
results.addAll(PointLineUtil.getPointLineKeys());
return results;
}
for (GridCoverage coverage : coverages) {

View file

@ -17,12 +17,13 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.grid;
import java.util.HashMap;
import java.util.Map;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogEntry;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
/**
@ -33,9 +34,10 @@ import com.raytheon.viz.volumebrowser.vbui.SelectedData;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 25, 2012 bsteffen Initial javadoc
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Sep 25, 2012 bsteffen Initial javadoc
* Aug 03, 2015 3861 bsteffen Move to new plugin
*
* </pre>
*

View file

@ -0,0 +1,125 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
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.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.datacube.DataCubeContainer;
import com.raytheon.viz.grid.inv.GridInventory;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
/**
*
* Provides static methods to allow multiple {@link ProductCreator} to share the
* same logic for loading multiple resources when the selected source is an
* ensemble model.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridEnsembleHelper {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GridEnsembleHelper.class);
public static interface GridProductCreator extends ProductCreator{
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType);
}
public static Collection<ResourcePair> getResourcesToLoad(
GridProductCreator creator, IDataCatalog dataCatalog,
IDataCatalogEntry catalogEntry, DisplayType displayType) {
List<String> ensembles = GridEnsembleHelper.getEnsembles(dataCatalog,
catalogEntry);
if (ensembles != null) {
Collection<ResourcePair> full = new ArrayList<ResourcePair>();
for (String ensemble : ensembles) {
Collection<ResourcePair> single = creator
.getBaseResourcesToLoad(dataCatalog, catalogEntry,
displayType);
GridEnsembleHelper.addEnsemble(single, ensemble);
full.addAll(single);
}
return full;
} else {
return creator.getBaseResourcesToLoad(dataCatalog, catalogEntry,
displayType);
}
}
private static List<String> getEnsembles(IDataCatalog dataCatalog,
IDataCatalogEntry catalogEntry) {
Map<String, RequestConstraint> metadataMap = dataCatalog
.getProductParameters(catalogEntry);
List<String> ensembles = null;
try {
ensembles = getGridInventory().getEnsembles(metadataMap);
if (ensembles != null && ensembles.size() > 1) {
Collections.sort(ensembles);
} else {
ensembles = null;
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"Error occured during perturbation query.", e);
}
return ensembles;
}
private static void addEnsemble(Collection<ResourcePair> resources,
String ensemble) {
for (ResourcePair pair : resources) {
AbstractRequestableResourceData data = ((AbstractRequestableResourceData) pair
.getResourceData());
data.getMetadataMap().put(GridConstants.ENSEMBLE_ID,
new RequestConstraint(ensemble.toString()));
}
}
private static GridInventory getGridInventory() {
return (GridInventory) DataCubeContainer
.getInventory(GridConstants.GRID);
}
}

View file

@ -0,0 +1,87 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridEnsembleHelper.GridProductCreator;
import com.raytheon.viz.grid.rsc.GridNameGenerator;
import com.raytheon.viz.grid.rsc.GridResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.AbstractMapProductCreator;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.SpaceTimeMenu;
/**
*
* {@link ProductCreator} for loading grid data on a
* {@link MapRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridMapProductCreator extends AbstractMapProductCreator implements
GridProductCreator {
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return GridEnsembleHelper.getResourcesToLoad(this, dataCatalog,
catalogEntry, displayType);
}
@Override
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return super.getResourcesToLoad(dataCatalog, catalogEntry, displayType);
}
@Override
protected GridResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
GridResourceData gRscData = new GridResourceData();
if (catalogEntry.getDialogSettings().getSpaceTimeSelection() == SpaceTimeMenu.SPACE) {
System.out
.println("Loading a Plan View Space Grid Resource from the Volume Browser.");
gRscData.setSpatial(true);
} else {
gRscData.setNameGenerator(new GridNameGenerator(catalogEntry
.getSelectedData().getPlanesText()));
}
return gRscData;
}
}

View file

@ -0,0 +1,68 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridEnsembleHelper.GridProductCreator;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightRenderableDisplay;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.loader.TimeHeightProductCreator;
/**
*
* {@link ProductCreator} for loading grid data on a
* {@link TimeHeightRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridTimeHeightProductCreator extends TimeHeightProductCreator
implements GridProductCreator {
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return GridEnsembleHelper.getResourcesToLoad(this, dataCatalog,
catalogEntry, displayType);
}
@Override
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return super.getResourcesToLoad(dataCatalog, catalogEntry, displayType);
}
}

View file

@ -0,0 +1,68 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridEnsembleHelper.GridProductCreator;
import com.raytheon.uf.viz.xy.timeseries.display.TimeSeriesRenderableDisplay;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.loader.TimeSeriesProductCreator;
/**
*
* {@link ProductCreator} for loading grid data on a
* {@link TimeSeriesRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridTimeSeriesProductCreator extends TimeSeriesProductCreator
implements GridProductCreator {
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return GridEnsembleHelper.getResourcesToLoad(this, dataCatalog,
catalogEntry, displayType);
}
@Override
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return super.getResourcesToLoad(dataCatalog, catalogEntry, displayType);
}
}

View file

@ -0,0 +1,68 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.grid;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.volumebrowser.dataplugin.grid.GridEnsembleHelper.GridProductCreator;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightRenderableDisplay;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.loader.VarHeightProductCreator;
/**
*
* {@link ProductCreator} for loading grid data on a
* {@link VarHeightRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class GridVarHeightProductCreator extends VarHeightProductCreator
implements GridProductCreator {
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return GridEnsembleHelper.getResourcesToLoad(this, dataCatalog,
catalogEntry, displayType);
}
@Override
public Collection<ResourcePair> getBaseResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
return super.getResourcesToLoad(dataCatalog, catalogEntry, displayType);
}
}

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.point;
import java.util.Arrays;
import java.util.Collection;
@ -28,19 +28,45 @@ import java.util.List;
import java.util.Set;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogEntry;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
/**
*
* Implements the IDataCatalog interface for dmd data.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 3, 2015 bsteffen Initial javadoc
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class DmdDataCatalog extends AbstractDataCatalog {
private static final String[] fieldPlanePairs = { "LowLyr:ShrMag",
"MaxShear:ShrMag", "LowLyr:wDiv", "MidLyr:wDiv", "LowLyr:g2gsh",
"LowLyr:RRV", "MaxWind:RRV", "LowLyr:diam", "Layer:sRank",
"LowLyr:GH", "MaxWind:GH", "MaxShear:GH", "HiLyr:GH", "LowLyr:P",
"MaxWind:P", "MaxShear:P", "HiLyr:P", POINT_LINE_KEY + ":ShrMag",
POINT_LINE_KEY + ":wDiv", POINT_LINE_KEY + ":g2gsh",
POINT_LINE_KEY + ":RRV", POINT_LINE_KEY + ":diam",
POINT_LINE_KEY + ":GH", POINT_LINE_KEY + ":P" };
"MaxWind:P", "MaxShear:P", "HiLyr:P",
PointLineUtil.POINT_LINE_KEY + ":ShrMag",
PointLineUtil.POINT_LINE_KEY + ":wDiv",
PointLineUtil.POINT_LINE_KEY + ":g2gsh",
PointLineUtil.POINT_LINE_KEY + ":RRV",
PointLineUtil.POINT_LINE_KEY + ":diam",
PointLineUtil.POINT_LINE_KEY + ":GH",
PointLineUtil.POINT_LINE_KEY + ":P" };
@Override
protected void addProductParameters(IDataCatalogEntry catalogEntry,
@ -72,7 +98,7 @@ public class DmdDataCatalog extends AbstractDataCatalog {
if (!getAvailablePlanes(selectedSources, selectedFields).contains(
selectedData.getPlanesKey())
&& !isPointLine(selectedData.getPlanesKey())) {
&& !PointLineUtil.isPointLine(selectedData.getPlanesKey())) {
return null;
}
@ -107,13 +133,14 @@ public class DmdDataCatalog extends AbstractDataCatalog {
List<String> planes = Arrays.asList(selectedPlanes);
boolean hasPointLine = false;
for (String plane : planes) {
hasPointLine = hasPointLine || isPointLine(plane);
hasPointLine = hasPointLine || PointLineUtil.isPointLine(plane);
}
for (String fieldPlanePair : fieldPlanePairs) {
String[] split = fieldPlanePair.split(":");
if (planes.isEmpty() || planes.contains(split[0])) {
fields.add(split[1]);
} else if (hasPointLine && split[0].equals(POINT_LINE_KEY)) {
} else if (hasPointLine
&& split[0].equals(PointLineUtil.POINT_LINE_KEY)) {
fields.add(split[1]);
}
}
@ -131,8 +158,8 @@ public class DmdDataCatalog extends AbstractDataCatalog {
for (String fieldPlanePair : fieldPlanePairs) {
String[] split = fieldPlanePair.split(":");
if (fields.contains(split[1]) || fields.isEmpty()) {
if (split[0].equals(POINT_LINE_KEY)) {
for (String plane : getPointLineKeys()) {
if (split[0].equals(PointLineUtil.POINT_LINE_KEY)) {
for (String plane : PointLineUtil.getPointLineKeys()) {
planes.add(plane);
}
} else {
@ -151,7 +178,7 @@ public class DmdDataCatalog extends AbstractDataCatalog {
List<String> planes = Arrays.asList(selectedPlanes);
boolean hasPointLine = false;
for (String plane : planes) {
hasPointLine = hasPointLine || isPointLine(plane);
hasPointLine = hasPointLine || PointLineUtil.isPointLine(plane);
}
for (String fieldPlanePair : fieldPlanePairs) {
String[] split = fieldPlanePair.split(":");
@ -159,7 +186,8 @@ public class DmdDataCatalog extends AbstractDataCatalog {
if (planes.contains(split[0]) || planes.isEmpty()) {
return Arrays.asList("radar149");
} else if (hasPointLine && split[0].equals(POINT_LINE_KEY)) {
} else if (hasPointLine
&& split[0].equals(PointLineUtil.POINT_LINE_KEY)) {
return Arrays.asList("radar149");
}
}

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.point;
import java.util.ArrayList;
import java.util.Arrays;
@ -36,6 +36,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.pointdata.StaticPlotInfoPV;
import com.raytheon.viz.pointdata.StaticPlotInfoPV.SPIEntry;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.DelegateAvailableRequest;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
import com.raytheon.viz.volumebrowser.xml.VbSource;
@ -48,15 +50,16 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 28, 2011 mschenke Initial creation
* May 02, 2013 1949 bsteffen Force ModelSounding in Vb to play nicely
* with others.
* Jul 23, 2014 3410 bclement location changed to floats
* Aug 19, 2014 3506 mapeters Modified getTypeMap function to still get
* correct VB sources after splitting them
* into multiple files.
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Sep 28, 2011 mschenke Initial creation
* May 02, 2013 1949 bsteffen Force ModelSounding in Vb to play nicely
* with others.
* Jul 23, 2014 3410 bclement location changed to floats
* Aug 19, 2014 3506 mapeters Modified getTypeMap function to still get
* correct VB sources after splitting them
* into multiple files.
* Aug 03, 2015 3861 bsteffen Move to volumebrowser.dataplugin plugin.
*
* </pre>
*

View file

@ -0,0 +1,73 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.point;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.objectiveanalysis.rsc.OAResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.AbstractMapProductCreator;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
/**
*
* {@link ProductCreator} for loading objective analysis data on a
* {@link MapRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class OAMapProductCreator extends AbstractMapProductCreator {
@Override
protected OAResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
String sourceText = catalogEntry.getSelectedData().getSourcesText();
OAResourceData rscData = new OAResourceData();
if (sourceText.equals("RaobOA")) {
BinOffset binOffset = new BinOffset(3600, 3600);
rscData.setBinOffset(binOffset);
} else if (sourceText.equals("MetarOA")) {
BinOffset binOffset = new BinOffset(1800, 1800);
rscData.setBinOffset(binOffset);
}
rscData.setParameter(catalogEntry.getSelectedData().getFieldsKey());
rscData.setParameterName(catalogEntry.getSelectedData().getFieldsText());
rscData.setSource(sourceText);
String levelKey = catalogEntry.getSelectedData().getPlanesKey();
rscData.setLevelKey(levelKey);
rscData.setRetrieveData(false);
rscData.setUpdatingOnMetadataOnly(true);
return rscData;
}
}

View file

@ -0,0 +1,66 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.point;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.timeseries.display.TimeSeriesRenderableDisplay;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.loader.TimeSeriesProductCreator;
/**
*
* {@link ProductCreator} for loading objective analysis data on a
* {@link TimeSeriesRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class OATimeSeriesProductCreator extends TimeSeriesProductCreator {
@Override
protected TimeSeriesResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
TimeSeriesResourceData resourceData = super.createNewResourceData(
dataCatalog, catalogEntry, displayType);
String sourceText = catalogEntry.getSelectedData().getSourcesText();
if (sourceText.equals("RaobOA")) {
BinOffset binOffset = new BinOffset(3600, 3600);
resourceData.setBinOffset(binOffset);
} else if (sourceText.equals("MetarOA")) {
BinOffset binOffset = new BinOffset(1800, 1800);
resourceData.setBinOffset(binOffset);
}
return resourceData;
}
}

View file

@ -17,7 +17,10 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.point;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.DelegateAvailableRequest;
/**
*
@ -31,6 +34,7 @@ package com.raytheon.viz.volumebrowser.datacatalog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 25, 2011 bsteffen Initial creation
* Aug 03, 2015 3861 bsteffen Move to volumebrowser.dataplugin plugin.
*
* </pre>
*

View file

@ -0,0 +1,88 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.point;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionRenderableDisplay;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.CrossSectionProductCreator;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.LineString;
/**
*
* {@link ProductCreator} for loading point data on a
* {@link CrossSectionRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class PointCrossSectionProductCreator extends CrossSectionProductCreator {
@Override
protected CrossSectionResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
CrossSectionResourceData resourceData = super.createNewResourceData(
dataCatalog, catalogEntry, displayType);
if (!(dataCatalog instanceof PointDataCatalog)) {
return resourceData;
}
PointDataCatalog pointCatalog = (PointDataCatalog) dataCatalog;
String sourceKey = catalogEntry.getSelectedData().getSourcesKey();
List<String> closest = new ArrayList<String>();
String letter = catalogEntry.getSelectedData().getPlanesKey()
.replace("Line", "");
LineString line = ToolsDataManager.getInstance().getBaseline(letter);
Coordinate[] newLine = new Coordinate[line.getNumPoints()];
for (int i = 0; i < line.getNumPoints(); i++) {
SurfaceObsLocation loc = pointCatalog.getClosestStation(
line.getCoordinateN(i),
sourceKey, closest);
if (loc == null) {
break;
}
closest.add(loc.getStationId());
newLine[i] = new Coordinate(loc.getLongitude(), loc.getLatitude());
}
ToolsDataManager.getInstance().setBaseline(letter,
line.getFactory().createLineString(newLine));
resourceData.setStationIDs(closest);
return resourceData;
}
}

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.point;
import java.util.ArrayList;
import java.util.Arrays;
@ -40,22 +40,16 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
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.BinOffset;
import com.raytheon.uf.viz.core.catalog.DbQuery;
import com.raytheon.uf.viz.core.exception.VizException;
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;
import com.raytheon.uf.viz.d2d.nsharp.rsc.GoesSndNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.MdlSndNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.PoesSndNSharpResourceData;
import com.raytheon.uf.viz.objectiveanalysis.rsc.OAResourceData;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.uf.viz.volumebrowser.dataplugin.AbstractInventoryDataCatalog;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.pointdata.util.AbstractPointDataInventory;
import com.raytheon.viz.volumebrowser.datacatalog.AvailableDataRequest;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogEntry;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserAction;
@ -69,17 +63,18 @@ import com.vividsolutions.jts.geom.LineString;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 01, 2009 bsteffen Initial creation
* May 08, 2013 DR14824 mgamazaychikov Added alterProductParameters method
* May 09, 2013 1869 bsteffen Modified D2D time series of point data to
* work without dataURI.
* Aug 15, 2013 2258 bsteffen Convert profiler sounding to var height
* with hodo.
* Aug 15, 2013 2260 bsteffen Switch poessounding to NSharp.
* Jul 23, 2014 3410 bclement location changed to floats
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Dec 01, 2009 bsteffen Initial creation
* May 08, 2013 14824 mgamazay Added alterProductParameters method
* May 09, 2013 1869 bsteffen Modified D2D time series of point data to
* work without dataURI.
* Aug 15, 2013 2258 bsteffen Convert profiler sounding to var height
* with hodo.
* Aug 15, 2013 2260 bsteffen Switch poessounding to NSharp.
* Jul 23, 2014 3410 bclement location changed to floats
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
* </pre>
*
@ -182,12 +177,12 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
}
}
protected SurfaceObsLocation getClosestStation(Coordinate coordinate,
public SurfaceObsLocation getClosestStation(Coordinate coordinate,
String sourceKey) {
return getClosestStation(coordinate, sourceKey, null);
}
protected SurfaceObsLocation getClosestStation(Coordinate coordinate,
public SurfaceObsLocation getClosestStation(Coordinate coordinate,
String sourceKey, Collection<String> ignore) {
SurfaceObsLocation[] availableStations = getStationLocations(sourceKey);
if ((availableStations == null) || (availableStations.length == 0)
@ -253,12 +248,13 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
IDataCatalogEntry catalogEntry,
HashMap<String, RequestConstraint> productParameters,
String constraintKey) {
if (!isPointLine(catalogEntry.getSelectedData().getPlanesKey())
if (!PointLineUtil.isPointLine(catalogEntry.getSelectedData()
.getPlanesKey())
&& (catalogEntry.getDialogSettings().getViewSelection() != ViewMenu.TIMESERIES)) {
return;
}
if (catalogEntry.getSelectedData().getSourcesKey().endsWith("OA")) {
Coordinate current = getPointCoordinate(catalogEntry);
Coordinate current = PointLineUtil.getPointCoordinate(catalogEntry);
double lon0 = current.x - 5;
double lon1 = current.y + 5;
double lat0 = current.y - 5;
@ -301,7 +297,8 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
}
productParameters.put(constraintKey, stationRC);
} else {
Coordinate coordinate = getPointCoordinate(catalogEntry);
Coordinate coordinate = PointLineUtil
.getPointCoordinate(catalogEntry);
if (coordinate != null) {
String sourceKey = catalogEntry.getSelectedData()
@ -406,108 +403,6 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
.getLevelMappingForKey("Station").getLevels();
}
@Override
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
String sourceKey = catalogEntry.getSelectedData().getSourcesKey();
String sourceText = catalogEntry.getSelectedData().getSourcesText();
switch (resourceType) {
case PLAN_VIEW:
OAResourceData rscData = new OAResourceData();
// TODO this should be configurable
if (sourceText.equals("RaobOA")) {
BinOffset binOffset = new BinOffset(3600, 3600);
rscData.setBinOffset(binOffset);
} else if (sourceText.equals("MetarOA")) {
BinOffset binOffset = new BinOffset(1800, 1800);
rscData.setBinOffset(binOffset);
}
rscData.setParameter(catalogEntry.getSelectedData().getFieldsKey());
rscData.setParameterName(catalogEntry.getSelectedData()
.getFieldsText());
rscData.setSource(sourceText);
String levelKey = catalogEntry.getSelectedData().getPlanesKey();
rscData.setLevelKey(levelKey);
rscData.setRetrieveData(false);
rscData.setUpdatingOnMetadataOnly(true);
return rscData;
case TIME_SERIES:
AbstractRequestableResourceData resourceData = super
.getResourceData(catalogEntry, resourceType);
// TODO this should be configurable, and shared with PLAN_VIEW
if (sourceText.equals("RaobOA")) {
BinOffset binOffset = new BinOffset(3600, 3600);
resourceData.setBinOffset(binOffset);
} else if (sourceText.equals("MetarOA")) {
BinOffset binOffset = new BinOffset(1800, 1800);
resourceData.setBinOffset(binOffset);
}
return resourceData;
case TIME_HEIGHT:
resourceData = getResourceData(catalogEntry, resourceType,
new TimeHeightResourceData());
Coordinate coordinate = getPointCoordinate(catalogEntry);
SurfaceObsLocation closestLoc = getClosestStation(coordinate,
sourceKey);
Coordinate closestCoord = new Coordinate(closestLoc.getLongitude(),
closestLoc.getLatitude());
((TimeHeightResourceData) resourceData)
.setPointCoordinate(closestCoord);
String pointLetter = getPointLetter(catalogEntry);
PointsDataManager.getInstance().setCoordinate(pointLetter,
closestCoord);
return resourceData;
case CROSS_SECTION:
resourceData = super.getResourceData(catalogEntry, resourceType);
List<String> closest = new ArrayList<String>();
String letter = catalogEntry.getSelectedData().getPlanesKey()
.replace("Line", "");
LineString line = ToolsDataManager.getInstance()
.getBaseline(letter);
Coordinate[] newLine = new Coordinate[line.getNumPoints()];
for (int i = 0; i < line.getNumPoints(); i++) {
SurfaceObsLocation loc = getClosestStation(
line.getCoordinateN(i), sourceKey, closest);
if (loc == null) {
break;
}
closest.add(loc.getStationId());
newLine[i] = new Coordinate(loc.getLongitude(),
loc.getLatitude());
}
ToolsDataManager.getInstance().setBaseline(letter,
line.getFactory().createLineString(newLine));
((CrossSectionResourceData) resourceData).setStationIDs(closest);
return resourceData;
case SOUNDING:
if (getPlugin(sourceKey).equals("bufrua")) {
return new BufruaNSharpResourceData();
} else if (sourceKey.equals("modelsoundingETA")) {
return new MdlSndNSharpResourceData("NAMSND");
} else if (sourceKey.equals("modelsoundingGFS")) {
return new MdlSndNSharpResourceData("GFSSND");
} else if (sourceKey.equals("poessounding")) {
return new PoesSndNSharpResourceData();
} else if (sourceKey.equals("goessounding")) {
return new GoesSndNSharpResourceData();
} else if (sourceKey.equals("profiler")) {
VarHeightResourceData vhData = new VarHeightResourceData();
vhData.setPoint(getPointCoordinate(catalogEntry));
vhData.setParameter("Wind");
vhData.setParameterName("Wind");
vhData.setPointLetter(getPointLetter(catalogEntry));
vhData.setSource(sourceText);
return vhData;
}
default:
return super.getResourceData(catalogEntry, resourceType);
}
}
@Override
protected boolean isValidSelection(SelectedData selData) {
try {
@ -619,7 +514,7 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog {
|| (viewSelection == ViewMenu.PLANVIEW)
|| (viewSelection == ViewMenu.TIMESERIES)) {
Set<String> results = new HashSet<String>();
results.addAll(getPointLineKeys());
results.addAll(PointLineUtil.getPointLineKeys());
return results;
}
ToolsDataManager tdm = ToolsDataManager.getInstance();

View file

@ -0,0 +1,76 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.point;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
import com.raytheon.viz.volumebrowser.loader.TimeHeightProductCreator;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.vividsolutions.jts.geom.Coordinate;
/**
*
* {@link ProductCreator} for loading point data on a
* {@link TimeHeightRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class PointTimeHeightProductCreator extends TimeHeightProductCreator {
@Override
protected TimeHeightResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
TimeHeightResourceData resourceData = super.createNewResourceData(
dataCatalog, catalogEntry, displayType);
if (!(dataCatalog instanceof PointDataCatalog)) {
return resourceData;
}
PointDataCatalog pointCatalog = (PointDataCatalog) dataCatalog;
String sourceKey = catalogEntry.getSelectedData().getSourcesKey();
Coordinate coordinate = PointLineUtil.getPointCoordinate(catalogEntry);
SurfaceObsLocation closestLoc = pointCatalog.getClosestStation(
coordinate, sourceKey);
Coordinate closestCoord = new Coordinate(closestLoc.getLongitude(),
closestLoc.getLatitude());
resourceData.setPointCoordinate(closestCoord);
String pointLetter = PointLineUtil.getPointLetter(catalogEntry);
PointsDataManager.getInstance()
.setCoordinate(pointLetter, closestCoord);
return resourceData;
}
}

View file

@ -0,0 +1,58 @@
/**
* 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.uf.viz.volumebrowser.dataplugin.point;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionRenderableDisplay;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.loader.ProductCreator;
/**
*
* {@link ProductCreator} for loading vwp data on a
* {@link CrossSectionRenderableDisplay}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
*/
public class VwpCrossSectionCreator extends PointCrossSectionProductCreator {
@Override
protected CrossSectionResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
CrossSectionResourceData data = super
.createNewResourceData(dataCatalog, catalogEntry, displayType);
data.setBinOffset(new BinOffset(120, 120));
return data;
}
}

View file

@ -17,31 +17,30 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.volumebrowser.datacatalog;
package com.raytheon.uf.viz.volumebrowser.dataplugin.point;
import java.util.HashMap;
import java.util.List;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.viz.core.catalog.DbQuery;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
/**
*
* Catalog for radar point data(VWP, DMD).
* Catalog for radar VWP data.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 1, 2009 bsteffen Initial creation
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Dec 01, 2009 bsteffen Initial creation
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
*
* </pre>
*
@ -92,29 +91,5 @@ public class VwpDataCatalog extends PointDataCatalog {
productParameters.put("productCode", new RequestConstraint("48"));
}
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
AbstractRequestableResourceData resourceData = super.getResourceData(
catalogEntry, resourceType);
;
switch (resourceType) {
case CROSS_SECTION:
resourceData.setBinOffset(new BinOffset(120, 120));
break;
case SOUNDING:
VarHeightResourceData vhData = new VarHeightResourceData();
vhData.setPoint(getPointCoordinate(catalogEntry));
vhData.setParameter("Wind");
vhData.setParameterName("Wind");
vhData.setPointLetter(getPointLetter(catalogEntry));
vhData.setSource(catalogEntry.getSelectedData().getSourcesText());
resourceData = vhData;
break;
}
return resourceData;
}
}

View file

@ -38,4 +38,11 @@
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.viz.volumebrowser.dataplugin"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -2,12 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Volume Browser Plug-in
Bundle-SymbolicName: com.raytheon.viz.volumebrowser;singleton:=true
Bundle-Version: 1.13.0.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: Raytheon
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Require-Bundle: org.eclipse.core.runtime,
net.sf.swtaddons,
com.raytheon.uf.viz.core,
com.raytheon.viz.ui,
@ -27,20 +26,14 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.viz.xy.timeheight,
com.raytheon.uf.viz.xy.varheight,
com.raytheon.uf.viz.xy.timeseries,
com.raytheon.uf.viz.d2d.nsharp,
gov.noaa.nws.ncep.ui.nsharp,
com.raytheon.uf.common.dataplugin,
com.raytheon.viz.grid,
com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.viz.objectiveanalysis,
com.raytheon.viz.pointdata,
com.raytheon.uf.common.pointdata,
com.raytheon.uf.common.comm,
com.raytheon.uf.common.derivparam;bundle-version="1.14.0",
com.raytheon.uf.viz.datacube,
com.raytheon.uf.viz.core.grid;bundle-version="1.15.0"
Export-Package: com.raytheon.viz.volumebrowser,
com.raytheon.viz.volumebrowser.datacatalog,
com.raytheon.viz.volumebrowser.loader,
com.raytheon.viz.volumebrowser.util,
com.raytheon.viz.volumebrowser.vbui,
com.raytheon.viz.volumebrowser.xml
Import-Package: com.raytheon.uf.common.inventory.exception,

View file

@ -2,5 +2,6 @@ output.com.raytheon.viz.volumebrowser.jar = bin/
bin.includes = META-INF/,\
plugin.xml,\
localization/,\
com.raytheon.viz.volumebrowser.jar
com.raytheon.viz.volumebrowser.jar,\
schema/
source.com.raytheon.viz.volumebrowser.jar = src/

View file

@ -20,6 +20,8 @@
-->
<?eclipse version="3.2"?>
<plugin>
<extension-point id="com.raytheon.viz.volumebrowser.datacatalog" name="Volume Browser Data Catalog" schema="schema/com.raytheon.viz.volumebrowser.datacatalog.exsd"/>
<extension-point id="com.raytheon.viz.volumebrowser.productcreator" name="Volume Browser Product Creator" schema="schema/com.raytheon.viz.volumebrowser.productcreator.exsd"/>
<extension
point="org.eclipse.ui.commands">
<command

View file

@ -0,0 +1,78 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.raytheon.viz.volumebrowser" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="com.raytheon.viz.volumebrowser" id="com.raytheon.viz.volumebrowser.datacatalog" name="Volume Browser Data Catalog"/>
</appInfo>
<documentation>
Provides a way for plugins to register a data catalog with the volume browser so that new datatypes may be laoded.
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="dataCatalog"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="dataCatalog">
<complexType>
<attribute name="catalogClass" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
1.15.0
</documentation>
</annotation>
</schema>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.raytheon.viz.volumebrowser" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="com.raytheon.viz.volumebrowser" id="com.raytheon.viz.volumebrowser.productcreator" name="Volume Browser Product Creator"/>
</appInfo>
<documentation>
Provides a way for plugins to register a product creator with the volume browser so that new datatypes may be laoded.
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="productCreator"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="productCreator">
<complexType>
<attribute name="plugins" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="resourceType" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="creatorClass" type="string">
<annotation>
<documentation>
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn=":com.raytheon.viz.volumebrowser.loader.ProductCreator"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="since"/>
</appInfo>
<documentation>
1.15.0
</documentation>
</annotation>
</schema>

View file

@ -35,8 +35,6 @@ import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
import com.raytheon.uf.viz.d2d.nsharp.rsc.GribNSharpResourceData;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
@ -50,14 +48,16 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------- -------- ----------- -----------------------------------------
* Jan 04, 2010 mschenke Initial creation
* Oct 03, 2012 1248 rferrel Change to use adapter.
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
* Aug 19, 2014 3506 mapeters Modified getModelTitleToNameMap function
* to still get correct VB sources after
* splitting them into multiple files.
* Date Ticket# Engineer Description
* ------------- -------- --------- -----------------------------------------
* Jan 04, 2010 mschenke Initial creation
* Oct 03, 2012 1248 rferrel Change to use adapter.
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
* Aug 19, 2014 3506 mapeters Modified getModelTitleToNameMap function
* to still get correct VB sources after
* splitting them into multiple files.
* Aug 03, 2015 3861 bsteffen Remove nsharp dependency.
*
* </pre>
*
* @author mschenke
@ -74,11 +74,9 @@ public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
if (modelTitleToNameMap == null) {
modelTitleToNameMap = new HashMap<String, String>();
for (VbSource source : VbSourceList.getInstance()
.getAllSources()) {
for (VbSource source : VbSourceList.getInstance().getAllSources()) {
if (!source.getRemove()) {
modelTitleToNameMap.put(source.getName(),
source.getKey());
modelTitleToNameMap.put(source.getName(), source.getKey());
}
}
}
@ -114,8 +112,6 @@ public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
} else if (data instanceof TimeSeriesResourceData) {
((TimeSeriesResourceData) data).setSource(lookup.getInfo(
selectedString).getTitle());
} else if (data instanceof GribNSharpResourceData) {
((D2DNSharpResourceData) data).setSoundingType(selectedString);
} else if (data instanceof CrossSectionResourceData) {
((CrossSectionResourceData) data).setSource(lookup.getInfo(
selectedString).getTitle());

View file

@ -24,10 +24,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import com.raytheon.uf.common.dataplugin.grid.util.GridLevelTranslator;
import com.raytheon.uf.common.dataplugin.level.Level;
@ -43,23 +40,9 @@ import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
import com.raytheon.uf.common.style.StyleException;
import com.raytheon.uf.common.style.StyleManager;
import com.raytheon.uf.common.style.StyleRule;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.grid.rsc.GridLoadProperties;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData.AxisParameter;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.core.graphing.util.GraphPrefsFactory;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Abstract data catalog implementation for shared functionality between data
@ -68,22 +51,23 @@ import com.vividsolutions.jts.geom.Coordinate;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 06, 2009 2987 jelkins Initial creation
* Oct 21, 2009 1711 bsteffen Updated Baseline and Points to use new
* ToolsDataManager
* Jan 30, 2012 14308 D.Friedman Use correct style for arrow types.
* Jul 31, 2012 875 rferrel Now uses points.
* Feb 21, 2013 1617 bsteffen fixed vb sounding point selection for
* points which contain the word Point
* May 03, 2013 DR14824 mgamazaychikov Added alterProductParameters method
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
* Sep 06, 2013 2251 mnash Move graph prefs style type to
* graph plugin
* Jan 30, 2014 #2725 ekladstrup updated exception handling during move of derived
* parameters to common
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Date Ticket# Engineer Description
* ------------- -------- --------- -------------------------------------------
* Oct 06, 2009 2987 jelkins Initial creation
* Oct 21, 2009 1711 bsteffen Updated Baseline and Points to use new
* ToolsDataManager
* Jan 30, 2012 14308 dfriedma Use correct style for arrow types.
* Jul 31, 2012 875 rferrel Now uses points.
* Feb 21, 2013 1617 bsteffen fixed vb sounding point selection for
* points which contain the word Point
* May 03, 2013 14824 mgamazay Added alterProductParameters method
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
* Sep 06, 2013 2251 mnash Move graph prefs style type to graph plugin
* Jan 30, 2014 2725 ekladstr updated exception handling during move of
* derived parameters to common
* Sep 09, 2014 3356 njensen Remove CommunicationException
* Aug 03, 2015 3861 bsteffen Extract point/line methods to PointLineUtil
* Move resource creation to ProductCreators
*
* </pre>
*
@ -95,14 +79,6 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AbstractDataCatalog.class);
/** key representing all latitude and longitude planes **/
public static final String LAT_LON_KEY = "LatLon";
/** key representing all point and line planes **/
public static final String POINT_LINE_KEY = "PointLine";
public static final Pattern POINT_PATTERN = Pattern.compile("^Point");
/**
*
* @return a list of plugin Names used for the given setting
@ -117,175 +93,6 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
return getPlugins(null)[0];
}
@Override
public Collection<ResourcePair> getResourcesToLoad(
IDataCatalogEntry catalogEntry, ResourceType resourceType,
DisplayType displayType) {
ResourcePair jobRequest = new ResourcePair();
AbstractRequestableResourceData resourceData = getResourceData(
catalogEntry, resourceType);
resourceData.setMetadataMap(getProductParameters(catalogEntry));
LoadProperties loadProperties;
loadProperties = getLoadProperties(catalogEntry, resourceType,
displayType);
loadProperties.setResourceType(resourceType);
jobRequest.setResourceData(resourceData);
jobRequest.setLoadProperties(loadProperties);
jobRequest.setProperties(new ResourceProperties());
return Arrays.asList(jobRequest);
}
/**
*
* @param catalogEntry
* @param resourceType
* @param inputResourceData
* @return
*/
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType,
AbstractRequestableResourceData inputResourceData) {
AbstractRequestableResourceData resourceData;
switch (resourceType) {
case CROSS_SECTION:
CrossSectionResourceData csData = (CrossSectionResourceData) inputResourceData;
csData.setParameter(catalogEntry.getSelectedData().getFieldsKey());
csData.setParameterName(catalogEntry.getSelectedData()
.getFieldsText());
csData.setSource(catalogEntry.getSelectedData().getSourcesText());
resourceData = csData;
break;
case VAR_HEIGHT:
VarHeightResourceData vhData = (VarHeightResourceData) inputResourceData;
vhData.setPoint(getPointCoordinate(catalogEntry));
vhData.setParameter(catalogEntry.getSelectedData().getFieldsKey());
vhData.setParameterName(catalogEntry.getSelectedData()
.getFieldsText());
vhData.setPointLetter(getPointLetter(catalogEntry));
vhData.setSource(catalogEntry.getSelectedData().getSourcesText());
resourceData = vhData;
break;
case TIME_SERIES:
TimeSeriesResourceData tsData = (TimeSeriesResourceData) inputResourceData;
tsData.setCoordinate(getPointCoordinate(catalogEntry));
tsData.setPointLetter(getPointLetter(catalogEntry));
tsData.setSource(catalogEntry.getSelectedData().getSourcesText());
AxisParameter yParameter = new AxisParameter();
yParameter.code = catalogEntry.getSelectedData().getFieldsKey();
yParameter.name = catalogEntry.getSelectedData().getFieldsText();
tsData.setYParameter(yParameter);
tsData.setLevelKey(catalogEntry.getSelectedData().getPlanesKey());
resourceData = tsData;
break;
case TIME_HEIGHT:
TimeHeightResourceData thData = (TimeHeightResourceData) inputResourceData;
thData.setPoint(getPointCoordinate(catalogEntry));
thData.setParameter(catalogEntry.getSelectedData().getFieldsKey());
thData.setParameterName(catalogEntry.getSelectedData()
.getFieldsText());
thData.setPointLetter(getPointLetter(catalogEntry));
thData.setSource(catalogEntry.getSelectedData().getSourcesText());
resourceData = thData;
break;
default: // PLAN_VIEW
resourceData = null;
break;
}
return resourceData;
}
/**
* Get the resource data
*
* Override this method to provide an implementation for PLAN_VIEW if
* needed.
*
* @param catalogEntry
* @param resourceType
* @return the resource data for the given catalogEntry
*/
protected AbstractRequestableResourceData getResourceData(
IDataCatalogEntry catalogEntry, ResourceType resourceType) {
AbstractRequestableResourceData resourceData;
switch (resourceType) {
case CROSS_SECTION:
resourceData = getResourceData(catalogEntry, resourceType,
new CrossSectionResourceData());
break;
case VAR_HEIGHT:
resourceData = getResourceData(catalogEntry, resourceType,
new VarHeightResourceData());
break;
case TIME_SERIES:
resourceData = getResourceData(catalogEntry, resourceType,
new TimeSeriesResourceData());
break;
case TIME_HEIGHT:
resourceData = getResourceData(catalogEntry, resourceType,
new TimeHeightResourceData());
break;
default: // PLAN_VIEW
resourceData = null;
break;
}
return resourceData;
}
/**
* Obtain the point from the given catalog entry or from directly from the
* volume browser if in time series.
*
* @param catalogEntry
* the catalogEntry for which to obtain a point
* @return the coordinates belonging to the point. Null if there is no point
* associated with this catalog Entry.
*/
protected Coordinate getPointCoordinate(IDataCatalogEntry catalogEntry) {
String pointLetter = getPointLetter(catalogEntry);
Coordinate c = PointsDataManager.getInstance().getCoordinate(
pointLetter);
if (c == null) {
c = PointsDataManager.getInstance().getCoordinate("A");
}
return c;
}
protected String getPointLetter(IDataCatalogEntry catalogEntry) {
String pointLetter = null;
switch (catalogEntry.getDialogSettings().getViewSelection()) {
case TIMEHEIGHT:
case VARVSHGT:
case CROSSSECTION:
case SOUNDING:
pointLetter = POINT_PATTERN.matcher(
catalogEntry.getSelectedData().getPlanesKey())
.replaceFirst("");
break;
case TIMESERIES:
pointLetter = catalogEntry.getDialogSettings().getPointsSelection()
.getName();
break;
}
return pointLetter;
}
/*
* (non-Javadoc)
*
@ -443,51 +250,6 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
IDataCatalogEntry catalogEntry,
HashMap<String, RequestConstraint> productParameters);
/**
*
* @param dataCatalogEntry
* @param resourceType
* @param displayType
* @return the load properties to use, override this method if needed
*/
protected LoadProperties getLoadProperties(
IDataCatalogEntry dataCatalogEntry, ResourceType resourceType,
DisplayType displayType) {
// we should really add the displayType attribute to LoadProperties
return new GridLoadProperties(displayType);
}
public static Set<String> getPointLineKeys() {
Set<String> keySet = new HashSet<String>();
for (String letter : PointsDataManager.getInstance().getPointNames()) {
keySet.add("Point" + letter);
}
for (String letter : ToolsDataManager.getInstance().getBaselineNames()) {
keySet.add("Line" + letter);
}
return keySet;
}
/**
* @param plane
* @return true if the given plane is a line or point
*/
protected boolean isLineOrPoint(String plane) {
return (isLatLon(plane) || isPointLine(plane));
}
protected boolean isLatLon(String plane) {
return ((plane != null) && (plane.startsWith("Lat")
|| plane.startsWith("Lon") || plane.equals("LATS") || plane
.equals("LONS")));
}
protected boolean isPointLine(String plane) {
return ((plane != null) && (plane.startsWith("Line") || plane
.startsWith("Point")));
}
/**
* Alter product parameters
*

View file

@ -22,8 +22,14 @@ package com.raytheon.viz.volumebrowser.datacatalog;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.progress.UIJob;
@ -42,11 +48,12 @@ import com.raytheon.viz.volumebrowser.vbui.VbUtil;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 27, 2009 2161 lvenable Initial creation
* Aug 19, 2013 2269 bsteffen Fix MDCRS data and switch acars to use
* nsharp.
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* May 27, 2009 2161 lvenable Initial creation
* Aug 19, 2013 2269 bsteffen Fix MDCRS data and switch acars to use
* nsharp.
* Aug 03, 2015 3861 bsteffen Load catalogs from extension point
*
* </pre>
*
@ -57,6 +64,8 @@ public class DataCatalogManager {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DataCatalogManager.class);
private static final String EXTENSION_POINT_ID = "com.raytheon.viz.volumebrowser.datacatalog";
private static DataCatalogManager dataCatalogManager;
/**
@ -96,7 +105,7 @@ public class DataCatalogManager {
request.cancel();
}
};
}
private static class MenuUpdateJob extends UIJob {
@ -168,13 +177,33 @@ public class DataCatalogManager {
* Volume Browser's product table.
*/
private DataCatalogManager() {
// TODO these should be read from an extension point.
catalogs = new ArrayList<IDataCatalog>();
catalogs.add(new GridDataCatalog());
catalogs.add(new DmdDataCatalog());
catalogs.add(new PointDataCatalog());
catalogs.add(new ModelSoundingCatalog());
catalogs.add(new VwpDataCatalog());
loadFromExtensionPoint();
}
private void loadFromExtensionPoint() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(EXTENSION_POINT_ID);
IExtension[] extensions = point.getExtensions();
for (IExtension ext : extensions) {
IConfigurationElement[] config = ext.getConfigurationElements();
for (IConfigurationElement cfg : config) {
try {
IDataCatalog catalog = (IDataCatalog) cfg
.createExecutableExtension("catalogClass");
catalogs.add(catalog);
} catch (CoreException e) {
statusHandler
.handle(Priority.PROBLEM,
"Unable to load a Volume Browser data catalog, some products will not load.",
e);
}
}
}
}
public void addDataCatalog(IDataCatalog catalog) {

View file

@ -19,14 +19,11 @@
**/
package com.raytheon.viz.volumebrowser.datacatalog;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
/**
@ -37,9 +34,10 @@ import com.raytheon.viz.volumebrowser.vbui.SelectedData;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 27, 2009 #2161 lvenable Initial creation
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* May 27, 2009 2161 lvenable Initial creation
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
* </pre>
*
@ -90,22 +88,6 @@ public interface IDataCatalog {
*/
void getAvailableData(AvailableDataRequest request);
/**
* Get the Request object for a single catalog Entry
*
* @param catalogEntry
* the catalog entry for which to obtain a request
* @param resourceType
* the type of request
* @param displayType
* display an image, or contour, etc
* @return a request that can be used along with the editor returned from
* the getEditor() method to request a catalogEntry to be fetched,
* loaded, and displayed on the display.
*/
Collection<ResourcePair> getResourcesToLoad(IDataCatalogEntry catalogEntry,
ResourceType resourceType, DisplayType displayType);
/**
* Get all possible sources for which this catalog can provide data
*

View file

@ -0,0 +1,84 @@
/**
* 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.volumebrowser.loader;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.grid.rsc.GridLoadProperties;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.maps.actions.NewMapEditor;
import com.raytheon.uf.viz.core.maps.display.MapRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Contains logic for creating a {@link MapRenderableDisplay} appropriate for
* the current perspective.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Extracted from ProductTableComp
*
* </pre>
*
* @author bsteffen
*/
public abstract class AbstractMapProductCreator extends AbstractProductCreator {
@Override
protected MapRenderableDisplay createNewRenderableDisplay(VolumeBrowserDialogSettings dialogSettings, SelectedData selectedData) {
String editorId = DescriptorMap.getEditorId(MapDescriptor.class
.getName());
IEditorPart editorPart = EditorUtil.findEditor(editorId);
try {
if (editorPart == null) {
new NewMapEditor().execute(null);
editorPart = EditorUtil.findEditor(editorId);
}
AbstractEditor editor = (AbstractEditor) editorPart;
MapRenderableDisplay display = (MapRenderableDisplay) editor
.getActiveDisplayPane().getRenderableDisplay()
.createNewDisplay();
display.setDescriptor(new MapDescriptor());
return display;
} catch (ExecutionException | VizException e) {
throw new RuntimeException(e);
}
}
@Override
protected LoadProperties createNewLoadProperties(DisplayType displayType) {
return new GridLoadProperties(displayType);
}
}

View file

@ -0,0 +1,94 @@
/**
* 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.volumebrowser.loader;
import java.util.Arrays;
import java.util.Collection;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Base implementation of {@link ProductCreator} that breaks the creation into
* distinct tasks that can be easily implemented or overridden.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public abstract class AbstractProductCreator implements ProductCreator {
@Override
public AbstractRenderableDisplay loadProduct(IDataCatalog dataCatalog,
IDataCatalogEntry catalogEntry, DisplayType displayType) {
AbstractRenderableDisplay display = createNewRenderableDisplay(
catalogEntry.getDialogSettings(),
catalogEntry.getSelectedData());
Collection<ResourcePair> resources = getResourcesToLoad(dataCatalog,
catalogEntry, displayType);
display.getDescriptor().getResourceList().addAll(resources);
return display;
}
protected Collection<ResourcePair> getResourcesToLoad(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
AbstractRequestableResourceData resourceData = createNewResourceData(
dataCatalog, catalogEntry, displayType);
resourceData.setMetadataMap(dataCatalog
.getProductParameters(catalogEntry));
ResourcePair pair = new ResourcePair();
pair.setResourceData(resourceData);
pair.setLoadProperties(createNewLoadProperties(displayType));
pair.setProperties(new ResourceProperties());
return Arrays.asList(pair);
}
protected LoadProperties createNewLoadProperties(DisplayType displayType) {
return new LoadProperties();
}
protected abstract AbstractRenderableDisplay createNewRenderableDisplay(
VolumeBrowserDialogSettings dialogSettings,
SelectedData selectedData);
protected abstract AbstractRequestableResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType);
}

View file

@ -0,0 +1,143 @@
/**
* 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.volumebrowser.loader;
import java.awt.Rectangle;
import java.util.Arrays;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.grid.rsc.GridLoadProperties;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionRenderableDisplay;
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.CrossSectionUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.SpaceTimeMenu;
import com.raytheon.viz.volumebrowser.vbui.VbUtil;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
/**
*
* Creates a {@link CrossSectionRenderableDisplay} containing a
* {@link CrossSectionResourceData}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class CrossSectionProductCreator extends AbstractProductCreator {
@Override
protected AbstractRenderableDisplay createNewRenderableDisplay(
VolumeBrowserDialogSettings dialogSettings,
SelectedData selectedData) {
CrossSectionRenderableDisplay display = new CrossSectionRenderableDisplay();
CrossSectionDescriptor descriptor = display.getDescriptor();
descriptor.setRenderableDisplay(display);
SpaceTimeMenu currentSpaceTime = dialogSettings.getSpaceTimeSelection();
String planesKey = selectedData.getPlanesKey();
if (currentSpaceTime == SpaceTimeMenu.TIME) {
/*
* The Selected Plane in Time setting will be either a Baseline or a
* Lat/Lon Line
*/
Rectangle coverageRectangle = VbUtil.getMapCoverageRectangle();
LineString line = null;
if (planesKey.startsWith("Lon")) {
double x = Double.parseDouble(planesKey.substring(3));
Coordinate start = new Coordinate(x,
coverageRectangle.getMaxY());
Coordinate end = new Coordinate(x, coverageRectangle.getMinY());
line = new GeometryFactory().createLineString(new Coordinate[] {
start, end });
} else if (planesKey.startsWith("Lat")) {
double y = Double.parseDouble(planesKey.substring(3));
Coordinate start = new Coordinate(coverageRectangle.getMinX(),
y);
Coordinate end = new Coordinate(coverageRectangle.getMaxX(), y);
line = new GeometryFactory().createLineString(new Coordinate[] {
start, end });
} else if (planesKey.startsWith("Line")) {
ToolsDataManager dataManager = ToolsDataManager.getInstance();
line = dataManager.getBaseline(planesKey.substring(4));
/* default to Baseline A if all else fails */
if (line == null) {
line = dataManager.getBaseline("A");
}
} else {
throw new RuntimeException("Invalid line has been selected: "
+ planesKey);
}
/* set the line at which the results are displayed */
descriptor.setLines(Arrays.asList(line));
descriptor.setLineID(selectedData.getPlanesText());
} else if (currentSpaceTime == SpaceTimeMenu.SPACE) {
System.out
.println("Loading a Cross Section Space Resource from the Volume Browser.");
if (planesKey.equals("LATS")) {
descriptor.setLines(CrossSectionUtil.getAllLats());
descriptor.setLineID("AllLAT");
} else if (planesKey.equals("LONS")) {
descriptor.setLines(CrossSectionUtil.getAllLons());
descriptor.setLineID("AllLON");
}
}
descriptor.setHeightScale(dialogSettings.getHeightScaleSelection());
return display;
}
@Override
protected CrossSectionResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry,
DisplayType displayType) {
SelectedData selectedData = catalogEntry.getSelectedData();
CrossSectionResourceData resourceData = new CrossSectionResourceData();
resourceData.setParameter(selectedData.getFieldsKey());
resourceData.setParameterName(selectedData.getFieldsText());
resourceData.setSource(selectedData.getSourcesText());
return resourceData;
}
@Override
protected LoadProperties createNewLoadProperties(DisplayType displayType) {
return new GridLoadProperties(displayType);
}
}

View file

@ -0,0 +1,49 @@
/**
* 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.volumebrowser.loader;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
/**
*
* Interface for classes which know how to load a specific product from the
* volume browser. Instances of this class should be registered with the
* {@link ProductCreatorManager} so they will be used to create products.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public interface ProductCreator {
public AbstractRenderableDisplay loadProduct(IDataCatalog dataCatalog,
IDataCatalogEntry catalogEntry, DisplayType displayType);
}

View file

@ -0,0 +1,167 @@
/**
* 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.volumebrowser.loader;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
/**
*
* Class for managing registered {@link ProductCreator}s.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class ProductCreatorManager {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ProductCreatorManager.class);
private static final String EXTENSION_POINT_ID = "com.raytheon.viz.volumebrowser.productcreator";
private static final ProductCreatorManager instance = new ProductCreatorManager();
private final Map<Key, ProductCreator> creators = new HashMap<>();
private ProductCreatorManager() {
loadFromExtensionPoint();
}
private void loadFromExtensionPoint() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(EXTENSION_POINT_ID);
IExtension[] extensions = point.getExtensions();
for (IExtension ext : extensions) {
IConfigurationElement[] config = ext.getConfigurationElements();
for (IConfigurationElement cfg : config) {
String resourceType = cfg.getAttribute("resourceType");
String plugins = cfg.getAttribute("plugins");
try {
ProductCreator creator = (ProductCreator) cfg
.createExecutableExtension("creatorClass");
for (String plugin : plugins.split(",")) {
addCreator(plugin, resourceType, creator);
}
} catch (CoreException e) {
statusHandler
.handle(Priority.PROBLEM,
"Unable to load a Volume Browser product creator, some products will not load.",
e);
}
}
}
}
public void addCreator(String pluginName, String resourceType,
ProductCreator creator) {
Key key = new Key(pluginName, resourceType);
synchronized (creators) {
creators.put(key, creator);
}
}
public ProductCreator getCreator(String pluginName, String resourceType) {
Key key = new Key(pluginName, resourceType);
synchronized (creators) {
return creators.get(key);
}
}
public static ProductCreatorManager getInstance() {
return instance;
}
private static class Key {
public final String pluginName;
public final String resourceType;
private final int hashCode;
public Key(String pluginName, String resourceType) {
this.pluginName = pluginName;
this.resourceType = resourceType;
int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((pluginName == null) ? 0 : pluginName.hashCode());
hashCode = prime * hashCode
+ ((resourceType == null) ? 0 : resourceType.hashCode());
this.hashCode = hashCode;
}
@Override
public int hashCode() {
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Key other = (Key) obj;
if (pluginName == null) {
if (other.pluginName != null)
return false;
} else if (!pluginName.equals(other.pluginName))
return false;
if (resourceType == null) {
if (other.resourceType != null)
return false;
} else if (!resourceType.equals(other.resourceType))
return false;
return true;
}
@Override
public String toString() {
return "Key [pluginName=" + pluginName + ", resourceType="
+ resourceType + "]";
}
}
}

View file

@ -0,0 +1,198 @@
/**
* 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.volumebrowser.loader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.IEditorPart;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.core.rsc.ICombinedResourceData;
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
import com.raytheon.viz.ui.BundleProductLoader;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.UiUtil;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.vbui.ProductTableComp;
/**
*
* This class can be used to accumulate multiple products from the
* {@link ProductTableComp} for loading. Each product is added using
* {@link #addProduct(IDataCatalogEntry, DisplayType)} and when all products
* have beens elected then they can be loaded with either {@link #load()} or
* {@link #loadDifference()}. Instances of this class are not intended for
* reuse.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class ProductLoader {
private List<AbstractRenderableDisplay> displaysToLoad = new ArrayList<>();
public void addProduct(IDataCatalogEntry catalogEntry,
DisplayType displayType) {
IDataCatalog catalog = DataCatalogManager.getDataCatalogManager()
.getDataCatalog(catalogEntry.getSelectedData());
ResourceType resourceType = catalogEntry.getDialogSettings()
.getViewSelection().getResourceType();
HashMap<String, RequestConstraint> metadataMap = catalog
.getProductParameters(catalogEntry);
String pluginName = metadataMap.get(PluginDataObject.PLUGIN_NAME_ID)
.getConstraintValue();
ProductCreator loader = ProductCreatorManager.getInstance().getCreator(
pluginName, resourceType.toString().toLowerCase());
if (loader == null) {
throw new RuntimeException("Unable to load product for plugin "
+ pluginName + " of type " + resourceType);
}
AbstractRenderableDisplay display = loader.loadProduct(catalog,
catalogEntry, displayType);
if (display != null) {
displaysToLoad.add(display);
}
}
public void loadDifference() {
if (displaysToLoad.size() < 2) {
throw new RuntimeException(
"Not enough resources selected to difference");
} else if (displaysToLoad.size() > 2) {
throw new RuntimeException(
"Too many resources selected to difference");
}
AbstractRenderableDisplay display1 = displaysToLoad.get(0);
AbstractRenderableDisplay display2 = displaysToLoad.get(1);
displaysToLoad.clear();
if (!display1.getDescriptor().isCompatible(display2.getDescriptor())) {
throw new RuntimeException(
"Difference failed because of incompatible resources.");
}
Iterator<ResourcePair> it1 = display1.getDescriptor().getResourceList()
.iterator();
Iterator<ResourcePair> it2 = display2.getDescriptor().getResourceList()
.iterator();
while (it1.hasNext() && it2.hasNext()) {
ResourcePair pair1 = it1.next();
ResourcePair pair2 = it2.next();
if (pair1.getResourceData() instanceof ICombinedResourceData) {
ICombinedResourceData first = (ICombinedResourceData) pair1
.getResourceData();
first.setSecondaryData(pair2.getResourceData());
first.setCombineOperation(CombineOperation.DIFFERENCE);
}
}
System.out
.println("Loading a Difference Product from the Volume Browser.");
load(display1);
}
public void load() {
if (displaysToLoad.isEmpty()) {
return;
}
while (!displaysToLoad.isEmpty()) {
AbstractRenderableDisplay display = displaysToLoad.get(0);
displaysToLoad.remove(0);
Iterator<AbstractRenderableDisplay> it = displaysToLoad.iterator();
while (it.hasNext()) {
AbstractRenderableDisplay next = it.next();
if (display.getDescriptor().isCompatible(next.getDescriptor())) {
display.getDescriptor().getResourceList()
.addAll(next.getDescriptor().getResourceList());
it.remove();
}
}
load(display);
}
}
protected void load(AbstractRenderableDisplay display) {
String editorId = DescriptorMap.getEditorId(display.getDescriptor()
.getClass().getName());
IEditorPart activeEditor = EditorUtil.getActiveEditor();
AbstractEditor editor = UiUtil.createOrOpenEditor(editorId,
display.cloneDisplay());
if (editor != null) {
if (activeEditor != null && editor != activeEditor
&& activeEditor instanceof IMultiPaneEditor
&& editor instanceof IMultiPaneEditor) {
IMultiPaneEditor activeMpe = (IMultiPaneEditor) activeEditor;
IMultiPaneEditor mpe = (IMultiPaneEditor) editor;
if (mpe.getNumberofPanes() < activeMpe.getNumberofPanes()) {
for (int i = mpe.getNumberofPanes(); i < activeMpe
.getNumberofPanes(); ++i) {
mpe.addPane(display.createNewDisplay());
}
IDisplayPane selectedPane = activeMpe
.getSelectedPane(IMultiPaneEditor.LOAD_ACTION);
if (selectedPane != null) {
IDisplayPane[] allPanes = activeMpe.getDisplayPanes();
for (int i = 0; i < allPanes.length; ++i) {
if (selectedPane == allPanes[i]) {
IDisplayPane newSelectedPane = mpe
.getDisplayPanes()[i];
mpe.setSelectedPane(
IMultiPaneEditor.LOAD_ACTION,
newSelectedPane);
break;
}
}
}
}
}
Bundle b = new Bundle();
b.setDisplays(new AbstractRenderableDisplay[] { display });
Job j = new BundleProductLoader(editor, b);
j.schedule();
}
}
}

View file

@ -0,0 +1,91 @@
/**
* 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.volumebrowser.loader;
import com.raytheon.uf.viz.core.grid.rsc.GridLoadProperties;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor.TimeDirection;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.timeheight.rsc.TimeHeightResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.LeftRightMenu;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Creates a {@link TimeHeightRenderableDisplay} containing a
* {@link TimeHeightResourceData}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class TimeHeightProductCreator extends AbstractProductCreator {
@Override
protected TimeHeightRenderableDisplay createNewRenderableDisplay(
VolumeBrowserDialogSettings dialogSettings,
SelectedData selectedData) {
TimeHeightRenderableDisplay display = new TimeHeightRenderableDisplay();
TimeHeightDescriptor descriptor = display.getDescriptor();
descriptor.setRenderableDisplay(display);
descriptor.setHeightScale(dialogSettings.getHeightScaleSelection());
LeftRightMenu leftRightMenu = dialogSettings
.getTimeDirectionSelection();
if (leftRightMenu == LeftRightMenu.LEFT) {
descriptor.setTimeDirection(TimeDirection.RIGHT_TO_LEFT);
} else {
descriptor.setTimeDirection(TimeDirection.LEFT_TO_RIGHT);
}
return display;
}
@Override
protected TimeHeightResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
SelectedData selectedData = catalogEntry.getSelectedData();
TimeHeightResourceData resourceData = new TimeHeightResourceData();
resourceData.setPoint(PointLineUtil.getPointCoordinate(catalogEntry));
resourceData.setParameter(selectedData.getFieldsKey());
resourceData.setParameterName(selectedData.getFieldsText());
resourceData.setPointLetter(PointLineUtil.getPointLetter(catalogEntry));
resourceData.setSource(selectedData.getSourcesText());
return resourceData;
}
@Override
protected LoadProperties createNewLoadProperties(DisplayType displayType) {
return new GridLoadProperties(displayType);
}
}

View file

@ -0,0 +1,74 @@
/**
* 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.volumebrowser.loader;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.timeseries.display.TimeSeriesRenderableDisplay;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData;
import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData.AxisParameter;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Creates a {@link TimeSeriesRenderableDisplay} containing a
* {@link TimeSeriesResourceData}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class TimeSeriesProductCreator extends AbstractProductCreator{
@Override
protected TimeSeriesRenderableDisplay createNewRenderableDisplay(VolumeBrowserDialogSettings dialogSettings, SelectedData selectedData) {
return new TimeSeriesRenderableDisplay();
}
@Override
protected TimeSeriesResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
SelectedData selectedData = catalogEntry.getSelectedData();
TimeSeriesResourceData resourceData = new TimeSeriesResourceData();
resourceData.setCoordinate(PointLineUtil.getPointCoordinate(catalogEntry));
resourceData.setPointLetter(PointLineUtil.getPointLetter(catalogEntry));
resourceData.setSource(selectedData.getSourcesText());
AxisParameter yParameter = new AxisParameter();
yParameter.code = selectedData.getFieldsKey();
yParameter.name = selectedData.getFieldsText();
resourceData.setYParameter(yParameter);
resourceData.setLevelKey(selectedData.getPlanesKey());
return resourceData;
}
}

View file

@ -0,0 +1,76 @@
/**
* 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.volumebrowser.loader;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.varheight.hodo.VarHeightHodoDescriptor;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.viz.core.slice.request.HeightScales;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Creates a {@link VarHeightRenderableDisplay} containing a
* {@link VarHeightHodoDescriptor} with a {@link VarHeightResourceData}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class VarHeightHodoProductCreator extends AbstractProductCreator {
@Override
protected VarHeightRenderableDisplay createNewRenderableDisplay(
VolumeBrowserDialogSettings dialogSettings, SelectedData selectedData) {
VarHeightRenderableDisplay display = new VarHeightRenderableDisplay();
VarHeightHodoDescriptor descriptor = new VarHeightHodoDescriptor();
display.setDescriptor(descriptor);
descriptor.setRenderableDisplay(display);
descriptor.setHeightScale(HeightScales.fromName("Log 1050-150"));
return display;
}
@Override
protected AbstractRequestableResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
VarHeightResourceData resourceData = new VarHeightResourceData();
resourceData.setPoint(PointLineUtil.getPointCoordinate(catalogEntry));
resourceData.setParameter("Wind");
resourceData.setParameterName("Wind");
resourceData.setPointLetter(PointLineUtil.getPointLetter(catalogEntry));
resourceData.setSource(catalogEntry.getSelectedData().getSourcesText());
return resourceData;
}
}

View file

@ -0,0 +1,72 @@
/**
* 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.volumebrowser.loader;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightDescriptor;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.PointLineUtil;
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
import com.raytheon.viz.volumebrowser.vbui.VolumeBrowserDialogSettings;
/**
*
* Creates a {@link VarHeightRenderableDisplay} containing a
* {@link VarHeightDescriptor} with a {@link VarHeightResourceData}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Initial Creation
*
* </pre>
*
* @author bsteffen
*/
public class VarHeightProductCreator extends AbstractProductCreator {
@Override
protected VarHeightRenderableDisplay createNewRenderableDisplay(VolumeBrowserDialogSettings dialogSettings, SelectedData selectedData) {
VarHeightRenderableDisplay display = new VarHeightRenderableDisplay();
VarHeightDescriptor descriptor = display.getDescriptor();
descriptor.setRenderableDisplay(display);
descriptor.setHeightScale(dialogSettings.getHeightScaleSelection());
return display;
}
@Override
protected VarHeightResourceData createNewResourceData(
IDataCatalog dataCatalog, IDataCatalogEntry catalogEntry, DisplayType displayType) {
VarHeightResourceData resourceDaata = new VarHeightResourceData();
resourceDaata.setPoint(PointLineUtil.getPointCoordinate(catalogEntry));
resourceDaata.setParameter(catalogEntry.getSelectedData().getFieldsKey());
resourceDaata.setParameterName(catalogEntry.getSelectedData().getFieldsText());
resourceDaata.setPointLetter(PointLineUtil.getPointLetter(catalogEntry));
resourceDaata.setSource(catalogEntry.getSelectedData().getSourcesText());
return resourceDaata;
}
}

View file

@ -0,0 +1,121 @@
/**
* 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.volumebrowser.util;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;
import com.raytheon.uf.viz.points.PointsDataManager;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.vividsolutions.jts.geom.Coordinate;
/**
*
* Static convenience methods for dealing with the points and lines when loading
* data from the volume browser.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Aug 03, 2015 3861 bsteffen Extracted from AbstractDataCatalog
*
* </pre>
*
* @author bsteffen
*/
public class PointLineUtil {
/** key representing all latitude and longitude planes **/
public static final String LAT_LON_KEY = "LatLon";
/** key representing all point and line planes **/
public static final String POINT_LINE_KEY = "PointLine";
public static final Pattern POINT_PATTERN = Pattern.compile("^Point");
public static Set<String> getPointLineKeys() {
Set<String> keySet = new HashSet<String>();
for (String letter : PointsDataManager.getInstance().getPointNames()) {
keySet.add("Point" + letter);
}
for (String letter : ToolsDataManager.getInstance().getBaselineNames()) {
keySet.add("Line" + letter);
}
return keySet;
}
public static boolean isLatLon(String plane) {
return ((plane != null) && (plane.startsWith("Lat")
|| plane.startsWith("Lon") || plane.equals("LATS") || plane
.equals("LONS")));
}
public static boolean isPointLine(String plane) {
return ((plane != null) && (plane.startsWith("Line") || plane
.startsWith("Point")));
}
/**
* Obtain the point from the given catalog entry or from directly from the
* volume browser if in time series.
*
* @param catalogEntry
* the catalogEntry for which to obtain a point
* @return the coordinates belonging to the point. Null if there is no point
* associated with this catalog Entry.
*/
public static Coordinate getPointCoordinate(IDataCatalogEntry catalogEntry) {
String pointLetter = getPointLetter(catalogEntry);
Coordinate c = PointsDataManager.getInstance().getCoordinate(
pointLetter);
if (c == null) {
c = PointsDataManager.getInstance().getCoordinate("A");
}
return c;
}
public static String getPointLetter(IDataCatalogEntry catalogEntry) {
String pointLetter = null;
switch (catalogEntry.getDialogSettings().getViewSelection()) {
case TIMEHEIGHT:
case VARVSHGT:
case CROSSSECTION:
case SOUNDING:
pointLetter = POINT_PATTERN.matcher(
catalogEntry.getSelectedData().getPlanesKey())
.replaceFirst("");
break;
case TIMESERIES:
pointLetter = catalogEntry.getDialogSettings().getPointsSelection()
.getName();
break;
}
return pointLetter;
}
}

View file

@ -19,9 +19,6 @@
**/
package com.raytheon.viz.volumebrowser.vbui;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDescriptor;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpSkewTPaneDisplay;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -30,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@ -59,49 +55,14 @@ import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IEditorPart;
import com.raytheon.uf.viz.core.DescriptorMap;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
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.maps.actions.NewMapEditor;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionRenderableDisplay;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor.TimeDirection;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.timeseries.display.TimeSeriesRenderableDisplay;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightDescriptor;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightRenderableDisplay;
import com.raytheon.uf.viz.xy.varheight.hodo.VarHeightHodoDescriptor;
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
import com.raytheon.viz.awipstools.ToolsDataManager;
import com.raytheon.viz.core.rsc.ICombinedResourceData;
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
import com.raytheon.viz.core.slice.request.HeightScales;
import com.raytheon.viz.ui.BundleProductLoader;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.UiUtil;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
import com.raytheon.viz.volumebrowser.util.CrossSectionUtil;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.LeftRightMenu;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.SpaceTimeMenu;
import com.raytheon.viz.volumebrowser.loader.ProductLoader;
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
/**
*
@ -110,17 +71,20 @@ import com.vividsolutions.jts.geom.LineString;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 08, 2009 2161 lvenable Initial creation
* Mar 27, 2012 14506 Qinglu Lin For cross section plot along a line of
* latitude, swap xStart and xEnd.
* Jan 16, 2013 1492 rferrel Changes for non-blocking InventoryDlg.
* Jan 25, 2013 15529 kshresth Fixed cross section "Unhandled event loop
* exception" when loading contours and
* Image combo
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
* Feb 12, 2015 4105 rferrel Remove duplicate update of table item in addProduct.
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Jun 08, 2009 2161 lvenable Initial creation
* Mar 27, 2012 14506 qlin For cross section plot along a line of
* latitude, swap xStart and xEnd.
* Jan 16, 2013 1492 rferrel Changes for non-blocking InventoryDlg.
* Jan 25, 2013 15529 kshresth Fixed cross section "Unhandled event loop
* exception" when loading contours and Image
* combo
* Aug 20, 2013 2259 bsteffen Delete old skewt plugin.
* Feb 12, 2015 4105 rferrel Remove duplicate update of table item in
* addProduct.
* Aug 03, 2015 3861 bsteffen Move product loading to ProductLoader
*
* </pre>
*
* @author lvenable
@ -691,28 +655,18 @@ public class ProductTableComp extends Composite {
ProductTableData productTableData = tableDataArray
.get(indexOf);
DisplayType currentDisplayType = productTableData
.getDisplayTypeSet().iterator().next();
productTableData.getDisplayTypeSet().clear();
ProductLoader loader = new ProductLoader();
for (DisplayType displayType : productTableData
.getSelectedData().getDisplayTypes()) {
productTableData.getDisplayTypeSet().add(
loader.addProduct(
productTableData.getCatalogEntry(),
displayType);
}
List<ResourcePair> resources = productTableData
.getResourcesToLoad();
loadResources(false, resources);
loader.load();
unselectProduct(indexOf);
productTableData.getDisplayTypeSet().clear();
productTableData.getDisplayTypeSet().add(
currentDisplayType);
updateLoadButtonAndProductLabels();
}
@ -859,244 +813,25 @@ public class ProductTableComp extends Composite {
*/
private void loadProducts(boolean difference) {
int[] prodIndexes = prodSelTable.getSelectionIndices();
ProductLoader loader = new ProductLoader();
List<ResourcePair> resources = new ArrayList<ResourcePair>(
prodIndexes.length);
for (int i = 0; i < prodIndexes.length; i++) {
ProductTableData productData = tableDataArray.get(prodIndexes[i]);
resources.addAll(productData.getResourcesToLoad());
for (DisplayType displayType : productData.getDisplayTypeSet()) {
loader.addProduct(productData.getCatalogEntry(), displayType);
}
}
if (difference) {
loader.loadDifference();
} else {
loader.load();
}
loadResources(difference, resources);
unselectProduct(prodIndexes);
updateLoadButtonAndProductLabels();
}
private void loadResources(boolean difference,
List<ResourcePair> resourceList) {
if (difference) {
try {
((ICombinedResourceData) resourceList.get(0).getResourceData())
.setSecondaryData(resourceList.get(1).getResourceData());
((ICombinedResourceData) resourceList.get(0).getResourceData())
.setCombineOperation(CombineOperation.DIFFERENCE);
resourceList.remove(1);
} catch (Exception e) {
resourceList.clear();
throw new RuntimeException(
"Unable to obtain a difference request", e);
}
}
VolumeBrowserDialogSettings dialogSettings = VolumeBrowserAction
.getVolumeBrowserDlg().getDialogSettings();
ResourceType resourceType = dialogSettings.getViewSelection()
.getResourceType();
AbstractRenderableDisplay display = null;
switch (resourceType) {
case PLAN_VIEW:
String editorId = DescriptorMap.getEditorId(MapDescriptor.class
.getName());
IEditorPart editorPart = EditorUtil.findEditor(editorId);
if (editorPart == null) {
try {
new NewMapEditor().execute(null);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
editorPart = EditorUtil.findEditor(editorId);
}
AbstractEditor editor = (AbstractEditor) editorPart;
display = (AbstractRenderableDisplay) editor.getActiveDisplayPane()
.getRenderableDisplay().createNewDisplay();
try {
display.setDescriptor(new MapDescriptor());
} catch (VizException e) {
throw new RuntimeException(e);
}
break;
case CROSS_SECTION:
CrossSectionRenderableDisplay csDisplay = new CrossSectionRenderableDisplay();
CrossSectionDescriptor csDesc = csDisplay.getDescriptor();
csDesc.setRenderableDisplay(csDisplay);
selectNewTableItem();
IDataCatalogEntry catalogEntry = getSelectedData().get(0)
.getCatalogEntry();
VBMenuBarItemsMgr.SpaceTimeMenu currentSpaceTime = dialogSettings
.getSpaceTimeSelection();
String selectedPlaneKey = catalogEntry.getSelectedData()
.getPlanesKey();
// the selected Plane in Time setting will be either a Baseline or a
// Lat/Lon Line
if (currentSpaceTime == SpaceTimeMenu.TIME) {
java.awt.Rectangle coverageRectangle = VbUtil
.getMapCoverageRectangle();
LineString line = null;
if (selectedPlaneKey.startsWith("Lon")) {
double yEnd, yStart, xEnd, xStart;
yEnd = coverageRectangle.getMinY();
yStart = coverageRectangle.getMaxY();
xEnd = Double.parseDouble(selectedPlaneKey.replace("Lon",
""));
xStart = xEnd;
line = (new GeometryFactory())
.createLineString(new Coordinate[] {
new Coordinate(xStart, yStart),
new Coordinate(xEnd, yEnd) });
} else if (selectedPlaneKey.startsWith("Lat")) {
double yEnd, yStart, xEnd, xStart;
xStart = coverageRectangle.getMinX();
xEnd = coverageRectangle.getMaxX();
yEnd = Double.parseDouble(selectedPlaneKey.replace("Lat",
""));
yStart = yEnd;
line = (new GeometryFactory())
.createLineString(new Coordinate[] {
new Coordinate(xStart, yStart),
new Coordinate(xEnd, yEnd) });
}
// assume we have selected a baseline
else {
ToolsDataManager dataManager = ToolsDataManager
.getInstance();
line = dataManager.getBaseline(selectedPlaneKey.replace(
"Line", ""));
// default to Baseline A if all else fails
if (line == null) {
line = dataManager.getBaseline("A");
}
}
// set the line at which the results are displayed
csDesc.setLines(Arrays.asList(line));
csDesc.setLineID(catalogEntry.getSelectedData().getPlanesText());
} else if (currentSpaceTime == SpaceTimeMenu.SPACE) {
if (selectedPlaneKey.equals("LATS")) {
csDesc.setLines(CrossSectionUtil.getAllLats());
csDesc.setLineID("AllLAT");
} else if (selectedPlaneKey.equals("LONS")) {
csDesc.setLines(CrossSectionUtil.getAllLons());
csDesc.setLineID("AllLON");
}
}
csDesc.setHeightScale(dialogSettings.getHeightScaleSelection());
display = csDisplay;
break;
case VAR_HEIGHT:
VarHeightRenderableDisplay vhDisplay = new VarHeightRenderableDisplay();
VarHeightDescriptor vhDesc = vhDisplay.getDescriptor();
vhDesc.setRenderableDisplay(vhDisplay);
vhDesc.setHeightScale(dialogSettings.getHeightScaleSelection());
display = vhDisplay;
break;
case TIME_SERIES:
display = new TimeSeriesRenderableDisplay();
break;
case TIME_HEIGHT:
TimeHeightRenderableDisplay thDisplay = new TimeHeightRenderableDisplay();
TimeHeightDescriptor thDesc = thDisplay.getDescriptor();
thDesc.setRenderableDisplay(thDisplay);
thDesc.setHeightScale(dialogSettings.getHeightScaleSelection());
LeftRightMenu leftRightMenu = dialogSettings
.getTimeDirectionSelection();
if (leftRightMenu == LeftRightMenu.LEFT) {
thDesc.timeDirection = TimeDirection.RIGHT_TO_LEFT;
} else {
thDesc.timeDirection = TimeDirection.LEFT_TO_RIGHT;
}
display = thDisplay;
break;
case SOUNDING:
// need to handle both legacy skeqwT and nsharp skewT at the same
// time.
List<ResourcePair> varheightSkewtResources = new ArrayList<ResourcePair>();
List<ResourcePair> nsharpSkewtResources = new ArrayList<ResourcePair>();
for (ResourcePair pair : resourceList) {
if (pair.getResourceData() instanceof D2DNSharpResourceData) {
nsharpSkewtResources.add(pair);
} else if (pair.getResourceData() instanceof VarHeightResourceData) {
varheightSkewtResources.add(pair);
}
}
if (!nsharpSkewtResources.isEmpty()) {
display = new NsharpSkewTPaneDisplay();
display.setDescriptor(new NsharpSkewTPaneDescriptor());
if (!varheightSkewtResources.isEmpty()) {
resourceList.removeAll(varheightSkewtResources);
loadResources(difference, varheightSkewtResources);
}
} else {
VarHeightRenderableDisplay vhhDisplay = new VarHeightRenderableDisplay();
VarHeightHodoDescriptor vhhDesc = new VarHeightHodoDescriptor();
vhhDisplay.setDescriptor(vhhDesc);
vhhDesc.setRenderableDisplay(vhhDisplay);
vhhDesc.setHeightScale(HeightScales.fromName("Log 1050-150"));
display = vhhDisplay;
}
break;
}
String editorId = DescriptorMap.getEditorId(display.getDescriptor()
.getClass().getName());
IEditorPart activeEditor = EditorUtil.getActiveEditor();
AbstractEditor editor = UiUtil.createOrOpenEditor(editorId,
display.cloneDisplay());
if (editor != null) {
if (activeEditor != null && editor != activeEditor
&& activeEditor instanceof IMultiPaneEditor
&& editor instanceof IMultiPaneEditor) {
IMultiPaneEditor activeMpe = (IMultiPaneEditor) activeEditor;
IMultiPaneEditor mpe = (IMultiPaneEditor) editor;
if (mpe.getNumberofPanes() < activeMpe.getNumberofPanes()) {
for (int i = mpe.getNumberofPanes(); i < activeMpe
.getNumberofPanes(); ++i) {
mpe.addPane(display.createNewDisplay());
}
IDisplayPane selectedPane = activeMpe
.getSelectedPane(IMultiPaneEditor.LOAD_ACTION);
if (selectedPane != null) {
IDisplayPane[] allPanes = activeMpe.getDisplayPanes();
for (int i = 0; i < allPanes.length; ++i) {
if (selectedPane == allPanes[i]) {
IDisplayPane newSelectedPane = mpe
.getDisplayPanes()[i];
mpe.setSelectedPane(
IMultiPaneEditor.LOAD_ACTION,
newSelectedPane);
break;
}
}
}
}
}
for (ResourcePair pair : resourceList) {
display.getDescriptor().getResourceList().add(pair);
}
Bundle b = new Bundle();
b.setDisplays(new AbstractRenderableDisplay[] { display });
Job j = new BundleProductLoader(editor, b);
j.schedule();
}
}
/**
* @param prodIndexes
* @return
@ -1118,8 +853,11 @@ public class ProductTableComp extends Composite {
*/
private void loadSingleProduct(int selectedItemIndex) {
ProductTableData productData = tableDataArray.get(selectedItemIndex);
List<ResourcePair> resources = productData.getResourcesToLoad();
loadResources(false, resources);
ProductLoader loader = new ProductLoader();
for (DisplayType displayType : productData.getDisplayTypeSet()) {
loader.addProduct(productData.getCatalogEntry(), displayType);
}
loader.load();
unselectProduct(selectedItemIndex);
updateLoadButtonAndProductLabels();
}

View file

@ -19,16 +19,12 @@
**/
package com.raytheon.viz.volumebrowser.vbui;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalog;
import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
@ -40,9 +36,10 @@ import com.raytheon.viz.volumebrowser.datacatalog.IDataCatalogEntry;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 9, 2009 #2161 lvenable Initial creation
* Date Ticket# Engineer Description
* ------------- -------- --------- --------------------------
* Jun 09, 2009 2161 lvenable Initial creation
* Aug 03, 2015 3861 bsteffen Move resource creation to ProductCreators
*
* </pre>
*
@ -172,21 +169,6 @@ public class ProductTableData {
catalogEntry.getSelectedData());
}
public List<ResourcePair> getResourcesToLoad() {
ResourceType currentSetting = catalogEntry.getDialogSettings()
.getViewSelection().getResourceType();
List<ResourcePair> resourceList = new ArrayList<ResourcePair>();
for (DisplayType displayType : displayTypeSet) {
resourceList.addAll(getDataCatalog().getResourcesToLoad(
catalogEntry, currentSetting, displayType));
}
return resourceList;
}
/**
* Get the name of the product. Returns either the simple name or the image
* name depending on if the displayTypeSet contains the IMAGE DisplayType.