diff --git a/build/deploy.edex.awips2/esb/conf/security/keystoreUtil.sh b/build/deploy.edex.awips2/esb/conf/security/keystoreUtil.sh
index 8613944237..6be5bbbe94 100755
--- a/build/deploy.edex.awips2/esb/conf/security/keystoreUtil.sh
+++ b/build/deploy.edex.awips2/esb/conf/security/keystoreUtil.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# Temporary, only be used until we get DOD certs.
# rewrite from 16.1.1
SETUP_ENV=/awips2/edex/bin/setup.env
@@ -273,7 +274,6 @@ do
done
-
cn=$(hostname)
echo "Generating keystore..."
diff --git a/build/deploy.edex.awips2/esb/conf/spring/edex.xml b/build/deploy.edex.awips2/esb/conf/spring/edex.xml
index 28e52c27c7..dc3a07b537 100644
--- a/build/deploy.edex.awips2/esb/conf/spring/edex.xml
+++ b/build/deploy.edex.awips2/esb/conf/spring/edex.xml
@@ -100,6 +100,16 @@
-->
+
+
+
+
+
+
+
+
+
+
@@ -109,7 +119,7 @@
-
+
diff --git a/build/deploy.edex.awips2/esb/conf/wrapper.conf b/build/deploy.edex.awips2/esb/conf/wrapper.conf
index 7b9ff398ad..3b890a4005 100644
--- a/build/deploy.edex.awips2/esb/conf/wrapper.conf
+++ b/build/deploy.edex.awips2/esb/conf/wrapper.conf
@@ -90,6 +90,9 @@ wrapper.java.additional.4=-Dorg.apache.camel.jmx.disabled=true
# Enforces GMT to be used as the timezone
wrapper.java.additional.5=-Duser.timezone=GMT
+# Set default tmp to awips controlled directory for security
+wrapper.java.additional.6=-Djava.io.tmpdir=/awips2/tmp
+
# garbage collection settings
wrapper.java.additional.gc.1=-XX:+UseConcMarkSweepGC
wrapper.java.additional.gc.2=-XX:+CMSIncrementalMode
diff --git a/cave/build/alertviz/customTargets.xml b/cave/build/alertviz/customTargets.xml
index 2eb6406330..dac3d6af3a 100644
--- a/cave/build/alertviz/customTargets.xml
+++ b/cave/build/alertviz/customTargets.xml
@@ -186,16 +186,6 @@
-
-
-
-
-
-
-
diff --git a/cave/build/build.sh b/cave/build/build.sh
index 970b60e98e..2659f43a3a 100755
--- a/cave/build/build.sh
+++ b/cave/build/build.sh
@@ -69,6 +69,7 @@ java -jar $LAUNCHER_JAR -application org.eclipse.ant.core.antRunner \
-Dbuilder=$BUILDER \
-DbuildDirectory=${BUILDER}/tmp \
-Dbase=$BUILDER \
+-DproductFile=awips.product \
$OPTS_FOR_ANT
rc=$?
diff --git a/cave/build/build.xml b/cave/build/build.xml
index 0f7cdc8ae3..b71ae6c773 100644
--- a/cave/build/build.xml
+++ b/cave/build/build.xml
@@ -7,6 +7,8 @@
value="gtk" />
+
@@ -71,6 +73,7 @@
+
-
\ No newline at end of file
+
diff --git a/cave/build/cave/build.properties b/cave/build/cave/build.properties
index 74de95c003..2da49f18bd 100644
--- a/cave/build/cave/build.properties
+++ b/cave/build/cave/build.properties
@@ -19,7 +19,10 @@
# them on the command line (e.g., -DbaseLocation=d:/eclipse
############# PRODUCT/PACKAGING CONTROL #############
-product=${base}/../../com.raytheon.viz.product.awips/awips.product
+
+# The product file is specified in the build.xml as a default and is
+# overridable setting 'build.product' from ant.
+product=${base}/../../com.raytheon.viz.product.awips/${productFile}
#product=${base}/../../com.raytheon.viz.product.awips/developer.product
runPackager=true
diff --git a/cave/build/cave/customTargets.xml b/cave/build/cave/customTargets.xml
index 05aef2673b..a971bcac3b 100644
--- a/cave/build/cave/customTargets.xml
+++ b/cave/build/cave/customTargets.xml
@@ -196,16 +196,6 @@
-
-
-
-
-
-
-
diff --git a/cave/build/static/README.txt b/cave/build/static/README.txt
index 51b6e5476a..7198f8f1ad 100644
--- a/cave/build/static/README.txt
+++ b/cave/build/static/README.txt
@@ -10,10 +10,8 @@ The following common directories exist within the static directory:
architecture.
We also have the following os / architecture specific directories within the static
-directory. The name of the directories is based on the eclipse (3.6.1) os.arch
+directory. The name of the directories is based on the eclipse (3.8.2) os.arch
designation.
linux.x86 - these files will only be installed on a 32-bit Linux Operating System.
linux.x86_64 - these files will only be installed on a 64-bit Linux Operating System.
- win32.x86 - these files will only be installed on a 32-bit MS Windows Operating System.
win32.amd64 - these files will only be installed on a 64-bit Windows Operating System.
- macosx.x86 - these files will only be installed on a 32-bit Apple OS X Operating System.
\ No newline at end of file
diff --git a/cave/build/static/linux/alertviz/alertviz.sh b/cave/build/static/linux/alertviz/alertviz.sh
index 7f1a64ea4a..480ef84f76 100644
--- a/cave/build/static/linux/alertviz/alertviz.sh
+++ b/cave/build/static/linux/alertviz/alertviz.sh
@@ -26,6 +26,7 @@
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Oct 09, 2014 #3675 bclement added cleanExit signal trap
+# Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables.
#
user=`/usr/bin/whoami`
@@ -96,7 +97,7 @@ fi
#check for the logs directory, which may not be present at first start
hostName=`hostname -s`
-LOGDIR=$HOME/caveData/logs/consoleLogs/$hostName/
+export LOGDIR=$HOME/caveData/logs/consoleLogs/$hostName/
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
@@ -122,27 +123,17 @@ trap 'cleanExit $pid' SIGHUP SIGINT SIGQUIT SIGTERM
count=0
while [ $exitVal -ne 0 -a $count -lt 10 ]
do
- count=`expr $count + 1`
- curTime=`date +%Y%m%d_%H%M%S`
- LOGFILE=${LOGDIR}/alertviz_${curTime}_console.log
- export LOGFILE_ALERTVIZ=${LOGDIR}/alertviz_${curTime}_admin.log
-
- #first check if we can write to the directory
- if [ -w ${LOGDIR} ]; then
- touch ${LOGFILE}
- fi
-
- #check for display; if no display then exit
- if [ -z "${DISPLAY}" ]; then
- echo "Display is not available."
- exitVal=0
- else
- #finally check if we can write to the file
- if [ -w ${LOGFILE} ]; then
- ${dir}/alertviz $* > ${LOGFILE} 2>&1 &
+ count=`expr $count + 1`
+ #check for display; if no display then exit
+ if [ -z "${DISPLAY}" ]; then
+ echo "Display is not available."
+ exitVal=0
else
- ${dir}/alertviz $* &
- fi
+ if [ -w ${LOGDIR} ] ; then
+ ${dir}/alertviz $* > /dev/null 2>&1 &
+ else
+ ${dir}/alertviz $* &
+ fi
pid=$!
wait $pid
exitVal=$?
diff --git a/cave/build/static/linux/cave/cave.sh b/cave/build/static/linux/cave/cave.sh
index fd98b5f75b..32dd9e993e 100644
--- a/cave/build/static/linux/cave/cave.sh
+++ b/cave/build/static/linux/cave/cave.sh
@@ -34,6 +34,7 @@
# Oct 10, 2014 #3675 njensen Logback now does console logging to ensure correct pid
# Oct 13, 2014 #3675 bclement startup shutdown log includes both launching pid and placeholder
# Jan 28, 2015 #4018 randerso Added a productEditor log file to changes in the GFE product editor
+# Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables.
#
@@ -194,7 +195,7 @@ then
fi
BASE_LOGDIR=$HOME/caveData/logs/consoleLogs
-LOGDIR=$BASE_LOGDIR/$hostName/
+export LOGDIR=$BASE_LOGDIR/$hostName/
# make sure directory exists
if [ ! -d $LOGDIR ]; then
@@ -212,13 +213,6 @@ export LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid
# At this point fork so that log files can be set up with the process pid and
# this process can log the exit status of cave.
(
- # we include the PID of the launching process along with
- # a %PID% placeholder to be replaced with the "real" PID
- export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_logs.log"
- export LOGFILE_CONSOLE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_console.log"
- export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_perf.log"
- export LOGFILE_PRODUCT_EDITOR="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_productEditor.log"
-
# can we write to log directory
if [ -w ${LOGDIR} ]; then
touch ${LOGFILE_STARTUP_SHUTDOWN}
diff --git a/cave/build/static/win32.amd64/alertviz/alertviz.bat b/cave/build/static/win32.amd64/alertviz/alertviz.bat
deleted file mode 100644
index b6b641bab0..0000000000
--- a/cave/build/static/win32.amd64/alertviz/alertviz.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-@echo OFF
-
-REM Determine where we are located.
-SET CONTAINING_DIRECTORY=%~dp0
-
-REM Prepare the environment.
-
-REM Location of AWIPS II Java (the jre).
-SET JavaJreDirectory=C:\Program Files\Raytheon\AWIPS II\Java\jre7
-REM Location of AWIPS II Python.
-SET PythonInstallDirectory=C:\Program Files\Raytheon\AWIPS II\Python
-
-REM Add Java and Python to the path.
-SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
-SET Path=%JavaJreDirectory%\bin;%Path%
-REM Define 'PythonPath'.
-SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%;%PythonPath%
-
-REM Eliminate variables that will no longer be used.
-SET PythonInstallDirectory=
-SET JavaJreDirectory=
-
-REM Determine where we will be logging to.
-SET HOME_DIRECTORY=%USERPROFILE%
-SET CAVEDATA_LOG_DIRECTORY=%HOME_DIRECTORY%\caveData\logs
-SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
-IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
-
-echo Starting ALERTVIZ; leave this CMD window open to enable AlertViz 'restart'.
-REM Start AlertViz (and implement the alertviz restart capability).
-:AlertVizLoopStart
-SET RND=%random%
-SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
-REM Python is used to retrieve the current date and time because the order
-REM of the Windows date/time fields is not necessarily guaranteed and the
-REM Windows date/time fields can only be extracted using substring operations
-REM instead of -formatter- strings like Linux allows.
-python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
-SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
-DEL %RND_DATETIME_FILE%
-
-SET LOGFILE_CONSOLE=%CAVEDATA_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%_console.log
-SET LOGFILE_ALERTVIZ=%CAVEDATA_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%_admin.log
-
-"%CONTAINING_DIRECTORY%alertviz.exe" %* > "%CONSOLE_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%.log" 2>&1
-IF %ERRORLEVEL% == 0 (EXIT)
-echo Restarting AlertViz.
-GOTO AlertVizLoopStart
-
diff --git a/cave/build/static/win32.amd64/cave/cave.bat b/cave/build/static/win32.amd64/cave/cave.bat
deleted file mode 100644
index a343b81be7..0000000000
--- a/cave/build/static/win32.amd64/cave/cave.bat
+++ /dev/null
@@ -1,56 +0,0 @@
-@echo OFF
-
-REM Determine where we are located.
-SET CONTAINING_DIRECTORY=%~dp0
-
-REM Prepare the environment.
-
-REM Location of AWIPS II Java (the jre).
-SET JavaJreDirectory=C:\Program Files\Raytheon\AWIPS II\Java\jre7
-REM Location of AWIPS II Python.
-SET PythonInstallDirectory=C:\Program Files\Raytheon\AWIPS II\Python
-
-REM Add Java and Python to the path.
-SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
-SET Path=%JavaJreDirectory%\bin;%Path%
-REM Add the CAVE lib directory to the path.
-SET Path=%CONTAINING_DIRECTORY%lib;%Path%
-REM Define 'PythonPath'.
-SET PythonPath=%CONTAINING_DIRECTORY%lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%;%PythonPath%
-
-REM Eliminate variables that will no longer be used.
-SET PythonInstallDirectory=
-SET JavaJreDirectory=
-
-REM Determine where we will be logging to.
-SET HOME_DIRECTORY=%USERPROFILE%
-SET CAVEDATA_LOG_DIRECTORY=%HOME_DIRECTORY%\caveData\logs
-SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
-IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
-
-SET RND=%random%
-SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
-REM Python is used to retrieve the current date and time because the order
-REM of the Windows date/time fields is not necessarily guaranteed and the
-REM Windows date/time fields can only be extracted using substring operations
-REM instead of -formatter- strings like Linux allows.
-python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
-SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
-DEL %RND_DATETIME_FILE%
-
-SET LOGFILE_CAVE=%CAVEDATA_LOG_DIRECTORY%\cave_%LOG_DATETIME%_logs.log
-SET LOGFILE_CONSOLE=%CAVEDATA_LOG_DIRECTORY%\cave_%LOG_DATETIME%_console.log
-SET LOGFILE_PERFORMANCE=%CAVEDATA_LOG_DIRECTORY%\cave_%LOG_DATETIME%_perf.log
-SET LOGFILE_PRODUCT_EDITOR=%CAVEDATA_LOG_DIRECTORY%\cave_%LOG_DATETIME%_productEditor.log
-
-echo THIS CMD WINDOW CAN BE CLOSED AT ANY TIME!
-cd %HOMEPATH%
-REM Start CAVE.
-"%CONTAINING_DIRECTORY%cave.exe" %* > "%CONSOLE_LOG_DIRECTORY%\cave_%LOG_DATETIME%.log" 2>&1
-IF ERRORLEVEL 1 (echo CAVE ERROR - check the logs for additional information. && PAUSE)
-
-EXIT
diff --git a/cave/build/static/win32.x86/alertviz/alertviz.bat b/cave/build/static/win32.x86/alertviz/alertviz.bat
deleted file mode 100644
index 5e4b50ee83..0000000000
--- a/cave/build/static/win32.x86/alertviz/alertviz.bat
+++ /dev/null
@@ -1,69 +0,0 @@
-@echo OFF
-
-REM Determine if we are running on a 32-bit or 64-bit OS.
-IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
- SET REG_EXE=C:\Windows\System32\reg.exe
-) ELSE (
- SET REG_EXE=C:\Windows\SysWOW64\reg.exe
-)
-
-REM Determine where we are located.
-SET CONTAINING_DIRECTORY=%~dp0
-
-REM Prepare the environment.
-
-REM Registry Query Variables.
-SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
-SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
-REM Determine where AWIPS II Java (the jre) is located.
-%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
-IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
-FOR /F "tokens=2* delims= " %%A IN (
-'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
-SET JavaJreDirectory=%%B)
-REM Determine where AWIPS II Python is located.
-%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
-IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
-FOR /F "tokens=2* delims= " %%A IN (
-'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
-SET PythonInstallDirectory=%%B)
-
-REM Add Java and Python to the path.
-SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
-SET Path=%JavaJreDirectory%\bin;%Path%
-REM Define 'PythonPath'.
-SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%;%PythonPath%
-
-REM Eliminate variables that will no longer be used.
-SET PythonInstallDirectory=
-SET JavaJreDirectory=
-SET REG_EXE=
-SET A2_JAVA_REG=
-SET A2_PYTHON_REG=
-
-REM Determine where we will be logging to.
-SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
-SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
-SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
-IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
-
-echo Starting ALERTVIZ; leave this CMD window open to enable AlertViz 'restart'.
-REM Start AlertViz (and implement the alertviz restart capability).
-:AlertVizLoopStart
-SET RND=%random%
-SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
-REM Python is used to retrieve the current date and time because the order
-REM of the Windows date/time fields is not necessarily guaranteed and the
-REM Windows date/time fields can only be extracted using substring operations
-REM instead of -formatter- strings like Linux allows.
-python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
-SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
-DEL %RND_DATETIME_FILE%
-"%CONTAINING_DIRECTORY%alertviz.exe" %* > "%CONSOLE_LOG_DIRECTORY%\alertviz_%LOG_DATETIME%.log" 2>&1
-IF %ERRORLEVEL% == 0 (EXIT)
-echo Restarting AlertViz.
-GOTO AlertVizLoopStart
-
diff --git a/cave/build/static/win32.x86/cave/cave.bat b/cave/build/static/win32.x86/cave/cave.bat
deleted file mode 100644
index 0b347287dd..0000000000
--- a/cave/build/static/win32.x86/cave/cave.bat
+++ /dev/null
@@ -1,72 +0,0 @@
-@echo OFF
-
-REM Determine if we are running on a 32-bit or 64-bit OS.
-IF NOT EXIST C:\Windows\SysWOW64\reg.exe (
- SET REG_EXE=C:\Windows\System32\reg.exe
-) ELSE (
- SET REG_EXE=C:\Windows\SysWOW64\reg.exe
-)
-
-REM Determine where we are located.
-SET CONTAINING_DIRECTORY=%~dp0
-
-REM Prepare the environment.
-
-REM Registry Query Variables.
-SET A2_JAVA_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Java"
-SET A2_PYTHON_REG="HKLM\Software\Raytheon\Runtime Environment\AWIPS II Python"
-REM Determine where AWIPS II Java (the jre) is located.
-%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory > NUL 2>&1
-IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Java. && PAUSE && EXIT)
-FOR /F "tokens=2* delims= " %%A IN (
-'%REG_EXE% QUERY %A2_JAVA_REG% /v JavaJreDirectory') DO (
-SET JavaJreDirectory=%%B)
-REM Determine where AWIPS II Python is located.
-%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory > NUL 2>&1
-IF ERRORLEVEL 1 (echo ENVIRONMENT ERROR - Unable to find AWIPS II Python. && PAUSE && EXIT)
-FOR /F "tokens=2* delims= " %%A IN (
-'%REG_EXE% QUERY %A2_PYTHON_REG% /v PythonInstallDirectory') DO (
-SET PythonInstallDirectory=%%B)
-
-REM Add Java and Python to the path.
-SET Path=%PythonInstallDirectory%;%PythonInstallDirectory%\DLLs;%Path%
-SET Path=%JavaJreDirectory%\bin;%Path%
-REM Add the CAVE lib directory to the path.
-SET Path=%CONTAINING_DIRECTORY%lib;%Path%
-REM Define 'PythonPath'.
-SET PythonPath=%CONTAINING_DIRECTORY%lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib\lib-tk;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\DLLs;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%\Lib;%PythonPath%
-SET PythonPath=%PythonInstallDirectory%;%PythonPath%
-
-REM Eliminate variables that will no longer be used.
-SET PythonInstallDirectory=
-SET JavaJreDirectory=
-SET REG_EXE=
-SET A2_JAVA_REG=
-SET A2_PYTHON_REG=
-
-REM Determine where we will be logging to.
-SET HOME_DIRECTORY=%HOMEDRIVE%%HOMEPATH%
-SET CAVEDATA_LOG_DIRECTORY=%HOMEDRIVE%%HOMEPATH%\caveData\logs
-SET CONSOLE_LOG_DIRECTORY=%CAVEDATA_LOG_DIRECTORY%\consoleLogs\%COMPUTERNAME%
-IF NOT EXIST "%CONSOLE_LOG_DIRECTORY%" (MKDIR "%CONSOLE_LOG_DIRECTORY%")
-
-SET RND=%random%
-SET RND_DATETIME_FILE=%TMP%\awips2dt_%RND%.tmp
-REM Python is used to retrieve the current date and time because the order
-REM of the Windows date/time fields is not necessarily guaranteed and the
-REM Windows date/time fields can only be extracted using substring operations
-REM instead of -formatter- strings like Linux allows.
-python -c "from datetime import datetime; print datetime.now().strftime('%%Y%%m%%d_%%H%%M%%S');" > %RND_DATETIME_FILE%
-SET /p LOG_DATETIME= < %RND_DATETIME_FILE%
-DEL %RND_DATETIME_FILE%
-
-echo THIS CMD WINDOW CAN BE CLOSED AT ANY TIME!
-cd %HOMEPATH%
-REM Start CAVE.
-"%CONTAINING_DIRECTORY%cave.exe" %* > "%CONSOLE_LOG_DIRECTORY%\cave_%LOG_DATETIME%.log" 2>&1
-IF ERRORLEVEL 1 (echo CAVE ERROR - check the logs for additional information. && PAUSE)
-
-EXIT
diff --git a/cave/build/static/win32.x86/cave/lib/gridslice.pyd b/cave/build/static/win32.x86/cave/lib/gridslice.pyd
deleted file mode 100644
index e4e744bb67..0000000000
Binary files a/cave/build/static/win32.x86/cave/lib/gridslice.pyd and /dev/null differ
diff --git a/cave/build/static/win32.x86/cave/lib/libgcc_s_dw2-1.dll b/cave/build/static/win32.x86/cave/lib/libgcc_s_dw2-1.dll
deleted file mode 100644
index 8e343cd382..0000000000
Binary files a/cave/build/static/win32.x86/cave/lib/libgcc_s_dw2-1.dll and /dev/null differ
diff --git a/cave/build/static/win32.x86/cave/lib/libgfortran-3.dll b/cave/build/static/win32.x86/cave/lib/libgfortran-3.dll
deleted file mode 100644
index 98181eb311..0000000000
Binary files a/cave/build/static/win32.x86/cave/lib/libgfortran-3.dll and /dev/null differ
diff --git a/cave/build/static/win32.x86/cave/lib/libquadmath-0.dll b/cave/build/static/win32.x86/cave/lib/libquadmath-0.dll
deleted file mode 100644
index 08de7b74a4..0000000000
Binary files a/cave/build/static/win32.x86/cave/lib/libquadmath-0.dll and /dev/null differ
diff --git a/cave/build/static/win32.x86/cave/lib/zlib1.dll b/cave/build/static/win32.x86/cave/lib/zlib1.dll
deleted file mode 100644
index 076f50336d..0000000000
Binary files a/cave/build/static/win32.x86/cave/lib/zlib1.dll and /dev/null differ
diff --git a/cave/com.raytheon.uf.viz.alertview.feature/.project b/cave/com.raytheon.uf.viz.alertview.feature/.project
new file mode 100644
index 0000000000..2269f0de66
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.feature/.project
@@ -0,0 +1,17 @@
+
+
+ com.raytheon.uf.viz.alertview.feature
+
+
+
+
+
+ org.eclipse.pde.FeatureBuilder
+
+
+
+
+
+ org.eclipse.pde.FeatureNature
+
+
diff --git a/cave/com.raytheon.uf.viz.alertview.feature/build.properties b/cave/com.raytheon.uf.viz.alertview.feature/build.properties
new file mode 100644
index 0000000000..64f93a9f0b
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/cave/com.raytheon.uf.viz.alertview.feature/feature.xml b/cave/com.raytheon.uf.viz.alertview.feature/feature.xml
new file mode 100644
index 0000000000..f2cfce4996
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.feature/feature.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ [Enter Feature Description here.]
+
+
+
+ [Enter Copyright Description here.]
+
+
+
+ [Enter License Description here.]
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/.classpath b/cave/com.raytheon.uf.viz.alertview.localization/.classpath
new file mode 100644
index 0000000000..098194ca4b
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/.project b/cave/com.raytheon.uf.viz.alertview.localization/.project
new file mode 100644
index 0000000000..b1e1ee01af
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/.project
@@ -0,0 +1,33 @@
+
+
+ com.raytheon.uf.viz.alertview.localization
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+ org.eclipse.pde.ds.core.builder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.alertview.localization/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..f635d38227
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: AlertView Localization
+Bundle-SymbolicName: com.raytheon.uf.viz.alertview.localization
+Bundle-Version: 1.15.0.qualifier
+Bundle-Vendor: RAYTHEON
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.14.1",
+ com.raytheon.uf.viz.alertview;bundle-version="1.15.0"
+Service-Component: OSGI-INF/*.xml
+
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/OSGI-INF/alertPrefs.xml b/cave/com.raytheon.uf.viz.alertview.localization/OSGI-INF/alertPrefs.xml
new file mode 100644
index 0000000000..7bd654f059
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/OSGI-INF/alertPrefs.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/build.properties b/cave/com.raytheon.uf.viz.alertview.localization/build.properties
new file mode 100644
index 0000000000..c58ea2178c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/cave/com.raytheon.uf.viz.alertview.localization/src/com/raytheon/uf/viz/alertview/localization/AlertViewLocalizationPrefStore.java b/cave/com.raytheon.uf.viz.alertview.localization/src/com/raytheon/uf/viz/alertview/localization/AlertViewLocalizationPrefStore.java
new file mode 100644
index 0000000000..243db1d14c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.localization/src/com/raytheon/uf/viz/alertview/localization/AlertViewLocalizationPrefStore.java
@@ -0,0 +1,170 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.localization;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import com.raytheon.uf.common.localization.FileUpdatedMessage;
+import com.raytheon.uf.common.localization.ILocalizationFileObserver;
+import com.raytheon.uf.common.localization.IPathManager;
+import com.raytheon.uf.common.localization.LocalizationContext;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
+import com.raytheon.uf.common.localization.LocalizationFile;
+import com.raytheon.uf.common.localization.LocalizationFileOutputStream;
+import com.raytheon.uf.common.localization.exception.LocalizationException;
+import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
+import com.raytheon.uf.viz.alertview.AlertViewPrefStore;
+
+/**
+ *
+ * An {@link AlertViewPrefStore} that stores preferences in
+ * {@link LocalizationFile}s.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class AppenderBundleListener implements SynchronousBundleListener {
+
+ private final Bundle bundle;
+
+ private final AlertViewAppender appender;
+
+ public AppenderBundleListener(Bundle bundle, AlertViewAppender appender) {
+ this.bundle = bundle;
+ this.appender = appender;
+ }
+
+ @Override
+ public void bundleChanged(BundleEvent event) {
+ if (event.getType() == BundleEvent.STOPPING
+ && event.getBundle() == bundle) {
+ appender.stop();
+ }
+ }
+}
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.alertview.logback/src/com/raytheon/uf/viz/alertview/logback/LoggingEventAlert.java b/cave/com.raytheon.uf.viz.alertview.logback/src/com/raytheon/uf/viz/alertview/logback/LoggingEventAlert.java
new file mode 100644
index 0000000000..65343d3979
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview.logback/src/com/raytheon/uf/viz/alertview/logback/LoggingEventAlert.java
@@ -0,0 +1,92 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.logback;
+
+import java.util.Date;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Layout;
+
+import com.raytheon.uf.viz.alertview.Alert;
+
+/**
+ *
+ * Wraps an {@link ILoggingEvent} in the {@link Alert} interface so it can be
+ * added to the AlertView.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public interface Alert {
+
+ public enum Priority {
+ DEBUG, INFO, WARN, ERROR;
+ }
+
+ /**
+ * @return The time the event occured that generated this alert.
+ */
+ public Date getTime();
+
+ /**
+ * @return The importance of the alert.
+ */
+ public Priority getPriority();
+
+ /**
+ * @return An arbitrary string describing the origin of the Alert. This
+ * should be a short word or phrase that can be used by the user to
+ * take special action based on origins that are more or less
+ * important for a specific user.
+ */
+ public String getOrigin();
+
+ /**
+ * @return A short summary of the alert.
+ */
+ public String getMessage();
+
+ /**
+ * @return A detailed description of the alert.
+ */
+ public String getDetails();
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertDestination.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertDestination.java
new file mode 100644
index 0000000000..4ff459e9d8
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertDestination.java
@@ -0,0 +1,47 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview;
+
+/**
+ *
+ * An OSGi service interface for any service component that needs to know about
+ * {@link Alert}s. Any component which wants to contribute new alerts should
+ * broadcast the Alert to all registered {@link AlertDestination}s. Any
+ * componenet that needs to know about new Alerts should implement this
+ * interface and register as a service.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public interface AlertDestination {
+
+ public void handleAlert(Alert alert);
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertStore.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertStore.java
new file mode 100644
index 0000000000..e5faa6322c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertStore.java
@@ -0,0 +1,50 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview;
+
+import java.util.List;
+
+/**
+ *
+ * An OSGi service interface that provides a way for the AlertView to load
+ * {@link Alert}s that arrive while it is not open. At a minimum a store should
+ * be accumulating new messages as they arrive. A store may want to provide
+ * persistant storage so that old alerts can be viewed from a new cave.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public interface AlertStore {
+
+ /**
+ * @return All stored alerts.
+ */
+ public List getAlerts();
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertViewActivator.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertViewActivator.java
new file mode 100644
index 0000000000..f9cda9d7cc
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/AlertViewActivator.java
@@ -0,0 +1,136 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview;
+
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+
+import com.raytheon.uf.viz.alertview.ui.prefs.AlertViewPreferencePage;
+import com.raytheon.uf.viz.alertview.ui.prefs.PopupPreferencePage;
+import com.raytheon.uf.viz.alertview.ui.prefs.StylePreferencePage;
+
+/**
+ *
+ * {@link BundleActivator} that is used to only show the preference pages if
+ * AlertView is being used.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public interface AlertFilter {
+
+ public boolean filter(Alert alert);
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/ConstantFilter.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/ConstantFilter.java
new file mode 100644
index 0000000000..20909e9b0c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/ConstantFilter.java
@@ -0,0 +1,55 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.filter;
+
+import com.raytheon.uf.viz.alertview.Alert;
+
+/**
+ * An {@link AlertFilter} that always returns true, or always returns false,
+ * ignoring the {@link Alert} that is passed in. This is used to implement a
+ * filter that either always accepts or always rejects Alerts.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class ConstantFilter implements AlertFilter {
+
+ public final boolean result;
+
+ public ConstantFilter(boolean result) {
+ this.result = result;
+ }
+
+ @Override
+ public boolean filter(Alert alert) {
+ return result;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/FilterManager.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/FilterManager.java
new file mode 100644
index 0000000000..b1a154ab36
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/FilterManager.java
@@ -0,0 +1,99 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.filter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.raytheon.uf.viz.alertview.Alert.Priority;
+
+/**
+ *
+ * Provides a lookup mechanism for getting {@link AlertFilter}s using an id.
+ * This is especially useful when a filter is stored in a preference file
+ * because the id provides a convenient representation to store it and the
+ * manager provides a reliable way to lookup filters.
+ *
+ * TODO the current implementation just uses a small set of hard-coded filters.
+ * This should be implemented so that new filters can be added by other plugins
+ * and possibly even allow user defined filters to do things like regex the
+ * message.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class FilterManager {
+
+ /** Name for a filter that accepts all alerts. */
+ public static final String ALL = "all";
+
+ /** Name for a filter that accepts no alerts. */
+ public static final String NONE = "none";
+
+ /** Name for a filter that accepts alerts with priority >= WARN. */
+ public static final String WARN_PLUS = "warnPlus";
+
+ /** Name for a filter that accepts alerts with priority >= INFO. */
+ public static final String INFO_PLUS = "infoPlus";
+
+ private static Logger logger = LoggerFactory.getLogger(FilterManager.class);
+
+ private static final AlertFilter NONE_FILTER = new ConstantFilter(false);
+
+ private final Map filters = new HashMap<>();
+
+ public FilterManager() {
+ loadDefaultFilters();
+ }
+
+ private void loadDefaultFilters() {
+ filters.put(ALL, new ConstantFilter(true));
+ filters.put(NONE, new ConstantFilter(false));
+ for (Priority p : Priority.values()) {
+ filters.put(p.name().toLowerCase(), new PriorityFilter(p));
+ }
+ filters.put(WARN_PLUS, new MinPriorityFilter(Priority.WARN));
+ filters.put(INFO_PLUS, new MinPriorityFilter(Priority.INFO));
+ }
+
+ public AlertFilter getFilter(String id) {
+ AlertFilter filter = filters.get(id);
+ if (filter == null) {
+ logger.warn("AlertView FilterManager failed to find a filter with an id of "
+ + id);
+ filter = NONE_FILTER;
+ }
+ return filter;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/MinPriorityFilter.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/MinPriorityFilter.java
new file mode 100644
index 0000000000..b9c6a52f16
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/MinPriorityFilter.java
@@ -0,0 +1,55 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.filter;
+
+import com.raytheon.uf.viz.alertview.Alert;
+import com.raytheon.uf.viz.alertview.Alert.Priority;
+
+/**
+ * An {@link AlertFilter} that returns true for {@link Alert}s that have a
+ * priority equal to or above a specified level.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class MinPriorityFilter implements AlertFilter {
+
+ private final Priority priority;
+
+ public MinPriorityFilter(Priority priority) {
+ this.priority = priority;
+ }
+
+ @Override
+ public boolean filter(Alert alert) {
+ return alert.getPriority().ordinal() >= priority.ordinal();
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/PriorityFilter.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/PriorityFilter.java
new file mode 100644
index 0000000000..7c1649ba78
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/filter/PriorityFilter.java
@@ -0,0 +1,55 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.filter;
+
+import com.raytheon.uf.viz.alertview.Alert;
+import com.raytheon.uf.viz.alertview.Alert.Priority;
+
+/**
+ * An {@link AlertFilter} that returns true for {@link Alert}s that have a
+ * priority equal to a specified level.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class PriorityFilter implements AlertFilter {
+
+ private final Priority priority;
+
+ public PriorityFilter(Priority priority) {
+ this.priority = priority;
+ }
+
+ @Override
+ public boolean filter(Alert alert) {
+ return alert.getPriority() == priority;
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/AlertViewPreferences.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/AlertViewPreferences.java
new file mode 100644
index 0000000000..a1feec57cf
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/AlertViewPreferences.java
@@ -0,0 +1,269 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.prefs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.viz.alertview.Alert.Priority;
+import com.raytheon.uf.viz.alertview.filter.FilterManager;
+import com.raytheon.uf.viz.alertview.ui.view.AlertTable;
+import com.raytheon.uf.viz.alertview.ui.view.AlertView;
+
+/**
+ * Contains the preferences that control how {@link AlertView} appears to the
+ * user.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+@XmlRootElement
+public class PopUpPreferences {
+
+ public static enum PopUpCorner {
+ UPPER_LEFT, UPPER_RIGHT, LOWER_LEFT, LOWER_RIGHT;
+
+ public String getPrettyName() {
+ String name = name();
+ String[] words = name.split("_");
+ StringBuilder pretty = new StringBuilder(name.length());
+ for (String word : words) {
+ if (pretty.length() > 0) {
+ pretty.append(' ');
+ }
+ pretty.append(word.charAt(0));
+ pretty.append(word.substring(1).toLowerCase());
+ }
+ return pretty.toString();
+ }
+
+ public static PopUpCorner fromPrettyName(String corner) {
+ return valueOf(corner.replace(' ', '_').toUpperCase());
+ }
+ }
+
+ private String filter;
+
+ /* Time in ms. */
+ private int duration;
+
+ private PopUpCorner corner;
+
+ private int width;
+
+ private int height;
+
+ public PopUpPreferences() {
+ /* Everything needs reasonable defaults to keep PreferenceFile happy. */
+ filter = Priority.ERROR.name().toLowerCase();
+ duration = 3000;
+ corner = PopUpCorner.LOWER_RIGHT;
+ width = 500;
+ height = 50;
+ }
+
+ public PopUpPreferences(PopUpPreferences other) {
+ this.filter = other.getFilter();
+ this.duration = other.getDuration();
+ this.corner = other.getCorner();
+ this.width = other.getWidth();
+ this.height = other.getHeight();
+ }
+
+ public String getFilter() {
+ return filter;
+ }
+
+ public void setFilter(String filter) {
+ this.filter = filter;
+ }
+
+ public int getDuration() {
+ return duration;
+ }
+
+ public void setDuration(int duration) {
+ this.duration = duration;
+ }
+
+ public PopUpCorner getCorner() {
+ return corner;
+ }
+
+ public void setCorner(PopUpCorner corner) {
+ this.corner = corner;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((corner == null) ? 0 : corner.hashCode());
+ result = prime * result + duration;
+ result = prime * result + ((filter == null) ? 0 : filter.hashCode());
+ result = prime * result + height;
+ result = prime * result + width;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PopUpPreferences other = (PopUpPreferences) obj;
+ if (corner != other.corner)
+ return false;
+ if (duration != other.duration)
+ return false;
+ if (filter == null) {
+ if (other.filter != null)
+ return false;
+ } else if (!filter.equals(other.filter))
+ return false;
+ if (height != other.height)
+ return false;
+ if (width != other.width)
+ return false;
+ return true;
+ }
+
+ public static PreferenceFile load(
+ PreferenceFile.Listener super PopUpPreferences> listener) {
+ return new PreferenceFile<>("alert_popup.xml", PopUpPreferences.class,
+ listener);
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/PreferenceFile.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/PreferenceFile.java
new file mode 100644
index 0000000000..ef1d7d0743
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/PreferenceFile.java
@@ -0,0 +1,239 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.prefs;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.xml.bind.DataBindingException;
+import javax.xml.bind.JAXB;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.raytheon.uf.viz.alertview.AlertViewPrefStore;
+import com.raytheon.uf.viz.alertview.AlertViewPrefStore.AlertViewPrefListener;
+
+/**
+ *
+ * Handles the serialization and service management of a preference file. This
+ * class is designed to be a more friendly way to consume an
+ * {@link AlertViewPrefStore} service. To load preferences using this class the
+ * Preference class P should be JAXB serializable and must provide a no-arg
+ * constructor that initializaes the preferences to a usable state. In cases
+ * when loading the preferences from files fails the no-arg constructor will be
+ * used to return a default preference object.
+ *
+ * This class listens to changes from the {@link AlertViewPrefStore} service and
+ * notifies its own listeners of changes to the specified file. It also listens
+ * to changes to the available AlertViewPrefStore services and when a better
+ * service becomes available it will reload the preferences from the new service
+ * and notify listeners. This is especially useful during startup if the
+ * prefered AlertViewPrefStore starts after other components.
+ *
+ *
{
+
+ private static final String FILTER = "(" + Constants.OBJECTCLASS + "="
+ + AlertViewPrefStore.class.getName() + ")";
+
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ private final BundleContext context;
+
+ private final String fileName;
+
+ private final Class
type;
+
+ private final Listener super P> listener;
+
+ private final AlertViewPrefListener prefStoreListener = new AlertViewPrefListener() {
+
+ @Override
+ public void prefFileChanged(String fileName) {
+ if (fileName.equals(PreferenceFile.this.fileName)) {
+ updatePreferences(loadFromStore());
+ }
+ }
+ };
+
+ private final ServiceListener serviceListener = new ServiceListener() {
+
+ @Override
+ public void serviceChanged(ServiceEvent event) {
+ @SuppressWarnings("unchecked")
+ ServiceReference ref = (ServiceReference) event
+ .getServiceReference();
+ if (event.getType() == ServiceEvent.REGISTERED) {
+ add(ref);
+ } else if (event.getType() == ServiceEvent.UNREGISTERING) {
+ remove(ref);
+ }
+ }
+ };
+
+ private ServiceReference serviceReference;
+
+ private AlertViewPrefStore prefStore;
+
+ private P preferences;
+
+ public PreferenceFile(String fileName, Class
type,
+ Listener super P> listener) {
+ this.fileName = fileName;
+ this.type = type;
+ this.listener = listener;
+ context = FrameworkUtil.getBundle(getClass()).getBundleContext();
+ try {
+ context.addServiceListener(serviceListener, FILTER);
+ } catch (InvalidSyntaxException e) {
+ /*
+ * The FILTER is statically defined and very simple syntax so it is
+ * unlikely that this will ever happen.
+ */
+ throw new RuntimeException(e);
+ }
+ this.preferences = updateServiceReference(context
+ .getServiceReference(AlertViewPrefStore.class));
+ }
+
+ public void close(){
+ if(serviceReference != null){
+ prefStore.removeListener(prefStoreListener);
+ context.ungetService(serviceReference);
+ }
+ context.removeServiceListener(serviceListener);
+ }
+
+ protected P updateServiceReference(
+ ServiceReference serviceReference) {
+ this.serviceReference = serviceReference;
+ if (serviceReference != null) {
+ return updatePrefStore(context.getService(serviceReference));
+ } else {
+ return updatePrefStore(null);
+ }
+ }
+
+ protected P updatePrefStore(AlertViewPrefStore prefStore) {
+ this.prefStore = prefStore;
+ if (prefStore != null) {
+ prefStore.addListener(prefStoreListener);
+ }
+ return loadFromStore();
+ }
+
+ protected P loadFromStore() {
+ P preferences = null;
+ if (prefStore != null) {
+ try (InputStream in = prefStore.readConfigFile(fileName)) {
+ if (in != null) {
+ preferences = JAXB.unmarshal(in, type);
+ }
+ } catch (IOException | DataBindingException e) {
+ logger.error("Unable to load {} from {}", type.getSimpleName(),
+ fileName, e);
+ }
+ }
+ if (preferences == null) {
+ try {
+ preferences = type.newInstance();
+ } catch (InstantiationException | IllegalAccessException e) {
+ /*
+ * Docs indicate you should have a public no arg constructor, if
+ * there isn't one then you get RuntimeExceptions.
+ */
+ throw new RuntimeException(e);
+ }
+ }
+ return preferences;
+ }
+
+ protected void updatePreferences(P preferences) {
+ if (!this.preferences.equals(preferences)) {
+ this.preferences = preferences;
+ listener.update(preferences);
+ }
+ }
+
+
+ protected void add(ServiceReference ref) {
+ if (serviceReference == null || ref.compareTo(serviceReference) > 0) {
+ if (serviceReference != null) {
+ prefStore.removeListener(prefStoreListener);
+ context.ungetService(serviceReference);
+ }
+ updatePreferences(updateServiceReference(ref));
+ }
+ }
+
+ protected void remove(ServiceReference ref) {
+ if (ref.equals(serviceReference)) {
+ prefStore.removeListener(prefStoreListener);
+ context.ungetService(serviceReference);
+ updatePreferences(updateServiceReference(context
+ .getServiceReference(AlertViewPrefStore.class)));
+ }
+ }
+
+ public P get() {
+ return preferences;
+ }
+
+ public void write(P preferences) {
+ if (prefStore != null) {
+ try (OutputStream out = prefStore.writeConfigFile(fileName)) {
+ JAXB.marshal(preferences, out);
+ } catch (IOException e) {
+ logger.error("Unable to write {} to {}", type.getSimpleName(),
+ fileName, e);
+ }
+ }
+ updatePreferences(preferences);
+ }
+
+ public static interface Listener
{
+
+ public void update(P preference);
+
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/RCPPrefStore.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/RCPPrefStore.java
new file mode 100644
index 0000000000..22b087b325
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/prefs/RCPPrefStore.java
@@ -0,0 +1,120 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.prefs;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+import com.raytheon.uf.viz.alertview.AlertViewPrefStore;
+
+/**
+ *
+ * A simple {@link AlertViewPrefStore} that stores preferences in the state area
+ * that the Eclipse Runtime Platform provides for this bundle. When no user file
+ * is available the default version of the file is loaded from within this
+ * bundle.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class MemoryAlertStore implements AlertStore, AlertDestination,
+ PreferenceFile.Listener {
+
+ private ConcurrentLinkedQueue alerts = new ConcurrentLinkedQueue<>();
+
+ private final PreferenceFile prefsFile;
+
+ private int retentionCount;
+
+ public MemoryAlertStore() {
+ prefsFile = AlertViewPreferences.load(this);
+ retentionCount = prefsFile.get().getAlertsToLoad();
+ }
+
+ @Override
+ public void update(AlertViewPreferences preferences) {
+ retentionCount = preferences.getAlertsToLoad();
+ while (alerts.size() > retentionCount) {
+ alerts.poll();
+ }
+ }
+
+ /**
+ * This will get called automatically by declaritive services.
+ */
+ public void deactivate() {
+ prefsFile.close();
+ }
+
+ @Override
+ public void handleAlert(Alert alert) {
+ /* Trim too desired number of alerts */
+ if (alerts.size() >= retentionCount) {
+ alerts.poll();
+ }
+ alerts.offer(alert);
+
+ }
+
+ @Override
+ public List getAlerts() {
+ return Arrays.asList(alerts.toArray(new Alert[0]));
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/style/AlertStyle.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/style/AlertStyle.java
new file mode 100644
index 0000000000..a047c79ca7
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/style/AlertStyle.java
@@ -0,0 +1,174 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.style;
+
+import com.raytheon.uf.viz.alertview.Alert;
+
+/**
+ *
+ * Styles that apply to an {@link Alert}.
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class AlertPopup implements AlertDestination,
+ PreferenceFile.Listener {
+
+ private final PopupAlertTask task = new PopupAlertTask();
+
+ private final PreferenceFile prefsFile;
+
+ protected final FilterManager filters = new FilterManager();
+
+ protected final StyleManager styles = new StyleManager();
+
+ protected PopUpPreferences prefs;
+
+ public AlertPopup() {
+ prefsFile = PopUpPreferences.load(this);
+ prefs = prefsFile.get();
+ }
+
+ @Override
+ public void update(PopUpPreferences preferences) {
+ prefs = preferences;
+ }
+
+ /**
+ * This will get called automatically by declaritive services.
+ */
+ public void deactivate() {
+ prefsFile.close();
+ styles.close();
+ }
+
+ @Override
+ public void handleAlert(Alert alert) {
+ if (filters.getFilter(prefs.getFilter()).filter(alert)) {
+ task.update(alert);
+ }
+ }
+
+ /**
+ * This task will run on the UI thread and is responsible for managing the
+ * popup window. This should not be run directly but will schedule itself
+ * when {@link #update(Alert)} or {@link #clear(Alert)} is called.
+ */
+ private class PopupAlertTask implements Runnable {
+
+ private final Timer timer = new Timer("Remove Alert Popup");
+
+ private Shell shell;
+
+ private Label label;
+
+ /**
+ * This is the alert that should be dispalyed, the most recent alert
+ * passed to update which has not been passed to clear.
+ */
+ private volatile Alert alert;
+
+ /**
+ * This is the currently displayed alert, it should only be used from
+ * the UI thread. If this task is waiting to be run on the UI thread
+ * then this will not be the same as alert.
+ */
+ private Alert displayedAlert;
+
+ /**
+ * Update the popup window with the provided alert. If the window is not
+ * currently open then a new popup window will be opened to display the
+ * alert. If a popup window is already displayed then this alert will
+ * replace any other alert in the popup window. This method schedules an
+ * update on the UI thread but it does not block. If multiple calls to
+ * {@link #update(Alert)} are made before the UI thread becomes
+ * available then only the most recent Alert will be displayed.
+ */
+ public synchronized void update(Alert alert) {
+ this.alert = alert;
+ Display.getDefault().asyncExec(this);
+ }
+
+ /**
+ * Close the popup if the provided alert is the most recent alert that
+ * should be displayed. The alert is provided to make clear an atomic
+ * operation. If another alert has been provided to
+ * {@link #update(Alert)} since clear was called then it will be a no-op
+ * because the more recent alert needs to be displayed.
+ */
+ public synchronized void clear(Alert alert) {
+ if (alert == this.alert) {
+ this.alert = null;
+ Display.getDefault().asyncExec(this);
+ }
+ }
+
+ public void openInAlertView() {
+ if (displayedAlert != null) {
+ OpenAlertViewHandler.openInAlertView(displayedAlert);
+ clear(displayedAlert);
+ }
+ }
+
+ @Override
+ public void run() {
+ this.displayedAlert = this.alert;
+ if (displayedAlert != null && (shell == null || shell.isDisposed())) {
+ shell = new Shell(Display.getDefault(), SWT.NO_FOCUS
+ | SWT.NO_TRIM | SWT.ON_TOP);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ shell.setLayout(layout);
+ shell.setForeground(Display.getDefault().getSystemColor(
+ SWT.COLOR_BLACK));
+ shell.addListener(SWT.Dispose, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ shell = null;
+ }
+ });
+
+ final Composite comp = new Composite(shell, SWT.BORDER);
+
+ layout = new GridLayout(1, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ comp.setLayout(layout);
+ comp.setLayoutData(data);
+
+ label = new Label(comp, SWT.WRAP);
+ data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ label.setLayoutData(data);
+ label.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent e) {
+ openInAlertView();
+ }
+
+ });
+ shell.setSize(prefs.getWidth(), prefs.getHeight());
+
+ Rectangle clientArea = Display.getDefault().getMonitors()[0]
+ .getClientArea();
+
+ int offset = 2;
+ int startX = offset;
+ int startY = offset;
+ switch (prefs.getCorner()) {
+ case UPPER_LEFT:
+ startX = clientArea.x + offset;
+ startY = clientArea.y + offset;
+ break;
+ case UPPER_RIGHT:
+ startX = clientArea.x + clientArea.width
+ - shell.getSize().x - offset;
+ startY = clientArea.y + offset;
+ break;
+ case LOWER_LEFT:
+ startX = clientArea.x + offset;
+ startY = clientArea.y + clientArea.height
+ - shell.getSize().y - offset;
+ break;
+ case LOWER_RIGHT:
+ startX = clientArea.x + clientArea.width
+ - shell.getSize().x - offset;
+ startY = clientArea.y + clientArea.height
+ - shell.getSize().y - offset;
+ break;
+ }
+
+ shell.setLocation(startX, startY);
+ shell.setVisible(true);
+ }
+ if (displayedAlert == null) {
+ if (shell != null && !shell.isDisposed()) {
+ shell.dispose();
+ }
+ } else {
+ Display display = shell.getDisplay();
+ label.setBackground(styles.getBackgroundColor(display,
+ displayedAlert));
+ label.setForeground(styles.getForegroundColor(display,
+ displayedAlert));
+ label.setFont(styles.getFont(display, displayedAlert));
+ label.setText(displayedAlert.getMessage());
+ timer.schedule(new ClosePopupTask(displayedAlert),
+ prefs.getDuration());
+ }
+ }
+ }
+
+ /**
+ * This task is scheduled from the UI thread whenever an alert is displayed
+ * in a popup. It will call clear after the popup has expired. It is never
+ * canceled but instead it relies on the atomic nature of
+ * {@link #clear(Alert)} to ensure that if another alert arrives it will not
+ * close the popup.
+ */
+ private class ClosePopupTask extends TimerTask {
+
+ private final Alert alert;
+
+ public ClosePopupTask(Alert alert) {
+ this.alert = alert;
+ }
+
+ @Override
+ public void run() {
+ task.clear(alert);
+ }
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/ui/prefs/AlertViewPreferencePage.java b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/ui/prefs/AlertViewPreferencePage.java
new file mode 100644
index 0000000000..b91fdb69b6
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.alertview/src/com/raytheon/uf/viz/alertview/ui/prefs/AlertViewPreferencePage.java
@@ -0,0 +1,213 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.alertview.ui.prefs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+import com.raytheon.uf.viz.alertview.prefs.AlertViewPreferences;
+import com.raytheon.uf.viz.alertview.prefs.PreferenceFile;
+import com.raytheon.uf.viz.alertview.ui.view.AlertTable;
+
+/**
+ * Preference page for configuring {@link AlertViewPreferences}
+ *
+ *
+ *
+ * @author bsteffen
+ * @version 1.0
+ */
+public class OpenAlertViewHandler extends AbstractHandler {
+
+ private final Alert alert;
+
+ public OpenAlertViewHandler() {
+ this.alert = null;
+ }
+
+ public OpenAlertViewHandler(Alert alert) {
+ this.alert = alert;
+ }
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ openInAlertView(alert);
+ return null;
+ }
+
+ public static void openInAlertView(Alert alert) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ if (workbench.isStarting()) {
+ workbench.addWindowListener(new ShowAlertViewWindowListener(alert));
+ } else if (window != null) {
+ AlertView.show(window, alert);
+ }
+ }
+
+ /**
+ * If the user clicks on the alert popup while the workbench is starting
+ * then this listener will be used to wait until the workbench window is
+ * opened and then display the alert.
+ */
+ private static class ShowAlertViewWindowListener implements IWindowListener {
+
+ private final Alert alert;
+
+ public ShowAlertViewWindowListener(Alert alert) {
+ this.alert = alert;
+ }
+
+ @Override
+ public void windowOpened(IWorkbenchWindow window) {
+ AlertView.show(window, alert);
+ window.getWorkbench().removeWindowListener(this);
+ }
+
+ @Override
+ public void windowDeactivated(IWorkbenchWindow window) {
+ /* Unused method required by interface. */
+ }
+
+ @Override
+ public void windowClosed(IWorkbenchWindow window) {
+ /* Unused method required by interface. */
+ }
+
+ @Override
+ public void windowActivated(IWorkbenchWindow window) {
+ /* Unused method required by interface. */
+ }
+ }
+
+}
diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertPopupMessageDlg.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertPopupMessageDlg.java
index a54bf887fa..0d4cac05f4 100644
--- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertPopupMessageDlg.java
+++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertPopupMessageDlg.java
@@ -33,6 +33,8 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
@@ -68,6 +70,7 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
* 13 Jan 2011 7375 cjeanbap Commented out shell.setVisible(...) in
* acknowledgeLastMessage().
* 20 Apr 2015 4311 lvenable Fixed text field to accept really long text strings.
+ * 29 Jun 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
*
*
*
@@ -77,6 +80,20 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
*/
public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
MouseListener {
+ private static final int MAX_INITIAL_LINES = 5;
+
+ private static final int WIDTH_IN_CHARS = 135;
+
+ private static final double PERCENT_OF_SCREEN_WIDTH = 0.75;
+
+ private static final int NUM_LIST_ITEMS = 10;
+
+ /*
+ * Adjustment for SWT bug where shell.getSize() returns incorrect value when
+ * SWT.ON_TOP style is used.
+ */
+ private static final int SWT_BUG_FACTOR = 6;
+
/**
* Dialog shell.
*/
@@ -87,21 +104,11 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
*/
private Display display;
- /**
- * Font used for the controls.
- */
- private Font controlFont;
-
/**
* Font used for labels
*/
private Font labelFont;
- /**
- * Font used for the double click label.
- */
- private Font dblClickLblFont;
-
/**
* Message text field.
*/
@@ -268,7 +275,9 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
*/
private boolean initialized = false;
- private final AlertVisualization av;
+ private boolean first;
+
+ private int controlWidth;
/**
* Constructor.
@@ -285,13 +294,12 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* Color to be displayed at startup.
*/
public AlertPopupMessageDlg(Shell parent, StatusMessage statMsg,
- boolean expanded, Listener listener, RGB startUpRGB,
- AlertVisualization av) {
+ boolean expanded, Listener listener, RGB startUpRGB) {
super(parent, 0);
hideListener = listener;
statMsgArray.add(statMsg);
this.expanded = expanded;
- this.av = av;
+ this.first = true;
initShell(startUpRGB);
}
@@ -303,15 +311,14 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
Shell parent = getParent();
display = parent.getDisplay();
- shell = new Shell(parent, SWT.ON_TOP);
+ shell = new Shell(parent, SWT.ON_TOP | SWT.RESIZE);
shell.setText("Alert Visualization Popup Message Dialog");
- Rectangle prvLocation = av.getAlertPopupMsgPrvLocation();
- if (prvLocation != null) {
- shell.getBounds().add(prvLocation);
- }
// Create the main layout for the shell.
GridLayout mainLayout = new GridLayout(1, false);
+ mainLayout.marginWidth = 0;
+ mainLayout.marginHeight = 0;
+ mainLayout.verticalSpacing = 0;
shell.setLayout(mainLayout);
// initialize data, fonts, and arrays
@@ -345,12 +352,13 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* @return True/False/null.
*/
public Object open() {
- shell.pack();
setInitialDialogLocation();
initialized = true;
+ showHideLog();
+
shell.open();
while (!shell.isDisposed()) {
@@ -361,9 +369,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
initialized = false;
- controlFont.dispose();
labelFont.dispose();
- dblClickLblFont.dispose();
return null;
}
@@ -372,10 +378,26 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* Initialize font data
*/
private void initalizeData() {
- controlFont = new Font(shell.getDisplay(), "Monospace", 10, SWT.NORMAL);
- labelFont = new Font(shell.getDisplay(), "Monospace", 14, SWT.BOLD);
- dblClickLblFont = new Font(shell.getDisplay(), "Monospace", 10,
- SWT.BOLD);
+ FontData fontData = display.getSystemFont().getFontData()[0];
+ labelFont = new Font(shell.getDisplay(), fontData.getName(),
+ (int) (fontData.getHeight() * 1.4), SWT.BOLD);
+
+ /*
+ * compute preferred height to display entire message.
+ */
+ int screenWidth = display.getPrimaryMonitor().getBounds().width;
+
+ /*
+ * compute width of controls as the lesser of WIDTH_IN_CHARS or
+ * PERCENT_OF_SCREEN_WIDTH
+ */
+ GC gc = new GC(display);
+ gc.setFont(display.getSystemFont());
+ int charWidth = gc.getFontMetrics().getAverageCharWidth();
+ gc.dispose();
+
+ controlWidth = Math.min(charWidth * WIDTH_IN_CHARS,
+ (int) (screenWidth * PERCENT_OF_SCREEN_WIDTH));
}
/**
@@ -399,7 +421,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
private void createTitleBarLabel() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.horizontalSpan = 3;
- moveLabel = new Label(shell, SWT.CENTER | SWT.BORDER);
+ moveLabel = new Label(shell, SWT.CENTER);
moveLabel.setText("Alert Visualization Popup Message Dialog");
moveLabel.setLayoutData(gd);
moveLabel.setFont(labelFont);
@@ -415,97 +437,90 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* Create the labels at the top of the dialog.
*/
private void createTopLabels() {
- GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
topLabelComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(3, false);
gl.horizontalSpacing = 35;
topLabelComp.setLayout(gl);
+ GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
topLabelComp.setLayoutData(gd);
topLabelComp.setBackground(display.getSystemColor(SWT.COLOR_RED));
+ sourceLbl = new Label(topLabelComp, SWT.BORDER);
+ sourceLbl.setText(sourceStr + statMsgArray.get(0).getSourceKey());
gd = new GridData(200, SWT.DEFAULT);
gd.verticalIndent = 10;
- sourceLbl = new Label(topLabelComp, SWT.NONE);
- sourceLbl.setText(sourceStr + statMsgArray.get(0).getSourceKey());
sourceLbl.setLayoutData(gd);
- gd = new GridData(200, SWT.DEFAULT);
- gd.verticalIndent = 10;
- priorityLbl = new Label(topLabelComp, SWT.NONE);
+ priorityLbl = new Label(topLabelComp, SWT.BORDER);
priorityLbl.setText(priorityStr
+ statMsgArray.get(0).getPriority().ordinal());
- priorityLbl.setLayoutData(gd);
-
gd = new GridData(200, SWT.DEFAULT);
gd.verticalIndent = 10;
- categoryLbl = new Label(topLabelComp, SWT.NONE);
- categoryLbl.setText(categoryStr + statMsgArray.get(0).getCategory());
- categoryLbl.setLayoutData(gd);
+ priorityLbl.setLayoutData(gd);
- /*
- * If the expanded flag is false then hide the labels that display the
- * Category/Source/Priority information.
- */
- if (expanded == false) {
- // Hide the message labels
- ((GridData) topLabelComp.getLayoutData()).exclude = true;
- topLabelComp.setVisible(false);
- shell.layout();
- shell.pack();
- }
+ categoryLbl = new Label(topLabelComp, SWT.BORDER);
+ categoryLbl.setText(categoryStr + statMsgArray.get(0).getCategory());
+ gd = new GridData(200, SWT.DEFAULT);
+ gd.verticalIndent = 10;
+ categoryLbl.setLayoutData(gd);
}
/**
* Create the message text control.
*/
private void createMessageControl() {
- GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
messageComp = new Composite(shell, SWT.NONE);
messageComp.setLayout(new GridLayout(1, false));
messageComp.setLayoutData(gd);
messageComp.setBackground(display.getSystemColor(SWT.COLOR_RED));
- gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
- gd.heightHint = 20;
- gd.widthHint = 920;
messageTF = new Text(messageComp, SWT.BORDER | SWT.MULTI | SWT.WRAP
| SWT.V_SCROLL);
- messageTF.setLayoutData(gd);
- messageTF.setText(statMsgArray.get(0).getMessage());
messageTF.setEditable(false);
+ messageTF.setText(statMsgArray.get(0).getMessage());
+
+ int preferredHeight = messageTF.computeSize(controlWidth, SWT.DEFAULT).y;
+
+ /*
+ * compute size to display only max initial lines
+ */
+ int height = messageTF.getLineHeight() * MAX_INITIAL_LINES;
+ Rectangle initialSize = messageTF.computeTrim(0, 0, controlWidth,
+ height);
+
+ gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = initialSize.width;
+
+ gd.heightHint = Math.min(preferredHeight, initialSize.height);
+ gd.minimumHeight = gd.heightHint;
+ messageTF.setLayoutData(gd);
}
/**
* Create the action buttons for the dialog.
*/
private void createActionButtons() {
- GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
actionComp = new Composite(shell, SWT.NONE);
actionComp.setLayout(new GridLayout(7, false));
+ GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
actionComp.setLayoutData(gd);
actionComp.setBackground(display.getSystemColor(SWT.COLOR_RED));
- gd = new GridData(200, SWT.DEFAULT);
- timeLbl = new Label(actionComp, SWT.NONE);
+ timeLbl = new Label(actionComp, SWT.BORDER);
timeLbl.setText(dateFormat.format(statMsgArray.get(0).getEventTime()));
+ gd = new GridData(200, SWT.DEFAULT);
timeLbl.setLayoutData(gd);
- gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
fillerLbl = new Label(actionComp, SWT.NONE);
fillerLbl.setText("");
fillerLbl.setBackground(display.getSystemColor(SWT.COLOR_RED));
+ gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
fillerLbl.setLayoutData(gd);
- gd = new GridData(100, SWT.DEFAULT);
hideShowLogBtn = new Button(actionComp, SWT.PUSH);
- hideShowLogBtn.setLayoutData(gd);
-
- if (expanded == true) {
- hideShowLogBtn.setText("Hide Log");
- } else {
- hideShowLogBtn.setText("Show Log");
- }
-
+ hideShowLogBtn.setLayoutData(new GridData());
+ hideShowLogBtn.setText("Hide Log");
hideShowLogBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
@@ -547,90 +562,69 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
hideDialogBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- Rectangle prevLocation = Display.getCurrent().getBounds();
- av.setAlertPopupMsgPrvLocation(prevLocation);
shell.setVisible(false);
}
});
-
- /*
- * If the expanded flag is false then hide the Acknowledge Selected
- * button.
- */
- if (expanded == false) {
- // Hide the Acknowledge Selected button
- ((GridData) ackSelectedBtn.getLayoutData()).exclude = true;
- ackSelectedBtn.setVisible(false);
- actionComp.layout();
- actionComp.pack();
- }
}
/**
* Create the message log list control.
*/
private void createMessageLogControl() {
- GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
logComp = new Composite(shell, SWT.NONE);
logComp.setLayout(new GridLayout(1, false));
+ GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
logComp.setLayoutData(gd);
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Label dblClickLBl = new Label(logComp, SWT.BORDER | SWT.CENTER);
dblClickLBl
.setText("Double-click message to display more information:");
- dblClickLBl.setFont(dblClickLblFont);
+ dblClickLBl.setFont(labelFont);
dblClickLBl.setForeground(display.getSystemColor(SWT.COLOR_DARK_BLUE));
dblClickLBl.setLayoutData(gd);
- gd = new GridData(SWT.FILL, SWT.FILL, true, true);
- gd.widthHint = 900;
- gd.heightHint = 250;
msgLogList = new List(logComp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- msgLogList.setFont(controlFont);
+ gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ Rectangle size = msgLogList.computeTrim(0, 0, controlWidth,
+ msgLogList.getItemHeight() * NUM_LIST_ITEMS);
+ gd.widthHint = size.width;
+ gd.heightHint = size.height;
+ gd.heightHint = (msgLogList.getItemHeight() * 10)
+ + (msgLogList.getBorderWidth() * 2);
msgLogList.setLayoutData(gd);
msgLogList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
showSelectedListData();
}
- });
- detailsComp = new SimpleDetailsComp(logComp, SWT.NONE);
-
- msgLogList.addMouseListener(new MouseListener() {
@Override
- public void mouseDoubleClick(MouseEvent e) {
-
- if (detailsComp.isVisible() == false) {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ int delta = 0;
+ if (detailsComp.isVisible()) {
+ ((GridData) detailsComp.getLayoutData()).exclude = true;
+ detailsComp.setVisible(false);
+ delta -= detailsComp.getSize().y;
+ } else {
int idx = msgLogList.getSelectionIndex();
if (idx < 0) {
return;
}
StatusMessage sm = statMsgArray.get(idx);
detailsComp.displayDetails(sm);
+ ((GridData) detailsComp.getLayoutData()).exclude = false;
detailsComp.setVisible(true);
- } else {
- detailsComp.setVisible(false);
+ delta += detailsComp.getSize().y;
}
- }
- @Override
- public void mouseDown(MouseEvent e) {
+ adjustHeight(delta);
}
-
- @Override
- public void mouseUp(MouseEvent e) {
- }
-
});
- if (expanded == false) {
- ((GridData) logComp.getLayoutData()).exclude = true;
- logComp.setVisible(false);
- shell.layout();
- shell.pack();
- }
+ detailsComp = new SimpleDetailsComp(shell, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ detailsComp.setLayoutData(gd);
msgLogList.add(getFormattedMessage(statMsgArray.get(0)));
msgLogList.select(0);
@@ -641,46 +635,59 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* Show/Hide the message log list.
*/
private void showHideLog() {
+ int delta = 0;
if (expanded == true) {
// Show the message labels
((GridData) topLabelComp.getLayoutData()).exclude = false;
topLabelComp.setVisible(true);
- shell.layout();
- shell.pack();
+ delta += topLabelComp.getSize().y;
// Show the Acknowledge Selected button
((GridData) ackSelectedBtn.getLayoutData()).exclude = false;
ackSelectedBtn.setVisible(true);
- actionComp.layout();
- actionComp.pack();
+ hideShowLogBtn.setText("Hide Log");
// Show the message log
((GridData) logComp.getLayoutData()).exclude = false;
logComp.setVisible(true);
- shell.layout();
- shell.pack();
- hideShowLogBtn.setText("Hide Log");
+ delta += logComp.getSize().y;
} else {
// Hide the message labels
((GridData) topLabelComp.getLayoutData()).exclude = true;
topLabelComp.setVisible(false);
- shell.layout();
- shell.pack();
+ delta -= topLabelComp.getSize().y;
// Hide the Acknowledge Selected button
((GridData) ackSelectedBtn.getLayoutData()).exclude = true;
ackSelectedBtn.setVisible(false);
- actionComp.layout();
- actionComp.pack();
+ hideShowLogBtn.setText("Show Log");
// Hide the message log
- detailsComp.setVisible(false);
+ if (this.first || detailsComp.isVisible()) {
+ ((GridData) detailsComp.getLayoutData()).exclude = true;
+ detailsComp.setVisible(false);
+ delta -= detailsComp.getSize().y;
+ this.first = false;
+ }
+
((GridData) logComp.getLayoutData()).exclude = true;
logComp.setVisible(false);
- shell.layout();
- shell.pack();
- hideShowLogBtn.setText("Show Log");
+ delta -= logComp.getSize().y;
}
+ actionComp.layout();
+
+ adjustHeight(delta);
+ }
+
+ private void adjustHeight(int delta) {
+ Point minSize = shell.getMinimumSize();
+ minSize.y += delta;
+ shell.setMinimumSize(minSize);
+
+ Point size = shell.getSize();
+ size.x += SWT_BUG_FACTOR;
+ size.y += delta + SWT_BUG_FACTOR;
+ shell.setSize(size);
}
/**
@@ -701,10 +708,19 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
sourceLbl.setText(sourceStr + sm.getSourceKey());
timeLbl.setText(dateFormat.format(sm.getEventTime()));
messageTF.setText(sm.getMessage());
+ int desiredHeight = Math.min(MAX_INITIAL_LINES,
+ messageTF.getLineCount())
+ * messageTF.getLineHeight();
+ Rectangle clientArea = messageTF.getClientArea();
+ if (clientArea.height < desiredHeight) {
+ Rectangle trim = messageTF.computeTrim(clientArea.x, clientArea.y,
+ clientArea.width, desiredHeight);
+ Point oldSize = messageTF.getSize();
+ messageTF.setSize(oldSize.x, trim.height);
+ adjustHeight(trim.height - oldSize.y);
+ }
detailsComp.displayDetails(sm);
-
- this.shell.pack();
}
/**
@@ -747,7 +763,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
}
// Check if a message is not selected.
- if (currentIndex < 0 || !expanded) {
+ if ((currentIndex < 0) || !expanded) {
if (msgLogList.getItemCount() > 0) {
msgLogList.select(0);
showSelectedListData();
@@ -759,7 +775,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
// Check if the current index will go outside the array
// (it should never do this but check anyway...)
- if (currentIndex > 0 && currentIndex == statMsgArray.size()) {
+ if ((currentIndex > 0) && (currentIndex == statMsgArray.size())) {
msgLogList.select(0);
showSelectedListData();
return;
@@ -877,6 +893,8 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
messageComp.setBackground(bgColor);
actionComp.setBackground(bgColor);
fillerLbl.setBackground(bgColor);
+ logComp.setBackground(bgColor);
+ detailsComp.setBackground(bgColor);
}
/**
@@ -890,18 +908,18 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
return;
}
- boolean expandedForPromp = false;
+ boolean expandedForPrompt = false;
if (!expanded) {
- expandedForPromp = expanded = true;
+ expandedForPrompt = expanded = true;
+ showHideLog();
}
- showHideLog();
if (confirmPrompt) {
ConfirmationDlg cd = new ConfirmationDlg(shell,
"Are you sure you want to acknowledge all popup messages?",
SWT.ICON_QUESTION);
- if (msgLogList != null && !msgLogList.isDisposed()) {
+ if ((msgLogList != null) && !msgLogList.isDisposed()) {
Rectangle logBounds = msgLogList.getBounds();
Point logDisplayOrigin = msgLogList.toDisplay(0, 0);
logBounds.x = logDisplayOrigin.x;
@@ -912,7 +930,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
result = cd.open();
if (result != SWT.YES) {
- if (result == SWT.CANCEL && expandedForPromp) {
+ if ((result == SWT.CANCEL) && expandedForPrompt) {
expanded = false;
showHideLog();
}
@@ -951,17 +969,18 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
private void setInitialDialogLocation() {
if (dialogXY == null) {
+ Point minSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ shell.setMinimumSize(minSize);
int screenHeight = display.getBounds().height;
int screenWidth = display.getPrimaryMonitor().getBounds().width;
- int newX = screenWidth / 2
- - (shell.getChildren())[0].getBounds().width / 2;
- int newY = (screenHeight / 2 - (shell.getChildren())[0].getBounds().height / 2) - 200;
+ Point size = minSize;
+ shell.setSize(size);
- shell.setLocation(newX, newY);
-
- dialogXY = new Point(newX, newY);
+ dialogXY = new Point((screenWidth - size.x) / 2,
+ (screenHeight - size.y) / 4);
+ shell.setLocation(dialogXY);
} else {
shell.setLocation(dialogXY);
}
@@ -997,7 +1016,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
* @return True if open, false if not.
*/
public boolean dialogIsOpen() {
- return (shell != null && !shell.isDisposed() && shell.isVisible());
+ return ((shell != null) && !shell.isDisposed() && shell.isVisible());
}
/**
@@ -1042,7 +1061,7 @@ public class AlertPopupMessageDlg extends Dialog implements MouseMoveListener,
*/
@Override
public void mouseMove(MouseEvent e) {
- if (origin != null && moveDialog == true) {
+ if ((origin != null) && (moveDialog == true)) {
// Move the dialog.
dialogLoc = display.map(shell, null, e.x, e.y);
dialogXY.x = dialogLoc.x - origin.x;
diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisualization.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisualization.java
index ac9ecff405..1e7246af99 100644
--- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisualization.java
+++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisualization.java
@@ -95,6 +95,7 @@ import com.raytheon.uf.viz.core.VizApp;
* then set the icon to the default image.
* 18 Mar 2015 4234 njensen Remove reference to non-working python
* 03 Jun 2015 4473 njensen Updated for new AlertvizJob API
+ * 29 Jun 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
*
*
*
@@ -377,8 +378,8 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
@Override
public void widgetSelected(SelectionEvent e) {
- if (alertPopupDlg != null
- && alertPopupDlg.getNumberOfMessages() > 0) {
+ if ((alertPopupDlg != null)
+ && (alertPopupDlg.getNumberOfMessages() > 0)) {
cancelTimer();
openAlertPopupDialog();
}
@@ -437,20 +438,15 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
MenuItem viewLogMI = new MenuItem(trayItemMenu, SWT.NONE);
viewLogMI.setText("System Log...");
viewLogMI.addSelectionListener(new SelectionAdapter() {
- boolean open = false;
-
SimpleLogViewer slv = null;
@Override
public void widgetSelected(SelectionEvent event) {
- if (open) {
- open = slv.focus(); // Do Nothing! It's open
- } else {
- open = true;
+ if ((slv == null) || slv.isDisposed()) {
slv = new SimpleLogViewer(shell);
- slv.setText("System Log");
slv.open();
- open = false;
+ } else {
+ slv.bringToTop();
}
}
});
@@ -597,7 +593,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
* Show the Alert Visualization Configuration dialog.
*/
private void showConfigDialog() {
- if (configDlg != null && !configDlg.isDisposed()) {
+ if ((configDlg != null) && !configDlg.isDisposed()) {
configDlg.close();
}
configDlg = new AlertVisConfigDlg(shell, alertMessageDlg, configData,
@@ -640,7 +636,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
.hasMissing(statMsg))) {
Source source = configData.lookupSource("GDN_ADMIN");
RGB backgroundRBG = null;
- if (source == null || source.getConfigurationItem() == null) {
+ if ((source == null) || (source.getConfigurationItem() == null)) {
backgroundRBG = ColorUtil.getColorValue("COLOR_YELLOW");
} else {
AlertMetadata am = source.getConfigurationItem().lookup(
@@ -663,7 +659,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
}
} else {
if (cat.getCategoryName().equals(Constants.MONITOR)
- || amd.isText() == true) {
+ || (amd.isText() == true)) {
alertMessageDlg.messageHandler(statMsg, amd, cat,
gConfig);
}
@@ -689,8 +685,8 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
audioFile = getFullAudioFilePath(audioFile);
} else {
audioFile = statMsg.getAudioFile();
- if (audioFile != null
- && (audioFile.trim().length() == 0 || audioFile
+ if ((audioFile != null)
+ && ((audioFile.trim().length() == 0) || audioFile
.equals("NONE"))) {
audioFile = null;
}
@@ -703,10 +699,9 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
// Pop-up message
if (amd.isPopup() == true) {
- if (alertPopupDlg == null || alertPopupDlg.isDisposed() == true) {
+ if ((alertPopupDlg == null) || (alertPopupDlg.isDisposed() == true)) {
alertPopupDlg = new AlertPopupMessageDlg(shell, statMsg,
- gConfig.isExpandedPopup(), this, amd.getBackground(),
- this);
+ gConfig.isExpandedPopup(), this, amd.getBackground());
} else {
alertPopupDlg.addNewMessage(statMsg, amd);
}
@@ -739,7 +734,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
if (!file.exists()) {
file = PathManagerFactory.getPathManager().getStaticFile(
"alertVizAudio/" + file.getName());
- if (file == null || !file.exists()) {
+ if ((file == null) || !file.exists()) {
filename = null;
} else {
filename = file.getPath();
@@ -752,7 +747,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
* Opens the alert pop-up dialog
*/
public void openAlertPopupDialog() {
- if (alertPopupDlg != null && alertPopupDlg.dialogIsOpen() == true) {
+ if ((alertPopupDlg != null) && (alertPopupDlg.dialogIsOpen() == true)) {
alertPopupDlg.showDialog(true);
} else {
alertPopupDlg.open();
@@ -849,7 +844,7 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
configData = ConfigurationManager.getInstance()
.getCurrentConfiguration();
configContext = ConfigurationManager.getInstance().getCurrentContext();
- if (alertMessageDlg != null && showAlertDialogMI != null) {
+ if ((alertMessageDlg != null) && (showAlertDialogMI != null)) {
alertMessageDlg.setConfigData(configData);
if (configData.isMonitorLayoutChanged(prevConfigFile)) {
if (alertMessageDlg.reLayout()) {
@@ -864,21 +859,6 @@ public class AlertVisualization implements ITimerAction, IAudioAction,
// }
}
- /**
- * Set the Alert Popup Message previous location.
- */
- public void setAlertPopupMsgPrvLocation(Rectangle prevLocation) {
- this.prevLocation = prevLocation;
- }
-
- /**
- * Get the Alert Popup Message to restore the window to its previous
- * location.
- */
- public Rectangle getAlertPopupMsgPrvLocation() {
- return this.prevLocation;
- }
-
/**
* Get the number of text control composites.
*
diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleDetailsComp.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleDetailsComp.java
index 13d2637745..a02369e79a 100644
--- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleDetailsComp.java
+++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleDetailsComp.java
@@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.message.StatusMessage;
@@ -40,7 +39,8 @@ import com.raytheon.uf.common.message.StatusMessage;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Oct 9, 2008 chammack Initial creation
+ * Oct 09, 2008 chammack Initial creation
+ * Jun 29, 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
*
*
* @author chammack
@@ -49,10 +49,7 @@ import com.raytheon.uf.common.message.StatusMessage;
public class SimpleDetailsComp extends Composite {
- /**
- * Shell of the parent composite
- */
- private Shell shell = null;
+ private static final int NUM_DETAIL_LINES = 13;
/**
* Actually contains text of details message, lives in textBox
@@ -66,25 +63,22 @@ public class SimpleDetailsComp extends Composite {
*/
public SimpleDetailsComp(Composite parent, int style) {
super(parent, style);
- this.shell = parent.getShell();
-
initComponents();
- setVisible(false);
}
/**
* Lay out composite with StyledText
*/
private void initComponents() {
- GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
- setLayout(new GridLayout(1, false));
- setLayoutData(gd);
+ GridLayout layout = new GridLayout(1, false);
+ setLayout(layout);
- gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
- gd.heightHint = 250;
- st = new StyledText(this, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+ st = new StyledText(this, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER
+ | SWT.WRAP);
st.setEditable(false);
-
+ GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ gd.heightHint = (st.getLineHeight() * NUM_DETAIL_LINES)
+ + (st.getBorderWidth() * 2);
st.setLayoutData(gd);
Menu popupMenu = new Menu(st);
@@ -121,43 +115,10 @@ public class SimpleDetailsComp extends Composite {
if (sm == null) {
st.setText("");
} else {
- StringBuilder sb = new StringBuilder();
- // sb.append(sm.getMessage()).append("\n");
-
- String details = sm.getDetails();
- String[] lines = details.split("[\n]");
-
- for (String line : lines) {
- if (line.length() > 500) {
- sb.append(line.substring(0, 500)).append(
- "...text truncated\n");
-
- } else {
- sb.append(line).append("\n");
- }
- }
- st.setText(sb.toString());
+ st.setText(sm.getDetails());
}
}
- /**
- * Override so we can exclude this composite from the layout when hidden
- */
- @Override
- public void setVisible(boolean visible) {
- ((GridData) this.getLayoutData()).exclude = !visible;
-
- if (visible == true) {
- ((GridData) st.getLayoutData()).widthHint = getParent().getBounds().width - 46;
- }
-
- super.setVisible(visible);
-
- shell.layout();
- shell.pack();
-
- }
-
/**
*
*/
diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleLogViewer.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleLogViewer.java
index 666f4da9a1..e050c65880 100644
--- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleLogViewer.java
+++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/SimpleLogViewer.java
@@ -26,12 +26,11 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -51,10 +50,15 @@ import com.raytheon.uf.common.message.StatusMessage;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.alertviz.Activator;
import com.raytheon.uf.viz.alertviz.AlertvizException;
+import com.raytheon.uf.viz.alertviz.AlertvizJob;
import com.raytheon.uf.viz.alertviz.Container;
+import com.raytheon.uf.viz.alertviz.IAlertArrivedCallback;
import com.raytheon.uf.viz.alertviz.LogUtil;
import com.raytheon.uf.viz.alertviz.LogUtil.Order;
import com.raytheon.uf.viz.alertviz.SystemStatusHandler;
+import com.raytheon.uf.viz.alertviz.config.AlertMetadata;
+import com.raytheon.uf.viz.alertviz.config.Category;
+import com.raytheon.uf.viz.alertviz.config.TrayConfiguration;
/**
* Implements a basic log viewer capability
@@ -65,6 +69,8 @@ import com.raytheon.uf.viz.alertviz.SystemStatusHandler;
* ------------ ---------- ----------- --------------------------
* Sep 30, 2008 1433 chammack Initial creation
* Jun 02, 2015 4473 njensen Cleaned up warnings
+ * Jul 01, 2015 4473 njensen Fix update of table on alert arrival
+ * Jun 29, 2015 4311 randerso Reworking AlertViz dialogs to be resizable.
*
*
*
@@ -72,69 +78,67 @@ import com.raytheon.uf.viz.alertviz.SystemStatusHandler;
* @version 1.0
*/
-public class SimpleLogViewer extends Dialog {
+public class SimpleLogViewer extends Dialog implements IAlertArrivedCallback {
+
+ private Display display;
- /**
- *
- */
private Shell shell;
- /**
- *
- */
- private SimpleDetailsComp sdb;
+ private SimpleDetailsComp detailsComp;
- /**
- *
- */
private Button showLog;
- /**
- *
- */
- private Table reference;
-
- /**
- *
- */
int[] range;
+ private Table table;
+
+ private Color yellow;
+
+ private Color red;
+
+ private Color orange;
+
+ private Color black;
+
+ boolean first;
+
/**
*
* @param parent
*/
public SimpleLogViewer(Shell parent) {
super(parent, SWT.NONE);
+ first = true;
+
+ display = parent.getDisplay();
+
+ // Create a new shell object and set the text for the dialog.
+ shell = new Shell(display, SWT.DIALOG_TRIM | SWT.MIN | SWT.TITLE
+ | SWT.RESIZE);
+ shell.setText("System Log");
+
+ initializeComponents();
}
/**
- * set focus to the dialog
- *
- * @return false if not open or disposed, true otherwise
+ * @return true if shell is null or disposed;
*/
- public boolean focus() {
- if (shell == null || shell.isDisposed()) {
- return false;
- } else {
+ public boolean isDisposed() {
+ return ((shell != null) && shell.isDisposed());
+ }
+
+ /**
+ * Bring dialog to the top
+ */
+ public void bringToTop() {
+ if ((shell != null) && !shell.isDisposed()) {
+ shell.setVisible(true);
shell.forceFocus();
- return true;
+ shell.forceActive();
}
}
- /**
- * Opens the dialog (makes visible).
- *
- * @return Null
- */
- public Object open() {
- // Create a new shell object and set the text for the dialog.
- Shell parent = getParent();
- // shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE);
- shell = new Shell(parent.getDisplay(), SWT.DIALOG_TRIM | SWT.MIN
- | SWT.TITLE | SWT.RESIZE);
- shell.setText(getText());
-
- /* TODO: Max Code: */
+ private void initializeComponents() {
GridLayout mainLayout = new GridLayout(1, true);
mainLayout.marginHeight = 0;
mainLayout.marginWidth = 0;
@@ -143,15 +147,7 @@ public class SimpleLogViewer extends Dialog {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, true);
shell.setLayoutData(gd);
- // shell.setLayout(new GridLayout(1, false));
-
- // shell.setSize(800, 400);
- // shell.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- // | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
- // | GridData.VERTICAL_ALIGN_FILL));
-
- final Table table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
- reference = table;
+ table = new Table(shell, SWT.BORDER | SWT.VIRTUAL);
final TableColumn[] columns = new TableColumn[] {
new TableColumn(table, SWT.NONE),
new TableColumn(table, SWT.NONE),
@@ -159,10 +155,6 @@ public class SimpleLogViewer extends Dialog {
new TableColumn(table, SWT.NONE),
new TableColumn(table, SWT.NONE) };
- // table.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- // | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
- // | GridData.VERTICAL_ALIGN_FILL));
-
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 800;
gd.heightHint = 400;
@@ -179,47 +171,39 @@ public class SimpleLogViewer extends Dialog {
columns[3].setWidth(100);
columns[4].setText("Message");
columns[4].setWidth(100);
- final int[] range;
- final int sz;
+ int sz = 0;
try {
range = SystemStatusHandler.getCurrentRange();
- this.range = range;
- sz = range[1] - range[0];
+ if ((range[0] == 0) && (range[1] == 0)) {
+ // database is empty
+ sz = 0;
+ } else {
+ sz = (range[1] - range[0]) + 1;
+ }
} catch (AlertvizException e2) {
Container
.logInternal(
Priority.ERROR,
"SimpleLogViewer: exception getting current range from SystemStatusHandler.",
e2);
- return null;
}
table.setSortColumn(columns[0]);
table.setSortDirection(SWT.UP);
- final Color red = new Color(Display.getCurrent(), new RGB(255, 0, 0));
- final Color yellow = new Color(Display.getCurrent(), new RGB(255, 255,
- 0));
- final Color orange = new Color(Display.getCurrent(), new RGB(255, 128,
- 0));
- final Color black = new Color(Display.getCurrent(), new RGB(0, 0, 0));
-
- table.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- showHideLog();
- }
- });
+ red = new Color(display, new RGB(255, 0, 0));
+ yellow = new Color(Display.getCurrent(), new RGB(255, 255, 0));
+ orange = new Color(display, new RGB(255, 128, 0));
+ black = new Color(display, new RGB(0, 0, 0));
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
int idx = table.getSelectionIndex();
+ StatusMessage sm = null;
try {
- StatusMessage sm = SystemStatusHandler.retrieveByPk(idx
- + range[0]);
- sdb.displayDetails(sm);
+ sm = SystemStatusHandler.retrieveByPk(idx + range[0]);
} catch (Exception e1) {
Container
.logInternal(
@@ -227,6 +211,12 @@ public class SimpleLogViewer extends Dialog {
"SimpleLogViewer: exception retrieving StatusMessage by key from SystemStatusHandler: "
+ (idx + range[0]), e1);
}
+ detailsComp.displayDetails(sm);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ showHideLog();
}
});
@@ -332,19 +322,52 @@ public class SimpleLogViewer extends Dialog {
}
});
- sdb = new SimpleDetailsComp(shell, SWT.NONE);
+ detailsComp = new SimpleDetailsComp(shell, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
+ detailsComp.setLayoutData(gd);
+
+ }
+
+ @Override
+ public void alertArrived(StatusMessage statusMessage,
+ AlertMetadata alertMetadata, Category category,
+ TrayConfiguration globalConfiguration) {
+
+ if (!table.isDisposed()) {
+ int count = table.getItemCount();
+ table.setItemCount(count + 1);
+ }
+ }
+
+ /**
+ * Opens the dialog (makes visible).
+ *
+ * @return null
+ */
+ public Object open() {
+ Point minSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ shell.setMinimumSize(minSize);
+
+ Point size = minSize;
+ shell.setSize(size);
+
+ showHideLog();
+
+ AlertvizJob.getInstance().addAlertArrivedCallback(this);
- shell.pack();
shell.open();
+ table.showItem(table.getItem(table.getItemCount() - 1));
+ table.select(table.getItemCount() - 1);
// Wait until the shell is disposed.
- Display display = parent.getDisplay();
+ Display display = shell.getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
+ AlertvizJob.getInstance().removeAlertArrivedCallback(this);
table.dispose();
red.dispose();
yellow.dispose();
@@ -358,26 +381,27 @@ public class SimpleLogViewer extends Dialog {
*
*/
private void showHideLog() {
- int idx = reference.getSelectionIndex();
- if (idx < 0) {
- return;
- }
- try {
- StatusMessage sm = SystemStatusHandler.retrieveByPk(idx + range[0]);
- if (sdb.isVisible() == false) {
- sdb.setVisible(true);
- sdb.displayDetails(sm);
- showLog.setText("Hide Log...");
- } else {
- sdb.setVisible(false);
- showLog.setText("Show Log...");
- }
- } catch (AlertvizException e1) {
- Container
- .logInternal(
- Priority.ERROR,
- "SimpleLogViewer: exception retrieving StatusMessage by key from SystemStatusHandler: "
- + (idx + range[0]), e1);
+ int delta = 0;
+ if (first || detailsComp.isVisible()) {
+ showLog.setText("Show Log...");
+
+ ((GridData) detailsComp.getLayoutData()).exclude = true;
+ detailsComp.setVisible(false);
+ delta -= detailsComp.getSize().y;
+ first = false;
+ } else {
+ showLog.setText("Hide Log...");
+ ((GridData) detailsComp.getLayoutData()).exclude = false;
+ detailsComp.setVisible(true);
+ delta += detailsComp.getSize().y;
}
+
+ Point minSize = shell.getMinimumSize();
+ minSize.y += delta;
+ shell.setMinimumSize(minSize);
+
+ Point size = shell.getSize();
+ size.y += delta;
+ shell.setSize(size);
}
}
diff --git a/cave/com.raytheon.uf.viz.alertviz/logback-alertviz.xml b/cave/com.raytheon.uf.viz.alertviz/logback-alertviz.xml
index 12023382ed..76b5dc4bee 100644
--- a/cave/com.raytheon.uf.viz.alertviz/logback-alertviz.xml
+++ b/cave/com.raytheon.uf.viz.alertviz/logback-alertviz.xml
@@ -2,9 +2,20 @@
+
+
+ ${LOGDIR}
+ alertviz_${startTime}_admin.log
+
+
+ ${LOGDIR}
+ alertviz_${startTime}_console.log
+
+
+
INFO
@@ -18,20 +29,16 @@
-
-
- alertviz-admin.log
- LOGFILE_ALERTVIZ
-
- alertviz-admin.log%i
- LOGFILE_ALERTVIZ
- 1
- 5
-
-
- 2GB
-
- true
+
+
+ ${consoleLogFile}
+
+ INFO
+
+
+
+
+ ${adminLogFile}
@@ -71,5 +78,6 @@
+
diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/AlertvizJob.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/AlertvizJob.java
index da834b9206..0cb7a6b616 100644
--- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/AlertvizJob.java
+++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/AlertvizJob.java
@@ -75,10 +75,11 @@ import com.raytheon.uf.viz.core.VizApp;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Sep 4, 2008 1433 chammack Initial creation
- * Jun 3, 2013 2026 randerso Improve error handling
- * May 5, 2015 4473 mschenke Major refactor
- * Jun 1, 2015 4473 njensen Major refactor, removed send ability
+ * Sep 04, 2008 1433 chammack Initial creation
+ * Jun 03, 2013 2026 randerso Improve error handling
+ * May 05, 2015 4473 mschenke Major refactor
+ * Jun 01, 2015 4473 njensen Major refactor, removed send ability
+ * Jun 29, 2015 4473 njensen Register notification observer on start
*
*
*
@@ -178,6 +179,7 @@ public class AlertvizJob extends Job implements AlertService {
this.broker.setPersistent(false);
this.broker.setUseJmx(false);
this.port = port;
+ AlertVizNotificationObserver.registerAlertVizNotificationObserver();
String localIP = "localhost";
try {
diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/UsersTreeLabelProvider.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/UsersTreeLabelProvider.java
index 61a5abfce7..d637c05bd7 100644
--- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/UsersTreeLabelProvider.java
+++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/UsersTreeLabelProvider.java
@@ -28,6 +28,7 @@ import java.util.Map;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
@@ -66,6 +67,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.TreeObjectContainer;
* Mar 06, 2014 2848 bclement get venueName directly from session
* Jun 12, 2014 3267 bclement fixed missing null-check for outdated UI info
* Oct 08, 2014 3705 bclement replaced checks for SessionGroupContainer with TreeObjectContainer
+ * Jun 23, 2015 4563 mapeters bold/color users in contacts list if logged-in
*
*
*
@@ -86,6 +88,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return connection.getContactsManager().getPresence(user);
}
+ @Override
protected String getDisplayName(UserId user) {
return getLocalAlias(user);
}
@@ -136,7 +139,6 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
}
return rval;
}
-
};
private List listeners;
@@ -159,7 +161,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
if (element instanceof UserId) {
return userLabelProvider.getImage(element);
} else if (element instanceof RosterEntry) {
- return userLabelProvider.getImage((RosterEntry) element);
+ return userLabelProvider.getImage(element);
} else if (element instanceof RosterGroup) {
key = "roster_group";
} else if (element instanceof SharedGroup) {
@@ -168,7 +170,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
// key = "session_group";
} else if (element instanceof TreeObjectContainer) {
key = ((TreeObjectContainer) element).getIcon();
- }
+ }
if (imageMap.get(key) == null && !key.equals("")) {
imageMap.put(key, CollaborationUtils.getNodeImage(key));
@@ -183,7 +185,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
} else if (element instanceof SharedGroup) {
return ((SharedGroup) element).getName();
} else if (element instanceof RosterEntry) {
- return userLabelProvider.getText((RosterEntry) element);
+ return userLabelProvider.getText(element);
} else if (element instanceof TreeObjectContainer) {
return ((TreeObjectContainer) element).getLabel();
} else if (element instanceof UserId) {
@@ -211,10 +213,13 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
@Override
public Font getFont(Object element) {
- if (element instanceof RosterGroup || element instanceof SharedGroup
- || element instanceof TreeObjectContainer) {
- // for this case do nothing, as it is not the top level of
- // session groups
+ boolean isGroupTitle = element instanceof RosterGroup
+ || element instanceof SharedGroup
+ || element instanceof TreeObjectContainer;
+ boolean isAvailableUser = element instanceof RosterEntry
+ && userLabelProvider.getPresence(
+ userLabelProvider.convertObject(element)).isAvailable();
+ if (isGroupTitle || isAvailableUser) {
if (boldFont == null) {
Font currFont = Display.getCurrent().getSystemFont();
boldFont = new Font(Display.getCurrent(), currFont.toString(),
@@ -225,6 +230,17 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
return null;
}
+ @Override
+ public Color getForeground(Object element) {
+ if (element instanceof RosterEntry) {
+ UserId user = userLabelProvider.convertObject(element);
+ if (userLabelProvider.getPresence(user).isAvailable()) {
+ return Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
+ }
+ }
+ return null;
+ }
+
/**
* Gets the tooltip text on the tree that this is a label provider for
*/
@@ -234,7 +250,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
if (element instanceof UserId) {
return userLabelProvider.getToolTipText(element);
} else if (element instanceof RosterEntry) {
- return userLabelProvider.getToolTipText((RosterEntry) element);
+ return userLabelProvider.getToolTipText(element);
}
// builds the tooltip text for the session group
// portion of the view
@@ -242,10 +258,8 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
IVenueSession sessGroup = (IVenueSession) element;
IVenue venue = sessGroup.getVenue();
builder.append("ID: ").append(venue.getId());
- builder.append("\nName: ").append(venue.getName())
- .append("\n");
- builder.append("Subject: ").append(venue.getSubject())
- .append("\n");
+ builder.append("\nName: ").append(venue.getName()).append("\n");
+ builder.append("Subject: ").append(venue.getSubject()).append("\n");
builder.append("Participants: ")
.append(venue.getParticipantCount());
return builder.toString();
diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java
index 19841d1b85..403923ecf8 100644
--- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java
+++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java
@@ -24,6 +24,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
import com.raytheon.uf.common.status.IUFStatusHandler;
@@ -49,6 +50,8 @@ import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg.Mode;
* Jul 8, 2008 #1183 chammack Migrate to new localization
* Oct 16, 2012 #1229 rferrel Changes for non-blocking VizLocalizationFileListDlg.
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizLocalizationFileListDlg}.
+ * Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
+ * {@link VizLocalizationFileListDlg}.
*
*
*
@@ -74,7 +77,8 @@ public class DeleteAWIPSProcedure extends AbstractHandler {
|| listDlg.isDisposed()) {
listDlg = new VizLocalizationFileListDlg("Delete Procedure",
HandlerUtil.getActiveShell(event), Mode.DELETE,
- ProcedureDlg.PROCEDURES_DIR, "procedures");
+ ProcedureDlg.PROCEDURES_DIR, "procedures",
+ LocalizationType.CAVE_STATIC);
listDlg.setCloseCallback(new ICloseCallback() {
@Override
diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/OpenAWIPSProcedure.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/OpenAWIPSProcedure.java
index 0f7fb9026f..01a6fbf939 100644
--- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/OpenAWIPSProcedure.java
+++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/OpenAWIPSProcedure.java
@@ -26,6 +26,7 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.LocalizationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
@@ -35,6 +36,7 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
import com.raytheon.viz.ui.VizWorkbenchManager;
import com.raytheon.viz.ui.actions.LoadPerspectiveHandler;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
+import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
import com.raytheon.viz.ui.dialogs.localization.VizOpenLocalizationFileListDlg;
/**
@@ -52,6 +54,8 @@ import com.raytheon.viz.ui.dialogs.localization.VizOpenLocalizationFileListDlg;
* Jun 07, 2013 2074 mnash Don't open the dialog if no procedures are deserialized
* Aug 11, 2014 3480 bclement added logging
* Jun 02, 2015 #4401 bkowal Updated to use {@link VizOpenLocalizationFileListDlg}.
+ * Jun 30, 2015 #4401 bkowal Specify the localization type when constructing a
+ * {@link VizOpenLocalizationFileListDlg}.
*
*
* @author chammack
@@ -76,7 +80,8 @@ public class OpenAWIPSProcedure extends AbstractHandler {
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
dialog = new VizOpenLocalizationFileListDlg("Open Procedure",
HandlerUtil.getActiveShell(event),
- ProcedureDlg.PROCEDURES_DIR, "procedures");
+ ProcedureDlg.PROCEDURES_DIR, "procedures",
+ LocalizationType.CAVE_STATIC);
dialog.setCloseCallback(new ICloseCallback() {
@Override
diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListFileDlg.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListFileDlg.java
index 147aef5d68..e4f847b43b 100644
--- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListFileDlg.java
+++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/dialogs/procedures/ProcedureListFileDlg.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
/**
@@ -43,6 +44,7 @@ import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 2, 2015 4401 bkowal Initial creation
+ * Jun 30, 2015 4401 bkowal Specify the localization level during construction.
*
*
*
@@ -67,7 +69,8 @@ public class ProcedureListFileDlg extends VizLocalizationFileListDlg {
*/
public ProcedureListFileDlg(String title, Shell parent, Mode mode,
String localizationDirectory) {
- super(title, parent, mode, localizationDirectory, "procedures");
+ super(title, parent, mode, localizationDirectory, "procedures",
+ LocalizationType.CAVE_STATIC);
}
@Override
diff --git a/cave/com.raytheon.uf.viz.damagepath/plugin.xml b/cave/com.raytheon.uf.viz.damagepath/plugin.xml
index d79db21098..0400ef47d4 100644
--- a/cave/com.raytheon.uf.viz.damagepath/plugin.xml
+++ b/cave/com.raytheon.uf.viz.damagepath/plugin.xml
@@ -4,9 +4,9 @@
*
@@ -175,7 +176,7 @@ public class DamagePathLayer extends
Polygon polygon = PolygonUtil.makeDefaultPolygon(getResourceContainer()
.getActiveDisplayPane().getRenderableDisplay());
DrawablePolygon drawablePolygon = new DamagePathPolygon(polygon, this);
- polygons.add(0, drawablePolygon);
+ super.resetPolygons(Arrays.asList(drawablePolygon));
}
@Override
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathLoader.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathLoader.java
index 9c90cbbe8e..54409d5f96 100644
--- a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathLoader.java
+++ b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathLoader.java
@@ -26,7 +26,6 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -38,7 +37,6 @@ import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.feature.type.Name;
import com.raytheon.uf.common.json.JsonException;
-import com.raytheon.uf.common.json.geo.BasicJsonService;
import com.raytheon.uf.common.json.geo.GeoJsonMapUtil;
import com.raytheon.uf.common.json.geo.IGeoJsonService;
import com.raytheon.uf.common.json.geo.SimpleGeoJsonService;
@@ -47,7 +45,6 @@ import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.util.Pair;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.Polygon;
-import com.vividsolutions.jts.operation.valid.IsValidOp;
/**
* Loads a damage path GeoJSON-formatted file from either local disk or the
@@ -62,6 +59,10 @@ import com.vividsolutions.jts.operation.valid.IsValidOp;
* Jun 05, 2015 #4375 dgilling Initial creation
* Jun 18, 2015 #4354 dgilling Support FeatureCollections so each polygon
* can have its own properties.
+ * Jun 30, 2015 #4354 dgilling Remove unnecessary back compat code for
+ * 15.1 version of damage path tool.
+ * Jul 01, 2015 #4375 dgilling Remove isValid check to imported
+ * polygons.
*
*
*
@@ -71,12 +72,8 @@ import com.vividsolutions.jts.operation.valid.IsValidOp;
public final class DamagePathLoader {
- private static final String UNSUPPORTED_GEOJSON_TYPE = "Damage path file is unsupported GeoJSON object type %s. This tool only supports Feature and Geometry objects.";
-
private static final String UNSUPPORTED_GEOM_TYPE = "Damage path file contains invalid geometry type %s at geometry index %d. Must only contain Polygons.";
- private static final String INVALID_POLYGON = "Damage path file contains an invalid Polyon at index %d: %s";
-
private final Collection>> damagePathData;
public DamagePathLoader(LocalizationFile locFile)
@@ -119,85 +116,6 @@ public final class DamagePathLoader {
}
private void loadFromInputStream(final InputStream is) throws JsonException {
- Geometry deserializedGeom = null;
- Map deserializedProps = Collections.emptyMap();
- GeoJsonMapUtil geoJsonUtil = new GeoJsonMapUtil();
-
- /*
- * For compatibility with any users that may have an autosaved damage
- * path file from previous builds, we'll support deserializing Geometry,
- * Feature and FeatureCollection GeoJSON types.
- *
- * TODO: remove this code for code that just expects the file to always
- * be a FeatureCollection.
- */
- Map jsonObject = (Map) new BasicJsonService()
- .deserialize(is, LinkedHashMap.class);
- String geoJsonType = jsonObject.get(GeoJsonMapUtil.TYPE_KEY).toString();
- if (geoJsonType.equals(GeoJsonMapUtil.FEATURE_COLL_TYPE)) {
- FeatureCollection featureCollection = geoJsonUtil
- .populateFeatureCollection(jsonObject);
- populateDataFromFeatureCollection(featureCollection);
- return;
- } else if (geoJsonType.equals(GeoJsonMapUtil.FEATURE_TYPE)) {
- SimpleFeature feature = geoJsonUtil.populateFeature(jsonObject);
- deserializedGeom = (Geometry) feature.getDefaultGeometry();
-
- Name defaultGeomAttrib = feature.getDefaultGeometryProperty()
- .getName();
- deserializedProps = new LinkedHashMap<>();
- deserializedProps.put(GeoJsonMapUtil.ID_KEY, feature.getID());
- for (Property p : feature.getProperties()) {
- if (!defaultGeomAttrib.equals(p.getName())) {
- deserializedProps.put(p.getName().toString(), p.getValue()
- .toString());
- }
- }
- } else if (isGeometryType(geoJsonType)) {
- deserializedGeom = geoJsonUtil.populateGeometry(jsonObject);
- } else {
- throw new JsonException(String.format(UNSUPPORTED_GEOJSON_TYPE,
- geoJsonType));
- }
-
- int numGeometries = deserializedGeom.getNumGeometries();
- for (int i = 0; i < numGeometries; i++) {
- Geometry geomN = deserializedGeom.getGeometryN(i);
- if (geomN instanceof Polygon) {
- Polygon newPolygon = (Polygon) geomN;
- IsValidOp validator = new IsValidOp(newPolygon);
- if (validator.isValid()) {
- Pair> polygonAndProps = new Pair<>(
- newPolygon, deserializedProps);
- damagePathData.add(polygonAndProps);
- } else {
- throw new JsonException(String.format(INVALID_POLYGON, i,
- validator.getValidationError()));
- }
- } else {
- throw new JsonException(String.format(UNSUPPORTED_GEOM_TYPE,
- geomN.getGeometryType(), i));
- }
- }
- }
-
- private boolean isGeometryType(String geoJsonType) {
- return ((GeoJsonMapUtil.GEOM_COLL_TYPE.equals(geoJsonType))
- || (GeoJsonMapUtil.LINE_STR_TYPE.equals(geoJsonType))
- || (GeoJsonMapUtil.MULT_LINE_STR_TYPE.equals(geoJsonType))
- || (GeoJsonMapUtil.MULT_POINT_TYPE.equals(geoJsonType))
- || (GeoJsonMapUtil.MULT_POLY_TYPE.equals(geoJsonType))
- || (GeoJsonMapUtil.POINT_TYPE.equals(geoJsonType)) || (GeoJsonMapUtil.POLY_TYPE
- .equals(geoJsonType)));
- }
-
- /*
- * TODO: Replace loadFromInputStream with this method when we no longer
- * desire supporting the version 15.1 GeoJSON formatted damage path files.
- */
- @SuppressWarnings("unused")
- private void loadFromInputStreamFuture(final InputStream is)
- throws JsonException {
IGeoJsonService json = new SimpleGeoJsonService();
FeatureCollection featureCollection = json
.deserializeFeatureCollection(is);
@@ -215,12 +133,6 @@ public final class DamagePathLoader {
Geometry geom = (Geometry) feature.getDefaultGeometry();
if (geom instanceof Polygon) {
Polygon newPolygon = (Polygon) geom;
- IsValidOp validator = new IsValidOp(newPolygon);
- if (!validator.isValid()) {
- throw new JsonException(String.format(INVALID_POLYGON,
- featureIdx, validator.getValidationError()));
- }
-
Map properties = new LinkedHashMap<>();
Name defaultGeomAttrib = feature
.getDefaultGeometryProperty().getName();
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathPolygon.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathPolygon.java
index 4f40f2d835..51eb99bc96 100644
--- a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathPolygon.java
+++ b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathPolygon.java
@@ -23,7 +23,6 @@ import java.util.Collections;
import java.util.Map;
import com.raytheon.uf.viz.drawing.polygon.DrawablePolygon;
-import com.raytheon.uf.viz.drawing.polygon.PolygonLayer;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Polygon;
@@ -37,6 +36,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 18, 2015 #4354 dgilling Initial creation
+ * Jun 30, 2015 #4354 dgilling Force setProperties to trigger a save.
*
*
*
@@ -51,23 +51,23 @@ public class DamagePathPolygon extends DrawablePolygon {
private Map properties;
- public DamagePathPolygon(PolygonLayer> polygonLayer) {
- super(polygonLayer);
+ public DamagePathPolygon(DamagePathLayer> layer) {
+ super(layer);
this.properties = DEFAULT_PROPS;
}
- public DamagePathPolygon(Polygon polygon, PolygonLayer> polygonLayer) {
- this(polygon, DEFAULT_PROPS, polygonLayer);
+ public DamagePathPolygon(Polygon polygon, DamagePathLayer> layer) {
+ this(polygon, DEFAULT_PROPS, layer);
}
public DamagePathPolygon(Polygon polygon, Map properties,
- PolygonLayer> polygonLayer) {
- super(polygon, polygonLayer);
+ DamagePathLayer> layer) {
+ super(polygon, layer);
this.properties = properties;
}
- public DamagePathPolygon(Coordinate[] coords, PolygonLayer> polygonLayer) {
- super(coords, polygonLayer);
+ public DamagePathPolygon(Coordinate[] coords, DamagePathLayer> layer) {
+ super(coords, layer);
this.properties = DEFAULT_PROPS;
}
@@ -87,5 +87,6 @@ public class DamagePathPolygon extends DrawablePolygon {
public void setProperties(Map properties) {
this.properties = properties;
+ ((DamagePathLayer>) polygonLayer).scheduleSaveJob();
}
}
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathUtils.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathUtils.java
index e59ebebef3..2ccd6398c1 100644
--- a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathUtils.java
+++ b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/DamagePathUtils.java
@@ -19,67 +19,89 @@
**/
package com.raytheon.uf.viz.damagepath;
+import java.awt.geom.Point2D;
+import java.util.ArrayDeque;
import java.util.ArrayList;
+import java.util.Deque;
import java.util.List;
import javax.measure.converter.UnitConverter;
-import javax.measure.quantity.Length;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
-import javax.measure.unit.Unit;
import org.geotools.referencing.GeodeticCalculator;
import com.raytheon.uf.common.dataplugin.radar.RadarStation;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
-import com.raytheon.viz.awipstools.common.stormtrack.AbstractStormTrackResource;
-import com.raytheon.viz.awipstools.common.stormtrack.StormTrackState;
-import com.raytheon.viz.awipstools.common.stormtrack.StormTrackState.StormCoord;
+import com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer.Baseline;
import com.raytheon.viz.radar.util.StationUtils;
import com.vividsolutions.jts.geom.Coordinate;
-import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
-import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
/**
* Utility class for Damage Paths.
- *
+ *
*
- *
+ *
* SOFTWARE HISTORY
- *
+ *
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 23, 2015 3977 nabowle Initial creation
* Mar 26, 2015 3977 nabowle Limit distance to avoid polar errors. Log
* skipped points.
* Apr 01, 2015 3977 nabowle rename the status handler.
- *
+ * Jun 18, 2015 3977 nabowle Fix buffering. Renamed mehtods to
+ * specify that they're for Tornados.
+ * Jun 25, 2015 3977 nabowle Redo inner-point buffering for use with
+ * Interactive Baselines.
+ *
*
- *
+ *
* @author nabowle
* @version 1.0
*/
public class DamagePathUtils {
+ /**
+ * The number of degrees between points at the ends of a Tornado Damage Path
+ * Buffer.
+ */
+ private static final double END_DEGREE_DIFF = 30.0D;
+
+ /** Upper degree boundary to define a sharp angle. */
+ private static final double SHARP_ANGLE = 100;
+
+ /** Lower degree boundary when a sharp angle straddles 0 degrees. */
+ private static final double SHARP_ANGLE_INV = 360 - SHARP_ANGLE;
+
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(DamagePathUtils.class);
- /** The unit for the uncertainty algorithm. */
- private static Unit TARGET_UNIT = NonSI.MILE;
+ /** Convert miles for the algorithm to meters. */
+ private static UnitConverter TO_METERS = NonSI.MILE
+ .getConverterTo(SI.METER);
- /** Convert meters returned the GeodeticCalculator to the desired unit. */
- private static UnitConverter METERS_TO = SI.METER
- .getConverterTo(TARGET_UNIT);
+ /*
+ * Pre-convert algorithm constants to meters to prevent having to convert
+ * back and forth.
+ */
+ private static final double ONE_TENTH_MILE = TO_METERS.convert(0.1);
+
+ private static final double THREE_TENTHS_MILE = TO_METERS.convert(0.3);
+
+ private static final double FORTY_MILES = TO_METERS.convert(40.0);
+
+ private static final double EIGHTY_MILES = TO_METERS.convert(80.0);
/**
* Maximum distance of a point to the radar station to use when estimating a
- * damage path polygon. Any farther point will be ignored.
+ * damage path polygon. Any farther point will be ignored. Based on radar
+ * max extent
*/
- private static final double MAX_DISTANCE = NonSI.MILE.getConverterTo(
- TARGET_UNIT).convert(300.0); // Based on radar max extent
+ private static final double MAX_DISTANCE = TO_METERS.convert(300.0);
private DamagePathUtils() {
super();
@@ -87,129 +109,405 @@ public class DamagePathUtils {
/**
- * Estimates the damage path polygon for a storm track.
+ * Estimates a Tornado damage path polygon for a baseline.
*
- * @param stormTrack
- * The storm track to create a damage path for.
- * @return The estimated damage path polygon for a storm track.
+ * @param baseline
+ * The baseline to create a tornado damage path for.
+ * @return The estimated tornado damage path polygon for a baseline.
*/
- public static Polygon estimateDamagePath(
- AbstractStormTrackResource stormTrack) {
-
- StormTrackState stState = stormTrack.getStormTrackState();
+ public static Polygon estimateTornadoDamagePath(Baseline baseline) {
+ Coordinate[] coords = baseline.line.getCoordinates();
RadarStation station = StationUtils.getInstance().getHomeRadarStation();
GeometryFactory gf = new GeometryFactory();
- List skippedCoords = new ArrayList<>();
- Geometry damagePathBuffer = createBuffer(stState.timePoints, station,
- gf, null, skippedCoords);
- damagePathBuffer = createBuffer(stState.futurePoints, station, gf,
- damagePathBuffer, skippedCoords);
+ List skippedCoords = new ArrayList<>();
+ List validCoords = new ArrayList<>();
+ GeodeticCalculator gc = new GeodeticCalculator();
+ filterCoords(coords, station, skippedCoords, validCoords,
+ gc);
if (!skippedCoords.isEmpty()) {
StringBuilder sb = new StringBuilder();
- sb.append("Skipped the following Storm Coordinates because they ")
+ sb.append(
+ "Skipped the following Coordinates for Baseline "
+ + baseline.name + " because they ")
.append("are out of range of the radar station. ");
- for (StormTrackState.StormCoord coord : skippedCoords) {
- sb.append("(").append(coord.time.toString()).append(", ")
- .append(coord.coord.x).append(", ")
- .append(coord.coord.y).append(") ");
+ for (Coordinate coord : skippedCoords) {
+ sb.append("(").append(coord.x).append(", ").append(coord.y)
+ .append(") ");
}
statusHandler.info(sb.toString());
}
- /*
- * user likely tried to import before creating track or entire track is
- * outside of the max range.
- */
- if (damagePathBuffer == null) {
+ if (validCoords.isEmpty()) {
String suggestion;
if (skippedCoords.isEmpty()) {
- suggestion = "Make sure the storm track is initialized.";
+ suggestion = "Make sure the baseline is initialized.";
} else {
- suggestion = "Make sure the storm track is within range of the radar station.";
+ suggestion = "Make sure the baseline is within range of the radar station.";
}
statusHandler
- .warn("Could not create a Damage Path polygon for the storm track. "
- + suggestion);
+ .warn("Could not create a Damage Path polygon for Baseline "
+ + baseline.name + ". " + suggestion);
return null;
}
- Polygon polygon = gf.createPolygon(damagePathBuffer.convexHull()
- .getCoordinates());
+ Coordinate[] damagePathCoords = createTornadoBuffer(validCoords, station, gc,
+ gf);
+
+ Polygon polygon = gf.createPolygon(damagePathCoords);
return polygon;
}
/**
- * Creates a buffers a buffer around the storm coordinates. If
- * damagePathBuffer is non null, the created buffer will be the union of the
- * two buffers.
+ * Filter the coordinates based on their range to the given radar station.
*
* @param stormCoords
- * The storm track coordinates.
+ * The coordinates.
* @param station
- * The station to base distance on.
- * @param gf
- * The geometry factory.
- * @param damagePathBuffer
- * The current damage path buffer. May be null.
- * @param farCoords
- * The list to add any skipped coordinates to.
- * @return The created buffer. If damagePathBuffer is not null, the created
- * buffer will included damagePathBuffer.
+ * The radar station.
+ * @param skippedCoords
+ * A list where coordinates that are out of range of the station
+ * will be added to.
+ * @param validCoords
+ * A list where coordinates that are in range of the station will
+ * be added to.
+ * @param gc
+ * A GeodeticCalculator.
*/
- private static Geometry createBuffer(
- StormTrackState.StormCoord[] stormCoords, RadarStation station,
- GeometryFactory gf, Geometry damagePathBuffer,
- List farCoords) {
- if (stormCoords == null || stormCoords.length == 0) {
- return damagePathBuffer;
- }
+ private static void filterCoords(Coordinate[] stormCoords,
+ RadarStation station, List skippedCoords,
+ List validCoords, GeodeticCalculator gc) {
+ Coordinate stormCoord;
+ double distance;
+ if (stormCoords != null) {
+ for (int i = 0; i < stormCoords.length; i++) {
+ stormCoord = stormCoords[i];
+ gc.setStartingGeographicPoint(stormCoord.x, stormCoord.y);
+ gc.setDestinationGeographicPoint(station.getLon(),
+ station.getLat());
+ distance = gc.getOrthodromicDistance();
- GeodeticCalculator gc = new GeodeticCalculator();
- Point point;
- Geometry buffer;
- double distanceMeters; // distance in meters
- double distance; // distance in the desired unit
+ if (distance > MAX_DISTANCE) {
+ skippedCoords.add(stormCoords[i]);
+ } else {
+ validCoords.add(stormCoords[i]);
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates a buffer around the line defined by the storm coordinates using
+ * Doug Speheger's tornado damage path algorithm.
+ *
+ * @param stormCoords
+ * The storm coordinates to create a damage path around.
+ * @param station
+ * The radar station to use.
+ * @param gc
+ * A GeodeticCalculator.
+ * @param gf
+ * A GeometryFactory.
+ * @return A Geometry representing an estimated Tornado Damage Path for the
+ * given storm coordinates. If the no coordinates are provided, null
+ * is returned.
+ */
+ private static Coordinate[] createTornadoBuffer(List stormCoords,
+ RadarStation station, GeodeticCalculator gc, GeometryFactory gf) {
+ // left hand side points
+ List lhsPoints = new ArrayList<>();
+ // right hand side points
+ Deque rhsPoints = new ArrayDeque<>();
double uncertainty;
Coordinate stormCoord;
- for (int i = 0; i < stormCoords.length; i++) {
- stormCoord = stormCoords[i].coord;
- gc.setStartingGeographicPoint(stormCoord.x, stormCoord.y);
- gc.setDestinationGeographicPoint(station.getLon(), station.getLat());
- distanceMeters = gc.getOrthodromicDistance();
- distance = METERS_TO.convert(distanceMeters);
+ /* Create a concave hull for a linear set of coordinates. */
+ for (int i = 0; i < stormCoords.size(); i++) {
+ stormCoord = stormCoords.get(i);
+ uncertainty = calculateUncertainty(station, gc, stormCoord);
- if (distance > MAX_DISTANCE) {
- farCoords.add(stormCoords[i]);
- continue;
+ if (stormCoords.size() == 1) {
+ /*
+ * In the case that there's only one coordinate, draw a circle
+ * around the point and break out.
+ */
+ for (double d = -180; d < 180; d += END_DEGREE_DIFF) {
+ gc.setDirection(d, uncertainty);
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+ }
+ break;
}
- /*
- * Based off of research done by Doug Speheger comparing surveyed
- * tornado paths to manually identified radar tornadic vortex
- * signatures in 2008-2012. In the initial dataset, 87% of tornadoes
- * were within this range of uncertainty.
- */
- if (distance < 40.0) {
- uncertainty = 0.3 + distance * 0.005;
- } else if (distance < 80.0) {
- uncertainty = 0.1 + distance * 0.01;
+ if (i == 0) {
+ createStartCap(stormCoords, gc, lhsPoints, uncertainty, i);
+ } else if (i < stormCoords.size() - 1) {
+ bufferInnerPoint(stormCoord, stormCoords, gc, lhsPoints,
+ rhsPoints, uncertainty, i, station);
} else {
- uncertainty = distance * 0.015 - 0.3;
+ createEndCap(stormCoords, gc, rhsPoints, uncertainty, i);
}
- point = gf.createPoint(stormCoord);
- buffer = point.buffer(uncertainty);
- if (damagePathBuffer == null) {
- damagePathBuffer = buffer;
- } else {
- damagePathBuffer = damagePathBuffer.union(buffer);
- }
}
- return damagePathBuffer;
+ lhsPoints.addAll(rhsPoints);
+
+ Coordinate[] coordinates = new Coordinate[lhsPoints.size() + 1];
+ Point2D point;
+ for (int i = 0; i < lhsPoints.size(); i++) {
+ point = lhsPoints.get(i);
+ coordinates[i] = new Coordinate(point.getX(), point.getY());
+ }
+ coordinates[coordinates.length - 1] = coordinates[0];
+
+ return coordinates;
+ }
+
+
+ /**
+ * Based off of research done by Doug Speheger comparing surveyed tornado
+ * paths to manually identified radar tornadic vortex signatures in
+ * 2008-2012. In the initial dataset, 87% of tornadoes were within this
+ * range of uncertainty.
+ *
+ * Note: All units are in meters. Constants have been pre-converted from
+ * miles to meters.
+ *
+ * @param station
+ * @param gc
+ * @param coord
+ * @return
+ */
+ private static double calculateUncertainty(RadarStation station,
+ GeodeticCalculator gc, Coordinate coord) {
+ gc.setStartingGeographicPoint(coord.x, coord.y);
+ gc.setDestinationGeographicPoint(station.getLon(), station.getLat());
+ double distance = gc.getOrthodromicDistance();
+
+ double uncertainty;
+ if (distance < FORTY_MILES) {
+ uncertainty = THREE_TENTHS_MILE + distance * 0.005;
+ } else if (distance < EIGHTY_MILES) {
+ uncertainty = ONE_TENTH_MILE + distance * 0.01;
+ } else {
+ uncertainty = distance * 0.015 - THREE_TENTHS_MILE;
+ }
+ return uncertainty;
+ }
+
+ /**
+ * Creates a buffer around a non-end point. If the path is on a generally
+ * straight path, just create two points on opposite sides of the path
+ * point. If the path coordinate is the vertex of an angle is sharp, create
+ * a couple points around the outside of the angle and create a single point
+ * on the inside that's uncertainty-meters from the point and both lines
+ * creating the angle.
+ *
+ * @param stormCoord
+ * @param stormCoords
+ * @param gc
+ * @param lhsPoints
+ * @param rhsPoints
+ * @param uncertainty
+ * @param i
+ * @param station
+ */
+ private static void bufferInnerPoint(Coordinate stormCoord,
+ List stormCoords, GeodeticCalculator gc,
+ List lhsPoints, Deque rhsPoints,
+ double uncertainty, int i, RadarStation station) {
+ gc.setStartingGeographicPoint(stormCoord.x, stormCoord.y);
+
+ Coordinate nextCoord = stormCoords.get(i + 1);
+ gc.setDestinationGeographicPoint(nextCoord.x, nextCoord.y);
+ double azimuthToNext = nonNegativeAzimuth(gc.getAzimuth());
+
+ Coordinate prevCoord = stormCoords.get(i - 1);
+ gc.setDestinationGeographicPoint(prevCoord.x, prevCoord.y);
+ double azimuthToPrev = nonNegativeAzimuth(gc.getAzimuth());
+
+ double angle = Math.abs(azimuthToPrev - azimuthToNext);
+ boolean sharpAngle = (angle <= SHARP_ANGLE && angle > 0)
+ || (angle >= SHARP_ANGLE_INV && angle < 360);
+
+ if (sharpAngle) {
+ boolean rhsOnInside = angle <= SHARP_ANGLE ? azimuthToNext < azimuthToPrev
+ : azimuthToPrev < azimuthToNext;
+ double bisectionAngle = Math
+ .toRadians(angle >= SHARP_ANGLE_INV ? (360.0 - angle) / 2
+ : angle / 2);
+
+ gc.setDirection(geodeticAzimuth(azimuthToNext + 180), uncertainty);
+ if (rhsOnInside) {
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+
+ createOpposingPoints(stormCoord, gc, lhsPoints,
+ new ArrayDeque(), uncertainty, azimuthToNext,
+ azimuthToPrev);
+ double innerUncertainty = Math.abs(uncertainty
+ / Math.sin(bisectionAngle));
+ if (innerUncertainty < uncertainty) {
+ innerUncertainty = uncertainty;
+ }
+ createOpposingPoints(stormCoord, gc, new ArrayList(),
+ rhsPoints, innerUncertainty, azimuthToNext,
+ azimuthToPrev);
+
+ gc.setDirection(geodeticAzimuth(azimuthToPrev + 180),
+ uncertainty);
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+
+ } else {
+ rhsPoints.push(gc.getDestinationGeographicPoint());
+
+ createOpposingPoints(stormCoord, gc, new ArrayList(),
+ rhsPoints, uncertainty, azimuthToNext, azimuthToPrev);
+ double innerUncertainty = Math.abs(uncertainty
+ / Math.sin(bisectionAngle));
+ if (innerUncertainty < uncertainty) {
+ innerUncertainty = uncertainty;
+ }
+ createOpposingPoints(stormCoord, gc, lhsPoints,
+ new ArrayDeque(), innerUncertainty,
+ azimuthToNext, azimuthToPrev);
+
+ gc.setDirection(geodeticAzimuth(azimuthToPrev + 180),
+ uncertainty);
+ rhsPoints.push(gc.getDestinationGeographicPoint());
+ }
+ } else {
+ createOpposingPoints(stormCoord, gc, lhsPoints, rhsPoints, uncertainty,
+ azimuthToNext, azimuthToPrev);
+ }
+ }
+
+ /**
+ * Create two points at 180 degrees from each other on the imaginary line
+ * that bisects the angle created at this point.
+ *
+ * @param coord
+ * @param gc
+ * @param lhsPoints
+ * @param rhsPoints
+ * @param uncertainty
+ * @param azimuthToNext
+ * @param azimuthToPrev
+ */
+ private static void createOpposingPoints(Coordinate coord,
+ GeodeticCalculator gc,
+ List lhsPoints, Deque rhsPoints,
+ double uncertainty, double azimuthToNext, double azimuthToPrev) {
+ gc.setStartingGeographicPoint(coord.x, coord.y);
+ double pointAzimuth = geodeticAzimuth(Math.min(azimuthToNext,
+ azimuthToPrev)
+ + Math.abs(azimuthToPrev - azimuthToNext) / 2);
+
+ if (azimuthToNext <= azimuthToPrev) {
+ pointAzimuth = geodeticAzimuth(pointAzimuth + 180);
+ }
+
+ gc.setDirection(pointAzimuth, uncertainty);
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+
+ pointAzimuth = geodeticAzimuth(pointAzimuth + 180);
+
+ gc.setDirection(pointAzimuth, uncertainty);
+ rhsPoints.push(gc.getDestinationGeographicPoint());
+ }
+
+
+ /**
+ * Create's a curved half-circle buffer around the starting coordinate.
+ *
+ * @param stormCoords
+ * @param gc
+ * @param lhsPoints
+ * @param uncertainty
+ * @param i
+ */
+ private static void createStartCap(List stormCoords,
+ GeodeticCalculator gc, List lhsPoints, double uncertainty,
+ int i) {
+ Coordinate nextCoord = stormCoords.get(i + 1);
+ gc.setDestinationGeographicPoint(nextCoord.x, nextCoord.y);
+ double azimuthToNext = gc.getAzimuth();
+
+ double pointAzimuth = geodeticAzimuth(azimuthToNext + 90);
+ gc.setDirection(pointAzimuth, uncertainty);
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+
+ for (double d = END_DEGREE_DIFF; d <= 180; d += END_DEGREE_DIFF) {
+ pointAzimuth = geodeticAzimuth(pointAzimuth + END_DEGREE_DIFF);
+ gc.setDirection(pointAzimuth, uncertainty);
+ lhsPoints.add(gc.getDestinationGeographicPoint());
+ }
+ }
+
+ /**
+ * Create's a curved half-circle buffer around the ending coordinate.
+ *
+ * @param stormCoords
+ * @param gc
+ * @param rhsPoints
+ * @param uncertainty
+ * @param i
+ */
+ private static void createEndCap(List stormCoords,
+ GeodeticCalculator gc, Deque rhsPoints,
+ double uncertainty, int i) {
+ Coordinate prevCoord = stormCoords.get(i - 1);
+ gc.setDestinationGeographicPoint(prevCoord.x, prevCoord.y);
+ double azimuthToPrev = gc.getAzimuth();
+
+ double pointAzimuth = geodeticAzimuth(azimuthToPrev - 90);
+ gc.setDirection(pointAzimuth, uncertainty);
+ rhsPoints.push(gc.getDestinationGeographicPoint());
+
+ for (double d = END_DEGREE_DIFF; d <= 180; d += END_DEGREE_DIFF) {
+ pointAzimuth = geodeticAzimuth(pointAzimuth - END_DEGREE_DIFF);
+ gc.setDirection(pointAzimuth, uncertainty);
+ rhsPoints.push(gc.getDestinationGeographicPoint());
+ }
+ }
+
+ /**
+ * Clamps the azimuth to [-180, 180] for use with the GeodeticCalculator.
+ *
+ * @param azimuth
+ * The azimuth.
+ * @return An equivalent azimuth in [-180, 180].
+ */
+ private static double geodeticAzimuth(double azimuth) {
+ double az = azimuth;
+ while (az < -180.0) {
+ az += 360.0;
+ }
+
+ while (az > 180.0) {
+ az -= 360.0;
+ }
+
+ return az;
+ }
+
+ /**
+ * Clamps the azimuth to [0, 360] to simplify the azimath.
+ *
+ * @param azimuth
+ * The azimuth.
+ * @return An equivalent azimuth in [0, 360].
+ */
+ private static double nonNegativeAzimuth(double azimuth) {
+ double az = azimuth;
+ while (az < 0) {
+ az += 360.0;
+ }
+
+ while (az > 360.0) {
+ az -= 360.0;
+ }
+
+ return az;
}
}
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/ImportFromDistanceSpeedAction.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/ImportFromDistanceSpeedAction.java
deleted file mode 100644
index e026096497..0000000000
--- a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/ImportFromDistanceSpeedAction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.viz.damagepath;
-
-import com.raytheon.uf.common.status.IUFStatusHandler;
-import com.raytheon.uf.common.status.UFStatus;
-import com.raytheon.uf.viz.core.VizApp;
-import com.raytheon.uf.viz.core.drawables.ResourcePair;
-import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
-import com.raytheon.uf.viz.core.rsc.ResourceList;
-import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
-import com.raytheon.viz.awipstools.ui.layer.DistanceSpeedLayer;
-import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
-import com.vividsolutions.jts.geom.Polygon;
-
-/**
- * Action to create a damage path from a DistanceSpeedLayer.
- *
- *
- *
- * SOFTWARE HISTORY
- *
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Mar 23, 2015 3977 nabowle Initial creation
- * Jun 01, 2015 3975 dgilling Update for DamageLayer changes for
- * multiple polygon support.
- * Jun 18, 2015 4354 dgilling Update isEnabled to consider editable
- * capability.
- *
- *
- *
- * @author nabowle
- * @version 1.0
- */
-
-public class ImportFromDistanceSpeedAction extends AbstractRightClickAction {
-
- protected static final transient IUFStatusHandler statusHandler = UFStatus
- .getHandler(ImportFromDistanceSpeedAction.class);
-
- public ImportFromDistanceSpeedAction() {
- super("New from Distance Speed Tool");
- }
-
- @Override
- public void run() {
- VizApp.runSync(new Runnable() {
- @Override
- public void run() {
- DamagePathLayer> layer = (DamagePathLayer>) getSelectedRsc();
- DistanceSpeedLayer dsLayer = findImportLayer(layer);
-
- // The Distance Speed tool has not been loaded.
- if (dsLayer == null) {
- return;
- }
-
- Polygon polygon = DamagePathUtils.estimateDamagePath(dsLayer);
-
- if (polygon != null) {
- layer.addPolygon(polygon.getExteriorRing().getCoordinates());
- }
- }
- });
- }
-
- /**
- * Returns true iff super.isEnabled() is true and the DistanceSpeed tool is
- * loaded, false otherwise.
- */
- @Override
- public boolean isEnabled() {
- AbstractVizResource, ?> rsc = getSelectedRsc();
- boolean enabled = rsc.getCapability(EditableCapability.class)
- .isEditable();
- if (enabled) {
- if (rsc != null) {
- enabled = findImportLayer(rsc) != null;
- }
- }
- return enabled;
- }
-
- /**
- * Finds the DistanceSpeedLayer.
- *
- * @param rsc
- * The current resource
- * @return The found DistanceSpeedLayer, or null if the tool is not loaded.
- */
- private DistanceSpeedLayer findImportLayer(AbstractVizResource, ?> rsc) {
- ResourceList resources = rsc.getDescriptor().getResourceList();
- for (ResourcePair rp : resources) {
- if (rp.getResource() instanceof DistanceSpeedLayer) {
- return (DistanceSpeedLayer) rp.getResource();
- }
- }
- return null;
- }
-}
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/NewTornadoDamagePathAction.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/NewTornadoDamagePathAction.java
new file mode 100644
index 0000000000..6d66f7b9c8
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/NewTornadoDamagePathAction.java
@@ -0,0 +1,220 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.damagepath;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+
+import com.raytheon.uf.common.status.IUFStatusHandler;
+import com.raytheon.uf.common.status.UFStatus;
+import com.raytheon.uf.viz.core.VizApp;
+import com.raytheon.uf.viz.core.drawables.ResourcePair;
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.ResourceList;
+import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
+import com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer;
+import com.raytheon.viz.awipstools.ui.layer.InteractiveBaselinesLayer.Baseline;
+import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
+import com.vividsolutions.jts.geom.Polygon;
+
+/**
+ * Action to create a tornado damage path from an InteractiveBaselineLayer.
+ *
+ * Adds a menu item to the DamagePath's legend right-click menu which has a
+ * submenu to select one of the available baselines.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 23, 2015 3977 nabowle Initial creation
+ * Jun 01, 2015 3975 dgilling Update for DamageLayer changes for
+ * multiple polygon support.
+ * Jun 18, 2015 4354 dgilling Update isEnabled to consider editable
+ * capability.
+ * Jun 19, 2015 3977 nabowle Specify Tornado Path.
+ * Jun 23, 2015 3977 nabowle Switch to InteractiveBaselineLayer.
+ * Renamed from ImportFromDistanceSpeedAction.
+ *
+ *
+ * @author nabowle
+ * @version 1.0
+ */
+
+public class NewTornadoDamagePathAction extends AbstractRightClickAction
+ implements IMenuCreator {
+
+ protected static final transient IUFStatusHandler statusHandler = UFStatus
+ .getHandler(NewTornadoDamagePathAction.class);
+
+ private Menu menu;
+
+ public NewTornadoDamagePathAction() {
+ super("New Tornado Path from Baseline", SWT.DROP_DOWN);
+ }
+
+ @Override
+ public Menu getMenu(Control parent) {
+ if (menu != null) {
+ menu.dispose();
+ }
+
+ menu = new Menu(parent);
+ createMenu(menu);
+
+ return menu;
+ }
+
+ @Override
+ public void dispose() {
+ if (menu != null) {
+ menu.dispose();
+ }
+ }
+
+ @Override
+ public Menu getMenu(Menu parent) {
+ if (menu != null) {
+ menu.dispose();
+ }
+
+ createMenu(parent);
+
+ return menu;
+ }
+
+ @Override
+ public IMenuCreator getMenuCreator() {
+ return this;
+ }
+
+ /**
+ * Creates a submenu with every displayed baseline, listed in alphabetical
+ * order.
+ *
+ * @param parent
+ */
+ private void createMenu(Menu parent) {
+ menu = new Menu(parent);
+ InteractiveBaselinesLayer ibl = findImportLayer(getSelectedRsc());
+ if (ibl == null || ibl.getCurrentBaselines() == null) {
+ return;
+ }
+ List baselines = new ArrayList<>(Arrays.asList(ibl
+ .getCurrentBaselines()));
+ Collections.sort(baselines, new Comparator() {
+ @Override
+ public int compare(Baseline b1, Baseline b2) {
+ return b1.name.compareTo(b2.name);
+ }
+ });
+
+ for (Baseline baseline : baselines) {
+ ActionContributionItem aci = new ActionContributionItem(
+ new ImportFromBaselineInternalAction(baseline));
+ aci.fill(menu, -1);
+ }
+ }
+
+
+ @Override
+ public boolean isEnabled() {
+ AbstractVizResource, ?> rsc = getSelectedRsc();
+ boolean enabled = rsc.getCapability(EditableCapability.class)
+ .isEditable();
+ if (enabled) {
+ if (rsc != null) {
+ enabled = findImportLayer(rsc) != null;
+ }
+ }
+ return enabled;
+ }
+
+ /**
+ * Finds the import layer.
+ *
+ * @param rsc
+ * The current resource
+ * @return The found import layer, or null if the tool is not loaded.
+ */
+ private InteractiveBaselinesLayer findImportLayer(
+ AbstractVizResource, ?> rsc) {
+ ResourceList resources = rsc.getDescriptor().getResourceList();
+ for (ResourcePair rp : resources) {
+ if (rp.getResource() instanceof InteractiveBaselinesLayer) {
+ return (InteractiveBaselinesLayer) rp.getResource();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Submenu actions for each available baseline.
+ *
+ * Each action is created with one of the available baselines, which when
+ * run will generate a Tornado damage path for that baseline.
+ */
+ private class ImportFromBaselineInternalAction extends Action {
+ final Baseline baseline;
+
+ public ImportFromBaselineInternalAction(Baseline line) {
+ super(line.name, Action.AS_PUSH_BUTTON);
+ this.baseline = line;
+ }
+
+ @Override
+ public void run() {
+ VizApp.runSync(new Runnable() {
+ @Override
+ public void run() {
+ DamagePathLayer> layer = (DamagePathLayer>) getSelectedRsc();
+
+ Polygon polygon = DamagePathUtils
+ .estimateTornadoDamagePath(baseline);
+
+ if (polygon != null) {
+ layer.addPolygon(polygon.getExteriorRing()
+ .getCoordinates());
+ }
+ }
+ });
+
+ getContainer().refresh();
+ }
+
+ @Override
+ public String getText() {
+ return baseline.name;
+ }
+
+ }
+}
diff --git a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/OpenGeoJsonPropertiesDlgAction.java b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/OpenGeoJsonPropertiesDlgAction.java
index e74b260faf..ddfdf7bfbc 100644
--- a/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/OpenGeoJsonPropertiesDlgAction.java
+++ b/cave/com.raytheon.uf.viz.damagepath/src/com/raytheon/uf/viz/damagepath/OpenGeoJsonPropertiesDlgAction.java
@@ -41,6 +41,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jun 09, 2015 #4355 dgilling Rename action for UI.
* Jun 18, 2015 #4354 dgilling Allow individual properties object for
* each polygon.
+ * Jun 30, 2015 #4354 dgilling Fix NullPointerException.
*
*
*
@@ -65,7 +66,6 @@ public class OpenGeoJsonPropertiesDlgAction extends AbstractRightClickAction {
Shell shell = VizWorkbenchManager.getInstance()
.getCurrentWindow().getShell();
- final DamagePathLayer> layer = (DamagePathLayer>) getSelectedRsc();
final Map geoJsonProps = damagePath
.getProperties();
EditGeoJsonPropertiesDlg dlg = new EditGeoJsonPropertiesDlg(
@@ -78,7 +78,6 @@ public class OpenGeoJsonPropertiesDlgAction extends AbstractRightClickAction {
&& (!geoJsonProps.equals(returnValue))) {
Map updatedProperties = (Map) returnValue;
damagePath.setProperties(updatedProperties);
- layer.scheduleSaveJob();
}
}
});
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/DIRC.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/DIRC.xml
deleted file mode 100644
index ee280da415..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/DIRC.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml
deleted file mode 100644
index 688297a9d2..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/LTNG.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXDVV.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXDVV.xml
deleted file mode 100644
index be8fa65f36..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXDVV.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml
deleted file mode 100644
index b0d7bcd510..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXREF.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml
deleted file mode 100644
index fc076df656..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUPHL.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUVV.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUVV.xml
deleted file mode 100644
index a102178086..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/MXUVV.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/OGRD.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/OGRD.xml
deleted file mode 100644
index 76c03bf1af..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/OGRD.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/SPC.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/SPC.xml
deleted file mode 100644
index b1062e53fc..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/SPC.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml
deleted file mode 100644
index c86c8edbb4..0000000000
--- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/WGS1hr.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/polygon/DrawablePolygon.java b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/polygon/DrawablePolygon.java
index 24520599c4..9c90266772 100644
--- a/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/polygon/DrawablePolygon.java
+++ b/cave/com.raytheon.uf.viz.drawing/src/com/raytheon/uf/viz/drawing/polygon/DrawablePolygon.java
@@ -51,6 +51,8 @@ import com.vividsolutions.jts.geom.Polygon;
* ------------ ---------- ----------- --------------------------
* May 27, 2015 #4375 dgilling Initial creation
* Jun 18, 2015 #4354 dgilling Correct behavior of project.
+ * Jun 30, 2015 #4354 dgilling Make PolygonLayer visible to
+ * subclasses.
*
*
*
@@ -69,7 +71,10 @@ public class DrawablePolygon implements IRenderable2 {
private final Object lock;
- private final PolygonLayer> polygonLayer;
+ /**
+ * The PolygonLayer this polygon is attached to.
+ */
+ protected final PolygonLayer> polygonLayer;
public DrawablePolygon(PolygonLayer> polygonLayer) {
this.lock = new Object();
diff --git a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/DeleteAction.java b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/DeleteAction.java
index 52bfc0fb4a..70f69dc755 100644
--- a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/DeleteAction.java
+++ b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/DeleteAction.java
@@ -54,6 +54,7 @@ import com.raytheon.uf.viz.localization.perspective.editor.LocalizationEditorInp
* ------------ ---------- ----------- --------------------------
* Nov 3, 2010 mschenke Initial creation
* Feb 18, 2015 4132 mapeters Fixed issue with deleting overrides.
+ * Jun 29, 2015 946 rferrel Do not allow delete of a protected level file.
*
*
*
@@ -216,6 +217,10 @@ public class DeleteAction extends Action {
canDelete = false;
break;
}
+ if (file.isProtected() && file.getProtectedLevel().equals(level)) {
+ canDelete = false;
+ break;
+ }
}
return canDelete;
}
diff --git a/cave/com.raytheon.uf.viz.product.alertviz/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.product.alertviz/META-INF/MANIFEST.MF
index 8bd0f1d0e2..d6c3567ca3 100644
--- a/cave/com.raytheon.uf.viz.product.alertviz/META-INF/MANIFEST.MF
+++ b/cave/com.raytheon.uf.viz.product.alertviz/META-INF/MANIFEST.MF
@@ -14,3 +14,4 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.raytheon.uf.common.message
Export-Package: com.raytheon.uf.viz.product.alertviz
+Bundle-Localization: plugin
diff --git a/cave/com.raytheon.uf.viz.product.alertviz/build.properties b/cave/com.raytheon.uf.viz.product.alertviz/build.properties
index e9863e281e..0dc34f7833 100644
--- a/cave/com.raytheon.uf.viz.product.alertviz/build.properties
+++ b/cave/com.raytheon.uf.viz.product.alertviz/build.properties
@@ -2,4 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ plugin.properties
diff --git a/cave/com.raytheon.uf.viz.product.alertviz/plugin.properties b/cave/com.raytheon.uf.viz.product.alertviz/plugin.properties
new file mode 100644
index 0000000000..7c11021eec
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.product.alertviz/plugin.properties
@@ -0,0 +1 @@
+caveVersion=DEVELOPMENT
\ No newline at end of file
diff --git a/cave/com.raytheon.uf.viz.product.alertviz/plugin.xml b/cave/com.raytheon.uf.viz.product.alertviz/plugin.xml
index 93d10fa41a..9184b6109b 100644
--- a/cave/com.raytheon.uf.viz.product.alertviz/plugin.xml
+++ b/cave/com.raytheon.uf.viz.product.alertviz/plugin.xml
@@ -42,6 +42,9 @@
name="appName"
value="alertviz">
+
diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/build.properties b/cave/com.raytheon.uf.viz.thinclient.cave/build.properties
index 43d52e27ca..aae76abb0a 100644
--- a/cave/com.raytheon.uf.viz.thinclient.cave/build.properties
+++ b/cave/com.raytheon.uf.viz.thinclient.cave/build.properties
@@ -2,5 +2,6 @@ output.com.raytheon.uf.viz.thinclient.cave.jar = bin/
bin.includes = META-INF/,\
plugin.xml,\
ThinClientPluginBlacklist.txt,\
- com.raytheon.uf.viz.thinclient.cave.jar
+ com.raytheon.uf.viz.thinclient.cave.jar,\
+ logback-viz-thinclient.xml
source.com.raytheon.uf.viz.thinclient.cave.jar = src/
diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/ThinClientComponent.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/ThinClientComponent.java
index 82472b50b8..98d6a39fd9 100644
--- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/ThinClientComponent.java
+++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/ThinClientComponent.java
@@ -27,9 +27,11 @@ import java.util.List;
import org.eclipse.jface.preference.IPreferenceStore;
import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
import com.raytheon.uf.common.comm.HttpClient;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
+import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@@ -72,6 +74,7 @@ import com.raytheon.viz.ui.personalities.awips.CAVE;
* Nov 06, 2014 3356 njensen Always initialize ILocalizationAdapter
* in case cache preference is not enabled
* Feb 23, 2015 4164 dlovely Call AlertViz initialize.
+ * Jun 26, 2015 4474 bsteffen Register the PathManager as an OSGi service.
*
*
*
@@ -185,6 +188,11 @@ public class ThinClientComponent extends CAVE implements IThinClientComponent {
statusHandler.handle(Priority.CRITICAL,
"Error setting up localization", e1);
}
+ FrameworkUtil
+ .getBundle(getClass())
+ .getBundleContext()
+ .registerService(IPathManager.class,
+ PathManagerFactory.getPathManager(), null);
}
/*
diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java
index 7382bed6d4..bdd975ed7d 100644
--- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java
+++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/EditorTafTabComp.java
@@ -25,7 +25,6 @@ import java.util.HashMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ExtendedModifyEvent;
import org.eclipse.swt.custom.ExtendedModifyListener;
-import org.eclipse.swt.custom.ST;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.DisposeEvent;
@@ -75,6 +74,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
* 1/17/2011 7782 rferrel Added qcSkipCheck to mimic A1.
* 3/18/2011 7888 rferrel Added getLargeTF method.
* 02/19/2014 16980 zhao added getter and setter for the Alt flag
+ * 06/27/2015 4588 skorolev Removed unnecessary insert toggle.
*
*
*
@@ -380,22 +380,6 @@ public class EditorTafTabComp extends Composite {
createCaretImage(insertWidth, size.y);
caret.setImage(caretImage);
tafEditorTxt.setCaret(caret);
-
- /*
- * NOTE:
- *
- * The following code sets the TOGGLE_OVERWRITE for the text editor in
- * the editor tabs. In the TafViewerEditorDlg, after the controls are
- * initialized it is also set (if insert is false). Removing this code
- * or the code in the TafViewerEditorDlg will cause the text editor
- * control to not insert/overwrite properly. I do not understand why
- * this is but that is why I am documenting this. This may be fixed in
- * the future. --- L. Venable
- */
- if (configMgr.getResourceAsBoolean(ResourceTag.Insert) == false) {
- tafEditorTxt.invokeAction(ST.TOGGLE_OVERWRITE);
- }
-
tafEditorTxt.addMouseListener(new MouseAdapter() {
@Override
@@ -1370,11 +1354,11 @@ public class EditorTafTabComp extends Composite {
corRdo.setEnabled(editable);
}
- public boolean getAlt() {
- return alt;
- }
+ public boolean getAlt() {
+ return alt;
+ }
- public void setAlt(boolean b) {
- alt = b;
- }
+ public void setAlt(boolean b) {
+ alt = b;
+ }
}
diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java
index 4db3ec5928..9ff076bcd1 100644
--- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java
+++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java
@@ -52,7 +52,6 @@ import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseAdapter;
@@ -241,7 +240,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* 08/13/2014 3497 njensen Refactored syntax checking to prevent potential infinite loop
* 12/02/2014 #15007 zhao Added restoreFrom() for the "Restore From..." menu option
- * 04/07/2015 17332 zhao Added code to handle case of "Cancel" in "Restore From..."
+ * 04/07/2015 17332 zhao Added code to handle case of "Cancel" in "Restore From..."
+ * 06/23/2015 2282 skorolev Corrected "CLEAR" case in updateSettings.
+ * 06/26/2015 4588 skorolev Fixed Insert/Overwrite issue.
*
*
*
@@ -427,11 +428,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
*/
private Color fltCatFontColor;
- /**
- * Flag indicating if the editor is in overwrite mode.
- */
- private boolean overwriteMode = false;
-
/**
* Indicator of viewer tab selected.
*/
@@ -450,7 +446,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
/**
* The list of Viewer tabs configured for display.
*/
- private List modelsTabs = new ArrayList();
+ private final List modelsTabs = new ArrayList();
/**
* Current active Viewer tab.
@@ -505,7 +501,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
/**
* The station list.
*/
- private List stationList;
+ private final List stationList;
/**
* Saved state of the QC check items
@@ -580,12 +576,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
return;
}
- // If the disposeOnExit is true then return since this dialog
- // will be modal and we can't prevent the dialog from disposing.
- // if (disposeOnExit == true) {
- // return;
- // }
-
// Block the disposal of this dialog.
hideDialog();
event.doit = false;
@@ -631,27 +621,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
// Initialize all of the controls and layouts
initializeComponents();
- /*
- * NOTE:
- *
- * The following code sets the TOGGLE_OVERWRITE for the text editors in
- * the editor tabs. In the EditorTafTabComp, when the text controls are
- * created it is also set (if insert is false). Removing this code or
- * the code in the EditorTafTabComp will cause the text editor control
- * to not insert/overwrite properly. I do not understand why this is but
- * that is why I am documenting this. This may be fixed in the future.
- * --- L. Venable
- */
-
- if (configMgr.getResourceAsBoolean(ResourceTag.Insert) == false) {
- for (TabItem editTafTabItem : editorTafTabs) {
- EditorTafTabComp tafTabComp = (EditorTafTabComp) editTafTabItem
- .getControl();
- tafTabComp.getTextEditorControl().invokeAction(
- ST.TOGGLE_OVERWRITE);
- }
- }
-
confirmSend = configMgr.getDataAsBoolean(ResourceTag.ConfirmSend);
disallowSend = configMgr.getDataAsString(ResourceTag.DisallowSend);
}
@@ -756,7 +725,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
editorTafTabComp.setWmoIdLbl("");
editorTafTabComp.setWmoSiteLbl("");
editorTafTabComp.setLargeTF("");
- editorTafTabComp.setSmallTF("");
+ // editorTafTabComp.setSmallTF("");
editorTafTabComp.getTextEditorControl().setText("");
if (editorTafTabComp.isTafSent()) {
editorTafTabComp.updateTafSent(false);
@@ -1116,8 +1085,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
printMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
- // PrintDialog pd = new PrintDialog(shell);
- // pd.open();
printAllText();
}
});
@@ -2096,7 +2063,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
return editorComp;
}
- /**
+ /**
* Check if there is an extra '=' sign in a TAF
*
* @param doLogMessage
@@ -2113,7 +2080,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
st = editorTafTabComp.getTextEditorControl();
in = in.toUpperCase().replaceAll("TAF", "\n\nTAF").trim();
- while ( in.contains("\n\n\n") ) {
+ while (in.contains("\n\n\n")) {
in = in.replace("\n\n\n", "\n\n");
}
@@ -2153,29 +2120,33 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
String msg = "Syntax error: There is an extra '=' sign or 'TAF' is missing at beginning of TAF";
String[] tafs = in.split("\n\n");
int tafStartIndex = 0;
- for ( String taf : tafs ) {
+ for (String taf : tafs) {
int firstEqualSignIndex = taf.indexOf('=');
- if ( firstEqualSignIndex == -1 ) {
+ if (firstEqualSignIndex == -1) {
tafStartIndex += taf.length() + 2;
continue;
}
- int secondEqualSignIndex = taf.indexOf('=', firstEqualSignIndex+1);
- if ( secondEqualSignIndex == -1 ) {
+ int secondEqualSignIndex = taf
+ .indexOf('=', firstEqualSignIndex + 1);
+ if (secondEqualSignIndex == -1) {
tafStartIndex += taf.length() + 2;
continue;
}
- while ( secondEqualSignIndex > -1 ) {
- int secondEqualSignIndexInEditorText = tafStartIndex + secondEqualSignIndex;
- StyleRange sr = new StyleRange(secondEqualSignIndexInEditorText, 1, null, qcColors[3]);
+ while (secondEqualSignIndex > -1) {
+ int secondEqualSignIndexInEditorText = tafStartIndex
+ + secondEqualSignIndex;
+ StyleRange sr = new StyleRange(
+ secondEqualSignIndexInEditorText, 1, null, qcColors[3]);
syntaxMap.put(sr, msg);
st.setStyleRange(sr);
- secondEqualSignIndex = taf.indexOf('=', secondEqualSignIndex+1);
+ secondEqualSignIndex = taf.indexOf('=',
+ secondEqualSignIndex + 1);
}
errorFound = true;
tafStartIndex += taf.length() + 2;
}
- if ( doLogMessage ) {
+ if (doLogMessage) {
msgStatComp.setMessageText(msg, qcColors[3].getRGB());
}
@@ -2344,7 +2315,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
guidanceViewerFolder = new TabFolder(guidanceViewerComp, SWT.NONE);
guidanceViewerFolder.setLayoutData(gd);
- guidanceViewerFolder.addSelectionListener(new SelectionListener() {
+ guidanceViewerFolder.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -2366,12 +2337,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
currentTab.markTextAsUpdating();
}
}
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
- System.out.println("default selection listener event: " + e);
- }
});
configMgr.setDefaultColors(guidanceViewerFolder);
@@ -2503,24 +2468,25 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
}
}
}
-
+
/**
* restore from a file a user selects
*/
private void restoreFrom() {
-
- if ( tabFolder.getSelectionIndex() == VIEWER_TAB_SELECTED ) {
+
+ if (tabFolder.getSelectionIndex() == VIEWER_TAB_SELECTED) {
tabFolder.setSelection(editorTab);
}
-
+
String tempTafPath = "aviation/tmp/";
IPathManager pm = PathManagerFactory.getPathManager();
- LocalizationContext context = pm.getContext(LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
+ LocalizationContext context = pm.getContext(
+ LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
String path = pm.getFile(context, tempTafPath).getAbsolutePath();
FileDialog dlg = new FileDialog(shell, SWT.OPEN);
dlg.setFilterPath(path);
String filepath = dlg.open();
- if ( filepath == null ) { // if "Cancel"; do nothing
+ if (filepath == null) { // if "Cancel"; do nothing
return;
}
@@ -2582,7 +2548,8 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
} catch (FileNotFoundException e) {
setMessageStatusError("File " + filepath + " not found.");
} catch (IOException e) {
- setMessageStatusError("An IOException occured while opening file " + filepath);
+ setMessageStatusError("An IOException occured while opening file "
+ + filepath);
} finally {
if (errorMsg != null) {
setMessageStatusError("File " + filepath + ": " + errorMsg);
@@ -2864,30 +2831,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
public void pasteText() {
if (tabFolder.getSelectionIndex() != VIEWER_TAB_SELECTED) {
// Assume editorTafTabComp is for the active tab.
- if (overwriteMode == false) {
- editorTafTabComp.getTextEditorControl().paste();
- } else if (overwriteMode == true
- && editorTafTabComp.getTextEditorControl().getCaretOffset() < editorTafTabComp
- .getTextEditorControl().getCharCount()) {
-
- editorTafTabComp.getTextEditorControl().replaceTextRange(
- editorTafTabComp.getTextEditorControl()
- .getCaretOffset(),
- ((String) (clipboard).getContents(TextTransfer
- .getInstance())).length(),
- (String) (clipboard).getContents(TextTransfer
- .getInstance()));
-
- editorTafTabComp.getTextEditorControl()
- .setCaretOffset(
- editorTafTabComp.getTextEditorControl()
- .getCaretOffset()
- + ((String) (clipboard)
- .getContents(TextTransfer
- .getInstance()))
- .length());
-
- }
+ editorTafTabComp.getTextEditorControl().paste();
}
}
@@ -3026,7 +2970,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
st.setStyleRange(null);
syntaxMap.clear();
-
/*
* TODO Refactor all of this to be smarter. Right now it's kind of dumb
* in that the python syntax check can potentially alter the datetime of
@@ -3529,7 +3472,6 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable,
// Change the state of the insert check
insertChk.setSelection(!(insertChk.getSelection()));
}
-
// Loop and set all of the editors to the update insert state
for (TabItem editTafTabItem : editorTafTabs) {
EditorTafTabComp tafTabComp = (EditorTafTabComp) editTafTabItem
diff --git a/cave/com.raytheon.viz.feature.awips.developer/feature.xml b/cave/com.raytheon.viz.feature.awips.developer/feature.xml
index 364a60621d..0fe75c167d 100644
--- a/cave/com.raytheon.viz.feature.awips.developer/feature.xml
+++ b/cave/com.raytheon.viz.feature.awips.developer/feature.xml
@@ -201,6 +201,10 @@
id="gov.noaa.gsd.viz.hazards.feature"
version="0.0.0"/>
+
+
diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/itool/TextProductTest.py b/cave/com.raytheon.viz.gfe/localization/gfe/itool/TextProductTest.py
index 66ad88ac64..cb4e199ad1 100644
--- a/cave/com.raytheon.viz.gfe/localization/gfe/itool/TextProductTest.py
+++ b/cave/com.raytheon.viz.gfe/localization/gfe/itool/TextProductTest.py
@@ -277,7 +277,8 @@ import ProcessVariableList
from com.raytheon.viz.gfe.textformatter import TextProductFinishWaiter, FormatterUtil, TextProductManager
from com.raytheon.viz.gfe.smarttool import TextFileUtil
-from com.raytheon.viz.gfe.dialogs.formatterlauncher import ConfigData_ProductStateEnum as ProductStateEnum
+from com.raytheon.viz.gfe.dialogs.formatterlauncher import ConfigData
+ProductStateEnum = ConfigData.ProductStateEnum
class ProcessInfo:
def __init__(self, entry, name, pid, script):
diff --git a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py
index ed9fe2aa95..efd064b248 100644
--- a/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py
+++ b/cave/com.raytheon.viz.gfe/localization/gfe/userPython/gfeConfig/gfeConfig.py
@@ -33,9 +33,6 @@
# 05/28/2014 2841 randerso Added separate configurable limits for
# text formatter and product script tasks
# 02/04/2015 17039 ryu Removed HighlightFramingCodes setting.
-# 06/15/2015 4422 dgilling Add default color-mappings for
-# simulated satellite parms.
-#
GFESUITE_HOME = "/awips2/GFESuite"
GFESUITE_PRDDIR = "/tmp/products"
@@ -1182,10 +1179,6 @@ ir11West_defaultColorTable = "Sat/IR/CIRA (IR Default)"
ir13West_defaultColorTable = "Sat/IR/CIRA (IR Default)"
ir39West_defaultColorTable = "Sat/IR/CIRA (IR Default)"
waterVaporWest_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
-SBT124_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-SBT125_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-SBT122_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-SBT123_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
VisibleE_defaultColorTable = "Sat/VIS/ZA (Vis Default)"
IR11E_defaultColorTable = "Sat/IR/CIRA (IR Default)"
@@ -1208,12 +1201,6 @@ IR39W_defaultColorTable = "Sat/IR/CIRA (IR Default)"
WaterVaporW_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
FogW_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
-IR11_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-IR13_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-IR39_defaultColorTable = "Sat/IR/CIRA (IR Default)"
-WaterVapor_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
-Fog_defaultColorTable = "Sat/WV/Gray Scale Water Vapor"
-
Hazards_defaultColorTable = "GFE/Hazards"
# Start HTI entries
diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java
index 46ebf55e00..19e2728ddc 100644
--- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java
+++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java
@@ -131,6 +131,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
* Feb 02, 2015 4075 ccody Added getSelectedGage for HS issue #3961
* Mar 09, 2015 13998 lbousaidi changed the dur display when it is null to match A1.
* Apr 09, 2015 4215 mpduff Check strTree before removing items.
+ * Jul 06, 2015 4215 mpduff Correct the fact that user's cannot click and view time series.
*
*
*
@@ -344,21 +345,21 @@ public class MultiPointResource extends
*/
private synchronized void addPoint(GageData gage) {
String lid = gage.getLid();
- GageData existingGage = dataMap.get(lid);
- Coordinate xy = new Coordinate(gage.getLon(), gage.getLat());
- gage.setCoordinate(xy);
+ GageData existing = dataMap.get(lid);
+ if (gage != existing) {
+ Coordinate xy = new Coordinate(gage.getLon(), gage.getLat());
+ gage.setCoordinate(xy);
- if (existingGage != null && existingGage != gage) {
- PixelExtent pe = getPixelExtent(existingGage,
- getShiftWidth(existingGage), getShiftHeight(existingGage));
- Envelope oldEnv = descriptor.pixelToWorld(pe);
- List> list = strTree.query(oldEnv);
- if (list != null && !list.isEmpty()) {
- strTree.remove(oldEnv, existingGage);
+ if (existing != null) {
+ PixelExtent pe = getPixelExtent(existing,
+ getShiftWidth(existing), getShiftHeight(existing));
+ Envelope oldEnv = descriptor.pixelToWorld(pe);
+ strTree.remove(oldEnv, existing);
}
/* Create a small envelope around the point */
- pe = getPixelExtent(gage, getShiftWidth(gage), getShiftHeight(gage));
+ PixelExtent pe = getPixelExtent(gage, getShiftWidth(gage),
+ getShiftHeight(gage));
Envelope newEnv = descriptor.pixelToWorld(pe);
strTree.insert(newEnv, gage);
diff --git a/cave/com.raytheon.viz.product.awips/developer.product b/cave/com.raytheon.viz.product.awips/developer.product
index 0cdd2eedf0..00214d6a9f 100644
--- a/cave/com.raytheon.viz.product.awips/developer.product
+++ b/cave/com.raytheon.viz.product.awips/developer.product
@@ -65,10 +65,10 @@
+
+
-
-
diff --git a/cave/com.raytheon.viz.product.awips/plugin.properties b/cave/com.raytheon.viz.product.awips/plugin.properties
index 28543fe0bc..949156c811 100644
--- a/cave/com.raytheon.viz.product.awips/plugin.properties
+++ b/cave/com.raytheon.viz.product.awips/plugin.properties
@@ -2,3 +2,4 @@ caveAboutText=Common AWIPS Visualization Environment (CAVE)\n\
\n\
Developed on the Raytheon Visualization Environment (viz)\n\
\t~ DEVELOPMENT ~
+caveVersion=DEVELOPMENT
\ No newline at end of file
diff --git a/cave/com.raytheon.viz.product.awips/plugin.xml b/cave/com.raytheon.viz.product.awips/plugin.xml
index 82db54a5e1..b7674ad6d7 100644
--- a/cave/com.raytheon.viz.product.awips/plugin.xml
+++ b/cave/com.raytheon.viz.product.awips/plugin.xml
@@ -31,6 +31,9 @@
+
diff --git a/cave/com.raytheon.viz.product.awips/thinclient.product b/cave/com.raytheon.viz.product.awips/thinclient.product
new file mode 100644
index 0000000000..f2b9610876
--- /dev/null
+++ b/cave/com.raytheon.viz.product.awips/thinclient.product
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+ %caveAboutText
+
+
+
+
+
+
+
+ -data @user.home/caveData -user @user.home/caveData -alertviz
+ -consoleLog
+ -XX:+UseG1GC
+-Dosgi.instance.area.readOnly=true
+-Dorg.eclipse.update.reconcile=false
+-XX:MaxPermSize=128m
+-Dorg.eclipse.ui/KEY_CONFIGURATION_ID=com.raytheon.viz.ui.awips.scheme
+-Dqpid.dest_syntax=BURL
+-Dlogback.configurationFile=logback-viz-alertview.xml
+-Dlogback.statusListenerClass=com.raytheon.uf.common.logback.UFLogbackInternalStatusListener
+-Dthrift.stream.maxsize=200
+-Dviz.memory.warn.threshold=98
+-Dhttps.certificate.check=false
+-XX:+UnlockExperimentalVMOptions
+-XX:G1HeapRegionSize=4M
+-XX:InitiatingHeapOccupancyPercent=25
+-XX:G1MixedGCCountTarget=16
+-XX:G1MixedGCLiveThresholdPercent=25
+-XX:G1OldCSetRegionThresholdPercent=25
+-XX:G1HeapWastePercent=5
+ -Dfile.encoding=UTF-8 -Xmx2560M
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jdk1.6.0
+ jdk1.6.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java
index 493b2097c2..7569724fed 100644
--- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java
+++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookFrame.java
@@ -36,6 +36,7 @@ import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
+import com.raytheon.uf.common.dataplugin.redbook.RedbookWMOMap;
import com.raytheon.uf.common.dataplugin.redbook.blocks.Block_004_016;
import com.raytheon.uf.common.dataplugin.redbook.blocks.DefaultBlock;
import com.raytheon.uf.common.dataplugin.redbook.blocks.RedbookBlockBuilder;
@@ -65,7 +66,6 @@ import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
-import com.raytheon.viz.redbook.RedbookWMOMap;
import com.raytheon.viz.redbook.blocks.AbstractTextBlock;
import com.raytheon.viz.redbook.blocks.AlphaNumBlock;
import com.raytheon.viz.redbook.blocks.PlotDataBlock;
@@ -95,6 +95,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common
* and edex redbook plugins
* Apr 10, 2014 1803 njensen Fix dispose() for collaboration
+ * Jun 26, 2015 4512 mapeters Updated for RedbookWMOMap API changes
*
*
*
@@ -209,12 +210,11 @@ public class RedbookFrame implements IRenderable {
.getResourceData().getMetadataMap()
.get("wmoTTAAii");
if (wmo != null) {
- RedbookWMOMap.Info info = RedbookWMOMap.load().mapping
- .get(wmo.getConstraintValue());
+ RedbookWMOMap.Info info = RedbookWMOMap.load()
+ .getValue(wmo.getConstraintValue());
if (info != null) {
- customProjection = info.projection; // may
- // be
- // null
+ // projection may be null
+ customProjection = info.projection;
}
}
} catch (Exception e) {
diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookProductBrowserDataDefinition.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookProductBrowserDataDefinition.java
index b578eec134..821ab36b71 100644
--- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookProductBrowserDataDefinition.java
+++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookProductBrowserDataDefinition.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import com.raytheon.uf.common.dataplugin.redbook.RedbookWMOMap;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@@ -32,7 +33,6 @@ import com.raytheon.uf.viz.productbrowser.AbstractRequestableProductBrowserDataD
import com.raytheon.uf.viz.productbrowser.ProductBrowserLabel;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference;
import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType;
-import com.raytheon.viz.redbook.RedbookWMOMap;
import com.raytheon.viz.redbookua.rsc.RedbookUpperAirResourceData;
/**
@@ -43,7 +43,8 @@ import com.raytheon.viz.redbookua.rsc.RedbookUpperAirResourceData;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * May 17, 2010 mnash Initial creation
+ * May 17, 2010 mnash Initial creation
+ * Jun 26, 2015 4512 mapeters Updated for RedbookWMOMap API changes
*
*
*
@@ -92,7 +93,7 @@ public class RedbookProductBrowserDataDefinition extends
List labels = new ArrayList();
if ("wmoTTAAii".equals(param)) {
for (int i = 0; i < parameters.length; i++) {
- RedbookWMOMap.Info info = mapping.mapping.get(parameters[i]);
+ RedbookWMOMap.Info info = mapping.getValue(parameters[i]);
if (info != null) {
labels.add(new ProductBrowserLabel(info.name + " ("
+ parameters[i] + ")", parameters[i]));
diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookResource.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookResource.java
index b44d2b6ca1..d9d3913095 100644
--- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookResource.java
+++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbook/rsc/RedbookResource.java
@@ -31,6 +31,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.redbook.RedbookRecord;
+import com.raytheon.uf.common.dataplugin.redbook.RedbookWMOMap;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
@@ -50,7 +51,6 @@ import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
-import com.raytheon.viz.redbook.RedbookWMOMap;
import com.raytheon.viz.redbook.rsc.RedbookFrame.RedbookStatus;
/**
@@ -68,6 +68,7 @@ import com.raytheon.viz.redbook.rsc.RedbookFrame.RedbookStatus;
* May 21, 2013 2001 njensen Fixed display of messages
* Mar 13, 2014 2907 njensen split edex.redbook plugin into common
* and edex redbook plugins
+ * Jun 26, 2015 4512 mapeters Updated for RedbookWMOMap API changes
*
*
*
@@ -155,7 +156,7 @@ public class RedbookResource extends
if (wmoStr.isEmpty()) {
continue;
}
- RedbookWMOMap.Info info = map.mapping.get(wmoStr);
+ RedbookWMOMap.Info info = map.getValue(wmoStr);
if (info != null && info.name != null) {
this.humanReadableName = info.name;
break;
diff --git a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java
index d6b59793ad..d4aa9b209d 100644
--- a/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java
+++ b/cave/com.raytheon.viz.redbook/src/com/raytheon/viz/redbookua/rsc/RedbookUpperAirResource.java
@@ -37,6 +37,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.redbook.RedbookRecord;
+import com.raytheon.uf.common.dataplugin.redbook.RedbookWMOMap;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
@@ -71,7 +72,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.viz.pointdata.PlotData;
import com.raytheon.viz.pointdata.PlotModelFactory;
import com.raytheon.viz.redbook.Activator;
-import com.raytheon.viz.redbook.RedbookWMOMap;
import com.raytheon.viz.redbookua.RedbookUpperAirDecoder;
import com.vividsolutions.jts.geom.Coordinate;
@@ -90,6 +90,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jul 29, 2014 3465 mapeters Updated deprecated drawString() calls.
* Aug 11, 2014 3504 mapeters Replaced deprecated IODataPreparer
* instances with IRenderedImageCallback.
+ * Jun 26, 2015 4512 mapeters Updated for RedbookWMOMap API changes.
*
*
*
@@ -179,7 +180,7 @@ public class RedbookUpperAirResource extends
Activator.getDefault(), Activator.PLUGIN_ID);
return;
}
- RedbookWMOMap.Info info = map.mapping.get(wmo.getConstraintValue());
+ RedbookWMOMap.Info info = map.getValue(wmo.getConstraintValue());
if (info != null && info.name != null)
this.humanReadableName = info.name;
}
diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
index 0a2780723b..f8f5ae1fcc 100644
--- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
+++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
@@ -347,7 +347,8 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 15Feb2015 4001 dgilling Ensure all fields are set in SendPracticeProductRequest.
* 05Mar2015 RM 15025 kshrestha Fix to maintain the headers that they are saved with
* 10Mar2015 RM 14866 kshrestha Disable QC GUI pop up for TextWS
- * 6Apr2015 RM14968 mgamazaychikov Fix formatting for pathcast section
+ * 06Apr2015 RM14968 mgamazaychikov Fix formatting for pathcast section
+ * 15Jun2015 4441 randerso Unconditionally convert text to upper case for QC
*
*
*
@@ -4909,8 +4910,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
if (warnGenFlag) {
QCConfirmationMsg qcMsg = new QCConfirmationMsg();
if (!qcMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
- MixedCaseProductSupport.conditionalToUpper(prod.getNnnid(),
- textEditor.getText()), prod.getNnnid())) {
+ textEditor.getText().toUpperCase(), prod.getNnnid())) {
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
qcMsg.getTitle(), qcMsg.getProductMessage(),
qcMsg.getModeMessage());
@@ -4964,11 +4964,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
return;
}
- if (isWarnGenDlg == true){
+ if (isWarnGenDlg == true) {
StdTextProduct prod = getStdTextProduct();
String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid();
- SendConfirmationMsg sendMsg = new SendConfirmationMsg(resend, afosId,
- prod.getNnnid());
+ SendConfirmationMsg sendMsg = new SendConfirmationMsg(resend,
+ afosId, prod.getNnnid());
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
sendMsg.getTitle(), sendMsg.getProductMessage(),
@@ -5748,140 +5748,154 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
int afosXxxLimit = 5; // second three characters is AFOS XXX
String prodText = textEditor.getText();
- if (!prodText.startsWith("ZCZC")) {
- /*
- * DR15610 - Make sure that if the first line of the text product is not
- * a WMO heading it is treated as part of the text body.
- */
- String[] pieces = textEditor.getText().split("\r*\n", 2);
- if (pieces.length > 1) {
- pieces[0] += "\n"; // WMOHeader expects this
- }
- WMOHeader header = new WMOHeader(pieces[0].getBytes(), null);
- if (!header.isValid()) {
- headerTF.setText("");
- try {
- textEditor.setText(originalText);
- textEditor.setEditable(true);
- textEditor.setEditable(false);
- } catch (IllegalArgumentException e) {
- // There is no text product body, so set it to the empty string.
- textEditor.setText("");
+ if (!prodText.startsWith("ZCZC")) {
+ /*
+ * DR15610 - Make sure that if the first line of the text product is
+ * not a WMO heading it is treated as part of the text body.
+ */
+ String[] pieces = textEditor.getText().split("\r*\n", 2);
+ if (pieces.length > 1) {
+ pieces[0] += "\n"; // WMOHeader expects this
}
- } else {
- // TODO FIX PARSING
-
- // First, set the current header by assuming that it usually
- // consists of the first two lines of text in the text product,
- // though there will be exceptions to that "rule" as handled below.
- // So, obtain the AFOS NNNxxx. If it's where it is supposed to be
- // in the new format, then the existing header is already an AWIPS
- // text product identifier. Otherwise it is a legacy AFOS
- // identifier.
- if (TextDisplayModel.getInstance().hasStdTextProduct(token)) {
- StdTextProduct textProd = TextDisplayModel.getInstance()
- .getStdTextProduct(token);
- StdTextProductId prodId = textProd.getProdId();
+ WMOHeader header = new WMOHeader(pieces[0].getBytes(), null);
+ if (!header.isValid()) {
+ headerTF.setText("");
try {
- // start of second line of text
- start = textEditor.getOffsetAtLine(thisLine + 1);
- if ((textEditor.getText(start, start + afosNnnLimit)
- .equals(prodId.getNnnid()))
- && (textEditor.getText(start + afosNnnLimit + 1,
- start + afosXxxLimit).equals(prodId
- .getXxxid()))) {
- // Text matches the products nnnid and xxxid
- numberOfLinesOfHeaderText = 2;
- } else if (textEditor.getText(start,
- start + afosNnnLimit + 2).equals(
- AFOSParser.DRAFT_PIL)
- || textEditor.getText(start,
- start + afosNnnLimit + 2).equals("TTAA0")) {
- // Text matches temporary WRKWG#
- numberOfLinesOfHeaderText = 2;
- } else {
+ textEditor.setText(originalText);
+ textEditor.setEditable(true);
+ textEditor.setEditable(false);
+ } catch (IllegalArgumentException e) {
+ // There is no text product body, so set it to the empty
+ // string.
+ textEditor.setText("");
+ }
+ } else {
+ // TODO FIX PARSING
+
+ // First, set the current header by assuming that it usually
+ // consists of the first two lines of text in the text product,
+ // though there will be exceptions to that "rule" as handled
+ // below.
+ // So, obtain the AFOS NNNxxx. If it's where it is supposed to
+ // be
+ // in the new format, then the existing header is already an
+ // AWIPS
+ // text product identifier. Otherwise it is a legacy AFOS
+ // identifier.
+ if (TextDisplayModel.getInstance().hasStdTextProduct(token)) {
+ StdTextProduct textProd = TextDisplayModel.getInstance()
+ .getStdTextProduct(token);
+ StdTextProductId prodId = textProd.getProdId();
+ try {
+ // start of second line of text
+ start = textEditor.getOffsetAtLine(thisLine + 1);
+ if ((textEditor.getText(start, start + afosNnnLimit)
+ .equals(prodId.getNnnid()))
+ && (textEditor.getText(
+ start + afosNnnLimit + 1, start
+ + afosXxxLimit).equals(prodId
+ .getXxxid()))) {
+ // Text matches the products nnnid and xxxid
+ numberOfLinesOfHeaderText = 2;
+ } else if (textEditor.getText(start,
+ start + afosNnnLimit + 2).equals(
+ AFOSParser.DRAFT_PIL)
+ || textEditor.getText(start,
+ start + afosNnnLimit + 2).equals(
+ "TTAA0")) {
+ // Text matches temporary WRKWG#
+ numberOfLinesOfHeaderText = 2;
+ } else {
+ // Assume this header block is a legacy AFOS
+ // identifier.
+ numberOfLinesOfHeaderText = 1;
+ }
+ } catch (IllegalArgumentException e) {
// Assume this header block is a legacy AFOS identifier.
numberOfLinesOfHeaderText = 1;
}
+ }
+
+ try {
+ start = 0;
+ finish = textEditor.getOffsetAtLine(thisLine
+ + numberOfLinesOfHeaderText) - 1;
} catch (IllegalArgumentException e) {
- // Assume this header block is a legacy AFOS identifier.
- numberOfLinesOfHeaderText = 1;
+ // The text does not span enough lines so use the full
+ // extent
+ // of the product.
+ finish = textEditor.getCharCount() - 1;
+ }
+
+ // Set the content of the header block to consist of just the
+ // header
+ // of
+ // the text product... it will get reunited with the body when
+ // it is
+ // saved.
+ if (finish > start) {
+ headerTF.setText(textEditor.getText(start, finish));
+ } else {
+ headerTF.setText("");
+ }
+
+ // Next, set the current body by assuming that it always
+ // consists of the rest of the text product beyond the line(s)
+ // of text in the header.
+ try {
+ int numberOfBlankLines = -1;
+ String line = null;
+ do {
+ numberOfBlankLines++;
+ line = textEditor.getLine(thisLine
+ + numberOfLinesOfHeaderText
+ + numberOfBlankLines);
+ } while ((line.length() == 0) || line.equals(""));
+ // Note: 'st' is a reference to 'textEditor'...
+ // delelete the header from the text in 'textEditor'
+ finish = textEditor.getOffsetAtLine(thisLine
+ + numberOfLinesOfHeaderText + numberOfBlankLines);
+ textEditor.setSelection(start, finish);
+ textEditor.setEditable(true);
+ textEditor.invokeAction(SWT.DEL);
+ textEditor.setEditable(false);
+ } catch (IllegalArgumentException e) {
+ // There is no text product body, so set it to the empty
+ // string.
+ textEditor.setText("");
}
}
+ } else {
+ /**
+ * If the first word begins with "ZCZC", it is a two-line header at
+ * least, it is
+ * "ZCZC CCNNNXXX adr\r\r\nTTAA00 KCCC DDHHMM bbb\r\r\n"
+ */
+ int newLineIndex = prodText.indexOf("\n\n");
+ String first = prodText.substring(0, newLineIndex);
- try {
- start = 0;
- finish = textEditor.getOffsetAtLine(thisLine
- + numberOfLinesOfHeaderText) - 1;
- } catch (IllegalArgumentException e) {
- // The text does not span enough lines so use the full extent
- // of the product.
- finish = textEditor.getCharCount() - 1;
- }
+ if (first.length() > 10) {
+ String rest = prodText.substring(newLineIndex + 1);
- // Set the content of the header block to consist of just the header
- // of
- // the text product... it will get reunited with the body when it is
- // saved.
- if (finish > start) {
- headerTF.setText(textEditor.getText(start, finish));
- } else {
- headerTF.setText("");
- }
+ headerTF.setText(first);
+ String cccnnnxxx = first.substring(5, 14);
+ setCurrentSiteId("");
+ setCurrentWmoId("");
+ setCurrentWsfoId(cccnnnxxx.substring(0, 3));
+ setCurrentProdCategory(cccnnnxxx.substring(3, 6));
+ setCurrentProdDesignator(cccnnnxxx.substring(6, 9));
- // Next, set the current body by assuming that it always
- // consists of the rest of the text product beyond the line(s)
- // of text in the header.
- try {
- int numberOfBlankLines = -1;
- String line = null;
- do {
- numberOfBlankLines++;
- line = textEditor.getLine(thisLine
- + numberOfLinesOfHeaderText + numberOfBlankLines);
- } while ((line.length() == 0) || line.equals(""));
- // Note: 'st' is a reference to 'textEditor'...
- // delelete the header from the text in 'textEditor'
- finish = textEditor.getOffsetAtLine(thisLine
- + numberOfLinesOfHeaderText + numberOfBlankLines);
- textEditor.setSelection(start, finish);
- textEditor.setEditable(true);
- textEditor.invokeAction(SWT.DEL);
- textEditor.setEditable(false);
- } catch (IllegalArgumentException e) {
- // There is no text product body, so set it to the empty string.
- textEditor.setText("");
+ try {
+ textEditor.setText(rest.trim());
+ textEditor.setEditable(true);
+ textEditor.setEditable(false);
+ } catch (IllegalArgumentException e) {
+ // There is no text product body, so set it to the empty
+ // string.
+ textEditor.setText("");
+ }
}
}
- } else {
- /**
- * If the first word begins with "ZCZC", it is a two-line header at least,
- * it is "ZCZC CCNNNXXX adr\r\r\nTTAA00 KCCC DDHHMM bbb\r\r\n"
- */
- int newLineIndex = prodText.indexOf("\n\n");
- String first = prodText.substring(0, newLineIndex);
-
- if (first.length() > 10 ) {
- String rest = prodText.substring(newLineIndex+1);
-
- headerTF.setText(first);
- String cccnnnxxx = first.substring(5, 14);
- setCurrentSiteId("");
- setCurrentWmoId("");
- setCurrentWsfoId(cccnnnxxx.substring(0, 3));
- setCurrentProdCategory(cccnnnxxx.substring(3, 6));
- setCurrentProdDesignator(cccnnnxxx.substring(6, 9));
-
- try {
- textEditor.setText(rest.trim());
- textEditor.setEditable(true);
- textEditor.setEditable(false);
- } catch (IllegalArgumentException e) {
- // There is no text product body, so set it to the empty string.
- textEditor.setText("");
- }
- }
- }
}
/**
@@ -7951,7 +7965,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
// is this the pathcast paragragh?
- if (paragraphStart.startsWith("* THIS") && paragraphStart.endsWith("WILL BE NEAR...")) {
+ if (paragraphStart.startsWith("* THIS")
+ && paragraphStart.endsWith("WILL BE NEAR...")) {
inPathcast = true;
}
@@ -7964,8 +7979,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
padding = " ";
}
- if ((inLocations || inPathcast) && (paragraphStartLineNumber == lineNumber)) {
- // Keep LOCATIONS and PATHCAST first line short & don't paste more to it.
+ if ((inLocations || inPathcast)
+ && (paragraphStartLineNumber == lineNumber)) {
+ // Keep LOCATIONS and PATHCAST first line short & don't paste more
+ // to it.
if (line.indexOf("...") == line.lastIndexOf("...")) {
return;
}
@@ -8045,11 +8062,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
&& (allText.charAt(eol + 1) == '\n')) {
deleteLen = 2;
} else if (allText.charAt(eol) == '\n') {
- if (allText.charAt(eol-1) == '.' && allText.charAt(eol-2) != '.') {
+ if ((allText.charAt(eol - 1) == '.')
+ && (allText.charAt(eol - 2) != '.')) {
// do not extend this line.
return;
- }
- else {
+ } else {
deleteLen = 1;
}
} else {
@@ -8197,8 +8214,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
textEditor.replaceTextRange(position, 0, replacement.toString());
// remove and extra space
- if (textEditor.getText(position -1, position - 1).equals(" ")) {
- textEditor.replaceTextRange(position-1, 1, "");
+ if (textEditor.getText(position - 1, position - 1).equals(" ")) {
+ textEditor.replaceTextRange(position - 1, 1, "");
}
++endWrapLine;
}
diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/IQCCheck.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/IQCCheck.java
index 783c02841c..01aa45427a 100644
--- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/IQCCheck.java
+++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/qc/IQCCheck.java
@@ -64,15 +64,15 @@ public interface IQCCheck {
public static final Pattern firstBulletPtrn = Pattern.compile(
"^\\*\\s(.*)\\s(WARNING|ADVISORY)(\\sFOR(.*)|...)",
- Pattern.CASE_INSENSITIVE);
+ Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
public static final Pattern secondBulletPtrn = Pattern.compile(
"^\\*\\sUNTIL\\s(\\d{1,2})(\\d{2})\\s(AM|PM)\\s(\\w{3,4})",
- Pattern.CASE_INSENSITIVE);
+ Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
public static final Pattern thirdBulletPtrn = Pattern.compile(
"^\\*\\sAT\\s(\\d{1,2})(\\d{2})\\s(AM|PM)\\s(\\w{3,4})(.*)",
- Pattern.CASE_INSENSITIVE);
+ Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
public static final Pattern latLonPtrn = Pattern
.compile("LAT...LON+(\\s\\d{3,4}\\s\\d{3,5}){1,}");
diff --git a/cave/com.raytheon.viz.textworkstation/localization/textws/gui/QualityControlCfg.xml b/cave/com.raytheon.viz.textworkstation/localization/textws/gui/QualityControlCfg.xml
index 26023ea61c..6a6264696e 100644
--- a/cave/com.raytheon.viz.textworkstation/localization/textws/gui/QualityControlCfg.xml
+++ b/cave/com.raytheon.viz.textworkstation/localization/textws/gui/QualityControlCfg.xml
@@ -20,12 +20,12 @@
-->
ER \ RAIN
- SM \ SNOW MELT
+ SM \ SNOWMELTSM \ MELTING SNOW
- SM \ VOLCANIC SNOW MELT
+ SM \ VOLCANIC SNOWMELTIJ \ ICE JAMIC \ ICE JAM AND RAIN
- IC \ ICE JAM AND SNOW MELT
+ IC \ ICE JAM AND SNOWMELTGO \ GLACIERGO \ GLACIER-DAMMED LAKEDM \ DAM
@@ -34,7 +34,7 @@
DM \ LEVEE FAILUREDM \ DAM FAILUREDM \ DAM BREAK
- RS \ RAIN AND SNOW MELT
+ RS \ RAIN AND SNOWMELTRS \ RAIN AND MELTING SNOW
diff --git a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractAWIPSComponent.java b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractAWIPSComponent.java
index b12042358f..d2a10a70a1 100644
--- a/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractAWIPSComponent.java
+++ b/cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractAWIPSComponent.java
@@ -66,6 +66,7 @@ import com.raytheon.uf.viz.personalities.cave.component.CAVEApplication;
* Feb 23, 2015 4164 dlovely Extracted AlertViz initialize.
* Jun 03, 2015 4473 njensen If running with AlertViz, start a job to
* continuously check AlertViz status.
+ * Jun 22, 2015 4474 njensen Don't check for alertviz if alertview is enabled
*
*
*
@@ -212,7 +213,8 @@ public abstract class AbstractAWIPSComponent extends CAVEApplication {
// Setup AlertViz observer
if ((getRuntimeModes() & ALERT_VIZ) != 0) {
// Set up alertviz
- if (LocalizationManager.internalAlertServer && !isNonUIComponent()) {
+ if (LocalizationManager.internalAlertServer && !isNonUIComponent()
+ && !Boolean.getBoolean("alertview.enabled")) {
/*
* Potentially run alertviz inside viz. Will repeatedly schedule
* a check to verify it's running. If not found, it will try and
diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/misc.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/misc.xml
index fba2764353..3e8be73eda 100644
--- a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/misc.xml
+++ b/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/misc.xml
@@ -83,12 +83,7 @@
-
-
-
-
-
+
diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/sfc2d/simulated-satellite.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/sfc2d/simulated-satellite.xml
deleted file mode 100644
index 0972d35098..0000000000
--- a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/sfc2d/simulated-satellite.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/planes/planviewtime-timeseries/misc.xml b/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/planes/planviewtime-timeseries/misc.xml
index 3aa076e935..5e5155567b 100644
--- a/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/planes/planviewtime-timeseries/misc.xml
+++ b/cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/planes/planviewtime-timeseries/misc.xml
@@ -112,6 +112,5 @@
indentText="false" />
-
+
\ No newline at end of file
diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java
index 27ff83aa64..49942b82c4 100644
--- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java
+++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java
@@ -82,8 +82,9 @@ abstract public class AbstractLockingBehavior {
Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
private static Pattern startMND = Pattern
- .compile("(BULLETIN - IMMEDIATE BROADCAST REQUESTED)|(BULLETIN - EAS ACTIVATION REQUESTED)|"
- + warningType);
+ .compile(
+ "(BULLETIN - IMMEDIATE BROADCAST REQUESTED)|(BULLETIN - EAS ACTIVATION REQUESTED)|"
+ + warningType, Pattern.CASE_INSENSITIVE);
private static Pattern stateAbbrevPtrn = Pattern.compile(
WarnGenPatterns.listOfAreaName + WarnGenPatterns.NEWLINE,
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java
index 45ea0a3d9f..8a30834049 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java
@@ -118,6 +118,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* should be purged.
* 09/09/2014 #3356 njensen Remove CommunicationException
* 03/05/2015 #4169 randerso Fix error handling in getDatabase
+ * 06/29/2015 #4537 rferrel Allow for durations less then 1 hour.
*
*
*
@@ -1097,8 +1098,12 @@ public class D2DGridDatabase extends VGridDatabase {
TimeUtil.SECONDS_PER_HOUR, 0);
}
}
- return new TimeConstraints(TimeUtil.SECONDS_PER_HOUR, (int) repeat,
- (int) start);
+
+ int duration = TimeUtil.SECONDS_PER_HOUR;
+ if (duration > repeat) {
+ duration = (int) repeat;
+ }
+ return new TimeConstraints(duration, (int) repeat, (int) start);
}
private int calcPrecision(float minV, float maxV) {
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/notification/gfe-watch.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/notification/gfe-watch.xml
index 086cbadb25..93f427665d 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/notification/gfe-watch.xml
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/notification/gfe-watch.xml
@@ -5,7 +5,7 @@
VM
-
+
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/parameter/alias/gfeParamName.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/parameter/alias/gfeParamName.xml
index 7b363efca5..b4b8b57c26 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/parameter/alias/gfeParamName.xml
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/parameter/alias/gfeParamName.xml
@@ -10,6 +10,7 @@
Dec 15, 2014 DR 14024 jwatson Added parameters for 2.5km GFSLAMPGrid
Feb 24, 2015 DR 16671 byin Added HPBL for RUC13
May 21, 2015 DR 17515 bhunder Added parameters for URMA25
+ Jun 29, 2015 #4537 rferrel Added parameters for HRRR.
-->
av
@@ -27,7 +28,8 @@
dirswdpddpt
- dpterranl
+ dpterranl
+ dswrfELEVemspept
@@ -60,6 +62,7 @@
prsigsvpvvpw
+ retoprhscpshf
@@ -97,6 +100,7 @@
wdwderranlweasd
+ weasd1hrwghwgswindprob
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py
index 1514f8d9ad..d44aa41c00 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py
@@ -66,8 +66,8 @@
# 04/20/2015 #4414 dgilling Add missing NWPSTrkngCG0 weather elements.
# 05/12/2015 #17144 bhunder Added RTMA model
# 05/29/2015 17496 ryu Changed parm definitions for Wave1-10 and Period1-10.
-# 05/29/2015 #17144 bhunder Added weather Params for URMA25 and OCONUS RTMA
-# 06/15/2015 #4422 dgilling Added parms for NAM12 simulated satellite.
+#
+# 05/29/2015 #17144 bhunder Added weather Params for URMA25 and OCONUS RTMA
####################################################################################################
#----------------------------------------------------------------------------
@@ -391,16 +391,7 @@ FloodingRainThreat = ("FloodingRainThreat", DISCRETE, "Cat", "Flooding Rain Thre
StormSurgeThreat = ("StormSurgeThreat", DISCRETE, "Cat", "Storm Surge Threat", NO, Threat4Keys,2)
WindThreat = ("WindThreat", DISCRETE, "Cat", "Wind Threat", NO, Threat4Keys,2)
TornadoThreat = ("TornadoThreat", DISCRETE, "Cat", "Tornado Threat", NO, Threat4Keys,2)
-QPFtoFFGRatio = ("QPFtoFFGRatio", SCALAR, "1", "QPF to FFG Ratio", 8.0, 0.0, 0, NO)
-
-# Parms for Simulated Satellite
-SatIR11 = ("IR11", SCALAR, "C", "11 micron temperature", 58.0, -111.0, 0, NO)
-SatIR13 = ("IR13", SCALAR, "C", "13 micron temperature", 50.0, -111.0, 0, NO)
-SatIR39 = ("IR39", SCALAR, "C", "3.9 micron temperature", 50.0,
- -111.0, 0, NO)
-SatWV = ("WaterVapor", SCALAR, "C", "water vapor temperature",
- -62.0, -111.0, 0, NO)
-SatFog = ("Fog", SCALAR, "C", "ir11 - ir39", 50.0, -111.0, 0, NO)
+QPFtoFFGRatio = ("QPFtoFFGRatio", SCALAR, "1", "QPF to FFG Ratio", 8.0, 0.0, 0, NO)
# Hazards
HazardKeys = []
@@ -2143,9 +2134,6 @@ ENPwave_parms = [([WindWaveHeight, WaveHeight, SurfHeight, Wind], TC6),
# GFSLAMPGrid
GFSLAMPGridPARMS=[([Temp, Td, Vis, CigHgt],TC1)]
-# NAM12 Simulated Satellite
-NAM12SATSIMPARMS=[([SatIR39, SatIR11, SatIR13, SatWV, SatFog],TC3)]
-
#---------------------------------------------------------------------------
# Databases for a site.
# list of (Database, [parms])
@@ -2165,7 +2153,7 @@ DATABASES = [(Official, OFFICIALDBS + localParms),
(GFS75, STD6_MODEL + localGFS75Parms),
(GFS190, STD6_MODEL + localGFS190Parms),
(NAM40, STD3_MODEL + localNAM40Parms),
- (NAM12, STD3_MODEL + NAM12SATSIMPARMS + localNAM12Parms),
+ (NAM12, STD3_MODEL + localNAM12Parms),
(gfsLR, STD12_MODEL + localgfsLRParms),
(GWW, WAVEPARMS + localGWWParms),
(WNAWAVE, WAVEPARMS + localWNAWAVEParms),
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml
index fd37bda8c9..51684e58aa 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml
@@ -1,12 +1,16 @@
-
+
+
+
+
@@ -249,6 +253,9 @@
+
+
+
@@ -489,7 +496,4 @@
-
-
-
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/HRRR.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/HRRR.xml
index 31de299811..040a4cfe77 100755
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/HRRR.xml
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/HRRR.xml
@@ -1,21 +1,67 @@
+
0
+ 900
+ 1800
+ 27003600
+ 4500
+ 5400
+ 63007200
+ 8100
+ 9000
+ 990010800
+ 11700
+ 12600
+ 1350014400
+ 15300
+ 16200
+ 1710018000
+ 18900
+ 19800
+ 2070021600
+ 22500
+ 23400
+ 2430025200
+ 26100
+ 27000
+ 2790028800
+ 29700
+ 30600
+ 3150032400
+ 33300
+ 34200
+ 3510036000
+ 36900
+ 37800
+ 3870039600
+ 40500
+ 41400
+ 4230043200
+ 44100
+ 45000
+ 4590046800
+ 47700
+ 48600
+ 4950050400
+ 51300
+ 52200
+ 5310054000
@@ -43,10 +89,28 @@
100000.0-99999.00
- FHAG 1000 HYB 1
+ FHAG 1000 4000 HYB 1 NTAT 0FHAG1000
+ FHAG4000HYB1
+ NTAT
+
+
+
+
+ retop
+ Echo top height of 18dBZ surface
+ m
+ meters
+ echoTop
+ 0.0
+ 100000.0
+ -99999.0
+ 0
+ CTL
+
+ CTL
@@ -74,9 +138,10 @@
6000.0-99999.00
- SFC BL 0>180 0>255
+ SFC BL 0>90 0>180 0>255SFC
+ BL090BL0180BL0255
@@ -89,8 +154,8 @@
0
- tp
- total precipitation
+ tp1hr
+ total precipitation (1 hr)mmmillimetertotPrecip
@@ -104,8 +169,8 @@
- weasd
- water equivalent of accumulated snow depth
+ weasd1hr
+ water equivalent of accumulated snow depth (1 hr)mlmilwaterEqvAccSnowDepth
@@ -193,21 +258,6 @@
HCL
-
- crain
- Categorical rain
- yes=1, no=0
-
- CategoricalRain
- 0.0
- 1.0
- -99999.0
- 0
- SFC
-
- SFC
-
- uwu wind component
@@ -218,9 +268,15 @@
150.0-99999.00
- 10 FHAG
+ FHAG 10 FHAG 80 MB 1000 925 850 700 500FHAG10
+ FHAG80
+ MB1000
+ MB925
+ MB850
+ MB700
+ MB500
@@ -233,9 +289,10 @@
1000.0-99999.00
- SFC BL 0>255
+ SFC BL 0>90 0>255SFC
+ BL090BL0255
@@ -270,25 +327,54 @@
- csnow
- Categorical snow
+ cicep
+ Categorical ice pelletsyes=1, no=0
- CategoricalSnow
+ CategoricalIcePlt0.01.0-99999.0
+ 0SFCSFC
- cicep
- Categorical ice pellets
+ cpofp
+ Probability of frozen precip
+ %
+ percent
+ FrznPcpProb
+ -99999.0
+ 0
+ SFC
+
+ SFC
+
+
+
+ crain
+ Categorical rainyes=1, no=0
- CategoricalIcePlt
+ CategoricalRain
+ 0.0
+ 1.0
+ -99999.0
+ 0
+ SFC
+
+ SFC
+
+
+
+ csnow
+ Categorical snow
+ yn
+
+ CategoricalSnow0.01.0-99999.0
@@ -329,9 +415,9 @@
150.0-99999.01
- 10 FHAG
+ SFC
- FHAG10
+ SFC
@@ -359,9 +445,24 @@
330.0-99999.01
- FHAG 2
+ FHAG 2 MB 1000 0925 700 500FHAG2
+ MB1000
+ MB925
+ MB700
+ MB500
+
+
+
+ dswrf
+ Downward shortwave radiation flux
+ W/m2
+ watts/meter2
+ 0
+ SFC
+
+ SFC
@@ -405,11 +506,34 @@
150.0-99999.00
+ FHAG 10 FHAG 80 MB 1000 925 850 700 500
+
+ FHAG10
+ FHAG80
+ MB1000
+ MB925
+ MB850
+ MB700
+ MB500
+
+
+
+
+ ws1hr
+ Wind Speed
+ m/s
+ meter/sec
+ windSpeed
+ 0
+ 150
+ -99999.0
+ 010 FHAGFHAG10
+
tTemperature
@@ -420,9 +544,14 @@
330.0-99999.00
- 2 FHAG
+ 2 FHAG MB 1000 925 850 700 500FHAG2
+ MB1000
+ MB925
+ MB850
+ MB700
+ MB500
@@ -441,10 +570,15 @@
20000.0-99999.00
- CBL CTL
+ SFC ADCL CBL CTL CLG MB 1000 500
+ SFC
+ ADCLCBLCTL
+ CLG
+ MB1000
+ MB500
@@ -462,6 +596,19 @@
SFC
+
+ pr
+ precipitation rate
+ Kg/m**2 / s
+ 0.0
+ 0.10000000149
+ -99999.0
+ 0
+ SFC
+
+ SFC
+
+ pwprecipitable water
@@ -508,11 +655,11 @@
- mwind
- Maximum Wind Speed
+ ws
+ Wind Speedm/smeter/sec
- maxWindSpeed
+ windSpeed0150-99999.0
@@ -522,4 +669,29 @@
FHAG10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/eta218.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/eta218.xml
index 92dea9a519..db3e04e1f6 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/eta218.xml
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/eta218.xml
@@ -829,64 +829,4 @@
SFC
-
- SBT122
- Simulated Brightness Temp 3.9u
- K
- degree_Kelvin
- SBT122
- 180.0
- 330.0
- -99999.0
- 0
- NTAT
-
- NTAT
-
-
-
- SBT123
- Simulated Brightness Temp WV
- K
- degree_Kelvin
- SBT123
- 180.0
- 330.0
- -99999.0
- 0
- NTAT
-
- NTAT
-
-
-
- SBT124
- Simulated Brightness Temp IR
- K
- degree_Kelvin
- SBT124
- 180.0
- 330.0
- -99999.0
- 0
- NTAT
-
- NTAT
-
-
-
- SBT125
- Simulated Brightness Temp 13u
- K
- degree_Kelvin
- SBT125
- 180.0
- 330.0
- -99999.0
- 0
- NTAT
-
- NTAT
-
-
diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/smartinit/NAM12.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/smartinit/NAM12.py
index 38bb60772c..5d07364d34 100644
--- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/smartinit/NAM12.py
+++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/smartinit/NAM12.py
@@ -1686,25 +1686,5 @@ class NAM12Forecaster(Forecaster):
value=where(less(value,0.0),value+360,value)
return value
- def gvar2T(self, ir):
- t = where(ir < 177, (660 - ir) / 2.0, (418 - ir))
- t = t - 273
- return t
-
- def calcIR11(self, SBT124_NTAT):
- return self.gvar2T(SBT124_NTAT)
-
- def calcIR13(self, SBT125_NTAT):
- return self.gvar2T(SBT125_NTAT)
-
- def calcIR39(self, SBT122_NTAT):
- return self.gvar2T(SBT122_NTAT)
-
- def calcWaterVapor(self, SBT123_NTAT):
- return self.gvar2T(SBT123_NTAT)
-
- def calcFog(self, IR11, IR39):
- return IR11 - IR39
-
def main():
NAM12Forecaster().run()
diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/GridUtil.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/GridUtil.java
deleted file mode 100644
index ebb7d042cf..0000000000
--- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/GridUtil.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-
-package com.raytheon.edex.uengine;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Util class for grids. Extracted from original uEngine's TermQueryIndex task.
- *
- *
- * SOFTWARE HISTORY
- * Date PR# Engineer Description
- * ----------- ---------- ------------ --------------------------
- * Mar 29, 2007 njensen Initial Creation
- *
- *
- */
-public class GridUtil {
-
- /**
- * Creates a Meta-Data map from the meta-data query result object.
- *
- * @param result
- * the query result object
- * @return the Meta-Data map
- *
- * @throws Exception
- * in the event a serious error occurs
- */
- public static Map createMetaDataMap(Object result)
- throws Exception {
- HashMap retVal = new HashMap();
- Class> aClass = Class.forName(result.getClass().getName());
-
- while (aClass != null) {
- for (Field aField : aClass.getDeclaredFields()) {
- if (!Modifier.isStatic(aField.getModifiers())) {
- String name = aField.getName();
- String getter = "get" + name.substring(0, 1).toUpperCase()
- + name.substring(1);
- try {
- Method aMethod = aClass.getMethod(getter,
- (Class[]) null);
- Object value = aMethod.invoke(result, (Object[]) null);
- if (value != null) {
- // System.out.println(name + " : " + value);
- retVal.put(name, value);
- }
- } catch (NoSuchMethodException e) {
- // just skip it!
- }
- }
- }
- aClass = aClass.getSuperclass();
- }
- return retVal;
- }
-
-}
diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/runners/IMicroEngine.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/runners/IMicroEngine.java
index 1ee1b2ad7f..8587a3ec9a 100644
--- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/runners/IMicroEngine.java
+++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/runners/IMicroEngine.java
@@ -25,6 +25,9 @@ import com.raytheon.edex.uengine.exception.MicroEngineException;
import com.raytheon.uf.common.message.response.AbstractResponseMessage;
/**
+ * @deprecated MicroEngine, aka uEngine, is deprecated. Use IServerRequest/IRequestHandler
+ * framework instead.
+ *
* The public interface for all μEngine script runners. It provides the required
* operations to run a script. These operations are {@link #initialize()},
* {@link #setScript(String)}, {@link #execute()}, {@link #getResult()}, and
@@ -56,12 +59,15 @@ import com.raytheon.uf.common.message.response.AbstractResponseMessage;
* ------------ ---------- ----------- --------------------------
* 12Nov2008 1709 MW Fegan Initial Creation.
* 25May2011 8686 cjeanbap Add setter method.
+ * 25Jun2015 4495 njensen Deprecated
+ *
*
*
* @author mfegan
* @version 1.0
*/
+@Deprecated
public interface IMicroEngine {
/**
* Executes a previously set μEngine script. Implementations of
@@ -71,6 +77,7 @@ public interface IMicroEngine {
* @throws MicroEngineException if any error occurs
*/
public void execute() throws MicroEngineException;
+
/**
* Executes the specified μEngine script. This is a convenience method
* that includes initialization and release operations on the script runner
@@ -95,7 +102,9 @@ public interface IMicroEngine {
* @return the result of execution the script
* @throws MicroEngineException if any error occurs
*/
- public List executeScript(String script) throws MicroEngineException;
+ public List executeScript(String script)
+ throws MicroEngineException;
+
/**
* Returns the results from running a μEngine script. Classes that implement
* this interface should ensure that a valid, although possibly empty, list
@@ -103,6 +112,7 @@ public interface IMicroEngine {
* should be obtained in this method.
*/
public List getResult();
+
/**
* Initializes the μEngine script runner. Initialization should not be
* dependent on having set a script; it should only get the scripting engine
@@ -111,6 +121,7 @@ public interface IMicroEngine {
* @throws MicroEngineException if any error occurs
*/
public void initialize() throws MicroEngineException;
+
/**
* Initializes the μEngine script runner. This version combines
* {@link #setScript(String) setting the script} with
@@ -120,6 +131,7 @@ public interface IMicroEngine {
* @throws MicroEngineException if any error occurs
*/
public void initialize(String script) throws MicroEngineException;
+
/**
* Releases any resources utilized by the μEngine script runner. Generally,
* this method should release resources allocated in {@link #initialize()}.
@@ -129,10 +141,11 @@ public interface IMicroEngine {
* In case of failure, this method should log the failure and fail silently.
*/
public void release();
+
/**
* Provides the script to be executed.
*/
public void setScript(String script);
-
+
public void setTrigger(String triggerId);
}
diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseAscii.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseAscii.java
deleted file mode 100644
index 2179180bb8..0000000000
--- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseAscii.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-
-package com.raytheon.edex.uengine.tasks.response;
-
-import com.raytheon.edex.msg.ResponseMessageASCII;
-import com.raytheon.edex.uengine.tasks.ScriptTask;
-import com.raytheon.uf.common.dataplugin.PluginDataObject;
-
-/**
- * Makes an ASCII response.
- *
- *
- * SOFTWARE HISTORY
- * Date PR# Engineer Description
- * ----------- ---------- ------------ --------------------------
- * Mar 29, 2007 njensen Initial Creation
- *
- *
- */
-public class MakeResponseAscii extends ScriptTask {
-
- private PluginDataObject record;
-
- private String input;
-
- public MakeResponseAscii(PluginDataObject aRecord, String anInput) {
- record = aRecord;
- input = anInput;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.raytheon.edex.uengine.js.tasks.ScriptTask#execute()
- */
- @Override
- public Object execute() {
- String dataURI = (String) record.getIdentifier();
- String time = record.getDataTime().getValidTime().toString();
- String station = "StationID";
- String type = record.getPluginName();
-
- return ResponseMessageASCII.generateASCIIResponse(null, input, type,
- station, time, dataURI);
- }
-
-}
diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java
deleted file mode 100644
index 1b75fc00e0..0000000000
--- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/response/MakeResponseInline.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-
-package com.raytheon.edex.uengine.tasks.response;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.GregorianCalendar;
-import java.util.List;
-import java.util.UUID;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import com.raytheon.edex.msg.ResponseMessageInline;
-import com.raytheon.edex.uengine.ResponseUtil;
-import com.raytheon.edex.uengine.exception.MicroEngineException;
-import com.raytheon.edex.uengine.tasks.ScriptTask;
-import com.raytheon.uf.common.util.StringUtil;
-
-/**
- * Makes an inline response message. Derived from old uEngine
- * MakeResponseInline.
- *
- *