14.1.1-13 baseline

Former-commit-id: 6eef3022653638f9031a85932d8d551aba5600d2
This commit is contained in:
Steve Harris 2013-12-12 16:59:57 -05:00
parent a3ec45a99f
commit b0b55a676b
41 changed files with 1366 additions and 553 deletions

BIN
cave/.dm/.dirs.dmdb Normal file

Binary file not shown.

View file

@ -413,7 +413,7 @@
<xmlproperty file="${builder}/memorySettings.xml" <xmlproperty file="${builder}/memorySettings.xml"
collapseAttributes="true"/> collapseAttributes="true"/>
<property name="caveXmx" value="2048M" /> <property name="caveXmx" value="3072M" />
<property name="caveMaxPermSize" value="256m" /> <property name="caveMaxPermSize" value="256m" />
<update.ini <update.ini

View file

@ -2,6 +2,36 @@
# CAVE startup script # CAVE startup script
# Note: CAVE will not run as 'root' # 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` user=`/usr/bin/whoami`
if [ ${user} == 'root' ];then if [ ${user} == 'root' ];then
echo "WARNING: CAVE cannot be run as user '${user}'!" echo "WARNING: CAVE cannot be run as user '${user}'!"
@ -9,13 +39,16 @@ if [ ${user} == 'root' ];then
exit 1 exit 1
fi fi
path_to_script=`readlink -f $0` # Since, we no longer need to worry about re-location ...
dir=$(dirname $path_to_script) 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=$? RC=$?
if [ ${RC} -ne 0 ]; then 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 exit 1
fi fi
@ -28,16 +61,11 @@ copyVizShutdownUtilIfNecessary
# delete any old disk caches in the background # delete any old disk caches in the background
deleteOldCaveDiskCaches & 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_LIBRARY_PATH=${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:$LD_LIBRARY_PATH
export LD_PRELOAD=libpython.so 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 PATH=${JAVA_INSTALL}/bin:${PYTHON_INSTALL}/bin:$PATH
export JAVA_HOME="${JAVA_INSTALL}/jre" export JAVA_HOME="${JAVA_INSTALL}/jre"
@ -60,16 +88,16 @@ if [ -x ${TESTCHECK} ]; then
status=${?} status=${?}
if [ $status -eq 11 ]; then if [ $status -eq 11 ]; then
MODE="TEST" MODE="TEST"
SWITCHES=" -mode TEST " SWITCHES="${SWITCHES} -mode TEST "
elif [ $status -eq 12 ];then elif [ $status -eq 12 ];then
MODE="PRACTICE" MODE="PRACTICE"
SWITCHES=" -mode PRACTICE " SWITCHES="${SWITCHES} -mode PRACTICE "
elif [ $status -eq 15 ];then elif [ $status -eq 15 ];then
MODE="OPERATIONAL" MODE="OPERATIONAL"
SWITCHES=" -mode OPERATIONAL" SWITCHES="${SWITCHES} -mode OPERATIONAL"
else else
MODE="OPERATIONAL (no response)" MODE="OPERATIONAL (no response)"
SWITCHES=" " SWITCHES="${SWITCHES} "
fi fi
echo "getTestMode() returned ${MODE}" echo "getTestMode() returned ${MODE}"
else else
@ -79,6 +107,30 @@ fi
export TEXTWS=`hostname | sed -e 's/lx/xt/g'` 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 #check for gtk-2.0 value
gtkResource=.gtkrc-2.0 gtkResource=.gtkrc-2.0
includeLine="include \"$HOME/.gtkrc.mine\"" includeLine="include \"$HOME/.gtkrc.mine\""
@ -108,8 +160,12 @@ else
echo $altButtonLine >> $HOME/$mineFile echo $altButtonLine >> $HOME/$mineFile
fi fi
hostName=`hostname -s` if [[ -z "$PROGRAM_NAME" ]]
LOGDIR=$HOME/caveData/logs/consoleLogs/$hostName/ then
PROGRAM_NAME="cave"
fi
LOGDIR="$HOME/caveData/logs/consoleLogs/$hostName/"
# make sure directory exists # make sure directory exists
if [ ! -d $LOGDIR ]; then if [ ! -d $LOGDIR ]; then
@ -119,39 +175,46 @@ fi
export pid=$$ export pid=$$
curTime=`date +%Y%m%d_%H%M%S` curTime=`date +%Y%m%d_%H%M%S`
LOGFILE=${LOGDIR}/cave_${curTime}_pid_${pid}_console.log LOGFILE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_console.log"
export LOGFILE_CAVE=${LOGDIR}/cave_${curTime}_pid_${pid}_alertviz.log export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_alertviz.log"
export LOGFILE_PERFORMANCE=${LOGDIR}/cave_${curTime}_pid_${pid}_perf.log export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_${pid}_perf.log"
redirect="TRUE"
for flag in $@; do
if [ $flag == "-noredirect" ]; then
redirect="FALSE"
break
fi
done
# can we write to log directory # can we write to log directory
if [ -w ${LOGDIR} ]; then if [ -w ${LOGDIR} ]; then
touch ${LOGFILE} touch ${LOGFILE}
fi 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. # Special instructions for the 64-bit jvm.
ARCH_ARGS="" ARCH_ARGS=""
if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then if [ -f /awips2/java/jre/lib/amd64/server/libjvm.so ]; then
ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so" ARCH_ARGS="-vm /awips2/java/jre/lib/amd64/server/libjvm.so"
fi fi
lookupINI $@ lookupINI "${USER_ARGS[@]}"
if [[ "${runMonitorThreads}" == "true" ]] ; then if [[ "${runMonitorThreads}" == "true" ]] ; then
# nohup to allow tar process to continue after user has logged out # 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 fi
if ( [ ${redirect} == "TRUE" ] ); then if [[ "${redirect}" == "true" ]] ; then
exec ${dir}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} $@ > ${LOGFILE} 2>&1 exec ${CAVE_INSTALL}/cave ${ARCH_ARGS} ${SWITCHES} ${CAVE_INI_ARG} "${USER_ARGS[@]}" > ${LOGFILE} 2>&1
else 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 fi

View file

@ -1,5 +1,34 @@
#!/bin/bash #!/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 source /awips2/cave/iniLookup.sh
RC=$? RC=$?
if [ ${RC} -ne 0 ]; then if [ ${RC} -ne 0 ]; then
@ -60,6 +89,8 @@ function extendLibraryPath()
if [ "${1}" = "-noX" ]; then if [ "${1}" = "-noX" ]; then
export LD_LIBRARY_PATH="${CAVE_LIB_DIRECTORY}/lib_mesa:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="${CAVE_LIB_DIRECTORY}/lib_mesa:$LD_LIBRARY_PATH"
fi fi
CALLED_EXTEND_LIB_PATH="true"
} }
function copyVizShutdownUtilIfNecessary() function copyVizShutdownUtilIfNecessary()
@ -89,7 +120,7 @@ function copyVizShutdownUtilIfNecessary()
function getPidsOfMyRunningCaves() function getPidsOfMyRunningCaves()
{ {
local user=`whoami` 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 # preserve IFS and set it to line feed only
local PREV_IFS=$IFS local PREV_IFS=$IFS

View file

@ -4148,4 +4148,15 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
<displayUnits>kts</displayUnits> <displayUnits>kts</displayUnits>
</contourStyle> </contourStyle>
</styleRule> </styleRule>
<styleRule>
<paramLevelMatches>
<parameter>SnowT</parameter>
</paramLevelMatches>
<contourStyle>
<displayUnits>C</displayUnits>
<contourLabeling>
<values>-15 -5 0</values>
</contourLabeling>
</contourStyle>
</styleRule>
</styleRuleset> </styleRuleset>

View file

@ -20,7 +20,9 @@
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# Returns heat index or wind chill # 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 numpy
import T import T
@ -62,7 +64,7 @@ def execute2(temperature,dewpoint,relHumidity,windSpeed):
def execute3(T,DpT,wSpd): def execute3(T,DpT,wSpd):
TC = T - 273.15 #convert from K to C TC = T - 273.15 #convert from K to C
DpTC = DpT - 273.15 #convert to 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 Hi = HeatIndex.calculate(TC,DpTC) #Outputs Celsius
Wc = WindChill.calculate(TC,wSpd_kmh) #Outputs Celsius Wc = WindChill.calculate(TC,wSpd_kmh) #Outputs Celsius
HiK = numpy.where(Hi != -9999.0, celciusToKelvin(Hi),-9999.0) HiK = numpy.where(Hi != -9999.0, celciusToKelvin(Hi),-9999.0)

Binary file not shown.

View file

@ -20,9 +20,6 @@
package com.raytheon.uf.viz.monitor.scan.commondialogs; package com.raytheon.uf.viz.monitor.scan.commondialogs;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Font;
@ -37,8 +34,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Spinner;
import com.raytheon.uf.common.monitor.scan.config.SCANConfig; import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
import com.raytheon.uf.common.monitor.scan.config.UnwarnedConfig;
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanColors; import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanColors;
import com.raytheon.uf.common.monitor.scan.config.UnwarnedConfig;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/** /**
@ -51,6 +48,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 25, 2009 lvenable Initial creation * Oct 25, 2009 lvenable Initial creation
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* *
* </pre> * </pre>
* *
@ -221,21 +222,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false); gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4; gd.horizontalSpan = 4;
gd.verticalIndent = 20; gd.verticalIndent = 20;
unwarnedTorChk = new Button(controlComp, SWT.CHECK); unwarnedTorChk = createCheckLabelColor(controlComp, gd, "Unwarned TOR");
unwarnedTorChk.setText("Unwarned TOR");
unwarnedTorChk.setSelection(cfgData.getUnwarnedTor()); unwarnedTorChk.setSelection(cfgData.getUnwarnedTor());
unwarnedTorChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedTorChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedTorChk.setLayoutData(gd);
unwarnedTorChk.addSelectionListener(new SelectionAdapter() { unwarnedTorChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
enableTorControls(); enableTorControls();
} }
}); });
setupButtonMouseListeners(unwarnedTorChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true); gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
@ -284,21 +278,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false); gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4; gd.horizontalSpan = 4;
gd.verticalIndent = 20; gd.verticalIndent = 20;
unwarnedSvrChk = new Button(controlComp, SWT.CHECK); unwarnedSvrChk = createCheckLabelColor(controlComp, gd, "Unwarned SVR");
unwarnedSvrChk.setText("Unwarned SVR");
unwarnedSvrChk.setSelection(cfgData.getUnwarnedSvr()); unwarnedSvrChk.setSelection(cfgData.getUnwarnedSvr());
unwarnedSvrChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedSvrChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedSvrChk.setLayoutData(gd);
unwarnedSvrChk.addSelectionListener(new SelectionAdapter() { unwarnedSvrChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
enableSvrControls(); enableSvrControls();
} }
}); });
setupButtonMouseListeners(unwarnedSvrChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true); gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
@ -549,59 +536,58 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
infoText.append("SCAN identifies those storm cells that contain a\n"); infoText.append("SCAN identifies those storm cells that contain a\n");
infoText.append("Tornado Vortex Signature (TVS) and to some extent\n"); infoText.append("Tornado Vortex Signature (TVS) and to some extent\n");
infoText infoText.append("severe weather (based on various storm cell parameters).\n");
.append("severe weather (based on various storm cell parameters).\n"); infoText.append("Now SCAN can determine which storm cells currently have\n");
infoText
.append("Now SCAN can determine which storm cells currently have\n");
infoText.append("an active TOR or SVR warning and which do not. For\n"); infoText.append("an active TOR or SVR warning and which do not. For\n");
infoText infoText.append("those that do not, the SCAN user can set various storm\n");
.append("those that do not, the SCAN user can set various storm\n"); infoText.append("cell parameter thresholds (see below). If these thresholds\n");
infoText infoText.append("are met or exceeded and no TOR and/or SVR is in effect\n");
.append("cell parameter thresholds (see below). If these thresholds\n"); infoText.append("in the polygon where the cell is located, an Unwarned Storm\n");
infoText
.append("are met or exceeded and no TOR and/or SVR is in effect\n");
infoText
.append("in the polygon where the cell is located, an Unwarned Storm\n");
infoText.append("Alarm will be issued.\n\n"); infoText.append("Alarm will be issued.\n\n");
infoText infoText.append("To turn this functionality on for TOR and/or SVR warnings,\n");
.append("To turn this functionality on for TOR and/or SVR warnings,\n"); infoText.append("simply click the toggle below on and then check and specify\n");
infoText infoText.append("the thresholds you would like be used in order to issue a TOR\n");
.append("simply click the toggle below on and then check and specify\n"); infoText.append("and/or SVR Unwarned Storm Cell Alarm. You will know that\n");
infoText infoText.append("an Unwarned Storm Alarm has been issued when the storm\n");
.append("the thresholds you would like be used in order to issue a TOR\n"); infoText.append("cell identifier in the Storm Cell Table changes color to\n");
infoText infoText.append("magenta for TOR warnings and yellow for SVR warnings.");
.append("and/or SVR Unwarned Storm Cell Alarm. You will know that\n");
infoText
.append("an Unwarned Storm Alarm has been issued when the storm\n");
infoText
.append("cell identifier in the Storm Cell Table changes color to\n");
infoText
.append("magenta for TOR warnings and yellow for SVR warnings.");
} }
private void setupButtonMouseListeners(final Button btn) { /**
btn.addMouseMoveListener(new MouseMoveListener() { * Create a composite that contains a checkbox with no text and a colored
@Override * label.
public void mouseMove(MouseEvent e) { *
btn.setForeground(shell.getDisplay().getSystemColor( * @param parentComp
SWT.COLOR_BLACK)); * Parent composite.
} * @param gd
* GridData used for the composite.
* @param labelText
* Text for the label.
* @return The checkbox that is created.
*/
private Button createCheckLabelColor(Composite parentComp, GridData gd,
String labelText) {
}); GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
btn.addMouseTrackListener(new MouseTrackAdapter() { Composite chkLblComp = new Composite(parentComp, SWT.NONE);
@Override chkLblComp.setLayout(gl);
public void mouseExit(MouseEvent e) { chkLblComp.setLayoutData(gd);
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_WHITE));
}
@Override gd = new GridData(18, SWT.DEFAULT);
public void mouseEnter(MouseEvent e) { Button chkBox = new Button(chkLblComp, SWT.CHECK);
btn.setForeground(shell.getDisplay().getSystemColor( chkBox.setLayoutData(gd);
SWT.COLOR_BLACK));
} Label lbl = new Label(chkLblComp, SWT.NONE);
}); lbl.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
lbl.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
lbl.setText(" " + labelText);
return chkBox;
} }
@Override @Override

View file

