13.2.1-1 baseline

Former-commit-id: 8dd688c878 [formerly 5dfe4d10f1] [formerly e62172c8c7] [formerly 8dd688c878 [formerly 5dfe4d10f1] [formerly e62172c8c7] [formerly 81849e3cbb [formerly e62172c8c7 [formerly 30d12654dea302c2bb0546edcb3b7ddd04ddd046]]]]
Former-commit-id: 81849e3cbb
Former-commit-id: 3d35fd52d5 [formerly e34695538d] [formerly c835df6c612355b23abcc04a384d5b398d1c5ec6 [formerly 8713dfc5ca]]
Former-commit-id: d5a28dcde502767d0f84d7301207580849e0a584 [formerly ebff2a6275]
Former-commit-id: b4556ea28f
This commit is contained in:
Steve Harris 2013-01-14 18:42:21 -05:00
parent 32c48861de
commit e5f32a2bbe
83 changed files with 1590 additions and 668 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -25,22 +25,7 @@
menuText="Convective SIGMET" id="ConvSigmet">
<dataURI>/convsigmet/%</dataURI>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml" menuText="NCWF" id="NCWF">
<dataURI>/bufrncwf/%</dataURI>
</contribute>
<contribute xsi:type="subMenu" menuText="CCFP">
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="2 Hour" id="CCFP2HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="7200"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="4 Hour" id="CCFP4HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="14400"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="6 Hour" id="CCFP6HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="21600"/>
</contribute> </contribute>
<contribute xsi:type="separator" id="separator1"/>
<contribute xsi:type="titleItem" titleText="------ Icing Products ------" />

View file

@ -35,6 +35,7 @@
<ImmediateCause>DM \ DAM FAILURE</ImmediateCause>
<ImmediateCause>DM \ DAM BREAK</ImmediateCause>
<ImmediateCause>RS \ RAIN AND SNOW MELT</ImmediateCause>
<ImmediateCause>RS \ RAIN AND MELTING SNOW</ImmediateCause>
<productTypeMap>
<item>
<key>FFW</key>

View file

@ -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.
*
* </pre>
*
@ -738,6 +740,8 @@ public class AlertVisConfigDlg extends Dialog implements
}
setSourceColor(s, item);
sourcesList.update();
setNewConfig();
} catch (Exception e) {
Container
.logInternal(

View file

@ -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.
*
* </pre>
*
* @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);

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="CCFP">
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="4 Hour" id="CCFP4HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="14400"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="6 Hour" id="CCFP6HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="21600"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Ccfp.xml" menuText="8 Hour" id="CCFP8HOUR">
<dataURI>/ccfp/%</dataURI>
<substitute key="validDuration" value="28800"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuContributionFile>
<include installTo="menu:ncepHydro?after=AWC"
fileName="menus/ccfp/baseCCFP.xml"/>
</menuContributionFile>

View file

@ -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
*
* </pre>
*
@ -74,15 +78,18 @@ import com.vividsolutions.jts.geom.Point;
public class CcfpResource extends
AbstractVizResource<CcfpResourceData, MapDescriptor> {
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;
}

View file

@ -430,6 +430,15 @@
name="xxx"
visible="true">
</separator>
<command
commandId="com.raytheon.viz.ui.actions.titleAction"
id="AWC"
label="------ AWC ------">
</command>
<separator
name="xxx"
visible="true">
</separator>
<command id="HYDRO"
commandId="com.raytheon.viz.ui.actions.titleAction"
label="------ Hydro ------">

View file

@ -45,7 +45,7 @@
<Method name="Alias">
<Field abbreviation="PC"/>
</Method>
<Method name="Or" models="ETA GFS212">
<Method name="Or" models="ETA GFS212 GFS201 GFS160 GFS161 GFS254">
<Field abbreviation="TP6hr"/>
<Field abbreviation="TP12hr"/>
</Method>

View file

@ -25,6 +25,9 @@
<Method name="Alias" models="ECMWF-HiRes">
<Field abbreviation="TP_ECMWF"/>
</Method>
<Method name="ModelRun">
<Field abbreviation="TP"/>
</Method>
<Method name="ModelRun">
<Field abbreviation="TP1hr"/>
</Method>

View file

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

View file

@ -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
*
* </pre>
*
* @author lvenable
@ -235,7 +237,7 @@ public class SiteMonitor implements IRequestCompleteListener<Map<?, ?>> {
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));

View file

@ -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
* </pre>
*
* @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() {

View file

@ -143,6 +143,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
* 11/26/2012 1298 rferrel Non-blocking dialog cleanup.
* 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
*
* </pre>
*
* @author grichard
@ -753,7 +755,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);

View file

@ -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
*
* </pre>
*
@ -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"));
}
}

View file

@ -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
* </pre>
*
* @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;
}

View file

@ -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.
*
* </pre>
*
@ -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("");
}

View file

@ -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
* </pre>
*
* @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);

View file

@ -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
*
* </pre>
*
@ -226,6 +230,26 @@ public class ISCRequestReplyDlg extends CaveSWTDialog {
this.xml = (String) response[0];
this.weList = (List<String>) 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<Object[]> 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<String, Map<String, List<Map<String, String>>>>) response[2];
serverDictT2S = (Map<String, Map<String, String>>) response[4];

View file

@ -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).
*
*
* <pre>
*
*
* 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.
*
* </pre>
*
*
* @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<String, Map<String, RGB>> discreteParmToColorMap = new HashMap<String, Map<String, RGB>>();
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<String, DiscreteColorTable> 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, DiscreteColorTable>();
}
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<String> 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<String, DiscreteColorTable> discreteColorTable;
public static List<ImageAttr> 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);
}

View file

@ -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
*
*
* <pre>
* 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
*
* </pre>
*
*
* @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)
@ -396,7 +427,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
@ -517,6 +548,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
true);
dstring.setText(truncatedLabel, seColorBarTextColor);
dstring.setCoordinates(labelLoc, center);
dstring.font = colorbarResource.getColorbarWxLabelFont();
target.drawStrings(dstring);
}
}
@ -526,7 +558,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
@ -626,7 +658,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
/*
* (non-Javadoc)
*
*
* @see
* com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#getValueAt(double[],
* int)

View file

@ -35,7 +35,7 @@
</loadProperties>
<properties isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
</properties>
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
<resourceData xsi:type="gridResourceData" customLegend="${customLegend}" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
<metadataMap>
<mapping key="info.parameter.abbreviation">
<constraint constraintValue="${param}" constraintType="EQUALS"/>

View file

@ -37,26 +37,32 @@
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Prob > 0.1 inch" id="probGt01Inch">
<substitute key="param" value="PQPF23hr"/>
<substitute key="customLegend" value="0-3hr. Probability of Rain > 0.1in."/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Prob > 0.5 inch" id="probGt05Inch">
<substitute key="param" value="PQPF33hr"/>
<substitute key="customLegend" value="0-3hr. Probability of Rain > 0.5in."/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Prob > 1.0 inch" id="probGt1Inch">
<substitute key="param" value="PQPF53hr"/>
<substitute key="customLegend" value="0-3hr. Probability of Rain > 1.0in."/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Prob > 2.0 inch" id="probGt2Inch">
<substitute key="param" value="PQPF63hr"/>
<substitute key="customLegend" value="0-3hr. Probability of Rain > 2.0in."/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Rainfall (inch)" id="rainfall">
<substitute key="param" value="SCQP3hr"/>
<substitute key="customLegend" value="0-3hr. Rainfall Amount"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/hydro/zeroToThreeHourRadarQPF.xml"
menuText="0-3hr Prob CG Lightning" id="probCGLightning">
<substitute key="param" value="PVORT3hr"/>
<substitute key="customLegend" value="0-3hr. CG Lightning Probability"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -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<Integer> dataPtList = new ArrayList<Integer>();
int dataIndex = 0;
int zoomDataIndex=0;
ArrayList<Integer> al = new ArrayList<Integer>();
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++) {

View file

@ -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
*
*
* </pre>
@ -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<Double> 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<Object[]> 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<Object[]> results = null;
try {
results = (ArrayList<Object[]>)DirectDbQuery.executeQuery(RATING_SHIFT_QUERY, HydroConstants.IHFS, QueryLanguage.SQL);
results = (ArrayList<Object[]>)DirectDbQuery.executeQuery(RATING_SHIFT_QUERY.replace(":lid", lid), HydroConstants.IHFS, QueryLanguage.SQL);
} catch (VizException e) {
e.printStackTrace();
} catch (NullPointerException e) {

View file

@ -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
*
* </pre>
*
@ -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";
}
}

View file

@ -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.
*
* </pre>
*
@ -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),

View file

@ -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
* </pre>
*
* @author randerso
@ -789,8 +790,16 @@ public class XmrgResource extends
break;
case Index:
List<MPERadarLoc> radars= MPEDataManager.getInstance().getRadars();
for (int k=dmPref.getEntries().size();k<radars.size()+2;k++){
DataMappingEntry dme = new DataMappingEntry();
dme.setPixelValue((double) (k));
dme.setDisplayValue(Double.MAX_VALUE);
dmPref.addEntry(dme);
}
int j = 2;
for (MPERadarLoc radar : MPEDataManager.getInstance().getRadars()) {
for (MPERadarLoc radar : radars) {
dmPref.getEntries().get(j++).setLabel(radar.getId());
}
while (j < dmPref.getEntries().size()) {

View file

@ -55,6 +55,7 @@ import com.raytheon.viz.mpe.core.MPEDataManager.MPEGageData;
* ------------ ---------- ----------- --------------------------
* Oct 30, 2008 snaples Initial creation
* Aug 8, 2012 15271 snaples Updated hourly slot
* Jan 02, 2013 15565 snaples Fixed problem with wrong time being sent to mpe_fieldgen
* </pre>
*
* @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;

View file

@ -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.
*
* </pre>
*
@ -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<String, RequestConstraint> rcMap = null;
private Map<Long, Map<String, PrecipData>> cache3 = new HashMap<Long, Map<String, PrecipData>>();
private final Map<Long, Map<String, PrecipData>> cache3 = new HashMap<Long, Map<String, PrecipData>>();
private Map<Long, Map<String, PrecipData>> cache6 = new HashMap<Long, Map<String, PrecipData>>();
private final Map<Long, Map<String, PrecipData>> cache6 = new HashMap<Long, Map<String, PrecipData>>();
private Map<DataTime, Set<String>> baseStations = new HashMap<DataTime, Set<String>>();
private final Map<DataTime, Set<String>> baseStations = new HashMap<DataTime, Set<String>>();
public MetarPrecipDataContainer(int duration,
Map<String, RequestConstraint> rcMap) {
@ -148,15 +148,19 @@ public class MetarPrecipDataContainer {
if (duration == 1) {
PointDataContainer pdc = requestPointData(rcMap, validTime, 1,
P1_KEY);
Map<String, PrecipData> precipMap1 = null;
if (pdc != null) {
Map<String, PrecipData> precipMap1 = createPrecipData(pdc,
precipMap1 = createPrecipData(pdc,
validTime - ONE_HOUR, validTime, P1_KEY);
Map<String, PrecipData> 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);

View file

@ -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
*
* </pre>
*
@ -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));
}
});

View file

@ -305,6 +305,8 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 17OCT2012 1229 rferrel Changes for non-blocking SWTMessageBox.
* 05Nov2012 15560 S. Naples Added check to see if we are in edit mode before capturing keys.
* 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method
* 31Dec2012 15651 M.Gamazaychikov Added an argument to re-factored PrintDisplay.print
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method.
* </pre>
*
* @author lvenable
@ -3540,7 +3542,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
@ -4192,7 +4194,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);
}
/**
@ -4215,7 +4217,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);
@ -5141,6 +5143,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;
}
}
@ -5149,6 +5156,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) {

View file

@ -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
*
* </pre>
*
@ -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();

View file

@ -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
*
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 13, 2006 chammack Initial Creation.
*
* Jan 9, 2013 15648 ryu Fix NPE on closing color editor.
*
* </pre>
*
*
* @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();
}
}

View file

@ -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
*
*
* <pre>
*
*
* 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.
*
* </pre>
*
*
* @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();
}
}

View file

@ -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.
*
*
* <pre>
* 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.
*
* </pre>
*
*
* @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()
*/

View file

@ -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().
*
* </pre>
*
@ -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();

View file

@ -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.
*
* </pre>
*
* @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;
}

View file

@ -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();
*
* </pre>
*
@ -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<Integer> bulletIndices = new ArrayList<Integer>();
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.

View file

@ -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().
*
* </pre>
*
@ -49,7 +51,10 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
*/
@Override
public void body() {
headlines();
if (action != WarningAction.COR)
headlines();
else
super.body();
}
/**

View file

@ -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();
*
* </pre>
*
@ -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<Integer> bulletIndices = new ArrayList<Integer>();
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;
}
}

View file

@ -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.
*
* </pre>
*
@ -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...");
}

View file

@ -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.
*
* </pre>
*
@ -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<String> 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<String>();
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;

View file

@ -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)
<L>${prevCounty}</L>##
#else
${prevCounty}##
#end
#if(${prevCountyType} != ${area.areaNotation} || ${useStates} == true)
#if(${lock} == true)
<L> ${prevCountyType}</L>##
#else
${prevCountyType}##
#end
#end
#if(${useStates} == true)
#if(${lock} == true)
IN <L>#areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}</L>##
#else
IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}##
#end
#end
#else
AND ##
#if(${prevPartOfCounty.size()} > 0)
#areaFormat(${prevPartOfCounty} ${useCentralCounty} ${useExtremeCounty}) ##
#end
#if(${lock} == true)
<L>${prevCounty}</L>##
#else
${prevCounty}##
#end
#if(${prevCountyType} != ${area.areaNotation} || ${useStates} == true)
#if(${countyCount} > 1)
#if(${prevCountiesType})
#if(${lock} == true)
<L> ${prevCountiesType}</L>##
#else
${prevCountiesType}##
#end
#end
#elseif(${prevCountyType})
#if(${lock} == true)
<L> ${prevCountyType}</L>##
#else
${prevCountyType}##
#end
#end
#end
#if(${useStates} == true)
#if(${lock} == true)
IN <L>#areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}</L>##
#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)
<L>${prevCounty}</L>##
#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)
<L> ${prevCountiesType}</L>##
#else
${prevCountiesType}##
#end
#end
#elseif(${prevCountyType})
#if(${lock} == true)
<L> ${prevCountyType}</L>##
#else
${prevCountyType}##
#end
#end
#end
#if((${prevCountyType} != ${area.areaNotation} || ((${prevState} != ${area.parentRegion} || ${prevPartOfState} != ${partOfState}) && ${useStates} == true)))
#if(${lock} == true)
IN <L>#areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}</L>##
#else
IN #areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}##
#end
#end
AND ##
#if(${area.partOfArea})
#areaFormat(${area.partOfArea} ${useCentralCounty} ${useExtremeCounty}) ##
#end
#if(${lock} == true)
<L>${area.name}##
#else
${area.name}##
#end
#if(${countyCount} >= 1)
#if(${area.areasNotation})
#if(${lock} == true)
<L> ${area.areasNotation}</L>##
#else
${area.areasNotation}##
#end
#end
#elseif(${area.areaNotation})
#if(${lock} == true)
<L> ${area.areaNotation}</L>##
#else
${area.areaNotation}##
#end
#end
#if(${lock} == true)
</L>##
#else
##
#end
#if(${useStates} == true)
#if(${lock} == true)
IN <L>#areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}</L>##
#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)
<L>${area.name} ${area.areaNotation}</L>##
#else
${area.name} ${area.areaNotation}##
#end
#if(${useStates} == true)
#if(${lock} == true)
IN <L>#areaFormat(${partOfState} ${useCentralState} ${useExtremeState}) ${area.parentRegion}</L>##
#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)
<L>${prevCounty}</L>##
#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)
<L>${prevCounty} ${prevCountyType}</L>##
#else
${prevCounty} ${prevCountyType}##
#end
#if(${useStates} == true)
#if(${lock} == true)
IN <L>#areaFormat(${prevPartOfState} ${useCentralState} ${useExtremeState}) ${prevState}</L>##
#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 <L>${area.name}</L>##
#else
AND THE ${area.name}##
#end
### NO COUNTIES AND ONE INDEPENDENT CITY
#else
#if(${lock} == true)
THE <L>${area.name}</L>##
#else
THE ${area.name}##
#end
#end
#else
## MULTIPLE INDEPENDENT CITIES...LAST ITEM IN THE LIST
#if(${lock} == true)
AND THE <L>${area.name}</L>##
#else
AND THE ${area.name}##
#end
#end
#else
#if(${lock} == true)
...THE <L>${area.name}</L>##
#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 ##

View file

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

View file

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

View file

@ -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} != "")
<L>${hycType}</L> 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} != "")
<L>${hycType}</L> 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 <L>${hycType}</L> ##
#end
REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ##
#headlineLocList(${areas} true true true false)...
#headlineLocList(${areas} true true true false true)...
################################################
#################################

View file

@ -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} != "")
<L>${hycType}</L> 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} != "")
<L>${hycType}</L> 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 <L>${hycType}</L> ##
#end
REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) FOR ##
#headlineLocList(${areas} true true true false)...
#headlineLocList(${areas} true true true false true)...
################################################
#################################

View file

@ -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}...
#############

View file

@ -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} != "")
<L>${hycType}</L> 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} != "")
<L>${hycType}</L> 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 <L>${hycType}</L> ##
#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 #

View file

@ -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} != "")
<L>${hycType}</L> 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} != "")
<L>${hycType}</L> 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 <L>${hycType}</L> ##
#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 #

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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
*
* </pre>
*
@ -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);

View file

@ -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
*
* </pre>
*
@ -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

View file

@ -19,5 +19,5 @@
further_licensing_information.
-->
<requestPatterns xmlns:ns2="group">
<regex>^FAUS2[789] KKCI.*</regex>
<regex>^FAUS(2[89]|30) KKCI.*</regex>
</requestPatterns>

View file

@ -75,6 +75,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
*
* </pre>
*
* @author bphillip
@ -124,6 +127,8 @@ public class GribSpatialCache {
private FileDataList fileDataList;
private long fileScanTime = 0;
boolean shiftSubGridWest = false;
/**
* Gets the singleton instance of GribSpatialCache
@ -330,8 +335,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;
@ -340,6 +349,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.x = Math.min(Math.max(0, lowerLeftPosition.x), referenceCoverage.getNx() - 1);
lowerLeftPosition.y = Math.min(Math.max(0, lowerLeftPosition.y), referenceCoverage.getNy() - 1);
@ -592,7 +607,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;
}

View file

@ -0,0 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
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.
-->
<pointDataDbDescription>
<parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" />
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" fillValue="-9999" unit="m" />
<parameter name="stationId" queryName="location.stationId" type="STRING" />
<parameter name="dataProvider" queryName="dataProvider" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
</pointDataDbDescription>

View file

@ -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.
* </pre>
*
* @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;

View file

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

View file

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

View file

@ -19,7 +19,7 @@
further_licensing_information.
-->
<configuration>
<model name="RUC236" description="RUC 40km" />
<model name="RUC130" description="RUC 13km" />
<!-- <inventoryHint levelType="MB" nLevels="36" /> -->
<inventoryHint levelType="SFC" nLevels="1" />

View file

@ -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
*
* </pre>
*
@ -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.

View file

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

View file

@ -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
*
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 20, 2008 bclements Initial creation
* Jan 10, 2013 15648 ryu Added equals() method.
* </pre>
*
*
* @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;
}
}

View file

@ -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
*
*
* <pre>
*
*
* 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.
*
* </pre>
*
*
* @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<Color>();
@ -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<Color> colors = new ArrayList<Color>();
Color current = null;
for (Color color: this.colors) {
if (!color.equals(current)) {
colors.add(color);
current = color;
}
}
this.colors = colors;
changed = true;
}
}

View file

@ -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.
*
* </pre>
*
@ -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.
* <p>
* 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

View file

@ -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.
*
* </pre>
*
@ -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);

View file

@ -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
* </pre>
*
* @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<IDataRecord> records = new ArrayList<IDataRecord>();
@ -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

View file

@ -0,0 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
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.
-->
<pointDataDbDescription>
<parameter name="latitude" queryName="location.latitude" type="FLOAT" unit="°" />
<parameter name="longitude" queryName="location.longitude" type="FLOAT" unit="°" />
<parameter name="elevation" queryName="location.elevation" type="FLOAT" unit="m" />
<parameter name="stationName" queryName="location.stationId" type="STRING" />
<parameter name="qcType" queryName="qcType" type="STRING" />
<parameter name="dataURI" queryName="dataURI" type="STRING" />
</pointDataDbDescription>

View file

@ -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.
* </pre>
*
* @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;
}
}

View file

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

View file

@ -380,7 +380,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
@ -401,6 +401,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
@ -448,7 +452,7 @@ IDS|DDPLUS ^(SXUS2[0123]|VHVD29) KWNB (..)(..)(..)
# SHEF
IDS|DDPLUS ^(SO.{4}) (.{4}) (..)(..)(..)
FILE -overwrite -log -close -edex /data_store/SHEF/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
FILE -overwrite -log -close -edex /data_store/shef/(\3:yyyy)(\3:mm)\3/\4/\1_\2_\3\4\5_(seq).%Y%m%d%H
# AWIPS1: OTHER ^UAUS31.* /point/aircraft/Raw