Merge branch 'omaha_14.2.1' into development
Former-commit-id:0950a8a1ba
[formerly0950a8a1ba
[formerly 71a8fd9b0659b06e366e734c06fa74232787238b]] Former-commit-id:64f8564cd8
Former-commit-id:5d6bae317d
This commit is contained in:
commit
bb449e689e
134 changed files with 3476 additions and 2059 deletions
BIN
cave/.dm/.dirs.dmdb
Normal file
BIN
cave/.dm/.dirs.dmdb
Normal file
Binary file not shown.
|
@ -411,7 +411,7 @@
|
|||
<xmlproperty file="${builder}/memorySettings.xml"
|
||||
collapseAttributes="true"/>
|
||||
|
||||
<property name="caveXmx" value="2048M" />
|
||||
<property name="caveXmx" value="3072M" />
|
||||
<property name="caveMaxPermSize" value="256m" />
|
||||
|
||||
<update.ini
|
||||
|
|
|
@ -2,6 +2,36 @@
|
|||
# CAVE startup script
|
||||
# Note: CAVE will not run as 'root'
|
||||
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Dec 05, 2013 #2593 rjpeter Added check for number of running
|
||||
# cave sessions.
|
||||
# Dec 05, 2013 #2590 dgilling Modified so gfeclient.sh can be wrapped
|
||||
# around this script.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
user=`/usr/bin/whoami`
|
||||
if [ ${user} == 'root' ];then
|
||||
echo "WARNING: CAVE cannot be run as user '${user}'!"
|
||||
|
@ -9,13 +39,16 @@ if [ ${user} == 'root' ];then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
path_to_script=`readlink -f $0`
|
||||
dir=$(dirname $path_to_script)
|
||||
# Since, we no longer need to worry about re-location ...
|
||||
CAVE_INSTALL="/awips2/cave"
|
||||
JAVA_INSTALL="/awips2/java"
|
||||
PYTHON_INSTALL="/awips2/python"
|
||||
export AWIPS_INSTALL_DIR="${CAVE_INSTALL}"
|
||||
|
||||
source ${dir}/caveUtil.sh
|
||||
source ${CAVE_INSTALL}/caveUtil.sh
|
||||
RC=$?
|
||||
if [ ${RC} -ne 0 ]; then
|
||||
echo "ERROR: unable to find and/or access ${dir}/caveUtil.sh."
|
||||
echo "ERROR: unable to find and/or access ${CAVE_INSTALL}/caveUtil.sh."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -28,16 +61,11 @@ copyVizShutdownUtilIfNecessary
|
|||
# delete any old disk caches in the background
|
||||
deleteOldCaveDiskCaches &
|
||||
|
||||
# Since, we no longer need to worry about re-location ...
|
||||
CAVE_INSTALL="/awips2/cave"
|
||||
JAVA_INSTALL="/awips2/java"
|
||||
PYTHON_INSTALL="/awips2/python"
|
||||
|
||||
export AWIPS_INSTALL_DIR="${CAVE_INSTALL}"
|
||||
|
||||
export LD_LIBRARY_PATH=${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:$LD_LIBRARY_PATH
|
||||
export LD_PRELOAD=libpython.so
|
||||
extendLibraryPath
|
||||
if [[ -z "$CALLED_EXTEND_LIB_PATH" ]]; then
|
||||
extendLibraryPath
|
||||
fi
|
||||
export PATH=${JAVA_INSTALL}/bin:${PYTHON_INSTALL}/bin:$PATH
|
||||
export JAVA_HOME="${JAVA_INSTALL}/jre"
|
||||
|
||||
|
@ -60,16 +88,16 @@ if [ -x ${TESTCHECK} ]; then
|
|||
status=${?}
|
||||
if [ $status -eq 11 ]; then
|
||||
MODE="TEST"
|
||||
SWITCHES=" -mode TEST "
|
||||
SWITCHES="${SWITCHES} -mode TEST "
|
||||
elif [ $status -eq 12 ];then
|
||||
MODE="PRACTICE"
|
||||
SWITCHES=" -mode PRACTICE "
|
||||
SWITCHES="${SWITCHES} -mode PRACTICE "
|
||||
elif [ $status -eq 15 ];then
|
||||
MODE="OPERATIONAL"
|
||||
SWITCHES=" -mode OPERATIONAL"
|
||||
SWITCHES="${SWITCHES} -mode OPERATIONAL"
|
||||
else
|
||||
MODE="OPERATIONAL (no response)"
|
||||
SWITCHES=" "
|
||||
SWITCHES="${SWITCHES} "
|
||||
fi
|
||||
echo "getTestMode() returned ${MODE}"
|
||||
else
|
||||
|
@ -79,6 +107,30 @@ fi
|
|||
|
||||
export TEXTWS=`hostname | sed -e 's/lx/xt/g'`
|
||||
|
||||
hostName=`hostname -s`
|
||||
|
||||
if [[ $hostName =~ xt.* ]]; then
|
||||
export IGNORE_NUM_CAVES=1
|
||||
fi
|
||||
|
||||
# check number of running caves
|
||||
if [[ -z $IGNORE_NUM_CAVES ]]; then
|
||||
# free usually reports below on G threshold (11 instead of 12G), giving the 3 cave recommended in field
|
||||
mem=( `free -g | grep "Mem:"` )
|
||||
mem=${mem[1]}
|
||||
let _maxCaves=mem/3
|
||||
|
||||
getPidsOfMyRunningCaves
|
||||
if [[ "$_numPids" -ge "$_maxCaves" ]]; then
|
||||
zenity --question --title "Max CAVE sessions already running" --text "$_numPids CAVE sessions already running. Starting more may impact system performance and stability.\n\nProceed?"
|
||||
cancel="$?"
|
||||
|
||||
if [[ "$cancel" == "1" ]]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#check for gtk-2.0 value
|
||||
gtkResource=.gtkrc-2.0
|
||||
includeLine="include \"$HOME/.gtkrc.mine\""
|
||||
|
@ -108,8 +160,12 @@ else
|
|||
echo $altButtonLine >> $HOME/$mineFile
|
||||
fi
|
||||
|
||||
hostName=`hostname -s`
|
||||
LOGDIR=$HOME/caveData/logs/consoleLogs/$hostName/
|
||||
if [[ -z "$PROGRAM_NAME" ]]
|
||||
then
|
||||
PROGRAM_NAME="cave"
|
||||
fi
|
||||
|
||||
LOGDIR="$HOME/caveData/logs/consoleLogs/$hostName/"
|
||||
|
||||
# make sure directory exists
|
||||
if [ ! -d $LOGDIR ]; then
|
||||
|
@ -119,39 +175,46 @@ fi
|
|||
export pid=$$
|
||||
|
||||
curTime=`date +%Y%m%d_%H%M%S`
|
||||
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log
|
||||
export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log
|
||||
export LOGFILE_PERFORMANCE=${LOGDIR}/cave_${curTime}_pid_${pid}_perf.log
|
||||
|
||||
redirect="TRUE"
|
||||
for flag in $@; do
|
||||
if [ $flag == "-noredirect" ]; then
|
||||
redirect="FALSE"
|
||||
break
|
||||
fi
|
||||
done
|
||||
LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
|
||||
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_alertviz.log"
|
||||
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_perf.log"
|
||||
|
||||
# can we write to log directory
|
||||
if [ -w ${LOGDIR} ]; then
|
||||
touch ${LOGFILE}
|
||||
fi
|
||||
|
||||
# remove "-noredirect" flag from command-line if set so it doesn't confuse any
|
||||
# commands we call later.
|
||||
redirect="true"
|
||||
USER_ARGS=()
|
||||
while [[ $1 ]]
|
||||
do
|
||||
if [[ "$1" == "-noredirect" ]]
|
||||
then
|
||||
redirect="false"
|
||||
else
|
||||
USER_ARGS+=("$1")
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
# Special instructions for the 64-bit jvm.
|
||||
ARCH_ARGS=""
|
||||
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
|
||||
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
|
||||
fi
|
||||
|
||||
lookupINI $@
|
||||
lookupINI "${USER_ARGS[@]}"
|
||||
|
||||
if [[ "${runMonitorThreads}" == "true" ]] ; then
|
||||
# nohup to allow tar process to continue after user has logged out
|
||||
nohup ${dir}/monitorThreads.sh $pid >> /dev/null 2>&1 &
|
||||
nohup ${CAVE_INSTALL}/monitorThreads.sh $pid >> /dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
if ( [ ${redirect} == "TRUE" ] ); then
|
||||
exec ${dir}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} $@ > ${LOGFILE} 2>&1
|
||||
if [[ "${redirect}" == "true" ]] ; then
|
||||
exec ${CAVE_INSTALL}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} "${USER_ARGS[@]}" > ${LOGFILE} 2>&1
|
||||
else
|
||||
exec ${dir}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} $@ 2>&1 | tee ${LOGFILE}
|
||||
exec ${CAVE_INSTALL}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} "${USER_ARGS[@]}" 2>&1 | tee ${LOGFILE}
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,5 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Dec 05, 2013 #2593 rjpeter Fix getPidsOfMyRunningCaves
|
||||
# Dec 05, 2013 #2590 dgilling Modified extendLibraryPath() to export a
|
||||
# var if it's already been run.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
source /awips2/cave/iniLookup.sh
|
||||
RC=$?
|
||||
if [ ${RC} -ne 0 ]; then
|
||||
|
@ -60,6 +89,8 @@ function extendLibraryPath()
|
|||
if [ "${1}" = "-noX" ]; then
|
||||
export LD_LIBRARY_PATH="${CAVE_LIB_DIRECTORY}/lib_mesa:$LD_LIBRARY_PATH"
|
||||
fi
|
||||
|
||||
CALLED_EXTEND_LIB_PATH="true"
|
||||
}
|
||||
|
||||
function copyVizShutdownUtilIfNecessary()
|
||||
|
@ -89,7 +120,7 @@ function copyVizShutdownUtilIfNecessary()
|
|||
function getPidsOfMyRunningCaves()
|
||||
{
|
||||
local user=`whoami`
|
||||
local caveProcs=`ps -ef | grep "/awips2/cave/cave" | grep -v "grep" | grep $user`
|
||||
local caveProcs=`ps -ef | grep "/awips2/cave/cave " | grep -v "grep" | grep $user`
|
||||
|
||||
# preserve IFS and set it to line feed only
|
||||
local PREV_IFS=$IFS
|
||||
|
|
|
@ -69,9 +69,7 @@
|
|||
</property>
|
||||
<property name="arguments" ref="recordFactory" />
|
||||
</bean>
|
||||
|
||||
<bean id="procedureXmlManagerInit" class="com.raytheon.uf.viz.core.procedures.ProcedureXmlManager" factory-method="inititializeAsync"/>
|
||||
|
||||
|
||||
<bean id="vizSubClassLocator" class="com.raytheon.uf.viz.core.reflect.SubClassLocator"/>
|
||||
<bean class="com.raytheon.uf.common.style.StyleManager" factory-method="getInstance">
|
||||
<property name="subClassLocator" ref="vizSubClassLocator" />
|
||||
|
|
|
@ -42,6 +42,7 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 7/1/06 chammack Initial Creation.
|
||||
* Dec 06, 2013 2599 njensen Fix PixelExtent(Rectangle)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -123,6 +124,7 @@ public class PixelExtent implements IExtent {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void reset() {
|
||||
envelope = new Envelope(aMinX, aMaxX, aMinY, aMaxY);
|
||||
}
|
||||
|
@ -134,8 +136,7 @@ public class PixelExtent implements IExtent {
|
|||
* a rectangle to build the extent from
|
||||
*/
|
||||
public PixelExtent(Rectangle rect) {
|
||||
envelope = new Envelope(rect.x, rect.x + rect.width, rect.y, rect.y
|
||||
+ rect.height);
|
||||
this(rect.x, rect.x + rect.width, rect.y, rect.y + rect.height);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -143,6 +144,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getMaxX()
|
||||
*/
|
||||
@Override
|
||||
public double getMaxX() {
|
||||
|
||||
return envelope.getMaxX();
|
||||
|
@ -153,6 +155,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getMaxY()
|
||||
*/
|
||||
@Override
|
||||
public double getMaxY() {
|
||||
|
||||
return envelope.getMaxY();
|
||||
|
@ -163,6 +166,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getMinX()
|
||||
*/
|
||||
@Override
|
||||
public double getMinX() {
|
||||
|
||||
return envelope.getMinX();
|
||||
|
@ -173,6 +177,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getMinY()
|
||||
*/
|
||||
@Override
|
||||
public double getMinY() {
|
||||
|
||||
return envelope.getMinY();
|
||||
|
@ -183,6 +188,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getWidth()
|
||||
*/
|
||||
@Override
|
||||
public double getWidth() {
|
||||
return getMaxX() - getMinX();
|
||||
}
|
||||
|
@ -192,6 +198,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getHeight()
|
||||
*/
|
||||
@Override
|
||||
public double getHeight() {
|
||||
return getMaxY() - getMinY();
|
||||
}
|
||||
|
@ -201,6 +208,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#scale(double)
|
||||
*/
|
||||
@Override
|
||||
public void scale(double factor) {
|
||||
double deltaWidth = getWidth() * (factor - 1.0);
|
||||
double deltaHeight = getHeight() * (factor - 1.0);
|
||||
|
@ -214,6 +222,7 @@ public class PixelExtent implements IExtent {
|
|||
* @see com.raytheon.uf.viz.core.IExtent#scaleAndBias(double, double,
|
||||
* double)
|
||||
*/
|
||||
@Override
|
||||
public void scaleAndBias(double factor, double xCenter, double yCenter) {
|
||||
double deltaWidth = envelope.getWidth() * (factor - 1.0);
|
||||
double deltaHeight = envelope.getHeight() * (factor - 1.0);
|
||||
|
@ -240,6 +249,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#getCenter()
|
||||
*/
|
||||
@Override
|
||||
public double[] getCenter() {
|
||||
double midX = (getMaxX() + getMinX()) / 2.0f;
|
||||
double midY = (getMaxY() + getMinY()) / 2.0f;
|
||||
|
@ -248,6 +258,7 @@ public class PixelExtent implements IExtent {
|
|||
return new double[] { midX, midY, midZ };
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getScale() {
|
||||
return getWidth() / (aMaxX - aMinX);
|
||||
}
|
||||
|
@ -257,6 +268,7 @@ public class PixelExtent implements IExtent {
|
|||
* @param shiftX
|
||||
* @param shiftY
|
||||
*/
|
||||
@Override
|
||||
public void shift(double shiftX, double shiftY) {
|
||||
|
||||
envelope.translate(shiftX, shiftY);
|
||||
|
@ -268,6 +280,7 @@ public class PixelExtent implements IExtent {
|
|||
* @param start
|
||||
* @param end
|
||||
*/
|
||||
@Override
|
||||
public void shift(Ray start, Ray end) {
|
||||
|
||||
// view.shift(start, end);
|
||||
|
@ -303,6 +316,7 @@ public class PixelExtent implements IExtent {
|
|||
*
|
||||
* @see com.raytheon.uf.viz.core.IExtent#contains(double[])
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(double[] pixel) {
|
||||
return envelope.contains(pixel[0], pixel[1]);
|
||||
}
|
||||
|
@ -314,6 +328,7 @@ public class PixelExtent implements IExtent {
|
|||
* com.raytheon.uf.viz.core.IExtent#intersects(com.raytheon.uf.viz.core.
|
||||
* IExtent)
|
||||
*/
|
||||
@Override
|
||||
public boolean intersects(IExtent pe) {
|
||||
return intersect((PixelExtent) pe);
|
||||
}
|
||||
|
|
|
@ -52,8 +52,10 @@ import com.raytheon.uf.viz.core.Activator;
|
|||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Oct 18, 2013 2491 bsteffen Initial creation
|
||||
* Dec 10, 2013 2602 bsteffen Add null checks to detect unloaded
|
||||
* bundles.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -256,7 +258,13 @@ public class SubClassLocator implements ISubClassLocator {
|
|||
private Set<Class<?>> loadClassesFromCache(Bundle bundle,
|
||||
Collection<String> classNames) {
|
||||
BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
|
||||
if (bundleWiring == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
ClassLoader loader = bundleWiring.getClassLoader();
|
||||
if (loader == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
HashSet<Class<?>> result = new HashSet<Class<?>>(classNames.size(),
|
||||
1.0f);
|
||||
for (String className : classNames) {
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.HashSet;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
|
@ -37,7 +36,7 @@ import com.raytheon.uf.common.localization.LocalizationUtil;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* This dialog will allow users to open existing procedures.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -46,6 +45,8 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 16, 2011 mschenke Initial creation
|
||||
* 11 Dec 2013 #2583 lvenable Added a check to determine if current user,
|
||||
* all users or all procedures should be requested.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,16 +57,18 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
|
|||
public class OpenProcedureListDlg extends ProcedureListDlg {
|
||||
|
||||
/**
|
||||
* @param title
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
* @param mode
|
||||
* Parent shell.
|
||||
*/
|
||||
public OpenProcedureListDlg(Shell parent) {
|
||||
super("Open Procedure", parent, Mode.OPEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProcedureTree populateDataList(TreeViewer treeViewer) {
|
||||
protected ProcedureTree populateDataList() {
|
||||
|
||||
ProcedureTree root = new ProcedureTree("root", null);
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
Set<LocalizationContext> searchContexts = new HashSet<LocalizationContext>();
|
||||
|
@ -73,18 +76,31 @@ public class OpenProcedureListDlg extends ProcedureListDlg {
|
|||
searchContexts.addAll(Arrays.asList(pm
|
||||
.getLocalSearchHierarchy(LocalizationType.CAVE_STATIC)));
|
||||
|
||||
// Use of LocalizationLevels.values() in this case should be okay since
|
||||
// we are requesting all possible context names for the level, doesn't
|
||||
// matter if our local context for the level is set
|
||||
LocalizationLevel[] levels = pm.getAvailableLevels();
|
||||
for (LocalizationLevel level : levels) {
|
||||
if (level.isSystemLevel() == false) {
|
||||
String[] available = pm.getContextList(level);
|
||||
for (String s : available) {
|
||||
LocalizationContext ctx = pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, level);
|
||||
ctx.setContextName(s);
|
||||
searchContexts.add(ctx);
|
||||
// If the show type is not the current user then look at loading the
|
||||
// remaining procedures.
|
||||
if (selectedShowType != ShowType.MINE) {
|
||||
// Use of LocalizationLevels.values() in this case should be okay
|
||||
// since we are requesting all possible context names for the level,
|
||||
// doesn't matter if our local context for the level is set
|
||||
LocalizationLevel[] levels = pm.getAvailableLevels();
|
||||
for (LocalizationLevel level : levels) {
|
||||
|
||||
// If the show type is all users and the localization is USER or
|
||||
// show type is ALL then load the procedure. This will either
|
||||
// load all of the procedures or only the ones at the user
|
||||
// level.
|
||||
if ((selectedShowType == ShowType.ALL_USERS && level == LocalizationLevel.USER)
|
||||
|| selectedShowType == ShowType.ALL) {
|
||||
|
||||
if (level.isSystemLevel() == false) {
|
||||
String[] available = pm.getContextList(level);
|
||||
for (String s : available) {
|
||||
LocalizationContext ctx = pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, level);
|
||||
ctx.setContextName(s);
|
||||
searchContexts.add(ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,23 +19,18 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.d2d.ui.dialogs.procedures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IMenuListener;
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Cursor;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.layout.RowData;
|
||||
|
@ -43,11 +38,10 @@ import org.eclipse.swt.layout.RowLayout;
|
|||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.swt.widgets.TreeItem;
|
||||
import org.eclipse.ui.IWorkbenchActionConstants;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
|
@ -74,6 +68,12 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 07/31/2012 DR 15036 D. Friedman Ensure current user's procedures
|
||||
* are visible.
|
||||
* 10/16/2012 1229 rferrel Made dialog non-blocking.
|
||||
* 11 Dec 2013 #2583 lvenable Added show mine, show all users, and show
|
||||
* all radio buttons, fixed a widget disposed
|
||||
* error, cleaned up code to prevent buttons
|
||||
* from magically appearing, removed dead code,
|
||||
* and other code clean up.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
|
@ -81,32 +81,85 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
*/
|
||||
public class ProcedureListDlg extends CaveSWTDialog {
|
||||
|
||||
/** Flag indicating the data will only be at the root level. */
|
||||
protected boolean oneLevel = true;
|
||||
|
||||
private Font font;
|
||||
|
||||
/** Text control that contains a selected procedure from the tree viewer. */
|
||||
private Text procedureTF;
|
||||
|
||||
/** Tree that holds the procedure data. */
|
||||
private TreeViewer treeViewer;
|
||||
|
||||
/** OK button. */
|
||||
private Button okBtn;
|
||||
|
||||
/** Cancel button. */
|
||||
private Button cancelBtn;
|
||||
|
||||
private Button frozenBtn;
|
||||
/** Frozen check box. */
|
||||
private Button frozenChk;
|
||||
|
||||
/** Frozen flag. */
|
||||
private boolean frozen = false;
|
||||
|
||||
String fileName;
|
||||
/** Selected filename. */
|
||||
private String fileName;
|
||||
|
||||
private ProcedureTree fileTree = new ProcedureTree(null, null);
|
||||
|
||||
/** Flag indicating if all users should be displayed. */
|
||||
private boolean showAllUsersFlag = false;
|
||||
|
||||
/** Expand button. */
|
||||
private Button expandButton;
|
||||
|
||||
/** Collapse button. */
|
||||
private Button collapseButton;
|
||||
|
||||
/** Show current user procedures. */
|
||||
private Button showMineRdo = null;
|
||||
|
||||
/** Show all user procedures. */
|
||||
private Button showAllUsersRdo = null;
|
||||
|
||||
/** Show all procedures. */
|
||||
private Button showAllProceduresRdo = null;
|
||||
|
||||
/** List of buttons that will be enabled or disabled. */
|
||||
private List<Button> enableBtnArray = new ArrayList<Button>();
|
||||
|
||||
/**
|
||||
* Dialog mode. This determines what functionality the dialog will be able
|
||||
* to do.
|
||||
*/
|
||||
public static enum Mode {
|
||||
SAVE, OPEN, DELETE
|
||||
};
|
||||
|
||||
/**
|
||||
* Enumeration to determine what procedures should be shown.
|
||||
*/
|
||||
public static enum ShowType {
|
||||
MINE, ALL_USERS, ALL
|
||||
};
|
||||
|
||||
protected ShowType selectedShowType = ShowType.MINE;
|
||||
|
||||
/**
|
||||
* Dialog mode.
|
||||
*/
|
||||
private final Mode mode;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param title
|
||||
* Dialog title.
|
||||
* @param parent
|
||||
* Parent shell.
|
||||
* @param mode
|
||||
* Mode of the dialog.
|
||||
*/
|
||||
public ProcedureListDlg(String title, Shell parent, Mode mode) {
|
||||
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK); // Win32
|
||||
setText(title);
|
||||
|
@ -115,133 +168,226 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void disposed() {
|
||||
font.dispose();
|
||||
protected void opened() {
|
||||
// Set the minimum size on the dialog so that it cannot be resized to
|
||||
// hide the controls.
|
||||
shell.setMinimumSize(shell.getBounds().width, shell.getBounds().height);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
font = new Font(shell.getDisplay(), "Courier", 11, SWT.BOLD);
|
||||
|
||||
Composite mainComp = new Composite(shell, SWT.NONE);
|
||||
mainComp.setLayout(new GridLayout(2, false));
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 400;
|
||||
mainComp.setLayoutData(gd);
|
||||
|
||||
createTextComp(mainComp);
|
||||
createButtonComp(mainComp);
|
||||
}
|
||||
|
||||
protected void createExpandComp(Composite parent) {
|
||||
/**
|
||||
* Create a composite with the Expand and Collapse buttons.
|
||||
*
|
||||
* @param parent
|
||||
* Parent composite.
|
||||
*/
|
||||
private void createExpandComp(Composite parent) {
|
||||
|
||||
Composite expandComp = new Composite(parent, SWT.NONE);
|
||||
expandComp.setLayout(new RowLayout(SWT.HORIZONTAL));
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
gd.widthHint = 25;
|
||||
expandComp.setLayoutData(gd);
|
||||
|
||||
if (this.mode == Mode.DELETE) {
|
||||
gd.exclude = true;
|
||||
}
|
||||
|
||||
RowData rd = new RowData();
|
||||
Button expandButton = new Button(expandComp, SWT.PUSH);
|
||||
expandButton = new Button(expandComp, SWT.PUSH);
|
||||
expandButton.setText("Expand All");
|
||||
expandButton.setLayoutData(rd);
|
||||
enableBtnArray.add(expandButton);
|
||||
expandButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
expandAll();
|
||||
treeViewer.expandAll();
|
||||
}
|
||||
});
|
||||
|
||||
rd = new RowData();
|
||||
Button collapseButton = new Button(expandComp, SWT.PUSH);
|
||||
collapseButton = new Button(expandComp, SWT.PUSH);
|
||||
collapseButton.setText("Collapse All");
|
||||
collapseButton.setLayoutData(rd);
|
||||
enableBtnArray.add(collapseButton);
|
||||
collapseButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
collapseAll();
|
||||
treeViewer.collapseAll();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void expandAll() {
|
||||
treeViewer.expandAll();
|
||||
}
|
||||
|
||||
private void collapseAll() {
|
||||
treeViewer.collapseAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the text and tree viewer controls.
|
||||
*
|
||||
* @param mainComp
|
||||
* Parent composite.
|
||||
*/
|
||||
protected void createTextComp(Composite mainComp) {
|
||||
final Cursor cursor = getShell().getCursor();
|
||||
getShell().setCursor(
|
||||
Display.getCurrent().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
final Composite textComp = new Composite(mainComp, SWT.NONE);
|
||||
textComp.setLayout(new GridLayout(1, true));
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 150;
|
||||
textComp.setLayoutData(gd);
|
||||
|
||||
procedureTF = new Text(textComp, SWT.BORDER);
|
||||
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
|
||||
gd.widthHint = 150;
|
||||
if (this.mode == Mode.DELETE) {
|
||||
gd.exclude = true;
|
||||
/*
|
||||
* Add a text control to the dialog if it isn't in delete mode.
|
||||
*/
|
||||
if (this.mode != Mode.DELETE) {
|
||||
procedureTF = new Text(textComp, SWT.BORDER);
|
||||
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
|
||||
// gd.widthHint = 150;
|
||||
procedureTF.setLayoutData(gd);
|
||||
|
||||
/*
|
||||
* If this is the open dialog, make the text control uneditable. The
|
||||
* reason for this is that currently this dialog doesn't do anything
|
||||
* with the text that the user could enter into the box. In AWIPS I,
|
||||
* entering in a name that doesn't exist will bring up the
|
||||
* procedures dialog with the entered name but no products. In AWIPS
|
||||
* II, the dialog just closes. Until this gets addressed the text
|
||||
* control should be uneditable.
|
||||
*/
|
||||
if (this.mode == Mode.OPEN) {
|
||||
procedureTF.setEditable(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mode == Mode.OPEN) {
|
||||
|
||||
Composite showComp = new Composite(textComp, SWT.NONE);
|
||||
showComp.setLayout(new GridLayout(3, false));
|
||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
showComp.setLayoutData(gd);
|
||||
|
||||
showMineRdo = new Button(showComp, SWT.RADIO);
|
||||
showMineRdo.setText("Show Mine");
|
||||
showMineRdo.setSelection(true);
|
||||
enableBtnArray.add(showMineRdo);
|
||||
showMineRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (showMineRdo.getSelection()
|
||||
&& selectedShowType != ShowType.MINE) {
|
||||
showProcedureAction(ShowType.MINE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData();
|
||||
gd.horizontalIndent = 10;
|
||||
showAllUsersRdo = new Button(showComp, SWT.RADIO);
|
||||
showAllUsersRdo.setText("Show All Users");
|
||||
showAllUsersRdo.setLayoutData(gd);
|
||||
enableBtnArray.add(showAllUsersRdo);
|
||||
showAllUsersRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (showAllUsersRdo.getSelection()
|
||||
&& selectedShowType != ShowType.ALL_USERS) {
|
||||
showProcedureAction(ShowType.ALL_USERS);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData();
|
||||
gd.horizontalIndent = 10;
|
||||
showAllProceduresRdo = new Button(showComp, SWT.RADIO);
|
||||
showAllProceduresRdo.setText("Show All");
|
||||
showAllProceduresRdo.setLayoutData(gd);
|
||||
enableBtnArray.add(showAllProceduresRdo);
|
||||
showAllProceduresRdo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (showAllProceduresRdo.getSelection()
|
||||
&& selectedShowType != ShowType.ALL) {
|
||||
showProcedureAction(ShowType.ALL);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
procedureTF.setLayoutData(gd);
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.widthHint = 250;
|
||||
gd.heightHint = 175;
|
||||
treeViewer = new TreeViewer(textComp, SWT.SINGLE | SWT.BORDER
|
||||
| SWT.FILL);
|
||||
gd.widthHint = 325;
|
||||
gd.heightHint = 170;
|
||||
|
||||
treeViewer = new TreeViewer(textComp, SWT.SINGLE | SWT.BORDER);
|
||||
treeViewer.getTree().setLayoutData(gd);
|
||||
treeViewer.getTree().addSelectionListener(new SelectionListener() {
|
||||
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent arg0) {
|
||||
|
||||
}
|
||||
|
||||
treeViewer.getTree().addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent arg0) {
|
||||
if (!treeViewer.getTree().isDisposed()
|
||||
&& treeViewer.getTree().getSelection().length > 0) {
|
||||
procedureTF.setText(treeViewer.getTree().getSelection()[0]
|
||||
.getText());
|
||||
if (procedureTF != null && !procedureTF.isDisposed()) {
|
||||
procedureTF
|
||||
.setText(treeViewer.getTree().getSelection()[0]
|
||||
.getText());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
treeViewer.getTree().addMouseListener(new MouseListener() {
|
||||
@Override
|
||||
public void mouseUp(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
}
|
||||
|
||||
treeViewer.getTree().addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
selectAction(true);
|
||||
// Check to see if the selected item has child nodes. If it
|
||||
// doesn't then call selectAction.
|
||||
if (!checkSelectionToggle(getSelectedTreeItem())) {
|
||||
selectAction();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
updateTreeViewerData();
|
||||
|
||||
// If not in delete mode then add the expand/collapse controls.
|
||||
if (this.mode != Mode.DELETE) {
|
||||
createExpandComp(textComp);
|
||||
}
|
||||
}
|
||||
|
||||
private void showProcedureAction(ShowType showType) {
|
||||
this.selectedShowType = showType;
|
||||
|
||||
treeViewer.getTree().removeAll();
|
||||
treeViewer.getTree().clearAll(true);
|
||||
procedureTF.setText("");
|
||||
updateTreeViewerData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the tree viewer with data.
|
||||
*/
|
||||
private void updateTreeViewerData() {
|
||||
|
||||
// Set the cursor to a wait cursor. Also set the main composite to not
|
||||
// be editable while the data is being retrieved.
|
||||
getShell().setCursor(
|
||||
Display.getCurrent().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
enableControls(false);
|
||||
|
||||
Job job = new Job("Populating procedures...") {
|
||||
protected org.eclipse.core.runtime.IStatus run(
|
||||
org.eclipse.core.runtime.IProgressMonitor monitor) {
|
||||
fileTree = populateDataList(treeViewer);
|
||||
fileTree = populateDataList();
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// If the treeViewer is null or has been disposed then
|
||||
// return as the dialog has been shutdown.
|
||||
if (treeViewer == null
|
||||
|| treeViewer.getTree().isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
treeViewer
|
||||
.setContentProvider(new ProcedureTreeContentProvider(
|
||||
fileTree));
|
||||
|
@ -249,21 +395,16 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
.setLabelProvider(new ProcedureTreeLabelProvider());
|
||||
treeViewer.setSorter(new ProcedureTreeSorter());
|
||||
|
||||
// uncomment following function call to enable the right
|
||||
// click
|
||||
// context
|
||||
// menu
|
||||
// createContextMenu();
|
||||
|
||||
// it didn't seem to start with null, the string doesn't
|
||||
// actually mean
|
||||
// anything in this case
|
||||
// actually mean anything in this case
|
||||
treeViewer.setInput("kickstart");
|
||||
|
||||
openUserInTreeViewer();
|
||||
|
||||
createExpandComp(textComp);
|
||||
getShell().setCursor(cursor);
|
||||
// Set the cursor to a normal cursor. Also, reenable the
|
||||
// main composite to be editable.
|
||||
enableControls(true);
|
||||
getShell().setCursor(null);
|
||||
}
|
||||
});
|
||||
return Status.OK_STATUS;
|
||||
|
@ -272,85 +413,23 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
job.schedule();
|
||||
}
|
||||
|
||||
private void createContextMenu() {
|
||||
MenuManager menuMgr = new MenuManager();
|
||||
menuMgr.setRemoveAllWhenShown(true);
|
||||
menuMgr.addMenuListener(new IMenuListener() {
|
||||
public void menuAboutToShow(IMenuManager mgr) {
|
||||
fillContextMenu(mgr);
|
||||
/**
|
||||
* Enable or disable controls based on the flag passed in.
|
||||
*
|
||||
* @param enableFlag
|
||||
* True to enable controls, false to disable.
|
||||
*/
|
||||
private void enableControls(boolean enableFlag) {
|
||||
|
||||
for (Button btn : enableBtnArray) {
|
||||
if (btn != null && !btn.isDisposed()) {
|
||||
btn.setEnabled(enableFlag);
|
||||
}
|
||||
});
|
||||
|
||||
Menu menu = menuMgr.createContextMenu(treeViewer.getControl());
|
||||
treeViewer.getControl().setMenu(menu);
|
||||
}
|
||||
|
||||
protected void fillContextMenu(IMenuManager mgr) {
|
||||
if (treeViewer.getSelection().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final Object tmp = treeViewer.getTree().getSelection()[0].getData();
|
||||
if (tmp instanceof ProcedureTree) {
|
||||
ProcedureTree sel = (ProcedureTree) tmp;
|
||||
|
||||
// if there is a valid file add load option
|
||||
if (sel.getFile() != null) {
|
||||
String text = "";
|
||||
if (this.mode == ProcedureListDlg.Mode.DELETE) {
|
||||
text = "Delete this";
|
||||
} else if (this.mode == ProcedureListDlg.Mode.OPEN) {
|
||||
text = "Open this";
|
||||
} else if (this.mode == ProcedureListDlg.Mode.SAVE) {
|
||||
text = "Save as this";
|
||||
} else {
|
||||
text = "Action";
|
||||
}
|
||||
mgr.add(new Action(text) {
|
||||
public void run() {
|
||||
selectAction(false);
|
||||
}
|
||||
});
|
||||
|
||||
// add separator
|
||||
mgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
} else {
|
||||
// add expand this option
|
||||
String text = "";
|
||||
final boolean state = treeViewer.getExpandedState(tmp);
|
||||
if (state) {
|
||||
text = "Collapse";
|
||||
} else {
|
||||
text = "Expand";
|
||||
}
|
||||
|
||||
mgr.add(new Action(text) {
|
||||
public void run() {
|
||||
treeViewer.setExpandedState(tmp, !state);
|
||||
}
|
||||
});
|
||||
|
||||
// add separator
|
||||
mgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
|
||||
}
|
||||
|
||||
// add expand/collapse options
|
||||
mgr.add(new Action("Expand All") {
|
||||
public void run() {
|
||||
expandAll();
|
||||
}
|
||||
});
|
||||
mgr.add(new Action("Collapse All") {
|
||||
public void run() {
|
||||
collapseAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void openUserInTreeViewer() {
|
||||
if (this.oneLevel) {
|
||||
// do nothing for single level
|
||||
} else {
|
||||
private void openUserInTreeViewer() {
|
||||
if (!oneLevel) {
|
||||
IPathManager mgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext ctx = mgr.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER);
|
||||
|
@ -381,14 +460,13 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
/**
|
||||
* populate the data list
|
||||
*/
|
||||
protected ProcedureTree populateDataList(TreeViewer treeViewer) {
|
||||
protected ProcedureTree populateDataList() {
|
||||
ProcedureTree root = new ProcedureTree("root", null);
|
||||
IPathManager mgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext ctx = mgr.getContext(LocalizationType.CAVE_STATIC,
|
||||
LocalizationLevel.USER);
|
||||
LocalizationFile[] files = mgr.listFiles(ctx,
|
||||
ProcedureDlg.PROCEDURES_DIR, null, true, true);
|
||||
|
||||
String[] strings = new String[files.length];
|
||||
for (int i = 0; i < strings.length; i++) {
|
||||
strings[i] = LocalizationUtil.extractName(files[i].getName());
|
||||
|
@ -399,7 +477,10 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create the OK and Cancel buttons.
|
||||
*
|
||||
* @param mainComp
|
||||
* Parent composite.
|
||||
*/
|
||||
private void createButtonComp(Composite mainComp) {
|
||||
// Add buttom comp
|
||||
|
@ -413,10 +494,11 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
okBtn = new Button(buttonComp, SWT.PUSH);
|
||||
okBtn.setText("Ok");
|
||||
okBtn.setLayoutData(rd);
|
||||
enableBtnArray.add(okBtn);
|
||||
okBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
selectAction(false);
|
||||
selectAction();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -433,11 +515,11 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
|
||||
if (mode == Mode.SAVE) {
|
||||
rd = new RowData(100, SWT.DEFAULT);
|
||||
frozenBtn = new Button(buttonComp, SWT.CHECK);
|
||||
frozenBtn.setText("Freeze time");
|
||||
frozenBtn.setLayoutData(rd);
|
||||
frozenBtn.setSelection(frozen);
|
||||
frozenBtn.addSelectionListener(new SelectionAdapter() {
|
||||
frozenChk = new Button(buttonComp, SWT.CHECK);
|
||||
frozenChk.setText("Freeze time");
|
||||
frozenChk.setLayoutData(rd);
|
||||
frozenChk.setSelection(frozen);
|
||||
frozenChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
frozen = !frozen;
|
||||
|
@ -453,38 +535,62 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
return fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method call to determine if frozen is selected.
|
||||
*
|
||||
* @return True if frozen, false otherwise.
|
||||
*/
|
||||
public boolean isFrozen() {
|
||||
return frozen;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if the item was toggled, toggles if the item has children
|
||||
* returns true if the item was toggled, toggles (expands/collapses ) if the
|
||||
* item has children
|
||||
*
|
||||
* @param obj
|
||||
* @return
|
||||
* basically this method check to see if the node in the tree has children.
|
||||
* if the node has children it will expand the tree to show the children.
|
||||
*
|
||||
* @param procedureTree
|
||||
* The procedure tree.
|
||||
* @return True if there are children of the selection.
|
||||
*/
|
||||
private boolean checkSelectionToggle(Object obj) {
|
||||
if (obj instanceof ProcedureTree) {
|
||||
ProcedureTree item = (ProcedureTree) obj;
|
||||
if (item.hasChildren()) {
|
||||
// toggle and return true
|
||||
boolean expanded = treeViewer.getExpandedState(obj);
|
||||
treeViewer.setExpandedState(obj, !expanded);
|
||||
return true;
|
||||
}
|
||||
private boolean checkSelectionToggle(ProcedureTree procedureTree) {
|
||||
|
||||
if (procedureTree.hasChildren()) {
|
||||
// toggle and return true
|
||||
boolean expanded = treeViewer.getExpandedState(procedureTree);
|
||||
treeViewer.setExpandedState(procedureTree, !expanded);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void selectAction(boolean fromDblClick) {
|
||||
/**
|
||||
* Get the procedure tree object from the selected item in the tree viewer.
|
||||
*
|
||||
* @return The procedure tree.
|
||||
*/
|
||||
private ProcedureTree getSelectedTreeItem() {
|
||||
Object tmp = null;
|
||||
if (!treeViewer.getSelection().isEmpty()) {
|
||||
tmp = treeViewer.getTree().getSelection()[0].getData();
|
||||
}
|
||||
if (fromDblClick && checkSelectionToggle(tmp)) {
|
||||
return;
|
||||
|
||||
if (tmp instanceof ProcedureTree) {
|
||||
return (ProcedureTree) tmp;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action method that determines what mode the dialog is in. Action from the
|
||||
* OK button or double-clicking the item in the tree viewer.
|
||||
*/
|
||||
private void selectAction() {
|
||||
|
||||
if (mode == Mode.SAVE) {
|
||||
if (procedureTF.getText() == null)
|
||||
return;
|
||||
|
@ -520,12 +626,22 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
} else if (mode == Mode.OPEN) {
|
||||
fileName = procedureTF.getText();
|
||||
if (tmp instanceof ProcedureTree) {
|
||||
ProcedureTree tmp = getSelectedTreeItem();
|
||||
if (tmp != null) {
|
||||
// it must be a procedure tree, that is what the content
|
||||
// provider uses internally
|
||||
LocalizationFile selectedFile = ((ProcedureTree) tmp).getFile();
|
||||
|
||||
if (selectedFile == null) {
|
||||
displayOpenErrorDialog();
|
||||
return;
|
||||
}
|
||||
setReturnValue(selectedFile);
|
||||
} else {
|
||||
displayOpenErrorDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
close();
|
||||
} else if (mode == Mode.DELETE) {
|
||||
|
||||
|
@ -537,7 +653,8 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
+ selection[0].getText() + "\"");
|
||||
if (result == true) {
|
||||
fileName = selection[0].getText();
|
||||
if (tmp instanceof ProcedureTree) {
|
||||
ProcedureTree tmp = getSelectedTreeItem();
|
||||
if (tmp != null) {
|
||||
// it must be a procedure tree, that is what the content
|
||||
// provider uses internally
|
||||
LocalizationFile selectedFile = ((ProcedureTree) tmp)
|
||||
|
@ -546,10 +663,33 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
close();
|
||||
}
|
||||
} else {
|
||||
MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
|
||||
mb.setText("Selection Error");
|
||||
mb.setMessage("You must select an item to delete it.");
|
||||
mb.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a dialog letting the user know they have to select a file to open
|
||||
* it.
|
||||
*/
|
||||
private void displayOpenErrorDialog() {
|
||||
MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
|
||||
mb.setText("Selection Error");
|
||||
mb.setMessage("You must select a file to open it.");
|
||||
mb.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the data list contains the specified filename.
|
||||
*
|
||||
* @param fileName
|
||||
* Filename.
|
||||
* @return True if the data list contains the filename, false otherwise.
|
||||
*/
|
||||
private boolean dataListContains(String fileName) {
|
||||
TreeItem[] items = treeViewer.getTree().getItems();
|
||||
for (TreeItem item : items) {
|
||||
|
@ -559,4 +699,13 @@ public class ProcedureListDlg extends CaveSWTDialog {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method call to determine if all users should be shown.
|
||||
*
|
||||
* @return True if all users should be shown, false otherwise.
|
||||
*/
|
||||
protected boolean showAllUsers() {
|
||||
return showAllUsersFlag;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,6 +102,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
|||
* Oct 28, 2013 2430 mpduff Add % of bandwidth utilized graph.
|
||||
* Nov 19, 2013 1531 mpduff Made graph resizable.
|
||||
* Nov 25, 2013 2545 mpduff Default to Opsnet if Network not available yet.
|
||||
* Dec 17, 2013 2633 mpduff Fix redraw problems.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -390,6 +391,7 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
cs = new CanvasSettings(740, heightWithBuffer, graphSize.x,
|
||||
graphSize.y, xSpaceBuffer, ySpaceBuffer);
|
||||
canvasSettingsMap.put(CanvasImages.GRAPH, cs);
|
||||
|
||||
graphCanvasSize.x = cs.getCanvasWidth();
|
||||
graphCanvasSize.y = cs.getCanvasHeight();
|
||||
graphCanvasSettings = cs;
|
||||
|
@ -405,7 +407,7 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
canvasSettingsMap.put(CanvasImages.Y_LABEL, cs);
|
||||
|
||||
// Create the X header canvas settings
|
||||
cs = new CanvasSettings(740, 60, 740, 60, 20, 0);
|
||||
cs = new CanvasSettings(740, 60, graphSize.x, 60, 20, 0);
|
||||
canvasSettingsMap.put(CanvasImages.X_HEADER, cs);
|
||||
|
||||
// Create the y header canvas settings
|
||||
|
@ -421,7 +423,7 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
canvasSettingsMap.put(CanvasImages.UTILIZATION_GRAPH, cs);
|
||||
|
||||
// Create the Utilization header canvas settings
|
||||
cs = new CanvasSettings(740, utilizationHeaderHeight, 740,
|
||||
cs = new CanvasSettings(740, utilizationHeaderHeight, graphSize.x,
|
||||
utilizationHeaderHeight, xSpaceBuffer, 0);
|
||||
canvasSettingsMap.put(CanvasImages.UTILIZATION_HEADER, cs);
|
||||
}
|
||||
|
@ -1416,8 +1418,8 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
imageMgr.setCanvasSetting(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
imageMgr.generateImages(bgd);
|
||||
updateCanvases();
|
||||
imageMgr.generateImages(bgd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1553,7 +1555,10 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setGraphData(graphDataUtil.getGraphData(false));
|
||||
setGraphData(graphDataUtil.getGraphData(true));
|
||||
updateCanvasSettings();
|
||||
updateCanvases();
|
||||
layout();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1622,6 +1627,9 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
- getCanvasHeight(CanvasImages.UTILIZATION_HEADER)
|
||||
- getCanvasHeight(CanvasImages.UTILIZATION_GRAPH);
|
||||
|
||||
this.graphCanvasSettings.setImageWidth(graphCanvasWidth);
|
||||
this.graphCanvasSettings.setImageHeight(graphCanvasHeight);
|
||||
|
||||
// X Header canvas
|
||||
CanvasSettings settings = this
|
||||
.getCanvasSettings(CanvasImages.X_HEADER);
|
||||
|
@ -1671,6 +1679,8 @@ public class BandwidthCanvasComp extends Composite implements IDialogClosed,
|
|||
settings = this.getCanvasSettings(CanvasImages.GRAPH);
|
||||
settings.updateCanvas(graphCanvasWidth, graphCanvasHeight,
|
||||
graphSize.x, graphSize.y);
|
||||
graphCanvasSettings.setDrawWidth(graphSize.x);
|
||||
graphCanvasSettings.setDrawHeight(graphSize.y);
|
||||
|
||||
((GridData) graphCanvas.getLayoutData()).widthHint = graphCanvasWidth;
|
||||
((GridData) graphCanvas.getLayoutData()).heightHint = graphCanvasHeight;
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.uf.viz.core.RGBColors;
|
|||
* Jan 28, 2013 1529 djohnson Add hasSubscriptionNameChecked().
|
||||
* Oct 28, 2013 2430 mpduff Add % of bandwidth utilized graph.
|
||||
* Nov 19, 2013 1531 mpduff Update the settings.
|
||||
* Dec 17, 2013 2633 mpduff Keep data used to regenerate images.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -143,7 +144,7 @@ public class BandwidthImageMgr implements IGraphOptions {
|
|||
|
||||
private final Composite parentComp;
|
||||
|
||||
private final BandwidthGraphData graphData;
|
||||
private BandwidthGraphData graphData;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -256,6 +257,7 @@ public class BandwidthImageMgr implements IGraphOptions {
|
|||
* The graph data object
|
||||
*/
|
||||
public void generateImages(BandwidthGraphData graphData) {
|
||||
this.graphData = graphData;
|
||||
for (CanvasImages ci : CanvasImages.values()) {
|
||||
canvasImgMap.get(ci).regenerateImage(graphData);
|
||||
}
|
||||
|
|
|
@ -26,8 +26,6 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
|
@ -68,6 +66,8 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
|
||||
import com.raytheon.uf.common.site.SiteData;
|
||||
import com.raytheon.uf.common.site.SiteMap;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -143,6 +143,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* Oct 25, 2013 2292 mpduff Move overlap checks to edex.
|
||||
* Nov 06, 2013 2358 mpduff Resurrected file management code.
|
||||
* Nov 08, 2013 2506 bgonzale Removed send notification when a subscription is deleted.
|
||||
* Dec 05, 2013 2570 skorolev Show All subscriptions.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -229,7 +230,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
private final ISubscriptionNotificationService subscriptionNotificationService = DataDeliveryServices
|
||||
.getSubscriptionNotificationService();
|
||||
|
||||
private final ISubscriptionManagerFilter filter;
|
||||
private ISubscriptionManagerFilter filter;
|
||||
|
||||
/** The selected office */
|
||||
private String selectedOffice;
|
||||
|
@ -237,9 +238,6 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
/** The selected group */
|
||||
private String selectedGroup;
|
||||
|
||||
/** The office display list */
|
||||
private final SortedSet<String> officeDisplayItems = new TreeSet<String>();
|
||||
|
||||
/** Load config dialog */
|
||||
private LoadSaveConfigDlg loadDlg;
|
||||
|
||||
|
@ -249,6 +247,12 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
/** SaveAs config dialog */
|
||||
private LoadSaveConfigDlg saveAsDlg;
|
||||
|
||||
/** Option to select all subscriptions */
|
||||
private final String ALL = "ALL";
|
||||
|
||||
/** Option to select all groups of subscriptions */
|
||||
private final String ALL_SUBSCRIPTIONS = "All Subscriptions";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -597,14 +601,13 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
|
||||
// Office Selection Combo Box
|
||||
GridData comboData = new GridData(85, SWT.DEFAULT);
|
||||
officeCbo = new Combo(officeComp, SWT.READ_ONLY);
|
||||
officeCbo = new Combo(officeComp, SWT.READ_ONLY | SWT.BORDER);
|
||||
officeCbo.setLayoutData(comboData);
|
||||
officeCbo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
handleFilterSelection();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Group label
|
||||
|
@ -1005,6 +1008,12 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
public List<Subscription> getSubscriptions(
|
||||
ISubscriptionHandler subscriptionHandler)
|
||||
throws RegistryHandlerException {
|
||||
|
||||
if (!office.equals(ALL)) {
|
||||
filter = SubscriptionManagerFilters.getBySiteId(office);
|
||||
} else {
|
||||
filter = SubscriptionManagerFilters.getAll();
|
||||
}
|
||||
final List<Subscription> results = filter
|
||||
.getSubscriptions(subscriptionHandler);
|
||||
|
||||
|
@ -1013,11 +1022,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
for (Iterator<Subscription> iter = results.iterator(); iter
|
||||
.hasNext();) {
|
||||
Subscription subscription = iter.next();
|
||||
if ((office == null || "ALL".equals(office) || subscription
|
||||
.getOfficeIDs().contains(office))
|
||||
&& (group == null
|
||||
|| "All Subscriptions".equals(group) || group
|
||||
.equals(subscription.getGroupName()))) {
|
||||
if (group == null || ALL_SUBSCRIPTIONS.equals(group)
|
||||
|| group.equals(subscription.getGroupName())) {
|
||||
continue;
|
||||
}
|
||||
iter.remove();
|
||||
|
@ -1173,7 +1179,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
|
||||
List<String> groupNameList = GroupDefinitionManager.getGroupNames();
|
||||
|
||||
groupNameList.add(0, "All Subscriptions");
|
||||
groupNameList.add(0, ALL_SUBSCRIPTIONS);
|
||||
groupNames = groupNameList.toArray(new String[0]);
|
||||
groupCbo.setItems(groupNames);
|
||||
|
||||
|
@ -1188,34 +1194,23 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
|||
* Return the list of office names available. Default is "ALL" office ids
|
||||
*/
|
||||
public void loadOfficeNames() {
|
||||
int numRows = tableComp.getTable().getItemCount();
|
||||
|
||||
if (numRows > 0) {
|
||||
for (int i = 0; i < numRows; i++) {
|
||||
Map<String, SiteData> siteData = SiteMap.getInstance().getSiteData();
|
||||
Set<String> sites = siteData.keySet();
|
||||
|
||||
SubscriptionManagerRowData rowData = tableComp
|
||||
.getSubscriptionData().getDataRow(i);
|
||||
Set<String> office = rowData.getOfficeIds();
|
||||
officeDisplayItems.addAll(office);
|
||||
}
|
||||
}
|
||||
|
||||
officeNames = officeDisplayItems.toArray(new String[officeDisplayItems
|
||||
.size()]);
|
||||
officeNames = sites.toArray(new String[sites.size()]);
|
||||
String[] officeAll = new String[officeNames.length + 1];
|
||||
|
||||
officeAll[0] = "ALL";
|
||||
officeAll[0] = ALL;
|
||||
|
||||
System.arraycopy(officeNames, 0, officeAll, 1, officeNames.length);
|
||||
officeCbo.setItems(officeAll);
|
||||
|
||||
String site = CURRENT_SITE;
|
||||
if (this.selectedOffice != null) {
|
||||
for (Iterator<String> iter = officeDisplayItems.iterator(); iter
|
||||
.hasNext();) {
|
||||
String next = iter.next();
|
||||
if (next.equals(selectedOffice)) {
|
||||
site = next;
|
||||
for (String item : officeAll) {
|
||||
if (item.equals(selectedOffice)) {
|
||||
site = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
# ----------------------------------------------------------------
|
||||
# Returns heat index or wind chill
|
||||
#
|
||||
# History
|
||||
# 12/02/2013 DR 14455 Qinglu Lin Changed 1.85200 to 3.6 at
|
||||
# wSpd_kmh = wSpd * 1.85200
|
||||
# ----------------------------------------------------------------
|
||||
import numpy
|
||||
import T
|
||||
|
@ -62,7 +64,7 @@ def execute2(temperature,dewpoint,relHumidity,windSpeed):
|
|||
def execute3(T,DpT,wSpd):
|
||||
TC = T - 273.15 #convert from K to C
|
||||
DpTC = DpT - 273.15 #convert to from K to C
|
||||
wSpd_kmh = wSpd * 1.85200 #convert from m/s to km/h
|
||||
wSpd_kmh = wSpd * 3.6 #convert from m/s to km/h
|
||||
Hi = HeatIndex.calculate(TC,DpTC) #Outputs Celsius
|
||||
Wc = WindChill.calculate(TC,wSpd_kmh) #Outputs Celsius
|
||||
HiK = numpy.where(Hi != -9999.0, celciusToKelvin(Hi),-9999.0)
|
||||
|
|
BIN
cave/com.raytheon.uf.viz.monitor.scan/.dm/.dirs.dmdb
Normal file
BIN
cave/com.raytheon.uf.viz.monitor.scan/.dm/.dirs.dmdb
Normal file
Binary file not shown.
BIN
cave/com.raytheon.uf.viz.monitor.scan/src/.dm/.dirs.dmdb
Normal file
BIN
cave/com.raytheon.uf.viz.monitor.scan/src/.dm/.dirs.dmdb
Normal file
Binary file not shown.
BIN
cave/com.raytheon.uf.viz.monitor.scan/src/com/.dm/.dirs.dmdb
Normal file
BIN
cave/com.raytheon.uf.viz.monitor.scan/src/com/.dm/.dirs.dmdb
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -192,6 +192,7 @@ public class ScanResourceData extends AbstractRequestableResourceData {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
getScan().closeDialog(icao);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -2,6 +2,7 @@
|
|||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension-point id="tearoffperspective" name="tearoffperspective" schema="schema/tearoffperspective.exsd"/>
|
||||
<extension-point id="com.raytheon.uf.viz.ui.menus.contribItemProvider" name="contribItemProvider" schema="schema/com.raytheon.uf.viz.ui.menus.contribItemProvider.exsd"/>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="com.raytheon.uf.viz.ui.menus" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="com.raytheon.uf.viz.ui.menus" id="com.raytheon.uf.viz.ui.menus.contribItemProvider" name="contribItemProvider"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence minOccurs="1" maxOccurs="unbounded">
|
||||
<element ref="contributionItemProvider"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="contributionItemProvider">
|
||||
<complexType>
|
||||
<attribute name="contribution" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="itemProvider" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
|
@ -37,7 +37,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.viz.core.VariableSubstitutionUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.jobs.JobPool;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.AbstractMenuContributionItem;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
|
||||
/**
|
||||
|
@ -46,11 +46,12 @@ import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 26, 2009 chammack Initial creation
|
||||
* May 08, 2013 1978 bsteffen Perform variable substitution on subMenu
|
||||
* IDs.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Mar 26, 2009 chammack Initial creation
|
||||
* May 08, 2013 1978 bsteffen Perform variable substitution on subMenu
|
||||
* IDs.
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -120,8 +121,8 @@ public class SubmenuContributionItem extends MenuManager {
|
|||
|
||||
for (int i = 0; i < contribs.length; i++) {
|
||||
try {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(contribs[i].getClass());
|
||||
IContribItemProvider amc = MenuXMLMap
|
||||
.getProvider(contribs[i].getClass());
|
||||
contributionItems[i] = amc.getContributionItems(
|
||||
contribs[i], this.subs, this.removals);
|
||||
|
||||
|
|
|
@ -42,14 +42,16 @@ import com.raytheon.uf.viz.ui.menus.DiscoverMenuContributions;
|
|||
import com.raytheon.uf.viz.ui.menus.widgets.SubmenuContributionItem;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Providex ability to include menus from other localization files.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 27, 2009 chammack Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Apr 27, 2009 chammack Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -103,8 +105,8 @@ public class IncludeMenuContribution extends
|
|||
|
||||
if (mtf.contributions != null) {
|
||||
for (CommonAbstractMenuContribution c : mtf.contributions) {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(c.getClass());
|
||||
IContribItemProvider amc = MenuXMLMap.getProvider(c
|
||||
.getClass());
|
||||
IContributionItem[] contribItems = amc
|
||||
.getContributionItems(c, combinedSub, removals);
|
||||
if (contribItems != null && contribItems.length > 0) {
|
||||
|
|
|
@ -52,9 +52,10 @@ import com.raytheon.uf.viz.ui.menus.widgets.SubmenuContributionItem;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 12, 2009 chammack Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Mar 12, 2009 chammack Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -136,8 +137,8 @@ public class IncludeMenuItem extends CommonIncludeMenuItem implements
|
|||
|
||||
if (mtf.contributions != null) {
|
||||
for (CommonAbstractMenuContribution c : mtf.contributions) {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(c.getClass());
|
||||
IContribItemProvider amc = MenuXMLMap.getProvider(c
|
||||
.getClass());
|
||||
if (removalsSet.contains(c.id))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -22,6 +22,14 @@ package com.raytheon.uf.viz.ui.menus.xml;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonCommandContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonDynamicMenuContribution;
|
||||
|
@ -31,6 +39,9 @@ import com.raytheon.uf.common.menus.xml.CommonSeparatorMenuContribution;
|
|||
import com.raytheon.uf.common.menus.xml.CommonSubmenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonTitleContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -38,10 +49,11 @@ import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 28, 2010 mnash Initial creation
|
||||
* Jul 31, 2012 875 rferrel Added DynamicMenuContribution.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jun 28, 2010 mnash Initial creation
|
||||
* Jul 31, 2012 875 rferrel Added DynamicMenuContribution.
|
||||
* Dec 11, 2013 2602 bsteffen Load providers from extension point.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,9 +62,16 @@ import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
|||
*/
|
||||
|
||||
public class MenuXMLMap {
|
||||
public static final Map<Class<?>, AbstractMenuContributionItem<?>> xmlMapping = new HashMap<Class<?>, AbstractMenuContributionItem<?>>();
|
||||
|
||||
static {
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DynamicMenuContribution.class);
|
||||
|
||||
private static final String EXTENSION_ID = "com.raytheon.uf.viz.ui.menus.contribItemProvider";
|
||||
|
||||
private static final Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> xmlMapping = init();
|
||||
|
||||
private static Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> init() {
|
||||
Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> xmlMapping = new HashMap<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider>();
|
||||
xmlMapping.put(CommonBundleMenuContribution.class,
|
||||
new BundleMenuContribution());
|
||||
xmlMapping.put(CommonCommandContribution.class,
|
||||
|
@ -70,10 +89,31 @@ public class MenuXMLMap {
|
|||
new ToolbarSubmenuContribution());
|
||||
xmlMapping.put(CommonDynamicMenuContribution.class,
|
||||
new DynamicMenuContribution());
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
IExtensionPoint point = registry.getExtensionPoint(EXTENSION_ID);
|
||||
if (point != null) {
|
||||
IExtension[] extensions = point.getExtensions();
|
||||
for (IExtension extension : extensions) {
|
||||
for (IConfigurationElement element : extension
|
||||
.getConfigurationElements()) {
|
||||
try {
|
||||
CommonAbstractMenuContribution contrib = (CommonAbstractMenuContribution) element
|
||||
.createExecutableExtension("contribution");
|
||||
IContribItemProvider provider = (IContribItemProvider) element
|
||||
.createExecutableExtension("itemProvider");
|
||||
xmlMapping.put(contrib.getClass(), provider);
|
||||
} catch (CoreException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error preparing menu contributions.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return xmlMapping;
|
||||
}
|
||||
|
||||
public static void registerMapping(Class<?> clazz,
|
||||
AbstractMenuContributionItem<?> item) {
|
||||
xmlMapping.put(clazz, item);
|
||||
public static IContribItemProvider getProvider(
|
||||
Class<? extends CommonAbstractMenuContribution> contribClass) {
|
||||
return xmlMapping.get(contribClass);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,23 @@ import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.ui.menus.widgets.ToolbarSubmenuContributionItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution for adding submenus to a tool bar.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolbarSubmenuContribution extends
|
||||
AbstractMenuContributionItem<CommonToolbarSubmenuContribution> {
|
||||
|
||||
|
@ -52,8 +69,8 @@ public class ToolbarSubmenuContribution extends
|
|||
List<IContributionItem> contribItemList = new ArrayList<IContributionItem>();
|
||||
|
||||
for (CommonAbstractMenuContribution amc : item.contributions) {
|
||||
AbstractMenuContributionItem<?> common = MenuXMLMap.xmlMapping
|
||||
.get(amc.getClass());
|
||||
IContribItemProvider common = MenuXMLMap
|
||||
.getProvider(amc.getClass());
|
||||
contribItemList.addAll(Arrays.asList(common.getContributionItems(
|
||||
amc, subs, removals)));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# CAVE startup script
|
||||
# Note: CAVE will not run as 'root'
|
||||
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Dec 04, 2013 #2589 dgilling Create command-line arg that controls
|
||||
# xvfb initialization.
|
||||
# Dec 05, 2013 #2593 rjpeter set IGNORE_NUM_CAVES
|
||||
# Dec 05, 2013 #2590 dgilling Remove duplicated code and call to
|
||||
# cave.sh.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
user=`/usr/bin/whoami`
|
||||
if [ ${user} == 'root' ];then
|
||||
echo "WARNING: CAVE cannot be run as user '${user}'!"
|
||||
|
@ -16,75 +48,44 @@ if [ ${RC} -ne 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
dir=${0%/*}
|
||||
PROGRAM_NAME="gfeclient"
|
||||
|
||||
if [ "$dir" = "$0" ]; then
|
||||
|
||||
dir="."
|
||||
|
||||
fi
|
||||
|
||||
cd "$dir"
|
||||
|
||||
# Since, we no longer need to worry about re-location ...
|
||||
CAVE_INSTALL="/awips2/cave"
|
||||
JAVA_INSTALL="/awips2/java"
|
||||
PYTHON_INSTALL="/awips2/python"
|
||||
|
||||
export AWIPS_INSTALL_DIR="${CAVE_INSTALL}"
|
||||
|
||||
export LD_LIBRARY_PATH=${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:$LD_LIBRARY_PATH
|
||||
export PATH=${JAVA_INSTALL}/bin:${PYTHON_INSTALL}/bin:$PATH
|
||||
export JAVA_HOME="${JAVA_INSTALL}/jre"
|
||||
|
||||
# The user can update this field if they choose to do so.
|
||||
export HYDRO_APPS_DIR="/awips2/edex/data/hdf5/hydroapps"
|
||||
|
||||
TESTCHECK="$TMCP_HOME/bin/getTestMode"
|
||||
if [ -x ${TESTCHECK} ]; then
|
||||
echo "Calling getTestMode()"
|
||||
${TESTCHECK}
|
||||
status=${?}
|
||||
if [ $status -eq 11 ]; then
|
||||
MODE="TEST"
|
||||
SWITCHES=" -mode TEST "
|
||||
elif [ $status -eq 12 ];then
|
||||
MODE="PRACTICE"
|
||||
SWITCHES=" -mode PRACTICE "
|
||||
elif [ $status -eq 15 ];then
|
||||
MODE="OPERATIONAL"
|
||||
SWITCHES=" -mode OPERATIONAL"
|
||||
# remove "-enablegl" flag from command-line if set so it doesn't confuse any
|
||||
# commands we call later.
|
||||
USER_ARGS=()
|
||||
while [[ $1 ]]
|
||||
do
|
||||
if [ "$1" == "-enablegl" ]
|
||||
then
|
||||
ENABLEGL="true"
|
||||
else
|
||||
MODE="OPERATIONAL (no response)"
|
||||
SWITCHES=" "
|
||||
USER_ARGS+=("$1")
|
||||
fi
|
||||
echo "getTestMode() returned ${MODE}"
|
||||
else
|
||||
MODE="UNKNOWN"
|
||||
echo "getTestMode() not found - going to use defaults"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
export TEXTWS=`hostname | sed -e 's/lx/xt/g'`
|
||||
|
||||
# if display not set
|
||||
if [ -n "$DISPLAY" ]
|
||||
if [ -n "$ENABLEGL" ]
|
||||
then
|
||||
# if display not set
|
||||
if [ -n "$DISPLAY" ]
|
||||
then
|
||||
echo "Using Display set to $DISPLAY"
|
||||
extendLibraryPath
|
||||
else
|
||||
else
|
||||
echo "Display not set, creating offscreen x on port $$"
|
||||
extendLibraryPath "-noX"
|
||||
Xvfb :$$ -screen 0 1280x1024x24 &
|
||||
xvfb=$!
|
||||
export DISPLAY="localhost:$$.0"
|
||||
#don't use shader when no display set
|
||||
export SWITCHES="${SWITCHES} -no_shader"
|
||||
SWITCHES="${SWITCHES} -no_shader"
|
||||
fi
|
||||
fi
|
||||
|
||||
COMPONENT_ARGS="-component gfeclient"
|
||||
export LD_PRELOAD=libpython.so
|
||||
lookupINI ${COMPONENT_ARGS}
|
||||
/awips2/cave/cave ${SWITCHES} ${CAVE_INI_ARG} -nosplash ${COMPONENT_ARGS} "$@"
|
||||
export IGNORE_NUM_CAVES=1
|
||||
|
||||
source /awips2/cave/cave.sh -nosplash -noredirect -component gfeclient "${USER_ARGS[@]}" &
|
||||
wait
|
||||
|
||||
if [ -n "$xvfb" ]
|
||||
then
|
||||
|
|
|
@ -1,5 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Dec 04, 2013 #2589 dgilling Create command-line arg that controls
|
||||
# xvfb initialization.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# get path to cave
|
||||
path_to_script=`readlink -f $0`
|
||||
RUN_FROM_DIR=`dirname $path_to_script`
|
||||
|
@ -9,7 +37,8 @@ CAVE_DIR=/awips2/cave
|
|||
|
||||
# execute the runProcedure module
|
||||
_GFECLI="${RUN_FROM_DIR}/gfeclient.sh"
|
||||
_MODULE="${RUN_FROM_DIR}/src/ifpimage/PngWriter.py"
|
||||
_GFECLI_ARGS="-enablegl"
|
||||
_MODULE="${CAVE_DIR}/etc/gfe/utility/PngWriter.py"
|
||||
|
||||
# quoting of '$@' is used to prevent command line interpretation
|
||||
if [ ! -f $_GFECLI ] || [ ! -d $CAVE_DIR ]
|
||||
|
@ -17,6 +46,6 @@ then
|
|||
echo "CAVE and/or gfeclient not installed on this workstation ..exiting"
|
||||
exit 1
|
||||
else
|
||||
$_GFECLI $_MODULE "$@"
|
||||
$_GFECLI $_GFECLI_ARGS $_MODULE "$@"
|
||||
fi
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ import java.io.File;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import jep.Jep;
|
||||
import jep.JepException;
|
||||
|
@ -35,6 +37,7 @@ import com.raytheon.uf.common.python.PyUtil;
|
|||
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.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.viz.gfe.python.GfeCavePyIncludeUtil;
|
||||
|
@ -54,6 +57,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* Sep 11, 2013 #2033 dgilling Update path to utilityDir and pyVizDir,
|
||||
* now that they're no longer in
|
||||
* localization store.
|
||||
* Dec 04, 2013 #2588 dgilling Add thread to force shutdown.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -158,6 +162,23 @@ public class GfeClient extends AbstractCAVEComponent {
|
|||
long t1 = System.currentTimeMillis();
|
||||
System.out.println("Entire execution to run python script: "
|
||||
+ (t1 - t0));
|
||||
|
||||
// operationally, we've found situations where gfeclient jobs seem to
|
||||
// hang around running even though all non-daemon threads have completed
|
||||
// their work. So, in attempt to prevent those cases from hanging around
|
||||
// as "zombie" processes let's set a timer to kill the JVM if things
|
||||
// haven't exited by themselves.
|
||||
Timer shutdownTimer = new Timer("gfe-client-shutdown", true);
|
||||
TimerTask shutdownTask = new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
statusHandler
|
||||
.warn("GFEClient should have already exited, but it hasn't. Manually exiting.");
|
||||
System.exit(0);
|
||||
}
|
||||
};
|
||||
shutdownTimer.schedule(shutdownTask, 45 * TimeUtil.MILLIS_PER_SECOND);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -44,10 +44,15 @@ import org.eclipse.swt.widgets.Text;
|
|||
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;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.server.lock.Lock;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.slice.DiscreteGridSlice;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.slice.ScalarGridSlice;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.slice.VectorGridSlice;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.slice.WeatherGridSlice;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.weather.WeatherKey;
|
||||
import com.raytheon.uf.common.message.WsId;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
|
@ -79,7 +84,10 @@ 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
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.getUnixTime into TimeUtil
|
||||
* Dec 03, 2013 2597 randerso Fixed spacing when displaying multiple grid histories.
|
||||
* Fixed weather element state and data distribution for
|
||||
* Weather and Discrete elements.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -107,9 +115,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
|
||||
// set gridInfoText to be Text
|
||||
private Text gridInfoText;
|
||||
|
||||
|
||||
private SimpleDateFormat gmtFormatter;
|
||||
|
||||
|
||||
public GridInfoDialog(Shell parent, Parm parm, Date clickTime) {
|
||||
super(parent);
|
||||
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
|
||||
|
@ -129,7 +137,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
GridLayout layout = (GridLayout) top.getLayout();
|
||||
layout.numColumns = 2;
|
||||
layout.makeColumnsEqualWidth = false;
|
||||
|
||||
|
||||
initializeComponents();
|
||||
|
||||
return top;
|
||||
|
@ -145,52 +153,48 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
b.setText(gridInfoElements[i]);
|
||||
b.addSelectionListener(this);
|
||||
}
|
||||
|
||||
// Composite composite2 = new Composite(top, SWT.NONE);
|
||||
// layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true);
|
||||
// composite2.setLayoutData(layoutData);
|
||||
// composite2.setLayout(new GridLayout(1, true));
|
||||
|
||||
gridInfoText = new Text(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.READ_ONLY);
|
||||
gridInfoText = new Text(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL
|
||||
| SWT.READ_ONLY);
|
||||
layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gridInfoText.setBackground(group.getBackground());
|
||||
gridInfoText.setLayoutData(layoutData);
|
||||
}
|
||||
|
||||
/*
|
||||
* adjust the width of the dialog
|
||||
*/
|
||||
private void adjustDlg(String infoText){
|
||||
int screenWidth = this.getParentShell().getDisplay().
|
||||
getPrimaryMonitor().getBounds().width;
|
||||
int maxWidth = (int)Math.round(screenWidth * 0.75);
|
||||
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
int maxLength = getMaxWidth(infoText);
|
||||
if ( maxLength > maxWidth ) {
|
||||
gd.widthHint = maxWidth;
|
||||
gridInfoText.setLayoutData(gd);
|
||||
} else {
|
||||
gridInfoText.setLayoutData(gd);
|
||||
}
|
||||
gridInfoText.setText(infoText);
|
||||
}
|
||||
|
||||
/*
|
||||
* get the maximum width of the info
|
||||
*/
|
||||
private int getMaxWidth(String textInfo){
|
||||
String[] splits = textInfo.split("\\n");
|
||||
GC gc = new GC (gridInfoText);
|
||||
FontMetrics fm = gc.getFontMetrics ();
|
||||
int acw = fm.getAverageCharWidth ();
|
||||
int maxStr = 0;
|
||||
for (String str : splits){
|
||||
maxStr = Math.max(maxStr, str.length());
|
||||
}
|
||||
return maxStr*acw;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* adjust the width of the dialog
|
||||
*/
|
||||
private void adjustDlg(String infoText) {
|
||||
int screenWidth = this.getParentShell().getDisplay()
|
||||
.getPrimaryMonitor().getBounds().width;
|
||||
int maxWidth = (int) Math.round(screenWidth * 0.75);
|
||||
|
||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
int maxLength = getMaxWidth(infoText);
|
||||
if (maxLength > maxWidth) {
|
||||
gd.widthHint = maxWidth;
|
||||
gridInfoText.setLayoutData(gd);
|
||||
} else {
|
||||
gridInfoText.setLayoutData(gd);
|
||||
}
|
||||
gridInfoText.setText(infoText);
|
||||
}
|
||||
|
||||
/*
|
||||
* get the maximum width of the info
|
||||
*/
|
||||
private int getMaxWidth(String textInfo) {
|
||||
String[] splits = textInfo.split("\\n");
|
||||
GC gc = new GC(gridInfoText);
|
||||
FontMetrics fm = gc.getFontMetrics();
|
||||
int acw = fm.getAverageCharWidth();
|
||||
int maxStr = 0;
|
||||
for (String str : splits) {
|
||||
maxStr = Math.max(maxStr, str.length());
|
||||
}
|
||||
return maxStr * acw;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
super.createButton(parent, Window.CANCEL, "Cancel", false);
|
||||
|
@ -239,17 +243,17 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
String choice = b.getText();
|
||||
|
||||
if (choice.equalsIgnoreCase("Grid Info")) {
|
||||
adjustDlg(getGridInfo());
|
||||
adjustDlg(getGridInfo());
|
||||
} else if (choice.equalsIgnoreCase("Grid History")) {
|
||||
adjustDlg(getGridHistory());
|
||||
} else if (choice.equalsIgnoreCase("ISC History")) {
|
||||
adjustDlg(getISCHistory());
|
||||
} else if (choice.equalsIgnoreCase("Weather Element Info")) {
|
||||
adjustDlg(getWEInfo());
|
||||
adjustDlg(getWEInfo());
|
||||
} else if (choice.equalsIgnoreCase("Weather Element State")) {
|
||||
adjustDlg(getWEState());
|
||||
} else if (choice.equalsIgnoreCase("Locks")) {
|
||||
adjustDlg(getLockInfo());
|
||||
adjustDlg(getLockInfo());
|
||||
} else if (choice.equalsIgnoreCase("Data Distribution")) {
|
||||
adjustDlg(getDataDistribution());
|
||||
} else {
|
||||
|
@ -266,8 +270,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
List<Lock> locks = parm.getLockTable().getLocks();
|
||||
|
||||
if (locks.isEmpty()) {
|
||||
info.append("Weather element is not locked");
|
||||
info.append("\nWeather element is not locked");
|
||||
} else {
|
||||
info.append("\n");
|
||||
for (Lock lock : locks) {
|
||||
info.append("(")
|
||||
.append(gmtFormatter.format(lock.getTimeRange()
|
||||
|
@ -303,9 +308,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
grid = iscGridID.grid();
|
||||
}
|
||||
if (grid == null) {
|
||||
info.append("No ISC Grid");
|
||||
info.append("\nNo ISC Grid");
|
||||
} else {
|
||||
info.append("ISC Grid Valid Time: ").append(grid.getGridTime())
|
||||
info.append("\nISC Grid Valid Time: ").append(grid.getGridTime())
|
||||
.append("\n\n");
|
||||
|
||||
GridDataHistory[] history = grid.getHistory();
|
||||
|
@ -360,50 +365,48 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)
|
||||
|| parm.getGridInfo().getGridType().equals(GridType.VECTOR)) {
|
||||
|
||||
info.append("Fuzz Value: ")
|
||||
info.append("\nFuzz Value: ")
|
||||
.append(parm.getParmState().getFuzzValue()).append("\n");
|
||||
|
||||
if (parm.isMutable()) {
|
||||
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)
|
||||
|| parm.getGridInfo().getGridType()
|
||||
.equals(GridType.VECTOR)) {
|
||||
info.append("Delta value: ")
|
||||
.append(parm.getParmState().getDeltaValue())
|
||||
.append("\n");
|
||||
}
|
||||
info.append("Assign Value: ")
|
||||
.append(parm.getParmState().getPickUpValue())
|
||||
.append("\n");
|
||||
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.VECTOR)) {
|
||||
info.append("Vector Edit Mode: ")
|
||||
.append(parm.getParmState().getVectorMode())
|
||||
.append("\n");
|
||||
}
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.DISCRETE)
|
||||
|| parm.getGridInfo().getGridType()
|
||||
.equals(GridType.WEATHER)) {
|
||||
info.append("Weather/Discrete Combine Mode: ")
|
||||
.append(parm.getParmState().getCombineMode())
|
||||
.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
info.append("Selected: ")
|
||||
.append((parm.getParmState().isSelected() ? "Yes" : "No"))
|
||||
.append("\n");
|
||||
|
||||
if (parm.getParmState().isSelected()) {
|
||||
info.append("Selected Time Range: ")
|
||||
.append(this.timeRangeToGMT(parm.getParmState()
|
||||
.getSelectedTimeRange())).append("\n");
|
||||
}
|
||||
info.append("Graphic Color: ")
|
||||
.append(formatRGB(parm.getDisplayAttributes()
|
||||
.getBaseColor())).append("\n");
|
||||
}
|
||||
|
||||
if (parm.isMutable()) {
|
||||
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)
|
||||
|| parm.getGridInfo().getGridType().equals(GridType.VECTOR)) {
|
||||
info.append("Delta value: ")
|
||||
.append(parm.getParmState().getDeltaValue())
|
||||
.append("\n");
|
||||
}
|
||||
info.append("Assign Value: ")
|
||||
.append(parm.getParmState().getPickUpValue()).append("\n");
|
||||
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.VECTOR)) {
|
||||
info.append("Vector Edit Mode: ")
|
||||
.append(parm.getParmState().getVectorMode())
|
||||
.append("\n");
|
||||
}
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.DISCRETE)
|
||||
|| parm.getGridInfo().getGridType()
|
||||
.equals(GridType.WEATHER)) {
|
||||
info.append("Weather/Discrete Combine Mode: ")
|
||||
.append(parm.getParmState().getCombineMode())
|
||||
.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
info.append("Selected: ")
|
||||
.append((parm.getParmState().isSelected() ? "Yes" : "No"))
|
||||
.append("\n");
|
||||
|
||||
if (parm.getParmState().isSelected()) {
|
||||
info.append("Selected Time Range: ")
|
||||
.append(this.timeRangeToGMT(parm.getParmState()
|
||||
.getSelectedTimeRange())).append("\n");
|
||||
}
|
||||
info.append("Graphic Color: ")
|
||||
.append(formatRGB(parm.getDisplayAttributes().getBaseColor()))
|
||||
.append("\n");
|
||||
|
||||
return info.toString();
|
||||
}
|
||||
|
||||
|
@ -426,14 +429,26 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
return value;
|
||||
}
|
||||
|
||||
private int[] calcCounts(Grid2DByte grid, int numKeys) {
|
||||
int[] counts = new int[numKeys];
|
||||
|
||||
byte[] data = grid.getBytes();
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
int index = data[i] & 0xFF;
|
||||
counts[index]++;
|
||||
}
|
||||
return counts;
|
||||
}
|
||||
|
||||
private String getDataDistribution() {
|
||||
|
||||
StringBuilder info = new StringBuilder();
|
||||
info.append(getBoxTitle(gridData, true, "Data Distribution"));
|
||||
|
||||
if (gridData == null) {
|
||||
info.append("No Grid");
|
||||
info.append("\nNo Grid");
|
||||
} else {
|
||||
info.append("\n");
|
||||
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)) {
|
||||
Grid2DFloat grid = ((ScalarGridSlice) gridData.getGridSlice())
|
||||
.getScalarGrid();
|
||||
|
@ -450,23 +465,29 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
.append(getMaxMin(grid, false)).append("\n");
|
||||
} else if (parm.getGridInfo().getGridType()
|
||||
.equals(GridType.WEATHER)) {
|
||||
WeatherGridSlice slice = (WeatherGridSlice) gridData
|
||||
.getGridSlice();
|
||||
Grid2DByte grid = slice.getWeatherGrid();
|
||||
WeatherKey[] keys = slice.getKeys();
|
||||
|
||||
// TODO
|
||||
// for i in xrange(len(dta[1])):
|
||||
// count = self._calcCounts(dta, i)
|
||||
// info += `count` + " ----> " \
|
||||
// + AFPS.WeatherKey_string(dta[1][i]).keyAsPrettyString() \
|
||||
// + "\n"
|
||||
int[] counts = calcCounts(grid, keys.length);
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
info.append(counts[i]).append(" ----> ");
|
||||
info.append(keys[i].toPrettyString());
|
||||
info.append("\n");
|
||||
}
|
||||
} else if (parm.getGridInfo().getGridType()
|
||||
.equals(GridType.DISCRETE)) {
|
||||
// TODO
|
||||
// elif grid.type() == AFPS.Parm.DISCRETE:
|
||||
// for i in xrange(len(dta[1])):
|
||||
// count = self._calcCounts(dta, i)
|
||||
// info += `count` + " ----> " \
|
||||
// + dta[1][i] \
|
||||
// + "\n" else:
|
||||
|
||||
DiscreteGridSlice slice = (DiscreteGridSlice) gridData
|
||||
.getGridSlice();
|
||||
Grid2DByte grid = slice.getDiscreteGrid();
|
||||
DiscreteKey[] keys = slice.getKey();
|
||||
int[] counts = calcCounts(grid, keys.length);
|
||||
for (int i = 0; i < keys.length; i++) {
|
||||
info.append(counts[i]).append(" ----> ");
|
||||
info.append(keys[i].toString());
|
||||
info.append("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,9 +500,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
info.append(getBoxTitle(gridData, true, "Grid Information"));
|
||||
|
||||
if (gridData == null) {
|
||||
info.append("No Grid");
|
||||
info.append("\nNo Grid");
|
||||
} else {
|
||||
info.append("Grid okay to edit: ")
|
||||
info.append("\nGrid okay to edit: ")
|
||||
.append((gridData.isOkToEdit() ? "Yes" : "No"))
|
||||
.append("\n");
|
||||
|
||||
|
@ -513,7 +534,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
StringBuilder info = new StringBuilder();
|
||||
info.append(getBoxTitle(null, false, "Weather Element Information"));
|
||||
|
||||
info.append("Weather Element Name: ")
|
||||
info.append("\nWeather Element Name: ")
|
||||
.append(parm.getParmID().getParmName()).append("\n");
|
||||
|
||||
info.append("Weather Element Level: ")
|
||||
|
@ -587,7 +608,8 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
} else {
|
||||
for (GridDataHistory h : gridData.getHistory()) {
|
||||
|
||||
info.append("Grid origin: ").append(h.getOrigin()).append("\n");
|
||||
info.append("\nGrid origin: ").append(h.getOrigin())
|
||||
.append("\n");
|
||||
info.append("Original Source: ")
|
||||
.append(uiFormat.uiParmIDcollapsed(h.getOriginParm()))
|
||||
.append("\n");
|
||||
|
@ -678,7 +700,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
|
|||
info.append("\n");
|
||||
}
|
||||
|
||||
info.append("\n").append(title).append(":\n\n");
|
||||
info.append("\n").append(title).append(":\n");
|
||||
return info.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,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.SimulatedTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.auth.UserController;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -346,7 +347,20 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
|
|||
|
||||
Set<VtecObject> vtecsToAssignEtn = GFEVtecUtil
|
||||
.getVtecLinesThatNeedEtn(productText);
|
||||
Map<String, Integer> etnCache = new HashMap<String, Integer>();
|
||||
// With GFE VTEC products, it's possible to have multiple segments
|
||||
// with
|
||||
// NEW vtec action codes and the same phensig. For this reason,
|
||||
// HazardsTable.py implemented a "cache" that would ensure all NEWs
|
||||
// for
|
||||
// the same phensig would be assigned the same ETN. This Map
|
||||
// replicates
|
||||
// that legacy behavior.
|
||||
//
|
||||
// This "cache" has two levels:
|
||||
// 1. The first level is keyed by the hazard's phensig.
|
||||
// 2. The second level is keyed by the valid period of the hazard.
|
||||
// Effectively, making this a Map<Phensig, Map<ValidPeriod, ETN>>.
|
||||
Map<String, Map<TimeRange, Integer>> etnCache = new HashMap<String, Map<TimeRange, Integer>>();
|
||||
|
||||
for (VtecObject vtec : vtecsToAssignEtn) {
|
||||
try {
|
||||
|
@ -410,7 +424,15 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
|
|||
}
|
||||
}
|
||||
|
||||
etnCache.put(vtec.getPhensig(), serverResponse.getNextEtn());
|
||||
TimeRange validPeriod = new TimeRange(vtec.getStartTime()
|
||||
.getTime(), vtec.getEndTime().getTime());
|
||||
String phensig = vtec.getPhensig();
|
||||
Map<TimeRange, Integer> etnsByTR = etnCache.get(phensig);
|
||||
if (etnsByTR == null) {
|
||||
etnsByTR = new HashMap<TimeRange, Integer>();
|
||||
etnCache.put(phensig, etnsByTR);
|
||||
}
|
||||
etnsByTR.put(validPeriod, serverResponse.getNextEtn());
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.CRITICAL,
|
||||
"Error setting ETNs for product", e);
|
||||
|
|
|
@ -59,7 +59,6 @@ import org.opengis.referencing.operation.TransformException;
|
|||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
|
@ -98,6 +97,8 @@ import com.raytheon.viz.gfe.ui.zoneselector.ZoneSelector;
|
|||
* Oct 17, 2013 2481 randerso Fixed regression which cause configured level combinations
|
||||
* files to not be found. Removed message when combinations file
|
||||
* not found to match A1.
|
||||
* Dec 03, 2013 #2591 dgilling Ensure all change states to the combo
|
||||
* file are handled.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -985,8 +986,7 @@ public class ZoneCombinerComp extends Composite implements
|
|||
*/
|
||||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
if ((message.getChangeType().equals(FileChangeType.UPDATED))
|
||||
&& message.getFileName().equalsIgnoreCase(currentComboFile)) {
|
||||
if (message.getFileName().equalsIgnoreCase(currentComboFile)) {
|
||||
File file = new File(message.getFileName());
|
||||
String comboName = file.getName().replace(".py", "");
|
||||
statusHandler
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.regex.Matcher;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.raytheon.uf.common.activetable.response.GetNextEtnResponse;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.texteditor.util.VtecObject;
|
||||
|
@ -54,6 +55,9 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
|
|||
* phensig.
|
||||
* Aug 29, 2013 #1843 dgilling Add hooks for inter-site ETN assignment.
|
||||
* Oct 21, 2013 #1843 dgilling Use new GetNextEtnResponse.
|
||||
* Nov 22, 2013 #2578 dgilling Fix ETN assignment for products with
|
||||
* multiple NEW VTEC lines for the same
|
||||
* phensig but disjoint TimeRanges.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -222,7 +226,7 @@ public class GFEVtecUtil {
|
|||
* If an error occurred sending the request to the server.
|
||||
*/
|
||||
public static String finalizeETNs(String product,
|
||||
Map<String, Integer> etnCache) {
|
||||
Map<String, Map<TimeRange, Integer>> etnCache) {
|
||||
if (StringUtil.isEmptyString(product)) {
|
||||
return product;
|
||||
}
|
||||
|
@ -239,14 +243,45 @@ public class GFEVtecUtil {
|
|||
.contains(vtec.getOffice()) && TROPICAL_PHENSIGS
|
||||
.contains(vtec.getPhensig())))) {
|
||||
// With GFE VTEC products, it's possible to have multiple
|
||||
// segments with NEW vtec action codes and the same phensig. For
|
||||
// this reason, HazardsTable.py implemented a "cache" that would
|
||||
// ensure all NEWs for the same phensig would be assigned the
|
||||
// same ETN. The etnCache Map replicaes this behavior.
|
||||
// segments with
|
||||
// NEW vtec action codes and the same phensig. For this reason,
|
||||
// HazardsTable.py implemented a "cache" that would ensure all
|
||||
// NEWs for
|
||||
// the same phensig would be assigned the same ETN. This Map
|
||||
// replicates
|
||||
// that legacy behavior.
|
||||
//
|
||||
// This "cache" has two levels:
|
||||
// 1. The first level is keyed by the hazard's phensig.
|
||||
// 2. The second level is keyed by the valid period of the
|
||||
// hazard.
|
||||
// Effectively, making this a Map<Phensig, Map<ValidPeriod,
|
||||
// ETN>>.
|
||||
|
||||
// Some more clarification on the ETN assignment behavior: all
|
||||
// NEW VTEC lines with the same phensig should be assigned the
|
||||
// same ETN if the hazards' valid periods are adjacent or
|
||||
// overlapping.
|
||||
// If there's a discontinuity in TimeRanges we increment to the
|
||||
// next ETN.
|
||||
Integer newEtn = null;
|
||||
String cacheKey = vtec.getPhensig();
|
||||
Integer newEtn = etnCache.get(cacheKey);
|
||||
vtec.setSequence(newEtn);
|
||||
TimeRange validPeriod = new TimeRange(vtec.getStartTime()
|
||||
.getTime(), vtec.getEndTime().getTime());
|
||||
|
||||
Map<TimeRange, Integer> etnsByTR = etnCache.get(cacheKey);
|
||||
if (etnsByTR != null) {
|
||||
newEtn = etnsByTR.get(validPeriod);
|
||||
for (TimeRange tr : etnsByTR.keySet()) {
|
||||
if ((validPeriod.isAdjacentTo(tr))
|
||||
|| (validPeriod.overlaps(tr))) {
|
||||
vtec.setSequence(newEtn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vtecMatcher
|
||||
.appendReplacement(
|
||||
finalOutput,
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Satellite Plug-in
|
||||
Bundle-Name: Satellite Visualization Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.satellite;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.satellite.Activator
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core, com.raytheon.viz.ui
|
||||
Eclipse-BuddyPolicy: ext, global
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.core,
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.message;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.11.31",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core;bundle-version="1.12.1174",
|
||||
javax.measure,
|
||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.satellite,
|
||||
com.raytheon.uf.common.datastorage,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.uf.viz.productbrowser,
|
||||
com.raytheon.uf.viz.derivparam,
|
||||
com.raytheon.uf.viz.ui.menus,
|
||||
com.raytheon.uf.common.style,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.core,
|
||||
javax.measure
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.satellite,
|
||||
com.raytheon.viz.satellite.rsc
|
||||
|
|
|
@ -48,4 +48,11 @@
|
|||
name="Satellite"
|
||||
category="com.raytheon.uf.viz.productbrowser.productbrowserpreferencespage"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.ui.menus.contribItemProvider">
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonSatBundleMenuContribution"
|
||||
itemProvider="com.raytheon.viz.satellite.menu.SatBundleMenuContribution">
|
||||
</contributionItemProvider>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -1,81 +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.viz.satellite;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonSatBundleMenuContribution;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.satellite.menu.SatBundleMenuContribution;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.viz.satellite";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
plugin = this;
|
||||
MenuXMLMap.registerMapping(CommonSatBundleMenuContribution.class,
|
||||
new SatBundleMenuContribution());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -333,6 +333,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
|||
* simulated time.
|
||||
* 20Sep2013 #2394 lvenable Fixed color memory leaks.
|
||||
* 20Nov2013 DR 16777 D. Friedman Check if OUPRequest will work before setting ETN.
|
||||
* 10Dec2013 2601 mpduff Fix NullPointerException.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -4947,11 +4948,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
if (!resend) {
|
||||
StdTextProduct prod = getStdTextProduct();
|
||||
OUPTestRequest testReq = new OUPTestRequest();
|
||||
testReq.setOupRequest(
|
||||
createOUPRequest(prod, prod.getProduct()));
|
||||
testReq.setOupRequest(createOUPRequest(prod,
|
||||
prod.getProduct()));
|
||||
try {
|
||||
OUPResponse checkResponse = (OUPResponse)
|
||||
ThriftClient.sendRequest(testReq);
|
||||
OUPResponse checkResponse = (OUPResponse) ThriftClient
|
||||
.sendRequest(testReq);
|
||||
if (checkResponse.hasFailure()) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error during text product transmission check: "
|
||||
|
@ -4961,24 +4962,27 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error during text product transmission check", e);
|
||||
"Error during text product transmission check",
|
||||
e);
|
||||
inEditMode = true;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Update the vtec string in the message. It looks wrong to
|
||||
* do this after saveEditedProduct, but it works because
|
||||
* for this case (isOpertional && ! resend) case, saveEditedProduct,
|
||||
* does not actually save anything. */
|
||||
prod.setProduct(
|
||||
VtecUtil.getVtec(removeSoftReturns(prod.getProduct()), true));
|
||||
/*
|
||||
* Update the vtec string in the message. It looks wrong to
|
||||
* do this after saveEditedProduct, but it works because for
|
||||
* this case (isOpertional && ! resend) case,
|
||||
* saveEditedProduct, does not actually save anything.
|
||||
*/
|
||||
prod.setProduct(VtecUtil.getVtec(
|
||||
removeSoftReturns(prod.getProduct()), true));
|
||||
/*
|
||||
* This silly bit of code updates the ETN of a VTEC in the
|
||||
* text pane to reflect the ETN that was actually used, but
|
||||
* not update any other parts of the text even though they
|
||||
* may have also been changed just before the product was
|
||||
* sent.
|
||||
*
|
||||
*
|
||||
* A1 works similarly.
|
||||
*/
|
||||
updateTextEditor(copyEtn(prod.getProduct(), body));
|
||||
|
@ -5048,8 +5052,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
private OUPRequest createOUPRequest(StdTextProduct prod, String text) {
|
||||
OUPRequest req = new OUPRequest();
|
||||
OfficialUserProduct oup = new OfficialUserProduct();
|
||||
String awipsWanPil = prod.getSite() + prod.getNnnid()
|
||||
+ prod.getXxxid();
|
||||
String awipsWanPil = prod.getSite() + prod.getNnnid() + prod.getXxxid();
|
||||
String awipsID = prod.getNnnid() + prod.getXxxid();
|
||||
|
||||
oup.setAwipsWanPil(awipsWanPil);
|
||||
|
@ -7177,6 +7180,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
private File getFile(String filename) {
|
||||
LocalizationFile lFile = pathManager.getLocalizationFile(lc,
|
||||
SAVED_SESSION_DIR + filename);
|
||||
if (lFile == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return lFile.getFile();
|
||||
}
|
||||
|
||||
|
@ -7200,11 +7207,16 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
file = getFile(filename);
|
||||
|
||||
synchronized (this) {
|
||||
bufStream = new BufferedOutputStream(new FileOutputStream(
|
||||
file));
|
||||
bufStream.write(SerializationUtil.marshalToXml(
|
||||
stdTextProduct).getBytes());
|
||||
if (file == null) {
|
||||
statusHandler
|
||||
.warn("Auto save failed. See server for details...");
|
||||
} else {
|
||||
synchronized (this) {
|
||||
bufStream = new BufferedOutputStream(
|
||||
new FileOutputStream(file));
|
||||
bufStream.write(SerializationUtil.marshalToXml(
|
||||
stdTextProduct).getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Should the edit session be backed up to the server?
|
||||
|
|
|
@ -58,6 +58,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationConstants;
|
|||
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
||||
import com.raytheon.uf.viz.core.procedures.ProcedureXmlManager;
|
||||
import com.raytheon.uf.viz.core.status.VizStatusHandlerFactory;
|
||||
import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
|
||||
import com.raytheon.viz.alerts.jobs.AutoUpdater;
|
||||
|
@ -75,25 +76,29 @@ import com.raytheon.viz.core.units.UnitRegistrar;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* May 16, 2012 #636 dgilling Ensure exception is thrown
|
||||
* and CAVE immediately exits
|
||||
* if connection cannot be made to
|
||||
* localization server.
|
||||
* May 31, 2012 #674 dgilling Allow SimulatedTime to be set from
|
||||
* the command line.
|
||||
* Oct 02, 2012 #1236 dgilling Allow SimulatedTime to be set from
|
||||
* the command line even if practice
|
||||
* mode is off.
|
||||
* Jan 09, 2013 #1442 rferrel Changes to notify SimultedTime listeners.
|
||||
* Apr 17, 2013 1786 mpduff startComponent now sets StatusHandlerFactory
|
||||
* Apr 23, 2013 #1939 randerso Allow serialization to complete initialization
|
||||
* before connecting to JMS to avoid deadlock
|
||||
* May 23, 2013 #2005 njensen Shutdown on spring initialization errors
|
||||
* Oct 15, 2013 2361 njensen Added startupTimer
|
||||
* Nov 14, 2013 2361 njensen Removed initializing serialization at startup
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* May 16, 2012 636 dgilling Ensure exception is thrown and CAVE
|
||||
* immediately exits if connection cannot be
|
||||
* made to localization server.
|
||||
* May 31, 2012 674 dgilling Allow SimulatedTime to be set from the
|
||||
* command line.
|
||||
* Oct 02, 2012 1236 dgilling Allow SimulatedTime to be set from the
|
||||
* command line even if practice mode is
|
||||
* off.
|
||||
* Jan 09, 2013 1442 rferrel Changes to notify SimultedTime listeners.
|
||||
* Apr 17, 2013 1786 mpduff startComponent now sets
|
||||
* StatusHandlerFactory
|
||||
* Apr 23, 2013 1939 randerso Allow serialization to complete
|
||||
* initialization before connecting to JMS
|
||||
* to avoid deadlock
|
||||
* May 23, 2013 2005 njensen Shutdown on spring initialization errors
|
||||
* Oct 15, 2013 2361 njensen Added startupTimer
|
||||
* Nov 14, 2013 2361 njensen Removed initializing serialization at
|
||||
* startup
|
||||
* Dec 10, 2013 2602 bsteffen Start loading ProcedureXmlManager in
|
||||
* startComponent.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -254,6 +259,8 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent {
|
|||
startInternal(componentName);
|
||||
}
|
||||
|
||||
ProcedureXmlManager.inititializeAsync();
|
||||
|
||||
if (workbenchAdvisor != null) {
|
||||
returnCode = PlatformUI.createAndRunWorkbench(display,
|
||||
workbenchAdvisor);
|
||||
|
|
|
@ -2,40 +2,44 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Volume Browser Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.volumebrowser;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.volumebrowser.Activator
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.ui.menus
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.viz.core,
|
||||
net.sf.swtaddons,
|
||||
com.raytheon.uf.viz.core,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.pointdata,
|
||||
com.raytheon.uf.viz.d2d.core,
|
||||
com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.uf.viz.core.maps,
|
||||
com.raytheon.viz.core.graphing,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.style,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.viz.awipstools,
|
||||
com.raytheon.uf.viz.points,
|
||||
com.raytheon.uf.viz.xy,
|
||||
com.raytheon.uf.viz.ui.menus,
|
||||
com.raytheon.uf.viz.xy.crosssection,
|
||||
com.raytheon.uf.viz.xy.timeheight,
|
||||
com.raytheon.uf.viz.xy.varheight,
|
||||
com.raytheon.viz.awipstools,
|
||||
com.raytheon.viz.grid,
|
||||
com.raytheon.uf.viz.xy.timeseries,
|
||||
com.raytheon.uf.viz.d2d.nsharp,
|
||||
gov.noaa.nws.ncep.ui.nsharp,
|
||||
com.raytheon.uf.viz.derivparam,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.viz.grid,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.viz.objectiveanalysis,
|
||||
com.raytheon.viz.pointdata,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
net.sf.swtaddons;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.xy;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
com.raytheon.uf.common.comm
|
||||
Export-Package: com.raytheon.viz.volumebrowser,
|
||||
com.raytheon.viz.volumebrowser.datacatalog,
|
||||
com.raytheon.viz.volumebrowser.vbui,
|
||||
com.raytheon.viz.volumebrowser.xml
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.viz.core.map,
|
||||
com.raytheon.viz.core.rsc
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
</handler>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="tools" class="com.raytheon.viz.volumebrowser.ToolsAlterBundleContributor"/>
|
||||
<alterBundle class="com.raytheon.viz.volumebrowser.ToolsAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="grids" class="com.raytheon.viz.volumebrowser.GridAlterBundleContributor"/>
|
||||
<alterBundle class="com.raytheon.viz.volumebrowser.GridAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
|
@ -79,4 +79,19 @@
|
|||
<separator name="StdEnvDataPackageFamilies" visible="true"/>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.ui.menus.contribItemProvider">
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonToolBarContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.ToolBarContribution">
|
||||
</contributionItemProvider>
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonMenuContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.MenuContribution">
|
||||
</contributionItemProvider>
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonTitleImgContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.TitleImgContribution">
|
||||
</contributionItemProvider>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -1,89 +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.viz.volumebrowser;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonTitleImgContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.volumebrowser.xml.MenuContribution;
|
||||
import com.raytheon.viz.volumebrowser.xml.TitleImgContribution;
|
||||
import com.raytheon.viz.volumebrowser.xml.ToolBarContribution;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.viz.volumebrowser";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
plugin = this;
|
||||
MenuXMLMap.registerMapping(CommonToolBarContribution.class,
|
||||
new ToolBarContribution());
|
||||
MenuXMLMap.registerMapping(CommonMenuContribution.class,
|
||||
new MenuContribution());
|
||||
MenuXMLMap.registerMapping(CommonTitleImgContribution.class,
|
||||
new TitleImgContribution());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -29,12 +29,8 @@ import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
|||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter;
|
||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
|
@ -55,10 +51,11 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 4, 2010 mschenke Initial creation
|
||||
* Oct 3, 2012 #1248 rferrel Change to use adapter.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 04, 2010 mschenke Initial creation
|
||||
* Oct 03, 2012 1248 rferrel Change to use adapter.
|
||||
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,8 +64,6 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
*/
|
||||
|
||||
public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridAlterBundleContributor.class);
|
||||
|
||||
private static final String GRID_KEY = "Grid";
|
||||
|
||||
|
@ -78,26 +73,20 @@ public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
|
||||
if (modelTitleToNameMap == null) {
|
||||
modelTitleToNameMap = new HashMap<String, String>();
|
||||
try {
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getName() != null) {
|
||||
modelTitleToNameMap.put(source.getName(),
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getName() != null) {
|
||||
modelTitleToNameMap.put(source.getName(), source.getKey());
|
||||
} else {
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info == null) {
|
||||
modelTitleToNameMap.put(source.getKey(),
|
||||
source.getKey());
|
||||
} else {
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance()
|
||||
.getInfo(source.getKey());
|
||||
if (info == null) {
|
||||
modelTitleToNameMap.put(source.getKey(),
|
||||
source.getKey());
|
||||
} else {
|
||||
modelTitleToNameMap.put(info.getTitle(),
|
||||
source.getKey());
|
||||
}
|
||||
modelTitleToNameMap.put(info.getTitle(),
|
||||
source.getKey());
|
||||
}
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Cannot load grid sources.", e);
|
||||
}
|
||||
}
|
||||
return modelTitleToNameMap;
|
||||
|
|
|
@ -49,7 +49,6 @@ import com.raytheon.uf.viz.points.PointUtilities;
|
|||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
|
||||
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
|
||||
|
@ -64,12 +63,13 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 #1248 rferrel Added listener for when points change.
|
||||
* May 03, 2013 DR14824 mgamazaychikov Added alterResource method
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- -------------- --------------------------------------
|
||||
* Aug 08, 2012 875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 1248 rferrel Added listener for when points change.
|
||||
* May 03, 2013 14824 mgamazaychikov Added alterResource method
|
||||
* Dec 11, 2013 2602 bsteffen Fix compiler warnings and format.
|
||||
*
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -86,9 +86,9 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
private static final String POINTS_KEY = "point";
|
||||
|
||||
private static final String LINES_KEY = "line";
|
||||
|
||||
|
||||
private static final String PLUGIN_KEY = "pluginName";
|
||||
|
||||
|
||||
private static final String REPORTYPE_KEY = "reportType";
|
||||
|
||||
private IPointChangedListener pointChangedListener;
|
||||
|
@ -255,9 +255,9 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, POINTS_KEY,
|
||||
selectedString);
|
||||
alterContainer((IPointsToolContainer) rData, selectedString);
|
||||
alterResource((AbstractRequestableResourceData) rData,
|
||||
POINTS_KEY, selectedString);
|
||||
alterContainer((IPointsToolContainer) rData, selectedString);
|
||||
} else if (rData instanceof IResourceGroup) {
|
||||
alterResourceList(((IResourceGroup) rData).getResourceList(),
|
||||
selectedString);
|
||||
|
@ -265,76 +265,73 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
private void alterResource(AbstractRequestableResourceData data, String selectedKey,
|
||||
String selectedString) {
|
||||
if (selectedString == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, RequestConstraint> metadataMap = data.getMetadataMap();
|
||||
HashMap<String, RequestConstraint> metadataMapOld = new HashMap<String, RequestConstraint>();
|
||||
// make a copy of original matedata map
|
||||
metadataMapOld.putAll(metadataMap);
|
||||
// obtain data catalog
|
||||
AbstractDataCatalog ac = getDataCatalog (metadataMap);
|
||||
if ( ac == null ) {
|
||||
return;
|
||||
}
|
||||
// change the parameters in the original metadata map
|
||||
ac.alterProductParameters(selectedKey, selectedString,
|
||||
(HashMap<String, RequestConstraint>) metadataMap);
|
||||
|
||||
// in addition to metadata map resource data needs to be modified
|
||||
// for CrossSectionResourceData
|
||||
if (data instanceof CrossSectionResourceData) {
|
||||
String theKeyToChange = null;
|
||||
Iterator<Map.Entry<String, RequestConstraint>> it = metadataMap
|
||||
.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
Map.Entry<String, RequestConstraint> pairs = (Map.Entry) it
|
||||
.next();
|
||||
String currentKey = (String) pairs.getKey();
|
||||
String currentValue = metadataMap.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (metadataMapOld.containsKey(currentKey)) {
|
||||
String oldValue = metadataMapOld.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (!oldValue.equalsIgnoreCase(currentValue)) {
|
||||
theKeyToChange = currentKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
String stationID = metadataMap.get(theKeyToChange)
|
||||
.getConstraintValue();
|
||||
List<String> stationIDs = Arrays.asList(stationID
|
||||
.split("\\s*,\\s*"));
|
||||
((CrossSectionResourceData) data).setStationIDs(stationIDs);
|
||||
}
|
||||
}
|
||||
private void alterResource(AbstractRequestableResourceData data,
|
||||
String selectedKey, String selectedString) {
|
||||
if (selectedString == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, RequestConstraint> metadataMap = data.getMetadataMap();
|
||||
HashMap<String, RequestConstraint> metadataMapOld = new HashMap<String, RequestConstraint>();
|
||||
// make a copy of original matedata map
|
||||
metadataMapOld.putAll(metadataMap);
|
||||
// obtain data catalog
|
||||
AbstractDataCatalog ac = getDataCatalog(metadataMap);
|
||||
if (ac == null) {
|
||||
return;
|
||||
}
|
||||
// change the parameters in the original metadata map
|
||||
ac.alterProductParameters(selectedKey, selectedString, metadataMap);
|
||||
|
||||
private AbstractDataCatalog getDataCatalog(
|
||||
HashMap<String, RequestConstraint> metadataMap) {
|
||||
String pluginName = null;
|
||||
String reportType = null;
|
||||
if (metadataMap.containsKey(PLUGIN_KEY)) {
|
||||
pluginName = metadataMap.get(PLUGIN_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (metadataMap.containsKey(REPORTYPE_KEY)) {
|
||||
reportType = metadataMap.get(REPORTYPE_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
String sourcesKey = pluginName + reportType;
|
||||
// in addition to metadata map resource data needs to be modified
|
||||
// for CrossSectionResourceData
|
||||
if (data instanceof CrossSectionResourceData) {
|
||||
String theKeyToChange = null;
|
||||
Iterator<Map.Entry<String, RequestConstraint>> it = metadataMap
|
||||
.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, RequestConstraint> pairs = it.next();
|
||||
String currentKey = pairs.getKey();
|
||||
String currentValue = metadataMap.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (metadataMapOld.containsKey(currentKey)) {
|
||||
String oldValue = metadataMapOld.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (!oldValue.equalsIgnoreCase(currentValue)) {
|
||||
theKeyToChange = currentKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
String stationID = metadataMap.get(theKeyToChange)
|
||||
.getConstraintValue();
|
||||
List<String> stationIDs = Arrays.asList(stationID
|
||||
.split("\\s*,\\s*"));
|
||||
((CrossSectionResourceData) data).setStationIDs(stationIDs);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedData sd = new SelectedData(null, sourcesKey, null, null, null,
|
||||
null, null);
|
||||
return (AbstractDataCatalog) DataCatalogManager
|
||||
.getDataCatalogManager().getDataCatalog(sd);
|
||||
}
|
||||
private AbstractDataCatalog getDataCatalog(
|
||||
HashMap<String, RequestConstraint> metadataMap) {
|
||||
String pluginName = null;
|
||||
String reportType = null;
|
||||
if (metadataMap.containsKey(PLUGIN_KEY)) {
|
||||
pluginName = metadataMap.get(PLUGIN_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (metadataMap.containsKey(REPORTYPE_KEY)) {
|
||||
reportType = metadataMap.get(REPORTYPE_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
String sourcesKey = pluginName + reportType;
|
||||
|
||||
/**
|
||||
SelectedData sd = new SelectedData(null, sourcesKey, null, null, null,
|
||||
null, null);
|
||||
return (AbstractDataCatalog) DataCatalogManager.getDataCatalogManager()
|
||||
.getDataCatalog(sd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rData
|
||||
* @param selectedString
|
||||
*/
|
||||
|
@ -357,11 +354,11 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
line);
|
||||
ResourceList rl = display.getDescriptor().getResourceList();
|
||||
for (ResourcePair rp : rl) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, LINES_KEY,
|
||||
line);
|
||||
}
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData,
|
||||
LINES_KEY, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* Nov 17, 2009 3120 rjpeter Updated to use LevelMappingFactory.
|
||||
* Jul 31, 2012 875 rferrel Now uses points.
|
||||
* May 30, 2013 2055 bsteffen Remove modelName from sounding pointName.
|
||||
* Dec 06, 2013 2271 mpduff Added check for null coordinate.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -427,6 +428,10 @@ public class GridDataCatalog extends AbstractInventoryDataCatalog {
|
|||
for (String letter : pointLetters) {
|
||||
Coordinate c = PointsDataManager.getInstance()
|
||||
.getCoordinate(letter);
|
||||
if (c == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
DirectPosition2D dp = new DirectPosition2D(c.x, c.y);
|
||||
llToCRS.transform(dp, dp);
|
||||
if (env.contains(dp.x, dp.y)) {
|
||||
|
|
|
@ -50,11 +50,7 @@ import org.eclipse.swt.widgets.Label;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
||||
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.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
|
@ -78,14 +74,18 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 12, 2009 #2161 lvenable Initial creation
|
||||
* Jul 31, 2012 #875 rferrel Now uses markers.
|
||||
* Sep 26, 2012 #1216 rferrel Change listener added to update
|
||||
* points menu.
|
||||
* Jan 14, 2013 #1516 rferrel Remove listeners on dispose and specify
|
||||
* Data Selection in Points Tool Action.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* May 12, 2009 2161 lvenable Initial creation
|
||||
* Jul 31, 2012 875 rferrel Now uses markers.
|
||||
* Sep 26, 2012 1216 rferrel Change listener added to update points
|
||||
* menu.
|
||||
* Jan 14, 2013 1516 rferrel Remove listeners on dispose and specify
|
||||
* Data Selection in Points Tool Action.
|
||||
* Dec 06, 2013 2271 mpduff Save the selected plane points so the
|
||||
* menu's are recreated correctly on a
|
||||
* pointChange action.
|
||||
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -94,8 +94,6 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
*/
|
||||
public class DataListsProdTableComp extends Composite implements
|
||||
IDataMenuAction {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DataListsProdTableComp.class);
|
||||
|
||||
/**
|
||||
* Listener to update planes current point menu.
|
||||
|
@ -105,13 +103,13 @@ public class DataListsProdTableComp extends Composite implements
|
|||
/**
|
||||
* Listener to trigger reset.
|
||||
*/
|
||||
private IPointChangedListener resetPointChangeListener;
|
||||
private final IPointChangedListener resetPointChangeListener;
|
||||
|
||||
/**
|
||||
* Listener to trigger reset.
|
||||
*/
|
||||
|
||||
private IToolChangedListener resetToolChangeListener;
|
||||
private final IToolChangedListener resetToolChangeListener;
|
||||
|
||||
/**
|
||||
* Perform a regular expression find instead of simply completing the input
|
||||
|
@ -136,7 +134,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* #getMatchingProposals(java.lang.String[], java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected List getMatchingProposals(String[] proposals,
|
||||
protected List<?> getMatchingProposals(String[] proposals,
|
||||
String contents) {
|
||||
return super.getMatchingProposals(
|
||||
getMatches(proposals, contents), "");
|
||||
|
@ -473,6 +471,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
@Override
|
||||
public void toolChanged() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateMenuInventory();
|
||||
}
|
||||
|
@ -487,6 +486,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
@Override
|
||||
public void pointChanged() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateMenuInventory();
|
||||
}
|
||||
|
@ -668,82 +668,76 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* items/menus.
|
||||
*/
|
||||
|
||||
try {
|
||||
// Linked HashMap used to preserve the ordering of categories
|
||||
Map<String, List<IContributionItem>> catMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
Map<String, Map<String, List<IContributionItem>>> subCatMap = new LinkedHashMap<String, Map<String, List<IContributionItem>>>();
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getViews() != null
|
||||
&& !source.getViews().contains(setting)) {
|
||||
continue;
|
||||
}
|
||||
List<IContributionItem> catList = null;
|
||||
if (source.getSubCategory() != null) {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap
|
||||
.get(source.getCategory());
|
||||
if (subMap == null) {
|
||||
subMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
subCatMap.put(source.getCategory(), subMap);
|
||||
}
|
||||
catList = subMap.get(source.getSubCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
subMap.put(source.getSubCategory(), catList);
|
||||
}
|
||||
} else {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
}
|
||||
MenuContribution mContrib = new MenuContribution();
|
||||
mContrib.xml.key = source.getKey();
|
||||
if (source.getName() != null) {
|
||||
mContrib.xml.menuText = source.getName();
|
||||
} else {
|
||||
// Attempt a lookup in the grib model table
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info != null) {
|
||||
mContrib.xml.menuText = info.getTitle();
|
||||
} else {
|
||||
mContrib.xml.menuText = source.getKey();
|
||||
}
|
||||
}
|
||||
catList.add(new MenuContributionItem(mContrib));
|
||||
// Linked HashMap used to preserve the ordering of categories
|
||||
Map<String, List<IContributionItem>> catMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
Map<String, Map<String, List<IContributionItem>>> subCatMap = new LinkedHashMap<String, Map<String, List<IContributionItem>>>();
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getViews() != null
|
||||
&& !source.getViews().contains(setting)) {
|
||||
continue;
|
||||
}
|
||||
for (Entry<String, List<IContributionItem>> entry : catMap
|
||||
.entrySet()) {
|
||||
ToolBarContribution tbContrib = new ToolBarContribution();
|
||||
tbContrib.xml.toolItemText = entry.getKey();
|
||||
tbContrib.xml.id = setting.toString() + entry.getKey();
|
||||
List<IContributionItem> catList = null;
|
||||
if (source.getSubCategory() != null) {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap
|
||||
.get(entry.getKey());
|
||||
if (subMap != null) {
|
||||
for (Entry<String, List<IContributionItem>> subEntry : subMap
|
||||
.entrySet()) {
|
||||
TitleImgContribution tContrib = new TitleImgContribution();
|
||||
tContrib.xml.titleText = subEntry.getKey();
|
||||
tContrib.xml.displayDashes = true;
|
||||
tContrib.xml.displayImage = true;
|
||||
entry.getValue().add(
|
||||
new TitleImgContributionItem(tContrib));
|
||||
entry.getValue().addAll(subEntry.getValue());
|
||||
}
|
||||
.get(source.getCategory());
|
||||
if (subMap == null) {
|
||||
subMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
subCatMap.put(source.getCategory(), subMap);
|
||||
}
|
||||
catList = subMap.get(source.getSubCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
subMap.put(source.getSubCategory(), catList);
|
||||
}
|
||||
} else {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
sourceControl.toolbar.add(new ToolBarContributionItem(
|
||||
tbContrib, entry.getValue().toArray(
|
||||
new IContributionItem[0])));
|
||||
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
MenuContribution mContrib = new MenuContribution();
|
||||
mContrib.xml.key = source.getKey();
|
||||
if (source.getName() != null) {
|
||||
mContrib.xml.menuText = source.getName();
|
||||
} else {
|
||||
// Attempt a lookup in the grib model table
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info != null) {
|
||||
mContrib.xml.menuText = info.getTitle();
|
||||
} else {
|
||||
mContrib.xml.menuText = source.getKey();
|
||||
}
|
||||
}
|
||||
catList.add(new MenuContributionItem(mContrib));
|
||||
}
|
||||
for (Entry<String, List<IContributionItem>> entry : catMap.entrySet()) {
|
||||
ToolBarContribution tbContrib = new ToolBarContribution();
|
||||
tbContrib.xml.toolItemText = entry.getKey();
|
||||
tbContrib.xml.id = setting.toString() + entry.getKey();
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap.get(entry
|
||||
.getKey());
|
||||
if (subMap != null) {
|
||||
for (Entry<String, List<IContributionItem>> subEntry : subMap
|
||||
.entrySet()) {
|
||||
TitleImgContribution tContrib = new TitleImgContribution();
|
||||
tContrib.xml.titleText = subEntry.getKey();
|
||||
tContrib.xml.displayDashes = true;
|
||||
tContrib.xml.displayImage = true;
|
||||
entry.getValue()
|
||||
.add(new TitleImgContributionItem(tContrib));
|
||||
entry.getValue().addAll(subEntry.getValue());
|
||||
}
|
||||
}
|
||||
sourceControl.toolbar.add(new ToolBarContributionItem(tbContrib,
|
||||
entry.getValue().toArray(new IContributionItem[0])));
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -882,8 +876,20 @@ public class DataListsProdTableComp extends Composite implements
|
|||
|
||||
@Override
|
||||
public void pointChanged() {
|
||||
MenuItemManager.getInstance().clearPlanesMap();
|
||||
pta.resetMenu();
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MenuItemManager menuItemMgr = MenuItemManager
|
||||
.getInstance();
|
||||
|
||||
Set<String> planeListItems = planeControl.list
|
||||
.getAvailableKeys().keySet();
|
||||
|
||||
menuItemMgr.clearPlanesMap();
|
||||
menuItemMgr.setSelectedPlaneItems(planeListItems);
|
||||
pta.resetMenu();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
PointsDataManager.getInstance().addPointsChangedListener(
|
||||
|
@ -947,6 +953,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* Menu information that contains information about the item
|
||||
* selected.
|
||||
*/
|
||||
@Override
|
||||
public void addToList(String displayStr, MenuContribution menuContrib) {
|
||||
activeList.addItemToList(displayStr, menuContrib);
|
||||
|
||||
|
@ -959,6 +966,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
*
|
||||
* @return The active data selection.
|
||||
*/
|
||||
@Override
|
||||
public DataSelection getActiveDataSelection() {
|
||||
return currentDataSelection;
|
||||
}
|
||||
|
@ -971,6 +979,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* (
|
||||
* com.raytheon.viz.volumebrowser.vbui.DataListsProdTableComp.DataSelection)
|
||||
*/
|
||||
@Override
|
||||
public void setActiveDataSelection(DataSelection dataSelection) {
|
||||
currentDataSelection = dataSelection;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.raytheon.viz.volumebrowser.vbui;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.viz.volumebrowser.xml.MenuContribution;
|
|||
* May 27, 2009 #2161 lvenable Initial creation
|
||||
* Jan 24, 2013 #1516 rferrel Methods to change/get
|
||||
* Active Data Selection.
|
||||
* Dec 06, 2013 #2271 mpduff Added the set of keys for the selected plane items
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -75,6 +77,11 @@ public class MenuItemManager {
|
|||
*/
|
||||
private IDataMenuAction menuActionCB;
|
||||
|
||||
/**
|
||||
* Set of keys for the selected plane items.
|
||||
*/
|
||||
private Set<String> selectedPlaneItems = new HashSet<String>(0);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
@ -584,4 +591,23 @@ public class MenuItemManager {
|
|||
public void setActiveDataSelection(DataSelection dataSelection) {
|
||||
menuActionCB.setActiveDataSelection(dataSelection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the set of selected keys for the plane item list
|
||||
*
|
||||
* @param selectedPlaneItems
|
||||
* Set of selected keys
|
||||
*/
|
||||
public void setSelectedPlaneItems(Set<String> selectedPlaneItems) {
|
||||
this.selectedPlaneItems = selectedPlaneItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the set of selected keys for the plane item list
|
||||
*
|
||||
* @return The selected keys
|
||||
*/
|
||||
public Set<String> getSelectedPlaneItems() {
|
||||
return selectedPlaneItems;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.viz.volumebrowser.vbui;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.ActionContributionItem;
|
||||
|
@ -54,6 +55,7 @@ import com.raytheon.viz.volumebrowser.xml.MenuContribution;
|
|||
* now opens the menu.
|
||||
* Sep 26, 2012 1216 rferrel resetMenu method added.
|
||||
* Jan 24, 2013 1516 rferrel Change Active Data Selection prior to filling menus.
|
||||
* Dec 06, 2013 2271 mpduff Disable plane menu items for already selected items.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -173,6 +175,7 @@ public class PointToolAction extends Action implements IMenuCreator {
|
|||
@Override
|
||||
public Menu getMenu(Menu parent) {
|
||||
if (menu == null) {
|
||||
|
||||
MenuItemManager.getInstance().setActiveDataSelection(dataSelection);
|
||||
menu = new Menu(parent);
|
||||
fillMenu(menu);
|
||||
|
@ -229,6 +232,16 @@ public class PointToolAction extends Action implements IMenuCreator {
|
|||
TitleContributionItem cci = new TitleContributionItem();
|
||||
cci.setText(node.getName());
|
||||
cci.fill(menu, -1);
|
||||
|
||||
// disable menu items for already selected items
|
||||
if (dataSelection == DataSelection.PLANES) {
|
||||
Set<String> planeItems = MenuItemManager.getInstance()
|
||||
.getSelectedPlaneItems();
|
||||
for (String s : planeItems) {
|
||||
MenuItemManager.getInstance().disableMenuItem(s,
|
||||
DataSelection.PLANES);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,23 @@ import com.raytheon.viz.volumebrowser.xml.TitleImgContribution;
|
|||
import com.raytheon.viz.volumebrowser.xml.ToolBarContribution;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution item for tool bar buttons.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Set the id of menu items.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unkown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolBarContributionItem extends ContributionItem {
|
||||
|
||||
protected Menu menu;
|
||||
|
@ -116,6 +133,7 @@ public class ToolBarContributionItem extends ContributionItem {
|
|||
GeoUtil.formatCoordinate(new Coordinate(i, i))
|
||||
.split(" ")[coordinateIndex]);
|
||||
menuContribution.xml.key = keyPrefixString + i;
|
||||
menuContribution.xml.id = idPrefixString + i;
|
||||
|
||||
MenuContributionItem menuContributionItem = new MenuContributionItem(
|
||||
menuContribution);
|
||||
|
|
|
@ -31,9 +31,27 @@ import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
|
|||
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.AbstractMenuContributionItem;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.volumebrowser.widget.ToolBarContributionItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution Item for tool bars.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolBarContribution extends
|
||||
AbstractMenuContributionItem<CommonToolBarContribution> {
|
||||
|
||||
|
@ -49,8 +67,8 @@ public class ToolBarContribution extends
|
|||
List<IContributionItem> contribItemList = new ArrayList<IContributionItem>();
|
||||
|
||||
for (CommonAbstractMenuContribution amc : item.contributions) {
|
||||
AbstractMenuContributionItem<?> common = MenuXMLMap.xmlMapping
|
||||
.get(amc.getClass());
|
||||
IContribItemProvider common = MenuXMLMap
|
||||
.getProvider(amc.getClass());
|
||||
contribItemList.addAll(Arrays.asList(common.getContributionItems(
|
||||
amc, subs, removals)));
|
||||
}
|
||||
|
|
|
@ -6,28 +6,29 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
* Description of a single source for the volume browser.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2011 bsteffen Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 06, 2011 bsteffen Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
* @see VbSourceList
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class VbSource implements ISerializableObject {
|
||||
public class VbSource {
|
||||
|
||||
@XmlAttribute(required = true)
|
||||
private String key;
|
||||
|
|
|
@ -12,20 +12,19 @@ import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
|||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
* List of sources for populating the volume browser tool bar menus
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2011 bsteffen Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 06, 2011 bsteffen Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -34,7 +33,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class VbSourceList implements ISerializableObject {
|
||||
public class VbSourceList {
|
||||
|
||||
private final static String VB_SOURCE_FILE = "volumebrowser/VbSources.xml";
|
||||
|
||||
|
@ -78,7 +77,7 @@ public class VbSourceList implements ISerializableObject {
|
|||
this.entries = entries;
|
||||
}
|
||||
|
||||
public static VbSourceList getInstance() throws VizException {
|
||||
public static VbSourceList getInstance() {
|
||||
synchronized (VB_SOURCE_FILE) {
|
||||
if (instance == null) {
|
||||
LocalizationFile file = PathManagerFactory.getPathManager()
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<property name="src" value="src"></property>
|
||||
<property name="db.mach.name" value="localhost"/>
|
||||
<property name="database" value="hd_ob83krf" />
|
||||
<property name="database.port" value="5432" />
|
||||
|
||||
|
||||
<target name="runJDbGen">
|
||||
|
@ -12,7 +13,7 @@
|
|||
<pathelement location="./bin"/>
|
||||
<pathelement path="${basedir}/REQUIRED_JARS/postgresql-8.3-603.jdbc3.jar"/>
|
||||
</classpath>
|
||||
<arg value="jdbc:postgresql://${db.mach.name}:5432/${database}?user=awips"/> <!-- connectionURL -->
|
||||
<arg value="jdbc:postgresql://${db.mach.name}:${database.port}/${database}?user=awips"/> <!-- connectionURL -->
|
||||
<arg value="${basedir}/PreferredTableNames.txt"/> <!--preferredTableNameFilePath -->
|
||||
<arg value="${database}"/> <!-- dbName -->
|
||||
<arg value="ohd.hseb.ihfsdb.generated"/> <!-- packageName -->
|
||||
|
|
42
deltaScripts/14.2.1/dropLSRdataURI.sh
Normal file
42
deltaScripts/14.2.1/dropLSRdataURI.sh
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
# DR #2581 - this update script will drop the dataURI column from the lsr table
|
||||
|
||||
PSQL="/awips2/psql/bin/psql"
|
||||
|
||||
# takes one arg: a table name
|
||||
# drops the datauri constraint and column if they exist
|
||||
function dropDatauri {
|
||||
echo "INFO: Dropping DataURI column from $1"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS ${1}_datauri_key;"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP COLUMN IF EXISTS datauri;"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to drop dataURI column for $table"
|
||||
echo "FATAL: The update has failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# takes three args: table, constraint name, unique columns
|
||||
# will first drop the constraint if it exists and then adds it back, this is
|
||||
# fairly inefficient if it does exist but operationally it won't exist and for
|
||||
# testing this allows the script to be run easily as a noop.
|
||||
function dropDatauriAndAddConstraint {
|
||||
dropDatauri $1
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 DROP CONSTRAINT IF EXISTS $2;"
|
||||
${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ADD CONSTRAINT $2 UNIQUE $3;"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: Failed to add new unique constraint for $table"
|
||||
echo "FATAL: The update has failed."
|
||||
exit 1
|
||||
fi
|
||||
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE $1"
|
||||
}
|
||||
|
||||
echo "INFO: Dropping dataURI columns."
|
||||
|
||||
dropDatauriAndAddConstraint lsr lsr_latitude_longitude_stationId_reftime_forecasttime_eventtype_key "(latitude, longitude, stationId, reftime, forecasttime, eventtype)"
|
||||
|
||||
|
||||
echo "INFO: LSR dataURI column dropped successfully"
|
3
deltaScripts/14.2.1/updateMadisTableConstraint.sql
Normal file
3
deltaScripts/14.2.1/updateMadisTableConstraint.sql
Normal file
|
@ -0,0 +1,3 @@
|
|||
alter table madis drop constraint madis_location_reftime_provider_subprovider_restriction_key;
|
||||
|
||||
alter table madis add constraint madis_location_stationid_reftime_provider_subprovider_restr_key UNIQUE (location, stationid, reftime, provider, subprovider, restriction)
|
5
deltaScripts/14.2.1/updateMadisUniqueConstraint.sh
Normal file
5
deltaScripts/14.2.1/updateMadisUniqueConstraint.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
PSQL=/awips2/psql/bin/psql
|
||||
DIR=`dirname $0`
|
||||
${PSQL} -U awips -d metadata -f ${DIR}/updateMadisTableConstraint.sql
|
|
@ -34,7 +34,7 @@ wrapper.fork_hack=true
|
|||
wrapper.console.pipestreams=true
|
||||
|
||||
# Java Application
|
||||
wrapper.java.command=${EDEX_HOME}/../java/bin/java
|
||||
wrapper.java.command=${JAVA_HOME}/bin/java
|
||||
|
||||
# necessary for etc/init.d/edex_camel
|
||||
wrapper.pidfile=${EDEX_HOME}/bin/${EDEX_RUN_MODE}.pid
|
||||
|
|
|
@ -34,14 +34,14 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
/**
|
||||
* This class contains several utility methods that construct a ProfilerObs
|
||||
* instance from the BUFR decoded data.
|
||||
* Convert bufr packets into level data for bufrua mandatory levels.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20080303 969 jkorman Initial implementation.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Mar 03, 2008 969 jkorman Initial implementation.
|
||||
* Dec 05, 2013 2612 bsteffen Fix max wind decoding.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -212,8 +212,8 @@ public class BUFRUAManLevelAdapter extends AbstractBUFRUAAdapter {
|
|||
double pres = getDouble(p.get(0), -9999);
|
||||
if (pres > 0) {
|
||||
setViewData("prMaxW", view, p.get(0), maxWindIdx);
|
||||
setViewData("wdMaxW", view, p.get(3), maxWindIdx);
|
||||
setViewData("wsMaxW", view, p.get(4), maxWindIdx);
|
||||
setViewData("wdMaxW", view, p.get(2), maxWindIdx);
|
||||
setViewData("wsMaxW", view, p.get(3), maxWindIdx);
|
||||
maxWindIdx++;
|
||||
}
|
||||
if (maxWindIdx == maxMaxWinds) {
|
||||
|
|
|
@ -23,6 +23,7 @@ import static com.raytheon.uf.edex.decodertools.bufr.packets.DataPacketTypes.Rep
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.edex.plugin.bufrua.util.SigWindHeightConversionManager;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.LayerTools;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObs;
|
||||
import com.raytheon.uf.common.pointdata.Dimension;
|
||||
|
@ -34,15 +35,16 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Convert bufr packets into level data for bufrua significant levels.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 21, 2009 jkorman Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Jul 21, 2009 jkorman Initial creation
|
||||
* Dec 05, 2013 2612 bsteffen Convert heights for sig wind layers.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -190,6 +192,8 @@ public class BUFRUASigLevelAdapter extends AbstractBUFRUAAdapter {
|
|||
.getValue();
|
||||
int sig = getInt(p.get(1), IDecoderConstants.VAL_MISSING);
|
||||
double height = getDouble(p.get(0), -9999);
|
||||
height = SigWindHeightConversionManager.convertHeight(
|
||||
pointData, height);
|
||||
if (sig == 2) {
|
||||
if ((height > 0) && (height < 30000)) {
|
||||
view.setFloat(LayerTools.HT_SIGW, (float) height,
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
/**
|
||||
* 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.plugin.bufrua.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* List of conversion factors for bufrua sites.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Dec 05, 2013 2612 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
* @see SigWindHeightConversionManager
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class SigWindHeightConversionList {
|
||||
|
||||
@XmlElement(name = "conversion")
|
||||
private List<SigWindHeightConversion> entries;
|
||||
|
||||
public List<SigWindHeightConversion> getEntries() {
|
||||
return entries;
|
||||
}
|
||||
|
||||
public void setEntries(List<SigWindHeightConversion> entries) {
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public static class SigWindHeightConversion {
|
||||
|
||||
@XmlAttribute(required = true)
|
||||
private String stationId;
|
||||
|
||||
@XmlAttribute(required = true)
|
||||
private double factor;
|
||||
|
||||
public String getStationId() {
|
||||
return stationId;
|
||||
}
|
||||
|
||||
public void setStationId(String stationId) {
|
||||
this.stationId = stationId;
|
||||
}
|
||||
|
||||
public double getFactor() {
|
||||
return factor;
|
||||
}
|
||||
|
||||
public void setFactor(double factor) {
|
||||
this.factor = factor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
/**
|
||||
* 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.plugin.bufrua.util;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.edex.plugin.bufrua.util.SigWindHeightConversionList.SigWindHeightConversion;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObs;
|
||||
import com.raytheon.uf.common.localization.AutoUpdatingLocalizationFile;
|
||||
import com.raytheon.uf.common.localization.AutoUpdatingLocalizationFile.AutoUpdatingFileChangedListener;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* Some UAObs are incorrectly encoded so the Significant Wind heights are
|
||||
* multiples of 300 meters when in fact the observations were really taken at
|
||||
* multiples of 1000 feet. A conversion list is serialised and can be used to
|
||||
* determine which sites require unit conversion for the heights to match the
|
||||
* actual observations.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Dec 06, 2013 2612 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class SigWindHeightConversionManager implements
|
||||
AutoUpdatingFileChangedListener {
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SigWindHeightConversionList.class);
|
||||
|
||||
private static final String FILE_NAME = "bufrua/sigWindHeightConversion.xml";
|
||||
|
||||
private static final SigWindHeightConversionManager instance = new SigWindHeightConversionManager();
|
||||
|
||||
/* Must keep reference to the file or listener doesn't work */
|
||||
@SuppressWarnings("unused")
|
||||
private final AutoUpdatingLocalizationFile file;
|
||||
|
||||
private Map<String, Double> factors;
|
||||
|
||||
private SigWindHeightConversionManager() {
|
||||
AutoUpdatingLocalizationFile file = null;
|
||||
try {
|
||||
file = new AutoUpdatingLocalizationFile(FILE_NAME,
|
||||
LocalizationType.EDEX_STATIC);
|
||||
file.addListener(this);
|
||||
loadFactors(file);
|
||||
} catch (Throwable e) {
|
||||
/*
|
||||
* Do not allow exceptions to propogate, this would break class
|
||||
* loading, instead no conversion will ever occur.
|
||||
*/
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"An error has occured loading the SigWind Height Conversion factors.",
|
||||
e);
|
||||
factors = Collections.emptyMap();
|
||||
}
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileChanged(AutoUpdatingLocalizationFile file) {
|
||||
try {
|
||||
loadFactors(file);
|
||||
} catch (Exception e) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
"An error has occured reloading the SigWind Height Conversion factors.",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadFactors(AutoUpdatingLocalizationFile file)
|
||||
throws SerializationException, JAXBException {
|
||||
SigWindHeightConversionList list = file.loadObject(
|
||||
new JAXBManager(SigWindHeightConversionList.class),
|
||||
SigWindHeightConversionList.class);
|
||||
Map<String, Double> result = new HashMap<String, Double>(list
|
||||
.getEntries().size(), 1.0f);
|
||||
for (SigWindHeightConversion entry : list.getEntries()) {
|
||||
result.put(entry.getStationId(), entry.getFactor());
|
||||
}
|
||||
factors = result;
|
||||
}
|
||||
|
||||
public double getFactor(String stationId) {
|
||||
Double factor = factors.get(stationId);
|
||||
if (factor != null) {
|
||||
return factor.doubleValue();
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
public static double convertHeight(UAObs obs, double height) {
|
||||
return height * instance.getFactor(obs.getStationId());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,300 @@
|
|||
<sigWindHeightConversionList>
|
||||
<!-- Some UAObs are incorrectly encoded so the Significant Wind heights
|
||||
are multiples of 300 meters when in fact the observations were really taken
|
||||
at multiples of 1000 feet. This list specifies all affected sites and the
|
||||
corresponding conversion factor. -->
|
||||
<!--Tatoosh Island, WA -->
|
||||
<conversion stationId="72798" factor="1.016" />
|
||||
<!--South Vandenberg AFB -->
|
||||
<conversion stationId="74606" factor="1.016" />
|
||||
<!--Yuma, AZ (K1Y7) -->
|
||||
<conversion stationId="74004" factor="1.016" />
|
||||
<!--Yuma PG Site 2, AZ (K1Y8) -->
|
||||
<conversion stationId="74005" factor="1.016" />
|
||||
<!--Yuma PG Site 3, AZ (K1Y9) -->
|
||||
<conversion stationId="74006" factor="1.016" />
|
||||
<!--Albuquerque, NM (KABQ) -->
|
||||
<conversion stationId="72365" factor="1.016" />
|
||||
<!--Boise, ID (KBOI) -->
|
||||
<conversion stationId="72681" factor="1.016" />
|
||||
<!--Denver, CO (KDNR) -->
|
||||
<conversion stationId="72469" factor="1.016" />
|
||||
<!--Desert Rock, NV (KDRA) -->
|
||||
<conversion stationId="72387" factor="1.016" />
|
||||
<!--Edwards AFB, CA (KEDW) -->
|
||||
<conversion stationId="72381" factor="1.016" />
|
||||
<!--Flagstaff, AZ (KFGZ) -->
|
||||
<conversion stationId="72376" factor="1.016" />
|
||||
<!--Glasgow, MT (KGGW) -->
|
||||
<conversion stationId="72768" factor="1.016" />
|
||||
<!--Grand Junction, CO (KGJT) -->
|
||||
<conversion stationId="72476" factor="1.016" />
|
||||
<!--Elko, NV (KLKN) -->
|
||||
<conversion stationId="72582" factor="1.016" />
|
||||
<!--Las Vegas, NV (KVEF) -->
|
||||
<conversion stationId="72388" factor="1.016" />
|
||||
<!--Medford, OR (KMFR) -->
|
||||
<conversion stationId="72597" factor="1.016" />
|
||||
<!--San Diego, CA (KNKX) -->
|
||||
<conversion stationId="72293" factor="1.016" />
|
||||
<!--San Nicholas Island, CA (KNSI) -->
|
||||
<conversion stationId="72291" factor="1.016" />
|
||||
<!--Pt. Mugu NAWS, CA (KNTD) -->
|
||||
<conversion stationId="72391" factor="1.016" />
|
||||
<!--Oakland, CA (KOAK) -->
|
||||
<conversion stationId="72493" factor="1.016" />
|
||||
<!--Spokane, WA (KOTX) -->
|
||||
<conversion stationId="72786" factor="1.016" />
|
||||
<!--Phoenix (KPSR) -->
|
||||
<conversion stationId="74626" factor="1.016" />
|
||||
<!--Reno, NV (KREV) -->
|
||||
<conversion stationId="72489" factor="1.016" />
|
||||
<!--Riverton, WY (KRIW) -->
|
||||
<conversion stationId="72672" factor="1.016" />
|
||||
<!--Salt Lake City, UT (KSLC) -->
|
||||
<conversion stationId="72572" factor="1.016" />
|
||||
<!--Salem, OR (KSLE) -->
|
||||
<conversion stationId="72694" factor="1.016" />
|
||||
<!--Great Falls, MT (KTFX) -->
|
||||
<conversion stationId="72776" factor="1.016" />
|
||||
<!--Tucson, AZ (KTWC) -->
|
||||
<conversion stationId="72274" factor="1.016" />
|
||||
<!--Quillayute, WA (KUIL) -->
|
||||
<conversion stationId="72797" factor="1.016" />
|
||||
<!--Vanderberg AFB, CA (KVBG) -->
|
||||
<conversion stationId="72393" factor="1.016" />
|
||||
<!--White Sands, NM (KWSD) -->
|
||||
<conversion stationId="72269" factor="1.016" />
|
||||
<!--Yuma (Marine), AZ (KYUM) -->
|
||||
<conversion stationId="72280" factor="1.016" />
|
||||
<!--Aberdeen, SD (KABR) -->
|
||||
<conversion stationId="72659" factor="1.016" />
|
||||
<!--Amarillo, TX (KAMA) -->
|
||||
<conversion stationId="72363" factor="1.016" />
|
||||
<!--Bismarck, ND (KBIS) -->
|
||||
<conversion stationId="72764" factor="1.016" />
|
||||
<!--Brownsville, TX (KBRO) -->
|
||||
<conversion stationId="72250" factor="1.016" />
|
||||
<!--Corpus Christi, TX (KCRP) -->
|
||||
<conversion stationId="72251" factor="1.016" />
|
||||
<!--Dodge City, KS (KDDC) -->
|
||||
<conversion stationId="72451" factor="1.016" />
|
||||
<!--Del Rio, TX (KDRT) -->
|
||||
<conversion stationId="72261" factor="1.016" />
|
||||
<!--Quad Cities, IL (KDVN) -->
|
||||
<conversion stationId="74455" factor="1.016" />
|
||||
<!--El Paso, TX (KEPZ) -->
|
||||
<conversion stationId="72364" factor="1.016" />
|
||||
<!--Fort Worth, TX (KFWD) -->
|
||||
<conversion stationId="72249" factor="1.016" />
|
||||
<!--Green Bay, WI (KGRB) -->
|
||||
<conversion stationId="72645" factor="1.016" />
|
||||
<!--Fort Hood, TX (KHLR) -->
|
||||
<conversion stationId="72257" factor="1.016" />
|
||||
<!--Lincoln, IL (KILX) -->
|
||||
<conversion stationId="74560" factor="1.016" />
|
||||
<!--International Falls, MN (KINL) -->
|
||||
<conversion stationId="72747" factor="1.016" />
|
||||
<!--North Platte, NE (KLBF) -->
|
||||
<conversion stationId="72562" factor="1.016" />
|
||||
<!--Little Rock, AR (KLZK) -->
|
||||
<conversion stationId="72340" factor="1.016" />
|
||||
<!--Midland, TX (KMAF) -->
|
||||
<conversion stationId="72265" factor="1.016" />
|
||||
<!--Minneapolis, MN (KMPX) -->
|
||||
<conversion stationId="72649" factor="1.016" />
|
||||
<!--Omaha, NE (KOAX) -->
|
||||
<conversion stationId="72558" factor="1.016" />
|
||||
<!--Oklahoma City, OK (KOUN) -->
|
||||
<conversion stationId="72357" factor="1.016" />
|
||||
<!--Springfield, MO (KSGF) -->
|
||||
<conversion stationId="72440" factor="1.016" />
|
||||
<!--Topeka, KS (KTOP) -->
|
||||
<conversion stationId="72456" factor="1.016" />
|
||||
<!--Rapid City, SD (KUNR) -->
|
||||
<conversion stationId="72662" factor="1.016" />
|
||||
<!--Albany, NY (KALY) -->
|
||||
<conversion stationId="72518" factor="1.016" />
|
||||
<!--Phillips AAF, Aberdeen, MD (KAPG) -->
|
||||
<conversion stationId="74002" factor="1.016" />
|
||||
<!--Gaylord, MI (KAPX) -->
|
||||
<conversion stationId="72634" factor="1.016" />
|
||||
<!--Birmingham, AL (KBMX) -->
|
||||
<conversion stationId="72230" factor="1.016" />
|
||||
<!--Buffalo, NY (KBUF) -->
|
||||
<conversion stationId="72528" factor="1.016" />
|
||||
<!--Caribou, ME (KCAR) -->
|
||||
<conversion stationId="72712" factor="1.016" />
|
||||
<!--Chatham, MA (KCHH) -->
|
||||
<conversion stationId="74494" factor="1.016" />
|
||||
<!--Charleston, SC (KCHS) -->
|
||||
<conversion stationId="72208" factor="1.016" />
|
||||
<!--Detroit, MI (KDTX) -->
|
||||
<conversion stationId="72632" factor="1.016" />
|
||||
<!--Key West, FL (KKEY) -->
|
||||
<conversion stationId="72201" factor="1.016" />
|
||||
<!--Atlanta, GA (KFFC) -->
|
||||
<conversion stationId="72215" factor="1.016" />
|
||||
<!--Greensboro, NC (KGSO) -->
|
||||
<conversion stationId="72317" factor="1.016" />
|
||||
<!--Portland, ME (KGYX) -->
|
||||
<conversion stationId="74389" factor="1.016" />
|
||||
<!--Cincinnati, OH (KILN) -->
|
||||
<conversion stationId="72426" factor="1.016" />
|
||||
<!--Jackson, MS (KJAN) -->
|
||||
<conversion stationId="72235" factor="1.016" />
|
||||
<!--Jacksonville, FL (KJAX) -->
|
||||
<conversion stationId="72206" factor="1.016" />
|
||||
<!--Lake Charles, LA (KLCH) -->
|
||||
<conversion stationId="72240" factor="1.016" />
|
||||
<!--New Orleans, LA (KLIX) -->
|
||||
<conversion stationId="72233" factor="1.016" />
|
||||
<!--Wash-Dulles, VA (KIAD) -->
|
||||
<conversion stationId="72403" factor="1.016" />
|
||||
<!--Miami, FL (KMFL) -->
|
||||
<conversion stationId="72202" factor="1.016" />
|
||||
<!--Morehead City, NC (KMHX) -->
|
||||
<conversion stationId="72305" factor="1.016" />
|
||||
<!--Nashville, TN (KOHX) -->
|
||||
<conversion stationId="72327" factor="1.016" />
|
||||
<!--Upton, NY (KOKX) -->
|
||||
<conversion stationId="72501" factor="1.016" />
|
||||
<!--Pittsburgh, PA (KPBZ) -->
|
||||
<conversion stationId="72520" factor="1.016" />
|
||||
<!--Roanoke, VA (KRNK) -->
|
||||
<conversion stationId="72318" factor="1.016" />
|
||||
<!--Shreveport, LA (KSHV) -->
|
||||
<conversion stationId="72248" factor="1.016" />
|
||||
<!--Tallahasee, FL (KTAE) -->
|
||||
<conversion stationId="72214" factor="1.016" />
|
||||
<!--Tampa Bay, FL (KTBW) -->
|
||||
<conversion stationId="72210" factor="1.016" />
|
||||
<!--Valparaiso/Eglin, FL (KVPS) -->
|
||||
<conversion stationId="72221" factor="1.016" />
|
||||
<!--Wallops Island, VA (KWAL) -->
|
||||
<conversion stationId="72402" factor="1.016" />
|
||||
<!--Cape Canaveral, FL (KXMR) -->
|
||||
<conversion stationId="74794" factor="1.016" />
|
||||
<!--Redstone Arsenal, AL -->
|
||||
<conversion stationId="74001" factor="1.016" />
|
||||
<!--Eureka, NW (CWEU) -->
|
||||
<conversion stationId="71917" factor="1.016" />
|
||||
<!--Sachs Harbour, NW (CWSY) -->
|
||||
<conversion stationId="71051" factor="1.016" />
|
||||
<!--Baker Lake, NW (CYBK) -->
|
||||
<conversion stationId="71926" factor="1.016" />
|
||||
<!--Cambridge Bay, NW (CYCB) -->
|
||||
<conversion stationId="71925" factor="1.016" />
|
||||
<!--Inuvik, NW (CYEV) -->
|
||||
<conversion stationId="71957" factor="1.016" />
|
||||
<!--Frobisher Bay, NW (CYFB) -->
|
||||
<conversion stationId="71909" factor="1.016" />
|
||||
<!--Alert, NW (CYLT) -->
|
||||
<conversion stationId="71082" factor="1.016" />
|
||||
<!--Resolute Bay, NW (CYRB) -->
|
||||
<conversion stationId="71924" factor="1.016" />
|
||||
<!--Fort Smith, NW (CYSM) -->
|
||||
<conversion stationId="71934" factor="1.016" />
|
||||
<!--Hall Beach, NW (CYUX) -->
|
||||
<conversion stationId="71081" factor="1.016" />
|
||||
<!--Nonman Wells, NW (CYVQ) -->
|
||||
<conversion stationId="71043" factor="1.016" />
|
||||
<!--Whitehorse, YK (CYXY) -->
|
||||
<conversion stationId="71964" factor="1.016" />
|
||||
<!--Coral Harbour, NW (CYZS) -->
|
||||
<conversion stationId="71915" factor="1.016" />
|
||||
<!--Edmonton/Stony, AB (CWEG) -->
|
||||
<conversion stationId="71119" factor="1.016" />
|
||||
<!--Edmonton/Namao, AB (CYED) -->
|
||||
<conversion stationId="71121" factor="1.016" />
|
||||
<!--Edmonton Airport, AB (CYEG) -->
|
||||
<conversion stationId="71123" factor="1.016" />
|
||||
<!--Kelowna, BC (CYLW) -->
|
||||
<conversion stationId="71203" factor="1.016" />
|
||||
<!--Cold Lake, AB (CYOD) -->
|
||||
<conversion stationId="71120" factor="1.016" />
|
||||
<!--Edmonton, AB (CYXD) -->
|
||||
<conversion stationId="71879" factor="1.016" />
|
||||
<!--Prince George, BC (CYXS) -->
|
||||
<conversion stationId="71896" factor="1.016" />
|
||||
<!--Fort Nelson, BC (CYYE) -->
|
||||
<conversion stationId="71945" factor="1.016" />
|
||||
<!--Victoria, BC (CYYJ) -->
|
||||
<conversion stationId="71799" factor="1.016" />
|
||||
<!--Port Hardy, BC (CYZT) -->
|
||||
<conversion stationId="71109" factor="1.016" />
|
||||
<!--Camp Shilo, MB (CWLO) -->
|
||||
<conversion stationId="71853" factor="1.016" />
|
||||
<!--Pickle Lake, ON (CWPL) -->
|
||||
<conversion stationId="71845" factor="1.016" />
|
||||
<!--The Pas, MB (CYQD) -->
|
||||
<conversion stationId="71867" factor="1.016" />
|
||||
<!--Churchill, MB (CYYQ) -->
|
||||
<conversion stationId="71913" factor="1.016" />
|
||||
<!--Placentia, NF (CWAR) -->
|
||||
<conversion stationId="71807" factor="1.016" />
|
||||
<!--Maniwaki, QB (CWMW) -->
|
||||
<conversion stationId="71722" factor="1.016" />
|
||||
<!--Shelburne, NS (CWOS) -->
|
||||
<conversion stationId="71399" factor="1.016" />
|
||||
<!--Sable Island, NS (CWSA) -->
|
||||
<conversion stationId="71600" factor="1.016" />
|
||||
<!--Moosonee, ON (CWZC) -->
|
||||
<conversion stationId="71836" factor="1.016" />
|
||||
<!--La Grande 4, QB (CYAH) -->
|
||||
<conversion stationId="71823" factor="1.016" />
|
||||
<!--Camp Gagetown NB (CYCX) -->
|
||||
<conversion stationId="71701" factor="1.016" />
|
||||
<!--Halifax Metoc, NS (CYHZ) -->
|
||||
<conversion stationId="71396" factor="1.016" />
|
||||
<!--Stephenville, NF (CYJT) -->
|
||||
<conversion stationId="71815" factor="1.016" />
|
||||
<!--Inoucdjouac, QB (CYPH) -->
|
||||
<conversion stationId="71907" factor="1.016" />
|
||||
<!--Yarmouth, NS (CYQI) -->
|
||||
<conversion stationId="71603" factor="1.016" />
|
||||
<!--Montreal/Dorval, QB (CYUL) -->
|
||||
<conversion stationId="71627" factor="1.016" />
|
||||
<!--Fort Chimo, QB (CYVP) -->
|
||||
<conversion stationId="71906" factor="1.016" />
|
||||
<!--Goose Bay, NF (CYYR) -->
|
||||
<conversion stationId="71816" factor="1.016" />
|
||||
<!--St. Johns/Torbay, NF (CYYT) -->
|
||||
<conversion stationId="71801" factor="1.016" />
|
||||
<!--Toronto Int'l, ON (CYYZ) -->
|
||||
<conversion stationId="71624" factor="1.016" />
|
||||
<!--Sept-lies, QB (CYZV) -->
|
||||
<conversion stationId="71811" factor="1.016" />
|
||||
<!--Adak/Davis AFB, AK -->
|
||||
<conversion stationId="70454" factor="1.016" />
|
||||
<!--Barter Island, AK (PABA) -->
|
||||
<conversion stationId="70086" factor="1.016" />
|
||||
<!--Bethel, AK (PABE) -->
|
||||
<conversion stationId="70219" factor="1.016" />
|
||||
<!--Barrow, AK (PABR) -->
|
||||
<conversion stationId="70026" factor="1.016" />
|
||||
<!--Cold Bay, AK (PACB) -->
|
||||
<conversion stationId="70316" factor="1.016" />
|
||||
<!--Kodiak, AK (PADQ) -->
|
||||
<conversion stationId="70350" factor="1.016" />
|
||||
<!--Fairbanks, AK (PAFA) -->
|
||||
<conversion stationId="70261" factor="1.016" />
|
||||
<!--Anchorage, AK (PAFC) -->
|
||||
<conversion stationId="70273" factor="1.016" />
|
||||
<!--King Salmon, AK (PAKN) -->
|
||||
<conversion stationId="70326" factor="1.016" />
|
||||
<!--McGrath, AK (PAMC) -->
|
||||
<conversion stationId="70231" factor="1.016" />
|
||||
<!--Annette Is, AK (PANT) -->
|
||||
<conversion stationId="70398" factor="1.016" />
|
||||
<!--Nome, AK (PAOM) -->
|
||||
<conversion stationId="70200" factor="1.016" />
|
||||
<!--Kotzebue, AK (PAOT) -->
|
||||
<conversion stationId="70133" factor="1.016" />
|
||||
<!--St. Paul Island, AK (PASN) -->
|
||||
<conversion stationId="70308" factor="1.016" />
|
||||
<!--Shemya AFB, AK (PASY) -->
|
||||
<conversion stationId="70414" factor="1.016" />
|
||||
<!--Yakutat, AK (PAYA) -->
|
||||
<conversion stationId="70361" factor="1.016" />
|
||||
</sigWindHeightConversionList>
|
|
@ -119,6 +119,7 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
|
|||
* the same parm simultaneously.
|
||||
* Added code to check the purge times when publishing and not publish
|
||||
* data that is eligible to be purged.
|
||||
* 12/03/13 #2595 randerso Added check for null update time in commitGrid
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -581,7 +582,8 @@ public class GridParmManager {
|
|||
// if update time is less than publish time, grid
|
||||
// has not changed since last published,
|
||||
// therefore only update history, do not publish
|
||||
if ((gdh.getPublishTime() == null)
|
||||
if ((gdh.getUpdateTime() == null)
|
||||
|| (gdh.getPublishTime() == null)
|
||||
|| (gdh.getUpdateTime().getTime() > gdh
|
||||
.getPublishTime().getTime())
|
||||
// in service backup, times on srcHistory
|
||||
|
|
|
@ -22,7 +22,9 @@ package com.raytheon.edex.plugin.gfe.server.handler;
|
|||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.Writer;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -36,10 +38,13 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.edex.core.EDEXUtil;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Request handler for <code>SaveCombinationsFileRequest</code>. Writes the
|
||||
* specified zone combinations to the specified site's combinations file
|
||||
* directory.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -48,6 +53,8 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 16, 2011 dgilling Initial creation
|
||||
* Dec 02, 2013 #2591 dgilling Only send notification after Writer is
|
||||
* flushed/closed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -79,43 +86,48 @@ public class SaveCombinationsFileHandler implements
|
|||
FileUtil.join(COMBO_FILE_DIR, request.getFileName()));
|
||||
boolean isAdded = (!localFile.exists());
|
||||
|
||||
List<Object> listOfCombos = new ArrayList<Object>();
|
||||
FileWriter file = null;
|
||||
Writer outWriter = null;
|
||||
try {
|
||||
file = new FileWriter(localFile);
|
||||
BufferedWriter out = new BufferedWriter(file);
|
||||
outWriter = new BufferedWriter(new FileWriter(localFile));
|
||||
String zoneComments = "\n# Automatically generated combinations file\n# "
|
||||
+ request.getFileName() + "\n\nCombinations = [\n";
|
||||
out.write(zoneComments);
|
||||
DecimalFormat df = new DecimalFormat("00");
|
||||
outWriter.write(zoneComments);
|
||||
|
||||
NumberFormat df = new DecimalFormat("00");
|
||||
for (int i = 0; i < request.getCombos().size(); i++) {
|
||||
StringBuilder nextLineToWrite = new StringBuilder();
|
||||
List<String> modZGL = new ArrayList<String>(request.getCombos()
|
||||
.get(i).size());
|
||||
for (String zone : request.getCombos().get(i)) {
|
||||
modZGL.add("'" + zone + "'");
|
||||
}
|
||||
listOfCombos.add("\t(" + modZGL + ", " + "'Region"
|
||||
+ df.format((i + 1)) + "' ),\n");
|
||||
out.write(listOfCombos.get(i).toString());
|
||||
nextLineToWrite.append("\t([");
|
||||
nextLineToWrite.append(StringUtil.join(modZGL, ','));
|
||||
nextLineToWrite.append("], ");
|
||||
nextLineToWrite.append("'Region");
|
||||
nextLineToWrite.append(df.format(i + 1));
|
||||
nextLineToWrite.append("' ),\n");
|
||||
outWriter.write(nextLineToWrite.toString());
|
||||
}
|
||||
out.write("]");
|
||||
out.close();
|
||||
|
||||
FileChangeType changeType = FileChangeType.UPDATED;
|
||||
if (isAdded) {
|
||||
changeType = FileChangeType.ADDED;
|
||||
}
|
||||
EDEXUtil.getMessageProducer().sendAsync(
|
||||
"utilityNotify",
|
||||
new FileUpdatedMessage(localization, FileUtil.join(
|
||||
COMBO_FILE_DIR, request.getFileName()), changeType,
|
||||
localFile.lastModified()));
|
||||
outWriter.write("]");
|
||||
} finally {
|
||||
if (file != null) {
|
||||
file.close();
|
||||
if (outWriter != null) {
|
||||
outWriter.close();
|
||||
}
|
||||
}
|
||||
|
||||
// placing the notification code here ensures we only send the
|
||||
// notification on a successful file write operation. Otherwise we would
|
||||
// have thrown an IOException and never gotten to this portion of the
|
||||
// request handler.
|
||||
FileChangeType changeType = isAdded ? FileChangeType.ADDED
|
||||
: FileChangeType.UPDATED;
|
||||
EDEXUtil.getMessageProducer().sendAsync(
|
||||
"utilityNotify",
|
||||
new FileUpdatedMessage(localization, FileUtil.join(
|
||||
COMBO_FILE_DIR, request.getFileName()), changeType,
|
||||
localFile.lastModified()));
|
||||
|
||||
return new ServerResponse<Object>();
|
||||
}
|
||||
|
||||
|
|
|
@ -763,7 +763,7 @@ def storeScalarWE(we, trList, file, timeRange, databaseID,
|
|||
for i in xrange(len(overlappingTimes) -1, -1, -1):
|
||||
ot = overlappingTimes[i]
|
||||
if not ot in histDict:
|
||||
del overlappingTime[i]
|
||||
del overlappingTimes[i]
|
||||
del timeList[i]
|
||||
elif we.getGpi().isRateParm():
|
||||
durRatio = (float(timeList[i][1]-timeList[i][0]))/float((ot[1]-ot[0]))
|
||||
|
|
|
@ -34,6 +34,7 @@ import com.raytheon.edex.plugin.grib.exception.GribException;
|
|||
import com.raytheon.edex.plugin.grib.spatial.GribSpatialCache;
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.edex.util.grib.CompositeModel;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
|
@ -79,7 +80,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
|
||||
* Nov 19, 2013 2478 rjpeter Make update process update database also.
|
||||
*
|
||||
* Dec 06, 2013 2170 rjpeter Update to pass PluginDataObject[] to notification.
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -227,7 +228,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
|
|||
updateExistingRecord(record, assembledRecord, thinned, dao);
|
||||
}
|
||||
EDEXUtil.getMessageProducer().sendAsync("notificationAggregation",
|
||||
record);
|
||||
new PluginDataObject[] { record });
|
||||
}
|
||||
|
||||
private GridRecord createAssembledRecord(GridRecord record,
|
||||
|
|
|
@ -56,14 +56,15 @@ import com.raytheon.uf.common.util.LogUtil;
|
|||
* Jul 18, 2013 1653 mpduff Add getSubscriptionStatusSummary method.
|
||||
* Oct 2, 2013 1797 dhladky Generics
|
||||
* Oct 01, 2013 2267 bgonzale Log error response from proposed scheduling.
|
||||
* Dec 11, 2013 2625 mpduff Fix error handling to not return null.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
* @version 1.0
|
||||
*/
|
||||
public abstract class BandwidthService<T extends Time, C extends Coverage> extends
|
||||
BasePrivilegedServerService<IBandwidthRequest<T, C>> implements
|
||||
public abstract class BandwidthService<T extends Time, C extends Coverage>
|
||||
extends BasePrivilegedServerService<IBandwidthRequest<T, C>> implements
|
||||
IBandwidthService<T, C> {
|
||||
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
|
@ -183,7 +184,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public IProposeScheduleResponse proposeSchedule(Subscription<T, C> subscription) {
|
||||
public IProposeScheduleResponse proposeSchedule(
|
||||
Subscription<T, C> subscription) {
|
||||
return proposeSchedule(Arrays.asList(subscription));
|
||||
}
|
||||
|
||||
|
@ -257,9 +259,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
return sendRequest(request, BandwidthGraphData.class);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to retrieve bandwidth graph data, returning null.",
|
||||
e);
|
||||
return null;
|
||||
"Unable to retrieve bandwidth graph data.", e);
|
||||
return new BandwidthGraphData();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +269,8 @@ public abstract class BandwidthService<T extends Time, C extends Coverage> exten
|
|||
public SubscriptionStatusSummary getSubscriptionStatusSummary(
|
||||
Subscription<T, C> subscription) {
|
||||
IBandwidthRequest<T, C> request = new IBandwidthRequest<T, C>();
|
||||
request.setSubscriptions(Arrays.<Subscription<T, C>> asList(subscription));
|
||||
request.setSubscriptions(Arrays
|
||||
.<Subscription<T, C>> asList(subscription));
|
||||
request.setRequestType(RequestType.GET_SUBSCRIPTION_STATUS);
|
||||
try {
|
||||
return sendRequest(request, SubscriptionStatusSummary.class);
|
||||
|
|
|
@ -35,7 +35,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 20, 2013 2397 bgonzale Initial creation.
|
||||
* Nov 25, 2545 2545 mpduff Added bucketTimeInMinutes.
|
||||
* Nov 25, 2013 2545 mpduff Added bucketTimeInMinutes.
|
||||
* Dec 17, 2013 2636 bgonzale Refactored bucket fill in edex.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -173,29 +174,4 @@ public class BandwidthBucketDescription implements
|
|||
this.bucketTimeMinutes = bucketTimeMinutes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get any data that is leftover after filling the bucket.
|
||||
*
|
||||
* @return The amount of data overage
|
||||
*/
|
||||
public long getLeftovers() {
|
||||
long leftover = 0;
|
||||
|
||||
if (this.usedBytes > this.bucketSize) {
|
||||
leftover = usedBytes - bucketSize;
|
||||
usedBytes = bucketSize;
|
||||
}
|
||||
|
||||
return leftover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add any leftovers from the previous buckets.
|
||||
*
|
||||
* @param leftovers
|
||||
* data overage from previous buckets
|
||||
*/
|
||||
public void addLeftovers(long leftovers) {
|
||||
this.usedBytes += leftovers;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Sep 20, 2013 2397 bgonzale Added Map of Bucket Descriptions.
|
||||
* Nov 19, 2013 2545 bgonzale Added 'add' method stub. Still work to do.
|
||||
* Nov 25, 2013 2545 mpduff Finished implementing 2545.
|
||||
* Dec 11, 2013 2625 mpduff Add error handling for no data conditions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -220,7 +221,11 @@ public class BandwidthGraphData {
|
|||
* @return Number of subscriptions
|
||||
*/
|
||||
public int getNumberOfSubscriptions(Network network) {
|
||||
return networkDataMap.get(network).size();
|
||||
if (networkDataMap.size() > 0) {
|
||||
return networkDataMap.get(network).size();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,6 +244,11 @@ public class BandwidthGraphData {
|
|||
*/
|
||||
public List<String> getSubscriptionsSortedByTime(Network network,
|
||||
long currentTime, boolean intersect) {
|
||||
// No data so return empty list.
|
||||
if (networkDataMap.size() == 0) {
|
||||
return new ArrayList<String>(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort each of the subscriptions array time windows so they are in
|
||||
* order by time window start time.
|
||||
|
|
|
@ -81,6 +81,9 @@ import com.raytheon.uf.common.time.TimeRange;
|
|||
* Jun 20, 2013 2127 rjpeter Added OnDelete annotation.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Sep 20, 2013 2147 rferrel Changes to archive hdf5 files.
|
||||
* Dec 03, 2013 2597 randerso Cleared gridHistory id when adding new history
|
||||
* records in consolidateHistory so dao will recognize
|
||||
* it as a new record
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -265,6 +268,7 @@ public class GFERecord extends PluginDataObject implements IPersistable {
|
|||
} else {
|
||||
GridDataHistory hist = newHistory.get(i);
|
||||
hist.setParent(this);
|
||||
hist.setId(0);
|
||||
gridHistory.add(hist);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,10 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Grid
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.grid
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.common.dataplugin.grid.dataquery,
|
||||
|
@ -14,22 +15,22 @@ Export-Package: com.raytheon.uf.common.dataplugin.grid,
|
|||
com.raytheon.uf.common.dataplugin.grid.request,
|
||||
com.raytheon.uf.common.dataplugin.grid.units,
|
||||
com.raytheon.uf.common.dataplugin.grid.util
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0";visibility:=reexport,
|
||||
com.raytheon.uf.common.parameter;bundle-version="1.0.0";visibility:=reexport,
|
||||
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174";visibility:=reexport,
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.gridcoverage;visibility:=reexport,
|
||||
com.raytheon.uf.common.parameter;visibility:=reexport,
|
||||
com.raytheon.uf.common.dataplugin.level;visibility:=reexport,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.datastorage,
|
||||
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.dataquery,
|
||||
com.raytheon.uf.common.util,
|
||||
com.raytheon.uf.common.dataaccess,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.common.style,
|
||||
org.apache.commons.beanutils,
|
||||
javax.measure,
|
||||
javax.persistence;bundle-version="1.0.0",
|
||||
org.hibernate;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.uf.common.style,
|
||||
com.raytheon.uf.common.style.level
|
||||
javax.persistence,
|
||||
org.hibernate
|
||||
|
|
|
@ -35,7 +35,6 @@ import javax.persistence.UniqueConstraint;
|
|||
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
|
@ -59,15 +58,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 21, 2012 bsteffen Initial creation
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* May 21, 2012 bsteffen Initial creation
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Dec 16, 2013 2574 bsteffen Remove getDecoderGettable.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -184,11 +184,6 @@ public class GridRecord extends PersistablePluginDataObject implements
|
|||
getInfoNotNull().setEnsembleId(ensembleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDecoderGettable getDecoderGettable() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpatialObject getSpatialObject() {
|
||||
return getLocation();
|
||||
|
|
|
@ -42,9 +42,10 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 27, 2012 bsteffen Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Feb 27, 2012 bsteffen Initial creation
|
||||
* Dec 16, 2013 2574 bsteffen Update deprecated method call.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -97,8 +98,8 @@ public class DatasetInfoLookup {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
Object obj = manager.unmarshalFromXmlFile(file.getFile());
|
||||
DatasetInfoSet set = (DatasetInfoSet) obj;
|
||||
DatasetInfoSet set = manager.unmarshalFromXmlFile(
|
||||
DatasetInfoSet.class, file.getFile());
|
||||
for (DatasetInfo info : set.getInfos()) {
|
||||
infoMap.put(info.getDatasetId(), info);
|
||||
}
|
||||
|
|
|
@ -60,11 +60,12 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 14, 2012 bsteffen Initial creation
|
||||
* Jan 14, 2013 1469 bkowal No longer needs to retrieve the location
|
||||
* of the hdf5 data directory.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Nov 14, 2012 bsteffen Initial creation
|
||||
* Jan 14, 2013 1469 bkowal No longer needs to retrieve the location
|
||||
* of the hdf5 data directory.
|
||||
* Dec 16, 2013 2574 bsteffen Fixed bugs in setRequestArea.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -193,9 +194,9 @@ public class GridDataRetriever {
|
|||
double lat2) throws GridCoverageException {
|
||||
SubGrid subGrid = new SubGrid();
|
||||
subGrid.setLowerLeftLat(Math.min(lat1, lat2));
|
||||
subGrid.setLowerLeftLon(Math.min(lat1, lat2));
|
||||
subGrid.setUpperRightLat(Math.min(lat1, lat2));
|
||||
subGrid.setUpperRightLon(Math.min(lat1, lat2));
|
||||
subGrid.setLowerLeftLon(Math.min(lon1, lon1));
|
||||
subGrid.setUpperRightLat(Math.max(lat1, lat2));
|
||||
subGrid.setUpperRightLon(Math.max(lon2, lon2));
|
||||
requestCoverage = record.getLocation().trim(subGrid);
|
||||
int[] minIndex = { subGrid.getUpperLeftX(), subGrid.getUpperLeftY() };
|
||||
int[] maxIndex = { subGrid.getUpperLeftX() + subGrid.getNX(),
|
||||
|
@ -321,7 +322,7 @@ public class GridDataRetriever {
|
|||
}
|
||||
}
|
||||
|
||||
private File findStorageLocation() throws StorageException {
|
||||
private File findStorageLocation() {
|
||||
IHDFFilePathProvider pathProvider = record.getHDFPathProvider();
|
||||
|
||||
String path = pathProvider.getHDFPath(record.getPluginName(), record);
|
||||
|
|
|
@ -4148,4 +4148,15 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
|
|||
<displayUnits>kts</displayUnits>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
</styleRuleset>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>SnowT</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits>C</displayUnits>
|
||||
<contourLabeling>
|
||||
<values>-15 -5 0</values>
|
||||
</contourLabeling>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
</styleRuleset>
|
|
@ -24,7 +24,7 @@ import java.util.Map;
|
|||
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Local Storm Report event type
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -33,6 +33,7 @@ import java.util.Map;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 14, 2009 jkorman Initial creation
|
||||
* Dec 09, 2013 2581 njensen Added freezing drizzle
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,7 +82,8 @@ public enum LSREventType {
|
|||
TSTMWNDDMG("TSTM WND DMG",36,LSRUnits.NOUNITS),
|
||||
TSTMWNDGST("TSTM WND GST",37,LSRUnits.MPH),
|
||||
WATERSPOUT("WATER SPOUT",38,LSRUnits.NOUNITS),
|
||||
WILDFIRE("WILDFIRE",39,LSRUnits.NOUNITS);
|
||||
WILDFIRE("WILDFIRE",39,LSRUnits.NOUNITS),
|
||||
FREEZINGDRIZZLE("FREEZING DRIZZLE", 40, LSRUnits.NOUNITS);
|
||||
|
||||
private final String eventName;
|
||||
|
||||
|
|
|
@ -30,8 +30,6 @@ import javax.measure.quantity.Velocity;
|
|||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -70,6 +68,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed XML annotations and IDecoderGettable
|
||||
* Dec 10, 2013 2581 njensen Removed dataURI column
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,7 +77,9 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "lsrseq")
|
||||
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@Table(name = "lsr", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
"latitude", "longitude", "stationId", "refTime", "forecastTime",
|
||||
"eventType" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
|
@ -116,13 +117,12 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
private LSREventType eventType;
|
||||
|
||||
// Correction indicator from wmo header
|
||||
@DataURI(position = 2)
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
private String corIndicator;
|
||||
|
||||
@Embedded
|
||||
@DataURI(position = 3, embedded = true)
|
||||
@DataURI(position = 2, embedded = true)
|
||||
@DynamicSerializeElement
|
||||
private SurfaceObsLocation location;
|
||||
|
||||
|
@ -504,13 +504,6 @@ public class LocalStormReport extends PersistablePluginDataObject implements
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "lsr";
|
||||
|
|
|
@ -73,6 +73,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Jul 14, 2013 2180 dhladky GUI update for mouse over display
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Oct 14, 2013 2361 njensen Removed IDecoderGettable
|
||||
* Dec 10, 2013 2616 mpduff Added stationId to the unique constraint
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -83,7 +84,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "madisseq")
|
||||
@Table(name = "madis", uniqueConstraints = { @UniqueConstraint(columnNames = {
|
||||
"location", "refTime", "provider", "subProvider", "restriction" }) })
|
||||
"location", "stationId", "refTime", "provider", "subProvider", "restriction" }) })
|
||||
@org.hibernate.annotations.Table(appliesTo = "madis", indexes = { @Index(name = "madis_wfsQueryIndex", columnNames = {
|
||||
"refTime", "location" }), })
|
||||
@DynamicSerialize
|
||||
|
|
|
@ -46,10 +46,12 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2011 mschenke Initial creation
|
||||
* May 30, 2013 #2028 randerso Changed to return simple geometry or multi-geometry if possible
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Oct 12, 2011 mschenke Initial creation
|
||||
* May 30, 2013 2028 randerso Changed to return simple geometry or
|
||||
* multi-geometry if possible
|
||||
* Dec 11, 2013 2619 bsteffen Fix rare dateline bug in flattenGeometry.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -318,14 +320,14 @@ public class WorldWrapCorrector {
|
|||
Coordinate a = coords[i];
|
||||
Coordinate b = coords[ip1];
|
||||
|
||||
b.x += currOffset;
|
||||
double testX = b.x + currOffset;
|
||||
|
||||
Boolean low = null;
|
||||
if (a.x - b.x > 180.0) {
|
||||
if (a.x - testX > 180.0) {
|
||||
low = false;
|
||||
} else if (b.x - a.x > 180.0) {
|
||||
} else if (testX - a.x > 180.0) {
|
||||
low = true;
|
||||
} else if (checker.check(a.x, b.x)) {
|
||||
} else if (checker.check(a.x, testX)) {
|
||||
handle = true;
|
||||
}
|
||||
|
||||
|
@ -334,18 +336,20 @@ public class WorldWrapCorrector {
|
|||
// we wrap either low end or high
|
||||
if (low) {
|
||||
currOffset -= 360;
|
||||
b.x -= 360.0;
|
||||
if (currOffset < minOffset) {
|
||||
minOffset = currOffset;
|
||||
}
|
||||
} else {
|
||||
currOffset += 360;
|
||||
b.x += 360;
|
||||
if (currOffset > maxOffset) {
|
||||
maxOffset = currOffset;
|
||||
}
|
||||
}
|
||||
b.x += currOffset;
|
||||
} else {
|
||||
b.x = testX;
|
||||
}
|
||||
|
||||
}
|
||||
return handle ? new double[] { minOffset, maxOffset } : null;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ Bundle-SymbolicName: com.raytheon.uf.common.gridcoverage
|
|||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Export-Package: com.raytheon.uf.common.gridcoverage,
|
||||
com.raytheon.uf.common.gridcoverage.convert,
|
||||
|
@ -19,4 +20,5 @@ Require-Bundle: com.raytheon.uf.common.serialization,
|
|||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataquery,
|
||||
org.apache.commons.lang
|
||||
org.apache.commons.lang,
|
||||
org.apache.commons.beanutils
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.gridcoverage.convert;
|
||||
|
||||
import org.apache.commons.beanutils.ConversionException;
|
||||
import org.apache.commons.beanutils.Converter;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURIFieldConverter;
|
||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||
import com.raytheon.uf.common.gridcoverage.lookup.GridCoverageLookup;
|
||||
|
@ -42,7 +45,7 @@ import com.raytheon.uf.common.gridcoverage.lookup.GridCoverageLookup;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GridCoverageConverter implements DataURIFieldConverter {
|
||||
public class GridCoverageConverter implements DataURIFieldConverter, Converter {
|
||||
|
||||
@Override
|
||||
public String toString(Object field) {
|
||||
|
@ -71,6 +74,19 @@ public class GridCoverageConverter implements DataURIFieldConverter {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridCoverage convert(Class clazz, Object value) {
|
||||
if (value instanceof Integer) {
|
||||
return fromInteger((Integer) value);
|
||||
} else if (value instanceof String) {
|
||||
return fromString((String) value);
|
||||
} else {
|
||||
throw new ConversionException("Cannot convert "
|
||||
+ String.valueOf(value) + " of type "
|
||||
+ value.getClass().getSimpleName() + " to a GridCoverage.");
|
||||
}
|
||||
}
|
||||
|
||||
public GridCoverage fromInteger(Integer integer) {
|
||||
if (integer != null) {
|
||||
GridCoverage result = GridCoverageLookup.getInstance().getCoverage(
|
||||
|
@ -81,7 +97,7 @@ public class GridCoverageConverter implements DataURIFieldConverter {
|
|||
}
|
||||
throw new UnsupportedOperationException(
|
||||
"Cannot find GridCoverage with id of "
|
||||
+ String.valueOf(integer));
|
||||
+ String.valueOf(integer));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.spi.v4.CatalogObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.spi.v4.CatalogObjectsResponse;
|
||||
|
||||
import org.apache.cxf.annotations.GZIP;
|
||||
import org.apache.cxf.annotations.FastInfoset;
|
||||
|
||||
import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
||||
|
||||
|
@ -46,12 +46,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 2012 bphillip Initial implementation
|
||||
* 10/17/2013 1682 bphillip Added software history
|
||||
* 12/9/2013 2613 bphillip Changed to use FastInfoset
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@FastInfoset
|
||||
@WebService(name = "Cataloger", targetNamespace = EbxmlNamespaces.SPI_INT_URI)
|
||||
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
|
|
|
@ -32,7 +32,7 @@ import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.UpdateObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
|
||||
|
||||
import org.apache.cxf.annotations.GZIP;
|
||||
import org.apache.cxf.annotations.FastInfoset;
|
||||
|
||||
import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
||||
|
||||
|
@ -48,12 +48,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 2012 bphillip Initial implementation
|
||||
* 10/17/2013 1682 bphillip Added software history
|
||||
* 12/9/2013 2613 bphillip Changed to use FastInfoset
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@FastInfoset
|
||||
@WebService(name = "LifecycleManager", targetNamespace = EbxmlNamespaces.RR_INT_URI)
|
||||
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
|
|
|
@ -32,7 +32,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
|
||||
|
||||
import org.apache.cxf.annotations.GZIP;
|
||||
import org.apache.cxf.annotations.FastInfoset;
|
||||
|
||||
import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
||||
|
||||
|
@ -46,12 +46,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
|||
* 2012 bphillip Initial implementation
|
||||
* 10/17/2013 1682 bphillip Added software history
|
||||
* 10/20/2013 1682 bphillip Added synchronous notification delivery
|
||||
* 12/9/2013 2613 bphillip Changed to use FastInfoset
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@FastInfoset
|
||||
@WebService(name = "NotificationListener", targetNamespace = EbxmlNamespaces.NL_INT_URI)
|
||||
@SOAPBinding(style = Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
|
||||
|
||||
import org.apache.cxf.annotations.GZIP;
|
||||
import org.apache.cxf.annotations.FastInfoset;
|
||||
|
||||
import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
||||
|
||||
|
@ -43,12 +43,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 2012 bphillip Initial implementation
|
||||
* 10/17/2013 1682 bphillip Added software history
|
||||
* 12/9/2013 2613 bphillip Changed to use FastInfoset
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@FastInfoset
|
||||
@WebService(name = "QueryManager", targetNamespace = EbxmlNamespaces.RR_INT_URI)
|
||||
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
|
|
|
@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.spi.v4.ValidateObjectsRequest;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.spi.v4.ValidateObjectsResponse;
|
||||
|
||||
import org.apache.cxf.annotations.GZIP;
|
||||
import org.apache.cxf.annotations.FastInfoset;
|
||||
|
||||
import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
||||
|
||||
|
@ -43,12 +43,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 2012 bphillip Initial implementation
|
||||
* 10/17/2013 1682 bphillip Added software history
|
||||
* 12/9/2013 2613 bphillip Changed to use FastInfoset
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@FastInfoset
|
||||
@WebService(name = "Validator", targetNamespace = EbxmlNamespaces.SPI_INT_URI)
|
||||
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
|
|
|
@ -62,6 +62,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
|
|||
* May 01, 2013 1967 njensen Fixed autoboxing for Eclipse 3.8
|
||||
* Jun 24, 2013 2106 djohnson Use IDENTIFIER generic for method signature.
|
||||
* 10/8/2013 1682 bphillip Added the createCriteria method
|
||||
* 12/9/2013 2613 bphillip Added flushAndClearSession method
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -429,6 +430,14 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
|
|||
return ((SessionFactoryImpl) template.getSessionFactory()).getDialect();
|
||||
}
|
||||
|
||||
/**
|
||||
* Flushes and clears the current Hibernate Session
|
||||
*/
|
||||
public void flushAndClearSession() {
|
||||
this.getSessionFactory().getCurrentSession().flush();
|
||||
this.getSessionFactory().getCurrentSession().clear();
|
||||
}
|
||||
|
||||
protected SessionFactory getSessionFactory() {
|
||||
return template.getSessionFactory();
|
||||
}
|
||||
|
|
|
@ -16,28 +16,10 @@
|
|||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- SBN routed subscriptions are scheduled for retrieval at the WFO,
|
||||
but the actual retrieval occurs at the NCF -->
|
||||
<bean id="SBNRetrievalPlan"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan">
|
||||
<property name="network" value="SBN" />
|
||||
<property name="map" ref="BandwidthMap" />
|
||||
<property name="bandwidthDao" ref="bandwidthDao" />
|
||||
<property name="bucketsDao" ref="bandwidthBucketDao" />
|
||||
<property name="associator" ref="bandwidthBucketAllocationAssociator" />
|
||||
<property name="scheduler">
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.PriorityRetrievalScheduler" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<util:map id="retrievalPlans">
|
||||
<entry key="OPSNET">
|
||||
<ref local="OPSNETRetrievalPlan" />
|
||||
</entry>
|
||||
<entry key="SBN">
|
||||
<ref local="SBNRetrievalPlan" />
|
||||
</entry>
|
||||
</util:map>
|
||||
|
||||
</beans>
|
|
@ -61,6 +61,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan;
|
|||
* Jul 11, 2013 2106 djohnson Use priority straight from the BandwidthSubscription.
|
||||
* Sep 20, 2013 2397 bgonzale Add Map of Bucket Descriptions to BandwidthGraphData.
|
||||
* Nov 27, 2013 2545 mpduff Get data by network
|
||||
* Dec 11, 2013 2566 bgonzale handle case when there are no reservations.
|
||||
* Dec 17, 2013 2636 bgonzale Refactored bucket fill in edex.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -130,12 +132,14 @@ class BandwidthGraphDataAdapter {
|
|||
final List<BandwidthReservation> bandwidthReservations = retrievalPlan
|
||||
.getBandwidthReservationsForBucket(bucket);
|
||||
|
||||
for (BandwidthReservation reservation : bandwidthReservations) {
|
||||
if (!reservations.containsKey(reservation.getId())) {
|
||||
reservations.put(reservation.getId(),
|
||||
new ArrayList<BandwidthReservation>());
|
||||
if (bandwidthReservations != null) {
|
||||
for (BandwidthReservation reservation : bandwidthReservations) {
|
||||
if (!reservations.containsKey(reservation.getId())) {
|
||||
reservations.put(reservation.getId(),
|
||||
new ArrayList<BandwidthReservation>());
|
||||
}
|
||||
reservations.get(reservation.getId()).add(reservation);
|
||||
}
|
||||
reservations.get(reservation.getId()).add(reservation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,9 +181,13 @@ class BandwidthGraphDataAdapter {
|
|||
|
||||
List<Long> binStartTimes = new ArrayList<Long>();
|
||||
binStartTimes.add(retrieval.getStartTime().getTimeInMillis());
|
||||
for (BandwidthReservation reservation : reservations.get(retrieval
|
||||
.getIdentifier())) {
|
||||
binStartTimes.add(reservation.getBandwidthBucket());
|
||||
List<BandwidthReservation> retrievalReservations = reservations
|
||||
.get(retrieval.getIdentifier());
|
||||
|
||||
if (retrievalReservations != null) {
|
||||
for (BandwidthReservation reservation : retrievalReservations) {
|
||||
binStartTimes.add(reservation.getBandwidthBucket());
|
||||
}
|
||||
}
|
||||
window.setBinStartTimes(binStartTimes);
|
||||
windowData.addTimeWindow(window);
|
||||
|
@ -202,9 +210,6 @@ class BandwidthGraphDataAdapter {
|
|||
BandwidthBucketDescription desc = new BandwidthBucketDescription(
|
||||
bucket.getNetwork(), bucket.getBucketSize(),
|
||||
bucket.getCurrentSize(), bucket.getBucketStartTime());
|
||||
desc.addLeftovers(leftovers);
|
||||
|
||||
leftovers = desc.getLeftovers();
|
||||
descriptions.add(desc);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.util.IPerformanceTimer;
|
|||
import com.raytheon.uf.common.time.util.ITimer;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
import com.raytheon.uf.common.util.JarUtil;
|
||||
import com.raytheon.uf.common.util.LogUtil;
|
||||
import com.raytheon.uf.common.util.algorithm.AlgorithmUtil;
|
||||
import com.raytheon.uf.common.util.algorithm.AlgorithmUtil.IBinarySearchResponse;
|
||||
|
@ -129,6 +130,8 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* Nov 04, 2013 2506 bgonzale Added removeBandwidthSubscriptions method.
|
||||
* Nov 19, 2013 2545 bgonzale changed getBandwidthGraphData to protected.
|
||||
* Dec 04, 2013 2566 bgonzale added method to retrieve and parse spring files for a mode.
|
||||
* Dec 11, 2013 2566 bgonzale fix spring resource resolution.
|
||||
* Dec 17, 2013 2636 bgonzale Changed logging to differentiate the output.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -193,8 +196,9 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
int i = 0;
|
||||
for (String fileName : fileList) {
|
||||
String name = RES_PATTERN.matcher(fileName).replaceFirst("");
|
||||
name = JarUtil.getResResourcePath(name);
|
||||
result[i++] = name;
|
||||
statusHandler.debug("Spring file added: " + name + " for mode "
|
||||
statusHandler.info("Spring file added: " + name + " for mode "
|
||||
+ modeName);
|
||||
}
|
||||
return result;
|
||||
|
@ -253,10 +257,10 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
.newArrayListWithCapacity(numberOfRetrievalTimes);
|
||||
|
||||
for (Calendar retrievalTime : retrievalTimes) {
|
||||
statusHandler.info("schedule() - Scheduling subscription ["
|
||||
statusHandler.info("Scheduling subscription ["
|
||||
+ subscription.getName()
|
||||
+ String.format(
|
||||
"] baseReferenceTime [%1$tY%1$tm%1$td%1$tH%1$tM",
|
||||
"] retrievalTime [%1$tY%1$tm%1$td%1$tH%1$tM",
|
||||
retrievalTime) + "]");
|
||||
|
||||
// Add the current subscription to the ones BandwidthManager already
|
||||
|
@ -292,7 +296,7 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
.getBandwidthSubscriptions(dao.getProvider(),
|
||||
dao.getDataSetName(), retrievalTime);
|
||||
|
||||
statusHandler.info("schedule() - Scheduling subscription ["
|
||||
statusHandler.info("Scheduling subscription ["
|
||||
+ dao.getName()
|
||||
+ String.format(
|
||||
"] baseReferenceTime [%1$tY%1$tm%1$td%1$tH%1$tM",
|
||||
|
|
|
@ -68,6 +68,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Jul 11, 2013 2106 djohnson Use BandwidthSubscription instead of Subscription.
|
||||
* Jul 18, 2013 1653 mpduff Implemented method.
|
||||
* Oct 2, 2013 1797 dhladky generics
|
||||
* Dec 17, 2013 2636 bgonzale Added method to get a BandwidthAllocation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -668,4 +669,14 @@ class InMemoryBandwidthDao<T extends Time, C extends Coverage> implements IBandw
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BandwidthAllocation getBandwidthAllocation(long id) {
|
||||
for (BandwidthAllocation current : bandwidthAllocations) {
|
||||
if (current.getId() == id) {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 18, 2013 2106 djohnson Extracted from {@link RetrievalPlan}.
|
||||
* Dec 17, 2013 2636 bgonzale Throw exception if attempt to overfill the bucket.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -104,7 +105,7 @@ public class BandwidthBucket implements Comparable<BandwidthBucket>,
|
|||
}
|
||||
|
||||
public long getAvailableBandwidth() {
|
||||
return Math.max(0, bucketSize - currentSize);
|
||||
return bucketSize - currentSize;
|
||||
}
|
||||
|
||||
public long getBucketSize() {
|
||||
|
@ -119,8 +120,13 @@ public class BandwidthBucket implements Comparable<BandwidthBucket>,
|
|||
return currentSize;
|
||||
}
|
||||
|
||||
public void setCurrentSize(long currentSize) {
|
||||
this.currentSize = currentSize;
|
||||
public void setCurrentSize(long size) {
|
||||
if (size > this.bucketSize) {
|
||||
throw new IllegalArgumentException("New data size, " + size
|
||||
+ ", is greater than available bucket size "
|
||||
+ this.bucketSize);
|
||||
}
|
||||
this.currentSize = size;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,6 +51,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus;
|
|||
* Jun 13, 2013 2095 djohnson Implement ability to store a collection of subscriptions.
|
||||
* Jun 24, 2013 2106 djohnson Add more methods.
|
||||
* Jul 18, 2013 1653 mpduff Added getSubscriptionStatusSummary.
|
||||
* Dec 17, 2013 2636 bgonzale Added method to get a BandwidthAllocation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -487,4 +488,11 @@ public interface IBandwidthDao<T extends Time, C extends Coverage> {
|
|||
* @return the SubscriptionStatusSummary
|
||||
*/
|
||||
SubscriptionStatusSummary getSubscriptionStatusSummary(Subscription<T, C> sub);
|
||||
|
||||
/**
|
||||
* Get the BandwidthAllocation identified by the given id.
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
BandwidthAllocation getBandwidthAllocation(long id);
|
||||
}
|
|
@ -66,6 +66,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Jul 18, 2013 1653 mpduff Added getSubscriptionStatusSummary.
|
||||
* Aug 28, 2013 2290 mpduff Check for no subscriptions.
|
||||
* Oct 2, 2013 1797 dhladky Generics
|
||||
* Dec 17, 2013 2636 bgonzale Added method to get a BandwidthAllocation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -583,4 +584,9 @@ public class HibernateBandwidthDao<T extends Time, C extends Coverage> implement
|
|||
|
||||
return summary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BandwidthAllocation getBandwidthAllocation(long id) {
|
||||
return bandwidthAllocationDao.getById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDao;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 25, 2013 2106 djohnson Extracted from {@link BandwidthBucket} and {@link RetrievalPlan}.
|
||||
* Dec 17, 2013 2636 bgonzale Prevent stale BandwidthAllocation updates by retrieving
|
||||
* them from the dao before updating.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -137,10 +139,16 @@ public class InMemoryBandwidthBucketAllocationAssociator implements
|
|||
for (BandwidthAllocation o : allocations.get(bucket.getIdentifier())) {
|
||||
if (RetrievalStatus.READY.equals(o.getStatus())
|
||||
&& o.getAgentType().equals(agentType)) {
|
||||
allocation = o;
|
||||
allocation.setStatus(RetrievalStatus.PROCESSING);
|
||||
// Persist this change to the database
|
||||
bandwidthDao.createOrUpdate(allocation);
|
||||
allocation = bandwidthDao
|
||||
.getBandwidthAllocation(o.getId());
|
||||
if (allocation == null) {
|
||||
// allocation was removed from persistence, sync the
|
||||
// mapping
|
||||
allocations.remove(o.getId(), o);
|
||||
} else {
|
||||
allocation.setStatus(RetrievalStatus.PROCESSING);
|
||||
bandwidthDao.createOrUpdate(allocation);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue