diff --git a/cave/build/static/common/cave/etc/bundles/DefaultRadarFourPanelBlendedBestRes.xml b/cave/build/static/common/cave/etc/bundles/DefaultRadarFourPanelBlendedBestRes.xml index c845de5067..6806261a7d 100644 --- a/cave/build/static/common/cave/etc/bundles/DefaultRadarFourPanelBlendedBestRes.xml +++ b/cave/build/static/common/cave/etc/bundles/DefaultRadarFourPanelBlendedBestRes.xml @@ -85,7 +85,7 @@ + constraintType="IN" /> @@ -119,7 +119,7 @@ + constraintType="IN" /> @@ -173,7 +173,7 @@ + constraintType="IN" /> @@ -207,7 +207,7 @@ + constraintType="IN" /> @@ -256,7 +256,7 @@ + constraintType="IN" /> @@ -290,7 +290,7 @@ + constraintType="IN" /> @@ -344,7 +344,7 @@ + constraintType="IN" /> @@ -378,7 +378,7 @@ + constraintType="IN" /> diff --git a/cave/build/static/common/cave/etc/bundles/DefaultTerminalRadar4PanelBlendedBestRes.xml b/cave/build/static/common/cave/etc/bundles/DefaultTerminalRadar4PanelBlendedBestRes.xml new file mode 100644 index 0000000000..cdf8e398aa --- /dev/null +++ b/cave/build/static/common/cave/etc/bundles/DefaultTerminalRadar4PanelBlendedBestRes.xml @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyA.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyA.xml index 7bfb35758e..ac3186ce95 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyA.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyA.xml @@ -59,7 +59,7 @@ ModFamA| |N|Conv: NonSupercell Tor Family| |OTHER | | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyB.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyB.xml index dff95859dd..6589a91894 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyB.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyB.xml @@ -56,7 +56,7 @@ ModFamB| |N|Conv: Storm Init Family| |OTHER | | \ PLAN_VIEW - + @@ -188,7 +188,7 @@ ModFamB| |N|Conv: Storm Init Family| |OTHER | | \ PLAN_VIEW - + @@ -322,7 +322,7 @@ ModFamB| |N|Conv: Storm Init Family| |OTHER | | \ PLAN_VIEW - + @@ -488,7 +488,7 @@ ModFamB| |N|Conv: Storm Init Family| |OTHER | | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyC.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyC.xml index 10a80f7b61..ab4de75eff 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyC.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyC.xml @@ -166,7 +166,7 @@ ModFamC| |N|Conv: Hail Family| |OTHER | | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyD.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyD.xml index fb9cb3d22b..82af335064 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyD.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyD.xml @@ -70,7 +70,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -169,7 +169,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -268,7 +268,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -367,7 +367,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -466,7 +466,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -702,7 +702,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -981,7 +981,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -1152,7 +1152,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -1287,7 +1287,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -1386,7 +1386,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + @@ -1485,7 +1485,7 @@ ModFamD| |N|Winter: Family| |OTHER | | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyH.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyH.xml index 6fbc209871..14ecfd1bfd 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyH.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyH.xml @@ -139,7 +139,7 @@ ModFamH | | N|Conv: QLCS/Wind Family| | OTHER| | PLAN_VIEW - + @@ -269,7 +269,7 @@ ModFamH | | N|Conv: QLCS/Wind Family| | OTHER| | PLAN_VIEW - + @@ -396,7 +396,7 @@ ModFamH | | N|Conv: QLCS/Wind Family| | OTHER| | PLAN_VIEW - + @@ -496,7 +496,7 @@ ModFamH | | N|Conv: QLCS/Wind Family| | OTHER| | PLAN_VIEW - + @@ -1025,7 +1025,7 @@ ModFamH | | N|Conv: QLCS/Wind Family| | OTHER| | PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyU.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyU.xml index ed14cd5b97..a8b7de6ee7 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyU.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyU.xml @@ -66,7 +66,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -165,7 +165,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -264,7 +264,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -363,7 +363,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -462,7 +462,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -594,7 +594,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -873,7 +873,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -1044,7 +1044,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -1179,7 +1179,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -1278,7 +1278,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + @@ -1377,7 +1377,7 @@ ModFamU| |N|Briefing Family| |OTHER | | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyV.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyV.xml index b7fe7fff6a..f907b5f8a8 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyV.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyV.xml @@ -135,7 +135,7 @@ ModFamV | | N|Conv: Severe Type Family| | OTHER| | \ PLAN_VIEW - + @@ -341,7 +341,7 @@ ModFamV | | N|Conv: Severe Type Family| | OTHER| | \ PLAN_VIEW - + @@ -479,7 +479,7 @@ ModFamV | | N|Conv: Severe Type Family| | OTHER| | \ PLAN_VIEW - + @@ -902,7 +902,7 @@ ModFamV | | N|Conv: Severe Type Family| | OTHER| | \ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyW.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyW.xml index 11ae214077..ec2f37ca3f 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyW.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyW.xml @@ -135,7 +135,7 @@ PLAN_VIEW - + @@ -235,7 +235,7 @@ PLAN_VIEW - + @@ -371,7 +371,7 @@ PLAN_VIEW - + @@ -544,7 +544,7 @@ PLAN_VIEW - + @@ -644,7 +644,7 @@ PLAN_VIEW - + @@ -1093,7 +1093,7 @@ PLAN_VIEW - + @@ -1194,7 +1194,7 @@ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyX.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyX.xml index 13ea2f7a5c..b3f9a3011d 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyX.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyX.xml @@ -110,7 +110,7 @@ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyY.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyY.xml index 1bb9f5a9cd..b1948592a0 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyY.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyY.xml @@ -127,7 +127,7 @@ PLAN_VIEW - + @@ -227,7 +227,7 @@ PLAN_VIEW - + @@ -327,7 +327,7 @@ PLAN_VIEW - + @@ -610,7 +610,7 @@ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyYY.xml b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyYY.xml index 67c3e4954d..9f7f9995c9 100644 --- a/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyYY.xml +++ b/cave/build/static/common/cave/etc/bundles/volume/ModelFamilyYY.xml @@ -129,7 +129,7 @@ PLAN_VIEW - + @@ -229,7 +229,7 @@ PLAN_VIEW - + @@ -329,7 +329,7 @@ PLAN_VIEW - + @@ -429,7 +429,7 @@ PLAN_VIEW - + @@ -731,7 +731,7 @@ PLAN_VIEW - + diff --git a/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py b/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py index 67a87ffffb..b88ba11ca6 100644 --- a/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py +++ b/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py @@ -297,12 +297,8 @@ class SmartScript(BaseTool.BaseTool): #SendISCOnSave is enabled, then this routine will fail as grids are #sent when saved and the manual operation is not allowed. The #overall isc send state must also be True for this command to work. - req = [] - parms = self.__parmMgr.getAllAvailableParms(); - for parm in parms: - pid = parm.getParmID() - tr = parm.getParmTimeRange() - req.append(SendISCRequest(pid,tr)) + req = ArrayList() + req.add(SendISCRequest()) self.__parmOp.sendISC(req) def manualSendISC_manualMode(self, requests): @@ -310,13 +306,12 @@ class SmartScript(BaseTool.BaseTool): #SendISCOnSave is enabled, then this routine will fail as grids are #sent when saved and the manual operation is not allowed. #The requests are tuples of (parmName, parmLevel, timeRange). The - #TimeRange is an AFPS.TimeRange() instance. The overall isc + #TimeRange is an TimeRange() instance. The overall isc #send state must also be True for this command to work. - req = [] + req = ArrayList() for parmName, parmLevel, tr in requests: - pid = ParmID.ParmID(parmName, self.mutableID(), - parmLevel).toJavaObj() - req.append(SendISCRequest(pid, tr)) + pid = ParmID.ParmID(name=parmName, dbid=self.mutableID(), level=parmLevel).toJavaObj() + req.add(SendISCRequest(pid, tr.toJavaObj())) self.__parmOp.sendISC(req) diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/CMC/CMC.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/CMC/CMC.xml index d5b296dd91..659f9949ca 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/CMC/CMC.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/CMC/CMC.xml @@ -7,7 +7,6 @@ GDFILE=cmc pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/EASTNMM/EASTNMM.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/EASTNMM/EASTNMM.xml index a44db07006..58141982c9 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/EASTNMM/EASTNMM.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/EASTNMM/EASTNMM.xml @@ -7,7 +7,6 @@ GDFILE=hireswNmmE pluginName=grid -eventName=% Forecast ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWF/ECMWF.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWF/ECMWF.xml index 325b8c0fdd..c20a5d6798 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWF/ECMWF.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWF/ECMWF.xml @@ -7,7 +7,6 @@ GDFILE=ecmwf pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFG/ECMWFG.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFG/ECMWFG.xml index 1320aabc5d..a1aa26c111 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFG/ECMWFG.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFG/ECMWFG.xml @@ -7,7 +7,6 @@ GDFILE=ecmwfg pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFT/ECMWFT.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFT/ECMWFT.xml index 940e083a6c..944a58e535 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFT/ECMWFT.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/ECMWFT/ECMWFT.xml @@ -7,7 +7,6 @@ GDFILE=ecmwft pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/FNMOCWAVE/FNMOCWAVE.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/FNMOCWAVE/FNMOCWAVE.xml index 16dda27a67..9fd8201a89 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/FNMOCWAVE/FNMOCWAVE.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/FNMOCWAVE/FNMOCWAVE.xml @@ -7,7 +7,6 @@ GDFILE=fnmocwave pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/GFS/GFS.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/GFS/GFS.xml index 5129addaa9..c8a668da2b 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/GFS/GFS.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/GFS/GFS.xml @@ -7,7 +7,6 @@ GDFILE=gfs pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NAM/NAM.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NAM/NAM.xml index a067c36865..7fe137c35b 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NAM/NAM.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NAM/NAM.xml @@ -8,7 +8,6 @@ GDFILE=nam pluginName=grid -eventName=% ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NOGAPS/NOGAPS.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NOGAPS/NOGAPS.xml index eccc09cabe..0dd4fbf8ce 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NOGAPS/NOGAPS.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NOGAPS/NOGAPS.xml @@ -7,7 +7,6 @@ GDFILE=nogaps pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NWW3/NWW3.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NWW3/NWW3.xml index 1793b56233..23124cde06 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NWW3/NWW3.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/NWW3/NWW3.xml @@ -7,7 +7,6 @@ GDFILE=nww3 pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/RAP/RAP.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/RAP/RAP.xml index d3c2c3f00c..807e373c31 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/RAP/RAP.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/RAP/RAP.xml @@ -6,7 +6,6 @@ GDFILE=rap pluginName=grid -eventName=% Forecast,Regional ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/UKMET/UKMET.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/UKMET/UKMET.xml index 8f42f685b4..acb6c9af1c 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/UKMET/UKMET.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/UKMET/UKMET.xml @@ -7,7 +7,6 @@ GDFILE=ukmet pluginName=grid -eventName=% Forecast,Global ModelFcstGridContours diff --git a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/WESTNMM/WESTNMM.xml b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/WESTNMM/WESTNMM.xml index 81c0c27d34..ba09f2091a 100644 --- a/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/WESTNMM/WESTNMM.xml +++ b/cave/build/static/common/cave/etc/ncep/ResourceDefns/GRID/WESTNMM/WESTNMM.xml @@ -6,7 +6,6 @@ GDFILE=westnmm pluginName=ncgrib -eventName=% Forecast ModelFcstGridContours diff --git a/cave/com.raytheon.uf.viz.ccfp/build.properties b/cave/com.raytheon.uf.viz.ccfp/build.properties index 34d2e4d2da..3459198753 100644 --- a/cave/com.raytheon.uf.viz.ccfp/build.properties +++ b/cave/com.raytheon.uf.viz.ccfp/build.properties @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + localization/ diff --git a/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/function/DistFilter.java b/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/function/DistFilter.java index fc5faf86f7..6a2c53bee9 100644 --- a/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/function/DistFilter.java +++ b/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/function/DistFilter.java @@ -23,7 +23,7 @@ import java.util.Arrays; import jep.INumpyable; -import com.raytheon.uf.viz.derivparam.python.PythonNumpyFloatArray; +import com.raytheon.uf.common.python.PythonNumpyFloatArray; /** * TODO Add Description diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GridInfoDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GridInfoDialog.java index cb0d648cb9..a8a8e0ed02 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GridInfoDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GridInfoDialog.java @@ -19,7 +19,6 @@ **/ package com.raytheon.viz.gfe.dialogs; -import java.awt.Toolkit; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -75,7 +74,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Jun 20, 2008 #875 bphillip Implemented Dialog functionality * Sep 20, 2012 #1190 dgilling Use new WsId.getHostName() method. * Nov 12, 2012 #1298 rferrel Code cleanup for non-blocking dialog. - * Jan 10, 2013 #DR15572 jzeng add getWindowMax() and getMaxWidth(String str) + * Jan 10, 2013 #DR15572 jzeng add getMaxWidth(String str) * and adjustDlg(String str), * change gridInfoText from Label to Text * to make sure the info get displayed inside the screen @@ -107,15 +106,9 @@ public class GridInfoDialog extends CaveJFACEDialog implements // set gridInfoText to be Text private Text gridInfoText; - - // width of the screen - private int WidthofScreen; - - // width of the grouplist - private final int WidthofGroup = 240; - + private SimpleDateFormat gmtFormatter; - + public GridInfoDialog(Shell parent, Parm parm, Date clickTime) { super(parent); this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS); @@ -127,8 +120,6 @@ public class GridInfoDialog extends CaveJFACEDialog implements gmtFormatter = new SimpleDateFormat("MMM dd yy HH:mm:ss zzz"); gmtFormatter.setTimeZone(TimeZone.getTimeZone("GMT")); - //make sure there is enough space for the group list - WidthofScreen = this.getWindowMax() - WidthofGroup; } @Override @@ -153,34 +144,30 @@ public class GridInfoDialog extends CaveJFACEDialog implements b.setText(gridInfoElements[i]); b.addSelectionListener(this); } + // Composite composite2 = new Composite(top, SWT.NONE); // layoutData = new GridData(SWT.DEFAULT, SWT.FILL, false, true); // composite2.setLayoutData(layoutData); // composite2.setLayout(new GridLayout(1, true)); - gridInfoText = new Text(top, SWT.NONE | SWT.H_SCROLL); + gridInfoText = new Text(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.READ_ONLY); layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); - gridInfoText.setEditable(false); gridInfoText.setBackground(group.getBackground()); gridInfoText.setLayoutData(layoutData); } - - /* - * To get the width of the screen - */ - private int getWindowMax(){ - Toolkit toolkit = Toolkit.getDefaultToolkit(); - return toolkit.getScreenSize().width; - } /* * adjust the width of the dialog */ private void adjustDlg(String infoText){ + int screenWidth = this.getParentShell().getDisplay(). + getPrimaryMonitor().getBounds().width; + int maxWidth = (int)Math.round(screenWidth * 0.75); + GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); int maxLength = getMaxWidth(infoText); - if ( maxLength > WidthofScreen ) { - gd.widthHint = WidthofScreen; + if ( maxLength > maxWidth ) { + gd.widthHint = maxWidth; gridInfoText.setLayoutData(gd); } else { gridInfoText.setLayoutData(gd); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/AbstractGridResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/AbstractGridResource.java index d3665b9583..ed9a9b0ae8 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/AbstractGridResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/AbstractGridResource.java @@ -823,7 +823,8 @@ public abstract class AbstractGridResource Unit unit = data.getDataUnit(); if (stylePreferences != null) { Unit styleUnit = stylePreferences.getDisplayUnits(); - if (unit != null && unit.isCompatible(styleUnit)) { + if (unit != null && styleUnit != null + && unit.isCompatible(styleUnit)) { value = (float) unit.getConverterTo(styleUnit).convert(value); unit = styleUnit; unitString = stylePreferences.getDisplayUnitLabel(); diff --git a/cave/com.raytheon.viz.radar/localization/menus/radar/baseTerminal4Panel.xml b/cave/com.raytheon.viz.radar/localization/menus/radar/baseTerminal4Panel.xml index ab46a9fb59..11b2e15eb9 100644 --- a/cave/com.raytheon.viz.radar/localization/menus/radar/baseTerminal4Panel.xml +++ b/cave/com.raytheon.viz.radar/localization/menus/radar/baseTerminal4Panel.xml @@ -24,7 +24,7 @@ @@ -44,7 +44,7 @@ @@ -64,7 +64,7 @@ @@ -84,7 +84,7 @@ @@ -104,7 +104,7 @@ @@ -127,7 +127,7 @@ @@ -147,7 +147,7 @@ @@ -167,7 +167,7 @@ @@ -187,7 +187,7 @@ @@ -207,7 +207,7 @@ diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/print/PrintDisplay.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/print/PrintDisplay.java index 2e3e0d7636..6855a3236d 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/print/PrintDisplay.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/print/PrintDisplay.java @@ -152,11 +152,27 @@ public class PrintDisplay { */ int lineWidthPixels = gc.stringExtent(aBuffer.toString()).x; int deviceWidthPixels = rightMargin - leftMargin; - printerFont.dispose(); + /* * Scale the original font size; */ float fontSize = (float)deviceWidthPixels / (float)lineWidthPixels * (float)origFontSize; + + /* + * Validate that the line width in scaled font does not exceed the deviceWidthPixelx + */ + boolean isValidated = false; + while (!isValidated) { + printerFontData.setHeight((int) (fontSize)); + gc.setFont(new Font(printer, printerFontData)); + lineWidthPixels = gc.stringExtent(aBuffer.toString()).x; + if (lineWidthPixels < deviceWidthPixels) { + isValidated = true; + } else { + fontSize--; + } + } + printerFont.dispose(); /* * Set the printerFont Data font to the scaled font */ diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java index 9c21bb76bd..a3375758a4 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenDialog.java @@ -129,6 +129,7 @@ import com.vividsolutions.jts.geom.Polygon; * and in updateListSelected(). * Dec 20, 2012 DR 15537 Qinglu Lin Changed the assigned value to trackEditable from false * to true in boxSelected(). + * Jan 24, 2013 DR 15723 Qinglu Lin Invoked WarngenLayer's initRemovedGids(). * * * @@ -1572,6 +1573,7 @@ public class WarngenDialog extends CaveSWTDialog implements warngenLayer.getStormTrackState().endTime = null; WarningAction action = WarningAction.valueOf(data.getAct()); warngenLayer.setWarningAction(action); + warngenLayer.initRemovedGids(); if (action == WarningAction.CON) { oldWarning = conSelected(data); } else if (action == WarningAction.COR) { @@ -1827,7 +1829,7 @@ public class WarngenDialog extends CaveSWTDialog implements * @param selected */ private AbstractWarningRecord conSelected(FollowupData data) { - CurrentWarnings cw = CurrentWarnings.getInstance(warngenLayer + CurrentWarnings cw = CurrentWarnings.getInstance(warngenLayer .getLocalizedSite()); AbstractWarningRecord newWarn = null; if (WarningAction.COR == WarningAction.valueOf(data.getAct())) { diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index fbddbdb397..5887eb290d 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -153,6 +153,8 @@ import com.vividsolutions.jts.io.WKTReader; * 12/17/2012 DR 15571 Qinglu Lin For hydro products,futurePoints is null. Resolved an issue caused by trying to get * Coordinate[] from futurePoints. * 12/18/2012 DR 15571 Qinglu Lin Resolved coordinate issue in TML line caused by clicking Restart button. + * 01/24/2013 DR 15723 Qinglu Lin Added initRemovedGids() and updated updateWarnedAreas() to prevent the removed + * counties from being re-hatched. * * * @@ -240,6 +242,8 @@ public class WarngenLayer extends AbstractStormTrackResource { private WarningAction warningAction = WarningAction.NEW; + private Set removedGids = new HashSet(); + static { for (int i = 0; i < 128; i++) { if (i % 32 == 0) { @@ -1270,12 +1274,22 @@ public class WarngenLayer extends AbstractStormTrackResource { Geometry oldArea = oldWarningArea.getGeometryN(n); Geometry geom = GeometryUtil.intersection(warningPolygon, oldArea); - if (geom.isEmpty() == false) { - if (intersection == null) { - intersection = geom; - } else { - intersection = GeometryUtil.union(intersection, - geom); + String[] gids = GeometryUtil.getGID(geom); + boolean flag = false; + for (String gid: gids) { + if (removedGids.contains(gid)) { + flag = true; + break; + } + } + if (!flag) { + if (geom.isEmpty() == false) { + if (intersection == null) { + intersection = geom; + } else { + intersection = GeometryUtil.union(intersection, + geom); + } } } } @@ -2114,6 +2128,7 @@ public class WarngenLayer extends AbstractStormTrackResource { for (GeospatialData f : geoData.features) { Geometry geom = f.geometry; if (f.prepGeom.contains(point)) { + String[] gids = GeometryUtil.getGID(geom); if (GeometryUtil.contains(state.getWarningArea(), point)) { // remove county Geometry tmp = GeometryUtil.difference( @@ -2123,6 +2138,9 @@ public class WarngenLayer extends AbstractStormTrackResource { } state.setWarningArea(tmp); + for (String gid: gids) { + removedGids.add(gid); + } } else { if (oldWarningArea != null) { // for a CON, prevents extra areas to be added @@ -2145,6 +2163,9 @@ public class WarngenLayer extends AbstractStormTrackResource { } state.setWarningArea(GeometryUtil.union( state.getWarningArea(), geom)); + for (String gid: gids) { + removedGids.remove(gid); + } } } else { // add county @@ -2361,4 +2382,8 @@ public class WarngenLayer extends AbstractStormTrackResource { public void setWarningAction(WarningAction warningAction) { this.warningAction = warningAction; } + + public void initRemovedGids() { + removedGids.clear(); + } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenUIManager.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenUIManager.java index 75c74d0fb7..0b45ae91a4 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenUIManager.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenUIManager.java @@ -59,6 +59,8 @@ import com.vividsolutions.jts.geom.Polygon; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 7, 2010 mschenke Initial creation + * Jan 29, 2013 15723 Qinglu Lin Called warngenLayer.initRemovedGids() in move() and in run() of + * AddVertexAction, DeleteVertextAction and MoveElementAction inner classes. * * * @@ -356,6 +358,7 @@ public class WarngenUIManager extends InputAdapter { } private void move(int x, int y) { + warngenLayer.initRemovedGids(); IDisplayPaneContainer container = warngenLayer.getResourceContainer(); WarngenUIState state = warngenLayer.getWarngenState(); @@ -409,6 +412,7 @@ public class WarngenUIManager extends InputAdapter { return; } + warngenLayer.initRemovedGids(); Coordinate[] coords = warngenLayer.getPolygon().getCoordinates(); int idx = StormTrackUIManager.getCoordinateIndex(warngenLayer, @@ -511,6 +515,7 @@ public class WarngenUIManager extends InputAdapter { private class MoveElementAction extends AbstractRightClickAction { @Override public void run() { + warngenLayer.initRemovedGids(); moveType = MoveType.ALL_POINTS; movePointIndex = StormTrackUIManager.getCoordinateIndex( warngenLayer, warngenLayer.getPolygon().getCoordinates(), @@ -540,6 +545,7 @@ public class WarngenUIManager extends InputAdapter { return; } + warngenLayer.initRemovedGids(); Coordinate c = new Coordinate(lastMouseX, lastMouseY); Polygon poly = warngenLayer.getPolygon(); diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/AVIATION.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/AVIATION.xml index dd34f25186..99e3f0adb9 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/AVIATION.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/AVIATION.xml @@ -1,15 +1,15 @@ AVIATION - pluginName,eventName,dataTime + pluginName,info.ensembleId,dataTime - + - + - + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/GFS.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/GFS.xml index 65593e98e5..ca2e8ba72f 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/GFS.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/GFS.xml @@ -1,7 +1,7 @@ GFS - pluginName,info.secondaryId,dataTime + pluginName,dataTime @@ -9,8 +9,5 @@ - - - diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM.xml index 915db50475..7213547f6e 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM.xml @@ -1,7 +1,7 @@ NAM - pluginName,info.secondaryId,dataTime + pluginName,dataTime @@ -9,8 +9,5 @@ - - - diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM_00.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM_00.xml index ee2dd2e260..bf5d06d6c6 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM_00.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NAM_00.xml @@ -3,11 +3,11 @@ NAM_00 pluginName,dataTime - + - + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NcGridSoundingInventory.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NcGridSoundingInventory.xml index dde5030b14..62a9cecaf4 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NcGridSoundingInventory.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/ncep/hold/NcInventoryDefinitions/NcGridSoundingInventory.xml @@ -3,10 +3,10 @@ NcGridSoundingInventory - pluginName,modelName,eventName,dataTime + pluginName,info.datasetId,info.secondaryId,dataTime - + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/python/gfe/JSmartUtils.py b/edexOsgi/build.edex/esb/data/utility/common_static/base/python/gfe/JSmartUtils.py new file mode 100644 index 0000000000..0272c6b0fe --- /dev/null +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/python/gfe/JSmartUtils.py @@ -0,0 +1,80 @@ +## +# 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. +## + +# +# Provides Java implementations of common smart utility functions +# to boost performance. +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/14/13 njensen Initial Creation. +# +# +# + +import jep +from com.raytheon.uf.common.dataplugin.gfe.util import SmartUtils as JavaSmartUtils +import numpy + + +def __getMaskIndiciesForJava(mask): + flatMask = mask.flat #flatten the array + flatIndicies = numpy.nonzero(flatMask) # get the indicies of the set cells + ysize = mask.shape[1] + indexes = [] + # convert the flat incicies to the x, y indicies + for i in flatIndicies: + indexes.append((i / ysize, i % ysize)) + + # Make two new jarrays to hold the final coordinate tuples + size = len(indexes[0][0]) + xcoords = jep.jarray(size, jep.JINT_ID) + ycoords = jep.jarray(size, jep.JINT_ID) + + #=================================================================== + # Convert the coordinates from a tuple of numpy arrays to a list of + # coordinate tuples + + for index in xrange(size): + try: + x = indexes[0][0][index] + y = indexes[0][1][index] + xcoords[index] = int(x) + ycoords[index] = int(y) + except Exception, e: + print e + + return xcoords, ycoords + + +def fillEditArea(grid, fillMask, borderMask): + editPointsX, editPointsY = __getMaskIndiciesForJava(fillMask) + borderPointsX, borderPointsY = __getMaskIndiciesForJava(borderMask) + + gridObj = JavaSmartUtils.fillEditArea(grid, grid.shape[1], grid.shape[0], \ + editPointsY, editPointsX, borderPointsY, borderPointsX) + + retObj = gridObj.__numpy__[0] + return retObj + + diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/GribSpatialCache.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/GribSpatialCache.java index 89b7f198bd..96b4bcf7e1 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/GribSpatialCache.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/GribSpatialCache.java @@ -307,7 +307,12 @@ public class GribSpatialCache { referenceCoverage); double shiftX = 0; - if (shiftSubGridWest == true && modelName != "TPCSurgeProb") + + // Check whether 'shiftWest' flag is set in subgrid definition xml file + if (subGridDef.getShiftWest() != null) + shiftSubGridWest = subGridDef.getShiftWest(); + + if (shiftSubGridWest == true) shiftX = subGridDef.getNx() / 5; double xCenterPoint = subGridCenterGridCoord.x - shiftX; diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/SubGridDef.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/SubGridDef.java index cc19677b94..934c6a3e7a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/SubGridDef.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/spatial/SubGridDef.java @@ -65,7 +65,9 @@ public class SubGridDef implements ISerializableObject { @XmlElement(required = true) private double ny; - + @XmlElement + private Boolean shiftWest; + // annotation on setter to enforce data constraints private Double centerLatitude; @@ -96,6 +98,13 @@ public class SubGridDef implements ISerializableObject { this.ny = ny; } + public Boolean getShiftWest() { + return shiftWest; + } + + public void setShiftWest(Boolean shiftWest) { + this.shiftWest = shiftWest; + } /** * a model may have more than one grid so use reference grid instead. * diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/TPCSurgeProbClip.xml b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/TPCSurgeProbClip.xml index 60ab2538c1..14254e0248 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/TPCSurgeProbClip.xml +++ b/edexOsgi/com.raytheon.edex.plugin.grib/utility/edex_static/base/grib/subgrids/TPCSurgeProbClip.xml @@ -23,6 +23,7 @@ 374 1300 1200 + false + + FRZL + LCLV + HGHT + BCBL + BCLY + BCTL + BCLY + PLBL + DPTH + DPTH + CLDL + CCBL + CCLY + CCLY + CCTL + CCLY + CEIL + CEIL + CLDT + DPTH + DPTH + DCCBL + DCCBL + DCCTL + DCCTL + NONE + NONE + EHLT + EHLT + ELYR + NONE + ELVL + ELVL + HGHT + HGHT + FRZL + GSCBL + GSCTL + GSCBL + GSCTL + HCBL + HCLY + HCLY + HCTL + HCLY + HTSLW + HTFL + HGHT + HTSLW + HYBL + HYBL + PRES + THTA + THTA + LBSLW + HYBL + LCBL + LCLV + LCLY + LCTL + LCLY + LWBZ + LBSLW + LWBZ + PRES + HGHT + THTA + THTA + PRES + SGMA + MWSL + PRES + MCBL + MCLY + MCTL + MCLY + MTHE + DPTH + NONE + MTHE + MWSL + NONE + TOPA + OBIL + OBML + OITL + OLYR + OML + OSEQ + OSEQ + OSEQ + PLBL + PDLY + PLBL + POTV + POTV + SCCBT + SCCBT + SCCTL + SCCTL + SEAB + NONE + SGMA + SGMA + PDLV + TEMP + THTA + TILT + TMPL + TROP + TROP + POTV + LWBZ + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.parameter/utility/common_static/base/parameter/alias/gempak.xml b/edexOsgi/com.raytheon.uf.common.parameter/utility/common_static/base/parameter/alias/gempak.xml index 19161c27f9..96a6950ca1 100644 --- a/edexOsgi/com.raytheon.uf.common.parameter/utility/common_static/base/parameter/alias/gempak.xml +++ b/edexOsgi/com.raytheon.uf.common.parameter/utility/common_static/base/parameter/alias/gempak.xml @@ -19,77 +19,248 @@ further_licensing_information. --> - HGHT5 + HGHT5 + ALBD + ALBD01 + ALBD03 + ALBD06 + ALBD09 + ALBD12 + ALBD18 + ALBD24 + ALBD48 AVOR - WXTR - WXTZ - WXTP - WXTS - CWTR + LFT4 CAPE - CINH CCLD + WXTZ + WXTZ01 + WXTZ03 + WXTZ06 + WXTZ09 + WXTZ12 + WXTZ18 + WXTZ24 + WXTZ48 + WXTP + WXTP01 + WXTP03 + WXTP06 + WXTP09 + WXTP12 + WXTP18 + WXTP24 + WXTP48 + CINH + CLWMR + ACPCP C01M C03M C06M C09M C12M - C12M + C18M + C24M + C48M + POPZ + POPF + C01M + C03M + C06M + C09M + C12M + C18M + C24M + C48M + WXTR + WXTR01 + WXTR03 + WXTR06 + WXTR09 + WXTR12 + WXTR18 + WXTR24 + WXTR48 + WXTS + WXTS01 + WXTS03 + WXTS06 + WXTS09 + WXTS12 + WXTS18 + WXTS24 + WXTS48 + CWTR + CWRK + CWRK01 + CWRK03 + CWRK06 + CWRK09 + CWRK12 + CWRK18 + CWRK24 + CWRK48 + DRCTPW + DRCTSW + LWRD + LWRD01 + LWRD03 + LWRD06 + LWRD09 + LWRD12 + LWRD18 + LWRD24 + LWRD48 DWPK DPDK - DRCTWW - DRCTSW + SWRD + SWRD01 + SWRD03 + SWRD06 + SWRD09 + SWRD12 + SWRD18 + SWRD24 + SWRD48 + EMSL THTE EVAP - HGHT + FLDCP DIST - HEAT + GHFX + GHFX01 + GHFX03 + GHFX06 + GHFX09 + GHFX12 + GHFX18 + GHFX24 + GHFX48 + HGHT + HGHTA CLDH + HLCY + HEAT + HINDEX + ZPBL + ICAHT + ICEC ICET - MIXR + LAND LAPS CLDL + NCPCP S01M S03M + S06M + S09M + S12M + S18M + S24M + S48M FXLH - TMNK - PERDWW - PERDSW + FXLH01 + FXLH03 + FXLH06 + FXLH09 + FXLH12 + FXLH18 + FXLH24 + FXLH48 CLDM - TMXK - LIFT - PRES - PMSL - EMSL + MIXR MMSL - THTA - PCPR - PRESA - DRCTPW + TMNK + TMNK01 + TMNK03 + TMNK06 + TMNK09 + TMNK12 + TMNK18 + TMNK24 + TMNK48 + TMXK + TMXK01 + TMXK03 + TMXK06 + TMXK09 + TMXK12 + TMXK18 + TMXK24 + TMXK48 + OZMR + PRES + PRES01 + PRES03 + PRES06 + PRES09 + PRES12 + PRES18 + PRES24 + PRES48 PERDPW - POPZ - POPF - PVOR + PERDSW PEVAP PEVP + LIFT + PLPL + PMSL + THTA + PRATE + PR01 + PR03 + PR06 + PR09 + PR12 + PR18 + PR24 + PR48 + PRESA + PVOR + OMEG PWTR RELH SATD - DRCTSW - PERDSW - HGHTSW - HGHTWW SCVR - SNDM SPFH FXSH - SLTK - HLCY + FXSH01 + FXSH03 + FXSH06 + FXSH09 + FXSH12 + FXSH18 + FXSH24 + FXSH48 LIFT + SNDM + SOIM + SUNSD + DRCTSW + HGHTSW + PERDSW TMPK + TMPK01 + TMPK03 + TMPK06 + TMPK09 + TMPK12 + TMPK18 + TMPK24 + TMPK48 TMPKA - TSTM CLD + CLD01 + CLD03 + CLD06 + CLD09 + CLD12 + CLD18 + CLD24 + CLD48 + TSTM + TOZO + APCP P01M P03M P06M @@ -98,19 +269,89 @@ P18M P24M P48M + SLTK + UGWD + UGWD01 + UGWD03 + UGWD06 + UGWD09 + UGWD12 + UGWD18 + UGWD24 + UGWD48 + URELFX + URELFX01 + URELFX03 + URELFX06 + URELFX09 + URELFX12 + URELFX18 + URELFX24 + URELFX48 + LWRU + LWRU01 + LWRU03 + LWRU06 + LWRU09 + LWRU12 + LWRU18 + LWRU24 + LWRU48 USTRM VSTRM + SWRU + SWRU01 + SWRU03 + SWRU06 + SWRU09 + SWRU12 + SWRU18 + SWRU24 + SWRU48 UREL VREL VAPR - VWSH - OMEG + VRELFX + VRELFX01 + VRELFX03 + VRELFX06 + VRELFX09 + VRELFX12 + VRELFX18 + VRELFX24 + VRELFX48 + VGWD + VGWD01 + VGWD03 + VGWD06 + VGWD09 + VGWD12 + VGWD18 + VGWD24 + VGWD48 VSBY THTV + VRATE + VWSH TVRK - SWEM - ENRG + VWSH + WATR + WATR01 + WATR03 + WATR06 + WATR09 + WATR12 + WATR18 + WATR24 + WATR48 DRCT - SPED + SWEM + HGHT5 GUST + WILT + ENRG + SPED + DRCTWW + HGHTWW + PERDWW \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/PythonNumpyFloatArray.java b/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PythonNumpyFloatArray.java similarity index 97% rename from cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/PythonNumpyFloatArray.java rename to edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PythonNumpyFloatArray.java index 1f20590bcc..ec3357c58a 100644 --- a/cave/com.raytheon.uf.viz.derivparam.python/src/com/raytheon/uf/viz/derivparam/python/PythonNumpyFloatArray.java +++ b/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PythonNumpyFloatArray.java @@ -17,7 +17,7 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.derivparam.python; +package com.raytheon.uf.common.python; import jep.INumpyable; diff --git a/edexOsgi/com.raytheon.uf.tools.cli/impl/capture b/edexOsgi/com.raytheon.uf.tools.cli/impl/capture index 22d95b42b8..a5f0cf373c 100644 --- a/edexOsgi/com.raytheon.uf.tools.cli/impl/capture +++ b/edexOsgi/com.raytheon.uf.tools.cli/impl/capture @@ -12,6 +12,7 @@ REMOTE_SERVERS_TO_CHECK="dx1f dx3 dx4" # Flags to control what data capure grabs, to enable flag must be YES, anything else will be considered off. RUN_JSTACK="Y" +JSTACK_ITERATIONS="15" RUN_JMAP="Y" RUN_QPID_STAT="Y" MOVE_ALL_HS_ERR_PID="Y" @@ -19,6 +20,7 @@ MOVE_ALL_HS_ERR_PID="Y" GRAB_REMOTE_TOP="Y" GRAB_REMOTE_VMSTAT="Y" GRAB_CAVE_AND_ALERTVIZ_LOGS="Y" +GRAB_SCREENSHOT='Y' EDEX_MODE="N" FORCE="N" TGZ_OUTPUT="Y" @@ -39,6 +41,9 @@ usage() { echo -e "-g {grep string}\tdefault [$grepString]" echo " The grep string used to find the processes" echo + echo -e "-screen {y/n}\t\tdefault [$GRAB_SCREENSHOT]" + echo " Screen print the current workstation (local user must be running capture)" + echo echo -e "-s {y/n}\t\tdefault [$RUN_JSTACK]" echo " Run jstack to grab the thread stack information" echo @@ -115,6 +120,18 @@ checkYes() { fi } +# runs import to grab screen shot of users desktop +grabScreenShot() { + if [ "$GRAB_SCREENSHOT" == "y" ]; then + echo "Capturing screen shot of desktop" + t1=`date "+%Y%m%d %H:%M:%S"` + echo "${t1}: Capturing screen shot of desktop" >> $processFile + import -window root -display :0.0 ${dataPath}/screenShot_0.png > ${dataPath}/screenShot_0.log 2>&1 & + import -window root -display :0.1 ${dataPath}/screenShot_1.png > ${dataPath}/screenShot_1.log 2>&1 & + import -window root -display :0.2 ${dataPath}/screenShot_2.png > ${dataPath}/screenShot_2.log 2>&1 & + fi +} + # runs ssh command to grab top on a remote server, requires auto login to be setup grabRemoteTop() { if [ "$GRAB_REMOTE_TOP" == "y" ]; then @@ -143,7 +160,6 @@ grabRemoteVmstat() { fi } - checkForProcsAsOtherUsers() { if [ ! -z "$procs" ]; then numMyProcs=`echo "$myProcs" | wc -l` @@ -213,39 +229,104 @@ reasonForCapture() { echo $reason >> ${dataPath}/capture_reason.log } -# runs jstack in background +# for a specified pid run jstack a specified number of times in a row runJstack() { local pid="$1" - shift 1 - local options=$@ - local prePath="${dataPath}/pid_${pid}_" - local t1=`date "+%Y%m%d %H:%M:%S"` - local cmd="/awips2/java/bin/jstack $options $pid" - echo "${t1}: Running command: ${cmd} >> ${prePath}jstack.log 2>&1 &" >> $processFile - if [ "$ACCUM" = "y" ]; then - echo >> ${prePath}jstack.log - echo >> ${prePath}jstack.log - echo "Running for $t1" >> ${prePath}jstack.log + local numIterations="$2" + local options="-l" + + if [ "$FORCE" == "y" ]; then + options="${options} -F" fi - $cmd >> ${prePath}jstack.log 2>&1 & + + local cmd="/awips2/java/bin/jstack" + local count=1 + local prePath="${dataPath}/pid_${pid}_" + local log="" + while [ "$count" -le "$numIterations" ]; do + t1=`date "+%Y%m%d %H:%M:%S"` + log="${prePath}jstack_${count}.log" + + echo "${t1}: Running command: ${cmd} ${options} ${pid} >> ${log} 2>&1" >> $processFile + echo "Running for $t1" >> $log + ${cmd} ${options} ${pid} >> ${log} 2>&1 + + if [[ "$?" != "0" && $FORCE != "y" ]]; then + t1=`date "+%Y%m%d %H:%M:%S"` + echo "${t1}: jstack for $pid failed to connect, rerunning with -F" >> $processFile + ${cmd} ${options} -F ${pid} >> ${log} 2>&1 + fi + let "count+=1" + done } -# runs jmap in background +# Launchs a background process for each PID to pull jstacks +launchJstacks() { + # grab all jstacks + if [ "${RUN_JSTACK}" == "y" ]; then + if [ ! -z ${cavePid} ]; then + echo "Capturing thread stack for pid $cavePid" + else + echo "Capturing all process thread stacks" + fi + + local count=0 + while [ "$count" -lt "$numProcs" ]; do + runJstack ${pids[$count]} ${JSTACK_ITERATIONS} & + let "count+=1" + done + fi +} + +# runs jmap in background, if it fails will run again with -F runJmap() { local pid=$1 - shift 1 - local options=$@ local prePath="${dataPath}/pid_${pid}_" + local options="" + + if [ "$FORCE" == "y" ]; then + options="${options} -F" + fi + local t1=`date "+%Y%m%d %H:%M:%S"` + local log="${prePath}dump.log" + local dumpPath="${prePath}dump" + if [ "$ACCUM" = "y" ]; then # accum needs to change hprof by date local t2=`date "+%Y%m%d_%H%M%S"` - local cmd="/awips2/java/bin/jmap -dump:format=b,file=${prePath}dump_${t2}.hprof $options $pid" + dumpPath="${dumpPath}_${t2}.hprof" else - local cmd="/awips2/java/bin/jmap -dump:format=b,file=${prePath}dump.hprof $options $pid" + dumpPath="${dumpPath}.hprof" + fi + + local cmd="/awips2/java/bin/jmap -dump:format=b,file=${dumpPath}" + echo "${t1}: Running command: $cmd $options $pid >> $log 2>&1 &" >> $processFile + $cmd $options $pid >> $log 2>&1 & + + if [[ "$?" != "0" && $FORCE != "y" ]]; then + t1=`date "+%Y%m%d %H:%M:%S"` + echo "${t1}: jmap for $pid failed to connect, rerunning with -F" >> $processFile + $cmd $options -F $pid >> $log 2>&1 & + fi +} + +# Launchs a background process for each PID to pull jmap +launchJmaps() { + # grab all jmaps + if [ "$RUN_JMAP" == "y" ]; then + if [ ! -z ${cavePid} ]; then + echo "Capturing process heap dump for pid $cavePid" + else + echo "Capturing all Heap Dumps" + fi + + local count=0 + while [ "$count" -lt "$numProcs" ]; do + runJmap ${pids[$count]} & + let "count+=1" + done fi - echo "${t1}: Running command: $cmd >> ${prePath}dump.log 2>&1 &" >> $processFile - $cmd >> ${prePath}dump.log 2>&1 & } # runs qpid-stat @@ -253,14 +334,25 @@ runQpidStat() { local qpidHost=cp1f local prePath="${dataPath}/" local t1=`date "+%Y%m%d %H:%M:%S"` - local cmd="/awips2/python/bin/qpid-stat -q -Smsg -L100 ${qpidHost}" - echo "${t1}: Running command: $cmd >> ${prepath}qpid-stat.log 2>&1 &" >> $processFile + local cmd="/awips2/python/bin/qpid-stat -q -Smsg -L500 ${qpidHost}" + local log="${prepath}qpid-stat-queues.log" + echo "${t1}: Running command: $cmd >> $log 2>&1 &" >> $processFile if [ "$ACCUM" = "y" ]; then - echo >> ${prePath}qpid-stat.log - echo >> ${prePath}qpid-stat.log - echo "Running for $t1" >> ${prePath}qpid-stat.log + echo >> $log + echo >> $log + echo "Running for $t1" >> $log fi - $cmd >> ${prePath}qpid-stat.log 2>&1 & + $cmd >> $log 2>&1 & + + log="${prepath}qpid-stat-sessions.log" + cmd="/awips2/python/bin/qpid-stat -s -Smsg -L500 ${qpidHost}" + echo "${t1}: Running command: $cmd >> $log 2>&1 &" >> $processFile + if [ "$ACCUM" = "y" ]; then + echo >> $log + echo >> $log + echo "Running for $t1" >> $log + fi + $cmd >> $log 2>&1 & } # runs versions.sh to grab version info @@ -291,6 +383,7 @@ while [ ! -z "$1" ]; do -e) EDEX_MODE="Y"; edexProcs[$edexProcCount]="$1"; shift 1; let "edexProcCount+=1";; -a) ACCUM="$1"; shift 1;; -v) GRAB_REMOTE_VMSTAT="$1"; shift 1;; + -screen) GRAB_SCREENSHOT="$1"; shift 1;; -h|*) usage;; esac done @@ -308,6 +401,7 @@ checkYes EDEX_MODE $EDEX_MODE checkYes TGZ_OUTPUT $TGZ_OUTPUT checkYes ACCCUM $ACCCUM checkYes RUN_VERSIONS $RUN_VERSIONS +checkYes GRAB_SCREENSHOT $GRAB_SCREENSHOT # if PID mode don't grab other hs_err_pids if [ ! -z $cavePid ]; then @@ -383,7 +477,7 @@ if [ "$EDEX_MODE" == "y" ]; then grepString="${grepString}) " fi -procs=`ps -ef | grep -E "$grepString" | grep -v "grep"` +procs=`ps -ef | grep -E "$grepString" | grep -v "grep" | grep -v "cave.sh"` if [ ! -z "$cavePid" ]; then # limit cave procs to the requested PID @@ -399,11 +493,6 @@ echo "" >> $processFile checkForProcsAsOtherUsers -# get reason for running capture -if [ "$reason" != "n" ]; then - reasonForCapture & -fi - if [ ! -z "${myProcs}" ]; then t1=`date "+%Y%m%d %H:%M:%S"` echo "Processes found for user $user, capturing data to $dataPath" @@ -424,38 +513,9 @@ if [ ! -z "${myProcs}" ]; then done IFS=$PREV_IFS - # doing each item in its own loop so we can grab all data for a given type at once + launchJstacks - # grab all jstacks - if [ "${RUN_JSTACK}" == "y" ]; then - if [ ! -z ${cavePid} ]; then - echo "Capturing thread stack for pid $cavePid" - else - echo "Capturing all process thread stacks" - fi - - count=0 - while [ "$count" -lt "$numProcs" ]; do - if [ "$FORCE" == "y" ]; then - runJstack ${pids[$count]} -l -F - else - runJstack ${pids[$count]} -l - fi - bPids[$count]=$! - let "count+=1" - done - - count=0 - while [ "$count" -lt "$numProcs" ]; do - wait ${bPids[$count]} - if [ "$?" != "0" ]; then - t1=`date "+%Y%m%d %H:%M:%S"` - echo "${t1}: jstack for ${pids[$count]} failed to connect, rerunning with -F" >> $processFile - runJstack ${pids[$count]} -l -F - fi - let "count+=1" - done - fi + launchJmaps runQpidStat @@ -463,36 +523,6 @@ if [ ! -z "${myProcs}" ]; then grabRemoteVmstat - # grab all jmaps - if [ "$RUN_JMAP" == "y" ]; then - if [ ! -z ${cavePid} ]; then - echo "Capturing process heap dump for pid $cavePid" - else - echo "Capturing all Heap Dumps" - fi - - count=0 - while [ "$count" -lt "$numProcs" ]; do - if [ "$FORCE" == "y" ]; then - runJmap ${pids[$count]} -F - else - runJmap ${pids[$count]} - fi - bPids[$count]=$! - let "count+=1" - done - - count=0 - while [ "$count" -lt "$numProcs" ]; do - wait ${bPids[$count]} - if [ "$?" != "0" ]; then - t1=`date "+%Y%m%d %H:%M:%S"` - echo "${t1}: jmap for ${pids[$count]} failed to connect, rerunning with -F" >> $processFile - runJmap ${pids[$count]} -F - fi - let "count+=1" - done - fi else t1=`date "+%Y%m%d %H:%M:%S"` echo "*** NO processes found for user $user, capturing limited data to $dataPath" @@ -504,6 +534,14 @@ else grabRemoteVmstat fi +# grab screen shot, spawns background process for each screen +grabScreenShot + +# get reason for running capture +if [ "$reason" != "n" ]; then + reasonForCapture & +fi + # move all hs_err_pid from user's home directory to capture directory if [ "${MOVE_ALL_HS_ERR_PID}" == "y" ]; then numErrFiles=`ls ${HOME}/hs_err_pid* 2> /dev/null | wc -l` diff --git a/ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/ncinventory/NcInventory.java b/ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/ncinventory/NcInventory.java index cf096ad411..5e6dee5d97 100644 --- a/ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/ncinventory/NcInventory.java +++ b/ncep/gov.noaa.nws.ncep.edex.common/src/gov/noaa/nws/ncep/edex/common/ncinventory/NcInventory.java @@ -281,6 +281,7 @@ public class NcInventory { // get the dao and the record class for this plugin and use them // to create a DatabaseQuery. // + CoreDao dao = PluginFactory.getInstance().getPluginDao( inventoryDefn.getPluginName() ); String recordClassStr = PluginFactory.getInstance().getPluginRecordClassName( @@ -308,7 +309,6 @@ public class NcInventory { List queryResults = dao.queryByCriteria( dbQuery ); if( !queryResults.isEmpty() ) { - for( Object queryRslt : queryResults ) { // if there is only one parameter then the results will be an // Object, otherwise it will be an array of Objects. @@ -327,7 +327,12 @@ public class NcInventory { Object rsltArray[] = (Object[])queryRslt; for( int p=0 ; p * * This code has been developed by the SIB for use in the AWIPS2 system. @@ -23,25 +25,22 @@ import java.util.Map; * @version 1.0 */ -public class MosaicInfoDict implements Iterable { - public static final String MOSAIC_INFO_FILE = "mosaicInfo.txt"; +public class MosaicInfoDict implements Iterable { private static MosaicInfoDict instance = null; private Map dict; - private MosaicInfoDict(String dir) { + private MosaicInfoDict(File midf) { dict = new LinkedHashMap(); - - // file points to $AWIPS/edex/data/utility/common_static/base/mosaicInfo.txt - File file = new File(dir + File.separator + MOSAIC_INFO_FILE); - + try { //read the mosaicInfo.txt to pointer in - BufferedReader in = new BufferedReader(new FileReader(file)); + BufferedReader in = new BufferedReader(new FileReader(midf)); String s = in.readLine(); + //read in line by line and put into mosaic information dictionary while (s != null) { if ((s.length() > 0) && (s.charAt(0) != '#')) { @@ -69,7 +68,7 @@ public class MosaicInfoDict implements Iterable { * @return */ public MosaicInfo getInfo(int productCode) { - return dict.get(productCode); + return dict.get(productCode); } /* @@ -82,9 +81,9 @@ public class MosaicInfoDict implements Iterable { return Collections.unmodifiableCollection(dict.values()).iterator(); } - public static synchronized MosaicInfoDict getInstance(String dir) { + public static synchronized MosaicInfoDict getInstance(File midf ) { if (instance == null) { - instance = new MosaicInfoDict(dir); + instance = new MosaicInfoDict(midf); } return instance; @@ -100,6 +99,7 @@ public class MosaicInfoDict implements Iterable { } public static void main(String[] args) { - MosaicInfoDict dict = MosaicInfoDict.getInstance(args[0]); + File f = new File( args[0]); + MosaicInfoDict dict = MosaicInfoDict.getInstance( f ); } } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/GridLookupFileName.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/GridLookupFileName.java index 5041ffc517..567d9f9eda 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/GridLookupFileName.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/GridLookupFileName.java @@ -4,17 +4,13 @@ import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; -// TODO this logic could probably be included in the ncgribFileNameProcessor rather than in a singleton public class GridLookupFileName { /** The singleton instance of GridLookupFileName **/ private static GridLookupFileName instance; - // TODO modelname needs to be infered from filename since the file name - // processing happens before decode. private String[] modelNames = { "cmce", "gefs", "gww", "naefsBC", "naefsUS", "naefsAK", "sref" }; - // TODO this should be read from a configureable xml file, not hardcoded private String[] template = { "cmc_gep.*|cmce;cmc_gec.*|cmcec;cmc_geavg.*|cmceMean;cmc_gespr.*|cmceSpread", "gec00.*bc.*|gefscBC;gec00.*anl|gefscAnal;gec00.*[0-9]|gefsc;gep.*anl|gefsAnal;gep.*bc.*|gefsBC;geavg.*bc.*|gefsMeanBC;gespr.*bc.*|gefsSpreadBC;gespr.*|gefsSpread", @@ -40,9 +36,6 @@ public class GridLookupFileName { } private void initModels() { - // TODO instead of just building this map, all parsing should be - // happening here and regexes should be built into Pattern object so - // that we aren'y constantly reprocessing regexes for (int i = 0; i < modelNames.length; i++) { models.put(modelNames[i].toUpperCase(), template[i]); } @@ -51,24 +44,18 @@ public class GridLookupFileName { public String getModelName(String filename) { String modelname = null; - // this was commented out because file name processing should happen - // before decode so there is no pre-existing model name. // if (model.equalsIgnoreCase("gww") && gridId.equalsIgnoreCase("229")) // { // return modelname; // } // // String template = models.get(model.toUpperCase()); - // since we don't know the model name, we must process all templates. for (String template : this.template) { - // TODO do not split this for every filename, split in init String[] tokens = template.split(";"); // System.out.println ( " CMC ensemble " + "!!!\n"); for (String token : tokens) { - // TODO do not split this for every filename, split in init String[] alias = token.split("\\|"); - // TODO compile and reuse patterns. if (Pattern.matches(alias[0], filename)) { modelname = alias[1]; @@ -81,9 +68,6 @@ public class GridLookupFileName { break; } } - if (modelname != null) { - break; - } } return modelname; } diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgribFileNameProcessor.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgribFileNameProcessor.java index b09c909c21..84ae8e4065 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgribFileNameProcessor.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncgrib/src/gov/noaa/nws/ncep/edex/plugin/ncgrib/NcgribFileNameProcessor.java @@ -27,11 +27,9 @@ import org.apache.camel.Processor; /** * - * Based off a file name for a grib file, determine the modelName, secondaryId, - * and ensembleId. It is ok not to set any headers because the decoder can find - * the modelName and ensembleId. Those fields should only be set if the filename - * has information beyond what is in the actual grib file.The grib decoder will - * not set a secondary id so if it isn't set here it will be null. + * Processor for ncep grib files, this processor has lots of hard coded + * assumptions about file naming that need to be more generic based off ncep + * file names. * *
  * 
