Issue #2176 Implemented emergency warning products.

Change-Id: Icde169adbcfc5c409319649d63d222044a35dae2

Former-commit-id: 46d5bd4f0a [formerly c62de0d75f] [formerly 7d74ba5ee1] [formerly 67ce90c14a [formerly 7d74ba5ee1 [formerly 36df6339cc00afc5935746a4a47b0e9e8c641f85]]]
Former-commit-id: 67ce90c14a
Former-commit-id: 5fed586cc6728d3bc60caa721d6692540f8131c5 [formerly 4b38e3786d]
Former-commit-id: a9fccb3e9d
This commit is contained in:
Jonathan Sanchez 2013-07-25 13:47:44 -05:00
parent d20b7f17c0
commit 04db8f74f2
10 changed files with 833 additions and 352 deletions

View file

@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.site;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
com.raytheon.uf.viz.localization,
com.raytheon.uf.common.auth;bundle-version="1.12.1174"
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.warning;bundle-version="1.12.1174"
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.viz.texteditor,
com.raytheon.viz.texteditor.alarmalert.dialogs,

View file

@ -0,0 +1,196 @@
/**
* 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.viz.texteditor.dialogs;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
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.WarningRecord.WarningAction;
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.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.texteditor.util.VtecObject;
import com.raytheon.viz.texteditor.util.VtecUtil;
/**
* Produces the product message and mode message for the warngen confirmation
* dialog for emergency warnings.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 23, 2013 2176 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class EmergencyConfirmationMsg implements IWarnGenConfirmationable {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(EmergencyConfirmationMsg.class);
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)
*/
private class ActiveTableRecordComparator implements
Comparator<ActiveTableRecord> {
@Override
public int compare(ActiveTableRecord o1, ActiveTableRecord o2) {
return o1.getIssueTime().compareTo(o2.getIssueTime());
}
}
@Override
public boolean checkWarningInfo(String header, String body, String nnn) {
VtecObject vtec = VtecUtil.parseMessage(body);
EmergencyType type = null;
WarningAction action = null;
if (vtec != null) {
type = EmergencyType.valueOf(vtec.getPhensig());
action = WarningAction.valueOf(vtec.getAction());
if (action == WarningAction.CAN && body.split("\\$\\$").length > 2) {
// It is possible for a warning products to have two segments: a
// CAN and a CON.'$$' denotes the end of one segment. VtecUtil
// only grabs the first VTEC. If there are multiple segments CAN
// should always be the first VTEC
action = WarningAction.CANCON;
}
}
// Check if the warning product is a valid EmergencyType.
if (type != null) {
boolean currentEmergency = body.contains("EMERGENCY");
if (action == WarningAction.NEW && currentEmergency) {
// Only occurs when the warning is first issued and not any
// other action
productMessage = "This is a " + type.value;
} else if (action == WarningAction.CON
|| action == WarningAction.EXT
|| action == WarningAction.CANCON) {
// Check if the warning was an upgrade or downgrade in the
// emergency warning for continuation, extension (FFW), or a
// cancel
// and continuation.
GetActiveTableRequest request = new GetActiveTableRequest();
if (CAVEMode.getMode().equals(CAVEMode.PRACTICE)) {
request.setMode(ActiveTableMode.PRACTICE);
} else {
request.setMode(ActiveTableMode.OPERATIONAL);
}
request.setSiteID(vtec.getOffice());
request.setPhensigList(vtec.getPhensig());
request.setEtn(String.format("%04d", vtec.getSequence()));
try {
GetActiveTableResponse response = (GetActiveTableResponse) ThriftClient
.sendRequest(request);
List<ActiveTableRecord> records = response.getActiveTable();
// There should be existing records since this is for follow
// ups. This is just a precaution
if (records != null && !records.isEmpty()) {
// Get latest active table record
Collections.sort(records,
new ActiveTableRecordComparator());
ActiveTableRecord record = records
.get(records.size() - 1);
boolean wasEmergency = record.getRawmessage().contains(
"EMERGENCY");
if (!wasEmergency && currentEmergency) {
productMessage = "This is an upgrade of a "
+ type.value;
} else if (wasEmergency && !currentEmergency) {
productMessage = "This is a downgrade of a "
+ type.value;
}
}
} catch (VizException e) {
statusHandler.handle(Priority.ERROR,
"Error making request to active table.");
}
}
}
return productMessage == null;
}
@Override
public String getTitle() {
return "Severe Weather Product";
}
@Override
public String getProductMessage() {
return productMessage;
}
@Override
public String getModeMessage() {
return "Should we proceed?\n";
}
}

