13.3.1-2 baseline

Former-commit-id: df6d6f598e [formerly df6d6f598e [formerly 09fb11f28bef2c3cd8fb3bfe1b2fe88f3b30af6e]]
Former-commit-id: 3d115ed3be
Former-commit-id: e8a51dc780
This commit is contained in:
Steve Harris 2013-02-25 10:18:36 -05:00
parent 654f15be5c
commit 2a2a9e03b7
6 changed files with 193 additions and 93 deletions

View file

@ -138,6 +138,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
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.VizApp;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.notification.INotificationObserver;
@ -307,10 +308,11 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method
* 13Dec2012 1353 rferrel Change to make edit cancel message not
* dispaly the red had kill job message.
* 31Dec2012 15651 M.Gamazaychikov Added an argument to re-factored PrintDisplay.print
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method.
* 10JAN2013 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method.
* 31JAN2013 14247 D. Friedman Make spell check dialog child of editor window.
* 31JAN2013 15580 D. Friedman Prevent errors when window is disposed.
* 31JAN2013 15610 M.Gamazaychikov Added handling first line of text product which
* is not a valid WMO heading.
* </pre>
*
* @author lvenable
@ -4194,7 +4196,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
*/
private void printAllText() {
FontData fontData = textEditor.getFont().getFontData()[0];
PrintDisplay.print(textEditor.getText(), fontData, charWrapCol, statusHandler);
PrintDisplay.print(textEditor.getText(), fontData, statusHandler);
}
/**
@ -4217,7 +4219,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, charWrapCol,
PrintDisplay.print(textEditor.getSelectionText(), fontData,
statusHandler);
textEditor.setText(tmpText);
textEditor.setSelection(point);
@ -5204,6 +5206,28 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
int afosNnnLimit = 2; // first three characters is AFOS NNN
int afosXxxLimit = 5; // second three characters is AFOS XXX
/*
* DR15610 - Make sure that if the first line of the
* text product is not a WMO heading it is treated as
* part of the text body.
*/
String[] pieces = textEditor.getText().split("\r*\n", 2);
if (pieces.length > 1) {
pieces[0] += "\n"; // WMOHeader expects this
}
WMOHeader header = new WMOHeader(pieces[0].getBytes(), null);
if ( !header.isValid() ) {
headerTF.setText("");
try {
textEditor.setText(originalText);
textEditor.setEditable(true);
textEditor.setEditable(false);
} catch (IllegalArgumentException e) {
// There is no text product body, so set it to the empty string.
textEditor.setText("");
}
}
else {
// TODO FIX PARSING
// First, set the current header by assuming that it usually
@ -5283,6 +5307,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
// There is no text product body, so set it to the empty string.
textEditor.setText("");
}
}
// set editor status flags
dirty = false;
}

View file

@ -88,7 +88,7 @@ import com.raytheon.viz.core.slice.request.VerticalPointRequest.TimeDirection;
import com.raytheon.viz.skewt.SkewtDisplay;
import com.raytheon.viz.skewt.rscdata.SkewTResourceData;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.MenuLoader;
import com.raytheon.viz.ui.BundleProductLoader;
import com.raytheon.viz.ui.UiUtil;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
@ -1081,7 +1081,7 @@ public class ProductTableComp extends Composite {
Bundle b = new Bundle();
b.setDisplays(new AbstractRenderableDisplay[] { display });
Job j = new MenuLoader(b, editor);
Job j = new BundleProductLoader(editor, b);
j.schedule();
}
}

View file