@@ -48,25 +46,20 @@ import org.apache.camel.Processor;
  */
 public class NcgribFileNameProcessor implements Processor {
 
-    // TODO does this actually match all ensemble patterns?
     // grab all known ensemble ids
     private static final Pattern ENSEMBLE_ID_PATTERN = Pattern
             .compile("^(p|n|ctl)\\d{0,2}$");
 
-    // TODO merge this pattern in with the patterns in GridLookupFileName
     // anything that ends in nest is assumed to be a nested grid identifier
     private static final Pattern FIREWXNEST_ID_PATTERN = Pattern
             .compile("^firewxnest$");
 
-    // TODO merge this pattern in with the patterns in GridLookupFileName
     // anything that ends in nest is assumed to be a nested grid identifier
     private static final Pattern NEST_ID_PATTERN = Pattern.compile("^.*nest$");
 
-    // TODO merge this pattern in with the patterns in GridLookupFileName
     // SREF gets special handling, does this apply to other models?
     private static final Pattern SREF_PATTERN = Pattern.compile("^sref_.*$");
 
-    // TODO merge this pattern in with the patterns in GridLookupFileName
     // This is the least generic pattern ever, are there any constraints on
     // event names, who knows?
     private static final Pattern HURRICANE_PATTERN = Pattern
@@ -108,13 +101,14 @@ public class NcgribFileNameProcessor implements Processor {
                 }
             }
         }