@ -63,6 +63,8 @@ import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
* Feb 28, 2013 1731 bsteffen Optimize construction of scan resource. * Feb 28, 2013 1731 bsteffen Optimize construction of scan resource.
* Apr 18, 2013 1926 njensen Reuse URIs in construction of resource * Apr 18, 2013 1926 njensen Reuse URIs in construction of resource
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* 04 Dec 2013 #2592 lvenable Added check to ensure the PluginDataObject
* array has at least one element.
* *
* </pre> * </pre>
* *
@ -97,56 +99,37 @@ public class ScanResourceData extends AbstractRequestableResourceData {
protected AbstractVizResource<?, ?> constructResource( protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects) LoadProperties loadProperties, PluginDataObject[] objects)
throws VizException { throws VizException {
List<String> uris = getScan().getAvailableUris(
ScanTables.valueOf(tableType), icao);
try {
long t0 = System.currentTimeMillis();
// Forces ScanMonitor to grab data back for one extra hour 1/2 past
// the first time.
Calendar firstCal = ((ScanRecord) objects[0]).getDataTime()
.getRefTimeAsCalendar();
firstCal.add(Calendar.MINUTE, -90);
Date firstDate = firstCal.getTime();
int count = 0;
List<ScanRecord> recordsToLoad = new ArrayList<ScanRecord>(
uris.size());
for (String uri : uris) {
ScanRecord record = new ScanRecord(uri);
if (record.getDataTime().getRefTime().after(firstDate)) {
recordsToLoad.add(record);
}
}
ScanRecord[] records = recordsToLoad.toArray(new ScanRecord[0]);
populateRecords(records); if (objects.length > 0) {
for (ScanRecord record : records) {
if ((record.getTableData() != null)
&& (record.getDataTime() != null)
&& (record.getTableData().getVolScanTime() != null)) {
getScan().setTableData(icao, record.getTableData(), List<String> uris = getScan().getAvailableUris(
/* ScanTables.valueOf(tableType), icao);
* TODO: This should be the volume scan time, but try {
* {Radar,Scan}Record.getVolScanTime is actually the radar long t0 = System.currentTimeMillis();
* product generation time. // Forces ScanMonitor to grab data back for one extra hour 1/2
*/ // past
record.getDataTime().getRefTime(), record.getTilt(), // the first time.
record.getDataTime().getRefTime(), tableType); Calendar firstCal = ((ScanRecord) objects[0]).getDataTime()
count++; .getRefTimeAsCalendar();
firstCal.add(Calendar.MINUTE, -90);
if (record.getType().equals(ScanTables.DMD.name())) { Date firstDate = firstCal.getTime();
if (dataObjectMap == null) { int count = 0;
dataObjectMap = new HashMap<DataTime, ScanRecord>(); List<ScanRecord> recordsToLoad = new ArrayList<ScanRecord>(
} uris.size());
dataObjectMap.put(record.getDataTime(), record); for (String uri : uris) {
ScanRecord record = new ScanRecord(uri);
if (record.getDataTime().getRefTime().after(firstDate)) {
recordsToLoad.add(record);
} }
} }
} ScanRecord[] records = recordsToLoad.toArray(new ScanRecord[0]);
populateRecords(records);
for (ScanRecord record : records) {
if ((record.getTableData() != null)
&& (record.getDataTime() != null)
&& (record.getTableData().getVolScanTime() != null)) {
// populate the DMD data map
if (tableType.equals(ScanTables.DMD.name())) {
if (dataObjectMap != null) {
for (ScanRecord record : dataObjectMap.values()) {
getScan().setTableData(icao, record.getTableData(), getScan().setTableData(icao, record.getTableData(),
/* /*
* TODO: This should be the volume scan time, but * TODO: This should be the volume scan time, but
@ -154,39 +137,64 @@ public class ScanResourceData extends AbstractRequestableResourceData {
* radar product generation time. * radar product generation time.
*/ */
record.getDataTime().getRefTime(), record.getTilt(), record.getDataTime().getRefTime(), record.getTilt(),
record.getDataTime().getRefTime(), record.getDataTime().getRefTime(), tableType);
record.getType()); count++;
getScan().setDmdTilt(record.getTilt(), icao);
getScan().addDmdScanRecord(record); if (record.getType().equals(ScanTables.DMD.name())) {
if (dataObjectMap == null) {
dataObjectMap = new HashMap<DataTime, ScanRecord>();
}
dataObjectMap.put(record.getDataTime(), record);
}
} }
} }
}
long t4 = System.currentTimeMillis();
System.out.println("Loaded " + count + " out of " + uris.size() // populate the DMD data map
+ " objects in " + (t4 - t0) + "ms"); if (tableType.equals(ScanTables.DMD.name())) {
// need to update the dialog here after the if (dataObjectMap != null) {
// scanResourceData has been fully populated for (ScanRecord record : dataObjectMap.values()) {
getScan().setInstantiated(true); getScan().setTableData(icao, record.getTableData(),
if ((getScan().getDialog(ScanTables.valueOf(tableType), icao) != null) /*
&& !getScan() * TODO: This should be the volume scan time, but
.getDialog(ScanTables.valueOf(tableType), icao) * {Radar,Scan}Record.getVolScanTime is actually the
.getCurrentShell().isDisposed()) { * radar product generation time.
DataTime time = getScan().getMostRecent(getScan(), tableType, */
icao); record.getDataTime().getRefTime(),
if (time != null) { record.getTilt(),
getScan().updateDialog( record.getDataTime().getRefTime(),
ScanTables.valueOf(tableType), record.getType());
icao, getScan().setDmdTilt(record.getTilt(), icao);
time.getRefTime(), getScan().addDmdScanRecord(record);
time.getRefTime(), }
getScan().getTiltAngle( }
ScanTables.valueOf(tableType), icao));
} }
long t4 = System.currentTimeMillis();
System.out.println("Loaded " + count + " out of " + uris.size()
+ " objects in " + (t4 - t0) + "ms");
// need to update the dialog here after the
// scanResourceData has been fully populated
getScan().setInstantiated(true);
if ((getScan().getDialog(ScanTables.valueOf(tableType), icao) != null)
&& !getScan()
.getDialog(ScanTables.valueOf(tableType), icao)
.getCurrentShell().isDisposed()) {
DataTime time = getScan().getMostRecent(getScan(),
tableType, icao);
if (time != null) {
getScan().updateDialog(
ScanTables.valueOf(tableType),
icao,
time.getRefTime(),
time.getRefTime(),
getScan().getTiltAngle(
ScanTables.valueOf(tableType), icao));
}
}
} catch (Exception e) {
e.printStackTrace();
getScan().closeDialog(icao);
} }
} catch (Exception e) {
e.printStackTrace();
getScan().closeDialog(icao);
} }
return new ScanResource(this, loadProperties); return new ScanResource(this, loadProperties);
} }

View file

@ -40,8 +40,10 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.MessageBox;
@ -78,6 +80,10 @@ import com.raytheon.uf.viz.monitor.scan.commondialogs.LoadSaveConfigDlg.DialogTy
* Apr 26, 2013 #1945 lvenable Some code cleanup. * Apr 26, 2013 #1945 lvenable Some code cleanup.
* 06 Jun 2013 #2065 lvenable Added convenience method to alert the user to use the clear * 06 Jun 2013 #2065 lvenable Added convenience method to alert the user to use the clear
* button if they want to close the dialog. * button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
@ -642,6 +648,62 @@ public abstract class AbstractTableDlg extends Dialog implements IMonitor,
// this will mean firing a get graphData Event back to the monitor // this will mean firing a get graphData Event back to the monitor
} }
/**
* This is a method that will create a composite that contains a checkbox
* with no text and a label. Since the upgrade to Redhat 6, a checkbox that
* has its foreground and background color changed can cause the check in
* the checkbox to become invisible if the foreground color is too light.
* This method creates an ordinary checkbox with the label and composite
* background being colored.
*
* @param parentComp
* Parent composite.
* @param bgColor
* Background color.
* @param fgColor
* Foreground color.
* @param labelText
* Text for the label.
* @param colorComposite
* Flag indicating if the composite background color should be
* set.
* @param toolTipText
* Set the toolTipText
* @return The checkbox control that is created.
*/
protected final Button createCheckLabelComposite(Composite parentComp,
Color bgColor, Color fgColor, String labelText,
boolean colorComposite, String toolTipText) {
GridData gd = new GridData();
GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
Composite chkLblComp = new Composite(parentComp, SWT.NONE);
chkLblComp.setLayout(gl);
chkLblComp.setLayoutData(gd);
if (colorComposite) {
chkLblComp.setBackground(bgColor);
}
gd = new GridData(18, SWT.DEFAULT);
Button chkBox = new Button(chkLblComp, SWT.CHECK);
chkBox.setLayoutData(gd);
Label lbl = new Label(chkLblComp, SWT.NONE);
lbl.setBackground(bgColor);
lbl.setForeground(fgColor);
lbl.setText(" " + labelText);
chkBox.setToolTipText(toolTipText);
lbl.setToolTipText(toolTipText);
return chkBox;
}
@Override @Override
public ArrayList<IMonitor> getMonitorControlListeners() { public ArrayList<IMonitor> getMonitorControlListeners() {
return controlListeners; return controlListeners;

View file

@ -92,6 +92,10 @@ import com.raytheon.viz.ui.EditorUtil;
* some bad code, and some code cleanup. * some bad code, and some code cleanup.
* 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear * 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear
* button if they want to close the dialog. * button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* *
* </pre> * </pre>
* *
@ -306,13 +310,11 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
} }
}); });
gd = new GridData();
configBtn = new Button(controlComp, SWT.PUSH); configBtn = new Button(controlComp, SWT.PUSH);
configBtn.setText("Configurations"); configBtn.setText("Configurations");
configBtn configBtn
.setBackground(scanCfg.getScanColor(ScanColors.Configurations)); .setBackground(scanCfg.getScanColor(ScanColors.Configurations));
configBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); configBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
configBtn.setLayoutData(gd);
configBtn.addSelectionListener(new SelectionAdapter() { configBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -343,12 +345,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(rankBtn); setupButtonMouseListeners(rankBtn);
gd = new GridData();
attribBtn = new Button(controlComp, SWT.PUSH); attribBtn = new Button(controlComp, SWT.PUSH);
attribBtn.setText("Attributes"); attribBtn.setText("Attributes");
attribBtn.setBackground(scanCfg.getScanColor(ScanColors.Attributes)); attribBtn.setBackground(scanCfg.getScanColor(ScanColors.Attributes));
attribBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); attribBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
attribBtn.setLayoutData(gd);
attribBtn.addSelectionListener(new SelectionAdapter() { attribBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -358,12 +358,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(attribBtn); setupButtonMouseListeners(attribBtn);
gd = new GridData();
tablesBtn = new Button(controlComp, SWT.PUSH); tablesBtn = new Button(controlComp, SWT.PUSH);
tablesBtn.setText("Tables"); tablesBtn.setText("Tables");
tablesBtn.setBackground(scanCfg.getScanColor(ScanColors.Default)); tablesBtn.setBackground(scanCfg.getScanColor(ScanColors.Default));
tablesBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); tablesBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tablesBtn.setLayoutData(gd);
tablesBtn.addSelectionListener(new SelectionAdapter() { tablesBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -376,55 +374,58 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(tablesBtn); setupButtonMouseListeners(tablesBtn);
gd = new GridData(); /*
linkToFrameChk = new Button(controlComp, SWT.CHECK); * Link to Frame
linkToFrameChk.setText("Link to Frame "); */
linkToFrameChk.setBackground(scanCfg linkToFrameChk = createCheckLabelComposite(controlComp,
.getScanColor(ScanColors.LinkToFrame)); scanCfg.getScanColor(ScanColors.LinkToFrame),
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(cellCfgMgr.getScanCellCfgXML() linkToFrameChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getLinkToFrame()); .getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() { linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleLinkToFrame(); handleLinkToFrame();
} }
}); });
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder(); StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells,\n"); tipText.append("Activate to remove from the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's that are outside your CWA.\n\n"); tipText.append("MESOs, and TVS's that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells,\n"); tipText.append("Deactivate to include in the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's detected by radar."); tipText.append("MESOs, and TVS's detected by radar.");
gd = new GridData(); cwaFilterChk = createCheckLabelComposite(controlComp,
cwaFilterChk = new Button(controlComp, SWT.CHECK); scanCfg.getScanColor(ScanColors.CWAFilter),
cwaFilterChk.setText("CWA Filter "); display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter)); tipText.toString());
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk.setSelection(cellCfgMgr.getScanCellCfgXML() cwaFilterChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption()); .getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() { cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction(); handleCWAFilterAction();
} }
}); });
setupButtonMouseListeners(cwaFilterChk);
// Uses same back ground color as attributes. /*
gd = new GridData(); * Unwarned
unwarnedChk = new Button(controlComp, SWT.CHECK); */
unwarnedChk.setText("Unwarned "); unwarnedChk = createCheckLabelComposite(controlComp,
unwarnedChk.setBackground(scanCfg.getScanColor(ScanColors.Attributes)); scanCfg.getScanColor(ScanColors.Attributes),
unwarnedChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); display.getSystemColor(SWT.COLOR_WHITE), "Unwarned ", true,
null);
unwarnedChk.setSelection(cellCfgMgr.getScanCellCfgXML() unwarnedChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption()); .getFilterOption());
unwarnedChk.setLayoutData(gd);
unwarnedChk.addSelectionListener(new SelectionAdapter() { unwarnedChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -432,41 +433,31 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
displayUnwarnedAlarmDialog(); displayUnwarnedAlarmDialog();
} }
}); });
setupButtonMouseListeners(unwarnedChk);
// Create/Recreate the unwarned config data since the ScanConfig is a // Create/Recreate the unwarned config data since the ScanConfig is a
// singleton // singleton and the data clears out when the CELL table dialog get
// and the data clears out when the CELL table dialog get re-created. // re-created.
scanCfg.createUnwarnedConfig(); scanCfg.createUnwarnedConfig();
// Vertical tables are not supported at this time. /*
gd = new GridData(); * Vertical - tech blocked
vertChk = new Button(controlComp, SWT.CHECK); */
vertChk.setText("Vert "); vertChk = createCheckLabelComposite(controlComp,
vertChk.setEnabled(false); scanCfg.getScanColor(ScanColors.Vert),
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert)); display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(cellCfgMgr.getScanCellCfgXML().getFilterOption()); vertChk.setSelection(cellCfgMgr.getScanCellCfgXML().getFilterOption());
vertChk.setLayoutData(gd); vertChk.setEnabled(false);
/* /*
* The vertical table is a techblocked DR. This selection listener will * Tool tips
* be commented out until it is needed.
*/ */
// vertChk.addSelectionListener(new SelectionAdapter() { tipsChk = createCheckLabelComposite(controlComp,
// @Override scanCfg.getScanColor(ScanColors.Tips),
// public void widgetSelected(SelectionEvent e) { display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
// }
// });
setupButtonMouseListeners(vertChk);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(cellCfgMgr.getScanCellCfgXML().getTipsOption()); tipsChk.setSelection(cellCfgMgr.getScanCellCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() { tipsChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -474,8 +465,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
scanTableComp.updateColumnTips(); scanTableComp.updateColumnTips();
} }
}); });
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = 75; gd.widthHint = 75;
alarmBtn = new Button(controlComp, SWT.PUSH); alarmBtn = new Button(controlComp, SWT.PUSH);