@ -20,6 +20,10 @@
package com.raytheon.viz.warngen.template;
import java.awt.geom.Point2D;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@ -57,12 +61,18 @@ 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.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningConstants;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType;
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData;
import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -133,6 +143,8 @@ import com.vividsolutions.jts.io.WKTReader;
* Dec 17, 2012 15571 Qinglu Lin For hydro products, resolved issue caused by calling wkt.read(loc)
* while loc is null.
* Jan 8, 2013 15664 Qinglu Lin Appended selectedAction to handler.handle()'s argument list.
* Feb 15, 2013 15820 Qinglu Lin Added createOfficeTimezoneMap() and added logic so that localtimezone
* and secondtimezone can get correct values when warning area covers two time zones.
*
* </pre>
*
@ -167,6 +179,36 @@ public class TemplateRunner {
dateFormat.put("time", new SimpleDateFormat("HHmm"));
}
/**
* Read cwa and timezone info from officeCityTimezone.txt, and put them
* into map officeCityTimezone.
*/
public static Map<String,String> createOfficeTimezoneMap() {
Map<String,String> officeCityTimezone = new HashMap<String,String>();
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext lc = pathMgr.getContext(
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
String octz = "officeCityTimezone.txt";
String fileToRetrieve = IPathManager.SEPARATOR + WarningConstants.WARNGEN_DIR
+ IPathManager.SEPARATOR + octz;
File timezoneFile = pathMgr.getFile(lc, fileToRetrieve);
String line;
String[] splitLine;
BufferedReader timezoneReader;
try {
timezoneReader = new BufferedReader(new InputStreamReader(new FileInputStream(
timezoneFile)));
for (line = timezoneReader.readLine(); line != null; line = timezoneReader.readLine()) {
splitLine = line.trim().split("\\\\");
officeCityTimezone.put(splitLine[0].trim(),splitLine[1].trim());
}
} catch (Exception e) {
statusHandler.handle(Priority.SIGNIFICANT,
"WarnGen Error while processing data in : " + octz, e);
}
return officeCityTimezone;
}
/**
* Executes a warngen template given the polygon from the Warngen Layer and
* the Storm tracking information from StormTrackDisplay
@ -363,7 +405,22 @@ public class TemplateRunner {
}
}
Map<String, String> officeCityTimezone = createOfficeTimezoneMap();
String cityTimezone = null;
if (officeCityTimezone != null)
cityTimezone = officeCityTimezone.get(warngenLayer.getLocalizedSite());
Iterator<String> iterator = timeZones.iterator();
if (timeZones.size() > 1 && cityTimezone != null) {
String timezone;
while (iterator.hasNext()) {
timezone = iterator.next();
if (timezone.equals(cityTimezone) && context.get("localtimezone") == null) {
context.put("localtimezone", timezone);
} else if (context.get("secondtimezone") == null) {
context.put("secondtimezone", timezone);
}
}
} else {
while (iterator.hasNext()) {
if (context.get("localtimezone") == null) {
context.put("localtimezone", iterator.next());
@ -372,6 +429,7 @@ public class TemplateRunner {
}
}
}
}
// CAN and EXP products follow different rules as followups
if (!(selectedAction == WarningAction.CAN || selectedAction == WarningAction.EXP)) {

View file

@ -0,0 +1,19 @@
MSO \ M
BOI \ M
VEF \ P
PSR \ M
BIS \ C
ABR \ C
UNR \ M
LBF \ C
GLD \ M
DDC \ C
MAF \ C
MQT \ E
IWX \ E
LOT \ C
PAH \ C
LMK \ E
MRX \ E
TAE \ E
AFC \ A

View file

@ -11,7 +11,6 @@
## VERSION AWIPS II 1.5 -- MAR 2 2012 OB12.2.1-4 ##
## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
## BY QINGLU LIN 8-14-2012 DR 14493 use TMLtime ##
## BY QINGLU LIN 2-04-2013 DR 15198 Added <L></L> to ${area.name} for NEW. ##
################################################################
## Added Volcano Information in version 1.3 for sites where
## Volcanoes affect their marine zones. If sites wish to hide
@ -70,7 +69,7 @@ SPECIAL MARINE WARNING FOR...
#end
#foreach (${area} in ${areas})
##
<L>${area.name}...</L>
${area.name}...
#end
##
##

View file

@ -11,7 +11,6 @@
## VERSION AWIPS II 1.5 -- MAR 2 2012 OB12.2.1-4 ##
## BY MGAMAZAYCHIKOV -- JUL 20 2012 DR15006 ##
## BY QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
## BY QINGLU LIN 2-04-2013 DR 15198 Added <L></L> to ${area.name} for CON/CAN/(CON/CAN)/COR/EXP ##
#####################################################
## Added Volcano Information in version 1.3 for sites where
## Volcanoes affect their marine zones. If sites wish to hide
@ -88,7 +87,7 @@ THIS IS A TEST MESSAGE.##
THE AFFECTED AREAS WERE...
#foreach (${area} in ${areas})
<L>${area.name}...</L>
${area.name}...
#end
######################################################################
@ -362,7 +361,7 @@ THIS IS A TEST MESSAGE.##
FOR THE FOLLOWING AREAS...
#foreach (${area} in ${areas})
<L>${area.name}...</L>
${area.name}...
#end
## Storm current location description
@ -516,7 +515,7 @@ THIS IS A TEST MESSAGE.##
THE AFFECTED AREAS WERE...
#foreach (${area} in ${cancelareas})
<L>${area.name}...</L>
${area.name}...
#end
######################################################################
@ -778,7 +777,7 @@ THIS IS A TEST MESSAGE.##
FOR THE FOLLOWING AREAS...
#foreach (${area} in ${areas})
<L>${area.name}...</L>
${area.name}...
#end
#if(${productClass}=="T")
@ -1191,7 +1190,7 @@ THIS IS A TEST MESSAGE.##
FOR THE FOLLOWING AREAS...
#foreach (${area} in ${areas})
<L>${area.name}...</L>
${area.name}...
#end
#if(${productClass}=="T")
@ -1331,7 +1330,7 @@ WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtime
THE AFFECTED AREAS WERE...
#foreach (${area} in ${areas})
<L>${area.name}...</L>
${area.name}...
#end
######################################################################