View file

@ -0,0 +1,67 @@
/**
* 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.viz.texteditor.dialogs;
/**
* Interface to retrieve the WarnGen Confirmation Dialog message values.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 23, 2013 2176 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public interface IWarnGenConfirmationable {
/**
* Returns true if the WarnGen Confirmation Dialog needs to pop-up.
*
* @param header
* @param body
* @param nnn
* @return
*/
public boolean checkWarningInfo(String header, String body, String nnn);
/**
*
* @return the title for the WarnGen Confirmation Dialog
*/
public String getTitle();
/**
*
* @return the product message in the WarnGen Confirmation Dialog
*/
public String getProductMessage();
/**
*
* @return the mode message in the WarnGen Confirmation Dialog
*/
public String getModeMessage();
}

View file

@ -0,0 +1,66 @@
/**
* 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.viz.texteditor.dialogs;
import com.raytheon.viz.texteditor.qc.QualityControl;
/**
* Produces the product message and mode message for the warngen confirmation
* dialog for warnings failing QC.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 23, 2013 2176 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class QCConfirmationMsg implements IWarnGenConfirmationable {
private QualityControl qcCheck = new QualityControl();
@Override
public boolean checkWarningInfo(String header, String body, String nnn) {
return qcCheck.checkWarningInfo(header, body, nnn);
}
@Override
public String getTitle() {
return "Problem Detected by QC";
}
@Override
public String getProductMessage() {
return qcCheck.getErrorMessage();
}
@Override
public String getModeMessage() {
return "Do you really want to Send?\n";
}
}

View file

@ -0,0 +1,102 @@
/**
* 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.viz.texteditor.dialogs;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.texteditor.qc.QualityControl;
/**
* Produces the product message and mode message for the warngen confirmation
* dialog for sending a warning.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 23, 2013 2176 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class SendConfirmationMsg implements IWarnGenConfirmationable {
private String title;
private boolean resend;
private String afosId;
public SendConfirmationMsg(boolean resend, String afosId, String nnn) {
this.resend = resend;
this.afosId = afosId;
title = QualityControl.getProductWarningType(nnn);
}
@Override
public boolean checkWarningInfo(String header, String body, String nnn) {
return true;
}
@Override
public String getTitle() {
return title;
}
@Override
public String getProductMessage() {
StringBuilder productMessage = new StringBuilder();
if (resend) {
productMessage.append("You are about to RESEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
} else {
productMessage.append("You are about to SEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
}
return productMessage.toString();
}
@Override
public String getModeMessage() {
CAVEMode mode = CAVEMode.getMode();
StringBuilder modeMessage = new StringBuilder();
modeMessage.append("The workstation is in ").append(mode)
.append(" mode.");
if (resend) {
modeMessage.append("\nThere is no QC check for resend product.");
}
Pattern p = Pattern.compile(".\\%[s].");
Matcher m = p.matcher(TextEditorDialog.STORED_SENT_MSG);
boolean result = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
.equals(mode));
modeMessage.append(result ? m.replaceAll(" ") : m.replaceAll(" not "));
return modeMessage.toString();
}
}

View file

@ -85,8 +85,8 @@ import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.FontMetrics;
@ -100,7 +100,6 @@ import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
@ -142,7 +141,6 @@ import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.edex.decodertools.time.TimeTools;
import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport;
import com.raytheon.uf.edex.wmo.message.WMOHeader;
// import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.auth.UserController;
import com.raytheon.uf.viz.core.exception.VizException;
@ -176,7 +174,6 @@ import com.raytheon.viz.texteditor.msgs.ITextEditorCallback;
import com.raytheon.viz.texteditor.msgs.IWmoBrowserCallback;
import com.raytheon.viz.texteditor.notify.NotifyExpiration;
import com.raytheon.viz.texteditor.print.PrintDisplay;
import com.raytheon.viz.texteditor.qc.QualityControl;
import com.raytheon.viz.texteditor.scripting.dialogs.IScriptEditor;
import com.raytheon.viz.texteditor.scripting.dialogs.IScriptEditorObserver;
import com.raytheon.viz.texteditor.scripting.dialogs.ScriptEditorDialog;
@ -191,6 +188,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.dialogs.SWTMessageBox;
// import com.raytheon.uf.viz.core.RGBColors;
/**
* Main Text Editor dialog.
*
@ -328,6 +327,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* *.xml files in localization;
* add selection listener to catch the highlight words and
* set the highlight colors.
* 23Jul2013 2176 jsanchez Added a new confirmation message for emergency warnings.
*
* </pre>
*
@ -378,8 +378,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
private final int HIGHLIGHT_BG = SWT.COLOR_RED;
// Color red = shell.getDisplay().getSystemColor(SWT.COLOR_RED);
// Color black = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
// Color red = shell.getDisplay().getSystemColor(SWT.COLOR_RED);
// Color black = shell.getDisplay().getSystemColor(SWT.COLOR_BLACK);
/**
* The length of BEGIN_ELEMENT_TAG.
@ -791,7 +791,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* Small font menu item.
*/
// private MenuItem smallFontItem;
// private MenuItem smallFontItem;
/**
* Medium font menu item.
@ -801,7 +801,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* Large font menu item.
*/
// private MenuItem largeFontItem;
// private MenuItem largeFontItem;
/**
* Overstrike (overwrite) menu item.
@ -1384,12 +1384,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
private boolean isPreviousLineWrapped;
private Color textForeground;
private Color textBackground;
private Color highlightForeground;
private Color highlightBackground;
// protected Color color;
// protected Color color;
/**
* Constructor with additional cave style rules
@ -2979,7 +2981,8 @@ 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();
int selectFontSize = ((SizeButtonCfg) item.getData())
.getFontSize();
setDefaultFont(selectFontSize);
textEditor.setFont(dftFont);
@ -3835,7 +3838,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
textEditor.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
System.out.println("\ntextEditor default selection event --" + e.toString());
System.out.println("\ntextEditor default selection event --"
+ e.toString());
}
@Override
@ -4056,7 +4060,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
if( textElm.getColor() == null ) {
if (textElm.getColor() == null) {
message.append("Item \"color\" data enter problem!\n");
}
@ -4078,30 +4082,35 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
for (TextColorElement textElm : clrCfg.getTextColorElements()) {
String paramName = textElm.getParamName().trim();
if( paramName.equalsIgnoreCase("textBG")) {
if ( textElm.getColor() != null)
textBackground = new Color(shell.getDisplay(), textElm.getColor());
if (paramName.equalsIgnoreCase("textBG")) {
if (textElm.getColor() != null)
textBackground = new Color(shell.getDisplay(),
textElm.getColor());
else
textBackground = shell.getDisplay().getSystemColor(UPDATE_BG);
textBackground = shell.getDisplay().getSystemColor(
UPDATE_BG);
}
else if( paramName.equalsIgnoreCase("textFG")) {
if ( textElm.getColor() != null)
textForeground = new Color(shell.getDisplay(), textElm.getColor());
} else if (paramName.equalsIgnoreCase("textFG")) {
if (textElm.getColor() != null)
textForeground = new Color(shell.getDisplay(),
textElm.getColor());
else
textForeground = shell.getDisplay().getSystemColor(UPDATE_FG);
}
else if( paramName.equalsIgnoreCase("highlightBG")) {
if ( textElm.getColor() != null)
highlightBackground = new Color(shell.getDisplay(), textElm.getColor());
textForeground = shell.getDisplay().getSystemColor(
UPDATE_FG);
} else if (paramName.equalsIgnoreCase("highlightBG")) {
if (textElm.getColor() != null)
highlightBackground = new Color(shell.getDisplay(),
textElm.getColor());
else
highlightBackground = shell.getDisplay().getSystemColor(HIGHLIGHT_BG);
}
else if( paramName.equalsIgnoreCase("highlightFG")) {
if ( textElm.getColor() != null)
highlightForeground = new Color(shell.getDisplay(), textElm.getColor());
highlightBackground = shell.getDisplay().getSystemColor(
HIGHLIGHT_BG);
} else if (paramName.equalsIgnoreCase("highlightFG")) {
if (textElm.getColor() != null)
highlightForeground = new Color(shell.getDisplay(),
textElm.getColor());
else
highlightForeground = shell.getDisplay().getSystemColor(UPDATE_FG);
highlightForeground = shell.getDisplay().getSystemColor(
UPDATE_FG);
}
}
@ -4967,47 +4976,31 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* true if product is to be resent
*/
synchronized private void sendProduct(final boolean resend) {
final CAVEMode mode = CAVEMode.getMode();
StdTextProduct prod = getStdTextProduct();
String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid();
final String title = QualityControl.getProductWarningType(prod
.getNnnid());
final StringBuilder productMessage = new StringBuilder();
final StringBuilder modeMessage = new StringBuilder();
modeMessage.append("The workstation is in ").append(mode)
.append(" mode.");
if (resend) {
productMessage.append("You are about to RESEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
modeMessage.append("\nThere is no QC check for resend product.");
} else if (warnGenFlag) {
productMessage.append("You are about to SEND a " + afosId + "\n");
productMessage.append(title).append(".\n");
QualityControl qcCheck = new QualityControl();
if (qcCheck.checkWarningInfo(headerTF.getText().toUpperCase(),
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
if (warnGenFlag) {
QCConfirmationMsg qcMsg = new QCConfirmationMsg();
if (!qcMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
textEditor.getText().toUpperCase(), prod.getNnnid())) {
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
"Problem Detected by QC", qcCheck.getErrorMessage(),
"Do you really want to Send?\n", mode);
qcMsg.getTitle(), qcMsg.getProductMessage(),
qcMsg.getModeMessage());
wgcd.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue))
finishSendProduct(resend, title, mode,
productMessage, modeMessage);
if (Boolean.TRUE.equals(returnValue)) {
checkEmergencyProduct(resend);
}
}
});
wgcd.open();
return;
} else {
checkEmergencyProduct(resend);
}
} else {
finishSendProduct(resend);
}
finishSendProduct(resend, title, mode, productMessage, modeMessage);
}
/**
@ -5016,21 +5009,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* the WarnGen being sent.
*
* @param resend
* @param title
* @param mode
* @param productMessage
* @param modeMessage
*/
private void finishSendProduct(final boolean resend, String title,
CAVEMode mode, StringBuilder productMessage,
StringBuilder modeMessage) {
Pattern p = Pattern.compile(".\\%[s].");
Matcher m = p.matcher(STORED_SENT_MSG);
final boolean result = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
.equals(mode));
modeMessage.append(result ? m.replaceAll(" ") : m.replaceAll(" not "));
private void finishSendProduct(final boolean resend) {
if (statusBarLabel.getText().startsWith("Attachment:")) {
StringBuilder sb = new StringBuilder("An Attachment file (");
int startIndex = "Attachment:".length() + 1;
@ -5053,21 +5033,58 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
if (!verifyRequiredFields()) {
return;
}
StdTextProduct prod = getStdTextProduct();
String afosId = prod.getCccid() + prod.getNnnid() + prod.getXxxid();
SendConfirmationMsg sendMsg = new SendConfirmationMsg(resend, afosId,
prod.getNnnid());
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell, title,
productMessage.toString(), modeMessage.toString(), mode);
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
sendMsg.getTitle(), sendMsg.getProductMessage(),
sendMsg.getModeMessage());
wgcd.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue)) {
warngenCloseCallback(resend, result);
warngenCloseCallback(resend);
}
}
});
wgcd.open();
}
/**
* Checks if the product is a emergency warning product and opens up the
* WarnGen Confirmation Dialog if necessary.
*
* @param resend
* true if product is to be resent
*/
private void checkEmergencyProduct(final boolean resend) {
StdTextProduct prod = getStdTextProduct();
EmergencyConfirmationMsg emergencyMsg = new EmergencyConfirmationMsg();
if (emergencyMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
emergencyMsg.getTitle(), emergencyMsg.getProductMessage(),
emergencyMsg.getModeMessage());
wgcd.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue)) {
finishSendProduct(resend);
}
}
});
wgcd.open();
} else {
finishSendProduct(resend);
}
}
/**
* This is used by finishedSendProduct as the call back to the warnGen
* confirmaiton Dialog.
@ -5075,10 +5092,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* @param resend
* @param result
*/
private void warngenCloseCallback(boolean resend, boolean isOperational) {
private void warngenCloseCallback(boolean resend) {
// DR14553 (make upper case in product)
String body = textEditor.getText().toUpperCase();
CAVEMode mode = CAVEMode.getMode();
boolean isOperational = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
.equals(mode));
if (isOperational) {
removeOptionalFields();
@ -5781,7 +5801,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
finish = textEditor.getCharCount() - 1;
}
// Set the content of the header block to consist of just the header of
// Set the content of the header block to consist of just the header
// of
// the text product... it will get reunited with the body when it is
// saved.
if (finish > start) {

View file

@ -71,7 +71,7 @@ public class WarnGenConfirmationDlg extends CaveSWTDialog {
private String IMAGE_PRACTICE = "res/images/twsPractice.gif";
protected WarnGenConfirmationDlg(Shell parentShell, String title,
String productMessage, String modeMessage, CAVEMode mode) {
String productMessage, String modeMessage) {
super(parentShell, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL, CAVE.NONE
| CAVE.DO_NOT_BLOCK);
@ -79,7 +79,7 @@ public class WarnGenConfirmationDlg extends CaveSWTDialog {
this.productMessage = productMessage;
this.modeMessage = modeMessage;
this.mode = mode;
this.mode = CAVEMode.getMode();
setReturnValue(Boolean.FALSE);
}

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* ------------ ---------- ----------- --------------------------
* Initial creation
* May 7, 2013 1973 rferrel Changes to properly display Issue Time.
* Jul 22, 2013 2176 jsanchez Added EMER to the display string in the update list.
*
* </pre>
*
@ -92,6 +93,9 @@ public class FollowupData extends WarningRecord {
rval.append(buildExpStr(status, record));
}
if (record.getRawmessage().contains("EMERGENCY")) {
rval.append(" EMER");
}
equvialentString = rval.substring(0,
record.getProductClass().equals("T") ? 20 : 18);

View file

@ -72,6 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
* May 10, 2013 1951 rjpeter Updated ugcZones references
* May 31, 2013 DR 16264 D. Friedman Fix query in prepare method.
* Jun 05, 2013 DR 16279 D. Friedman Fix updating of issuance time for followups.
* Jul 22, 2013 2176 jsanchez Set the raw message for an EXT.
* </pre>
*
* @author mschenke
@ -312,6 +313,7 @@ public class CurrentWarnings {
if (rval != null) {
rval.setEndTime(warning.getEndTime());
rval.setIssueTime(warning.getIssueTime());
rval.setRawmessage(warning.getRawmessage());
}
}
}

View file

@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Apr 18, 2013 1877 jsanchez Had the child classes set the comparator. Fixed a null pointer.
* 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.
* </pre>
*
* @author jsanchez
@ -358,14 +359,23 @@ public abstract class AbstractWWAResource extends
}
if (entry != null && entry.wireframeShape != null) {
LineStyle lineStyle = (record.getProductClass() != null && record
.getProductClass().equals("T")) ? LineStyle.DASHED
: LineStyle.SOLID;
LineStyle lineStyle = LineStyle.SOLID;
if (record.getProductClass() != null
&& record.getProductClass().equals("T")) {
lineStyle = LineStyle.DASHED;
}
int outlineWidth = getCapability(OutlineCapability.class)
.getOutlineWidth();
// Make wire frame outline thicker for EMERGENCY warnings
if (record.getRawmessage().contains("EMERGENCY")) {
outlineWidth *= 2;
}
target.drawWireframeShape(
entry.wireframeShape,
getCapability(ColorableCapability.class).getColor(),
getCapability(OutlineCapability.class)
.getOutlineWidth(), lineStyle);
outlineWidth, lineStyle);
} else if (entry != null && entry.shadedShape != null) {
target.drawShadedShape(entry.shadedShape, 1);
}
@ -409,6 +419,14 @@ public abstract class AbstractWWAResource extends
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);
}
}
}
}
@ -581,7 +599,11 @@ public abstract class AbstractWWAResource extends
}
textToPrint[0] += "." + record.getEtn();
if (record.getRawmessage().contains("EMERGENCY")) {
textToPrint[1] = record.getPil() + " EMER";
} else {
textToPrint[1] = record.getPil();
}
SimpleDateFormat startFormat = DEFAULT_FORMAT;
SimpleDateFormat endFormat = DEFAULT_FORMAT;