diff --git a/cave/build/static/common/cave/etc/aviation/python/MetarMonitorP.py b/cave/build/static/common/cave/etc/aviation/python/MetarMonitorP.py index 31c7ccaf8c..5ac80386a5 100644 --- a/cave/build/static/common/cave/etc/aviation/python/MetarMonitorP.py +++ b/cave/build/static/common/cave/etc/aviation/python/MetarMonitorP.py @@ -214,7 +214,10 @@ # Relationship Type: In Response to # Status: NEXTRELEASE # Title: OB9.2 AvnFPS - TPO/FuelAlternate Rule Doesn't work -# +# +################################# +# Date DR. # Engineer Description +# Dec. 27, 2012 15583 zhao Fixed a bug with Wind Dir. when wind is calm # import copy, logging, math, sets import Avn, MonitorP @@ -311,6 +314,8 @@ Arguments: dd ff1""" tddo = tw['dd'].get('ocnl', None) # variable wind: always matches if 'VRB' in (mdd, tddp, tddo): + return False + if mw['ff']['lo'] == 0: return False if tddp is None: delta1= 999 diff --git a/cave/build/static/common/cave/etc/aviation/python/TextThread.py b/cave/build/static/common/cave/etc/aviation/python/TextThread.py index c9b5bc0fe2..817a91db43 100644 --- a/cave/build/static/common/cave/etc/aviation/python/TextThread.py +++ b/cave/build/static/common/cave/etc/aviation/python/TextThread.py @@ -135,7 +135,7 @@ Expects files from acqserver. File name determines data type. return self.doMetar(bulletin) elif fname.startswith('FT'): return self.doTaf(bulletin) - elif fname.startswith('FAUS2'): + elif fname.startswith('FAUS2') or fname.startswith('FAUS30'): return self.doCCFP(bulletin) else: _Logger.info('Unknown data type: %s' % fname) diff --git a/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/PhraseBuilder.py b/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/PhraseBuilder.py index 20604855c9..b3c61a16de 100644 --- a/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/PhraseBuilder.py +++ b/cave/build/static/common/cave/etc/gfe/userPython/textUtilities/regular/PhraseBuilder.py @@ -24,8 +24,14 @@ # # PhraseBuilder.py # Methods for building phrases for Narrative products. -# +# # Author: hansen +# History +# Time Ticket Number Developer Comments +# ----------------------------------------------------------------------------- +# 12/28/2012 DR 15596 J.Zeng Added checkWeatherSimilarity +# for two lists based on Virgil's +# suggestion # ---------------------------------------------------------------------------- import types @@ -1855,10 +1861,28 @@ class PhraseBuilder(ConfigVariables.ConfigVariables, stats1.sort(self.rankedSortOrder) stats2.sort(self.rankedSortOrder) + diff = [] + for element in stats1: + test = 1 + for el in stats2: + if str(element) == str(el): + test = 0 + if test and str(element) not in diff: + diff.append(str(element)) + for element in stats2: + test = 1 + for el in stats1: + if str(element) == str(el): + test = 0 + if test and str(element) not in diff: + diff.append(str(element)) + if len(diff) == 0: + return 1 + if stats1 == stats2: #print 'checkWx return 1' return 1 - + # Check for equal length of statistics if len(stats1) == len(stats2): # If there is only one subkey to worry about 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 30026578b4..67a87ffffb 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 @@ -23,6 +23,14 @@ # any purpose. # # SmartScript -- library of methods for Smart Tools and Procedures +# History +# Time Ticket# Developer Comments +# ---------------------------------------------------------------------- +# 01/09/2012 DR15626 J. Zeng Add methods +# enableISCsend +# clientISCSendStatus +# manualSendISC_autoMode +# manualSendISC_manualMode # # Author: hansen # ---------------------------------------------------------------------------- @@ -52,6 +60,7 @@ from com.raytheon.uf.common.dataplugin.gfe.discrete import DiscreteDefinition from com.raytheon.uf.common.dataplugin.gfe.weather import WeatherKey from com.raytheon.uf.common.dataplugin.gfe.db.objects import TimeConstraints from com.raytheon.uf.common.dataplugin.gfe.db.objects import GridParmInfo +from com.raytheon.uf.common.dataplugin.gfe.server.request import SendISCRequest class SmartScript(BaseTool.BaseTool): @@ -262,6 +271,54 @@ class SmartScript(BaseTool.BaseTool): #Standard, PRACTICE, TEST return self.__dataMgr.getOpMode().name() +#------------------------------------------------------------------------ +# ISC control functions +#------------------------------------------------------------------------ + + def enableISCsend(self, state): + #sets the overall isc send state. If the send state is false, then + #no ISC grids can be transmitted. To change the behavior + #when these programs (e.g., procedures) are run from the command line, + #you can enable/disable the send capability upon saving. This + #command does not send grids, but sets the system state. When + #saving grids and SendISCOnSave is set, or the manual Send ISC Dialog + #is used, then the grids will be sent. + self.__dataMgr.enableISCsend(state) + + def clientISCSendStatus(self): + #returns the current state for sending isc from this program. This + #depicts the state of whether this client has been enabled to send + #ISC via the SendISCOnSave or manual Send ISC Dialog. The ifpServer + #still needs to be properly configured for sending to occur. + return self.__dataMgr.clientISCSendStatus() + + def manualSendISC_autoMode(self): + #Simulates the use of the SendISCDialog. Note if the ifpServer's + #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)) + self.__parmOp.sendISC(req) + + def manualSendISC_manualMode(self, requests): + #simulates the use of the SendISCDialog. Note if the ifpServers's + #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 + #send state must also be True for this command to work. + req = [] + for parmName, parmLevel, tr in requests: + pid = ParmID.ParmID(parmName, self.mutableID(), + parmLevel).toJavaObj() + req.append(SendISCRequest(pid, tr)) + self.__parmOp.sendISC(req) + ######################################################################### ## Smart Tool methods ## diff --git a/cave/build/static/common/cave/etc/menus/upperair/baseAviation.xml b/cave/build/static/common/cave/etc/menus/upperair/baseAviation.xml index 73e03ea0a5..b99b8e6866 100644 --- a/cave/build/static/common/cave/etc/menus/upperair/baseAviation.xml +++ b/cave/build/static/common/cave/etc/menus/upperair/baseAviation.xml @@ -25,22 +25,7 @@ menuText="Convective SIGMET" id="ConvSigmet"> /convsigmet/% - - /bufrncwf/% - - - - /ccfp/% - - - - /ccfp/% - - - - /ccfp/% - - + diff --git a/cave/build/static/common/cave/etc/textws/gui/QualityControlCfg.xml b/cave/build/static/common/cave/etc/textws/gui/QualityControlCfg.xml index 8d5449e7e4..00db1f55f9 100644 --- a/cave/build/static/common/cave/etc/textws/gui/QualityControlCfg.xml +++ b/cave/build/static/common/cave/etc/textws/gui/QualityControlCfg.xml @@ -35,6 +35,7 @@ DM \ DAM FAILURE DM \ DAM BREAK RS \ RAIN AND SNOW MELT + RS \ RAIN AND MELTING SNOW FFW diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisConfigDlg.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisConfigDlg.java index c638fbf5e7..ac06a633f0 100644 --- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisConfigDlg.java +++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/AlertVisConfigDlg.java @@ -91,6 +91,8 @@ import com.raytheon.uf.viz.alertviz.ui.dialogs.ConfigurationFileDlg.Function; * 08 Sep 2012 13528 Xiaochuan Confirmation message is not necessary when * close. Add setNewConfig and run in common * setting group to perform the updating. + * 20 Dec 2012 13746 Xiaochuan Add setNewConfig in omitMenuItem.addSelectionListener + * to send notify for the changing. * * * @@ -738,6 +740,8 @@ public class AlertVisConfigDlg extends Dialog implements } setSourceColor(s, item); sourcesList.update(); + setNewConfig(); + } catch (Exception e) { Container .logInternal( diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/PriorityControls.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/PriorityControls.java index 78969ae5c8..81da43eb68 100644 --- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/PriorityControls.java +++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/PriorityControls.java @@ -62,6 +62,8 @@ import com.raytheon.uf.viz.alertviz.config.AlertMetadata; * 24 Mar 2011 5853 cjeanbap Check AlertMetadata for Null. * 08 Sep 2012 13528 Xiaochuan Run setNewConfig to update priorities * setting. + * 14 Dec 2012 4827 Xiaochuan Set toolTip on changeActionBtn. + * * * * @author lvenable @@ -781,7 +783,8 @@ public class PriorityControls { String selectedFileName = selectedFile.getName(); saveNeeded = !selectedFileName.equals(actionFile); alertMetadata.setPythonScript(selectedFileName); - actionChk.setToolTipText(selectedFileName); + changeActionBtn.setToolTipText(selectedFileName); + } else { alertMetadata.setAudioFile(null); alertMetadata.setAudioEnabled(false); diff --git a/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/baseCCFP.xml b/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/baseCCFP.xml new file mode 100644 index 0000000000..357c7fe82b --- /dev/null +++ b/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/baseCCFP.xml @@ -0,0 +1,36 @@ + + + + + + /ccfp/% + + + + /ccfp/% + + + + /ccfp/% + + + + diff --git a/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/index.xml b/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/index.xml new file mode 100644 index 0000000000..ec871df2a7 --- /dev/null +++ b/cave/com.raytheon.uf.viz.ccfp/localization/menus/ccfp/index.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/cave/com.raytheon.uf.viz.ccfp/src/com/raytheon/uf/viz/ccfp/rsc/CcfpResource.java b/cave/com.raytheon.uf.viz.ccfp/src/com/raytheon/uf/viz/ccfp/rsc/CcfpResource.java index ed1f457f7e..d662d39013 100644 --- a/cave/com.raytheon.uf.viz.ccfp/src/com/raytheon/uf/viz/ccfp/rsc/CcfpResource.java +++ b/cave/com.raytheon.uf.viz.ccfp/src/com/raytheon/uf/viz/ccfp/rsc/CcfpResource.java @@ -53,6 +53,9 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Point; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; /** * @@ -65,6 +68,7 @@ import com.vividsolutions.jts.geom.Point; * ------------ ---------- ----------- -------------------------- * Sep 22, 2009 3072 bsteffen Initial creation * Aug 23, 2012 1096 njensen Fixed memory leaks + * Dec 20, 2012 DCS 135 tk Changes for CCFP 2010 and 2012 TIN's * * * @@ -74,15 +78,18 @@ import com.vividsolutions.jts.geom.Point; public class CcfpResource extends AbstractVizResource { - private static final String[] coverageValues = { "", "75-100%", "50-74%", - "25-49%" }; + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(CcfpResource.class); + + private static final String[] coverageValues = { "", "75-100%", "40-74%", + "25-39%" }; private static final String[] confValues = { "", "HIGH", "", "LOW" }; - private static final String[] growthValues = { "", "++", "+", "NC", "-" }; + private static final String[] growthValues = { "", "+", "NC", "-" }; - private static final String[] topsValues = { "", "370+", "310-370", - "250-310" }; + private static final String[] topsValues = { "", "400", "390", "340", + "290" }; private static final String[] resourceTypes = { "", "Solid Coverage", "Medium Coverage", "Sparse Coverage", "Line" }; @@ -517,7 +524,13 @@ public class CcfpResource extends private void prepareLine(CcfpRecord record, DisplayFrame frame) throws VizException { Geometry geom = record.getLocation().getGeometry(); - frame.solidPolygons.addLineSegment(geom.getCoordinates()); + if (record.getCoverage() == 2) { + frame.dottedPolygons.addLineSegment(geom.getCoordinates()); + } + else { + frame.solidPolygons.addLineSegment(geom.getCoordinates()); + } + } /** @@ -562,10 +575,43 @@ public class CcfpResource extends */ private String[] getFormattedData(CcfpRecord record) { String[] lines = new String[4]; - lines[0] = "TOPS: " + topsValues[record.getTops()]; - lines[1] = "GWTH: " + growthValues[record.getGrowth()]; - lines[2] = "CONF: " + confValues[record.getConf()]; - lines[3] = "CVRG: " + coverageValues[record.getCoverage()]; + + int tops = record.getTops(); + if (tops < topsValues.length) { + lines[0] = "TOPS: " + topsValues[tops]; + } else { + lines[0] = "TOPS: "; + statusHandler.handle(Priority.EVENTA, + "Problem interogating CCFP data: tops value out of range"); + } + + int gwth = record.getGrowth(); + if (gwth < growthValues.length) { + lines[1] = "GWTH: " + growthValues[gwth]; + } else { + lines[1] = "GWTH: "; + statusHandler.handle(Priority.EVENTA, + "Problem interogating CCFP data: growth value out of range"); + } + + int conf = record.getConf(); + if (conf < confValues.length) { + lines[2] = "CONF: " + confValues[conf]; + } else { + lines[2] = "CONF: "; + statusHandler.handle(Priority.EVENTA, + "Problem interogating CCFP data: confidence value out of range"); + } + + int cvrg = record.getCoverage(); + if (cvrg < coverageValues.length) { + lines[3] = "CVRG: " + coverageValues[cvrg]; + } else { + lines[3] = "CVRG: "; + statusHandler.handle(Priority.EVENTA, + "Problem interogating CCFP data: coverage value out of range"); + } + return lines; } diff --git a/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml b/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml index d407ceff4a..579468e35e 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml +++ b/cave/com.raytheon.uf.viz.d2d.ui/plugin.xml @@ -430,6 +430,15 @@ name="xxx" visible="true"> + + + + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml index 9a452ad309..40a84f773b 100644 --- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TP.xml @@ -45,7 +45,7 @@ - + diff --git a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TPmodel.xml b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TPmodel.xml index 3755ae4e0c..0c0dc1d8dd 100644 --- a/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TPmodel.xml +++ b/cave/com.raytheon.uf.viz.derivparam/localization/derivedParameters/definitions/TPmodel.xml @@ -25,6 +25,9 @@ + + + diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java index 020a942dc1..de9d6c8804 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java @@ -223,6 +223,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * made non-blocking. * 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg. * 11/05/2012 15477 zhao Trim blank lines in text in Editor when check Syntax + * 01/09/2013 15528 zhao Modified saveFile() and restoreFile() * * * @@ -1848,18 +1849,12 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, String bbb = editorTafTabComp.getBBB(); String type; - if (ti.getText().equals(tabFillText) - || editorTafTabComp.getTextEditorControl().getText() - .trim().length() == 0) { - MessageBox questionMB = new MessageBox(shell, - SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); + if (ti.getText().equals(tabFillText) || editorTafTabComp.getTextEditorControl().getText().trim().length() == 0) { + MessageBox questionMB = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK ); questionMB.setText("Save TAF"); - questionMB.setMessage("Empty TAF do you want to save it?"); - int result = questionMB.open(); - - if (result == SWT.CANCEL) { - return; - } + questionMB.setMessage("Cannot save Empty TAF!"); + questionMB.open(); + return; } if (bbb.startsWith("AA")) { @@ -2290,8 +2285,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, private void saveFile(String filename) { String tempTafPath = "aviation/tmp/"; IPathManager pm = PathManagerFactory.getPathManager(); - LocalizationContext context = pm.getContext( - LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); + LocalizationContext context = pm.getContext(LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); String path = pm.getFile(context, tempTafPath).getAbsolutePath(); String filepath = null; @@ -2311,17 +2305,14 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, if (filepath != null) { try { setWaitCursor(true); - String fname = tempTafPath - + filepath.substring(filepath.lastIndexOf('/') + 1); + String fname = tempTafPath + filepath.substring(filepath.lastIndexOf('/') + 1); LocalizationFile lFile = pm.getLocalizationFile(context, fname); File file = lFile.getFile(); if (filename == null && file.exists()) { - MessageBox questionMB = new MessageBox(shell, - SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); + MessageBox questionMB = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); questionMB.setText("Save TAF"); - questionMB - .setMessage("File already exists. Do you want to overwrite it?"); + questionMB.setMessage("File already exists. Do you want to overwrite it?"); int result = questionMB.open(); if (result == SWT.CANCEL) { @@ -2346,17 +2337,14 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, setMessageStatusOK("File " + filepath + " saved successfully."); } catch (FileNotFoundException e) { e.printStackTrace(); - setMessageStatusError("Unable to open file " + filepath - + " for writing."); + setMessageStatusError("Unable to open file " + filepath + " for writing."); } catch (IOException e) { e.printStackTrace(); - setMessageStatusError("An IOException occured while saving file " - + filepath); + setMessageStatusError("An IOException occured while saving file " + filepath); } catch (LocalizationOpFailedException e) { e.printStackTrace(); - setMessageStatusError("A LocalizationOpFailedException occured while saving file " - + filepath); + setMessageStatusError("A LocalizationOpFailedException occured while saving file " + filepath); } finally { setWaitCursor(false); } @@ -2373,12 +2361,10 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, tabFolder.setSelection(editorTab); // Use the current tab if (!(ti.getText().equals(tabFillText))) { - if (!editorTafTabComp.isTafSent()) { - MessageBox questionMB = new MessageBox(shell, - SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); + if (!editorTafTabComp.isTafSent() && !editorTafTabComp.getTextEditorControl().getText().trim().equals("")) { + MessageBox questionMB = new MessageBox(shell,SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); questionMB.setText("Restore TAF"); - questionMB - .setMessage("Forecast not saved. Do you want to continue?"); + questionMB.setMessage("Forecast not saved. Do you want to continue?"); int result = questionMB.open(); if (result == SWT.CANCEL) { @@ -2389,10 +2375,8 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, String tempTafPath = "aviation/tmp/"; IPathManager pm = PathManagerFactory.getPathManager(); - LocalizationContext context = pm.getContext( - LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); - String path = pm.getFile(context, tempTafPath) - .getAbsolutePath(); + LocalizationContext context = pm.getContext(LocalizationType.CAVE_STATIC, LocalizationLevel.SITE); + String path = pm.getFile(context, tempTafPath).getAbsolutePath(); String filepath = null; File tmp = new File(path); @@ -2413,11 +2397,8 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, try { setWaitCursor(true); - String fname = tempTafPath - + filepath - .substring(filepath.lastIndexOf('/') + 1); - LocalizationFile lFile = pm.getLocalizationFile( - context, fname); + String fname = tempTafPath + filepath.substring(filepath.lastIndexOf('/') + 1); + LocalizationFile lFile = pm.getLocalizationFile(context, fname); File file = lFile.getFile(); FileReader reader = new FileReader(file); BufferedReader input = new BufferedReader(reader); @@ -2434,20 +2415,17 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, if (values.length != 3) { errorMsg = "parse error"; contents.append(line); - contents.append(System - .getProperty("line.separator")); + contents.append(System.getProperty("line.separator")); } else { editorTafTabComp.setWmoIdLbl(values[0].trim()); - editorTafTabComp - .setWmoSiteLbl(values[1].trim()); + editorTafTabComp.setWmoSiteLbl(values[1].trim()); editorTafTabComp.setLargeTF(values[2].trim()); } } while ((line = input.readLine()) != null) { contents.append(line); - contents.append(System - .getProperty("line.separator")); + contents.append(System.getProperty("line.separator")); } input.close(); @@ -2468,25 +2446,20 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, } ti.setText(icao + " " + bbb); - editorTafTabComp.getTextEditorControl() - .setText(tafText); + editorTafTabComp.getTextEditorControl().setText(tafText); if (editorTafTabComp.isTafSent()) { editorTafTabComp.updateTafSent(false); } } catch (FileNotFoundException e) { - setMessageStatusError("File " + filepath - + " not found."); + setMessageStatusError("File " + filepath + " not found."); } catch (IOException e) { - setMessageStatusError("An IOException occured while opening file " - + filepath); + setMessageStatusError("An IOException occured while opening file " + filepath); } finally { if (errorMsg != null) { - setMessageStatusError("File " + filepath + ": " - + errorMsg); + setMessageStatusError("File " + filepath + ": " + errorMsg); } else { - setMessageStatusOK("File " + filepath - + " opened successfully."); + setMessageStatusOK("File " + filepath + " opened successfully."); } setWaitCursor(false); } diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java index aefc1f5df2..d789633e37 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/SiteMonitor.java @@ -64,6 +64,8 @@ import com.raytheon.viz.aviation.xml.MonitorCfg; * Apr 30, 2012 14717 zhao Indicators turn gray when Metar is outdated * 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer * 11AUG2012 14570 zhao Added 'cat' to alert_key_map + * 02Jan2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI + * * * * @author lvenable @@ -235,7 +237,7 @@ public class SiteMonitor implements IRequestCompleteListener> { protected Label createLabel(Composite parentComp, String text) { ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance(); text = " " + text.trim() + " "; - GridData gd = new GridData(35, SWT.DEFAULT); + GridData gd = new GridData(15, SWT.DEFAULT);// GridData(35 // DR 15606 Label lbl = new Label(parentComp, SWT.CENTER); configMgr.setDefaultFontAndColors(lbl, text, gd); lbl.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_GRAY)); diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java index 8f5bbf5c7e..96d9f1aba9 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java @@ -91,7 +91,7 @@ import com.raytheon.viz.avnconfig.IStatusSettable; * Viewer when a METAR changes alert status. * 04/26/2012 14717 zhao Indicator labels turn gray when Metar is outdated * 20JUL2012 14570 gzhang/zhao Add data structure for highlighting correct time groups in TAF viewer - * + * 01/02/2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI * * * @author lvenable @@ -300,7 +300,7 @@ public class TafSiteComp { ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance(); GridData gd = new GridData(); - gd.widthHint = 70; +// gd.widthHint = 70; // DR 15606 gd.minimumWidth = 70; siteIdBtn = new Button(parent, SWT.PUSH); configMgr.setDefaultFontAndColors(siteIdBtn, "WWWW", gd); @@ -449,7 +449,7 @@ public class TafSiteComp { GridData gd = new GridData(); gd.minimumWidth = btnMinWidth; - gd.widthHint = btnMinWidth; +// gd.widthHint = btnMinWidth; // DR 15606 amdBtn = new Button(btnStatusComp, SWT.PUSH); configMgr.setDefaultFontAndColors(amdBtn, "Amd", gd); amdBtn.addSelectionListener(new SelectionAdapter() { @@ -466,7 +466,7 @@ public class TafSiteComp { gd = new GridData(); gd.minimumWidth = btnMinWidth; - gd.widthHint = btnMinWidth; +// gd.widthHint = btnMinWidth; // DR 15606 rtdBtn = new Button(btnStatusComp, SWT.PUSH); configMgr.setDefaultFontAndColors(rtdBtn, "Rtd", gd); rtdBtn.addSelectionListener(new SelectionAdapter() { @@ -483,7 +483,7 @@ public class TafSiteComp { gd = new GridData(); gd.minimumWidth = btnMinWidth; - gd.widthHint = btnMinWidth; +// gd.widthHint = btnMinWidth; // DR 15606 corBtn = new Button(btnStatusComp, SWT.PUSH); configMgr.setDefaultFontAndColors(corBtn, "Cor", gd); corBtn.addSelectionListener(new SelectionAdapter() { diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java index 51b21c90c5..07d06abbea 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/observer/TafMonitorDlg.java @@ -142,6 +142,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 10/11/2012 1229 rferrel Changes for non-blocking TafViewerEditorDlg. * 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg. * 11/28/2012 1363 rferrel Dispose of PythonGuidanceJob when closing. + * 01/02/2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI + * * * * @author grichard @@ -752,7 +754,7 @@ public class TafMonitorDlg extends CaveSWTDialog { gl.verticalSpacing = 1; scrolledComp.setLayout(gl); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); - gd.heightHint = SCROLLED_COMP_HEIGHT_perStn * stationList.size(); +// gd.heightHint = SCROLLED_COMP_HEIGHT_perStn * stationList.size(); // DR 15606 scrolledComp.setLayoutData(gd); configMgr.setDefaultColors(scrolledComp); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/EditAreaModeButton.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/EditAreaModeButton.java index e46d177c76..05f047eb29 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/EditAreaModeButton.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/EditAreaModeButton.java @@ -21,11 +21,12 @@ package com.raytheon.viz.gfe.actions; import java.util.Map; +import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.commands.IElementUpdater; import org.eclipse.ui.menus.UIElement; +import com.raytheon.viz.ui.UiUtil; import com.raytheon.viz.gfe.core.DataManager; -import com.raytheon.viz.gfe.core.IReferenceSetManager.RefSetMode; import com.raytheon.viz.ui.actions.AbstractDropDownMenuHandler; /** @@ -36,6 +37,7 @@ import com.raytheon.viz.ui.actions.AbstractDropDownMenuHandler; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 2, 2008 #1053 randerso Initial creation + * Dec 19,2012 #15535 jdynina Adjusted size for the button on demand * * * @@ -54,14 +56,15 @@ public class EditAreaModeButton extends AbstractDropDownMenuHandler implements * menus.UIElement, java.util.Map) */ @Override - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") public void updateElement(UIElement element, Map parameters) { DataManager dm = DataManager.getCurrentInstance(); if (dm == null) { return; } - RefSetMode mode = dm.getRefManager().getMode(); - element.setText(mode.getSymbol()); + element.setText(dm.getRefManager().getMode().getSymbol()); + UiUtil.updateWindowCoolBar((IWorkbenchWindow) parameters + .get("org.eclipse.ui.IWorkbenchWindow")); } } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowISCGridsAction.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowISCGridsAction.java index ae347f6d78..b4c634ff0f 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowISCGridsAction.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowISCGridsAction.java @@ -45,68 +45,42 @@ import org.eclipse.swt.widgets.ToolItem; * 07/20/09 1995 bphillip Initial release * 12/06/12 DR 15574 jzeng Change the image of * the icon when it is activated + * 01/11/13 DR 15574 jzeng delete all fields to local variables * * * @author bphillip * @version 1 */ public class ShowISCGridsAction extends AbstractHandler { - /* - * non-active Image - */ - private Image orgImg = null; - /* - * active Image - */ - private Image actImg = null; - /* - * ImageDescriptor - */ - private ImageDescriptor id = null; - /* - * Tool item - */ - private ToolItem ti = null; - @Override + @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { boolean current = Message.inquireLastMessage(ShowISCGridsMsg.class).show(); - /* - * Get toolItem - */ + if (arg0.getTrigger() instanceof Event) { - Event e = (Event) arg0.getTrigger(); - if ( e.widget instanceof ToolItem) { - ti = (ToolItem) e.widget; - } + Event e = (Event) arg0.getTrigger(); + if ( e.widget instanceof ToolItem) { + ToolItem ti = (ToolItem) e.widget; + if (ti != null ){ + ImageDescriptor id; + + if (!current){ + id = Activator.imageDescriptorFromPlugin( + Activator.PLUGIN_ID, "icons/isc1.gif" ); + } else { + id = Activator.imageDescriptorFromPlugin( + Activator.PLUGIN_ID, "icons/isc0.gif" ); + } + + if (id != null){ + Image img = id.createImage(); + ti.setImage(img); + img.dispose(); + } + } + } } - - /* - * Get Image when it is not activated - */ - if (orgImg == null) { - id = Activator.imageDescriptorFromPlugin( - Activator.PLUGIN_ID, "icons/isc0.gif" ); - orgImg = id.createImage(); - } - /* - * Get Image when it is activated - */ - if (actImg == null) { - id = Activator.imageDescriptorFromPlugin( - Activator.PLUGIN_ID, "icons/isc1.gif" ); - actImg = id.createImage(); - } - /* - * Change the image when it is active and - * change it back when it is not activated - */ - if (ti != null) { - if (!current) - ti.setImage(actImg); - else ti.setImage(orgImg); - } - + new ShowISCGridsMsg(!current).send(); return null; } 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 b6c28cce76..cb0d648cb9 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,6 +19,7 @@ **/ package com.raytheon.viz.gfe.dialogs; +import java.awt.Toolkit; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -29,15 +30,17 @@ import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.FontMetrics; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; import com.raytheon.edex.util.Util; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; @@ -72,6 +75,11 @@ 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) + * and adjustDlg(String str), + * change gridInfoText from Label to Text + * to make sure the info get displayed inside the screen + * and can be scrolled. * * * @@ -97,8 +105,15 @@ public class GridInfoDialog extends CaveJFACEDialog implements "ISC History", "Weather Element Info", "Weather Element State", "Locks", "Data Distribution" }; - private Label gridInfoText; - + // 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) { @@ -112,6 +127,8 @@ 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 @@ -120,7 +137,7 @@ public class GridInfoDialog extends CaveJFACEDialog implements GridLayout layout = (GridLayout) top.getLayout(); layout.numColumns = 2; layout.makeColumnsEqualWidth = false; - + initializeComponents(); return top; @@ -141,11 +158,51 @@ public class GridInfoDialog extends CaveJFACEDialog implements // composite2.setLayoutData(layoutData); // composite2.setLayout(new GridLayout(1, true)); - gridInfoText = new Label(top, SWT.NONE); + gridInfoText = new Text(top, SWT.NONE | SWT.H_SCROLL); 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){ + GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); + int maxLength = getMaxWidth(infoText); + if ( maxLength > WidthofScreen ) { + gd.widthHint = WidthofScreen; + gridInfoText.setLayoutData(gd); + } else { + gridInfoText.setLayoutData(gd); + } + gridInfoText.setText(infoText); + } + + /* + * get the maximum width of the info + */ + private int getMaxWidth(String textInfo){ + String[] splits = textInfo.split("\\n"); + GC gc = new GC (gridInfoText); + FontMetrics fm = gc.getFontMetrics (); + int acw = fm.getAverageCharWidth (); + int maxStr = 0; + for (String str : splits){ + maxStr = Math.max(maxStr, str.length()); + } + return maxStr*acw; + } + @Override protected void createButtonsForButtonBar(Composite parent) { super.createButton(parent, Window.CANCEL, "Cancel", false); @@ -194,19 +251,19 @@ public class GridInfoDialog extends CaveJFACEDialog implements String choice = b.getText(); if (choice.equalsIgnoreCase("Grid Info")) { - gridInfoText.setText(getGridInfo()); + adjustDlg(getGridInfo()); } else if (choice.equalsIgnoreCase("Grid History")) { - gridInfoText.setText(getGridHistory()); + adjustDlg(getGridHistory()); } else if (choice.equalsIgnoreCase("ISC History")) { - gridInfoText.setText(getISCHistory()); + adjustDlg(getISCHistory()); } else if (choice.equalsIgnoreCase("Weather Element Info")) { - gridInfoText.setText(getWEInfo()); + adjustDlg(getWEInfo()); } else if (choice.equalsIgnoreCase("Weather Element State")) { - gridInfoText.setText(getWEState()); + adjustDlg(getWEState()); } else if (choice.equalsIgnoreCase("Locks")) { - gridInfoText.setText(getLockInfo()); + adjustDlg(getLockInfo()); } else if (choice.equalsIgnoreCase("Data Distribution")) { - gridInfoText.setText(getDataDistribution()); + adjustDlg(getDataDistribution()); } else { gridInfoText.setText(""); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java index 98174d46bc..eeafc5f64e 100755 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java @@ -65,6 +65,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 28May2010 2187 cjeanbap Added StdTextProductFactory * functionality. * 09 NOV 2012 1298 rferrel Changes for non-blocking dialog. + * 10Jan2012 15564 mgamazaychikov Set the awipsWanPil based on productText data * * * @author lvenable @@ -387,7 +388,15 @@ public class StoreTransmitDlg extends CaveSWTDialog implements } else { req = new OUPRequest(); OfficialUserProduct oup = new OfficialUserProduct(); - String awipsWanPil = productIdTF.getText(); + /* + * DR15564 - set the awipsWanPil based on productText data + */ + String[] splitLines = productText.split("\n"); + String[] firstLine = splitLines[0].split(" "); + String[] secondLine = splitLines[1].split(" "); + String cccc = firstLine[1]; + String productNnnidXxxid = secondLine[0]; + String awipsWanPil = cccc + productNnnidXxxid; oup.setAwipsWanPil(awipsWanPil); oup.setProductText(productText); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/isc/ISCRequestReplyDlg.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/isc/ISCRequestReplyDlg.java index b129072323..e19e7c5eb0 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/isc/ISCRequestReplyDlg.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/isc/ISCRequestReplyDlg.java @@ -39,6 +39,9 @@ import org.eclipse.swt.widgets.Shell; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; +import com.raytheon.uf.viz.core.catalog.DirectDbQuery; +import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage; +import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.GFEServerException; import com.raytheon.viz.gfe.core.DataManager; @@ -55,6 +58,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * ------------ ---------- ----------- -------------------------- * 08/20/09 1995 lvenable Initial port * 10/24/2008 1287 rferrel Made dialog non-blocking. + * 12/28/2012 DR15587 jzeng Query weather elements from fcst DB * * * @@ -226,6 +230,26 @@ public class ISCRequestReplyDlg extends CaveSWTDialog { this.xml = (String) response[0]; this.weList = (List) response[1]; Collections.sort(this.weList); + + /* + * If the weList is empty, get it from database + */ + if (this.weList.isEmpty() ){ + String query = "Select distinct (parmname) from awips.gfe"; + List list = null; + try { + list = DirectDbQuery.executeQuery(query, "metadata", + QueryLanguage.SQL); + for (Object[] we : list){ + weList.add(we[0].toString()); + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, + "Error querying database", e); + } + } + + domainDict = (Map>>>) response[2]; serverDictT2S = (Map>) response[4]; diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/DiscreteDisplayUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/DiscreteDisplayUtil.java index a64d012a6c..a730247dc9 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/DiscreteDisplayUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/DiscreteDisplayUtil.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -23,8 +23,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.eclipse.swt.graphics.RGB; - import com.raytheon.uf.common.colormap.ColorMap; import com.raytheon.uf.common.colormap.IColorMap; import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType; @@ -56,16 +54,17 @@ import com.raytheon.viz.gfe.core.wxvalue.WxValue; /** * Utilities for displaying GFEResources correctly. Determines the fill color * and/or pattern for discrete data (Weather or Hazard grids). - * + * *
- * 
+ *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 9, 2009            njensen     Initial creation
- * 
+ * Jan 9, 2013  15648     ryu         Update colormap when new discrete colrmap is selected.
+ *
  * 
- * + * * @author njensen * @version 1.0 */ @@ -74,8 +73,6 @@ public class DiscreteDisplayUtil { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(DiscreteDisplayUtil.class); - private static Map> discreteParmToColorMap = new HashMap>(); - private static ColorMap defaultSpectrum; private static synchronized ColorMap getDefaultSpectrum() { @@ -96,22 +93,29 @@ public class DiscreteDisplayUtil { return defaultSpectrum; } + private static WeatherColorTable weatherColorTable; + + private static Map discreteColorTable; + /** * Delete the discrete color map for parm. This should be done whenever the * color map in the resource is changed (to make getFillColor() load the new * color map), or when the parm is destroyed (to conserve storage). - * + * * @param parm * The discrete parm whose color map is to be deleted. */ - public static void deleteParmColorMap(Parm parm) { + public static synchronized void deleteParmColorMap(Parm parm) { + if (discreteColorTable == null) { + discreteColorTable = new HashMap(); + } String compositeName = parm.getParmID().getCompositeName(); - discreteParmToColorMap.put(compositeName, null); + discreteColorTable.remove(compositeName); } /** * Given a parm, build a ColorMapParameters object for it. - * + * * @param aparm * The parm for which color map parameters should be built. * @return the ColorMapParameters for the parm. @@ -207,12 +211,9 @@ public class DiscreteDisplayUtil { float logFactor = prefs.getFloat(logFactorPref); colorMP.setLogFactor(logFactor); } - + if (info.getGridType() == GridType.DISCRETE) { List keys = info.getDiscreteKeys(); - if (!keys.get(keys.size()-1).equalsIgnoreCase("LocalHazard")) { - keys.add("LocalHazard"); - } DataMappingPreferences dataMap = new DataMappingPreferences(); for (int i=0; i < keys.size(); i++) { DataMappingEntry entry = new DataMappingEntry(); @@ -232,10 +233,6 @@ public class DiscreteDisplayUtil { return colorMP; } - private static WeatherColorTable weatherColorTable; - - private static Map discreteColorTable; - public static List getFillAttributes(WxValue wxValue) { if (wxValue instanceof WeatherWxValue) { @@ -275,7 +272,6 @@ public class DiscreteDisplayUtil { ColorMapParameters params = resource.getCapability( ColorMapCapability.class).getColorMapParameters(); IColorMap colorMap = params.getColorMap(); - colorTable = new DiscreteColorTable(parm, colorMap); discreteColorTable.put(compName, colorTable); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java index cd0801324b..503d3ad132 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java @@ -1,26 +1,26 @@ /** * 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. **/ /** - * This package is associated with the classes that describe the Color bar at the - * top of the Spatial Editor window. + * This package is associated with the classes that describe the Color bar at the + * top of the Spatial Editor window. */ package com.raytheon.viz.gfe.rsc.colorbar; @@ -53,13 +53,20 @@ import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle; import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment; import com.raytheon.uf.viz.core.PixelExtent; import com.raytheon.uf.viz.core.RGBColors; +import com.raytheon.uf.viz.core.drawables.ColorMapParameters; import com.raytheon.uf.viz.core.drawables.FillPatterns; +import com.raytheon.uf.viz.core.drawables.IColorMapParametersListener; import com.raytheon.uf.viz.core.drawables.PaintProperties; +import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.map.IMapDescriptor; +import com.raytheon.uf.viz.core.rsc.AbstractVizResource; +import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability; import com.raytheon.viz.gfe.Activator; import com.raytheon.viz.gfe.colortable.ColorEntry; import com.raytheon.viz.gfe.colortable.ColorTable.ImageAttr; +import com.raytheon.viz.gfe.core.DataManager; +import com.raytheon.viz.gfe.core.ISpatialDisplayManager; import com.raytheon.viz.gfe.core.griddata.DiscreteGridData; import com.raytheon.viz.gfe.core.griddata.IGridData; import com.raytheon.viz.gfe.core.griddata.WeatherGridData; @@ -75,7 +82,7 @@ import com.vividsolutions.jts.geom.Coordinate; /** * Implements a colorbar for continuous (scalar and vector) elements - * + * *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
@@ -84,14 +91,16 @@ import com.vividsolutions.jts.geom.Coordinate;
  * Aug 20, 2008            dglazesk    Updated for the new ColorMap interface
  * Aug 20, 2012      1079  randerso    Changed to display all discrete values for
  *                                     non-overlapping discretes
- * 
+ * Jan 9, 2013  15661      ryu         Set font for drawing regular Wx/discrete parm labels.
+ * Jan 10, 2013  15548     ryu         Update colorbar when new discrete colormap is selected
+ *
  * 
- * + * * @author chammack * @version 1.0 */ public class DiscreteColorbar implements IColorBarDisplay, - IGridDataChangedListener { + IGridDataChangedListener, IColorMapParametersListener { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(DiscreteColorbar.class); @@ -126,9 +135,11 @@ public class DiscreteColorbar implements IColorBarDisplay, private boolean lastIscMode; + private ColorMapParameters cmParams; + /** * Constructor for the Discrete Color Bar - * + * * @param parm * The parm * @param colorbarResource @@ -143,16 +154,31 @@ public class DiscreteColorbar implements IColorBarDisplay, this.lastIscMode = parm.getDataManager().getParmManager().iscMode(); parm.getListeners().addGridChangedListener(this); + cmParams = getColorMapParameters(); + cmParams.addListener(this); + } + + private ColorMapParameters getColorMapParameters() { + DataManager dataManager = parm.getDataManager(); + ISpatialDisplayManager spatialDisplayManager = dataManager + .getSpatialDisplayManager(); + ResourcePair resourcePair = spatialDisplayManager + .getResourcePair(parm); + AbstractVizResource resource = resourcePair.getResource(); + ColorMapParameters params = resource.getCapability( + ColorMapCapability.class).getColorMapParameters(); + return params; } /* * (non-Javadoc) - * + * * @see com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#dispose() */ @Override public void dispose() { parm.getListeners().removeGridChangedListener(this); + cmParams.removeListener(this); } @Override @@ -160,9 +186,14 @@ public class DiscreteColorbar implements IColorBarDisplay, lastTime = null; } + @Override + public void colorMapChanged() { + lastTime = null; + } + /** * Gets the Discrete Color map. - * + * * @return Returns the color map used for the discrete data. */ public static ColorMap getFallbackColorMap() { @@ -171,7 +202,7 @@ public class DiscreteColorbar implements IColorBarDisplay, /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.core.drawables.IRenderable#paint(com.raytheon.viz.core * .IGraphicsTarget, com.raytheon.viz.core.drawables.PaintProperties) @@ -395,7 +426,7 @@ public class DiscreteColorbar implements IColorBarDisplay, * Labels that do not fit their designated band on the bar will be * truncated. Pickup value text will always be displayed in full, so any * text it overlaps will not be drawn. - * + * * @param target * The graphics target on which to draw * @param colorTable @@ -516,6 +547,7 @@ public class DiscreteColorbar implements IColorBarDisplay, true); dstring.setText(truncatedLabel, seColorBarTextColor); dstring.setCoordinates(labelLoc, center); + dstring.font = colorbarResource.getColorbarWxLabelFont(); target.drawStrings(dstring); } } @@ -525,7 +557,7 @@ public class DiscreteColorbar implements IColorBarDisplay, /** * Draws the colorbar once colors and patterns have been decided. - * + * * @param target * The graphics target on which to draw. * @param pixelExtent @@ -625,7 +657,7 @@ public class DiscreteColorbar implements IColorBarDisplay, /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#getValueAt(double[], * int) diff --git a/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml b/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml index 0c51ac0cf1..5a71b3e87d 100644 --- a/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml +++ b/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml @@ -35,7 +35,7 @@ - + diff --git a/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml b/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml index 9665c2e9b6..5f6935893b 100644 --- a/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml +++ b/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml @@ -37,26 +37,32 @@ + + + + + +
\ No newline at end of file diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java index f84e2505e8..d1f9825d8f 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java @@ -132,7 +132,8 @@ import com.raytheon.viz.hydrocommon.util.DbUtils; * to display stage value, also added checking for rating curve for both * stage and discharge. * 13 Nov 2012 15416 lbousaidi added a check when the colorname is null and a call to - * getGroupModeColor + * getGroupModeColor + * 09 Jan 2012 15493 lbousaidi added code to delete data while zooming when you draw a box * @author lvenable * @version 1.0 * @@ -1714,7 +1715,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements } } } - } else if (dialog.isDelete()) { + } else if ( traceSelected && dialog.isDelete()) { if (mouseDown) { int deleteX1 = selectedX; int deleteY1 = selectedY; @@ -2111,8 +2112,13 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements getAgain = false; } else if (traceSelected && dialog.isDelete() && (deleteRect != null)) { TraceData td = graphData.getTraces().get(selectedTraceId); + TimeSeriesPoint[] pointArray= null; + if (!zoomed ){ + pointArray = td.getTsData(); + } else { + pointArray = td.getZoomedTsData(); + } - TimeSeriesPoint[] pointArray = td.getTsData(); for (int i = 0; i < pointArray.length; i++) { if (deleteRect.contains(pointArray[i].getPixelX(), pointArray[i].getPixelY())) { @@ -2345,6 +2351,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements int[] dataPts = new int[pointArray.length * 2]; ArrayList dataPtList = new ArrayList(); int dataIndex = 0; + int zoomDataIndex=0; ArrayList al = new ArrayList(); for (int i = 0; i < pointArray.length; i++) { if (pointArray[i].getY() != HydroConstants.MISSING_VALUE) { @@ -2378,11 +2385,15 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements al.add(GRAPHBORDER_LEFT + x2pixel(graphData, pointArray[i].getX() .getTime())); + pointArray[i].setPixelX(al.get(zoomDataIndex)); + zoomDataIndex++; al.add(GRAPHBORDER * 2 + graphAreaHeight - (lowerAxis - y2pixel(graphData, pointArray[i].getY()))); + pointArray[i].setPixely(al.get(zoomDataIndex)); + zoomDataIndex++; } int[] pts = new int[al.size()]; for (int j = 0; j < al.size(); j++) { diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java index 00829426fd..61730984e3 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java @@ -38,6 +38,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants; * Jul 7, 2008 1194 mpduff Initial creation * May 11,2011 9281 lbousaid nothing get display in right y-axis when * there is no rating curve + * Jan 03,2013 15652 wkwock Fix stage to discharge * * * @@ -52,8 +53,10 @@ public class StageDischargeUtils { private static String RATING_QUERY = "select lid,stage,discharge from rating where lid=':lid' order by stage asc"; - private static String RATING_SHIFT_QUERY = "select lid,date,shift_amount from ratingshift where lid = ':lid' and active='T' order by date asc"; - + private static String RATING_SHIFT_QUERY = "select lid,date,shift_amount from ratingshift where lid = ':lid' and active='T' order by date desc"; + + private static boolean needToFindShiftAmount = false; + /** * Returns the corresponding stage value for the discharge value passed in. * @@ -78,7 +81,8 @@ public class StageDischargeUtils { try { if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) { ratingData = queryRatingData(lid); - /* Check the Rating object for data and return true if data are available*/ + needToFindShiftAmount = true; + /* Check the Rating object for data and return true if data are available*/ if (ratingData.getStage().size() > 2) { retVal = true; } @@ -88,7 +92,8 @@ public class StageDischargeUtils { } } else { if (ratingData.getLid().equalsIgnoreCase(lid)) { - ratingData = queryRatingData(lid); + ratingData = queryRatingData(lid); + needToFindShiftAmount = true; if (ratingData.getStage().size() > 2) { retVal = true; } else { @@ -125,7 +130,6 @@ public class StageDischargeUtils { } double discharge = HydroConstants.MISSING_VALUE; - boolean needToFindShiftAmount = false; /* * If the lid passed in is NOT the same as the previous lid @@ -133,11 +137,11 @@ public class StageDischargeUtils { */ if (!lid.equals(previousLid)) { previousLid = lid; - needToFindShiftAmount = true; try { if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) { - ratingData = queryRatingData(lid); + needToFindShiftAmount = true; + ratingData = queryRatingData(lid); } } catch (VizException e) { // TODO Auto-generated catch block @@ -188,7 +192,8 @@ public class StageDischargeUtils { stageRatingCurve.set(i, d); } ratingData.setStage(stageRatingCurve); - } + needToFindShiftAmount = false; + } } ArrayList dischargeList = ratingData.getDischarge(); @@ -291,6 +296,7 @@ public class StageDischargeUtils { try { if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) { ratingData = queryRatingData(lid); + needToFindShiftAmount = true; } } catch (VizException e) { // TODO Auto-generated catch block @@ -422,10 +428,12 @@ public class StageDischargeUtils { List results = DirectDbQuery.executeQuery(RATING_QUERY.replace(":lid", lid), HydroConstants.IHFS, QueryLanguage.SQL); if (results != null) { + //the Rating constructor already add stage and discharge to it. so clear it... + rating.getStage().clear(); + rating.getDischarge().clear(); for (int i = 0; i < results.size(); i++) { Object[] sa = results.get(i); if (((sa[1] != null) || (sa[1] != "")) && ((sa[2] != null) || (sa[2] != ""))) { - // TODO check these types rating.addStage((Double)sa[1]); rating.addDischarge((Double)sa[2]); } @@ -446,7 +454,7 @@ public class StageDischargeUtils { /* Query the ratingShift table */ ArrayList results = null; try { - results = (ArrayList)DirectDbQuery.executeQuery(RATING_SHIFT_QUERY, HydroConstants.IHFS, QueryLanguage.SQL); + results = (ArrayList)DirectDbQuery.executeQuery(RATING_SHIFT_QUERY.replace(":lid", lid), HydroConstants.IHFS, QueryLanguage.SQL); } catch (VizException e) { e.printStackTrace(); } catch (NullPointerException e) { diff --git a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/HydroDBData.java b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/HydroDBData.java index d4b5cd1987..4ced61d5ff 100644 --- a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/HydroDBData.java +++ b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/HydroDBData.java @@ -36,6 +36,8 @@ import com.raytheon.viz.hydrocommon.HydroConstants; * Nov 18, 2008 1697 askripsky Initial creation * Dec 2, 2008 1744 askripsky Added getDBString methods * Dec 17, 2008 1782 grichard Added getDBString methods + * Jan 03, 2013 15520 lbousaidi Added getDBStringNoQuote method + * * * @@ -116,4 +118,16 @@ public class HydroDBData { public String getDBString(String str) { return (str != null) ? "'" + str + "'" : "null"; } + + /** + * Returns "null" if the value is set to null, else returns the value + * Doesn't add extra single quotes around the string + * @param str + * @return + */ + + public String getDBStringNoQuote(String str) { + return (str != null) ? str : "null"; + } + } diff --git a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/RiverStatData.java b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/RiverStatData.java index d0739164ba..4c6cff3cb7 100644 --- a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/RiverStatData.java +++ b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/RiverStatData.java @@ -35,6 +35,10 @@ import com.raytheon.viz.hydrocommon.HydroConstants; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 6, 2008 1802 askripsky Initial creation + * Jan 3, 2013 15520 lbousaidi added a dollar-quoted string to getUpdate and + * getInsert statements to always write literally + * the string content. + * * * @@ -765,7 +769,7 @@ public class RiverStatData extends HydroDBData implements IHydroDBData { String rval = "INSERT INTO riverstat ( " + columns + " ) VALUES ( %s, %s, %s, %s, %s, %s, %s," - + " %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s," + + " %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, $$%s$$,%s," + " %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )"; rval = String.format(rval, getDBString(lid), getDBString(primaryPE), @@ -776,7 +780,7 @@ public class RiverStatData extends HydroDBData implements IHydroDBData { getDBString(level), getDBString(riverMile), getDBString(pool), getDBString(periodOfRecord), getDBString(rated), getDBString(latitude), getDBString(longitude), - getDBString(remark), getDBString(reviseDate, dateFormat), + getDBStringNoQuote(remark), getDBString(reviseDate, dateFormat), getDBString(latLonSource), getDBString(stream), getDBString(tidalEffect), getDBString(backWater), getDBString(verticalDatum), getDBString(actionFlow), @@ -809,7 +813,7 @@ public class RiverStatData extends HydroDBData implements IHydroDBData { public String getUpdateStatement() { // Set the basic update statement String rval = "UPDATE riverstat SET lid=%s, primary_pe=%s, bf=%s, cb=%s, da=%s, response_time=%s, threshold_runoff=%s," - + " fq=%s, fs=%s, gsno=%s, level=%s, mile=%s, pool=%s, por=%s, rated=%s, lat=%s, lon=%s, remark=%s, rrevise=%s," + + " fq=%s, fs=%s, gsno=%s, level=%s, mile=%s, pool=%s, por=%s, rated=%s, lat=%s, lon=%s, remark=$$%s$$, rrevise=%s," + " rsource=%s, stream=%s, tide=%s, backwater=%s, vdatum=%s, action_flow=%s, wstg=%s, zd=%s, ratedat=%s," + " usgs_ratenum=%s, uhgdur=%s, use_latest_fcst=%s WHERE %s"; @@ -822,7 +826,7 @@ public class RiverStatData extends HydroDBData implements IHydroDBData { getDBString(level), getDBString(riverMile), getDBString(pool), getDBString(periodOfRecord), getDBString(rated), getDBString(latitude), getDBString(longitude), - getDBString(remark), getDBString(reviseDate, dateFormat), + getDBStringNoQuote(remark), getDBString(reviseDate, dateFormat), getDBString(latLonSource), getDBString(stream), getDBString(tidalEffect), getDBString(backWater), getDBString(verticalDatum), getDBString(actionFlow), diff --git a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/XmrgResource.java b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/XmrgResource.java index 197ae8667a..b4e036a528 100644 --- a/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/XmrgResource.java +++ b/cave/com.raytheon.viz.mpe.ui/src/com/raytheon/viz/mpe/ui/rsc/XmrgResource.java @@ -94,6 +94,7 @@ import com.vividsolutions.jts.geom.GeometryFactory; * ------------ ---------- ----------- -------------------------- * Oct 23, 2008 randerso Initial creation * Sep 5, 2012 15079 snaples Updated interrogate method to handle values without rounding errors. + * Jan 7, 2013 15483 wkwock Fix the "Radar coverage field" error * * * @author randerso @@ -786,8 +787,16 @@ public class XmrgResource extends break; case Index: + List radars= MPEDataManager.getInstance().getRadars(); + for (int k=dmPref.getEntries().size();k * * @author snaples @@ -277,9 +278,8 @@ public class RegenHrFlds { /* Read Gage Data and store in structure */ /*-------------------------------------------------------------------------*/ Calendar cl = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - cl.setTime(datetime); + cl.setTimeInMillis(datetime.getTime()); int hh = cl.get(Calendar.HOUR_OF_DAY); - hh = hour_slot; String hour = "" + hh; if (hh < 10) { hour = "0" + hh; diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/MetarPrecipDataContainer.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/MetarPrecipDataContainer.java index 4cd3eed427..de3c620d65 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/MetarPrecipDataContainer.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/util/MetarPrecipDataContainer.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Collections; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -53,6 +52,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 19, 2011 bsteffen Initial creation + * Jan 10, 2013 snaples updated getBasePrecipData to use correct data for 1 hour precip. * * * @@ -126,15 +126,15 @@ public class MetarPrecipDataContainer { private static final long SIX_HOUR = 6 * ONE_HOUR; - private int duration; + private final int duration; private Map rcMap = null; - private Map> cache3 = new HashMap>(); + private final Map> cache3 = new HashMap>(); - private Map> cache6 = new HashMap>(); + private final Map> cache6 = new HashMap>(); - private Map> baseStations = new HashMap>(); + private final Map> baseStations = new HashMap>(); public MetarPrecipDataContainer(int duration, Map rcMap) { @@ -148,15 +148,19 @@ public class MetarPrecipDataContainer { if (duration == 1) { PointDataContainer pdc = requestPointData(rcMap, validTime, 1, P1_KEY); + Map precipMap1 = null; if (pdc != null) { - Map precipMap1 = createPrecipData(pdc, + precipMap1 = createPrecipData(pdc, validTime - ONE_HOUR, validTime, P1_KEY); - Map precipMap1old = createPrecipData(pdc, + if (precipMap1 == null) { + precipMap1 = createPrecipData(pdc, validTime - ONE_HOUR + FIFTEEN_MIN, validTime - FIFTEEN_MIN, P1_KEY); + } // Data frame 15 minutes ago is better then data now for some // reason - precipMap = combine(precipMap1old, precipMap1); + precipMap = precipMap1; + } } else if (duration == 3) { precipMap = getRawPrecipData3(validTime); diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java index 2e01d6d1dd..4a23cdd9c7 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmDisplayWindow.java @@ -61,6 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Feb 03, 2012 14317 mhuang Make alarm display window wider * Sep 6, 2012 13365 rferrel Accumulate and Display fix. * Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow. Added DO_NOT_BLOCK. + * Dec 31, 2012 15651 mgamazaychikov Added an argument to re-factored PrintDisplay.print * * * @@ -198,7 +199,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog { } PrintDisplay.print(lines.toString(), text.getFont() - .getFontData()[0], UFStatus + .getFontData()[0], -1, UFStatus .getHandler(AlarmDisplayWindow.class)); } }); @@ -207,7 +208,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog { @Override public void widgetSelected(SelectionEvent event) { PrintDisplay.print(text.getText(), - text.getFont().getFontData()[0], + text.getFont().getFontData()[0], -1, UFStatus.getHandler(AlarmDisplayWindow.class)); } }); diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java index 20d9af7a96..007664fa7b 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java @@ -307,6 +307,8 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox; * 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method * 13Dec2012 1353 rferrel Change to make edit cancel message not * dispaly the red had kill job message. + * 31Dec2012 15651 M.Gamazaychikov Added an argument to re-factored PrintDisplay.print + * 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method. * * * @author lvenable @@ -3538,7 +3540,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (textEditor.getEditable() == false) { return; } - if (event.keyCode == SWT.DEL || event.character == SWT.BS + if (event.keyCode == SWT.DEL || event.keyCode == SWT.BS || event.keyCode == SWT.SHIFT) { // Do nothing... // We need to capture the Delete, Backspace and Shift @@ -4190,7 +4192,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private void printAllText() { FontData fontData = textEditor.getFont().getFontData()[0]; - PrintDisplay.print(textEditor.getText(), fontData, statusHandler); + PrintDisplay.print(textEditor.getText(), fontData, charWrapCol, statusHandler); } /** @@ -4213,7 +4215,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String tmpText = textEditor.getText(); Point point = textEditor.getSelection(); FontData fontData = textEditor.getFont().getFontData()[0]; - PrintDisplay.print(textEditor.getSelectionText(), fontData, + PrintDisplay.print(textEditor.getSelectionText(), fontData, charWrapCol, statusHandler); textEditor.setText(tmpText); textEditor.setSelection(point); @@ -5142,6 +5144,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int rangeEnd = rangeStart + ranges[i + 1]; if (event.start > rangeStart && event.start < rangeEnd) { event.doit = false; + /* + * DR15704 - this needs to be set so the rewrap is not called + * when locked text gets editted. + */ + userKeyPressed = false; break; } } @@ -5150,6 +5157,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int ranges[] = textEditor.getRanges(event.start, length); if (inEditMode && ranges != null && ranges.length != 0) { event.doit = false; + /* + * DR15704 - this needs to be set so the rewrap is not called + * when locked text gets editted. + */ + userKeyPressed = false; } } } catch (IllegalArgumentException e) { 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 bb83845693..39070fa383 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 @@ -43,6 +43,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * Sep 15, 2011 10557 rferrel Initial creation * Jul 17, 2012 14274 rferrel Now use eclipse Printer instead of awt. * Text is printed using same font as the GUI + * Dec 31, 2012 15651 mgamazaychikov Added setFont method to scale font for printing * * * @@ -52,7 +53,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority; public class PrintDisplay { public static void print(final String printedText, final FontData fontData, - IUFStatusHandler statusHandler) { + int aLineWidth, IUFStatusHandler statusHandler) { PrinterData data = Printer.getDefaultPrinterData(); if (data == null) { statusHandler.handle(Priority.PROBLEM, @@ -66,9 +67,11 @@ public class PrintDisplay { } final Printer printer = new Printer(data); - PrintDisplay pd = new PrintDisplay(printer, printedText, fontData); + PrintDisplay pd = new PrintDisplay(printer, printedText, fontData, aLineWidth); pd.printJob(); } + + private int lineWidth; private Printer printer; @@ -102,10 +105,16 @@ public class PrintDisplay { int end; - private PrintDisplay(Printer printer, String text, FontData fontData) { + private PrintDisplay(Printer printer, String text, FontData fontData, int aWidth) { this.printer = printer; this.textToPrint = text; this.printerFontData = fontData; + if (aWidth == -1) { + this.lineWidth = 69; + } + else { + this.lineWidth = aWidth; + } } private void printJob() { @@ -118,11 +127,43 @@ public class PrintDisplay { thread.start(); } - private void printIt() { + protected void setFont() { + /* + * get the original font size and set the gc font. + */ + float origFontSize = printerFontData.getHeight(); + Font printerFont = new Font(printer, printerFontData); + gc.setFont(printerFont); + + /* + * Create a buffer for computing line width in pixels. + */ + StringBuilder aBuffer = new StringBuilder(lineWidth); + for (int i = 0; i < lineWidth; i++) { + aBuffer.append(' '); + } + /* + * Get the line width in pixels and the device's width in pixels + */ + 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; + /* + * Set the printerFont Data font to the scaled font + */ + printerFontData.setHeight((int)(fontSize)); + gc.setFont(new Font(printer, printerFontData)); + } + + private void printIt() { if (printer.startJob("Text")) { // the string is the job name - shows up // in the printer's job list Rectangle clientArea = printer.getClientArea(); - Rectangle trim = printer.computeTrim(0, 0, 0, 0); + Rectangle trim = printer.computeTrim(0, 0, 0, 0); Point dpi = printer.getDPI(); // one inch from left side of paper @@ -145,12 +186,10 @@ public class PrintDisplay { * foreground color. */ gc = new GC(printer); - Font printerFont = new Font(printer, printerFontData); + setFont(); Color printerForegroundColor = new Color(printer, new RGB(0, 0, 0)); Color printerBackgroundColor = new Color(printer, new RGB(255, 255, 255)); - - gc.setFont(printerFont); gc.setForeground(printerForegroundColor); gc.setBackground(printerBackgroundColor); tabWidth = gc.stringExtent(tabs).x; @@ -161,7 +200,7 @@ public class PrintDisplay { printer.endJob(); // Cleanup graphics resources used in printing - printerFont.dispose(); + printerForegroundColor.dispose(); printerBackgroundColor.dispose(); gc.dispose(); diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/cmenu/ColorEditDialogAction.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/cmenu/ColorEditDialogAction.java index bfec2af0b4..e4e5411f89 100644 --- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/cmenu/ColorEditDialogAction.java +++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/cmenu/ColorEditDialogAction.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -28,17 +28,18 @@ import com.raytheon.viz.ui.dialogs.colordialog.ColorEditDialog; import com.raytheon.viz.ui.editor.IMultiPaneEditor; /** - * + * * Allows a resource's color to be changed - * + * *
  * SOFTWARE HISTORY
  * Date         Ticket#     Engineer    Description
  * ------------ ----------  ----------- --------------------------
  * Nov 13, 2006             chammack    Initial Creation.
- * 
+ * Jan 9, 2013  15648       ryu         Fix NPE on closing color editor.
+ *
  * 
- * + * * @author chammack * @version 1 */ @@ -54,7 +55,7 @@ public class ColorEditDialogAction extends AbstractRightClickAction { /* * (non-Javadoc) - * + * * @see org.eclipse.jface.action.Action#run() */ @Override @@ -76,7 +77,8 @@ public class ColorEditDialogAction extends AbstractRightClickAction { .getCurrentWindow().getShell(), container, getSelectedRsc(), false, false); - container.refresh(); + if (container != null) + container.refresh(); } } diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditComposite.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditComposite.java index 4de6de8d50..6425b3e379 100644 --- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditComposite.java +++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditComposite.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -33,17 +33,20 @@ import com.raytheon.uf.common.colormap.ColorMap; /** * Composite for colormap editing - * + * *
- * 
+ *
  * SOFTWARE HISTORY
- * 
+ *
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Nov 18, 2010            mschenke     Initial creation
- * 
+ * Jan 10, 2013 15648      ryu         Editing GFE discrete colormap: a check button
+ *                                     is added and duplicate entries in the colormap
+ *                                     are removed when it is selected.
+ *
  * 
- * + * * @author mschenke * @version 1.0 */ @@ -76,6 +79,11 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, */ private Button hsbRdo; + /** + * GFE discrete check button. + */ + private Button gfeDiscreteCheck; + /** * Title for the upper color wheel. */ @@ -125,6 +133,9 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, true)); // lowerColorWheel.setColor(colorArray.get(colorArray.size() - 1)); lowerColorWheel.setColor(initial); + + // Create the GFE discrete check button. + createGFEDiscreteButton(); } /** @@ -168,6 +179,32 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, }); } + /** + * Create the GFE discrete check button. + */ + private void createGFEDiscreteButton() { + // Create a group to contain the RGB and HSB radio buttons. + Group discreteGroup = new Group(getParent(), SWT.NONE); + + RowLayout groupRowLayout = new RowLayout(); + groupRowLayout.marginLeft = 10; + groupRowLayout.marginRight = 10; + groupRowLayout.spacing = 10; + discreteGroup.setLayout(groupRowLayout); + discreteGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + // Create the discrete check button. + gfeDiscreteCheck = new Button(discreteGroup, SWT.CHECK); + gfeDiscreteCheck.setText("GFE Discrete"); + gfeDiscreteCheck.setSelection(false); + gfeDiscreteCheck.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent event) { + updateColorMap(); + } + }); + } + /** * Change the upper and lower color wheel objects to display either RGB or * HSB. @@ -185,7 +222,7 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, /** * Fill the area between the sliders in the color bar using the color data * provided. - * + * * @param colorData * The color data object containing the RGB color and the alpha * value. @@ -200,7 +237,7 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, * Set the color where the top or bottom slider is pointing. The color wheel * title is used to determine if the color is from the upper color wheel or * the lower color wheel. - * + * * @param colorData * The color data object containing the RGB color and the alpha * value. @@ -221,7 +258,7 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, * A callback method used by the ColorBar class. This method is called to * update the upper or lower color wheel when the mouse is clicked in the * color bar and moved around. - * + * * @param colorData * The color data object containing the RGB color and the alpha * value. @@ -242,6 +279,9 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, */ public void updateColorMap() { colorMap = ColorUtil.buildColorMap(colorBar.getCurrentColors(), null); + if (isGFEDiscrete()) { + colorMap.removeDuplicates(); + } callback.updateColorMap(colorMap); } @@ -277,4 +317,8 @@ public class ColorEditComposite extends Composite implements IColorWheelAction, return colorMap; } + public boolean isGFEDiscrete() { + return gfeDiscreteCheck.getSelection(); + } + } diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditDialog.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditDialog.java index 4775079360..2bc8c059ab 100644 --- a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditDialog.java +++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorEditDialog.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -69,7 +69,7 @@ import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener; /** * This is the main dialog for the Color Edit Dialog. - * + * *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
@@ -77,9 +77,12 @@ import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener;
  *                         lvenable    Initial Creation.
  * Jul 24, 2007            njensen     Hooked into backend.
  * Oct 17, 2012 1229       rferrel     Changes for non-blocking SaveColorMapDialog.
- * 
+ * Jan 10, 2013 15648      ryu         Editing GFE discrete colormap: a check button
+ *                                     is added and duplicate entries in the colormap
+ *                                     are removed when it is selected.
+ *
  * 
- * + * * @author lvenable * @version 1.0 */ @@ -172,7 +175,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /** * Constructor. - * + * * @param parent * Parent shell. */ @@ -606,7 +609,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.uf.viz.core.IVizEditorChangedListener#editorChanged(com. * raytheon.uf.viz.core.IDisplayPaneContainer) @@ -626,7 +629,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @seecom.raytheon.uf.viz.core.IRenderableDisplayChangedListener# * renderableDisplayChanged(com.raytheon.uf.viz.core.IDisplayPane, * com.raytheon.uf.viz.core.drawables.IRenderableDisplay, @@ -647,7 +650,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener#notifyRemove * (com.raytheon.uf.viz.core.drawables.ResourcePair) @@ -667,7 +670,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.uf.viz.core.rsc.ResourceList.AddListener#notifyAdd(com.raytheon * .uf.viz.core.drawables.ResourcePair) @@ -684,7 +687,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.uf.viz.core.rsc.IResourceDataChanged#resourceChanged(com * .raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType, @@ -713,7 +716,7 @@ public class ColorEditDialog extends CaveSWTDialog implements } /** - * + * * @param display */ private void removeListeners(IRenderableDisplay display) { @@ -723,7 +726,7 @@ public class ColorEditDialog extends CaveSWTDialog implements } /** - * + * * @param rl */ private void removeListeners(ResourceList rl) { @@ -759,7 +762,7 @@ public class ColorEditDialog extends CaveSWTDialog implements } /** - * + * * @param display */ private void addListeners(IRenderableDisplay display) { @@ -769,7 +772,7 @@ public class ColorEditDialog extends CaveSWTDialog implements } /** - * + * * @param rl */ private void addListeners(ResourceList rl) { @@ -793,7 +796,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.ui.editor.ISelectedPaneChangedListener#selectedPaneChanged * (java.lang.String, com.raytheon.uf.viz.core.IDisplayPane) @@ -836,10 +839,18 @@ public class ColorEditDialog extends CaveSWTDialog implements } } + private ColorMap getColorMap() { + ColorMap cm = (ColorMap) cap.getColorMapParameters().getColorMap(); + if (colorEditComp.isGFEDiscrete()) { + cm.removeDuplicates(); + } + return cm; + } + private void officeSaveAs() { if (mustCreate(officeSaveAsDialog)) { - officeSaveAsDialog = new SaveColorMapDialog(shell, (ColorMap) cap - .getColorMapParameters().getColorMap(), true, + officeSaveAsDialog = new SaveColorMapDialog(shell, + getColorMap(), true, currentColormapName); officeSaveAsDialog.setCloseCallback(new ICloseCallback() { @@ -859,8 +870,8 @@ public class ColorEditDialog extends CaveSWTDialog implements private void saveAs() { if (mustCreate(saveAsDialog)) { - saveAsDialog = new SaveColorMapDialog(shell, (ColorMap) cap - .getColorMapParameters().getColorMap(), false, + saveAsDialog = new SaveColorMapDialog(shell, + getColorMap(), false, currentColormapName); saveAsDialog.setCloseCallback(new ICloseCallback() { @@ -879,7 +890,7 @@ public class ColorEditDialog extends CaveSWTDialog implements } private void save() { - ColorMap cm = (ColorMap) cap.getColorMapParameters().getColorMap(); + ColorMap cm = getColorMap(); try { ColorUtil.saveColorMapLocal(cm, currentColormapName, false); } catch (VizException e1) { @@ -914,7 +925,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.ui.dialogs.colordialog.IColorBarAction#updateColor(com * .raytheon.viz.ui.dialogs.colordialog.ColorData, boolean) @@ -926,7 +937,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.ui.dialogs.colordialog.IColorWheelAction#setColor(com * .raytheon.viz.ui.dialogs.colordialog.ColorData, java.lang.String) @@ -938,7 +949,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see * com.raytheon.viz.ui.dialogs.colordialog.IColorWheelAction#fillColor(com * .raytheon.viz.ui.dialogs.colordialog.ColorData) @@ -950,7 +961,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback# * colorMapUpdated(com.raytheon.uf.common.colormap.ColorMap) */ @@ -987,7 +998,7 @@ public class ColorEditDialog extends CaveSWTDialog implements /* * (non-Javadoc) - * + * * @see com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback# * getColorMapParameters() */ 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 b1a4f10b66..9c21bb76bd 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 @@ -127,6 +127,8 @@ import com.vividsolutions.jts.geom.Polygon; * but lock immediate cause, implemented in individual template. * Nov 02, 2012 DR 15455 Qinglu Lin Added warngenLayer.setWarningAction() in resetPressed() * and in updateListSelected(). + * Dec 20, 2012 DR 15537 Qinglu Lin Changed the assigned value to trackEditable from false + * to true in boxSelected(). * * * @@ -1246,7 +1248,7 @@ public class WarngenDialog extends CaveSWTDialog implements */ private void boxSelected() { boxEditable = !polygonLocked; - trackEditable = false; + trackEditable = true; warngenLayer.getStormTrackState().editable = trackEditable; warngenLayer.setBoxEditable(boxEditable); warngenLayer.issueRefresh(); diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java index 788a54976a..54c9e5d715 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/template/TemplateRunner.java @@ -131,7 +131,9 @@ import com.vividsolutions.jts.io.WKTReader; * Nov 30, 2012 15571 Qinglu Lin For NEW, assigned simulatedTime to TMLtime; For COR, used stormLocs * in oldWarn. * Dec 17, 2012 15571 Qinglu Lin For hydro products, resolved issue caused by calling wkt.read(loc) - * while loc is null. + * while loc is null. + * Jan 8, 2013 15664 Qinglu Lin Appended selectedAction to handler.handle()'s argument list. + * * * * @author njensen @@ -790,7 +792,7 @@ public class TemplateRunner { String text = script.toString(); WarningTextHandler handler = WarningTextHandlerFactory.getHandler( selectedAction, text, config.getAutoLockText()); - String handledText = handler.handle(text, areas, cancelareas); + String handledText = handler.handle(text, areas, cancelareas, selectedAction); return handledText; } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java index 174fb80d0a..8379232b92 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/AbstractLockingBehavior.java @@ -29,6 +29,11 @@ import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; +import com.raytheon.uf.common.dataplugin.warning.util.FileUtil; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.viz.texteditor.util.VtecObject; import com.raytheon.viz.texteditor.util.VtecUtil; import com.raytheon.viz.warngen.gis.AffectedAreas; @@ -44,6 +49,10 @@ import com.raytheon.viz.warngen.gis.AffectedAreas; * ------------ ---------- ----------- -------------------------- * Sep 24, 2012 15332 jsanchez Initial creation * Oct 18, 2012 15332 jsanchez Updated the find method. + * Jan 8, 2013 15664 Qinglu Lin Appended WarningAction to lock()'s parameter list; + * moved the following methods from InitialLockingBehavior to this class: + * bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn(); + * updated body(), header(), and secondBullet(); * * * @@ -81,6 +90,13 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns { + "|(TORNADO WARNING)|(MARINE WEATHER STATEMENT)|(SHORT TERM FORECAST)" + "|(SPECIAL WEATHER STATEMENT)|(SPECIAL MARINE WARNING)"; + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(AbstractLockingBehavior.class); + + private static Pattern immediateCausePtrn = null; + + protected WarningAction action = null; + /** * Locks the particular strings in the texts based on common patterns and * the affected areas. @@ -91,8 +107,9 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns { * @return */ public String lock(String text, AffectedAreas[] affectedAreas, - AffectedAreas[] canceledAreas) { + AffectedAreas[] canceledAreas, WarningAction action) { this.text = text; + this.action = action; intialize(affectedAreas, canceledAreas); ugc(); htec(); @@ -110,10 +127,166 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns { return this.text; } + protected void body() { + header(); + firstBullet(); + secondBullet(); + } + /** - * Calls the sub classes implementation of the body method. + * Helper method to determine the index of each bullet. + * + * @return */ - abstract protected void body(); + private Integer[] bulletIndices() { + List bulletIndices = new ArrayList(); + + int index = text.indexOf("* "); + while (index >= 0) { + bulletIndices.add(index); + index = text.indexOf("* ", index + 2); + } + + return bulletIndices.toArray(new Integer[bulletIndices.size()]); + } + + /** + * Locks the header before the first bullet. + */ + private void header() { + // LOCK_END should not be found at the beginning since the previous line + // should be blank. + String h = "^((THE NATIONAL WEATHER SERVICE IN .{1,} HAS (ISSUED A|EXTENDED THE))" + + newline + ")$"; + Pattern header = Pattern.compile(h, Pattern.MULTILINE); + find(header.matcher(text)); + } + + /** + * Locks the affected area names in the first bullet, the immediate cause. + * + * @param start + * @param end + */ + private void firstBullet() { + Integer[] bulletIndices = bulletIndices(); + + // Short term forecasts don't follow normal bullets? + if (bulletIndices.length < 2) { + return; + } + int start = bulletIndices[0]; + int end = bulletIndices[1]; + + if (immediateCausePtrn == null) { + immediateCausePtrn = getImmediateCausesPtrn(); + } + + String firstBulletText = text.substring(start, end); + + // According to the original WarningTextHandler, marine zone names + // should not be locked. For some reason, this differs from followups as + // stated in DR 15110. Need verification from NWS. This is a variance? + if (!isMarineProduct()) { + Matcher m = null; + for (String line : firstBulletText.split("\\n")) { + + if (immediateCausePtrn != null) { + // immediate cause + m = immediateCausePtrn.matcher(line); + if (m.find()) { + String i = line.replace(line, LOCK_START + line + + LOCK_END); + firstBulletText = firstBulletText.replace(line, i); + continue; + } + } + + for (AffectedAreas affectedArea : affectedAreas) { + String name = affectedArea.getName(); + String areaNotation = affectedArea.getAreaNotation(); + String parentRegion = affectedArea.getParentRegion(); + if (name != null && name.trim().length() != 0 + && line.contains(name.toUpperCase())) { + name = name.toUpperCase(); + String t = line; + if (!hasBeenLocked(line, name)) { + t = t.replace(name, LOCK_START + name + LOCK_END); + } + + if (areaNotation != null + && areaNotation.trim().length() != 0) { + areaNotation = areaNotation.toUpperCase(); + if (!hasBeenLocked(line, areaNotation.toUpperCase())) { + t = t.replace(areaNotation, LOCK_START + + areaNotation + LOCK_END); + } + } + + if (parentRegion != null + && parentRegion.trim().length() != 0) { + parentRegion = parentRegion.toUpperCase(); + if (!hasBeenLocked(line, parentRegion)) { + t = t.replace(parentRegion, LOCK_START + + parentRegion + LOCK_END); + } + } + + if (validate(t)) { + firstBulletText = firstBulletText.replace(line, t); + } + break; + } + } + } + } + + firstBulletText = firstBulletText.replaceAll(firstBullet, LOCK_START + + "$0" + LOCK_END); + + this.text = text.replace(text.substring(start, end), firstBulletText); + } + + /** + * Locks the second bullet. + */ + private void secondBullet() { + // LOCK_END should not be found at the beginning since the previous line + // should be blank. + String secondBullet = + "\\* UNTIL \\d{3,4} (AM|PM) \\w{3,4}( \\w{6,9}){0,1}(\\/\\d{3,4} (AM|PM) \\w{3,4}( \\w{6,9}){0,1}\\/){0,1}" + + newline; + Pattern secondBulletPtrn = Pattern.compile(secondBullet, + Pattern.MULTILINE); + find(secondBulletPtrn.matcher(text)); + } + + /** + * Set the immediateCausePtrn with the info in immediateCause.text. + */ + private static Pattern getImmediateCausesPtrn() { + String filename = "immediateCause.txt"; + StringBuffer pattern = new StringBuffer(); + + try { + String immediateCause = FileUtil.open(filename, "base"); + pattern.append("(.*)(A DAM BREAK"); + for (String ic : immediateCause.split("\n")) { + String[] parts = ic.split("\\\\"); + pattern.append("| " + parts[1].trim()); + } + + pattern.append(")(.*)"); + return Pattern.compile(pattern.toString()); + } catch (Exception e) { + statusHandler + .handle(Priority.ERROR, + "Unable to process immediateCause.txt in the base directory", + e); + } + + return null; + } /** * Adds the affect areas into the appropriate lists. diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/FollowUpLockingBehavior.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/FollowUpLockingBehavior.java index d8ea2563d1..a2783bc14c 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/FollowUpLockingBehavior.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/FollowUpLockingBehavior.java @@ -25,6 +25,7 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.viz.warngen.gis.AffectedAreas; /** @@ -37,6 +38,7 @@ import com.raytheon.viz.warngen.gis.AffectedAreas; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 24, 2012 15322 jsanchez Initial creation + * Jan 8, 2013 15664 Qinglu Lin Updated body(). * * * @@ -49,7 +51,10 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior { */ @Override public void body() { - headlines(); + if (action != WarningAction.COR) + headlines(); + else + super.body(); } /** diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/InitialLockingBehavior.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/InitialLockingBehavior.java index 7967f89e72..0240b4e828 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/InitialLockingBehavior.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/InitialLockingBehavior.java @@ -19,17 +19,6 @@ **/ package com.raytheon.viz.warngen.text; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.raytheon.uf.common.dataplugin.warning.util.FileUtil; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; -import com.raytheon.viz.warngen.gis.AffectedAreas; - /** * Locks text patterns on initial or new warning. * @@ -40,6 +29,9 @@ import com.raytheon.viz.warngen.gis.AffectedAreas; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 24, 2012 15322 jsanchez Initial creation + * Jan 8, 2013 15664 Qinglu Lin Removed the following methods (and moved them to AbstractLockingBehavior): + * body(), bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn(); + * * * @@ -47,173 +39,4 @@ import com.raytheon.viz.warngen.gis.AffectedAreas; * @version 1.0 */ public class InitialLockingBehavior extends AbstractLockingBehavior { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(InitialLockingBehavior.class); - - private static Pattern immediateCausePtrn = null; - - /** - * Locks the appropriate text of the body of an initial warning. - */ - @Override - public void body() { - header(); - firstBullet(); - secondBullet(); - } - - /** - * Helper method to determine the index of each bullet. - * - * @return - */ - private Integer[] bulletIndices() { - List bulletIndices = new ArrayList(); - - int index = text.indexOf("* "); - while (index >= 0) { - bulletIndices.add(index); - index = text.indexOf("* ", index + 2); - } - - return bulletIndices.toArray(new Integer[bulletIndices.size()]); - } - - /** - * Locks the header before the first bullet. - */ - private void header() { - // LOCK_END should not be found at the beginning since the previous line - // should be blank. - String h = "^((THE NATIONAL WEATHER SERVICE IN .{1,} HAS ISSUED A)" - + newline + ")$"; - Pattern header = Pattern.compile(h, Pattern.MULTILINE); - find(header.matcher(text)); - } - - /** - * Locks the affected area names in the first bullet, the immediate cause. - * - * @param start - * @param end - */ - private void firstBullet() { - Integer[] bulletIndices = bulletIndices(); - - // Short term forecasts don't follow normal bullets? - if (bulletIndices.length < 2) { - return; - } - int start = bulletIndices[0]; - int end = bulletIndices[1]; - - if (immediateCausePtrn == null) { - immediateCausePtrn = getImmediateCausesPtrn(); - } - - String firstBulletText = text.substring(start, end); - - // According to the original WarningTextHandler, marine zone names - // should not be locked. For some reason, this differs from followups as - // stated in DR 15110. Need verification from NWS. This is a variance? - if (!isMarineProduct()) { - Matcher m = null; - for (String line : firstBulletText.split("\\n")) { - - if (immediateCausePtrn != null) { - // immediate cause - m = immediateCausePtrn.matcher(line); - if (m.find()) { - String i = line.replace(line, LOCK_START + line - + LOCK_END); - firstBulletText = firstBulletText.replace(line, i); - continue; - } - } - - for (AffectedAreas affectedArea : affectedAreas) { - String name = affectedArea.getName(); - String areaNotation = affectedArea.getAreaNotation(); - String parentRegion = affectedArea.getParentRegion(); - if (name != null && name.trim().length() != 0 - && line.contains(name.toUpperCase())) { - name = name.toUpperCase(); - String t = line; - if (!hasBeenLocked(line, name)) { - t = t.replace(name, LOCK_START + name + LOCK_END); - } - - if (areaNotation != null - && areaNotation.trim().length() != 0) { - areaNotation = areaNotation.toUpperCase(); - if (!hasBeenLocked(line, areaNotation.toUpperCase())) { - t = t.replace(areaNotation, LOCK_START - + areaNotation + LOCK_END); - } - } - - if (parentRegion != null - && parentRegion.trim().length() != 0) { - parentRegion = parentRegion.toUpperCase(); - if (!hasBeenLocked(line, parentRegion)) { - t = t.replace(parentRegion, LOCK_START - + parentRegion + LOCK_END); - } - } - - if (validate(t)) { - firstBulletText = firstBulletText.replace(line, t); - } - break; - } - } - } - } - - firstBulletText = firstBulletText.replaceAll(firstBullet, LOCK_START - + "$0" + LOCK_END); - - this.text = text.replace(text.substring(start, end), firstBulletText); - } - - /** - * Locks the second bullet. - */ - private void secondBullet() { - // LOCK_END should not be found at the beginning since the previous line - // should be blank. - String secondBullet = "^(\\* UNTIL \\d{3,4} (AM|PM) \\w{3,4}" + newline - + ")"; - Pattern secondBulletPtrn = Pattern.compile(secondBullet, - Pattern.MULTILINE); - find(secondBulletPtrn.matcher(text)); - } - - /** - * Set the immediateCausePtrn with the info in immediateCause.text. - */ - private static Pattern getImmediateCausesPtrn() { - String filename = "immediateCause.txt"; - StringBuffer pattern = new StringBuffer(); - - try { - String immediateCause = FileUtil.open(filename, "base"); - pattern.append("(.*)(A DAM BREAK"); - for (String ic : immediateCause.split("\n")) { - String[] parts = ic.split("\\\\"); - pattern.append("| " + parts[1].trim()); - } - - pattern.append(")(.*)"); - return Pattern.compile(pattern.toString()); - } catch (Exception e) { - statusHandler - .handle(Priority.ERROR, - "Unable to process immediateCause.txt in the base directory", - e); - } - - return null; - } - } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/WarningTextHandler.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/WarningTextHandler.java index 78c2193821..cf8ae197dd 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/WarningTextHandler.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/text/WarningTextHandler.java @@ -22,6 +22,7 @@ package com.raytheon.viz.warngen.text; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.viz.warngen.gis.AffectedAreas; /** @@ -34,6 +35,7 @@ import com.raytheon.viz.warngen.gis.AffectedAreas; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 24, 2012 15322 jsanchez Initial creation + * Jan 8, 2013 15664 Qinglu Lin Appended WarningAction to handle()'s parameter list, etc. * * * @@ -47,7 +49,7 @@ public class WarningTextHandler { private IModifyTextBehavior modifyTextBehavior; public String handle(String text, AffectedAreas[] affectedAreas, - AffectedAreas[] canceledAreas) { + AffectedAreas[] canceledAreas, WarningAction action) { long t0 = System.currentTimeMillis(); text = text.toUpperCase(); @@ -58,7 +60,7 @@ public class WarningTextHandler { } if (lockingBehavior != null) { - text = lockingBehavior.lock(text, affectedAreas, canceledAreas); + text = lockingBehavior.lock(text, affectedAreas, canceledAreas, action); System.out.println("Locked text..."); } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FipsUtil.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FipsUtil.java index eb6643fbde..9f608b8cfa 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FipsUtil.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/FipsUtil.java @@ -48,6 +48,8 @@ import com.raytheon.viz.warnings.DateUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 6, 2008 bwoodle Initial creation + * Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem + * with generated list of counties. * * * @@ -80,9 +82,6 @@ public class FipsUtil { /** Catch the Date portion of the UGC Header */ private static final String DATEPATTERN = "\\-([0-9]{6}\\-)"; - /** Parses a single county from a UGC Header, can be repeated */ - private static final String SINGLECOUNTY = "(?:([A-Z]{3}[0-9]{3})\\-)|(?:([0-9]{3})\\-)"; - /** Another RE to Catch the Date portion of the UGC Header */ private static final String DATESTR = "[0-9]{6}\\-"; @@ -324,8 +323,11 @@ public class FipsUtil { } } + /* + * DR15599 - use simplifyHeader to get the correct rval + */ if (difference.size() > 0) { - rval = getUgc(difference); + rval = simplifyHeader(getUgc(difference)); } rval = rval + dateStr; return rval; @@ -353,15 +355,53 @@ public class FipsUtil { matchStr += "-"; } - String currentState = ""; - pattern = Pattern.compile(SINGLECOUNTY); - matcher = pattern.matcher(matchStr); - while (matcher.find()) { - if (matcher.group(1) != null && matcher.group(1).length() == 6) { - currentState = matcher.group(1).substring(0, 3); - rval.add(matcher.group(1)); - } else { - rval.add(currentState + matcher.group(2)); + /* + * DR15599 - completely re-did how rval is calculated. + */ + String[] lines = matchStr.split("[\n]"); + matchStr = ""; + for (String line : lines) { + matchStr += line; + } + + String[] ranges = matchStr.split("[-]"); + List curList = null; + String curState = null; + for (String range : ranges) { + if (Character.isLetter(range.charAt(0))) { + /* + * range starts with a character - get the new + * state or marine zone name + */ + if (curState != null) { + for (String zone: curList) { + rval.add(curState+zone); + } + } + curState = range.substring(0, 3); + curList = new ArrayList(); + range = range.substring(3); + } + if (curList != null) { + if (range.contains(">")) { + /* + * get the full range of zones/counties + */ + String left = range.substring(0, 3); + String right = range.substring(4); + int start = Integer.valueOf(left); + int end = Integer.valueOf(right); + for (int val = start; val <= end; ++val) { + curList.add(FIPS_FORMAT.format(val)); + } + } else { + curList.add(range); + } + } + } + if (curState != null) { + for (String zone: curList) { + rval.add(curState+zone); } } return rval; diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/VM_global_library.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/VM_global_library.vm index c5346631de..1ada94dece 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/VM_global_library.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/VM_global_library.vm @@ -4,6 +4,7 @@ ##### Qinglu Lin 07-31-2012 DR 15217. Use roundAndPad for movement direction in DEG. ##### Qinglu Lin 08-13-2012 DR 14493. Use corToNewMarker and corEventtime. ##### D. Friedman 11-09-2012 DR 15430. Rework included watches. +##### QINGLU LIN 12-27-2012 DR 15594. Added $lock to headlineLocList. #################################################################################################### Mile Marker Test Code macro "mmarkers" use (called out of VM_global_library.vm): @@ -419,7 +420,7 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound ## useCentralxxx = boolean to use the word CENTRAL in the County or State phrase ## useExtremexxx = boolean to use the word EXTREME in the county of State phrase ################################################################## -#macro(headlineLocList $areas $useCentralCounty $useExtremeCounty $useCentralState $useExtremeState) +#macro(headlineLocList $areas $useCentralCounty $useExtremeCounty $useCentralState $useExtremeState $lock) #set($countyCount = 0) #set($countyCounter = 0) #set($itemCount = 0) @@ -490,30 +491,58 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound #if(${prevPartOfCounty.size()} > 0) #areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${prevCounty}## +#else +${prevCounty}## +#end #if(${prevCountyType} != ${area.areaNotation} || ${useStates} == true) +#if(${lock} == true) ${prevCountyType}## +#else + ${prevCountyType}## +#end #end #if(${useStates} == true) +#if(${lock} == true) IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#else + IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#end #end #else AND ## #if(${prevPartOfCounty.size()} > 0) #areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${prevCounty}## +#else +${prevCounty}## +#end #if(${prevCountyType} != ${area.areaNotation} || ${useStates} == true) #if(${countyCount} > 1) #if(${prevCountiesType}) +#if(${lock} == true) ${prevCountiesType}## +#else + ${prevCountiesType}## +#end #end #elseif(${prevCountyType}) +#if(${lock} == true) ${prevCountyType}## +#else + ${prevCountyType}## +#end #end #end #if(${useStates} == true) +#if(${lock} == true) IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#else + IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#end #end #end #set($countyCount = 1) @@ -526,34 +555,70 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound #if(${prevPartOfCounty.size()} > 0) #areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${prevCounty}## +#else +${prevCounty}## +#end #if(${prevCountyType} != ${area.areaNotation} || (${prevCountyType} != ${area.areaNotation} || ((${prevState} != ${area.parentRegion} || ${prevPartOfState} != ${partOfState}) && ${useStates} == true))) #if(${countyCount} > 1) #if(${prevCountiesType}) +#if(${lock} == true) ${prevCountiesType}## +#else + ${prevCountiesType}## +#end #end #elseif(${prevCountyType}) +#if(${lock} == true) ${prevCountyType}## +#else + ${prevCountyType}## +#end #end #end #if((${prevCountyType} != ${area.areaNotation} || ((${prevState} != ${area.parentRegion} || ${prevPartOfState} != ${partOfState}) && ${useStates} == true))) +#if(${lock} == true) IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#else + IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#end #end AND ## #if(${area.partOfArea}) #areaFormat(${area.partOfArea} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${area.name}## +#else +${area.name}## +#end #if(${countyCount} >= 1) #if(${area.areasNotation}) +#if(${lock} == true) ${area.areasNotation}## +#else + ${area.areasNotation}## +#end #end #elseif(${area.areaNotation}) +#if(${lock} == true) ${area.areaNotation}## +#else + ${area.areaNotation}## #end +#end +#if(${lock} == true) ## +#else +## +#end #if(${useStates} == true) +#if(${lock} == true) IN #areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}## +#else + IN #areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}## +#end #end #else #if(${countyCounter} > 1) @@ -565,9 +630,17 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound #if(${area.partOfArea}) #areaFormat(${area.partOfArea} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${area.name} ${area.areaNotation}## +#else +${area.name} ${area.areaNotation}## +#end #if(${useStates} == true) +#if(${lock} == true) IN #areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}## +#else + IN #areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}## +#end #end #end #set($countyCount = 0) @@ -581,7 +654,11 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound #if(${prevPartOfCounty.size()} > 0) #areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${prevCounty}## +#else +${prevCounty}## +#end #end #set($countyCount= $countyCount + 1) #end @@ -613,26 +690,50 @@ ${closestPoint.roundedDistance} ${units} #direction(${closestPoint.oppositeRound #if(${prevPartOfCounty}) #areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ## #end +#if(${lock} == true) ${prevCounty} ${prevCountyType}## +#else +${prevCounty} ${prevCountyType}## +#end #if(${useStates} == true) +#if(${lock} == true) IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#else + IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}## +#end #end #end #if (${indepCityCount} == ${numIndepCity}) #if (${indepCityCount} == 1) ### COUNTIES + 1 INDEPENDENT CITY #if (${numCounties} > ${numIndepCity}) +#if(${lock} == true) AND THE ${area.name}## +#else + AND THE ${area.name}## +#end ### NO COUNTIES AND ONE INDEPENDENT CITY #else +#if(${lock} == true) THE ${area.name}## +#else +THE ${area.name}## +#end #end #else ## MULTIPLE INDEPENDENT CITIES...LAST ITEM IN THE LIST +#if(${lock} == true) AND THE ${area.name}## +#else + AND THE ${area.name}## +#end #end #else +#if(${lock} == true) ...THE ${area.name}## +#else +...THE ${area.name}## +#end #end #end #end @@ -750,7 +851,7 @@ ${location.name}## ${otherLead} WILL REMAIN OVER MAINLY OPEN WATERS. #else ${otherLead} WILL REMAIN OVER MAINLY RURAL AREAS OF ## -#headlineLocList(${areas} true true true false).## +#headlineLocList(${areas} true true true false false).## ###NOW SEARCH FOR OTHER POINTS (PRESUMABLY 3s) AND LIST THEM HERE ### NEED TO CODE THIS ONCE SECTION IS ADDED #set($numOtherPoints = ${list.size($thirdTier)}) @@ -879,7 +980,7 @@ AND ${strOutput} ${ruralPhrase} WILL REMAIN OVER MAINLY OPEN WATERS. #else ## NO MAJOR POINTS FOUND. LIST RURAL AREAS -${ruralPhrase} WILL REMAIN OVER MAINLY RURAL AREAS OF #headlineLocList(${areas} true true true false).## +${ruralPhrase} WILL REMAIN OVER MAINLY RURAL AREAS OF #headlineLocList(${areas} true true true false false).## #set($numMinorPoints = ${list.size($otherCityList)}) #if(${numMinorPoints} == 1) ..INCLUDING THE COMMUNITY OF ## diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup.vm index a9ae2cfa5d..cd24581ad3 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup.vm @@ -7,6 +7,7 @@ ## Mike and Phil 1-25-2012 at CRH TIM ## Evan Bookbinder 2-24-2012 ## Phil Kurimski 2-28-2012 for OB 12.2.1-3 +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ## #if(${action} == "EXT") #set($starttime = "000000T0000Z") @@ -182,7 +183,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ## -#headlineLocList(${areas} true true true false)## +#headlineLocList(${areas} true true true false true)## ... #if(${list.contains($bullets, "recedingWater")}) @@ -207,7 +208,7 @@ EXPIRED AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone #else WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ## #end -#headlineLocList(${areas} true true true false)## +#headlineLocList(${areas} true true true false true)## ... #if(${list.contains($bullets, "recedingWater")}) @@ -228,7 +229,7 @@ THE HEAVY RAIN HAS ENDED...AND FLOODING IS NO LONGER EXPECTED TO POSE A THREAT. THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -351,7 +352,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false)## +#headlineLocList(${cancelareas} true true true false true)## ... ########### END NEW HEADLINE CODE #################### @@ -383,7 +384,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} REMAINS IN EFFECT UNTIL ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -503,7 +504,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ## -#headlineLocList(${areas} true true true false)## +#headlineLocList(${areas} true true true false true)## ... ########### END NEW HEADLINE CODE #################### @@ -535,7 +536,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} REMAINS IN EFFECT UNTIL ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup_Zones.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup_Zones.vm index 89e1616851..4e49e3e820 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup_Zones.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodAdvisoryFollowup_Zones.vm @@ -4,6 +4,7 @@ ## Created by Mike Dangelo 09-19-2011 at Alaska TIM for zones ## Edited by Mike Dangelo 01-26-2012 at CRH TIM ## Edited by Phil Kurimski 2-29-2012 +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ## #if(${action} == "EXT") #set($starttime = "000000T0000Z") @@ -451,7 +452,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -642,7 +643,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup.vm index 61a1cfe9ec..bc6e7ad5ee 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup.vm @@ -7,6 +7,7 @@ ## EDITED BY EVAN BOOKBINDER 2-24-2012 ## ## EDITED BY PHIL KURIMSKI 2-28-2012 ## ## EDITED BY MIKE REGA 5-02-2012 DR 14885 MND blank line ## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. #################################### SET SOME VARs ################################### #set ($hycType = "") #set ($floodReason = "") @@ -112,7 +113,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") @@ -120,7 +121,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end ############################ @@ -197,7 +198,7 @@ THIS IS A TEST MESSAGE.## FOR ${hycType} ## #end REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)... +#headlineLocList(${areas} true true true false true)... ################################################ ################################# diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup_Zones.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup_Zones.vm index b1db16a872..baa4ce0eb2 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup_Zones.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/arealFloodWarningFollowup_Zones.vm @@ -4,6 +4,7 @@ ## Created BY MIKE DANGELO 9-19-2011 at Alaska TIM for zones coding ## ## Edited by Phil kurimski 2-29-2012 ## Edited by Mike Rega 5-02-2012 DR 14885-MND blank line +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. #################################### SET SOME VARs ################################### #set ($hycType = "") #set ($floodReason = "") @@ -137,7 +138,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") @@ -145,7 +146,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end @@ -218,7 +219,7 @@ THIS IS A TEST MESSAGE.## FOR ${hycType} ## #end REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)... +#headlineLocList(${areas} true true true false true)... ################################################ ################################# diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/extremeWindWarningFollowup.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/extremeWindWarningFollowup.vm index ca65bb9b66..f50dd40412 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/extremeWindWarningFollowup.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/extremeWindWarningFollowup.vm @@ -3,6 +3,7 @@ ## MODIFIED EVAN BOOKBINDER 09-16-2011 OB11.0.8-8 ## Evan Bookbinder 4-25-2012 for OB 12.3.1 (corText) ## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ################################################ ## ### CREATE PHRASING DEPENDING ON WHETHER WE ISSUE EXP PRIOR TO EXPIRATION TIME OR NOT @@ -54,7 +55,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE. ## #end ...THE EXTREME WIND WARNING FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## One line explanation @@ -157,7 +158,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE. ## #end ...AN EXTREME WIND WARNING REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)... +#headlineLocList(${areas} true true true false true)... ## Storm current location description #if(${productClass}=="T") @@ -206,7 +207,7 @@ PRECAUTIONARY/PREPAREDNESS ACTIONS... #end #if(${list.contains($bullets, "cta1")}) WIDESPREAD DESTRUCTIVE WINDS OF !** **! TO !** **! MPH WILL SPREAD ACROSS ## -#headlineLocList(${areas} true true true false)...PRODUCING SWATHS OF TORNADO-LIKE DAMAGE. +#headlineLocList(${areas} true true true false true)...PRODUCING SWATHS OF TORNADO-LIKE DAMAGE. #end #if(${list.contains($bullets, "cta2")}) @@ -314,7 +315,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE EXTREME WIND WARNING FOR## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... ## One line explanation @@ -362,7 +363,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...AN EXTREME WIND WARNING REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)... +#headlineLocList(${areas} true true true false true)... #if(${productClass}=="T") @@ -462,7 +463,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE EXTREME WIND WARNING FOR## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ############# diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup.vm index 7dfb11335d..c769b1f4f6 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup.vm @@ -8,6 +8,7 @@ ## Modified by MIKE DANGELO 2-23-2012 ## Modified by EVAN BOOKBINDER 2-24-2012 ## Modified by Phil Kurimski 2-29-2012 +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. #################################### SET SOME VARs ################################### #set ($hycType = "") #set ($snowMelt = "") @@ -94,7 +95,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") @@ -102,7 +103,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end ############################ @@ -175,7 +176,7 @@ THIS IS A TEST MESSAGE.## FOR ${hycType} ## #end REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)...## +#headlineLocList(${areas} true true true false true)...## ############################################################################### ## Flash Flood Emergency per NWS 10-922 Directive goes after initial headline # diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup_Zones.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup_Zones.vm index da23fd7c73..31be6f95dc 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup_Zones.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/flashFloodWarningFollowup_Zones.vm @@ -6,6 +6,7 @@ ## done in August. ## Edited by Mike Dangelo 01-26-2012 at CRH TIM ## Edited by Phil Kurimski 2-29-2012 +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. #################################### SET SOME VARs ################################### #set ($hycType = "") #set ($snowMelt = "") @@ -92,7 +93,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") @@ -100,7 +101,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #if (${hycType} != "") ${hycType} IN ## #end -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end ############################ @@ -172,7 +173,7 @@ THIS IS A TEST MESSAGE.## FOR ${hycType} ## #end REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false)...## +#headlineLocList(${areas} true true true false true)...## ############################################################################### ## Flash Flood Emergency per NWS 10-922 Directive goes after initial headline # diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/impactSevereWeatherStatement.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/impactSevereWeatherStatement.vm index 3aac4392af..6baa30e64d 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/impactSevereWeatherStatement.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/impactSevereWeatherStatement.vm @@ -6,6 +6,7 @@ ## VERSION AWIPS II 1.1 -- 2-29-2012 OB12.2.1-4 ## ## VERSION AWIPS II 1.2 -- 4-20-2012 ## ## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ################################################################ ## ################################################################### @@ -142,12 +143,12 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} ## #if(${action}=="EXP" || ${action}=="CAN") ...THE ${eventType} WARNING FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") ...THE ${eventType} WARNING FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end ############################ @@ -360,7 +361,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #end #if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true") ...A ${eventType} WARNING REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### ##################################################################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup.vm index af817e4666..179426de76 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup.vm @@ -7,6 +7,7 @@ ## Evan Bookbinder -- SEP 16 2011 OB11.0.8-8 ## ## Phil Kurimski -- SEP 23 2011 OB11.0.8-8 ## ## Mike Rega -- MAY 03 2012 DR 14885 MND ## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ##################################################### ## #set($headline = "") @@ -210,7 +211,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -227,7 +228,7 @@ ${endwarning} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## @@ -398,7 +399,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -424,7 +425,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -587,7 +588,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -613,7 +614,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -764,7 +765,7 @@ EXPIRED AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone #else WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup_Zones.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup_Zones.vm index b850ae262a..6b5323f317 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup_Zones.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/nonConvectiveFlashFloodWarningFollowup_Zones.vm @@ -7,6 +7,7 @@ ## Evan Bookbinder -- SEP 16 2011 OB11.0.8-8 ## ## Phil Kurimski -- SEP 23 2011 OB11.0.8-8 ## ## Mike Rega -- MAY 03 2012 DR 14885 MND ## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ##################################################### ## #set($headline = "") @@ -210,7 +211,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -227,7 +228,7 @@ ${endwarning} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## @@ -393,7 +394,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -419,7 +420,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -586,7 +587,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -612,7 +613,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} THIS IS A TEST MESSAGE.## #end ...A FLASH FLOOD WARNING ${headline}REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### @@ -767,7 +768,7 @@ EXPIRED AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone #else WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ## #end -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/severeWeatherStatement.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/severeWeatherStatement.vm index da9149404a..82294739e7 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/severeWeatherStatement.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/severeWeatherStatement.vm @@ -10,6 +10,7 @@ ## BY MIKE REGA 5-3-2012 DR 14885 MND blank line ## ## BY QINGLU LIN 6-18-2012 DR 15043 use duration ## ## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ################################################################# ## ################################################################### @@ -117,12 +118,12 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} ## #if(${action}=="EXP" || ${action}=="CAN") ...THE ${eventType} WARNING FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ${expcanHLTag}... ## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE #elseif(${action}=="CANCON" || ${CORCAN}=="true") ...THE ${eventType} WARNING FOR ## -#headlineLocList(${cancelareas} true true true false) +#headlineLocList(${cancelareas} true true true false true) ${expcanHLTag}... #end ############################ @@ -335,7 +336,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #end #if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true") ...A ${eventType} WARNING REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone},${duration}) FOR ## -#headlineLocList(${areas} true true true false) +#headlineLocList(${areas} true true true false true) ...## ########### END NEW HEADLINE CODE #################### ##################################################################### diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/significantWeatherAdvisory.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/significantWeatherAdvisory.vm index d0ceee0fff..bfab17d4a0 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/significantWeatherAdvisory.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/significantWeatherAdvisory.vm @@ -7,6 +7,7 @@ ## Edited by Phil Kurimski 3-01-2012 OB12.2.1-4 ## ## Evan Bookbinder 4-25-2012 for OB 12.3.1 (MND) ## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ###################################################### ## ##SET SOME INITIAL VARIABLES @@ -119,7 +120,7 @@ THIS IS A TEST MESSAGE. ## #end #if(${windSpeed} >= 40 || ${hailSize} >= 0.70) ...SIGNIFICANT WEATHER ADVISORY FOR ## -#headlineLocList(${areas} true false true false) #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) +#headlineLocList(${areas} true false true false true) #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) ...## #elseif(${windSpeed} == 0 && ${hailSize} == 0) !** YOU DID NOT SELECT ANY WIND OR HAIL THREATS. PLEASE RE-GENERATE THIS ADVISORY **! diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/sws_county.vm b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/sws_county.vm index edb5b5be6b..064e4cd910 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/sws_county.vm +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/sws_county.vm @@ -2,6 +2,9 @@ ## sigwx alert for thunderstorms with wind and/or hail under ## severe limits ## county list needs to be sortable by state/parts of state/ +## +## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. +## ${WMOId} ${vtecOffice} 000000 ${BBBId} SPS${siteId} @@ -26,7 +29,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})} #end THE NATIONAL WEATHER SERVICE IN ${officeLoc} HAS ISSUED A SPECIAL WEATHER STATEMENT EFFECTIVE ## -#secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR #headlineLocList(${areas} true true true false). +#secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR #headlineLocList(${areas} true true true false true). #if(${stormType} == "line") #set ($type1 = "THUNDERSTORMS") diff --git a/edexOsgi/build.edex/esb/data/utility/edex_static/base/config/gfe/serverConfig.py b/edexOsgi/build.edex/esb/data/utility/edex_static/base/config/gfe/serverConfig.py index 538aa916aa..6a69a8fc89 100644 --- a/edexOsgi/build.edex/esb/data/utility/edex_static/base/config/gfe/serverConfig.py +++ b/edexOsgi/build.edex/esb/data/utility/edex_static/base/config/gfe/serverConfig.py @@ -605,12 +605,16 @@ HRAP = ('HRAP', POLAR_STEREOGRAPHIC, (-119.036, 23.097), (-75.945396, 53.480095), (0.0, 0.0), 0.0, 0.0, (1, 1), (801, 881), 0.0, 0.0, -105.0) +NDFD_Oceanic_10K = ('NDFD Oceanic 10km', MERCATOR, + (-230.094, -30.4192), (10.71, 67.03), + (0.0, 0.0), 0.0, 0.0, (1, 1), (2517, 1289), 0.0, -109.962, 0.0) + # list of all projections allProjections = [Grid201, Grid202, Grid203, Grid204, Grid205, Grid206, Grid207, Grid208, Grid209, Grid210, Grid211, Grid212, Grid213, Grid214, Grid214AK, Grid215, Grid216, Grid217, Grid218, Grid219, Grid221, Grid222, Grid225, Grid226, Grid227, Grid228, Grid229, Grid230, Grid231, Grid232, - Grid233, Grid234, Grid235, HRAP] + Grid233, Grid234, Grid235, HRAP, NDFD_Oceanic_10K] #--------------------------------------------------------------------------- # @@ -791,8 +795,10 @@ SITES = { #Special Sites - Updated NHC and OPC domains in OB9.3 'US' : ([267, 159], (18.0, 9.5), (67.0, 40.0), 'EDT5EDT', Grid211, "other"), 'FSL' : ([161, 145], (38.50, 27.00), (10.0, 9.0), 'MST7MDT', Grid211, "other"), - 'NH1' : ([667, 461], (69.5, 4.5), (52.03125, 35.9375), 'EST5EDT', Grid204, "wfo"), - 'NH2' : ([950, 289], (-33.0, -7.0), (148.276, 45.0), 'EST5EDT', Grid210, "wfo"), +# 'NH1' : ([667, 461], (69.5, 4.5), (52.03125, 35.9375), 'EST5EDT', Grid204, "wfo"), +# 'NH2' : ([950, 289], (-33.0, -7.0), (148.276, 45.0), 'EST5EDT', Grid210, "wfo"), + 'NH1' = ([838, 577], (887.0, 121.0), (837.0, 576.0), 'EST5EDT', NDFD_Oceanic_10K, "wfo") + 'NH2' = ([1188, 363], (1328.0, 365.0), (1187.0, 362.0), 'EST5EDT', NDFD_Oceanic_10K, "wfo") 'ONA' : ([244, 383], (68.9375, 19.5625), (15.1875, 23.875), 'EST5EDT', Grid211, "wfo"), 'ONP' : ([396, 415], (8.1875, 21.5625), (24.6875, 25.875), 'PST8PDT', Grid211, "wfo"), @@ -971,7 +977,7 @@ RTMA = ('RTMA', GRID, '', YES, NO, 1, 36) NamDNG5 = ('NamDNG5', GRID, '', NO, NO, 2, 0) TPCProb = ('TPCProb', GRID, '', NO, NO, 30, 0) SREF = ('SREF', GRID, '', NO, NO, 3, 0) - +ENPwave = ('ENPwave', GRID, '', NO, NO, 2, 0) #--------------------------------------------------------------------------- # # D2D Model Database Version Specification @@ -1117,6 +1123,7 @@ elif SID in CONUS_EAST_SITES: ('HiResW-NMM-East', 'HIRESWnmm'), ('SPCGuide', 'SPC'), ('ECMWF-HiRes','ECMWFHiRes'), + ('ENPWAVE253', 'ENPwave'), ] else: #######DCS3501 WEST_CONUS @@ -1166,6 +1173,7 @@ else: #######DCS3501 WEST_CONUS ('HiResW-NMM-West', 'HIRESWnmm'), ('SPCGuide', 'SPC'), ('ECMWF-HiRes','ECMWFHiRes'), + ('ENPWAVE253', 'ENPwave'), ] if SID in GreatLake_SITES: @@ -1390,6 +1398,7 @@ else: # "WCwave4" : ["WCwave4"], # "WNAwave10" : ["WNAwave10"], # "WNAwave4" : ["WNAwave4"], +# "ENPwave": ["ENPwave"], } #initialization skip certain model runs @@ -1519,6 +1528,7 @@ localMOSParms = localHPCQPFParms = localRFCQPFParms = [] localTCMParms = localSATParms = localGFS75Parms = localGFS190Parms = [] localAKwave10Parms = localAKwave4Parms = localEPwave10Parms = localGlobalWaveParms = [] localWCwave10Parms = localWCwave4Parms = localWNAwave10Parms = localWNAwave4Parms = [] +localENPwaveParms = [] localGLWMParms = [] #####DCS3499 localParms = localHIRESWarwParms = localHIRESWnmmParms = [] #######DCS3501 #DR20634 localParms = localSPCParms = [] @@ -1595,7 +1605,7 @@ if not BASELINE and siteImport('localConfig'): localWCwave4Parms = getattr(localConfig, 'parmsWCwave4', localWCwave4Parms) localWNAwave10Parms = getattr(localConfig, 'parmsWNAwave10', localWNAwave10Parms) localWNAwave4Parms = getattr(localConfig, 'parmsWNAwave4', localWNAwave4Parms) - + localENPwaveParms = getattr(localConfig, 'parmsENPwave', localENPwaveParms) #note that extraISCparms are not in the standard format. These #are a list of ([p, p, p, p], officeType) localISCExtraParms = getattr(localConfig, 'extraISCparms', localISCExtraParms) @@ -1771,6 +1781,9 @@ TPCProbPARMS = [([prob34, prob50, prob64], TC1), # Cobb snow tool parmsNAM12 = [([SnowRatio], TC1)] parmsGFS40 = [([SnowRatio], TC1)] + +ENPwave_parms = [([WindWaveHeight, WaveHeight, SurfHeight, Wind], TC6), + ([Swell, Swell2, Period, Period2], TC6)] #--------------------------------------------------------------------------- # Databases for a site. # list of (Database, [parms]) @@ -1826,6 +1839,7 @@ DATABASES = [(Official, OFFICIALDBS + localParms), (RTMA, RTMAPARMS + localRTMAParms), (NamDNG5, NamDNG5PARMS + localNamDNG5Parms), (TPCProb, TPCProbPARMS + localTPCProbParms), + (ENPwave, ENPwave_parms + localENPwaveParms), (Test, OFFICIALDBS + localParms)] + localDBs # Intersite coordination database parameter groupings, based on diff --git a/edexOsgi/build.edex/esb/data/utility/edex_static/base/protectedFiles.txt b/edexOsgi/build.edex/esb/data/utility/edex_static/base/protectedFiles.txt index 13d6dd90e9..c98c5486c8 100644 --- a/edexOsgi/build.edex/esb/data/utility/edex_static/base/protectedFiles.txt +++ b/edexOsgi/build.edex/esb/data/utility/edex_static/base/protectedFiles.txt @@ -9,7 +9,7 @@ SITE:common_static/scan/SCANRunSiteConfig.xml #AvnFPS files -SITE:cave_static/aviation/avnwatch/aviationForecasterConfig.xml +#SITE:cave_static/aviation/avnwatch/aviationForecasterConfig.xml #D2D files BASE:cave_static/derivedParameters/DerivedParameterInterface.py diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java index 8ff32691fb..494b368d88 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java @@ -47,7 +47,7 @@ import com.vividsolutions.jts.io.WKTReader; * 12/03/2008 chammack Camel refactor * 09/15/2009 3027 njensen Patterns constants * 09/21/2009 3072 bsteffen Fixed Decoding of Line Records - * + * 01/02/2013 DCS 135 tk handle coverage value Line records * * * @@ -71,7 +71,7 @@ public class CcfpDecoder extends AbstractDecoder { private static final String PARSE_AREA = "AREA (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) (\\d+) \\d+ (.*) (\\d+) (\\d+)"; /** Parse a LINE line */ - private static final String PARSE_LINE = "LINE \\d+ (.*)"; + private static final String PARSE_LINE = "LINE (\\d+) \\d+ (.*)"; private static final Pattern STRING_PATTERN = Pattern.compile(PARSE_STRING); @@ -180,26 +180,33 @@ public class CcfpDecoder extends AbstractDecoder { } else if (record.getProducttype().equals("LINE")) { matcher = LINE_PATTERN.matcher(msg); if (matcher.find()) { - record.setCoverage(null); + record.setCoverage(Integer.parseInt(matcher.group(1))); // change to group 1 record.setConf(null); record.setGrowth(null); record.setTops(null); record.setSpeed(null); record.setDirection(null); - location.setBoxLat(0); - location.setBoxLong(0); - String templatlonpairs = matcher.group(1); + String templatlonpairs = matcher.group(2); // change to group 2 matcher = PAIR_PATTERN.matcher(templatlonpairs); StringBuffer wtk = new StringBuffer(); wtk.append("LINESTRING("); if (matcher.find()) { - wtk.append(Double.toString(Integer.parseInt(matcher - .group(2)) - * -0.1)); + + Double lon = Integer.parseInt(matcher + .group(2)) * -0.1; + String lonStr = Double.toString(lon); + + Double lat = Integer.parseInt(matcher + .group(1)) * 0.1; + String latStr = Double.toString(lat); + + location.setBoxLong(lon); + location.setBoxLat(lat); + + wtk.append(lonStr); wtk.append(SPACE); - wtk.append(Double.toString(Integer.parseInt(matcher - .group(1)) * 0.1)); + wtk.append(latStr); } while (matcher.find()) { wtk.append(COMMA); diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java index b3b2951140..c591a82496 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpSeparator.java @@ -45,6 +45,7 @@ import com.raytheon.edex.util.Util; * 03/03/2007 908 bwoodle initial creation * 12/03/2008 chammack Camel refactor * 09/16/2009 3027 njensen Static patterns + * 01/02/2013 DCS 135 tk use \\r* for testing end of line * * * @@ -58,11 +59,11 @@ public class CcfpSeparator extends AbstractRecordSeparator { /** Regex used for separating multi-record files */ private static final Pattern DATASET = Pattern - .compile("CCFP \\d{8}_\\d{4} \\d{8}_\\d{4}([\\r\\n]+(AREA|LINE).*)*"); + .compile("CCFP \\d{8}_\\d{4} \\d{8}_\\d{4}([\\r*\\n]+(AREA|LINE).*)*"); /** Regex to pull AWIPS Header */ private static final Pattern AWIPSHEADER = Pattern - .compile("[\\r\\n]+(TAF|MTR|CFP)([\\p{Alnum} ]{3})[\\r\\n]+"); + .compile("[\\r*\\n]+(TAF|MTR|CFP)([\\p{Alnum} ]{3})[\\r*\\n]+"); /** Regex used for extracting the header */ private static final Pattern HEADERREGEX = Pattern diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/utility/edex_static/base/distribution/ccfp.xml b/edexOsgi/com.raytheon.edex.plugin.ccfp/utility/edex_static/base/distribution/ccfp.xml index 084a367779..d5ac8a88b3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/utility/edex_static/base/distribution/ccfp.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/utility/edex_static/base/distribution/ccfp.xml @@ -19,5 +19,5 @@ further_licensing_information. --> - ^FAUS2[789] KKCI.* + ^FAUS(2[89]|30) KKCI.* 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 912429b501..89b7f198bd 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 @@ -73,6 +73,9 @@ import com.vividsolutions.jts.geom.Coordinate; * ------------ ---------- ----------- -------------------------- * 4/7/09 1994 bphillip Initial Creation * + * 1/4/13 DR 15653 M.Porricelli Shift subgrid domain + * westward like AWIPSI + * * * * @author bphillip @@ -128,6 +131,8 @@ public class GribSpatialCache { private FileDataList fileDataList; private long fileScanTime = 0; + + boolean shiftSubGridWest = false; /** * Gets the singleton instance of GribSpatialCache @@ -300,8 +305,12 @@ public class GribSpatialCache { Coordinate subGridCenterGridCoord = MapUtil.latLonToGridCoordinate( subGridCenterLatLon, PixelOrientation.CENTER, referenceCoverage); - - double xCenterPoint = subGridCenterGridCoord.x; + + double shiftX = 0; + if (shiftSubGridWest == true && modelName != "TPCSurgeProb") + shiftX = subGridDef.getNx() / 5; + + double xCenterPoint = subGridCenterGridCoord.x - shiftX; double yCenterPoint = subGridCenterGridCoord.y; double xDistance = subGridDef.getNx() / 2; @@ -310,6 +319,12 @@ public class GribSpatialCache { - xDistance, yCenterPoint + yDistance); Coordinate upperRightPosition = new Coordinate(xCenterPoint + xDistance, yCenterPoint - yDistance); + + // If the western edge of the subgrid is placed west of the full grid boundary + // (possibly when westward shifting above was done) it will be shifted back + // to within the boundary, but the eastern edge should be shifted back also, by + // a proportional amount + if (lowerLeftPosition.x < 0) upperRightPosition.x -= lowerLeftPosition.x; lowerLeftPosition = MapUtil.gridCoordinateToLatLon( lowerLeftPosition, PixelOrientation.CENTER, @@ -599,7 +614,18 @@ public class GribSpatialCache { .handleRequest(centerPointRequest); logger.info("Default sub grid location is wfo center point [" + defaultCenterPoint.y + "/" + defaultCenterPoint.x + "]"); + /* If we are getting the WFO center as the center point, it means that + // the site has not defined its own center in the site file + // defaultSubGridCenterPoint.xml (see previous If block). + // Therefore, we will be shifting the domain westward to be similar to + // AWIPSI default behavior, so set a flag here. + // If the site *has* defined a center in defaultSubGridCenterPoint.xml, + // we will use that as the true, intended center and will not shift the + // domain further. + */ + shiftSubGridWest = true; } + else shiftSubGridWest = false; return defaultCenterPoint; } diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/pointdata/ldadhydrodb.xml b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/pointdata/ldadhydrodb.xml new file mode 100644 index 0000000000..f2f46ca795 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/pointdata/ldadhydrodb.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java index c425c50b31..f82a3d438a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java @@ -21,6 +21,9 @@ package com.raytheon.edex.plugin.satellite; import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.util.Calendar; import java.util.TimeZone; @@ -69,6 +72,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * 04/17/2012 14724 kshresth This is a temporary workaround - Projection off CONUS * - AWIPS2 Baseline Repository -------- * 06/27/2012 798 jkorman Using SatelliteMessageData to "carry" the decoded image. + * 01/03/2013 15294 D. Friedman Start with File instead of byte[] to + * reduce memory usage. * * * @author bphillip @@ -82,61 +87,65 @@ public class SatelliteDecoder extends AbstractDecoder { private static final String SAT_HDR_TT = "TI"; + private static final int GINI_HEADER_SIZE = 512; + + private static final int INITIAL_READ = GINI_HEADER_SIZE + 128; + private SatelliteDao dao; - public PluginDataObject[] decode(byte[] data) throws Exception { + public PluginDataObject[] decode(File file) throws Exception { PluginDataObject[] retData = null; SatelliteRecord record = null; - if ((data != null) && (data.length > 0)) { + if (file == null || (file.length() < 1)) + return new PluginDataObject[0]; + RandomAccessFile f = new RandomAccessFile(file, "r"); + try { + // Read in enough data to cover the WMO heading and GINI header. + ByteBuffer byteBuffer = ByteBuffer.allocate(INITIAL_READ); + f.getChannel().read(byteBuffer); + byteBuffer.flip(); + try { - data = removeWmoHeader(data); + removeWmoHeader(byteBuffer); } catch (DecoderException e) { logger.error(e); - data = null; + byteBuffer = null; } - if (data != null) { + if (byteBuffer != null) { + int offsetOfDataInFile = byteBuffer.position() + GINI_HEADER_SIZE; Calendar calendar = Calendar.getInstance(TimeZone .getTimeZone("GMT")); - ByteBuffer byteBuffer = null; int intValue = 0; byte byteValue = 0; byte[] tempBytes = null; - byte[] header = null; byte threeBytesArray[] = new byte[3]; record = new SatelliteRecord(); - if (isCompressed(data)) { + if (isCompressed(byteBuffer)) { + /* If the data is compressed, we assume it came from the SBN + * and will have a reasonable size such that we can have two + * copies of the data in memory at the same time. Ideally, + * SBN decompression should be performed upstream from EDEX + * and this code would be removed. + */ + byte[] data = new byte[(int) file.length() - byteBuffer.position()]; + f.seek(byteBuffer.position()); + f.readFully(data); byte[][] retVal = decompressSatellite(data); - header = retVal[0]; - data = retVal[1]; - } - - if (header == null) { - header = new byte[512]; - System.arraycopy(data, 0, header, 0, 512); - // drop the header from the data in the header - byte[] fullTempBytes = new byte[data.length - 512]; - System.arraycopy(data, 512, fullTempBytes, 0, - fullTempBytes.length); - int endOfGoodData = getIndex(fullTempBytes, 0); - tempBytes = new byte[endOfGoodData]; - System.arraycopy(fullTempBytes, 0, tempBytes, 0, - endOfGoodData); - + byteBuffer = ByteBuffer.wrap(retVal[0]); + tempBytes = retVal[1]; } else { - tempBytes = data; + /* The code bellow performs absolute gets on the buffer, so + * it needs to be compacted. + */ + byteBuffer.compact(); + byteBuffer.flip(); } - // create a byte buffer - byteBuffer = ByteBuffer.allocate(512); - - // add the header - byteBuffer.put(header, 0, 512); - // get the scanning mode int scanMode = byteBuffer.get(37); @@ -264,6 +273,15 @@ public class SatelliteDecoder extends AbstractDecoder { // get number of points along y-axis int ny = byteBuffer.getShort(18); + /* If input was SBN-compressed, we already have the data + * loaded. If not, load it now. + */ + if (tempBytes == null) { + tempBytes = new byte[nx * ny]; + f.seek(offsetOfDataInFile); + f.readFully(tempBytes, 0, tempBytes.length); + } + /* * Rotate image if necessary */ @@ -409,6 +427,12 @@ public class SatelliteDecoder extends AbstractDecoder { record.setMessageData(dataRec); } } + } finally { + try { + f.close(); + } catch (IOException e) { + // ignore + } } if (record == null) { retData = new PluginDataObject[0]; @@ -425,20 +449,17 @@ public class SatelliteDecoder extends AbstractDecoder { * * @throws DecoderException * If WMO header is not found, or is incorrect. - * @return The byte array data with all leading information to the end of - * the wmo header removed. + * @param messageData + * Contains the start of the satellite data file. On return, + * the position is set the beginning of the GINI header. */ - private byte[] removeWmoHeader(byte[] messageData) throws DecoderException { - - int readSize = (messageData.length > 1024) ? 1024 : messageData.length; - - byte[] retMessage = null; + private void removeWmoHeader(ByteBuffer messageData) throws DecoderException { // Copy to a char [], carefully, as creating a string from // a byte [] with binary data can create erroneous data - char[] message = new char[readSize]; + char[] message = new char[messageData.remaining()]; for (int i = 0; i < message.length; i++) { - message[i] = (char) (messageData[i] & 0xFF); + message[i] = (char) (messageData.get() & 0xFF); } String msgStr = new String(message); Matcher matcher = null; @@ -448,9 +469,8 @@ public class SatelliteDecoder extends AbstractDecoder { if (SAT_HDR_TT.equals(msgStr .substring(headerStart, headerStart + 2))) { int startOfSatellite = matcher.end(); - retMessage = new byte[messageData.length - startOfSatellite]; - System.arraycopy(messageData, startOfSatellite, retMessage, 0, - retMessage.length); + messageData.position(startOfSatellite); + messageData.limit(messageData.capacity()); } else { throw new DecoderException( "First character of the WMO header must be 'T'"); @@ -458,21 +478,22 @@ public class SatelliteDecoder extends AbstractDecoder { } else { throw new DecoderException("Cannot decode an empty WMO header"); } - - return retMessage; } /** * Checks to see if the current satellite product is compressed. * + * Assumes messageData is a byte[]-backed ByteBuffer. + * * @return A boolean indicating if the file is compressed or not */ - private boolean isCompressed(byte[] messageData) { + private boolean isCompressed(ByteBuffer messageData) { boolean compressed = true; byte[] placeholder = new byte[10]; Inflater decompressor = new Inflater(); try { - decompressor.setInput(messageData); + decompressor.setInput(messageData.array(), + messageData.position(), messageData.remaining()); decompressor.inflate(placeholder); } catch (DataFormatException e) { compressed = false; diff --git a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/impl/separator/StdTextSeparator.java b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/impl/separator/StdTextSeparator.java index 560b128884..62950478c3 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/impl/separator/StdTextSeparator.java +++ b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/impl/separator/StdTextSeparator.java @@ -100,6 +100,7 @@ public class StdTextSeparator extends WMOMessageSeparator { || ispanId.startsWith("FQGX40") || ispanId.startsWith("FDU") || ispanId.startsWith("UAXX") || ispanId.startsWith("FPCN") || ispanId.startsWith("WWPN20") || ispanId.startsWith("FAUS2") + || ispanId.startsWith("FAUS30") || (ispanId.startsWith("TC") && !ispanId.startsWith("TCUS"))) { stdFlg = true; } else { diff --git a/edexOsgi/com.raytheon.edex.rpgenvdata/src/com/raytheon/edex/rpgenvdata/RPGEnvironmentalDataManager.java b/edexOsgi/com.raytheon.edex.rpgenvdata/src/com/raytheon/edex/rpgenvdata/RPGEnvironmentalDataManager.java index 0d75017810..0211fedc9a 100644 --- a/edexOsgi/com.raytheon.edex.rpgenvdata/src/com/raytheon/edex/rpgenvdata/RPGEnvironmentalDataManager.java +++ b/edexOsgi/com.raytheon.edex.rpgenvdata/src/com/raytheon/edex/rpgenvdata/RPGEnvironmentalDataManager.java @@ -84,6 +84,16 @@ import com.raytheon.uf.edex.database.plugin.PluginDao; import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.database.query.DatabaseQuery; +/** +* SOFTWARE HISTORY +* +* Date Ticket# Engineer Description +* ------------ ---------- ----------- -------------------------- +* ?? ?? Initial Creation +* 1-3-2013 DR 15667 M.Porricelli Made EnvironParamsLevelTable.xml +* accessible from SITE level +* +**/ public class RPGEnvironmentalDataManager { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(RPGEnvironmentalDataManager.class); @@ -143,12 +153,23 @@ public class RPGEnvironmentalDataManager { LocalizationContext edexStaticBase = pathMgr.getContext( LocalizationContext.LocalizationType.EDEX_STATIC, LocalizationContext.LocalizationLevel.BASE); - - File file = pathMgr.getFile(edexStaticBase, "rpgenvdata" + + LocalizationContext edexStaticSite = pathMgr.getContext( + LocalizationContext.LocalizationType.EDEX_STATIC, + LocalizationContext.LocalizationLevel.SITE); + + File basePathFile = pathMgr.getFile(edexStaticBase, "rpgenvdata" + + File.separator + "EnvironParamsLevelTable.xml"); + File sitePathFile = pathMgr.getFile(edexStaticSite, "rpgenvdata" + File.separator + "EnvironParamsLevelTable.xml"); - Unmarshaller u = Configuration.getUnmashaller(); - configuration = (Configuration) u.unmarshal(file); + if (sitePathFile.exists()) { + Unmarshaller u = Configuration.getUnmashaller(); + configuration = (Configuration) u.unmarshal(sitePathFile); + } else { + Unmarshaller u = Configuration.getUnmashaller(); + configuration = (Configuration) u.unmarshal(basePathFile); + } if (!validateConfiguration(configuration)) { configuration = null; diff --git a/edexOsgi/com.raytheon.edex.rpgenvdata/utility/edex_static/base/rpgenvdata/EnvironParamsLevelTable.xml b/edexOsgi/com.raytheon.edex.rpgenvdata/utility/edex_static/base/rpgenvdata/EnvironParamsLevelTable.xml index 54cf0b8701..03626b87af 100644 --- a/edexOsgi/com.raytheon.edex.rpgenvdata/utility/edex_static/base/rpgenvdata/EnvironParamsLevelTable.xml +++ b/edexOsgi/com.raytheon.edex.rpgenvdata/utility/edex_static/base/rpgenvdata/EnvironParamsLevelTable.xml @@ -19,7 +19,7 @@ further_licensing_information. --> - + diff --git a/edexOsgi/com.raytheon.edex.textdb/src/com/raytheon/edex/textdb/fax/FaxSender.java b/edexOsgi/com.raytheon.edex.textdb/src/com/raytheon/edex/textdb/fax/FaxSender.java index 6592ca717f..6669d67d34 100644 --- a/edexOsgi/com.raytheon.edex.textdb/src/com/raytheon/edex/textdb/fax/FaxSender.java +++ b/edexOsgi/com.raytheon.edex.textdb/src/com/raytheon/edex/textdb/fax/FaxSender.java @@ -37,6 +37,7 @@ import com.raytheon.uf.common.util.RunProcess; * ------------ ---------- ----------- -------------------------- * Oct 28, 2010 bfarmer Initial creation * Sep 19, 2011 10955 rferrel Use RunProcess + * Jan 10, 2012 4550 mgamazaychikov Fixed the sshCommand * * * @@ -150,14 +151,17 @@ public class FaxSender { } // Execute faxSender.csh on ldad fax script file (system exec) StringBuilder sshCommand = new StringBuilder(); - sshCommand.append("ssh ls1 -l ldad -n \""); + /* + * DR4550 - the sshCommand should be: + * ssh -n ls1 -l ldad $LDAD_EXTERNAL_HOME/bin/faxSender.csh filename + */ + sshCommand.append("ssh -n ls1 -l ldad "); sshCommand.append(System.getenv("LDAD_EXTERNAL_HOME")); sshCommand.append("/bin/faxSender.csh "); sshCommand.append(ldadScriptFilename); - sshCommand.append("\""); // DR#10955 RunProcess sshCommandExec = RunProcess.getRunProcess().exec( - sshCommand.toString()); + sshCommand.toString()); error = sshCommandExec.getStderr().trim(); if (error.length() != 0) { // Send back an appropriate error string. diff --git a/edexOsgi/com.raytheon.edex.textdb/utility/common_static/base/textdb/ispan_table.dat b/edexOsgi/com.raytheon.edex.textdb/utility/common_static/base/textdb/ispan_table.dat index 08ca3e3e24..a5aaefc034 100644 --- a/edexOsgi/com.raytheon.edex.textdb/utility/common_static/base/textdb/ispan_table.dat +++ b/edexOsgi/com.raytheon.edex.textdb/utility/common_static/base/textdb/ispan_table.dat @@ -320,10 +320,10 @@ FAUS26KZNY AAACWANY6 FAUS26KZOA AAACWAOA6 FAUS26KZOB AAACWAOB6 FAUS26KZSE AAACWASE6 -FAUS26KZTL AAACWATL6 -FAUS27KKCI MKCCFP01 +FAUS26KZTL AAACWATL6 FAUS28KKCI MKCCFP02 -FAUS29KKCI MKCCFP03 +FAUS29KKCI MKCCFP03 +FAUS30KKCI MKCCFP04 FBCA11KWBC AAA18AC11 FBCA12KWBC AAA24AC11 FBCA13KWBC AAA18AC13 diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/Color.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/Color.java index bec4341254..2f2b95dd89 100644 --- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/Color.java +++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/Color.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -26,16 +26,17 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; /** - * + * * Implementation of Color class used in ColorMap - * + * *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Aug 20, 2008            bclements     Initial creation
+ * Jan 10, 2013 15648      ryu         Added equals() method.
  * 
- * + * * @author bclements * @version 1.0 */ @@ -102,4 +103,18 @@ public class Color { public void setGreen(float f) { green = f; } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Color) { + Color c = (Color) obj; + if (alpha == c.alpha && + red == c.red && + blue == c.blue && + green == c.green) + return true; + } + + return false; + } } diff --git a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/ColorMap.java b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/ColorMap.java index 9bb6922a70..bea147d247 100644 --- a/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/ColorMap.java +++ b/edexOsgi/com.raytheon.uf.common.colormap/src/com/raytheon/uf/common/colormap/ColorMap.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -37,11 +37,11 @@ import com.raytheon.uf.common.serialization.ISerializableObject; /** * Implementation of a colormap - * + * *
- * 
+ *
  *  SOFTWARE HISTORY
- * 
+ *
  *  Date         Ticket#     Engineer    Description
  *  ------------ ----------  ----------- --------------------------
  *  Feb 5, 2007              chammack    Initial Creation.
@@ -49,9 +49,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
  *  Aug 20, 2008			 bclement	 Added JaXB annotations and color class
  *  Aug 20, 2008			 dglazesk	 Added some interface pieces to make this more
  *                                       usable
- * 
+ *  Jan 10, 2013 15648       ryu         Added removeDuplicates() method.
+ *
  * 
- * + * * @author chammack * @version 1 */ @@ -80,8 +81,8 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { } /** - * - * + * + * */ public ColorMap(String name, float[] red, float[] green, float[] blue) { this.colors = new ArrayList(); @@ -96,7 +97,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /** * Creates a ColorMap using name and the list of colors in map. - * + * * @param name * Name for the new ColorMap * @param map @@ -111,7 +112,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /** * Do not instantiate directly, use GLTarget methods - * + * * @param name * @param red * @param green @@ -138,7 +139,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.uf.common.colormap.IColorMap#getBlue() */ public float[] getBlue() { @@ -152,7 +153,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.uf.common.colormap.IColorMap#getGreen() */ public float[] getGreen() { @@ -166,7 +167,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.uf.common.colormap.IColorMap#getRed() */ public float[] getRed() { @@ -180,7 +181,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.uf.common.colormap.IColorMap#getSize() */ public int getSize() { @@ -189,7 +190,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.uf.common.colormap.IColorMap#getAlpha() */ public float[] getAlpha() { @@ -203,7 +204,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /** * Return the buffer representation of the colormap - * + * * @return the colorMap buffer */ public synchronized Buffer getColorMap() { @@ -232,7 +233,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see com.raytheon.edex.colormap.IColorMap#getName() */ public String getName() { @@ -245,7 +246,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { /* * (non-Javadoc) - * + * * @see java.lang.Object#toString() */ @Override @@ -328,7 +329,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { * wavelength to the maximum wavelength. If the reverse flag is set, then a * reverse spectrum is generated. The red, green, and blue indexes are * returned through the calling arguments. - * + * * @param numOfColors * @param minWaveLength * @param maxWaveLength @@ -409,4 +410,20 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject { return new Color((float) r, (float) g, (float) b); } + /** + * Removes duplicate entries. + */ + public void removeDuplicates() { + List colors = new ArrayList(); + Color current = null; + for (Color color: this.colors) { + if (!color.equals(current)) { + colors.add(color); + current = color; + } + } + + this.colors = colors; + changed = true; + } } diff --git a/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java b/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java index 12a718a8fb..2bed55d2d8 100644 --- a/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java +++ b/edexOsgi/com.raytheon.uf.common.comm/src/com/raytheon/uf/common/comm/HttpClient.java @@ -22,6 +22,7 @@ package com.raytheon.uf.common.comm; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -71,6 +72,7 @@ import com.raytheon.uf.common.util.ByteArrayOutputStreamPool.ByteArrayOutputStre * 03/02/11 #8045 rferrel Add connect reestablished message. * 07/17/12 #911 njensen Refactored significantly * 08/09/12 15307 snaples Added putEntitiy in postStreamingEntity. + * 01/07/13 DR 15294 D. Friedman Added streaming requests. * * * @@ -434,6 +436,95 @@ public class HttpClient { return executePostMethod(put); } + /** + * Post a message to an http address, and return the result as a byte array. + *

+ * Implementation note: The given stream handler will be used at least + * twice: Once to determine the length, another to actually send the + * content. This is done because pypies does not accept chunked requests + * bodies. + * + * @param address + * @param handler the handler responsible for generating the message to be posted + * @return + * @throws CommunicationException + */ + public byte[] postBinary(String address, OStreamHandler handler) throws CommunicationException { + class OStreamEntity extends AbstractHttpEntity { + OStreamHandler handler; + long contentLength = -1; + + public OStreamEntity(OStreamHandler handler) { + this.handler = handler; + } + + @Override + public InputStream getContent() throws IOException, + IllegalStateException { + throw new IllegalStateException("OStreamEntity does not support getContent()."); + } + + @Override + public long getContentLength() { + if (contentLength < 0) { + class CountingStream extends OutputStream { + long count; + + @Override + public void write(int b) throws IOException { + ++count; + } + + @Override + public void write(byte[] b) throws IOException { + count += b.length; + } + + @Override + public void write(byte[] b, int off, int len) + throws IOException { + count += len; + } + } + + CountingStream cs = new CountingStream(); + try { + handler.writeToStream(cs); + contentLength = cs.count; + } catch (CommunicationException e) { + // ignore + } + } + return contentLength; + } + + @Override + public boolean isRepeatable() { + return true; + } + + @Override + public boolean isStreaming() { + return false; + } + + @Override + public void writeTo(OutputStream stream) throws IOException { + try { + handler.writeToStream(stream); + } catch (CommunicationException e) { + throw new IOException(e.getMessage(), e.getCause()); + } + } + } + + OStreamEntity entity = new OStreamEntity(handler); + HttpPost put = new HttpPost(address); + put.setEntity(entity); + + return executePostMethod(put); + } + /** * Post a string to an endpoint and stream the result back. * @@ -592,6 +683,15 @@ public class HttpClient { throws CommunicationException; } + /** + * Responsible for writing HTTP content to a stream. May be called + * more than once for a given entity. See postBinary(String, OStreamHandler) + * for details. + */ + public static interface OStreamHandler { + public void writeToStream(OutputStream os) throws CommunicationException; + } + /** * Automatically reads a stream into a byte array and stores the byte array * in byteResult. Should only be used internally in HttpClient with diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java index 0b614003f1..faf88b060d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/gis/GeospatialFactory.java @@ -61,6 +61,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; * Apr 11, 2012 #14691 Qinglu Lin For marine warnings, getFeAreaField() returns null. * So, do not add the returned value of getFeAreaField() * to areaFields. + * Jan 9, 2013 15600 Qinglu Lin Execute "timezones = myTimeZones;" even if timezones != null. * * * @@ -118,9 +119,7 @@ public class GeospatialFactory { GeospatialData[] parentAreas = dataSet.getParentAreas(); GeospatialData[] myTimeZones = dataSet.getTimezones(); if (myTimeZones != null && myTimeZones.length > 0) { - if (timezones == null) { - timezones = myTimeZones; - } + timezones = myTimeZones; for (GeospatialData tz : myTimeZones) { tz.prepGeom = PreparedGeometryFactory.prepare(tz.geometry); diff --git a/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java b/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java index 5f5e864c21..e1c1eca3fe 100644 --- a/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java +++ b/edexOsgi/com.raytheon.uf.common.pypies/src/com/raytheon/uf/common/pypies/PyPiesDataStore.java @@ -2,11 +2,13 @@ package com.raytheon.uf.common.pypies; import java.io.File; import java.io.FileNotFoundException; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; +import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.comm.HttpClient; import com.raytheon.uf.common.datastorage.DuplicateRecordStorageException; import com.raytheon.uf.common.datastorage.IDataStore; @@ -31,6 +33,8 @@ import com.raytheon.uf.common.pypies.response.ErrorResponse; import com.raytheon.uf.common.pypies.response.FileActionResponse; import com.raytheon.uf.common.pypies.response.RetrieveResponse; import com.raytheon.uf.common.pypies.response.StoreResponse; +import com.raytheon.uf.common.serialization.DynamicSerializationManager; +import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationType; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.util.FileUtil; @@ -66,6 +70,7 @@ import com.raytheon.uf.common.util.FileUtil; * ------------ ---------- ----------- -------------------------- * May 27, 2010 njensen Initial creation * Oct 01, 2010 rjpeter Added logging of requests over 300ms + * Mon 07, 2013 DR 15294 D. Friedman Stream large requests * * * @author njensen @@ -76,6 +81,8 @@ public class PyPiesDataStore implements IDataStore { private static final long SIMPLE_LOG_TIME = 300; + private static final long HUGE_REQUEST = 1024 * 1024 * 25; + protected static String address = null; protected List records = new ArrayList(); @@ -276,9 +283,19 @@ public class PyPiesDataStore implements IDataStore { req.setOp(storeOp); req.setRecords(records); + boolean huge = false; + long totalSize = 0; + for (IDataRecord rec : records) { + totalSize += rec.getSizeInBytes(); + if (totalSize >= HUGE_REQUEST) { + huge = true; + break; + } + } + StorageStatus ss = null; try { - StoreResponse sr = (StoreResponse) sendRequest(req); + StoreResponse sr = (StoreResponse) sendRequest(req, huge); ss = sr.getStatus(); String[] exc = sr.getExceptions(); IDataRecord[] failed = sr.getFailedRecords(); @@ -327,17 +344,20 @@ public class PyPiesDataStore implements IDataStore { return ss; } - protected Object sendRequest(final AbstractRequest obj) + protected Object sendRequest(final AbstractRequest obj) throws StorageException { + return sendRequest(obj, false); + } + + protected Object sendRequest(final AbstractRequest obj, boolean huge) throws StorageException { obj.setFilename(filename); - byte[] bytes = serializeRequest(obj); initializeProperties(); byte[] result = null; long t0 = System.currentTimeMillis(); try { - result = HttpClient.getInstance().postBinary(address, bytes); + result = doSendRequest(obj, huge); } catch (Exception e) { throw new StorageException( "Error communicating with pypies server", null, e); @@ -359,6 +379,24 @@ public class PyPiesDataStore implements IDataStore { return ret; } + protected byte[] doSendRequest(final AbstractRequest obj, boolean huge) throws Exception { + if (huge) { + return HttpClient.getInstance().postBinary(address, new HttpClient.OStreamHandler() { + @Override + public void writeToStream(OutputStream os) throws CommunicationException { + try { + DynamicSerializationManager.getManager(SerializationType.Thrift).serialize(obj, os); + } catch (SerializationException e) { + throw new CommunicationException(e); + } + } + }); + } else { + byte[] bytes = serializeRequest(obj); + return HttpClient.getInstance().postBinary(address, bytes); + } + } + /** * By default this method simply passes the request to * sendRequest(AbstractRequest). Method exists to be overridden for diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml new file mode 100644 index 0000000000..8d29123e1d --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java index 08f76976b7..370d88589d 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/common/QPFConfig.java @@ -60,7 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 02/17/2009 1981 dhladky Initial Creation. - * + * 01/07/2013 DR 15647 gzhang Use logger.warn for null earlyVilURI/earlyCZURI. * * * @author dhladky @@ -372,8 +372,9 @@ public class QPFConfig { } if (earlyVilURI == null || earlyCZURI == null) { - throw new Exception("QPFConfig " + icao - + ": Radar Record request failed, no previous data."); + qpfgen.logger.warn("QPFConfig: No previous data for QPF. Check the RADAR OP Mode.");// DR 15647 + //throw new Exception("QPFConfig " + icao + //+ ": Radar Record request failed, no previous data."); } try { @@ -518,8 +519,8 @@ public class QPFConfig { return true; } catch (Exception e) { qpfgen.logger - .error("QPFConfig: Couldn't create all needed RadarRecords: " - + e.getMessage()); + .error("QPFConfig: Some RadarRecords cannot be created: " + + e.getMessage());// DR 15647 return false; } } diff --git a/rpms/awips2.core/Installer.ldm/component.spec b/rpms/awips2.core/Installer.ldm/component.spec index bbedc5741b..b6481310af 100644 --- a/rpms/awips2.core/Installer.ldm/component.spec +++ b/rpms/awips2.core/Installer.ldm/component.spec @@ -5,7 +5,7 @@ Name: awips2-ldm Summary: AWIPS II LDM Distribution Version: 6.8.1 -Release: 27 +Release: 28 Group: AWIPSII BuildRoot: /tmp URL: N/A diff --git a/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template b/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template index eaef03eb8a..14233f8a6d 100755 --- a/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template +++ b/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template @@ -411,7 +411,7 @@ IDS|DDPLUS ^(FOUS[67].) (....) (..)(..)(..) # FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H # # separate out svrwx lsr and GSM misc adm messages -IDS|DDPLUS|HDS ^(N[A-VYZ]....) (.{4}) (..)(..)(..) +IDS|DDPLUS ^(N[A-VYZ]....) (.{4}) (..)(..)(..) FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H IDS|DDPLUS ^(NWUS[01346-9].) (.{4}) (..)(..)(..) FILE -overwrite -log -close -edex /data_store/misc_adm_messages/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H @@ -432,6 +432,10 @@ IDS|DDPLUS ^(R.{5}) (.{4}) (..)(..)(..) IDS|DDPLUS ^(SM[UCM][SNX]..) (.{4}) (..)(..)(..) FILE -overwrite -log -close -edex /data_store/synoptic/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H +# DR 15716 - Add in SHUS products for fire weather obs (and others) +IDS|DDPLUS ^(SHUS..) (.{4}) (..)(..)(..) + FILE -overwrite -log -close -edex /data_store/misc_sfc_obs/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H + # AWIPS1: TEXT ^S[AP]US[78]0.* /point/metar/Raw # AWIPS1: TEXT ^S[AP]US4.* /point/metar/Raw # AWIPS1: TEXT ^S[AP]U[CEMW]6.* /point/metar/Raw