View file

@ -93,6 +93,10 @@ import com.raytheon.viz.ui.EditorUtil;
* some bad code, and some code cleanup. * some bad code, and some code cleanup.
* 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear * 06 Jun 2013 #2065 lvenable Added code to alert the user to use the clear
* button if they want to close the dialog. * button if they want to close the dialog.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* *
* </pre> * </pre>
* *
@ -428,74 +432,66 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(attribBtn); setupButtonMouseListeners(attribBtn);
gd = new GridData(); /*
linkToFrameChk = new Button(controlComp, SWT.CHECK); * Link to frame
linkToFrameChk.setText("Link to Frame "); */
linkToFrameChk.setBackground(scanCfg linkToFrameChk = createCheckLabelComposite(controlComp,
.getScanColor(ScanColors.LinkToFrame)); scanCfg.getScanColor(ScanColors.LinkToFrame),
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(dmdConfigMgr.getScanDmdCfgXML() linkToFrameChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getLinkToFrame()); .getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() { linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleLinkToFrame(); handleLinkToFrame();
} }
}); });
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder(); StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells and\n"); tipText.append("Activate to remove from the SCAN table all cells and\n");
tipText.append("DMDs that are outside your CWA.\n\n"); tipText.append("DMDs that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells and\n"); tipText.append("Deactivate to include in the SCAN table all cells and\n");
tipText.append("DMDs detected by radar."); tipText.append("DMDs detected by radar.");
gd = new GridData(); cwaFilterChk = createCheckLabelComposite(controlComp,
cwaFilterChk = new Button(controlComp, SWT.CHECK); scanCfg.getScanColor(ScanColors.CWAFilter),
cwaFilterChk.setText("CWA Filter "); display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter)); tipText.toString());
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk.setSelection(dmdConfigMgr.getScanDmdCfgXML() cwaFilterChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getFilterOption()); .getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() { cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction(); handleCWAFilterAction();
} }
}); });
setupButtonMouseListeners(cwaFilterChk);
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
/* /*
* The vertical table is a techblocked DR. This will be commented out * Vertical - tech blocked
* until that is addressed.
*/ */
// vertChk.addSelectionListener(new SelectionAdapter() { vertChk = createCheckLabelComposite(controlComp,
// @Override scanCfg.getScanColor(ScanColors.Vert),
// public void widgetSelected(SelectionEvent e) { display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
// }
// }); vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
setupButtonMouseListeners(vertChk); vertChk.setEnabled(false);
/*
* Tool tips
*/
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getTipsOption()); tipsChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() { tipsChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -504,8 +500,10 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
dmdTableComp.updateColumnTips(); dmdTableComp.updateColumnTips();
} }
}); });
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
alarmBtn = new Button(controlComp, SWT.PUSH); alarmBtn = new Button(controlComp, SWT.PUSH);
alarmBtn.setText("Alarm"); alarmBtn.setText("Alarm");

View file

@ -71,6 +71,10 @@ import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance. * Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* *
* </pre> * </pre>
* *
@ -242,48 +246,38 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(attribBtn); setupButtonMouseListeners(attribBtn);
/*
* Vertical - tech blocked
*/
// Vertical tables are not supported at this time. // Vertical tables are not supported at this time.
gd = new GridData(); vertChk = createCheckLabelComposite(controlComp,
vertChk = new Button(controlComp, SWT.CHECK); scanCfg.getScanColor(ScanColors.Vert),
vertChk.setText("Vert "); display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getFilterOption()); vertChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getFilterOption());
vertChk.setLayoutData(gd); vertChk.setEnabled(false);
/* /*
* The vertical table is a techblocked DR. This selection listener will * Tool tips
* be commented out until it is needed.
*/ */
// vertChk.addSelectionListener(new SelectionAdapter() { tipsChk = createCheckLabelComposite(controlComp,
// @Override scanCfg.getScanColor(ScanColors.Tips),
// public void widgetSelected(SelectionEvent e) { display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
// }
// });
setupButtonMouseListeners(vertChk);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getTipsOption()); tipsChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() { tipsChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
System.out.println(tipsChk.getSelection());
SCANConfig.getInstance().setShowTips(scanTable, SCANConfig.getInstance().setShowTips(scanTable,
tipsChk.getSelection()); tipsChk.getSelection());
System.out
.println(SCANConfig.getInstance().showTips(scanTable));
System.out.println(scanTable.name());
scanTableComp.updateColumnTips(); scanTableComp.updateColumnTips();
} }
}); });
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true); gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160; gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT); timeLbl = new Label(controlComp, SWT.RIGHT);

View file

@ -70,6 +70,10 @@ import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance. * Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* *
* </pre> * </pre>
* *
@ -233,48 +237,37 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
}); });
setupButtonMouseListeners(attribBtn); setupButtonMouseListeners(attribBtn);
// Vertical tables are not supported at this time. /*
gd = new GridData(); * Vertical - tech blocked
vertChk = new Button(controlComp, SWT.CHECK); */
vertChk.setText("Vert "); vertChk = createCheckLabelComposite(controlComp,
vertChk.setEnabled(false); scanCfg.getScanColor(ScanColors.Vert),
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert)); display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getFilterOption()); vertChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getFilterOption());
vertChk.setLayoutData(gd); vertChk.setEnabled(false);
/* /*
* The vertical table is a techblocked DR. This selection listener will * Tool tips
* be commented out until it is needed.
*/ */
// vertChk.addSelectionListener(new SelectionAdapter() { tipsChk = createCheckLabelComposite(controlComp,
// @Override scanCfg.getScanColor(ScanColors.Tips),
// public void widgetSelected(SelectionEvent e) { display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
// }
// });
setupButtonMouseListeners(vertChk);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getTipsOption()); tipsChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() { tipsChk.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
System.out.println(tipsChk.getSelection());
SCANConfig.getInstance().setShowTips(scanTable, SCANConfig.getInstance().setShowTips(scanTable,
tipsChk.getSelection()); tipsChk.getSelection());
System.out
.println(SCANConfig.getInstance().showTips(scanTable));
System.out.println(scanTable.name());
scanTableComp.updateColumnTips(); scanTableComp.updateColumnTips();
} }
}); });
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true); gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160; gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT); timeLbl = new Label(controlComp, SWT.RIGHT);

