From a529bc8cad50ba40360c5641e9aa325f2f00ba9e Mon Sep 17 00:00:00 2001 From: David Gillingham Date: Thu, 20 Mar 2014 13:07:50 -0500 Subject: [PATCH 1/7] Issue #2418: Re-implement GFE support for pSurge 2.0 data to match A1. Change-Id: I984a4c3e62a1fd5a18610146fa1dd35b9050a8f9 Former-commit-id: e820f7ea4046e42ae1112fe8b1a0f8455dbc997d --- .../base/grid/dataset/alias/gfeParamInfo.xml | 1 - .../base/parameter/alias/gfeParamName.xml | 89 +- .../base/config/gfe/serverConfig.py | 4 +- .../base/grid/gfeLevelMappingFile.xml | 6 + .../base/grid/parameterInfo/PHISH.xml | 819 ------------ .../base/grid/parameterInfo/TPCSurgeProb.xml | 1131 ++++++++++++----- 6 files changed, 854 insertions(+), 1196 deletions(-) delete mode 100644 edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/PHISH.xml diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml index c9a5605518..7443be9698 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml @@ -179,5 +179,4 @@ ecmfNH ecmfNH laps - PHISH 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 7597df9015..75ff952084 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 @@ -5,6 +5,7 @@ May 07, 2013 #1974 randerso Removed unnecessary TPCSG_ entries (should only need TPCSG-) Changed TP_XXX to tpXXX for RFC total precip Jul 03, 2013 #2044 randerso Removed mappings from tpXXX to tp_XXX for RFCQPF + Mar 31, 2014 #2934 dgilling Updated params for pSurge2.0/PHISH data. --> av @@ -308,37 +309,6 @@ tp6c8 tpmean6 tpsprd6 - PSurge0Ft - PSurge1Ft - PSurge4Ft - PSurge5Ft - PSurge6Ft - Surge20Pct - PSurge7Ft - PSurge8Ft - PSurge9Ft - PSurge10Ft - Surge30Pct - PSurge11Ft - PSurge12Ft - PSurge13Ft - Surge40Pct - PSurge14Ft - PSurge15Ft - PSurge16Ft - Surge50Pct - PSurge17Ft - PSurge18Ft - PSurge19Ft - PSurge20Ft - PSurge2Ft - PSurge21Ft - PSurge22Ft - PSurge23Ft - PSurge24Ft - PSurge25Ft - PSurge3Ft - Surge10Pct tpecmwf tpw tsprd @@ -373,4 +343,61 @@ wssprd wx zagl + Surge10Pct + Surge20Pct + Surge30Pct + Surge40Pct + Surge50Pct + PSurge0Ft + PSurge1Ft + PSurge2Ft + PSurge3Ft + PSurge4Ft + PSurge5Ft + PSurge6Ft + PSurge7Ft + PSurge8Ft + PSurge9Ft + PSurge10Ft + PSurge11Ft + PSurge12Ft + PSurge13Ft + PSurge14Ft + PSurge15Ft + PSurge16Ft + PSurge17Ft + PSurge18Ft + PSurge19Ft + PSurge20Ft + PSurge21Ft + PSurge22Ft + PSurge23Ft + PSurge24Ft + PSurge25Ft + Surge10Pctincr + Surge20Pctincr + Surge30Pctincr + Surge40Pctincr + Surge50Pctincr + PSurge0Ftincr + PSurge1Ftincr + PSurge2Ftincr + PSurge3Ftincr + PSurge4Ftincr + PSurge5Ftincr + PSurge6Ftincr + PSurge7Ftincr + PSurge8Ftincr + PSurge9Ftincr + PSurge10Ftincr + PSurge11Ftincr + PSurge12Ftincr + PSurge13Ftincr + PSurge14Ftincr + PSurge15Ftincr + PSurge16Ftincr + PSurge17Ftincr + PSurge18Ftincr + PSurge19Ftincr + PSurge20Ftincr 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 738323a4eb..f805f5e426 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 @@ -36,6 +36,7 @@ # 10/03/2013 #2424 randerso Change localTC to use dateutil instead of pytz # to get correct offsets for Alaska # 01/17/2014 #2719 randerso Added NHA domain +# 03/20/2014 #2418 dgilling Remove unneeded D2D source PHISH. # ######################################################################## @@ -1020,7 +1021,6 @@ D2DDBVERSIONS = { "HPCERP": 5, "TPCProb": 30, "TPCStormSurge": 1, - "PHISH": 1, "CRMTopo": 1, "NED": 1, } @@ -1127,7 +1127,6 @@ elif SID in CONUS_EAST_SITES: 'GLERL', 'WNAWAVE238', ('TPCSurgeProb','TPCStormSurge'), # DCS3462 - 'PHISH', 'GlobalWave', 'EPwave10', 'AKwave10', @@ -1177,7 +1176,6 @@ else: #######DCS3501 WEST_CONUS 'GLERL', 'WNAWAVE238', ('TPCSurgeProb','TPCStormSurge'), # DCS3462 - 'PHISH', 'GlobalWave', 'EPwave10', 'WCwave10', 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 6a6ab2ab3d..b416a6a713 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,4 +1,7 @@ + @@ -237,6 +240,9 @@ + + + diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/PHISH.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/PHISH.xml deleted file mode 100644 index 1e8de1ba1f..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/PHISH.xml +++ /dev/null @@ -1,819 +0,0 @@ - - - - - 21600 - 43200 - 64800 - 86400 - 108000 - 129600 - 151200 - 172800 - 194400 - 216000 - 237600 - 259200 - 280800 - - - Surge10Pct - 10% Exceedance Height - feet - feet - SURGE10pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge20Pct - 20% Exceedance Height - feet - feet - SURGE20pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge30Pct - 30% Exceedance Height - feet - feet - SURGE30pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge40Pct - 40% Exceedance Height - feet - feet - SURGE40pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge50Pct - 50% Exceedance Height - feet - feet - SURGE50pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge0Ft - Prob of Hurricane Storm Surge > 0 feet - % - percent - ProbSurge00c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge1Ft - Prob of Hurricane Storm Surge > 1 foot - % - percent - ProbSurge01c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge2Ft - Prob of Hurricane Storm Surge > 2 feet - % - percent - ProbSurge02c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge3Ft - Prob of Hurricane Storm Surge > 3 feet - % - percent - ProbSurge03c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge4Ft - Prob of Hurricane Storm Surge > 4 feet - % - percent - ProbSurge04c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge5Ft - Prob of Hurricane Storm Surge > 5 feet - % - percent - ProbSurge05c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge6Ft - Prob of Hurricane Storm Surge > 6 feet - % - percent - ProbSurge06c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge7Ft - Prob of Hurricane Storm Surge > 7 feet - % - percent - ProbSurge07c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge8Ft - Prob of Hurricane Storm Surge > 8 feet - % - percent - ProbSurge08c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge9Ft - Prob of Hurricane Storm Surge > 9 feet - % - percent - ProbSurge09c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge10Ft - Prob of Hurricane Storm Surge > 10 feet - % - percent - ProbSurge10c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge11Ft - Prob of Hurricane Storm Surge > 11 feet - % - percent - ProbSurge11c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge12Ft - Prob of Hurricane Storm Surge > 12 feet - % - percent - ProbSurge12c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge13Ft - Prob of Hurricane Storm Surge > 13 feet - % - percent - ProbSurge13c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge14Ft - Prob of Hurricane Storm Surge > 14 feet - % - percent - ProbSurge14c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge15Ft - Prob of Hurricane Storm Surge > 15 feet - % - percent - ProbSurge15c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge16Ft - Prob of Hurricane Storm Surge > 16 feet - % - percent - ProbSurge16c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge17Ft - Prob of Hurricane Storm Surge > 17 feet - % - percent - ProbSurge17c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge18Ft - Prob of Hurricane Storm Surge > 18 feet - % - percent - ProbSurge18c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge19Ft - Prob of Hurricane Storm Surge > 19 feet - % - percent - ProbSurge19c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge20Ft - Prob of Hurricane Storm Surge > 20 feet - % - percent - ProbSurge20c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge10pct6hr - 10% Exceedance Height - feet - feet - SURGE10pct6hr - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge20pct6hr - 20% Exceedance Height - feet - feet - SURGE20pct6hr - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge30pct6hr - 30% Exceedance Height - feet - feet - SURGE30pct6hr - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge40pct6hr - 40% Exceedance Height - feet - feet - SURGE40pct6hr - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge50pct6hr - 50% Exceedance Height - feet - feet - SURGE50pct6hr - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge0ft6hr - Prob of Hurricane Storm Surge > 0 feet - % - percent - ProbSurge006hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge1ft6hr - Prob of Hurricane Storm Surge > 1 foot - % - percent - ProbSurge016hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge2ft6hr - Prob of Hurricane Storm Surge > 2 feet - % - percent - ProbSurge026hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge3ft6hr - Prob of Hurricane Storm Surge > 3 feet - % - percent - ProbSurge036hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge4ft6hr - Prob of Hurricane Storm Surge > 4 feet - % - percent - ProbSurge046hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge5ft6hr - Prob of Hurricane Storm Surge > 5 feet - % - percent - ProbSurge056hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge6ft6hr - Prob of Hurricane Storm Surge > 6 feet - % - percent - ProbSurge066hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge7ft6hr - Prob of Hurricane Storm Surge > 7 feet - % - percent - ProbSurge076hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge8ft6hr - Prob of Hurricane Storm Surge > 8 feet - % - percent - ProbSurge086hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge9ft6hr - Prob of Hurricane Storm Surge > 9 feet - % - percent - ProbSurge096hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge10ft6hr - Prob of Hurricane Storm Surge > 10 feet - % - percent - ProbSurge106hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge11ft6hr - Prob of Hurricane Storm Surge > 11 feet - % - percent - ProbSurge116hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge12ft6hr - Prob of Hurricane Storm Surge > 12 feet - % - percent - ProbSurge126hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge13ft6hr - Prob of Hurricane Storm Surge > 13 feet - % - percent - ProbSurge136hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge14ft6hr - Prob of Hurricane Storm Surge > 14 feet - % - percent - ProbSurge146hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge15ft6hr - Prob of Hurricane Storm Surge > 15 feet - % - percent - ProbSurge156hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge16ft6hr - Prob of Hurricane Storm Surge > 16 feet - % - percent - ProbSurge166hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge17ft6hr - Prob of Hurricane Storm Surge > 17 feet - % - percent - ProbSurge176hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge18ft6hr - Prob of Hurricane Storm Surge > 18 feet - % - percent - ProbSurge186hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge19ft6hr - Prob of Hurricane Storm Surge > 19 feet - % - percent - ProbSurge196hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge20ft6hr - Prob of Hurricane Storm Surge > 20 feet - % - percent - ProbSurge206hr - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - staticSpacing - Grid spacing - meters - -99999.0 - - - staticTopo - Topography - meters - -99999.0 - - diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/TPCSurgeProb.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/TPCSurgeProb.xml index d2b2c0f59b..05076bddc0 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/TPCSurgeProb.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/TPCSurgeProb.xml @@ -1,15 +1,13 @@ 21600 43200 64800 - 75600 86400 - 97200 108000 129600 151200 @@ -17,57 +15,95 @@ 194400 216000 237600 + 259200 + 280800 288000 - 432000 + - PSurge23Ft - 80 hr Prob of Hurricane Storm Surge > 23 feet - % - percent - ProbSurge23c - 0.0 + Surge10Pct + Hurricane Storm Surge Percentile(10) + m + meters + SURGE10pct + -100.0 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 + SFC + + + + Surge20Pct + Hurricane Storm Surge Percentile(20) + m + meters + SURGE20pct + -100.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + Surge30Pct + Hurricane Storm Surge Percentile(30) + m + meters + SURGE30pct + -100.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 SFC Surge40Pct - 80 hr Hurricane Storm Surge Percentile(40) - feet - feet + Hurricane Storm Surge Percentile(40) + m + meters SURGE40pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge21Ft - 80 hr Prob of Hurricane Storm Surge > 21 feet - % - percent - ProbSurge21c - 0.0 + -100.0 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC + + Surge50Pct + Hurricane Storm Surge Percentile(50) + m + meters + SURGE50pct + -100.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + PSurge25Ft - 80 hr Prob of Hurricane Storm Surge > 25 feet + Prob of Hurricane Storm Surge > 25 feet % percent ProbSurge25c @@ -80,282 +116,9 @@ SFC - - staticCoriolis - Coriolis parameter - /s - -99999.0 - - - Surge30Pct - 80 hr Hurricane Storm Surge Percentile(30) - feet - feet - SURGE30pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge20Pct - 80 hr Hurricane Storm Surge Percentile(20) - feet - feet - SURGE20pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge16Ft - 80 hr Prob of Hurricane Storm Surge > 16 feet - % - percent - ProbSurge16c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - staticSpacing - Grid spacing - meters - -99999.0 - - - PSurge11Ft - 80 hr Prob of Hurricane Storm Surge > 11 feet - % - percent - ProbSurge11c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge10Ft - 80 hr Prob of Hurricane Storm Surge > 10 feet - % - percent - ProbSurge10c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge15Ft - 80 hr Prob of Hurricane Storm Surge > 15 feet - % - percent - ProbSurge15c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge14Ft - 80 hr Prob of Hurricane Storm Surge > 14 feet - % - percent - ProbSurge14c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge2Ft - 80 hr Prob of Hurricane Storm Surge > 2 feet - % - percent - ProbSurge02c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge17Ft - 80 hr Prob of Hurricane Storm Surge > 17 feet - % - percent - ProbSurge17c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge6Ft - 80 hr Prob of Hurricane Storm Surge > 6 feet - % - percent - ProbSurge06c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge4Ft - 80 hr Prob of Hurricane Storm Surge > 4 feet - % - percent - ProbSurge04c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge8Ft - 80 hr Prob of Hurricane Storm Surge > 8 feet - % - percent - ProbSurge08c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge19Ft - 80 hr Prob of Hurricane Storm Surge > 19 feet - % - percent - ProbSurge19c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - staticTopo - Topography - meters - -99999.0 - - - PSurge18Ft - 80 hr Prob of Hurricane Storm Surge > 18 feet - % - percent - ProbSurge18c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - Surge50Pct - 80 hr Hurricane Storm Surge Percentile(50) - feet - feet - SURGE50pct - 0.0 - 25.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge22Ft - 80 hr Prob of Hurricane Storm Surge > 22 feet - % - percent - ProbSurge22c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - - - PSurge20Ft - 80 hr Prob of Hurricane Storm Surge > 20 feet - % - percent - ProbSurge20c - 0.0 - 100.0 - -9999.0 - 0 - SFC - - SFC - - PSurge24Ft - 80 hr Prob of Hurricane Storm Surge > 24 feet + Prob of Hurricane Storm Surge > 24 feet % percent ProbSurge24c @@ -368,9 +131,166 @@ SFC + + PSurge23Ft + Prob of Hurricane Storm Surge > 23 feet + % + percent + ProbSurge23c + 0.0 + 100.0 + -9999.0 + 0 + SFC + + SFC + + + + PSurge22Ft + Prob of Hurricane Storm Surge > 22 feet + % + percent + ProbSurge22c + 0.0 + 100.0 + -9999.0 + 0 + SFC + + SFC + + + + PSurge21Ft + Prob of Hurricane Storm Surge > 21 feet + % + percent + ProbSurge21c + 0.0 + 100.0 + -9999.0 + 0 + SFC + + SFC + + + + PSurge20Ft + Prob of Hurricane Storm Surge > 20 feet + % + percent + ProbSurge20c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge19Ft + Prob of Hurricane Storm Surge > 19 feet + % + percent + ProbSurge19c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge18Ft + Prob of Hurricane Storm Surge > 18 feet + % + percent + ProbSurge18c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge17Ft + Prob of Hurricane Storm Surge > 17 feet + % + percent + ProbSurge17c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge16Ft + Prob of Hurricane Storm Surge > 16 feet + % + percent + ProbSurge16c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge15Ft + Prob of Hurricane Storm Surge > 15 feet + % + percent + ProbSurge15c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge14Ft + Prob of Hurricane Storm Surge > 14 feet + % + percent + ProbSurge14c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + PSurge13Ft - 80 hr Prob of Hurricane Storm Surge > 13 feet + Prob of Hurricane Storm Surge > 13 feet % percent ProbSurge13c @@ -378,14 +298,15 @@ 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC PSurge12Ft - 80 hr Prob of Hurricane Storm Surge > 12 feet + Prob of Hurricane Storm Surge > 12 feet % percent ProbSurge12c @@ -393,59 +314,47 @@ 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC - PSurge5Ft - 80 hr Prob of Hurricane Storm Surge > 5 feet + PSurge11Ft + Prob of Hurricane Storm Surge > 11 feet % percent - ProbSurge05c + ProbSurge11c 0.0 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC - PSurge3Ft - 80 hr Prob of Hurricane Storm Surge > 3 feet + PSurge10Ft + Prob of Hurricane Storm Surge > 10 feet % percent - ProbSurge03c + ProbSurge10c 0.0 100.0 -9999.0 0 - SFC - - SFC - - - - PSurge7Ft - 80 hr Prob of Hurricane Storm Surge > 7 feet - % - percent - ProbSurge07c - 0.0 - 100.0 - -9999.0 - 0 - SFC + SFC 0 FHAG + FHAG0 SFC PSurge9Ft - 80 hr Prob of Hurricane Storm Surge > 9 feet + Prob of Hurricane Storm Surge > 9 feet % percent ProbSurge09c @@ -453,24 +362,562 @@ 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC - Surge10Pct - 80 hr Hurricane Storm Surge Percentile(10) - feet - feet - SURGE10pct + PSurge8Ft + Prob of Hurricane Storm Surge > 8 feet + % + percent + ProbSurge08c 0.0 - 25.0 + 100.0 -9999.0 0 - SFC + SFC 0 FHAG + FHAG0 SFC + + PSurge7Ft + Prob of Hurricane Storm Surge > 7 feet + % + percent + ProbSurge07c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge6Ft + Prob of Hurricane Storm Surge > 6 feet + % + percent + ProbSurge06c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge5Ft + Prob of Hurricane Storm Surge > 5 feet + % + percent + ProbSurge05c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge4Ft + Prob of Hurricane Storm Surge > 4 feet + % + percent + ProbSurge04c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge3Ft + Prob of Hurricane Storm Surge > 3 feet + % + percent + ProbSurge03c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge2Ft + Prob of Hurricane Storm Surge > 2 feet + % + percent + ProbSurge02c + 0.0 + 100.0 + -9999.0 + 0 + SFC 0 FHAG + + FHAG0 + SFC + + + + PSurge1Ft + Prob of Hurricane Storm Surge > 1 feet + % + percent + ProbSurge01c + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge0Ft + Prob of Hurricane Storm Surge > 0 feet + % + percent + ProbSurge00c + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + + Surge10Pctincr + 6 hr Hurricane Storm Surge Percentile(10) + m + meters + SURGE10pct_incr + -100.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + Surge20Pctincr + 6 hr Hurricane Storm Surge Percentile(20) + m + meters + SURGE20pct_incr + -100.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + Surge30Pctincr + 6 hr Hurricane Storm Surge Percentile(30) + m + meters + SURGE30pct_incr + -100.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + Surge40Pctincr + 6 hr Hurricane Storm Surge Percentile(40) + m + meters + SURGE40pct_incr + -100.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + Surge50Pctincr + 6 hr Hurricane Storm Surge Percentile(50) + m + meters + SURGE50pct_incr + -100.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge20Ftincr + 6 hr Prob of Hurricane Storm Surge > 20 feet + % + percent + ProbSurge20c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge19Ftincr + 6 hr Prob of Hurricane Storm Surge > 19 feet + % + percent + ProbSurge19c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge18Ftincr + 6 hr Prob of Hurricane Storm Surge > 18 feet + % + percent + ProbSurge18c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge17Ftincr + 6 hr Prob of Hurricane Storm Surge > 17 feet + % + percent + ProbSurge17c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge16Ftincr + 6 hr Prob of Hurricane Storm Surge > 16 feet + % + percent + ProbSurge16c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge15Ftincr + 6 hr Prob of Hurricane Storm Surge > 15 feet + % + percent + ProbSurge15c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge14Ftincr + 6 hr Prob of Hurricane Storm Surge > 14 feet + % + percent + ProbSurge14c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge13Ftincr + 6 hr Prob of Hurricane Storm Surge > 13 feet + % + percent + ProbSurge13c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge12Ftincr + 6 hr Prob of Hurricane Storm Surge > 12 feet + % + percent + ProbSurge12c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge11Ftincr + 6 hr Prob of Hurricane Storm Surge > 11 feet + % + percent + ProbSurge11c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge10Ftincr + 6 hr Prob of Hurricane Storm Surge > 10 feet + % + percent + ProbSurge10c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge9Ftincr + 6 hr Prob of Hurricane Storm Surge > 9 feet + % + percent + ProbSurge09c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge8Ftincr + 6 hr Prob of Hurricane Storm Surge > 8 feet + % + percent + ProbSurge08c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge7Ftincr + 6 hr Prob of Hurricane Storm Surge > 7 feet + % + percent + ProbSurge07c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge6Ftincr + 6 hr Prob of Hurricane Storm Surge > 6 feet + % + percent + ProbSurge06c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge5Ftincr + 6 hr Prob of Hurricane Storm Surge > 5 feet + % + percent + ProbSurge05c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge4Ftincr + 6 hr Prob of Hurricane Storm Surge > 4 feet + % + percent + ProbSurge04c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge3Ftincr + 6 hr Prob of Hurricane Storm Surge > 3 feet + % + percent + ProbSurge03c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge2Ftincr + 6 hr Prob of Hurricane Storm Surge > 2 feet + % + percent + ProbSurge02c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge1Ftincr + 6 hr Prob of Hurricane Storm Surge > 1 feet + % + percent + ProbSurge01c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + PSurge0Ftincr + 6 hr Prob of Hurricane Storm Surge > 0 feet + % + percent + ProbSurge00c_incr + 0.0 + 100.0 + -9999.0 + 0 + 0 FHAG + + FHAG0 + + + + + staticTopo + Topography + meters + -99999.0 + + + staticCoriolis + Coriolis parameter + /s + -99999.0 + + + staticSpacing + Grid spacing + meters + -99999.0 + From 3d6ebf498ec20710eedc965d3dd4f7c7fc5394ed Mon Sep 17 00:00:00 2001 From: Dave Hladky Date: Tue, 1 Apr 2014 11:14:33 -0500 Subject: [PATCH 2/7] Issue #2949 Updated scripts Change-Id: I36f39d59e8aa1abc8cefd5ed100cbfd70eedaa80 Former-commit-id: afcfc72329522c2d731a4afe9353632effb9cb23 --- .../registryQueryUpdate/updateQueriesSql.sql | 84 ++++++++++++++----- .../14.2.1/updateMadisTableConstraint.sql | 4 +- 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/deltaScripts/14.2.1/registryQueryUpdate/updateQueriesSql.sql b/deltaScripts/14.2.1/registryQueryUpdate/updateQueriesSql.sql index c03c6ff67f..8051956493 100644 --- a/deltaScripts/14.2.1/registryQueryUpdate/updateQueriesSql.sql +++ b/deltaScripts/14.2.1/registryQueryUpdate/updateQueriesSql.sql @@ -1,26 +1,66 @@ -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SPARQL'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SPARQL'; +CREATE FUNCTION taxonomyelementtype_classificationnode_update() RETURNS void AS $$ + DECLARE + t bool; + BEGIN + SELECT EXISTS( + SELECT * FROM information_schema.tables + WHERE + table_schema = 'ebxml' AND + table_name = 'taxonomyelementtype_classificationnode' +) into t; + IF + t ='t' + THEN + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SPARQL'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SQL-92'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XQuery'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:EJBQL'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:ExportObject'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:FindAllMyObjects'; + delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:ExtrinsicObjectQuery'; + INSERT INTO ebxml.taxonomyelementtype_classificationnode(taxonomyelementtype_id,classificationnode_id) + VALUES('urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage','urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL'); + RAISE NOTICE 'updated ebxml.taxonomyelementtype_classificationnode table, success!'; + ELSE + RAISE NOTICE 'Table ebxml.taxonomyelementtype_classificationnode does not exist, skipping!'; + END IF; + END; +$$ LANGUAGE plpgsql; -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SQL-92'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SQL-92'; +CREATE FUNCTION classificationnode_update() RETURNS void AS $$ + DECLARE + t bool; + BEGIN + SELECT EXISTS( + SELECT * FROM information_schema.tables + WHERE + table_schema = 'ebxml' AND + table_name = 'classificationnode' +) into t; + IF + t ='t' + THEN + delete from where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SPARQL'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SQL-92'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XQuery'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:EJBQL'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:ExportObject'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:FindAllMyObjects'; + delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:ExtrinsicObjectQuery'; + INSERT INTO ebxml.classificationnode (id,lid,objecttype,owner,versionname,code,parent,path) + VALUES ('urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL','urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL', + 'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ClassificationNode','NCF','1','HQL', + 'urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage','/urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage/HQL'); + RAISE NOTICE 'updated ebxml.classificationnode table, success!'; + ELSE + RAISE NOTICE 'Table ebxml.classificationnode does not exist, skipping!'; + END IF; + END; +$$ LANGUAGE plpgsql; -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XQuery'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XQuery'; +select taxonomyelementtype_classificationnode_update(); +select classificationnode_update(); -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:QueryLanguage:EJBQL'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:QueryLanguage:EJBQL'; +DROP FUNCTION taxonomyelementtype_classificationnode_update(); +DROP FUNCTION classificationnode_update(); -INSERT INTO ebxml.classificationnode (id,lid,objecttype,owner,versionname,code,parent,path) VALUES -('urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL','urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL', -'urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ClassificationNode','NCF','1','HQL', -'urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage','/urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage/HQL'); -INSERT INTO ebxml.taxonomyelementtype_classificationnode(taxonomyelementtype_id,classificationnode_id) VALUES('urn:oasis:names:tc:ebxml-regrep:classificationScheme:QueryLanguage','urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL'); - -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:ExportObject'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:ExportObject'; - -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:FindAllMyObjects'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:FindAllMyObjects'; - -delete from ebxml.taxonomyelementtype_classificationnode where classificationnode_id='urn:oasis:names:tc:ebxml-regrep:query:ExtrinsicObjectQuery'; -delete from ebxml.classificationnode where id= 'urn:oasis:names:tc:ebxml-regrep:query:ExtrinsicObjectQuery'; diff --git a/deltaScripts/14.2.1/updateMadisTableConstraint.sql b/deltaScripts/14.2.1/updateMadisTableConstraint.sql index 68ead33a90..a4d2b92490 100644 --- a/deltaScripts/14.2.1/updateMadisTableConstraint.sql +++ b/deltaScripts/14.2.1/updateMadisTableConstraint.sql @@ -1,3 +1,3 @@ -alter table madis drop constraint madis_location_reftime_provider_subprovider_restriction_key; +alter table if exists madis drop constraint madis_location_reftime_provider_subprovider_restriction_key; +alter table if exists madis add CONSTRAINT madis_latitude_longitude_stationid_reftime_provider_subprovider UNIQUE (latitude, longitude, stationid, reftime, provider, subprovider, restriction) -alter table madis add constraint madis_location_stationid_reftime_provider_subprovider_restr_key UNIQUE (location, stationid, reftime, provider, subprovider, restriction) From 53d5000261cb27f98218389f0c803e74765ef1dc Mon Sep 17 00:00:00 2001 From: Richard Peter Date: Tue, 1 Apr 2014 14:44:05 -0500 Subject: [PATCH 3/7] Issue #2509: Fix stitched grid notifications Change-Id: Ib4581f8c8d3f3eae15d22601cfc35732acd849a4 Former-commit-id: 861f0c09baa01e191b430bce6699c0f1c95a52d2 --- .../grib/decoderpostprocessors/EnsembleGridAssembler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java index 761a8076e0..a8fbb036c2 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java @@ -228,7 +228,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor { updateExistingRecord(record, assembledRecord, thinned, dao); } EDEXUtil.getMessageProducer().sendAsync("notificationAggregation", - new PluginDataObject[] { record }); + new PluginDataObject[] { assembledRecord }); } private GridRecord createAssembledRecord(GridRecord record, From 11fbd86558759e5e8c4e0a24f987af45b61f6cfe Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Wed, 2 Apr 2014 09:00:17 -0500 Subject: [PATCH 4/7] Issue #2969 Fixed error when Topo parm is unloaded. Fixed check state of Topography menu item. Change-Id: I3cd13d91b489425e05efd68fd6bbbfd9a9d3cd4b Former-commit-id: 3856ce7fc5c5ac85ca26e71da326457f0bb0b2b5 --- .../raytheon/viz/gfe/actions/TopoHandler.java | 48 ++++++++++++++++--- .../internal/GFESpatialDisplayManager.java | 9 ++++ .../viz/gfe/core/internal/ParmManager.java | 5 +- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/TopoHandler.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/TopoHandler.java index ece7b0b82c..3b06db338b 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/TopoHandler.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/TopoHandler.java @@ -27,11 +27,15 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.ui.commands.IElementUpdater; import org.eclipse.ui.menus.UIElement; +import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.viz.core.VizApp; +import com.raytheon.viz.gfe.core.DataManager; +import com.raytheon.viz.gfe.core.DataManagerUIFactory; import com.raytheon.viz.gfe.core.msgs.EnableDisableTopoMsg; import com.raytheon.viz.gfe.core.msgs.EnableDisableTopoMsg.Action; -import com.raytheon.viz.gfe.core.msgs.Message; +import com.raytheon.viz.gfe.core.parm.Parm; /** * Handle the GFE Topography menu item @@ -42,6 +46,7 @@ import com.raytheon.viz.gfe.core.msgs.Message; * ------------ ---------- ----------- -------------------------- * Jul 2, 2008 #1160 randerso Initial creation * Nov 20, 2013 #2331 randerso Re-implemented using message + * Apr 02, 2014 #2969 randerso Fix state of Topography menu item * * * @@ -53,6 +58,8 @@ public class TopoHandler extends AbstractHandler implements IElementUpdater { private IUFStatusHandler statusHandler = UFStatus .getHandler(TopoHandler.class); + public static String commandId = "com.raytheon.viz.gfe.actions.topo"; + /* * (non-Javadoc) * @@ -62,11 +69,21 @@ public class TopoHandler extends AbstractHandler implements IElementUpdater { */ @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { - Action lastAction = Message.inquireLastMessage( - EnableDisableTopoMsg.class).getAction(); + boolean topoDisplayed = false; + DataManager dm = DataManagerUIFactory.getCurrentInstance(); + if (dm != null) { + Parm[] parms = dm.getParmManager().getDisplayedParms(); + ParmID topoId = dm.getTopoManager().getCompositeParmID(); + for (Parm p : parms) { + if (p.getParmID().equals(topoId)) { + topoDisplayed = true; + break; + } + } + } Action newAction; - if (lastAction.equals(Action.ENABLE)) { + if (topoDisplayed) { newAction = Action.DISABLE; } else { newAction = Action.ENABLE; @@ -88,8 +105,25 @@ public class TopoHandler extends AbstractHandler implements IElementUpdater { @SuppressWarnings("rawtypes") @Override public void updateElement(final UIElement element, Map parameters) { - element.setChecked(Message - .inquireLastMessage(EnableDisableTopoMsg.class).getAction() - .equals(EnableDisableTopoMsg.Action.ENABLE)); + boolean topoDisplayed = false; + DataManager dm = DataManagerUIFactory.getCurrentInstance(); + if (dm != null) { + Parm[] parms = dm.getParmManager().getDisplayedParms(); + ParmID topoId = dm.getTopoManager().getCompositeParmID(); + for (Parm p : parms) { + if (p.getParmID().equals(topoId)) { + topoDisplayed = true; + break; + } + } + } + + final boolean checked = topoDisplayed; + VizApp.runAsync(new Runnable() { + @Override + public void run() { + element.setChecked(checked); + } + }); } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/GFESpatialDisplayManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/GFESpatialDisplayManager.java index 8f725b3865..af9d8abc1c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/GFESpatialDisplayManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/GFESpatialDisplayManager.java @@ -26,6 +26,8 @@ import java.util.List; import java.util.Set; import org.eclipse.swt.graphics.RGB; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.commands.ICommandService; import org.geotools.coverage.grid.GridGeometry2D; import org.geotools.geometry.GeneralEnvelope; import org.opengis.geometry.Envelope; @@ -46,6 +48,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability; import com.raytheon.viz.core.ColorUtil; import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.PythonPreferenceStore; +import com.raytheon.viz.gfe.actions.TopoHandler; import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.IParmManager; import com.raytheon.viz.gfe.core.ISampleSetManager; @@ -73,6 +76,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor; * 12/02/2008 1450 randerso Moved getEditors method into UiUtil for general use * 04/09/2009 1288 rjpeter Add sample set listener,ensure remove called for listeners * 08/20/2009 2310 njensen Separated most logic out into AbstractSpatialDisplayManager + * 04/02/2014 2969 randerso Fix state of Topography menu item * * * @author chammack @@ -361,6 +365,11 @@ public class GFESpatialDisplayManager extends AbstractSpatialDisplayManager createResourceFromParm(desc, addParm, false); } } + if (PlatformUI.isWorkbenchRunning()) { + ICommandService service = (ICommandService) PlatformUI + .getWorkbench().getService(ICommandService.class); + service.refreshElements(TopoHandler.commandId, null); + } } /* diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java index d805a10c1b..e0a65eb87c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java @@ -140,6 +140,7 @@ import com.raytheon.viz.gfe.types.MutableInteger; * 11/21/2013 #2331 randerso Merge with AbstractParmManager and deleted MockParmManager * to simplify maintenance of this class. * Changed handling of enabling/disabling Topo parm + * 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded. * * * @author chammack @@ -780,7 +781,9 @@ public class ParmManager implements IParmManager, IMessageClient { parmIDs.addAll(Arrays.asList(vcParms)); } else if ((cacheParmIDs == null) && (!dbID.getDbType().equals("V"))) { - uncachedDbs.add(dbID); + if (this.availableServerDatabases.contains(dbID)) { + uncachedDbs.add(dbID); + } } else { parmIDs.addAll(cacheParmIDs); From 6a28fcb1563290e55b58cb4463d7d78f0552ac7a Mon Sep 17 00:00:00 2001 From: "Brian.Dyke" Date: Fri, 4 Apr 2014 12:57:32 -0400 Subject: [PATCH 5/7] Merged 1354 -5 and -6 into 1412 based on 1411-25 Former-commit-id: 407b42b0eff676a95483e219d6be899e45effd6c --- .../cave/etc/aviation/python/TafDecoder.py | 10 + .../regular/VectorRelatedPhrases.py | 44 +- .../ArchiveCaseCreationDialogAction.java | 25 +- .../uf/viz/archive/ui/CaseCreationDlg.java | 281 +++++---- .../uf/viz/archive/ui/GenerateCaseDlg.java | 581 ++++++++---------- .../refresh/ThinClientDataUpdateTree.java | 5 + .../viz/awipstools/ToolsDataManager.java | 11 +- .../src/com/raytheon/viz/gfe/GfeClient.java | 13 +- .../gfe/core/griddata/WeatherGridData.java | 27 +- .../formatterlauncher/ProductEditorComp.java | 22 +- .../raytheon/viz/grid/util/RadarAdapter.java | 10 +- edexOsgi/build.edex/esb/conf/log4j.xml | 43 +- .../base/python/MasterInterface.py | 16 +- .../utility/SAF_Site_MultiPil_Definition.py | 1 + .../notify/VTECTableChangeListener.java | 60 +- .../base/grid/parameterInfo/spcGuideNDFD.xml | 28 +- .../res/spring/utility-common.xml | 18 + .../res/spring/utility-request.xml | 10 - .../uf/common/activetable/VTECChange.java | 35 +- .../archive/config/ArchiveConfigManager.java | 290 +++++++-- .../archive/config/CategoryDataSet.java | 98 +++ .../uf/common/archive/config/DisplayData.java | 28 +- .../ArchiveCaseCreationAuthRequest.java | 71 +++ .../gfe/textproduct/DraftProduct.java | 38 +- .../uf/common/dataplugin/qc/QCRecord.java | 9 + .../lookup/GridCoverageLookup.java | 29 +- .../serialization/SerializationUtil.java | 7 +- .../common_static/base/vtec/ActiveTable.py | 5 +- .../common_static/base/vtec/MergeVTEC.py | 14 +- .../res/spring/archiveadmim-request.xml | 14 +- ...m.raytheon.uf.edex.archive.cron.properties | 5 +- ...ArchiveCaseCreationAuthRequestHandler.java | 61 ++ .../gridcoverage/GetGridCoverageHandler.java | 14 +- .../uf/edex/plugin/grid/dao/GridDao.java | 24 +- .../META-INF/MANIFEST.MF | 1 + .../res/spring/textdbsrv-request.xml | 4 +- .../raytheon/uf/edex/services/TextDBSrv.java | 266 ++------ .../scripts/createGFEStartScript | 38 +- .../ServiceBackup/scripts/proc_receive_config | 38 +- .../uf/common/activetable/VTECChange.py | 7 + rpms/build/x86_64/build.sh | 8 +- 41 files changed, 1388 insertions(+), 921 deletions(-) create mode 100644 edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-common.xml create mode 100644 edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveCaseCreationAuthRequest.java create mode 100644 edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveCaseCreationAuthRequestHandler.java diff --git a/cave/build/static/common/cave/etc/aviation/python/TafDecoder.py b/cave/build/static/common/cave/etc/aviation/python/TafDecoder.py index 546bc1e59d..8673e0df9a 100644 --- a/cave/build/static/common/cave/etc/aviation/python/TafDecoder.py +++ b/cave/build/static/common/cave/etc/aviation/python/TafDecoder.py @@ -315,6 +315,10 @@ # Status: TEST # Title: AvnFPS: OB9.2 installation breaks mtrs.cfg file # +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 02APR2014 17211 zhao (code obtained from the listserver via Virgil that implements a new rule regarding CB, TS etc) +# # # import exceptions, re, time, types @@ -423,6 +427,8 @@ ddHH/ddHH)""", 60: """NSW not needed""", 61: """The period covered by a TAF shall not exceed 30 hours""", +81: """CB may only be mentioned when TS or VCTS mentioned +(NWSI 10-813, Appendix B, 1.2.7.3)""", } _Warnings = { \ @@ -1054,6 +1060,10 @@ class Decoder(tpg.VerboseParser): 'TS' in g['vcnty']['str']: if 'sky' not in g or 'CB' not in g['sky']['str']: raise Error(_Errors[11]) + if 'sky' in g and 'CB' in g['sky']['str']: + if ('pcp' not in g or 'TS' not in g['pcp']['str']) and \ + ('vcnty' not in g or 'TS' not in g['vcnty']['str']): + raise Error(_Errors[81]) def check_obv(self): # NWSI 10-813, 1.2.6 diff --git a/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/VectorRelatedPhrases.py b/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/VectorRelatedPhrases.py index 75f193fa4b..b974af9e9f 100644 --- a/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/VectorRelatedPhrases.py +++ b/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/VectorRelatedPhrases.py @@ -505,16 +505,16 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): def windSpdProb_thresholds(self, tree, node): return [ - ((50.0, 80.0), (40.0, 60.0)), # Per 1 - (45.0, 32.5), # Per 2 - (40.0, 25.0), # Per 3 - (35.0, 20.0), # Per 4 - (30.0, 15.0), # Per 5 - (25.0, 12.5), # Per 6 - (22.5, 10.0), # Per 7 - (20.0, 8.0), # Per 8 - (17.5, 6.0), # Per 9 - (15.0, 5.0), # Per 10 + ((45.0, 80.0), (25.0, 60.0)), # Per 1 + (35.0, 20.0), # Per 2 + (30.0, 15.0), # Per 3 + (25.0, 12.5), # Per 4 + (22.5, 10.0), # Per 5 + (20.0, 8.0), # Per 6 + (17.5, 7.0), # Per 7 + (15.0, 6.0), # Per 8 + (12.5, 5.0), # Per 9 + (10.0, 4.0), # Per 10 ] def firstComponentPeriod(self, tree, node): @@ -1130,7 +1130,7 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): desc = "posHR" elif maxMag >= 34.0: desc = "posTS" - elif pws64 >= thresh64low or pws64 +2.0 >= thresh64low: + elif pws64 >= thresh64low or pws64 +5.0 >= thresh64low: desc = "posHR" elif pws34 >= thresh34low or pws34+10.0 >= thresh34low: desc = "posTS" @@ -1203,7 +1203,7 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): desc = "posHR" elif maxMag >= 34.0: desc = "posTS" - elif pws64 >= thresh64 or pws64 +2.0 >= thresh64: + elif pws64 >= thresh64 or pws64 +5.0 >= thresh64: desc = "posHR" elif pws34 >= thresh34 or pws34+10.0 >= thresh34: desc = "posTS" @@ -1299,7 +1299,7 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): else: self.debug_print("HERE I AM") - if pws64 >= thresh64 or pws64+1.0 >= thresh64: + if pws64 >= thresh64 or pws64+2.5 >= thresh64: desc = "posHR" elif maxMag >= 64.0: desc = "posHR" @@ -1399,7 +1399,7 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): else: self.debug_print("HERE I AM") - if pws64 >= thresh64 or pws64+1 >= thresh64: + if pws64 >= thresh64 or pws64+2.5 >= thresh64: desc = "posHR" elif maxMag >= 64.0: desc = "posHR" @@ -1435,14 +1435,18 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): self.debug_print("(34 kt threshold, 64 kt threshold) = (%.2f, %.2f)" % (thresh34, thresh64), 1) - if (pws64 >= thresh64 or (pws64 + 1.0) >= thresh64) and maxMag >= 20.0: + if (pws64 >= thresh64 or (pws64 + 1.0) >= thresh64): desc = "posHR" elif maxMag >= 64.0: desc = "posHR" - elif (pws34 >= thresh34 or (pws34 + 2.5) >= thresh34) and maxMag >= 20.0: + elif (self._Hurricane_A or self._Hurricane_W) and maxMag >= 50: + desc = "posHR" + elif (pws34 >= thresh34 or (pws34 + 2.5) >= thresh34): desc = "posTS" elif maxMag >= 34.0: desc = "posTS" + elif (self._Hurricane_A or self._Hurricane_W or self._TropStorm_A or self._TropStorm_W) and maxMag >= 25: + desc = "posTS" else: desc = "" @@ -1470,14 +1474,18 @@ class VectorRelatedPhrases(PhraseBuilder.PhraseBuilder): self.debug_print("(34 kt threshold, 64 kt threshold) = (%.2f, %.2f)" % (thresh34, thresh64), 1) - if (pws64 >= thresh64 or (pws64 + 1.0) >= thresh64) and maxMag >= 20.0: + if (pws64 >= thresh64 or (pws64 + 1.0) >= thresh64): desc = "posHR" elif maxMag >= 64.0: desc = "posHR" - elif (pws34 >= thresh34 or (pws34 + 2.5) >= thresh34) and maxMag >= 20.0: + elif (self._Hurricane_A or self._Hurricane_W) and maxMag >= 50: + desc = "posHR" + elif (pws34 >= thresh34 or (pws34 + 2.5) >= thresh34): desc = "posTS" elif maxMag >= 34.0: desc = "posTS" + elif (self._Hurricane_A or self._Hurricane_W or self._TropStorm_A or self._TropStorm_W) and maxMag >= 25: + desc = "posTS" else: desc = "" diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveCaseCreationDialogAction.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveCaseCreationDialogAction.java index 6f4167f384..57abb87eb4 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveCaseCreationDialogAction.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveCaseCreationDialogAction.java @@ -25,7 +25,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; -import com.raytheon.uf.common.archive.request.ArchiveAdminAuthRequest; +import com.raytheon.uf.common.archive.request.ArchiveCaseCreationAuthRequest; import com.raytheon.uf.common.auth.user.IUser; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -56,8 +56,12 @@ public class ArchiveCaseCreationDialogAction extends AbstractHandler { private final IUFStatusHandler statusHandler = UFStatus .getHandler(ArchiveCaseCreationDialogAction.class); + /** Dialog to display */ private CaseCreationDlg dialog; + /** Default case directory location. */ + private String caseDir; + /** Case Administration permission */ private final String PERMISSION = "archive.casecreation"; @@ -74,7 +78,7 @@ public class ArchiveCaseCreationDialogAction extends AbstractHandler { if (dialog == null || dialog.isDisposed()) { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); - dialog = new CaseCreationDlg(shell); + dialog = new CaseCreationDlg(shell, caseDir); dialog.open(); } else { dialog.bringToTop(); @@ -93,16 +97,25 @@ public class ArchiveCaseCreationDialogAction extends AbstractHandler { IUser user = UserController.getUserObject(); String msg = user.uniqueId() + " does not have permission to access archive case creation dialog."; - ArchiveAdminAuthRequest request = new ArchiveAdminAuthRequest(); + ArchiveCaseCreationAuthRequest request = new ArchiveCaseCreationAuthRequest(); request.setRoleId(PERMISSION); request.setNotAuthorizedMessage(msg); request.setUser(user); try { Object o = ThriftClient.sendPrivilegedRequest(request); - if (o instanceof ArchiveAdminAuthRequest) { - ArchiveAdminAuthRequest r = (ArchiveAdminAuthRequest) o; - return r.isAuthorized(); + if (o instanceof ArchiveCaseCreationAuthRequest) { + ArchiveCaseCreationAuthRequest r = (ArchiveCaseCreationAuthRequest) o; + if (r.isAuthorized()) { + this.caseDir = r.getCaseDirectory(); + return true; + } + } else { + statusHandler + .handle(Priority.ERROR, + String.format( + "Cannot validate user expected response type ArchiveCaseCreationAuthRequest, received %s", + o.getClass().getName())); } } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java index 2f7ccf2f82..206c69f2c6 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java @@ -38,6 +38,7 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; @@ -45,6 +46,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Spinner; import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; import com.raytheon.uf.common.archive.config.DisplayData; @@ -71,6 +73,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * Jul 24, 2013 #2221 rferrel Changes for select configuration. * Aug 06, 2013 #2222 rferrel Changes to display all selected data. * Aug 26, 2013 #2225 rferrel Make perspective independent and no longer modal. + * Mar 24, 2014 #2853 rferrel Populate case label directory with default value. + * Mar 26, 2014 32880 rferrerl Implement case compression and split. * * * @@ -79,6 +83,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; */ public class CaseCreationDlg extends AbstractArchiveDlg { + /** The case creation label's default directory. */ + private final String defaultCaseDir; + /** Start time label. */ private Label startTimeLbl; @@ -100,9 +107,8 @@ public class CaseCreationDlg extends AbstractArchiveDlg { /** Compression check box. */ private Button compressChk; - // TODO restore when Multi-file implemented. - // /** Break files check box. */ - // private Button breakFilesChk; + /** Break files check box. */ + private Button breakFilesChk; /** Button to save new select case configuration. */ private Button saveAsBtn; @@ -113,17 +119,14 @@ public class CaseCreationDlg extends AbstractArchiveDlg { /** Button to delete select case configuration. */ private Button deleteBtn; - // TODO restore when Multi-file implemented. - // /** File size spinner control. */ - // private Spinner fileSizeSpnr; + /** File size spinner control. */ + private Spinner fileSizeSpnr; - // TODO restore when Multi-file implemented. - // /** File size combo box. */ - // private Combo fileSizeCbo; + /** File size combo box. */ + private Combo fileSizeCbo; - // TODO restore when Multi-file implemented. - // /** Maximum file size label. */ - // private Label maxFileSizeLbl; + /** Maximum file size label. */ + private Label maxFileSizeLbl; /** Directory location label. */ private Label locationLbl; @@ -168,13 +171,14 @@ public class CaseCreationDlg extends AbstractArchiveDlg { * @param parentShell * Parent shell. */ - public CaseCreationDlg(Shell parentShell) { + public CaseCreationDlg(Shell parentShell, String defaultCaseDir) { super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.DO_NOT_BLOCK | CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT | CAVE.INDEPENDENT_SHELL); this.type = Type.Case; this.setSelect = false; this.type = Type.Case; + this.defaultCaseDir = defaultCaseDir; } /* @@ -372,60 +376,58 @@ public class CaseCreationDlg extends AbstractArchiveDlg { */ compressChk = new Button(compressionComp, SWT.CHECK); compressChk.setText("Compress Files"); - // TODO restore when Multi-file implemented. - // compressChk.addSelectionListener(new SelectionAdapter() { - // @Override - // public void widgetSelected(SelectionEvent e) { - // handleCompressSelection(); - // } - // }); + compressChk.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + handleCompressSelection(); + } + }); - // TODO restore when Multi-file implemented. - // gd = new GridData(); - // gd.horizontalIndent = 20; - // breakFilesChk = new Button(compressionComp, SWT.CHECK); - // breakFilesChk.setText("Break into multiple files"); - // breakFilesChk.setLayoutData(gd); - // breakFilesChk.setEnabled(false); - // breakFilesChk.addSelectionListener(new SelectionAdapter() { - // @Override - // public void widgetSelected(SelectionEvent e) { - // handleBreakFilesSelection(breakFilesChk.getSelection()); - // } - // }); + gd = new GridData(); + gd.horizontalIndent = 20; + breakFilesChk = new Button(compressionComp, SWT.CHECK); + breakFilesChk.setText("Break into multiple files"); + breakFilesChk.setLayoutData(gd); + breakFilesChk.setEnabled(false); + breakFilesChk.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + handleBreakFilesSelection(breakFilesChk.getSelection()); + } + }); - // Composite maxFileSizeComp = new Composite(compressionComp, SWT.NONE); - // gl = new GridLayout(3, false); - // gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); - // gd.horizontalIndent = 20; - // maxFileSizeComp.setLayout(gl); - // maxFileSizeComp.setLayoutData(gd); - // - // maxFileSizeLbl = new Label(maxFileSizeComp, SWT.NONE); - // maxFileSizeLbl.setText("Max File Size: "); - // maxFileSizeLbl.setEnabled(false); - // - // gd = new GridData(60, SWT.DEFAULT); - // fileSizeSpnr = new Spinner(maxFileSizeComp, SWT.BORDER); - // fileSizeSpnr.setIncrement(1); - // fileSizeSpnr.setPageIncrement(50); - // fileSizeSpnr.setMaximum(2000); - // fileSizeSpnr.setMinimum(500); - // fileSizeSpnr.setLayoutData(gd); - // fileSizeSpnr.setEnabled(false); - // - // fileSizeCbo = new Combo(maxFileSizeComp, SWT.VERTICAL | SWT.DROP_DOWN - // | SWT.BORDER | SWT.READ_ONLY); - // fileSizeCbo.setEnabled(false); - // fileSizeCbo.addSelectionListener(new SelectionAdapter() { - // @Override - // public void widgetSelected(SelectionEvent e) { - // handleFileSizeChangeSelection(); - // } - // }); - // fileSizeCbo.add("MB"); - // fileSizeCbo.add("GB"); - // fileSizeCbo.select(0); + Composite maxFileSizeComp = new Composite(compressionComp, SWT.NONE); + gl = new GridLayout(3, false); + gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + gd.horizontalIndent = 20; + maxFileSizeComp.setLayout(gl); + maxFileSizeComp.setLayoutData(gd); + + maxFileSizeLbl = new Label(maxFileSizeComp, SWT.NONE); + maxFileSizeLbl.setText("Max File Size: "); + maxFileSizeLbl.setEnabled(false); + + gd = new GridData(60, SWT.DEFAULT); + fileSizeSpnr = new Spinner(maxFileSizeComp, SWT.BORDER); + fileSizeSpnr.setIncrement(1); + fileSizeSpnr.setPageIncrement(50); + fileSizeSpnr.setMaximum(2000); + fileSizeSpnr.setMinimum(500); + fileSizeSpnr.setLayoutData(gd); + fileSizeSpnr.setEnabled(false); + + fileSizeCbo = new Combo(maxFileSizeComp, SWT.VERTICAL | SWT.DROP_DOWN + | SWT.BORDER | SWT.READ_ONLY); + fileSizeCbo.setEnabled(false); + fileSizeCbo.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + handleFileSizeChangeSelection(); + } + }); + fileSizeCbo.add("MB"); + fileSizeCbo.add("GB"); + fileSizeCbo.select(0); } /** @@ -648,14 +650,9 @@ public class CaseCreationDlg extends AbstractArchiveDlg { List displayDatas = getSelectedData(); boolean doCompress = compressChk.getSelection(); - // TODO restore once Multi-file implemented. - // boolean doMultiFiles = breakFilesChk.getSelection(); - // int compressSize = fileSizeSpnr.getSelection(); - // String sizeType = - // fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()); - boolean doMultiFiles = false; - int compressSize = 500; - String sizeType = "MB"; + boolean doMultiFiles = breakFilesChk.getSelection(); + int compressSize = fileSizeSpnr.getSelection(); + String sizeType = fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()); setCursorBusy(true); if (generateCaseDlg == null || generateCaseDlg.isDisposed()) { @@ -698,19 +695,18 @@ public class CaseCreationDlg extends AbstractArchiveDlg { } - // TODO restore when Multi-file implemented. - // /** - // * Enable/Disable controls based on the compression check box. - // */ - // private void handleCompressSelection() { - // if (compressChk.getSelection()) { - // handleBreakFilesSelection(breakFilesChk.getSelection()); - // } else { - // handleBreakFilesSelection(false); - // } - // - // breakFilesChk.setEnabled(compressChk.getSelection()); - // } + /** + * Enable/Disable controls based on the compression check box. + */ + private void handleCompressSelection() { + if (compressChk.getSelection()) { + handleBreakFilesSelection(breakFilesChk.getSelection()); + } else { + handleBreakFilesSelection(false); + } + + breakFilesChk.setEnabled(compressChk.getSelection()); + } /** * Bring up modal dialog to get the case's directory name. @@ -749,18 +745,17 @@ public class CaseCreationDlg extends AbstractArchiveDlg { } } - // TODO restore when Multi-file implemented. - // /** - // * Enable/Disable file size controls. - // * - // * @param enabled - // * Enabled flag. - // */ - // private void handleBreakFilesSelection(boolean enabled) { - // maxFileSizeLbl.setEnabled(enabled); - // fileSizeSpnr.setEnabled(enabled); - // fileSizeCbo.setEnabled(enabled); - // } + /** + * Enable/Disable file size controls. + * + * @param enabled + * Enabled flag. + */ + private void handleBreakFilesSelection(boolean enabled) { + maxFileSizeLbl.setEnabled(enabled); + fileSizeSpnr.setEnabled(enabled); + fileSizeCbo.setEnabled(enabled); + } /** * Enables the generate button will user has entered all needed elements. @@ -772,36 +767,35 @@ public class CaseCreationDlg extends AbstractArchiveDlg { } } - // TODO restore when Multi-file implemented. - // /** - // * Action performed when the file size has changed. - // */ - // private void handleFileSizeChangeSelection() { - // /* - // * If the same item was selected just return. - // */ - // if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals( - // (String) fileSizeCbo.getData())) { - // return; - // } - // - // if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals("MB")) { - // fileSizeSpnr.setIncrement(1); - // fileSizeSpnr.setPageIncrement(50); - // fileSizeSpnr.setMaximum(2000); - // fileSizeSpnr.setMinimum(500); - // fileSizeSpnr.setSelection(500); - // } else { - // fileSizeSpnr.setIncrement(1); - // fileSizeSpnr.setPageIncrement(5); - // fileSizeSpnr.setMinimum(1); - // fileSizeSpnr.setMaximum(10); - // fileSizeSpnr.setSelection(1); - // } - // - // fileSizeCbo - // .setData(fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex())); - // } + /** + * Action performed when the file size has changed. + */ + private void handleFileSizeChangeSelection() { + /* + * If the same item was selected just return. + */ + if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals( + (String) fileSizeCbo.getData())) { + return; + } + + if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals("MB")) { + fileSizeSpnr.setIncrement(1); + fileSizeSpnr.setPageIncrement(50); + fileSizeSpnr.setMaximum(2000); + fileSizeSpnr.setMinimum(500); + fileSizeSpnr.setSelection(500); + } else { + fileSizeSpnr.setIncrement(1); + fileSizeSpnr.setPageIncrement(5); + fileSizeSpnr.setMinimum(1); + fileSizeSpnr.setMaximum(10); + fileSizeSpnr.setSelection(1); + } + + fileSizeCbo + .setData(fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex())); + } /** * Display the directory browser dialog. @@ -810,6 +804,15 @@ public class CaseCreationDlg extends AbstractArchiveDlg { DirectoryDialog dlg = new DirectoryDialog(shell, SWT.OPEN); dlg.setText("Case Location"); String dirName = dlg.open(); + updateLocationLbl(dirName); + } + + /** + * Update the case label and fields dependent on the change. + * + * @param dirName + */ + private void updateLocationLbl(String dirName) { if (dirName != null) { locationLbl.setText(trimDirectoryName(dirName)); locationLbl.setToolTipText(dirName); @@ -1009,4 +1012,26 @@ public class CaseCreationDlg extends AbstractArchiveDlg { super.clearModified(); saveBtn.setEnabled(false); } + + /* + * (non-Javadoc) + * + * @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#opened() + */ + @Override + protected void opened() { + super.opened(); + File caseDir = new File(defaultCaseDir); + if (caseDir.isDirectory()) { + updateLocationLbl(defaultCaseDir); + } else { + MessageDialog + .openError( + shell, + "Error", + String.format( + "Unable to find Case Location directory:\n%s\nMay need to mount the directory.", + defaultCaseDir)); + } + } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java index 2dc0b715b2..04ee31c179 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.zip.GZIPOutputStream; +import org.apache.commons.compress.archivers.ArchiveException; import org.apache.commons.compress.archivers.ArchiveOutputStream; import org.apache.commons.compress.archivers.ArchiveStreamFactory; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; @@ -62,6 +63,8 @@ import com.raytheon.uf.common.archive.config.DisplayData; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.ITimer; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; @@ -82,6 +85,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * implementation of compression. * Oct 08, 2013 2442 rferrel Remove category directory. * Feb 04, 2013 2270 rferrel Move HDF files to parent's directory. + * Mar 26, 2014 2880 rferrel Compress and split cases implemented. * * * @@ -130,9 +134,8 @@ public class GenerateCaseDlg extends CaveSWTDialog { /** When true break the compress file into multiple files. */ private final boolean doMultiFiles; - // Needed when compress and split implemented - // /** The compress size for multiple files. */ - // private final long splitSize; + /** The compress size for multiple files. */ + private final long splitSize; /** Job to perform the case generation off of the UI thread. */ private GenerateJob generateJob; @@ -174,8 +177,7 @@ public class GenerateCaseDlg extends CaveSWTDialog { this.doCompress = doCompress; this.doMultiFiles = doMultiFiles; - // Needed when compress and split implemented. - // this.splitSize = splitSize; + this.splitSize = splitSize; this.caseName = caseDir.getAbsolutePath().substring( targetDir.getAbsolutePath().length() + 1); setText("Generating - " + caseName); @@ -412,6 +414,9 @@ public class GenerateCaseDlg extends CaveSWTDialog { String currentCategory = null; boolean updateDestDir = false; + ITimer timer = TimeUtil.getTimer(); + timer.start(); + try { for (DisplayData displayData : sourceDataList) { if (shutdown.get()) { @@ -436,7 +441,7 @@ public class GenerateCaseDlg extends CaveSWTDialog { if (!doCompress) { caseCopy = new CopyMove(); } else if (doMultiFiles) { - caseCopy = new CompressAndSplitCopy(); + caseCopy = new CompressAndSplitCopy(splitSize); } else { caseCopy = new CompressCopy(); } @@ -478,11 +483,18 @@ public class GenerateCaseDlg extends CaveSWTDialog { if (caseCopy != null) { try { caseCopy.finishCase(); - } catch (CaseCreateException ex) { + } catch (Exception ex) { // Ignore } caseCopy = null; } + timer.stop(); + if (statusHandler.isPriorityEnabled(Priority.INFO)) { + String message = String.format("Case %s took %s.", + caseDir.getName(), + TimeUtil.prettyDuration(timer.getElapsedTime())); + statusHandler.handle(Priority.INFO, message); + } } return Status.OK_STATUS; @@ -504,6 +516,8 @@ public class GenerateCaseDlg extends CaveSWTDialog { * This class copies selected files/directories to a case-directory/archive. */ private static class CopyMove implements ICaseCopy { + private final IUFStatusHandler statusHandler; + /** * Flag to indicate user canceled the case generation. */ @@ -519,6 +533,13 @@ public class GenerateCaseDlg extends CaveSWTDialog { */ private int startRelativePath; + /** + * Constructor. + */ + public CopyMove() { + statusHandler = UFStatus.getHandler(this.getClass()); + } + /** * Copy source File to desired destination. * @@ -531,6 +552,16 @@ public class GenerateCaseDlg extends CaveSWTDialog { return; } + if (!source.exists()) { + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + String message = String.format( + "Purged and unable to place in case: %s", + source.getAbsoluteFile()); + statusHandler.handle(Priority.DEBUG, message); + } + return; + } + if (source.isDirectory()) { if (!destination.exists()) { @@ -554,6 +585,11 @@ public class GenerateCaseDlg extends CaveSWTDialog { } } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#copy(java.io.File) + */ @Override public void copy(File source) throws CaseCreateException { String relativePath = source.getAbsolutePath().substring( @@ -563,10 +599,17 @@ public class GenerateCaseDlg extends CaveSWTDialog { destination.getParentFile().mkdirs(); copyFile(source, destination); } catch (IOException ex) { - throw new CaseCreateException("CopyMove.copy: ", ex); + throw new CaseCreateException("Copy Move ", ex); } } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#startCase(java.io.File, + * com.raytheon.uf.common.archive.config.DisplayData, + * java.util.concurrent.atomic.AtomicBoolean) + */ @Override public void startCase(File caseDir, DisplayData displayData, AtomicBoolean shutdown) { @@ -578,6 +621,11 @@ public class GenerateCaseDlg extends CaveSWTDialog { startRelativePath = displayData.getRootDir().length(); } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#finishCase() + */ @Override public void finishCase() { // Nothing to do. @@ -587,55 +635,79 @@ public class GenerateCaseDlg extends CaveSWTDialog { /** * This class takes selected directories/files to * case-directory/archive/compress-category-file. The compress-category-file - * is a tar gzip file containing the categorie's data. + * is a tar gzip file containing the category's data. */ private static class CompressCopy implements ICaseCopy { + private final IUFStatusHandler statusHandler; + /** * Flag to indicate user canceled case generation. */ - private AtomicBoolean shutdown; + protected AtomicBoolean shutdown; /** * Top Level destination directory. */ - private File destDir; + protected File destDir; /** * Stream to the file being created. */ - private FileOutputStream fileStream; + protected FileOutputStream fileStream; /** * Stream to perform the compression. */ - private GZIPOutputStream zipStream; + protected GZIPOutputStream zipStream; /** * Stream to create the tar image. */ - private ArchiveOutputStream tarStream; + protected ArchiveOutputStream tarStream; + + /** + * The category directory name used to generate tar file name(s). + */ + protected String categoryDirName; /** * Index to start of relative path in source File. */ - private int startRelativePath; + protected int startRelativePath; /** * Directories already created in the tar image. */ - private final HashSet tarDirFile = new HashSet(); + protected final HashSet tarDirFile = new HashSet(); /** * Buffer to use for reading in a file. */ - private final byte[] buffer = new byte[(int) (32 * FileUtils.ONE_KB)]; + protected final byte[] buffer = new byte[(int) (32 * FileUtils.ONE_KB)]; + /** + * Current tar file being created. + */ + protected File tarFile; + + /** + * Constructor. + */ + public CompressCopy() { + this.statusHandler = UFStatus.getHandler(this.getClass()); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#copy(java.io.File) + */ @Override public void copy(File source) throws CaseCreateException { try { addParentDir(source); addTarFiles(new File[] { source }); - } catch (IOException e) { + } catch (Exception e) { throw new CaseCreateException("Compress Copy failed: ", e); } } @@ -645,14 +717,26 @@ public class GenerateCaseDlg extends CaveSWTDialog { * * @param files * @throws IOException + * @throws ArchiveException + * @throws CaseCreateException */ - private void addTarFiles(File[] files) throws IOException { + private void addTarFiles(File[] files) throws IOException, + ArchiveException { for (File file : files) { if (shutdown.get()) { return; } String name = file.getAbsolutePath().substring( startRelativePath); + if (!file.exists()) { + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + String message = String.format( + "Purged and unable to place in case: %s", + file.getAbsoluteFile()); + statusHandler.handle(Priority.DEBUG, message); + } + continue; + } if (file.isDirectory()) { if (!tarDirFile.contains(file)) { TarArchiveEntry entry = new TarArchiveEntry(file, name); @@ -662,6 +746,7 @@ public class GenerateCaseDlg extends CaveSWTDialog { addTarFiles(file.listFiles()); } } else { + checkFit(file); // DR 2270 bump HDF files up a directory. if (name.endsWith(hdfExt)) { File destination = new File(file.getParentFile() @@ -695,7 +780,7 @@ public class GenerateCaseDlg extends CaveSWTDialog { * * @param stream */ - private void closeStream(Closeable stream) { + protected void closeStream(Closeable stream) { try { stream.close(); } catch (IOException ex) { @@ -703,13 +788,21 @@ public class GenerateCaseDlg extends CaveSWTDialog { } } + /** + * Allows sub-class to check to see if file will fit in the current tar + * file and if needed setup new tar file. + */ + protected void checkFit(File file) throws IOException, ArchiveException { + // Do not change the tar file. + } + /** * If needed add parent directories to the tar image. * * @param file * @throws IOException */ - private void addParentDir(File file) throws IOException { + protected void addParentDir(File file) throws IOException { File parent = file.getParentFile(); if (parent != null && !tarDirFile.contains(parent) && (parent.getAbsolutePath().length() > startRelativePath)) { @@ -723,6 +816,13 @@ public class GenerateCaseDlg extends CaveSWTDialog { } } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#startCase(java.io.File, + * com.raytheon.uf.common.archive.config.DisplayData, + * java.util.concurrent.atomic.AtomicBoolean) + */ @Override public void startCase(File caseDir, DisplayData displayData, AtomicBoolean shutdown) throws CaseCreateException { @@ -730,30 +830,67 @@ public class GenerateCaseDlg extends CaveSWTDialog { this.shutdown = shutdown; String archiveDirName = ArchiveConstants .convertToFileName(displayData.getArchiveName()); - String categoryDirName = ArchiveConstants + categoryDirName = ArchiveConstants .convertToFileName(displayData.getCategoryName()); destDir = new File(caseDir, archiveDirName); destDir.mkdirs(); - tarDirFile.clear(); startRelativePath = displayData.getRootDir().length(); - File tarFile = new File(destDir, categoryDirName - + ArchiveConstants.TAR_EXTENSION); - fileStream = new FileOutputStream(tarFile); - zipStream = new GZIPOutputStream(fileStream); - ArchiveStreamFactory factory = new ArchiveStreamFactory(); - tarStream = factory.createArchiveOutputStream( - ArchiveStreamFactory.TAR, zipStream); - if (tarStream instanceof TarArchiveOutputStream) { - ((TarArchiveOutputStream) tarStream) - .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); - } + openStreams(); } catch (Exception e) { - throw new CaseCreateException("CompressCopy.startCase: ", e); + throw new CaseCreateException("Compress Copy start case: ", e); } } + /** + * Determine a new tar file and set up its streams. + * + * @throws IOException + * @throws ArchiveException + */ + protected void openStreams() throws IOException, ArchiveException { + tarDirFile.clear(); + tarFile = getTarFile(); + fileStream = new FileOutputStream(tarFile); + zipStream = new GZIPOutputStream(fileStream); + ArchiveStreamFactory factory = new ArchiveStreamFactory(); + tarStream = factory.createArchiveOutputStream( + ArchiveStreamFactory.TAR, zipStream); + if (tarStream instanceof TarArchiveOutputStream) { + ((TarArchiveOutputStream) tarStream) + .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + } + } + + /** + * Determine new tar file. + * + * @return tarFile + */ + protected File getTarFile() { + return new File(destDir, categoryDirName + + ArchiveConstants.TAR_EXTENSION); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.ICaseCopy#finishCase() + */ @Override public void finishCase() throws CaseCreateException { + try { + closeStreams(); + } catch (IOException e) { + throw new CaseCreateException("Compress Copy finish: ", e); + } + } + + /** + * Close all the streams for current tar file. + * + * @throws IOException + */ + protected void closeStreams() throws IOException { try { if (tarStream != null) { tarStream.finish(); @@ -761,8 +898,6 @@ public class GenerateCaseDlg extends CaveSWTDialog { if (zipStream != null) { zipStream.finish(); } - } catch (IOException e) { - throw new CaseCreateException("CaseCopy.finish: ", e); } finally { if (tarStream != null) { closeStream(tarStream); @@ -780,315 +915,89 @@ public class GenerateCaseDlg extends CaveSWTDialog { /* * This class intended for making "image" files read for burning to a CD or - * DVD. Need to resolve issues on how this should be done. + * DVD. */ - private static class CompressAndSplitCopy implements ICaseCopy { + private static class CompressAndSplitCopy extends CompressCopy { + /** + * Number of bytes to back off the split limit to allow finishing the + * tar without exceeding the limit. + */ + private final long BACK_OFF_BYTES = 5 * FileUtils.ONE_KB; + /** + * Maximum bytes for a tar file. + */ + private final long splitSize; + + /** + * Count of tar files for a category. + */ + private int fileCnt = 0; + + /** + * Constructor. + * + * @param splitSize + */ + public CompressAndSplitCopy(long splitSize) { + super(); + this.splitSize = splitSize - BACK_OFF_BYTES; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.archive.ui.GenerateCaseDlg.CompressCopy#startCase + * (java.io.File, com.raytheon.uf.common.archive.config.DisplayData, + * java.util.concurrent.atomic.AtomicBoolean) + */ + @Override public void startCase(File caseDir, DisplayData displayData, AtomicBoolean shutdown) throws CaseCreateException { - throw new CaseCreateException( - "Compress and split not yet implemented."); + this.fileCnt = 0; + super.startCase(caseDir, displayData, shutdown); } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.archive.ui.GenerateCaseDlg.CompressCopy#getTarFile + * () + */ @Override - public void copy(File source) throws CaseCreateException { - // TODO Auto-generated method stub - + protected File getTarFile() { + int cnt = ++fileCnt; + String name = String.format("%s_%03d%s", categoryDirName, cnt, + ArchiveConstants.TAR_EXTENSION); + return new File(destDir, name); } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.archive.ui.GenerateCaseDlg.CompressCopy#checkFit + * (java.io.File) + */ @Override - public void finishCase() { - // TODO Auto-generated method stub + protected void checkFit(File file) throws IOException, ArchiveException { + // force update of tarFile length. + tarStream.flush(); + zipStream.flush(); + fileStream.flush(); + + /* + * Most likely over estimates the size since it is unknown how well + * file will compress. + */ + long size = tarFile.length() + file.length(); + if (size >= splitSize) { + closeStreams(); + openStreams(); + addParentDir(file); + } } - - // TODO Example code for future implementation of this class. - // Will need to break up into the starCase, copy and finishCase will - // need close and join. - - // private void compressAndSplitCase() { - // ArchiveOutputStream tarStream = null; - // GZIPOutputStream zipStream = null; - // try { - // Pipe pipe = Pipe.open(); - // OutputStream poStream = Channels.newOutputStream(pipe.sink()); - // zipStream = new GZIPOutputStream(poStream); - // ArchiveStreamFactory factory = new ArchiveStreamFactory(); - // - // tarStream = factory.createArchiveOutputStream( - // ArchiveStreamFactory.TAR, zipStream); - // - // if (tarStream instanceof TarArchiveOutputStream) { - // ((TarArchiveOutputStream) tarStream) - // .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); - // } - // - // final InputStream piStream = Channels.newInputStream(pipe - // .source()); - // splitDone.set(false); - // - // Job splitJob = new Job("Split") { - // - // @Override - // protected IStatus run(IProgressMonitor monitor) { - // OutputStream splitStream = null; - // long totSize = 0; - // try { - // byte[] buffer = new byte[12 * 1024]; - // - // int bufCnt = 0; - // long splitCnt = 0L; - // while ((bufCnt = piStream.read(buffer)) != -1) { - // totSize += bufCnt; - // if (splitStream == null) { - // splitStream = openSplitFile(++numSplitFiles); - // } - // long fileSize = splitCnt + bufCnt; - // if (fileSize < splitSize) { - // splitStream.write(buffer, 0, bufCnt); - // splitCnt = fileSize; - // } else if (fileSize == splitSize) { - // splitStream.write(buffer, 0, bufCnt); - // splitStream.close(); - // splitStream = null; - // splitCnt = 0L; - // } else { - // int cnt = (int) (splitSize - splitCnt); - // splitStream.write(buffer, 0, cnt); - // splitStream.close(); - // splitStream = openSplitFile(++numSplitFiles); - // int remainder = bufCnt - cnt; - // splitStream.write(buffer, cnt, remainder); - // splitCnt = remainder; - // } - // } - // } catch (IOException e) { - // statusHandler.handle(Priority.PROBLEM, - // e.getLocalizedMessage(), e); - // } finally { - // if (splitStream != null) { - // try { - // splitStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // splitDone.set(true); - // System.out.println("totalSize: " + totSize - // + ", splitSize: " + splitSize - // + ", numSplitFiles: " + numSplitFiles); - // } - // - // return Status.OK_STATUS; - // } - // }; - // splitJob.schedule(); - // - // createTarFile(tarStream, caseDir.listFiles()); - // tarStream.finish(); - // zipStream.finish(); - // try { - // tarStream.close(); - // } catch (IOException ex) { - // // Ignore - // } - // tarStream = null; - // - // try { - // zipStream.close(); - // } catch (IOException ex) { - // // Ignore - // } - // zipStream = null; - // - // while (!splitDone.get()) { - // if (splitJob.getState() == Job.RUNNING) { - // try { - // System.out.println("splitJob.join()"); - // splitJob.join(); - // } catch (InterruptedException e) { - // statusHandler.handle(Priority.INFO, - // e.getLocalizedMessage(), e); - // } - // } else { - // try { - // private void compressAndSplitCase() { - // ArchiveOutputStream tarStream = null; - // GZIPOutputStream zipStream = null; - // try { - // Pipe pipe = Pipe.open(); - // OutputStream poStream = Channels.newOutputStream(pipe.sink()); - // zipStream = new GZIPOutputStream(poStream); - // ArchiveStreamFactory factory = new ArchiveStreamFactory(); - // - // tarStream = factory.createArchiveOutputStream( - // ArchiveStreamFactory.TAR, zipStream); - // - // if (tarStream instanceof TarArchiveOutputStream) { - // ((TarArchiveOutputStream) tarStream) - // .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); - // } - // - // final InputStream piStream = Channels.newInputStream(pipe - // .source()); - // splitDone.set(false); - // - // Job splitJob = new Job("Split") { - // - // @Override - // protected IStatus run(IProgressMonitor monitor) { - // OutputStream splitStream = null; - // long totSize = 0; - // try { - // byte[] buffer = new byte[12 * 1024]; - // - // int bufCnt = 0; - // long splitCnt = 0L; - // while ((bufCnt = piStream.read(buffer)) != -1) { - // totSize += bufCnt; - // if (splitStream == null) { - // splitStream = openSplitFile(++numSplitFiles); - // } - // long fileSize = splitCnt + bufCnt; - // if (fileSize < splitSize) { - // splitStream.write(buffer, 0, bufCnt); - // splitCnt = fileSize; - // } else if (fileSize == splitSize) { - // splitStream.write(buffer, 0, bufCnt); - // splitStream.close(); - // splitStream = null; - // splitCnt = 0L; - // } else { - // int cnt = (int) (splitSize - splitCnt); - // splitStream.write(buffer, 0, cnt); - // splitStream.close(); - // splitStream = openSplitFile(++numSplitFiles); - // int remainder = bufCnt - cnt; - // splitStream.write(buffer, cnt, remainder); - // splitCnt = remainder; - // } - // } - // } catch (IOException e) { - // statusHandler.handle(Priority.PROBLEM, - // e.getLocalizedMessage(), e); - // } finally { - // if (splitStream != null) { - // try { - // splitStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // splitDone.set(true); - // System.out.println("totalSize: " + totSize - // + ", splitSize: " + splitSize - // + ", numSplitFiles: " + numSplitFiles); - // } - // - // return Status.OK_STATUS; - // } - // }; - // splitJob.schedule(); - // - // createTarFile(tarStream, caseDir.listFiles()); - // tarStream.finish(); - // zipStream.finish(); - // try { - // tarStream.close(); - // } catch (IOException ex) { - // // Ignore - // } - // tarStream = null; - // - // try { - // zipStream.close(); - // } catch (IOException ex) { - // // Ignore - // } - // zipStream = null; - // - // while (!splitDone.get()) { - // if (splitJob.getState() == Job.RUNNING) { - // try { - // System.out.println("splitJob.join()"); - // splitJob.join(); - // } catch (InterruptedException e) { - // statusHandler.handle(Priority.INFO, - // e.getLocalizedMessage(), e); - // } - // } else { - // try { - // Thread.sleep(200L); - // } catch (InterruptedException e) { - // statusHandler.handle(Priority.INFO, - // e.getLocalizedMessage(), e); - // } - // } - // } - // } catch (IOException e) { - // statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - // e); - // } catch (ArchiveException e1) { - // statusHandler.handle(Priority.PROBLEM, - // e1.getLocalizedMessage(), e1); - // } finally { - // if (tarStream != null) { - // try { - // tarStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // - // if (zipStream != null) { - // try { - // zipStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // } - // setProgressBar(100, SWT.NORMAL); - // deleteCaseDir(); - // String message = caseDir.getName() + "split into " + numSplitFiles - // + " file(s)."; - // setStateLbl(message, null); - // } - // Thread.sleep(200L); - // } catch (InterruptedException e) { - // statusHandler.handle(Priority.INFO, - // e.getLocalizedMessage(), e); - // } - // } - // } - // } catch (IOException e) { - // statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - // e); - // } catch (ArchiveException e1) { - // statusHandler.handle(Priority.PROBLEM, - // e1.getLocalizedMessage(), e1); - // } finally { - // if (tarStream != null) { - // try { - // tarStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // - // if (zipStream != null) { - // try { - // zipStream.close(); - // } catch (IOException e) { - // // Ignore - // } - // } - // } - // setProgressBar(100, SWT.NORMAL); - // deleteCaseDir(); - // String message = caseDir.getName() + "split into " + numSplitFiles - // + " file(s)."; - // setStateLbl(message, null); - // } - } } diff --git a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java index 59544005c7..6fac5cdf21 100644 --- a/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java +++ b/cave/com.raytheon.uf.viz.thinclient.cave/src/com/raytheon/uf/viz/thinclient/cave/refresh/ThinClientDataUpdateTree.java @@ -62,6 +62,7 @@ import com.raytheon.viz.grid.util.RadarAdapter; * ------------ ---------- ----------- -------------------------- * Dec 13, 2011 bsteffen Initial creation * Feb 21, 2014 DR 16744 D. Friedman Add radar/grid updates + * Apr 1, 2014 DR 17220 D. Friedman Handle uninitialized grid inventory * * * @@ -142,6 +143,10 @@ public class ThinClientDataUpdateTree extends DataUpdateTree { private void getRadarUpdates(String time, Set messages) { Set radarMessages = new HashSet(); Map metadata = RadarAdapter.getInstance().getUpdateConstraints(); + if (metadata == null) { + // Can happen if grid inventory has not been initialized + return; + } metadata = new HashMap(metadata); metadata.put("insertTime", new RequestConstraint(time, ConstraintType.GREATER_THAN)); diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ToolsDataManager.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ToolsDataManager.java index 0ea91fb874..c1db6598d2 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ToolsDataManager.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/ToolsDataManager.java @@ -84,6 +84,7 @@ import com.vividsolutions.jts.geom.LineString; * 10-21-09 #1711 bsteffen Initial Creation * 04-07-10 #4614 randerso Reworked to use localization files * 07-11-12 #875 rferrel Move points to PointsDataManager. + * 04-02-14 DR 16351 D. Friedman Fix updates to storm track from preferences. (backport from 14.2.2) * * * @@ -136,6 +137,8 @@ public class ToolsDataManager implements ILocalizationFileObserver, private Object stormLock = new Object(); + private boolean stormTrackDirty = false; + private String site; private LocalizationFile userToolsDir; @@ -232,7 +235,7 @@ public class ToolsDataManager implements ILocalizationFileObserver, public StormTrackData getStormTrackData() { synchronized (stormLock) { - if (stormData == null) { + if (stormData == null || stormTrackDirty) { loadStormData(); } return new StormTrackData(stormData); @@ -268,6 +271,7 @@ public class ToolsDataManager implements ILocalizationFileObserver, if (points != null) { setCoordinates(stormData, points); } + stormTrackDirty = false; } private void setCoordinates(StormTrackData data, String[] points) { @@ -664,6 +668,11 @@ public class ToolsDataManager implements ILocalizationFileObserver, } else if (P_STORMTRACK_SPEED.equals(key) && value instanceof Double) { stormData.setMotionSpeed((Double) value); + } else { + /* Incompatible value indicates update from preference + * store. We will want to reload. + */ + stormTrackDirty = true; } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java index 4d889be3c1..1afc58da53 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/GfeClient.java @@ -56,6 +56,10 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; * Aug 20, 2012 #1081 dgilling Don't pass -server and -site args * to python script. * Dec 04, 2013 #2588 dgilling Add thread to force shutdown. + * Mar 25, 2014 #2963 randerso Removed obsolete python_include support + * which was adding an empty string into the + * python path causing python to look in user's + * current default directory for modules. * * * @@ -104,19 +108,14 @@ public class GfeClient extends AbstractCAVEComponent { String pyVizDir = pathMgr.getFile(baseContext, "pyViz").getPath(); - String pyInclude = System.getProperty("python_include"); - if (pyInclude == null) { - pyInclude = ""; - } - String utilityDir = pathMgr.getFile(baseContext, com.raytheon.uf.common.util.FileUtil.join("gfe", "utility")) .getPath(); boolean includeUser = (!VizApp.getWsId().getUserName().equals("SITE")); - String includePath = PyUtil.buildJepIncludePath(true, pyInclude, - utilityDir, GfePyIncludeUtil.getCommonPythonIncludePath(), + String includePath = PyUtil.buildJepIncludePath(true, utilityDir, + GfePyIncludeUtil.getCommonPythonIncludePath(), GfePyIncludeUtil.getCommonGfeIncludePath(), GfePyIncludeUtil.getConfigIncludePath(includeUser), pyVizDir, GfePyIncludeUtil.getUtilitiesIncludePath(includeUser), diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/griddata/WeatherGridData.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/griddata/WeatherGridData.java index fd24fb53bf..18ffb80c8d 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/griddata/WeatherGridData.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/griddata/WeatherGridData.java @@ -68,6 +68,7 @@ import com.vividsolutions.jts.geom.MultiPolygon; * Jan 30, 2013 #15719 jdynina Allowed more than 128 chars in wx * strings * 02/19/2013 1637 randerso Added throws declarations to translateDataFrom + * 04/01/2014 17187 randerso (code checked in by zhao) To allow over 128 wx lements * * * @@ -902,19 +903,19 @@ public class WeatherGridData extends AbstractGridData implements INumpyable { } } } - // COMBINE mode is more difficult, have to do each one - else { - for (int i = 0; i < dim.x; i++) { - for (int j = 0; j < dim.y; j++) { - if (points.get(i, j) == 1) { - WeatherKey combined = new WeatherKey(key.get(values - .get(i, j))); - combined.addAll(doGetWeatherValue(i, j)); - grid.set(i, j, lookupKeyValue(combined)); - } - } - } - } + // COMBINE mode is more difficult, have to do each one + else { + for (int i = 0; i < dim.x; i++) { + for (int j = 0; j < dim.y; j++) { + if (points.get(i, j) == 1) { + WeatherKey combined = new WeatherKey( + key.get(0xFF & values.get(i, j))); + combined.addAll(doGetWeatherValue(i, j)); + grid.set(i, j, lookupKeyValue(combined)); + } + } + } + } setGrid(grid); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java index 98e82708bc..60e216cf2e 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java @@ -156,6 +156,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * update VTEC lines on products that * aren't being corrected. * 02/05/2014 17022 ryu Modified loadDraft() to fix merging of WMO heading and AWIPS ID. + * 03/25/2014 #2884 randerso Added xxxid to check for disabling editor * * * @@ -2728,20 +2729,31 @@ public class ProductEditorComp extends Composite implements && !msg.getMode().equals(ActiveTableMode.PRACTICE)) { return; } - List pils = VTECTableChangeNotification.DisableTable.get(pil); String brained = null; boolean allFound = false; String sid = getDefString("fullStationID"); - String pil = getDefString("pil"); - if (pil != null) { - pil = pil.substring(0, 3); + String pilxxx = getDefString("pil"); + String pil = null; + if (pilxxx != null) { + pil = pilxxx.substring(0, 3); + List pils = VTECTableChangeNotification.DisableTable + .get(pil); + + // append xxxId to pil for matching + if (pils != null) { + String xxxId = pilxxx.substring(3, pilxxx.length()); + for (int i = 0; i < pils.size(); i++) { + pils.set(i, pils.get(i) + xxxId); + } + } for (VTECChange m : msg.getChanges()) { if (m.getSite().equals("*ALL") || m.getPil().equals("*ALL*")) { allFound = true; } + String msgPilxxx = m.getPil() + m.getXxxid(); if (m.getSite().equals(sid)) { - if ((pils == null) && m.getPil().equals(pil)) { + if ((pils == null) && msgPilxxx.equals(pilxxx)) { if (brain()) { brained = m.getPil(); } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java index 8154c29cec..05325621e1 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/RadarAdapter.java @@ -82,6 +82,7 @@ import com.raytheon.viz.radar.util.StationUtils; * ------------ ---------- ----------- -------------------------- * Mar 23, 2010 #4473 rjpeter Initial creation * Feb 21, 2014 DR 16744 D. Friedman Add getUpdateConstraints + * Apr 1, 2014 DR 17220 D. Friedman Handle uninitialized grid inventory * * * @@ -398,6 +399,11 @@ public class RadarAdapter { } public Map getUpdateConstraints() { + RadarStation radarStation = getConfiguredRadar(); + if (radarStation == null) { + // Can happen if grid inventory has not been initialized + return null; + } RadarProductCodeMapping rpcMap = RadarProductCodeMapping.getInstance(); HashSet productCodes = new HashSet(); for (String abbrev : rpcMap.getParameterAbbrevs()) { @@ -406,8 +412,8 @@ public class RadarAdapter { Map rcMap = new HashMap(); rcMap.put(RadarAdapter.PLUGIN_NAME_QUERY, new RequestConstraint( RADAR_SOURCE)); - rcMap.put(ICAO_QUERY, new RequestConstraint(getConfiguredRadar() - .getRdaId().toLowerCase())); + rcMap.put(ICAO_QUERY, new RequestConstraint(radarStation.getRdaId() + .toLowerCase())); rcMap.put( PRODUCT_CODE_QUERY, new RequestConstraint(Arrays.toString(new ArrayList( diff --git a/edexOsgi/build.edex/esb/conf/log4j.xml b/edexOsgi/build.edex/esb/conf/log4j.xml index a8edd563ce..d474b811d2 100644 --- a/edexOsgi/build.edex/esb/conf/log4j.xml +++ b/edexOsgi/build.edex/esb/conf/log4j.xml @@ -27,16 +27,30 @@ - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -81,9 +95,14 @@ - - - + + + + + + + + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/python/MasterInterface.py b/edexOsgi/build.edex/esb/data/utility/common_static/base/python/MasterInterface.py index 40d6655c57..73afaa15ad 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/python/MasterInterface.py +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/python/MasterInterface.py @@ -34,11 +34,11 @@ # 10/20/08 njensen Initial Creation. # 01/17/13 1486 dgilling Make a new-style class. # 09/23/13 16614 njensen Fixed reload method -# -# +# 03/25/14 2963 randerso Added check to instantiate method to +# verify module contains desired class +# throw a useful error message if not # - import os, string import sys, inspect, traceback @@ -103,9 +103,13 @@ class MasterInterface(object): def isInstantiated(self, moduleName): return self.__instanceMap.has_key(moduleName) - def instantiate(self, moduleName, className, **kwargs): - instance = sys.modules[moduleName].__dict__.get(className)(**kwargs) - self.__instanceMap[moduleName] = instance + def instantiate(self, moduleName, className, **kwargs): + if sys.modules[moduleName].__dict__.has_key(className): + instance = sys.modules[moduleName].__dict__.get(className)(**kwargs) + self.__instanceMap[moduleName] = instance + else: + msg = "Module %s (in %s) has no class named %s" % (moduleName, sys.modules[moduleName].__file__, className) + raise Exception(msg) def runMethod(self, moduleName, className, methodName, **kwargs): instance = self.__instanceMap[moduleName] diff --git a/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py b/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py index ce0c0c2de0..de5c1b3016 100644 --- a/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py +++ b/edexOsgi/build.edex/esb/data/utility/edex_static/base/textproducts/templates/utility/SAF_Site_MultiPil_Definition.py @@ -48,6 +48,7 @@ VariableList = [ # If Flooding is "Yes", the system will insert a statement in the # product when FFA, FLW, or FLS is in effect. #("Flooding?" , "No", "radio", ["Yes","No"]), + #(("Include Tropical?", "includeTropical") , "No", "radio", ["Yes","No"]), ] #********************************************************************** diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/VTECTableChangeListener.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/VTECTableChangeListener.java index a12e6b15cd..7a06ba1b8d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/VTECTableChangeListener.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/notify/VTECTableChangeListener.java @@ -20,21 +20,26 @@ package com.raytheon.edex.plugin.gfe.server.notify; import java.util.List; +import java.util.Set; import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.VTECChange; import com.raytheon.uf.common.activetable.VTECTableChangeNotification; import com.raytheon.uf.common.dataplugin.gfe.textproduct.DraftProduct; +import com.raytheon.uf.common.localization.FileUpdatedMessage; +import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType; 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.PathManagerFactory; +import com.raytheon.uf.common.site.SiteMap; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.edex.core.EDEXUtil; +import com.raytheon.uf.edex.core.EdexException; /** * Listener to handle VTEC Table Change notifications @@ -45,7 +50,11 @@ import com.raytheon.uf.common.util.FileUtil; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jun 5, 2012 randerso Initial creation + * Jun 5, 2012 randerso Initial creation + * Mar 25, 2014 #2884 randerso Added xxxid to check for disabling drafts + * Fixed to work with sites other than the EDEX site + * Added work around to Localization not sending + * FileUpdatedMessages on EDEX * * * @@ -65,23 +74,32 @@ public class VTECTableChangeListener { } private void checkDrafts(ActiveTableMode tableName, VTECChange change) { - String siteid = change.getSite(); + String officeId = change.getSite(); String pil = change.getPil(); + String xxxid = change.getXxxid(); + String awipspil = officeId + pil + xxxid; // the KKKKCCCXXX statusHandler.handle(Priority.EVENTA, "checkDrafts: " + tableName + ":" - + siteid + ":" + pil); + + awipspil); String mode = "Standard"; if (tableName.equals(ActiveTableMode.PRACTICE)) { mode = "PRACTICE"; } - String awipspil = siteid + pil; // only the KKKKCCC + + Set siteList = SiteMap.getInstance() + .getSite3LetterIds(officeId); IPathManager pathMgr = PathManagerFactory.getPathManager(); - LocalizationContext siteContext = pathMgr.getContext( - LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); + LocalizationContext[] contexts = new LocalizationContext[siteList + .size()]; + int i = 0; + for (String siteId : siteList) { + contexts[i++] = pathMgr.getContextForSite( + LocalizationType.CAVE_STATIC, siteId); + } String path = FileUtil.join("gfe", "drafts"); - LocalizationFile[] inv = pathMgr.listFiles(siteContext, path, null, - false, true); + LocalizationFile[] inv = pathMgr.listFiles(contexts, path, null, false, + true); for (LocalizationFile lf : inv) { String[] tokens = lf.getFile().getName().split("-"); @@ -98,19 +116,35 @@ public class VTECTableChangeListener { boolean markit = false; - // attempt a match for the pil in the DisableTable of related pils + // attempt a match for the pil in the DisableTable of related + // pils List pils = VTECTableChangeNotification.DisableTable .get(pil); if (pils != null) { - markit = pils.contains(fpil.substring(4, 7)); - } else if (awipspil.equals(fpil.substring(0, 7))) { + markit = pils.contains(fpil.substring(4, 7)) + && xxxid.equals(fpil.substring(7, fpil.length())); + } else if (awipspil.equals(fpil)) { markit = true; - } else if (siteid.equals("*ALL*")) { + } else if (officeId.equals("*ALL*")) { + // This is for the clear hazards GUI. markit = true; } if (markit) { markDraft(lf); + + // TODO: remove sending of FileUpdateMessage after DR #2768 is + // fixed + try { + EDEXUtil.getMessageProducer().sendAsync( + "utilityNotify", + new FileUpdatedMessage(lf.getContext(), lf + .getName(), FileChangeType.UPDATED, lf + .getTimeStamp().getTime())); + } catch (EdexException e) { + statusHandler.handle(Priority.PROBLEM, + e.getLocalizedMessage(), e); + } } } } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/spcGuideNDFD.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/spcGuideNDFD.xml index 5c63bc010f..d15c9fed34 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/spcGuideNDFD.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/parameterInfo/spcGuideNDFD.xml @@ -110,7 +110,7 @@ SFC - + hailprob Hail Probability % @@ -123,8 +123,8 @@ SFC - - + + windprob Damaging Wind Probability % @@ -137,8 +137,8 @@ SFC - - + + sigtrndprob Extreme Tornado Probability % @@ -151,8 +151,8 @@ SFC - - + + sighailprob Extreme Hail Probability % @@ -165,8 +165,8 @@ SFC - - + + sigwindprob Extreme Damaging Wind Probability % @@ -179,8 +179,8 @@ SFC - - + + prsvr Combined Severe Probability % @@ -193,8 +193,8 @@ SFC - - + + prsigsv Combined Extreme Severe Probability % @@ -208,5 +208,5 @@ SFC - + diff --git a/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-common.xml b/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-common.xml new file mode 100644 index 0000000000..93eab522f6 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-common.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-request.xml b/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-request.xml index 2639e15829..63a9f1fb2a 100644 --- a/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-request.xml +++ b/edexOsgi/com.raytheon.edex.utilitysrv/res/spring/utility-request.xml @@ -37,14 +37,4 @@ - - - - - - - - - - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/VTECChange.java b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/VTECChange.java index a9c99c6a20..391f2cf1b9 100644 --- a/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/VTECChange.java +++ b/edexOsgi/com.raytheon.uf.common.activetable/src/com/raytheon/uf/common/activetable/VTECChange.java @@ -22,6 +22,23 @@ package com.raytheon.uf.common.activetable; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * VTEC Change container for VTECTableChangeNotification + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 26, 2014            randerso    Initial creation
+ * Mar 25, 2014 #2884      randerso    Added xxxid to VTECChange
+ * 
+ * 
+ * + * @author randerso + * @version 1.0 + */ @DynamicSerialize public class VTECChange { @DynamicSerializeElement @@ -33,13 +50,17 @@ public class VTECChange { @DynamicSerializeElement private String phensig; + @DynamicSerializeElement + private String xxxid; + public VTECChange() { } - public VTECChange(String site, String pil, String phensig) { + public VTECChange(String site, String pil, String phensig, String xxxid) { this.site = site; this.pil = pil; this.phensig = phensig; + this.xxxid = xxxid; } public String getSite() { @@ -54,6 +75,10 @@ public class VTECChange { return phensig; } + public String getXxxid() { + return xxxid; + } + public void setSite(String site) { this.site = site; } @@ -66,10 +91,14 @@ public class VTECChange { this.phensig = phensig; } + public void setXxxid(String xxxid) { + this.xxxid = xxxid; + } + @Override public String toString() { - return String.format("(Site:%s, Pil:%s, PhenSig:%s)", site, pil, - phensig); + return String.format("(Site:%s, Pil:%s, PhenSig:%s, xxxID:%s)", site, + pil, phensig, xxxid); } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java index 1c6166dae0..9f9eb8291e 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java @@ -31,9 +31,11 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TimeZone; import java.util.TreeMap; import java.util.regex.Matcher; @@ -65,6 +67,7 @@ import com.raytheon.uf.common.localization.exception.LocalizationOpFailedExcepti import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.FileUtil; @@ -89,6 +92,8 @@ import com.raytheon.uf.common.util.FileUtil; * Aug 28, 2013 2299 rferrel purgeExpiredFromArchive now returns the number of files purged. * Dec 04, 2013 2603 rferrel Changes to improve archive purging. * Dec 17, 2013 2603 rjpeter Fix directory purging. + * Mar 21, 2014 2835 rjpeter Optimized getDisplayData to only scan directories to the depth required to + * populate the display label. * * * @author rferrel @@ -105,7 +110,7 @@ public class ArchiveConfigManager { public final String ARCHIVE_DIR = "archiver/purger"; /** Localization manager. */ - protected IPathManager pathMgr; + protected final IPathManager pathMgr; private final Map archiveNameToLocalizationFileMap = new HashMap(); @@ -715,15 +720,16 @@ public class ArchiveConfigManager { List fileList = new LinkedList(); ArchiveConfig archiveConfig = displayData.archiveConfig; - for (CategoryDataSet dataSet : displayData.dataSets) { + Map> fullMatchDirs = getDirs(new File( + archiveConfig.getRootDir()), displayData.getLabelDirMap()); + for (Map.Entry> entry : fullMatchDirs + .entrySet()) { + CategoryDataSet dataSet = entry.getKey(); int[] timeIndices = dataSet.getTimeIndices(); - String filePatternStr = dataSet.getFilePattern(); - boolean dirOnly = dataSet.isDirOnly(); - - List dirs = displayData.dirsMap.get(dataSet); + Set dirs = entry.getValue(); int beginIndex = archiveConfig.getRootDir().length(); @@ -790,62 +796,171 @@ public class ArchiveConfigManager { /** * Get a list of directories matching the categories directory patterns that - * are sub-directories of the archive's root directory. + * are sub-directories of the archive's root directory. maxDepth is the + * depth of directories to list, 0 for no listing, 1 for root directory, + * etc. * * @param archiveConfig * @param categoryConfig + * @param maxDepth * @return dirs */ private Map> getDirs(File rootFile, - CategoryConfig categoryConfig) { - List resultDirs = null; - List dirs = new ArrayList(); - List tmpDirs = new ArrayList(); - List swpDirs = null; + CategoryConfig categoryConfig, int maxDepth) { List dataSets = categoryConfig.getDataSetList(); Map> rval = new HashMap>( dataSets.size(), 1); - // keep an in memory map since some of the categories cause the same - // directories to be listed over and over - Map> polledDirs = new HashMap>(); + if (maxDepth > 0) { + List resultDirs = null; + List dirs = new ArrayList(); + List tmpDirs = new ArrayList(); + List swpDirs = null; - for (CategoryDataSet dataSet : dataSets) { - resultDirs = new LinkedList(); + /* + * keep an in memory map since some of the categories cause the same + * directories to be listed over and over + */ + Map> polledDirs = new HashMap>(); - for (String dirPattern : dataSet.getDirPatterns()) { - String[] subExpr = dirPattern.split(File.separator); - dirs.clear(); - dirs.add(rootFile); - tmpDirs.clear(); + for (CategoryDataSet dataSet : dataSets) { + resultDirs = new LinkedList(); - for (String regex : subExpr) { - Pattern subPattern = Pattern.compile("^" + regex + "$"); - IOFileFilter filter = FileFilterUtils - .makeDirectoryOnly(new RegexFileFilter(subPattern)); + for (String dirPattern : dataSet.getDirPatterns()) { + String[] subExpr = dirPattern.split(File.separator); + dirs.clear(); + dirs.add(rootFile); + tmpDirs.clear(); + int depth = 0; - for (File dir : dirs) { - List dirList = polledDirs.get(dir); - if (dirList == null) { - File[] list = dir.listFiles(); - dirList = Arrays.asList(list); - polledDirs.put(dir, dirList); + for (String regex : subExpr) { + Pattern subPattern = Pattern.compile("^" + regex + "$"); + IOFileFilter filter = FileFilterUtils + .makeDirectoryOnly(new RegexFileFilter( + subPattern)); + + for (File dir : dirs) { + List dirList = polledDirs.get(dir); + if (dirList == null) { + File[] list = dir.listFiles(); + dirList = Arrays.asList(list); + polledDirs.put(dir, dirList); + } + + if (dirList != null) { + tmpDirs.addAll(FileFilterUtils.filterList( + filter, dirList)); + } } - if (dirList != null) { - tmpDirs.addAll(FileFilterUtils.filterList(filter, - dirList)); + swpDirs = dirs; + dirs = tmpDirs; + tmpDirs = swpDirs; + tmpDirs.clear(); + depth++; + + if (depth >= maxDepth) { + break; } } - swpDirs = dirs; - dirs = tmpDirs; - tmpDirs = swpDirs; - tmpDirs.clear(); + resultDirs.addAll(dirs); } - - resultDirs.addAll(dirs); + rval.put(dataSet, resultDirs); } + } + + return rval; + } + + /** + * Gets the directories that fully match the given data sets. Starts with + * the directories that previously matched up to displayLabel generation. + * + * @param rootFile + * @param dataSetMap + * @return + */ + private Map> getDirs(File rootFile, + Map> dataSetMap) { + Map> rval = new HashMap>( + dataSetMap.size(), 1); + + int rootFileDepth = rootFile.getAbsolutePath().split(File.separator).length; + + Set dirs = new HashSet(); + Set tmpDirs = new HashSet(); + Set swpDirs = null; + + /* + * keep in memory map since some of the categories cause the same + * directories to be listed over and over + */ + Map> polledDirs = new HashMap>(); + + for (Map.Entry> entry : dataSetMap + .entrySet()) { + CategoryDataSet dataSet = entry.getKey(); + Set resultDirs = new HashSet(); + + Set dirsToScan = entry.getValue(); + for (File dirToScan : dirsToScan) { + // determine depth of file that was already matched + String[] tokens = dirToScan.getAbsolutePath().split( + File.separator); + + DIR_PATTERN_LOOP: for (String dirPattern : dataSet + .getDirPatterns()) { + String[] subExpr = dirPattern.split(File.separator); + dirs.clear(); + dirs.add(dirToScan); + tmpDirs.clear(); + int subExprIndex = 0; + + for (int i = rootFileDepth; i < tokens.length; i++) { + Pattern subPattern = Pattern.compile("^" + + subExpr[subExprIndex++] + "$"); + Matcher m = subPattern.matcher(tokens[i]); + if (!m.matches()) { + continue DIR_PATTERN_LOOP; + } + } + + while (subExprIndex < subExpr.length) { + Pattern subPattern = Pattern.compile("^" + + subExpr[subExprIndex++] + "$"); + IOFileFilter filter = FileFilterUtils + .makeDirectoryOnly(new RegexFileFilter( + subPattern)); + + for (File dir : dirs) { + List dirList = polledDirs.get(dir); + if (dirList == null) { + File[] list = dir.listFiles(); + + // When null something has purged the directory. + if (list != null) { + dirList = Arrays.asList(list); + polledDirs.put(dir, dirList); + } + } + + if (dirList != null) { + tmpDirs.addAll(FileFilterUtils.filterList( + filter, dirList)); + } + } + + swpDirs = dirs; + dirs = tmpDirs; + tmpDirs = swpDirs; + tmpDirs.clear(); + } + + resultDirs.addAll(dirs); + } + } + rval.put(dataSet, resultDirs); } @@ -866,27 +981,67 @@ public class ArchiveConfigManager { */ public List getDisplayData(String archiveName, String categoryName, boolean setSelect) { + ITimer timer = TimeUtil.getTimer(); + timer.start(); Map> displayMap = new HashMap>(); ArchiveConfig archiveConfig = archiveMap.get(archiveName); String rootDirName = archiveConfig.getRootDir(); CategoryConfig categoryConfig = findCategory(archiveConfig, categoryName); - File rootFile = new File(rootDirName); - TreeMap displays = new TreeMap(); - Map> dirMap = getDirs(rootFile, - categoryConfig); + + int maxDepth = 0; for (CategoryDataSet dataSet : categoryConfig.getDataSetList()) { - List dataSetDirPatterns = dataSet.getDirPatterns(); + maxDepth = Math.max(maxDepth, + dataSet.getMaxDirDepthForDisplayLabel()); + } + + File rootFile = new File(rootDirName); + TreeMap>> displays = new TreeMap>>(); + Map> dirMap = getDirs(rootFile, + categoryConfig, maxDepth); + for (CategoryDataSet dataSet : categoryConfig.getDataSetList()) { + List dataSetDirPatterns = dataSet.getSplitDirPatterns(); List dirs = dirMap.get(dataSet); int beginIndex = rootFile.getAbsolutePath().length() + 1; List patterns = new ArrayList( dataSetDirPatterns.size()); - for (String dirPattern : dataSetDirPatterns) { - Pattern pattern = Pattern.compile("^" + dirPattern + "$"); + /* + * Need to limit patterns by maxDepth so that matching works + * correctly on the shortened directory. This could cause a few + * false hits, but can't be helped without doing a full match which + * is too costly. + */ + StringBuilder builder = new StringBuilder(100); + for (String[] dirTokens : dataSetDirPatterns) { + int depth = 0; + + for (String token : dirTokens) { + if (depth > 0) { + /* + * The config files specifically use / to delimit + * directories in the patterns. It does not depend on + * the platform, specifically since its regex extra + * handling would need to be added to handle \ if it was + * ever used. Also window clients aren't going to mount + * /data_store and /archive which is all the servers + * knows/exports. + */ + builder.append("/"); + } + builder.append(token); + depth++; + if (depth >= maxDepth) { + break; + } + } + + Pattern pattern = Pattern.compile("^" + builder.toString() + + "$"); patterns.add(pattern); + builder.setLength(0); } MessageFormat msgfmt = new MessageFormat(dataSet.getDisplayLabel()); @@ -906,22 +1061,26 @@ public class ArchiveConfigManager { } String displayLabel = msgfmt.format(args, sb, pos0) .toString(); + Map> matchingDatasets = displays + .get(displayLabel); + if (matchingDatasets == null) { + matchingDatasets = new HashMap>(); + displays.put(displayLabel, matchingDatasets); + } + + Set labelDirs = matchingDatasets.get(dataSet); + if (labelDirs == null) { + labelDirs = new HashSet(); + matchingDatasets.put(dataSet, labelDirs); + } + + labelDirs.add(dir); List displayDirs = displayMap.get(displayLabel); if (displayDirs == null) { - displayDirs = new ArrayList(); + displayDirs = new LinkedList(); displayMap.put(displayLabel, displayDirs); } displayDirs.add(dir); - DisplayData displayData = displays.get(displayLabel); - if (displayData == null) { - displayData = new DisplayData(archiveConfig, - categoryConfig, dataSet, displayLabel); - displays.put(displayLabel, displayData); - } else if (!displayData.dataSets.contains(dataSet)) { - displayData.dataSets.add(dataSet); - } - - displayData.dirsMap.put(dataSet, displayDirs); break; } } @@ -931,7 +1090,18 @@ public class ArchiveConfigManager { List displayDataList = new ArrayList( displays.size()); - displayDataList.addAll(displays.values()); + for (String label : displays.keySet()) { + displayDataList.add(new DisplayData(archiveConfig, categoryConfig, + displays.get(label), label)); + } + + timer.stop(); + + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + statusHandler.debug("DisplayData for " + archiveName + " - " + + categoryName + " maxDepth " + maxDepth + " took " + + timer.getElapsedTime()); + } return displayDataList; } diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java index a36177d1f4..f271640edc 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java @@ -20,6 +20,7 @@ package com.raytheon.uf.common.archive.config; import java.io.File; +import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.regex.Matcher; @@ -45,6 +46,8 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Oct 02, 2013 #2147 rferrel Allow Date to ignore hour in time stamp. * Dec 10, 2013 #2624 rferrel Added Julian date. * Dec 17, 2013 2603 rjpeter Clear low order time fields on time generation. + * Mar 21, 2014 2835 rjpeter Add methods to determine max directory depth + * needed to populate display labels. * * * @author rferrel @@ -67,6 +70,25 @@ public class CategoryDataSet { private static final int TIMESTAMP_INDEX = 0; + private static final Pattern LABEL_BACK_REF_FINDER = Pattern + .compile("\\{(\\d+)\\}"); + + /** + * The config files specifically use / to delimit directories in the + * patterns. It does not depend on the platform, specifically since its + * regex extra handling would need to be added to handle \ if it was ever + * used. Also window clients aren't going to mount /data_store and /archive + * which is all the servers knows/exports. + */ + private static final Pattern DIR_SPLITTER = Pattern.compile("/"); + + /** + * Not technically sound due to optional capturing groups, but good enough + * for performance optimization of directory scanning. + */ + private static final Pattern GROUP_FINDER = Pattern + .compile("[^\\\\\\(]?+\\([^\\?]"); + /** * Types of times and the number of indices for getting the time stamp from * patterns. @@ -118,6 +140,24 @@ public class CategoryDataSet { return dirPatterns; } + /** + * Returns the directory patterns split on /. Not using File.separator due + * to this splitting on escape characters on a windows based platform. + * + * @return + */ + public List getSplitDirPatterns() { + if (dirPatterns != null) { + List rval = new ArrayList(dirPatterns.size()); + for (String dirPat : dirPatterns) { + rval.add(DIR_SPLITTER.split(dirPat)); + } + return rval; + } + + return null; + } + public void setDirPatterns(List dirPatterns) { this.dirPatterns = dirPatterns; } @@ -313,6 +353,64 @@ public class CategoryDataSet { return fileTime; } + /** + * Returns the max directory depth scan needed to resolve the display label. + * 0 implies no scan, 1 is all files under root, etc. + * + * @return + */ + public int getMaxDirDepthForDisplayLabel() { + int rval = 0; + + if ((displayLabel != null) && (displayLabel.length() > 0) + && (dirPatterns != null) && (dirPatterns.size() > 0)) { + Matcher m = LABEL_BACK_REF_FINDER.matcher(displayLabel); + /* find all back references, keeping only highest one */ + int maxBackReference = -1; + while (m.find()) { + int backReference = Integer.parseInt(m.group(1)); + maxBackReference = Math.max(maxBackReference, backReference); + } + if (maxBackReference >= 0) { + for (String[] tokens : getSplitDirPatterns()) { + rval = Math.max(rval, + depthForCapturingGroup(tokens, maxBackReference)); + } + } + } + + return rval; + } + + /** + * Parses tokens looking for the directory depth to scan to get groupToFind. + * This is not perfect and optional capturing groups will throw this off. + * + * @param tokens + * @param groupToFind + * @return + */ + private int depthForCapturingGroup(String[] tokens, int groupToFind) { + int rval = 0; + if (groupToFind == 0) { + rval = tokens.length; + } else { + int groupCount = 0; + for (String token : tokens) { + rval++; + Matcher m = GROUP_FINDER.matcher(token); + while (m.find()) { + groupCount++; + } + if (groupCount >= groupToFind) { + break; + } + } + } + + return rval; + } + /* * (non-Javadoc) * diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java index 7f6d22cadc..fa4ea986c0 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java @@ -3,9 +3,9 @@ package com.raytheon.uf.common.archive.config; import java.io.File; import java.util.ArrayList; import java.util.Comparator; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import com.raytheon.uf.common.util.SizeUtil; @@ -24,7 +24,7 @@ import com.raytheon.uf.common.util.SizeUtil; * Aug 02, 2013 2224 rferrel Changes to include DataSet in configuration. * Aug 06, 2013 2222 rferrel Changes to display all selected data. * Aug 14, 2013 2220 rferrel Add priority comparator. - * + * Mar 24, 2014 2835 rjpeter Changed method signatures, add volatile to multi-threaded variables. * * * @author rferrel @@ -94,8 +94,7 @@ public class DisplayData implements Comparable { /** The data's category configuration. */ protected final CategoryConfig categoryConfig; - protected final List dataSets = new ArrayList( - 1); + protected final List dataSets; /** The display label for this data. */ protected final String displayLabel; @@ -104,20 +103,20 @@ public class DisplayData implements Comparable { * Mappings of a list of directories for the display label matching the data * set's directory patterns and found under the archive's root directory. */ - protected final Map> dirsMap = new HashMap>(); + protected final Map> labelDirMap; /** * For use by GUI to indicate display label's row is selected. */ - private boolean selected = false; + private volatile boolean selected = false; /** * Indicates data is visible in the display. */ - private boolean visible = false; + private volatile boolean visible = false; /** For use by GUI for indicating the size of the directories' contents. */ - private long size = UNKNOWN_SIZE; + private volatile long size = UNKNOWN_SIZE; /** * Constructor. @@ -128,12 +127,14 @@ public class DisplayData implements Comparable { * @param displayLabel */ public DisplayData(ArchiveConfig archiveConfig, - CategoryConfig categoryConfig, CategoryDataSet dataSet, - String displayLabel) { + CategoryConfig categoryConfig, + Map> dataSetsAndDirs, String displayLabel) { this.archiveConfig = archiveConfig; this.categoryConfig = categoryConfig; this.displayLabel = displayLabel; - this.dataSets.add(dataSet); + this.dataSets = new ArrayList(dataSetsAndDirs.keySet()); + this.labelDirMap = dataSetsAndDirs; + } /** @@ -244,6 +245,7 @@ public class DisplayData implements Comparable { /** * Determine if the object contains the same data as the instance. */ + @Override public boolean equals(Object object) { if (this == object) { return true; @@ -283,6 +285,10 @@ public class DisplayData implements Comparable { return categoryConfig.getName(); } + public Map> getLabelDirMap() { + return labelDirMap; + } + /* * (non-Javadoc) * diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveCaseCreationAuthRequest.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveCaseCreationAuthRequest.java new file mode 100644 index 0000000000..ecf204f53f --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveCaseCreationAuthRequest.java @@ -0,0 +1,71 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.request; + +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Authorization request for Case Creation. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 25, 2014 2853       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ +@DynamicSerialize +public class ArchiveCaseCreationAuthRequest extends ArchiveAdminAuthRequest { + + /** Resource property value for case directory location. */ + @DynamicSerializeElement + private String caseDirectory; + + /** Default constructor. */ + public ArchiveCaseCreationAuthRequest() { + super(); + } + + /** + * Getter. + * + * @return caseDirectory + */ + public String getCaseDirectory() { + return caseDirectory; + } + + /** + * Setter. + * + * @param caseDirectory + */ + public void setCaseDirectory(String caseDirectory) { + this.caseDirectory = caseDirectory; + } + +} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/textproduct/DraftProduct.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/textproduct/DraftProduct.java index 7d76f42574..0001d73a89 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/textproduct/DraftProduct.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/textproduct/DraftProduct.java @@ -21,11 +21,9 @@ package com.raytheon.uf.common.dataplugin.gfe.textproduct; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import com.raytheon.uf.common.dataplugin.gfe.StatusConstants; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.serialization.SerializationException; @@ -37,14 +35,15 @@ import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; /** - * TODO Add Description + * Handles saving and loading of draft GFE text products * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Mar 23, 2010            randerso     Initial creation
+ * Mar 23, 2010            randerso    Initial creation
+ * Mar 26, 2014  #2884     randerso    Code clean up
  * 
  * 
* @@ -54,7 +53,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority; @DynamicSerialize public class DraftProduct { - private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(DraftProduct.class); + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(DraftProduct.class); + @DynamicSerializeElement private ProductDefinition productDefinition; @@ -94,15 +95,10 @@ public class DraftProduct { FileOutputStream out = null; try { - out = new FileOutputStream(file); + out = lf.openOutputStream(); out.write(bytes); - } catch (FileNotFoundException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - - } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } finally { if (out != null) { @@ -120,21 +116,15 @@ public class DraftProduct { public static DraftProduct load(LocalizationFile lf) throws SerializationException { - File file = lf.getFile(); - byte[] bytes = null; FileInputStream in = null; try { - in = new FileInputStream(file); + File file = lf.getFile(true); + in = lf.openInputStream(); bytes = new byte[(int) file.length()]; in.read(bytes); - } catch (FileNotFoundException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - - } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + } catch (Exception e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } finally { if (in != null) { @@ -147,6 +137,6 @@ public class DraftProduct { } } - return (DraftProduct) SerializationUtil.transformFromThrift(bytes); + return SerializationUtil.transformFromThrift(DraftProduct.class, bytes); } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java index 01a02b4cd1..1cfe4322e1 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java @@ -57,6 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * PluginDataObject. * May 16, 2013 1869 bsteffen Remove DataURI column from qc. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Feb 27, 2014 2852 rferrel Add getter/setter to FakePointDataView. * * * @@ -683,6 +684,14 @@ public class QCRecord extends PluginDataObject implements ISpatialEnabled { @DynamicSerializeElement @Column(name = "idx") int curIdx; + + public int getCurIdx() { + return curIdx; + } + + public void setCurIdx(int curIdx) { + this.curIdx = curIdx; + } } public QCRecord() { diff --git a/edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/lookup/GridCoverageLookup.java b/edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/lookup/GridCoverageLookup.java index 5e5e11e89d..56813ff9bd 100644 --- a/edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/lookup/GridCoverageLookup.java +++ b/edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/lookup/GridCoverageLookup.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; +import com.raytheon.uf.common.dataquery.requests.DbQueryRequest.OrderMode; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; @@ -42,9 +43,11 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Mar 12, 2012 bsteffen Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Mar 12, 2012 bsteffen Initial creation + * Mar 20, 2013 2910 bsteffen Add warning for duplicate coverages. + * * * * @@ -74,17 +77,29 @@ public class GridCoverageLookup { initializeMaps(); DbQueryRequest query = new DbQueryRequest(); query.setEntityClass(GridCoverage.class.getName()); + query.setOrderByField("id", OrderMode.DESC); try { DbQueryResponse resp = (DbQueryResponse) RequestRouter.route(query); for (Map map : resp.getResults()) { GridCoverage coverage = (GridCoverage) map.get(null); - coverageToId.put(coverage, coverage.getId()); + Integer oldValue = coverageToId.put(coverage, coverage.getId()); + if (oldValue != null) { + statusHandler + .handle(Priority.WARN, + "Two grid coverages were found in the database that are spatially equivalent(id=" + + oldValue + + "," + + coverage.getId() + + ")"); + } idToCoverage.put(coverage.getId(), coverage); } } catch (Exception e) { - // do not rethrow, the lookup is not broken at this point so if the - // problems persist then more exceptions will come from the actual - // lookup methods themselves. + /* + * Do not rethrow, the lookup is not broken at this point so if the + * problems persist then more exceptions will come from the actual + * lookup methods themselves. + */ statusHandler.handle(Priority.PROBLEM, "Error occurred retrieving coverages from server.", e); } diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java index 9a4ebb27d5..8a828cc817 100644 --- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java +++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java @@ -47,6 +47,7 @@ import com.raytheon.uf.common.util.ServiceLoaderUtil; * Feb 07, 2013 1543 djohnson Use ServiceLoader to find how to load jaxbable classes, defaulting to SerializableManager. * Mar 21, 2013 1794 djohnson ServiceLoaderUtil now requires the requesting class. * May 01, 2013 1968 djohnson Prevent deadlock due to SerializableManager threads needing to serialize things. + * Mar 26, 2014 2884 randerso Fixed broken javadoc link * * * @@ -327,9 +328,9 @@ public final class SerializationUtil { * the object as bytes * @return the Java object * @throws SerializationException - * @deprecated Use {@link #transformFromThrift(Class, byte[]) which performs - * the cast for you, and wraps any {@link ClassCastException}s - * in a serialization exception + * @deprecated Use {@link #transformFromThrift(Class, byte[])} which + * performs the cast for you, and wraps any + * {@link ClassCastException}s in a serialization exception */ @Deprecated public static Object transformFromThrift(byte[] bytes) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py index 00b1e9bacf..f7c35bc5f9 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/ActiveTable.py @@ -27,6 +27,7 @@ # ------------ ---------- ----------- -------------------------- # 06/11/13 #2083 randerso Log active table changes, save backups # 03/06/14 #2883 randerso Pass siteId into mergeFromJava +# 03/25/14 #2884 randerso Added xxxid to VTECChange # import time @@ -195,7 +196,7 @@ class ActiveTable(VTECTableUtil.VTECTableUtil): changedFlag = True #determine changes for notifications - rec = (newR['officeid'], newR['pil'], newR['phensig']) + rec = (newR['officeid'], newR['pil'], newR['phensig'], newR['xxxid']) if rec not in changes: changes.append(rec) @@ -309,7 +310,7 @@ def mergeFromJava(siteId, activeTable, newRecords, logger, mode, offsetSecs=0): if (changedFlag): from com.raytheon.uf.common.activetable import VTECChange for c in changes: - changeList.add(VTECChange(c[0],c[1],c[2])) + changeList.add(VTECChange(c[0],c[1],c[2],c[3])) from com.raytheon.uf.common.activetable import MergeResult result = MergeResult(updatedList, purgedList, changeList) diff --git a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py index 016b8f3c0b..a58d73dac9 100644 --- a/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py +++ b/edexOsgi/com.raytheon.uf.edex.activetable/utility/common_static/base/vtec/MergeVTEC.py @@ -32,7 +32,7 @@ # 01/25/13 1447 dgilling Initial Creation. # 03/19/13 1447 dgilling Merge A1 DR 21434. # 06/11/13 #2083 randerso Move backups to edex_static -# +# 03/25/14 #2884 randerso Added xxxid to VTECChange # @@ -264,7 +264,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): changed = True if changed: - chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig']) + chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig'], othRec['xxxid']) if chgRec not in changes: changes.append(chgRec) @@ -285,7 +285,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): oldReplaceEntriesAct.append(activeTable[i]) activeTable[i] = othRec #replace the record chgRec = (activeTable[i]['officeid'], - activeTable[i]['pil'], activeTable[i]['phensig']) + activeTable[i]['pil'], activeTable[i]['phensig'], activeTable[i]['xxxid']) if chgRec not in changes: changes.append(chgRec) else: @@ -298,7 +298,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): if found == 0: missingEntriesAct.append(othRec) activeTable.append(othRec) #add the record - chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig']) + chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig'], othRec['xxxid']) if chgRec not in changes: changes.append(chgRec) @@ -326,7 +326,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): newReplaceEntriesPast.append(othRec) oldReplaceEntriesPast.append(activeTable[maxETNIndex]) activeTable[maxETNIndex] = othRec #replace record - chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig']) + chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig'], othRec['xxxid']) if chgRec not in changes: changes.append(chgRec) @@ -334,7 +334,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): if maxETN is None: missingEntriesPast.append(othRec) activeTable.append(othRec) #add the record - chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig']) + chgRec = (othRec['officeid'], othRec['pil'], othRec['phensig'], othRec['xxxid']) if chgRec not in changes: changes.append(chgRec) @@ -382,7 +382,7 @@ class MergeVTEC(VTECTableUtil.VTECTableUtil): changeList = ArrayList() for c in self._changes: - changeList.add(VTECChange(c[0],c[1],c[2])) + changeList.add(VTECChange(c[0],c[1],c[2],c[3])) result = MergeResult(updatedList, purgedList, changeList) return result diff --git a/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml index 7b1cc0cfa5..e1acf463e4 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml +++ b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml @@ -2,12 +2,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> - - + + + + + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties b/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties index a7a334bc48..95821a289e 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties +++ b/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties @@ -12,5 +12,8 @@ archive.purge.cron=0+5+0/2+*+*+? # compress database records archive.compression.enable=false +# To change Default case directory. +#archive.case.directory=/data/archiver + # to disable a specific archive, use property archive.disable=pluginName,pluginName... -#archive.disable=grid,text,acars \ No newline at end of file +#archive.disable=grid,text,acars diff --git a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveCaseCreationAuthRequestHandler.java b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveCaseCreationAuthRequestHandler.java new file mode 100644 index 0000000000..94dd6f84f7 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveCaseCreationAuthRequestHandler.java @@ -0,0 +1,61 @@ +/** + * 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.edex.archive.useradmin; + +import com.raytheon.uf.common.archive.request.ArchiveAdminAuthRequest; +import com.raytheon.uf.common.archive.request.ArchiveCaseCreationAuthRequest; + +/** + * Handler for Case Creation dialog authorization. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Mar 25, 2014 2853       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class ArchiveCaseCreationAuthRequestHandler extends + ArchiveAdminPrivilegedRequestHandler { + + private final String CASE_DIR_KEY = "archive.case.directory"; + + private final String CASE_DIR_DEFAULT = "/data/archiver"; + + @Override + public ArchiveAdminAuthRequest handleRequest(ArchiveAdminAuthRequest request) + throws Exception { + super.handleRequest(request); + if (request instanceof ArchiveCaseCreationAuthRequest) { + ArchiveCaseCreationAuthRequest req = (ArchiveCaseCreationAuthRequest) request; + req.setCaseDirectory(System.getProperty(CASE_DIR_KEY, + CASE_DIR_DEFAULT)); + } + return request; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.gridcoverage/src/com/raytheon/uf/edex/gridcoverage/GetGridCoverageHandler.java b/edexOsgi/com.raytheon.uf.edex.gridcoverage/src/com/raytheon/uf/edex/gridcoverage/GetGridCoverageHandler.java index c87ff58f7c..e3569632c1 100644 --- a/edexOsgi/com.raytheon.uf.edex.gridcoverage/src/com/raytheon/uf/edex/gridcoverage/GetGridCoverageHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.gridcoverage/src/com/raytheon/uf/edex/gridcoverage/GetGridCoverageHandler.java @@ -45,10 +45,13 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Mar 26, 2012 bsteffen Initial creation - * Mar 07, 2013 1771 bsteffen fix gridcoverage duplicate checks. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Mar 26, 2012 bsteffen Initial creation + * Mar 07, 2013 1771 bsteffen fix gridcoverage duplicate checks. + * Mar 20, 2013 2910 bsteffen Commit transaction within cluster locks. + * + * * * * @@ -96,6 +99,8 @@ public class GetGridCoverageHandler implements coverage.initialize(); sess.saveOrUpdate(coverage); rval = coverage; + trans.commit(); + trans = null; } } finally { ClusterLockUtils.deleteLock(ct.getId().getName(), ct @@ -103,7 +108,6 @@ public class GetGridCoverageHandler implements } } - trans.commit(); } catch (Exception e) { statusHandler.error("Error occurred looking up GridCoverage[" + coverage.getName() + "]", e); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridDao.java b/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridDao.java index 47fb370498..ea936c0027 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridDao.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.grid/src/com/raytheon/uf/edex/plugin/grid/dao/GridDao.java @@ -64,11 +64,12 @@ import com.raytheon.uf.edex.database.plugin.PluginDao; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 4/7/09 1994 bphillip Initial Creation - * Mar 14, 2013 1587 bsteffen Fix static data persisting to datastore. - * Mar 27, 2013 1821 bsteffen Speed up GridInfoCache. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Apr 07, 2009 1994 bphillip Initial Creation + * Mar 14, 2013 1587 bsteffen Fix static data persisting to datastore. + * Mar 27, 2013 1821 bsteffen Speed up GridInfoCache. + * Mar 20, 2013 2910 bsteffen Clear dataURI after loading cached info. * * * @@ -246,6 +247,8 @@ public class GridDao extends PluginDao { + record.getDataURI(), e); return false; } + /* Clear the dataURI just in case something changed. */ + record.setDataURI(null); return true; } @@ -325,15 +328,6 @@ public class GridDao extends PluginDao { } } record.setLocation(dbCoverage); - if (!coverage.getId().equals(dbCoverage.getId())) { - record.setDataURI(null); - try { - record.constructDataURI(); - } catch (PluginException e) { - logger.info("Error constructing dataURI: " + record); - return false; - } - } return true; } @@ -382,7 +376,7 @@ public class GridDao extends PluginDao { QueryResult result = (QueryResult) this.executeNativeSql(sqlString .toString()); for (int i = 0; i < result.getResultCount(); i++) { - orphanedIds.remove((Integer) result.getRowColumnValue(i, 0)); + orphanedIds.remove(result.getRowColumnValue(i, 0)); } if (!orphanedIds.isEmpty()) { sqlString = new StringBuilder(orphanedIds.size() * 15 + 60); diff --git a/edexOsgi/com.raytheon.uf.edex.textdbsrv/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.textdbsrv/META-INF/MANIFEST.MF index 825996a99d..61a832f949 100644 --- a/edexOsgi/com.raytheon.uf.edex.textdbsrv/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.textdbsrv/META-INF/MANIFEST.MF @@ -9,6 +9,7 @@ Require-Bundle: com.raytheon.edex.common, com.raytheon.edex.textdb, org.apache.commons.logging, org.apache.commons.lang, + com.raytheon.uf.common.status, com.raytheon.uf.edex.decodertools;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin.text, com.raytheon.uf.common.site;bundle-version="1.12.1152" diff --git a/edexOsgi/com.raytheon.uf.edex.textdbsrv/res/spring/textdbsrv-request.xml b/edexOsgi/com.raytheon.uf.edex.textdbsrv/res/spring/textdbsrv-request.xml index d0bbfc2f79..0ac739fbc2 100644 --- a/edexOsgi/com.raytheon.uf.edex.textdbsrv/res/spring/textdbsrv-request.xml +++ b/edexOsgi/com.raytheon.uf.edex.textdbsrv/res/spring/textdbsrv-request.xml @@ -10,9 +10,7 @@ - - - + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.textdbsrv/src/com/raytheon/uf/edex/services/TextDBSrv.java b/edexOsgi/com.raytheon.uf.edex.textdbsrv/src/com/raytheon/uf/edex/services/TextDBSrv.java index 2b8d0b785c..7002f8cebb 100644 --- a/edexOsgi/com.raytheon.uf.edex.textdbsrv/src/com/raytheon/uf/edex/services/TextDBSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.textdbsrv/src/com/raytheon/uf/edex/services/TextDBSrv.java @@ -19,12 +19,15 @@ **/ package com.raytheon.uf.edex.services; -import static com.raytheon.uf.edex.services.textdbimpl.CommandExecutor.createErrorMessage; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import javax.xml.bind.JAXBException; import com.raytheon.uf.common.message.Message; +import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.time.util.ITimer; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.common.util.SizeUtil; import com.raytheon.uf.edex.services.textdbimpl.CommandExecutor; import com.raytheon.uf.edex.services.textdbsrv.ICommandExecutor; @@ -35,179 +38,100 @@ import com.raytheon.uf.edex.services.textdbsrv.ICommandExecutor; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 03, 2008 1538 jkorman Initial implementation + * Oct 03, 2008 1538 jkorman Initial implementation. + * Mar 26, 2014 2835 rjpeter Added logging. * * * @author jkorman * @version 1.0 */ public class TextDBSrv { + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(TextDBSrv.class); + + private static final IUFStatusHandler textDbSrvLogger = UFStatus + .getNamedHandler("TextDBSrvRequestLogger"); private static Integer instanceId = 0; - private Integer serviceInstanceId = null; - - // private boolean jmxModeOn = false; - - // private ObjectName serviceJmxId = null; - - // private boolean serviceRegistered = false; - - // Exposed properties - - // private String serviceName = null; - - private int messageCount = 0; - - private Log logger = LogFactory.getLog(getClass()); - private ICommandExecutor executor = null; public TextDBSrv() { super(); synchronized (instanceId) { instanceId = instanceId + 1; - serviceInstanceId = new Integer(instanceId); } executor = new CommandExecutor(); } - // /** - // * - // */ - // public String process(String text) throws EdexException { - // String retMsg = ""; - // if (text != null) { - // - // try { - // messageCount++; - // String xmlMessage = null; - // try { - // Object m = unmarshalFromXml(text); - // - // Message sMessage = null; - // - // if (m instanceof Message) { - // - // sMessage = executeMessage((Message) m); - // - // if (sMessage != null) { - // xmlMessage = marshalToXml(sMessage); - // } else { - // xmlMessage = - // marshalToXml(createErrorMessage("ERROR:Null return from execute")); - // } - // } else { - // String errMsg = "Message content was null"; - // if (m != null) { - // errMsg = "ERROR:Incorrect message type " - // + m.getClass().getName(); - // } - // xmlMessage = marshalToXml(createErrorMessage(errMsg)); - // } - // } catch (Exception e) { - // logger.error("Error processing message", e); - // // attempt to send an error message back to the client. - // try { - // xmlMessage = - // marshalToXml(createErrorMessage("ERROR:Exception processing message")); - // } catch (JAXBException e1) { - // logger.error(e1); - // } - // } - // - // retMsg = xmlMessage; - // - // } catch (Exception e) { - // logger.error("Error getting message payload", e); - // } - // } - // - // if (retMsg == null) { - // retMsg = "An error occurred"; - // } - // - // return retMsg; - // } + /** + * Processes an xml message from the text db service endpoint. + * + * @param xml + * @return + */ + public String processXmlMessage(String xml) { + ITimer timer = TimeUtil.getTimer(); + timer.start(); + String sizeString = SizeUtil.prettyByteSize(xml.length()); + textDbSrvLogger.info("Processing xml message of length: " + sizeString); + Message returnMessage = null; + String outXml = null; + + try { + Message message = SerializationUtil.unmarshalFromXml(Message.class, + xml); + returnMessage = processMessage(message); + outXml = SerializationUtil.marshalToXml(returnMessage); + } catch (JAXBException e) { + statusHandler.error("Serialization of message failed", e); + outXml = ""; + } + + timer.stop(); + + StringBuilder sb = new StringBuilder(300); + sb.append("Processed message in ").append(timer.getElapsedTime()) + .append("ms, "); + sb.append("request was size ").append(sizeString); + sb.append(", response was size ").append( + SizeUtil.prettyByteSize(outXml.length())); + textDbSrvLogger.info(sb.toString()); + + return outXml; + } + + /** + * Processes a textdb message. + * + * @param message + * @return + */ public Message processMessage(Message message) { Message returnMessage = null; try { if (message != null) { - messageCount++; returnMessage = executeMessage(message); if (returnMessage == null) { - returnMessage = createErrorMessage("ERROR:Null return from execute"); + returnMessage = CommandExecutor + .createErrorMessage("ERROR:Null return from execute"); } } else { String errMsg = "Message content was null"; - returnMessage = createErrorMessage(errMsg); + returnMessage = CommandExecutor.createErrorMessage(errMsg); } } catch (Exception e) { - e.printStackTrace(); + returnMessage = CommandExecutor + .createErrorMessage("Processing of message failed: " + + e.getLocalizedMessage()); + statusHandler.error("Processing of message failed", e); } return returnMessage; } - // /** - // * - // * @return - // */ - // public boolean isJmxModeOn() { - // return jmxModeOn; - // } - // - // /** - // * - // * @param desiredMode - // */ - // public void setJmxModeOn(boolean desiredJmxMode) { - // jmxModeOn = desiredJmxMode; - // // if (desiredJmxMode) { - // // register(serviceName); - // // } - // } - - // /** - // * Get the name of this service. - // * - // * @return The service name. - // */ - // @Override - // public String getServiceName() { - // return serviceName; - // } - // - // /** - // * Set the name of this service. - // * - // * @param serviceName - // * The service name. - // */ - // public void setServiceName(String serviceName) { - // this.serviceName = serviceName; - // } - - // /** - // * Clear the message count to zero. - // */ - // @Override - // public void clearMessageCount() { - // messageCount = 0; - // } - // - // /** - // * Get a count of messages processed since startup or the last reset. - // * - // * @return Message count. - // */ - // @Override - // public int getMessageCount() { - // return messageCount; - // } - /** * * @param command @@ -236,67 +160,7 @@ public class TextDBSrv { */ private synchronized void executeCommand(String command) { if ("read".equals(command)) { - logger.info("Processing command"); + statusHandler.info("Processing command"); } } - - // /** - // * Register this service with the JMX management. - // */ - // protected void register(String name) { - // if (serviceRegistered || !isJmxModeOn()) { - // return; - // } - // - // String domain = rightShortenName( - // this.getClass().getPackage().getName(), 2); - // - // // Get the MBean server for the platform - // MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - // try { - // // register the "server" dummy class, if necessary - // ObjectName dummyId = new ObjectName(domain + ":type=server"); - // if (!mbs.isRegistered(dummyId)) { - // mbs.registerMBean(new ServerGroup(), dummyId); - // } - // // register this class as an MBean - // serviceJmxId = new ObjectName(domain + ":type=server,name=" + name - // + "." + serviceInstanceId); - // StandardMBean smbean = new StandardMBean(this, - // TextDBSrvInterface.class); - // mbs.registerMBean(smbean, serviceJmxId); - // serviceRegistered = true; - // } catch (Exception e) { - // logger.error("register(2) failed to register with JMX server", e); - // - // serviceRegistered = false; - // jmxModeOn = false; - // } - // } - // - // /** - // * Unregister this service from the JMX server. This should be called - // prior - // * to shutting down the service. - // */ - // protected void unRegister(String name) { - // if (!serviceRegistered || !isJmxModeOn()) { - // return; - // } - // // Get the MBean server for the platform - // MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); - // try { - // if (mbs.isRegistered(serviceJmxId)) { - // mbs.unregisterMBean(serviceJmxId); - // } - // - // serviceRegistered = false; - // logger.info("JMX Monitoring for " + serviceName + " stopped"); - // } catch (Exception e) { - // logger.error("register(2) failed to register with JMX server", e); - // serviceRegistered = false; - // jmxModeOn = false; - // } - // } - } diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/createGFEStartScript b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/createGFEStartScript index 926f6eef87..2010db802d 100644 --- a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/createGFEStartScript +++ b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/createGFEStartScript @@ -1,4 +1,32 @@ #!/bin/bash +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +############################################################################## +# Create GFE Start Script +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 03/20/14 #2933 randerso Fixed for Dual Domain +############################################################################## if [ ${#AWIPS_HOME} = 0 ] then path_to_script=`readlink -f $0` @@ -39,7 +67,15 @@ fi chmod +x ${LAUNCH_SCRIPT} -SITE_LOWER=`echo ${AW_SITE_IDENTIFIER}|tr [a-z] [A-Z]` +if [ -z $PRIMARY_SITES ] +then + LOCAL_SITE=${AW_SITE_IDENTIFIER} +else + IFS=',' + site_list=($PRIMARY_SITES) + LOCAL_SITE=${site_list[0]} +fi +SITE_LOWER=`echo ${LOCAL_SITE}|tr [a-z] [A-Z]` echo $SITE_LOWER > $SCRIPTS_DIR/siteID.txt log_msg "GFE launch script created for ${SITE_CAPS}" diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config index 5c5e5307ec..de51e86a73 100644 --- a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config +++ b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config @@ -1,4 +1,33 @@ #!/bin/bash +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +############################################################################## +# Process Received Configuration +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 03/20/14 #2933 randerso Changed PRDDIR and LOGDIR to use + Backup site's configuration +############################################################################## import_file=${1} log_msg The import_file is: $import_file @@ -179,8 +208,15 @@ BACKUP_MHSID=$(egrep "GFESUITE_MHSID" ${backup_config}) FAILED_MHSID=$(egrep "GFESUITE_MHSID" ${failed_config}) BACKUP_SERVER=$(egrep "GFESUITE_SERVER" ${backup_config}) FAILED_SERVER=$(egrep "GFESUITE_SERVER" ${failed_config}) -sed -i "s/$FAILED_SERVER/$BACKUP_SERVER/" ${failed_config} +BACKUP_LOGDIR=$(egrep "GFESUITE_LOGDIR" ${backup_config}) +FAILED_LOGDIR=$(egrep "GFESUITE_LOGDIR" ${failed_config}) +BACKUP_PRDDIR=$(egrep "GFESUITE_PRDDIR" ${backup_config}) +FAILED_PRDDIR=$(egrep "GFESUITE_PRDDIR" ${failed_config}) + sed -i "s/$FAILED_MHSID/$BACKUP_MHSID/" ${failed_config} +sed -i "s/$FAILED_SERVER/$BACKUP_SERVER/" ${failed_config} +sed -i "s/$FAILED_LOGDIR/$BACKUP_LOGDIR/" ${failed_config} +sed -i "s/$FAILED_PRDDIR/$BACKUP_PRDDIR/" ${failed_config} sed -i "s/98000000/$SVCBU_FAILED_SITE_PORT/" ${failed_config} cd ${SVCBU_HOME} diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py index 18c3634505..cc6fadb347 100644 --- a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py @@ -19,6 +19,7 @@ ## # File auto-generated against equivalent DynamicSerialize Java class +# 03/25/14 #2884 randerso Added xxxid to VTECChange class VTECChange(object): @@ -26,6 +27,7 @@ class VTECChange(object): self.site = None self.pil = None self.phensig = None + self.xxxid = None def getSite(self): return self.site @@ -45,3 +47,8 @@ class VTECChange(object): def setPhensig(self, phensig): self.phensig = phensig + def getXxxid(self): + return self.xxxid + + def setXxxid(self, xxxid): + self.xxxid = xxxid diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index e5a9d0798a..e9fd84442e 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -412,7 +412,7 @@ if [ "${1}" = "-viz" ]; then buildRPM "awips2-common-base" #buildRPM "awips2-python-numpy" #buildRPM "awips2-ant" - #buildRPM "awips2-python-dynamicserialize" + buildRPM "awips2-python-dynamicserialize" #buildRPM "awips2-python" #buildRPM "awips2-adapt-native" #unpackHttpdPypies @@ -422,8 +422,8 @@ if [ "${1}" = "-viz" ]; then #buildRPM "awips2-httpd-pypies" #buildRPM "awips2-hydroapps-shared" #buildRPM "awips2-rcm" - #buildRPM "awips2-gfesuite-client" - #buildRPM "awips2-gfesuite-server" + buildRPM "awips2-gfesuite-client" + buildRPM "awips2-gfesuite-server" #buildRPM "awips2-tools" #buildRPM "awips2-cli" buildCAVE @@ -437,7 +437,7 @@ fi if [ "${1}" = "-edex" ]; then ##buildRPM "awips2-common-base" - buildRPM "awips2" + #buildRPM "awips2" buildEDEX if [ $? -ne 0 ]; then exit 1 From 90f1750691e4551a307c49b24b92034c1f908e4f Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Fri, 4 Apr 2014 13:17:36 -0500 Subject: [PATCH 6/7] Issue #2973 Use correct area for expanding subgrid requests. Former-commit-id: 3cc81be3ed534aed54bf80b0654f28f7fd86cc8b --- .../viz/grid/util/GridDataCubeAdapter.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/GridDataCubeAdapter.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/GridDataCubeAdapter.java index 15d1a7ce4e..381b6a3d3d 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/GridDataCubeAdapter.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/util/GridDataCubeAdapter.java @@ -73,12 +73,15 @@ import com.raytheon.viz.grid.record.RequestableDataRecord; *
  * 
  * SOFTWARE HISTORY
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Mar 16, 2009            brockwoo    Initial creation
- * Nov 21, 2009 3576       rjpeter     Refactored use of DerivParamDesc.
- * Jun 04, 2013 2041       bsteffen    Improve exception handing in grid
- *                                     resources.
+ * Date          Ticket#  Engineer    Description
+ * ------------- -------- ----------- --------------------------
+ * Mar 16, 2009           brockwoo    Initial creation
+ * Nov 21, 2009  3576     rjpeter     Refactored use of DerivParamDesc.
+ * Jun 04, 2013  2041     bsteffen    Improve exception handing in grid
+ *                                    resources.
+ * Apr 04, 2014  2973     bsteffen    Use correct area for expanding subgrid
+ *                                    requests.
+ * 
  * 
* * @author brockwoo @@ -294,7 +297,6 @@ public class GridDataCubeAdapter extends AbstractDataCubeAdapter { continue; } GridRecord record = data.getGridSource(); - area = record.getLocation(); String file = HDF5Util.findHDF5Location(record).getPath(); if (file != null) { List list = fileMap.get(file); From 947194c998fd5cc314676c6ab27207a42e3ace63 Mon Sep 17 00:00:00 2001 From: "Brian.Dyke" Date: Wed, 9 Apr 2014 11:39:07 -0400 Subject: [PATCH 7/7] Merged 1354 -7 and -8 into 1412 Former-commit-id: 082b54dc10676b7090f8a1c9a01929a6d7da2667 --- .../common/stormtrack/StormTrackDisplay.java | 12 ++++++++---- .../common/stormtrack/StormTrackUIManager.java | 12 ++++++++++++ .../viz/gfe/interpolation/WeatherInterp.java | 5 +++-- .../ServiceBackup/scripts/proc_receive_config | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java index 55a3b122f5..733c9a2269 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackDisplay.java @@ -98,6 +98,7 @@ import com.vividsolutions.jts.geom.LineString; * 15Mar2013 15693 mgamazaychikov Made sure that magnification capability works. * 06-11-2013 DR 16234 D. Friedman Fix pivot index when frames count is reduced. * 06-24-2013 DR 16317 D. Friedman Handle "motionless" track. + * 04-07-2014 DR 17232 D. Friedman Make sure pivot indexes are valid. * * * @@ -210,9 +211,10 @@ public class StormTrackDisplay implements IRenderable { } if (currentFrame == currentState.displayedPivotIndex) { - if (currentState.displayedPivotIndex == currentState.pivotIndex) { + if (currentState.displayedPivotIndex == currentState.pivotIndex && + currentState.otherPivotIndex >= 0) { currentState.displayedPivotIndex = currentState.otherPivotIndex; - } else { + } else if (currentState.pivotIndex >= 0){ currentState.displayedPivotIndex = currentState.pivotIndex; } } @@ -234,9 +236,10 @@ public class StormTrackDisplay implements IRenderable { currentState.displayedPivotIndex = currentState.pivotIndex; currentState.nextPivotIndex = -1; } else if (currentFrame == currentState.displayedPivotIndex) { - if (currentState.displayedPivotIndex == currentState.pivotIndex) { + if (currentState.displayedPivotIndex == currentState.pivotIndex && + currentState.otherPivotIndex >= 0) { currentState.displayedPivotIndex = currentState.otherPivotIndex; - } else { + } else if (currentState.pivotIndex >= 0){ currentState.displayedPivotIndex = currentState.pivotIndex; } } else if (currentFrame != currentState.displayedPivotIndex) { @@ -1401,4 +1404,5 @@ public class StormTrackDisplay implements IRenderable { data.setMotionSpeed((int) mpsToKts.convert(state.speed)); dataManager.setStormTrackData(data); } + } diff --git a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java index 60bf54b604..99ee4b6837 100644 --- a/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java +++ b/cave/com.raytheon.viz.awipstools/src/com/raytheon/viz/awipstools/common/stormtrack/StormTrackUIManager.java @@ -63,6 +63,7 @@ import com.vividsolutions.jts.geom.Point; * needs to update the track because * the point has been moved. * 08-12-2013 DR 16427 D. Friedman Prevent NPE. + * 04-07-2014 DR 17232 D. Friedman Set displayedPivotIndex when needed. * * * @@ -270,6 +271,17 @@ public class StormTrackUIManager extends InputAdapter { state.pointMoved = true; FramesInfo info = controller.getDescriptor().getFramesInfo(); trackUtil.setPivotIndexes(info, state); + + // This code is duplicated from StormTrackDisplay.paint(). + if (state.displayedPivotIndex == trackUtil.getCurrentFrame(info)) { + if (state.displayedPivotIndex == state.pivotIndex && + state.otherPivotIndex >= 0) { + state.displayedPivotIndex = state.otherPivotIndex; + } else if (state.pivotIndex >= 0) { + state.displayedPivotIndex = state.pivotIndex; + } + } + state.nextPivotIndex = trackUtil.getCurrentFrame(info); controller.issueRefresh(); rval = true; diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/interpolation/WeatherInterp.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/interpolation/WeatherInterp.java index 3980313406..b94ea18a88 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/interpolation/WeatherInterp.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/interpolation/WeatherInterp.java @@ -116,6 +116,7 @@ import com.raytheon.uf.common.time.TimeRange; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 11, 2011 dgilling Initial creation + * 04/08/2014 DR 17187 randerson (code checked in by zhao) * * * @@ -451,7 +452,7 @@ public class WeatherInterp extends Interp { // are already set to 0. // get its value - key = keys1[index]; + key = keys1[0xFF & index]; // find this key in the new list, and save the corresponding // index @@ -466,7 +467,7 @@ public class WeatherInterp extends Interp { // bytes index = grid2.get(i, j); // get its key - key = keys2[index]; + key = keys2[0xFF & index]; // find this key in the new list, and save the corresponding // index for (int k = 0; k < _allKeys.size(); k++) { diff --git a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config index de51e86a73..6019d1de32 100644 --- a/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config +++ b/edexOsgi/com.raytheon.uf.tools.gfesuite.servicebackup/svcBackup/ServiceBackup/scripts/proc_receive_config @@ -26,7 +26,7 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 03/20/14 #2933 randerso Changed PRDDIR and LOGDIR to use - Backup site's configuration +# Backup site's configuration ############################################################################## import_file=${1}