-        datasetid = GridLookupFileName.getInstance().getModelName(flName);
+     //   datasetid = GridLookupFileName.getInstance().getModelName(flName);
         if (datasetid != null) {
             exchange.getIn().setHeader("datasetid", datasetid);
         }
+        else {
+        	datasetid = GridLookupFileName.getInstance().getModelName(flName);
+        }
         if (secondaryid == null) {
-            // TODO does everything really need secondaryid or should this only
-            // be set for events?
             secondaryid = nameTokens[0];
         }
         exchange.getIn().setHeader("secondaryid", secondaryid);
diff --git a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/view/NsharpPaletteWindow.java b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/view/NsharpPaletteWindow.java
index 798d98be86..aa3eae0a32 100644
--- a/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/view/NsharpPaletteWindow.java
+++ b/ncep/gov.noaa.nws.ncep.ui.nsharp/src/gov/noaa/nws/ncep/ui/nsharp/view/NsharpPaletteWindow.java
@@ -101,7 +101,7 @@ DisposeListener, IPartListener{
 	private static NsharpConstants.SPCGraph leftGraph = NsharpConstants.SPCGraph.EBS;
 	private static NsharpConstants.SPCGraph rightGraph = NsharpConstants.SPCGraph.STP;
 	private boolean spcGpCreated = false;
-	public static NsharpPaletteWindow getInstance() {
+	public  static NsharpPaletteWindow getInstance() {
 		if( VizPerspectiveListener.getCurrentPerspectiveManager()!= null){
 			if(VizPerspectiveListener.getCurrentPerspectiveManager().getPerspectiveId().equals(D2D5Pane.ID_PERSPECTIVE))
 				return d2dInstance;
@@ -279,7 +279,7 @@ DisposeListener, IPartListener{
 		if(rsc!= null && rsc.getSpcGraphsPaneRsc()!=null) {
 			rsc.getSpcGraphsPaneRsc().setGraphs(leftGraph, rightGraph);
 		}
-
+		
 	}
 	public void setAndOpenMb(String msg) {
 		if (mb != null) {
@@ -312,12 +312,12 @@ DisposeListener, IPartListener{
 		NsharpConfigStore configStore = configMgr.retrieveNsharpConfigStoreFromFs();
 		NsharpGraphProperty graphConfigProperty = configStore.getGraphProperty();
 		paneConfigurationName = graphConfigProperty.getPaneConfigurationName();
-		try {
-			NsharpGridInventory.getInstance().initInventory(false);
+		/*try {
+		//	NsharpGridInventory.getInstance().initInventory(false);
 		} catch (VizException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
-		}
+		}*/
 		
 	}
 
@@ -1048,7 +1048,7 @@ DisposeListener, IPartListener{
 				}
 			}          		            	 	
 		} );
-
+		
 		if(paneConfigurationName.equals(NsharpConstants.PANE_SPCWS_CFG_STR))
 			createSPCGp();
 		
@@ -1082,7 +1082,7 @@ DisposeListener, IPartListener{
 		}
 		else{
 			effBulkShearBtn.setEnabled( false );
-	}
+		}
 		effBulkShearBtn.addListener( SWT.MouseUp, new Listener() {
 			public void handleEvent(Event event) {  
 				if(leftGraph != NsharpConstants.SPCGraph.EBS && rightGraph != NsharpConstants.SPCGraph.EBS){
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_logs.so b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_logs.so
index d379a58498..1e6a5abd68 100644
Binary files a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_logs.so and b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_logs.so differ
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_nologs.so b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_nologs.so
index 85c1026e85..62ec770343 100644
Binary files a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_nologs.so and b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux32/libgpk_nologs.so differ
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux64/libgempak.so b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux64/libgempak.so
index d0ec988cdd..29fd1fec9b 100644
Binary files a/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux64/libgempak.so and b/ncep/gov.noaa.nws.ncep.viz.gempak.nativelib.linux64/libgempak.so differ
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/MANIFEST.MF b/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/MANIFEST.MF
index c1a4d09cea..7af40520d6 100644
--- a/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/MANIFEST.MF
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/MANIFEST.MF
@@ -4,6 +4,8 @@ Bundle-Name: Gempak Plug-in
 Bundle-SymbolicName: gov.noaa.nws.ncep.viz.gempak;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: gov.noaa.nws.ncep.viz.gempak.Activator
+Eclipse-BuddyPolicy: registered, ext, global
+Eclipse-RegisterBuddy:  com.raytheon.uf.common.serialization
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  com.raytheon.viz.core;bundle-version="1.12.1142",
@@ -13,6 +15,8 @@ Require-Bundle: org.eclipse.ui,
  com.raytheon.viz.alerts,
  com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
  com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0",
+ com.raytheon.uf.common.parameter;bundle-version="1.0.0",
+ com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
  com.sun.jna,
  org.geotools;bundle-version="2.6.4",
  org.apache.log4j;bundle-version="1.0.0"
@@ -21,6 +25,10 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: gov.noaa.nws.ncep.viz.gempak,
  gov.noaa.nws.ncep.viz.gempak.grid.jna,
  gov.noaa.nws.ncep.viz.gempak.grid.inv,
+ gov.noaa.nws.ncep.viz.gempak.grid.mapper,
+ gov.noaa.nws.ncep.viz.gempak.grid.units,
  gov.noaa.nws.ncep.viz.gempak.util
 Import-Package: com.raytheon.uf.common.derivparam.tree,
- gov.noaa.nws.ncep.edex.common.ncinventory
+ gov.noaa.nws.ncep.edex.common.ncinventory,
+ gov.noaa.nws.ncep.common.log.logger,
+ com.raytheon.uf.common.serialization
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
new file mode 100644
index 0000000000..180598c631
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject
@@ -0,0 +1,4 @@
+gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridParmInfo
+gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridParmInfoSet
+gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridVcrdInfo
+gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridVcrdInfoSet
\ No newline at end of file
diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/localization/ncep/GempakGridUnits/gempakGridParmeterUnits.xml b/ncep/gov.noaa.nws.ncep.viz.gempak/localization/ncep/GempakGridUnits/gempakGridParmeterUnits.xml
similarity index 100%
rename from ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/localization/ncep/GempakGridUnits/gempakGridParmeterUnits.xml
rename to ncep/gov.noaa.nws.ncep.viz.gempak/localization/ncep/GempakGridUnits/gempakGridParmeterUnits.xml
diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml b/ncep/gov.noaa.nws.ncep.viz.gempak/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml
similarity index 99%
rename from ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml
rename to ncep/gov.noaa.nws.ncep.viz.gempak/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml
index c7b132e2c6..720727064d 100644
--- a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/localization/ncep/GempakGridUnits/gempakGridVcrdUnits.xml
@@ -98,7 +98,7 @@
      
      
           Pressure difference layer
-          hPa
+          Pa
           PDLY
           -2
      
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/mapper/GridMapper.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/mapper/GridMapper.java
new file mode 100644
index 0000000000..d70f73f32f
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/mapper/GridMapper.java
@@ -0,0 +1,20 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.mapper;
+
+import com.raytheon.uf.common.dataplugin.grid.mapping.DatasetIdMapper;
+import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapper;
+import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
+
+public class GridMapper {
+	public GridMapper () {
+	}
+
+	public static void GridMapperInit () {
+		initlize ();
+	}
+	
+	private static void initlize () {
+		DatasetIdMapper.getInstance();
+		LevelMapper.getInstance();
+		ParameterMapper.getInstance();
+	}
+}
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfo.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfo.java
new file mode 100644
index 0000000000..1dce2c118f
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfo.java
@@ -0,0 +1,55 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class GempakGridParmInfo implements ISerializableObject{
+	@XmlElement
+    private String name;
+	
+	@XmlElement
+    private String units;
+	
+	@XmlElement
+    private String gnam;
+	
+	@XmlElement
+    private int scale;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getUnits() {
+		return units;
+	}
+
+	public void setUnits(String units) {
+		this.units = units;
+	}
+
+	public String getGnam() {
+		return gnam;
+	}
+
+	public void setGnam(String gnam) {
+		this.gnam = gnam;
+	}
+
+	public int getScale() {
+		return scale;
+	}
+
+	public void setScale(int scale) {
+		this.scale = scale;
+	}
+}
+
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoLookup.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoLookup.java
new file mode 100644
index 0000000000..2a75f8721f
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoLookup.java
@@ -0,0 +1,117 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.raytheon.uf.common.localization.FileUpdatedMessage;
+import com.raytheon.uf.common.localization.ILocalizationFileObserver;
+import com.raytheon.uf.common.localization.IPathManager;
+import com.raytheon.uf.common.localization.LocalizationContext;
+import com.raytheon.uf.common.localization.LocalizationFile;
+import com.raytheon.uf.common.localization.PathManagerFactory;
+import com.raytheon.uf.common.localization.FileUpdatedMessage.FileChangeType;
+import com.raytheon.uf.common.serialization.SerializationUtil;
+
+import gov.noaa.nws.ncep.common.log.logger.NcepLogger;
+import gov.noaa.nws.ncep.common.log.logger.NcepLoggerManager;
+import gov.noaa.nws.ncep.viz.localization.NcPathManager;
+
+public class GempakGridParmInfoLookup implements ILocalizationFileObserver {
+	public static final String GRID_GEMPAK_PARM_FILE = "ncep"+File.separator +
+															"GempakGridUnits" + File.separator + 
+															"gempakGridParmeterUnits.xml";
+	/** The logger */
+	private static NcepLogger logger = NcepLoggerManager.getNcepLogger(GempakGridParmInfoLookup.class);
+
+	/** The singleton instance of GridLookupFileName **/
+    private static GempakGridParmInfoLookup instance;
+    
+    private final Map parmInfo;
+    
+    public static GempakGridParmInfoLookup getInstance () {
+    	if (instance == null) {
+    		instance = new GempakGridParmInfoLookup ();
+    	}
+    	return instance;
+    }
+    
+    private GempakGridParmInfoLookup () {
+    	parmInfo = new HashMap ();
+    	try {
+    		initParmInfo ();
+    	}catch (IOException e) {
+            logger.error("Unable to initialize gempak parameter information list!", e);
+        }
+    }
+    
+    private void initParmInfo () throws IOException {
+    	
+//    	logger.info("Initial Gempak Parameter information===");
+    	File gempakParmInfo = 
+    		NcPathManager.getInstance().getStaticFile(GRID_GEMPAK_PARM_FILE);
+    	
+    	GempakGridParmInfoSet parmInfoList = null;
+    	try {
+    		if ( gempakParmInfo.exists()) {
+    			parmInfoList = (GempakGridParmInfoSet) SerializationUtil
+                .jaxbUnmarshalFromXmlFile(gempakParmInfo.getPath());
+    		} else {
+                ArrayList emptyList = new ArrayList();
+                parmInfoList = new GempakGridParmInfoSet();
+                parmInfoList.setParmeterinfo(emptyList);
+            }
+    		for (GempakGridParmInfo parm : parmInfoList.getParmeterinfo()) {
+    			parmInfo.put(parm.getGnam(), parm);
+    		}
+    	} catch (Exception e) {
+            throw new IOException ("Unable to unmarshal ncep gempak parm info file");
+        }
+    	
+    }
+  
+    public String getParmUnit ( String parm ) {
+    	
+    	String units = null;
+    	GempakGridParmInfo pInfo = parmInfo.get(parm);
+    	if ( pInfo != null ) {
+    		units = pInfo.getUnits();
+    	}
+    	return units;
+    }
+    
+    public int getParmScale ( String parm ) {
+    	
+    	int scale = 0;
+    	GempakGridParmInfo pInfo = parmInfo.get(parm);
+    	if ( pInfo != null ) {
+    		scale = pInfo.getScale();
+    	}
+    	return scale;
+    }
+    
+    public void display () {
+    	int cnt = 1;
+    	logger.info ("Size of parm table:" + parmInfo.size());
+    	for (GempakGridParmInfo parm: parmInfo.values() ) {
+    		logger.info("No." + cnt + " name:" + parm.getName() + " gname:" + parm.getGnam() + " units:" + parm.getUnits() + " scale:" + parm.getScale());
+    		cnt ++;
+    	}
+    }
+	@Override
+	public void fileUpdated( FileUpdatedMessage fumsg) {
+		String fName = fumsg.getFileName();
+		LocalizationFile lFile;
+		logger.info("======fileUpdated:" + fumsg.getChangeType());
+		// if the file had been deleted 
+		if( fumsg.getChangeType() == FileChangeType.DELETED ) {
+
+		}
+		else {
+		
+		}
+	}
+}
+
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoSet.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoSet.java
new file mode 100644
index 0000000000..00a5cacc39
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridParmInfoSet.java
@@ -0,0 +1,29 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import java.util.ArrayList;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+
+@XmlRootElement(name = "gempakGridParmUnitSet")
+@XmlAccessorType(XmlAccessType.NONE)
+public class GempakGridParmInfoSet implements ISerializableObject{
+	/**
+     * List of parameter for/from the XML.
+     */
+    @XmlElements( { @XmlElement(name = "parmeterinfo", type = GempakGridParmInfo.class) })
+    private ArrayList parmeterinfo;
+
+	public ArrayList getParmeterinfo() {
+		return parmeterinfo;
+	}
+
+	public void setParmeterinfo(ArrayList parmeterinfo) {
+		this.parmeterinfo = parmeterinfo;
+	}
+}
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfo.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfo.java
new file mode 100644
index 0000000000..3de4aaf5bc
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfo.java
@@ -0,0 +1,55 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class GempakGridVcrdInfo implements ISerializableObject{
+	@XmlElement
+    private String name;
+	
+	@XmlElement
+    private String units;
+	
+	@XmlElement
+    private String gnam;
+	
+	@XmlElement
+    private int scale;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getUnits() {
+		return units;
+	}
+
+	public void setUnits(String units) {
+		this.units = units;
+	}
+
+	public String getGnam() {
+		return gnam;
+	}
+
+	public void setGnam(String gnam) {
+		this.gnam = gnam;
+	}
+
+	public int getScale() {
+		return scale;
+	}
+
+	public void setScale(int scale) {
+		this.scale = scale;
+	}
+}
+
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoLookup.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoLookup.java
new file mode 100644
index 0000000000..543053878d
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoLookup.java
@@ -0,0 +1,95 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import gov.noaa.nws.ncep.common.log.logger.NcepLogger;
+import gov.noaa.nws.ncep.common.log.logger.NcepLoggerManager;
+import gov.noaa.nws.ncep.viz.localization.NcPathManager;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.raytheon.uf.common.serialization.SerializationUtil;
+
+public class GempakGridVcrdInfoLookup {
+	public static final String GRID_GEMPAK_VCORD_FILE = "ncep"+File.separator +
+														 "GempakGridUnits" + File.separator + 
+														 "gempakGridVcrdUnits.xml";
+	/** The logger */
+	private static NcepLogger logger = NcepLoggerManager.getNcepLogger(GempakGridVcrdInfoLookup.class);
+	/** The singleton instance of GridLookupFileName **/
+    private static GempakGridVcrdInfoLookup instance;
+    
+    private final Map vcrdInfo;
+    
+    public static GempakGridVcrdInfoLookup getInstance () {
+    	if (instance == null) {
+    		instance = new GempakGridVcrdInfoLookup ();
+    	}
+    	return instance;
+    }
+    
+    private GempakGridVcrdInfoLookup () {
+    	vcrdInfo = new HashMap ();
+    	try {
+    		initVcordInfo ();
+    	}catch (IOException e) {
+            logger.error("Unable to initialize gempak vcord information list!", e);
+        }
+    }
+    
+    private void initVcordInfo () throws IOException {
+    	
+//    	logger.info("Initial Gempak VCORD information===");
+    	File gempakVcrdInfo = 
+    		NcPathManager.getInstance().getStaticFile(GRID_GEMPAK_VCORD_FILE);
+    	
+    	GempakGridVcrdInfoSet vcrdInfoList = null;
+    	try {
+    		if ( gempakVcrdInfo.exists()) {
+    			vcrdInfoList = (GempakGridVcrdInfoSet) SerializationUtil
+                .jaxbUnmarshalFromXmlFile(gempakVcrdInfo.getPath());
+    		} else {
+                ArrayList emptyList = new ArrayList();
+                vcrdInfoList = new GempakGridVcrdInfoSet();
+                vcrdInfoList.setVcordinfo(emptyList);
+            }
+    		for (GempakGridVcrdInfo vcrd : vcrdInfoList.getVcordinfo()) {
+    			vcrdInfo.put(vcrd.getGnam(), vcrd);
+    		}
+    	} catch (Exception e) {
+            throw new IOException ("Unable to unmarshal ncep gempak vcrd info file");
+        }    	
+    }
+    
+    public String getVcrdUnit ( String parm ) {
+    	
+    	String units = null;
+    	GempakGridVcrdInfo pInfo = vcrdInfo.get(parm);
+    	if ( pInfo != null ) {
+    		units = pInfo.getUnits();
+    	}
+    	return units;
+    }
+    
+    public int getParmScale ( String parm ) {
+    	
+    	int scale = 0;
+    	GempakGridVcrdInfo pInfo = vcrdInfo.get(parm);
+    	if ( pInfo != null ) {
+    		scale = pInfo.getScale();
+    	}
+    	return scale;
+    }
+    
+    public void display () {
+    	int cnt = 1;
+    	logger.info ("Size of vcrd table:" + vcrdInfo.size());
+    	for (GempakGridVcrdInfo parm: vcrdInfo.values() ) {
+    		logger.info("No." + cnt + " name:" + parm.getName() + " gname:" + parm.getGnam() + " units:" + parm.getUnits() + " scale:" + parm.getScale());
+    		cnt ++;
+    	}
+    }
+}
+
diff --git a/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoSet.java b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoSet.java
new file mode 100644
index 0000000000..4f619de220
--- /dev/null
+++ b/ncep/gov.noaa.nws.ncep.viz.gempak/src/gov/noaa/nws/ncep/viz/gempak/grid/units/GempakGridVcrdInfoSet.java
@@ -0,0 +1,30 @@
+package gov.noaa.nws.ncep.viz.gempak.grid.units;
+
+import java.util.ArrayList;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+
+@XmlRootElement(name = "gempakGridVcordUnitSet")
+@XmlAccessorType(XmlAccessType.NONE)
+public class GempakGridVcrdInfoSet implements ISerializableObject{
+	/**
+     * List of vcord for/from the XML.
+     */
+    @XmlElements( { @XmlElement(name = "vcordinfo", type = GempakGridVcrdInfo.class) })
+    private ArrayList vcordinfo;
+
+	public ArrayList getVcordinfo() {
+		return vcordinfo;
+	}
+
+	public void setVcordinfo(ArrayList vcordinfo) {
+		this.vcordinfo = vcordinfo;
+	}
+}
+
diff --git a/ncep/gov.noaa.nws.ncep.viz.resources/src/gov/noaa/nws/ncep/viz/resources/manager/ResourceDefinition.java b/ncep/gov.noaa.nws.ncep.viz.resources/src/gov/noaa/nws/ncep/viz/resources/manager/ResourceDefinition.java
index b68d016b39..8a49e930b0 100644
--- a/ncep/gov.noaa.nws.ncep.viz.resources/src/gov/noaa/nws/ncep/viz/resources/manager/ResourceDefinition.java
+++ b/ncep/gov.noaa.nws.ncep.viz.resources/src/gov/noaa/nws/ncep/viz/resources/manager/ResourceDefinition.java
@@ -79,8 +79,8 @@ import gov.noaa.nws.ncep.edex.common.ncinventory.NcInventoryRequestMsg;
  *  09/05/12      #860        Greg Hull   Add this to the URICatalog for storing the latest time.
  *  09/13/12      #860        Greg Hull   set default for inventoryEnabled to false.
  *  11/2012		  #885		  T. Lee	  Set unmapped satellite projection resolution to "native"
- *  01/02/2013                X. Guo      Added codes to get Extpoint constraint name
- *
+ *  01/2013                   Greg Hull   Don't create wildcard inventory constraints
+ * 
  * 
* * @author ghull @@ -111,7 +111,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, // must match the name in an extention point which defines the java class // that implementes the resource. @XmlElement - private String rscImplementation; + private String rscImplementation; // the name of a column in the DB used to generated dynamic Resources. // (Note: this must be defined as a parameter for the resource implementation.) @@ -166,13 +166,13 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, // Default to disnabled so it must be explicitly enabled. @XmlElement private Boolean inventoryEnabled = false; - + private String inventoryAlias = null; // the names of the parameters which are stored in the inventory for this RD; // private ArrayList inventoryParamNames = new ArrayList(); - + // a map from the resource Constraints to a cache of the availableTimes and the @@ -245,7 +245,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, rscImplementation = rscDefn.rscImplementation; setLocalizationFile( rscDefn.getLocalizationFile() ); - + inventoryAlias = null; availTimesCache = new HashMap,DataTimesCacheEntry>(); @@ -298,6 +298,9 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, return prmsList; } + // TODO : Need to change this to return the constraint field instead of the + // generator parameter. Til then all parameters that generate + // a type or sub type must be the same name as the request constraint. public String getRscTypeGenerator() { return (rscTypeGenerator == null ? "" : rscTypeGenerator ); } @@ -606,18 +609,27 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, // // (most of the time the paramName and constraint name are the same except for // GDFILE where the constraint is 'modelName') So for this case we need to - // + // for( ResourceParamInfo prmInfo : rscImplParams.values() ) { + + // if this parameter is defined as a request constraint and + // if it has a non-wildcard value, then create a inventory constraint for it + // if( prmInfo.getParamType() == ResourceParamType.REQUEST_CONSTRAINT ) { String prmName = prmInfo.getParamName(); String cnstrName = prmInfo.getConstraintName(); - if( paramValues.containsKey( prmName ) ) { - String prmValue = paramValues.get( prmName ); - - inventoryConstraints.put( cnstrName, - getConstraintFromParamValue( prmValue ) ); + if( paramValues.containsKey( prmName ) ) { + // if the constraint value is a wildcard then don't add this + // to the list since it will fail in the case where the + // db value is a null. + RequestConstraint reqConstr = getConstraintFromParamValue( + paramValues.get( prmName ) ); + + if( reqConstr != RequestConstraint.WILDCARD ) { + inventoryConstraints.put( cnstrName, reqConstr ); + } } // else { // 'LIKE' doesn't work for integers. Just leave this out. @@ -1018,6 +1030,10 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, NcInventoryRequestMsg reqMsg = NcInventoryRequestMsg.makeQueryRequest(); reqMsg.setInventoryName( inventoryAlias ); reqMsg.setReqConstraintsMap( searchConstraints ); + + // TODO : Need to change this to return the constraint field instead of the + // generator parameter. Til then all parameters that generate + // a type or sub type must be the same name as the request constraint. String genType = getRscTypeGenerator(); String cnstrName = null; if ( genType != null ) { @@ -1068,7 +1084,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, public ArrayList generatedSubTypesList() throws VizException { // Grids, Satellite, Radar, etc all are dynamically updated when new alert updates // are received (when new data is ingested). PGEN doesn't have alert updates and so - // we need to always check for new products. + // we need to always check for new products. if( isPgenResource() ) { return getPgenProducts(); @@ -1161,14 +1177,14 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, subType = queryResults[1] + "_native"; } else { subType = queryResults[1] + "_"+ // note that the 'km' here will make the code - queryResults[2] + "km"; // to parse the subType non-generic so we might want to change it. + queryResults[2] + "km"; // to parse the subType non-generic so we might want to change it. } - + if( !generatedSubTypesList.contains( subType ) ) { generatedSubTypesList.add( subType ); } else out.println("subType already in the list?"); // shouldn't happen - } + } } return generatedSubTypesList; @@ -1277,7 +1293,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, else if( availTimesCache.size() > 4 ) { availTimesCache.get( resourceConstraints ).addToUriCatalog(); } - } + } // Return the latest time or if there either is NoData or if the time hasn't been // set yet, return a Null DataTime. @@ -1285,9 +1301,9 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, public DataTime getLatestDataTime( ResourceName rscName ) throws VizException { if( !isRequestable() ) { - return null; - } - + return null; + } + Map resourceConstraints = getInventoryConstraintsFromParameters( ResourceDefnsMngr.getInstance().getAllResourceParameters( rscName ) ); @@ -1357,7 +1373,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, // if times are cached for these constraints, and if the times haven't expired, // then just return the cached times. - // + // if( availTimesCache.containsKey( resourceConstraints ) ) { DataTimesCacheEntry cachedTimesEntry = availTimesCache.get( resourceConstraints ); @@ -1365,7 +1381,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, if( availTimes != null ) { return availTimes; - } + } // (Do not remove the entry in the cache since this may be being refreshed // with the latestTimes from the URICatalog. } @@ -1382,7 +1398,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, // if( inventoryEnabled ) { - NcInventoryRequestMsg reqMsg = NcInventoryRequestMsg.makeQueryRequest(); + NcInventoryRequestMsg reqMsg = NcInventoryRequestMsg.makeQueryRequest(); reqMsg.setInventoryName( inventoryAlias ); reqMsg.setRequestedParam( "dataTime" ); reqMsg.setReqConstraintsMap( @@ -1393,7 +1409,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, long t01 = System.currentTimeMillis(); rslts = ThriftClient.sendRequest( reqMsg ); - + if( !(rslts instanceof String[]) ) { out.println("Inventory Request Failed:"+rslts.toString() ); @@ -1425,7 +1441,7 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, } } else { // if the inventory is not enabled - // + // LayerProperty property = new LayerProperty(); property.setDesiredProduct( ResourceType.PLAN_VIEW ); @@ -1577,8 +1593,8 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, if ( satRec.getResolution() == 0 && getSubTypeGenParamsList()[1].equals("resolution") ) { subType = satRec.getAreaName() + "_native"; } else { - subType = satRec.getAreaName() + "_" + - satRec.getResolution().toString() + "km"; + subType = satRec.getAreaName() + "_" + + satRec.getResolution().toString() + "km"; } attrSetKey = satRec.getImageType(); } @@ -1704,8 +1720,8 @@ public class ResourceDefinition implements ISerializableObject, IAlertObserver, subType = subType+"_native"; } else { - subType = subType+"_"+uriAttrValues.get( genPrm2 ).toString() + "km"; - } + subType = subType+"_"+uriAttrValues.get( genPrm2 ).toString() + "km"; + } } if( subType != null && diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.mosaic/localization/ncep/resourceTemplates/RadarMosaic.xml b/ncep/gov.noaa.nws.ncep.viz.rsc.mosaic/localization/ncep/resourceTemplates/RadarMosaic.xml index fbb05c5ee7..54144ecdb0 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.mosaic/localization/ncep/resourceTemplates/RadarMosaic.xml +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.mosaic/localization/ncep/resourceTemplates/RadarMosaic.xml @@ -35,7 +35,7 @@
diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/MANIFEST.MF b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/MANIFEST.MF index 1ac7ec6903..701f1c95f6 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/MANIFEST.MF +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/MANIFEST.MF @@ -66,4 +66,6 @@ Import-Package: com.raytheon.edex.meteoLib, com.sun.jna, com.sun.jna.ptr, gov.noaa.nws.ncep.common.log.logger, - gov.noaa.nws.ncep.viz.gempak.grid.inv + gov.noaa.nws.ncep.viz.gempak.grid.inv, + gov.noaa.nws.ncep.viz.gempak.grid.mapper, + gov.noaa.nws.ncep.viz.gempak.grid.units diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject index d53e1edfd5..7d56f80286 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject @@ -1,7 +1,3 @@ gov.noaa.nws.ncep.viz.rsc.ncgrid.rsc.NcgridResourceData gov.noaa.nws.ncep.viz.rsc.ncgrid.rsc.NcEnsembleResourceData -gov.noaa.nws.ncep.edex.common.dataRecords.NcFloatDataRecord -gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridParmInfo -gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridParmInfoSet -gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridVcrdInfo -gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridVcrdInfoSet \ No newline at end of file +gov.noaa.nws.ncep.edex.common.dataRecords.NcFloatDataRecord \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/src/gov/noaa/nws/ncep/viz/rsc/ncgrid/dgdriv/Dgdriv.java b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/src/gov/noaa/nws/ncep/viz/rsc/ncgrid/dgdriv/Dgdriv.java index 4f49c93c98..92d931dbaf 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/src/gov/noaa/nws/ncep/viz/rsc/ncgrid/dgdriv/Dgdriv.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/src/gov/noaa/nws/ncep/viz/rsc/ncgrid/dgdriv/Dgdriv.java @@ -62,8 +62,9 @@ import gov.noaa.nws.ncep.common.log.logger.NcepLogger; import gov.noaa.nws.ncep.common.log.logger.NcepLoggerManager; import gov.noaa.nws.ncep.viz.rsc.ncgrid.rsc.NcEnsembleResourceData; import gov.noaa.nws.ncep.viz.rsc.ncgrid.rsc.NcgridResourceData; -import gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridParmInfoLookup; -import gov.noaa.nws.ncep.viz.rsc.ncgrid.util.GempakGridVcrdInfoLookup; +import gov.noaa.nws.ncep.viz.gempak.grid.mapper.GridMapper; +import gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridParmInfoLookup; +import gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridVcrdInfoLookup; import gov.noaa.nws.ncep.viz.rsc.ncgrid.customCoverage.CustomLatLonCoverage; import gov.noaa.nws.ncep.viz.rsc.ncgrid.customCoverage.CustomLambertConformalCoverage; import gov.noaa.nws.ncep.viz.rsc.ncgrid.customCoverage.CustomMercatorCoverage; @@ -141,9 +142,9 @@ public class Dgdriv { private static Connector conn; private NcgridDataCache cacheData; - + private static NcgribLogger ncgribLogger = NcgribLogger.getInstance();; - + public static final int LLMXGD = 1000000; //Max # grid points /* @@ -329,7 +330,7 @@ public class Dgdriv { byte [] prjbuf = new byte [BUFRLENGTH]; boolean proces = true; Map hm = new HashMap(); -// private String eventName; +// private String eventName; DiagnosticsCallback diagCallback=null; ReturnFileNameCallback flnmCallback = null; ReturnCycleForecastHoursCallback fhrsCallback = null; @@ -413,15 +414,16 @@ public class Dgdriv { long t1 = System.currentTimeMillis(); int rDataSize = rData.length; IntByReference datSize = new IntByReference(rDataSize); - logger.debug("retrieve data nx=" + nx +" ny=" + ny + " rDataSize=" + rDataSize); + +// logger.info("retrieve data nx=" + nx +" ny=" + ny + " rDataSize=" + rDataSize); if ( (nx*ny) == rDataSize ) { if ( addData ) { cacheData.addGridData(dataURI, nx, ny, rData); } if ( flip ) { // logger.info ("*****flip grid data*****"); - gd.gem.db_returndata(flipData(rData, nx, ny),datSize); - } + gd.gem.db_returndata(flipData(rData, nx, ny),datSize); + } else gd.gem.db_returndata(checkMissingData(rData),datSize); } @@ -502,8 +504,8 @@ public class Dgdriv { if ( ncgribLogger.enableDiagnosticLogs() ) { logger.info("Rcv'd new subg:" + msg); } - createNewISpatialObj ( msg ); - return true; + createNewISpatialObj ( msg ); + return true; } } @@ -815,7 +817,7 @@ public class Dgdriv { } if ( flop ) { // logger.info ("====flop grid data 1====="); - fds.setXdata(flopData(ugrid, igx.getValue(), igy.getValue())); + fds.setXdata(flopData(ugrid, igx.getValue(), igy.getValue())); } else fds.setXdata( revertGempakData2CAVE(ugrid) ); @@ -829,7 +831,7 @@ public class Dgdriv { } if ( flop ) { // logger.info ("====flop grid data ====="); - fds.setYdata(flopData(vgrid, igx.getValue(), igy.getValue())); + fds.setYdata(flopData(vgrid, igx.getValue(), igy.getValue())); } else fds.setYdata( revertGempakData2CAVE(vgrid) ); @@ -871,7 +873,7 @@ public class Dgdriv { private void prepareGridDTInfo() { String alias = this.gdfile; String path = "A2DB_GRID"; - logger.debug("prepareGridDTInfo-- alias:" + alias + " gdfileOriginal:" + this.gdfileOriginal); + logger.debug ("prepareGridDTInfo-- alias:" + alias + " gdfileOriginal:" + this.gdfileOriginal); String template = this.gdfileOriginal + "_db"; if ( this.gdfileOriginal.contains(":")) { template = this.gdfileOriginal.substring(0, this.gdfileOriginal.indexOf(":")) + "_db"; @@ -1327,7 +1329,7 @@ public class Dgdriv { return outGridFlipped; } - + /* * Changes the missing data value from * CAVE -999999.0f to GEMPAK -9999.0f @@ -1388,7 +1390,7 @@ public class Dgdriv { outGridFlopped[ii] = inGrid[ii]; } } - + return outGridFlopped; } private String getEnsTimes () { @@ -1474,12 +1476,12 @@ public class Dgdriv { //setWorldWrapColumns (1); //check its return value/exception and decide to update coverage or not GridDataRetriever dataRetriever = new GridDataRetriever (dataURI); - boolean isWorldWrap = false; - try { - isWorldWrap = dataRetriever.setWorldWrapColumns (1); - } catch (GridCoverageException e) { - //ignore setWorldWrapColumns exception. - } +// boolean isWorldWrap = false; +// try { +// isWorldWrap = dataRetriever.setWorldWrapColumns (1); +// } catch (GridCoverageException e) { +// //ignore setWorldWrapColumns exception. +// } try { String gempakParm = cacheData.getGempakParam(dataURI); if ( gempakParm != null ) { @@ -1497,12 +1499,14 @@ public class Dgdriv { t001 = System.currentTimeMillis(); FloatDataRecord dataRecord = dataRetriever.getDataRecord(); float[] data = dataRecord.getFloatData(); - if ( isWorldWrap ) { - setSubgSpatialObj ( (ISpatialObject)dataRetriever.getCoverage()); - } +// if ( isWorldWrap ) { +// if ( ncgribLogger.enableDiagnosticLogs() ) +// logger.info("===new coverage nx:"+dataRetriever.getCoverage().getNx() + " ny:"+dataRetriever.getCoverage().getNy()); +// setSubgSpatialObj ( (ISpatialObject)dataRetriever.getCoverage()); +// } t002 = System.currentTimeMillis(); if ( ncgribLogger.enableDiagnosticLogs() ) - logger.info("***Reading " + dataURI + " from hdf5 took: " + (t002-t001)); + logger.info("***Reading " + dataURI + " from hdf5 took: " + (t002-t001) + ", return size:" + data.length); return data; } catch (StorageException s) { if ( ncgribLogger.enableDiagnosticLogs() ) @@ -1738,7 +1742,7 @@ public class Dgdriv { request.addRequestField(GridDBConstants.FORECAST_TIME_QUERY); request.setDistinct(true); request.setConstraints(rcMap); - long t0 = System.currentTimeMillis(); + long t0 = System.currentTimeMillis(); String retFileNames = ""; try { DbQueryResponse response = (DbQueryResponse) ThriftClient @@ -1767,7 +1771,7 @@ public class Dgdriv { if ( retFileNames.length() > 0 ) retFileNames = retFileNames + "|"; retFileNames = retFileNames + prefix+dt + hh + "f" + forecastHourFormat.format(fhr); } - + } } catch (VizException e) { @@ -1824,7 +1828,7 @@ public class Dgdriv { else { if ( gridRscData.getEnsembelMember() != null ) { rcMap.put( GridDBConstants.ENSEMBLE_ID_QUERY, new RequestConstraint( parmList[1] ) ); - } + } else { rcMap.put( GridDBConstants.EVENT_NAME_QUERY, new RequestConstraint( parmList[1] ) ); } @@ -1934,7 +1938,7 @@ public class Dgdriv { if ( ncgribLogger.enableDiagnosticLogs() ) { long t00 = System.currentTimeMillis(); logger.info("++++ getDataURIFromAssembler for("+parameters+") from cache took: " + (t00-t0)); - } + } return datauri; } Map rcMap = getRequestConstraint (parameters); @@ -1948,7 +1952,7 @@ public class Dgdriv { DbQueryRequest request = new DbQueryRequest(); request.addRequestField(GridDBConstants.DATA_URI_QUERY); request.setConstraints(rcMap); - + DbQueryResponse response = (DbQueryResponse) ThriftClient .sendRequest(request); // extract list of results @@ -2109,8 +2113,8 @@ public class Dgdriv { if (spatialObj != null && spatialObj instanceof ISpatialObject) { cov = (ISpatialObject) spatialObj; } - } - + } + if ( cov != null ) { navStr = getGridNavigationContent ( cov); } @@ -2190,6 +2194,7 @@ public class Dgdriv { } qAssembler.setParameterAbbreviation(parmList[2]); qAssembler.setMasterLevelName (parmList[3]); + // qAssembler.setMasterLevelName ("MB"); String ll1 = null, ll2 = null; if ( parmList[4].contains(":")) { @@ -2219,7 +2224,7 @@ public class Dgdriv { qAssembler.setLevelTwoValue(level2); } else { - qAssembler.setLevelTwoValue(-9999.0); + qAssembler.setLevelTwoValue(-999999.0); } qAssembler.setLevelUnits(gempakVcordInfo.getVcrdUnit(parmList[3])); @@ -2240,6 +2245,9 @@ public class Dgdriv { rcMap.put(GridDBConstants.REF_TIME_QUERY, new RequestConstraint(refTime)); rcMap.put(GridDBConstants.FORECAST_TIME_QUERY, new RequestConstraint(fcstTime)); + if ( ncgribLogger.enableDiagnosticLogs() ) { + logger.info ("exit getRequestConstraint - rcMap:"+ rcMap.toString()); + } return rcMap; } } diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/MZ_CNTY.xml b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/MZ_CNTY.xml index ab7e67ac8d..9b3d63e0d9 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/MZ_CNTY.xml +++ b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/MZ_CNTY.xml @@ -4,5 +4,5 @@ BOUNDED_AREA ncep bounds.mzcntybnds - area + name diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE.xml b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE.xml index fd1dca3787..49f0305c0b 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE.xml +++ b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE.xml @@ -4,5 +4,5 @@ BOUNDED_AREA ncep bounds.statebnds - area + name diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE_NAME.xml b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE_NAME.xml index ac82ea424f..7b39516d0e 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE_NAME.xml +++ b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/STATE_NAME.xml @@ -4,5 +4,5 @@ BOUNDED_AREA ncep bounds.statebnds - area + name diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/TIMEZONE.xml b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/TIMEZONE.xml index 7ed33624b1..6f9bfadcab 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/TIMEZONE.xml +++ b/ncep/gov.noaa.nws.ncep.viz.ui.locator/localization/ncep/LocatorDataSources/TIMEZONE.xml @@ -4,5 +4,5 @@ BOUNDED_AREA ncep bounds.tzbnds - timezone + time_zone diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/META-INF/MANIFEST.MF b/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/META-INF/MANIFEST.MF index 8481a33545..94dab2caac 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/META-INF/MANIFEST.MF +++ b/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/META-INF/MANIFEST.MF @@ -28,6 +28,8 @@ Export-Package: gov.noaa.nws.ncep.viz.ui.perspectives;uses:="org.eclipse.ui,org. Import-Package: com.raytheon.uf.viz.core.maps.display, com.raytheon.viz.alerts.observers, gov.noaa.nws.ncep.viz.gempak.grid.inv, + gov.noaa.nws.ncep.viz.gempak.grid.mapper, + gov.noaa.nws.ncep.viz.gempak.grid.units, gov.noaa.nws.ncep.viz.resourceManager, gov.noaa.nws.ncep.viz.resources, gov.noaa.nws.ncep.viz.rsc.ncgrid, diff --git a/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/src/gov/noaa/nws/ncep/viz/ui/perspectives/NCPerspectiveManager.java b/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/src/gov/noaa/nws/ncep/viz/ui/perspectives/NCPerspectiveManager.java index e4c51a73aa..4195f8f14f 100644 --- a/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/src/gov/noaa/nws/ncep/viz/ui/perspectives/NCPerspectiveManager.java +++ b/ncep/gov.noaa.nws.ncep.viz.ui.perspectives/src/gov/noaa/nws/ncep/viz/ui/perspectives/NCPerspectiveManager.java @@ -5,6 +5,9 @@ import gov.noaa.nws.ncep.ui.pgen.controls.PgenFileNameDisplay; import gov.noaa.nws.ncep.viz.common.AbstractNcEditor; import gov.noaa.nws.ncep.viz.common.ui.NmapCommon; import gov.noaa.nws.ncep.viz.gempak.grid.inv.NcGridInventory; +import gov.noaa.nws.ncep.viz.gempak.grid.mapper.GridMapper; +import gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridParmInfoLookup; +import gov.noaa.nws.ncep.viz.gempak.grid.units.GempakGridVcrdInfoLookup; import gov.noaa.nws.ncep.viz.localization.NcPathManager; import gov.noaa.nws.ncep.viz.resourceManager.ui.ResourceManagerDialog; import gov.noaa.nws.ncep.viz.resources.manager.RbdBundle; @@ -83,34 +86,34 @@ import com.vividsolutions.jts.geom.Coordinate; * 06/01/2012 #815 G. Hull Create DESK Level for Localization. * 06/13/2012 #817 G. Hull for -spf arg, create one rbdLoader and call initTimeline on the rbds. * 12/12/1212 #630 G. Hull rm check for suspendZoom in displayChangeLister. code moved to refreshGUIElements - * + * * * - * @author + * @author * @version 1.0 */ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { /** The National Centers Perspective Class */ - // put this in common to avoid dependencies on this project + // put this in common to avoid dependencies on this project public static final String NC_PERSPECTIVE = NmapCommon.NatlCntrsPerspectiveID; - + private boolean gridInventoryInited = false; - private IVizEditorChangedListener displayChangeListener=null; - - @Override - protected void open() { - - // force DESK level to be created. - NcPathManager.getInstance(); - - if ( !gridInventoryInited ) { - long t0 = System.currentTimeMillis(); - try { + private IVizEditorChangedListener displayChangeListener = null; + + @Override + protected void open() { + + // force DESK level to be created. + NcPathManager.getInstance(); + + if (!gridInventoryInited) { + long t0 = System.currentTimeMillis(); + try { NcGridInventory.getInstance().initInventory(false); // don't // re-init -// NcGridInventory.getInstance().dumpNcGribInventory(); + // NcGridInventory.getInstance().dumpNcGribInventory(); } catch (final VizException e) { VizApp.runAsync(new Runnable() { @Override @@ -125,26 +128,28 @@ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { }); // System.out.println("NcGridInventory failed : "+e.getMessage() // ); - } - - long t1 = System.currentTimeMillis(); - System.out.println("NcGridInventory Init took: " + (t1-t0)); - gridInventoryInited = true; - } + } + GridMapper.GridMapperInit(); + GempakGridParmInfoLookup.getInstance(); + GempakGridVcrdInfoLookup.getInstance(); + long t1 = System.currentTimeMillis(); + System.out.println("NcGridInventory Init took: " + (t1 - t0)); + gridInventoryInited = true; + } - displayChangeListener = new IVizEditorChangedListener() { - @Override - public void editorChanged(IDisplayPaneContainer container) { + displayChangeListener = new IVizEditorChangedListener() { + @Override + public void editorChanged(IDisplayPaneContainer container) { if(container==null) return; - if( container instanceof AbstractNcEditor ) { - ((AbstractNcEditor)container).refreshGUIElements(); - } - } - }; - - // Add an observer to process the dataURI Notification msgs from edex. - // + if (container instanceof AbstractNcEditor) { + ((AbstractNcEditor) container).refreshGUIElements(); + } + } + }; + + // Add an observer to process the dataURI Notification msgs from edex. + // ProductAlertObserver.addObserver(null, new NcAutoUpdater()); // NatlCntrs uses a different equation to compute the Temperature values @@ -153,137 +158,137 @@ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { // by satellite // images and will create our Units and UnitConverter class to do the // conversion. - // + // NcSatelliteUnits.register(); - - // Force the RBDs to read from localization to save time - // bringing up the RBD manager - // - SpfsManager.getInstance(); - + + // Force the RBDs to read from localization to save time + // bringing up the RBD manager + // + SpfsManager.getInstance(); + // Initialize the NcInventory. This cache is stored on the server side // and will only // need initialization for the first instance of cave. try { ResourceDefnsMngr.getInstance(); // force reading in of the resource // definitions - + if (!ResourceDefnsMngr.getInstance().getBadResourceDefnsErrors() .isEmpty()) { - + final StringBuffer errBuf = new StringBuffer( "There were errors creating the following Resource Defintions:\n\n"); - int numErrs = 0; + int numErrs = 0; for (VizException vizex : ResourceDefnsMngr.getInstance() .getBadResourceDefnsErrors()) { - errBuf.append( " -- "+ vizex.getMessage()+"\n" ); - - if( ++numErrs > 20 ) { - errBuf.append( " .....and more...."); - } - } + errBuf.append(" -- " + vizex.getMessage() + "\n"); + + if (++numErrs > 20) { + errBuf.append(" .....and more...."); + } + } VizApp.runAsync(new Runnable() { @Override public void run() { - MessageDialog errDlg = new MessageDialog( - perspectiveWindow.getShell(), "Error", null, + MessageDialog errDlg = new MessageDialog( + perspectiveWindow.getShell(), "Error", null, errBuf.toString(), MessageDialog.ERROR, new String[] { "OK" }, 0); - errDlg.open(); + errDlg.open(); } }); - } - -// ResourceDefnsMngr.getInstance().createInventory(); - - } catch( VizException el ) { - MessageDialog errDlg = new MessageDialog( - perspectiveWindow.getShell(), "Error", null, - "Error Initializing NcInventory:\n\n"+el.getMessage(), - MessageDialog.ERROR, new String[]{"OK"}, 0); - errDlg.open(); - } - + } + + // ResourceDefnsMngr.getInstance().createInventory(); + + } catch (VizException el) { + MessageDialog errDlg = new MessageDialog( + perspectiveWindow.getShell(), "Error", null, + "Error Initializing NcInventory:\n\n" + el.getMessage(), + MessageDialog.ERROR, new String[] { "OK" }, 0); + errDlg.open(); + } + // Load either the default RBD or RBDs in the command line spf // List rbdsToLoad = new ArrayList(); String spfName = ProgramArguments.getInstance().getString("-spf"); - if( spfName != null && !spfName.isEmpty() ) { - String[] grpAndSpf = spfName.split( File.separator ); + if (spfName != null && !spfName.isEmpty()) { + String[] grpAndSpf = spfName.split(File.separator); - // the name of the spf should include a group name - // TODO : check that there is a group and if not use a default. - if( grpAndSpf.length != 2 ) { + // the name of the spf should include a group name + // TODO : check that there is a group and if not use a default. + if (grpAndSpf.length != 2) { System.out .println("The -spf argument is specified without an spf group (ex spfGroupName/spfName."); - // load the default rbd... - MessageDialog errDlg = new MessageDialog( + // load the default rbd... + MessageDialog errDlg = new MessageDialog( perspectiveWindow.getShell(), "Error", null, - "The -spf arguement is missing an SPF group name.\nEx. \"SpfGroupName/SpfName\"", - MessageDialog.WARNING, new String[]{"OK"}, 0); - errDlg.open(); + "The -spf arguement is missing an SPF group name.\nEx. \"SpfGroupName/SpfName\"", + MessageDialog.WARNING, new String[] { "OK" }, 0); + errDlg.open(); } else { - - try { + + try { rbdsToLoad = SpfsManager.getInstance().getRbdsFromSpf( grpAndSpf[0], grpAndSpf[1], true); // resolve Latest // Cycle times } catch (VizException e) { - MessageDialog errDlg = new MessageDialog( - perspectiveWindow.getShell(), "Error", null, + MessageDialog errDlg = new MessageDialog( + perspectiveWindow.getShell(), "Error", null, "The -spf arguement, " + spfName + " doen't exist\n", MessageDialog.WARNING, new String[] { "OK" }, 0); - errDlg.open(); - } - } + errDlg.open(); + } + } } - - if( rbdsToLoad.isEmpty() ) { - try { + + if (rbdsToLoad.isEmpty()) { + try { RbdBundle dfltRbd = RbdBundle.getDefaultRBD(); - rbdsToLoad.add( dfltRbd ); - + rbdsToLoad.add(dfltRbd); + } catch (Exception ve) { - System.out.println("Could not load rbd: " + ve.getMessage()); - ve.printStackTrace(); - } + System.out.println("Could not load rbd: " + ve.getMessage()); + ve.printStackTrace(); + } } - - //start data provider before creating ncmapeditor - StaticDataProvider.start(); - ResourceBndlLoader rbdLoader = new ResourceBndlLoader( "Loading SPF: " ); + // start data provider before creating ncmapeditor + StaticDataProvider.start(); - // loop thru the rbds and load them into a new editor. - for( RbdBundle rbd: rbdsToLoad ) { + ResourceBndlLoader rbdLoader = new ResourceBndlLoader("Loading SPF: "); - rbd.initTimeline(); + // loop thru the rbds and load them into a new editor. + for (RbdBundle rbd : rbdsToLoad) { + + rbd.initTimeline(); NCMapEditor editor = NmapUiUtils.createNatlCntrsEditor(rbd .getRbdName()); - - rbdLoader.addRBD( rbd, editor ); - } - VizApp.runAsync( rbdLoader ); - } - - @Override + rbdLoader.addRBD(rbd, editor); + } + + VizApp.runAsync(rbdLoader); + } + + @Override public void activate() { - super.activate(); - - // add an EditorChangedListener - VizWorkbenchManager.getInstance().addListener( displayChangeListener ); + super.activate(); -// Experiment. -// statusLine.setErrorMessage("Status Line ERROR MSG B"); -// statusLine.setMessage("Status Line MESSAGE B"); + // add an EditorChangedListener + VizWorkbenchManager.getInstance().addListener(displayChangeListener); + + // Experiment. + // statusLine.setErrorMessage("Status Line ERROR MSG B"); + // statusLine.setMessage("Status Line MESSAGE B"); // relayout the shell since we added widgets perspectiveWindow.getShell().layout(true, true); @@ -291,42 +296,42 @@ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { NcSatelliteUnits.register(); } - @Override + @Override public void deactivate() { - super.deactivate(); - - VizWorkbenchManager.getInstance().removeListener( displayChangeListener ); + super.deactivate(); + + VizWorkbenchManager.getInstance().removeListener(displayChangeListener); SatelliteUnits.register(); - + // would rather do this another way, preferably by having - // ResourceManagerDialog extend CaveSWTDialog (do this later) or + // ResourceManagerDialog extend CaveSWTDialog (do this later) or // by implementing a perspective closed listener (cyclical dependency // problem) ResourceManagerDialog.close(); } - + @Override protected List getStatusLineItems() { List stsLineDisplays = new ArrayList(); -// in reverse order - stsLineDisplays.add( new FadeDisplay() ); - stsLineDisplays.add( PgenFileNameDisplay.getInstance() ); - stsLineDisplays.add( FrameDataDisplay.createInstance() ); - + // in reverse order + stsLineDisplays.add(new FadeDisplay()); + stsLineDisplays.add(PgenFileNameDisplay.getInstance()); + stsLineDisplays.add(FrameDataDisplay.createInstance()); + return stsLineDisplays; } - @Override + @Override public void close() { - super.close(); - - VizWorkbenchManager.getInstance().removeListener( displayChangeListener ); - displayChangeListener = null; - + super.close(); + + VizWorkbenchManager.getInstance().removeListener(displayChangeListener); + displayChangeListener = null; + ResourceManagerDialog.close(); - } - + } + /* * (non-Javadoc) * @@ -337,7 +342,7 @@ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { @Override public IInputHandler[] getPerspectiveInputHandlers( final AbstractEditor editor) { - // currently only implementing handleMouseWheel which is now done below. + // currently only implementing handleMouseWheel which is now done below. IInputHandler[] superHandlers = super .getPerspectiveInputHandlers(editor); @@ -345,43 +350,43 @@ public class NCPerspectiveManager extends AbstractCAVEPerspectiveManager { // abstractEditors handlers // (this won't last long since the perspective will remove/save off the // editors. - if( !(editor instanceof NCMapEditor ) ) { - return superHandlers; + if (!(editor instanceof NCMapEditor)) { + return superHandlers; } - + // No-Ops for doubleClick, keyUp/Down, mouseDown, mouseHover and mouseUp IInputHandler handler = new InputAdapter() { - private boolean isShiftDown = false; - + private boolean isShiftDown = false; + @Override public boolean handleMouseDownMove(int x, int y, int mouseButton) { - // Set mouse position - Coordinate ll = editor.translateClick(x, y); - gov.noaa.nws.ncep.viz.common.CoorBean.getInstance().setCoor(ll); + // Set mouse position + Coordinate ll = editor.translateClick(x, y); + gov.noaa.nws.ncep.viz.common.CoorBean.getInstance().setCoor(ll); return false; } @Override public boolean handleMouseMove(int x, int y) { - // Set mouse position - Coordinate ll = ((NCMapEditor)editor).translateClick( x, y); - gov.noaa.nws.ncep.viz.common.CoorBean.getInstance().setCoor(ll); + // Set mouse position + Coordinate ll = ((NCMapEditor) editor).translateClick(x, y); + gov.noaa.nws.ncep.viz.common.CoorBean.getInstance().setCoor(ll); return false; } private void toggleVisibility(ResourcePair rp) { - AbstractVizResource rsc = rp.getResource(); - if (rsc != null) { + AbstractVizResource rsc = rp.getResource(); + if (rsc != null) { rp.getProperties().setVisible( !rp.getProperties().isVisible()); - } + } } - + }; ArrayList handlers = new ArrayList(); -// handlers.addAll(Arrays.asList(superHandlers)); + // handlers.addAll(Arrays.asList(superHandlers)); handlers.add(handler); return handlers.toArray(new IInputHandler[handlers.size()]); }