View file

@ -1,7 +1,39 @@
#!/bin/bash #!/bin/bash
# CAVE startup script # CAVE startup script
# Note: CAVE will not run as 'root' # 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` user=`/usr/bin/whoami`
if [ ${user} == 'root' ];then if [ ${user} == 'root' ];then
echo "WARNING: CAVE cannot be run as user '${user}'!" echo "WARNING: CAVE cannot be run as user '${user}'!"
@ -16,75 +48,44 @@ if [ ${RC} -ne 0 ]; then
exit 1 exit 1
fi fi
dir=${0%/*} PROGRAM_NAME="gfeclient"
if [ "$dir" = "$0" ]; then # remove "-enablegl" flag from command-line if set so it doesn't confuse any
# commands we call later.
dir="." USER_ARGS=()
while [[ $1 ]]
fi do
if [ "$1" == "-enablegl" ]
cd "$dir" then
ENABLEGL="true"
# 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"
else else
MODE="OPERATIONAL (no response)" USER_ARGS+=("$1")
SWITCHES=" "
fi fi
echo "getTestMode() returned ${MODE}" shift
else done
MODE="UNKNOWN"
echo "getTestMode() not found - going to use defaults"
fi
export TEXTWS=`hostname | sed -e 's/lx/xt/g'` if [ -n "$ENABLEGL" ]
# if display not set
if [ -n "$DISPLAY" ]
then then
# if display not set
if [ -n "$DISPLAY" ]
then
echo "Using Display set to $DISPLAY" echo "Using Display set to $DISPLAY"
extendLibraryPath extendLibraryPath
else else
echo "Display not set, creating offscreen x on port $$" echo "Display not set, creating offscreen x on port $$"
extendLibraryPath "-noX" extendLibraryPath "-noX"
Xvfb :$$ -screen 0 1280x1024x24 & Xvfb :$$ -screen 0 1280x1024x24 &
xvfb=$! xvfb=$!
export DISPLAY="localhost:$$.0" export DISPLAY="localhost:$$.0"
#don't use shader when no display set #don't use shader when no display set
export SWITCHES="${SWITCHES} -no_shader" SWITCHES="${SWITCHES} -no_shader"
fi
fi fi
COMPONENT_ARGS="-component gfeclient" export IGNORE_NUM_CAVES=1
export LD_PRELOAD=libpython.so
lookupINI ${COMPONENT_ARGS} source /awips2/cave/cave.sh -nosplash -noredirect -component gfeclient "${USER_ARGS[@]}" &
/awips2/cave/cave ${SWITCHES} ${CAVE_INI_ARG} -nosplash ${COMPONENT_ARGS} "$@" wait
if [ -n "$xvfb" ] if [ -n "$xvfb" ]
then then

31
cave/com.raytheon.viz.gfe/GFESuite/ifpIMAGE Executable file → Normal file
View file

@ -1,5 +1,33 @@
#!/bin/sh #!/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 # get path to cave
path_to_script=`readlink -f $0` path_to_script=`readlink -f $0`
RUN_FROM_DIR=`dirname $path_to_script` RUN_FROM_DIR=`dirname $path_to_script`
@ -9,6 +37,7 @@ CAVE_DIR=/awips2/cave
# execute the runProcedure module # execute the runProcedure module
_GFECLI="${RUN_FROM_DIR}/gfeclient.sh" _GFECLI="${RUN_FROM_DIR}/gfeclient.sh"
_GFECLI_ARGS="-enablegl"
_MODULE="${CAVE_DIR}/etc/gfe/utility/PngWriter.py" _MODULE="${CAVE_DIR}/etc/gfe/utility/PngWriter.py"
# quoting of '$@' is used to prevent command line interpretation # quoting of '$@' is used to prevent command line interpretation
@ -17,6 +46,6 @@ then
echo "CAVE and/or gfeclient not installed on this workstation ..exiting" echo "CAVE and/or gfeclient not installed on this workstation ..exiting"
exit 1 exit 1
else else
$_GFECLI $_MODULE "$@" $_GFECLI $_GFECLI_ARGS $_MODULE "$@"
fi fi

View file

@ -22,6 +22,8 @@ package com.raytheon.viz.gfe;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;
import jep.Jep; import jep.Jep;
import jep.JepException; import jep.JepException;
@ -38,6 +40,7 @@ import com.raytheon.uf.common.python.PyUtil;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
@ -52,6 +55,7 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
* Jun 25, 2010 mschenke Initial creation * Jun 25, 2010 mschenke Initial creation
* Aug 20, 2012 #1081 dgilling Don't pass -server and -site args * Aug 20, 2012 #1081 dgilling Don't pass -server and -site args
* to python script. * to python script.
* Dec 04, 2013 #2588 dgilling Add thread to force shutdown.
* *
* </pre> * </pre>
* *
@ -156,6 +160,23 @@ public class GfeClient extends AbstractCAVEComponent {
long t1 = System.currentTimeMillis(); long t1 = System.currentTimeMillis();
System.out.println("Entire execution to run python script: " System.out.println("Entire execution to run python script: "
+ (t1 - t0)); + (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);
} }
/* /*

View file

@ -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.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType; 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.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.grid.Grid2DFloat;
import com.raytheon.uf.common.dataplugin.gfe.server.lock.Lock; 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.ScalarGridSlice;
import com.raytheon.uf.common.dataplugin.gfe.slice.VectorGridSlice; 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.message.WsId;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
@ -79,7 +84,10 @@ import com.vividsolutions.jts.geom.Coordinate;
* change gridInfoText from Label to Text * change gridInfoText from Label to Text
* to make sure the info get displayed inside the screen * to make sure the info get displayed inside the screen
* and can be scrolled. * 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> * </pre>
* *
@ -146,50 +154,46 @@ public class GridInfoDialog extends CaveJFACEDialog implements
b.addSelectionListener(this); b.addSelectionListener(this);
} }
// Composite composite2 = new Composite(top, SWT.NONE); gridInfoText = new Text(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL
// layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true); | SWT.READ_ONLY);
// composite2.setLayoutData(layoutData);
// composite2.setLayout(new GridLayout(1, true));
gridInfoText = new Text(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.READ_ONLY);
layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
gridInfoText.setBackground(group.getBackground()); gridInfoText.setBackground(group.getBackground());
gridInfoText.setLayoutData(layoutData); gridInfoText.setLayoutData(layoutData);
} }
/* /*
* adjust the width of the dialog * adjust the width of the dialog
*/ */
private void adjustDlg(String infoText){ private void adjustDlg(String infoText) {
int screenWidth = this.getParentShell().getDisplay(). int screenWidth = this.getParentShell().getDisplay()
getPrimaryMonitor().getBounds().width; .getPrimaryMonitor().getBounds().width;
int maxWidth = (int)Math.round(screenWidth * 0.75); int maxWidth = (int) Math.round(screenWidth * 0.75);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
int maxLength = getMaxWidth(infoText); int maxLength = getMaxWidth(infoText);
if ( maxLength > maxWidth ) { if (maxLength > maxWidth) {
gd.widthHint = maxWidth; gd.widthHint = maxWidth;
gridInfoText.setLayoutData(gd); gridInfoText.setLayoutData(gd);
} else { } else {
gridInfoText.setLayoutData(gd); gridInfoText.setLayoutData(gd);
} }
gridInfoText.setText(infoText); gridInfoText.setText(infoText);
} }
/* /*
* get the maximum width of the info * get the maximum width of the info
*/ */
private int getMaxWidth(String textInfo){ private int getMaxWidth(String textInfo) {
String[] splits = textInfo.split("\\n"); String[] splits = textInfo.split("\\n");
GC gc = new GC (gridInfoText); GC gc = new GC(gridInfoText);
FontMetrics fm = gc.getFontMetrics (); FontMetrics fm = gc.getFontMetrics();
int acw = fm.getAverageCharWidth (); int acw = fm.getAverageCharWidth();
int maxStr = 0; int maxStr = 0;
for (String str : splits){ for (String str : splits) {
maxStr = Math.max(maxStr, str.length()); maxStr = Math.max(maxStr, str.length());
} }
return maxStr*acw; return maxStr * acw;
} }
@Override @Override
protected void createButtonsForButtonBar(Composite parent) { protected void createButtonsForButtonBar(Composite parent) {
@ -239,17 +243,17 @@ public class GridInfoDialog extends CaveJFACEDialog implements
String choice = b.getText(); String choice = b.getText();
if (choice.equalsIgnoreCase("Grid Info")) { if (choice.equalsIgnoreCase("Grid Info")) {
adjustDlg(getGridInfo()); adjustDlg(getGridInfo());
} else if (choice.equalsIgnoreCase("Grid History")) { } else if (choice.equalsIgnoreCase("Grid History")) {
adjustDlg(getGridHistory()); adjustDlg(getGridHistory());
} else if (choice.equalsIgnoreCase("ISC History")) { } else if (choice.equalsIgnoreCase("ISC History")) {
adjustDlg(getISCHistory()); adjustDlg(getISCHistory());
} else if (choice.equalsIgnoreCase("Weather Element Info")) { } else if (choice.equalsIgnoreCase("Weather Element Info")) {
adjustDlg(getWEInfo()); adjustDlg(getWEInfo());
} else if (choice.equalsIgnoreCase("Weather Element State")) { } else if (choice.equalsIgnoreCase("Weather Element State")) {
adjustDlg(getWEState()); adjustDlg(getWEState());
} else if (choice.equalsIgnoreCase("Locks")) { } else if (choice.equalsIgnoreCase("Locks")) {
adjustDlg(getLockInfo()); adjustDlg(getLockInfo());
} else if (choice.equalsIgnoreCase("Data Distribution")) { } else if (choice.equalsIgnoreCase("Data Distribution")) {
adjustDlg(getDataDistribution()); adjustDlg(getDataDistribution());
} else { } else {
@ -266,8 +270,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
List<Lock> locks = parm.getLockTable().getLocks(); List<Lock> locks = parm.getLockTable().getLocks();
if (locks.isEmpty()) { if (locks.isEmpty()) {
info.append("Weather element is not locked"); info.append("\nWeather element is not locked");
} else { } else {
info.append("\n");
for (Lock lock : locks) { for (Lock lock : locks) {
info.append("(") info.append("(")
.append(gmtFormatter.format(lock.getTimeRange() .append(gmtFormatter.format(lock.getTimeRange()
@ -303,9 +308,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements
grid = iscGridID.grid(); grid = iscGridID.grid();
} }
if (grid == null) { if (grid == null) {
info.append("No ISC Grid"); info.append("\nNo ISC Grid");
} else { } else {
info.append("ISC Grid Valid Time: ").append(grid.getGridTime()) info.append("\nISC Grid Valid Time: ").append(grid.getGridTime())
.append("\n\n"); .append("\n\n");
GridDataHistory[] history = grid.getHistory(); GridDataHistory[] history = grid.getHistory();
@ -360,50 +365,48 @@ public class GridInfoDialog extends CaveJFACEDialog implements
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR) if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)
|| parm.getGridInfo().getGridType().equals(GridType.VECTOR)) { || parm.getGridInfo().getGridType().equals(GridType.VECTOR)) {
info.append("Fuzz Value: ") info.append("\nFuzz Value: ")
.append(parm.getParmState().getFuzzValue()).append("\n"); .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(); return info.toString();
} }
@ -426,14 +429,26 @@ public class GridInfoDialog extends CaveJFACEDialog implements
return value; 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() { private String getDataDistribution() {
StringBuilder info = new StringBuilder(); StringBuilder info = new StringBuilder();
info.append(getBoxTitle(gridData, true, "Data Distribution")); info.append(getBoxTitle(gridData, true, "Data Distribution"));
if (gridData == null) { if (gridData == null) {
info.append("No Grid"); info.append("\nNo Grid");
} else { } else {
info.append("\n");
if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)) { if (parm.getGridInfo().getGridType().equals(GridType.SCALAR)) {
Grid2DFloat grid = ((ScalarGridSlice) gridData.getGridSlice()) Grid2DFloat grid = ((ScalarGridSlice) gridData.getGridSlice())
.getScalarGrid(); .getScalarGrid();
@ -450,23 +465,29 @@ public class GridInfoDialog extends CaveJFACEDialog implements
.append(getMaxMin(grid, false)).append("\n"); .append(getMaxMin(grid, false)).append("\n");
} else if (parm.getGridInfo().getGridType() } else if (parm.getGridInfo().getGridType()
.equals(GridType.WEATHER)) { .equals(GridType.WEATHER)) {
WeatherGridSlice slice = (WeatherGridSlice) gridData
.getGridSlice();
Grid2DByte grid = slice.getWeatherGrid();
WeatherKey[] keys = slice.getKeys();
// TODO int[] counts = calcCounts(grid, keys.length);
// for i in xrange(len(dta[1])): for (int i = 0; i < keys.length; i++) {
// count = self._calcCounts(dta, i) info.append(counts[i]).append(" ----> ");
// info += `count` + " ----> " \ info.append(keys[i].toPrettyString());
// + AFPS.WeatherKey_string(dta[1][i]).keyAsPrettyString() \ info.append("\n");
// + "\n" }
} else if (parm.getGridInfo().getGridType() } else if (parm.getGridInfo().getGridType()
.equals(GridType.DISCRETE)) { .equals(GridType.DISCRETE)) {
// TODO DiscreteGridSlice slice = (DiscreteGridSlice) gridData
// elif grid.type() == AFPS.Parm.DISCRETE: .getGridSlice();
// for i in xrange(len(dta[1])): Grid2DByte grid = slice.getDiscreteGrid();
// count = self._calcCounts(dta, i) DiscreteKey[] keys = slice.getKey();
// info += `count` + " ----> " \ int[] counts = calcCounts(grid, keys.length);
// + dta[1][i] \ for (int i = 0; i < keys.length; i++) {
// + "\n" else: 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")); info.append(getBoxTitle(gridData, true, "Grid Information"));
if (gridData == null) { if (gridData == null) {
info.append("No Grid"); info.append("\nNo Grid");
} else { } else {
info.append("Grid okay to edit: ") info.append("\nGrid okay to edit: ")
.append((gridData.isOkToEdit() ? "Yes" : "No")) .append((gridData.isOkToEdit() ? "Yes" : "No"))
.append("\n"); .append("\n");
@ -513,7 +534,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
StringBuilder info = new StringBuilder(); StringBuilder info = new StringBuilder();
info.append(getBoxTitle(null, false, "Weather Element Information")); info.append(getBoxTitle(null, false, "Weather Element Information"));
info.append("Weather Element Name: ") info.append("\nWeather Element Name: ")
.append(parm.getParmID().getParmName()).append("\n"); .append(parm.getParmID().getParmName()).append("\n");
info.append("Weather Element Level: ") info.append("Weather Element Level: ")
@ -587,7 +608,8 @@ public class GridInfoDialog extends CaveJFACEDialog implements
} else { } else {
for (GridDataHistory h : gridData.getHistory()) { 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: ") info.append("Original Source: ")
.append(uiFormat.uiParmIDcollapsed(h.getOriginParm())) .append(uiFormat.uiParmIDcollapsed(h.getOriginParm()))
.append("\n"); .append("\n");
@ -678,7 +700,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements
info.append("\n"); info.append("\n");
} }
info.append("\n").append(title).append(":\n\n"); info.append("\n").append(title).append(":\n");
return info.toString(); return info.toString();
} }

View file

@ -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.db.objects.GridLocation;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException; import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
import com.raytheon.uf.common.localization.FileUpdatedMessage; 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.ILocalizationFileObserver;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; 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 * Oct 17, 2013 2481 randerso Fixed regression which cause configured level combinations
* files to not be found. Removed message when combinations file * files to not be found. Removed message when combinations file
* not found to match A1. * not found to match A1.
* Dec 03, 2013 #2591 dgilling Ensure all change states to the combo
* file are handled.
* *
* </pre> * </pre>
* *
@ -985,8 +986,7 @@ public class ZoneCombinerComp extends Composite implements
*/ */
@Override @Override
public void fileUpdated(FileUpdatedMessage message) { public void fileUpdated(FileUpdatedMessage message) {
if ((message.getChangeType().equals(FileChangeType.UPDATED)) if (message.getFileName().equalsIgnoreCase(currentComboFile)) {
&& message.getFileName().equalsIgnoreCase(currentComboFile)) {
File file = new File(message.getFileName()); File file = new File(message.getFileName());
String comboName = file.getName().replace(".py", ""); String comboName = file.getName().replace(".py", "");
statusHandler statusHandler

View file

@ -26,6 +26,7 @@ import java.util.regex.Matcher;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.texteditor.util.VtecObject; import com.raytheon.viz.texteditor.util.VtecObject;
import com.raytheon.viz.texteditor.util.VtecUtil; import com.raytheon.viz.texteditor.util.VtecUtil;
@ -49,6 +50,9 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* Aug 07, 2013 #1842 dgilling Fix ETN assignment for products with * Aug 07, 2013 #1842 dgilling Fix ETN assignment for products with
* multiple NEW segments with the same * multiple NEW segments with the same
* phensig. * phensig.
* Nov 22, 2013 #2578 dgilling Fix ETN assignment for products with
* multiple NEW VTEC lines for the same
* phensig but disjoint TimeRanges.
* *
* </pre> * </pre>
* *
@ -92,7 +96,12 @@ public class GFEVtecUtil {
// HazardsTable.py implemented a "cache" that would ensure all NEWs for // HazardsTable.py implemented a "cache" that would ensure all NEWs for
// the same phensig would be assigned the same ETN. This Map replicates // the same phensig would be assigned the same ETN. This Map replicates
// that legacy behavior. // that legacy behavior.
Map<String, Integer> etnCache = new HashMap<String, Integer>(); //
// 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>>();
Matcher vtecMatcher = VtecUtil.VTEC_REGEX.matcher(message); Matcher vtecMatcher = VtecUtil.VTEC_REGEX.matcher(message);
StringBuffer finalOutput = new StringBuffer(); StringBuffer finalOutput = new StringBuffer();
@ -105,13 +114,38 @@ public class GFEVtecUtil {
&& ((!NATIONAL_PHENSIGS.contains(vtec.getPhensig())) || (IGNORE_NATIONAL_ETN && ((!NATIONAL_PHENSIGS.contains(vtec.getPhensig())) || (IGNORE_NATIONAL_ETN
.contains(vtec.getOffice()) && TROPICAL_PHENSIGS .contains(vtec.getOffice()) && TROPICAL_PHENSIGS
.contains(vtec.getPhensig())))) { .contains(vtec.getPhensig())))) {
String cacheKey = vtec.getPhensig(); // Some more clarification on the ETN assignment behavior: all
Integer newEtn = etnCache.get(cacheKey); // 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 phensig = vtec.getPhensig();
TimeRange validPeriod = new TimeRange(vtec.getStartTime()
.getTime(), vtec.getEndTime().getTime());
Map<TimeRange, Integer> etnsByTR = etnCache.get(phensig);
if (etnsByTR != null) {
for (TimeRange tr : etnsByTR.keySet()) {
if ((validPeriod.isAdjacentTo(tr))
|| (validPeriod.overlaps(tr))) {
newEtn = etnsByTR.get(tr);
break;
}
}
}
if (newEtn == null) { if (newEtn == null) {
newEtn = VtecUtil.getNextEtn(vtec.getOffice(), newEtn = VtecUtil.getNextEtn(vtec.getOffice(),
vtec.getPhensig(), true); vtec.getPhensig(), true);
etnCache.put(cacheKey, newEtn);
} }
Map<TimeRange, Integer> cacheLevel2 = (etnsByTR != null) ? etnsByTR
: new HashMap<TimeRange, Integer>();
cacheLevel2.put(validPeriod, newEtn);
etnCache.put(phensig, cacheLevel2);
vtec.setSequence(newEtn); vtec.setSequence(newEtn);
} }
vtecMatcher vtecMatcher

View file

@ -34,14 +34,14 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
import com.raytheon.uf.edex.pointdata.PointDataPluginDao; import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
/** /**
* This class contains several utility methods that construct a ProfilerObs * Convert bufr packets into level data for bufrua mandatory levels.
* instance from the BUFR decoded data.
* *
* <pre> * <pre>
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* 20080303 969 jkorman Initial implementation. * Mar 03, 2008 969 jkorman Initial implementation.
* Dec 05, 2013 2612 bsteffen Fix max wind decoding.
* *
* </pre> * </pre>
* *
@ -212,8 +212,8 @@ public class BUFRUAManLevelAdapter extends AbstractBUFRUAAdapter {
double pres = getDouble(p.get(0), -9999); double pres = getDouble(p.get(0), -9999);
if (pres > 0) { if (pres > 0) {
setViewData("prMaxW", view, p.get(0), maxWindIdx); setViewData("prMaxW", view, p.get(0), maxWindIdx);
setViewData("wdMaxW", view, p.get(3), maxWindIdx); setViewData("wdMaxW", view, p.get(2), maxWindIdx);
setViewData("wsMaxW", view, p.get(4), maxWindIdx); setViewData("wsMaxW", view, p.get(3), maxWindIdx);
maxWindIdx++; maxWindIdx++;
} }
if (maxWindIdx == maxMaxWinds) { if (maxWindIdx == maxMaxWinds) {

View file

@ -23,6 +23,7 @@ import static com.raytheon.uf.edex.decodertools.bufr.packets.DataPacketTypes.Rep
import java.util.List; 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.LayerTools;
import com.raytheon.uf.common.dataplugin.bufrua.UAObs; import com.raytheon.uf.common.dataplugin.bufrua.UAObs;
import com.raytheon.uf.common.pointdata.Dimension; 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; import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
/** /**
* TODO Add Description * Convert bufr packets into level data for bufrua significant levels.
* *
* <pre> * <pre>
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Jul 21, 2009 jkorman Initial creation * Jul 21, 2009 jkorman Initial creation
* Dec 05, 2013 2612 bsteffen Convert heights for sig wind layers.
* *
* </pre> * </pre>
* *
@ -190,6 +192,8 @@ public class BUFRUASigLevelAdapter extends AbstractBUFRUAAdapter {
.getValue(); .getValue();
int sig = getInt(p.get(1), IDecoderConstants.VAL_MISSING); int sig = getInt(p.get(1), IDecoderConstants.VAL_MISSING);
double height = getDouble(p.get(0), -9999); double height = getDouble(p.get(0), -9999);
height = SigWindHeightConversionManager.convertHeight(
pointData, height);
if (sig == 2) { if (sig == 2) {
if ((height > 0) && (height < 30000)) { if ((height > 0) && (height < 30000)) {
view.setFloat(LayerTools.HT_SIGW, (float) height, view.setFloat(LayerTools.HT_SIGW, (float) height,

View file

@ -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;
}
}
}

View file

@ -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());
}
}

View file

@ -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>

View file

@ -108,6 +108,7 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
* 10/02/13 #2444 randerso Fix error handling when creating IFPGridDatabases. * 10/02/13 #2444 randerso Fix error handling when creating IFPGridDatabases.
* DO NOT ATTEMPT TO MERGE THIS CHANGE INTO 14.2 as the GFE * DO NOT ATTEMPT TO MERGE THIS CHANGE INTO 14.2 as the GFE
* server code has been significantly refactored. * server code has been significantly refactored.
* 12/03/13 #2595 randerso Added check for null update time in commitGrid
* *
* </pre> * </pre>
* *
@ -594,7 +595,8 @@ public class GridParmManager {
// if update time is less than publish time, grid has not // if update time is less than publish time, grid has not
// changed since last published, therefore only update // changed since last published, therefore only update
// history, do not publish // history, do not publish
if ((gdh.getPublishTime() == null) if ((gdh.getUpdateTime() == null)
|| (gdh.getPublishTime() == null)
|| (gdh.getUpdateTime().getTime() > gdh || (gdh.getUpdateTime().getTime() > gdh
.getPublishTime().getTime()) .getPublishTime().getTime())
// in service backup, times on srcHistory could // in service backup, times on srcHistory could

View file

@ -22,7 +22,9 @@ package com.raytheon.edex.plugin.gfe.server.handler;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.Writer;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.localization.PathManagerFactory;
import com.raytheon.uf.common.serialization.comm.IRequestHandler; import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.core.EDEXUtil; 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> * <pre>
* *
@ -48,6 +53,8 @@ import com.raytheon.uf.edex.core.EDEXUtil;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* May 16, 2011 dgilling Initial creation * May 16, 2011 dgilling Initial creation
* Dec 02, 2013 #2591 dgilling Only send notification after Writer is
* flushed/closed.
* *
* </pre> * </pre>
* *
@ -79,43 +86,48 @@ public class SaveCombinationsFileHandler implements
FileUtil.join(COMBO_FILE_DIR, request.getFileName())); FileUtil.join(COMBO_FILE_DIR, request.getFileName()));
boolean isAdded = (!localFile.exists()); boolean isAdded = (!localFile.exists());
List<Object> listOfCombos = new ArrayList<Object>(); Writer outWriter = null;
FileWriter file = null;
try { try {
file = new FileWriter(localFile); outWriter = new BufferedWriter(new FileWriter(localFile));
BufferedWriter out = new BufferedWriter(file);
String zoneComments = "\n# Automatically generated combinations file\n# " String zoneComments = "\n# Automatically generated combinations file\n# "
+ request.getFileName() + "\n\nCombinations = [\n"; + request.getFileName() + "\n\nCombinations = [\n";
out.write(zoneComments); outWriter.write(zoneComments);
DecimalFormat df = new DecimalFormat("00");
NumberFormat df = new DecimalFormat("00");
for (int i = 0; i < request.getCombos().size(); i++) { for (int i = 0; i < request.getCombos().size(); i++) {
StringBuilder nextLineToWrite = new StringBuilder();
List<String> modZGL = new ArrayList<String>(request.getCombos() List<String> modZGL = new ArrayList<String>(request.getCombos()
.get(i).size()); .get(i).size());
for (String zone : request.getCombos().get(i)) { for (String zone : request.getCombos().get(i)) {
modZGL.add("'" + zone + "'"); modZGL.add("'" + zone + "'");
} }
listOfCombos.add("\t(" + modZGL + ", " + "'Region" nextLineToWrite.append("\t([");
+ df.format((i + 1)) + "' ),\n"); nextLineToWrite.append(StringUtil.join(modZGL, ','));
out.write(listOfCombos.get(i).toString()); nextLineToWrite.append("], ");
nextLineToWrite.append("'Region");
nextLineToWrite.append(df.format(i + 1));
nextLineToWrite.append("' ),\n");
outWriter.write(nextLineToWrite.toString());
} }
out.write("]"); outWriter.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()));
} finally { } finally {
if (file != null) { if (outWriter != null) {
file.close(); 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>(); return new ServerResponse<Object>();
} }

View file

@ -765,7 +765,7 @@ def storeScalarWE(we, trList, file, timeRange, databaseID,
for i in xrange(len(overlappingTimes) -1, -1, -1): for i in xrange(len(overlappingTimes) -1, -1, -1):
ot = overlappingTimes[i] ot = overlappingTimes[i]
if not ot in histDict: if not ot in histDict:
del overlappingTime[i] del overlappingTimes[i]
del timeList[i] del timeList[i]
elif we.getGpi().isRateParm(): elif we.getGpi().isRateParm():
durRatio = (float(timeList[i][1]-timeList[i][0]))/float((ot[1]-ot[0])) durRatio = (float(timeList[i][1]-timeList[i][0]))/float((ot[1]-ot[0]))

View file

@ -81,6 +81,9 @@ import com.raytheon.uf.common.time.TimeRange;
* Jun 20, 2013 2127 rjpeter Added OnDelete annotation. * Jun 20, 2013 2127 rjpeter Added OnDelete annotation.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Sep 20, 2013 2147 rferrel Changes to archive hdf5 files. * 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> * </pre>
* *
@ -263,6 +266,7 @@ public class GFERecord extends PluginDataObject implements IPersistable {
} else { } else {
GridDataHistory hist = newHistory.get(i); GridDataHistory hist = newHistory.get(i);
hist.setParent(this); hist.setParent(this);
hist.setId(0);
gridHistory.add(hist); gridHistory.add(hist);
} }
} }

View file

@ -130,6 +130,13 @@ if [ "${1}" = "-python-qpid" ]; then
exit 0 exit 0
fi fi
if [ "${1}" = "-notification" ]; then
buildRPM "awips2-notification"
exit 0
fi
if [ "${1}" = "-postgres" ]; then if [ "${1}" = "-postgres" ]; then
buildRPM "awips2-postgres" buildRPM "awips2-postgres"
buildRPM "awips2-database-server-configuration" buildRPM "awips2-database-server-configuration"
@ -146,6 +153,7 @@ if [ "${1}" = "-postgres" ]; then
fi fi
if [ "${1}" = "-delta" ]; then if [ "${1}" = "-delta" ]; then
buildRPM "awips2"
buildRPM "awips2-common-base" buildRPM "awips2-common-base"
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -161,10 +169,8 @@ if [ "${1}" = "-delta" ]; then
buildRPM "awips2-ncep-database" buildRPM "awips2-ncep-database"
buildRPM "awips2-gfesuite-client" buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server" buildRPM "awips2-gfesuite-server"
buildRPM "awips2-python"
buildRPM "awips2-python-dynamicserialize" buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-ufpy" buildRPM "awips2-python-ufpy"
buildRPM "awips2-python-qpid"
buildRPM "awips2-adapt-native" buildRPM "awips2-adapt-native"
buildRPM "awips2-aviation-shared" buildRPM "awips2-aviation-shared"
@ -260,7 +266,7 @@ if [ "${1}" = "-full" ]; then
buildRPM "awips2-httpd-pypies" buildRPM "awips2-httpd-pypies"
buildJava buildJava
buildRPM "awips2-groovy" buildRPM "awips2-groovy"
#buildRPM "awips2-ldm" buildRPM "awips2-ldm"
buildRPM "awips2-postgres" buildRPM "awips2-postgres"
buildRPM "awips2-pgadmin3" buildRPM "awips2-pgadmin3"
buildRPM "awips2-tools" buildRPM "awips2-tools"
@ -333,6 +339,12 @@ if [ "${1}" = "-ade" ]; then
exit 1 exit 1
fi fi
# Build the source jar file
ade_work_dir="/home/dmsys/Dim12/build/AWIPS2/AWIPS2-ADE-OB13.5.1-CM"
cd $ade_work_dir
./build_source_jar.sh
cp -v /tmp/awips-component/tmp/awips2-ade-baseline-SOURCES.jar ${WORKSPACE}/${ade_directory}
# Tar the directory. # Tar the directory.
pushd . > /dev/null 2>&1 pushd . > /dev/null 2>&1
cd ${WORKSPACE} cd ${WORKSPACE}

View file

@ -123,8 +123,8 @@ if [ "${1}" = "-64bit" ]; then
fi fi
if [ "${1}" = "-rh6" ]; then if [ "${1}" = "-rh6" ]; then
buildRPM "awips2-notification"
buildRPM "awips2-common-base" buildRPM "awips2-common-base"
buildRPM "awips2-notification"
buildEDEX buildEDEX
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
@ -170,7 +170,7 @@ if [ "${1}" = "-rh6" ]; then
buildRPM "awips2-ldm" buildRPM "awips2-ldm"
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 0 exit 1
fi fi
buildRPM "awips2-alertviz" buildRPM "awips2-alertviz"
buildRPM "awips2-database-server-configuration" buildRPM "awips2-database-server-configuration"
@ -214,6 +214,7 @@ if [ "${1}" = "-postgres" ]; then
fi fi
if [ "${1}" = "-delta" ]; then if [ "${1}" = "-delta" ]; then
buildRPM "awips2"
buildRPM "awips2-common-base" buildRPM "awips2-common-base"
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -224,28 +225,38 @@ if [ "${1}" = "-delta" ]; then
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
buildRPM "awips2-ncep-database"
buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server"
buildRPM "awips2-python-dynamicserialize" buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-ufpy" buildRPM "awips2-python-ufpy"
buildRPM "awips2-aviation-shared"
buildRPM "awips2-cli" buildRPM "awips2-cli"
buildRPM "awips2-database"
buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-data.hdf5-gfe.climo" buildRPM "awips2-data.hdf5-gfe.climo"
buildRPM "awips2-gfesuite-client" buildRPM "awips2-gfesuite-client"
buildRPM "awips2-gfesuite-server" buildRPM "awips2-gfesuite-server"
buildRPM "awips2-localapps-environment" buildRPM "awips2-localapps-environment"
buildRPM "awips2-maps-database"
buildRPM "awips2-notification"
buildRPM "awips2-pypies"
buildRPM "awips2-data.hdf5-topo" buildRPM "awips2-data.hdf5-topo"
buildRPM "awips2-data.gfe" buildRPM "awips2-data.gfe"
buildRPM "awips2" buildRPM "awips2-rcm"
buildLocalizationRPMs buildLocalizationRPMs
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
buildRPM "awips2-edex-environment"
buildRPM "awips2-notification"
exit 0 exit 0
fi fi
if [ "${1}" = "-full" ]; then if [ "${1}" = "-full" ]; then
# buildRPM "awips2-common-base" buildRPM "awips2-common-base"
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
@ -266,7 +277,7 @@ if [ "${1}" = "-full" ]; then
buildRPM "awips2-python-pil" buildRPM "awips2-python-pil"
buildRPM "awips2-python-pmw" buildRPM "awips2-python-pmw"
buildRPM "awips2-python-pupynere" buildRPM "awips2-python-pupynere"
# buildRPM "awips2-python-qpid" buildRPM "awips2-python-qpid"
buildRPM "awips2-python-scientific" buildRPM "awips2-python-scientific"
buildRPM "awips2-python-scipy" buildRPM "awips2-python-scipy"
buildRPM "awips2-python-tables" buildRPM "awips2-python-tables"
@ -398,12 +409,9 @@ fi
if [ "${1}" = "-viz" ]; then if [ "${1}" = "-viz" ]; then
buildRPM "awips2" buildRPM "awips2"
buildRPM "awips2-common-base" #buildRPM "awips2-common-base"
#buildRPM "awips2-python-dynamicserialize" #buildRPM "awips2-python-dynamicserialize"
#buildRPM "awips2-gfesuite-client" #buildRPM "awips2-python"
#buildRPM "awips2-gfesuite-server"
#buildRPM "awips2-python-numpy"
buildRPM "awips2-python"
#buildRPM "awips2-adapt-native" #buildRPM "awips2-adapt-native"
#unpackHttpdPypies #unpackHttpdPypies
#if [ $? -ne 0 ]; then #if [ $? -ne 0 ]; then