Issue #1638 Refactored viz/edex/common core projects to removed common and viz dependencies on edex projects
Amend: Accepted ticket for work, again! Ensured uframe product project was not deleted Change-Id: Iaa7754f25d74d893f84a7f82df605fb906e1e719 Former-commit-id: 615fa06253cc5226ddbedbb7835f3f03cf4cbb5b
This commit is contained in:
parent
6c766ddd85
commit
4ed4ef8d71
157 changed files with 1116 additions and 2986 deletions
|
@ -7,7 +7,7 @@ Bundle-Activator: com.raytheon.uf.viz.alertviz.Activator
|
|||
Bundle-Vendor: Raytheon
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.apache.activemq;visibility:=reexport,
|
||||
org.apache.activemq,
|
||||
com.raytheon.uf.common.localization;visibility:=reexport,
|
||||
com.raytheon.uf.common.serialization;visibility:=reexport,
|
||||
com.raytheon.uf.viz.core;visibility:=reexport,
|
||||
|
|
|
@ -7,8 +7,7 @@ Bundle-Activator: com.raytheon.uf.viz.aviation.advisory.Activator
|
|||
Bundle-Vendor: RAYTHEON
|
||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Require-Bundle: com.raytheon.uf.viz.core
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.viz.core,
|
||||
|
|
|
@ -8,8 +8,7 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.bufrsigwx,
|
||||
com.raytheon.uf.common.dataplugin.bufrsigwx.common,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
|
|
|
@ -8,7 +8,6 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.edex.plugin.ccfp,
|
||||
com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.status,
|
||||
|
|
|
@ -228,13 +228,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.topo"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.meteolib"
|
||||
download-size="0"
|
||||
|
|
|
@ -24,7 +24,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.apache.velocity;bundle-version="1.5.0",
|
||||
org.apache.qpid;bundle-version="1.0.0",
|
||||
javax.jms;bundle-version="1.0.0",
|
||||
org.apache.activemq;visibility:=reexport,
|
||||
org.apache.activemq,
|
||||
com.raytheon.uf.common.util;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.auth;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
|
@ -75,16 +75,10 @@ Export-Package: com.raytheon.uf.viz.core,
|
|||
com.raytheon.uf.viz.core.style.level,
|
||||
com.raytheon.uf.viz.core.tile,
|
||||
com.raytheon.uf.viz.core.time,
|
||||
com.raytheon.uf.viz.core.topo,
|
||||
com.raytheon.uf.viz.core.velocity,
|
||||
com.raytheon.viz.core.slice,
|
||||
com.raytheon.viz.core.slice.request,
|
||||
com.raytheon.viz.core.units
|
||||
Import-Package: com.raytheon.edex.colormap,
|
||||
com.raytheon.edex.db.dao,
|
||||
com.raytheon.edex.exception,
|
||||
com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.alertmonitor,
|
||||
Import-Package: com.raytheon.uf.common.alertmonitor,
|
||||
com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.datastorage,
|
||||
|
@ -97,7 +91,6 @@ Import-Package: com.raytheon.edex.colormap,
|
|||
com.raytheon.uf.common.time.adapter,
|
||||
com.raytheon.uf.common.time.util,
|
||||
com.raytheon.uf.common.topo,
|
||||
com.raytheon.uf.edex.topo,
|
||||
org.apache.log4j,
|
||||
org.apache.log4j.spi
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -26,16 +26,6 @@
|
|||
<property name="monitorEndpoint" value="edex.alerts.msg"/>
|
||||
</bean>
|
||||
|
||||
<!-- FIXME: Uncomment to re-enable cache at CAVE startup
|
||||
<bean id="gfeDiskCache" class="com.raytheon.uf.common.cache.disk.DiskCache" init-method="activateCache">
|
||||
<property name="name" value="GFE"/> -->
|
||||
<!-- TODO: Make this an environment variable that's passed in -->
|
||||
<!-- Cache directory relative to caveData/etc/workstation/${host} default is diskCache, will be followed by ${NAME}/${PID} -->
|
||||
<!-- <property name="baseCacheDir" value="diskCache"/> -->
|
||||
<!-- Number of grids, to always allow in memory -->
|
||||
<!-- <property name="sizeMemCacheMap" value="150"/>
|
||||
</bean> -->
|
||||
|
||||
<bean class="com.raytheon.uf.common.geospatial.LogRedirector" factory-method="getInstance"/>
|
||||
|
||||
<!-- These util:constant beans should not be required, they overwrite the ones in *-common.xml files for CAVE since
|
||||
|
|
|
@ -39,12 +39,12 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.core.runtime.Platform;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import com.raytheon.edex.scriptfactory.ScriptFactory;
|
||||
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.common.util.FileUtil;
|
||||
import com.raytheon.uf.common.util.velocity.VelocityManager;
|
||||
import com.raytheon.uf.viz.core.Activator;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
|
@ -70,6 +70,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
|||
* 12/17/2007 639 grichard Added "fxa" parm to scripts.
|
||||
* 3/17/2008 933 grichard Added support for taf plugin.
|
||||
* 04/14/2008 chammack Complete refactor to Velocity
|
||||
* Feb 15, 2013 1638 mschenke Created common VelocityManager for executing scripts
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -336,11 +337,18 @@ public class ScriptCreator {
|
|||
stringTemplate = DEFAULT_TEMPLATE;
|
||||
}
|
||||
|
||||
Map<String, Object> templateObjects = new HashMap<String, Object>();
|
||||
templateObjects.put("scriptMetadata", queryTerms);
|
||||
templateObjects.put("maxRecords", maxRecords);
|
||||
templateObjects.put("scriptLibrary", props.scriptLibrary);
|
||||
templateObjects.put("mode", mode);
|
||||
|
||||
try {
|
||||
String script = ScriptFactory.getInstance().createScript(
|
||||
stringTemplate, DEFAULT_TEMPLATE.getParentFile(),
|
||||
maxRecords, mode, props.scriptLibrary, queryTerms,
|
||||
FileUtil.join(LocalizationManager.getUserDir(), "logs"));
|
||||
String script = VelocityManager.executeTemplate(
|
||||
stringTemplate,
|
||||
DEFAULT_TEMPLATE.getParentFile(),
|
||||
new File(FileUtil.join(LocalizationManager.getUserDir(),
|
||||
"logs")), templateObjects);
|
||||
// System.out.println("Script gen: "
|
||||
// + (System.currentTimeMillis() - t0));
|
||||
return script;
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.nio.FloatBuffer;
|
|||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import com.raytheon.edex.colormap.ColorMapManager;
|
||||
import com.raytheon.uf.common.colormap.ColorMapUtils;
|
||||
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapData;
|
||||
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
|
||||
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
||||
|
@ -48,6 +48,7 @@ import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 13, 2010 mschenke Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved IndexColorModel creation to common.colormap utility
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -101,15 +102,15 @@ public class Colormapper {
|
|||
cmapedData[i] = findColorIndex(index, logFactor, colorMapSz);
|
||||
}
|
||||
|
||||
IndexColorModel cm = ColorMapManager.buildColorModel(parameters
|
||||
IndexColorModel cm = ColorMapUtils.buildColorModel(parameters
|
||||
.getColorMap());
|
||||
|
||||
|
||||
DataBufferByte byteArray = new DataBufferByte(cmapedData, width
|
||||
* height);
|
||||
|
||||
MultiPixelPackedSampleModel sample = new MultiPixelPackedSampleModel(
|
||||
DataBuffer.TYPE_BYTE, width, height,
|
||||
ColorMapManager.NUMBER_BITS);
|
||||
ColorMapUtils.COLOR_MODEL_NUMBER_BITS);
|
||||
WritableRaster writeRaster = Raster.createWritableRaster(sample,
|
||||
byteArray, new Point(0, 0));
|
||||
|
||||
|
|
|
@ -1,139 +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.core.topo;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
|
||||
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.topo.ITopoQuery;
|
||||
import com.raytheon.uf.common.topo.TopoQueryRequest;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Viz client class to mimic functionality of edex TopoQuery, uses ThriftClient
|
||||
* instead of direct hdf5 access if DataMode == THRIFT otherwise uses the
|
||||
* com.raytheon.edex.topo.TopoQuery
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2009 mschenke Initial creation
|
||||
* Jan 14, 2013 1469 bkowal The hdf5 root directory is no longer passed
|
||||
* as an argument to the common TopoQuery constructor.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TopoQuery implements ITopoQuery {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TopoQuery.class);
|
||||
|
||||
private TopoQueryRequest request;
|
||||
|
||||
/**
|
||||
* @return Initialized TopoQuery instance
|
||||
*/
|
||||
public static synchronized ITopoQuery getInstance() {
|
||||
return com.raytheon.uf.edex.topo.TopoQuery.getInstance(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Initialized TopoQuery instance
|
||||
*/
|
||||
public static synchronized ITopoQuery getInstance(int topoLevel,
|
||||
boolean useCaching) {
|
||||
return com.raytheon.uf.edex.topo.TopoQuery.getInstance(0);
|
||||
}
|
||||
|
||||
private TopoQuery(int level, boolean useCaching) {
|
||||
request = new TopoQueryRequest();
|
||||
request.setLevel(level);
|
||||
request.setUseCaching(useCaching);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level for the specified
|
||||
* coordinate.
|
||||
*
|
||||
* @param coord
|
||||
* should contain lon/lat in degrees
|
||||
* @return
|
||||
*/
|
||||
public double getHeight(Coordinate coord) {
|
||||
request.setCoordinates(new Coordinate[] { coord });
|
||||
request.setGridGeometry(null);
|
||||
try {
|
||||
return (Double) ThriftClient.sendRequest(request);
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.CRITICAL,
|
||||
"Unable to perform topo query", e);
|
||||
return Double.NaN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level for the specified
|
||||
* coordinates.
|
||||
*
|
||||
* @param coords
|
||||
* should contain lon/lat in degrees
|
||||
* @return
|
||||
*/
|
||||
public double[] getHeight(Coordinate[] coords) {
|
||||
request.setCoordinates(coords);
|
||||
request.setGridGeometry(null);
|
||||
try {
|
||||
return (double[]) ThriftClient.sendRequest(request);
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.CRITICAL,
|
||||
"Unable to perform topo query", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level reprojected and
|
||||
* interpolated to the specified grid geometry.
|
||||
*
|
||||
* @param targetGeom
|
||||
* @return the topo data array in row major order
|
||||
*/
|
||||
public float[] getHeight(GridGeometry2D targetGeom) {
|
||||
request.setCoordinates(null);
|
||||
request.setGridGeometry(targetGeom);
|
||||
try {
|
||||
return (float[]) ThriftClient.sendRequest(request);
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.CRITICAL,
|
||||
"Unable to perform topo query", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,152 +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.core.velocity;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
|
||||
import com.raytheon.edex.scriptfactory.ScriptTemplateLoader;
|
||||
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.Activator;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
|
||||
/**
|
||||
* Manages the execution of velocity templates
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 31, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class VelocityManager {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(VelocityManager.class);
|
||||
private static VelocityManager instance;
|
||||
|
||||
private Map<String, VelocityEngine> engineMap;
|
||||
|
||||
/** Cached templates */
|
||||
private final Map<String, Template> templateMap;
|
||||
|
||||
private VelocityManager() {
|
||||
engineMap = new HashMap<String, VelocityEngine>();
|
||||
templateMap = new HashMap<String, Template>();
|
||||
}
|
||||
|
||||
public static VelocityManager getInstance() {
|
||||
synchronized (VelocityManager.class) {
|
||||
if (instance == null) {
|
||||
instance = new VelocityManager();
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a script given the vm file and object map, uses default props
|
||||
* mimicked from ScriptFactory
|
||||
*
|
||||
* @param vmFile
|
||||
* the .vm file to use
|
||||
* @param objectMap
|
||||
* the string to object map velocity should use
|
||||
* @return the formatted text
|
||||
*/
|
||||
public String createScript(File vmFile, Map<String, Object> objectMap) {
|
||||
VelocityEngine engine = engineMap.get(vmFile.getAbsolutePath());
|
||||
if (engine == null) {
|
||||
java.util.Properties p = new java.util.Properties();
|
||||
String scriptDir = vmFile.getParentFile().getAbsolutePath();
|
||||
p.setProperty("file.resource.loader.class",
|
||||
ScriptTemplateLoader.class.getName());
|
||||
p.setProperty("file.resource.loader.path", scriptDir);
|
||||
p.setProperty("velocimacro.permissions.allowInline", "true");
|
||||
p.setProperty(
|
||||
"velocimacro.permissions.allow.inline.to.replace.global",
|
||||
"true");
|
||||
return createScript(vmFile, objectMap, p);
|
||||
} else {
|
||||
return createScript(vmFile, objectMap, engine);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a script given the vm file and object map, and custom velocity
|
||||
* properties
|
||||
*
|
||||
* @param vmFile
|
||||
* @param objectMap
|
||||
* @param customProps
|
||||
* @return the formatted text
|
||||
*/
|
||||
public String createScript(File vmFile, Map<String, Object> objectMap,
|
||||
Properties customProps) {
|
||||
VelocityEngine engine = new VelocityEngine();
|
||||
try {
|
||||
engine.init(customProps);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.SIGNIFICANT,
|
||||
"Error while initializing velocity engine", e);
|
||||
}
|
||||
return createScript(vmFile, objectMap, engine);
|
||||
}
|
||||
|
||||
private String createScript(File vmFile, Map<String, Object> objectMap,
|
||||
VelocityEngine engine) {
|
||||
StringWriter sw = null;
|
||||
try {
|
||||
VelocityContext context = new VelocityContext(objectMap);
|
||||
|
||||
sw = new StringWriter();
|
||||
|
||||
String path = vmFile.getAbsolutePath();
|
||||
String key = path + File.pathSeparator + vmFile.getParentFile().getAbsolutePath(); //Win32
|
||||
Template template = templateMap.get(key);
|
||||
if (template == null) {
|
||||
template = engine.getTemplate(path, Velocity.ENCODING_DEFAULT);
|
||||
templateMap.put(key, template);
|
||||
}
|
||||
|
||||
template.merge(context, sw);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.SIGNIFICANT,
|
||||
"Error while generating velocity text", e);
|
||||
}
|
||||
engineMap.put(vmFile.getAbsolutePath(), engine);
|
||||
return sw.toString();
|
||||
}
|
||||
}
|
|
@ -8,8 +8,7 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.cwa,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
|
|
|
@ -18,8 +18,7 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.colormap,
|
||||
Import-Package: com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.localization,
|
||||
|
|
|
@ -30,9 +30,8 @@ import java.util.List;
|
|||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.common.topo.ITopoQuery;
|
||||
import com.raytheon.uf.common.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.topo.TopoQuery;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,6 +44,8 @@ import com.raytheon.uf.viz.core.topo.TopoQuery;
|
|||
* 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
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -84,7 +85,7 @@ public class GribNSharpResourceData extends D2DNSharpResourceData {
|
|||
// If stationElevation is not set, set it to the topo value.
|
||||
if (profileList.getStationElevation() == NcSoundingProfile.MISSING) {
|
||||
if (surfaceElevation == NcSoundingProfile.MISSING) {
|
||||
ITopoQuery topoQuery = TopoQuery.getInstance();
|
||||
TopoQuery topoQuery = TopoQuery.getInstance();
|
||||
if (topoQuery != null) {
|
||||
surfaceElevation = (float) topoQuery
|
||||
.getHeight(coordinate);
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.eclipse.swt.widgets.MenuItem;
|
|||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||
|
@ -48,6 +47,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
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.util.FileUtil;
|
||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.IDialogClosed;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection;
|
||||
|
@ -81,6 +81,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* Aug 30, 2012 1120 jpiatt Added clickSort flag.
|
||||
* Oct 05, 2012 1241 djohnson Replace RegistryManager calls with registry handler calls.
|
||||
* Jan 10, 2013 1346 mpduff Add additional information to the dataset details output.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -293,27 +294,27 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
StringBuilder sb = new StringBuilder(150);
|
||||
sb.append("Dataset Name: ")
|
||||
.append(validateString(dataSet.getDataSetName()))
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("Dataset Type: ").append(dataSet.getDataSetType().toString())
|
||||
.append(Util.EOL);
|
||||
sb.append("Coverage: ").append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("Coverage: ").append(FileUtil.EOL);
|
||||
|
||||
sb.append("--- Projection : ")
|
||||
.append(validateString(dataSet.getCoverage().getProjection()))
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
|
||||
sb.append("--- UpperLeft (Lon) : ")
|
||||
.append(dataSet.getCoverage().getUpperLeft().x)
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("--- UpperLeft (Lat) : ")
|
||||
.append(dataSet.getCoverage().getUpperLeft().y)
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("--- LowerRight (Lon): ")
|
||||
.append(dataSet.getCoverage().getLowerRight().x)
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("--- LowerRight (Lat): ")
|
||||
.append(dataSet.getCoverage().getLowerRight().y)
|
||||
.append(Util.EOL);
|
||||
.append(FileUtil.EOL);
|
||||
sb.append("\n");
|
||||
|
||||
if (dataSet instanceof GriddedDataSet) {
|
||||
|
@ -325,7 +326,7 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
for (int i : cycleList) {
|
||||
sb.append(i).append(" ");
|
||||
}
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
}
|
||||
|
||||
List<Integer> fcstHrs = new ArrayList<Integer>(
|
||||
|
@ -340,19 +341,19 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
hrBuffer.append(i).append(" ");
|
||||
// wrap at 50 characters
|
||||
if (hrBuffer.length() > 50) {
|
||||
sb.append(hrBuffer).append(Util.EOL);
|
||||
sb.append(hrBuffer).append(FileUtil.EOL);
|
||||
sb.append(" ");
|
||||
hrBuffer.setLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Parameter> paramMap = dataSet.getParameters();
|
||||
if (!paramMap.isEmpty()) {
|
||||
sb.append("Parameters:").append(Util.EOL);
|
||||
sb.append("Parameters:").append(FileUtil.EOL);
|
||||
List<String> paramList = new ArrayList<String>(paramMap.keySet());
|
||||
Collections.sort(paramList, String.CASE_INSENSITIVE_ORDER);
|
||||
|
||||
|
@ -367,7 +368,7 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
for (String param : paramList) {
|
||||
sb.append("--- ").append(param);
|
||||
sb.append(getSpacing(max + 1, param));
|
||||
sb.append(paramMap.get(param).getDefinition()).append(Util.EOL);
|
||||
sb.append(paramMap.get(param).getDefinition()).append(FileUtil.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import javax.xml.bind.annotation.XmlElementRef;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Ensemble;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.datadelivery.common.xml.AreaXML;
|
||||
import com.raytheon.uf.viz.datadelivery.common.xml.IDisplayXml;
|
||||
|
||||
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.datadelivery.common.xml.IDisplayXml;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 29, 2012 mpduff Initial creation
|
||||
* Aug 10, 2012 1022 djohnson {@link SubsetXML} requires provider name.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -191,15 +192,15 @@ public class SubsetXML<TIMEXML extends TimeXML> implements IDisplayXml {
|
|||
@Override
|
||||
public String getDisplayXmlString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Subset Name : ").append(subsetName).append(Util.EOL);
|
||||
sb.append("Dataset Name: ").append(datasetName).append(Util.EOL);
|
||||
sb.append("Subset Name : ").append(subsetName).append(FileUtil.EOL);
|
||||
sb.append("Dataset Name: ").append(datasetName).append(FileUtil.EOL);
|
||||
sb.append("Provider: " + providerName);
|
||||
|
||||
for (VerticalXML v: verticalList) {
|
||||
sb.append(v.getDisplayXmlString());
|
||||
}
|
||||
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
|
||||
sb.append(area.getDisplayXmlString());
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ import javax.xml.bind.annotation.XmlElements;
|
|||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.datadelivery.common.xml.IDisplayXml;
|
||||
|
||||
/**
|
||||
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.datadelivery.common.xml.IDisplayXml;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 29, 2012 mpduff Initial creation
|
||||
* Aug 21, 2012 0743 djohnson Add specificDate, use append rather than concatenate strings.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -126,29 +127,29 @@ public abstract class TimeXML implements IDisplayXml {
|
|||
public String getDisplayXmlString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
if (latestData) {
|
||||
sb.append("Requesting Latest Data");
|
||||
} else {
|
||||
sb.append(getNonLatestData());
|
||||
}
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
|
||||
if (!CollectionUtil.isNullOrEmpty(cycleList)) {
|
||||
sb.append("Cycles:").append(Util.EOL);
|
||||
sb.append("Cycles:").append(FileUtil.EOL);
|
||||
for (Integer cycle : cycleList) {
|
||||
sb.append(" ").append(
|
||||
StringUtils.leftPad(cycle.toString(), 2, '0'));
|
||||
}
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
}
|
||||
|
||||
if (!CollectionUtil.isNullOrEmpty(fcstHourList)) {
|
||||
sb.append("Forecast Hours:").append(Util.EOL);
|
||||
sb.append("Forecast Hours:").append(FileUtil.EOL);
|
||||
for (String fcst: fcstHourList) {
|
||||
sb.append(" ").append(fcst);
|
||||
}
|
||||
sb.append(Util.EOL);
|
||||
sb.append(FileUtil.EOL);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
|
@ -42,13 +42,6 @@
|
|||
<import plugin="javax.measure" version="1.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.site"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.apache.activemq"
|
||||
download-size="0"
|
||||
|
@ -194,13 +187,6 @@
|
|||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.common"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin"
|
||||
download-size="0"
|
||||
|
@ -337,13 +323,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.topo"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.auth"
|
||||
download-size="0"
|
||||
|
@ -406,20 +385,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.core"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.database"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.spatial"
|
||||
download-size="0"
|
||||
|
@ -507,4 +472,11 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.units"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.edex.urifilter.URIFilter;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
|
||||
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
|
||||
import com.raytheon.uf.common.monitor.config.FogMonitorConfigurationManager;
|
||||
|
@ -84,6 +84,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Jun 16, 2012 14386 zhao Auto update County/Zone Table when new fog threat data arrives
|
||||
* Oct 26, 2012 1280 skorolev Made changes for non-blocking dialog and changed HashMap to Map
|
||||
* Oct.31 2012 1297 skorolev Clean code
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -144,11 +145,11 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
|
|||
private Geometry geoAdjAreas = null;
|
||||
|
||||
/** Data URI pattern for fog **/
|
||||
private final Pattern fogPattern = Pattern.compile(URIFilter.uriSeperator
|
||||
+ OBS + URIFilter.uriSeperator + wildCard + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + cwa + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + wildCard
|
||||
+ URIFilter.uriSeperator + wildCard + URIFilter.uriSeperator
|
||||
private final Pattern fogPattern = Pattern.compile(DataURI.SEPARATOR
|
||||
+ OBS + DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + cwa + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + wildCard
|
||||
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR
|
||||
+ "fog");
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.swt.graphics.RGB;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.edex.urifilter.URIFilter;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
|
||||
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
|
||||
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
|
||||
|
@ -82,6 +82,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* May 15, 2012 14510 zhao Modified processing at startup
|
||||
* Oct 26, 2012 1280 skorolev Clean code and made changes for non-blocking dialog
|
||||
* Oct 30, 2012 1297 skorolev Changed HashMap to Map
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -147,12 +148,12 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
|
|||
|
||||
/** Pattern for SAFESEAS **/
|
||||
private final Pattern ssPattern = Pattern
|
||||
.compile(URIFilter.uriSeperator + OBS + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + wildCard
|
||||
+ URIFilter.uriSeperator + cwa + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + wildCard
|
||||
+ URIFilter.uriSeperator + wildCard
|
||||
+ URIFilter.uriSeperator + "ss");
|
||||
.compile(DataURI.SEPARATOR + OBS + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + wildCard
|
||||
+ DataURI.SEPARATOR + cwa + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + wildCard
|
||||
+ DataURI.SEPARATOR + wildCard
|
||||
+ DataURI.SEPARATOR + "ss");
|
||||
|
||||
/**
|
||||
* Private constructor, singleton
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.edex.urifilter.URIFilter;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.monitor.config.SnowMonitorConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.data.CommonConfig;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -72,6 +72,7 @@ import com.raytheon.viz.alerts.observers.ProductAlertObserver;
|
|||
* May 15, 2012 14510 zhao Modified processing at startup
|
||||
* Oct 26, 2012 1280 skorolev Clean code and made changes for non-blocking ZoneTableDlg
|
||||
* Nov. 1, 2012 1297 skorolev Changed HashMap to Map and clean code
|
||||
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -116,11 +117,11 @@ public class SnowMonitor extends ObsMonitor {
|
|||
private final List<ISnowResourceListener> snowResources = new ArrayList<ISnowResourceListener>();
|
||||
|
||||
/** Pattern for SNOW **/
|
||||
private final Pattern snowPattern = Pattern.compile(URIFilter.uriSeperator
|
||||
+ OBS + URIFilter.uriSeperator + wildCard + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + cwa + URIFilter.uriSeperator
|
||||
+ wildCard + URIFilter.uriSeperator + wildCard
|
||||
+ URIFilter.uriSeperator + wildCard + URIFilter.uriSeperator
|
||||
private final Pattern snowPattern = Pattern.compile(DataURI.SEPARATOR
|
||||
+ OBS + DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + cwa + DataURI.SEPARATOR
|
||||
+ wildCard + DataURI.SEPARATOR + wildCard
|
||||
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR
|
||||
+ "snow");
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,6 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.edex.db.dao,
|
||||
com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.ncwf,
|
||||
com.raytheon.uf.common.dataplugin.persist,
|
||||
|
|
|
@ -25,7 +25,6 @@ Export-Package: com.raytheon.uf.viz.productbrowser;
|
|||
com.raytheon.uf.viz.productbrowser.actions;uses:="org.eclipse.core.commands",
|
||||
com.raytheon.uf.viz.productbrowser.bookmarks,
|
||||
com.raytheon.uf.viz.productbrowser.xml
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.message.response,
|
||||
Import-Package: com.raytheon.uf.common.message.response,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.viz.core.catalog
|
||||
|
|
|
@ -32,6 +32,5 @@ Import-Package: com.raytheon.edex.meteoLib,
|
|||
com.raytheon.uf.viz.core.datastructure,
|
||||
com.raytheon.uf.viz.core.exception,
|
||||
com.raytheon.uf.viz.core.status,
|
||||
com.raytheon.uf.viz.core.topo,
|
||||
com.raytheon.viz.core.map,
|
||||
com.raytheon.viz.pointdata
|
||||
|
|
|
@ -41,9 +41,9 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.sounding.SoundingParams;
|
||||
import com.raytheon.viz.core.map.GeoUtil;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
|
@ -57,6 +57,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 15, 2009 mschenke Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
|
||||
* and moved into common
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -12,8 +12,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.geotools;bundle-version="2.6.4"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.tcs,
|
||||
com.raytheon.uf.common.dataplugin.tcs.util,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
|
|
|
@ -17,8 +17,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.localization,
|
||||
Import-Package: com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.localization.exception,
|
||||
com.raytheon.uf.common.localization.msgs,
|
||||
com.raytheon.uf.common.serialization,
|
||||
|
|
|
@ -8,8 +8,7 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.vaa,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
|
|
|
@ -38,7 +38,6 @@ Import-Package: com.raytheon.edex.meteoLib,
|
|||
com.raytheon.uf.viz.core.status,
|
||||
com.raytheon.uf.viz.core.style,
|
||||
com.raytheon.uf.viz.core.style.level,
|
||||
com.raytheon.uf.viz.core.topo,
|
||||
com.raytheon.uf.viz.d2d.core.map,
|
||||
com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.uf.viz.xy,
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.common.geospatial.SpatialQueryResult;
|
|||
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.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.core.DrawableString;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
|
@ -47,7 +48,6 @@ import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.uf.viz.core.style.level.Level.LevelType;
|
||||
import com.raytheon.uf.viz.core.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.AbstractCrossSectionResource;
|
||||
import com.raytheon.uf.viz.xy.graph.AbstractGraph;
|
||||
|
@ -76,6 +76,8 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 3, 2010 bsteffen Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
|
||||
* and moved into common
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -11,13 +11,10 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.apache.commons.beanutils,
|
||||
com.raytheon.viz.core,
|
||||
org.geotools,
|
||||
org.apache.activemq,
|
||||
javax.jms;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.alerts,
|
||||
com.raytheon.viz.alerts.jobs,
|
||||
com.raytheon.viz.alerts.observers
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.message,
|
||||
com.raytheon.uf.common.message.response
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.edex.msg.PracticeDataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.message.PracticeDataURINotificationMessage;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -69,6 +69,7 @@ import com.raytheon.viz.core.mode.CAVEMode;
|
|||
* 05/08/08 1127 randerso Changed to implement INotificationObserver
|
||||
* 10/06/08 1433 chammack Updated to use VizStatus
|
||||
* 01/14/2013 1442 rferrel Filter out simulated time "future" alerts.
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
|
|
@ -14,8 +14,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.geotools,
|
||||
javax.measure,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.edex.meteolib,
|
||||
com.raytheon.viz.pointdata;bundle-version="1.10.13"
|
||||
com.raytheon.edex.meteolib
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.core.contours,
|
||||
com.raytheon.viz.core.contours.cmenu,
|
||||
|
|
|
@ -42,7 +42,6 @@ import org.opengis.referencing.operation.MathTransform;
|
|||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.edex.meteoLib.Controller;
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
|
@ -52,6 +51,8 @@ import com.raytheon.uf.common.geospatial.util.WorldWrapChecker;
|
|||
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.util.ArraysUtil;
|
||||
import com.raytheon.uf.common.util.GridUtil;
|
||||
import com.raytheon.uf.viz.core.DrawableString;
|
||||
import com.raytheon.uf.viz.core.IExtent;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
|
@ -88,6 +89,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Apr 26, 2010 #4583 rjpeter Replaced fortran fortconbuf with java port.
|
||||
* Mar 4, 2011 #7747 njensen Cached subgrid envelopes
|
||||
* Jul 9, 2012 DR 14940 M. Porricelli Adjust arrow size for streamlines
|
||||
* Feb 15, 2013 1638 mschenke Moved edex.common Util functions into common Util
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -97,9 +99,9 @@ public class ContourSupport {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ContourSupport.class);
|
||||
|
||||
private static float smallestContourValue = Util.GRID_FILL_VALUE - 1;
|
||||
private static float smallestContourValue = GridUtil.GRID_FILL_VALUE - 1;
|
||||
|
||||
private static float largestContourValue = Util.GRID_FILL_VALUE + 1;
|
||||
private static float largestContourValue = GridUtil.GRID_FILL_VALUE + 1;
|
||||
|
||||
private static LRUMap subgridCache = new LRUMap(10);
|
||||
|
||||
|
@ -328,7 +330,7 @@ public class ContourSupport {
|
|||
for (int i = 0; i < szX; i++) {
|
||||
float val = data1D[((int) sz[0] * (j + minY)) + (i + minX)];
|
||||
if (Float.isNaN(val)) {
|
||||
val = Util.GRID_FILL_VALUE;
|
||||
val = GridUtil.GRID_FILL_VALUE;
|
||||
}
|
||||
subgriddedData[i][j] = val;
|
||||
}
|
||||
|
@ -364,7 +366,7 @@ public class ContourSupport {
|
|||
float min = Float.POSITIVE_INFINITY;
|
||||
float max = Float.NEGATIVE_INFINITY;
|
||||
for (float f : data1D) {
|
||||
if (f != Util.GRID_FILL_VALUE && !Float.isNaN(f)) {
|
||||
if (f != GridUtil.GRID_FILL_VALUE && !Float.isNaN(f)) {
|
||||
min = Math.min(min, f);
|
||||
max = Math.max(max, f);
|
||||
}
|
||||
|
@ -1093,8 +1095,8 @@ public class ContourSupport {
|
|||
}
|
||||
}
|
||||
|
||||
Util.flipVert(adjustedUw, szY, szX);
|
||||
Util.flipVert(adjustedVw, szY, szX);
|
||||
ArraysUtil.flipVert(adjustedUw, szY, szX);
|
||||
ArraysUtil.flipVert(adjustedVw, szY, szX);
|
||||
|
||||
int arrSz = Math.max(10 * adjustedUw.length, uW.length);
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ Bundle-SymbolicName: com.raytheon.viz.core.gl;singleton:=true
|
|||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.core.gl.Activator
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: net.sf.ehcache
|
||||
Eclipse-BuddyPolicy: ext, registered
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
|
|
|
@ -5,27 +5,31 @@ Bundle-SymbolicName: com.raytheon.viz.core;singleton:=true
|
|||
Bundle-Version: 1.12.1174.qualifier
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.geotools,
|
||||
org.apache.commons.lang,
|
||||
org.apache.commons.beanutils,
|
||||
org.apache.http,
|
||||
javax.vecmath,
|
||||
org.apache.commons.configuration,
|
||||
org.apache.activemq,
|
||||
javax.measure,
|
||||
org.apache.velocity,
|
||||
org.jep,
|
||||
javax.persistence,
|
||||
net.sf.cglib,
|
||||
com.facebook.thrift,
|
||||
com.raytheon.edex.common;visibility:=reexport,
|
||||
com.raytheon.uf.common.localization;visibility:=reexport,
|
||||
com.raytheon.uf.common.serialization;visibility:=reexport,
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.time;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.units;bundle-version="1.0.0";visibility:=reexport,
|
||||
com.raytheon.uf.viz.core;visibility:=reexport,
|
||||
com.raytheon.uf.common.colormap;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
org.eclipse.core.expressions,
|
||||
com.raytheon.uf.viz.application;bundle-version="1.0.0"
|
||||
com.raytheon.uf.viz.application;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.topo;bundle-version="1.12.1174"
|
||||
Eclipse-BuddyPolicy: ext, registered, global
|
||||
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.status
|
||||
Export-Package:
|
||||
|
@ -49,7 +53,4 @@ Export-Package:
|
|||
Bundle-Vendor: Raytheon
|
||||
Bundle-Activator: com.raytheon.viz.core.CorePlugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.common.topo
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -28,7 +28,6 @@ import javax.measure.unit.Unit;
|
|||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
|
@ -37,6 +36,7 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
|||
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.util.GridUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -61,6 +61,7 @@ import com.raytheon.viz.core.style.image.ImagePreferences;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 25, 2007 chammack Initial Creation.
|
||||
* Mar 26, 2009 2086 jsanchez Added a entityList to the match criteria.
|
||||
* Feb 15, 2013 1638 mschenke Moved GRID_FILL_VALUE from edex.common Util into GridUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -137,7 +138,7 @@ public class ColorMapParameterFactory {
|
|||
min = Float.POSITIVE_INFINITY;
|
||||
max = Float.NEGATIVE_INFINITY;
|
||||
for (Number num : numArray) {
|
||||
if (num.floatValue() != Util.GRID_FILL_VALUE
|
||||
if (num.floatValue() != GridUtil.GRID_FILL_VALUE
|
||||
&& !Float.isNaN(num.floatValue())) {
|
||||
colormapMin = min = Math.min(min, num.floatValue());
|
||||
colormapMax = max = Math.max(max, num.floatValue());
|
||||
|
@ -145,7 +146,7 @@ public class ColorMapParameterFactory {
|
|||
}
|
||||
|
||||
if (min == Float.POSITIVE_INFINITY) {
|
||||
colormapMin = min = colormapMax = max = Util.GRID_FILL_VALUE;
|
||||
colormapMin = min = colormapMax = max = GridUtil.GRID_FILL_VALUE;
|
||||
}
|
||||
|
||||
// Add 25% buffer (same strategy as D2D)
|
||||
|
|
|
@ -13,5 +13,15 @@
|
|||
<property name="gridSaveThreshold" value="33554432"/>
|
||||
<!-- threshold = 32*1024*1024 bytes (32 MB)-->
|
||||
</bean>
|
||||
|
||||
<!-- FIXME: Uncomment to re-enable cache at CAVE startup
|
||||
<bean id="gfeDiskCache" class="com.raytheon.uf.common.cache.disk.DiskCache" init-method="activateCache">
|
||||
<property name="name" value="GFE"/> -->
|
||||
<!-- TODO: Make this an environment variable that's passed in -->
|
||||
<!-- Cache directory relative to caveData/etc/workstation/${host} default is diskCache, will be followed by ${NAME}/${PID} -->
|
||||
<!-- <property name="baseCacheDir" value="diskCache"/> -->
|
||||
<!-- Number of grids, to always allow in memory -->
|
||||
<!-- <property name="sizeMemCacheMap" value="150"/>
|
||||
</bean> -->
|
||||
|
||||
</beans>
|
|
@ -37,7 +37,6 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.commands.ICommandService;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
||||
|
@ -53,6 +52,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.viz.core.mode.CAVEMode;
|
||||
import com.raytheon.viz.gfe.Activator;
|
||||
import com.raytheon.viz.gfe.GFEException;
|
||||
|
@ -81,6 +81,7 @@ import com.raytheon.viz.gfe.core.wxvalue.WxValue;
|
|||
* 02/23/2012 1876 dgilling Implement missing clearUndoParmList
|
||||
* function.
|
||||
* 02/13/2013 #1597 randerso Added logging to support GFE Performance metrics
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.getUnixTime into TimeUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1072,7 +1073,7 @@ public class ParmOp {
|
|||
PythonPreferenceStore store = Activator.getDefault()
|
||||
.getPreferenceStore();
|
||||
// determine time limits for skipping, round to the hour
|
||||
long current = (Util.getUnixTime(SimulatedTime.getSystemTime()
|
||||
long current = (TimeUtil.getUnixTime(SimulatedTime.getSystemTime()
|
||||
.getTime()) / 3600) * 3600;
|
||||
TimeRange limitTime = TimeRange.allTimes();
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ import org.eclipse.jface.window.Window;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.FontMetrics;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.FontMetrics;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -41,7 +41,6 @@ import org.eclipse.swt.widgets.Group;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.TimeConstraints;
|
||||
|
@ -52,6 +51,7 @@ import com.raytheon.uf.common.dataplugin.gfe.slice.VectorGridSlice;
|
|||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.UIFormat;
|
||||
import com.raytheon.viz.gfe.core.UIFormat.FilterType;
|
||||
|
@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* change gridInfoText from Label to Text
|
||||
* to make sure the info get displayed inside the screen
|
||||
* and can be scrolled.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.getUnixTime into TimeUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -314,7 +315,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
String upTime = gmtFormatter.format(h.getUpdateTime());
|
||||
String ago = this.formatAgo(h.getUpdateTime());
|
||||
String pubTime = "";
|
||||
if (Util.getUnixTime(h.getPublishTime()) != 0) {
|
||||
if (TimeUtil.getUnixTime(h.getPublishTime()) != 0) {
|
||||
pubTime = " PUBLISHED";
|
||||
}
|
||||
info.append(site).append(" ").append(upTime).append(" ")
|
||||
|
@ -335,7 +336,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
String timeMod = "Not Modified";
|
||||
String ago = "";
|
||||
String user = "";
|
||||
if (Util.getUnixTime(h.getTimeModified()) != 0) {
|
||||
if (TimeUtil.getUnixTime(h.getTimeModified()) != 0) {
|
||||
timeMod = gmtFormatter.format(h.getTimeModified());
|
||||
ago = this.formatAgo(h.getTimeModified());
|
||||
user = this.whoLabel(h.getModified());
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.eclipse.swt.widgets.Group;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.edex.util.MathUtil;
|
||||
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.util.MathUtil;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.parm.Parm;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
|
@ -50,6 +50,7 @@ import com.raytheon.viz.ui.widgets.LabeledScale;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 26, 2008 Eric Babin Initial Creation
|
||||
* Oct 30, 2012 1298 rferrel Code clean up for non-blocking dialog.
|
||||
* Feb 15, 2013 1638 mschenke Moved edex.common MathUtil into common.util
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -22,8 +22,8 @@ package com.raytheon.viz.gfe.edittool.contour;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
|
||||
import com.raytheon.uf.common.util.GridUtil;
|
||||
import com.raytheon.viz.core.contours.util.ContourContainer;
|
||||
import com.raytheon.viz.core.contours.util.FortConBuf;
|
||||
import com.raytheon.viz.core.contours.util.FortConConfig;
|
||||
|
@ -39,6 +39,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 29, 2009 randerso Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved GRID_FILL_VALUE from edex.common Util into GridUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -66,8 +67,8 @@ public class ContourGrid {
|
|||
}
|
||||
|
||||
FortConConfig config = new FortConConfig();
|
||||
config.badlo = Util.GRID_FILL_VALUE - 1;
|
||||
config.badhi = Util.GRID_FILL_VALUE + 1;
|
||||
config.badlo = GridUtil.GRID_FILL_VALUE - 1;
|
||||
config.badhi = GridUtil.GRID_FILL_VALUE + 1;
|
||||
config.xOffset = 0;
|
||||
config.yOffset = 0;
|
||||
config.labelSpacingLine = 1;
|
||||
|
|
|
@ -33,8 +33,7 @@ Export-Package: com.raytheon.viz.grid,
|
|||
com.raytheon.viz.grid.rsc.general,
|
||||
com.raytheon.viz.grid.util,
|
||||
com.raytheon.viz.grid.xml
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.colormap,
|
||||
Import-Package: com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.dataplugin.level,
|
||||
com.raytheon.uf.common.derivparam.tree,
|
||||
|
|
|
@ -34,8 +34,8 @@ 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.common.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.topo.TopoQuery;
|
||||
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||
import com.raytheon.viz.grid.util.SliceUtil;
|
||||
|
||||
|
@ -49,6 +49,8 @@ import com.raytheon.viz.grid.util.SliceUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 15, 2010 rjpeter Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
|
||||
* and moved into common
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -30,10 +30,7 @@ import com.raytheon.uf.common.dataplugin.radar.util.RadarDataInterrogator;
|
|||
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.topo.ITopoQuery;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.uf.viz.core.topo.TopoQuery;
|
||||
import com.raytheon.viz.radar.Activator;
|
||||
import com.raytheon.uf.common.topo.TopoQuery;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -45,6 +42,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 4, 2010 mnash Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Got rid of viz/edex topo classes
|
||||
* and moved into common
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -92,7 +91,7 @@ public class RadarRadialInterrogator extends RadarDefaultInterrogator implements
|
|||
/ 1.7e7;
|
||||
double topoHeight = Double.NaN;
|
||||
if (useTopo) {
|
||||
ITopoQuery topoQuery = TopoQuery.getInstance();
|
||||
TopoQuery topoQuery = TopoQuery.getInstance();
|
||||
if (topoQuery != null) {
|
||||
topoHeight = topoQuery.getHeight(latLon);
|
||||
} else {
|
||||
|
|
|
@ -44,14 +44,14 @@ import org.eclipse.swt.widgets.MessageBox;
|
|||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.edex.util.Equations;
|
||||
import com.raytheon.edex.util.UAPoint;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
import com.raytheon.uf.common.sounding.ParcelLift.PARCEL_TYPE;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer;
|
||||
import com.raytheon.uf.common.sounding.SoundingLayer.DATA_TYPE;
|
||||
import com.raytheon.uf.common.sounding.VerticalSounding;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.common.sounding.util.Equations;
|
||||
import com.raytheon.uf.common.sounding.util.UAPoint;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -83,6 +83,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 22, 2009 randerso Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util
|
||||
* to common.sounding
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -26,9 +26,9 @@ import java.util.List;
|
|||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.edex.util.Equations;
|
||||
import com.raytheon.edex.util.UAPoint;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.common.sounding.util.Equations;
|
||||
import com.raytheon.uf.common.sounding.util.UAPoint;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -40,6 +40,8 @@ import com.raytheon.uf.common.sounding.WxMath;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 28Sept2008 #1529 dhladky initial.
|
||||
* Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util
|
||||
* to common.sounding
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -30,8 +30,8 @@ import javax.measure.unit.SI;
|
|||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.raytheon.edex.util.Equations;
|
||||
import com.raytheon.edex.util.UAPoint;
|
||||
import com.raytheon.uf.common.sounding.util.Equations;
|
||||
import com.raytheon.uf.common.sounding.util.UAPoint;
|
||||
import com.raytheon.uf.common.sounding.WxMath;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
|
@ -52,6 +52,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 14Jan2007 #682 ebabin Update for sampling bug.
|
||||
* 28Sept2008 #1529 dhladky separate and improve.
|
||||
* Feb 15, 2013 1638 mschenke Moved Equations/UAPoint from edex.common util
|
||||
* to common.sounding
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -177,11 +177,7 @@
|
|||
<bean id="pluginRegistry" class="com.raytheon.uf.edex.core.dataplugin.PluginRegistry" factory-method="getInstance"/>
|
||||
<bean id="dbPluginRegistry" class="com.raytheon.uf.edex.database.DatabasePluginRegistry" factory-method="getInstance"/>
|
||||
|
||||
<bean id="siteAwareRegistry" class="com.raytheon.uf.edex.site.SiteAwareRegistry" factory-method="getInstance">
|
||||
<property name="routeId" value="siteActivationRoute"/>
|
||||
</bean>
|
||||
|
||||
<bean id="commonDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
|
||||
<bean id="commonDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
|
||||
<property name="pluginFQN" value="com.raytheon.uf.edex.database" />
|
||||
<property name="database" value="metadata" />
|
||||
<property name="forceCheck" value="true" />
|
||||
|
@ -218,9 +214,6 @@
|
|||
|
||||
<bean id="edexLocalizationObserver" class="com.raytheon.edex.utility.EDEXLocalizationNotificationObserver" factory-method="getInstance"/>
|
||||
|
||||
<bean id="siteActivateNotifyFilter"
|
||||
class="com.raytheon.uf.common.site.notify.SiteActivateNotifyFilter" />
|
||||
<bean id="siteActivationMonitor" class="com.raytheon.uf.edex.site.SiteActivationMonitor" factory-method="getInstance"/>
|
||||
<!--
|
||||
** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
|
||||
** For more details see
|
||||
|
@ -249,28 +242,6 @@
|
|||
<to uri="jms-generic:topic:edex.alarms.msg?deliveryPersistent=false" />
|
||||
</route>
|
||||
|
||||
<route id="siteActivationRoute">
|
||||
<from uri="jms-generic:topic:siteActivation" />
|
||||
<doTry>
|
||||
<bean ref="serializationUtil" method="transformFromThrift"/>
|
||||
<bean ref="siteAwareRegistry" method="handleMessage" />
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:siteActivation?level=ERROR&showBody=false&showCaughtException=true&showStackTrace=true"/>
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</route>
|
||||
|
||||
<route id="siteActivateNotify">
|
||||
<from uri="vm:edex.siteActivateNotification?size=5000" />
|
||||
<filter>
|
||||
<method bean="siteActivateNotifyFilter" method="isSiteActivateNotification" />
|
||||
<bean ref="siteActivationMonitor" method="handleNotification"/>
|
||||
<bean ref="serializationUtil" method="transformToThrift" />
|
||||
<to uri="jms-generic:topic:edex.alerts.siteActivate" />
|
||||
</filter>
|
||||
</route>
|
||||
|
||||
<!-- Route to periodically close any unused jms resources that have been pooled -->
|
||||
<route id="jmsPooledResourceChecker">
|
||||
<from uri="timer://jmsPooledResourceCheck?period=60s" />
|
||||
|
|
|
@ -31,7 +31,6 @@ import javax.xml.bind.JAXBException;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.edex.subscription.data.ReplacementRecord;
|
||||
import com.raytheon.edex.subscription.data.SubscriptionRecord;
|
||||
import com.raytheon.edex.subscription.runners.ISubscribeRunner;
|
||||
|
@ -41,6 +40,7 @@ import com.raytheon.edex.uengine.runners.IMicroEngine;
|
|||
import com.raytheon.edex.uengine.runners.MicroEngine;
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.message.Header;
|
||||
import com.raytheon.uf.common.message.Message;
|
||||
import com.raytheon.uf.common.message.Property;
|
||||
|
@ -71,6 +71,7 @@ import com.raytheon.uf.edex.core.EdexException;
|
|||
* separate log file.
|
||||
* 30Aug2011 10581 rferrel executeScript now sending proper trigger
|
||||
* argument to the engine.
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -19,7 +19,6 @@ Export-Package: com.raytheon.edex.colormap,
|
|||
com.raytheon.edex.msg,
|
||||
com.raytheon.edex.plugin,
|
||||
com.raytheon.edex.plugin.factory,
|
||||
com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.edex.site,
|
||||
com.raytheon.edex.subscription,
|
||||
com.raytheon.edex.topo,
|
||||
|
@ -34,7 +33,6 @@ Require-Bundle: net.sf.ehcache,
|
|||
org.jep,
|
||||
org.junit,
|
||||
org.apache.commons.logging,
|
||||
org.apache.commons.pool,
|
||||
org.apache.commons.beanutils,
|
||||
org.apache.commons.lang,
|
||||
javax.measure,
|
||||
|
@ -46,7 +44,6 @@ Require-Bundle: net.sf.ehcache,
|
|||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.serialization;visibility:=reexport,
|
||||
com.raytheon.uf.common.status,
|
||||
org.apache.activemq,
|
||||
org.postgres;bundle-version="1.0.0",
|
||||
org.apache.http,
|
||||
org.springframework;bundle-version="2.5.6";visibility:=reexport,
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.raytheon.edex.exception.ColorTableException;
|
|||
import com.raytheon.uf.common.colormap.CMapFilenameFilter;
|
||||
import com.raytheon.uf.common.colormap.Color;
|
||||
import com.raytheon.uf.common.colormap.ColorMap;
|
||||
import com.raytheon.uf.common.colormap.ColorMapUtils;
|
||||
import com.raytheon.uf.common.colormap.IColorMap;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
|
@ -52,6 +53,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Jul 26, 2007 njensen Initial creation
|
||||
* Aug 20, 2008 dglazesk JiBX replaced with JaXB
|
||||
* Aug 20, 2008 dglazesk Updated for the new ColorMap interface
|
||||
* Feb 15, 2013 1638 mschenke Moved IndexColorModel creation to common.colormap utility
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,9 +63,9 @@ public class ColorMapManager {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ColorMapManager.class);
|
||||
|
||||
public static final int NUMBER_BITS = 8;
|
||||
public static final int NUMBER_BITS = ColorMapUtils.COLOR_MODEL_NUMBER_BITS;
|
||||
|
||||
public static final float MAX_VALUE = 255.0f;
|
||||
public static final float MAX_VALUE = ColorMapUtils.MAX_VALUE;
|
||||
|
||||
private static ColorMapManager instance;
|
||||
|
||||
|
@ -154,28 +156,14 @@ public class ColorMapManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Builds a color model from a color map
|
||||
* Call {@link ColorMapUtils#buildColorModel(IColorMap)}
|
||||
*
|
||||
* @param aColorMap
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static IndexColorModel buildColorModel(IColorMap aColorMap) {
|
||||
int size = aColorMap.getSize();
|
||||
byte[] red = new byte[size];
|
||||
byte[] green = new byte[size];
|
||||
byte[] blue = new byte[size];
|
||||
byte[] alpha = new byte[size];
|
||||
|
||||
List<Color> colors = aColorMap.getColors();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Color color = colors.get(i);
|
||||
red[i] = (byte) (color.getRed() * MAX_VALUE);
|
||||
green[i] = (byte) (color.getGreen() * MAX_VALUE);
|
||||
blue[i] = (byte) (color.getBlue() * MAX_VALUE);
|
||||
alpha[i] = (byte) (color.getAlpha() * MAX_VALUE);
|
||||
}
|
||||
|
||||
return new IndexColorModel(NUMBER_BITS, size, red, green, blue, alpha);
|
||||
return ColorMapUtils.buildColorModel(aColorMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,148 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.scriptfactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.edex.core.EdexException;
|
||||
|
||||
/**
|
||||
* Provides an interface to the script generation template facility
|
||||
*
|
||||
* Implemented as a singleton for performance reasons. Templates and context are
|
||||
* both cached in memory.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 17, 2008 #1088 chammack Initial creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ScriptFactory {
|
||||
|
||||
/** Cached velocity engine */
|
||||
private VelocityEngine velocityEngine;
|
||||
|
||||
/** Cached templates */
|
||||
private final Map<String, Template> templateMap;
|
||||
|
||||
/** The singleton instance */
|
||||
private static ScriptFactory instance;
|
||||
|
||||
/**
|
||||
* Guarded constructor
|
||||
*/
|
||||
private ScriptFactory() {
|
||||
templateMap = new HashMap<String, Template>();
|
||||
}
|
||||
|
||||
public static synchronized ScriptFactory getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ScriptFactory();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a script from a template
|
||||
*
|
||||
*
|
||||
* @param scriptTemplate
|
||||
* the path to the script template to use
|
||||
* @param globalScriptDir
|
||||
* the path to the global macro script directory
|
||||
* @param maxRecords
|
||||
* the maximum number of records to return (if applicable, else
|
||||
* zero)
|
||||
* @param mode
|
||||
* the script mode (if applicable)
|
||||
* @param scriptLibrary
|
||||
* the script library to use (if applicable)
|
||||
* @param metaData
|
||||
* the script's metadata that will be passed into the template
|
||||
* @param
|
||||
* @return a generated script
|
||||
* @throws EdexException
|
||||
* if script generation fails
|
||||
*/
|
||||
public synchronized String createScript(File scriptTemplate,
|
||||
File globalScriptDir, int maxRecords, String mode,
|
||||
String scriptLibrary, Map<String, RequestConstraint> metaData,
|
||||
String logDir) throws Exception {
|
||||
StringWriter sw = null;
|
||||
try {
|
||||
if (velocityEngine == null) {
|
||||
java.util.Properties p = new java.util.Properties();
|
||||
String scriptDir = globalScriptDir.getPath();
|
||||
p.setProperty("file.resource.loader.class",
|
||||
ScriptTemplateLoader.class.getName());
|
||||
p.setProperty("file.resource.loader.path", scriptDir);
|
||||
p.setProperty("velocimacro.permissions.allowInline", "true");
|
||||
p.setProperty(
|
||||
"velocimacro.permissions.allow.inline.to.replace.global",
|
||||
"true");
|
||||
p.setProperty("runtime.log",
|
||||
FileUtil.join(logDir, "velocity.log"));
|
||||
velocityEngine = new VelocityEngine();
|
||||
velocityEngine.init(p);
|
||||
}
|
||||
|
||||
VelocityContext context = new VelocityContext();
|
||||
|
||||
context.put("scriptMetadata", metaData);
|
||||
context.put("maxRecords", maxRecords);
|
||||
context.put("scriptLibrary", scriptLibrary);
|
||||
context.put("mode", mode);
|
||||
|
||||
sw = new StringWriter();
|
||||
|
||||
String path = scriptTemplate.getAbsolutePath();
|
||||
String key = path + File.pathSeparator + globalScriptDir; //Win32
|
||||
Template template = templateMap.get(key);
|
||||
if (template == null) {
|
||||
template = velocityEngine.getTemplate(path,
|
||||
Velocity.ENCODING_DEFAULT);
|
||||
templateMap.put(key, template);
|
||||
}
|
||||
|
||||
template.merge(context, sw);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Error generating from template", e);
|
||||
}
|
||||
|
||||
return sw.toString();
|
||||
}
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.scriptfactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.commons.collections.ExtendedProperties;
|
||||
import org.apache.velocity.exception.ResourceNotFoundException;
|
||||
import org.apache.velocity.runtime.resource.Resource;
|
||||
import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
|
||||
|
||||
/**
|
||||
* Provides a velocity file loading strategy that allows absolute path-based
|
||||
* script loading.
|
||||
*
|
||||
* Traditional velocity file loader requires all scripts to be in a single
|
||||
* declared directory.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 04/17/2008 1088 chammack Initial Creation.
|
||||
* 06/01/2012 DR 14555 D. Friedman Support new version of Velocity.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ScriptTemplateLoader extends FileResourceLoader {
|
||||
|
||||
private String path;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.velocity.runtime.resource.loader.FileResourceLoader#getLastModified(org.apache.velocity.runtime.resource.Resource)
|
||||
*/
|
||||
@Override
|
||||
public long getLastModified(Resource resource) {
|
||||
File file = new File(resource.getName());
|
||||
return file.lastModified();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.velocity.runtime.resource.loader.FileResourceLoader#getResourceStream(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public InputStream getResourceStream(String arg0)
|
||||
throws ResourceNotFoundException {
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(resolvePath(arg0));
|
||||
return fis;
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new ResourceNotFoundException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.velocity.runtime.resource.loader.FileResourceLoader#init(org.apache.commons.collections.ExtendedProperties)
|
||||
*/
|
||||
@Override
|
||||
public void init(ExtendedProperties arg0) {
|
||||
this.path = arg0.getString("path");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.velocity.runtime.resource.loader.FileResourceLoader#isSourceModified(org.apache.velocity.runtime.resource.Resource)
|
||||
*/
|
||||
@Override
|
||||
public boolean isSourceModified(Resource arg0) {
|
||||
File file = new File(arg0.getName());
|
||||
return (file.lastModified() != arg0.getLastModified());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resourceExists(String name) {
|
||||
File f = new File(resolvePath(name));
|
||||
return f.isFile();
|
||||
}
|
||||
|
||||
private String resolvePath(String arg0) {
|
||||
String dir = null;
|
||||
if (arg0.startsWith(File.separator) || arg0.charAt(1) == ':' ) //Win32
|
||||
dir = arg0;
|
||||
else
|
||||
dir = this.path + File.separator + arg0;
|
||||
return dir;
|
||||
}
|
||||
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.edex.urifilter;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
|
||||
/**
|
||||
* Interface IURIFilter
|
||||
|
@ -33,6 +33,8 @@ import com.raytheon.edex.msg.DataURINotificationMessage;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 06Feb2009 1981 dhladky Creation.
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
*
|
||||
* author dhladky
|
||||
* @version 1.0
|
||||
*/
|
||||
|
|
|
@ -32,7 +32,8 @@ import java.util.regex.Pattern;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -47,9 +48,10 @@ import com.raytheon.uf.edex.core.EdexException;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 02/07/2009 1981 dhladky Initial Creation.
|
||||
* 05/27/2009 2037 dhladky Fixed concurrent mod
|
||||
* exception with URI maps on removal
|
||||
* 02/07/2009 1981 dhladky Initial Creation.
|
||||
* 05/27/2009 2037 dhladky Fixed concurrent mod
|
||||
* exception with URI maps on removal
|
||||
* Feb 15, 2013 1638 mschenke Switched to use DataURI.SEPARATOR
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,7 +59,8 @@ import com.raytheon.uf.edex.core.EdexException;
|
|||
* @version 1.0
|
||||
*/
|
||||
public abstract class URIFilter implements ISerializableObject {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(URIFilter.class);
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(URIFilter.class);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -110,7 +113,7 @@ public abstract class URIFilter implements ISerializableObject {
|
|||
protected String[] previousURIs = null;
|
||||
|
||||
/** Separator for URI's */
|
||||
public static final String uriSeperator = "/";
|
||||
public static final String uriSeperator = DataURI.SEPARATOR;
|
||||
|
||||
/** sets the start for the forecast hour */
|
||||
public static final String forecastTimeSepStart = "(";
|
||||
|
|
|
@ -20,49 +20,30 @@
|
|||
|
||||
package com.raytheon.edex.util;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.ConvertUtil;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.common.util.GridUtil;
|
||||
|
||||
/**
|
||||
* Contains utility methods for use in common.
|
||||
|
@ -78,6 +59,9 @@ import com.raytheon.uf.common.util.ConvertUtil;
|
|||
* 15Jul2008 1014 MW Fegan Improved logging of JiBX marshaling errors.
|
||||
* Aug 20, 2008 dglazesk Added functions for handling JaXB marshalling
|
||||
* Nov 09, 2012 1322 djohnson Add close for Spring context.
|
||||
* Feb 15, 2013 1638 mschenke Deleted unused functions and moved ones used by common/viz
|
||||
* code into common projects
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mfegan
|
||||
|
@ -85,11 +69,6 @@ import com.raytheon.uf.common.util.ConvertUtil;
|
|||
*/
|
||||
public final class Util {
|
||||
|
||||
private static final NumberFormat milliFormatter = new DecimalFormat("000");
|
||||
|
||||
private static final NumberFormat nanoFormatter = new DecimalFormat(
|
||||
"000000");
|
||||
|
||||
// public static final String MEMORY_FORMAT = "Used Memory: %f MB, Free
|
||||
// Memory: %f MB, Heap Size: %f MB, Available: %f MB, Max Memory: %f MB";
|
||||
public static final String MEMORY_FORMAT = "Used Memory: %f MB, Heap Size: %f MB, Max Memory: %f MB";
|
||||
|
@ -110,9 +89,9 @@ public final class Util {
|
|||
/**
|
||||
* Easy reference to system-dependent end of line
|
||||
*/
|
||||
public static final String EOL = System.getProperty("line.separator");
|
||||
public static final String EOL = FileUtil.EOL;
|
||||
|
||||
public static final float GRID_FILL_VALUE = -999999;
|
||||
public static final float GRID_FILL_VALUE = GridUtil.GRID_FILL_VALUE;
|
||||
|
||||
private Util() {
|
||||
// No Instantiation
|
||||
|
@ -143,39 +122,6 @@ public final class Util {
|
|||
return "[" + (obj == null ? "null" : obj.toString()) + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes the setter for the specified field on an object.
|
||||
* <P>
|
||||
* The {@code objClass} argument could be eliminated by calling
|
||||
* {@link java.lang.Object#getClass()} on the object, but it is assumed this
|
||||
* method will only be used by a client using introspection, so the client
|
||||
* will already have created a {@link java.lang.Class} object. (If you know
|
||||
* what the object is, you can call the appropriate methods directly and do
|
||||
* not need this utility)
|
||||
*
|
||||
* @param object
|
||||
* the object on which to invoke the setter.
|
||||
* @param objClass
|
||||
* the CLass object
|
||||
* @param field
|
||||
* the field to be set
|
||||
* @param value
|
||||
* the value to be set
|
||||
*
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public static void setFieldValue(Object object, Class<?> objClass,
|
||||
String field, Object value) throws NoSuchMethodException,
|
||||
InvocationTargetException, IllegalAccessException {
|
||||
StringBuffer setter = new StringBuffer("set").append(
|
||||
field.substring(0, 1).toUpperCase()).append(field.substring(1));
|
||||
Method worker = objClass.getMethod(setter.toString(),
|
||||
new Class<?>[] { value.getClass() });
|
||||
worker.invoke(object, new Object[] { value });
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename from a fully qualified path
|
||||
*
|
||||
|
@ -229,127 +175,6 @@ public final class Util {
|
|||
return calendar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take in long representing nanoseconds, return formatted string.
|
||||
*
|
||||
* @param nano
|
||||
* number of nanoseconds to format
|
||||
* @return String representing seconds (ss.SSS:nnnnnn)
|
||||
*/
|
||||
public static String nano2Seconds(long nano) {
|
||||
long seconds = nano / 1000000000;
|
||||
long millis = (nano - (seconds * 1000000000)) / 1000000;
|
||||
return seconds
|
||||
+ "."
|
||||
+ milliFormatter.format(millis)
|
||||
+ ":"
|
||||
+ nanoFormatter.format(nano - (seconds * 1000000000)
|
||||
- (millis * 1000000)) + " s";
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of URL objects from an array of File objects.
|
||||
*
|
||||
* @param files
|
||||
* An array of File objects
|
||||
* @return An array of URL objects created from the array of file locations
|
||||
*/
|
||||
public static URL[] fileNameToURL(File[] files) {
|
||||
|
||||
ArrayList<URL> list = new ArrayList<URL>();
|
||||
URL[] urls = null;
|
||||
|
||||
if (files != null) {
|
||||
for (int counter = 0; counter < files.length; counter++) {
|
||||
try {
|
||||
list.add(files[counter].toURI().toURL());
|
||||
} catch (MalformedURLException e) {
|
||||
logger.error("Unable to create a URL for : "
|
||||
+ files[counter], e);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Unable to create a URL for : "
|
||||
+ files[counter], e);
|
||||
}
|
||||
}
|
||||
|
||||
// finally, assign this list back
|
||||
urls = list.toArray(new URL[] {});
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of URL objects from an array of String objects.
|
||||
*
|
||||
* @param theLocations
|
||||
* @return An array of URL objects created from the String array of
|
||||
* locations
|
||||
*/
|
||||
public static URL[] fileNameToURL(String[] theLocations) {
|
||||
ArrayList<URL> list = new ArrayList<URL>();
|
||||
URL[] urls = null;
|
||||
|
||||
// if the locations value is null or empty,
|
||||
// return a list empty URLs
|
||||
if (theLocations == null || theLocations.length == 0) {
|
||||
urls = new URL[] {};
|
||||
} else {
|
||||
for (int counter = 0; counter < theLocations.length; counter++) {
|
||||
try {
|
||||
list.add(new URL(theLocations[counter]));
|
||||
} catch (MalformedURLException e) {
|
||||
logger.error("Unable to create a URL for : "
|
||||
+ theLocations[counter], e);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Unable to create a URL for : "
|
||||
+ theLocations[counter], e);
|
||||
}
|
||||
}
|
||||
|
||||
// finally, assign this list back
|
||||
urls = list.toArray(new URL[] {});
|
||||
}
|
||||
|
||||
return urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts a file as a string from a jar
|
||||
*
|
||||
* @param jarFile
|
||||
* The jar file to examine
|
||||
* @param fileName
|
||||
* The name of the file within the jar to read
|
||||
* @return The string representation of the file
|
||||
*/
|
||||
public static String getJarEntry(JarFile jarFile, String fileName) {
|
||||
|
||||
InputStream jarStream = null;
|
||||
String fileContents = null;
|
||||
byte[] fileBytes = null;
|
||||
try {
|
||||
jarStream = jarFile.getInputStream(jarFile.getEntry(fileName));
|
||||
|
||||
fileBytes = new byte[jarStream.available()];
|
||||
jarStream.read(fileBytes);
|
||||
fileContents = new String(fileBytes);
|
||||
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to get input stream for jar entry: ["
|
||||
+ fileName + "]");
|
||||
|
||||
} finally {
|
||||
if (jarStream != null) {
|
||||
try {
|
||||
jarStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to close input stream to jar", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return fileContents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new class loaded by adding the specified list of files to the
|
||||
* existing class loader.
|
||||
|
@ -377,27 +202,6 @@ public final class Util {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive an array of directories from a comma-separated string.
|
||||
*
|
||||
* @param theLocationsString
|
||||
* @return An array of directories
|
||||
*/
|
||||
public static String[] retrieveDirectories(String theLocationsString) {
|
||||
String[] directories = null;
|
||||
|
||||
// check for an empty property list,
|
||||
// if found, return an empty directory list
|
||||
if (theLocationsString == null) {
|
||||
return new String[] {};
|
||||
}
|
||||
|
||||
// split the list of locations on ,
|
||||
directories = theLocationsString.split(",");
|
||||
|
||||
return directories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a temporary file from a byte array message inthe OS's temporary
|
||||
* directory This file is removed from the OS when the JVM terminates, but
|
||||
|
@ -441,244 +245,6 @@ public final class Util {
|
|||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a temporary file in the default location named "tempFile" with
|
||||
* the provided data
|
||||
*
|
||||
* @param message
|
||||
* The data to write to the file
|
||||
* @return The created file
|
||||
*/
|
||||
public static File createTempFile(byte[] message) {
|
||||
return createTempFile(message, "tempFile");
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip double array along a horizontal line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] flipHoriz(double[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[y - i - 1][j] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip double array along a vertical line
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] flipVert(double[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[i][x - j - 1] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a horizontal line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(float[][] baseArray) {
|
||||
|
||||
float temp;
|
||||
int height = baseArray[0].length;
|
||||
int width = baseArray.length;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i][j];
|
||||
baseArray[i][j] = baseArray[i][width - j - 1];
|
||||
baseArray[i][width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate 180 degrees.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void rotate180(float[] baseArray, int height, int width) {
|
||||
|
||||
int counter = 0;
|
||||
int total = height * width;
|
||||
float temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[counter];
|
||||
baseArray[counter] = baseArray[total - counter - 1];
|
||||
baseArray[total - counter - 1] = temp;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip along a vertical
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipVert(float[] baseArray, int height, int width) {
|
||||
|
||||
float temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i * width + j];
|
||||
baseArray[i * width + j] = baseArray[i * width + width - j - 1];
|
||||
baseArray[i * width + width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(float[] baseArray, int height, int width) {
|
||||
|
||||
float temp = 0;
|
||||
|
||||
for (int i = 0; i < height / 2; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
temp = baseArray[j + width * i];
|
||||
baseArray[j + width * i] = baseArray[j + width
|
||||
* (height - i - 1)];
|
||||
baseArray[j + width * (height - i - 1)] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip along a vertical
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipVert(byte[] baseArray, int height, int width) {
|
||||
|
||||
byte temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i * width + j];
|
||||
baseArray[i * width + j] = baseArray[i * width + width - j - 1];
|
||||
baseArray[i * width + width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(byte[] baseArray, int height, int width) {
|
||||
|
||||
byte temp = 0;
|
||||
|
||||
for (int i = 0; i < height / 2; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
temp = baseArray[j + width * i];
|
||||
baseArray[j + width * i] = baseArray[j + width
|
||||
* (height - i - 1)];
|
||||
baseArray[j + width * (height - i - 1)] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static float[][] flipVert(float[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
float[][] returnVal = new float[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[i][x - j - 1] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate double array 90 degrees to the right
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] rotateRight(double[][] baseArray) {
|
||||
|
||||
int y = baseArray[0].length;
|
||||
int x = baseArray.length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < x; i++) {
|
||||
for (int j = 0; j < y; j++) {
|
||||
returnVal[j][x - 1 - i] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate a double array 90 degrees to the left
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] rotateLeft(double[][] baseArray) {
|
||||
|
||||
int y = baseArray[0].length;
|
||||
int x = baseArray.length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < x; i++) {
|
||||
for (int j = 0; j < y; j++) {
|
||||
returnVal[y - j - 1][i] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a ddhhmm time group to a Calendar. Adjusts the calendar as
|
||||
* follows: Any time group with a day (dd) in the future is set back one
|
||||
|
@ -853,190 +419,6 @@ public final class Util {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the contents of a resource in a jar file as a string
|
||||
*
|
||||
* @param jarLocation
|
||||
* The location of the jar (directory + jar name)
|
||||
* @param resourceName
|
||||
* The resource to retrieve
|
||||
* @param resourceDirectory
|
||||
* The dirctory of the resource in the jar, e.g. "res\"
|
||||
* @return The string contents of the resource
|
||||
*/
|
||||
public static String getFileFromJar(String jarLocation,
|
||||
String resourceName, String resourceDirectory) {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
InputStream input = null;
|
||||
BufferedReader reader = null;
|
||||
JarFile jarFile = null;
|
||||
String line = null;
|
||||
|
||||
try {
|
||||
jarFile = new JarFile(jarLocation);
|
||||
ZipEntry entry = jarFile.getEntry(resourceDirectory + resourceName);
|
||||
input = jarFile.getInputStream(entry);
|
||||
reader = new BufferedReader(new InputStreamReader(input));
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
buffer.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to open file", e);
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to close reader", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (input != null) {
|
||||
try {
|
||||
input.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to close input stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (jarFile != null) {
|
||||
try {
|
||||
jarFile.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to close jar file", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a String into an (possibly numeric) Object. If the String parses
|
||||
* as an Integer, it will return the Integer object. If the String parses as
|
||||
* a Float, it will return the Float object. Otherwise, the original String
|
||||
* object is returned.
|
||||
*
|
||||
* @param string
|
||||
* the string to convert
|
||||
*
|
||||
* @return the converted object
|
||||
*/
|
||||
public static Object getObjForStr(String string, Class<?> aClass) {
|
||||
|
||||
Object retValue = null;
|
||||
|
||||
// convert to calendar, if the pattern matches
|
||||
if (string.matches("\\d{14}")) {
|
||||
retValue = convertStr14ToCal(string);
|
||||
} else if (string
|
||||
.matches("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.0")) {
|
||||
retValue = ConvertUtil.convertObject(string, Calendar.class);
|
||||
}
|
||||
|
||||
if (retValue != null) {
|
||||
return retValue;
|
||||
}
|
||||
// if there is a class, get the instance of it.
|
||||
if (aClass != null && string.indexOf(",") == -1) {
|
||||
|
||||
try {
|
||||
|
||||
if (Float.class.equals(aClass)) {
|
||||
retValue = new Float(string);
|
||||
} else if (Integer.class.equals(aClass)) {
|
||||
retValue = new Integer(string);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Unable to instaniate: " + aClass, e);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// try to get the instance based on try/catch
|
||||
try {
|
||||
retValue = Integer.parseInt(string);
|
||||
} catch (NumberFormatException e) {
|
||||
try {
|
||||
retValue = Float.parseFloat(string);
|
||||
} catch (NumberFormatException e1) {
|
||||
retValue = string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file from its location to another location.
|
||||
*
|
||||
* @param copyFrom
|
||||
* The file reference.
|
||||
* @param toDir
|
||||
* Location where the file will be copied to.
|
||||
* @return String status information.
|
||||
*/
|
||||
public static String copyFile(File copyFrom, String toDir) {
|
||||
String status = "";
|
||||
if (copyFrom.exists()) {
|
||||
if (copyFrom.isFile()) {
|
||||
File to = new File(toDir + copyFrom.getName());
|
||||
|
||||
BufferedInputStream bis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
try {
|
||||
try {
|
||||
bis = new BufferedInputStream(new FileInputStream(
|
||||
copyFrom));
|
||||
bos = new BufferedOutputStream(new FileOutputStream(to));
|
||||
|
||||
int i = 0;
|
||||
while ((i = bis.read()) > -1) {
|
||||
bos.write(i);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
status = ioe.toString();
|
||||
}
|
||||
} finally {
|
||||
String s = close(bis);
|
||||
if (s != null) {
|
||||
status += s;
|
||||
}
|
||||
s = close(bos);
|
||||
if (s != null) {
|
||||
status += s;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
status = "Is not a file reference";
|
||||
}
|
||||
} else {
|
||||
status = "File not found";
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
public static void copy(String fromFile, String toFile) throws IOException {
|
||||
|
||||
FileInputStream fis = new FileInputStream(fromFile);
|
||||
FileOutputStream fos = new FileOutputStream(toFile);
|
||||
|
||||
int b = 0;
|
||||
while ((b = fis.read()) != -1) {
|
||||
fos.write(b);
|
||||
}
|
||||
fis.close();
|
||||
fos.close();
|
||||
}
|
||||
|
||||
public static void copy(File fromFile, File toFile) throws IOException {
|
||||
copy(fromFile.getAbsolutePath(), toFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes any closeable object.
|
||||
*
|
||||
|
@ -1057,62 +439,6 @@ public final class Util {
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a hash number based on the toString values of all elements in the
|
||||
* supplied array
|
||||
*
|
||||
* @param elements
|
||||
* Elements that construct the hash number
|
||||
* @return A hash number
|
||||
*/
|
||||
public static Integer generateHash(Object[] elements) {
|
||||
|
||||
HashCodeBuilder hashBuilder = new HashCodeBuilder(17, 37);
|
||||
|
||||
for (int i = 0; i < elements.length; i++) {
|
||||
hashBuilder.append(elements[i].toString());
|
||||
}
|
||||
return hashBuilder.toHashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unique ID associated with a cache key address
|
||||
*
|
||||
* @param address
|
||||
* An address of an element in the cache
|
||||
* @return The UUID associated with this address
|
||||
*/
|
||||
public static String parseID(String address) {
|
||||
String id = address.split("[/\\|]")[1];
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a formatted string displaying current memory information.
|
||||
*
|
||||
* String is in the format: Max Size: x Mb, Free Memory: z Mb
|
||||
*
|
||||
* @return runtime memory information
|
||||
*/
|
||||
public static String getCurrentMemory() {
|
||||
final double oneMeg = 1024.0 * 1024.0;
|
||||
double freeMemory = Runtime.getRuntime().freeMemory() / oneMeg;
|
||||
double heapSize = Runtime.getRuntime().totalMemory() / oneMeg;
|
||||
double maxSize = Runtime.getRuntime().maxMemory() / oneMeg;
|
||||
|
||||
double usedSize = heapSize - freeMemory;
|
||||
return String.format(MEMORY_FORMAT, usedSize, heapSize, maxSize);
|
||||
}
|
||||
|
||||
public static float getPercentFreeMemory() {
|
||||
long maxSize = Runtime.getRuntime().maxMemory();
|
||||
float available = (maxSize - (Runtime.getRuntime().totalMemory() - Runtime
|
||||
.getRuntime().freeMemory())) / (1024 * 1024f);
|
||||
float percentFree = (available / ((maxSize / 1024f) / 1024)) * 100;
|
||||
return percentFree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the given string is all alpha-numeric characters
|
||||
*
|
||||
|
@ -1137,108 +463,6 @@ public final class Util {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a java type based on a string representation
|
||||
*
|
||||
* @param type
|
||||
* The type as a string
|
||||
* @return The Class type
|
||||
*/
|
||||
public static Class<?> getJavaType(String type) {
|
||||
if ("varchar".equals(type)) {
|
||||
return String.class;
|
||||
}
|
||||
if ("integer".equals(type)) {
|
||||
return Integer.class;
|
||||
}
|
||||
if ("float".equals(type)) {
|
||||
return Float.class;
|
||||
}
|
||||
if ("numeric".equals(type)) {
|
||||
return Double.class;
|
||||
}
|
||||
if ("timestamp with time zone".equals(type) || "timestamp".equals(type)) {
|
||||
return Calendar.class;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Bad type: " + type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the JAXB global context
|
||||
*
|
||||
* @return the jaxb global context
|
||||
* @throws JAXBException
|
||||
*
|
||||
* @deprecated Please use {@link SerializationUtil} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static JAXBContext getJaxbContext() throws JAXBException {
|
||||
return SerializationUtil.getJaxbContext();
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates an object from the XML representation in a string. Uses
|
||||
* JAXB.
|
||||
*
|
||||
* @param xml
|
||||
* The XML representation
|
||||
* @return A new instance from the XML representation
|
||||
* @throws JAXBException
|
||||
* @deprecated Please use {@link SerializationUtil} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static Object unmarshalFromXml(String xml) throws JAXBException {
|
||||
return SerializationUtil.unmarshalFromXml(xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of a class to an XML representation in a string. Uses
|
||||
* JAXB.
|
||||
*
|
||||
* @param obj
|
||||
* Object being marshalled
|
||||
* @return XML string representation of the object
|
||||
* @throws JAXBException
|
||||
* @deprecated Please use {@link SerializationUtil} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static String marshalToXml(Object obj) throws JAXBException {
|
||||
return SerializationUtil.marshalToXml(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of a class to an XML representation and write XML to
|
||||
* file. Uses JAXB.
|
||||
*
|
||||
* @param obj
|
||||
* Object to be marshalled
|
||||
* @param filePath
|
||||
* Path to the output file
|
||||
* @throws SerializationException
|
||||
* @deprecated Please use {@link SerializationUtil} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static void jaxbMarshalToXmlFile(Object obj, String filePath)
|
||||
throws SerializationException {
|
||||
SerializationUtil.jaxbMarshalToXmlFile(obj, filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates an object from the XML representation in a File. Uses JAXB.
|
||||
*
|
||||
* @param filePath
|
||||
* The path to the XML file
|
||||
* @return A new instance from the XML representation
|
||||
* @throws SerializationException
|
||||
* @deprecated Please use {@link SerializationUtil} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static Object jaxbUnmarshalFromXmlFile(String filePath)
|
||||
throws SerializationException {
|
||||
return SerializationUtil.jaxbUnmarshalFromXmlFile(filePath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve date as a long in the index standard format: yyyy-MM-dd
|
||||
* kk:mm:ss.SSS
|
||||
|
@ -1253,14 +477,6 @@ public final class Util {
|
|||
return TimeUtil.formatCalendar(cal);
|
||||
}
|
||||
|
||||
public static long getUnixTime(Date date) {
|
||||
if (date == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return date.getTime() / 1000l;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resizes a 1-D data array into a 2-D array based on the provided row and
|
||||
* column count
|
||||
|
@ -1309,33 +525,6 @@ public final class Util {
|
|||
return newGrid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts a sub-grid of data from a 2-D array of data
|
||||
*
|
||||
* @param data
|
||||
* The 2-D array of data
|
||||
* @param startColumn
|
||||
* The start column of the sub-grid
|
||||
* @param startRow
|
||||
* The start row of the sub-grid
|
||||
* @param columnCount
|
||||
* The number of columns in the sub-grid
|
||||
* @param rowCount
|
||||
* The number of rows in the sub-grid
|
||||
* @return The sub-grid of data
|
||||
*/
|
||||
public static float[][] subGrid(float[][] data, int startColumn,
|
||||
int startRow, int columnCount, int rowCount) {
|
||||
float[][] newGrid = new float[rowCount][columnCount];
|
||||
|
||||
for (int row = startRow; row < rowCount + startRow; row++) {
|
||||
for (int column = startColumn; column < columnCount + startColumn; column++) {
|
||||
newGrid[row - startRow][column - startColumn] = data[row][column];
|
||||
}
|
||||
}
|
||||
return newGrid;
|
||||
}
|
||||
|
||||
public static void insertSubgrid(float[][] data, float[][] subGrid,
|
||||
int startColumn, int startRow, int columnCount, int rowCount) {
|
||||
|
||||
|
@ -1366,6 +555,6 @@ public final class Util {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,5 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
org.springframework;bundle-version="2.5.6"
|
||||
Export-Package: com.raytheon.edex.services
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.message.response,
|
||||
com.raytheon.uf.edex.core,
|
||||
Import-Package: com.raytheon.uf.edex.core,
|
||||
com.raytheon.uf.edex.database.plugin
|
||||
|
|
|
@ -1,285 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.uengine.tasks.process;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.edex.msg.Service;
|
||||
import com.raytheon.edex.services.ArchiveSrv;
|
||||
import com.raytheon.uf.common.message.response.ResponseMessageGeneric;
|
||||
|
||||
/**
|
||||
* This script task will send control messages to the ArchiveSrvs to allow for
|
||||
* the turning on and off of the Archive locations.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 12/12/2007 561 dfitch Initial Creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dfitch
|
||||
* @version 1
|
||||
*/
|
||||
public class ArchiveSrvControl {
|
||||
|
||||
private static final String SET_ARCHIVE_DIR_LOCATION = "SET_ARCHIVE_DIR_LOCATION";
|
||||
|
||||
private static final String SET_TEE_MODE = "SET_TEE_MODE";
|
||||
|
||||
// private static final String ADD_ONE_TEE_MODE_CRONTAB =
|
||||
// "ADD_ONE_TEE_MODE_CRONTAB";
|
||||
|
||||
// private static final String REMOVE_ONE_TEE_MODE_CRONTAB =
|
||||
// "REMOVE_ONE_TEE_MODE_CRONTAB";
|
||||
|
||||
private static final String SET_RECORD_LOCATIONS = "SET_RECORD_LOCATIONS";
|
||||
|
||||
private String archiveDirectoryLocation = null;
|
||||
|
||||
private boolean teeModeOn = false;
|
||||
|
||||
private String targetName = null;
|
||||
|
||||
/**
|
||||
* What should happen when execute is invoked? There are several available
|
||||
* choices
|
||||
*
|
||||
* <ul>
|
||||
* <li>null -- Just return a list of what IngestSrv objects are out there</li>
|
||||
* <li>change -- perform what ever changes have been asked for... then
|
||||
* return the list of IngestSrv objects are out there</li>
|
||||
* </ul>
|
||||
*/
|
||||
private List<String> lstCommands = null;
|
||||
|
||||
private String recordLocations;
|
||||
|
||||
private String startTeeModeCrontab;
|
||||
|
||||
private String stopTeeModeCrontab;
|
||||
|
||||
public ArchiveSrvControl() {
|
||||
super();
|
||||
lstCommands = new ArrayList<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Replay the archive returning an XML string of some information about what
|
||||
* happened...
|
||||
*
|
||||
*/
|
||||
public Object execute() {
|
||||
List<ArchiveSrv> lstArchiveSrv = ArchiveSrv.getLstOfArchiveSrv();
|
||||
synchronized (lstArchiveSrv) {
|
||||
// logger.info("lstIngestSrv.size()=" + lstArchiveSrv.size());
|
||||
if ((null != lstCommands) && (lstCommands.size() > 0)) {
|
||||
for (Iterator<ArchiveSrv> it = lstArchiveSrv.iterator(); it
|
||||
.hasNext();) {
|
||||
ArchiveSrv archiveSrv = it.next();
|
||||
if ((null == targetName)
|
||||
|| targetName
|
||||
.equalsIgnoreCase(archiveSrv.getName())) {
|
||||
|
||||
executeCommand(archiveSrv);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lstArchiveSrv = ArchiveSrv.getLstOfArchiveSrv();
|
||||
List<Service> serviceList = new ArrayList<Service>();
|
||||
for (Iterator<ArchiveSrv> it = lstArchiveSrv.iterator(); it.hasNext();) {
|
||||
ArchiveSrv archiveSrv = it.next();
|
||||
if ((null == targetName)
|
||||
|| targetName.equalsIgnoreCase(archiveSrv.getName())) {
|
||||
|
||||
Service tmpSrv = new Service();
|
||||
tmpSrv.setArchiveDirectoryLocation(archiveSrv
|
||||
.getArchiveDirectoryLocation());
|
||||
tmpSrv.setJmxModeOn(archiveSrv.isJmxModeOn());
|
||||
tmpSrv.setName(archiveSrv.getName());
|
||||
tmpSrv.setTeeModeOn(archiveSrv.isTeeModeOn());
|
||||
serviceList.add(tmpSrv);
|
||||
|
||||
}
|
||||
}
|
||||
ResponseMessageGeneric response = new ResponseMessageGeneric(
|
||||
(ArrayList<Service>) serviceList);
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param archiveSrv
|
||||
*/
|
||||
private void executeCommand(ArchiveSrv archiveSrv) {
|
||||
for (Iterator<String> it = lstCommands.iterator(); it.hasNext();) {
|
||||
|
||||
String command = it.next();
|
||||
if (null == command) {
|
||||
|
||||
} else if (SET_RECORD_LOCATIONS.equals(command)) {
|
||||
archiveSrv.setRecordLocations(recordLocations);
|
||||
} else if (SET_ARCHIVE_DIR_LOCATION.equals(command)) {
|
||||
archiveSrv
|
||||
.setArchiveDirectoryLocation(archiveDirectoryLocation);
|
||||
} else if (SET_TEE_MODE.equals(command)) {
|
||||
archiveSrv.setTeeModeOn(teeModeOn);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
// private String statusOfAllIngestSrv() {
|
||||
// String result = "<?xml version='1.0' encoding='ISO-8859-1'?>\n"
|
||||
// + "<IngestSrvs>\n";
|
||||
//
|
||||
// List<ArchiveSrv> lstArchiveSrv = ArchiveSrv.getLstOfArchiveSrv();
|
||||
// synchronized (lstArchiveSrv) {
|
||||
// logger.info("lstIngestSrv.size()=" + lstArchiveSrv.size());
|
||||
// for (Iterator<ArchiveSrv> it = lstArchiveSrv.iterator(); it
|
||||
// .hasNext();) {
|
||||
// ArchiveSrv archiveSrv = it.next();
|
||||
// String dirLocation = archiveSrv.getArchiveDirectoryLocation();
|
||||
// int execCount = archiveSrv.getExecCount();
|
||||
// String name = archiveSrv.getName();
|
||||
// int numMessagesCopied = archiveSrv.getNumMessagesCopied();
|
||||
// boolean t = archiveSrv.isTeeModeOn();
|
||||
// result += "<IngestSrv><name>" + name + "</name><execCount>"
|
||||
// + execCount + "</execCount><teeModeOn>" + t
|
||||
// + "</teeModeOn>" + "<numCopied>" + numMessagesCopied
|
||||
// + "</numCopied><dirLocation>" + dirLocation
|
||||
// + "</dirLocation></IngestSrv>\n";
|
||||
// }
|
||||
// }
|
||||
// result += "</IngestSrvs>\n";
|
||||
// return result;
|
||||
// }
|
||||
/**
|
||||
* @return the archiveDirectoryLocation
|
||||
*/
|
||||
public String getArchiveDirectoryLocation() {
|
||||
return archiveDirectoryLocation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param archiveDirectoryLocation
|
||||
* the archiveDirectoryLocation to set
|
||||
*/
|
||||
public void setArchiveDirectoryLocation(String archiveDirectoryLocation) {
|
||||
this.archiveDirectoryLocation = archiveDirectoryLocation;
|
||||
lstCommands.add(SET_ARCHIVE_DIR_LOCATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the teeModeOn
|
||||
*/
|
||||
public boolean isTeeModeOn() {
|
||||
return teeModeOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param teeModeOn
|
||||
* the teeModeOn to set
|
||||
*/
|
||||
public void setTeeModeOn(boolean teeModeOn) {
|
||||
lstCommands.add(SET_TEE_MODE);
|
||||
this.teeModeOn = teeModeOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetName
|
||||
*/
|
||||
public String getTargetName() {
|
||||
return targetName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetName
|
||||
* the targetName to set
|
||||
*/
|
||||
public void setTargetName(String targetName) {
|
||||
this.targetName = targetName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the command
|
||||
*/
|
||||
public List<String> getCommands() {
|
||||
return lstCommands;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the startTeeModeCrontab
|
||||
*/
|
||||
public String getStartTeeModeCrontab() {
|
||||
return startTeeModeCrontab;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param startTeeModeCrontab
|
||||
* the startTeeModeCrontab to set
|
||||
*/
|
||||
public void setStartTeeModeCrontab(String startTeeModeCrontab) {
|
||||
this.startTeeModeCrontab = startTeeModeCrontab;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the stopTeeModeCrontab
|
||||
*/
|
||||
public String getStopTeeModeCrontab() {
|
||||
return stopTeeModeCrontab;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stopTeeModeCrontab
|
||||
* the stopTeeModeCrontab to set
|
||||
*/
|
||||
public void setStopTeeModeCrontab(String stopTeeModeCrontab) {
|
||||
this.stopTeeModeCrontab = stopTeeModeCrontab;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the recordLocations
|
||||
*/
|
||||
public String getRecordLocations() {
|
||||
return recordLocations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recordLocations
|
||||
* the recordLocations to set
|
||||
*/
|
||||
public void setRecordLocations(String recordLocations) {
|
||||
this.recordLocations = recordLocations;
|
||||
lstCommands.add(SET_RECORD_LOCATIONS);
|
||||
}
|
||||
|
||||
}
|
|
@ -5,7 +5,6 @@ Bundle-SymbolicName: com.raytheon.edex.meteolib
|
|||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: meteolib.jni,
|
||||
com.raytheon.edex.common,
|
||||
org.jep;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.10.7",
|
||||
com.raytheon.uf.common.status;bundle-version="1.10.7",
|
||||
|
|
|
@ -16,13 +16,13 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174"
|
|||
com.raytheon.uf.common.serialization,
|
||||
org.junit;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.plugin.grid,
|
||||
com.raytheon.uf.edex.topo,
|
||||
com.raytheon.uf.common.topo;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.common,
|
||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
||||
com.raytheon.edex.plugin.satellite;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.auth;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.site;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.site;bundle-version="1.0.0",
|
||||
ucar.nc2;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.parameter;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0"
|
||||
|
|
|
@ -47,7 +47,6 @@ import com.raytheon.uf.common.dataplugin.PluginException;
|
|||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID.DataType;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
|
||||
import com.raytheon.uf.common.site.notify.SendSiteActivationNotifications;
|
||||
import com.raytheon.uf.common.site.notify.SiteActivationNotification;
|
||||
import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONSTATUS;
|
||||
import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONTYPE;
|
||||
|
@ -62,6 +61,7 @@ import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
|||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils.LockState;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||
import com.raytheon.uf.edex.site.ISiteActivationListener;
|
||||
import com.raytheon.uf.edex.site.notify.SendSiteActivationNotifications;
|
||||
|
||||
/**
|
||||
* Activates the GFE server capabilities for a site
|
||||
|
@ -78,6 +78,7 @@ import com.raytheon.uf.edex.site.ISiteActivationListener;
|
|||
* Jul 12, 2012 15162 ryu added check for invalid db at activation
|
||||
* Dec 11, 2012 14360 ryu log a clean message in case of
|
||||
* missing configuration (no stack trace).
|
||||
* Feb 15, 2013 1638 mschenke Moved sending of site notification messages to edex plugin
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -60,7 +60,7 @@ 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.TimeRange;
|
||||
import com.raytheon.uf.edex.topo.TopoQuery;
|
||||
import com.raytheon.uf.common.topo.TopoQuery;
|
||||
|
||||
/**
|
||||
* Manages the TopoDatabase instances of active GFE sites
|
||||
|
@ -73,6 +73,7 @@ import com.raytheon.uf.edex.topo.TopoQuery;
|
|||
* Jul 10, 2009 njensen Initial creation
|
||||
* May 04, 2012 #574 dgilling Re-port to better match AWIPS1.
|
||||
* Feb 12, 2013 #1608 randerso Changed to use explicit deleteGroups
|
||||
* Feb 15, 2013 1638 mschenke Deleted topo edex plugin, moved code into common topo
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -28,7 +28,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.edex.plugin.gfe.cache.d2dparms.D2DParmIdCache;
|
||||
import com.raytheon.edex.plugin.gfe.config.GFESiteActivation;
|
||||
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
|
||||
|
@ -51,6 +50,7 @@ import com.raytheon.uf.common.dataplugin.gfe.server.notify.DBInvChangeNotificati
|
|||
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GfeNotification;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotification;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
|
||||
|
@ -75,6 +75,7 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
|||
* Sep 19, 2012 jdynina DR 15442 fix
|
||||
* Jan 18, 2013 #1504 randerso Moved D2D to GFE parameter name translation from
|
||||
* D2DParmIdCache to GfeIngestNotificationFilter
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -51,7 +51,6 @@ import com.raytheon.edex.plugin.grib.util.GribLevel;
|
|||
import com.raytheon.edex.plugin.grib.util.GribModelLookup;
|
||||
import com.raytheon.edex.plugin.grib.util.GribParameter;
|
||||
import com.raytheon.edex.plugin.grib.util.GridModel;
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.edex.util.grib.Grib1TableMap;
|
||||
import com.raytheon.edex.util.grib.GribParamTranslator;
|
||||
import com.raytheon.edex.util.grib.GribTableLookup;
|
||||
|
@ -81,6 +80,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.DataTime.FLAG;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.util.ArraysUtil;
|
||||
import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
||||
|
||||
/**
|
||||
|
@ -93,6 +93,7 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/11/10 4758 bphillip Initial Creation
|
||||
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -670,13 +671,13 @@ public class Grib1Decoder extends AbstractDecoder {
|
|||
case 0:
|
||||
break;
|
||||
case 64:
|
||||
Util.flipHoriz(data, ny, nx);
|
||||
ArraysUtil.flipHoriz(data, ny, nx);
|
||||
break;
|
||||
case 128:
|
||||
Util.flipVert(data, ny, nx);
|
||||
ArraysUtil.flipVert(data, ny, nx);
|
||||
break;
|
||||
case 192:
|
||||
Util.rotate180(data, ny, nx);
|
||||
ArraysUtil.rotate180(data, ny, nx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import java.util.zip.Inflater;
|
|||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.AbstractDecoder;
|
||||
import com.raytheon.edex.plugin.satellite.dao.SatelliteDao;
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.edex.util.satellite.SatSpatialFactory;
|
||||
import com.raytheon.edex.util.satellite.SatellitePosition;
|
||||
import com.raytheon.edex.util.satellite.SatelliteUnit;
|
||||
|
@ -45,6 +44,7 @@ import com.raytheon.uf.common.dataplugin.satellite.SatelliteMessageData;
|
|||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.util.ArraysUtil;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
||||
|
@ -74,6 +74,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
|||
* 06/27/2012 798 jkorman Using SatelliteMessageData to "carry" the decoded image.
|
||||
* 01/03/2013 15294 D. Friedman Start with File instead of byte[] to
|
||||
* reduce memory usage.
|
||||
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -288,14 +290,14 @@ public class SatelliteDecoder extends AbstractDecoder {
|
|||
// TODO: Can these numbers be an enum or constants?
|
||||
switch (scanMode) {
|
||||
case 1:
|
||||
Util.flipHoriz(tempBytes, ny, nx);
|
||||
ArraysUtil.flipHoriz(tempBytes, ny, nx);
|
||||
break;
|
||||
case 2:
|
||||
Util.flipVert(tempBytes, ny, nx);
|
||||
ArraysUtil.flipVert(tempBytes, ny, nx);
|
||||
break;
|
||||
case 3:
|
||||
Util.flipVert(tempBytes, ny, nx);
|
||||
Util.flipVert(tempBytes, ny, nx);
|
||||
ArraysUtil.flipVert(tempBytes, ny, nx);
|
||||
ArraysUtil.flipVert(tempBytes, ny, nx);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -17,7 +17,9 @@ Require-Bundle: org.apache.activemq,
|
|||
com.raytheon.uf.common.status,
|
||||
javax.measure;bundle-version="1.0.0",
|
||||
javax.jms;bundle-version="1.0.0",
|
||||
org.apache.http;bundle-version="4.1.1"
|
||||
org.apache.http;bundle-version="4.1.1",
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||
org.apache.velocity;bundle-version="1.7.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.edex.uengine,
|
||||
com.raytheon.edex.uengine.exception,
|
||||
|
@ -30,7 +32,6 @@ Export-Package: com.raytheon.edex.uengine,
|
|||
Import-Package: com.raytheon.edex.colormap,
|
||||
com.raytheon.edex.exception,
|
||||
com.raytheon.edex.msg,
|
||||
com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.edex.uengine.exception,
|
||||
com.raytheon.edex.util,
|
||||
com.raytheon.edex.utility,
|
||||
|
|
|
@ -22,9 +22,10 @@ package com.raytheon.edex.uengine.web;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.edex.scriptfactory.ScriptFactory;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.util.velocity.VelocityManager;
|
||||
import com.raytheon.uf.edex.core.props.EnvProperties;
|
||||
import com.raytheon.uf.edex.core.props.PropertiesFactory;
|
||||
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.uf.edex.core.props.PropertiesFactory;
|
|||
* 05/10/07 #273 brockwoo Updated script generation to
|
||||
* Javascript
|
||||
* 11/27/07 #214 brockwoo Added colormap capability to radar
|
||||
* Feb 18, 2013 1638 mschenke Moved ScriptFactory code into common VelocityManager class
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -102,9 +104,16 @@ public class ScriptTestDriver {
|
|||
if (properties != null) {
|
||||
logDir = properties.getEnvValue("LOGDIR");
|
||||
}
|
||||
script = ScriptFactory.getInstance().createScript(DEFAULT_TEMPLATE,
|
||||
DEFAULT_TEMPLATE.getParentFile(), maxRecords, engine,
|
||||
library, queryTerms, logDir);
|
||||
|
||||
Map<String, Object> templateObjects = new HashMap<String, Object>();
|
||||
templateObjects.put("scriptMetadata", queryTerms);
|
||||
templateObjects.put("maxRecords", maxRecords);
|
||||
templateObjects.put("scriptLibrary", library);
|
||||
templateObjects.put("mode", engine);
|
||||
|
||||
script = VelocityManager.executeTemplate(DEFAULT_TEMPLATE,
|
||||
DEFAULT_TEMPLATE.getParentFile(), new File(logDir),
|
||||
templateObjects);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error creating script for " + library);
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -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.common.colormap;
|
||||
|
||||
import java.awt.image.IndexColorModel;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Common utilities for colormaps
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2013 1638 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ColorMapUtils {
|
||||
|
||||
public static final int COLOR_MODEL_NUMBER_BITS = 8;
|
||||
|
||||
public static final float MAX_VALUE = 255.0f;
|
||||
|
||||
/**
|
||||
* Builds a color model from a color map
|
||||
*
|
||||
* @param aColorMap
|
||||
* @return
|
||||
*/
|
||||
public static IndexColorModel buildColorModel(IColorMap aColorMap) {
|
||||
int size = aColorMap.getSize();
|
||||
byte[] red = new byte[size];
|
||||
byte[] green = new byte[size];
|
||||
byte[] blue = new byte[size];
|
||||
byte[] alpha = new byte[size];
|
||||
|
||||
List<Color> colors = aColorMap.getColors();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
Color color = colors.get(i);
|
||||
red[i] = (byte) (color.getRed() * MAX_VALUE);
|
||||
green[i] = (byte) (color.getGreen() * MAX_VALUE);
|
||||
blue[i] = (byte) (color.getBlue() * MAX_VALUE);
|
||||
alpha[i] = (byte) (color.getAlpha() * MAX_VALUE);
|
||||
}
|
||||
|
||||
return new IndexColorModel(COLOR_MODEL_NUMBER_BITS, size, red, green, blue, alpha);
|
||||
}
|
||||
|
||||
}
|
|
@ -31,13 +31,13 @@ import javax.persistence.Id;
|
|||
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
* GridDataHistory
|
||||
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.time.TimeRange;
|
|||
* randerso Initial creation
|
||||
* 02/27/2008 879 rbell Added clone()
|
||||
* 04/18/2008 #875 bphillip Changed date fields to use java.util.Calendar
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.getUnixTime into TimeUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -417,33 +418,33 @@ public class GridDataHistory implements Cloneable, Serializable,
|
|||
|
||||
buffer.append(this.origin.ordinal()).append(" ");
|
||||
buffer.append(this.originParm.toString()).append(" ");
|
||||
buffer.append(Util.getUnixTime(this.originTimeRange.getStart()))
|
||||
buffer.append(TimeUtil.getUnixTime(this.originTimeRange.getStart()))
|
||||
.append(" ");
|
||||
buffer.append(Util.getUnixTime(this.originTimeRange.getEnd())).append(
|
||||
buffer.append(TimeUtil.getUnixTime(this.originTimeRange.getEnd())).append(
|
||||
" ");
|
||||
|
||||
if (this.timeModified == null) {
|
||||
buffer.append("0");
|
||||
} else if (Util.getUnixTime(this.timeModified) == 0) {
|
||||
} else if (TimeUtil.getUnixTime(this.timeModified) == 0) {
|
||||
buffer.append("0");
|
||||
} else {
|
||||
buffer.append(Util.getUnixTime(this.timeModified)).append(" ");
|
||||
buffer.append(TimeUtil.getUnixTime(this.timeModified)).append(" ");
|
||||
buffer.append(this.whoModified);
|
||||
}
|
||||
if (this.updateTime == null) {
|
||||
buffer.append(" 0");
|
||||
} else {
|
||||
buffer.append(" ").append(Util.getUnixTime(this.updateTime));
|
||||
buffer.append(" ").append(TimeUtil.getUnixTime(this.updateTime));
|
||||
}
|
||||
if (this.publishTime == null) {
|
||||
buffer.append(" 0");
|
||||
} else {
|
||||
buffer.append(" ").append(Util.getUnixTime(this.publishTime));
|
||||
buffer.append(" ").append(TimeUtil.getUnixTime(this.publishTime));
|
||||
}
|
||||
if (this.lastSentTime == null) {
|
||||
buffer.append(" 0");
|
||||
} else {
|
||||
buffer.append(" ").append(Util.getUnixTime(this.lastSentTime));
|
||||
buffer.append(" ").append(TimeUtil.getUnixTime(this.lastSentTime));
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
|
|
|
@ -61,5 +61,4 @@ Import-Package: com.raytheon.edex.exception,
|
|||
javax.measure.converter,
|
||||
javax.persistence,
|
||||
org.apache.commons.logging,
|
||||
org.apache.tools.bzip2,
|
||||
org.opengis.referencing.crs
|
||||
|
|
|
@ -15,6 +15,7 @@ Import-Package: com.raytheon.uf.common.time,
|
|||
Export-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.annotations,
|
||||
com.raytheon.uf.common.dataplugin.defaults,
|
||||
com.raytheon.uf.common.dataplugin.message,
|
||||
com.raytheon.uf.common.dataplugin.persist,
|
||||
com.raytheon.uf.common.dataplugin.request
|
||||
Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.msg;
|
||||
package com.raytheon.uf.common.dataplugin.message;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
@ -30,7 +30,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 2, 2008 chammack Initial creation
|
||||
* Sep 2, 2008 chammack Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved from com.raytheon.edex.common project
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.msg;
|
||||
package com.raytheon.uf.common.dataplugin.message;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
|
@ -30,7 +30,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 2, 2008 chammack Initial creation
|
||||
* Sep 2, 2008 chammack Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved from com.raytheon.edex.common project
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
|
@ -8,8 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Eclipse-BuddyPolicy: registered, ext, global
|
||||
Import-Package: com.raytheon.edex.scriptfactory,
|
||||
com.raytheon.uf.common.comm,
|
||||
Import-Package: com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.dataplugin.level,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.annotations,
|
||||
|
|
|
@ -11,8 +11,7 @@ Require-Bundle: com.facebook.thrift,
|
|||
javax.persistence,
|
||||
org.geotools,
|
||||
javax.measure;resolution:=optional,
|
||||
com.raytheon.uf.common.util,
|
||||
org.apache.commons.codec;bundle-version="1.4.0"
|
||||
com.raytheon.uf.common.util
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.adapters,
|
||||
|
|
|
@ -33,7 +33,7 @@ except:
|
|||
fastbinary = None
|
||||
|
||||
|
||||
class com_raytheon_edex_msg_DataURINotificationMessage:
|
||||
class com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage:
|
||||
"""
|
||||
Attributes:
|
||||
- dataURIs
|
||||
|
@ -88,7 +88,7 @@ class com_raytheon_edex_msg_DataURINotificationMessage:
|
|||
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
||||
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
||||
return
|
||||
oprot.writeStructBegin('com_raytheon_edex_msg_DataURINotificationMessage')
|
||||
oprot.writeStructBegin('com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage')
|
||||
if self.dataURIs != None:
|
||||
oprot.writeFieldBegin('dataURIs', TType.LIST, 1)
|
||||
oprot.writeListBegin(TType.STRING, len(self.dataURIs))
|
||||
|
|
|
@ -30,7 +30,7 @@ f = open("/tmp/testSerialization")
|
|||
trans = thrift.transport.TTransport.TFileObjectTransport(f)
|
||||
proto = SelfDescribingBinaryProtocol.SelfDescribingBinaryProtocol(trans)
|
||||
print proto.readMessageBegin()
|
||||
s = NotificationMessage.ttypes.com_raytheon_edex_msg_DataURINotificationMessage()
|
||||
s = NotificationMessage.ttypes.com_raytheon_uf_common_dataplugin_message_DataURINotificationMessage()
|
||||
s.read(proto)
|
||||
print s
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.12.1130",
|
|||
com.raytheon.uf.common.status;bundle-version="1.12.1130",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1130",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.core;bundle-version="1.12.1174"
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174"
|
||||
Export-Package: com.raytheon.uf.common.site,
|
||||
com.raytheon.uf.common.site.ingest,
|
||||
com.raytheon.uf.common.site.notify,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.util;
|
||||
package com.raytheon.uf.common.sounding.util;
|
||||
|
||||
import static java.lang.Math.abs;
|
||||
import static java.lang.Math.exp;
|
||||
|
@ -31,6 +31,23 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Common utility functions for UA Soundings
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2013 1638 mschenke Moved from edex.common util package
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class Equations {
|
||||
public interface VaporPressure {
|
||||
double es(double temperature);
|
|
@ -17,28 +17,28 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.topo;
|
||||
|
||||
package com.raytheon.uf.common.sounding.util;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* Class to represent Upper Air point
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 25, 2010 randerso Initial creation
|
||||
*
|
||||
* Feb 15, 2013 1638 mschenke Moved from edex.common util package
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UAPoint {
|
||||
|
||||
public class StatusConstants {
|
||||
public static final String PLUGIN_ID = StatusConstants.class.getPackage()
|
||||
.getName();
|
||||
public double pressure;
|
||||
|
||||
public static final String CATEGORY_TOPO = "TOPO";
|
||||
public double temperature;
|
||||
}
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.common.time.domain.api.ITimePoint;
|
|||
* Jan 22, 2013 1484 mpduff Add HOURS_PER_WEEK.
|
||||
* Jan 22, 2013 1519 djohnson Add MINUTES_PER_DAY.
|
||||
* Feb 26, 2013 1597 randerso Add SECONDS_PER_HOUR.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.getUnixTime into TimeUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -394,6 +395,20 @@ public final class TimeUtil {
|
|||
return calendar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns UNIX time for a Date, this is time in seconds instead of millis
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static long getUnixTime(Date date) {
|
||||
if (date == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return date.getTime() / 1000l;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disabled constructor.
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|||
Require-Bundle: com.raytheon.uf.common.datastorage;bundle-version="1.11.17",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.11.17",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.11.17",
|
||||
org.geotools;bundle-version="2.5.8"
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
||||
Export-Package: com.raytheon.uf.common.topo
|
||||
Import-Package: com.raytheon.uf.common.serialization.comm
|
||||
|
|
|
@ -1,71 +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.common.topo;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Interface for topo query
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface ITopoQuery {
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level for the specified
|
||||
* coordinate.
|
||||
*
|
||||
* @param coord
|
||||
* should contain lon/lat in degrees
|
||||
* @return
|
||||
*/
|
||||
public double getHeight(Coordinate coord);
|
||||
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level for the specified
|
||||
* coordinates.
|
||||
*
|
||||
* @param coords
|
||||
* should contain lon/lat in degrees
|
||||
* @return
|
||||
*/
|
||||
public double[] getHeight(Coordinate[] coords);
|
||||
|
||||
/**
|
||||
* Retrieves topo height in meters above mean sea level reprojected and
|
||||
* interpolated to the specified grid geometry.
|
||||
*
|
||||
* @param targetGeom
|
||||
* @return the topo data array in row major order
|
||||
*/
|
||||
public float[] getHeight(GridGeometry2D targetGeom);
|
||||
}
|
|
@ -17,11 +17,42 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.util;
|
||||
package com.raytheon.uf.common.topo;
|
||||
|
||||
public class UAPoint {
|
||||
/**
|
||||
* Exception for Topo
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2013 1638 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public double pressure;
|
||||
public class TopoException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 7092944265178932711L;
|
||||
|
||||
public TopoException() {
|
||||
}
|
||||
|
||||
public TopoException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public TopoException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public TopoException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public double temperature;
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.topo;
|
||||
package com.raytheon.uf.common.topo;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
|
@ -64,10 +64,6 @@ import com.raytheon.uf.common.geospatial.MapUtil;
|
|||
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.topo.ITopoQuery;
|
||||
import com.raytheon.uf.edex.core.EdexException;
|
||||
import com.raytheon.uf.edex.core.props.EnvProperties;
|
||||
import com.raytheon.uf.edex.core.props.PropertiesFactory;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -89,6 +85,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 03/09/2012 DR 14581 D. Friedman Fix grid referencing and use custom
|
||||
* nearest-neighbor resampling.i
|
||||
* 01/14/2013 #1469 bkowal Removed the hdf5 data directory.
|
||||
* Feb 15, 2013 1638 mschenke Moved from edex.topo project (not edex specific)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -96,13 +93,14 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class TopoQuery implements ITopoQuery {
|
||||
public class TopoQuery {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(TopoQuery.class);
|
||||
|
||||
private static final String TOPO_FILE = "/topo/srtm30.hdf";
|
||||
|
||||
private static final int TOPO_LIMIT = 4096 * 4096;;
|
||||
private static final int TOPO_LIMIT = 4096 * 4096;
|
||||
|
||||
private static Map<Integer, TopoQuery> topoQueryMap;
|
||||
|
||||
|
@ -131,7 +129,7 @@ public class TopoQuery implements ITopoQuery {
|
|||
try {
|
||||
query = new TopoQuery(hdf5File, topoLevel);
|
||||
topoQueryMap.put(topoLevel, query);
|
||||
} catch (EdexException e) {
|
||||
} catch (TopoException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
@ -163,17 +161,17 @@ public class TopoQuery implements ITopoQuery {
|
|||
|
||||
private int numLevels;
|
||||
|
||||
TopoQuery(File hdf5File) throws EdexException {
|
||||
TopoQuery(File hdf5File) throws TopoException {
|
||||
this(hdf5File, 0);
|
||||
}
|
||||
|
||||
TopoQuery(File hdf5File, int level) throws EdexException {
|
||||
TopoQuery(File hdf5File, int level) throws TopoException {
|
||||
this.topoLevel = level;
|
||||
this.hdf5File = hdf5File;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() throws EdexException {
|
||||
private void init() throws TopoException {
|
||||
dmtf = new DefaultMathTransformFactory();
|
||||
dataStore = DataStoreFactory.getDataStore(hdf5File);
|
||||
numLevels = getNumLevels();
|
||||
|
@ -266,7 +264,7 @@ public class TopoQuery implements ITopoQuery {
|
|||
null);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new EdexException("Error initializing TopoQuery from "
|
||||
throw new TopoException("Error initializing TopoQuery from "
|
||||
+ hdf5File.getAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
|
@ -548,13 +546,15 @@ public class TopoQuery implements ITopoQuery {
|
|||
double[] crsCorners = new double[worldCorners.length];
|
||||
GeneralEnvelope env = new GeneralEnvelope(2);
|
||||
if (worldCorners[2] > worldGeomPM.getGridRange().getHigh(0) + 1) {
|
||||
worldGeomDL.getGridToCRS(PixelInCell.CELL_CORNER).transform(worldCorners, 0,
|
||||
crsCorners, 0, worldCorners.length / 2);
|
||||
worldGeomDL.getGridToCRS(PixelInCell.CELL_CORNER)
|
||||
.transform(worldCorners, 0, crsCorners, 0,
|
||||
worldCorners.length / 2);
|
||||
env.setCoordinateReferenceSystem(worldGeomDL.getEnvelope()
|
||||
.getCoordinateReferenceSystem());
|
||||
} else {
|
||||
worldGeomPM.getGridToCRS(PixelInCell.CELL_CORNER).transform(worldCorners, 0,
|
||||
crsCorners, 0, worldCorners.length / 2);
|
||||
worldGeomPM.getGridToCRS(PixelInCell.CELL_CORNER)
|
||||
.transform(worldCorners, 0, crsCorners, 0,
|
||||
worldCorners.length / 2);
|
||||
env.setCoordinateReferenceSystem(worldGeomPM.getEnvelope()
|
||||
.getCoordinateReferenceSystem());
|
||||
}
|
||||
|
@ -713,102 +713,117 @@ public class TopoQuery implements ITopoQuery {
|
|||
|
||||
return simpleResample(baseGC, topoValues, targetGeom);
|
||||
}
|
||||
|
||||
float[] simpleResample(GridCoverage2D sourceGC, float[][] sourceData, GridGeometry2D targetGG) {
|
||||
int sourceWidth = sourceGC.getGridGeometry().getGridRange2D().getSpan(0);
|
||||
int sourceHeight = sourceGC.getGridGeometry().getGridRange2D().getSpan(1);
|
||||
int targetWidth = targetGG.getGridRange2D().getSpan(0);
|
||||
int targetHeight = targetGG.getGridRange2D().getSpan(1);
|
||||
float[] output = new float[targetWidth * targetHeight];
|
||||
Arrays.fill(output, Float.NaN);
|
||||
|
||||
ArrayList<MathTransform> transforms = new ArrayList<MathTransform>();
|
||||
ArrayList<MathTransform> toGeoXforms = new ArrayList<MathTransform>();
|
||||
ArrayList<MathTransform> sourceToGeoXforms = new ArrayList<MathTransform>();
|
||||
float[] simpleResample(GridCoverage2D sourceGC, float[][] sourceData,
|
||||
GridGeometry2D targetGG) {
|
||||
int sourceWidth = sourceGC.getGridGeometry().getGridRange2D()
|
||||
.getSpan(0);
|
||||
int sourceHeight = sourceGC.getGridGeometry().getGridRange2D()
|
||||
.getSpan(1);
|
||||
int targetWidth = targetGG.getGridRange2D().getSpan(0);
|
||||
int targetHeight = targetGG.getGridRange2D().getSpan(1);
|
||||
float[] output = new float[targetWidth * targetHeight];
|
||||
Arrays.fill(output, Float.NaN);
|
||||
|
||||
MathTransform targetGtoCRS = targetGG.getGridToCRS(PixelInCell.CELL_CENTER);
|
||||
MathTransform sourceCRStoG = sourceGC.getGridGeometry().getCRSToGrid2D(PixelOrientation.CENTER);
|
||||
CoordinateReferenceSystem targetCRS = targetGG.getCoordinateReferenceSystem();
|
||||
CoordinateReferenceSystem sourceCRS = sourceGC.getCoordinateReferenceSystem();
|
||||
|
||||
transforms.add(targetGtoCRS);
|
||||
if (! CRS.equalsIgnoreMetadata(sourceCRS, targetCRS)) {
|
||||
GeographicCRS sourceGeoCRS = null;
|
||||
GeographicCRS targetGeoCRS = null;
|
||||
if (sourceCRS instanceof ProjectedCRS) {
|
||||
sourceGeoCRS = ((ProjectedCRS) sourceCRS).getBaseCRS();
|
||||
}
|
||||
if (targetCRS instanceof ProjectedCRS) {
|
||||
targetGeoCRS = ((ProjectedCRS) targetCRS).getBaseCRS();
|
||||
}
|
||||
try {
|
||||
transforms.add(CRS.findMathTransform(targetCRS, targetGeoCRS, true));
|
||||
toGeoXforms.addAll(transforms);
|
||||
if (CRS.equalsIgnoreMetadata(sourceGeoCRS, targetGeoCRS)) {
|
||||
// nothing...
|
||||
} else {
|
||||
transforms.add(CRS.findMathTransform(targetGeoCRS, sourceGeoCRS));
|
||||
}
|
||||
transforms.add(CRS.findMathTransform(sourceGeoCRS, sourceCRS, true));
|
||||
sourceToGeoXforms.add(0, CRS.findMathTransform(sourceCRS, sourceGeoCRS));
|
||||
} catch (FactoryException e) {
|
||||
statusHandler.error(e.getMessage(), e);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
transforms.add(sourceCRStoG);
|
||||
sourceToGeoXforms.add(0, sourceGC.getGridGeometry().getGridToCRS(PixelInCell.CELL_CENTER));
|
||||
ArrayList<MathTransform> transforms = new ArrayList<MathTransform>();
|
||||
ArrayList<MathTransform> toGeoXforms = new ArrayList<MathTransform>();
|
||||
ArrayList<MathTransform> sourceToGeoXforms = new ArrayList<MathTransform>();
|
||||
|
||||
MathTransform mt;
|
||||
try {
|
||||
mt = concatenateTransforms(transforms);
|
||||
} catch (FactoryException e) {
|
||||
statusHandler.error(e.getMessage(), e);
|
||||
return output;
|
||||
}
|
||||
|
||||
double[] coord = new double[2];
|
||||
for (int y = 0; y < targetHeight; ++y) {
|
||||
for (int x = 0; x < targetWidth; ++x) {
|
||||
coord[0] = x;
|
||||
coord[1] = y;
|
||||
try {
|
||||
mt.transform(coord, 0, coord, 0, 1);
|
||||
} catch (TransformException e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int sx = (int) Math.round(coord[0]);
|
||||
int sy = (int) Math.round(coord[1]);
|
||||
if (sx >= 0 && sx < sourceWidth && sy >= 0 && sy < sourceHeight)
|
||||
output[y * targetWidth + x] = sourceData[sy][sx];
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
MathTransform targetGtoCRS = targetGG
|
||||
.getGridToCRS(PixelInCell.CELL_CENTER);
|
||||
MathTransform sourceCRStoG = sourceGC.getGridGeometry().getCRSToGrid2D(
|
||||
PixelOrientation.CENTER);
|
||||
CoordinateReferenceSystem targetCRS = targetGG
|
||||
.getCoordinateReferenceSystem();
|
||||
CoordinateReferenceSystem sourceCRS = sourceGC
|
||||
.getCoordinateReferenceSystem();
|
||||
|
||||
transforms.add(targetGtoCRS);
|
||||
if (!CRS.equalsIgnoreMetadata(sourceCRS, targetCRS)) {
|
||||
GeographicCRS sourceGeoCRS = null;
|
||||
GeographicCRS targetGeoCRS = null;
|
||||
if (sourceCRS instanceof ProjectedCRS) {
|
||||
sourceGeoCRS = ((ProjectedCRS) sourceCRS).getBaseCRS();
|
||||
}
|
||||
if (targetCRS instanceof ProjectedCRS) {
|
||||
targetGeoCRS = ((ProjectedCRS) targetCRS).getBaseCRS();
|
||||
}
|
||||
try {
|
||||
transforms.add(CRS.findMathTransform(targetCRS, targetGeoCRS,
|
||||
true));
|
||||
toGeoXforms.addAll(transforms);
|
||||
if (CRS.equalsIgnoreMetadata(sourceGeoCRS, targetGeoCRS)) {
|
||||
// nothing...
|
||||
} else {
|
||||
transforms.add(CRS.findMathTransform(targetGeoCRS,
|
||||
sourceGeoCRS));
|
||||
}
|
||||
transforms.add(CRS.findMathTransform(sourceGeoCRS, sourceCRS,
|
||||
true));
|
||||
sourceToGeoXforms.add(0,
|
||||
CRS.findMathTransform(sourceCRS, sourceGeoCRS));
|
||||
} catch (FactoryException e) {
|
||||
statusHandler.error(e.getMessage(), e);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
transforms.add(sourceCRStoG);
|
||||
sourceToGeoXforms.add(0,
|
||||
sourceGC.getGridGeometry()
|
||||
.getGridToCRS(PixelInCell.CELL_CENTER));
|
||||
|
||||
MathTransform mt;
|
||||
try {
|
||||
mt = concatenateTransforms(transforms);
|
||||
} catch (FactoryException e) {
|
||||
statusHandler.error(e.getMessage(), e);
|
||||
return output;
|
||||
}
|
||||
|
||||
double[] coord = new double[2];
|
||||
for (int y = 0; y < targetHeight; ++y) {
|
||||
for (int x = 0; x < targetWidth; ++x) {
|
||||
coord[0] = x;
|
||||
coord[1] = y;
|
||||
try {
|
||||
mt.transform(coord, 0, coord, 0, 1);
|
||||
} catch (TransformException e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int sx = (int) Math.round(coord[0]);
|
||||
int sy = (int) Math.round(coord[1]);
|
||||
if (sx >= 0 && sx < sourceWidth && sy >= 0 && sy < sourceHeight)
|
||||
output[y * targetWidth + x] = sourceData[sy][sx];
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
private static MathTransform concatenateTransforms(ArrayList<MathTransform> transforms) throws FactoryException {
|
||||
Hints hints = new Hints();
|
||||
final CoordinateOperationFactory factory =
|
||||
ReferencingFactoryFinder.getCoordinateOperationFactory(hints);
|
||||
final MathTransformFactory mtFactory;
|
||||
if (factory instanceof AbstractCoordinateOperationFactory) {
|
||||
mtFactory = ((AbstractCoordinateOperationFactory) factory).getMathTransformFactory();
|
||||
} else {
|
||||
mtFactory = ReferencingFactoryFinder.getMathTransformFactory(hints);
|
||||
}
|
||||
|
||||
MathTransform mt = null;
|
||||
for (MathTransform mti : transforms) {
|
||||
if (mt == null)
|
||||
mt = mti;
|
||||
else {
|
||||
mt = mtFactory.createConcatenatedTransform(mt, mti);
|
||||
}
|
||||
}
|
||||
|
||||
return mt != null ? mt : IdentityTransform.create(2);
|
||||
|
||||
private static MathTransform concatenateTransforms(
|
||||
ArrayList<MathTransform> transforms) throws FactoryException {
|
||||
Hints hints = new Hints();
|
||||
final CoordinateOperationFactory factory = ReferencingFactoryFinder
|
||||
.getCoordinateOperationFactory(hints);
|
||||
final MathTransformFactory mtFactory;
|
||||
if (factory instanceof AbstractCoordinateOperationFactory) {
|
||||
mtFactory = ((AbstractCoordinateOperationFactory) factory)
|
||||
.getMathTransformFactory();
|
||||
} else {
|
||||
mtFactory = ReferencingFactoryFinder.getMathTransformFactory(hints);
|
||||
}
|
||||
|
||||
MathTransform mt = null;
|
||||
for (MathTransform mti : transforms) {
|
||||
if (mt == null)
|
||||
mt = mti;
|
||||
else {
|
||||
mt = mtFactory.createConcatenatedTransform(mt, mti);
|
||||
}
|
||||
}
|
||||
|
||||
return mt != null ? mt : IdentityTransform.create(2);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,96 +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.common.topo;
|
||||
|
||||
import org.geotools.coverage.grid.GridGeometry2D;
|
||||
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 10, 2009 mschenke Initial creation
|
||||
* Jan 05, 2010 #3962 randerso added support for grid requests
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class TopoQueryRequest implements IServerRequest {
|
||||
|
||||
@DynamicSerializeElement
|
||||
private int level = 0;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private boolean useCaching = false;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private Coordinate[] coordinates;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private GridGeometry2D gridGeometry;
|
||||
|
||||
public TopoQueryRequest() {
|
||||
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public boolean isUseCaching() {
|
||||
return useCaching;
|
||||
}
|
||||
|
||||
public void setUseCaching(boolean useCaching) {
|
||||
this.useCaching = useCaching;
|
||||
}
|
||||
|
||||
public Coordinate[] getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(Coordinate[] coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public GridGeometry2D getGridGeometry() {
|
||||
return gridGeometry;
|
||||
}
|
||||
|
||||
public void setGridGeometry(GridGeometry2D targetGeom) {
|
||||
this.gridGeometry = targetGeom;
|
||||
}
|
||||
|
||||
}
|
|
@ -17,13 +17,30 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.util;
|
||||
package com.raytheon.uf.common.units;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.measure.unit.UnitFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* Unit converter class
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2013 1638 mschenke Moved from edex.common util package
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UnitConv {
|
||||
|
||||
public static Unit<?> deserializer(String unit) throws ParseException {
|
|
@ -8,12 +8,13 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|||
Require-Bundle: org.junit;bundle-version="1.0.0",
|
||||
org.apache.commons.beanutils;bundle-version="1.8.3",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
org.apache.commons.lang;bundle-version="2.3.0"
|
||||
org.apache.commons.lang;bundle-version="2.3.0",
|
||||
org.apache.velocity;bundle-version="1.7.0"
|
||||
Export-Package: com.raytheon.uf.common.util,
|
||||
com.raytheon.uf.common.util.algorithm,
|
||||
com.raytheon.uf.common.util.cache,
|
||||
com.raytheon.uf.common.util.header,
|
||||
com.raytheon.uf.common.util.mapping,
|
||||
com.raytheon.uf.common.util.registry,
|
||||
com.raytheon.uf.common.util.session
|
||||
Import-Package: org.apache.commons.lang
|
||||
com.raytheon.uf.common.util.session,
|
||||
com.raytheon.uf.common.util.velocity
|
||||
|
|
|
@ -0,0 +1,267 @@
|
|||
/**
|
||||
* 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.common.util;
|
||||
|
||||
/**
|
||||
* Array operation utilities
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2013 1638 mschenke Functions moved from edex.common Util
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ArraysUtil {
|
||||
|
||||
/**
|
||||
* Flip double array along a horizontal line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] flipHoriz(double[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[y - i - 1][j] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip double array along a vertical line
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] flipVert(double[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[i][x - j - 1] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a horizontal line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(float[][] baseArray) {
|
||||
|
||||
float temp;
|
||||
int height = baseArray[0].length;
|
||||
int width = baseArray.length;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i][j];
|
||||
baseArray[i][j] = baseArray[i][width - j - 1];
|
||||
baseArray[i][width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate 180 degrees.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void rotate180(float[] baseArray, int height, int width) {
|
||||
|
||||
int counter = 0;
|
||||
int total = height * width;
|
||||
float temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[counter];
|
||||
baseArray[counter] = baseArray[total - counter - 1];
|
||||
baseArray[total - counter - 1] = temp;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip along a vertical
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipVert(float[] baseArray, int height, int width) {
|
||||
|
||||
float temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i * width + j];
|
||||
baseArray[i * width + j] = baseArray[i * width + width - j - 1];
|
||||
baseArray[i * width + width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(float[] baseArray, int height, int width) {
|
||||
|
||||
float temp = 0;
|
||||
|
||||
for (int i = 0; i < height / 2; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
temp = baseArray[j + width * i];
|
||||
baseArray[j + width * i] = baseArray[j + width
|
||||
* (height - i - 1)];
|
||||
baseArray[j + width * (height - i - 1)] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip along a vertical
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipVert(byte[] baseArray, int height, int width) {
|
||||
|
||||
byte temp;
|
||||
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width / 2; j++) {
|
||||
temp = baseArray[i * width + j];
|
||||
baseArray[i * width + j] = baseArray[i * width + width - j - 1];
|
||||
baseArray[i * width + width - j - 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line.
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static void flipHoriz(byte[] baseArray, int height, int width) {
|
||||
|
||||
byte temp = 0;
|
||||
|
||||
for (int i = 0; i < height / 2; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
temp = baseArray[j + width * i];
|
||||
baseArray[j + width * i] = baseArray[j + width
|
||||
* (height - i - 1)];
|
||||
baseArray[j + width * (height - i - 1)] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip float array along a vertical line
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static float[][] flipVert(float[][] baseArray) {
|
||||
|
||||
int y = baseArray.length;
|
||||
int x = baseArray[0].length;
|
||||
float[][] returnVal = new float[y][x];
|
||||
|
||||
for (int i = 0; i < y; i++) {
|
||||
for (int j = 0; j < x; j++) {
|
||||
returnVal[i][x - j - 1] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate double array 90 degrees to the right
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] rotateRight(double[][] baseArray) {
|
||||
|
||||
int y = baseArray[0].length;
|
||||
int x = baseArray.length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < x; i++) {
|
||||
for (int j = 0; j < y; j++) {
|
||||
returnVal[j][x - 1 - i] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate a double array 90 degrees to the left
|
||||
*
|
||||
* @param baseArray
|
||||
* @return
|
||||
*/
|
||||
public static double[][] rotateLeft(double[][] baseArray) {
|
||||
|
||||
int y = baseArray[0].length;
|
||||
int x = baseArray.length;
|
||||
double[][] returnVal = new double[y][x];
|
||||
|
||||
for (int i = 0; i < x; i++) {
|
||||
for (int j = 0; j < y; j++) {
|
||||
returnVal[y - j - 1][i] = baseArray[i][j];
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -53,6 +53,7 @@ import java.util.zip.GZIPOutputStream;
|
|||
* Jul 06, 2012 798 jkorman Added more robust {@link #copyFile}. Added methods
|
||||
* to create temporary directories and files.
|
||||
* 02/15/2013 #1597 randerso Fixed error when copying empty files
|
||||
* Feb 15, 2013 1638 mschenke Moved EOL field from edex.common Util
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -69,6 +70,11 @@ public class FileUtil {
|
|||
|
||||
public final static String fileSeparatorRegex = "[/\\\\]";
|
||||
|
||||
/**
|
||||
* Easy reference to system-dependent end of line
|
||||
*/
|
||||
public static final String EOL = System.getProperty("line.separator");
|
||||
|
||||
/**
|
||||
* Joins one or more path components into a single path string. Path
|
||||
* components are separated by the operating system dependent
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.util.ArrayList;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 26, 2011 njensen Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved GRID_FILL_VALUE from edex.common Util
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -40,6 +41,13 @@ import java.util.ArrayList;
|
|||
*/
|
||||
|
||||
public class GridUtil {
|
||||
|
||||
|
||||
/**
|
||||
* Moved from edex common util to clean up dependencies. Still need to
|
||||
* figure out method for handling fill values and update
|
||||
*/
|
||||
public static final float GRID_FILL_VALUE = -999999f;
|
||||
|
||||
/**
|
||||
* Bresenham's algorithm to determine closest points along a line on a grid.
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.edex.util;
|
||||
package com.raytheon.uf.common.util;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Math utility functions
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -28,6 +28,7 @@ package com.raytheon.edex.util;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 27, 2009 randerso Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved from edex.common util package
|
||||
*
|
||||
* </pre>
|
||||
*
|
|
@ -0,0 +1,137 @@
|
|||
/**
|
||||
* 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.common.util.velocity;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
import org.apache.velocity.app.Velocity;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
|
||||
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
|
||||
/**
|
||||
* Apache Velocity manager/executor class
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 18, 2013 1638 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class VelocityManager {
|
||||
|
||||
private static Map<Object, VelocityEngine> engines = new HashMap<Object, VelocityEngine>();
|
||||
|
||||
/**
|
||||
* Execute the velocity template designated by vmFile
|
||||
*
|
||||
* @param vmFile
|
||||
* @param logDir
|
||||
* @param templateObjects
|
||||
* @return
|
||||
*/
|
||||
public static String executeTemplate(File vmFile, File logDir,
|
||||
Map<String, Object> templateObjects) {
|
||||
return executeTemplate(vmFile, vmFile.getParentFile(), logDir,
|
||||
templateObjects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the velocity template designated by vmFile
|
||||
*
|
||||
* @param vmFile
|
||||
* @param globalTemplateDir
|
||||
* @param logDir
|
||||
* @param templateObjects
|
||||
* @return
|
||||
*/
|
||||
public static String executeTemplate(File vmFile, File globalTemplateDir,
|
||||
File logDir, Map<String, Object> templateObjects) {
|
||||
Object key = vmFile.getAbsolutePath() + "::"
|
||||
+ globalTemplateDir.getAbsolutePath();
|
||||
VelocityEngine engine = null;
|
||||
synchronized (engines) {
|
||||
engine = engines.get(key);
|
||||
if (engine == null) {
|
||||
engine = new VelocityEngine();
|
||||
Properties p = new Properties();
|
||||
String scriptDir = globalTemplateDir.getAbsolutePath();
|
||||
String rootsToCheck = scriptDir;
|
||||
for (File root : File.listRoots()) {
|
||||
rootsToCheck += "," + root.getAbsolutePath();
|
||||
}
|
||||
p.setProperty("file.resource.loader.class",
|
||||
FileResourceLoader.class.getName());
|
||||
p.setProperty("file.resource.loader.path", rootsToCheck);
|
||||
p.setProperty("velocimacro.permissions.allowInline", "true");
|
||||
p.setProperty(
|
||||
"velocimacro.permissions.allow.inline.to.replace.global",
|
||||
"true");
|
||||
p.setProperty("runtime.log",
|
||||
FileUtil.join(logDir.getAbsolutePath(), "velocity.log"));
|
||||
engine.init(p);
|
||||
engines.put(key, engine);
|
||||
}
|
||||
}
|
||||
return executeTemplate(vmFile, templateObjects, engine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the velocity template designated by vmFile
|
||||
*
|
||||
* @param vmFile
|
||||
* @param templateObjects
|
||||
* @param velocityProperties
|
||||
* @return
|
||||
*/
|
||||
public static String executeTemplate(File vmFile,
|
||||
Map<String, Object> templateObjects, Properties velocityProperties) {
|
||||
VelocityEngine engine = new VelocityEngine();
|
||||
engine.init(velocityProperties);
|
||||
return executeTemplate(vmFile, templateObjects, engine);
|
||||
}
|
||||
|
||||
private static String executeTemplate(File vmFile,
|
||||
Map<String, Object> templateObjects, VelocityEngine engine) {
|
||||
VelocityContext context = new VelocityContext(templateObjects);
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
Template t = engine.getTemplate(vmFile.getAbsolutePath(),
|
||||
Velocity.ENCODING_DEFAULT);
|
||||
t.merge(context, sw);
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -148,13 +148,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.topo"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.plugin.manualIngest"
|
||||
download-size="0"
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
|
||||
/**
|
||||
* Provides a dispatcher for CPG services
|
||||
|
@ -39,6 +39,7 @@ import com.raytheon.edex.msg.DataURINotificationMessage;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 5, 2010 chammack Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -24,12 +24,12 @@ import java.util.concurrent.Executor;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.msg.DataURINotificationMessage;
|
||||
import com.raytheon.edex.urifilter.IURIFilter;
|
||||
import com.raytheon.edex.urifilter.URIFilter;
|
||||
import com.raytheon.edex.urifilter.URIGenerateMessage;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
|
||||
import com.raytheon.uf.common.event.EventBus;
|
||||
import com.raytheon.uf.common.monitor.cpg.MonitorStateConfigurationManager;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
|
@ -60,6 +60,7 @@ import com.raytheon.uf.edex.database.plugin.PluginDao;
|
|||
* 30NOV2012 1372 dhladky Added statistics.
|
||||
* 02/05/2013 1580 mpduff EventBus refactor.
|
||||
* 02/12/2013 1615 bgonzale Changed ProcessEvent pluginName to dataType.
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
|
|
@ -4,6 +4,5 @@ Bundle-Name: ESB Launcher Plug-in
|
|||
Bundle-SymbolicName: com.raytheon.uf.edex.esb.camel.launcher
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Require-Bundle: org.apache.activemq
|
||||
Main-Class: com.raytheon.uf.edex.esb.Main
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -48,6 +48,7 @@ import java.util.StringTokenizer;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 14, 2008 chammack Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Removed reference to unused "stop" method
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -76,14 +77,14 @@ public class Main {
|
|||
|
||||
if (args.length != 1) {
|
||||
valid = false;
|
||||
} else if (!argList.contains("start") && !argList.contains("stop")) {
|
||||
} else if (!argList.contains("start")) {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
System.out.println("Invalid or missing arguments.");
|
||||
System.out.println("Usage: edex [operation]");
|
||||
System.out.println(" where operation is start or stop.");
|
||||
System.out.println(" where operation is start.");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
@ -148,9 +149,6 @@ public class Main {
|
|||
|
||||
Method m = c.getMethod("start", new Class<?>[0]);
|
||||
m.invoke(null, new Object[0]);
|
||||
} else if (args[0].equals("stop")) {
|
||||
Method m = c.getMethod("stop", new Class<?>[0]);
|
||||
m.invoke(null, new Object[0]);
|
||||
}
|
||||
System.exit(0);
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
@ -266,8 +264,8 @@ public class Main {
|
|||
url = jarConnection.getJarFileURL();
|
||||
URI baseURI = new URI(url.toString()).resolve("..");
|
||||
edexHome = new File(baseURI).getCanonicalFile();
|
||||
System.setProperty(SYSTEM_PROPERTY, edexHome
|
||||
.getAbsolutePath());
|
||||
System.setProperty(SYSTEM_PROPERTY,
|
||||
edexHome.getAbsolutePath());
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|||
Require-Bundle: org.apache.camel;bundle-version="1.0.0",
|
||||
javax.jms,
|
||||
com.raytheon.edex.common;bundle-version="1.10.7",
|
||||
org.apache.activemq;bundle-version="5.1.0",
|
||||
org.apache.http;bundle-version="3.0.1",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.11.17",
|
||||
com.raytheon.uf.common.status,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue