From 8a0ae16a5de94b97d4fc79a8df997476736c45d6 Mon Sep 17 00:00:00 2001 From: Jonathan Sanchez Date: Thu, 5 Sep 2013 11:24:16 -0500 Subject: [PATCH] Issue #2176 Increased line width of emergency polygon and changed font for regular warning products. Change-Id: Icb5456d038a8a2fadbe10f70a2ef32c8ba1f7816 Former-commit-id: ce051787a74ebf6af58c9304a953e9acd5c3da0e [formerly ce051787a74ebf6af58c9304a953e9acd5c3da0e [formerly 61dd32d0244c9a6af8e63ed2b789cfa15d7c9539]] Former-commit-id: a57cec0ed88479f095fe434747fe54b5fc1ee8d1 Former-commit-id: ff9bac0d3bca158ca90a80bf72965425e1825617 --- .../dialogs/EmergencyConfirmationMsg.java | 46 ++----- .../texteditor/dialogs/TextEditorDialog.java | 130 ++++++++++-------- .../viz/warngen/gui/FollowupData.java | 6 +- .../viz/warnings/rsc/AbstractWWAResource.java | 41 ++++-- .../viz/warnings/rsc/WarningsResource.java | 9 +- .../viz/warnings/rsc/WatchesResource.java | 5 + .../dataplugin/warning/EmergencyType.java | 91 ++++++++++++ .../common_static/site/OAX/warngen/config.xml | 30 ---- 8 files changed, 210 insertions(+), 148 deletions(-) create mode 100644 edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/EmergencyType.java delete mode 100644 localization/localization.OAX/utility/common_static/site/OAX/warngen/config.xml diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/EmergencyConfirmationMsg.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/EmergencyConfirmationMsg.java index 52540b778c..84ea2d9712 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/EmergencyConfirmationMsg.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/EmergencyConfirmationMsg.java @@ -27,6 +27,7 @@ import com.raytheon.uf.common.activetable.ActiveTableMode; import com.raytheon.uf.common.activetable.ActiveTableRecord; import com.raytheon.uf.common.activetable.GetActiveTableRequest; import com.raytheon.uf.common.activetable.GetActiveTableResponse; +import com.raytheon.uf.common.dataplugin.warning.EmergencyType; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -48,6 +49,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 23, 2013 2176 jsanchez Initial creation + * Sep 4, 2013 2176 jsanchez Moved EmergencyType to a public class. * * * @@ -62,38 +64,6 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable { private String productMessage; - private static class EmergencyType { - - private static final EmergencyType TORNADO = new EmergencyType( - "TORNADO EMERGENCY", "TO.W"); - - private static final EmergencyType FLASH_FLOOD = new EmergencyType( - "FLASH FLOOD EMERGENCY", "FF.W"); - - private final String value; - - private final String phensig; - - private final static EmergencyType[] values = new EmergencyType[] { - TORNADO, FLASH_FLOOD }; - - private EmergencyType(String type, String phensig) { - this.value = type; - this.phensig = phensig; - } - - public static EmergencyType valueOf(String phensig) { - EmergencyType type = null; - for (EmergencyType t : values) { - if (t.phensig.equals(phensig)) { - type = t; - break; - } - } - return type; - } - }; - /** * Orders the ActiveTableRecord based on the issue time (ascending) */ @@ -126,11 +96,11 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable { // Check if the warning product is a valid EmergencyType. if (type != null) { - boolean currentEmergency = body.contains("EMERGENCY"); + boolean currentEmergency = EmergencyType.isEmergency(body); if (action == WarningAction.NEW && currentEmergency) { // Only occurs when the warning is first issued and not any // other action - productMessage = "This is a " + type.value; + productMessage = "This is a " + type.getValue(); } else if (action == WarningAction.CON || action == WarningAction.EXT || action == WarningAction.CANCON) { @@ -159,14 +129,14 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable { new ActiveTableRecordComparator()); ActiveTableRecord record = records .get(records.size() - 1); - boolean wasEmergency = record.getRawmessage().contains( - "EMERGENCY"); + boolean wasEmergency = EmergencyType.isEmergency(record + .getRawmessage()); if (!wasEmergency && currentEmergency) { productMessage = "This is an upgrade of a " - + type.value; + + type.getValue(); } else if (wasEmergency && !currentEmergency) { productMessage = "This is a downgrade of a " - + type.value; + + type.getValue(); } } } catch (VizException e) { diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java index 6ab357941e..f933aa7674 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java @@ -44,7 +44,6 @@ import java.util.Scanner; import java.util.TimeZone; import java.util.Timer; import java.util.TimerTask; -import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -331,7 +330,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox; * 25July2013 15733 GHull Read font and color prefs from TextEditorCfg. * 23Aug2013 DR 16514 D. Friedman Fix handling of completed product requests. Do not change * command history or close browser window for "update obs". - * + * 04Sep2013 2176 jsanchez Changed the order of the QC check dialogs. * * * @author lvenable @@ -2952,20 +2951,23 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, * The font size sub menu. */ private void createFontSizeSubMenu(Menu fontSizeSubMenu) { - - FontSizeCfg fontSizeCfg = TextEditorCfg.getTextEditorCfg().getFontSizeCfg(); - SizeButtonCfg seldFontBtn = TextEditorCfg.getTextEditorCfg().getSelectedFontButton(); - + + FontSizeCfg fontSizeCfg = TextEditorCfg.getTextEditorCfg() + .getFontSizeCfg(); + SizeButtonCfg seldFontBtn = TextEditorCfg.getTextEditorCfg() + .getSelectedFontButton(); + for (SizeButtonCfg buttonCfg : fontSizeCfg.getButtons()) { MenuItem item = new MenuItem(fontSizeSubMenu, SWT.RADIO); item.setText(buttonCfg.getLabelName()); - item.setSelection( false ); + item.setSelection(false); item.setData(buttonCfg); - + // if this button is the initial selection. - if( seldFontBtn.getLabelName().equals( buttonCfg.getLabelName() ) ) { + if (seldFontBtn.getLabelName().equals(buttonCfg.getLabelName())) { item.setSelection(true); - setDefaultFont( seldFontBtn.getFontSize(), seldFontBtn.getFontName() ); + setDefaultFont(seldFontBtn.getFontSize(), + seldFontBtn.getFontName()); } item.addSelectionListener(new SelectionAdapter() { @@ -2973,10 +2975,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, public void widgetSelected(SelectionEvent event) { MenuItem item = (MenuItem) event.getSource(); if (item.getSelection()) { - int selectFontSize = ( (SizeButtonCfg) item.getData()).getFontSize(); - String seldFontName = ((SizeButtonCfg) item.getData()).getFontName(); - - setDefaultFont( selectFontSize, seldFontName ); + int selectFontSize = ((SizeButtonCfg) item.getData()) + .getFontSize(); + String seldFontName = ((SizeButtonCfg) item.getData()) + .getFontName(); + + setDefaultFont(selectFontSize, seldFontName); textEditor.setFont(dftFont); headerTF.setFont(dftFont); @@ -2987,8 +2991,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } - public void setDefaultFont( int fontSize, String fontName ) { - dftFont = new Font( getDisplay(), fontName, fontSize, SWT.NORMAL); + public void setDefaultFont(int fontSize, String fontName) { + dftFont = new Font(getDisplay(), fontName, fontSize, SWT.NORMAL); } /** @@ -3723,7 +3727,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); textEditorComp = new Composite(shell, SWT.NONE); GridLayout gridLayout = new GridLayout(1, false); -// TextColorsCfg textColorCfg = null; + // TextColorsCfg textColorCfg = null; textEditorComp.setLayout(gridLayout); textEditorComp.setLayoutData(gd); @@ -3745,8 +3749,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, airportToolTip = new DefaultToolTip(textEditor, SWT.DEFAULT, true); textEditor.setKeyBinding(SWT.INSERT, SWT.NULL); // DR 7826 -// textColorCfg = getTextColorCfg(); - setDefaultTextColor( TextEditorCfg.getTextEditorCfg() ); + // textColorCfg = getTextColorCfg(); + setDefaultTextColor(TextEditorCfg.getTextEditorCfg()); textEditor.setForeground(textForeground); textEditor.setBackground(textBackground); @@ -3948,42 +3952,46 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, }); } -// private TextColorsCfg getTextColorCfg() { -// TextColorsCfg textColorsCfg = TextEditorCfg.getTextEditorCfg().getTextColorsCfg(); -// -// // Perform Sanity Checks on configuration. -// StringBuilder message = new StringBuilder(); -// -// for (TextColorElement textElm : textColorsCfg.getTextColorElements()) { -// String prmtName = textElm.getParamName(); -// if (prmtName == null) { -// message.append("Item \"paramName\" problem!\n"); -// -// } -// -// if( textElm.getColor() == null ) { -// message.append("Item \"color\" data enter problem!\n"); -// } -// -// if (message.length() > 0) { -// message.insert(0, "TextColorsCfg broblem(s): "); -// IUFStatusHandler statusHandler = UFStatus -// .getHandler(TextEditorDialog.class); -// statusHandler.handle(Priority.PROBLEM, message.toString()); -// } -// -// } -// -// return textColorsCfg; -// } + // private TextColorsCfg getTextColorCfg() { + // TextColorsCfg textColorsCfg = + // TextEditorCfg.getTextEditorCfg().getTextColorsCfg(); + // + // // Perform Sanity Checks on configuration. + // StringBuilder message = new StringBuilder(); + // + // for (TextColorElement textElm : textColorsCfg.getTextColorElements()) { + // String prmtName = textElm.getParamName(); + // if (prmtName == null) { + // message.append("Item \"paramName\" problem!\n"); + // + // } + // + // if( textElm.getColor() == null ) { + // message.append("Item \"color\" data enter problem!\n"); + // } + // + // if (message.length() > 0) { + // message.insert(0, "TextColorsCfg broblem(s): "); + // IUFStatusHandler statusHandler = UFStatus + // .getHandler(TextEditorDialog.class); + // statusHandler.handle(Priority.PROBLEM, message.toString()); + // } + // + // } + // + // return textColorsCfg; + // } - - private void setDefaultTextColor(TextEditorCfg txtClrCfg ) { - - textBackground = new Color( shell.getDisplay(), txtClrCfg.getTextBackgroundColor() ); - textForeground = new Color(shell.getDisplay(), txtClrCfg.getTextForegroundColor() ); - highlightBackground = new Color(shell.getDisplay(), txtClrCfg.getHighlightTextBackgroundColor() ); - highlightForeground = new Color(shell.getDisplay(), txtClrCfg.getHighlightTextForegroundColor() ); + private void setDefaultTextColor(TextEditorCfg txtClrCfg) { + + textBackground = new Color(shell.getDisplay(), + txtClrCfg.getTextBackgroundColor()); + textForeground = new Color(shell.getDisplay(), + txtClrCfg.getTextForegroundColor()); + highlightBackground = new Color(shell.getDisplay(), + txtClrCfg.getHighlightTextBackgroundColor()); + highlightForeground = new Color(shell.getDisplay(), + txtClrCfg.getHighlightTextForegroundColor()); } /** @@ -4858,14 +4866,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, @Override public void dialogClosed(Object returnValue) { if (Boolean.TRUE.equals(returnValue)) { - checkEmergencyProduct(resend); + finishSendProduct(resend); } } }); wgcd.open(); } else { - checkEmergencyProduct(resend); + finishSendProduct(resend); } } else { finishSendProduct(resend); @@ -4915,7 +4923,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, @Override public void dialogClosed(Object returnValue) { if (Boolean.TRUE.equals(returnValue)) { - warngenCloseCallback(resend); + checkEmergencyProduct(resend); } } }); @@ -4943,14 +4951,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, @Override public void dialogClosed(Object returnValue) { if (Boolean.TRUE.equals(returnValue)) { - finishSendProduct(resend); + warngenCloseCallback(resend); } } }); wgcd.open(); } else { - finishSendProduct(resend); + warngenCloseCallback(resend); } } @@ -5903,7 +5911,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, return; } - if (! isObsUpdated) { + if (!isObsUpdated) { if (browser != null) { browser.close(); browser = null; @@ -6097,7 +6105,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, private void postExecute(boolean hasAttachment, boolean enterEditor, boolean validExecuteCommand, String attachedFilename) { if (!this.isDisposed()) { - if (! productQueryJob.isExpectingRequests()) { + if (!productQueryJob.isExpectingRequests()) { if (hasAttachment) { statusBarLabel.setText("Attachment: " + attachedFilename); } else { diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java index 90abe1fc73..ef06609c0c 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java @@ -20,6 +20,7 @@ package com.raytheon.viz.warngen.gui; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; +import com.raytheon.uf.common.dataplugin.warning.EmergencyType; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.util.TimeUtil; @@ -39,6 +40,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Aug 7, 2013 2243 jsanchez Set all the attributes of an AbstractWarningRecord and added an expiration string. Removed calendar object. * Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. Fixed for practice mode. * Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. + * Sep 4,2013 2176 jsanchez Used EmergencyType class to identify emergency products. * * * @author rferrel @@ -96,8 +98,8 @@ public class FollowupData extends AbstractWarningRecord { rval.append(buildExpStr(status, record)); } - if (record.getRawmessage().contains("EMERGENCY")) { - rval.append(" EMER"); + if (EmergencyType.isEmergency(record.getRawmessage())) { + rval.append(" " + EmergencyType.EMER); } equvialentString = rval.substring(0, record.getProductClass().equals("T") ? 20 : 18); diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWWAResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWWAResource.java index 34424f20bd..c796d18a46 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWWAResource.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWWAResource.java @@ -15,6 +15,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; +import com.raytheon.uf.common.dataplugin.warning.EmergencyType; import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataquery.requests.RequestConstraint; @@ -80,6 +81,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory; * Remove frameAltered condition in matchesFrame. It prevented entries from being displayed. * Check if geometry is null when inspecting. * Jul 22, 2013 2176 jsanchez Updated the wire frame and text for EMERGENCY warnings. + * Sep 4, 2013 2176 jsanchez Made the polygon line width thicker and made regular text not bold. * * * @author jsanchez @@ -133,7 +135,9 @@ public abstract class AbstractWWAResource extends /** map of dataURI to a warning entry **/ protected Map entryMap; - protected IFont warningsFont; + protected IFont warningsFont = null; + + protected IFont emergencyFont = null; protected RGB color; @@ -368,8 +372,8 @@ public abstract class AbstractWWAResource extends int outlineWidth = getCapability(OutlineCapability.class) .getOutlineWidth(); // Make wire frame outline thicker for EMERGENCY warnings - if (record.getRawmessage().contains("EMERGENCY")) { - outlineWidth *= 2; + if (EmergencyType.isEmergency(record.getRawmessage())) { + outlineWidth *= 3; } target.drawWireframeShape( @@ -398,7 +402,10 @@ public abstract class AbstractWWAResource extends * paintProps.getZoomLevel() / 1000; String[] textToPrint = getText(record, mapWidth); if (warningsFont == null) { - warningsFont = target.getDefaultFont().deriveWithSize( + warningsFont = target.initializeFont(target + .getDefaultFont().getFontName(), 11, + new IFont.Style[0]); + emergencyFont = target.getDefaultFont().deriveWithSize( 11); } // DR14992: reverse the textToPrint array to plot the @@ -418,15 +425,24 @@ public abstract class AbstractWWAResource extends params.verticallAlignment = VerticalAlignment.BOTTOM; params.magnification = getCapability( MagnificationCapability.class).getMagnification(); - target.drawStrings(params); // Draws the string again to have it appear bolder - if (textToPrintReversed[2].endsWith("EMER")) { - params.setText(new String[] { "", "", "EMER", "" }, - color); - target.drawStrings(params); + if (EmergencyType.isEmergency(record.getRawmessage())) { + // moves over text to add EMER in a different font + textToPrintReversed[2] = String.format("%1$-21" + "s", + textToPrintReversed[2]); + params.setText(textToPrintReversed, color); + + DrawableString emergencyString = new DrawableString( + params); + emergencyString.font = emergencyFont; + emergencyString.setText(new String[] { "", "", + " " + EmergencyType.EMER, "" }, color); + target.drawStrings(emergencyString); } + target.drawStrings(params); + } } } @@ -598,12 +614,7 @@ public abstract class AbstractWWAResource extends textToPrint[0] += "." + vid; } textToPrint[0] += "." + record.getEtn(); - - if (record.getRawmessage().contains("EMERGENCY")) { - textToPrint[1] = record.getPil() + " EMER"; - } else { - textToPrint[1] = record.getPil(); - } + textToPrint[1] = record.getPil(); SimpleDateFormat startFormat = DEFAULT_FORMAT; SimpleDateFormat endFormat = DEFAULT_FORMAT; diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java index 206f92ce98..45a5567ffa 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java @@ -60,7 +60,8 @@ import com.vividsolutions.jts.geom.Geometry; * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * Apr 18, 2013 1877 jsanchez Ordered the records the same for update and initial load. * Removed no longer needed frameAltered. Do not set wire frame for a CAN. - * Jul 24, 2013 DR16350 mgamazaychikov Fix the problem with plotting EXP warning + * Jul 24, 2013 DR16350 mgamazaychikov Fix the problem with plotting EXP warning + * Sep 5, 2013 2176 jsanchez Disposed the emergency font. * * * @author jsanchez @@ -143,6 +144,10 @@ public class WarningsResource extends AbstractWWAResource { if (warningsFont != null) { warningsFont.dispose(); } + + if (emergencyFont != null) { + emergencyFont.dispose(); + } } @Override @@ -234,7 +239,7 @@ public class WarningsResource extends AbstractWWAResource { for (AbstractWarningRecord warnrec : recordsToLoad) { WarningAction act = WarningAction.valueOf(warnrec.getAct()); if (act == WarningAction.CON || act == WarningAction.CAN - || act == WarningAction.EXT) { + || act == WarningAction.EXT) { AbstractWarningRecord createShape = null; for (String key : entryMap.keySet()) { WarningEntry entry = entryMap.get(key); diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java index 9580cfa9e6..6b4b755a75 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java @@ -49,6 +49,7 @@ import com.vividsolutions.jts.geom.GeometryFactory; * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * May 06, 2013 1930 bsteffen Check for null in WatchesResource. * May 10, 2013 1951 rjpeter Updated ugcZones references + * Sep 5, 2013 2176 jsanchez Disposed the emergency font. * * * @author jsanchez @@ -140,6 +141,10 @@ public class WatchesResource extends AbstractWWAResource { if (warningsFont != null) { warningsFont.dispose(); } + + if (emergencyFont != null) { + emergencyFont.dispose(); + } } @Override diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/EmergencyType.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/EmergencyType.java new file mode 100644 index 0000000000..bcb1ff1d76 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/EmergencyType.java @@ -0,0 +1,91 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.dataplugin.warning; + +/** + * Helps manage and identify emergency products. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep  4, 2013  2176      jsanchez     Initial creation
+ * 
+ * 
+ * + * @author jsanchez + * @version 1.0 + */ + +public class EmergencyType { + + public static final String EMER = "EMER"; + + private static final EmergencyType TORNADO = new EmergencyType( + "TORNADO EMERGENCY", "TO.W"); + + private static final EmergencyType FLASH_FLOOD = new EmergencyType( + "FLASH FLOOD EMERGENCY", "FF.W"); + + private final String value; + + private final String phensig; + + private final static EmergencyType[] values = new EmergencyType[] { + TORNADO, FLASH_FLOOD }; + + private EmergencyType(String type, String phensig) { + this.value = type; + this.phensig = phensig; + } + + public static EmergencyType valueOf(String phensig) { + EmergencyType type = null; + for (EmergencyType t : values) { + if (t.phensig.equals(phensig)) { + type = t; + break; + } + } + return type; + } + + /** + * Checks to see if the text product is an emergency product. + * + * @param rawmessage + * @return + */ + public static boolean isEmergency(String rawmessage) { + for (EmergencyType type : values) { + if (rawmessage != null && rawmessage.contains(type.getValue())) { + return true; + } + } + return false; + } + + public String getValue() { + return value; + } + +} diff --git a/localization/localization.OAX/utility/common_static/site/OAX/warngen/config.xml b/localization/localization.OAX/utility/common_static/site/OAX/warngen/config.xml deleted file mode 100644 index 608df36aa5..0000000000 --- a/localization/localization.OAX/utility/common_static/site/OAX/warngen/config.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - OMAHA/VALLEY NE - OMAHA - EAX/KANSAS CITY,DMX/DES MOINES,BOX/BOSTON,LBF/NORTH PLATTE,PQR/PORTLAND - OMA - severethunderstorm - Flash Flood/ffw,Severe Thunderstorm/severethunderstorm,Tornado/tornado - Severe Weather Statement/SVS,Flash Flood Statement/ffs,non-convective FFW (Dam Break)/dambreak,non-convective Flash Flood Statement/dambreakffs,Areal Flood Warning/flw,Areal Flood Warning Followup/fls,Areal Flood Advisory/fla,Areal Flood Advisory Followup/flas,Special Marine Warning/smw,Marine Weather Statement (SMW Follow)/smws,Marine Weather Statement standalone/marinestatement,Short Term Forecast/shortterm,Special Weather Statement (zones)/sws - 5000 - \ No newline at end of file